Update acccess_id of poll choices to match (changed) access_id of poll
772976
public function updateChoicesAccessID() {
		// Ignore access (necessary in case a group admin is editing the poll of another group member)
		$ia = elgg_set_ignore_access(true);

		$choices = $this->getChoices();

		foreach ($choices as $choice) {
			$choice->access_id = $this->access_id;
			$choice->save();
		}

		elgg_set_ignore_access($ia);
	}
1294541
async def get_poll(poll_id):
    
    async with aiohttp.get('{api_url}/{poll_id}'.format(api_url=api_url, poll_id=poll_id)) as r:
        return await StrawPoll(r)
655697
def editissue(self, project_id, issue_id, **kwargs):
        
        data = {'id': project_id, 'issue_id': issue_id}
        if kwargs:
            data.update(kwargs)
        request = requests.put(
            '{0}/{1}/issues/{2}'.format(self.projects_url, project_id, issue_id),
            headers=self.headers, data=data, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 200:
            return request.json()
        else:
            return False
1293292
def update(self, access_token=None, id_token=None, id_token_jwt=None, userinfo=None):
        

        def set_if_defined(session_key, value):
            if value:
                self._session_storage[session_key] = value

        auth_time = int(time.time())
        if id_token:
            auth_time = id_token.get('auth_time', auth_time)

        self._session_storage['last_authenticated'] = auth_time
        set_if_defined('access_token', access_token)
        set_if_defined('id_token', id_token)
        set_if_defined('id_token_jwt', id_token_jwt)
        set_if_defined('userinfo', userinfo)
181952
def update(self, id):
        """"""
        map = self._get_map_from_user_by_id(c.user, id)
        if map is None:
            abort(404)

        # get json content from PUT request
        content = request.environ['wsgi.input'].read(int(request.environ['CONTENT_LENGTH']))
        #content = content.decode('utf8')

        # update mapfile
        mapfile = Mapfile()
        dict = simplejson.loads(content)
        mapfile.from_dict(dict)
        mapfile.to_file(os.path.join(config['mapfiles_dir'], map.filepath))
        if mapfile.get_name() != map.name:
            self._update_map(map, name=mapfile.get_name())

        response.status = 201
        return
256234
def create_single_poll_submission(self, poll_id, poll_session_id, poll_submissions_poll_choice_id):
        
        path = {}
        data = {}
        params = {}

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

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

        # REQUIRED - poll_submissions[poll_choice_id]
        """The chosen poll choice for this submission."""
        data["poll_submissions[poll_choice_id]"] = poll_submissions_poll_choice_id

        self.logger.debug("POST /api/v1/polls/{poll_id}/poll_sessions/{poll_session_id}/poll_submissions with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/polls/{poll_id}/poll_sessions/{poll_session_id}/poll_submissions".format(**path), data=data, params=params, no_data=True)
959329
def update_credentials(self, aws_access_key_id, aws_secret_access_key):
        '''  '''
        self.aws_access_key_id = aws_access_key_id
        self.aws_secret_access_key = aws_secret_access_key
203901
def _update_access_key_pair(self, access_key_id, key, val):
        
        # Get current state via HTTPS.
        current_access_key = self.get_access_key(access_key_id)

        # Copy and only change the single parameter.
        payload_dict = KeenApi._build_access_key_dict(current_access_key)
        payload_dict[key] = val

        # Now just treat it like a full update.
        return self.update_access_key_full(access_key_id, **payload_dict)
732314
def setPollFDNotifiers(
            self, added_cb=None, removed_cb=None, user_data=None):
        
        if added_cb is None:
            added_cb = self.__null_pointer
        else:
            added_cb = libusb1.libusb_pollfd_added_cb_p(added_cb)
        if removed_cb is None:
            removed_cb = self.__null_pointer
        else:
            removed_cb = libusb1.libusb_pollfd_removed_cb_p(removed_cb)
        if user_data is None:
            user_data = self.__null_pointer
        self.__added_cb = added_cb
        self.__removed_cb = removed_cb
        self.__poll_cb_user_data = user_data
        self.__libusb_set_pollfd_notifiers(
            self.__context_p,
            self.__cast(added_cb, libusb1.libusb_pollfd_added_cb_p),
            self.__cast(removed_cb, libusb1.libusb_pollfd_removed_cb_p),
            user_data,
        )
919027
def update_index(self):
        

        # update index

        idx = {}
        for _, p in sorted(self.permissions.items(), key=lambda x: str(x[0])):
            branch = idx
            parent_p = const.PERM_DENY
            for k in p.namespace.keys:
                if not k in branch:
                    branch[k] = {"__": parent_p}
                    branch[k].update(__implicit=True)

                branch = branch[k]
                parent_p = branch["__"]
            branch["__"] = p.value
            branch["__implicit"] = False

        self.index = idx

        # update read access map

        ramap = {}

        def update_ramap(branch_idx):
            r = {"__": False}
            for k, v in list(branch_idx.items()):
                if k != "__" and k != "__implicit":
                    r[k] = update_ramap(v)

            if branch_idx["__"] is not None and (branch_idx["__"] & const.PERM_READ) != 0:
                r["__"] = True
            return r

        for k, v in list(idx.items()):
            ramap[k] = update_ramap(v)

        self.read_access_map = ramap

        return self.index
1046817
function reset_poll()
	{
		global $db;

		$db->sql_transaction('begin');
		$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
			SET poll_option_total = 0
			WHERE topic_id = ' . $this->topic_id;
		$db->sql_query($sql);

		$sql = 'DELETE FROM ' . POLL_VOTES_TABLE . '
			WHERE topic_id = ' . $this->topic_id;
		$db->sql_query($sql);

		$this->poll_start = time();
		$this->poll_last_vote = 0;
		$sql = 'UPDATE ' . TOPICS_TABLE . '
			SET poll_start = ' . $this->poll_start . ',
				poll_last_vote = 0
			WHERE topic_id = ' . $this->topic_id;
		$db->sql_query($sql);

		$db->sql_transaction('commit');
	}
977228
def update_filter_dict(d, user, status):
    
    if user is not None:
        if not user.id:
            return None
        d['user'] = user
    if status is not None:
        d['status'] = status
751109
public function getPoll($poll_id)
    {
        $this->checkId($poll_id);

        return $this->adapter->get(sprintf('/polls/%d', $poll_id));
    }
1010588
def _registry_update(s, oldid):
        '''
        
        '''
        with _lock:
            sock_queue = ApplicationLayer._to_app.pop(oldid)
            ApplicationLayer._to_app[s._sockid()] = sock_queue
1123787
def update_or_create_candidate(
        self, candidate, aggregable=True, uncontested=False
    ):
        """"""
        candidate_election, c = CandidateElection.objects.update_or_create(
            candidate=candidate,
            election=self,
            defaults={"aggregable": aggregable, "uncontested": uncontested},
        )

        return candidate_election
800551
def set_values(self, choice_ids):
        
        # if not self.my_osid_object._my_map['choices']:
        #     raise IllegalState()
        organized_choices = []
        for choice_id in choice_ids:
            choice_obj = [c for c in self._original_choice_order if c['id'] == choice_id][0]
            organized_choices.append(choice_obj)
        self.my_osid_object._my_map['choices'] = organized_choices
524592
def update_user(id, user, opts = {})
      data, _status_code, _headers = update_user_with_http_info(id, user, opts)
      return data
    end