<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def libravatar_url(email=None, openid=None, size=64, default="retro"):
 """Get the URL to an avatar from libravatar. Either the user's email or openid must be provided. If you want to use Libravatar federation (through DNS), you should install and use the ``libravatar`` library instead. Check out the ``libravatar.libravatar_url()`` function. Args: email (str):
 The user's email openid (str):
 The user's OpenID size (int):
 Size of the avatar in pixels (it's a square). default (str):
 Default avatar to return if not found. Returns: str: The URL to the avatar image. Raises: ValueError: If neither email nor openid are provided. """

    # We use an OrderedDict here to make testing easier (URL strings become
    # predictable).
    params = collections.OrderedDict([("s", size), ("d", default)])
    query = parse.urlencode(params)
    if email:
        value = email
    elif openid:
        value = openid
    else:
        raise ValueError("You must provide either the email or the openid.")
    idhash = sha256(value.encode("utf-8")).hexdigest()
    return "https://seccdn.libravatar.org/avatar/%s?%s" % (idhash, query)