the profile can be mine or peer's
978019
function savePrivateProfile(objPrivateProfile, address, attestor_address, onDone){
	db.query(
		"INSERT "+db.getIgnore()+" INTO private_profiles (unit, payload_hash, attestor_address, address, src_profile) VALUES(?,?,?,?,?)", 
		[objPrivateProfile.unit, objPrivateProfile.payload_hash, attestor_address, address, JSON.stringify(objPrivateProfile.src_profile)], 
		function (res) {
			var private_profile_id = (res.insertId && res.affectedRows) ? res.insertId : 0;

			var insert_fields = function(current_src_profile) {
				var arrQueries = [];
				var isSrcProfileUpdated = false;
				for (var field in objPrivateProfile.src_profile){
					var arrValueAndBlinding = objPrivateProfile.src_profile[field];
					if (ValidationUtils.isArrayOfLength(arrValueAndBlinding, 2)) {
						if (!current_src_profile || !current_src_profile[field] || !ValidationUtils.isArrayOfLength(current_src_profile[field], 2)) {
							if (current_src_profile) {
								isSrcProfileUpdated = true;
								current_src_profile[field] = arrValueAndBlinding;
							}
							db.addQuery(arrQueries, "INSERT INTO private_profile_fields (private_profile_id, field, value, blinding) VALUES(?,?,?,?)", 
							[private_profile_id, field, arrValueAndBlinding[0], arrValueAndBlinding[1] ]);
						}
					}
				}
				if (isSrcProfileUpdated)
					db.addQuery(arrQueries, "UPDATE private_profiles SET src_profile=? WHERE private_profile_id=?", [JSON.stringify(current_src_profile), private_profile_id]);
				async.series(arrQueries, onDone);
			}

			if (!private_profile_id) { // already saved profile but with new fields being revealed
				db.query("SELECT private_profile_id, src_profile FROM private_profiles WHERE payload_hash=?", [objPrivateProfile.payload_hash], function(rows) {
					if (!rows.length)
						throw Error("can't insert private profile "+JSON.stringify(objPrivateProfile));
					private_profile_id = rows[0].private_profile_id;
					var src_profile = JSON.parse(rows[0].src_profile);
					insert_fields(src_profile);
				});
			}
			else
				insert_fields();

		}
	);
}
947505
function (userId, user, fields, modifier) {
    // make sure it is our record
    if (user._id !== userId)
      return false;

    // user can only modify the 'profile' field. sets to multiple
    // sub-keys (eg profile.foo and profile.bar) are merged into entry
    // in the fields list.
    if (fields.length !== 1 || fields[0] !== 'profile')
      return false;

    return true;
  }
3912
def activate(self, profile_name=NotSet):
        
        if profile_name is NotSet:
            profile_name = self.profile_name
        self._active_profile_name = profile_name
215434
def add_profile(self, namespace, key, value, force=False):
        
        try:
            entry = dax.Profile(namespace, key, value)
            self._dax_node.addProfile(entry)
        except dax.DuplicateError:
            if force:
                # Replace with the new key
                self._dax_node.removeProfile(entry)
                self._dax_node.addProfile(entry)
570355
public AccountHeaderBuilder withProfiles(@NonNull List<IProfile> profiles) {
        if (mDrawer != null) {
            mDrawer.mDrawerBuilder.idDistributor.checkIds(profiles);
        }
        this.mProfiles = profiles;
        return this;
    }
1161687
def profile_rule(self, rule):
        """"""
        rule_str = self.reduce_string(rule)
        if rule_str not in self.profile_info:
            self.profile_info[rule_str] = 1
        else:
            self.profile_info[rule_str] += 1
