<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_enum_key(key, choices):
 """ Get an enum by prefix or equality """

    if key in choices:
        return key
    keys = [k for k in choices if k.startswith(key)]
    if len(keys) == 1:
        return keys[0]