<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __authenticate(self):
 """ Sends a json payload with the email and password in order to get the authentication api_token to be used with the rest of the requests """

        if self.api_token:
            # verify current API token
            check_auth_uri = self.uri.split('/api/v1')[0] + '/check_token'
            req = self.request(check_auth_uri)
            try:
                ping = req.get().json()
            except Exception as exc:
                if str(exc).startswith('User not authenticated'):
                    self.api_token = None
            else:
                if self.email == ping['hello']:
                    return
                print "Authentication failed"
                sys.exit(1)

        auth_uri = self.uri.split('/api/v1')[0] + '/auth'
        payload = {
            'email': self.email,
            'password': self.password,
            'org_id': self.org_name
        }
        data = json.dumps(payload)
        req = self.request(auth_uri, data=data)
        response = req.post().json()
        token = response.get('mist_api_token', None)
        if token:
            # backwards compatibility with old Authentication system
            self.api_token = "mist_1 %s:%s" % (self.email, token)
        else:
            self.api_token = response.get('token', None)