Check if the profile name is valid
9660
def name_valid?(profile_name, profile_base_path)
      unless valid_puppet_class_name?(profile_name)
        error _('wizard.profile.invalid_name')%{words: Bebox::RESERVED_WORDS.join(', ')}
        return false
      end
      return true if profile_base_path.empty?
      # Check if the path name is valid
      unless Bebox::Profile.valid_pathname?(profile_base_path)
        error _('wizard.profile.invalid_path')%{words: Bebox::RESERVED_WORDS.join(', ')}
        return false
      end
      true
    end
771370
def profile_validation(self, status):
        """"""
        self.selected_profile.data.setdefault('validation_pass_count', 0)
        self.selected_profile.data.setdefault('validation_fail_count', 0)
        if status:
            self.selected_profile.data['validation_pass_count'] += 1
        else:
            self.selected_profile.data['validation_fail_count'] += 1
1077061
def validate_name(ctx, param, value):
    """"""
    if not value:
        value = os.path.basename(ctx.params['directory'].rstrip(os.path.sep))
    return value
3912
def activate(self, profile_name=NotSet):
        
        if profile_name is NotSet:
            profile_name = self.profile_name
        self._active_profile_name = profile_name
448761
def name_is_valid(name):
    
    # The name can only be 80 characters long.
    if len(name) > MAX_NAME_LENGTH:
        return False
    return bool(NAME_VALID_CHARS_REGEX.match(name))
1035961
def validate_user_data(self, expected, actual, api_version=None):
        
        self.log.debug('Validating user data...')
        self.log.debug('actual: {}'.format(repr(actual)))
        for e in expected:
            found = False
            for act in actual:
                if e['name'] == act.name:
                    a = {'enabled': act.enabled, 'name': act.name,
                         'email': act.email, 'id': act.id}
                    if api_version == 3:
                        a['default_project_id'] = getattr(act,
                                                          'default_project_id',
                                                          'none')
                    else:
                        a['tenantId'] = act.tenantId
                    found = True
                    ret = self._validate_dict_data(e, a)
                    if ret:
                        return "unexpected user data - {}".format(ret)
            if not found:
                return "user {} does not exist".format(e['name'])
        return ret
30008
public static List<String> explicitlyActivatedProfiles(String... profiles) {
        if (profiles.length == 0) {
            return Collections.<String> emptyList();
        }
        List<String> activated = new ArrayList<String>();
        for (String profileId : profiles) {
            Validate.notNullOrEmpty(profileId, "Invalid name (\"" + profileId + "\") of a profile to be activated");
            if (!(profileId.startsWith("-") || profileId.startsWith("!"))) {
                activated.add(profileId);
            }
        }

        return activated;
    }
1164873
def report_validation(self, status):
        """"""
        # only one fail/pass count per profile
        if status:
            self.report['results']['validations']['pass'] += 1
        else:
            self.report['results']['validations']['fail'] += 1
            if self.selected_profile.name not in self.report['results']['failed_profiles']:
                self.report['results']['failed_profiles'].append(self.selected_profile.name)
1003866
def check(self, profile_data, training_metadata=[]):
        """"""
        data = {
            "profile_json": _validate_dict(profile_data, "profile_data"),
            "training_metadata": _validate_training_metadata(training_metadata),
        }
        response = self.client.post("profile/json/check", data=data)
        return response.json()
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;
}
57411
def is_valid(self):
        """"""

        try:
            request = self.get_oauth_request()
            client = self.get_client(request)
            params = self._server.verify_request(request, client, None)
        except Exception as e:
            raise e

        return client
1286357
def valid_name(name):
    ""
    if isinstance(name, bytes):
        name = name.decode('ascii')
    if not Definitions.COOKIE_NAME_RE.match(name):
        return False
    # This module doesn't support $identifiers, which are part of an obsolete
    # and highly complex standard which is never used.
    if name[0] == "$":
        return False
    return True
57368
def get_profile_info(self):
        """"""
        return sorted(self.profile_info.items(),
                      key=lambda kv: kv[1],
                      reverse=False)
        return
507070
def valid?
      return false if @id.nil?
      return false if @name.nil?
      return false if @email.nil?
      return false if @order.nil?
      return false if @fields.nil?
      return false if @metadata.nil?
      return false if @state.nil?
      state_validator = EnumAttributeValidator.new('String', ['pending', 'completed'])
      return false unless state_validator.valid?(@state)
      auth_type_validator = EnumAttributeValidator.new('String', ['none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml'])
      return false unless auth_type_validator.valid?(@auth_type)
      auth_second_factor_type_validator = EnumAttributeValidator.new('String', ['none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint'])
      return false unless auth_second_factor_type_validator.valid?(@auth_second_factor_type)
      true
    end
1007604
def validate_aws_name(name):
  """"""
  assert len(name) <= 127
  # disallow unicode characters to avoid pain
  assert name == name.encode('ascii').decode('ascii')
  assert aws_name_regexp.match(name)
825233
def is_valid(self):
        '''
        
        '''

        valid = super(RegistrationContactForm,self).is_valid()
        msgs = messages.get_messages(self._request)

        # We only want validation messages to show up once, so pop messages that have already show up
        # before checking to see if any messages remain to be shown.
        prior_messages = self._session.pop('prior_messages',[])
        remaining_messages = []

        for m in msgs:
            m_dict = {'message': m.message, 'level': m.level, 'extra_tags': m.extra_tags}
            if m_dict not in prior_messages:
                remaining_messages.append(m_dict)

        if remaining_messages:
            self._session['prior_messages'] = remaining_messages
            self._request.session.modified = True
            return False
        return valid
1100064
def compliance(self, value):
        """"""
        if (self.api_version < '2.0'):
            self.profile = value
        else:
            try:
                self.profile[0] = value
            except AttributeError:
                # handle case where profile not initialized as array
                self.profile = [value]