/*  determine subscription existence
331530
function () {
            /*  determine parameters  */
            var params = $cs.params("_subscription", arguments, {
                id:      { pos: 0, req: true  },
                details: { pos: 1, def: false }
            });

            /*  determine whether subscription exists  */
            var result = (typeof this.__subscription[params.id] !== "undefined");

            /*  optionally provide details about subscription  */
            if (params.details)
                result = (result ? this.__subscription[params.id] : undefined);

            return result;
        }
483649
function Subscription (queue, options) {
        assert.object(queue, 'queue');
        assert.object(options, 'options');

        this.MAX_DISPOSE_RETRIES = 3;
        this.retryDelay = 1000;
        this.queue = queue;
        this.options = options;
        this._disposed = false;
    }
716224
public function getSubscriptionById($subscriptionId)
    {
        $subscriptions = $this
            ->getSubscriptions(null, null, null, $subscriptionId)
            ->getResponse()
            ->getSubscriptions();

        return count($subscriptions) ? reset($subscriptions) : null;
    }
826553
public function checkSubscription()
    {
        if (!$this->subscriberSocket) {
            $this->subscriberSocket = $this->context->getSocket(\ZMQ::SOCKET_SUB);
            $this->subscriberSocket->connect($this->publisherPmSocketAddress);
            $this->subscriberSocket->setSockOpt(\ZMQ::SOCKOPT_SUBSCRIBE, "");
        }

        $this->subscriptionMessage = @json_decode($this->subscriberSocket->recv(\ZMQ::MODE_DONTWAIT), true);

        if (($this->subscriptionMessage !== false) && ($this->subscriptionMessage !== null)
            && (is_array($this->subscriptionMessage) === false)
        ) {
            throw new ProcessManagerException("Not correct param from ProcessManager to TerminatorPauseStander: "
                . serialize($this->subscriptionMessage));
        }

        if (isset($this->subscriptionMessage)) {
            $this->logger->info("Receive subscription message: " . serialize($this->subscriptionMessage));
            $this->resolveAction();
        }

        return null;
    }
821729
async def _check_subscriptions(self):
        

        subscribed, url = await self._get_subscriptions()
        expect = set(settings.FACEBOOK_SUBSCRIPTIONS)

        if (expect - subscribed) or url != self.webhook_url:
            await self._set_subscriptions(expect | subscribed)
            logger.info('Updated webhook subscriptions')
        else:
            logger.info('No need to update webhook subscriptions')
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
253195
def exists(cls, id):
        """"""
        return bool(redisco.get_client().exists(cls._key[str(id)]) or
                    redisco.get_client().sismember(cls._key['all'], str(id)))
746944
function _get_subscription( $license_id ) {
            if ( ! isset( $this->_storage->subscriptions ) ||
                 empty( $this->_storage->subscriptions )
            ) {
                return null;
            }

            foreach ( $this->_storage->subscriptions as $subscription ) {
                if ( $subscription->license_id == $license_id ) {
                    return $subscription;
                }
            }

            return null;
        }
1174608
public static void registerSubscription(Subscription subscription) {
        mSubscriptions.add(subscription);
        if (isConnected()) {
            executeQuery(subscription.getQuery());
        }
    }
1231047
def getPreSubscription(self):
		'''
		
		'''
		result = asyncResult()
		data = self._getURL("/subscriptions")
		if data.status_code == 200: #immediate success
			result.error = False
			result.is_done = True
			result.result = data.json()
		else:
			result.error = response_codes("presubscription",data.status_code)
			result.is_done = True
		result.raw_data = data.content
		result.status_code = data.status_code
		return result
1245635
public boolean isSubscribe() {
    if (message == null) {
      return false;
    }

    return (((Request) message).getMethod().equals(Request.SUBSCRIBE));
  }
236617
function (subscription, cb) {

		Subscription.findOrCreate(subscription.id, subscription)
	    .exec(function (err, foundSubscription){
	      if (err) return cb(err);
	      if (foundSubscription.lastStripeEvent > subscription.lastStripeEvent) return cb(null, foundSubscription);
	      if (foundSubscription.lastStripeEvent == subscription.lastStripeEvent) return Subscription.afterStripeCustomerSubscriptionUpdated(foundSubscription, function(err, subscription){ return cb(err, subscription)});
	      Subscription.update(foundSubscription.id, subscription)
	      .exec(function(err, updatedSubscriptions){
	      	if (err) return cb(err);
	      	if(!updatedSubscriptions) return cb(null, null);
	      	Subscription.afterStripeCustomerSubscriptionUpdated(updatedSubscriptions[0], function(err, subscription){
	      		cb(err, subscription);
	      	});
	      });
	    });
	}
975882
def has_in_subscriptions(self, subscription):
        
        assert isinstance(subscription, github.Repository.Repository), subscription
        status, headers, data = self._requester.requestJson(
            "GET",
            "/user/subscriptions/" + subscription._identity
        )
        return status == 204
769647
def subscriptions_read(self, rid, **kwargs):
        """"""
        return self.__call_api_post('subscriptions.read', rid=rid, kwargs=kwargs)
274184
function (fn, update, container) {
  // Alias passed in variables for later access.
  this._fn        = fn;
  this._update    = update;
  this._container = container;

  // Assign every subscription instance a unique id. This helps with linking
  // between parent and child subscription instances.
  this.cid             = 'c' + Utils.uniqueId();
  this.children        = {};
  this.subscriptions   = {};
  this.unsubscriptions = [];

  // Create statically bound function instances for public consumption.
  this.boundUpdate         = Utils.bind(this.update, this);
  this.boundUnsubscription = Utils.bind(this.unsubscription, this);
}
1337179
public boolean isUnsubscribed(int restartableId) {
        Subscription subscription = restartableSubscriptions.get(restartableId);
        return subscription == null || subscription.isUnsubscribed();
    }
550513
private void resubscribe_if_needed() {
        Enumeration channel_names = EventConsumer.getChannelMap().keys();
        long now = System.currentTimeMillis();

        // check the list of not yet connected events and try to subscribe
        while (channel_names.hasMoreElements()) {
            String name = (String) channel_names.nextElement();
            EventChannelStruct eventChannelStruct = EventConsumer.getChannelMap().get(name);
            if ((now - eventChannelStruct.last_subscribed) > EVENT_RESUBSCRIBE_PERIOD / 3) {
                reSubscribeByName(eventChannelStruct, name);
            }
            eventChannelStruct.consumer.checkIfHeartbeatSkipped(name, eventChannelStruct);

        }// end while  channel_names.hasMoreElements()
    }