code: def energies(self, samples_like, dtype=np.float):
          
          samples, labels = as_samples(samples_like)
  
          if all(v == idx for idx, v in enumerate(labels)):
              ldata, (irow, icol, qdata), offset = self.to_numpy_vectors(dtype=dtype)
          else:
              ldata, (irow, icol, qdata), offset = self.to_numpy_vectors(variable_order=labels, dtype=dtype)
  
          energies = samples.dot(ldata) + (samples[:, irow]*samples[:, icol]).dot(qdata) + offset
          return np.asarray(energies, dtype=dtype)
docs: Determine the energies of the given samples.
  
          Args:
              samples_like (samples_like):
                  A collection of raw samples. `samples_like` is an extension of NumPy's array_like
                  structure. See :func:`.as_samples`.
  
              dtype (:class:`numpy.dtype`):
                  The data type of the returned energies.
  
          Returns:
              :obj:`numpy.ndarray`: The energies.