def Open(self):
    if not self._open_result:
      def open_impl():
        if self._num_failures[0] == 0:
          self._num_failures[0] -= 1
          self._state = ChannelState.Closed
          raise Exception("Error opening socket")
        gevent.sleep(self._open_delay)
        self._state = ChannelState.Open
      self._open_result = AsyncResult()
      self._open_result.SafeLink(open_impl)
    return self._open_result
dataset/ETHPy150Open steveniemitz/scales/test/scales/util/mocks.py/MockSink.Open/operator `>` -> `==`