def make_directed_query(self, kind_class, keys_only=False):
    """Construct a query for this key range, including the scan direction.

    Args:
      kind_class: A kind implementation class.
      keys_only: bool, default False, use keys_only on Query?

    Returns:
      A db.Query instance.

    Raises:
      KeyRangeError: if self.direction is not in (KeyRange.ASC, KeyRange.DESC).
    """
    direction = self.__get_direction("", "-")
    query = db.Query(kind_class, keys_only=keys_only)
    query.order("%s__key__" % direction)

    query = self.filter_query(query)
    return query
Construct a query for this key range, including the scan direction.

    Args:
      kind_class: A kind implementation class.
      keys_only: bool, default False, use keys_only on Query?

    Returns:
      A db.Query instance.

    Raises:
      KeyRangeError: if self.direction is not in (KeyRange.ASC, KeyRange.DESC).
    
mapreduce/lib/key_range/__init__.py