<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sample_poly(self, poly, **kwargs):
 """Sample from the binary polynomial and truncate output. Args: poly (obj:`.BinaryPolynomial`):
 A binary polynomial. **kwargs: Parameters for the sampling method, specified by the child sampler. Returns: :obj:`dimod.SampleSet` """

        tkw = self._truncate_kwargs
        if self._aggregate:
            return self.child.sample_poly(poly, **kwargs).aggregate().truncate(**tkw)
        else:
            return self.child.sample_poly(poly, **kwargs).truncate(**tkw)