<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_singular(result_key):
 """ Given a result key, return in the singular form """

    if result_key.endswith('ies'):
        return re.sub('ies$', 'y', result_key)
    elif result_key.endswith('uses'):
        return re.sub("uses$", "us", result_key)
    elif result_key.endswith('addresses'):  # Special case for '*addresses'
        return result_key[:-2]
    elif result_key.endswith('s'):
        return result_key[:-1]
    else:
        return result_key