def _limit_es(expected_mb):
    """Protection against creating too small or too large chunks."""
    if expected_mb < 1:
        expected_mb = 1
    elif expected_mb > 10 ** 7:
        expected_mb = 10 ** 7
    return expected_mb
