def auth(self):
        """Send authorization secret to nsqd."""
        self.send(nsq.auth(self.auth_secret))
        frame, data = self.read_response()

        if frame == nsq.FRAME_TYPE_ERROR:
            raise data

        try:
            response = json.loads(data.decode('utf-8'))
        except __HOLE__:
            self.close_stream()
            msg = 'failed to parse AUTH response JSON from nsqd: %r'
            raise errors.NSQException(msg % data)

        self.on_auth.send(self, response=response)
        return response
dataset/ETHPy150Open wtolson/gnsq/gnsq/nsqd.py/Nsqd.auth