if func in("choice", "function_choice"):
// arguments of `choice` may contain complex expression,// so use indices instead of argumentsargs = list(range(len(node.args)))else:
// arguments of other functions must be literal numberassertall(type(arg) is ast.Num for arg in node.args), "Smart parameter\"s arguments must be number literals"
args = [arg.n for arg in node.args]
After Change
// we will use keys in the dict as the choices, which is generated by code_generator according to the args given by userassertlen(node.args)== 1, "Smart parameter has arguments other than dict"// check if it is a number or a string and get its value accordingly
args = [key.n iftype(key) is ast.Num else key.sfor key in node.args[0].keys]
else:
// arguments of other functions must be literal numberassertall(type(arg) is ast.Num for arg in node.args), "Smart parameter\"s arguments must be number literals"