<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_flags():
 """ Return a list of all flags which are set. """

    flags = unitdata.kv().getrange('reactive.states.', strip=True) or {}
    return sorted(flags.keys())