docs: def discard(sample, embedding):
      """Discards the sample if broken.
  
      Args:
          sample (dict): A sample of the form {v: val, ...} where v is
              a variable in the target graph and val is the associated value as
              determined by a binary quadratic model sampler.
          embedding (dict): The mapping from the source graph to the target graph.
              Should be of the form {v: {s, ...}, ...} where v is a node in the
              source graph and s is a node in the target graph.
  
      Yields:
          dict: The unembedded sample is no chains were broken.
  
      """
      unembeded = {}
  
      for v, chain in iteritems(embedding):
          vals = [sample[u] for u in chain]
  
          if _all_equal(vals):
              unembeded[v] = vals.pop()
          else:
              return
  
      yield unembeded