class_docstr: Green version of :class:`zmq.Socket`
  
  The following methods are overridden:
  
      * send
      * recv
  
  To ensure that the ``zmq.NOBLOCK`` flag is set and that sending or receiving
  is deferred to the hub if a ``zmq.EAGAIN`` (retry) error is raised.
  
  The `__state_changed` method is triggered when the zmq.FD for the socket is
  marked as readable and triggers the necessary read and write events (which
  are waited for in the recv and send methods).
  
  Some double underscore prefixes are used to minimize pollution of
  :class:`zmq.Socket`'s namespace.
code: def __setup_events(self):
      self.__readable = AsyncResult()
      self.__writable = AsyncResult()
      self.__readable.set()
      self.__writable.set()
  
      try:
          self._state_event = get_hub().loop.io(
              self.getsockopt(zmq.FD), 1
          )  # read state watcher
          self._state_event.start(self.__state_changed)
      except AttributeError:
          # for gevent<1.0 compatibility
          from gevent.core import read_event
  
          self._state_event = read_event(
              self.getsockopt(zmq.FD),
              self.__state_changed,
              persist=True,
          )
  
imports: import sys
  import time
  import warnings
  from typing import Tuple
  import gevent
  from gevent.event import AsyncResult
  from gevent.hub import get_hub
  import zmq
  from zmq import Context
  from zmq import Socket
  from .poll import _Poller
label_desc: Use image node_id 5 for calling the _Socket obj's underlying member method code with example usage: obj.__setup_events() without return types