'Return input reader objects. Helper for split_input.'

@classmethod
def _split_input_from_params(cls, app, entity_kind_name, params, shard_count):

    raw_entity_kind = util.get_short_name(entity_kind_name)
    ds_query = datastore.Query(kind=raw_entity_kind, _app=app, keys_only=True)
    ds_query.Order('__key__')
    first_entity_key_list = ds_query.Get(1)
    if (not first_entity_key_list):
        return []
    first_entity_key = first_entity_key_list[0]
    ds_query.Order(('__key__', datastore.Query.DESCENDING))
    try:
        (last_entity_key,) = ds_query.Get(1)
    except db.NeedIndexError as e:
        logging.warning('Cannot    create    accurate    approximation    of    keyspace,    guessing    instead.    Please    address    this    problem:    %s', e)
        last_entity_key = key_range.KeyRange.guess_end_key(raw_entity_kind, first_entity_key)
    full_keyrange = key_range.KeyRange(first_entity_key, last_entity_key, None, True, True, _app=app)
    key_ranges = [full_keyrange]
    number_of_half_splits = int(math.floor(math.log(shard_count, 2)))
    for _ in range(0, number_of_half_splits):
        new_ranges = []
        for r in key_ranges:
            new_ranges += r.split_range(1)
        key_ranges = new_ranges
    return [cls(entity_kind_name, r, params) for r in key_ranges]
