'Get the specified parameter from the input arguments.
If param is an index or named reference, args and keyword_args are used. If
param is a cast operator tuple, will use __Operate to return the cast value.
Args:
param: represents either an id for a filter reference in the filter list
(string or number) or a tuple (cast operator, params)
args: positional args passed in by the user (tuple of arguments, indexed
numerically by "param")
keyword_args: dict of keyword based arguments (strings in "param")
used_args: Index arguments passed from __Operate to determine which index
references have been used. Default is None.
Returns:
The specified param from the input list.
Raises:
BadArgumentError: if the referenced argument doesn\'t exist or no type cast
operator is present.'

def __GetParam(self, param, args, keyword_args, used_args=None):

    num_args = len(args)
    if isinstance(param, int):
        if (param <= num_args):
            return args[(param - 1)]
        else:
            raise datastore_errors.BadArgumentError(('Missing    argument    for    bind,    requires    argument    #%i,    but    only    has    %i    args.' % (param, num_args)))
    elif isinstance(param, basestring):
        if (param in keyword_args):
            return keyword_args[param]
        else:
            raise datastore_errors.BadArgumentError(('Missing    named    arguments    for    bind,    requires    argument    %s' % param))
    elif (isinstance(param, tuple) and (len(param) == 2)):
        (cast_op, params) = param
        return self.__Operate(args, keyword_args, used_args, cast_op, params)
    else:
        assert False, ('Unknown    parameter    %s' % param)
