Returns ``True`` if the given user is a subscriber of this topic.
976527
def has_subscriber(self, user):
        
        if not hasattr(self, '_subscribers'):
            self._subscribers = list(self.subscribers.all())
        return user in self._subscribers
1111008
def subscribe(self, subscription):
        """"""
        url = urljoin(self._url, '/subscriptions')
        return subscription.post(url)
282364
@Override
	public int getNumberSubscribers(String topic) {
		if (map.containsKey(topic)) {
			return map.get(topic).size();
		}
		return 0;
	}
632013
function subscribe() {
  console.log('Subscribing client ' + clientId + ' to topic: ' + topics.subscribe);
  client.subscribe(topics.subscribe);
  isSubscribed = true;
}
1279211
def is_subscribed(self):
		""""""

		subscribed = next(
			(
				config_item['value'] == 'true'
				for config_item in self.config()
				if config_item['key'] == 'isNautilusUser'
			),
			None
		)

		if subscribed:
			self.tier = 'aa'
		else:
			self.tier = 'fr'

		return subscribed
700144
def subscribe_to_chat(
        self,
        subscriber: Callable[[events.ChatMessageWasReceived], None],
    ) -> None:
        
        self._chat_subscribers.append(subscriber)
1309234
def perform_permissions_check(self, user, obj, perms):
        
        return self.request.forum_permission_handler.can_subscribe_to_topic(obj, user)
800880
@Override
	public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
    {
        return createDurableSubscriber(topic,name,null,false);
    }
1160900
private boolean consideringHierarchy(Publish p) {
		boolean sent = false;
		for (Entry<Class<?>, List<SubscriberParent>> e : p.mapping.entrySet()) {
			if (e.getKey().isAssignableFrom(p.message.getClass())) {
				for (SubscriberParent parent : e.getValue()) {
					if (!predicateApplies(parent.getSubscriber(), p.message)) {
						continue;
					}
					parent.getSubscriber().receiveO(p.message);
					sent = true;
				}
			}
		}
		return sent;
	}
341683
function unsuspendSubscriber (topic, token) {
    if (typeof token === 'string') {
      return !!applyTopicDescendents(
        unsuspendTopic, 'subscriptions', token, topic
      );
    }

    var node = ancestorTopicSearch(token.topic, topic);
    if (node.topic !== token.topic) {
      return false;
    }

    var i = searchAround(
      getId, getPriority,
      token.id, token.priority,
      binaryIndexBy(getPriority, token.priority, node.subscriptions),
      node.subscriptions
    );

    if (i === -1) {
      return false;
    }

    return !!unsuspendNode(node.subscriptions[i]);
  }
300803
def subscribe(self, topic, options=None):
        

        def decorator(func):
            if self._started:
                self.session.subscribe(handler=func, topic=topic, options=options)
            else:

                def subscriber():
                    self.session.subscribe(handler=func, topic=topic, options=options)

                # Wait for the WAMP session to be started
                self._on_running_callbacks.append(subscriber)
            return func

        return decorator
807443
public function subscribe()
    {
        if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) {
            return false;
        }

        // is logged in ?
        $oUser = $this->getUser();
        if (!$oUser) {
            return false;
        }

        $iStatus = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('status');
        if ($oUser->setNewsSubscription($iStatus, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOrderOptInEmail'))) {
            $this->_iSubscriptionStatus = ($iStatus == 0 && $iStatus !== null) ? -1 : 1;
        }
    }
627659
func (tm *topicManager) IsSubscribed(topic string) bool {
	tm.locker.RLock()
	defer tm.locker.RUnlock()
	return tm.allTopics[topic] != nil
}
612021
public function isSubscribed(AnEventSubscriberInterface $subscriber)
    {
        $handle = $subscriber->getHandle();
        return isset($this->_subscribers[$handle]);
    }
1027755
def subscribe(self, subscription_channel, **observer_params):
        
        return self.get_channel(subscription_channel, **observer_params).ensure_started().observer
831225
def get_subscriber(self, subscriber_id):
        
        route_values = {}
        if subscriber_id is not None:
            route_values['subscriberId'] = self._serialize.url('subscriber_id', subscriber_id, 'str')
        response = self._send(http_method='GET',
                              location_id='4d5caff1-25ba-430b-b808-7a1f352cc197',
                              version='5.0-preview.1',
                              route_values=route_values)
        return self._deserialize('NotificationSubscriber', response)
62885
def is_subscribed_list(self, list_id, user_id):
        
        try:
            return bool(self._client.show_list_subscriber(list_id=list_id, user_id=user_id))
        except TweepError as e:
            if e.api_code == TWITTER_USER_IS_NOT_LIST_MEMBER_SUBSCRIBER:
                return False
            raise