docs: def clear_flag(flag):
      """
      Clear / deactivate a flag.
  
      :param str flag: Name of flag to set.
  
      .. note:: **Changes to flags are reset when a handler crashes.** Changes to
         flags happen immediately, but they are only persisted at the end of a
         complete and successful run of the reactive framework. All unpersisted
         changes are discarded when a hook crashes.
      """
      old_flags = get_flags()
      unitdata.kv().unset('reactive.states.%s' % flag)
      unitdata.kv().set('reactive.dispatch.removed_state', True)
      if flag in old_flags:
          tracer().clear_flag(flag)
          FlagWatch.change(flag)
          trigger = _get_trigger(None, flag)
          for flag_name in trigger['set_flag']:
              set_flag(flag_name)
          for flag_name in trigger['clear_flag']:
              clear_flag(flag_name)