<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def user_invite(self, username, email, roles):
 """ Invite a user to the tenant. """


        uri = 'openstack/users'
        data = {
            "username": username,
            "email": email,
            "roles": list(set(roles))
        }
        post_body = json.dumps(data)
        resp, body = self.post(uri, body=post_body)
        self.expected_success(200, resp.status)
        body = json.loads(body)
        return rest_client.ResponseBody(resp, body)