def _calculate_emissions(emission_probs):
 emissions = dict()
 for (state, symbol) in emission_probs:
  try:
   emissions[state].append(symbol)
  except KeyError:
   emissions[state] = [symbol]
 return emissions

def _calculate_emissions ( emission_probs ) : emissions = dict ( ) for ( state , symbol ) in emission_probs : try : emissions [ state ] . append ( symbol ) except KeyError : emissions [ state ] = [ symbol ] return emissions
calculate which symbols can be emitted in each state .