227219
function profileFromArgs(args) {
	if (!args) return null;
	const profileIndex = args.indexOf('--profile');
	if (profileIndex <= 0 || profileIndex >= args.length - 1) return null;
	const profileValue = args[profileIndex + 1];
	return profileValue ? profileValue : null;
}
1366750
async def profile(self, ctx, platform, name):
        ''''''

        player = await self.client.get_player(platform, name)
        solos = await player.get_solos()

        await ctx.send("# of kills in solos for {}: {}".format(name,solos.kills.value))
956047
function(name, options) {
			if (arguments.length == 2)
				return createProfile(name, options);
			else
				// create profile object only
				return new OutputProfile(utils.defaults(name || {}, defaultProfile));
		}
96558
def profile(self, username):
        """"""
        if not username and g.user:
            username = g.user.username

        payload = {
            'user': bootstrap_user_data(username, include_perms=True),
            'common': self.common_bootsrap_payload(),
        }

        return self.render_template(
            'superset/basic.html',
            title=_("%(user)s's profile", user=username),
            entry='profile',
            bootstrap_data=json.dumps(payload, default=utils.json_iso_dttm_ser),
        )
173786
def connection(profile_name='default', api_key=None):
    """"""
    if api_key is None:
        profile_fname = datapoint.profile.API_profile_fname(profile_name)
        if not os.path.exists(profile_fname):
            raise ValueError('Profile not found in {}. Please install your API \n'
                             'key with datapoint.profile.install_API_key('
                             '"<YOUR-KEY>")'.format(profile_fname))
        with open(profile_fname) as fh:
            api_key = fh.readlines()
    return Manager(api_key=api_key)
299593
function createProfile(config, profileData) {
  const options = {
    method: "POST",
    uri: `${config.obServer}:${config.obPort}/ob/profile/`,
    body: profileData,
    json: true, // Automatically stringifies the body to JSON
    headers: {
      Authorization: config.apiCredentials,
    },
    // resolveWithFullResponse: true
  };

  return rp(options);
}
381889
def owner_profile(self) -> 'Profile':
        """"""
        if not self._owner_profile:
            if 'username' in self._node['owner']:
                owner_struct = self._node['owner']
            else:
                # Sometimes, the 'owner' structure does not contain the username, only the user's ID.  In that case,
                # this call triggers downloading of the complete Post metadata struct, where the owner username
                # is contained.
                # Note that we cannot use Profile.from_id() here since that would lead us into a recursion.
                owner_struct = self._full_metadata['owner']
            self._owner_profile = Profile(self._context, owner_struct)
        return self._owner_profile
16422
def profile_view(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('profile:view', **{
        'storage': ctx.repo.create_secure_service('storage'),
        'name': name,
    })
1062981
def addProfile(self, profile):
        
        if ( profile in self._profiles ):
            return
        
        self._profiles.append(profile)
        self._profileCombo.blockSignals(True)
        self._profileCombo.addItem(profile.name())
        self._profileCombo.setCurrentIndex(self._profileCombo.count()-1)
        self._profileCombo.blockSignals(False)
1177837
function (req, res, next) {
    var profile = req.profile;
    var filter = { or: [{ foursquare: profile.id }, { email: profile.email }] };

    User.find({ where: filter }, function(err, users) {
      var user = users[0];

      if (user) {
        if (!user.foursquare) {
          user.foursquare = profile.id;
          user.displayName = user.displayName || profile.firstName + ' ' + profile.lastName;
          user.save(function() {
            req.user = user;
            next();
          });
          return;
        }
        req.user = user;
        next();
        return;
      }

      User.create({
        displayName: profile.firstName + ' ' + profile.lastName,
        foursquare: profile.id,
        email: profile.email,
        password: profile.id
      }, function (err, user) {
        req.user = user;
        next();
      });
    });
  }
332424
def handleProfileChange(self):
        
        # restore the profile settings
        prof    = self.currentProfile()
        vwidget = self.viewWidget()
        if vwidget:
            prof.restore(vwidget)
        
        if not self.signalsBlocked():
            self.currentProfileChanged.emit(self.currentProfile())