Example of listing subscriptions.
351002
public ListSubscriptionsPagedResponse listSubscriptions() throws Exception {
    // [START pubsub_list_subscriptions]
    try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
      ListSubscriptionsRequest listSubscriptionsRequest =
          ListSubscriptionsRequest.newBuilder()
              .setProject(ProjectName.of(projectId).toString())
              .build();
      ListSubscriptionsPagedResponse response =
          subscriptionAdminClient.listSubscriptions(listSubscriptionsRequest);
      Iterable<Subscription> subscriptions = response.iterateAll();
      for (Subscription subscription : subscriptions) {
        // do something with the subscription
      }
      return response;
    }
    // [END pubsub_list_subscriptions]
  }
755745
def find_subscription(self, identifier):
        
        for subscription in self.subscriptions.values():
            if subscription.identifier == identifier:
                return subscription
529194
def get_subscriptions_channel(self, search_channel):
        
        data = self.get_clients()
        clients = []
        for client in data:
            if 'subscriptions' in client:
                if isinstance(client['subscriptions'], list):
                    if search_channel in client['subscriptions']:
                        clients.append(client['name'])
                else:
                    if search_channel == client['subscriptions']:
                        clients.append(client['name'])
        return clients
1359262
public List<Subscription> getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        return getSubscriptions(null, null);
    }
105701
def subscriptions_list(**kwargs):
    '''
    

    '''
    result = {}
    subconn = __utils__['azurearm.get_client']('subscription', **kwargs)
    try:
        subs = __utils__['azurearm.paged_object_to_list'](subconn.subscriptions.list())

        for sub in subs:
            result[sub['subscription_id']] = sub
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
683009
def find_behind_subscriptions():
    
    subscriptions = Subscription.objects.filter(
        active=True, completed=False, process_status=0
    ).values_list("id", flat=True)
    for subscription_id in subscriptions.iterator():
        calculate_subscription_lifecycle.delay(str(subscription_id))
68350
def payments(self):
        """"""
        payments = self.client.subscription_payments.on(self).list()
        return payments
1250326
def get_subscription_labels(self, userPk):
        """"""
        r = self._request('subscriptions/' + str(userPk))
        if r:
            s = r.json()
            return s
        return []
992251
public Observable<Page<SubscriptionInner>> listAsync() {
        return listWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<SubscriptionInner>>, Page<SubscriptionInner>>() {
                @Override
                public Page<SubscriptionInner> call(ServiceResponse<Page<SubscriptionInner>> response) {
                    return response.body();
                }
            });
    }
1071499
public PubsubFuture<SubscriptionList> listSubscriptions(final String project,
                                                          final String pageToken) {
    final String query = (pageToken == null) ? "" : "?pageToken=" + pageToken;
    final String path = "projects/" + project + "/subscriptions" + query;
    return get("list subscriptions", path, readJson(SubscriptionList.class));
  }
755460
public function createSubscription()
    {
        $data = [
            "customer" => request()->customer, //Customer email or code
            "plan" => request()->plan,
            "authorization" => request()->authorization_code
        ];

        $this->setRequestOptions();
        $this->setHttpResponse('/subscription', 'POST', $data);
    }
1303110
def subscribers(self, date="", page=1, page_size=1000, order_field="email", order_direction="asc", include_tracking_information=False):
        """"""
        params = {
            "date": date,
            "page": page,
            "pagesize": page_size,
            "orderfield": order_field,
            "orderdirection": order_direction,
            "includetrackinginformation": include_tracking_information
        }
        response = self._get(self.uri_for("active"), params=params)
        return json_to_py(response)
944714
def get_all_subscriptions(self, next_token=None):
        
        params = {'ContentType' : 'JSON'}
        if next_token:
            params['NextToken'] = next_token
        response = self.make_request('ListSubscriptions', params, '/', 'GET')
        body = response.read()
        if response.status == 200:
            return json.loads(body)
        else:
            boto.log.error('%s %s' % (response.status, response.reason))
            boto.log.error('%s' % body)
            raise self.ResponseError(response.status, response.reason, body)
1160819
function doQuery(options) {
            return models.Subscriber.findPage(options)
                .then(({data, meta}) => {
                    return {
                        subscribers: data.map(model => model.toJSON(options)),
                        meta: meta
                    };
                });
        }
366721
def subscribers(self):
        """"""
        return [s for p, s in sorted(self._subscribers, key=lambda x: x[0])]
920075
def get_subscribers(obj):
    
    ctype = ContentType.objects.get_for_model(obj)
    return Subscription.objects.filter(content_type=ctype, object_id=obj.pk)
869836
def buildSubscriptionList(self):
        
        self._clearLists()
        unreadById = {}

        if not self.userId:
            self.getUserInfo()

        unreadJson = self.httpGet(ReaderUrl.UNREAD_COUNT_URL, { 'output': 'json', })
        unreadCounts = json.loads(unreadJson, strict=False)['unreadcounts']
        for unread in unreadCounts:
            unreadById[unread['id']] = unread['count']

        feedsJson = self.httpGet(ReaderUrl.SUBSCRIPTION_LIST_URL, { 'output': 'json', })
        subscriptions = json.loads(feedsJson, strict=False)['subscriptions']

        for sub in subscriptions:
            categories = []
            if 'categories' in sub:
                for hCategory in sub['categories']:
                    cId = hCategory['id']
                    if not cId in self.categoriesById:
                        category = Category(self, hCategory['label'], cId)
                        self._addCategory(category)
                    categories.append(self.categoriesById[cId])

            try:
                feed = self.getFeed(sub['id'])
                if not feed:
                    raise
                if not feed.title:
                    feed.title = sub['title']
                for category in categories:
                    feed.addCategory(category)
                feed.unread = unreadById.get(sub['id'], 0)
            except:
                feed = Feed(self,
                            sub['title'],
                            sub['id'],
                            sub.get('htmlUrl', None),
                            unreadById.get(sub['id'], 0),
                            categories)
            if not categories:
                self.orphanFeeds.append(feed)
            self._addFeed(feed)

        specialUnreads = [id for id in unreadById
                            if id.find('user/%s/state/com.google/' % self.userId) != -1]
        for type in self.specialFeeds:
            feed = self.specialFeeds[type]
            feed.unread = 0
            for id in specialUnreads:
                if id.endswith('/%s' % type):
                    feed.unread = unreadById.get(id, 0)
                    break

        return True