def METHOD_NAME(module, gl, project, wished_badge):
    changed = False
    existing_badge = None
    for badge in project.badges.list(iterator=True):
        if badge.image_url == wished_badge["image_url"]:
            existing_badge = badge
            break
    if not existing_badge:
        changed = True
        if module.check_mode:
            return changed, {"status": "A project badge would be created."}
        badge = project.badges.create(wished_badge)
        return changed, badge.attributes
    if existing_badge.link_url != wished_badge["link_url"]:
        changed = True
        existing_badge.link_url = wished_badge["link_url"]
    if changed:
        if module.check_mode:
            return changed, {"status": "Project badge attributes would be changed."}
        existing_badge.save()
    return changed, existing_badge.attributes