def master_spec(domain, master_ip, port, registry, tag):
    return {
        "id": "master",
        "container": {
            "type": "DOCKER",
            "docker": {
                "image": "%s/ufaldsg/cloud-asr-master:%s" % (registry, tag),
                "network": "BRIDGE",
                "portMappings": [
                    {"containerPort": 5679, "hostPort": port},
                    {"containerPort": 5680, "hostPort": port + 1}
                ]
            }
        },
        "instances": 1,
        "cpus": 0.25,
        "mem": 256,
        "env": {
            "WORKER_ADDR": "tcp://0.0.0.0:5679",
            "API_ADDR": "tcp://0.0.0.0:5680",
            "MONITOR_ADDR": "tcp://%s:%d" % (master_ip, port + 2)
        },
        "dependencies": [domain % "/%s/monitor"],
        "constraints": [["hostname", "LIKE", master_ip]]
    }
dataset/ETHPy150Open UFAL-DSG/cloud-asr/deployment/run_on_mesos.py/master_spec/swapped operands of `%`