https://stackoverflow.com/questions/60208/replacements-for-switch-statement-in-python/60211#60211
def f(x): return { 'a': 1, 'b': 2, }[x]