Add a new profile. Adding a profile will not do nothing about initialization
559887
function(name, force, callback) {
    var err = null;
    var profiles = this.all();

    if (~profiles.indexOf(name)) {
      err = 'Profile "' + name + '" already exists.';

    } else if (!force && ~RESERVED_PROFILE_NAME.indexOf(name)) {
      err = 'Profile name "' + name + '" is reserved by `multi-profile`';

    } else if (/^_/.test(name)) {
      err = 'Profile name "' + name + '" should not begin with `_`';

    } else {
      profiles.push(name);
      this.attr.set('profiles', profiles);
    }

    var data = {
      err: err,
      name: name
    };
    this.emit('add', data);

    callback && callback(err, data);
  }
191154
private void putInCache(UserProfile profile)
   {
      cache.put(profile.getUserName(), profile, CacheType.USER_PROFILE);
   }
596722
public void setProfile(OperaProfile profile) {
    options.get(PROFILE).setValue(PROFILE.sanitize(profile));
    supportsPd = true;
  }
1197897
def load(
        cls, name=None, parent_name=None, profile_is_live=False, values=None, defaults=None
    ) -> "EnvvarProfile":
        
        instance = cls(
            name=name,
            parent_name=parent_name,
            profile_is_live=profile_is_live,
            values=values,
            defaults=defaults,
        )
        instance._do_load()
        return instance
637826
public void updateProfile(ProfileUpdate profile) {
		getResourceFactory().getApiResource("/user/profile/")
				.entity(profile, MediaType.APPLICATION_JSON_TYPE).put();
	}
1308299
def profile_create(self):
        """"""
        if self.args.profile_name in self.profiles:
            self.handle_error('Profile "{}" already exists.'.format(self.args.profile_name))

        # load the install.json file defined as a arg (default: install.json)
        ij = self.load_install_json(self.args.ij)

        print(
            'Building Profile: {}{}{}'.format(c.Style.BRIGHT, c.Fore.CYAN, self.args.profile_name)
        )
        profile = OrderedDict()
        profile['args'] = {}
        profile['args']['app'] = {}
        profile['args']['app']['optional'] = self.profile_settings_args(ij, False)
        profile['args']['app']['required'] = self.profile_settings_args(ij, True)
        profile['args']['default'] = self.profile_setting_default_args(ij)
        profile['autoclear'] = True
        profile['clear'] = []
        profile['description'] = ''
        profile['data_files'] = []
        profile['exit_codes'] = [0]
        profile['groups'] = [os.environ.get('TCEX_GROUP', 'qa-build')]
        profile['install_json'] = self.args.ij
        profile['profile_name'] = self.args.profile_name
        profile['quiet'] = False

        if ij.get('runtimeLevel') == 'Playbook':
            validations = self.profile_settings_validations
            profile['validations'] = validations.get('rules')
            profile['args']['default']['tc_playbook_out_variables'] = '{}'.format(
                ','.join(validations.get('outputs'))
            )
        return profile
1034080
private void saveUserProfile(Session session, UserProfile profile, boolean broadcast) throws RepositoryException,
      Exception
   {
      Node userNode = utils.getUserNode(session, profile.getUserName());
      Node profileNode = getProfileNode(userNode);

      boolean isNewProfile = profileNode.isNew();

      if (broadcast)
      {
         preSave(profile, isNewProfile);
      }

      writeProfile(profile, profileNode);

      session.save();
      putInCache(profile);

      if (broadcast)
      {
         postSave(profile, isNewProfile);
      }
   }
