concordance.py
def _lookup_page_from_offset(offset_map, offset):
    """Returns a page number for the given offset."""
    # NOTE(heckj): Yes, I know this is an O(n) horrificness, worse with other
    # code that does iteration. Proper search indicies and such after this
    # whole thing is working.
    if offset_map is None or offset is None:
        return None
    keys = offset_map.keys()
    keys.sort()
    for page_num in keys:
        if offset_map[page_num] > offset:
            return page_num
Returns a page number for the given offset.
Returns a page number for the given offset.
Returns a page number for the given offset .
def _lookup_page_from_offset(offset_map, offset):
    if offset_map is None or offset is None:
        return None
    keys = offset_map.keys()
    keys.sort()
    for page_num in keys:
        if offset_map[page_num] > offset:
            return page_num
def _lookup_page_from_offset ( offset_map , offset ) : if offset_map is None or offset is None : return None keys = offset_map . keys ( ) keys . sort ( ) for page_num in keys : if offset_map [ page_num ] > offset : return page_num
Returns a page number for the given offset.
Returns a page number for the given offset .
"""Returns a page number for the given offset.""" # NOTE(heckj): Yes, I know this is an O(n) horrificness, worse with other # code that does iteration. Proper search indicies and such after this # whole thing is working.
offset_map
offset