docs: 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]