docstr: Called by IOLoop when there is activity on one of our
  file descriptors.
docstr_tok: ["Called","by","IOLoop","when","there","is","activity","on","one","of","our","file","descriptors","."]
code: def _handle_events(self, fd, events):
      """Called by IOLoop when there is activity on one of our
      file descriptors.
      """
      action = 0
      if events & ioloop.IOLoop.READ:
          action |= pycurl.CSELECT_IN
      if events & ioloop.IOLoop.WRITE:
          action |= pycurl.CSELECT_OUT
      while True:
          try:
              ret, num_handles = self._multi.socket_action(fd, action)
          except pycurl.error as e:
              ret = e.args[0]
          if ret != pycurl.E_CALL_MULTI_PERFORM:
              break
      self._finish_pending_requests()
  
imports: from __future__ import absolute_import, division, print_function
  import collections
  import functools
  import logging
  import pycurl
  import threading
  import time
  from io import BytesIO
  from tornado import httputil
  from tornado import ioloop
  from tornado import stack_context
  from tornado.escape import utf8, native_str
  from tornado.httpclient import HTTPResponse, HTTPError, AsyncHTTPClient, main
label_desc: Use image node_id 6 for calling the CurlAsyncHTTPClient obj's underlying member method code with example usage: obj._handle_events(fd, events) without return types