code: def _cleanup_fd(self, fd, close=False):
          
          self._ioloop.remove_handler(fd)
          if fd in self._connections:
              try:
                  self._pool_manager.free(self.pid, self._connections[fd])
              except pool.ConnectionNotFoundError:
                  pass
              if close:
                  self._connections[fd].close()
              del self._connections[fd]
          if fd in self._futures:
              del self._futures[fd]
docs: Ensure the socket socket is removed from the IOLoop, the
          connection stack, and futures stack.
  
          :param int fd: The fd # to cleanup