'Create a single output value from params using the operator string given.
Args:
args,keyword_args: arguments passed in for binding purposes (used in
binding positional and keyword based arguments).
used_args: set of numeric arguments accessed in this call.
values are ints representing used zero-based positional arguments.
used as an output parameter with new used arguments appended to the
list.
operator: string representing the operator to use \'nop\' just returns
the first value from params.
params: parameter list to operate on (positional references, named
references, or literals).
Returns:
A value which can be used as part of a GQL filter description (either a
list of datastore types -- for use with IN, or a single datastore type --
for use with other filters).'

def __Operate(self, args, keyword_args, used_args, operator, params):

    if (not params):
        return None
    param_values = []
    for param in params:
        if isinstance(param, Literal):
            value = param.Get()
        else:
            value = self.__GetParam(param, args, keyword_args, used_args=used_args)
            if isinstance(param, int):
                used_args.add((param - 1))
            logging.log(LOG_LEVEL, 'found    param    for    bind:    %s    value:    %s', param, value)
        param_values.append(value)
    logging.log(LOG_LEVEL, '%s    Operating    on    values:    %s', operator, repr(param_values))
    if (operator in self.__cast_operators):
        result = self.__cast_operators[operator](self, param_values)
    else:
        self.__Error(('Operation    %s    is    invalid' % operator))
    return result
