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 _wait_write(self):
      assert (
          self.__writable.ready()
      ), "Only one greenlet can be waiting on this event"
      self.__writable = AsyncResult()
      # timeout is because libzmq cannot be trusted to properly signal a new send event:
      # this is effectively a maximum poll interval of 1s
      tic = time.time()
      dt = self._gevent_bug_timeout
      if dt:
          timeout = gevent.Timeout(seconds=dt)
      else:
          timeout = None
      try:
          if timeout:
              timeout.start()
          self.__writable.get(block=True)
      except gevent.Timeout as t:
          if t is not timeout:
              raise
          toc = time.time()
          # gevent bug: get can raise timeout even on clean return
          # don't display zmq bug warning for gevent bug (this is getting ridiculous)
          if (
              self._debug_gevent
              and timeout
              and toc - tic > dt
              and self.getsockopt(zmq.EVENTS) & zmq.POLLOUT
          ):
              print(
                  "BUG: gevent may have missed a libzmq send event on %i!"
                  % self.FD,
                  file=sys.stderr,
              )
      finally:
          if timeout:
              timeout.close()
          self.__writable.set()
  
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 7 for calling the _Socket obj's underlying member method code with example usage: obj._wait_write() without return types