Search for all subscriptions by a given channel and person
495346
def get_subscriptions_by_channel_id_and_person_id(
            self, channel_id, person_id):
        
        return self.search_subscriptions(
            channel_id=channel_id, person_id=person_id)
25889
def get_channels(self):
        
        selectedItems = self.idx_chan.selectedItems()
        selected_chan = [x.text() for x in selectedItems]
        chan_in_order = []
        for chan in self.chan:
            if chan in selected_chan:
                chan_in_order.append(chan)

        return chan_in_order
333792
function(channel, subscription, context, once) {
      if (!channels[channel]) channels[channel] = [];
      channels[channel].push({fn: subscription, context: context || this, once: once});
    }
29110
def list_channels(self, owner):
        '''
        '''
        url = '%s/channels/%s' % (self.domain, owner)

        res = self.session.get(url)
        self._check_response(res, [200])
        return res.json()
1087866
def subscribe_to(channel, opts = {})
      js_tag = opts.delete(:include_js_tag){ true }
      subscription = Danthes.subscription(channel: channel)
      content = raw("if (typeof Danthes != 'undefined') { Danthes.sign(#{subscription.to_json}) }")
      js_tag ? content_tag('script', content, type: 'text/javascript') : content
    end
755745
def find_subscription(self, identifier):
        
        for subscription in self.subscriptions.values():
            if subscription.identifier == identifier:
                return subscription
385792
public function userSubscriptionChannel($channel, $user, $token = null)
    {
        return $this->sendRequest('GET', 'users/'.$user.'/subscriptions/'.$channel, $this->getToken($token));
    }
207499
def _fetch_channels(self):
        """"""
        json = requests.get(self._channels_url).json()
        self._channels = {c['channel']['code']: c['channel']['name']
                          for c in json['channels']}
69261
function parseChannel(channel){
        var parts = _.without(channel.split('/'), ''),
            filter = {};

        _.each(parts, function(item, index){
            if(index % 2 === 0) {
                filter[item] = parts[index + 1];
            }
        });

        if(!_.isUndefined(filter.node)){
            filters.nodes.push(filter.node);
        }

        if(!_.isUndefined(filter.system)){
            filters.system.push(filter.system);
        }

        if(!_.isUndefined(filter.type)){
            filters.types.push(filter.type);
        }

        if(!_.isUndefined(filter.contentid)){
            filters.contentids.push(filter.contentid);
        }
    }
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)
740304
def fetch(self, subscription_id, data={}, **kwargs):
        "
        return super(Subscription, self).fetch(subscription_id, data, **kwargs)
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()
1006436
function findSubscribersRecursively( node, parts, subscribers ) {
   if( Array.isArray( node[ SUBSCRIBER_FIELD ] ) ) {
      subscribers.push( ...node[ SUBSCRIBER_FIELD ] );
   }

   if( parts.length === 0 ) {
      return;
   }

   const [ part, ...remainder ] = parts;
   if( part.indexOf( SUB_TOPIC_SEPARATOR ) !== -1 ) {
      let index = part.length;
      let currentPart = part;
      do {
         currentPart = currentPart.substring( 0, index );
         if( currentPart in node ) {
            findSubscribersRecursively( node[ currentPart ], remainder, subscribers );
         }
         index = currentPart.lastIndexOf( SUB_TOPIC_SEPARATOR );
      }
      while( index !== -1 );
   }
   else if( part in node ) {
      findSubscribersRecursively( node[ part ], remainder, subscribers );
   }

   if( WILDCARD in node ) {
      findSubscribersRecursively( node[ WILDCARD ], remainder, subscribers );
   }
}
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
314040
def list_subscribers(self, list_id):
        
        return [User(user._json) for user in self._client.list_subscribers(list_id=list_id)]
905112
def channels(self, pattern=None):
        '''
        '''
        if pattern:
            return self.store.execute('PUBSUB', 'CHANNELS', pattern)
        else:
            return self.store.execute('PUBSUB', 'CHANNELS')
477136
def get_subscriptions(self, publication_id=None, owner_id=None,
                          since_when=None, limit_to=200, max_calls=None,
                          start_record=0, verbose=False):
        
        query = "SELECT Objects() FROM Subscription"

        # collect all where parameters into a list of
        # (key, operator, value) tuples
        where_params = []

        if owner_id:
            where_params.append(('owner', '=', "'%s'" % owner_id))
        if publication_id:
            where_params.append(('publication', '=', "'%s'" % publication_id))
        if since_when:
            d = datetime.date.today() - datetime.timedelta(days=since_when)
            where_params.append(
                ('LastModifiedDate', ">", "'%s 00:00:00'" % d))

        if where_params:
            query += " WHERE "
            query += " AND ".join(
                ["%s %s %s" % (p[0], p[1], p[2]) for p in where_params])

        subscription_list = self.get_long_query(
            query, limit_to=limit_to, max_calls=max_calls,
            start_record=start_record, verbose=verbose)

        return subscription_list