https://developer.zendesk.com/rest_api/docs/core/users#merge-self-with-another-user
513067
def users_me_merge(self, data, **kwargs):
        ""
        api_path = "/api/v2/users/me/merge.json"
        return self.call(api_path, method="PUT", data=data, **kwargs)
971880
def user_identity_make_primary(self, user_id, id, data, **kwargs):
        ""
        api_path = "/api/v2/users/{user_id}/identities/{id}/make_primary"
        api_path = api_path.format(user_id=user_id, id=id)
        return self.call(api_path, method="PUT", data=data, **kwargs)
1211942
def combine(person_array)
      url = Base + 'person'
      version_persons = self.person person_array, :genders => 'none', :events => 'none', :names => 'none'
      combine_person = Org::Familysearch::Ws::Familytree::V2::Schema::Person.new
      combine_person.create_combine(version_persons)
      familytree = Org::Familysearch::Ws::Familytree::V2::Schema::FamilyTree.new
      familytree.persons = [combine_person]
      res = @fs_communicator.post(url,familytree.to_json)
      familytree = Org::Familysearch::Ws::Familytree::V2::Schema::FamilyTree.from_json JSON.parse(res.body)
      return familytree.persons[0]
    end
618912
def changeUserRole( dbid, userid, roleid, newroleid )
      @dbid, @userid, @roleid, @newroleid = dbid, userid, roleid, newroleid
      
      xmlRequestData = toXML( :userid, @userid )
      xmlRequestData << toXML( :roleid, @roleid )
      xmlRequestData << toXML( :newroleid, @newroleid )
      
      sendRequest( :changeUserRole, xmlRequestData )

      return self if @chainAPIcalls
      @requestSucceeded
    end
107223
def user_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/users.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
322541
async function mergePr(prNo, branchName) {
  logger.debug(`mergePr(${prNo}, ${branchName})`);
  // Used for "automerge" feature
  try {
    const pr = await getPr(prNo);
    if (!pr) {
      throw Object.assign(new Error('not-found'), { statusCode: 404 });
    }
    await api.post(
      `./rest/api/1.0/projects/${config.projectKey}/repos/${
        config.repositorySlug
      }/pull-requests/${prNo}/merge?version=${pr.version}`
    );
    await getPr(prNo, true);
  } catch (err) {
    if (err.statusCode === 404) {
      throw new Error('not-found');
    } else if (err.statusCode === 409) {
      throw new Error('repository-changed');
    } else {
      logger.warn({ err }, `Failed to merge PR`);
      return false;
    }
  }

  logger.debug({ pr: prNo }, 'PR merged');
  // Delete branch
  await deleteBranch(branchName);
  return true;
}
551525
def merge_list_members_RIID(self, list_, record_data, merge_rule):
        
        list_ = list_.get_soap_object(self.client)
        result = self.call('mergeListMembersRIID', list_, record_data, merge_rule)
        return RecipientResult(result.recipientResult)
1063143
function merge(acc, item) {
  if (!item) {
    return acc;
  }

  return deepmerge(acc, item, {
    clone: false, // No need to clone deep, it's way faster.
  });
}
824420
public void merge(SubjectAware subjectAware)
  {
    merged = true;

    String username = subjectAware.username();

    if (username.length() > 0)
    {
      this.username = username;
    }

    String password = subjectAware.password();

    if (password.length() > 0)
    {
      this.password = password;
    }

    String configuration = subjectAware.configuration();

    if (configuration.length() > 0)
    {
      this.configuration = configuration;
    }
  }
1198679
function(other) {
      if (other.getSessionToken()) {
        this._sessionToken = other.getSessionToken();      
      }    
      Parse.User.__super__._mergeFromObject.call(this, other);
    }
776249
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True  # synchronous operation
        user_oid = uri_parms[0]
        user_uri = '/api/users/' + user_oid
        try:
            user = hmc.lookup_by_uri(user_uri)
        except KeyError:
            raise InvalidResourceError(method, uri)
        check_required_fields(method, uri, body, ['user-role-uri'])
        user_type = user.properties['type']
        if user_type in ('pattern-based', 'system-defined'):
            raise BadRequestError(
                method, uri, reason=314,
                message="Cannot add user role to user of type {}: {}".
                format(user_type, user_uri))
        user_role_uri = body['user-role-uri']
        try:
            hmc.lookup_by_uri(user_role_uri)
        except KeyError:
            raise InvalidResourceError(method, user_role_uri, reason=2)
        if user.properties.get('user-roles', None) is None:
            user.properties['user-roles'] = []
        user.properties['user-roles'].append(user_role_uri)
