Return active Subscriptions with plan counts annotated.
349782
def active_plan_summary(self):
		""""""
		return self.active().values("plan").order_by().annotate(count=models.Count("plan"))
457158
def get_all_active_subscribers
      find_active_subscribers(DateTime.new(y=1911,m=1,d=01, h=01,min=00,s=00))
    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
        )
632101
def all_active(cls):
        

        prefix = context.get_current_config()["redis_prefix"]
        queues = []
        for key in context.connections.redis.keys():
            if key.startswith(prefix):
                queues.append(Queue(key[len(prefix) + 3:]))

        return queues
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)
1277781
public Usages getSubscriptionUsages(final String subscriptionCode, final String addOnCode, final QueryParams params) {
       return doGET(Subscription.SUBSCRIPTION_RESOURCE +
                        "/" +
                        subscriptionCode +
                        AddOn.ADDONS_RESOURCE +
                        "/" +
                        addOnCode +
                        Usage.USAGE_RESOURCE, Usages.class, params );
    }
1105952
def num_signups(self):
        """"""
        return EighthSignup.objects.filter(scheduled_activity__block=self, user__in=User.objects.get_students()).count()
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)
683398
def active_joined_organisations(doc):
    """"""
    if doc.get('type') == 'user' and doc.get('state') != 'deactivated':
        for org_id, state in doc.get('organisations', {}).items():
            if state['state'] == 'deactivated':
                continue

            org = {'_id': org_id}
            yield [doc['_id'], None], org

            try:
                yield [doc['_id'], state['state']], org
            except KeyError:
                pass
278444
def get_active() -> List[str]:
        """"""
        active = []
        for i in range(__num_subarrays__):
            key = Subarray.get_key(i)
            if DB.get_hash_value(key, 'active').upper() == 'TRUE':
                active.append(Subarray.get_id(i))
        return active
1359262
public List<Subscription> getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        return getSubscriptions(null, null);
    }
197727
public Collection<PartnerSubscription> list(long partnerId, long accountId)
    {
        return HTTP.GET(String.format("/v2/partners/%d/accounts/%d/subscriptions", partnerId, accountId), PARTNER_SUBSCRIPTIONS).get();
    }
764746
def active(self):
        """"""
        qs = self.get_queryset()
        return qs.filter(
            models.Q(
                models.Q(start_date__isnull=True) |
                models.Q(start_date__lte=now().date())
            ) &
            models.Q(
                models.Q(end_date__isnull=True) |
                models.Q(end_date__gte=now().date())
            )
        ).distinct()
584308
async def _get_subscriptions(self) -> Tuple[Set[Text], Text]:
        

        url, params = self._get_subscriptions_endpoint()

        get = self.session.get(url, params=params)

        async with get as r:
            await self._handle_fb_response(r)
            data = await r.json()

            for scope in data['data']:
                if scope['object'] == 'page':
                    return (
                        set(x['name'] for x in scope['fields']),
                        scope['callback_url'],
                    )

        return set(), ''
351532
def _find_usage_plans(self):
        
        logger.debug('Finding usage for Usage Plans')
        plan_count = 0
        paginator = self.conn.get_paginator('get_usage_plans')
        for resp in paginator.paginate():
            plan_count += len(resp['items'])
        self.limits['Usage plans per account']._add_current_usage(
            plan_count, aws_type='AWS::ApiGateway::UsagePlan'
        )
157375
def api_subscriptions(request, userPk, key=None, hproPk=None):
    """"""

    if not check_api_key(request, key, hproPk):
        return HttpResponseForbidden

    # From UUID to Pk
    from users.models import TechUser

    user = get_object_or_404(TechUser, pk=userPk)

    (_, _, hproject) = getPlugItObject(hproPk)

    retour = user.getActiveSubscriptionLabels(hproject)

    return HttpResponse(json.dumps(retour), content_type="application/json")
68350
def payments(self):
        """"""
        payments = self.client.subscription_payments.on(self).list()
        return payments