Add given conversion profiles checking for invalid profiles
557433
def _setup_profiles(self, conversion_profiles):
        '''
        
        '''
        # Check for invalid profiles
        for key, path in conversion_profiles.items():
            if isinstance(path, str):
                path = (path, )
            for left, right in pair_looper(path):
                pair = (_format(left), _format(right))
                if pair not in self.converters:
                    msg = 'Invalid conversion profile %s, unknown step %s'
                    log.warning(msg % (repr(key), repr(pair)))
                    break
            else:
                # If it did not break, then add to conversion profiles
                self.conversion_profiles[key] = path
707362
function prepareProfileDir(profilesDir, nick) {
  var nick = nick || '.tmp';
  // Just in case `nick` has any funny business...
  nick = nick.replace(/[^\w\d.]/g, '-').replace('..', '-');
  var profileDir = path.join(profilesDir, util.format('vox-%s', nick));
  debug('Ensuring directory at %s', profileDir);
  mkdirp.sync(profileDir, 0700);
  return profileDir;
}
274585
def add_profile_variants(self, profile_variants):

        

        results = self.db.profile_variant.insert_many(profile_variants)

        return results
294544
private ConversionMethod verifyConversionExistence(List<ConversionMethod> conversions){
		for (ConversionMethod method : conversions) 
			if(isPresentIn(method.getFrom(),sourceName) && 
			   isPresentIn(method.getTo()  ,destinationName))
				return method;
				
		return null;
	}
678332
function processInputs(config) {
    for (const profileKey in config) {
        const profile = config[profileKey];
        if (profile.skip) {
            continue;
        }

        verifyProfile(profile, profileKey);

        if (profile.file) {
            handleFileSwagger(profile, profileKey);
        } else {
            handleUrlSwagger(profile, profileKey);
        }
    }
}
964049
private static void addScalarConverters(ConverterRegistry converterRegistry) {
		ConversionService conversionService = (ConversionService) converterRegistry;
		converterRegistry.addConverter(new StringToBooleanConverter());
		converterRegistry.addConverter(Boolean.class, String.class, new ObjectToStringConverter());

		converterRegistry.addConverterFactory(new StringToNumberConverterFactory());
		converterRegistry.addConverter(Number.class, String.class, new ObjectToStringConverter());

		converterRegistry.addConverterFactory(new NumberToNumberConverterFactory());

		converterRegistry.addConverter(new StringToCharacterConverter());
		converterRegistry.addConverter(Character.class, String.class, new ObjectToStringConverter());

		converterRegistry.addConverter(new NumberToCharacterConverter());
		converterRegistry.addConverterFactory(new CharacterToNumberFactory());

		converterRegistry.addConverterFactory(new StringToEnumConverterFactory());
		converterRegistry.addConverter(Enum.class, String.class, new EnumToStringConverter(conversionService));

		converterRegistry.addConverter(new StringToLocaleConverter());
		converterRegistry.addConverter(Locale.class, String.class, new ObjectToStringConverter());

		converterRegistry.addConverter(new PropertiesToStringConverter());
		converterRegistry.addConverter(new StringToPropertiesConverter());

		converterRegistry.addConverter(new StringToUUIDConverter());
		converterRegistry.addConverter(UUID.class, String.class, new ObjectToStringConverter());
	}
867893
def profile_v3_to_proofs(profile, fqdn, refresh=False, address = None):
    

    proofs = []

    try:
        test = profile.items()
    except:
        return proofs

    if 'account' in profile:
        accounts = profile['account']
    else:
        return proofs

    for account in accounts:

        # skip if proof service is not supported
        if 'service' in account and account['service'].lower() not in SITES:
            continue

        if 'proofType' in account and account['proofType'] == "http":

            try:
                proof = {"service": account['service'],
                         "proof_url": account['proofUrl'],
                         "identifier": account['identifier'],
                         "valid": False}

                if is_valid_proof(account['service'], account['identifier'],
                                  fqdn, account['proofUrl'], address = address):

                    proof["valid"] = True

                proofs.append(proof)
            except Exception as e:
                pass

    return proofs
