@register.simple_tag
def gravatar(email, size=50, rating='g', default=None):
    # Verify the rating actually is a rating accepted by gravatar
    rating = rating.lower()
    ratings = ['g', 'pg', 'r', 'x']
    if rating not in ratings:
        raise template.TemplateSyntaxError('rating must be %s' % (
            ", ".join(ratings)))
    # Create and return the url
    hash = md5(email).hexdigest()
    url = 'http://www.gravatar.com/avatar/%s?s=%s&r=%s' % (
        hash, size, rating)
    if default:
        url = "%s&d=%s" % (url, default)
    return url
Convert docstring from `toolz` to `cytoolz`.
dataset/ETHPy150Open teknolab/django.org.tr/apps/profiles/templatetags/gravatar.py/gravatar--crossover with--dataset/ETHPy150Open eriknw/cytoolz/cytoolz/tests/test_docstrings.py/convertdoc