code: def poly_energies(samples_like, poly):
      
      msg = ("poly_energies is deprecated and will be removed in dimod 0.9.0."
             "In the future, use BinaryPolynomial.energies")
      warnings.warn(msg, DeprecationWarning)
      # dev note the vartype is not used in the energy calculation and this will
      # be deprecated in the future
      return BinaryPolynomial(poly, 'SPIN').energies(samples_like)
docs: Calculates energy of samples from a higher order polynomial.
  
      Args:
          sample (samples_like):
              A collection of raw samples. `samples_like` is an extension of
              NumPy's array_like structure. See :func:`.as_samples`.
  
          poly (dict):
              Polynomial as a dict of form {term: bias, ...}, where `term` is a
              tuple of variables and `bias` the associated bias. Variable
              labeling/indexing of terms in poly dict must match that of the
              sample(s).
  
      Returns:
          list/:obj:`numpy.ndarray`: The energy of the sample(s).