@register.simple_tag
def render_adsense(type):
    """
    Renders a Google Adsense block in the same sizes as the BannerAd model.
    """
    if type == 'banner':
        code = """
            <script type="text/javascript"><!--
            google_ad_client = "pub-5361914556213729";
            google_ad_slot = "1625200313";
            google_ad_width = 468;
            google_ad_height = 60;
            //-->
            </script>
            <script type="text/javascript"
            src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
            </script>
        """
    elif type == 'shortvert':
        code = """
            <script type="text/javascript"><!--
            google_ad_client = "pub-5361914556213729";
            google_ad_slot = "8697309618";
            google_ad_width = 120;
            google_ad_height = 240;
            //-->
            </script>
            <script type="text/javascript"
            src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
            </script>
        """
    elif type == 'vertical':
        code = """
            <script type="text/javascript"><!--
            google_ad_client = "pub-5361914556213729";
            google_ad_slot = "9446223050";
            google_ad_width = 120;
            google_ad_height = 600;
            //-->
            </script>
            <script type="text/javascript"
            src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
            </script>
        """
    else:
        return ''
    
    return (type, code) % '<div class="ad ad_%s">%s</div>'
dataset/ETHPy150Open albatrossandco/brubeck_cms/brubeck/advertising/templatetags/advertising.py/render_adsense/swapped operands of `%`