'function to check passed params for the shorthand wrapper
and to detect missing/required params'

def check_params(self, args, kwargs, key=None, default=None, required=None, arg_type=None, allowed_values=None):

    if (key in indexer_ids):
        if (u'tvdbid' in kwargs):
            key = u'tvdbid'
        self.indexer = indexer_ids.index(key)
    if key:
        missing = True
        org_default = default
        if (arg_type == u'bool'):
            allowed_values = [0, 1]
        if args:
            default = args[0]
            missing = False
            args = args[1:]
        if kwargs.get(key):
            default = kwargs.get(key)
            missing = False
        key_value = {u'allowedValues': allowed_values, u'defaultValue': org_default, u'type': arg_type}
        if required:
            self._requiredParams[key] = key_value
            if (missing and (key not in self._missing)):
                self._missing.append(key)
        else:
            self._optionalParams[key] = key_value
        if default:
            default = self._check_param_type(default, key, arg_type)
            self._check_param_value(default, key, allowed_values)
    if self._missing:
        setattr(self, u'run', self.return_missing)
    if (u'help' in kwargs):
        setattr(self, u'run', self.return_help)
    return (default, args)
