code: def main(args):
      ndim = args.x_dim
      sigma = args.sigma
      width = max(0, 1 - 5 * sigma)
      centers = (np.sin(np.arange(ndim) / 2.0) * width + 1.0) / 2.0
      centers = np.ones(ndim) * 0.5
  
      def flat_loglike(theta):
          like = (
              -0.5 * (((theta - centers) / sigma) ** 2).sum()
              - 0.5 * log(2 * np.pi * sigma**2) * ndim
          )
          return like
  
      def flat_transform(x):
          return x
  
      import string
  
      paramnames = list(string.ascii_lowercase)[:ndim]
  
      if args.pymultinest:
          from pymultinest.solve import solve
  
          result = solve(
              LogLikelihood=flat_loglike,
              Prior=flat_transform,
              n_dims=ndim,
              outputfiles_basename=args.log_dir + "MN-%dd" % ndim,
              verbose=True,
              resume=True,
              importance_nested_sampling=False,
          )
  
          print()
          print("evidence: %(logZ).1f +- %(logZerr).1f" % result)
          print()
          print("parameter values:")
          for name, col in zip(
              paramnames, result["samples"].transpose()
          ):
              print(
                  "%15s : %.3f +- %.3f" % (name, col.mean(), col.std())
              )
  
      elif args.reactive:
          from ultranest.solvecompat import (
              pymultinest_solve_compat as solve,
          )
  
          result = solve(
              LogLikelihood=flat_loglike,
              Prior=flat_transform,
              n_dims=ndim,
              outputfiles_basename=args.log_dir + "RNS-%dd" % ndim,
              verbose=True,
              resume=True,
              importance_nested_sampling=False,
          )
  
          print()
          print("evidence: %(logZ).1f +- %(logZerr).1f" % result)
          print()
          print("parameter values:")
          for name, col in zip(
              paramnames, result["samples"].transpose()
          ):
              print(
                  "%15s : %.3f +- %.3f" % (name, col.mean(), col.std())
              )
  
imports: import argparse
  import numpy
  from numpy import log
label_desc: Use image node_id 1 for calling a global function with example usage: main(args) and returns: like, x