<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _exponent(self):
 """Return the exponent of self, as an integer. The exponent is defined as the unique integer k such that 2**(k-1) <= abs(self) < 2**k. If self is not finite and nonzero, return a string: one of '0', 'inf' or 'nan'. """

        if self and is_finite(self):
            return mpfr.mpfr_get_exp(self)

        if not self:
            return '0'
        elif is_inf(self):
            return 'inf'
        elif is_nan(self):
            return 'nan'
        else:
            assert False, "shouldn't ever get here"