https://developer.zendesk.com/rest_api/docs/chat/skills#update-skill-by-id
515706
def skill_update(self, skill_id, data, **kwargs):
        ""
        api_path = "/api/v2/skills/{skill_id}"
        api_path = api_path.format(skill_id=skill_id)
        return self.call(api_path, method="PUT", data=data, **kwargs)
532883
def update_by_id(self, data, table, id_value):
        '''
        
        '''
        key_map = {}
        if len(data) == 0:
            print('请确保data被正确传入了')
            return -1
        datas = {}
        updates = ''
        for k, v in data.items():
            # 防止sql注入
            datas.update({k: pymysql.escape_string(str(v))})
        for d in datas:
            updates += "{}='{}',".format(str(d), str(datas[d]))
        if len(updates) <= 0:
            return -1
        # 生成sql语句
        sql = "update {} set {} where id = '{}'".format(
            table, updates[:-1], str(id_value))
        res = self.query(sql)
        return 1 if res != -1 else res
1024362
def update_alert(self, alert_id, alert, fields=[]):
        
        req = self.url + "/api/alert/{}".format(alert_id)

        # update only the alert attributes that are not read-only
        update_keys = ['tlp', 'severity', 'tags', 'caseTemplate', 'title', 'description']

        data = {k: v for k, v in alert.__dict__.items() if
                (len(fields) > 0 and k in fields) or (len(fields) == 0 and k in update_keys)}

        if hasattr(alert, 'artifacts'):
            data['artifacts'] = [a.__dict__ for a in alert.artifacts]
        try:
            return requests.patch(req, headers={'Content-Type': 'application/json'}, json=data, proxies=self.proxies, auth=self.auth, verify=self.cert)
        except requests.exceptions.RequestException:
            raise AlertException("Alert update error: {}".format(e))
1326811
def update_project(id, **kwargs):
    
    content = update_project_raw(id, **kwargs)
    if content:
        return utils.format_json(content)
1014737
def create_update(self, trainer, xp, time_updated=None):
		
		
		if isinstance(trainer, Trainer):
			trainer = trainer.id
		url = api_url+'trainers/'+str(trainer)+'/updates/'
		payload = {'trainer' : int(trainer), 'xp' : int(xp)}
		
		if time_updated is None:
			payload['update_time'] = maya.now().iso8601()
		else:
			payload['update_time'] = time_updated.iso8601()
		if self.identifier:
			payload['meta_source'] = self.identifier
		
		r = requests.post(url, data=json.dumps(payload), headers=self.headers)
		print(request_status(r))
		r.raise_for_status()
		return Update(r.json())
1222159
def update_resource(id_or_uri, resource, opts = {})
      data, _status_code, _headers = update_resource_with_http_info(id_or_uri, resource, opts)
      return data
    end
72208
async def update(self, _id=None, **new_data):
		
		if not _id or not new_data:
			return {"error":400, 
					"reason":"Missed required fields"}

		document = await self.collection.find_one({"id":_id})
		if not document:
			return {"error":404, 
					"reason":"Not found"}

		for key in new_data:
			await self.collection.find_one_and_update(
							{"id": _id},
							{"$set": {key: new_data[key]}}
						)
		updated = await self.collection.find_one({"id":_id})
		return {"success":200, "reason": "Updated", **updated}
453414
def update(context, resource, **kwargs):
    """"""
    etag = kwargs.pop('etag')
    id = kwargs.pop('id')
    data = utils.sanitize_kwargs(**kwargs)
    uri = '%s/%s/%s' % (context.dci_cs_api, resource, id)
    r = context.session.put(uri, timeout=HTTP_TIMEOUT,
                            headers={'If-match': etag},
                            json=data)
    return r
825856
def load_skills_data() -> dict:
    """"""
    skills_data_file = expanduser('~/.mycroft/skills.json')
    if isfile(skills_data_file):
        try:
            with open(skills_data_file) as f:
                return json.load(f)
        except json.JSONDecodeError:
            return {}
    else:
        return {}
920773
function update(req, res, next) {
  var params = {
    appId: req.params.id || req.body._id,
    forms: req.body.forms || []
  };
  forms.updateAppForms(req.connectionOptions, params, formsResultHandlers(constants.resultTypes.formProjects, req, next));
}
65471
def agent_update(self, agent_id, data, **kwargs):
        ""
        api_path = "/api/v2/agents/{agent_id}"
        api_path = api_path.format(agent_id=agent_id)
        return self.call(api_path, method="PUT", data=data, **kwargs)
33003
def update_question_group(self, id, quiz_id, course_id, quiz_groups_name=None, quiz_groups_pick_count=None, quiz_groups_question_points=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # REQUIRED - PATH - quiz_id
        """ID"""
        path["quiz_id"] = quiz_id

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        # OPTIONAL - quiz_groups[name]
        """The name of the question group."""
        if quiz_groups_name is not None:
            data["quiz_groups[name]"] = quiz_groups_name

        # OPTIONAL - quiz_groups[pick_count]
        """The number of questions to randomly select for this group."""
        if quiz_groups_pick_count is not None:
            data["quiz_groups[pick_count]"] = quiz_groups_pick_count

        # OPTIONAL - quiz_groups[question_points]
        """The number of points to assign to each question in the group."""
        if quiz_groups_question_points is not None:
            data["quiz_groups[question_points]"] = quiz_groups_question_points

        self.logger.debug("PUT /api/v1/courses/{course_id}/quizzes/{quiz_id}/groups/{id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("PUT", "/api/v1/courses/{course_id}/quizzes/{quiz_id}/groups/{id}".format(**path), data=data, params=params, no_data=True)
21022
def update(self, uid):
        '''
        
        '''
        if self.userinfo.role[1] >= '3':
            pass
        else:
            return False
        post_data = self.get_post_data()

        post_data['user_name'] = self.get_current_user()

        if self.is_p:
            if MLink.update(uid, post_data):
                output = {
                    'addinfo ': 1,
                }
            else:
                output = {
                    'addinfo ': 0,
                }
            return json.dump(output, self)
        else:
            if MLink.update(uid, post_data):
                self.redirect('/link/list')
1014366
def update_security_of_password(self, ID, data):
        """"""
        # http://teampasswordmanager.com/docs/api-passwords/#update_security_password
        log.info('Update security of password %s with %s' % (ID, data))
        self.put('passwords/%s/security.json' % ID, data)
74395
def edit_project(self, id_, **kwargs):
        
        data = self._wrap_dict("project", kwargs)
        return self.patch("/projects/{}.json".format(id_), data=data)
666692
public void update(int id, String name) {
        String url = WxEndpoint.get("url.group.update");
        String json = String.format("{\"group\":{\"id\":%s,\"name\":\"%s\"}}", id, name);
        logger.debug("update group: {}", json);
        wxClient.post(url, json);
    }
201151
def update_trainer(self, trainer, username=None, start_date=None, has_cheated=None, last_cheated=None, currently_cheats=None, statistics=None, daily_goal=None, total_goal=None, prefered=None):
		""""""
		args = locals()
		if not isinstance(trainer, Trainer):
			raise ValueError
		url = api_url+'trainers/'+str(trainer.id)+'/'
		payload = {
			'last_modified': maya.now().iso8601()
		}
		
		for i in args:
			if args[i] is not None and i not in ['self', 'trainer', 'start_date']:
				payload[i] = args[i]
			elif args[i] is not None and i=='start_date':
				payload[i] = args[i].date().isoformat()
		
		r = requests.patch(url, data=json.dumps(payload), headers=self.headers)
		print(request_status(r))
		r.raise_for_status()
		return Trainer(r.json())