'Initialize a `State` object; make & add initial transitions.
Parameters:
- `statemachine`: the controlling `StateMachine` object.
- `debug`: a boolean; produce verbose output if true (nonzero).'

def __init__(self, state_machine, debug=0):

    self.transition_order = []
    'A    list    of    transition    names    in    search    order.'
    self.transitions = {}
    '\n                                A    mapping    of    transition    names    to    3-tuples    containing\n                                (compiled_pattern,    transition_method,    next_state_name).    Initialized    as\n                                an    instance    attribute    dynamically    (instead    of    as    a    class    attribute)\n                                because    it    may    make    forward    references    to    patterns    and    methods    in    this\n                                or    other    classes.\n                                '
    self.add_initial_transitions()
    self.state_machine = state_machine
    'A    reference    to    the    controlling    `StateMachine`    object.'
    self.debug = debug
    'Debugging    mode    on/off.'
    if (self.nested_sm is None):
        self.nested_sm = self.state_machine.__class__
    if (self.nested_sm_kwargs is None):
        self.nested_sm_kwargs = {'state_classes': [self.__class__], 'initial_state': self.__class__.__name__}
