code: def main(args):
      from ultranest import NestedSampler
  
      # def loglike(z):
      #    return np.array([-sum(100.0 * (x[1:] - x[:-1] ** 2.0) ** 2.0 + (1 - x[:-1]) ** 2.0) for x in z])
      def loglike_(z):
          return np.array(
              [
                  -sum(
                      100.0 * (x[1::2] - x[::2] ** 2.0) ** 2.0
                      + (1 - x[::2]) ** 2.0
                  )
                  for x in z
              ]
          )
  
      def loglike(z):
          a = np.array(
              [
                  -0.5
                  * sum(
                      [
                          ((xi - 0.83456 + i * 0.1) / 0.01) ** 2
                          for i, xi in enumerate(x)
                      ]
                  )
                  for x in z
              ]
          )
          b = np.array(
              [
                  -0.5
                  * sum(
                      [
                          ((xi - 0.43456 - i * 0.1) / 0.01) ** 2
                          for i, xi in enumerate(x)
                      ]
                  )
                  for x in z
              ]
          )
          return np.logaddexp(a, b)
  
      def transform(x):
          return 10.0 * x - 5.0
  
      import string
  
      paramnames = list(string.ascii_lowercase)[: args.x_dim]
  
      sampler = NestedSampler(
          paramnames,
          loglike,
          transform=transform,
          vectorized=True,
          log_dir=args.log_dir,
      )
      sampler.run(log_interval=20, num_live_points=args.num_live_points)
      sampler.plot()
  
imports: import os
  import sys
  import argparse
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: main(args) and returns: np, np, unknown