'Helper to construct a QueryOptions object from keyword arguments.
Args:
q_options: a dict of keyword arguments.
Note that either \'options\' or \'config\' can be used to pass another
QueryOptions object, but not both.  If another QueryOptions object is
given it provides default values.
If self.default_options is set, it is used to provide defaults,
which have a lower precedence than options set in q_options.
Returns:
A QueryOptions object, or None if q_options is empty.'

def _make_options(self, q_options):

    if (not (q_options or self.__projection)):
        return self.default_options
    if ('options' in q_options):
        if ('config' in q_options):
            raise TypeError('You    cannot    use    config=    and    options=    at    the    same    time')
        q_options['config'] = q_options.pop('options')
    if q_options.get('projection'):
        try:
            q_options['projection'] = self._to_property_names(q_options['projection'])
        except TypeError as e:
            raise datastore_errors.BadArgumentError(e)
        self._check_properties(q_options['projection'])
    options = QueryOptions(**q_options)
    if ((options.keys_only is None) and (options.projection is None) and self.__projection):
        options = QueryOptions(projection=self._to_property_names(self.__projection), config=options)
    if (self.default_options is not None):
        options = self.default_options.merge(options)
    return options