135253
def merge!(state)
      @cardinality = state.cardinality
      @policy = state.policy

      @transitions.merge!(state.transitions) do |_, _, transition|
        transition
      end

      return self
    end
922860
def add_user_to_group(self, username, group_name):
        
        url = 'rest/api/2/group/user'
        params = {'groupname': group_name}
        data = {'name': username}

        return self.post(url, params=params, data=data)
276959
function addUser(req, res, next) {
  res.locals.user = req.user;
  next();
}
460104
public function unmerge()
	{
		$sourceUser           = 0;
		$destinationUser      = 0;
		$directionalIndicator = $this->arguments->getOpt(4);

		if ($directionalIndicator)
		{
			switch ($directionalIndicator)
			{
				case 'from':
					$sourceUser      = (int)$this->arguments->getOpt(5);
					$destinationUser = (int)$this->arguments->getOpt(3);
					break;

				default:
					// Do nothing...can't assume
					break;
			}

			if ((!$sourceUser || !$destinationUser) && !$this->output->isInteractive())
			{
				$this->output->error('Please provide a source and destination user in the format: muse user unmerge [destUserId] from [sourceUserId]');
			}
		}
		else
		{
			if ($this->output->isInteractive())
			{
				$destinationUser = (int)$this->output->getResponse('What is the destination user ID (this is the user that was deleted during the initial merge)?');
				$sourceUser      = (int)$this->output->getResponse('What is the source user ID (this is the user that was the recipient of the initially merged data)?');
			}
			else
			{
				$this->output->error('Please provide a source and destination user in the format: muse user unmerge [destUserId] from [sourceUserId]');
			}
		}

		// Now, make sure a merge between these two actually exists in the logs
		$suser  = \User::getInstance($sourceUser);
		$duser  = \User::getInstance($destinationUser);
		$dbo    = App::get('db');

		// First, make sure we were given valid user ids
		if (!$suser->get('id') || !$duser->get('id'))
		{
			$this->output->error('User does not appear to be valid');
		}

		$sUserName = $suser->get('username');
		$dUserName = $duser->get('username');

		$query  = "SELECT * FROM `#__users_merge_log`";
		$query .= " WHERE (`source` = '{$destinationUser}' AND `destination` = '{$sourceUser}')";
		$query .= " OR    (`source` = '{$dUserName}' AND `destination` = '{$sUserName}')";
		$query .= " ORDER BY `table` ASC, `COLUMN` ASC";
		$dbo->setQuery($query);
		if (!$results = $dbo->loadObjectList())
		{
			$this->output->error("Sorry, we couldn't find a preexisting merge between these two users to undo");
		}
		else
		{
			if (count($results) > 0)
			{
				if ($this->output->isInteractive())
				{
					$progress = $this->output->getProgressOutput();
					$count = count($results);
					$progress->init('Unmerging records: ', 'ratio', $count);
				}

				$counter = 0;
				foreach ($results as $result)
				{
					if (is_numeric($result->source))
					{
						$query = "UPDATE `{$result->table}` SET `{$result->column}` = '{$result->source}' WHERE `{$result->table_pk}` = '{$result->table_id}'";
					}
					else
					{
						$query = "UPDATE `{$result->table}` SET `{$result->column}` = REPLACE({$result->column}, '{$result->destination}', '{$result->source}') WHERE `{$result->table_pk}` = '{$result->table_id}'";
					}
					$dbo->setQuery($query);
					if ($dbo->query())
					{
						$query = "DELETE FROM `#__users_merge_log` WHERE `id` = '{$result->id}'";
						$dbo->setQuery($query);
						$dbo->query();

						if ($this->output->isInteractive())
						{
							++$counter;
							$progress->setProgress($counter, $count);
						}
						else
						{
							$this->output->addLine("Unmerging {$result->table}.{$result->column}");
						}
					}
				}

				if ($this->output->isInteractive())
				{
					$progress->done();
					$this->output->addLine("Unmerged ({$counter}/{$count}) records successfully!", 'success');
				}
			}
		}

		// Unblock the user
		$duser->set('block', 0);
		$duser->save();
	}
629052
def me
      data = get("/me").body

      Resources::Me.new({ client: self }.merge(data))
    end
654269
def merge!(response)
      return self if response == self
      if Rack::Response === response
        response = [response.status, response.header, response]
      end
      self.status, self.body = response[0], response[2]
      self.header.merge!(response[1])
      self
    end