Sets user_info dict entry through a tuple.
965955
def user_info(self, kv):
        """"""

        key, value = kv
        self.__user_info[key] = value
72047
private void setUserInfo(CmsUser user, String key, String value) {

        if (!CmsStringUtil.isEmptyOrWhitespaceOnly(value)) {
            user.getAdditionalInfo().put(key, value);
        }
    }
53391
def add_infos(self, *keyvals, **kwargs):
    """"""
    kv_pairs = []
    for key, val in keyvals:
      key = key.strip()
      val = str(val).strip()
      if ':' in key:
        raise ValueError('info key "{}" must not contain a colon.'.format(key))
      kv_pairs.append((key, val))

    for k, v in kv_pairs:
      if k in self._info:
        raise ValueError('info key "{}" already exists with value {}. '
                         'Cannot add it again with value {}.'.format(k, self._info[k], v))
      self._info[k] = v

    try:
      with open(self._info_file, 'a') as outfile:
        for k, v in kv_pairs:
          outfile.write('{}: {}\n'.format(k, v))
    except IOError:
      if not kwargs.get('ignore_errors', False):
        raise
904036
def setLogEntries(self, entries, save=True, update_policies=True):
        """"""
        prev = None;  # "previous" valid entry for "Prev" link
        uplink = os.path.join("..", Purr.RenderIndex.INDEX);  # "Up" link
        self.entries = []
        for entry in entries:
            if not entry.ignore:
                entry.setPrevUpNextLinks(prev=prev, up=uplink)
                prev = entry
                self.entries.append(entry)
        if save:
            self.save()
        if update_policies:
            # populate default policies and renames based on entry list
            self._default_dp_props = {}
            for entry in entries:
                self.updatePoliciesFromEntry(entry)
            dprint(4, "default policies:", self._default_dp_props)
999051
def _get_user_info(self, access_token):
        """"""
        info_response = self._call('GET', self.info_url, params={'access_token': access_token})
        user_info = info_response.get('info')
        return user_info
955977
def add_data_dict(self, datadict):
        '''
        '''

        self.set_codes(list(datadict.keys()))
        self.add_data(list(datadict.values()))
653433
def _add_details(self, info):
        
        for (key, val) in six.iteritems(info):
            if isinstance(key, six.text_type) and six.PY2:
                key = key.encode(pyrax.get_encoding())
            elif isinstance(key, bytes):
                key = key.decode("utf-8")
            setattr(self, key, val)
840386
def user(ctx, username, password):
    """"""

    ctx.obj['username'] = username
    ctx.obj['password'] = password
412698
def set_entries(module_name, name_value_lists)
    login! unless logged_in?
    json = <<-EOF
      {
        "session": "#{@sugar_session_id}",
        "module_name": "#{module_name}",
        "name_value_list": #{name_value_lists.to_json}
      }
    EOF
    json.gsub!(/^\s{6}/,'')
    send!(:set_entries, json)
  end
674819
def set_item_data(self, item, filename, line_number):
        """"""
        set_item_user_text(item, '%s%s%d' % (filename, self.SEP, line_number))
1039262
def cli(obj, show_userinfo):
    """"""
    client = obj['client']
    userinfo = client.userinfo()
    if show_userinfo:
        for k, v in userinfo.items():
            if isinstance(v, list):
                v = ', '.join(v)
            click.echo('{:20}: {}'.format(k, v))
    else:
        click.echo(userinfo['preferred_username'])
1136545
def set_attrs(self, username, attrs):
        
        ldap_client = self._bind()
        tmp = self._get_user(self._byte_p2(username), ALL_ATTRS)
        if tmp is None:
            raise UserDoesntExist(username, self.backend_name)
        dn = self._byte_p2(tmp[0])
        old_attrs = tmp[1]
        for attr in attrs:
            bcontent = self._byte_p2(attrs[attr])
            battr = self._byte_p2(attr)
            new = {battr: self._modlist(self._byte_p3(bcontent))}
            # if attr is dn entry, use rename
            if attr.lower() == self.dn_user_attr.lower():
                ldap_client.rename_s(
                    dn,
                    ldap.dn.dn2str([[(battr, bcontent, 1)]])
                    )
                dn = ldap.dn.dn2str(
                    [[(battr, bcontent, 1)]] + ldap.dn.str2dn(dn)[1:]
                    )
            else:
                # if attr is already set, replace the value
                # (see dict old passed to modifyModlist)
                if attr in old_attrs:
                    if type(old_attrs[attr]) is list:
                        tmp = []
                        for value in old_attrs[attr]:
                            tmp.append(self._byte_p2(value))
                        bold_value = tmp
                    else:
                        bold_value = self._modlist(
                            self._byte_p3(old_attrs[attr])
                        )
                    old = {battr: bold_value}
                # attribute is not set, just add it
                else:
                    old = {}
                ldif = modlist.modifyModlist(old, new)
                if ldif:
                    try:
                        ldap_client.modify_s(dn, ldif)
                    except Exception as e:
                        ldap_client.unbind_s()
                        self._exception_handler(e)

        ldap_client.unbind_s()
370614
def _hook_id(self, info):
        
        if isinstance(info, dict) and 'id' in info.keys():
            self.id = info['id']
487267
def put_info(self, key, value):
        
        return self.instance.put_task_info(self.name, key, value)
1329003
def _maybe_init_user(self):
    """"""
    user_name = os.environ.get('USER', '') or os.environ.get('USERNAME', '')
    cursor = self._db.cursor()
    cursor.execute('SELECT user_id FROM Users WHERE user_name = ?',
                   (user_name,))
    row = cursor.fetchone()
    if row:
      return row[0]
    user_id = self._create_id()
    cursor.execute(
        """
        INSERT INTO USERS (user_id, user_name, inserted_time)
        VALUES (?, ?, ?)
        """,
        (user_id, user_name, time.time()))
    return user_id
1336129
def update_user(self, user, username=None, first_name=None, last_name=None):
		""""""
		
		if not isinstance(user, User):
			raise ValueError
		args = locals()
		url = api_url+'users/'+str(user.id)+'/'
		payload = {}
		for i in args:
			if args[i] is not None and i not in ['self', 'user']:
				payload[i] = args[i]
		r = requests.patch(url, data=json.dumps(payload), headers=self.headers)
		print(request_status(r))
		r.raise_for_status()
		return User(r.json())
961719
def set(self, attr_dict):
    
    for key in attr_dict:
      if key == self._id_attribute:
        setattr(self, self._id_attribute, attr_dict[key])
      else:
        setattr(self, u"_" + key, attr_dict[key])
    return self