Adds an IdentityLink for the given user id with the specified type,
but only if the user is not associated with the execution entity yet.
185263
@Override
  public IdentityLinkEntity involveUser(ExecutionEntity executionEntity, String userId, String type) {
    for (IdentityLinkEntity identityLink : executionEntity.getIdentityLinks()) {
      if (identityLink.isUser() && identityLink.getUserId().equals(userId)) {
        return identityLink;
      }
    }
    return addIdentityLink(executionEntity, userId, null, type);
  }
259077
def AddUser(self, uid, username, active):
    '''
    '''
    user_path = '/org/freedesktop/login1/user/%i' % uid
    if user_path in mockobject.objects:
        raise dbus.exceptions.DBusException('User %i already exists' % uid,
                                            name=MOCK_IFACE + '.UserExists')

    self.AddObject(user_path,
                   'org.freedesktop.login1.User',
                   {
                       'Sessions': dbus.Array([], signature='(so)'),
                       'IdleHint': False,
                       'DefaultControlGroup': 'systemd:/user/' + username,
                       'Name': username,
                       'RuntimePath': '/run/user/%i' % uid,
                       'Service': '',
                       'State': (active and 'active' or 'online'),
                       'Display': ('', dbus.ObjectPath('/')),
                       'UID': dbus.UInt32(uid),
                       'GID': dbus.UInt32(uid),
                       'IdleSinceHint': dbus.UInt64(0),
                       'IdleSinceHintMonotonic': dbus.UInt64(0),
                       'Timestamp': dbus.UInt64(42),
                       'TimestampMonotonic': dbus.UInt64(42),
                   },
                   [
                       ('Kill', 's', '', ''),
                       ('Terminate', '', '', ''),
                   ])

    return user_path
693803
protected function addEntity($type, $id, Entity\Content $owner)
    {
        $newEntity = new Entity\Relations([
            'from_contenttype' => (string) $owner->getContenttype(),
            'from_id'          => $owner->getId(),
            'to_contenttype'   => $type,
            'to_id'            => $id,
        ]);
        $this->add($newEntity);
    }
939966
def create_entity2user(enti_uid, user_id):
        '''
        
        '''
        record = TabEntity2User.select().where(
            (TabEntity2User.entity_id == enti_uid) & (TabEntity2User.user_id == user_id)
        )

        if record.count() > 0:
            record = record.get()
            MEntity2User.count_increate(record.uid, record.count)
        else:
            TabEntity2User.create(
                uid=tools.get_uuid(),
                entity_id=enti_uid,
                user_id=user_id,
                count=1,
                timestamp=time.time()
            )
175993
public function addUserTypeEntityIfNotExists($entityId, $fieldName, $fields) {
        $item = $this->getUserTypeEntity($entityId, $fieldName);
        if ($item) {
            return $item['ID'];
        }

        return $this->addUserTypeEntity($entityId, $fieldName, $fields);
    }
34067
public synchronized ID addOnline(final USER user, final ID sessionId)
	{
		sessionIdToUser.put(sessionId, user);
		return usersOnline.put(user, sessionId);
	}
1306677
private void addObjectIdentity(final Object object) {

        if (object == null) {
            _buffer.append("null");
        } else {
            _buffer.append(object.getClass().getName());
            _buffer.append("@");
            _buffer
                    .append(Integer
                            .toHexString(System.identityHashCode(object)));
        }

    }
909963
public Object getObjectByIdentity(Identity id)
            throws PersistenceBrokerException
    {
        checkOpen();
        ObjectEnvelope envelope = objectEnvelopeTable.getByIdentity(id);
        if (envelope != null)
        {
            return (envelope.needsDelete() ? null : envelope.getObject());
        }
        else
        {
            return getBroker().getObjectByIdentity(id);
        }
    }
577666
def create_identity(self, user, sp_mapping, **extra_config):
        

        return {
            out_attr: getattr(user, user_attr)
            for user_attr, out_attr in sp_mapping.items()
            if hasattr(user, user_attr)
        }
