Validates compose option

@param {String|Boolean} composeTheme - Compose them option
@throws
@returns {undefined}
491584
function validateComposeOption(composeTheme) {
  if ([ COMPOSE_DEEPLY, COMPOSE_SOFTLY, DONT_COMPOSE ].indexOf(composeTheme) === -1) {
    throw new Error(
      `Invalid composeTheme option for react-css-themr. Valid composition options\
 are ${COMPOSE_DEEPLY}, ${COMPOSE_SOFTLY} and ${DONT_COMPOSE}. The given\
 option was ${composeTheme}`
    )
  }
}
664641
function validate_options( $input ) {

		/*
		 * Restore Defaults.
		 *
		 * In the event that the user clicked the "Restore Defaults"
		 * button, the options defined in the theme's options.php
		 * file will be added to the option for the active theme.
		 */

		if ( isset( $_POST['reset'] ) ) {
			add_settings_error( 'options-framework', 'restore_defaults', __( 'Default options restored.', 'options-framework' ), 'updated fade' );
			return $this->get_default_values();
		}

		/*
		 * Update Settings
		 *
		 * This used to check for $_POST['update'], but has been updated
		 * to be compatible with the theme customizer introduced in WordPress 3.4
		 */

		$clean = array();
		$options = & Options_Framework::_optionsframework_options();
		foreach ( $options as $option ) {

			if ( ! isset( $option['id'] ) ) {
				continue;
			}

			if ( ! isset( $option['type'] ) ) {
				continue;
			}

			$id = preg_replace( '/[^a-zA-Z0-9._\-]/', '', strtolower( $option['id'] ) );

			// Set checkbox to false if it wasn't sent in the $_POST
			if ( 'checkbox' == $option['type'] && ! isset( $input[$id] ) ) {
				$input[$id] = false;
			}

			// Set each item in the multicheck to false if it wasn't sent in the $_POST
			if ( 'multicheck' == $option['type'] && ! isset( $input[$id] ) ) {
				foreach ( $option['options'] as $key => $value ) {
					$input[$id][$key] = false;
				}
			}

			// For a value to be submitted to database it must pass through a sanitization filter
			if ( has_filter( 'of_sanitize_' . $option['type'] ) ) {
				$clean[$id] = apply_filters( 'of_sanitize_' . $option['type'], $input[$id], $option );
			}
		}

		// Hook to run after validation
		do_action( 'optionsframework_after_validate', $clean );

		return $clean;
	}
1140984
function initThemes() {
        var activeThemeName = settingsCache.get('active_theme'),
            self = this;

        debug('init themes', activeThemeName);

        // Register a listener for server-start to load all themes
        common.events.on('server.start', function readAllThemesOnServerStart() {
            themeLoader.loadAllThemes();
        });

        // Just read the active theme for now
        return themeLoader
            .loadOneTheme(activeThemeName)
            .then(function activeThemeHasLoaded(theme) {
                // Validate
                return validate
                    .check(theme)
                    .then(function validationSuccess(checkedTheme) {
                        if (!validate.canActivate(checkedTheme)) {
                            const checkError = new common.errors.ThemeValidationError({
                                message: common.i18n.t('errors.middleware.themehandler.invalidTheme', {theme: activeThemeName}),
                                errorDetails: Object.assign(
                                    _.pick(checkedTheme, ['checkedVersion', 'name', 'path', 'version']), {
                                        errors: checkedTheme.results.error
                                    }
                                )
                            });

                            common.logging.error(checkError);

                            self.activate(theme, checkedTheme, checkError);
                        } else {
                            // CASE: inform that the theme has errors, but not fatal (theme still works)
                            if (checkedTheme.results.error.length) {
                                common.logging.warn(new common.errors.ThemeValidationError({
                                    errorType: 'ThemeWorksButHasErrors',
                                    message: common.i18n.t('errors.middleware.themehandler.themeHasErrors', {theme: activeThemeName}),
                                    errorDetails: Object.assign(
                                        _.pick(checkedTheme, ['checkedVersion', 'name', 'path', 'version']), {
                                            errors: checkedTheme.results.error
                                        }
                                    )
                                }));
                            }

                            debug('Activating theme (method A on boot)', activeThemeName);

                            self.activate(theme, checkedTheme);
                        }
                    });
            })
            .catch(common.errors.NotFoundError, function (err) {
                // CASE: active theme is missing, we don't want to exit because the admin panel will still work
                err.message = common.i18n.t('errors.middleware.themehandler.missingTheme', {theme: activeThemeName});
                common.logging.error(err);
            })
            .catch(function (err) {
                // CASE: theme threw an odd error, we don't want to exit because the admin panel will still work
                // This is the absolute catch-all, at this point, we do not know what went wrong!
                common.logging.error(err);
            });
    }
