<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _dstr(degrees, places=1, signed=False):
 r"""Convert floating point `degrees` into a sexagesimal string. '181deg 52\' 30.0"' '181deg 52\' 30.000"' '+181deg 52\' 30.0"' 'nan' """

    if isnan(degrees):
        return 'nan'
    sgn, d, m, s, etc = _sexagesimalize_to_int(degrees, places)
    sign = '-' if sgn < 0.0 else '+' if signed else ''
    return '%s%02ddeg %02d\' %02d.%0*d"' % (sign, d, m, s, places, etc)