def rewrite_single_shorthand_state_decl(data):
 for (sid, states) in six.iteritems(data):
  if isinstance(states, six.string_types):
   data[sid] = {states: []}

def rewrite_single_shorthand_state_decl ( data ) : for ( sid , states ) in six . iteritems ( data ) : if isinstance ( states , six . string_types ) : data [ sid ] = { states : [ ] }
rewrite all state declarations that look like this:: state_id_decl: state .