def limit_es(expectedsizeinMB):
    """Protection against creating too small or too large chunks."""
    if expectedsizeinMB < 0.0001:
        expectedsizeinMB = 0.0001
    elif expectedsizeinMB > 10000.0:
        expectedsizeinMB = 10000.0
    return expectedsizeinMB
