def _write(self, params, headers=None): 
        self.auth_check()
        url = 'http://www.tumblr.com/api/write'
        register_openers()
        params['email'] = self.email
        params['password'] = self.password
        params['private'] = self.private
        params['generator'] = GENERATOR
        params['group'] = self.name
        params['date'] = self.date
        params['tags'] = self.tags
        params['format'] = self.format

        if not params['date']:
            params['date'] = 'now'
        if not params['tags']:
            del params['tags']
        if not params['format']:
            del params['format']

        if not params in 'data':
            data = urlencode(params)
        else:
            data, headers = multipart_encode(params)

        if headers:
            req = Request(url, data, headers)
        else:
            req = Request(url, data)

        newid = None
        #print params
        try: 
            f = urlopen(req)
            print f.read()
            raise TumblrError("Error writing post")

        except HTTPError, e:
            if 201 == e.code:
                newid = e.read() 
                return self.read(id=newid)
            raise TumblrError(e.read())
dataset/ETHPy150Open ialex/opentumblr-qt/opentumblrqt/tumblr.py/Api._write/swapped operands of `in`