279368
function validateConfig(config) {
    // appId and versionId are not validated here since
    // not all operations require these to be present.
    // Validation of specific params are done in the
    // ServiceBase.js
    const { authoringKey, region } = config;
    const messageTail = `is missing from the configuration.\n\nDid you run ${chalk.cyan.bold('luis init')} yet?`;

    assert(typeof authoringKey === 'string', `The authoringKey  ${messageTail}`);
    assert(typeof region === 'string', `The region ${messageTail}`);
    assert(args.region == 'westus' || args.region == 'westeurope' || args.region == 'australiaeast' || args.region == 'virginia', `${args.region} is not a valid authoring region.  Valid values are [westus|westeurope|australiaeast|virginia]`);
}
164761
def valid?(option)
      option = option.to_s
      self.class.valid_options.include?(option) ||
        plugins.include?(option.split('_').first) ||
        option =~ /^theme_advanced_container_\w+$/
    end
190285
function composeS(...args) {
  if(!arguments.length) {
    throw new TypeError(err)
  }

  const ms =
    args.slice().reverse()

  const head =
    ms[0]

  if(!isSemigroupoid(head)) {
    throw new TypeError(err)
  }

  if(ms.length === 1) {
    return head
  }

  return ms.slice().reduce((comp, m) => {
    if(!isSameType(comp, m)) {
      throw new TypeError(err)
    }

    return comp.compose(m)
  })
}
42650
function validateOptions (options) {
  if (typeof options.apiKey !== 'string') {
    throw new Error('You must provide a valid API key to upload sourcemaps to Bugsnag.')
  }
  if (typeof options.sourceMap !== 'string') {
    throw new Error('You must provide a path to the source map you want to upload.')
  }
  if (options.addWildcardPrefix && !options.stripProjectRoot) {
    options.stripProjectRoot = true
  }
  if (options.uploadSources && !options.projectRoot) {
    throw new Error('You must provide a project root when uploading sources. ' +
      'The project root is used to generate relative paths to the sources.')
  }
  if (options.stripProjectRoot && !options.projectRoot) {
    throw new Error('You must provide a project root when stripping the root ' +
      'path from the source map.')
  }
  if (options.projectRoot && !path.isAbsolute(options.projectRoot)) {
    options.projectRoot = path.resolve(options.projectRoot)
  }
  return options
}
944132
function validateHeader (key, value) {
  if (typeof key !== 'string' || typeof value !== 'string')
    return option.some(`Parts of header ${key}:${value} must be strings`)
  return option.none
}
784198
public static void validate(String styleAttribute) throws InvalidInputException {
    try {
      final Map<String, String> styleMap = Splitter.on(";").omitEmptyStrings().withKeyValueSeparator(":").split(styleAttribute);
      final HashSet<String> inputStyleProperties = new HashSet<>(styleMap.keySet());
      inputStyleProperties.removeAll(ALLOWED_PROPERTIES);
      if (!inputStyleProperties.isEmpty()) {
        throw new InvalidInputException("Invalid property(s): [" + Joiner.on(",").join(inputStyleProperties) + "] in the \"style\" attribute");
      }
    } catch (IllegalArgumentException ex) {
      throw new InvalidInputException("Unparseable \"style\" attribute: " + styleAttribute, ex);
    }
  }
905087
function validateMethod (method) {
  if (!method) {
    return option.some('HTTP method is not specified')
  }
  if (typeof method !== 'string') {
    return option.some('HTTP method should be type of string')
  }
  if (supportedMethods.indexOf(method.toUpperCase()) < 0) {
    return option.some(`Http method ${method} is not supported`)
  }
  return option.none
}
1069155
function checkOptions(options) {
                // @TODO: should we throw an error if there are incorrect options provided?
                options = _.pick(options, permittedOptions);

                let validationErrors = utils.validateOptions(options);

                if (_.isEmpty(validationErrors)) {
                    return Promise.resolve(options);
                }

                // For now, we can only handle showing the first validation error
                return Promise.reject(validationErrors[0]);
            }
