Gets a StringPrep instance for the specified profile

@param profile The profile passed to find the StringPrep instance.
483106
public static StringPrep getInstance(int profile) {
        if (profile < 0 || profile > MAX_PROFILE) {
            throw new IllegalArgumentException("Bad profile type");
        }

        StringPrep instance = null;

        // A StringPrep instance is immutable.  We use a single instance
        // per type and store it in the internal cache.
        synchronized (CACHE) {
            WeakReference<StringPrep> ref = CACHE[profile];
            if (ref != null) {
                instance = ref.get();
            }

            if (instance == null) {
                ByteBuffer bytes = ICUBinary.getRequiredData(PROFILE_NAMES[profile] + ".spp");
                if (bytes != null) {
                    try {
                        instance = new StringPrep(bytes);
                    } catch (IOException e) {
                        throw new ICUUncheckedIOException(e);
                    }
                }
                if (instance != null) {
                    CACHE[profile] = new WeakReference<StringPrep>(instance);
                }
            }            
        }
        return instance;
    }
1148163
String retrieve(String name, String profile, String label, String path,
			boolean resolvePlaceholders) throws IOException {
		return retrieve(null, name, profile, label, path, resolvePlaceholders);
	}
674249
private static String checkProfilePicturePath(
			final FormItemList formItemList,
			final CreateUserResponse createUserResponse) {
		final String profilePicturePath = formItemList
				.getField(ProtocolConstants.Parameters.Create.User.PROFILE_PICTURE_PATH);
		if (profilePicturePath != null) {
			return profilePicturePath;
		} else {
			createUserResponse.profilePicturePathMissing();
		}

		return null;
	}
25893
protected CommonProfile getAuthenticatedProfile(final HttpServletRequest request,
                                                    final HttpServletResponse response,
                                                    final String requiredPermission) {
        val context = new J2EContext(request, response, getUmaConfigurationContext().getSessionStore());
        val manager = new ProfileManager<>(context, context.getSessionStore());
        val profile = manager.get(true).orElse(null);
        if (profile == null) {
            throw new AuthenticationException("Unable to locate authenticated profile");
        }
        if (!profile.getPermissions().contains(requiredPermission)) {
            throw new AuthenticationException("Authenticated profile does not carry the UMA protection scope");
        }
        return profile;
    }
467332
private static String extractArguments( final ProfileOption[] profiles )
    {
        final StringBuilder argument = new StringBuilder();
        if( profiles != null && profiles.length > 0 )
        {
            for( ProfileOption profile : profiles )
            {
                if( profile != null && profile.getProfile() != null && profile.getProfile().length() > 0 )
                {
                    if( argument.length() == 0 )
                    {
                        argument.append( "--profiles=" );
                    }
                    else
                    {
                        argument.append( "," );
                    }
                    argument.append( profile.getProfile() );
                }
            }
        }
        return argument.toString();
    }
23669
protected Content getProfile(String profileName) {
        Content profileLinkContent;
        Content profileLabel;
        profileLabel = new StringContent(profileName);
        profileLinkContent = getHyperLink(DocPaths.profileFrame(profileName), profileLabel, "",
                    "packageListFrame");
        Content li = HtmlTree.LI(profileLinkContent);
        return li;
    }
1021380
def getProfile(self, profile=None):
    '''
    
    '''
    if profile is None:
      # todo: what if the configuration `profile.default` does not exist?
      profile = self.config.get('DEFAULT', 'profile.default')
    if profile in self.profiles:
      return self.profiles[profile].init()
    for prof in self.profiles.values():
      if prof.name == profile:
        return prof.init()
    for prof in self.profiles.values():
      if prof.name.lower() == profile.lower():
        return prof.init()
    raise KeyError(profile)
894873
@RequestMapping(value = "/api/profile/{profileIdentifier}", method = RequestMethod.GET)
    public
    @ResponseBody
    HashMap<String, Object> getProfile(Model model, @PathVariable String profileIdentifier) throws Exception {
        Integer profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier);
        return Utils.getJQGridJSON(profileService.findProfile(profileId), "profile");
    }
653275
public function resolveProfilePath($path, $profile)
    {
        $path = $this->resolvePath($path);
        return preg_replace_callback('|\[\[([\w\_/]+)\]\]|', function ($matches) use ($profile) {
            $name = $matches[1];
            switch ($name) {
                case 'profile':
                    return $profile;
            }
            return '[[' . $name . ']]';
        }, $path);
    }
184624
private String fixNameForProfile(String name) {
		Assert.notBlank(name, "Setting name must be not blank !");
		final String actralProfile = StrUtil.nullToEmpty(this.profile);
		if (false == name.contains(StrUtil.DOT)) {
			return StrUtil.format("{}/{}.setting", actralProfile, name);
		}
		return StrUtil.format("{}/{}", actralProfile, name);
	}
388002
public String getProfileId() {
        return (data != null && data.payload != null) ? data.payload.profileId : null;
    }
907963
protected static function consumeProfiledName(&$args, &$profile)
    {
        $profiledName          = new \stdClass();
        $profiledName->profile = $profile;

        // Get the first argument
        $arg = array_shift($args);

        // If it's not a scalar argument
        if (!is_scalar($arg)) {
            return self::consumeNonScalarProfiledName($arg, $profile);
        }

        if (($profile === false) && is_string(current($args))) {
            $profile = array_shift($args);
        }

        return self::createProfiledNameFromString(strval($arg), $profile);
    }
558839
public <T, R> List<T> getProfileField(ProfileField<T, R> field) {
		List<R> values = getResourceFactory().getApiResource(
				"/user/profile/" + field.getName()).get(
				new GenericType<List<R>>() {
				});

		List<T> formatted = new ArrayList<T>();
		for (R value : values) {
			formatted.add(field.parse(value));
		}

		return formatted;
	}
596722
public void setProfile(OperaProfile profile) {
    options.get(PROFILE).setValue(PROFILE.sanitize(profile));
    supportsPd = true;
  }
153709
def _parse_profile(profile):
    '''
    
    '''
    if isinstance(profile, string_types):
        _profile = __salt__['config.option'](profile)
        if not _profile:
            msg = 'Pillar key for profile {0} not found.'.format(profile)
            raise SaltInvocationError(msg)
    else:
        _profile = profile
    hosts = _profile.get('hosts')
    index = _profile.get('index')
    return (hosts, index)
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();
                            }
                        });
    }
777101
public LanguageProfile read(File profileFile) throws IOException {
        return OldLangProfileConverter.convert(internalReader.read(profileFile));
    }