def METHOD_NAME(scopes=None, claims=None):
    login_command = ['az login']
    # Rejected by Conditional Access policy, like MFA
    if scopes:
        login_command.append('--scope {}'.format(' '.join(scopes)))
    # Rejected by CAE
    if claims:
        # Explicit logout is needed: https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/335
        return 'az logout\n' + ' '.join(login_command)
    return ' '.join(login_command)