Check to make sure the flapjack has the right ingredients
(i.e. is a valid potential module)

@param flapjack
@param options
559390
function checkIngredients(flapjack, options) {
    options = options || {};

    // If original module is not a function but has client function, use that
    if (flapjack && !_.isFunction(flapjack) && flapjack.client) {
        flapjack = flapjack.client;
    }
    // else if dealing with factory and no client annotation (i.e. it's server only), return null
    else if (flapjack && options.ngType === 'factory' && !options.isClient) {
        var moduleInfo = this.getModuleInfo(flapjack) || {};
        if (!moduleInfo.client) { return null; }
    }

    return flapjack;
}
72195
public boolean hasUniqueLongOption(String optionName) {
        if(hasLongOption(optionName)) {
            for(ProcessedOption o : getOptions()) {
                if(o.name().startsWith(optionName) && !o.name().equals(optionName))
                    return false;
            }
            return true;
        }
        return false;
    }
1006975
function validateOptions(options) {
  const notSupported = _.reject(_.keys(options), (key) => (
    OPTIONS.has(key)
  ));

  if (notSupported.length > 0) {
    console.warn(`[${PLUGIN_NAME}] Options ${notSupported} are not supported, use following options: ${Array.from(OPTIONS)}`);
  }
}
373811
function validateOptions(options) {
  const {
    lifecycleExperimental,
    disableLifecycleMethods,
    enableComponentDidUpdateOnSetState,
    supportPrevContextArgumentOfComponentDidUpdate,
    lifecycles,
  } = options;
  if (typeof lifecycleExperimental !== 'undefined' && typeof lifecycleExperimental !== 'boolean') {
    throw new Error('lifecycleExperimental must be either true or false if provided');
  }

  if (typeof disableLifecycleMethods !== 'undefined' && typeof disableLifecycleMethods !== 'boolean') {
    throw new Error('disableLifecycleMethods must be either true or false if provided');
  }

  if (
    lifecycleExperimental != null
    && disableLifecycleMethods != null
    && lifecycleExperimental === disableLifecycleMethods
  ) {
    throw new Error('lifecycleExperimental and disableLifecycleMethods cannot be set to the same value');
  }

  if (
    typeof enableComponentDidUpdateOnSetState !== 'undefined'
    && lifecycles.componentDidUpdate
    && lifecycles.componentDidUpdate.onSetState !== enableComponentDidUpdateOnSetState
  ) {
    throw new TypeError('the legacy enableComponentDidUpdateOnSetState option should be matched by `lifecycles: { componentDidUpdate: { onSetState: true } }`, for compatibility');
  }

  if (
    typeof supportPrevContextArgumentOfComponentDidUpdate !== 'undefined'
    && lifecycles.componentDidUpdate
    && lifecycles.componentDidUpdate.prevContext !== supportPrevContextArgumentOfComponentDidUpdate
  ) {
    throw new TypeError('the legacy supportPrevContextArgumentOfComponentDidUpdate option should be matched by `lifecycles: { componentDidUpdate: { prevContext: true } }`, for compatibility');
  }
}
273761
public static void checkOptional(OptionSet options, List<String> opts)
            throws VoldemortException {
        List<String> optCopy = Lists.newArrayList();
        for(String opt: opts) {
            if(options.has(opt)) {
                optCopy.add(opt);
            }
        }
        if(optCopy.size() > 1) {
            System.err.println("Conflicting options:");
            for(String opt: optCopy) {
                System.err.println("--" + opt);
            }
            throw new VoldemortException("Conflicting options detected.");
        }
    }
1275562
private void validateOptions() {
        // No validation if we found a help parameter
        if (helpWasSpecified) {
            return;
        }

        if (!requiredFields.isEmpty()) {
            List<String> missingFields = new ArrayList<>();
            for (ParameterDescription pd : requiredFields.values()) {
                missingFields.add("[" + Strings.join(" | ", pd.getParameter().names()) + "]");
            }
            String message = Strings.join(", ", missingFields);
            throw new ParameterException("The following "
                    + pluralize(requiredFields.size(), "option is required: ", "options are required: ")
                    + message);
        }

        if (mainParameter != null && mainParameter.description != null) {
            ParameterDescription mainParameterDescription = mainParameter.description;
            // Make sure we have a main parameter if it was required
            if (mainParameterDescription.getParameter().required() &&
                    !mainParameterDescription.isAssigned()) {
                throw new ParameterException("Main parameters are required (\""
                        + mainParameterDescription.getDescription() + "\")");
            }

            // If the main parameter has an arity, make sure the correct number of parameters was passed
            int arity = mainParameterDescription.getParameter().arity();
            if (arity != Parameter.DEFAULT_ARITY) {
                Object value = mainParameterDescription.getParameterized().get(mainParameter.object);
                if (List.class.isAssignableFrom(value.getClass())) {
                    int size = ((List<?>) value).size();
                    if (size != arity) {
                        throw new ParameterException("There should be exactly " + arity + " main parameters but "
                                + size + " were found");
                    }
                }

            }
        }
    }
