class_docstr: Inference by enumerating executions ordered by their probabilities.
  Exact (and results equivalent to Search) if all executions are enumerated.
code: def __init__(self, model, num_samples=None, **kwargs):
      if num_samples is None:
          num_samples = 100
      self.num_samples = num_samples
      self.model = model
      super().__init__(**kwargs)
  
imports: import collections
  import functools
  import queue
  import torch
  import pyro.distributions
  import pyro.poutine
  from pyro.distributions.util import logsumexp
  from pyro.infer.abstract_infer import TracePosterior
  from pyro.poutine.runtime import NonlocalExit
label_desc: Use image node_id 1 to create a new BestFirstSearch object from inherited base classes: TracePosterior with example: obj = BestFirstSearch(model, num_samples)