def METHOD_NAME(self, tokensource, outfile):
    """
    This method must format the tokens from the `tokensource` iterable and
    write the formatted version to the file object `outfile`.
    Formatter options can control how exactly the tokens are converted.
    """
    if self.encoding:
        # wrap the outfile in a StreamWriter
        outfile = codecs.lookup(self.encoding)[3](outfile)
    return self.format_unencoded(tokensource, outfile)