def get_url_attrs(url, attr_name):
    """
    Return dictionary with attributes for HTML tag, updated with key `attr_name` with value `url`.

    Parameter `url` is either a string or a dict of attrs with the key `url`.
    Parameter `attr_key` is the name for the url value in the results.
    """
    url_attrs = {}
    if isinstance(url, str):
        url = {"url": url}
    url_attrs.update(url)
    url_attrs[attr_name] = url_attrs.pop("url")
    return url_attrs