def auth_check(self):
        if self.is_authenticated:
            return
        url = 'http://www.tumblr.com/api/write'
        values = {	
            'action': 'authenticate',
            'generator' : GENERATOR, 
            'email': self.email, 
            'password' : self.password,
            'private' : self.private,
            'group': self.name,
            'date': self.date,
            'tags': self.tags,
            'format': self.format
        }

        data = urlencode(values)
        req = Request(url, data)
        try: 
            response = urlopen(req)
            page = response.read()
            self.url = page 
            self.is_authenticated = True
            return
        except __HOLE__, e:
            if 403 == e.code:
                raise TumblrAuthError(str(e))
            if 400 == e.code:
                raise TumblrRequestError(str(e))
        except Exception, e:
            raise TumblrError(str(e))
dataset/ETHPy150Open ialex/opentumblr-qt/opentumblrqt/tumblr.py/Api.auth_check