<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_k8s_upgrades_completion_list(cmd, prefix, namespace, **kwargs):
 # pylint: disable=unused-argument """Return Kubernetes versions available for upgrading an existing cluster."""

    resource_group = getattr(namespace, 'resource_group_name', None)
    name = getattr(namespace, 'name', None)
    return get_k8s_upgrades(cmd.cli_ctx, resource_group, name) if resource_group and name else None