POST /users/:id/contact_lists/:contact_list_id/contacts/
        Adds a new contact to the contact list. Returns ``{"created": true}``.
        There is no way to update entries in the list; just delete the old one
        and add the updated version.
354056
def post_user_contact_lists_contacts(self, id, contact_list_id, **data):
        
        
        return self.post("/users/{0}/contact_lists/{0}/contacts/".format(id,contact_list_id), data=data)
1247940
def add_contact(self, segment_id, contact_id):
        

        response = self._client.session.post(
            '{url}/{segment_id}/contact/add/{contact_id}'.format(
                url=self.endpoint_url,
                segment_id=segment_id,
                contact_id=contact_id
            )
        )
        return self.process_response(response)
843041
def delete_user_contact_list(self, id, contact_list_id, **data):
        
        
        return self.delete("/users/{0}/contact_lists/{0}/".format(id,contact_list_id), data=data)
1172268
def add_parent(sender, instance, **kwargs):
    
    if not kwargs['created']:
        return
    for att in ['task', 'context']:
        parent = getattr(instance, att).item_id
        child = instance.item_id
        ItemRelation.objects.get_or_create(
            parent_id=parent,
            child_id=child,
            visible=True,
        )
825435
def add_or_update(user_id, post_id, kind):
        '''
        
        '''

        rec = MUsage.query_by_signature(user_id, post_id)
        cate_rec = MInfor2Catalog.get_first_category(post_id)
        if cate_rec:
            cat_id = cate_rec.tag_id
        else:
            return False

        if rec.count() > 0:
            logger.info('Usage update: {uid}'.format(uid=post_id))
            rec = rec.get()
            query = TabUsage.update(kind=kind).where(TabUsage.uid == rec.uid)
            query.execute()
            MUsage.count_increate(rec.uid, cat_id, rec.count)
        else:
            logger.info('Usage create: {uid}'.format(uid=post_id))
            TabUsage.create(
                uid=tools.get_uuid(),
                post_id=post_id,
                user_id=user_id,
                count=1,
                tag_id=cat_id,
                timestamp=int(time.time()),
                kind=kind,
            )
795580
def _add_request_entry(self, entry=()):
        
        if not self._lookup_request_entry(entry):
            self.request_entry.append(entry)
1274676
def updated(self, user, options):
        
        for comment in self.comments:
            created = dateutil.parser.parse(comment["created"]).date()
            try:
                if (comment["author"]["emailAddress"] == user.email and
                        created >= options.since.date and
                        created < options.until.date):
                    return True
            except KeyError:
                pass
        return False
865118
def _add(self):
        
        is_valid_form = True
        get_filter_args(self._filters)
        exclude_cols = self._filters.get_relation_cols()
        form = self.add_form.refresh()

        if request.method == "POST":
            self._fill_form_exclude_cols(exclude_cols, form)
            if form.validate():
                self.process_form(form, True)
                item = self.datamodel.obj()
                form.populate_obj(item)

                try:
                    self.pre_add(item)
                except Exception as e:
                    flash(str(e), "danger")
                else:
                    if self.datamodel.add(item):
                        self.post_add(item)
                    flash(*self.datamodel.message)
                finally:
                    return None
            else:
                is_valid_form = False
        if is_valid_form:
            self.update_redirect()
        return self._get_add_widget(form=form, exclude_cols=exclude_cols)
786343
def _create_entry(self, url, title, tags):
        
        try:
            self.pocket.add(url=url, title=title, tags=tags)
            sentence = str('pocket {} created').format(url)
            logger.debug(sentence)
            status = True
        except Exception as e:
            logger.critical(e)
            update_result(self.trigger_id, msg=e, status=False)
            status = False
        return status
488516
def update(self):
        

        if not self.calendar_id:
            return False

        url = self.build_url(self._endpoints.get('calendar'))

        data = {
            self._cc('name'): self.name,
            self._cc('color'): self._cc(self.color.value
                                        if isinstance(self.color, CalendarColor)
                                        else self.color)
        }

        response = self.con.patch(url, data=data)

        return bool(response)
1260410
public Contact updateContact(final String id, ContactRequest contactRequest) throws UnauthorizedException, GeneralException {
        if (id == null) {
            throw new IllegalArgumentException("Contact ID must be specified.");
        }
        String request = CONTACTPATH + "/" + id;
        return messageBirdService.sendPayLoad("PATCH", request, contactRequest, Contact.class);
    }
599454
def update_contact(self, contact_id, email=None, name=None):
        
        params = {}

        if email is not None:
            params['email'] = email

        if name is not None:
            params['name'] = name

        url = self.CONTACTS_ID_URL % contact_id

        connection = Connection(self.token)
        connection.set_url(self.production, url)
        connection.add_header('Content-Type', 'application/json')
        connection.add_params(params)

        return connection.patch_request()
1115918
def add(self, post_id):
        '''
        
        '''
        post_data = self.get_post_data()

        post_data['user_name'] = self.userinfo.user_name
        post_data['user_id'] = self.userinfo.uid
        post_data['post_id'] = post_id
        replyid = MReply.create_reply(post_data)
        if replyid:
            out_dic = {'pinglun': post_data['cnt_reply'],
                       'uid': replyid}
            logger.info('add reply result dic: {0}'.format(out_dic))
            return json.dump(out_dic, self)
963391
private void addNewContact() {
		String name = newNameField.getText();
		if (name != null && !"".equals(name)) {
			List list = new ArrayList(repeater.getBeanList());
			list.add(new ContactDetails(name, null, new String[0]));
			repeater.setBeanList(list);
		}
		newNameField.setText("");
	}
198467
def delete_contact(self, contact_id):
        
        url = self.CONTACTS_ID_URL % contact_id

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

        return connection.delete_request()
1324571
def add_contact_to_group(self, contact, group):
        

        if isinstance(contact, basestring):
            contact = self.get_contact(contact)

        if isinstance(group, basestring):
            group = self.get_group(group)

        method, url = get_URL('contacts_add_to_group')

        payload = {
            'apikey': self.config.get('apikey'),
            'logintoken': self.session.cookies.get('logintoken'),
            'contactid': contact['contactid'],
            'contactgroupid': group['contactgroupid']
            }

        res = getattr(self.session, method)(url, params=payload)

        if res.status_code == 200:
            return True

        hellraiser(res)
632582
public function updateContactList($contactListId, array $data = [])
	{
		return $this->sendRequest(
			$this->createRequest('PATCH', sprintf('contact_lists/%d', $contactListId), [], $data)
		);
	}