Checks the status of the user's subscription to this thread.

        :returns: :class:`Subscription <Subscription>`
13575
def subscription(self):
        
        url = self._build_url('subscription', base_url=self._api)
        json = self._json(self._get(url), 200)
        return Subscription(json, self) if json else None
539574
def root_user_status(self):
        
        uri = "/instances/%s/root" % self.id
        resp, body = self.manager.api.method_get(uri)
        return body["rootEnabled"]
1218961
def (self):
        
        while True:
            message = self.req_queue.get()
            if message is None:
                _logger.debug(" thread is terminated")
                return

            if message._type != MessageType.EVENT:
                self._(message)
            elif message._type == MessageType.EVENT:
                self.__dispatch_event_message(message)
46052
def get_subscriptions(self):
        
        return github.PaginatedList.PaginatedList(
            github.Repository.Repository,
            self._requester,
            self.url + "/subscriptions",
            None
        )
1090642
def is_done(self, submissionid_or_submission, user_check=True):
        
        # TODO: not a very nice way to avoid too many database call. Should be refactored.
        if isinstance(submissionid_or_submission, dict):
            submission = submissionid_or_submission
        else:
            submission = self.get_submission(submissionid_or_submission, False)
        if user_check and not self.user_is_submission_owner(submission):
            return None
        return submission["status"] == "done" or submission["status"] == "error"
720628
def _on_status(data, unique_id):
        
        status_code = data.get('statusCode')
        logger.info('[Subscription: %s]: %s' % (unique_id, status_code))
1033785
def is_running(self):
        
        self.__update_status()
        return self.status == Status.UP or self.status == Status.DECOMMISSIONED
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
645858
def create(self):
        
        self.logger.debug('Create subscription on server...')

        if not self.connection.connected:
            self.state = 'connection_pending'
            return

        data = {
            'command': 'subscribe',
            'identifier': self._identifier_string()
        }

        self.connection.send(data)
        self.state = 'pending'
723779
def service_status(self, name):
        

        return self._loop.run_coroutine(self._client.service_status(name))
1053509
def process(self):
        

        subscription = None
        result = None

        try:
            subscription = self.socket.recv()

        except AuthenticateError as exception:
            logging.error(
                'Subscriber error while authenticating request: {}'
                .format(exception), exc_info=1)

        except AuthenticatorInvalidSignature as exception:
            logging.error(
                'Subscriber error while authenticating request: {}'
                .format(exception), exc_info=1)

        except DecodeError as exception:
            logging.error(
                'Subscriber error while decoding request: {}'
                .format(exception), exc_info=1)

        except RequestParseError as exception:
            logging.error(
                'Subscriber error while parsing request: {}'
                .format(exception), exc_info=1)

        else:
            logging.debug(
                'Subscriber received payload: {}'
                .format(subscription))

        _tag, message, fun = self.parse(subscription)
        message = self.verify(message)
        message = self.decode(message)

        try:
            result = fun(message)
        except Exception as exception:
            logging.error(exception, exc_info=1)

        # Return result to check successful execution of `fun` when testing
        return result
1296985
def status(self):
        
        myNow = timezone.localtime(timezone=self.tz)
        if getAwareDatetime(self.date, self.time_to, self.tz) < myNow:
            return "finished"
        elif getAwareDatetime(self.date, self.time_from, self.tz) < myNow:
            return "started"
1183889
def consumer_checkin
      @host.update_attributes(:last_checkin => params[:date])
      Candlepin::Consumer.new(@host.subscription_facet.uuid, @host.organization.label).checkin(params[:date])
      render :json => Resources::Candlepin::Consumer.get(@host.subscription_facet.uuid)
    end
833185
def find_behind_subscriptions(self, request):
        

        task_id = find_behind_subscriptions.delay()
        return Response(
            {"accepted": True, "task_id": str(task_id)}, status=status.HTTP_202_ACCEPTED
        )
360179
def accept_subscription(&blk)
      pres = connection.presence_stanza('to'=>jid.bare, 'type' => 'subscribed')
      connection.send_stanza pres, &blk
    end
1059342
def _on_close(self, socket):
        
        self.logger.debug('Connection closed.')

        for subscription in self.subscriptions.values():
            if subscription.state == 'subscribed':
                subscription.state = 'connection_pending'
689349
def status(self):
        
        status = _HTTP_STATUS_LINES.get(self._status_code)
        return str(status or ('{} Unknown'.format(self._status_code)))