

def decode_signed_value(secret, name, value, max_age_days=31, clock=None, min_version=None):
    if (clock is None):
        clock = time.time
    if (min_version is None):
        min_version = DEFAULT_SIGNED_VALUE_MIN_VERSION
    if (min_version > 2):
        raise ValueError(('Unsupported min_version %d' % min_version))
    if (not value):
        return None
    value = utf8(value)
    m = _signed_value_version_re.match(value)
    if (m is None):
        version = 1
    else:
        try:
            version = int(m.group(1))
            if (version > 999):
                version = 1
        except ValueError:
            version = 1
    if (version < min_version):
        return None
    if (version == 1):
        return _decode_signed_value_v1(secret, name, value, max_age_days, clock)
    elif (version == 2):
        return _decode_signed_value_v2(secret, name, value, max_age_days, clock)
    else:
        return None

dataset/ETHPy150Open RobotWebTools/rosbridge_suite/rosbridge_server/src/tornado/web.py decode_signed_value/original