def symbol_to_token(sym):
    if isinstance(sym, yacc.YaccSymbol):
        return sym.value
    elif isinstance(sym, lex.LexToken):
        return sym
    else:
        assert False, 'Not a symbol: %r' % sym
dataset/ETHPy150Open ardekantur/pyglet/tools/wraptypes/preprocessor.py/symbol_to_token/original