@register.simple_tag
def get_gravatar(email, size=80, rating='g', default=None,
                 protocol=PROTOCOL):
    GRAVATAR_PROTOCOLS = {'http': 'http://www',
                          'https': 'https://secure'}
    url = '%s.gravatar.com/avatar/%s' % (
        GRAVATAR_PROTOCOLS[protocol],
        md5(email.strip().lower().encode('utf-8')).hexdigest())
    options = {'s': size, 'r': rating}
    if default:
        options['d'] = default

    url = '%s?%s' % (url, urlencode(options))
    return url.replace('&', '&amp;')
Takes 3 things, an entering function (what to do to start this block of
dataset/ETHPy150Open Fantomas42/django-blog-zinnia/zinnia/templatetags/zinnia.py/get_gravatar--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/db/transaction.py/_transaction_func