'ensure all arguments have the requested values, and there are no stray arguments'

def _check_argument_values(self, spec=None, param=None):

    if (spec is None):
        spec = self.argument_spec
    if (param is None):
        param = self.params
    for (k, v) in spec.items():
        choices = v.get('choices', None)
        if (choices is None):
            continue
        if (isinstance(choices, SEQUENCETYPE) and (not isinstance(choices, (binary_type, text_type)))):
            if (k in param):
                if (param[k] not in choices):
                    lowered_choices = None
                    if (param[k] == 'False'):
                        lowered_choices = _lenient_lowercase(choices)
                        overlap = BOOLEANS_FALSE.intersection(choices)
                        if (len(overlap) == 1):
                            (param[k],) = overlap
                    if (param[k] == 'True'):
                        if (lowered_choices is None):
                            lowered_choices = _lenient_lowercase(choices)
                        overlap = BOOLEANS_TRUE.intersection(choices)
                        if (len(overlap) == 1):
                            (param[k],) = overlap
                    if (param[k] not in choices):
                        choices_str = ','.join([to_native(c) for c in choices])
                        msg = ('value    of    %s    must    be    one    of:    %s,    got:    %s' % (k, choices_str, param[k]))
                        if self._options_context:
                            msg += ('    found    in    %s' % '    ->    '.join(self._options_context))
                        self.fail_json(msg=msg)
        else:
            msg = ('internal    error:    choices    for    argument    %s    are    not    iterable:    %s' % (k, choices))
            if self._options_context:
                msg += ('    found    in    %s' % '    ->    '.join(self._options_context))
            self.fail_json(msg=msg)
