code: def metropolis_hastings(proposal, target, x):
      """
      Proposal(x) -> next point. Must be symmetric.
      This is because otherwise the PDF of the proposal density is needed
      (not just a way to draw from the proposal)
      """
      import random
  
      Yt = proposal(x)
      r = min(target(Yt) / (target(x) + 1e-100), 1)
      if random.random() <= r:
          return Yt
      else:
          return x
  
label_desc: Use image node_id 1 for calling a global function with example usage: metropolis_hastings(proposal, target, x) and returns: Yt, x