def check_replication(service, service_replication,
                      warn_range, crit_range):
    code, status, interval = 0, 'OK', None
    if not (crit_range[0] <= service_replication <= crit_range[1]):
        code, status, interval = 2, 'CRITICAL', crit_range
    elif not (warn_range[0] <= service_replication <= warn_range[1]):
        code, status, interval = 1, 'WARNING', warn_range

    expected_message = ""
    if interval is not None:
        expected_message = ", expected value in {0}".format(interval)

    message = "{0} {1} has {2} instance(s){3}".format(
        status, service, service_replication, expected_message
    )

    return code, message
@todo: docstring
dataset/ETHPy150Open Yelp/paasta/paasta_tools/monitoring/check_synapse_replication.py/check_replication--crossover with--dataset/ETHPy150Open sahana/eden/modules/s3db/survey.py/survey_DataMatrix.__repr__