Update a user's display name
774487
def update_user_display_name(user,**kwargs):
    
    #check_perm(kwargs.get('user_id'), 'edit_user')
    try:
        user_i = db.DBSession.query(User).filter(User.id==user.id).one()
        user_i.display_name = user.display_name
        return user_i
    except NoResultFound:
        raise ResourceNotFoundError("User (id=%s) not found"%(user.id))
874115
def set_display_name(self, display_name):
        '''
        
        '''
        if self.config.legacy_upload:
            return self._legacy_set_display_name(display_name)

        system = self._fetch_system_by_machine_id()
        if not system:
            return system
        inventory_id = system[0]['id']
        req_url = self.base_url + '/inventory/v1/hosts/' + inventory_id
        try:
            net_logger.info("PATCH %s", req_url)
            res = self.session.patch(req_url, json={'display_name': display_name})
        except (requests.ConnectionError, requests.Timeout) as e:
            logger.error(e)
            logger.error('The Insights API could not be reached.')
            return False
        if (self.handle_fail_rcs(res)):
            logger.error('Could not update display name.')
            return False
        logger.info('Display name updated to ' + display_name + '.')
        return True
1154029
def clear_display_name(self):
        
        if (self.get_display_name_metadata().is_read_only() or
                self.get_display_name_metadata().is_required()):
            raise errors.NoAccess()
        self._my_map['displayName'] = self._display_name_metadata['default_string_values'][0]
838702
def update_time_reset_passwd(user_name, the_time):
        '''
        
        '''
        entry = TabMember.update(
            time_reset_passwd=the_time,
        ).where(TabMember.user_name == user_name)
        try:
            entry.execute()
            return True
        except:
            return False
1225633
def update_user(self, instance, user, name=None, password=None, host=None):
        
        return instance.update_user(user, name=name, password=password,
                host=host)
1352804
def update(self, name, modifiers):
        """"""
        self.update_name(name)
        self.modifiers = modifiers
1308105
def update_name(self):
		

		p = self.api_retrieve()
		p.name = self.name
		p.save()

		self.save()
1032329
def set_account_username(self, account, old_username, new_username):
        
        luser = self._get_account(old_username)
        rename(luser, database=self._database, uid=new_username)
309122
def _FormatUsername(self, event):
    
    username = self._output_mediator.GetUsername(event)
    return self._FormatField(username)
139474
def rename(name, new_name):
    '''
    
    '''
    current_info = info(name)
    if not current_info:
        raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
    new_info = info(new_name)
    if new_info:
        raise CommandExecutionError(
            'User \'{0}\' already exists'.format(new_name)
        )
    cmd = ['pw', 'usermod', '-l', new_name, '-n', name]
    __salt__['cmd.run'](cmd)
    post_info = info(new_name)
    if post_info['name'] != current_info['name']:
        return post_info['name'] == new_name
    return False
267761
function updateUserSettings(userId, settings, overwrite, callback) {
        return _updateUserObjectField(userId, ['settings'], settings, overwrite)
            .then(function (userData) {
                return userData.settings;
            })
            .nodeify(callback);
    }
461019
def rename(name, new_name):
    '''
    
    '''
    current_info = info(name)
    if not current_info:
        raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
    new_info = info(new_name)
    if new_info:
        raise CommandExecutionError(
            'User \'{0}\' already exists'.format(new_name)
        )
    _dscl(
        ['/Users/{0}'.format(name), 'RecordName', name, new_name],
        ctype='change'
    )
    # dscl buffers changes, sleep 1 second before checking if new value
    # matches desired value
    time.sleep(1)
    return info(new_name).get('RecordName') == new_name
1015141
@SuppressWarnings("WeakerAccess")
  public UpdateInstanceRequest setDisplayName(@Nonnull String displayName) {
    Preconditions.checkNotNull(displayName);
    builder.getInstanceBuilder().setDisplayName(displayName);
    updateFieldMask(Instance.DISPLAY_NAME_FIELD_NUMBER);

    return this;
  }
921287
def set_user_name(self, uid, name):
        
        data = [uid]
        if len(name) > 16:
            raise Exception('name must be less than or = 16 chars')
        name = name.ljust(16, "\x00")
        data.extend([ord(x) for x in name])
        self.xraw_command(netfn=0x06, command=0x45, data=data)
        return True
299614
public function actionUserNameToFirstName()
    {
        if (!CmsUser::find()->count()) {
            $this->stdout("Content not found!\n", Console::BOLD);
            return;
        }

        $this->stdout("1. Cms user name normalize!\n", Console::FG_YELLOW);

        /**
         * @var CmsUser $cmsUser
         */
        foreach (CmsUser::find()->orderBy(['id' => SORT_ASC])->each(10) as $cmsUser) {
            $this->stdout("\t User: {$cmsUser->id}\n", Console::FG_YELLOW);

            if (!$cmsUser->_to_del_name) {
                $this->stdout("\t NOT found property: _to_del_name\n", Console::FG_YELLOW);
                continue;
            }

            $name = $cmsUser->_to_del_name;
            $nameData = explode(" ", $name);

            if (isset($nameData[0])) {
                $cmsUser->first_name = trim($nameData[0]);
            }

            if (isset($nameData[1])) {
                $cmsUser->last_name = trim($nameData[1]);
            }

            if (isset($nameData[2])) {
                $cmsUser->patronymic = trim($nameData[2]);
            }


            if ($cmsUser->save()) {
                $this->stdout("\t Updated name: {$cmsUser->name}\n", Console::FG_GREEN);
            } else {
                $this->stdout("\t NOT updated name: {$cmsUser->id}\n", Console::FG_RED);
            }
        }
    }
1369706
private void resetName()
	{

		UIJob job = new UIJob("Activating Console") { //$NON-NLS-1$
			public IStatus runInUIThread(IProgressMonitor monitor)
			{

				warnOfContentChange();
				return Status.OK_STATUS;
			}
		};
		job.setSystem(true);
		job.schedule();

	}
386227
def _quote_username(name):
    '''
    
    '''
    if not isinstance(name, six.string_types):
        return str(name)  # future lint: disable=blacklisted-function
    else:
        return salt.utils.stringutils.to_str(name)