def convert(self, input, filename=None):
        if self.encoding and isinstance(input, str):
            input = input.decode(self.encoding)
        self._reset(input, filename)
        buf = []
        self.before_convert(buf)
        self.parse_stmts(buf, input)
        self.after_convert(buf)
        script = ''.join(buf)
        self.script = script
        return script
Convert string in which python code is embedded into python script and return it.
dataset/ETHPy150Open rst2pdf/rst2pdf/rst2pdf/tenjin.py/Template.convert