Build a profile from user identifier and attributes.

@param id user identifier
@param attributes user attributes
334889
public void build(final Object id, final Map<String, Object> attributes) {
        setId(ProfileHelper.sanitizeIdentifier(this, id));
        addAttributes(attributes);
    }
925534
public final void setProfileId(String profileId) {
        boolean force = false;
        if (Utility.isNullOrEmpty(this.profileId) || !this.profileId.equalsIgnoreCase(profileId)) {
            // Clear out the old profilePicture before requesting for the new one.
            setBlankProfilePicture();
            force = true;
        }

        this.profileId = profileId;
        refreshImage(force);
    }
9491
public void addIdentity(Identity identity) {
        identities.add(identity);
        identitiesSet.add(identity.getKey());
    }
1002999
protected Map<String, List<Object>> retrievePersonAttributesFromAttributeRepository(final String id) {
        synchronized (lock) {
            val repository = getAttributeRepository();
            if (repository == null) {
                LOGGER.warn("No attribute repositories could be fetched from application context");
                return new HashMap<>(0);
            }
            return CoreAuthenticationUtils.retrieveAttributesFromAttributeRepository(repository, id, this.attributeRepositoryIds);
        }
    }
1245909
def _populate_profile_from_attributes(self, profile):
        
        save_profile = False

        for field, attr in self.settings.PROFILE_ATTR_MAP.items():
            try:
                # user_attrs is a hash of lists of attribute values
                setattr(profile, field, self.attrs[attr][0])
                save_profile = True
            except Exception:
                logger.warning("%s does not have a value for the attribute %s", self.dn, attr)

        return save_profile
529233
public void putAttributes(Attributes attributes){
        int attrCount = attributes.getLength();
        if(attrCount>0){
            temp();
            for(int i=0; i<attrCount; i++){
                QName qname = new QName(attributes.getURI(i), attributes.getLocalName(i));
                temp.put(qname, attributes.getValue(i));
            }
        }
    }
536686
public SpringApplicationBuilder profiles(String... profiles) {
		this.additionalProfiles.addAll(Arrays.asList(profiles));
		this.application.setAdditionalProfiles(
				StringUtils.toStringArray(this.additionalProfiles));
		return this;
	}
341482
public void setAttributes(Map<String, Attribute> attributes) {
		if (null == attributes) {
			throw new IllegalArgumentException("Attributes should be not-null.");
		}
		this.attributes = attributes;
		this.attributesLoaded = true;
	}
258215
public void setProfiles(java.util.Collection<ProfileData> profiles) {
        if (profiles == null) {
            this.profiles = null;
            return;
        }

        this.profiles = new java.util.ArrayList<ProfileData>(profiles);
    }
245493
protected void setELClass(String eLClass, Identification id, Attributes attributes) {
	this.ELClass = ClassDefinitionImpl.toClassDefinition(eLClass, id, attributes);
    }
64183
public void addProfile(Profile profile) {
        if (PROFILE_KIND.equals(profile.getKind())) {
            this.profileList.add(profile.getSettings());
        }
    }
591865
private void addToAttributes(final List<ApiAttribute> attributes) {
        for (final ApiObject object : attributes) {
            final ApiModelToGedObjectVisitor visitor = createVisitor();
            object.accept(visitor);
        }
    }
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;
    }
836631
public static Profile createProfile(Connection<?> connection) {
        Profile profile = new Profile();
        UserProfile providerProfile = connection.fetchUserProfile();

        String email = providerProfile.getEmail();
        if (StringUtils.isEmpty(email)) {
            throw new IllegalStateException("No email included in provider profile");
        }

        String username = providerProfile.getUsername();
        if (StringUtils.isEmpty(username)) {
            username = email;
        }

        String firstName = providerProfile.getFirstName();
        String lastName = providerProfile.getLastName();
        String displayName;

        if (StringUtils.isNotEmpty(connection.getDisplayName())) {
            displayName = connection.getDisplayName();
        } else {
            displayName = firstName + " " + lastName;
        }

        profile.setUsername(username);
        profile.setEmail(email);
        profile.setAttribute(FIRST_NAME_ATTRIBUTE_NAME, firstName);
        profile.setAttribute(LAST_NAME_ATTRIBUTE_NAME, lastName);
        profile.setAttribute(DISPLAY_NAME_ATTRIBUTE_NAME, displayName);

        if (StringUtils.isNotEmpty(connection.getImageUrl())) {
            profile.setAttribute(AVATAR_LINK_ATTRIBUTE_NAME, connection.getImageUrl());
        }

        return profile;
    }
622796
@SuppressWarnings({"unused", "WeakerAccess"})
    public void pushProfile(final Map<String, Object> profile) {
        if (profile == null || profile.isEmpty())
            return;

        postAsyncSafely("profilePush", new Runnable() {
            @Override
            public void run() {
                _push(profile);
            }
        });
    }
241813
def update_profile(self, attrs, attr_map=None):
        
        user_attrs = dict_to_cognito(attrs,attr_map)
        self.client.update_user_attributes(
            UserAttributes=user_attrs,
            AccessToken=self.access_token
        )
951373
public static String sanitizeIdentifier(final BasicUserProfile profile, final Object id) {
        if (id != null) {
            String sId = id.toString();
            if (profile != null) {
                final String type = profile.getClass().getName() + BasicUserProfile.SEPARATOR;
                if (sId.startsWith(type)) {
                    sId = sId.substring(type.length());
                }
            }
            return sId;
        }
        return null;
    }