def close(self):
        if not self.server_terminated:
            if not self.stream.closed():
                self._write_frame(True, 0x8, b(""))
            self.server_terminated = True
        if self.client_terminated:
            if self._waiting is not None:
                self.stream.io_loop.remove_timeout(self._waiting)
                self._waiting = None
            self.stream.close()
        elif self._waiting is None:
            # Give the client a few seconds to complete a clean shutdown,
            # otherwise just close the connection.
            self._waiting = self.stream.io_loop.add_timeout(
                time.time() + 5, self._abort)
Bing.geocode using structured query
dataset/ETHPy150Open jbalogh/tornado-websocket-client/websocket.py/WebSocket.close--crossover with--dataset/ETHPy150Open geopy/geopy/test/geocoders/bing.py/BingTestCase.test_structured_query