def get_gravatar_url(parser, token):
    words = token.contents.split()
    tagname = words.pop(0)
    if len(words) < 2:
        raise template.TemplateSyntaxError, "%r tag: At least one argument should be provided." % tagname
    if words.pop(0) != "for":
        raise template.TemplateSyntaxError, "%r tag: Syntax is {% get_gravatar_url for myemailvar rating "R" size 80 default img:blank as gravatar_url %}, where everything after myemailvar is optional."
    email = words.pop(0)
    if len(words) % 2 != 0:
        raise template.TemplateSyntaxError, "%r tag: Imbalanced number of arguments." % tagname
    args = {
        'email': email,
        'rating': GRAVATAR_MAX_RATING,
        'size': GRAVATAR_SIZE,
        'default': GRAVATAR_DEFAULT_IMG,
    }
    for name, value in zip(words[::2], words[1::2]):
        name = name.lower()
        if name not in ('rating', 'size', 'default', 'as'):
            raise template.TemplateSyntaxError, "%r tag: Invalid argument %r." % tagname, name
        args[smart_str(name)] = value
    return GravatarUrlNode(**args)
Generates a gravatar image URL based on the given parameters.
dataset/ETHPy150Open caseywstark/colab/colab/apps/threadedcomments/templatetags/gravatar.py/get_gravatar_url