<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_entitlement(owner, repo, identifier, name, token, show_tokens):
 """Update an entitlement in a repository."""

    client = get_entitlements_api()

    data = {}
    if name is not None:
        data["name"] = name

    if token is not None:
        data["token"] = token

    with catch_raise_api_exception():
        data, _, headers = client.entitlements_partial_update_with_http_info(
            owner=owner,
            repo=repo,
            identifier=identifier,
            data=data,
            show_tokens=show_tokens,
        )

    ratelimits.maybe_rate_limit(client, headers)
    return data.to_dict()