def convert(self, input, filename=None):
        """Convert string in which python code is embedded into python script and return it.

           input:str
             Input string to convert into python code.
           filename:str (=None)
             Filename of input. this is optional but recommended to report errors.

           ex.
             >>> import tenjin
             >>> from tenjin.helpers import escape, to_str
             >>> template = tenjin.Template()
             >>> filename = 'example.html'
             >>> input = open(filename).read()
             >>> script = template.convert(input, filename)   # filename is optional
             >>> print script
        """
        if self.encoding or 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
dataset/ETHPy150Open rst2pdf/rst2pdf/rst2pdf/tenjin.py/Template.convert/operator `and` -> `or`