Post a subscriptionfor the given netid
    and category_code
174493
def update_catagory(netid, category_code, status):
    
    url = "{0}/category".format(url_version())
    body = {
        "categoryCode": category_code,
        "status": status,
        "categoryList": [{"netid": netid}]
    }

    response = post_resource(url, json.dumps(body))
    return json.loads(response)
1112101
def organization_subscription_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/organization_subscriptions.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
740304
def fetch(self, subscription_id, data={}, **kwargs):
        "
        return super(Subscription, self).fetch(subscription_id, data, **kwargs)
1350846
def post(self, request, bot_id, format=None):
        
        return super(HookList, self).post(request, bot_id, format)
1067800
def subscribe(self, topic, channel):
        """"""
        self.send(nsq.subscribe(topic, channel))
1147287
def subscribe(self, event):
        """"""
        uuids = event.data

        if not isinstance(uuids, list):
            uuids = [uuids]

        subscribed = []
        for uuid in uuids:
            try:
                self._add_subscription(uuid, event)
                subscribed.append(uuid)
            except KeyError:
                continue

        result = {
            'component': 'hfos.events.objectmanager',
            'action': 'subscribe',
            'data': {
                'uuid': subscribed, 'success': True
            }
        }
        self._respond(None, result, event)
365615
def _netid_subscription_url(netid, subscription_codes):
    
    return "{0}/{1}/subscription/{2}".format(
        url_base(), netid,
        (','.join([str(n) for n in subscription_codes])
         if isinstance(subscription_codes, (list, tuple))
         else subscription_codes))
33057
def subscribe(self, feedUrl):
        
        response = self.httpPost(
            ReaderUrl.SUBSCRIPTION_EDIT_URL,
            {'ac':'subscribe', 's': feedUrl})
        # FIXME - need better return API
        if response and 'OK' in response:
            return True
        else:
            return False
1283380
def subscribe(self, *args, **kwargs):
        
        for address in args:
            try:
                self.messaging.subscription_socket.connect(address)
            except Exception:
                raise RuntimeError('addresses need to be in the form of: tcp://address_here:port_number'
                                   ' example: tcp://10.2.3.4:80'
                                   'address tried {}'.format(address))
590956
def from_id(reddit_session, subreddit_id):
        """"""
        pseudo_data = {'id': subreddit_id,
                       'permalink': '/comments/{0}'.format(subreddit_id)}
        return Submission(reddit_session, pseudo_data)
485597
function subscribeNode (client, subscriptions, channel, callback, done_callback) {
    if (subscriptions[channel]===undefined) {
        subscriptions[channel] = [callback];
        client.subscribe(channel, {qos: 0}, function() {
            // If there is a done_callback defined, execute it
            if (done_callback!==undefined) done_callback();
        });
    } else {
        subscriptions[channel].push(callback);
    }
}
497527
def push_subscription_update(self, follow_events=None, 
                              favourite_events=None, reblog_events=None, 
                              mention_events=None):
        
        params = {}
        
        if follow_events != None:
            params['data[alerts][follow]'] = follow_events
        
        if favourite_events != None:
            params['data[alerts][favourite]'] = favourite_events
            
        if reblog_events != None:
            params['data[alerts][reblog]'] = reblog_events
            
        if mention_events != None:
            params['data[alerts][mention]'] = mention_events
            
        return self.__api_request('PUT', '/api/v1/push/subscription', params)
1161486
function initiateSubscribe(clientObj) {
  this.__channels = {};
  var self = this;
  clientObj.subscribe('internalPing');
  clientObj.on('message', function(channelName, message) {
    if (channelName === 'internalPing') return;  // this is our internal channel for ping
    if (typeof self.__channels[channelName] === 'undefined') return; // we have no channel.
    try {
      var data = JSON.parse(message);
    } catch (e) {
      data = message;
    }
    for (var i = 0; i < self.__channels[channelName].length; i++) {
      self.__channels[channelName][i](data);
    }
  });
}
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);
    }
1135534
function updateSubscribers(req, res, next) {
  var updateSubscribersParams = {
    _id: req.params.id
  };

  var subscribers = req.body.subscribers;

  logger.debug("Middleware: listSubscribers: ", {params: updateSubscribersParams, subscribers: subscribers});

  forms.updateNotifications(_.extend(req.connectionOptions, updateSubscribersParams), subscribers, formsResultHandlers(constants.resultTypes.forms, req, next));
}
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")
1311462
def community_topic_subscription_create(self, topic_id, data, **kwargs):
        ""
        api_path = "/api/v2/community/topics/{topic_id}/subscriptions.json"
        api_path = api_path.format(topic_id=topic_id)
        return self.call(api_path, method="POST", data=data, **kwargs)