def _list_from_statespec(stuple):
 nval = []
 for val in stuple:
  typename = getattr(val, 'typename', None)
  if (typename is None):
   nval.append(val)
  else:
   val = str(val)
   if (typename == 'StateSpec'):
    val = val.split()
   nval.append(val)
 it = iter(nval)
 return [_flatten(spec) for spec in zip(it, it)]

def _list_from_statespec ( stuple ) : nval = [ ] for val in stuple : typename = getattr ( val , 'typename' , None ) if ( typename is None ) : nval . append ( val ) else : val = str ( val ) if ( typename == 'StateSpec' ) : val = val . split ( ) nval . append ( val ) it = iter ( nval ) return [ _flatten ( spec ) for spec in zip ( it , it ) ]
construct a list from the given statespec tuple according to the accepted statespec accepted by _format_mapdict .