code: def sample(self, bqm, **parameters):
          child = self.child
          cutoff = self._cutoff
          cutoff_vartype = self._cutoff_vartype
          comp = self._comparison
          if cutoff_vartype is dimod.SPIN:
              original = bqm.spin
          else:
              original = bqm.binary
          new = type(bqm)(original.linear,
                          ((u, v, bias)
                           for (u, v), bias in original.quadratic.items()
                           if not comp(abs(bias), cutoff)),
                          original.offset,
                          original.vartype)
          isolated = [v for v in new if not new.adj[v]]
          new.remove_variables_from(isolated)
          if isolated and len(new) == 0:
              v = isolated.pop()
              new.linear[v] = original.linear[v]
          sampleset = child.sample(new, **parameters).change_vartype(bqm.vartype, inplace=True)
          if isolated:
              samples, variables = _restore_isolated(sampleset, bqm, isolated)
          else:
              samples = sampleset.record.sample
              variables = sampleset.variables
          vectors = sampleset.data_vectors
          vectors.pop('energy')
          return dimod.SampleSet.from_samples_bqm((samples, variables), bqm, **vectors)