<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cancel_inquiry (self):
 """ Call this method to cancel an inquiry in process. inquiry_complete will still be called. """

        self.names_to_find = {}

        if self.is_inquiring:
            try:
                _bt.hci_send_cmd (self.sock, _bt.OGF_LINK_CTL, \
                        _bt.OCF_INQUIRY_CANCEL)
            except _bt.error as e:
                self.sock.close ()
                self.sock = None
                raise BluetoothError (e.args[0],
                                      "error canceling inquiry: " +
                                      e.args[1])
            self.is_inquiring = False