def stringify_expr(s, local_dict, global_dict, transformations):
 tokens = []
 input_code = StringIO(s.strip())
 for (toknum, tokval, _, _, _) in generate_tokens(input_code.readline):
  tokens.append((toknum, tokval))
 for transform in transformations:
  tokens = transform(tokens, local_dict, global_dict)
 return untokenize(tokens)

def stringify_expr ( s , local_dict , global_dict , transformations ) : tokens = [ ] input_code = StringIO ( s . strip ( ) ) for ( toknum , tokval , _ , _ , _ ) in generate_tokens ( input_code . readline ) : tokens . append ( ( toknum , tokval ) ) for transform in transformations : tokens = transform ( tokens , local_dict , global_dict ) return untokenize ( tokens )
converts the string s to python code .