def computeTokenTypes(tokenNames):
 if (tokenNames is None):
  return {}
 return dict(((name, type) for (type, name) in enumerate(tokenNames)))

def computeTokenTypes ( tokenNames ) : if ( tokenNames is None ) : return { } return dict ( ( ( name , type ) for ( type , name ) in enumerate ( tokenNames ) ) )
compute a dict that is an inverted index of tokennames .