def authenticate(self, user, password):
        auth_params = "email=%s&password=%s" % (user, password)
        values = base64.encodestring(auth_params)
        request = Request(AUTH_URL, values)
        try:
            res = urllib2.urlopen(request).read()
            token = urllib2.quote(res)
        except IOError:  # no connection exception
            token = None
        return token
Asserts that val is a function that when invoked raises the given error.
dataset/ETHPy150Open cpbotha/nvpy/nvpy/simplenote.py/Simplenote.authenticate--crossover with--dataset/ETHPy150Open ActivisionGameScience/assertpy/assertpy/assertpy.py/AssertionBuilder.raises