MisterAI's picture
download
raw
708 Bytes
"""Fixer that changes input(...) into eval(input(...))."""
# Author: Andre Roberge
# Local imports
from .. import fixer_base
from ..fixer_util import Call, Name
from .. import patcomp
context = patcomp.compile_pattern("power< 'eval' trailer< '(' any ')' > >")
class FixInput(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power< 'input' args=trailer< '(' [any] ')' > >
"""
def transform(self, node, results):
# If we're already wrapped in an eval() call, we're done.
if context.match(node.parent.parent):
return
new = node.clone()
new.prefix = ""
return Call(Name("eval"), [new], prefix=node.prefix)

Xet Storage Details

Size:
708 Bytes
·
Xet hash:
2e3cf0830825881723b84d3214f83be832fb9dd265f0e2bf67e2f6f565d64871

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.