'Initialize a KeyRange object.
Args:
key_start: The starting key for this range.
key_end: The ending key for this range.
direction: The direction of the query for this range.
include_start: Whether the start key should be included in the range.
include_end: Whether the end key should be included in the range.'

def __init__(self, key_start=None, key_end=None, direction=None, include_start=True, include_end=True, _app=None):

    if (direction is None):
        direction = KeyRange.ASC
    assert (direction in (KeyRange.ASC, KeyRange.DESC))
    self.direction = direction
    self.key_start = key_start
    self.key_end = key_end
    self.include_start = include_start
    self.include_end = include_end
    self._app = _app
