code: def from_samples_bqm(cls, samples_like, bqm, **kwargs):
          samples_like = as_samples(samples_like)
          energies = bqm.energies(samples_like)
          return cls.from_samples(samples_like, energy=energies, vartype=bqm.vartype, **kwargs)