'Disable user account.
Note: This operation appears to be idempotent.
:param user: User to disable.
:type user: :class:`.OpenStackIdentityUser`
:return: User account which has been disabled.
:rtype: :class:`.OpenStackIdentityUser`'

def disable_user(self, user):

    data = {'enabled': False}
    data = json.dumps({'user': data})
    response = self.authenticated_request(('/v3/users/%s' % user.id), data=data, method='PATCH')
    user = self._to_user(data=response.object['user'])
    return user
