Re-download all subscriptions and reset the page index
420358
def refresh_content(self, order=None, name=None):
        
        # reddit.get_my_subreddits() does not support sorting by order
        if order:
            self.term.flash()
            return

        with self.term.loader():
            self.content = SubscriptionContent.from_user(
                self.reddit, self.term.loader, self.content_type)
        if not self.term.loader.exception:
            self.nav = Navigator(self.content.get)
980834
function resetUriRouteHandlers() {
  /**
   * URIs can point to many different things, and this list will probably grow.
   * @type {[{when: RegExp, html: function, json: function}]}
   */
  uriRoutes = [
    // assume published
    {
      when: /\/_pages\//,
      default: assumePublishedUnlessEditing(renderPage),
      json: assumePublishedUnlessEditing(getDBObject)
    },
    // assume published
    {
      when: /\/_components\//,
      default: assumePublishedUnlessEditing(renderComponent),
      json: assumePublishedUnlessEditing(components.get)
    },
    // uris are not published, they only exist
    {
      when: /\/_uris\//,
      isUri: true,
      html: renderUri,
      json: db.get
    }];
}
477515
def get_subscriptions_by_subscriber_id(
            self, subscriber_id, max_results=10):
        
        return self.search_subscriptions(
            subscriber_id=subscriber_id, max_results=max_results)
234576
def get_subscriptions(self, limit=100, offset=0, params={}):
        
        url = self.SUBSCRIPTIONS_URL + "?limit=%s&offset=%s" % (limit, offset)

        for key, value in params.items():
            if key is 'ids':
                value = ",".join(value)

            url += '&%s=%s' % (key, value)

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.get_request()
950348
def _reset(self):
        """"""
        self._subscriber_thread = None
        self._must_stop = threading.Event()
        self._number_periodic_tasks = 0
919974
def update(self, title, unsubscribe_page, confirmed_opt_in,
               confirmation_success_page, unsubscribe_setting="AllClientLists",
               add_unsubscribes_to_supp_list=False, scrub_active_with_supp_list=False):
        """"""
        body = {
            "Title": title,
            "UnsubscribePage": unsubscribe_page,
            "ConfirmedOptIn": confirmed_opt_in,
            "ConfirmationSuccessPage": confirmation_success_page,
            "UnsubscribeSetting": unsubscribe_setting,
            "AddUnsubscribesToSuppList": add_unsubscribes_to_supp_list,
            "ScrubActiveWithSuppList": scrub_active_with_supp_list}
        response = self._put("/lists/%s.json" % self.list_id, json.dumps(body))
1093957
def subscriptions_unread(self, room_id, **kwargs):
        """"""
        return self.__call_api_post('subscriptions.unread', roomId=room_id, kwargs=kwargs)
791426
def reload(self):
        
        self._results = []
        self._next_item_index = 0
        self._next_page_index = 0
        self._last_page_seen = False
123671
def check_subscription(self, request):
		""""""
		subscriber = subscriber_request_callback(request)

		if not subscriber_has_active_subscription(subscriber):
			if not SUBSCRIPTION_REDIRECT:
				raise ImproperlyConfigured("DJSTRIPE_SUBSCRIPTION_REDIRECT is not set.")
			return redirect(SUBSCRIPTION_REDIRECT)
1151358
public void reset() {
		CrawlSession session = context.getSession();
		if (crawlpath != null) {
			session.addCrawlPath(crawlpath);
		}
		List<StateVertex> onURLSetTemp = new ArrayList<>();
		if (stateMachine != null)
			onURLSetTemp = stateMachine.getOnURLSet();
		stateMachine = new StateMachine(graphProvider.get(), crawlRules.getInvariants(), plugins,
				stateComparator, onURLSetTemp);
		context.setStateMachine(stateMachine);
		crawlpath = new CrawlPath();
		context.setCrawlPath(crawlpath);
		browser.handlePopups();
		browser.goToUrl(url);
		// Checks the landing page for URL and sets the current page accordingly
		checkOnURLState();
		plugins.runOnUrlLoadPlugins(context);
		crawlDepth.set(0);
	}
670657
protected void clearSubscrips (boolean verbose)
    {
        for (ClientProxy rec : _subscrips.values()) {
            if (verbose) {
                log.info("Clearing subscription", "client", this, "obj", rec.object.getOid());
            }
            rec.unsubscribe();
        }
        _subscrips.clear();
    }
1113483
def update_subscription(netid, action, subscription_code, data_field=None):
    
    url = '{0}/subscription.json'.format(url_version())
    action_list = []

    if isinstance(subscription_code, list):
        for code in subscription_code:
            action_list.append(_set_action(
                netid, action, code, data_field))
    else:
        action_list.append(_set_action(
            netid, action, subscription_code, data_field))

    body = {'actionList': action_list}
    response = post_resource(url, json.dumps(body))
    return _json_to_subscription_post_response(response)
280541
function autoSubscribe() {
    //re-add pending subscribers
    if (_pendingSubscribers.length > 0) {
      async.each(_pendingSubscribers, function(sub, callback) {
        debug('Add pending subscriber', sub);
        self.subscribeToTopic(sub.exchange, sub.queue, sub.filter, sub.subscriber, sub.opts, function(err) {
          if (err) {
            debug('Failed to add subscriber, keep it', sub);
          } else {
            //done, remove the item from the pending subscribers
            var idx = _pendingSubscribers.indexOf(sub);
            _pendingSubscribers.splice(idx, 1);
            debug('pending subsriber added, now there are ' + _pendingSubscribers.length + ' left');
          }
          return callback();
        });
      }, function() {
        debug('pending subscribers are added');
      });
    }
  }
469747
function unsubscribe(subscriber) {
    var index;

    for (var i = 0, l = subscribers.length; i < l; i++) {
      if (subscribers[i] === subscriber) {
        index = i;
      }
    }

    subscribers.splice(index, 1);
    cache = {};
  }
305780
def get_subscription(self, subscription_id):
        
        return self.client._put(self.url + 'subscriptions/{}'.format(subscription_id), headers=self.get_headers())
143893
def ensure_one_subscription():
    
    cursor = connection.cursor()
    cursor.execute("UPDATE subscription_subscription SET active = False \
                    WHERE id NOT IN \
                   (SELECT MAX(id) as id FROM \
                    subscription_subscription GROUP BY to_addr)")
    affected = cursor.rowcount
    vumi_fire_metric.delay(
        metric="subscription.duplicates", value=affected, agg="last")
    return affected
683106
def _del_all_subscriptions(self, session):
        
        filter_queue = deque()
        for topic in self._subscriptions:
            if self._del_subscription(topic, session):
                filter_queue.append(topic)
        for topic in filter_queue:
            if not self._subscriptions[topic]:
                del self._subscriptions[topic]