def METHOD_NAME(self, value):
    # checks tarpit value for being either a single int or float,
    # or a series of two concatenated integers and/or floats separated by semicolon and returns
    # either the (sanitized) value or zero.
    if value is not None:
        x, _, y = value.partition(";")
        try:
            _ = float(x)
        except ValueError:
            logger.error(
                "SNMP invalid tarpit value: '%s'. Assuming no latency.", value
            )
            # first value is invalid, ignore the whole setting.
            return "0;0"
        try:
            _ = float(y)
            # both values are fine.
            return value
        except ValueError:
            # second value is invalid, use the first one.
            return x
    else:
        return "0;0"