607848
function preset (key, format) {
  validator('format', format)

  if (presets[key] !== undefined) {
    throw new SyntaxError('It is not allowed to override existing presets.')
  }

  presets[key] = format
}
1360759
function configValidator(ops) {
  let renderError = false;
  const { vuescroll } = ops;

  // validate modes
  if (!~modes.indexOf(vuescroll.mode)) {
    error(
      `Unknown mode: ${
        vuescroll.mode
      },the vuescroll's option "mode" should be one of the ${modes}`
    );
    renderError = true;
  }

  return renderError;
}
54207
function validate(backing: any) {
  let isValid = false;
  assertObj(backing, 'backing');
  assert(
    _.isObjectLike(backing.types) || _.isObjectLike(backing.directives),
    'backing must have either "types" or "directives" backing values',
  );

  // validate the type backing config
  forEach(
    backing.types,
    config => {
      let valid = false;
      assertObj(config, 'type backing');
      valid = valid || assertFn(config.serialize, 'serialize');
      valid = valid || assertFn(config.parseValue, 'parseValue');
      valid = valid || assertFn(config.parseLiteral, 'parseLiteral');
      valid = valid || assertFn(config.isTypeOf, 'isTypeOf');
      valid = valid || assertFn(config.resolveType, 'resolveType');

      if (config.fields) {
        assertObj(config.fields, 'fields backing');
        forEach(
          config.fields,
          field => {
            let validf = false;
            assertObj(field, 'field backing');
            validf = validf || assertFn(field.resolve, 'resolve');
            validf = validf || assertFn(field.subscribe, 'subscribe');
            assert(validf, 'no field backing configuration was found');
            valid = true;
          },
          true,
        );
      }
      assert(valid, 'no type backing configuration was found');
      isValid = true;
    },
    true,
  );

  // validate the directive backing config
  forEach(
    backing.directives,
    config => {
      let valid = false;
      assert(_.isObjectLike(config), 'directive backing must be an object');
      valid = valid || assertFn(config.before, 'before');
      valid = valid || assertFn(config.after, 'after');
      valid = valid || assertFn(config.build, 'build');
      assert(valid, 'no directive backing configuration was found');
      isValid = true;
    },
    true,
  );

  // validate the enums backing config
  forEach(
    backing.enums,
    config => {
      assert(_.isObjectLike(config), 'enum backing must be an object');
      isValid = true;
    },
    true,
  );

  // assert at least one config was found
  assert(isValid, 'no type or directive backing configuration was found');
}
1263437
function(properties) {
			if (properties) {
				if (typeof properties.options === "string") {
					var options = properties.options;
					if (!/^\s*$/.test(options)) {
						var userOptionsMap = {}, hasUserOption = false;
						options.split(/,/).forEach(function(option) {
							var match = /\s*(\w+)\s*:\s*(\w+)\s*/.exec(option); // name:value
							if (match === null) {
								console.log('JSLint ignoring bad option: ' + option); //$NON-NLS-1$
							} else {
								var name = match[1], value = match[2];
								userOptionsMap[name] = value;
								hasUserOption = true;
							}
						});
						validationOptions = {};
						objects.mixin(validationOptions, DEFAULT_VALIDATION_OPTIONS, userOptionsMap);
						if (hasUserOption) {
							console.log('JSLint using user-provided options: {' + Object.keys(userOptionsMap).map(function(k) { //$NON-NLS-1$
								return k + ':' + userOptionsMap[k];
							}).join(',') + "}");
						}
					}
				}
			}
		}
670122
def compose(*validators):
    
    def composed_validator(value):
        out = value
        for validator in reversed(validators):
            out = validator(out)
        return out
    composed_validator.__name__ = 'compose(%s)' % ','.join(
        val.__name__ for val in validators)
    return composed_validator
1151189
public void compose(StylesheetRoot sroot) throws TransformerException
  {
    super.compose(sroot);
    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
    java.util.Vector vnames = cstate.getVariableNames();
    if(null != m_matchPattern)
      m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize());
      
    cstate.resetStackFrameSize();
    m_inArgsSize = 0;
  }