879642
def replace_validation(self):
        

        self.validate_profile_exists()
        profile_data = self.profiles.get(self.args.profile_name)

        # check redis
        # if redis is None:
        #     self.handle_error('Could not get connection to Redis')

        # load hash
        redis_hash = profile_data.get('data', {}).get('args', {}).get('tc_playbook_db_context')
        if redis_hash is None:
            self.handle_error('Could not find redis hash (db context).')

        # load data
        data = self.redis.hgetall(redis_hash)
        if data is None:
            self.handle_error('Could not load data for hash {}.'.format(redis_hash))
        validations = {'rules': [], 'outputs': []}
        for v, d in data.items():
            variable = v.decode('utf-8')
            # data = d.decode('utf-8')
            data = json.loads(d.decode('utf-8'))
            # if data == 'null':
            if data is None:
                continue
            validations['outputs'].append(variable)

            # null check
            od = OrderedDict()
            od['data'] = data
            od['data_type'] = 'redis'
            od['operator'] = 'eq'
            od['variable'] = variable
            # if variable.endswith('Array'):
            #     od['data'] = json.loads(data)
            #     od['data_type'] = 'redis'
            #     od['operator'] = 'eq'
            #     od['variable'] = variable
            # elif variable.endswith('Binary'):
            #     od['data'] = json.loads(data)
            #     od['data_type'] = 'redis'
            #     od['operator'] = 'eq'
            #     od['variable'] = variable
            # elif variable.endswith('String'):
            #     od['data'] = json.loads(data)
            #     od['data_type'] = 'redis'
            #     od['operator'] = 'eq'
            #     od['variable'] = variable
            validations['rules'].append(od)

        fqfn = profile_data.get('fqfn')
        with open(fqfn, 'r+') as fh:
            data = json.load(fh)
            for profile in data:
                if profile.get('profile_name') == self.args.profile_name:
                    profile['validations'] = validations.get('rules')
                    profile['args']['default']['tc_playbook_out_variables'] = ','.join(
                        validations.get('outputs')
                    )
            fh.seek(0)
            fh.write(json.dumps(data, indent=2, sort_keys=True))
            fh.truncate()
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
74972
def _verify_support(identity):
    """"""
    if identity.curve_name not in {formats.CURVE_NIST256}:
        raise NotImplementedError(
            'Unsupported elliptic curve: {}'.format(identity.curve_name))
1062981
def addProfile(self, profile):
        
        if ( profile in self._profiles ):
            return
        
        self._profiles.append(profile)
        self._profileCombo.blockSignals(True)
        self._profileCombo.addItem(profile.name())
        self._profileCombo.setCurrentIndex(self._profileCombo.count()-1)
        self._profileCombo.blockSignals(False)
118937
def addProfile(self, profile):
        
        # use the existing version
        for exist in self.profiles():
            if exist.name() == profile.name():
                if exist.version() < profile.version():
                    exist.setProfile(profile)
                
                return
        
        # otherwise create a new profile 
        act = XViewProfileAction(profile, self)
        self._profileGroup.addAction(act)
        self.addAction(act)
        return act
896587
function parseSrcProfile(src_profile){
	var assocPrivateData = {};
	for (var field in src_profile){
		var arrValueAndBlinding = src_profile[field];
		if (ValidationUtils.isArrayOfLength(arrValueAndBlinding, 2)) // otherwise it is a hash, meaning that the field was not disclosed
			assocPrivateData[field] = arrValueAndBlinding[0];
	}
	return assocPrivateData;
}
488560
function(id, profileKey, workDir) {
    console.log("Generating preprocessor string content");

    if( !profiles.hasOwnProperty("definitions") ) {
         throw("\"profiles\" dictionary is badly formed, no \"definitions\" key");
    }
    if ( !profiles.definitions.hasOwnProperty(profileKey) ) {
        throw("\"" + profileKey + "\" is not a registred SGE profile");
    }
    var string = _preprocessorDump(id, workDir, profiles.definitions[profileKey]);
    //string += _preprocessorDump(id, profiles.definitions[profileKey]);
    console.log(string);

    return string;
}
313719
public static function validateProfilesConfiguration($profiles, array &$messages)
    {
        if (static::isNotArray($profiles)) {
            $messages[] = 'Profile configuration must be an array.';
        } else {
            array_walk($profiles, function ($config, $profile) use (&$messages) {
                if (static::isNotArray($config)) {
                    $messages[] = 'Profile configuration for "'.$profile.'" must be an array.';
                } else {
                    array_walk($config, function ($domains, $directive) use ($profile, &$messages) {
                        if (static::isNotArrayOrString($domains)) {
                            $messages[] = 'Directive configuration for "'.$profile.':'.$directive.'"'.
                                ' must be a string or an array.';
                        }
                    });
                }
            });
        }
    }
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]
873461
def add_profiler(self, id, profiler):
        
        if not self.profilers:
            if self.profile_dump_path:
                atexit.register(self.dump_profiles, self.profile_dump_path)
            else:
                atexit.register(self.show_profiles)

        self.profilers.append([id, profiler, False])