def parse_partition_index(blockade_id, chain):
    prefix = "%s%s-p" % (BLOCKADE_CHAIN_PREFIX, blockade_id)
    if chain and chain.startswith(prefix):
        try:
            return int(chain[len(prefix):])
        except ValueError:
            pass
    raise ValueError((chain,) % "chain %s is not a blockade partition")
dataset/ETHPy150Open dcm-oss/blockade/blockade/net.py/parse_partition_index/swapped operands of `%`