1193160
@Override
    public UserProfile addUserProfile(final IPerson person, final IUserProfile profile) {
        final int userId = person.getID();
        final int layoutId = getLayoutId(person, profile);
        // generate an id for this profile

        return jdbcOperations.execute(
                (ConnectionCallback<UserProfile>)
                        con -> {
                            String sQuery;
                            PreparedStatement pstmt =
                                    con.prepareStatement(
                                            "INSERT INTO UP_USER_PROFILE "
                                                    + "(USER_ID, PROFILE_ID, PROFILE_FNAME, PROFILE_NAME, STRUCTURE_SS_ID, THEME_SS_ID,"
                                                    + "DESCRIPTION, LAYOUT_ID) VALUES (?,?,?,?,?,?,?,?)");
                            int profileId = getNextKey();
                            pstmt.setInt(1, userId);
                            pstmt.setInt(2, profileId);
                            pstmt.setString(3, profile.getProfileFname());
                            pstmt.setString(4, profile.getProfileName());
                            pstmt.setInt(5, profile.getStructureStylesheetId());
                            pstmt.setInt(6, profile.getThemeStylesheetId());
                            pstmt.setString(7, profile.getProfileDescription());
                            pstmt.setInt(8, layoutId);
                            sQuery =
                                    "INSERT INTO UP_USER_PROFILE (USER_ID, PROFILE_ID, PROFILE_FNAME, PROFILE_NAME, STRUCTURE_SS_ID, THEME_SS_ID, DESCRIPTION, LAYOUT_ID) VALUES ("
                                            + userId
                                            + ",'"
                                            + profileId
                                            + ",'"
                                            + profile.getProfileFname()
                                            + "','"
                                            + profile.getProfileName()
                                            + "',"
                                            + profile.getStructureStylesheetId()
                                            + ","
                                            + profile.getThemeStylesheetId()
                                            + ",'"
                                            + profile.getProfileDescription()
                                            + "', "
                                            + profile.getLayoutId()
                                            + ")";
                            logger.debug("addUserProfile(): {}", sQuery);
                            try {
                                pstmt.executeUpdate();

                                UserProfile newProfile = new UserProfile();
                                newProfile.setProfileId(profileId);
                                newProfile.setLayoutId(layoutId);
                                newProfile.setLocaleManager(profile.getLocaleManager());
                                newProfile.setProfileDescription(profile.getProfileDescription());
                                newProfile.setProfileFname(profile.getProfileFname());
                                newProfile.setProfileName(profile.getProfileName());
                                newProfile.setStructureStylesheetId(
                                        profile.getStructureStylesheetId());
                                newProfile.setSystemProfile(false);
                                newProfile.setThemeStylesheetId(profile.getThemeStylesheetId());

                                return newProfile;

                            } finally {
                                pstmt.close();
                            }
                        });
    }
873461
def add_profiler(self, id, profiler):
        
        if not self.profilers:
            if self.profile_dump_path:
                atexit.register(self.dump_profiles, self.profile_dump_path)
            else:
                atexit.register(self.show_profiles)

        self.profilers.append([id, profiler, False])
454583
def install_API_key(api_key, profile_name='default'):
    """"""
    fname = API_profile_fname(profile_name)
    if not os.path.isdir(os.path.dirname(fname)):
        os.makedirs(os.path.dirname(fname))
    with open(fname, 'w') as fh:
        fh.write(api_key)
1223028
def save_profile(self, profile):
        
        profile = profile.replace('.json', '')
        profile_path = os.path.join(
            self.root_directory,
            'minimum_needs',
            profile + '.json'
        )
        self.write_to_file(profile_path)
958248
def profile
      unless @profile
        if associated_profile
          @profile = Profile.new(associated_profile)
        else
          options = {:fields => 'user_id', :includes => 'Profile'}
          options = options.merge(:access_token => token, :access_secret => secret) if (token && secret)
          tmp = User.find(username, options)
          @profile = Profile.new(tmp.associated_profile)
        end
      end
      @profile
    end
161075
def keypair_add(name, pubfile=None, pubkey=None, profile=None, **kwargs):
    '''
    
    '''
    conn = _auth(profile, **kwargs)
    return conn.keypair_add(
        name,
        pubfile,
        pubkey
    )
484755
def add_profile(self, profile, selected):
        """"""
        report = Report(profile)
        report.selected = selected
        if selected:
            self.report['settings']['selected_profiles'].append(report.name)
            self.report['settings']['selected_profile_count'] += 1
        self.report['settings']['total_profile_count'] += 1
        self.profiles.setdefault(report.name, report)
        return report
51428
public AccountHeaderBuilder addProfiles(@NonNull IProfile... profiles) {
        if (this.mProfiles == null) {
            this.mProfiles = new ArrayList<>();
        }
        if (mDrawer != null) {
            mDrawer.mDrawerBuilder.idDistributor.checkIds(profiles);
        }
        Collections.addAll(this.mProfiles, profiles);

        return this;
    }
716343
function(profiles) {
			profiles = utils.parseJSON(profiles);
			Object.keys(profiles).forEach(function(name) {
				profile.create(name, normalizeProfile(profiles[name]));
			});
		}
1001019
def saveProfile( self ):
        
        manager = self.parent()
        prof    = manager.currentProfile()
        
        # save the current profile
        save_prof = manager.viewWidget().saveProfile()
        prof.setXmlElement(save_prof.xmlElement())