381516
def add_token_to_database(encoded_token, identity_claim):
    
    decoded_token = decode_token(encoded_token)
    jti = decoded_token['jti']
    token_type = decoded_token['type']
    user_identity = decoded_token[identity_claim]
    expires = _epoch_utc_to_datetime(decoded_token['exp'])
    revoked = False

    db_token = TokenBlacklist(
        jti=jti,
        token_type=token_type,
        user_identity=user_identity,
        expires=expires,
        revoked=revoked,
    )
    db.session.add(db_token)
    db.session.commit()
585053
protected void doLoginByIdentity(Object userId, LoginSpecifiedOption option) throws LoginFailureException {
        assertUserIdRequired(userId);
        handleLoginSuccess(findLoginUser(userId).orElseThrow(() -> {
            String msg = "Not found the user by the user ID: " + userId + ", " + option;
            return handleLoginFailure(msg, userId, OptionalThing.of(option));
        }), option);
    }
1138609
public synchronized void addSoftwareIdentifier(Identifier identifier) {
        //todo the following assertion should be removed after initial testing and implementation
        assert !(identifier instanceof CpeIdentifier) : "vulnerability identifier cannot be added to software identifiers";

        final Optional<Identifier> found = softwareIdentifiers.stream().filter(id
                -> id.getValue().equals(identifier.getValue())).findFirst();
        if (found.isPresent()) {
            //TODO - should we check for type of identifier?  I.e. could we see a Purl and GenericIdentifier with the same value
            final Identifier existing = found.get();
            if (existing.getConfidence().compareTo(identifier.getConfidence()) < 0) {
                existing.setConfidence(identifier.getConfidence());
            }
            if (existing.getNotes() != null && identifier.getNotes() != null) {
                existing.setNotes(existing.getNotes() + " " + identifier.getNotes());
            } else if (identifier.getNotes() != null) {
                existing.setNotes(identifier.getNotes());
            }
            if (existing.getUrl() == null && identifier.getUrl() != null) {
                existing.setUrl(identifier.getUrl());
            }
        } else {
            this.softwareIdentifiers.add(identifier);
        }
    }
718626
@Transactional
  @PostMapping(
      value = "/{entityTypeId}/{id}",
      params = "_method=PUT",
      headers = "Content-Type=application/x-www-form-urlencoded")
  @ResponseStatus(NO_CONTENT)
  public void updateFromFormPost(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("id") String untypedId,
      HttpServletRequest request) {
    Map<String, Object> paramMap = new HashMap<>();
    for (String param : request.getParameterMap().keySet()) {
      String[] values = request.getParameterValues(param);
      String value = values != null ? StringUtils.join(values, ',') : null;
      paramMap.put(param, value);
    }

    updateInternal(entityTypeId, untypedId, paramMap);
  }
826160
public void addPatientParticipantObject(String patientId)
	{
		addParticipantObjectIdentification(
				new RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectIDTypeCodes.PatientNumber(), 
				null,
				null, 
				null, 
				patientId, 
				RFC3881ParticipantObjectTypeCodes.PERSON, 
				RFC3881ParticipantObjectTypeRoleCodes.PATIENT, 
				null, 
				null);
	}
624218
function _linkIdentity(userId, key, socialUserInfo, creds) {
    var identityOptions = {
            id: socialUserInfo.id_str,
            screen_name: socialUserInfo.screen_name,
            accessToken: creds.oauth_token,
            accessSecret: creds.oauth_token_secret
        };

    return db.users.linkIdentity(userId, key, identityOptions);
}
247253
public void addType(final UUID... _uuid)
        throws EFapsException
    {
        final Set<Type> typesTmp = new HashSet<>();
        for (final UUID uuid : _uuid) {
            typesTmp.add(Type.get(uuid));
        }
        addType(typesTmp.toArray(new Type[typesTmp.size()]));
    }
80615
async def add(client: Client, identity_signed_raw: str) -> ClientResponse:
    
    return await client.post(MODULE + '/add', {'identity': identity_signed_raw}, rtype=RESPONSE_AIOHTTP)