# Path: charms/reactive/bus.py
# class FlagWatch(object):
#     key = 'reactive.state_watch'
# 
#     @classmethod
#     def _store(cls):
#         return unitdata.kv()
# 
#     @classmethod
#     def _get(cls):
#         return cls._store().get(cls.key, {
#             'iteration': 0,
#             'changes': [],
#             'pending': [],
#         })
# 
#     @classmethod
#     def _set(cls, data):
#         cls._store().set(cls.key, data)
# 
#     @classmethod
#     def reset(cls):
#         cls._store().unset(cls.key)
# 
#     @classmethod
#     def iteration(cls, i):
#         data = cls._get()
#         data['iteration'] = i
#         cls._set(data)
# 
#     @classmethod
#     def watch(cls, watcher, flags):
#         data = cls._get()
#         iteration = data['iteration']
#         changed = bool(set(flags) & set(data['changes']))
#         return iteration == 0 or changed
# 
#     @classmethod
#     def change(cls, flag):
#         data = cls._get()
#         data['pending'].append(flag)
#         cls._set(data)
# 
#     @classmethod
#     def commit(cls):
#         data = cls._get()
#         data['changes'] = data['pending']
#         data['pending'] = []
#         cls._set(data)
# 
# Path: charms/reactive/trace.py
# def tracer():
#     global _tracer
#     return _tracer


from charmhelpers.cli import cmdline
from charmhelpers.core import hookenv
from charmhelpers.core import unitdata
from charms.reactive.bus import FlagWatch
from charms.reactive.trace import tracer
    """
    set_flag(state, value)


@cmdline.subcommand()
@cmdline.no_output
def remove_state(state):
    """
    .. deprecated:: 0.5.0
       Alias of :func:`clear_flag`"""
    clear_flag(state)


def toggle_state(state, should_set):
    """
    .. deprecated:: 0.5.0
       Alias of :func:`toggle_flag`"""
    toggle_flag(state, should_set)


@cmdline.subcommand()
@cmdline.test_command
def is_state(state):
    """
    .. deprecated:: 0.5.0
       Alias for :func:`is_flag_set`"""
    return is_flag_set(state)


@cmdline.subcommand()

# Path: charms/reactive/bus.py
# class FlagWatch(object):
#     key = 'reactive.state_watch'
# 
#     @classmethod
#     def _store(cls):
#         return unitdata.kv()
# 
#     @classmethod
#     def _get(cls):
#         return cls._store().get(cls.key, {
#             'iteration': 0,
#             'changes': [],
#             'pending': [],
#         })
# 
#     @classmethod
#     def _set(cls, data):
#         cls._store().set(cls.key, data)
# 
#     @classmethod
#     def reset(cls):
#         cls._store().unset(cls.key)
# 
#     @classmethod
#     def iteration(cls, i):
#         data = cls._get()
#         data['iteration'] = i
#         cls._set(data)
# 
#     @classmethod
#     def watch(cls, watcher, flags):
#         data = cls._get()
#         iteration = data['iteration']
#         changed = bool(set(flags) & set(data['changes']))
#         return iteration == 0 or changed
# 
#     @classmethod
#     def change(cls, flag):
#         data = cls._get()
#         data['pending'].append(flag)
#         cls._set(data)
# 
#     @classmethod
#     def commit(cls):
#         data = cls._get()
#         data['changes'] = data['pending']
#         data['pending'] = []
#         cls._set(data)
# 
# Path: charms/reactive/trace.py
# def tracer():
#     global _tracer
#     return _tracer


# Path: charms/reactive/flags.py
from charmhelpers.cli import cmdline
from charmhelpers.core import hookenv
from charmhelpers.core import unitdata
from charms.reactive.bus import FlagWatch
from charms.reactive.trace import tracer

    """
    set_flag(state, value)


@cmdline.subcommand()
@cmdline.no_output
def remove_state(state):
    """
    .. deprecated:: 0.5.0
       Alias of :func:`clear_flag`"""
    clear_flag(state)


def toggle_state(state, should_set):
    """
    .. deprecated:: 0.5.0
       Alias of :func:`toggle_flag`"""
    toggle_flag(state, should_set)


@cmdline.subcommand()
@cmdline.test_command
def is_state(state):
    """
    .. deprecated:: 0.5.0
       Alias for :func:`is_flag_set`"""
    return is_flag_set(state)


@cmdline.subcommand()

@cmdline.test_command