def generate(self, chars, format='<STR_LIT>'):
im = self.generate_image(chars)<EOL>out = BytesIO()<EOL>im.save(out, format=format)<EOL>out.seek(<NUM_LIT:0>)<EOL>return out<EOL>
Generate an Image Captcha of the given characters.

        :param chars: text to be generated.
        :param format: image file format