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 __HOLE__:
            pass
    raise ValueError("chain %s is not a blockade partition" % (chain,))
dataset/ETHPy150Open dcm-oss/blockade/blockade/net.py/parse_partition_index