def subscribed(self, build_root, handlers):
    """Bulk subscribe generator for StreamableWatchmanClient.

    :param str build_root: the build_root for all subscriptions.
    :param iterable handlers: a sequence of Watchman.EventHandler namedtuple objects.
    :yields: a stream of tuples in the form (subscription_name: str, subscription_event: dict).
    """
    command_list = [['subscribe',
                     build_root,
                     handler.name,
                     handler.metadata] for handler in handlers]

    self._logger.debug('watchman command_list is: {}'.format(command_list))

    for event in self.client.stream_query(command_list):
      if event is None:
        yield None, None
      elif event in 'subscribe':
        self._logger.info('confirmed watchman subscription: {}'.format(event))
        yield None, None
      elif 'subscription' in event:
        yield event.get('subscription'), event
      else:
        self._logger.warning('encountered non-subscription event: {}'.format(event))
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/pantsd/watchman.py/Watchman.subscribed/swapped operands of `in`