<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def float_constructor(loader, node):
 """Construct Decimal from YAML float encoding."""

    s = loader.construct_scalar(node)
    if s == '.inf':
        return Decimal('Infinity')
    elif s == '-.inf':
        return -Decimal('Infinity')
    elif s == '.nan':
        return Decimal('NaN')
    return Decimal(s)