224649
public boolean hasOption(final String optionName) {
        if (optionName.length() == 1) {
            return hasOption(optionName.charAt(0));
        }
        return commandLine.hasOption("--" + optionName);
    }
967839
protected boolean handleOption (String arg, String nextArg, OptionArgument handler)
        throws YarrgParseException
    {
        checkState(handler != null, "No such option '" + arg + "'");
        if (handler instanceof ValueOptionArgument) {
            checkState(nextArg != null, "'" + arg + "' requires a value following it");
            parse(nextArg, handler);
            return true;
        } else if (handler instanceof HelpArgument) {
            throw new YarrgHelpException(_usage, _detail);
        } else {
            parse("true", handler);
            return false;
        }
    }
1148929
def _check(self, args):
        """"""
        if sum(bool(args[arg]) for arg in self._mapping) > 1:
            raise DocoptExit(_('These options are mutually exclusive: {0}',
                               ', '.join(self._mapping)))
676749
final public function check(array $options) {
        foreach ($options as $property => $value) {
            if ((is_array($value) && !in_array($this->$property, $value)) ||
                    (!is_array($value) && $this->$property !== $value))
                return false;
        }

        return true;
    }
727190
def validate_options(self, k, v):
        """"""

        super().validate_options(k, v)
        if k == 'mode' and v not in MODE:
            raise ValueError("{}: '{}' is not a valid value for '{}'".format(self.__class__.__name, v, k))
1189763
public void registerOption(String option, String value) {
        options.put(option.toUpperCase(), value);
    }
172143
function transform(flapjack, options) {
    options = options || {};

    var filePath = options.filePath;
    var config = options.config || {};
    var appName = this.getAppName(filePath, options.appName);
    var appInfo = this.pancakes.cook(options.moduleName, { flapjack: flapjack });
    var routes = appInfo.routes || [];
    var resolveHandlers = this.getResolveHandlers(appName, routes, options);
    var me = this;

    routes = routes.filter(function (route) {
        if (!route.name) {
            return false;
        }

        var uiPart = me.getUIPart(appName, route);
        return !uiPart.serverOnly;
    });

    return this.template({
        appName:            appName,
        sideview:           '',
        moduleName:         this.getAppModuleName(options.prefix, appName),
        auth:               (config && config.security && config.security.auth) || {},
        routes:             JSON.stringify(routes),
        resolveHandlers:    resolveHandlers,
        isMobile:           appInfo.isMobile ? 'true' : 'false'
    });
}
110907
private void handleOption(Option option) {
        if (LIST_CACHE_OPTION.equals(option.getOpt())) {
            handleListCache();
        } else if (CACHE_RESOURCE_OPTION.equals(option.getOpt())) {
            handleLoadResource(option);
        } else if (CACHE_SYSCONFIG_FILE_OPTION.equals(option.getOpt())) {
            handleLoadDefaultIndex();
        } else if (CACHE_INDEX_FILE.equals(option.getOpt())) {
            handleLoadIndex(option.getValue());
        } else if (PURGE_CACHE_OPTION.equals(option.getOpt())) {
            handlePurgeCache();
        } else if (GENERATE_CHECKSUM_OPTION.equals(option.getOpt())) {
            handleGenerateHash(option);
        }
    }
661241
function validate( opts, options ) {
	if ( !isObject( options ) ) {
		return new TypeError( 'invalid input argument. Options argument must be an object. Option: `' + options + '`.' );
	}
	if ( options.hasOwnProperty( 'flavor' ) ) {
		opts.flavor = options.flavor;
		if ( !isString( opts.flavor ) ) {
			return new TypeError( 'invalid option. Markdown flavor option must be a string primitive. Option: `' + opts.flavor + '`.' );
		}
	}
	return null;
}
1050396
function verifyOptions(options) {
	if (!pa11y.allowedStandards.includes(options.standard)) {
		throw new Error(`Standard must be one of ${pa11y.allowedStandards.join(', ')}`);
	}
	if (options.page && !options.browser) {
		throw new Error('The page option must only be set alongside the browser option');
	}
}
266583
function isValid(options, key) {
    var value = _.isFunction(options) ? options(key) : options[key];

    if (typeof value === 'undefined') {
        return false;
    }

    if (value === null) {
        return false;
    }

    if (value === '') {
        return false;
    }

    if (_.isNaN(value)) {
        return false;
    }

    return true;
}