code: def sample_poly(self, poly, penalty_strength=1.0,
                      keep_penalty_variables=False,
                      discard_unsatisfied=False, **parameters):
          
  
          bqm = make_quadratic(poly, penalty_strength, vartype=poly.vartype)
          response = self.child.sample(bqm, **parameters)
  
          return polymorph_response(response, poly, bqm,
                                    penalty_strength=penalty_strength,
                                    keep_penalty_variables=keep_penalty_variables,
                                    discard_unsatisfied=discard_unsatisfied)
docs: Sample from the given binary polynomial.
  
          Takes the given binary polynomial, introduces penalties, reduces the
          higher-order problem into a quadratic problem and sends it to its child
          sampler.
  
          Args:
              poly (:obj:`.BinaryPolynomial`):
                  A binary polynomial.
  
              penalty_strength (float, optional): Strength of the reduction constraint.
                  Insufficient strength can result in the binary quadratic model
                  not having the same minimization as the polynomial.
  
              keep_penalty_variables (bool, optional): default is True. if False
                  will remove the variables used for penalty from the samples
  
              discard_unsatisfied (bool, optional): default is False. If True
                  will discard samples that do not satisfy the penalty conditions.
  
              **parameters: Parameters for the sampling method, specified by
              the child sampler.
  
          Returns:
              :obj:`dimod.SampleSet`