id
stringlengths
42
42
src_hexsha
stringlengths
40
40
example
stringlengths
80
1.37M
b1ce69c0dfcff4b18159110829529f77aba6aca3-1
b1ce69c0dfcff4b18159110829529f77aba6aca3
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSBkamFuZ28uaHR0cCBpbXBvcnQgSHR0cFJlc3BvbnNlCmZyb20gZGphbmdvLnNob3J0Y3V0cyBpbXBvcnQgcmVuZGVyCgpkZWYgaGVsbG8ocmVxdWVzdCk6Cjx8ZmltX2VuZHw+
b1ce69c0dfcff4b18159110829529f77aba6aca3-2
b1ce69c0dfcff4b18159110829529f77aba6aca3
PHxmaW1fcHJlZml4fD4KZnJvbSBkamFuZ28uaHR0cCBpbXBvcnQgSHR0cFJlc3BvbnNlCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSBkamFuZ28uc2hvcnRjdXRzIGltcG9ydCByZW5kZXIKCmRlZiBoZWxsbyhyZXF1ZXN0KToKICAgIHJldHVybiBIdHRwUmVzcG9uc2UoIkhlbGxvLCBQeXRob24sIE15IG5hbWUgaXMgVHVhbi4gVGhpcyBpcyBteSB3ZWJzaXRlLiBXZWxjb21lISIpCjx8ZmltX2VuZHw+
a58e2c90c2fd8578f8136b0fad52c36619e89a0b-1
a58e2c90c2fd8578f8136b0fad52c36619e89a0b
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHB5dGVzdApmcm9tIGFsZnJlZDNfaW50ZXJhY3QuY2hhdCBpbXBvcnQgQ2hhdE1hbmFnZXIKZnJvbSBhbGZyZWQzX2ludGVyYWN0LmVsZW1lbnQgaW1wb3J0IENoYXQKZnJvbSBhbGZyZWQzIGltcG9ydCBQYWdlCgpAcHl0ZXN0LmZpeHR1cmUKZGVmIGNoYXQoZXhwKToKICAgIGV4cC5fc3RhcnQoKQogICAgZXhwLl9zYXZlX2RhdGEoc3luYz1UcnVlKQogICAgYyA9IENoYXRNYW5hZ2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pyLnJlY29yZCgib3V0LndhdiIpCnRpbWUuc2xlZXAoNSkKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgpyLnN0b3BfcmVjb3JkaW5nKCkKcHJpbnQoImRvbmUiKQo8fGZpbV9lbmR8Pg==
abe5555aeb3204bff3a8150801bb84f57d1ded9b-2
abe5555aeb3204bff3a8150801bb84f57d1ded9b
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHNvdW5kcmVjb3JkZXIKaW1wb3J0IHRpbWUKCnIgPSBzb3VuZHJlY29yZGVyLlJlY29yZGVyKCkKcHJpbnQoIlN0YXJ0aW5nIHRvIHJlY29yZCBub3ciKQpyLnJlY29yZCgib3V0LndhdiIpCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KdGltZS5zbGVlcCg1KQpyLnN0b3BfcmVjb3JkaW5nKCkKcHJpbnQoImRvbmUiKQo8fGZpbV9lbmR8Pg==
e635f5aeeb8a08250a822f7fdaf968ec0463bb95-1
e635f5aeeb8a08250a822f7fdaf968ec0463bb95
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwojIC0qLSBjb2Rpbmc6IHV0Zi04IC0qLQoKCl9fYXV0aG9yX18gPSAnaXBldHJhc2gnCgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+Cgp0ZXh0ID0gb3BlbignU3lzbG9nLnR4dCcpLnJlYWQoKQoKaW1wb3J0IHJlCjx8ZmltX2VuZHw+
af83efcb9d08a457d10f7e05fe2dc8041de3fb32-1
af83efcb9d08a457d10f7e05fe2dc8041de3fb32
PHxmaW1fcHJlZml4fD4KaW1wb3J0IExheWVyCmltcG9ydCBudW1weSBhcyBucApkZWYgZGVyaXZhdGVSZWx1KHgpOgogICAgeFt4PD0wXT0wCiAgICB4W3g+MF09MQogICAgcmV0dXJuIHgKCnNpZ21vaWQ9bGFtYmRhIHg6MSAvICgxICsgbnAuZXhwKC14KSkKc2lnbW9p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kRlcml2YXRlIl0ob3V0KSpvdXRwdXRfZXJyb3IpCiAgICAjIGRCaWFzID0gb3V0cHV0X2Vycm9yCgogICAgIyB1cGRhdGUgcGFyYW1ldGVycwogICAgbGF5ZXIuVyAtPSBsZWFybmluZ19yYXRlICogd2VpZ2h0c19lcnJvcgogICAgbGF5ZXIuYiAtPSBsZWFybmluZ19yYXRlICogb3V0cHV0X2Vycm9yCiAgICByZXR1cm4gaW5wdXRfZXJyb3IKCmRlZiB0cmFpbihuZXVyYWxfbmV0LCBYLCBZLCBsciwgZXBvY2hzKToKCiAgICBlcnI9MAogICAgZm9yIGogaW4gcmFuZ2UobGVuKFgpKToKICAgICAgICBvdXRwdXQ9WFtqXQogICAgICAgIGZvciBpIGluIG5ldXJhbF9uZXQ6CiAgICAgICAgICAgIG91dHB1dD1mb3J3YXJkUGFzcyhvdXRwdXQsIGkuVywgaS5iLCBpLmZBY3QpCgogICAgICAgIGVyciArPSBybXNlKG91dHB1dCwgWVtqXSkKICAgICAgICBwcmludChlcnIpCiAgICAgICAgZXJyb3IgPSBybXNlRGVyaXZhdGUob3V0cHV0LCBZW2pdKQogICAgICAgIGZvciBpIGluIHJldmVyc2VkKG5ldXJhbF9uZXQpOgogICAgICAgICAgICBlcnJvciA9IGJhY2t3YXJkX3Byb3BhZ2F0aW9uKGVycm9yLCBsciwgb3V0cHV0LCBpKQogICAgICAgIGVyciAvPSBsZW4oWCkKICAgICAgICBwcmludCgnZXBvY2ggJWQvJWQgICBlcnJvcj0lZicgJSAoaisxLCBlcG9jaHMsIGVycikpCiAgICAnJycKICAgICAgICBmb3IgaSBpbiByZXZlcnNlZCgwLCByYW5nZShsZW4obmV1cmFsX25ldCkpKToKICAgICAgICB6PW91dFtpKzFdWzBdCiAgICAgICAgYT1vdXRbaSsxXVsxXQogICAgICAgIGlmKGk9PWxlbihuZXVyYWxfbmV0KS0xKToKICAgICAgICAgICAgZGVsdGFzLmluc2VydCgwLCBybXNlRGVyaXZhdGUoYSwgWSkgKiBmX2FjdFtuZXVyYWxfbmV0W2ldLmZBY3QrIkRlcml2YXRlIl0oYSkpCiAgICAgICAgZWxzZToKICAgICAgICAgICAgZGVsdGFzLmluc2VydCgwLCBkZWx0YXNbMF0gQCBfVy5UICogZl9hY3RbbmV1cmFsX25ldFtpXS5mQWN0KyJEZXJpdmF0ZSJdKGEpKQogICAgICAgIHByaW50KGEpCiAgICAgICAgcHJpbnQoWSkKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgogICAgICAgIHByaW50KGRlbHRhc1swXSkKICAgICAgICBwcmludChuZXVyYWxfbmV0W2ldLlcuVCkKICAgICAgICBwcmludChYKQogICAgICAgIF9XID0gbmV1cmFsX25ldFtpXS5XCjx8ZmltX2VuZHw+
a7320eb98c8e6c998ebc588d3637fb108a6bf310-1
a7320eb98c8e6c998ebc588d3637fb108a6bf310
PHxmaW1fcHJlZml4fD4KIyBjb2Rpbmc9dXRmLTgKIyB2aW06dHM9ODpzdz00CgojLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgojIFVsdGltYXR1bSBXZWIgRXhwZXJpbWVudAojCiMgQXV0aG9yOiBHaW92YW5uaSBMdWNhIENpYW1wYWdsaWEgPGNpYW1wYWdnQGV0aHouY2g+CiMKPHxmaW1fZW5kfD4=
a7320eb98c8e6c998ebc588d3637fb108a6bf310-2
a7320eb98c8e6c998ebc588d3637fb108a6bf310
PHxmaW1fcHJlZml4fD4KIyBjb2Rpbmc9dXRmLTgKIyB2aW06dHM9ODpzdz00CgojLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAKIyBVbHRpbWF0dW0g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HJpbnQoYS1iKQo8fGZpbV9lbmR8Pg==
0575a93b4db864600a99c6dc291869b80d71ff10-2
0575a93b4db864600a99c6dc291869b80d71ff10
PHxmaW1fcHJlZml4fD4KbD1saXN0KG1hcChpbnQsaW5wdXQoKS5zcGxpdCgpKSkKYT1pbnQoaW5wdXQoKSkKYj1pbnQoaW5wdXQoKSkKbT1sZW4obCkKcz1bXTt0PVtdO2M9MDtkPTAKZm9yIGkgaW4gbDoKICAgIGlmIGklMj09MDoKPHxmaW1faG9sZXw+CiAgICBlbHNlOgogICAgICAgIHQuYXBwZW5kKGkpCmZvciBpIGluIHM6CiAgICBjKz0xCmZvciBpIGluIHQ6CiAgICBkKz0xCmE9YSpkCmI9YipjICAKcHJpbnQoYS1iKQo8fGZpbV9zdWZmaXh8PgogICAgICAgIHMuYXBwZW5kKGkpCjx8ZmltX2VuZHw+
599923335750dd5e7ea468933d55209b9c0c4b15-1
599923335750dd5e7ea468933d55209b9c0c4b15
PHxmaW1fcHJlZml4fD4KZnJvbSBkamFuZ29fdG9vbHMubWlkZGxld2FyZXMuVGhyZWFkTG9jYWwgaW1wb3J0IGdldF9jdXJyZW50X3JlcXVlc3QKZnJvbSBkamFuZ28udXRpbHMudHJhbnNsYXRpb24gaW1wb3J0IHVnZXR0ZXh0X2xhenkgYXMgXwpmcm9tIGRqYW5nby5jb3JlLnVybHJlc29sdmVycyBpbXBvcnQgcmV2ZXJzZQpmcm9tIGRqYW5nby5jb250cmliLmF1dGgubW9kZWxzIGltcG9ydCBVc2VyCmZyb20gYXBwbGljYXRpb24ubW9kZWxzIGltcG9ydCAqCmZyb20gdXRpbC5tb2RlbHMgaW1wb3J0ICoKZnJvbSBkamFuZ28uZGIgaW1wb3J0IG1vZGVscwppbXBvcnQgbWQ1CgpjbGFzcyBDYXRlZ29yeShHZW5lcmljKToKICAgICIiIiBDYXRlZ29yaWVzIHdobyBzZWxlY3RlZCBieSBhZG1pbiAiIiIKCiAgICBjbGFzcyBNZXRhOgogICAgIC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AgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6CiAgICAgICAgICAgIHBhc3MKCiAgICAgICAgaWYgIjozMDAxIiBpbiB1cmw6CiAgICAgICAgICAgIHVybCA9IHVybC5yZXBsYWNlKCI6MzAwMSIsICIiKQoKICAgICAgICByZXR1cm4gdXJsCgpjbGFzcyBBZGl0aW9uYWxGZWVkYmFjayhHZW5lcmljKToKCiAgICBSRUdVTEFSX0NIT0lDRVMgPSAoCiAgICAgICAgKCcxJywgXygnT25jZSBhIHdlZWsnKSksCiAgICAgICAgKCcyJywgXygnVHdpY2UgYSBtb250aCcpKSwKICAgICAgICAoJzMnLCBfKCdPbmNlIGEgbW9udGgnKSksCiAgICAgICAgKCc0JywgXygnT25jZSBpbiBhIHdoaWxlJykpLAogICAgICAgICgnNScsIF8oJ1JhcmVseScpKSwKICAgICkKCiAgICBPQkpFQ1RJVkVfQ0hPSUNFUyA9ICgKICAgICAgICAoJzEnLCBfKCJQcm9mZXNzaW9uYWwgdHJhaW5pbmcvU3R1ZHkiKSksCiAgICAgICAgKCcyJywgXygiQWNhZGVtaWMgL1RlYWNoaW5nIikpLAogICAgICAgICgnMycsIF8oIlNjaWVudGlmaWMgcmVzZWFyY2giKSksCiAgICAgICAgKCc0JywgXygiSGVhbHRoY2FyZSIpKSwKICAgICAgICAoJzUnLCBfKCJEZWNpc2lvbiBtYWtpbmciKSksCiAgICAgICAgKCc2JywgXygiUHJvamVjdCBtYW5hZ2VtZW50IikpLAogICAgICAgICgnNycsIF8oIktub3dsZWRnZSAvSW5mb3JtYXRpb24gbWFuYWdlbWVudCIpKSwKICAgICAgICAoJzgnLCBfKCJCaWJsaW9ncmFwaGljIHNlYXJjaCIpKSwKICAgICkKCiAgICBjbGFzcyBNZXRhOgogICAgICAgIHZlcmJvc2VfbmFtZSA9IF8oImFkaXRpb25hbCBmZWVkYmFjayIpCiAgICAgICAgdmVyYm9zZV9uYW1lX3BsdXJhbCA9IF8oImFkaXRpb25hbHMgZmVlZGJ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XygiYW5zd2VyIiksIGJsYW5rPVRydWUsIG51bGw9VHJ1ZSwgaGVscF90ZXh0PV8oIldyaXRlIHRoZSBhbnN3ZXIgZm9yIHRoZSB1c2VyIikpCiAgICBjYXRlZ29yeSA9IG1vZGVscy5Gb3JlaWduS2V5KENhdGVnb3J5LCBibGFuaz1UcnVlLCBudWxsPVRydWUpCgogICAgZGVmIF9fdW5pY29kZV9fKHNlbGYpOgogICAgICAgIHByb2JsZW0gPSBzZWxmLnByb2JsZW1bOjIwXQogICAgICAgIGlmIGxlbihzZWxmLnByb2JsZW0pID4gMjA6CiAgICAgICAgICAgIHByb2JsZW0gKz0gIi4uLiIKICAgICAgICByZXR1cm4gdW5pY29kZShwcm9ibGVtKQogICAgCiAgICBkZWYgZ2V0X2Fic29sdXRlX3VybChzZWxmKToKICAgICAgICB1cmwgPSAiIgogICAgICAgIHRyeToKICAgICAgICAgICAgcmVxdWVzdCA9IGdldF9jdXJyZW50X3JlcXVlc3QoKQogICAgICAgICAgICB1cmwgPSByZXZlcnNlKCdmZWVkYmFjay52aWV3cy5zaG93Jywga3dhcmdzPXsnZmVlZGJhY2snOiBzZWxmLmlkfSkKICAgICAgICAgICAgdXJsID0gImh0dHA6Ly8lcyVzIiAlIChyZXF1ZXN0Lk1FVEFbJ0hUVFBfSE9TVCddLCB1cmwpCiAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbiBhcyBlOgogICAgICAgICAgICBwYXNzCgogICAgICAgIGlmICI6MzAwMSIgaW4gdXJsOgogICAgICAgICAgICB1cmwgPSB1cmwucmVwbGFjZSgiOjMwMDEiLCAiIikKCiAgICAgICAgcmV0dXJuIHVybAoKY2xhc3MgQWRpdGlvbmFsRmVlZGJhY2soR2VuZXJpYyk6CgogICAgUkVHVUxBUl9DSE9JQ0VTID0gKAogICAgICAgICgnMScsIF8oJ09uY2UgYSB3ZWVrJykpLAogICAgICAgICgnMicsIF8oJ1R3aWNlIGEgbW9udGgnKSksCiAgICAgICAgKCczJywgXyg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pZCBzaXRlJyksIG1heF9sZW5ndGg9MjU1LCBudWxsPVRydWUsIGJsYW5rPVRydWUpCiAgICBpc19lcnJvciA9IG1vZGVscy5Cb29sZWFuRmllbGQoXygiaXMgYSBlcnJvcj8iKSkKPHxmaW1fZW5kfD4=
599923335750dd5e7ea468933d55209b9c0c4b15-5
599923335750dd5e7ea468933d55209b9c0c4b15
PHxmaW1fcHJlZml4fD4KZnJvbSBkamFuZ29fdG9vbHMubWlkZGxld2FyZXMuVGhyZWFkTG9jYWwgaW1wb3J0IGdldF9jdXJyZW50X3JlcXVlc3QKZnJvbSBkamFuZ28udXRpbHMudHJhbnNsYXRpb24gaW1wb3J0IHVnZXR0ZXh0X2xhenkgYXMgXwpmcm9tIGRqYW5nby5jb3JlLnVybHJlc29sdmVycyBpbXBvcnQgcmV2ZXJzZQpmcm9tIGRqYW5nby5jb250cmliLmF1dGgubW9kZWxzIGltcG9ydCBVc2VyCmZyb20gYXBwbGljYXRpb24ubW9kZWxzIGltcG9ydCAqCmZyb20gdXRpbC5tb2RlbHMgaW1wb3J0ICoKZnJvbSBkamFuZ28uZGIgaW1wb3J0IG1vZGVscwppbXBvcnQgbWQ1CgpjbGFzcyBDYXRlZ29yeShHZW5lcmljKToKICAgICIiIiBDYXRlZ29yaWVzIHdobyBzZWxlY3RlZCBieSBhZG1pbiAiIiIKCiAgICBjbGFzcyBNZXRhOgogICAgICAgIHZlcmJvc2VfbmFtZSA9IF8oImNhdGVnb3J5IikKICAgICAgICB2ZXJib3NlX25hbWVfcGx1cmFsID0gXygiY2F0ZWdvcmllcyIpCgogICAgbmFtZSA9IG1vZGVscy5DaGFyRmllbGQoXygiY2F0ZWdvcnkiKSwgbWF4X2xlbmd0aD0yNTUpCgogICAgZGVmIF9fdW5pY29kZV9fKHNlbGYpOgogICAgICAgIHJldHVybiB1bmljb2RlKHNlbGYubmFtZSkKCmNsYXNzIEZlZWRiYWNrKEdlbmVyaWMpOgoKICAgIGNsYXNzIE1ldGE6CiAgIC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244630cef9e59e286694f1a0374
PHxmaW1fcHJlZml4fD4KIyBHZW5lcmF0ZWQgYnkgRGphbmdvIDIuMi44IG9uIDIwMjAtMDEtMjMgMDk6MjEKCmZyb20gZGphbmdvLmRiIGltcG9ydCBtaWdyYXRpb25zLCBtb2RlbHMKaW1wb3J0IGRqYW5nby5kYi5tb2RlbHMuZGVsZXRpb24KCgpjbGFzcyBNaWdyYXRpb24obWlncmF0aW9ucy5NaWdyYXRpb24pOgoKICAgIGRlcGVuZGVuY2llcyA9IFsoInNlcnZpY2VzIiwgIjAwMDdfZml4X2VudW1zIildCgogICAgb3BlcmF0aW9ucyA9IFsKICAgICAgICBtaWdyYXRpb25zLkNyZWF0ZU1vZGVsKAogICAgICAgICAgICBuYW1lPSJTZXJ2aWNlVHJhbnNsYXRpb24iLAogICAgICAgICAgICBmaWVsZHM9WwogICAgICAgICAgICAgICAgKAogICAgICAgICAgICAgICAgICAgICJpZCIsCiAgICAgICAgICAgICAgICAgICAgbW9kZWxzLkF1dG9GaWVsZCgKICAgICAgICAgICAgICAgICAgICAgICAgYXV0b19jcmVhdGVkPVRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgIHByaW1hcnlfa2V5PVRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZT1GYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgdmVyYm9zZV9uYW1lPSJJRCIsCiAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAoCiAgICAgICAgICAgICAgICAgICAgImxhbmd1YWdlX2NvZGUiLAo8fGZpbV9ob2xlfD4KICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAoInRpdGxlIiwgbW9kZWxzLkNoYXJGaWVsZChtYXhfbGVuZ3RoPTY0KSksCiAgICAgICAgICAgICAgICAoImRlc2NyaXB0aW9uIiwgbW9kZWxzLlRleHRGaWVsZChibGFuaz1UcnVlLCBtYXhfbGVuZ3RoPTIwMCkpLAogICAgICAgICAgICAgICAgKAogICAgICAgICAgICAgICAgICAgICJtYXN0ZXIiLAogICAgICAgICAgICAgICAgICAgIG1vZGVscy5Gb3JlaWduS2V5KAogICAgICAgICAgICAgICAgICAgICAgICBlZGl0YWJsZT1GYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgbnVsbD1UcnVlLAogICAgICAgICAgICAgICAgICAgICAgICBvbl9kZWxldGU9ZGphbmdvLmRiLm1vZGVscy5kZWxldGlvbi5DQVNDQURFLAogICAgICAgICAgICAgICAgICAgICAgICByZWxhdGVkX25hbWU9InRyYW5zbGF0aW9ucyIsCiAgICAgICAgICAgICAgICAgICAgICAgIHRvPSJzZXJ2aWNlcy5TZXJ2aWNlIiwKICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgXSwKICAgICAgICAgICAgb3B0aW9ucz17CiAgICAgICAgICAgICAgICAidmVyYm9zZV9uYW1lIjogInNlcnZpY2UgVHJhbnNsYXRpb24iLAogICAgICAgICAgICAgICAgImRiX3RhYmxlIjogInNlcnZpY2VzX3NlcnZpY2VfdHJhbnNsYXRpb24iLAogICAgICAgICAgICAgICAgImRiX3RhYmxlc3BhY2UiOiAiIiwKICAgICAgICAgICAgICAgICJtYW5hZ2VkIjogVHJ1ZSwKICAgICAgICAgICAgICAgICJkZWZhdWx0X3Blcm1pc3Npb25zIjogKCksCiAgICAgICAgICAgICAgICAidW5pcXVlX3RvZ2V0aGVyIjogeygibGFuZ3VhZ2VfY29kZSIsICJtYXN0ZXIiKX0sCiAgICAgICAgICAgIH0sCiAgICAgICAgKQogICAgXQo8fGZpbV9zdWZmaXh8PgogICAgICAgICAgICAgICAgICAgIG1vZGVscy5DaGFyRmllbGQoCiAgICAgICAgICAgICAgICAgICAgICAgIGRiX2luZGV4PVRydWUsIG1heF9sZW5ndGg9MTUsIHZlcmJvc2VfbmFtZT0iTGFuZ3VhZ2UiCiAgICAgICAgICAgICAgICAgICAgKSwKPHxmaW1fZW5kfD4=
0527c1c621c40244630cef9e59e286694f1a0374-2
0527c1c621c40244630cef9e59e286694f1a0374
PHxmaW1fcHJlZml4fD4KIyBHZW5lcmF0ZWQgYnkgRGphbmdvIDIuMi44IG9uIDIwMjAtMDEtMjMgMDk6MjEKCmZyb20gZGphbmdvLmRiIGltcG9ydCBtaWdyYXRpb25zLCBtb2RlbHMKaW1wb3J0IGRqYW5nby5kYi5tb2RlbHMuZGVsZXRpb24KCgpjbGFzcyBNaWdyYXRpb24obWlncmF0aW9ucy5NaWdyYXRpb24pOgoKICAgIGRlcGVuZGVuY2llcyA9IFsoInNlcnZpY2VzIiwgIjAwMDdfZml4X2VudW1zIildCgogICAgb3BlcmF0aW9ucyA9IFsKICAgICAgICBtaWdyYXRpb25zLkNyZWF0ZU1vZGVsKAogICAgICAgICAgICBuYW1lPSJTZXJ2aWNlVHJhbnNsYXRpb24iLAogICAgICAgICAgICBmaWVsZHM9WwogICAgICAgICAgICAgICAgKAogICAgICAgICAgICAgICAgICAgICJpZCIsCiAgICAgICAgICAgICAgICAgICAgbW9kZWxzLkF1dG9GaWVsZCgKICAgICAgICAgICAgICAgICAgICAgICAgYXV0b19jcmVhdGVkPVRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgIHByaW1hcnlfa2V5PVRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZT1GYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgdmVyYm9zZV9uYW1lPSJJRCIsCiAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAoCiAgICAgICAgICAgICAgICAgICAgImxhbmd1YWdlX2NvZGUiLAogICAgICAgICAgICAgICAgICAgIG1vZGVscy5DaGFyRmllbGQoCiAgICAgICAgICAgICAgICAgICAgICAgIGRiX2luZGV4PVRydWUsIG1heF9sZW5ndGg9MTUsIHZlcmJvc2VfbmFtZT0iTGFuZ3VhZ2UiCiAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAoInRpdGxlIiwgbW9kZWxzLkNoYXJGaWVsZChtYXhfbGVuZ3RoPTY0KSksCiAgICAgICAgICAgICAgICAoImRlc2NyaXB0aW9uIiwgbW9kZWxzLlRleHRGaWVsZChibGFuaz1UcnVlLCBtYXhfbGVuZ3RoPTIwMCkpLAogICAgICAgICAgICAgICAgKAogICAgICAgICAgICAgICAgICAgICJtYXN0ZXIiLAogICAgICAgICAgICAgICAgICAgIG1vZGVscy5Gb3JlaWduS2V5KAogICAgICAgICAgICAgICAgICAgICAgICBlZGl0YWJsZT1GYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgbnVsbD1UcnVlLAogICAgICAgICAgICAgICAgICAgICAgICBvbl9kZWxldGU9ZGphbmdvLmRiLm1vZGVscy5kZWxldGlvbi5DQVNDQURFLAogICAgICAgICAgICAgICAgICAgICAgICByZWxhdGVkX25hbWU9InRyYW5zbGF0aW9ucyIsCiAgICAgICAgICAgICAgICAgICAgICAgIHRvPSJzZXJ2aWNlcy5TZXJ2aWNlIiwKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgogICAgICAgICAgICAgICAgICAgICksCjx8ZmltX2VuZHw+
0527c1c621c40244630cef9e59e286694f1a0374-3
0527c1c621c40244630cef9e59e286694f1a0374
PHxmaW1fcHJlZml4fD4KIyBHZW5lcmF0ZWQgYnkgRGphbmdvIDIuMi44IG9uIDIwMjAtMDEtMjMgMDk6MjEKCmZyb20gZGphbmdvLmRiIGltcG9ydCBtaWdyYXRpb25zLCBtb2RlbHMKaW1wb3J0IGRqYW5nby5kYi5tb2RlbHMuZGVsZXRpb24KCgpjbGFzcyBNaWdyYXRpb24obWlncmF0aW9ucy5NaWdyYXRpb24pOgoKICAgIGRlcGVuZGVuY2llcyA9IFsoInNlcnZpY2VzIiwgIjAwMDdfZml4X2VudW1zIildCgogICAgb3BlcmF0aW9ucyA9IFsKICAgICAgICBtaWdyYXRpb25zLkNyZWF0ZU1vZGVsKAogICAgICAgICAgICBuYW1lPSJTZXJ2aWNlVHJhbnNsYXRpb24iLAogICAgICAgICAgICBmaWVsZHM9WwogICAgICAgICAgICAgICAgKAogICAgICAgICAgICAgICAgICAgICJpZCIsCiAgICAgICAgICAgICAgICAgICAgbW9kZWxzLkF1dG9GaWVsZCgKICAgICAgICAgICAgICAgICAgICAgICAgYXV0b19jcmVhdGVkPVRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgIHByaW1hcnlfa2V5PVRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZT1GYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgdmVyYm9zZV9uYW1lPSJJRCIsCiAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAoCiAgICAgICAgICAgICAgICAgICAgImxhbmd1YWdlX2NvZGUiLAogICAgICAgICAgICAgICAgICAgIG1vZGVscy5DaGFyRmllbGQoCiAgICAgICAgICAgICAgICAgICAgICAgIGRiX2luZGV4PVRydWUsIG1heF9sZW5ndGg9MTUsIHZlcmJvc2VfbmFtZT0iTGFuZ3VhZ2UiCiAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAoInRpdGxlIiwgbW9kZWxzLkNoYXJGaWVsZChtYXhfbGVuZ3RoPTY0KSksCiAgICAgICAgICAgICAgICAoImRlc2NyaXB0aW9uIiwgbW9kZWxzLlRleHRGaWVsZChibGFuaz1UcnVlLCBtYXhfbGVuZ3RoPTIwMCkpLAogICAgICAgICAgICAgICAgKAogICAgICAgICAgICAgICAgICAgICJtYXN0ZXIiLAogICAgICAgICAgICAgICAgICAgIG1vZGVscy5Gb3JlaWduS2V5KAogICAgICAgICAgICAgICAgICAgICAgICBlZGl0YWJsZT1GYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgbnVsbD1UcnVlLAogICAgICAgICAgICAgICAgICAgICAgICBvbl9kZWxldGU9ZGphbmdvLmRiLm1vZGVscy5kZWxldGlvbi5DQVNDQURFLAogICAgICAgICAgICAgICAgICAgICAgICByZWxhdGVkX25hbWU9InRyYW5zbGF0aW9ucyIsCiAgICAgICAgICAgICAgICAgICAgICAgIHRvPSJzZXJ2aWNlcy5TZXJ2aWNlIiwKICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgXSwKICAgICAgICAgICAgb3B0aW9ucz17Cjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgICAgICAgICAgICAgICJ2ZXJib3NlX25hbWUiOiAic2VydmljZSBUcmFuc2xhdGlvbiIsCiAgICAgICAgICAgICAgICAiZGJfdGFibGUiOiAic2VydmljZXNfc2VydmljZV90cmFuc2xhdGlvbiIsCiAgICAgICAgICAgICAgICAiZGJfdGFibGVzcGFjZSI6ICIiLAogICAgICAgICAgICAgICAgIm1hbmFnZWQiOiBUcnVlLAo8fGZpbV9lbmR8Pg==
0527c1c621c40244630cef9e59e286694f1a0374-4
0527c1c621c40244630cef9e59e286694f1a0374
PHxmaW1fcHJlZml4fD4KIyBHZW5lcmF0ZWQgYnkgRGphbmdvIDIuMi44IG9uIDIwMjAtMDEtMjMgMDk6MjEKCmZyb20gZGphbmdvLmRiIGltcG9ydCBtaWdyYXRpb25zLCBtb2RlbHMKaW1wb3J0IGRqYW5nby5kYi5tb2RlbHMuZGVsZXRpb24KCgpjbGFzcyBNaWdyYXRpb24obWlncmF0aW9ucy5NaWdyYXRpb24pOgoKICAgIGRlcGVuZGVuY2llcyA9IFsoInNlcnZpY2VzIiwgIjAwMDdfZml4X2VudW1zIildCgogICAgb3BlcmF0aW9ucyA9IFsKICAgICAgICBtaWdyYXRpb25zLkNyZWF0ZU1vZGVsKAogICAgICAgICAgICBuYW1lPSJTZXJ2aWNlVHJhbnNsYXRpb24iLAogICAgICAgICAgICBmaWVsZHM9WwogICAgICAgICAgICAgICAgKAogICAgICAgICAgICAgICAgICAgICJpZCIsCiAgICAgICAgICAgICAgICAgICAgbW9kZWxzLkF1dG9GaWVsZCgKICAgICAgICAgICAgICAgICAgICAgICAgYXV0b19jcmVhdGVkPVRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgIHByaW1hcnlfa2V5PVRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgIHNlcmlhbGl6ZT1GYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgdmVyYm9zZV9uYW1lPSJJRCIsCiAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAoCiAgICAgICAgICAgICAgICAgICAgImxhbmd1YWdlX2NvZGUiLAogICAgICAgICAgICAgICAgICAgIG1vZGVscy5DaGFyRmllbGQoCiAgICAgICAgICAgICAgICAgICAgICAgIGRiX2luZGV4PVRydWUsIG1heF9sZW5ndGg9MTUsIHZlcmJvc2VfbmFtZT0iTGFuZ3VhZ2UiCiAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAoInRpdGxlIiwgbW9kZWxzLkNoYXJGaWVsZChtYXhfbGVuZ3RoPTY0KSksCiAgICAgICAgICAgICAgICAoImRlc2NyaXB0aW9uIiwgbW9kZWxzLlRleHRGaWVsZChibGFuaz1UcnVlLCBtYXhfbGVuZ3RoPTIwMCkpLAogICAgICAgICAgICAgICAgKAogICAgICAgICAgICAgICAgICAgICJtYXN0ZXIiLAogICAgICAgICAgICAgICAgICAgIG1vZGVscy5Gb3JlaWduS2V5KAogICAgICAgICAgICAgICAgICAgICAgICBlZGl0YWJsZT1GYWxzZSwKICAgICAgICAgICAgICAgICAgICAgICAgbnVsbD1UcnVlLAogICAgICAgICAgICAgICAgICAgICAgICBvbl9kZWxldGU9ZGphbmdvLmRiLm1vZGVscy5kZWxldGlvbi5DQVNDQURFLAogICAgICAgICAgICAgICAgICAgICAgICByZWxhdGVkX25hbWU9InRyYW5zbGF0aW9ucyIsCiAgICAgICAgICAgICAgICAgICAgICAgIHRvPSJzZXJ2aWNlcy5TZXJ2aWNlIiwKICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgXSwKICAgICAgICAgICAgb3B0aW9ucz17CiAgICAgICAgICAgICAgICAidmVyYm9zZV9uYW1lIjogInNlcnZpY2UgVHJhbnNsYXRpb24iLAogICAgICAgICAgICAgICAgImRiX3RhYmxlIjogInNlcnZpY2VzX3NlcnZpY2VfdHJhbnNsYXRpb24iLAogICAgICAgICAgICAgICAgImRiX3RhYmxlc3BhY2UiOiAiIiwKICAgICAgICAgICAgICAgICJtYW5hZ2VkIjogVHJ1ZSwKICAgICAgICAgICAgICAgICJkZWZhdWx0X3Blcm1pc3Npb25zIjogKCksCjx8ZmltX2hvbGV8PgogICAgICAgICAgICB9LAogICAgICAgICkKICAgIF0KPHxmaW1fc3VmZml4fD4KICAgICAgICAgICAgICAgICJ1bmlxdWVfdG9nZXRoZXIiOiB7KCJsYW5ndWFnZV9jb2RlIiwgIm1hc3RlciIpfSwKPHxmaW1fZW5kfD4=
0527c1c621c40244630cef9e59e286694f1a0374-5
0527c1c621c40244630cef9e59e286694f1a0374
PHxmaW1fcHJlZml4fD4KIyBHZW5lcmF0ZWQgYnkgRGphbmdvIDIuMi44IG9uIDIwMjAtMDEtMjMgMDk6MjEKCmZyb20gZGphbmdvLmRiIGltcG9ydCBtaWdyYXRpb25zLCBtb2RlbHMKaW1wb3J0IGRqYW5nby5kYi5tb2RlbHMuZGVsZXRpb24KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KCmNsYXNzIE1pZ3JhdGlvbihtaWdyYXRpb25zLk1pZ3JhdGlvbik6CgogICAgZGVwZW5kZW5jaWVzID0gWygic2VydmljZXMiLCAiMDAwN19maXhfZW51bXMiKV0KPHxmaW1fZW5kfD4=
a552d01b04ab26d8c2d61bb9446e723367acf00d-1
a552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ICAgICAgICAgICAgc2VsZi5jbG9zZSgpCjx8ZmltX2VuZHw+
a552d01b04ab26d8c2d61bb9446e723367acf00d-2
a552d01b04ab26d8c2d61bb9446e723367acf00d
PHxmaW1fcHJlZml4fD4KZnJvbSBkamFuZ28uY29uZiBpbXBvcnQgc2V0dGluZ3MKZnJvbSBkamFuZ28uY29udHJpYi5hdXRoIGltcG9ydCBnZXRfdXNlcl9tb2RlbAoKaW1wb3J0IGpzb24KZnJvbSBhc2dpcmVmLnN5bmMgaW1wb3J0IGFzeW5jX3RvX3N5bmMKZnJvbSBjaGFubmVscy5nZW5lcmljLndlYnNvY2tldCBpbXBvcnQgV2Vic29ja2V0Q29uc3VtZXIKaW1wb3J0IHRyYWNlYmFjawoKZnJvbSAuLm1vZGVscyBpbXBvcnQgQ2hhdCwgTWVzc2FnZQpmcm9tIC4uc2VyaWFsaXplcnMgaW1wb3J0IE1lc3NhZ2VTZXJpYWxpemVyCmZyb20gLi51dGlscyBpbXBvcnQgZGVjb2RlX2p3dAoKClVzZXIgPSBnZXRfdXNlcl9tb2RlbCgpCgoKY2xhc3MgQ2hhdENvbnN1bWVyKFdlYnNvY2tldENvbnN1bWVyKToKICAgIGRlZiBjb25uZWN0KHNlbGYpOgogICAgICAgIHNlbGYucm9vbV9uYW1lID0gc2VsZi5zY29wZVsndXJsX3JvdXRlJ11bJ2t3YXJncyddWydyb29tX25hbWUnXQogICAgICAgIHRyeToKICAgICAgICAgICAgc2VsZi5yb29tID0gQ2hhdC5vYmplY3RzLmdldCh1cmk9c2VsZi5yb29tX25hbWUpCiAgICAgICAgICAgIHNlbGYucm9vbV9ncm91cF9uYW1lID0gJ2NoYXRfJXMnICUgc2VsZi5yb29tX25hbWUKICAgICAgICAgICAgc2VsZi5hY3RpdmVfcm9vbXMgPSBzZXQoKQogICAgICAgICAgICBzZWxmLmFjY2VwdCgpCiAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbiBhcyBlOgogICAgICAgICAgICBpZiBzZXR0aW5ncy5ERUJVRzoKICAgICAgICAgICAgICAgIHByaW50KGUpCiAgICAgICAgICAgIHNlbGYuY2xvc2UoKQoKICAgIGRlZiBkaXNjb25uZWN0KHNlbGYsIGNsb3NlX2NvZGUpOgogICAgICAgICMgTGVhdmUgcm9vbSBncm91cAogICAgICAgIGlmIGhhc2F0dHIoc2VsZiwgJ3Jvb21fZ3JvdXBfbmFtZScpOgogICAgICAgICAgICBhc3luY190b19zeW5jKHNlbGYuY2hhbm5lbF9sYXllci5ncm91cF9kaXNjYXJkKSgKICAgICAgICAgICAgICAgIHNlbGYucm9vbV9ncm91cF9uYW1lLAogICAgICAgICAgICAgICAgc2VsZi5jaGFubmVsX25hbWUKICAgICAgICAgICAgKQoKICAgICMgcmVjZWl2ZXMganNvbiBjb250ZW50IGZyb20gc29ja2V0CiAgICAjIHRleHQgZGF0YSBmcm9tIGpzb24gaXMgYWxyZWFkeSBkZWNvZGVkIGhlcmUKICAgIGRlZiByZWNlaXZlKHNlbGYsIHRleHRfZGF0YT1Ob25lLCBieXRlX2RhdGE9Tm9uZSk6CiAgICAgICAgdGV4dF9kYXRhX2pzb24gPSBqc29uLmxvYWRzKHRleHRfZGF0YSkKICAgICAgICBjb21tYW5kID0gdGV4dF9kYXRhX2pzb24uZ2V0KCdjb21tYW5kJywgTm9uZSkKICAgICAgICB0cnk6CiAgICAgICAgICAgIHRva2VuID0gdGV4dF9kYXRhX2pzb25bJ3Rva2VuJ10KICAgICAgICAgICAgcGF5bG9hZCA9IGRlY29kZV9qd3QodG9rZW4pCiAgICAgICAgICAgIGlmIGNvbW1hbmQgPT0gJ2pvaW4nOgogICAgICAgICAgICAgICAgc2VsZi5qb2luX3Jvb20ocGF5bG9hZFsndXNlcm5hbWUnXSkKICAgICAgICAgICAgZWxpZiBjb21tYW5kID09ICdsZWF2ZSc6CiAgICAgICAgICAgICAgICBzZWxmLmxlYXZlX3Jvb20ocGF5bG9hZFsndXNlcm5hbWUnXSkKICAgICAgICAgICAgZWxpZiBjb21tYW5kID09ICdzZW5kJzoKICAgICAgICAgICAgICAgIHNlbGYuc2VuZF9yb29tKAogICAgICAgICAgICAgICAgICAgIHBheWxvYWRbJ3VzZXJuYW1lJ10sIHRleHRfZGF0YV9qc29uWydtZXNzYWdlJ10KICAgICAgICAgICAgICAgICkKCiAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbiBhcyBlOgogICAgICAgICAgICBpZiBzZXR0aW5ncy5ERUJVRzoKICAgICAgICAgICAgICAgIHRyYWNlYmFjay5wcmludF9leGMoKQogICAgICAgICAgICBzZWxmLmNsb3NlKCkKCiAgICBkZWYgam9pbl9yb29tKHNlbGYsIG5ld191c2VyKToKICAgICAgICAjIEFkZGluZyB1c2VyIHRvIENoYXQKICAgICAgICBzZWxmLnJvb20ub25saW5lX3BhcnRpY2lwYW50cy5hZGQoVXNlci5vYmplY3RzLmdldCh1c2VybmFtZT1uZXdfdXNlcikpCiAgICAgICAgc2VsZi5hY3RpdmVfcm9vbXMuYWRkKHNlbGYucm9vbV9uYW1lKQogICAgICAgICMgc2VuZGluZyBub3RpZmljYXRpb24gdG8gb3RoZXIgdXNlcnMKICAgICAgICBhc3luY190b19zeW5jKHNlbGYuY2hhbm5lbF9sYXllci5ncm91cF9zZW5kKSgKICAgICAgICAgICAgc2VsZi5yb29tX2dyb3VwX25hbWUsCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICd0eXBlJzogJ2NoYXRfam9pbicsCiAgICAgICAgICAgICAgICAnbmV3X3VzZXInOiBuZXdfdXNlciwKICAgICAgICAgICAgfQogICAgICAgICkKICAgICAgICAjIGFkZGluZyB0aGUgdXNlciB0byB0aGUgZ3JvdXAKICAgICAgICBhc3luY190b19zeW5jKHNlbGYuY2hhbm5lbF9sYXllci5ncm91cF9hZGQpKAogICAgICAgICAgICBzZWxmLnJvb21fZ3JvdXBfbmFtZSwKICAgICAgICAgICAgc2VsZi5jaGFubmVsX25hbWUKICAgICAgICApCiAgICAgICAgIyBzZW5kIHVwZGF0ZWQgb25saW5lIHVzZXIgbGlzdCB0byBjbGllbnQKICAgICAgICBhc3luY190b19zeW5jKHNlbGYuY2hhbm5lbF9sYXllci5ncm91cF9zZW5kKSgKICAgICAgICAgICAgc2VsZi5yb29tX2dyb3VwX25hbWUsCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICd0eXBlJzogJ2NoYXRfbGlzdCcsCiAgICAgICAgICAgICAgICAnbGlzdCc6IGxpc3Qoc2VsZi5yb29tLm9ubGluZV9wYXJ0aWNpcGFudHMudmFsdWVzKCd1c2VybmFtZScpKQogICAgICAgICAgICB9CiAgICAgICAgKQoKICAgIGRlZiBjaGF0X2pvaW4oc2VsZiwgZXZlbnQpOgogICAgICAgICJOb3RpZnkgb3RoZXIgdXNlcnMiCiAgICAgICAgYXN5bmNfdG9fc3luYyhzZWxmLnNlbmQodGV4dF9kYXRhPWpzb24uZHVtcHMoCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICdtc2dfdHlwZSc6ICdub3RpZmljYXRpb24nLAogICAgICAgICAgICAgICAgJ21lc3NhZ2UnOiBmJ3tldmVudFsibmV3X3VzZXIiXX0gam9pbmVkIHRoZSBjaGF0JywKICAgICAgICAgICAgfQogICAgICAgICkpKQoKICAgIGRlZiBsZWF2ZV9yb29tKHNlbGYsIHVzZXIpOgogICAgICAgICMgcmVtb3ZpbmcgdXNlciBmcm9tIENoYXQKICAgICAgICBzZWxmLnJvb20ub25saW5lX3BhcnRpY2lwYW50cy5yZW1vdmUoVXNlci5vYmplY3RzLmdldCh1c2VybmFtZT1uZXdfdXNlcikpCiAgICAgICAgc2VsZi5hY3RpdmVfcm9vbXMuZGlzY2FyZChzZWxmLnJvb21fbmFtZSkKICAgICAgICAjIHNlbmRpbmcgbm90aWZpY2F0aW9uIHRvIG90aGVyIHVzZXJzCiAgICAgICAgYXN5bmNfdG9fc3luYyhzZWxmLmNoYW5uZWxfbGF5ZXIuZ3JvdXBfc2VuZCkoCiAgICAgICAgICAgIHNlbGYucm9vbV9ncm91cF9uYW1lLAo8fGZpbV9ob2xlfD4KICAgICAgICApCiAgICAgICAgIyByZW1vdmluZyB0aGUgdXNlciBmcm9tIHRoZSBncm91cAogICAgICAgIGFzeW5jX3RvX3N5bmMoc2VsZi5jaGFubmVsX2xheWVyLmdyb3VwX2Rpc2NhcmQpKAogICAgICAgICAgICBzZWxmLnJvb21fZ3JvdXBfbmFtZSwKICAgICAgICAgICAgc2VsZi5jaGFubmVsX2xheWVyCiAgICAgICAgKQogICAgICAgICMgc2VuZCB1cGRhdGVkIG9ubGluZSB1c2VyIGxpc3QgdG8gY2xpZW50CiAgICAgICAgYXN5bmNfdG9fc3luYyhzZWxmLmNoYW5uZWxfbGF5ZXIuZ3JvdXBfc2VuZCkoCiAgICAgICAgICAgIHNlbGYucm9vbV9ncm91cF9uYW1lLAogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAndHlwZSc6ICdjaGF0X2xpc3QnLAogICAgICAgICAgICAgICAgJ2xpc3QnOiBsaXN0KHNlbGYucm9vbS5vbmxpbmVfcGFydGljaXBhbnRzLnZhbHVlcygndXNlcm5hbWUnKSkKICAgICAgICAgICAgfQogICAgICAgICkKCiAgICBkZWYgY2hhdF9sZWF2ZShzZWxmLCBldmVudCk6CiAgICAgICAgIk5vdGlmeSBvdGhlciB1c2VycyIKICAgICAgICBhc3luY190b19zeW5jKHNlbGYuc2VuZCh0ZXh0X2RhdGE9anNvbi5kdW1wcygKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgJ21zZ190eXBlJzogJ25vdGlmaWNhdGlvbicsCiAgICAgICAgICAgICAgICAnbWVzc2FnZSc6IGYne2V2ZW50WyJuZXdfdXNlciJdfSBsZWZ0IHRoZSBjaGF0JywKICAgICAgICAgICAgfQogICAgICAgICkpKQoKICAgICMgc2VuZCBtZXNzYWdlcyB0byB1c2VycyBvbiB0aGUgZ3JvdXAKICAgIGRlZiBzZW5kX3Jvb20oc2VsZiwgdXNlcm5hbWUsIG1lc3NhZ2UpOgogICAgICAgICMgc2F2aW5nIG1lc3NhZ2UgaW4gREIKICAgICAgICBuZXdfbXNnID0gIE1lc3NhZ2Uub2JqZWN0cy5jcmVhdGUoCiAgICAgICAgICAgIHNlbmRlcj1Vc2VyLm9iamVjdHMuZ2V0KHVzZXJuYW1lPXVzZXJuYW1lKSwKICAgICAgICAgICAgY29udGVudD1tZXNzYWdlCiAgICAgICAgKQogICAgICAgIG5ld19tc2cuY2hhdC5hZGQoc2VsZi5yb29tKQogICAgICAgIG1zZ19zZXJpYWxpemVyID0gTWVzc2FnZVNlcmlhbGl6ZXIobmV3X21zZykKICAgICAgICB0aW1lc3RhbXAgPSBtc2dfc2VyaWFsaXplci5kYXRhWyd0aW1lc3RhbXAnXQogICAgICAgIGFzeW5jX3RvX3N5bmMoc2VsZi5jaGFubmVsX2xheWVyLmdyb3VwX3NlbmQpKAogICAgICAgICAgICBzZWxmLnJvb21fZ3JvdXBfbmFtZSwKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgJ3R5cGUnOiAnY2hhdF9tZXNzYWdlJywKICAgICAgICAgICAgICAgICdzZW5kZXInOiAgdXNlcm5hbWUsCiAgICAgICAgICAgICAgICAnbWVzc2FnZSc6IG1lc3NhZ2UsCiAgICAgICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wCiAgICAgICAgICAgIH0KICAgICAgICApCgogICAgZGVmIGNoYXRfbWVzc2FnZShzZWxmLCBldmVudCk6CiAgICAgICAgIkRpc3RyaWJ1dGUgbWVzc2FnZSB0byBhbGwgdXNlcnMgaW4gZ3JvdXAiCiAgICAgICAgc2VsZi5zZW5kKHRleHRfZGF0YT1qc29uLmR1bXBzKAogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAnbXNnX3R5cGUnOiAnbWVzc2FnZScsCiAgICAgICAgICAgICAgICAnc2VuZGVyJzogZXZlbnRbJ3NlbmRlciddLAogICAgICAgICAgICAgICAgJ21lc3NhZ2UnOiBldmVudFsnbWVzc2FnZSddLAogICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IGV2ZW50Wyd0aW1lc3RhbXAnXQogICAgICAgICAgICB9CiAgICAgICAgKSkKCiAgICBkZWYgY2hhdF9saXN0KHNlbGYsIGV2ZW50KToKICAgICAgICBzZWxmLnNlbmQodGV4dF9kYXRhPWpzb24uZHVtcHMoCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICdtc2dfdHlwZSc6ICdsaXN0JywKICAgICAgICAgICAgICAgICd1c2VyTGlzdCc6IGV2ZW50WydsaXN0J10sCiAgICAgICAgICAgIH0KICAgICAgICApKQo8fGZpbV9zdWZmaXh8PgogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAndHlwZSc6ICdjaGF0X2xlYXZlJywKICAgICAgICAgICAgICAgICduZXdfdXNlcic6IG5ld191c2VyLAogICAgICAgICAgICB9Cjx8ZmltX2VuZHw+
a552d01b04ab26d8c2d61bb9446e723367acf00d-3
a552d01b04ab26d8c2d61bb9446e723367acf00d
PHxmaW1fcHJlZml4fD4KZnJvbSBkamFuZ28uY29uZiBpbXBvcnQgc2V0dGluZ3MKZnJvbSBkamFuZ28uY29udHJpYi5hdXRoIGltcG9ydCBnZXRfdXNlcl9tb2RlbAoKaW1wb3J0IGpzb24KZnJvbSBhc2dpcmVmLnN5bmMgaW1wb3J0IGFzeW5jX3RvX3N5bmMKZnJvbSBjaGFubmVscy5nZW5lcmljLndlYnNvY2tldCBpbXBvcnQgV2Vic29ja2V0Q29uc3VtZXIKaW1wb3J0IHRyYWNlYmFjawoKZnJvbSAuLm1vZGVscyBpbXBvcnQgQ2hhdCwgTWVzc2FnZQpmcm9tIC4uc2VyaWFsaXplcnMgaW1wb3J0IE1lc3NhZ2VTZXJpYWxpemVyCmZyb20gLi51dGlscyBpbXBvcnQgZGVjb2RlX2p3dAoKClVzZXIgPSBnZXRfdXNlcl9tb2RlbCgpCgoKY2xhc3MgQ2hhdENvbnN1bWVyKFdlYnNvY2tldENvbnN1bWVyKToKICAgIGRlZiBjb25uZWN0KHNlbGYpOgogICAgICAgIHNlbGYucm9vbV9uYW1lID0gc2VsZi5zY29wZVsndXJsX3JvdXRlJ11bJ2t3YXJncyddWydyb29tX25hbWUnXQogICAgICAgIHRyeToKICAgICAgICAgICAgc2VsZi5yb29tID0gQ2hhdC5vYmplY3RzLmdldCh1cmk9c2VsZi5yb29tX25hbWUpCiAgICAgICAgICAgIHNlbGYucm9vbV9ncm91cF9uYW1lID0gJ2NoYXRfJXMnICUgc2VsZi5yb29tX25hbWUKICAgICAgICAgICAgc2VsZi5hY3RpdmVfcm9vbXMgPSBzZXQoKQogICAgICAgICAgICBzZWxmLmFjY2VwdCgpCiAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbiBhcyBlOgogICAgICAgICAgICBpZiBzZXR0aW5ncy5ERUJVRzoKICAgICAgICAgICAgICAgIHByaW50KGUpCiAgICAgICAgICAgIHNlbGYuY2xvc2UoKQoKICAgIGRlZiBkaXNjb25uZWN0KHNlbGYsIGNsb3NlX2NvZGUpOgogICAgICAgICMgTGVhdmUgcm9vbSBncm91cAogICAgICAgIGlmIGhhc2F0dHIoc2VsZiwgJ3Jvb21fZ3JvdXBfbmFtZScpOgogICAgICAgICAgICBhc3luY190b19zeW5jKHNlbGYuY2hhbm5lbF9sYXllci5ncm91cF9kaXNjYXJkKSgKICAgICAgICAgICAgICAgIHNlbGYucm9vbV9ncm91cF9uYW1lLAogICAgICAgICAgICAgICAgc2VsZi5jaGFubmVsX25hbWUKICAgICAgICAgICAgKQoKICAgICMgcmVjZWl2ZXMganNvbiBjb250ZW50IGZyb20gc29ja2V0CiAgICAjIHRleHQgZGF0YSBmcm9tIGpzb24gaXMgYWxyZWFkeSBkZWNvZGVkIGhlcmUKICAgIGRlZiByZWNlaXZlKHNlbGYsIHRleHRfZGF0YT1Ob25lLCBieXRlX2RhdGE9Tm9uZSk6CiAgICAgICAgdGV4dF9kYXRhX2pzb24gPSBqc29uLmxvYWRzKHRleHRfZGF0YSkKICAgICAgICBjb21tYW5kID0gdGV4dF9kYXRhX2pzb24uZ2V0KCdjb21tYW5kJywgTm9uZSkKICAgICAgICB0cnk6CiAgICAgICAgICAgIHRva2VuID0gdGV4dF9kYXRhX2pzb25bJ3Rva2VuJ10KICAgICAgICAgICAgcGF5bG9hZCA9IGRlY29kZV9qd3QodG9rZW4pCiAgICAgICAgICAgIGlmIGNvbW1hbmQgPT0gJ2pvaW4nOgogICAgICAgICAgICAgICAgc2VsZi5qb2luX3Jvb20ocGF5bG9hZFsndXNlcm5hbWUnXSkKICAgICAgICAgICAgZWxpZiBjb21tYW5kID09ICdsZWF2ZSc6CiAgICAgICAgICAgICAgICBzZWxmLmxlYXZlX3Jvb20ocGF5bG9hZFsndXNlcm5hbWUnXSkKICAgICAgICAgICAgZWxpZiBjb21tYW5kID09ICdzZW5kJzoKICAgICAgICAgICAgICAgIHNlbGYuc2VuZF9yb29tKAogICAgICAgICAgICAgICAgICAgIHBheWxvYWRbJ3VzZXJuYW1lJ10sIHRleHRfZGF0YV9qc29uWydtZXNzYWdlJ10KICAgICAgICAgICAgICAgICkKCiAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbiBhcyBlOgogICAgICAgICAgICBpZiBzZXR0aW5ncy5ERUJVRzoKICAgICAgICAgICAgICAgIHRyYWNlYmFjay5wcmludF9leGMoKQogICAgICAgICAgICBzZWxmLmNsb3NlKCkKCiAgICBkZWYgam9pbl9yb29tKHNlbGYsIG5ld191c2VyKToKICAgICAgICAjIEFkZGluZyB1c2VyIHRvIENoYXQKICAgICAgICBzZWxmLnJvb20ub25saW5lX3BhcnRpY2lwYW50cy5hZGQoVXNlci5vYmplY3RzLmdldCh1c2VybmFtZT1uZXdfdXNlcikpCiAgICAgICAgc2VsZi5hY3RpdmVfcm9vbXMuYWRkKHNlbGYucm9vbV9uYW1lKQogICAgICAgICMgc2VuZGluZyBub3RpZmljYXRpb24gdG8gb3RoZXIgdXNlcnMKICAgICAgICBhc3luY190b19zeW5jKHNlbGYuY2hhbm5lbF9sYXllci5ncm91cF9zZW5kKSgKICAgICAgICAgICAgc2VsZi5yb29tX2dyb3VwX25hbWUsCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICd0eXBlJzogJ2NoYXRfam9pbicsCiAgICAgICAgICAgICAgICAnbmV3X3VzZXInOiBuZXdfdXNlciwKICAgICAgICAgICAgfQogICAgICAgICkKICAgICAgICAjIGFkZGluZyB0aGUgdXNlciB0byB0aGUgZ3JvdXAKICAgICAgICBhc3luY190b19zeW5jKHNlbGYuY2hhbm5lbF9sYXllci5ncm91cF9hZGQpKAogICAgICAgICAgICBzZWxmLnJvb21fZ3JvdXBfbmFtZSwKICAgICAgICAgICAgc2VsZi5jaGFubmVsX25hbWUKICAgICAgICApCiAgICAgICAgIyBzZW5kIHVwZGF0ZWQgb25saW5lIHVzZXIgbGlzdCB0byBjbGllbnQKICAgICAgICBhc3luY190b19zeW5jKHNlbGYuY2hhbm5lbF9sYXllci5ncm91cF9zZW5kKSgKICAgICAgICAgICAgc2VsZi5yb29tX2dyb3VwX25hbWUsCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICd0eXBlJzogJ2NoYXRfbGlzdCcsCiAgICAgICAgICAgICAgICAnbGlzdCc6IGxpc3Qoc2VsZi5yb29tLm9ubGluZV9wYXJ0aWNpcGFudHMudmFsdWVzKCd1c2VybmFtZScpKQogICAgICAgICAgICB9CiAgICAgICAgKQoKICAgIGRlZiBjaGF0X2pvaW4oc2VsZiwgZXZlbnQpOgogICAgICAgICJOb3RpZnkgb3RoZXIgdXNlcnMiCiAgICAgICAgYXN5bmNfdG9fc3luYyhzZWxmLnNlbmQodGV4dF9kYXRhPWpzb24uZHVtcHMoCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICdtc2dfdHlwZSc6ICdub3RpZmljYXRpb24nLAogICAgICAgICAgICAgICAgJ21lc3NhZ2UnOiBmJ3tldmVudFsibmV3X3VzZXIiXX0gam9pbmVkIHRoZSBjaGF0JywKICAgICAgICAgICAgfQogICAgICAgICkpKQoKICAgIGRlZiBsZWF2ZV9yb29tKHNlbGYsIHVzZXIpOgogICAgICAgICMgcmVtb3ZpbmcgdXNlciBmcm9tIENoYXQKICAgICAgICBzZWxmLnJvb20ub25saW5lX3BhcnRpY2lwYW50cy5yZW1vdmUoVXNlci5vYmplY3RzLmdldCh1c2VybmFtZT1uZXdfdXNlcikpCiAgICAgICAgc2VsZi5hY3RpdmVfcm9vbXMuZGlzY2FyZChzZWxmLnJvb21fbmFtZSkKICAgICAgICAjIHNlbmRpbmcgbm90aWZpY2F0aW9uIHRvIG90aGVyIHVzZXJzCiAgICAgICAgYXN5bmNfdG9fc3luYyhzZWxmLmNoYW5uZWxfbGF5ZXIuZ3JvdXBfc2VuZCkoCiAgICAgICAgICAgIHNlbGYucm9vbV9ncm91cF9uYW1lLAogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAndHlwZSc6ICdjaGF0X2xlYXZlJywKICAgICAgICAgICAgICAgICduZXdfdXNlcic6IG5ld191c2VyLAogICAgICAgICAgICB9CiAgICAgICAgKQogICAgICAgICMgcmVtb3ZpbmcgdGhlIHVzZXIgZnJvbSB0aGUgZ3JvdXAKICAgICAgICBhc3luY190b19zeW5jKHNlbGYuY2hhbm5lbF9sYXllci5ncm91cF9kaXNjYXJkKSgKICAgICAgICAgICAgc2VsZi5yb29tX2dyb3VwX25hbWUsCiAgICAgICAgICAgIHNlbGYuY2hhbm5lbF9sYXllcgogICAgICAgICkKICAgICAgICAjIHNlbmQgdXBkYXRlZCBvbmxpbmUgdXNlciBsaXN0IHRvIGNsaWVudAogICAgICAgIGFzeW5jX3RvX3N5bmMoc2VsZi5jaGFubmVsX2xheWVyLmdyb3VwX3NlbmQpKAogICAgICAgICAgICBzZWxmLnJvb21fZ3JvdXBfbmFtZSwKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgJ3R5cGUnOiAnY2hhdF9saXN0JywKICAgICAgICAgICAgICAgICdsaXN0JzogbGlzdChzZWxmLnJvb20ub25saW5lX3BhcnRpY2lwYW50cy52YWx1ZXMoJ3VzZXJuYW1lJykpCiAgICAgICAgICAgIH0KICAgICAgICApCgogICAgZGVmIGNoYXRfbGVhdmUoc2VsZiwgZXZlbnQpOgogICAgICAgICJOb3RpZnkgb3RoZXIgdXNlcnMiCiAgICAgICAgYXN5bmNfdG9fc3luYyhzZWxmLnNlbmQodGV4dF9kYXRhPWpzb24uZHVtcHMoCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICdtc2dfdHlwZSc6ICdub3RpZmljYXRpb24nLAogICAgICAgICAgICAgICAgJ21lc3NhZ2UnOiBmJ3tldmVudFsibmV3X3VzZXIiXX0gbGVmdCB0aGUgY2hhdCcsCiAgICAgICAgICAgIH0KICAgICAgICApKSkKCiAgICAjIHNlbmQgbWVzc2FnZXMgdG8gdXNlcnMgb24gdGhlIGdyb3VwCiAgICBkZWYgc2VuZF9yb29tKHNlbGYsIHVzZXJuYW1lLCBtZXNzYWdlKToKICAgICAgICAjIHNhdmluZyBtZXNzYWdlIGluIERCCiAgICAgICAgbmV3X21zZyA9ICBNZXNzYWdlLm9iamVjdHMuY3JlYXRlKAogICAgICAgICAgICBzZW5kZXI9VXNlci5vYmplY3RzLmdldCh1c2VybmFtZT11c2VybmFtZSksCiAgICAgICAgICAgIGNvbnRlbnQ9bWVzc2FnZQo8fGZpbV9ob2xlfD4KICAgICAgICBhc3luY190b19zeW5jKHNlbGYuY2hhbm5lbF9sYXllci5ncm91cF9zZW5kKSgKICAgICAgICAgICAgc2VsZi5yb29tX2dyb3VwX25hbWUsCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICd0eXBlJzogJ2NoYXRfbWVzc2FnZScsCiAgICAgICAgICAgICAgICAnc2VuZGVyJzogIHVzZXJuYW1lLAogICAgICAgICAgICAgICAgJ21lc3NhZ2UnOiBtZXNzYWdlLAogICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcAogICAgICAgICAgICB9CiAgICAgICAgKQoKICAgIGRlZiBjaGF0X21lc3NhZ2Uoc2VsZiwgZXZlbnQpOgogICAgICAgICJEaXN0cmlidXRlIG1lc3NhZ2UgdG8gYWxsIHVzZXJzIGluIGdyb3VwIgogICAgICAgIHNlbGYuc2VuZCh0ZXh0X2RhdGE9anNvbi5kdW1wcygKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgJ21zZ190eXBlJzogJ21lc3NhZ2UnLAogICAgICAgICAgICAgICAgJ3NlbmRlcic6IGV2ZW50WydzZW5kZXInXSwKICAgICAgICAgICAgICAgICdtZXNzYWdlJzogZXZlbnRbJ21lc3NhZ2UnXSwKICAgICAgICAgICAgICAgICd0aW1lc3RhbXAnOiBldmVudFsndGltZXN0YW1wJ10KICAgICAgICAgICAgfQogICAgICAgICkpCgogICAgZGVmIGNoYXRfbGlzdChzZWxmLCBldmVudCk6CiAgICAgICAgc2VsZi5zZW5kKHRleHRfZGF0YT1qc29uLmR1bXBzKAogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAnbXNnX3R5cGUnOiAnbGlzdCcsCiAgICAgICAgICAgICAgICAndXNlckxpc3QnOiBldmVudFsnbGlzdCddLAogICAgICAgICAgICB9CiAgICAgICAgKSkKPHxmaW1fc3VmZml4fD4KICAgICAgICApCiAgICAgICAgbmV3X21zZy5jaGF0LmFkZChzZWxmLnJvb20pCiAgICAgICAgbXNnX3NlcmlhbGl6ZXIgPSBNZXNzYWdlU2VyaWFsaXplcihuZXdfbXNnKQogICAgICAgIHRpbWVzdGFtcCA9IG1zZ19zZXJpYWxpemVyLmRhdGFbJ3RpbWVzdGFtcCddCjx8ZmltX2VuZHw+
bb7d807b3afe3e2165c0d003193f53c0c4099506-1
bb7d807b3afe3e2165c0d003193f53c0c4099506
PHxmaW1fcHJlZml4fD4KJycnCkNyZWF0ZWQgb24gTm92IDIxLCAyMDE5CgpAYXV0aG9yOiBiYWxsYW5jZQonJycKCmNsYXNzIEZ3cmlzY1RyYWNlckJmbUlGKCk6CiAgICAKICAgIGRlZiBfX2luaXRfXyhzZWxmKToKICAgICAgICBwYXNzCiAgICAKICAgIGRlZiBpbnN0cl9leGVjKHNlbGYsIHBjLCBpbnN0cik6Cjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgICAgICBwYXNzCiAgICAKPHxmaW1fZW5kfD4=
bb7d807b3afe3e2165c0d003193f53c0c4099506-2
bb7d807b3afe3e2165c0d003193f53c0c4099506
PHxmaW1fcHJlZml4fD4KJycnCkNyZWF0ZWQgb24gTm92IDIxLCAyMDE5Cgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CkBhdXRob3I6IGJhbGxhbmNlCicnJwoKY2xhc3MgRndyaXNjVHJhY2VyQmZtSUYoKToKPHxmaW1fZW5kfD4=
052a1eaeed0f64325a7de2fc3efc2210e55adb13-1
052a1eaeed0f64325a7de2fc3efc2210e55adb13
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwoiIiJEYXkgMTcgZm9yIGFkdmVudCBvZiBjb2RlIHNvbHV0aW9uIiIiCmZyb20gaXRlcnRvb2xzIGltcG9ydCBwcm9kdWN0CmltcG9ydCBzeXMKCgpkZWYgZ2V0X2lucHV0KGZpbGVuYW1lKToKICAgIHdpdGggb3BlbihmaWxlbmFtZSwgInIiKSBhcyBmOgo8fGZpbV9ob2xlfD4KICAgICAgICAgICAgICAgICAgICBhY3RpdmVzLmFkZCgoeCwgeSwgMCwgMCkpCiAgICByZXR1cm4gYWN0aXZlcwoKCmRlZiBuZWlnaGJvcnMoeCwgeSwgeiwgdyk6CiAgICBucyA9IHNldCgpCiAgICBmb3IgZHgsIGR5LCBkeiwgZHcgaW4gcHJvZHVjdChbLTEsIDAsIDFdLCByZXBlYXQ9NCk6CiAgICAgICAgbnMuYWRkKChkeCArIHgsIGR5ICsgeSwgZHogKyB6LCBkdyArIHcpKQogICAgbnMucmVtb3ZlKCh4LC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uZWlnaGJvcnMgaW4gKDIsIDMpOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2FjdGl2ZXMuYWRkKGNvb3JkKQogICAgICAgICAgICAgICAgICAgICAgICBlbGlmIGNvb3JkIG5vdCBpbiBhY3RpdmVzIGFuZCBudW1fYWN0aXZlX25laWdoYm9ycyA9PSAzOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2FjdGl2ZXMuYWRkKGNvb3JkKQogICAgICAgIGFjdGl2ZXMgPSBuZXdfYWN0aXZlcwogICAgcmV0dXJuIGxlbihhY3RpdmVzKQoKCmRlZiBtYWluKCk6CiAgICBpZiBsZW4oc3lzLmFyZ3YpICE9IDI6CiAgICAgICAgcHJpbnQoZiJVc2FnZToge3N5cy5hcmd2WzBdfSBpbnB1dGZpbGUiKQogICAgICAgIHN5cy5leGl0KDIpCiAgICBwcmludChmIlB0IDIgc29sdXRpb246IHtzb2x2ZV9wdF8yKGdldF9pbnB1dChzeXMuYXJndlsxXSkpfSIpCgoKaWYgX19uYW1lX18gPT0gIl9fbWFpbl9fIjoKICAgIG1haW4oKQo8fGZpbV9zdWZmaXh8PgogICAgICAgIGFjdGl2ZXMgPSBzZXQoKQogICAgICAgIGZvciB5LCBsaW5lIGluIGVudW1lcmF0ZShmKToKICAgICAgICAgICAgZm9yIHgsIHZhbCBpbiBlbnVtZXJhdGUobGluZS5zdHJpcCgpKToKICAgICAgICAgICAgICAgIGlmIHZhbCA9PSAiIyI6Cjx8ZmltX2VuZHw+
052a1eaeed0f64325a7de2fc3efc2210e55adb13-2
052a1eaeed0f64325a7de2fc3efc2210e55adb13
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwoiIiJEYXkgMTcgZm9yIGFkdmVudCBvZiBjb2RlIHNvbHV0aW9uIiIiCmZyb20gaXRlcnRvb2xzIGltcG9ydCBwcm9kdWN0CmltcG9ydCBzeXMKCgpkZWYgZ2V0X2lucHV0KGZpbGVuYW1lKToKICAgIHdpdGggb3BlbihmaWxlbmFtZSwgInIiKSBhcyBmOgogICAgICAgIGFjdGl2ZXMgPSBzZXQoKQogICAgICAgIGZvciB5LCBsaW5lIGluIGVudW1lcmF0ZShmKToKICAgICAgICAgICAgZm9yIHgsIHZhbCBpbiBlbnVtZXJhdGUobGluZS5zdHJpcCgpKToKICAgICAgICAgICAgICAgIGlmIHZhbCA9PSAiIyI6CiAgICAgICAgICAgICAgICAgICAgYWN0aXZlcy5hZGQoKHgsIHksIDAsIDApKQogICAgcmV0dXJuIGFjdGl2ZXMKCgpkZWYgbmVpZ2hib3JzKHgsIHksIHosIHcpOgogICAgbnMgPSBzZXQoKQogICAgZm9yIGR4LCBkeSwgZHosIGR3IGluIHByb2R1Y3QoWy0xLCAwLCAxXSwgcmVwZWF0PTQpOgogICAgICAgIG5zLmFkZCgoZHggKyB4LCBkeSArIHksIGR6ICsgeiwgZHcgKyB3KSkKICAgIG5zLnJlbW92ZSgoeCwgeSwgeiwgdykpCiAgICByZXR1cm4gbnMKCgpkZWYgZmluZF9yYW5nZXMoYWN0aXZlcyk6CiAgICB4cyA9IHNldCgpCiAgICB5cyA9IHNldCgpCiAgICB6cyA9IHNldCgpCiAgICB3cyA9IHNldCgpCiAgICBmb3IgeCwgeSwgeiwgdyBpbiBhY3RpdmVzOgogICAgICAgIHhzLmFkZCh4KQogICAgICAgIHlzLmFkZCh5KQogICAgICAgIHpzLmFkZCh6KQogICAgICAgIHdzLmFkZCh3KQogICAgcmV0dXJuIG1pbih4cyksIG1heCh4cyksIG1pbih5cyksIG1heCh5cyksIG1pbih6cyksIG1heCh6cyksIG1pbih3cyksIG1heCh3cykKCgpkZWYgc29sdmVfcHRfMihhY3RpdmVzKToKICAgIGZvciBfIGluIHJhbmdlKDEsIDcpOgogICAgICAgIG1pbngsIG1heHgsIG1pbnksIG1heHksIG1pbnosIG1heHosIG1pbncsIG1heHcgPSBmaW5kX3JhbmdlcyhhY3RpdmVzKQogICAgICAgIG5ld19hY3RpdmVzID0gc2V0KCkKICAgICAgICBmb3IgdyBpbiByYW5nZShtaW53IC0gMSwgbWF4dyArIDIpOgogICAgICAgICAgICBmb3IgeiBpbiByYW5nZShtaW56IC0gMSwgbWF4eiArIDIpOgo8fGZpbV9ob2xlfD4KICAgICAgICAgICAgICAgICAgICAgICAgaWYgY29vcmQgaW4gYWN0aXZlcyBhbmQgbnVtX2FjdGl2ZV9uZWlnaGJvcnMgaW4gKDIsIDMpOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2FjdGl2ZXMuYWRkKGNvb3JkKQogICAgICAgICAgICAgICAgICAgICAgICBlbGlmIGNvb3JkIG5vdCBpbiBhY3RpdmVzIGFuZCBudW1fYWN0aXZlX25laWdoYm9ycyA9PSAzOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2FjdGl2ZXMuYWRkKGNvb3JkKQogICAgICAgIGFjdGl2ZXMgPSBuZXdfYWN0aXZlcwogICAgcmV0dXJuIGxlbihhY3RpdmVzKQoKCmRlZiBtYWluKCk6CiAgICBpZiBsZW4oc3lzLmFyZ3YpICE9IDI6CiAgICAgICAgcHJpbnQoZiJVc2FnZToge3N5cy5hcmd2WzBdfSBpbnB1dGZpbGUiKQogICAgICAgIHN5cy5leGl0KDIpCiAgICBwcmludChmIlB0IDIgc29sdXRpb246IHtzb2x2ZV9wdF8yKGdldF9pbnB1dChzeXMuYXJndlsxXSkpfSIpCgoKaWYgX19uYW1lX18gPT0gIl9fbWFpbl9fIjoKICAgIG1haW4oKQo8fGZpbV9zdWZmaXh8PgogICAgICAgICAgICAgICAgZm9yIHkgaW4gcmFuZ2UobWlueSAtIDEsIG1heHkgKyAyKToKICAgICAgICAgICAgICAgICAgICBmb3IgeCBpbiByYW5nZShtaW54IC0gMSwgbWF4eCArIDIpOgogICAgICAgICAgICAgICAgICAgICAgICBjb29yZCA9ICh4LCB5LCB6LCB3KQogICAgICAgICAgICAgICAgICAgICAgICBudW1fYWN0aXZlX25laWd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LmFkZCh5KQogICAgICAgIHpzLmFkZCh6KQogICAgICAgIHdzLmFkZCh3KQogICAgcmV0dXJuIG1pbih4cyksIG1heCh4cyksIG1pbih5cyksIG1heCh5cyksIG1pbih6cyksIG1heCh6cyksIG1pbih3cyksIG1heCh3cykKCgpkZWYgc29sdmVfcHRfMihhY3RpdmVzKToKICAgIGZvciBfIGluIHJhbmdlKDEsIDcpOgogICAgICAgIG1pbngsIG1heHgsIG1pbnksIG1heHksIG1pbnosIG1heHosIG1pbncsIG1heHcgPSBmaW5kX3JhbmdlcyhhY3RpdmVzKQogICAgICAgIG5ld19hY3RpdmVzID0gc2V0KCkKICAgICAgICBmb3IgdyBpbiByYW5nZShtaW53IC0gMSwgbWF4dyArIDIpOgogICAgICAgICAgICBmb3IgeiBpbiByYW5nZShtaW56IC0gMSwgbWF4eiArIDIpOgogICAgICAgICAgICAgICAgZm9yIHkgaW4gcmFuZ2UobWlueSAtIDEsIG1heHkgKyAyKToKICAgICAgICAgICAgICAgICAgICBmb3IgeCBpbiByYW5nZShtaW54IC0gMSwgbWF4eCArIDIpOgogICAgICAgICAgICAgICAgICAgICAgICBjb29yZCA9ICh4LCB5LCB6LCB3KQogICAgICAgICAgICAgICAgICAgICAgICBudW1fYWN0aXZlX25laWdoYm9ycyA9IGxlbihhY3RpdmVzICYgbmVpZ2hib3JzKCpjb29yZCkpCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIGNvb3JkIGluIGFjdGl2ZXMgYW5kIG51bV9hY3RpdmVfbmVpZ2hib3JzIGluICgyLCAzKToKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19hY3RpdmVzLmFkZChjb29yZCkKICAgICAgICAgICAgICAgICAgICAgICAgZWxpZiBjb29yZCBub3QgaW4gYWN0aXZlcyBhbmQgbnVtX2FjdGl2ZV9uZWlnaGJvcnMgPT0gMzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19hY3RpdmVzLmFkZChjb29yZCkKICAgICAgICBhY3Rp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mIF9faW5pdF9fKHNlbGYsICphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgc3VwZXIoKS5fX2luaXRfXygqYXJncywgKiprd2FyZ3MpCgogICAgICAgIGZpZWxkX2RpY3QgPSBnZXRhdHRyKHNlbGYuX21ldGEubW9kZWwsICdfZmllbGRfZGljdCcsIE5vbmUpCiAgICAgICAgaWYgZmllbGRfZGljdCBpcyBOb25lOgogICAgICAgICAgICBmaWVsZF9kaWN0ID0ge2YubmFtZTogZiBmb3IgZiBpbiBzZWxmLl9tZXRhLm1vZGVsLl9tZXRhLmZpZWxkc30KICAgICAgICAgICAgc2V0YXR0cihzZWxmLl9tZXRhLm1vZGVsLCAnX2ZpZWxkX2RpY3QnLCBmaWVsZF9kaWN0KQoKICAgICAgICBmb3IgbmFtZSwgZmllbGQgaW4gc2VsZi5maWVsZHMuaXRlbXMoKToKICAgICAgICAgICAgbW9kZWxfZmllbGQgPSBmaWVsZF9kaWN0LmdldChuYW1lKQogICAgICAgICAgICBpZiBtb2RlbF9maWVsZCBpcyBOb25lOgogICAgICAgICAgICAgICAgY29udGludWUKICAgICAgICAgICAgZmlsZWRfbWFwcGVyID0gRk9STUZJRUxEX0ZPUl9EQkZJRUxEX0RFRkFVTFRTLmdldChtb2RlbF9maWVsZC5fX2NsYXNzX18sIHt9KQogICAgICAgICAgICBmb3JtX2NsYXNzID0gZmlsZWRfbWFwcGVyLmdldCgnZm9ybV9jbGFzcycpCiAgICAgICAgICAgIGlmIGZvcm1fY2xhc3MgaXMgbm90IE5vbmU6CiAgICAgICAgICAgICAgICBzZWxmLmZpZWxkc1tuYW1lXSA9IGZpZWxkID0gZm9ybV9jbGFzcygqKmZpZWxkLl9fZGljdF9fKQogICAgICAgICAgICB3aWRnZXRfY2xhc3MgPSBmaWxlZF9tYXBwZXIuZ2V0KCd3aWRnZXQnKQogICAgICAgICAgICBpZiB3aWRnZXRfY2xhc3MgaXMgbm90IE5vbmU6CiAgICAgICAgICAgICAgICBmaWVsZC53aWRnZXQgPSB3aWRnZXRfY2xhc3MoKQoKICAgIGRlZiB2YWxpZGF0ZV91bmlxdWUoc2VsZik6CiAgICAgICAgaWYgc2VsZi5fbWV0YS5tb2RlbC5fbWV0YS5hYnN0cmFjdDoKICAgICAgICAgICAgcGFzcwogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHN1cGVyKCkudmFsaWRhdGVfdW5pcXVlKCkKCiAgICBkZWYgX19zdHJfXyhzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5hc19kaXYoKQoKICAgIGRlZiBfYXNfZGl2KHNlbGYpOgogICAgICAgIHdpdGggYm91bmRfZmllbGRfaG9va2VyOgogICAgICAgICAgICBvdXRwdXQgPSBzZWxmLl9odG1sX291dHB1dCgKICAgICAgICAgICAgICAgIG5vcm1hbF9yb3c9JzxkaXYgY2xhc3M9ImZvcm0tcm93Ij4lKGVycm9ycylzJShsYWJlbClzJShmaWVsZClzJShoZWxwX3RleHQpczwvZGl2PicsCiAgICAgICAgICAgICAgICBlcnJvcl9yb3c9JzxkaXYgY2xhc3M9ImZvcm0tcm93Ij48ZGl2IGNvbHNwYW49IjIiPiVzPC9kaXY+PC9kaXY+JywKICAgICAgICAgICAgICAgIHJvd19lbmRlcj0nPC9kaXY+JywKICAgICAgICAgICAgICAgIGhlbHBfdGV4dF9odG1sPSc8ZGl2IGNsYXNzPSJoZWxwIj4lczwvZGl2PicsCiAgICAgICAgICAgICAgICBlcnJvcnNfb25fc2VwYXJhdGVfcm93PUZhbHNlLAogICAgICAgICAgICApCiAgICAgICAgICAgIHJldHVybiBvdXRwdXQKCiAgICBkZWYgYXNfZGl2KHNlbGYpOgogICAgICAgIGZpZWxkc2V0cyA9IGdldGF0dHIoc2VsZiwgJ2ZpZWxkc2V0cycsIE5vbmUpCiAgICAgICAgaWYgZmllbGRzZXRzIGlzIG5vdCBOb25lOgogICAgICAgICAgICBmaWVsZHMgPSBzZWxmLmZpZWxkcwogICAgICAgICAgICBvdXRwdXQgPSAnJwogICAgICAgICAgICBmb3IgZmllbGRzZXQgaW4gZmllbGRzZXRzOgogICAgICAgICAgICAgICAgaDIgPSAnPGgyPicgKyBmaWVsZHNldFswXSArICc8L2gyPicgaWYgZmllbGRzZXRbMF0gaXMgbm90IE5vbmUgZWxzZSAnJwogICAgICAgICAgICAgICAgc2VsZi5maWVsZHMgPSB7azogZmllbGRzW2tdIGZvciBrIGluIGZpZWxkc2V0WzFdLmdldCgnZmllbGRzJyl9CiAgICAgICAgICAgICAgICBvdXRwdXQgKz0gJzxmaWVsZHNldCBjbGFzcz0ibW9kdWxlIGFsaWduZWQiPicgKyBoMiArIHNlbGYuX2FzX2RpdigpICsgJzwvZmllbGRzZXQ+JwogICAgICAgICAgICBzZWxmLmZpZWxkcyA9IGZpZWxkcwogICAgICAgIGVsc2U6CiAgICAgICAgICAgIG91dHB1dCA9ICc8ZmllbGRzZXQgY2xhc3M9Im1vZHVsZSBhbGlnbmVkIj4nICsgc2VsZi5fYXNfZGl2KCkgKyAnPC9maWVsZHNldD4nCiAgICAgICAgcmV0dXJuIG1hcmtfc2FmZShvdXRwdXQpCgogICAgQHByb3BlcnR5CiAgICBkZWYgbWVkaWEoc2VsZik6CiAgICAgICAgbWVkaWEgPSBzdXBlcigpLm1lZGlhCiAgICAgICAganMgPSBbCiAgICAgICAgICAgICdjb3JlLmpzJywKICAgICAgICAgICAgJ2FkbWluL1JlbGF0ZWRPYmplY3RMb29rdXBzLmpzJywKICAgICAgICAgICAgJ3VybGlmeS5qcycsCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgICAgICAgICAgJ3ZlbmRvci94cmVnZXhwL3hyZWdleHAubWluLmpzJwo8fGZpbV9lbmR8Pg==
592cd638b9101fae51e0b0b3dbfb005c5dfc57ef-2
592cd638b9101fae51e0b0b3dbfb005c5dfc57ef
PHxmaW1fcHJlZml4fD4KZnJvbSBkamFuZ28gaW1wb3J0IGZvcm1zCmZyb20gZGphbmdvLmZvcm1zIGltcG9ydC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gogICAgZGVmIF9faW5pdF9fKHNlbGYsICphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgc3VwZXIoKS5fX2luaXRfXygqYXJncywgKiprd2FyZ3MpCgogICAgICAgIGZpZWxkX2RpY3QgPSBnZXRhdHRyKHNlbGYuX21ldGEubW9kZWwsICdfZmllbGRfZGljdCcsIE5vbmUpCiAgICAgICAgaWYgZmllbGRfZGljdCBpcyBOb25lOgogICAgICAgICAgICBmaWVsZF9kaWN0ID0ge2YubmFtZTogZiBmb3IgZiBpbiBzZWxmLl9tZXRhLm1vZGVsLl9tZXRhLmZpZWxkc30KICAgICAgICAgICAgc2V0YXR0cihzZWxmLl9tZXRhLm1vZGVsLCAnX2ZpZWxkX2RpY3QnLCBmaWVsZF9kaWN0KQoKICAgICAgICBmb3IgbmFtZSwgZmllbGQgaW4gc2VsZi5maWVsZHMuaXRlbXMoKToKICAgICAgICAgICAgbW9kZWxfZmllbGQgPSBmaWVsZF9kaWN0LmdldChuYW1lKQogICAgICAgICAgICBpZiBtb2RlbF9maWVsZCBpcyBOb25lOgogICAgICAgICAgICAgICAgY29udGludWUKICAgICAgICAgICAgZmlsZWRfbWFwcGVyID0gRk9STUZJRUxEX0ZPUl9EQkZJRUxEX0RFRkFVTFRTLmdldChtb2RlbF9maWVsZC5fX2NsYXNzX18sIHt9KQogICAgICAgICAgICBmb3JtX2NsYXNzID0gZmlsZWRfbWFwcGVyLmdldCgnZm9ybV9jbGFzcycpCiAgICAgICAgICAgIGlmIGZvcm1fY2xhc3MgaXMgbm90IE5vbmU6CiAgICAgICAgICAgICAgICBzZWxmLmZpZWxkc1tuYW1lXSA9IGZpZWxkID0gZm9ybV9jbGFzcygqKmZpZWxkLl9fZGljdF9fKQogICAgICAgICAgICB3aWRnZXRfY2xhc3MgPSBmaWxlZF9tYXBwZXIuZ2V0KCd3aWRnZXQnKQogICAgICAgICAgICBpZiB3aWRnZXRfY2xhc3MgaXMgbm90IE5vbmU6CiAgICAgICAgICAgICAgICBmaWVsZC53aWRnZXQgPSB3aWRnZXRfY2xhc3MoKQoKICAgIGRlZiB2YWxpZGF0ZV91bmlxdWUoc2VsZik6CiAgICAgICAgaWYgc2VsZi5fbWV0YS5tb2RlbC5fbWV0YS5hYnN0cmFjdDoKICAgICAgICAgICAgcGFzcwogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHN1cGVyKCkudmFsaWRhdGVfdW5pcXVlKCkKCiAgICBkZWYgX19zdHJfXyhzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5hc19kaXYoKQoKICAgIGRlZiBfYXNfZGl2KHNlbGYpOgogICAgICAgIHdpdGggYm91bmRfZmllbGRfaG9va2VyOgogICAgICAgICAgICBvdXRwdXQgPSBzZWxmLl9odG1sX291dHB1dCgKICAgICAgICAgICAgICAgIG5vcm1hbF9yb3c9JzxkaXYgY2xhc3M9ImZvcm0tcm93Ij4lKGVycm9ycylzJShsYWJlbClzJShmaWVsZClzJShoZWxwX3RleHQpczwvZGl2PicsCiAgICAgICAgICAgICAgICBlcnJvcl9yb3c9JzxkaXYgY2xhc3M9ImZvcm0tcm93Ij48ZGl2IGNvbHNwYW49IjIiPiVzPC9kaXY+PC9kaXY+JywKICAgICAgICAgICAgICAgIHJvd19lbmRlcj0nPC9kaXY+JywKICAgICAgICAgICAgICAgIGhlbHBfdGV4dF9odG1sPSc8ZGl2IGNsYXNzPSJoZWxwIj4lczwvZGl2PicsCiAgICAgICAgICAgICAgICBlcnJvcnNfb25fc2VwYXJhdGVfcm93PUZhbHNlLAogICAgICAgICAgICApCiAgICAgICAgICAgIHJldHVybiBvdXRwdXQKCiAgICBkZWYgYXNfZGl2KHNlbGYpOgogICAgICAgIGZpZWxkc2V0cyA9IGdldGF0dHIoc2VsZiwgJ2ZpZWxkc2V0cycsIE5vbmUpCiAgICAgICAgaWYgZmllbGRzZXRzIGlzIG5vdCBOb25lOgogICAgICAgICAgICBmaWVsZHMgPSBzZWxmLmZpZWxkcwogICAgICAgICAgICBvdXRwdXQgPSAnJwogICAgICAgICAgICBmb3IgZmllbGRzZXQgaW4gZmllbGRzZXRzOgogICAgICAgICAgICAgICAgaDIgPSAnPGgyPicgKyBmaWVsZHNldFswXSArICc8L2gyPicgaWYgZmllbGRzZXRbMF0gaXMgbm90IE5vbmUgZWxzZSAnJwogICAgICAgICAgICAgICAgc2VsZi5maWVsZHMgPSB7azogZmllbGRzW2tdIGZvciBrIGluIGZpZWxkc2V0WzFdLmdldCgnZmllbGRzJyl9CiAgICAgICAgICAgICAgICBvdXRwdXQgKz0gJzxmaWVsZHNldCBjbGFzcz0ibW9kdWxlIGFsaWduZWQiPicgKyBoMiArIHNlbGYuX2FzX2RpdigpICsgJzwvZmllbGRzZXQ+JwogICAgICAgICAgICBzZWxmLmZpZWxkcyA9IGZpZWxkcwogICAgICAgIGVsc2U6CiAgICAgICAgICAgIG91dHB1dCA9ICc8ZmllbGRzZXQgY2xhc3M9Im1vZHVsZSBhbGlnbmVkIj4nICsgc2VsZi5fYXNfZGl2KCkgKyAnPC9maWVsZHNldD4nCiAgICAgICAgcmV0dXJuIG1hcmtfc2FmZShvdXRwdXQpCgogICAgQHByb3BlcnR5CiAgICBkZWYgbWVkaWEoc2VsZik6CiAgICAgICAgbWVkaWEgPSBzdXBlcigpLm1lZGlhCiAgICAgICAganMgPSBbCiAgICAgICAgICAgICdjb3JlLmpzJywKICAgICAgICAgICAgJ2FkbWluL1JlbGF0ZWRPYmplY3RMb29rdXBzLmpzJywKICAgICAgICAgICAgJ3VybGlmeS5qcycsCiAgICAgICAgICAgICd2ZW5kb3IveHJlZ2V4cC94cmVnZXhwLm1pbi5qcycKICAgICAgICBdCiAgICAgICAgbWVkaWEgPSBmb3Jtcy5NZWRpYShqcz1bJ2FkbWluL2pzLyVzJyAlIHVybCBmb3IgdXJsIGluIGpzXSkgKyBtZWRpYQogICAgICAgIHJldHVybiBtZWRpYQo8fGZpbV9zdWZmaXh8PgoKCmJvdW5kX2ZpZWxkX2hvb2tlciA9IEJvdW5kR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ICAgICAgICBzZWxmLmZpZWxkc1tuYW1lXSA9IGZpZWxkID0gZm9ybV9jbGFzcygqKmZpZWxkLl9fZGljdF9fKQogICAgICAgICAgICB3aWRnZXRfY2xhc3MgPSBmaWxlZF9tYXBwZXIuZ2V0KCd3aWRnZXQnKQogICAgICAgICAgICBpZiB3aWRnZXRfY2xhc3MgaXMgbm90IE5vbmU6CiAgICAgICAgICAgICAgICBmaWVsZC53aWRnZXQgPSB3aWRnZXRfY2xhc3MoKQoKICAgIGRlZiB2YWxpZGF0ZV91bmlxdWUoc2VsZik6CiAgICAgICAgaWYgc2VsZi5fbWV0YS5tb2RlbC5fbWV0YS5hYnN0cmFjdDoKICAgICAgICAgICAgcGFzcwogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHN1cGVyKCkudmFsaWRhdGVfdW5pcXVlKCkKCiAgICBkZWYgX19zdHJfXyhzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5hc19kaXYoKQoKICAgIGRlZiBfYXNfZGl2KHNlbGYpOgogICAgICAgIHdpdGggYm91bmRfZmllbGRfaG9va2VyOgogICAgICAgICAgICBvdXRwdXQgPSBzZWxmLl9odG1sX291dHB1dCgKICAgICAgICAgICAgICAgIG5vcm1hbF9yb3c9JzxkaXYgY2xhc3M9ImZvcm0tcm93Ij4lKGVycm9ycylzJShsYWJlbClzJShmaWVsZClzJShoZWxwX3RleHQpczwvZGl2PicsCiAgICAgICAgICAgICAgICBlcnJvcl9yb3c9JzxkaXYgY2xhc3M9ImZvcm0tcm93Ij48ZGl2IGNvbHNwYW49IjIiPiVzPC9kaXY+PC9kaXY+JywKICAgICAgICAgICAgICAgIHJvd19lbmRlcj0nPC9kaXY+JywKICAgICAgICAgICAgICAgIGhlbHBfdGV4dF9odG1sPSc8ZGl2IGNsYXNzPSJoZWxwIj4lczwvZGl2PicsCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgICAgICAgICAgICAgIGVycm9yc19vbl9zZXBhcmF0ZV9yb3c9RmFsc2UsCjx8ZmltX2VuZHw+
553042e223864d397a746bf11c4703f38968a74f-1
553042e223864d397a746bf11c4703f38968a74f
PHxmaW1fcHJlZml4fD4KZnJvbSBDU1ZMaWJyYXJ5IGltcG9ydCAqCgoKY2xhc3MgU2VlU3BlY2lmaWNFbGVtZW50cyhDU1ZMaWJyYXJ5KToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCBmaWxlLCBzZXBlcmF0b3IsIGRpYywgcm93PTAsIGNvbHVtbj0wKToKICAgICAgICBzdXBlcigpLl9faW5pdF9fKGZpbGUsIHNlcGVyYXRvcikKICAgICAgICBzZWxmLl9fZGljID0gZGljCiAgICAgICAgc2VsZi5fX3JvdyA9IHJvdwogICAgICAgIHNlbGYuX19jb2wgPSBjb2x1bW4KCiAgICAjICoqKiBHZXR0ZXJzICoqKgogICAgZGVmIGdldFJvdyhzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5fX3JvdwoKICAgIGRlZiBnZXRDb2woc2VsZik6CiAgICAgICAgcmV0dXJuIHNlbGYuX19jb2wKCiAgICBkZWYgZ2V0TG9jYWxEaWN0KHNlbGYpOgogICAgICAgIHJldHVybiBzZWxmLl9fZGljCgogICAgZGVmIHNldERpY3Qoc2VsZiwgbmV3RGljdCk6CiAgICAgICAgc2VsZi5fX2RpYyA9IG5ld0RpY3QKCiAgICAjICoqKiBBY3Rpb25zICoqKgogICAgZGVmIHNlZShzZWxmKToKICAgICAgICB0ZW1wX2RpY3QgPSBzZWxmLmdldExvY2FsRGljdCgpCgogICAgICAgIGlmIHNlbGYuX19pc19yb3dfYW5kX2NvbF8wKCk6CiAgICAgICAgICAgIHNlbGYuZ2V0TG9jYWxEaWN0KCkKICAgICAgICBlbGlmIHNlbGYuX19pc19jb2x1bW5fb25seV8wKCk6CiAgICAgICAgICAgIHNlbGYuX19pdGVyYXRlT25seVJvdyh0ZW1wX2RpY3QpCiAgICAgICAgZWxpZiBzZWxmLl9faXNfcm93X29ubHlfMCgpOgogIC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NlbGYuZ2V0Um93KCkgPT0gMCBhbmQgc2VsZi5nZXRDb2woKSA9PSAwCgogICAgZGVmIF9faXNfY29sdW1uX29ubHlfMChzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5nZXRSb3coKSAhPSAwIGFuZCBzZWxmLmdldENvbCgpID09IDAKCiAgICBkZWYgX19pc19yb3dfb25seV8wKHNlbGYpOgogICAgICAgIHJldHVybiBzZWxmLmdldFJvdygpID09IDAgYW5kIHNlbGYuZ2V0Q29sKCkgIT0gMAo8fGZpbV9zdWZmaXh8PgoKICAgICAgICBmb3Iga2V5IGluIHRlbXBfZGljdDoKICAgICAgICAgICAgdGVtcF9saXN0ID0gdGVtcF9kaWN0W2tleV0KICAgICAgICAgICAgZm9yIGkgaW4gcmFuZ2UoMCwgbGVuKHRlbXBfbGlzdCkpOgo8fGZpbV9lbmR8Pg==
553042e223864d397a746bf11c4703f38968a74f-2
553042e223864d397a746bf11c4703f38968a74f
PHxmaW1fcHJlZml4fD4KZnJvbSBDU1ZMaWJyYXJ5IGltcG9ydCAqCgoKY2xhc3MgU2VlU3BlY2lmaWNFbGVtZW50cyhDU1ZMaWJyYXJ5KToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCBmaWxlLCBzZXBlcmF0b3IsIGRpYywgcm93PTAsIGNvbHVtbj0wKToKICAgICAgICBzdXBlcigpLl9faW5pdF9fKGZpbGUsIHNlcGVyYXRvcikKICAgICAgICBzZWxmLl9fZGljID0gZGljCiAgICAgICAgc2VsZi5fX3JvdyA9IHJvdwogICAgICAgIHNlbGYuX19jb2wgPSBjb2x1bW4KCiAgICAjICoqKiBHZXR0ZXJzICoqKgogICAgZGVmIGdldFJvdyhzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5fX3JvdwoKICAgIGRlZiBnZXRDb2woc2VsZik6CiAgICAgICAgcmV0dXJuIHNlbGYuX19jb2wKCiAgICBkZWYgZ2V0TG9jYWxEaWN0KHNlbGYpOgogICAgICAgIHJldHVybiBzZWx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9yIGkgaW4gcmFuZ2UoMCwgbGVuKHRlbXBfbGlzdCkpOgogICAgICAgICAgICAgICAgaWYgaSAhPSB0ZW1wX2NvbDoKICAgICAgICAgICAgICAgICAgICB0ZW1wX2xpc3RbaV0gPSAiIgoKPHxmaW1fZW5kfD4=
553042e223864d397a746bf11c4703f38968a74f-3
553042e223864d397a746bf11c4703f38968a74f
PHxmaW1fcHJlZml4fD4KZnJvbSBDU1ZMaWJyYXJ5IGltcG9ydCAqCgoKY2xhc3MgU2VlU3BlY2lmaWNFbGVtZW50cyhDU1ZMaWJyYXJ5KToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCBmaWxlLCBzZXBlcmF0b3IsIGRpYywgcm93PTAsIGNvbHVtbj0wKToKICAgICAgICBzdXBlcigpLl9faW5pdF9fKGZpbGUsIHNlcGVyYXRvcikKICAgICAgICBzZWxmLl9fZGljID0gZGljCiAgICAgICAgc2VsZi5fX3JvdyA9IHJvdwogICAgICAgIHNlbGYuX19jb2wgPSBjb2x1bW4KCiAgICAjICoqKiBHZXR0ZXJzICoqKgogICAgZGVmIGdldFJvdyhzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5fX3JvdwoKICAgIGRlZiBnZXRDb2woc2VsZik6CiAgICAgICAgcmV0dXJuIHNlbGYuX19jb2wKCiAgICBkZWYgZ2V0TG9jYWxEaWN0KHNlbGYpOgogICAgICAgIHJldHVybiBzZWxmLl9fZGljCgogICAgZGVmIHNldERpY3Qoc2VsZiwgbmV3RGljdCk6CiAgICAgICAgc2VsZi5fX2RpYyA9IG5ld0RpY3QKCiAgICAjICoqKiBBY3Rpb25zICoqKgogICAgZGVmIHNlZShzZWxmKToKICAgICAgICB0ZW1wX2RpY3QgPSBzZWxmLmdldExvY2FsRGljdCgpCgogICAgICAgIGlmIHNlbGYuX19pc19yb3dfYW5kX2NvbF8wKCk6CiAgICAgICAgICAgIHNlbGYuZ2V0TG9jYWxEaWN0KCkKICAgICAgICBlbGlmIHNlbGYuX19pc19jb2x1bW5fb25seV8wKCk6CiAgICAgICAgICAgIHNlbGYuX19pdGVyYXRlT25seVJvdyh0ZW1wX2RpY3QpCiAgICAgICAgZWxpZiBzZWxmLl9faXNfcm93X29ubHlfMCgpOgogICAgICAgICAgICBzZWxmLl9faXRlcmF0ZU9ubHlDb2wodGVtcF9kaWN0KQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHNlbGYuX19pdGVyYXRlUm93QW5kQ29sKHRlbXBfZGljdCkKCiAgICAjIFByaXZhdGUgTWV0aG9kcwogICAgZGVmIF9faXRlcmF0ZU9ubHlSb3coc2VsZiwgdGVtcF9kaWN0KToKICAgICAgICB0ZW1wX3JvdyA9IHNlbGYuZ2V0Um93KCkKCiAgICAgICAgZm9yIGtleSBpbiB0ZW1wX2RpY3Q6CiAgICAgICAgICAgIGlmIGtleSAhPSB0ZW1wX3JvdzoKICAgICAgICAgICAgICAgIHRlbXBfZGljdFtrZXldID0gIiIKCiAgICBkZWYgX19pdGVyYXRlT25seUNvbChzZWxmLCB0ZW1wX2RpY3QpOgogICAgICAgIHRlbXBfY29sID0gc2VsZi5nZXRDb2woKSAtIDEKCiAgICAgICAgZm9yIGtleSBpbiB0ZW1wX2RpY3Q6CiAgICAgICAgICAgIHRlbXBfbGlzdCA9IHRlbXBfZGljdFtrZXldCiAgICAgICAgICAgIGZvciBpIGluIHJhbmdlKDAsIGxlbih0ZW1wX2xpc3QpKToKICAgICAgICAgICAgICAgIGlmIGkgIT0gdGVtcF9jb2w6CiAgICAgICAgICAgICAgICAgICAgdGVtcF9saXN0W2ldID0gIiIKCiAgICBkZWYgX19pdGVyYXRlUm93QW5kQ29sKHNlbGYsIHRlbXBfZGljdCk6CiAgICAgICAgdGVtcF9yb3cgPSBzZWxmLmdldFJvdygpCiAgICAgICAgdGVtcF9jb2wgPSBzZWxmLmdldENvbCgpIC0gMQoKICAgICAgICBmb3Iga2V5IGluIHRlbXBfZGljdDoKICAgICAgICAgICAgdGVtcF9saXN0ID0gdGVtcF9kaWN0W2tleV0KICAgICAgICAgICAgZm9yIGkgaW4gcmFuZ2UoMCwgbGVuKHRlbXBfbGlzdCkpOgogICAgICAgICAgICAgICAgaWYgaSAhPSB0ZW1wX2NvbCBhbmQga2V5ICE9IHRlbXBfcm93OgogICAgICAgICAgICAgICAgICAgIHRlbXBfbGlzdFtpXSA9ICIiCgogICAgZGVmIF9faXNfcm93X2FuZF9jb2xfMChzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5nZXRSb3coKSA9PSAwIGFuZCBzZWxmLmdldENvbCgpID09IDAKCiAgICBkZWYgX19pc19jb2x1bW5fb25seV8wKHNlbGYpOgogICAgICAgIHJldHVybiBzZWxmLmdldFJvdygpICE9IDAgYW5kIHNlbGYuZ2V0Q29sKCkgPT0gMAoKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgogICAgZGVmIF9faXNfcm93X29ubHlfMChzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5nZXRSb3coKSA9PSAwIGFuZCBzZWxmLmdldENvbCgpICE9IDAKPHxmaW1fZW5kfD4=
553042e223864d397a746bf11c4703f38968a74f-4
553042e223864d397a746bf11c4703f38968a74f
PHxmaW1fcHJlZml4fD4KZnJvbSBDU1ZMaWJyYXJ5IGltcG9ydCAqCgoKY2xhc3MgU2VlU3BlY2lmaWNFbGVtZW50cyhDU1ZMaWJyYXJ5KToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCBmaWxlLCBzZXBlcmF0b3IsIGRpYywgcm93PTAsIGNvbHVtbj0wKToKICAgICAgICBzdXBlcigpLl9faW5pdF9fKGZpbGUsIHNlcGVyYXRvcikKICAgICAgICBzZWxmLl9fZGljID0gZGljCiAgICAgICAgc2VsZi5fX3JvdyA9IHJvdwogICAgICAgIHNlbGYuX19jb2wgPSBjb2x1bW4KCiAgICAjICoqKiBHZXR0ZXJzICoqKgogICAgZGVmIGdldFJvdyhzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5fX3JvdwoKICA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ZW1wX2RpY3Q6CiAgICAgICAgICAgIHRlbXBfbGlzdCA9IHRlbXBfZGljdFtrZXldCiAgICAgICAgICAgIGZvciBpIGluIHJhbmdlKDAsIGxlbih0ZW1wX2xpc3QpKToKICAgICAgICAgICAgICAgIGlmIGkgIT0gdGVtcF9jb2w6CiAgICAgICAgICAgICAgICAgICAgdGVtcF9saXN0W2ldID0gIiIKCiAgICBkZWYgX19pdGVyYXRlUm93QW5kQ29sKHNlbGYsIHRlbXBfZGljdCk6CiAgICAgICAgdGVtcF9yb3cgPSBzZWxmLmdldFJvdygpCiAgICAgICAgdGVtcF9jb2wgPSBzZWxmLmdldENvbCgpIC0gMQoKICAgICAgICBmb3Iga2V5IGluIHRlbXBfZGljdDoKICAgICAgICAgICAgdGVtcF9saXN0ID0gdGVtcF9kaWN0W2tleV0KICAgICAgICAgICAgZm9yIGkgaW4gcmFuZ2UoMCwgbGVuKHRlbXBfbGlzdCkpOgogICAgICAgICAgICAgICAgaWYgaSAhPSB0ZW1wX2NvbCBhbmQga2V5ICE9IHRlbXBfcm93Ogo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgICAgICAgICAgICAgdGVtcF9saXN0W2ldID0gIiIKCjx8ZmltX2VuZHw+
553042e223864d397a746bf11c4703f38968a74f-5
553042e223864d397a746bf11c4703f38968a74f
PHxmaW1fcHJlZml4fD4KZnJvbSBDU1ZMaWJyYXJ5IGltcG9ydCAqCgoKY2xhc3MgU2VlU3BlY2lmaWNFbGVtZW50cyhDU1ZMaWJyYXJ5KToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCBmaWxlLCBzZXBlcmF0b3IsIGRpYywgcm93PTAsIGNvbHVtbj0wKToKICAgICAgICBzdXBlcigpLl9faW5pdF9fKGZpbGUsIHNlcGVyYXRvcikKICAgICAgICBzZWxmLl9fZGljID0gZGljCiAgICAgICAgc2VsZi5fX3JvdyA9IHJvdwogICAgICAgIHNlbGYuX19jb2wgPSBjb2x1bW4KCiAgICAjICoqKiBHZXR0ZXJzICoqKgogICAgZGVmIGdldFJvdyhzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi5fX3JvdwoKICAgIGRlZiBnZXRDb2woc2VsZik6CiAgICAgICAgcmV0dXJuIHNlbGYuX19jb2wKCiAgICBkZWYgZ2V0TG9jYWxEaWN0KHNlbGYpOgogICAgICAgIHJldHVybiBzZWxmLl9fZGljCgogICAgZGVmIHNldERpY3Qoc2VsZiwgbmV3RGljdCk6CiAgICAgICAgc2VsZi5fX2RpYyA9IG5ld0RpY3QKCiAgICAjICoqKiBBY3Rpb25zICoqKgogICAgZGVmIHNlZShzZWxmKToKICAgICAgICB0ZW1wX2RpY3QgPSBzZWxmLmdldExvY2FsRGljdCgpCgogICAgICAgIGlmIHNlbGYuX19pc19yb3dfYW5kX2NvbF8wKCk6CiAgICAgICAgICAgIHNlbGYuZ2V0TG9jYWxEaWN0KCkKICAgICAgICBlbGlmIHNlbGYuX19pc19jb2x1bW5fb25seV8wKCk6CiAgICAgICAgICAgIHNlbGYuX19pdGVyYXRlT25seVJvdyh0ZW1wX2RpY3QpCiAgICAgICAgZWxpZiBzZWxmLl9faXNfcm93X29ubHlfMCgpOgogICAgICAgICAgICBzZWxmLl9faXRlcmF0ZU9ubHlDb2wodGVtcF9kaWN0KQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHNlbGYuX19pdGVyYXRlUm93QW5kQ29sKHRlbXBfZGljdCkKCiAgICAjIFByaXZhdGUgTWV0aG9kcwogICAgZGVmIF9faXRlcmF0ZU9ubHlSb3coc2VsZiwgdGVtcF9kaWN0KToKICAgICAgICB0ZW1wX3JvdyA9IHNlbGYuZ2V0Um93KCkKCiAgICAgICAgZm9yIGtleSBpbiB0ZW1wX2RpY3Q6CiAgICAgICAgICAgIGlmIGtleSAhPSB0ZW1wX3JvdzoKICAgICAgICAgICAgICAgIHRlbXBfZGljdFtrZXldID0gIiIKCiAgICBkZWYgX19pdGVyYXRlT25seUNvbChzZWxmLCB0ZW1wX2RpY3QpOgogICAgICAgIHRlbXBfY29sID0gc2VsZi5nZXRDb2woKSAtIDEKCiAgICAgICAgZm9yIGtleSBpbiB0ZW1wX2RpY3Q6CiAgICAgICAgICAgIHRlbXBfbGlzdCA9IHRlbXBfZGljdFtrZXldCiAgICAgICAgICAgIGZvciBpIGluIHJhbmdlKDAsIGxlbih0ZW1wX2xpc3QpKToKICAgICAgICAgICAgICAgIGlmIGkgIT0gdGVtcF9jb2w6CiAgICAgICAgICAgICAgICAgICAgdGVtcF9saXN0W2ldID0gIiIKCiAgICBkZWYgX19pdGVyYXRlUm93QW5kQ29sKHNlbGYsIHRlbXBfZGljdCk6CiAgICAgICAgdGVtcF9yb3cgPSBzZWxmLmdldFJvdygpCiAgICAgICAgdGVtcF9jb2wgPSBzZWxmLmdldENvbCgpIC0gMQoKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgogICAgICAgIGZvciBrZXkgaW4gdGVtcF9kaWN0OgogICAgICAgICAgICB0ZW1wX2xpc3QgPSB0ZW1wX2RpY3Rba2V5XQogICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgwLCBsZW4odGVtcF9saXN0KSk6CiAgICAgICAgICAgICAgICBpZiBpICE9IHRlbXBfY29sIGFuZCBrZXkgIT0gdGVtcF9yb3c6Cjx8ZmltX2VuZHw+
3c5ed6433a7d9fc367fbeed584051dc07827766a-1
3c5ed6433a7d9fc367fbeed584051dc07827766a
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGdjCmltcG9ydCBpbnNwZWN0CmltcG9ydCBqc29uCmltcG9ydCBsb2dnaW5nCmltcG9ydCBvcwppbXBvcnQgcHN1dGlsCmltcG9ydCBzeXMKaW1wb3J0IHRpbWUKaW1wb3J0IHRocmVhZAppbXBvcnQgdHJhY2ViYWNrCgpmcm9tIGNvbGxlY3Rpb25zIGltcG9ydCBkZWZhdWx0ZGljdApmcm9tIHRocmVhZGluZyBpbXBvcnQgVGhyZWFkCgpmc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KICAgICAgICAgICAgJ3RocmVzaG9sZCc6IHRocmVzaG9sZCwKICAgICAgICAgICAgJ2Fib3J0X29uX2hpdCc6IGFib3J0X29uX2hpdCwKICAgICAgICAgICAgJ3BhcmVudF90aHJlYWRfaWQnOiB0aHJlYWQuZ2V0X2lkZW50KCksCiAgICAgICAgfSwKICAgICkKICAgIHQuZGFlbW9uID0gVHJ1ZQogICAgdC5zdGFydCgpCgoKZGVmIHdpdGhfY2xhc3Mob2Jqcyk6CiAgICBmb3IgbyBpbiBvYmpzOgogICAgICAgIGlmIG5vdCBoYXNhdHRyKG8sICdfX2NsYXNzX18nKToKICAgICAgICAgICAgY29udGludWUKICAgICAgICB5aWVsZCBvCgoKZGVmIGR1bXBfbWVtb3J5KGZwLCBmcmFtZT1Ob25lKToKICAgIGlmIGZyYW1lIGlzIE5vbmU6CiAgICAgICAgZnJhbWUgPSBpbnNwZWN0LmN1cnJlbnRmcmFtZSgpCgogICAgcHJvY2VzcyA9IHBzdXRpbC5Qcm9jZXNzKG9zLmdldHBpZCgpKQogICAgbWVtX2luZm8gPSBwcm9jZXNzLmdldF9leHRfbWVtb3J5X2luZm8oKQoKICAgIGZwLndyaXRlKGpzb24uZHVtcHMoewogICAgICAgICdzdGFjayc6IHRyYWNlYmFjay5mb3JtYXRfc3RhY2soZnJhbWUpLAogICAgICAgICdjbWQnOiBwcm9jZXNzLmNtZGxpbmUsCiAgICAgICAgJ29wZW5maWxlcyc6IFsKICAgICAgICAgICAgZGljdCgKICAgICAgICAgICAgICAgIChrLCBnZXRhdHRyKGYsIGspKQogICAgICAgICAgICAgICAgZm9yIGsgaW4gKCdwYXRoJywgJ2ZkJykKICAgICAgICAgICAgKQogICAgICAgICAgICBmb3IgZiBpbiBwcm9jZXNzLmdldF9vcGVuX2ZpbGVzKCkKICAgICAgICBdLAogICAgICAgICdtZW0nOiBkaWN0KAogICAgICAgICAgICAoaywgZ2V0YXR0cihtZW1faW5mbywgaykpCiAgICAgICAgICAgIGZvciBrIGluICgncnNzJywgJ3ZtcycpCiAgICAgICAgKSwKICAgIH0pICsgJ1xuJykKCiAgICBmb3Igb2JqIGluIHdpdGhfY2xhc3MoZ2MuZ2V0X29iamVjdHMoKSk6CiAgICAgICAgcmVmc19ieV90eXBlID0gZGVmYXVsdGRpY3QoaW50KQogICAgICAgICMgZm9yIHJlZiBpbiB3aXRoX2NsYXNzKGdjLmdldF9yZWZlcmVudHMob2JqKSk6CiAgICAgICAgIyAgICAgcmVmc19ieV90eXBlW3N0cih0eXBlKHJlZikpXSArPSAxCiAgICAgICAgdHJ5OgogICAgICAgICAgICBvYmpfcmVwciA9IHJlcHIob2JqKQogICAgICAgIGV4Y2VwdCBUeXBlRXJyb3I6CiAgICAgICAgICAgIG9ial9yZXByID0gJyhubyByZXByKScKICAgICAgICBmcC53cml0ZShqc29uLmR1bXBzKHsKICAgICAgICAgICAgJ2lkJzogaWQob2JqKSwKICAgICAgICAgICAgJ2NsYXNzJzogc3RyKHR5cGUob2JqKSksCiAgICAgICAgICAgICdzaXplJzogc3lzLmdldHNpemVvZihvYmosIDApLAogICAgICAgICAgICAndmFsdWVfdHJpbSc6IG9ial9yZXByWzoxMDBdLAogICAgICAgICAgICAncmVmZXJlbnRzJzogZGljdChyZWZzX2J5X3R5cGUpLAogICAgICAgIH0pICsgJ1xuJykKCgpkZWYgbWVtY2hlY2sob3V0cHV0LCB0aHJlc2hvbGQ9T05FX0dCLCBhYm9ydF9vbl9oaXQ9RmFsc2UsCiAgICAgICAgICAgICBwYXJlbnRfdGhyZWFkX2lkPU5vbmUpOgogICAgaWYgbm90IHBhcmVudF90aHJlYWRfaWQ6CiAgICAgICAgcGFyZW50X3RocmVhZF9pZCA9IHRocmVhZC5nZXRfaWRlbnQoKQoKICAgIHBpZCA9IG9zLmdldHBpZCgpCiAgICByc3MgPSBwc3V0aWwuUHJvY2VzcyhwaWQpLmdldF9tZW1vcnlfaW5mbygpLnJzcwogICAgc3lzLnN0ZGVyci53cml0ZSgnUHJvY2VzcyB7fSByc3M9e31NQiAodGhyZXNob2xkPXt9TUIpJy5mb3JtYXQoCiAgICAgICAgcGlkLCByc3MgLyBPTkVfTUIsIHRocmVzaG9sZCAvIE9ORV9NQikpCgogICAgaWYgcnNzID4gdGhyZXNob2xkOgogICAgICAgIGZpbGVuYW1lID0gb3MucGF0aC5qb2luKAogICAgICAgICAgICBvdXRwdXQsICdtZW1vcnlkdW1wLXswfS5qc29uJy5mb3JtYXQoaW50KHRpbWUudGltZSgpKSkpCiAgICAgICAgZnJhbWUgPSBnZXRfdGhyZWFkX2ZyYW1lKHBhcmVudF90aHJlYWRfaWQpCgogICAgICAgIHN5cy5zdGRlcnIud3JpdGUoCiAgICAgICAgICAgICdUUkVTSE9MRCBFWENFRURFRDogZHVtcGluZyBwcm9maWxlIHRvIHt9ICh0aGlzIG1ha2UgdGFrZSBhIHdoaWxlKVxuJy5mb3JtYXQoCiAgICAgICAgICAgICAgICBmaWxlbmFtZSkpCgogICAgICAgIHRyeToKICAgICAgICAgICAgd2l0aCBvcGVuKGZpbGVuYW1lLCAnd2InKSBhcyBmcDoKICAgICAgICAgICAgICAgIGR1bXBfbWVtb3J5KGZwLCBmcmFtZSkKICAgICAgICBmaW5hbGx5OgogICAgICAgICAgICBpZiBhYm9ydF9vbl9oaXQ6CiAgICAgICAgICAgICAgICBzeXMuc3RkZXJyLndyaXRlKCdBYm9yaW5nIGV4ZWN1dGlvbiBkdWUgdG8gbWVtb3J5IHRocmVzaG9sZFxuJykKPHxmaW1faG9sZXw+CmRlZiBhbmFseXplKGZpbGVuYW1lKToKICAgIHJlc3VsdHNfYnlfdHlwZSA9IGRlZmF1bHRkaWN0KGxhbWJkYTogewogICAgICAgICdudW0nOiAwLAogICAgICAgICdleGFtcGxlcyc6IGRlZmF1bHRkaWN0KGludCksCiAgICAgICAgJ3NpemUnOiAwLAogICAgfSkKICAgIHdpdGggb3BlbihmaWxlbmFtZSkgYXMgZnA6CiAgICAgICAgaGVhZGVyID0ganNvbi5sb2FkcyhmcC5yZWFkbGluZSgpKQogICAgICAgIGZvciBsaW5lIGluIGZwOgogICAgICAgICAgICByZXN1bHQgPSBqc29uLmxvYWRzKGxpbmUpCiAgICAgICAgICAgIHRwID0gcmVzdWx0c19ieV90eXBlW3Jlc3VsdFsnY2xhc3MnXV0KICAgICAgICAgICAgdHBbJ251bSddICs9IDEKICAgICAgICAgICAgdHBbJ3NpemUnXSArPSByZXN1bHRbJ3NpemUnXQogICAgICAgICAgICB0cFsnZXhhbXBsZXMnXVtyZXN1bHRbJ3ZhbHVlX3RyaW0nXV0gKz0gMQoKICAgIHJlc3VsdHNfYnlfdHlwZSA9IHNvcnRlZCgKICAgICAgICByZXN1bHRzX2J5X3R5cGUuaXRlbXMoKSwKICAgICAgICBrZXk9bGFtYmRhIHg6IHhbMV1bJ3NpemUnXSwKICAgICAgICByZXZlcnNlPVRydWUpCgogICAgdG1wbCA9ICclLTUwcyAlLTEwcyAlLTEwcycKICAgIHByaW50IHRtcGwgJSAoJ1R5cGUnLCAnQ291bnQnLCAnU2l6ZScpCiAgICBwcmludCAnLScgKiA4MAogICAgZm9yIGNsc19uYW1lLCByZXN1bHQgaW4gcmVzdWx0c19ieV90eXBlWzo1MF06CiAgICAgICAgcHJpbnQgdG1wbCAlIChjbHNfbmFtZSwgcmVzdWx0WydudW0nXSwgcmVzdWx0WydzaXplJ10pCiAgICAgICAgZXhhbXBsZXMgPSBzb3J0ZWQocmVzdWx0WydleGFtcGxlcyddLml0ZW1zKCksIGtleT1sYW1iZGEgeDogeFsxXSwgcmV2ZXJzZT1UcnVlKQogICAgICAgIGZvciBuYW1lLCBjb3VudCBpbiBleGFtcGxlc1swOjFdOgogICAgICAgICAgICBwcmludCAnLT4gKCVzKSAlcycgJSAoY291bnQsIG5hbWUpCgppZiBfX25hbWVfXyA9PSAnX19tYWluX18nOgogICAgZmlsZW5hbWUgPSBzeXMuYXJndlsxXQogICAgYW5hbHl6ZShmaWxlbmFtZSkKPHxmaW1fc3VmZml4fD4KICAgICAgICAgICAgICAgIG9zLmFib3J0KCkKCgo8fGZpbV9lbmR8Pg==
3c5ed6433a7d9fc367fbeed584051dc07827766a-2
3c5ed6433a7d9fc367fbeed584051dc07827766a
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGdjCmltcG9ydCBpbnNwZWN0CmltcG9ydCBqc29uCmltcG9ydCBsb2dnaW5nCmltcG9ydCBvcwppbXBvcnQgcHN1dGlsCmltcG9ydCBzeXMKaW1wb3J0IHRpbWUKaW1wb3J0IHRocmVhZAppbXBvcnQgdHJhY2ViYWNrCgpmcm9tIGNvbGxlY3Rpb25zIGltcG9ydCBkZWZhdWx0ZGljdApmcm9tIHRocmVhZGluZyBpbXBvcnQgVGhyZWFkCgpmcm9tIHN5cyBpbXBvcnQgX2N1cnJlbnRfZnJhbWVzCgpsb2cgPSBsb2dnaW5nLmdldExvZ2dlcignbWVtcHJvZicpCgpPTkVfTUIgPSAxMDI0ICogMTAyNApPTkVfR0IgPSAxMDI0ICogT05FX01CCgoKY2xhc3MgUmVjdXJyaW5nVGltZXIoVGhyZWFkKToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCB0aWNrLCB0YXJnZXQsIGFyZ3M9Tm9uZSwga3dhcmdzPU5vbmUpOgogICAgICAgIGlmIGFyZ3MgaXMgTm9uZToKICAgICAgICAgICAgYXJncyA9ICgpCiAgICAgICAgaWYga3dhcmdzIGlzIE5vbmU6CiAgICAgICAgICAgIGt3YXJncyA9IHt9CgogICAgICAgIHNlbGYudGljayA9IHRpY2sKICAgICAgICBzZWxmLnRhcmdldCA9IHRhcmdldAogICAgICAgIHNlbGYuYXJncyA9IGFyZ3MKICAgICAgICBzZWxmLmt3YXJncyA9IGt3YXJncwogICAgICAgIHNlbGYuc3RvcHBlZCA9IEZhbHNlCgogICAgICAgIFRocmVhZC5fX2luaXRfXyhzZWxmKQoKICAgIGRlZiBydW4oc2VsZik6CiAgICAgICAgd2hpbGUgbm90IHNlbGYuc3RvcHBlZDoKICAgICAgICAgICAgc2VsZi50YXJnZXQoKnNlbGYuYXJncywgKipzZWxmLmt3YXJncykKICAgICAgICAgICAgdGltZS5zbGVlcChzZWxmLnRpY2spCgoKZGVmIGdldF90aHJlYWRfZnJhbWUodGhyZWFkX2lkKToKICAgIHJldHVybiBfY3VycmVudF9mcmFtZXMoKVt0aHJlYWRfaWRdCgoKZGVmIHdhdGNoX3RocmVhZChvdXRwdXQsIHRocmVzaG9sZD1PTkVfR0IsIHRpY2s9NS4wLCBhYm9ydF9vbl9oaXQ9RmFsc2UpOgogICAgdCA9IFJlY3VycmluZ1RpbWVyKAogICAgICAgIDEwLCBtZW1jaGVjaywga3dhcmdzPXsKICAgICAgICAgICAgJ291dHB1dCc6IG91dHB1dCwKICAgICAgICAgICAgJ3RocmVzaG9sZCc6IHRocmVzaG9sZCwKICAgICAgICAgICAgJ2Fib3J0X29uX2hpdCc6IGFib3J0X29uX2hpdCwKICAgICAgICAgICAgJ3BhcmVudF90aHJlYWRfaWQnOiB0aHJlYWQuZ2V0X2lkZW50KCksCiAgICAgICAgfSwKICAgICkKICAgIHQuZGFlbW9uID0gVHJ1ZQogICAgdC5zdGFydCgpCgoKZGVmIHdpdGhfY2xhc3Mob2Jqcyk6CiAgICBmb3IgbyBpbiBvYmpzOgogICAgICAgIGlmIG5vdCBoYXNhdHRyKG8sICdfX2NsYXNzX18nKToKICAgICAgICAgICAgY29udGludWUKICAgICAgICB5aWVsZCBvCgoKZGVmIGR1bXBfbWVtb3J5KGZwLCBmcmFtZT1Ob25lKToKICAgIGlmIGZyYW1lIGlzIE5vbmU6CiAgICAgICAgZnJhbWUgPSBpbnNwZWN0LmN1cnJlbnRmcmFtZSgpCgogICAgcHJvY2VzcyA9IHBzdXRpbC5Qcm9jZXNzKG9zLmdldHBpZCgpKQogICAgbWVtX2luZm8gPSBwcm9jZXNzLmdldF9leHRfbWVtb3J5X2luZm8oKQoKICAgIGZwLndyaXRlKGpzb24uZHVtcHMoewogICAgICAgICdzdGFjayc6IHRyYWNlYmFjay5mb3JtYXRfc3RhY2soZnJhbWUpLAogICAgICAgICdjbWQnOiBwcm9jZXNzLmNtZGxpbmUsCiAgICAgICAgJ29wZW5maWxlcyc6IFsKICAgICAgICAgICAgZGljdCgKICAgICAgICAgICAgICAgIChrLCBnZXRhdHRyKGYsIGspKQogICAgICAgICAgICAgICAgZm9yIGsgaW4gKCdwYXRoJywgJ2ZkJykKICAgICAgICAgICAgKQogICAgICAgICAgICBmb3IgZiBpbiBwcm9jZXNzLmdldF9vcGVuX2ZpbGVzKCkKICAgICAgICBdLAogICAgICAgICdtZW0nOiBkaWN0KAogICAgICAgICAgICAoaywgZ2V0YXR0cihtZW1faW5mbywgaykpCiAgICAgICAgICAgIGZvciBrIGluICgncnNzJywgJ3ZtcycpCiAgICAgICAgKSwKICAgIH0pICsgJ1xuJykKCiAgICBmb3Igb2JqIGluIHdpdGhfY2xhc3MoZ2MuZ2V0X29iamVjdHMoKSk6CiAgICAgICAgcmVmc19ieV90eXBlID0gZGVmYXVsdGRpY3QoaW50KQogICAgICAgICMgZm9yIHJlZiBpbiB3aXRoX2NsYXNzKGdjLmdldF9yZWZlcmVudHMob2JqKSk6CiAgICAgICAgIyAgICAgcmVmc19ieV90eXBlW3N0cih0eXBlKHJlZikpXSArPSAxCiAgICAgICAgdHJ5OgogICAgICAgICAgICBvYmpfcmVwciA9IHJlcHIob2JqKQogICAgICAgIGV4Y2VwdCBUeXBlRXJyb3I6CiAgICAgICAgICAgIG9ial9yZXByID0gJyhubyByZXByKScKICAgICAgICBmcC53cml0ZShqc29uLmR1bXBzKHsKICAgICAgICAgICAgJ2lkJzogaWQob2JqKSwKICAgICAgICAgICAgJ2NsYXNzJzogc3RyKHR5cGUob2JqKSksCiAgICAgICAgICAgICdzaXplJzogc3lzLmdldHNpemVvZihvYmosIDApLAogICAgICAgICAgICAndmFsdWVfdHJpbSc6IG9ial9yZXByWzoxMDBdLAogICAgICAgICAgICAncmVmZXJlbnRzJzogZGljdChyZ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CwKICAgICAgICAgICAgJ3RocmVzaG9sZCc6IHRocmVzaG9sZCwKICAgICAgICAgICAgJ2Fib3J0X29uX2hpdCc6IGFib3J0X29uX2hpdCwKICAgICAgICAgICAgJ3BhcmVudF90aHJlYWRfaWQnOiB0aHJlYWQuZ2V0X2lkZW50KCksCiAgICAgICAgfSwKICAgICkKICAgIHQuZGFlbW9uID0gVHJ1ZQogICAgdC5zdGFydCgpCgoKZGVmIHdpdGhfY2xhc3Mob2Jqcyk6CiAgICBmb3IgbyBpbiBvYmpzOgogICAgICAgIGlmIG5vdCBoYXNhdHRyKG8sICdfX2NsYXNzX18nKToKICAgICAgICAgICAgY29udGludWUKICAgICAgICB5aWVsZCBvCgoKZGVmIGR1bXBfbWVtb3J5KGZwLCBmcmFtZT1Ob25lKToKICAgIGlmIGZyYW1lIGlzIE5vbmU6CiAgICAgICAgZnJhbWUgPSBpbnNwZWN0LmN1cnJlbnRmcmFtZSgpCgogICAgcHJvY2VzcyA9IHBzdXRpbC5Qcm9jZXNzKG9zLmdldHBpZCgpKQogICAgbWVtX2luZm8gPSBwcm9jZXNzLmdldF9leHRfbWVtb3J5X2luZm8oKQoKICAgIGZwLndyaXRlKGpzb24uZHVtcHMoewogICAgICAgICdzdGFjayc6IHRyYWNlYmFjay5mb3JtYXRfc3RhY2soZnJhbWUpLAogICAgICAgICdjbWQnOiBwcm9jZXNzLmNtZGxpbmUsCiAgICAgICAgJ29wZW5maWxlcyc6IFsKICAgICAgICAgICAgZGljdCgKICAgICAgICAgICAgICAgIChrLCBnZXRhdHRyKGYsIGspKQogICAgICAgICAgICAgICAgZm9yIGsgaW4gKCdwYXRoJywgJ2ZkJykKICAgICAgICAgICAgKQogICAgICAgICAgICBmb3IgZiBpbiBwcm9jZXNzLmdldF9vcGVuX2ZpbGVzKCkKICAgICAgICBdLAo8fGZpbV9ob2xlfD4KICAgIH0pICsgJ1xuJykKCiAgICBmb3Igb2JqIGluIHdpdGhfY2xhc3MoZ2MuZ2V0X29iamVjdHMoKSk6CiAgICAgICAgcmVmc19ieV90eXBlID0gZGVmYXVsdGRpY3QoaW50KQogICAgICAgICMgZm9yIHJlZiBpbiB3aXRoX2NsYXNzKGdjLmdldF9yZWZlcmVudHMob2JqKSk6CiAgICAgICAgIyAgICAgcmVmc19ieV90eXBlW3N0cih0eXBlKHJlZikpXSArPSAxCiAgICAgICAgdHJ5OgogICAgICAgICAgICBvYmpfcmVwciA9IHJlcHIob2JqKQogICAgICAgIGV4Y2VwdCBUeXBlRXJyb3I6CiAgICAgICAgICAgIG9ial9yZXByID0gJyhubyByZXByKScKICAgICAgICBmcC53cml0ZShqc29uLmR1bXBzKHsKICAgICAgICAgICAgJ2lkJzogaWQob2JqKSwKICAgICAgICAgICAgJ2NsYXNzJzogc3RyKHR5cGUob2JqKSksCiAgICAgICAgICAgICdzaXplJzogc3lzLmdldHNpemVvZihvYmosIDApLAogICAgICAgICAgICAndmFsdWVfdHJpbSc6IG9ial9yZXByWzoxMDBdLAogICAgICAgICAgICAncmVmZXJlbnRzJzogZGljdChyZWZzX2J5X3R5cGUpLAogICAgICAgIH0pICsgJ1xuJykKCgpkZWYgbWVtY2hlY2sob3V0cHV0LCB0aHJlc2hvbGQ9T05FX0dCLCBhYm9ydF9vbl9oaXQ9RmFsc2UsCiAgICAgICAgICAgICBwYXJlbnRfdGhyZWFkX2lkPU5vbmUpOgogICAgaWYgbm90IHBhcmVudF90aHJlYWRfaWQ6CiAgICAgICAgcGFyZW50X3RocmVhZF9pZCA9IHRocmVhZC5nZXRfaWRlbnQoKQoKICAgIHBpZCA9IG9zLmdldHBpZCgpCiAgICByc3MgPSBwc3V0aWwuUHJvY2VzcyhwaWQpLmdldF9tZW1vcnlfaW5mbygpLnJzcwogICAgc3lzLnN0ZGVyci53cml0ZSgnUHJvY2VzcyB7fSByc3M9e31NQiAodGhyZXNob2xkPXt9TUIpJy5mb3JtYXQoCiAgICAgICAgcGlkLCByc3MgLyBPTkVfTUIsIHRocmVzaG9sZCAvIE9ORV9NQikpCgogICAgaWYgcnNzID4gdGhyZXNob2xkOgogICAgICAgIGZpbGVuYW1lID0gb3MucGF0aC5qb2luKAogICAgICAgICAgICBvdXRwdXQsICdtZW1vcnlkdW1wLXswfS5qc29uJy5mb3JtYXQoaW50KHRpbWUudGltZSgpKSkpCiAgICAgICAgZnJhbWUgPSBnZXRfdGhyZWFkX2ZyYW1lKHBhcmVudF90aHJlYWRfaWQpCgogICAgICAgIHN5cy5zdGRlcnIud3JpdGUoCiAgICAgICAgICAgICdUUkVTSE9MRCBFWENFRURFRDogZHVtcGluZyBwcm9maWxlIHRvIHt9ICh0aGlzIG1ha2UgdGFrZSBhIHdoaWxlKVxuJy5mb3JtYXQoCiAgICAgICAgICAgICAgICBmaWxlbmFtZSkpCgogICAgICAgIHRyeToKICAgICAgICAgICAgd2l0aCBvcGVuKGZpbGVuYW1lLCAnd2InKSBhcyBmcDoKICAgICAgICAgICAgICAgIGR1bXBfbWVtb3J5KGZwLCBmcmFtZSkKICAgICAgICBmaW5hbGx5OgogICAgICAgICAgICBpZiBhYm9ydF9vbl9oaXQ6CiAgICAgICAgICAgICAgICBzeXMuc3RkZXJyLndyaXRlKCdBYm9yaW5nIGV4ZWN1dGlvbiBkdWUgdG8gbWVtb3J5IHRocmVzaG9sZFxuJykKICAgICAgICAgICAgICAgIG9zLmFib3J0KCkKCgpkZWYgYW5hbHl6ZShmaWxlbmFtZSk6CiAgICByZXN1bHRzX2J5X3R5cGUgPSBkZWZhdWx0ZGljdChsYW1iZGE6IHsKICAgICAgICAnbnVtJzogMCwKICAgICAgICAnZXhhbXBsZXMnOiBkZWZhdWx0ZGljdChpbnQpLAogICAgICAgICdzaXplJzogMCwKICAgIH0pCiAgICB3aXRoIG9wZW4oZmlsZW5hbWUpIGFzIGZwOgogICAgICAgIGhlYWRlciA9IGpzb24ubG9hZHMoZnAucmVhZGxpbmUoKSkKICAgICAgICBmb3IgbGluZSBpbiBmcDoKICAgICAgICAgICAgcmVzdWx0ID0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KG1lbV9pbmZvLCBrKSkKICAgICAgICAgICAgZm9yIGsgaW4gKCdyc3MnLCAndm1zJykKICAgICAgICApLAo8fGZpbV9lbmR8Pg==
3c5ed6433a7d9fc367fbeed584051dc07827766a-4
3c5ed6433a7d9fc367fbeed584051dc07827766a
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGdjCmltcG9ydCBpbnNwZWN0CmltcG9ydCBqc29uCmltcG9ydCBsb2dnaW5nCmltcG9ydCBvcwppbXBvcnQgcHN1dGlsCmltcG9ydCBzeXMKaW1wb3J0IHRpbWUKaW1wb3J0IHRocmVhZAppbXBvcnQgdHJhY2ViYWNrCgpmcm9tIGNvbGxlY3Rpb25zIGltcG9ydCBkZWZhdWx0ZGljdApmcm9tIHRocmVhZGluZyBpbXBvcnQgVGhyZWFkCgpmcm9tIHN5cyBpbXBvcnQgX2N1cnJlbnRfZnJhbWVzCgpsb2cgPSBsb2dnaW5nLmdldExvZ2dlcignbWVtcHJvZicpCgpPTkVfTUIgPSAxMDI0ICogMTAyNApPTkVfR0IgPSAxMDI0ICogT05FX01CCgoKY2xhc3MgUmVjdXJyaW5nVGltZXIoVGhyZWFkKToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCB0aWNrLCB0YXJnZXQsIGFyZ3M9Tm9uZSwga3dhcmdzPU5vbmUpOgogICAgICAgIGlmIGFyZ3MgaXMgTm9uZToKICAgICAgICAgICAgYXJncyA9ICgpCiAgICAgICAgaWYga3dhcmdzIGlzIE5vbmU6CiAgICAgICAgICAgIGt3YXJncyA9IHt9CgogICAgICAgIHNlbGYudGljayA9IHRpY2sKICAgICAgICBzZWxmLnRhcmdldCA9IHRhcmdldAogICAgICAgIHNlbGYuYXJncyA9IGFyZ3MKICAgICAgICBzZWxmLmt3YXJncyA9IGt3YXJncwogICAgICAgIHNlbGYuc3RvcHBlZCA9IEZhbHNlCgogICAgICAgIFRocmVhZC5fX2luaXRfXyhzZWxmKQoKICAgIGRlZiBydW4oc2VsZik6CiAgICAgICAgd2hpbGUgbm90IHNlbGYuc3RvcHBlZDoKICAgICAgICAgICAgc2VsZi50YXJnZXQoKnNlbGYuYXJncywgKipzZWxmLmt3YXJncykKICAgICAgICAgICAgdGltZS5zbGVlcChzZWxmLnRpY2spCgoKZGVmIGdldF90aHJlYWRfZnJhbWUodGhyZWFkX2lkKToKICAgIHJldHVybiBfY3VycmVudF9mcmFtZXMoKVt0aHJlYWRfaWRdCgoKZGVmIHdhdGNoX3RocmVhZChvdXRwdXQsIHRocmVzaG9sZD1PTkVfR0IsIHRpY2s9NS4wLCBhYm9ydF9vbl9oaXQ9RmFsc2UpOgogICAgdCA9IFJlY3VycmluZ1RpbWVyKAo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgMTAsIG1lbWNoZWNrLCBrd2FyZ3M9ewogICAgICAgICAgICAnb3V0cHV0Jzogb3V0cHV0LAogICAgICAgICAgICAndGhyZXNob2xkJzogdGhyZXNob2xkLAogICAgICAgICAgICAnYWJvcnRfb25faGl0JzogYWJvcnRfb25faGl0LAo8fGZpbV9lbmR8Pg==
bbc291dbca2c4a03d0081b1965195a1e964ca859-1
bbc291dbca2c4a03d0081b1965195a1e964ca859
PHxmaW1fcHJlZml4fD4KaW1wb3J0IG9zCmltcG9ydCB0cmFjZWJhY2sKZnJvbSBpbnNwZWN0IGltcG9ydCBnZXRmcmFtZWluZm8sIHN0YWNrCgpmcm9tIHRvbmd1ZXR3aXN0ZXIubGliLnN0cmVhbSBpbXBvcnQgQnl0ZUJsb2NrSU8KCgpkZWYgZ3JvdXBlcih3cywgc2l6ZSwgbmV3bGluZT1GYWxzZSwgaW5kZW50PTEpOgogICAgaGV4X3N0ciA9ICcnLmpvaW4oZid7b3JkKGIpOjAyeH0nIGZvciBiIGluIHdzLmRlY29kZShCeXRlQmxvY2tJTy5FTkNPRElORykpCiAgICBuZXdsaW5lX3N0ciA9ICdcbicgaWYgbmV3bGluZSBlbHNlICcnCiAgICBpbmRlbnRfc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Xk9J19zb3VyY2UnLCB0b3BfY291bnQ9Tm9uZSk6CgogICAgICAgIGlmIHRvcF9jb3VudCBpcyBOb25lOgogICAgICAgICAgICB0b3BfY291bnQgPSBTVU1NQVJZX1RPUF9DT1VOVF9ERUZBVUxUCgogICAgICAgIHN1bW1hcnlfZGF0YSA9IHt9CgogICAgICAgIGZvciByZWNvcmQgaW4gZGF0YToKICAgICAgICAgICAgaWYgdHlwZShyZWNvcmQpIGlzIGRpY3QgYW5kIGRhdGFfa2V5IGluIHJlY29yZC5rZXlzKCk6CiAgICAgICAgICAgICAgICBmbGF0X3JlY29yZCA9IHNlbGYuZmxhdHRlbl9kaWN0KHJlY29yZFsnX3NvdXJjZSddKQogICAgICAgICAgICAgICAgZm9yIHJlY29yZF9rZXksIHJlY29yZF92YWx1ZSBpbiBmbGF0X3JlY29yZC5pdGVtcygpOgogICAgICAgICAgICAgICAgICAgIGlmIHR5cGUocmVjb3JkX3ZhbHVlKSBub3QgaW4gKHN0ciwgaW50LCBmbG9hdCk6CiAgICAgICAgICAgICAgICAgICAgICAgIHJlY29yZF92YWx1ZSA9IHN0cihyZWNvcmRfdmFsdWUpCiAgICAgICAgICAgICAgICAgICAgaWYgcmVjb3JkX2tleSBub3QgaW4gc3VtbWFyeV9kYXRhLmtleXMoKToKICAgICAgICAgICAgICAgICAgICAgICAgc3VtbWFyeV9kYXRhW3JlY29yZF9rZXldID0ge30KICAgICAgICAgICAgICAgICAgICBpZiByZWNvcmRfdmFsdWUgbm90IGluIHN1bW1hcnlfZGF0YVtyZWNvcmRfa2V5XS5rZXlzKCk6CiAgICAgICAgICAgICAgICAgICAgICAgIHN1bW1hcnlfZGF0YVtyZWNvcmRfa2V5XVtyZWNvcmRfdmFsdWVdID0gMQogICAgICAgICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAgICAgICAgIHN1bW1hcnlfZGF0YVtyZWNvcmRfa2V5XVtyZWNvcmRfdmFsdWVdICs9IDEKCiAgICAgICAgc3Vt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fX2luaXRfXyhzZWxmKToKICAgICAgICBwYXNzCgogICAgZGVmIHN1bW1hcnkoc2VsZiwgZGF0YSwgZGF0YV9rZXk9J19zb3VyY2UnLCB0b3BfY291bnQ9Tm9uZSk6CgogICAgICAgIGlmIHRvcF9jb3VudCBpcyBOb25lOgogICAgICAgICAgICB0b3BfY291bnQgPSBTVU1NQVJZX1RPUF9DT1VOVF9ERUZBVUxUCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KCiAgICAgICAgc3VtbWFyeV9kYXRhID0ge30KCiAgICAgICAgZm9yIHJlY29yZCBpbiBkYXRhOgo8fGZpbV9lbmR8Pg==
3cad98309850dcbb40f7004c47e9260f9c71e90a-3
3cad98309850dcbb40f7004c47e9260f9c71e90a
PHxmaW1fcHJlZml4fD4KCmZyb20gY29sbGVjdGlvbnMuYWJjIGltcG9ydCBNdXRhYmxlTWFwcGluZwoKZnJvbSBlbGFzdGljc2VhcmNoX2tpYmFuYV9jbGkgaW1wb3J0IF9fdGl0bGVfXyBhcyBOQU1FCmZyb20gZWxhc3RpY3NlYXJjaF9raWJhbmFfY2xpLnV0aWxzLmxvZ2dlciBpbXBvcnQgTG9nZ2VyCmZyb20gZWxhc3RpY3NlYXJjaF9raWJhbmFfY2xpIGltcG9ydCBfX3N1bW1hcnlfdG9wX2NvdW50X2RlZmF1bHRfXyBhcyBTVU1NQVJZX1RPUF9DT1VOVF9ERUZBVUxUCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KCgpsb2dnZXIgPSBMb2dnZXIobmFtZT1OQU1FKS5sb2dnaW5nCgo8fGZpbV9lbmR8Pg==
a55765daf30c00a5451540718b983f3a43ea3751-1
a55765daf30c00a5451540718b983f3a43ea3751
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGpzb24KaW1wb3J0IGxvZ2dpbmcKaW1wb3J0IG9zCmltcG9ydCBzb2NrZXRzZXJ2ZXIKaW1wb3J0IHN0cnVjdApmcm9tIG11bHRpcH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ICAgICAgICAgICBjb2RlID0gaW50KF9nZXRfYXR0cihlLCAnY29kZScsIGNvZGUpKQoKICAgICAgICBzZWxmLl93cml0ZV9yZXNwb25zZShqc29uLmR1bXBzKHsKICAgICAgICAgICAgJ2Vycm9ycyc6IFt7CiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsCiAgICAgICAgICAgICAgICAnZGVzY3JpcHRpb24nOiBtZXNzYWdlCiAgICAgICAgICAgIH1dLAogICAgICAgICAgICAncGF5bG9hZCc6IE5vbmUKICAgICAgICB9KSkKCiAgICBkZWYgX2dldF9yZXF1ZXN0KHNlbGYpIC0+IFVuaW9uW3N0ciwgTm9uZV06CiAgICAgICAgcmVxdWVzdF9sZW4gPSBzZWxmLl9wYXlsb2FkX2xlbigpCiAgICAgICAgaWYgbm90IHJlcXVlc3RfbGVuOgogICAgICAgICAgICByZXR1cm4gTm9uZQogICAgICAgIHJlcXVlc3QgPSBzZWxmLl9yZWFkX3BheWxvYWQocmVxdWVzdF9sZW4pCgogICAgICAgIGlmIHJlcXVlc3RfbGVuIDwgbGVuKHJlcXVlc3QpOgogICAgICAgICAgICByYWlzZSBFT0ZFcnJvcignaW5jb21wbGV0ZSBwYWNrYWdlJykKCiAgICAgICAgcmV0dXJuIGpzb24ubG9hZHMocmVxdWVzdCkKCiAgICBkZWYgX2ludGVybmFsX2hhbmRsZShzZWxmKSAtPiBzdHI6CiAgICAgICAgcmVxdWVzdF9vYmplY3QgPSBzZWxmLl9nZXRfcmVxdWVzdCgpCiAgICAgICAgaWYgcmVxdWVzdF9vYmplY3QgaXMgTm9uZToKICAgICAgICAgICAgcmV0dXJuIEZhbHNlCgogICAgICAgIHBheWxvYWQgPSByZXF1ZXN0X29iamVjdFsncGF5bG9hZCddCiAgICAgICAgc2VydmljZSA9IHJlcXVlc3Rfb2JqZWN0WydzZXJ2aWNlJ10KCiAgICAgICAgaWYgc2VydmljZSBub3QgaW4gcmVnaXN0ZXJlZF9zZXJ2aWNlczoKICAgICAgIC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VsZikgLT4gaW50OgogICAgICAgIHJhaXNlIE5vdEltcGxlbWVudGVkRXJyb3IoJ3JlcXVlc3RfbGVuIG5vdCBpbXBsZW1lbnRlZCcpCgogICAgZGVmIF93cml0ZV9yZXNwb25zZShzZWxmLCByZXNwb25zZTogc3RyKToKICAgICAgICByYWlzZSBOb3RJbXBsZW1lbnRlZEVycm9yKCd3cml0ZV9yZXNwb25zZSBub3QgaW1wbGVtZW50ZWQnKQoKICAgIGRlZiBfZ2VuZXJpY19lcnJvcihzZWxmLCBlKToKICAgICAgICByZXR1cm4gInt9OiBhbiBlcnJvciBoYXMgb2N1cnJlZCIuZm9ybWF0KHR5cGUoZSkuX19uYW1lX18pCgogICAgZGVmIF9oYW5kbGVfZXJyb3Ioc2VsZiwgZSk6CiAgICAgICAgbG9nZ2luZy5leGNlcHRpb24oZSkKCiAgICAgICAgbWVzc2FnZSA9IE5vbmUKICAgICAgICBjb2RlID0gRXJyb3JDb2Rlcy5VTktOT1dOX0VSUk9SCgogICAgICAgIG1lc3NhZ2UgPSBzdHIoX2dldF9hdHRyKGUsICdtZXNzYWdlJywgc2VsZi5fZ2VuZXJpY19lcnJvcihlKSkpCiAgICAgICAgaWYgaXNpbnN0YW5jZShlLCBFT0ZFcnJvcik6CiAgICAgICAgICAgIGNvZGUgPSBFcnJvckNvZGVzLklOVkFMSURfQ0hFQ0tTVU0KICAgICAgICBlbHNlOgogICAgICAgICAgICBjb2RlID0gaW50KF9nZXRfYXR0cihlLCAnY29kZScsIGNvZGUpKQoKICAgICAgICBzZWxmLl93cml0ZV9yZXNwb25zZShqc29uLmR1bXBzKHsKICAgICAgICAgICAgJ2Vycm9ycyc6IFt7CiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsCiAgICAgICAgICAgICAgICAnZGVzY3JpcHRpb24nOiBtZXNzYWdlCiAgICAgICAgICAgIH1dLAogICAgICAgICAgICAncGF5bG9hZCc6IE5vbmUKICAgICAgICB9KSkKCiAgICBkZWYgX2dldF9y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uZXJpY19lcnJvcihzZWxmLCBlKToKICAgICAgICByZXR1cm4gInt9OiBhbiBlcnJvciBoYXMgb2N1cnJlZCIuZm9ybWF0KHR5cGUoZSkuX19uYW1lX18pCgogICAgZGVmIF9oYW5kbGVfZXJyb3Ioc2VsZiwgZSk6CiAgICAgICAgbG9nZ2luZy5leGNlcHRpb24oZSkKCiAgICAgICAgbWVzc2FnZSA9IE5vbmUKICAgICAgICBjb2RlID0gRXJyb3JDb2Rlcy5VTktOT1dOX0VSUk9SCgogICAgICAgIG1lc3NhZ2UgPSBzdHIoX2dldF9hdHRyKGUsICdtZXNzYWdlJywgc2VsZi5fZ2VuZXJpY19lcnJvcihlKSkpCiAgICAgICAgaWYgaXNpbnN0YW5jZShlLCBFT0ZFcnJvcik6CiAgICAgICAgICAgIGNvZGUgPSBFcnJvckNvZGVzLklOVkFMSURfQ0hFQ0tTVU0KICAgICAgICBlbHNlOgogICAgICAgICAgICBjb2RlID0gaW50KF9nZXRfYXR0cihlLCAnY29kZScsIGNvZGUpKQoKICAgICAgICBzZWxmLl93cml0ZV9yZXNwb25zZShqc29uLmR1bXBzKHsKICAgICAgICAgICAgJ2Vycm9ycyc6IFt7CiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsCiAgICAgICAgICAgICAgICAnZGVzY3JpcHRpb24nOiBtZXNzYWdlCiAgICAgICAgICAgIH1dLAogICAgICAgICAgICAncGF5bG9hZCc6IE5vbmUKICAgICAgICB9KSkKCiAgICBkZWYgX2dldF9yZXF1ZXN0KHNlbGYpIC0+IFVuaW9uW3N0ciwgTm9uZV06CiAgICAgICAgcmVxdWVzdF9sZW4gPSBzZWxmLl9wYXlsb2FkX2xlbigpCiAgICAgICAgaWYgbm90IHJlcXVlc3RfbGVuOgogICAgICAgICAgICByZXR1cm4gTm9uZQogICAgICAgIHJlcXVlc3QgPSBzZWxmLl9yZWFkX3BheWxvYWQocmVxdWVzdF9sZW4pCgogICAgICAgIGlmIHJlcXVlc3RfbGVuIDw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BzdHIpOgogICAgICAgIHNlbGYucmVxdWVzdC5zZW5kYWxsKHN0cnVjdC5wYWNrKCJJIiwgbGVuKHJlc3BvbnNlKSkgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVzKHJlc3BvbnNlLCBlbmNvZGluZz0ndXRmOCcpKQoKCmNsYXNzIFVEUFNlcnZpY2VIYW5kbGVyKEdlbmVyaWNCYXNlSGFuZGxlciwgc29ja2V0c2VydmVyLkRhdGFncmFtUmVxdWVzdEhhbmRsZXIpOgogICAgZGVmIF9yZWFkX3BheWxvYWQoc2VsZiwgcmVxdWVzdF9sZW46IGludCk6CiAgICAgICAgcmV0dXJuIHNlbGYucmZpbGUucmVhZChyZXF1ZXN0X2xlbikKCiAgICBkZWYgX3BheWxvYWRfbGVuKHNlbGYpIC0+IHN0cjoKICAgICAgICByZXNwb25zZSA9IHNlbGYucmZpbGUucmVhZCg0KQogICAgICAgIGlmIGxlbihyZXNwb25zZSkgPT0gMDoKICAgICAgICAgICAgcmV0dXJuIDAKICAgICAgICBpZiBsZW4ocmVzcG9uc2UpIDwgNDoKICAgICAgICAgICAgcmFpc2UgRU9GRXJyb3IKICAgICAgICByZXR1cm4gc3RydWN0LnVucGFjaygiSSIsIHJlc3BvbnNlKVswXQoKICAgIGRlZiBfd3JpdGVfcmVzcG9uc2Uoc2VsZiwgcmVzcG9uc2U6IHN0cik6CiAgICAgICAgc2VsZi53ZmlsZS53cml0ZShzdHJ1Y3QucGFjaygiSSIsIGxlbihyZXNwb25zZSkpICsKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgogICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZXMocmVzcG9uc2UsIGVuY29kaW5nPSd1dGY4JykpCgoKPHxmaW1fZW5kfD4=
a55765daf30c00a5451540718b983f3a43ea3751-5
a55765daf30c00a5451540718b983f3a43ea3751
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGpzb24KaW1wb3J0IGxvZ2dpbmcKaW1wb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1NISVRfQk9PTCc6IEZhbHNlLAp9CgpQRVJGRUNUX0VOViA9IHsKICAgICdGVUNLX1NUUic6ICdhJywKICAgICdTVUNLX1NUUic6ICdiJywKICAgICdEQU1OX1NUUic6ICdjJywKICAgICdTSElUX1NUUic6ICdkJywKCiAgICAnRlVDS19JTlQnOiAnMTEnLAogICAgJ1NVQ0tfSU5UJzogJzIyJywKICAgICdEQU1OX0lOVCc6ICczMycsCiAgICAnU0hJVF9JTlQnOiAnNDQnLAoKICAgICdGVUNLX0JPT0wnOiAnKycsCiAgICAnU1VDS19CT09MJzogJy0nLAogICAgJ0RBTU5fQk9PTCc6ICcqJywKICAgICdTSElUX0JPT0wnOiAnLycsCn0KCgpjbGFzcyBUZXN0RW52RmlsdGVyKHVuaXR0ZXN0LlRlc3RDYXNlKToKCiAgICBkZWYgdGVzdF9ub3JtYWwoc2VsZik6CiAgICAgICAgIiIi5q2j5bi45oOF5Ya1IiIiCgogICAgICAgIGZpbGxlciA9IEVudkZpbGxlcihlbnY9UEVSRkVDVF9FTlYpCiAgICAgICAgY29uZmlnID0gREVGQVVMVF9DT05GSUcuY29weSgpCiAgICAgICAgZmlsbGVyLmZpbGwoY29uZmlnLCBDT05GSUdfU0NIRU1BKQo8fGZpbV9ob2xlfD4KICAgICAgICAgICAgJ0RBTU5fU1RSJzogJ2MnLAogICAgICAgICAgICAnU0hJVF9TVFInOiAnZCcsCgogICAgICAgICAgICAnRlVDS19JTlQnOiAxMSwKICAgICAgICAgICAgJ1NVQ0tfSU5UJzogMjIsCiAgICAgICAgICAgICdEQU1OX0lOVCc6IDMzLAogICAgICAgICAgICAnU0hJVF9JTlQnOiA0NCwKCiAgICAgICAgICAgICdGVUNLX0JPT0wnOiBUcnVlLAogICAgICAgICAgICAnU1VDS19CT09MJzogVHJ1ZSwKICAgICAgICAgICAgJ0RBTU5fQk9PTCc6IFRydWUsCiAgICAgICAgICAgICdTSElUX0JPT0wnOiBUcnVlLAogICAgICAgIH0pCgogICAgZGVmIHRlc3RfaW52YWxpZF92YWx1ZXMoc2VsZik6CiAgICAgICAgIiIiCiAgICAgICAgLSDnqbrlrZfnrKbkuLLvvIjkuI3lkKvnqbrnmb3nrKbvvInkuI3opobnm5bljp/lgLwKICAgICAgICAtIOexu+Wei+mUmeivr+S4jeimhuebluWOn+WAvAogICAgICAgIC0g5pyq5aGr5YaZ5LiN6KaG55uW5Y6f5YC8CiAgICAgICAgIiIiCiAgICAgICAgZmlsbGVyID0gRW52RmlsbGVyKGVudj17CiAgICAgICAgICAgICdGVUNLX1NUUic6ICdhJywKICAgICAgICAgICAgJ1NVQ0tfU1RSJzogJycsCgogICAgICAgICAgICAnRlVDS19JTlQnOiAnMjMzJywKICAgICAgICAgICAgJ1NVQ0tfSU5UJzogJ2FiYycsCiAgICAgICAgICAgICdEQU1OX0lOVCc6ICcnLAoKICAgICAgICAgICAgJ0ZVQ0tfQk9PTCc6ICcxMjMnLAogICAgICAgICAgICAnU1VDS19CT09MJzogJyonLAogICAgICAgICAgICAnREFNTl9CT09MJzogJycsCiAgICAgICAgfSkKICAgICAgICBjb25maWcgPSBERUZBVUxUX0NPTkZJRy5jb3B5KCkKICAgICAgICBmaWxsZXIuZmlsbChjb25maWcsIENPTkZJR19TQ0hFTUEpCgogICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwoY29uZmlnLCB7CiAgICAgICAgICAgICdGVUNLX1NUUic6ICdhJywKICAgICAgICAgICAgJ1NVQ0tfU1RSJzogJ3N1Y2snLAogICAgICAgICAgICAnREFNTl9TVFInOiAnZGFtbicsCiAgICAgICAgICAgICdTSElUX1NUUic6IE5vbmUsCgogICAgICAgICAgICAnRlVDS19JTlQnOiAyMzMsCiAgICAgICAgICAgICdTVUNLX0lOVCc6IDIsCiAgICAgICAgICAgICdEQU1OX0lOVCc6IDMsCiAgICAgICAgICAgICdTSElUX0lOVCc6IDQsCgogICAgICAgICAgICAnRlVDS19CT09MJzogVHJ1ZSwKICAgICAgICAgICAgJ1NVQ0tfQk9PTCc6IFRydWUsCiAgICAgICAgICAgICdEQU1OX0JPT0wnOiBGYWxzZSwKICAgICAgICAgICAgJ1NISVRfQk9PTCc6IEZhbHNlLAogICAgICAgIH0pCgogICAgZGVmIHRlc3Rfc3RyYW5nZV9zY2hlbWEoc2VsZik6CiAgICAgICAgIiIiCiAgICAgICAg56m6IHNjaGVtYSDkuI3mlLnlj5ggY29uZmlnCiAgICAgICAgc2NoZW1hIOS4jiBjb25maWcg5a6M5YWo5LiN5LiA6Ie077yM5LiN5pS55Y+YIGNvbmZpZwogICAgICAgICIiIgoKICAgICAgICBmaWxsZXIgPSBFbnZGaWxsZXIoZW52PVBFUkZFQ1RfRU5WKQogICAgICAgIGNvbmZpZyA9IERFRkFVTFRfQ09ORklHLmNvcHkoKQoKICAgICAgICBmaWxsZXIuZmlsbChjb25maWcsIHt9KQogICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwoY29uZmlnLCBERUZBVUxUX0NPTkZJRykKCiAgICAgICAgZmlsbGVyLmZpbGwoY29uZmlnLCB7CiAgICAgICAgICAgICdTVFJBTkdFX1NDSEVNQSc6IENvbmZpZ1NjaGVtYUl0ZW0oCiAgICAgICAgICAgICAgICBkZXNjcmlwdGlvbj0nc3RyYW5nZSBzY2hlbWEnLAogICAgICAgICAgICAgICAgZm9yX3Nob3J0PSdzcycsCiAgICAgICAgICAgICAgICBkZWZhdWx0PU5vbmUsCiAgICAgICAgICAgICAgICB0eXBlPWludCwKICAgICAgICAgICAgKSwKICAgICAgICB9KQogICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwoY29uZmlnLCBERUZBVUxUX0NPTkZJRykKPHxmaW1fc3VmZml4fD4KCiAgICAgICAgc2VsZi5hc3NlcnRFcXVhbChjb25maWcsIHsKICAgICAgICAgICAgJ0ZVQ0tfU1RSJzogJ2EnLAogICAgICAgICAgICAnU1VDS19TVFInOiAnYicsCjx8ZmltX2VuZHw+
af2cd24ed6a7bd659ef8d93668c885dcfd450f7e-1
af2cd24ed6a7bd659ef8d93668c885dcfd450f7e
PHxmaW1fcHJlZml4fD4KZnJvbSBudW1weSBpbXBvcnQgaW50ZXJwCmZyb20gc2V0dGluZ3MgaW1wb3J0ICoKaW1wb3J0IHJhbmRvbQoKCjx8ZmltX2hvbGV8PgogICAgICAgICJsaW1lIjogIjAwRkYwMCIsCiAgICAgICAgImJsdWUiOiAiMDAwMEZGIiwKICAgICAgICAieWVsbG93IjogIkZGRkYwMCIsCiAgICAgICAgImN5YW4iOiAiMDBGRkZGIiwKICAgICAgICAibWFnZW50YSI6ICJGRjAwRkYiLAogICAgICAgICJzaWx2ZXIiOiAiQzBDMEMwIiwKICAgICAgICAiZ3JheSI6ICI4MDgwODAiLAogICAgICAgICJtYXJvb24iOiAiODAwMDAwIiwKICAgICAgICAib2xpdmUiOiAiODA4MDAwIiwKICAgICAgICAiZ3JlZW4iOiAiMDA4MDAwIiwKICAgICAgICAicHVycGxlIjogIjgwMDA4MCIsCiAgICAgICAgInRlYWwiOiAiMDA4MDgwIiwKICAgICAgICAibmF2eSI6ICIwMDAwODAiLAogICAgfQoKICAgIGRlZiBfX2luaXRfXyhzZWxmLCByZWQsIGdyZWVuLCBibHVlKToKICAgICAgICBzZWxmLnJlZCA9IHJlZAogICAgICAgIHNlbGYuZ3JlZW4gPSBncmVlbgogICAgICAgIHNlbGYuYmx1ZSA9IGJsdWUKICAgICAgICBzZWxmLnB1bHNpbmdfZGlyZWN0aW9uID0gNQoKICAgIEBjbGFzc21ldGhvZAogICAgZGVmIHJnYihjbHMsIHIsIGcsIGIpOgogICAgICAgIHJldHVybiBjbHMociwgZywgYikKCiAgICBAY2xhc3NtZXRob2QKICAgIGRlZiBoZXgoY2xzLCBoZXhfY29sb3IpOgogICAgICAgIHIgPSBpbnQoaGV4X2NvbG9yWzA6Ml0sIDE2KQogICAgICAgIGcgPSBpbnQoaGV4X2NvbG9yWzI6NF0sIDE2KQogICAgICAgIGIgPSBpbnQoaGV4X2NvbG9yWzQ6Nl0sIDE2KQogICAgICAgIHJldHVybiBjbHMociwgZywgYikKCiAgICBAY2xhc3NtZXRob2QKICAgIGRlZiBuYW1lKGNscywgbmFtZSk6CiAgICAgICAgaWYgbmFtZSBpbiBDb2xvci5kZWZhdWx0X2NvbG9yczoKICAgICAgICAgICAgcmV0dXJuIGNscy5oZXgoQ29sb3IuZGVmYXVsdF9jb2xvcnNbbmFtZV0pCiAgICAgICAgZWxzZToKICAgICAgICAgICAgcmV0dXJuIGNscy5oZXgoIkZGRkZGRiIpCgogICAgQGNsYXNzbWV0aG9kCiAgICBkZWYgcmFuZG9tKGNscyk6CiAgICAgICAgcmV0dXJuIGNscy5yZ2IoCiAgICAgICAgICAgIHJhbmRvbS5yYW5kaW50KDAsIDI1NSksIHJhbmRvbS5yYW5kaW50KDAsIDI1NSksIHJhbmRvbS5yYW5kaW50KDAsIDI1NSkKICAgICAgICApCgogICAgZGVmIGZhZGUoCiAgICAgICAgc2VsZiwKICAgICAgICBmYWRlX3NwZWVkLAogICAgKToKICAgICAgICBzZWxmLnJlZCA9ICgKICAgICAgICAgICAgaW50KHNlbGYucmVkICogZmFkZV9zcGVlZCkKICAgICAgICAgICAgaWYgc2VsZi5yZWQgPiBzZWxmLmJhY2tncm91bmRfcmVkCiAgICAgICAgICAgIGVsc2Ugc2VsZi5iYWNrZ3JvdW5kX3JlZAogICAgICAgICkKICAgICAgICBzZWxmLmdyZWVuID0gKAogICAgICAgICAgICBpbnQoc2VsZi5ncmVlbiAqIGZhZGVfc3BlZWQpCiAgICAgICAgICAgIGlmIHNlbGYuZ3JlZW4gPiBzZWxmLmJhY2tncm91bmRfZ3JlZW4KICAgICAgICAgICAgZWxzZSBzZWxmLmJhY2tncm91bmRfZ3JlZW4KICAgICAgICApCiAgICAgICAgc2VsZi5ibHVlID0gKAogICAgICAgICAgICBpbnQoc2VsZi5ibHVlICogZmFkZV9zcGVlZCkKICAgICAgICAgICAgaWYgc2VsZi5ibHVlID4gc2VsZi5iYWNrZ3JvdW5kX2J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gICAgICJtYXJvb24iOiAiODAwMDAwIiwKICAgICAgICAib2xpdmUiOiAiODA4MDAwIiwKICAgICAgICAiZ3JlZW4iOiAiMDA4MDAwIiwKICAgICAgICAicHVycGxlIjogIjgwMDA4MCIsCiAgICAgICAgInRlYWwiOiAiMDA4MDgwIiwKICAgICAgICAibmF2eSI6ICIwMDAwODAiLAogICAgfQoKICAgIGRlZiBfX2luaXRfXyhzZWxmLCByZWQsIGdyZWVuLCBibHVlKToKICAgICAgICBzZWxmLnJlZCA9IHJlZAogICAgICAgIHNlbGYuZ3JlZW4gPSBncmVlbgogICAgICAgIHNlbGYuYmx1ZSA9IGJsdWUKICAgICAgICBzZWxmLnB1bHNpbmdfZGlyZWN0aW9uID0gNQoKICAgIEBjbGFzc21ldGhvZAogICAgZGVmIHJnYihjbHMsIHIsIGcsIGIpOgogICAgICAgIHJldHVybiBjbHMociwgZywgYikKCiAgICBAY2xhc3NtZXRob2QKICAgIGRlZiBoZXgoY2xzLCBoZXhfY29sb3IpOgogICAgICAgIHIgPSBpbnQoaGV4X2NvbG9yWzA6Ml0sIDE2KQogICAgICAgIGcgPSBpbnQoaGV4X2NvbG9yWzI6NF0sIDE2KQogICAgICAgIGIgPSBpbnQoaGV4X2NvbG9yWzQ6Nl0sIDE2KQogICAgICAgIHJldHVybiBjbHMociwgZywgYikKCiAgICBAY2xhc3NtZXRob2QKICAgIGRlZiBuYW1lKGNscywgbmFtZSk6CiAgICAgICAgaWYgbmFtZSBpbiBDb2xvci5kZWZhdWx0X2NvbG9yczoKICAgICAgICAgICAgcmV0dXJuIGNscy5oZXgoQ29sb3IuZGVmYXVsdF9jb2xvcnNbbmFtZV0pCiAgICAgICAgZWxzZToKICAgICAgICAgICAgcmV0dXJuIGNscy5oZXgoIkZGRkZGRiIpCgogICAgQGNsYXNzbWV0aG9kCiAgICBkZWYgcmFuZG9tKGNscyk6CiAgICAgICAgcmV0dXJuIGNscy5yZ2IoCiAgICAgICAgICAgIHJhbmRvbS5yYW5kaW50KDAsIDI1NSksIHJhbmRvbS5yYW5kaW50KDAsIDI1NSksIHJhbmRvbS5yYW5kaW50KDAsIDI1NSkKICAgICAgICApCgogICAgZGVmIGZhZGUoCiAgICAgICAgc2VsZiwKICAgICAgICBmYWRlX3NwZWVkLAogICAgKToKICAgICAgICBzZWxmLnJlZCA9ICgKICAgICAgICAgICAgaW50KHNlbGYucmVkICogZmFkZV9zcGVlZCkKICAgICAgICAgICAgaWYgc2VsZi5yZWQgPiBzZWxmLmJhY2tncm91bmRfcmVkCiAgICAgICAgICAgIGVsc2Ugc2VsZi5iYWNrZ3JvdW5kX3JlZAogICAgICAgICkKICAgICAgICBzZWxmLmdyZWVuID0gKAogICAgICAgICAgICBpbnQoc2VsZi5ncmVlbiAqIGZhZGVfc3BlZWQpCiAgICAgICAgICAgIGlmIHNlbGYuZ3JlZW4gPiBzZWxmLmJhY2tncm91bmRfZ3JlZW4KICAgICAgICAgICAgZWxzZSBzZWxmLmJhY2tncm91bmRfZ3JlZW4KICAgICAgICApCiAgICAgICAgc2VsZi5ibHVlID0gKAogICAgICAgICAgICBpbnQoc2VsZi5ibHVlICogZmFkZV9zcGVlZCkKICAgICAgICAgICAgaWYgc2VsZi5ibHVlID4gc2VsZi5iYWNrZ3JvdW5kX2JsdWUKICAgICAgICAgICAgZWxzZSBzZWxmLmJhY2tncm91bmRfYmx1ZQogICAgICAgICkKCiAgICBkZWYgYnJpZ2h0bmVzcyhzZWxmLCB2ZWxvY2l0eSk6CiAgICAgICAgc2VsZi5yZWQgPSBpbnQoaW50ZXJwKHZlbG9jaXR5LCBbMCwgMjU1XSwgWzAsIHNlbGYucmVkXSkpCiAgICAgICAgc2VsZi5ncmVlbiA9IGludChpbnRlcnAodmVsb2NpdHksIFswLCAyNTVdLCBbMCwgc2VsZi5ncmVlbl0pKQogICAgICAgIHNlbGYuYmx1ZSA9IGludChpbnRlcnAodmVsb2NpdHksIFswLCAyNTVdLCBbMCwgc2VsZi5ibHVlXSkpCiAgICA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8PCA4IHwgc2VsZi5ibHVlCgogICAgZGVmIF9fc3RyX18oc2VsZik6Cjx8ZmltX2VuZHw+
af2cd24ed6a7bd659ef8d93668c885dcfd450f7e-3
af2cd24ed6a7bd659ef8d93668c885dcfd450f7e
PHxmaW1fcHJlZml4fD4KZnJvbSBudW1weSBpbXBvcnQgaW50ZXJwCmZyb20gc2V0dGluZ3MgaW1wb3J0ICoKaW1wb3J0IHJhbmRvbQoKCmNsYXNzIENvbG9yOgogICAgZGVmYXVsdF9jb2xvcnMgPSB7CiAgICAgICAgIndoaXRlIjogIkZGRkZGRiIsCiAgICAgICAgInJlZCI6ICJGRjAwMDAiLAogICAgICAgICJsaW1lIjogIjAwRkYwMCIsCiAgICAgICAgImJsdWUiOiAiMDAwMEZGIiwKICAgICAgICAieWVsbG93IjogIkZGRkYwMCIsCiAgICAgICAgImN5YW4iOiAiMDBGRkZGIiwKICAgICAgICAibWFnZW50YSI6ICJGRjAwRkYiLAogICAgICAgICJzaWx2ZXIiOiAiQzBDMEMwIiwKICAgICAgICAiZ3JheSI6ICI4MDgwODAiLAogICAgICAgICJtYXJvb24iOiAiODAwMDAwIiwKICAgICAgICAib2xpdmUiOiAiODA4MDAwIiwKICAgICAgICAiZ3JlZW4iOiAiMDA4MDAwIiwKICAgICAgICAicHVycGxlIjogIjgwMDA4MCIsCiAgICAgICAgInRlYWwiOiAiMDA4MDgwIiwKICAgICAgICAibmF2eSI6ICIwMDAwODAiLAogICAgfQoKICAgIGRlZiBfX2luaXRfXyhzZWxmLCByZWQsIGdyZWVuLCBibHVlKToKICAgICAgICBzZWxmLnJlZCA9IHJlZAogICAgICAgIHNlbGYuZ3JlZW4gPSBncmVlbgogICAgICAgIHNlbGYuYmx1ZSA9IGJsdWUKICAgICAgICBzZWxmLnB1bHNpbmdfZGlyZWN0aW9uID0gNQoKICAgIEBjbGFzc21ldGhvZAogICAgZGVmIHJnYihjbHMsIHIsIGcsIGIpOgogICAgICAgIHJldHVybiBjbHMociwgZywgYikKCiAgICBAY2xhc3NtZXRob2QKICAgIGRlZiBoZXgoY2xzLCBoZXhfY29sb3IpOgogICAgICAgIHIgPSBpbnQoaGV4X2NvbG9yWzA6Ml0sIDE2KQogICAgICAgIGcgPSBpbnQoaGV4X2NvbG9yWzI6NF0sIDE2KQogICAgICAgIGIgPSBpbnQoaGV4X2NvbG9yWzQ6Nl0sIDE2KQogICAgICAgIHJldHVybiBjbHMociwgZywgYikKCiAgICBAY2xhc3NtZXRob2QKICAgIGRlZiBuYW1lKGNscywgbmFtZSk6CiAgICAgICAgaWYgbmFtZSBpbiBDb2xvci5kZWZhdWx0X2NvbG9yczoKICAgICAgICAgICAgcmV0dXJuIGNscy5oZXgoQ29sb3IuZGVmYXVsdF9jb2xvcnNbbmFtZV0pCiAgICAgICAgZWxzZToKICAgICAgICAgICAgcmV0dXJuIGNscy5oZXgoIkZGRkZGRiIpCgogICAgQGNsYXNzbWV0aG9kCiAgICBkZWYgcmFuZG9tKGNscyk6CiAgICAgICAgcmV0dXJuIGNscy5yZ2IoCiAgICAgICAgICAgIHJhbmRvbS5yYW5kaW50KDAsIDI1NSksIHJhbmRvbS5yYW5kaW50KDAsIDI1NSksIHJhbmRvbS5yYW5kaW50KDAsIDI1NSkKICAgICAgICApCgogICAgZGVmIGZhZGUoCiAgICAgICAgc2VsZiwKICAgICAgICBmYWRlX3NwZWVkLAogICAgKToKICAgICAgICBzZWxmLnJlZCA9ICgKICAgICAgICAgICAgaW50KHNlbGYucmVkICogZmFkZV9zcGVlZCkKICAgICAgICAgICAgaWYgc2VsZi5yZWQgPiBzZWxmLmJhY2tncm91bmRfcmVkCiAgICAgICAgICAgIGVsc2Ugc2VsZi5iYWNrZ3JvdW5kX3JlZAogICAgICAgICkKICAgICAgICBzZWxmLmdyZWVuID0gKAogICAgICAgICAgICBpbnQoc2VsZi5ncmVlbiAqIGZhZGVfc3BlZWQpCiAgICAgICAgICAgIGlmIHNlbGYuZ3JlZW4gPiBzZWxmLmJhY2tncm91bm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RkZGIiwKICAgICAgICAibWFnZW50YSI6ICJGRjAwRkYiLAo8fGZpbV9ob2xlfD4KICAgICAgICAiZ3JlZW4iOiAiMDA4MDAwIiwKICAgICAgICAicHVycGxlIjogIjgwMDA4MCIsCiAgICAgICAgInRlYWwiOiAiMDA4MDgwIiwKICAgICAgICAibmF2eSI6ICIwMDAwODAiLAogICAgfQoKICAgIGRlZiBfX2luaXRfXyhzZWxmLCByZWQsIGdyZWVuLCBibHVlKToKICAgICAgICBzZWxmLnJlZCA9IHJlZAogICAgICAgIHNlbGYuZ3JlZW4gPSBncmVlbgogICAgICAgIHNlbGYuYmx1ZSA9IGJsdWUKICAgICAgICBzZWxmLnB1bHNpbmdfZGlyZWN0aW9uID0gNQoKICAgIEBjbGFzc21ldGhvZAogICAgZGVmIHJnYihjbHMsIHIsIGcsIGIpOgogICAgICAgIHJldHVybiBjbHMociwgZywgYikKCiAgICBAY2xhc3NtZXRob2QKICAgIGRlZiBoZXgoY2xzLCBoZXhfY29sb3IpOgogICAgICAgIHIgPSBpbnQoaGV4X2NvbG9yWzA6Ml0sIDE2KQogICAgICAgIGcgPSBpbnQoaGV4X2NvbG9yWzI6NF0sIDE2KQogICAgICAgIGIgPSBpbnQoaGV4X2NvbG9yWzQ6Nl0sIDE2KQogICAgICAgIHJldHVybiBjbHMociwgZywgYikKCiAgICBAY2xhc3NtZXRob2QKICAgIGRlZiBuYW1lKGNscywgbmFtZSk6CiAgICAgICAgaWYgbmFtZSBpbiBDb2xvci5kZWZhdWx0X2NvbG9yczoKICAgICAgICAgICAgcmV0dXJuIGNscy5oZXgoQ29sb3IuZGVmYXVsdF9jb2xvcnNbbmFtZV0pCiAgICAgICAgZWxzZToKICAgICAgICAgICAgcmV0dXJuIGNscy5oZXgoIkZGRkZGRiIpCgogICAgQGNsYXNzbWV0aG9kCiAgICBkZWYgcmFuZG9tKGNscyk6CiAgICAgICAgcmV0dXJuIGNscy5yZ2IoCiAgICAgICAgICAgIHJhbmRvbS5yYW5kaW50KDAsIDI1NSksIHJhbmRvbS5yYW5kaW50KDAsIDI1NSksIHJhbmRvbS5yYW5kaW50KDAsIDI1NSkKICAgICAgICApCgogICAgZGVmIGZhZGUoCiAgICAgICAgc2VsZiwKICAgICAgICBmYWRlX3NwZWVkLAogICAgKToKICAgICAgICBzZWxmLnJlZCA9ICgKICAgICAgICAgICAgaW50KHNlbGYucmVkICogZmFkZV9zcGVlZCkKICAgICAgICAgICAgaWYgc2VsZi5yZWQgPiBzZWxmLmJhY2tncm91bmRfcmVkCiAgICAgICAgICAgIGVsc2Ugc2VsZi5iYWNrZ3JvdW5kX3JlZAogICAgICAgICkKICAgICAgICBzZWxmLmdyZWVuID0gKAogICAgICAgICAgICBpbnQoc2VsZi5ncmVlbiAqIGZhZGVfc3BlZWQpCiAgICAgICAgICAgIGlmIHNlbGYuZ3JlZW4gPiBzZWxmLmJhY2tncm91bmRfZ3JlZW4KICAgICAgICAgICAgZWxzZSBzZWxmLmJhY2tncm91bmRfZ3JlZW4KICAgICAgICApCiAgICAgICAgc2VsZi5ibHVlID0gKAogICAgICAgICAgICBpbnQoc2VsZi5ibHVlICogZmFkZV9zcGVlZCkKICAgICAgICAgICAgaWYgc2VsZi5ibHVlID4gc2VsZi5iYWNrZ3JvdW5kX2JsdWUKICAgICAgICAgICAgZWxzZSBzZWxmLmJhY2tncm91bmRfYmx1ZQogICAgICAgICkKCiAgICBkZWYgYnJpZ2h0bmVzcyhzZWxmLCB2ZWxvY2l0eSk6CiAgICAgICAgc2VsZi5yZWQgPSBpbnQoaW50ZXJwKHZlbG9jaXR5LCBbMCwgMjU1XSwgWzAsIHNlbGYucmVkXSkpCiAgICAgICAgc2VsZi5ncmVlbiA9IGludChpbnRlcnAodmVsb2NpdHksIFswLCAyNTVdLCBbMCwgc2VsZi5ncmVlbl0pKQogICAgICAgIHNlbGYuYmx1ZSA9IGludChpbnRlcnAodmVsb2NpdHksIFswLCAyNTVdLCBbMCwgc2VsZi5ibHVlXSkpCiAgICAg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IHNlbGYuYmx1ZSkKPHxmaW1fc3VmZml4fD4KICAgICAgICAic2lsdmVyIjogIkMwQzBDMCIsCiAgICAgICAgImdyYXkiOiAiODA4MDgwIiwKICAgICAgICAibWFyb29uIjogIjgwMDAwMCIsCiAgICAgICAgIm9saXZlIjogIjgwODAwMCIsCjx8ZmltX2VuZHw+
bba3bc717efeeb092f7850bc53289bf7ba02cf02-1
bba3bc717efeeb092f7850bc53289bf7ba02cf02
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHVuaXR0ZXN0Cgpmcm9tIG1pbmluZy5jbWQgaW1wb3J0IENvbW1hbmQKZnJvbSBtaW5pbmcuY21kX2V4ZWN1dG9yIGltcG9ydCBCdWZmZXJDb21tYW5kT3V0cHV0Q29uc3VtZXIsIENvbW1hbmRFeGVjdXRvcgoKCmNsYXNzIENvbW1hbmRFeGVjdXRvclRlc3RDYXNlKHVuaXR0ZXN0LlRlc3RDYXNlKToKCiAgICB0ZXN0X2NvbW1hbmQgPSBDb21tYW5kKCdlY2hvJywgWydGb29CYXInXSkKCiAgICBkZWYgdGVzdF9leGVjdXRvcl9leGVjdXRlc19jb21tYW5kX2FuZF9yZWFkc19vdXRwdXQoc2VsZik6CiAgICAgICAgb3V0cHV0X2NvbnN1bWVyID0gQnVmZmVyQ29tbWFuZE91dHB1dENvbnN1bWVyKCkKICAgICAgICBleGVjdXRvciA9IENvbW1hbmRFeGVjdXRvcihvdXRwdXRfY29uc3VtZXIpCiAgICAgICAgZXhlY3V0b3IuZXhlY3V0ZShzZWxmLnRlc3RfY29tbWFuZCkKICAgICAgICBzZWxmLmFzc2VydEVxdWFsKFsnRm9vQmFyJ10sIG91dHB1dF9jb25zdW1lci5vdXRwdXRfbGluZXMpCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KCgppZiBfX25hbWVfXyA9PSAnX19tYWluX18nOgogICAgdW5pdHRlc3QubWFpbigpCjx8ZmltX2VuZHw+
bba3bc717efeeb092f7850bc53289bf7ba02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hbmRFeGVjdXRvcgoKCmNsYXNzIENvbW1hbmRFeGVjdXRvclRlc3RDYXNlKHVuaXR0ZXN0LlRlc3RDYXNlKToKCjx8ZmltX2hvbGV8PgogICAgICAgIGV4ZWN1dG9yID0gQ29tbWFuZEV4ZWN1dG9yKG91dHB1dF9jb25zdW1lcikKICAgICAgICBleGVjdXRvci5leGVjdXRlKHNlbGYudGVzdF9jb21tYW5kKQogICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwoWydGb29CYXInXSwgb3V0cHV0X2NvbnN1bWVyLm91dHB1dF9saW5lcykKCgppZiBfX25hbWVfXyA9PSAnX19tYWluX18nOgogICAgdW5pdHRlc3QubWFpbigpCjx8ZmltX3N1ZmZpeHw+CiAgICB0ZXN0X2NvbW1hbmQgPSBDb21tYW5kKCdlY2hvJywgWydGb29CYXInXSkKCiAgICBkZWYgdGVzdF9leGVjdXRvcl9leGVjdXRlc19jb21tYW5kX2FuZF9yZWFkc19vdXRwdXQoc2VsZik6CiAgICAgICAgb3V0cHV0X2NvbnN1bWVyID0gQnVmZmVyQ29tbWFuZE91dHB1dENvbnN1bWVyKCkKPHxmaW1fZW5kfD4=
59e20cb709dd56ce4ca5765b7ee4a651588527d5-1
59e20cb709dd56ce4ca5765b7ee4a651588527d5
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KIyEvdXNyL2Jpbi9lbnYgcHl0aG9uCgppbXBvcnQgcGFuZGFzIGFzIHBkCmZyb20gY2VyZWJlbGx1bV92YWx1ZV9tYXAgaW1wb3J0IENlcmViZWxsdW1WYWx1ZU1hcAo8fGZpbV9lbmR8Pg==
59e20cb709dd56ce4ca5765b7ee4a651588527d5-2
59e20cb709dd56ce4ca5765b7ee4a651588527d5
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9lbnYgcHl0aG9uCgppbXBvcnQgcGFuZGFzIGFzIHBkCmZyb20gY2VyZWJlbGx1bV92YWx1ZV9tYXA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eV9jb2RlID0gewogICAgMTogImV4YWN0IGNvbnZlcnNpb24iLAogICAgMjogImFwcHJveGltYXRlIGNvbnZlcnNpb24iLAogICAgMzogIk5vIENvbnZlcnNpb24gLyBFcnJvciIKICAgIH0KCiMgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4KIyBEaWN0aW9uYXJ5IENvbnRhaW5pbmcgQ29udmVyc2lvbiBGYWN0b3JzOgpjb252X2ZhY3RvciA9IHsKCiAgICAjIFN0YW5kYXJkIENvbnZlcnNpb25zCiAgICAoIlN0YW5kYXJkIENvbnZlcnNpb25zIiwgInN0ZCIpOgogICAgICAgIHsKICAgICAgICAgICAgInBwbSI6IHsgCiAgICAgICAgICAgICAgICAicHBiIjogICAgICggMSwgICAgICAgMTAwMC4wICAgICAgKSwKICAgICAgICAgICAgICAgICJwcHQiOiAgICAgKCAxLCAgICAxMDAwMDAwLjAgICAgICApLAogICAgICAgICAgICAgICAgInBwcSI6ICAgICAoIDEsIDEwMDAwMDAwMDAuMCAgICAgICksCiAgICAgICAgICAgICAgICAiZy9nIjogICAgICggMSwgICAgICAgICAgIC4wMDAwMDEgKQogICAgICAgICAgICB9LAogICAgICAgICAgICAiQnEva2ciOiB7CiAgICAgICAgICAgICAgICAibUJxL2tnIiA6ICggMSwgICAgICAgMTAwMC4wICAgICAgKSwKICAgICAgICAgICAgICAgICJtdUJxL2tnIjogKCAxLCAgICAxMDAwMDAwLjAgICAgICApLAogICAgICAgICAgICAgICAgInVCcS9rZyIgOiAoIDEsICAgIDEwMDAwMDAuMCAgICAgICksCiAgICAgICAgICAgICAgICAiQnEvZyIgICA6ICggMSwgICAgICAgICAgMC4wMDEgICAgKSwKICAgICAgICAgICAgICAgICIvZyIgICAgIDogKCAxLCAgICAgICAgICAwLjAwMSAgICApLAogICAgICAgICAgICAgICAgIm11QnEvZyIgOiAoIDEsICAgICAgIDEwMDAuMCAgICAgICksCiAgICAgICAgICAgICAgICAidUJxL2ciICA6ICggMSwgICAgICAgMTAwMC4wICAgICAgKSwKICAgICAgICAgICAgICAgICJuQnEva2ciIDogKCAxLCAxMDAwMDAwMDAwLjAgICAgICApCiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICMgVXJhbml1bSAyMzggRmFjdG9ycwogICAgKCJVLTIzOCIsICJVMjM4IiwgIjIzOFUiLCAiMjM4LVUiKToKICAgICAgICB7CiAgICAgICAgInBwbSI6IHsiQnEva2ciOiAoMSwgMTIuNDM2Nil9CiAgICAgICAgfSwKCiAgICAjIFRob3JpdW0gMjMyIEZhY3RvcnMKICAgICgiVGgtMjMyIiwgIlRoMjMyIiwgIjIzMlRoIiwgIjIzMi1UaCIpOgogICAgICAgIHsKICAgICAgICAicHBtIjogeyJCcS9rZyI6ICgxLCA0LjA3MTkpfQogICAgICAgIH0sCgogICAgIyBQb3Rhc3NpdW0gNDAgRmFjdG9ycwogICAgKCJLLTQwIiwgIks0MCIsICI0MEsiLCAiNDAtSyIpOgogICAgICAgIHsKICAgICAgICAicHBtIjogeyJCcS9rZyI6ICgxLCAyNjUuMjQxNil9CiAgICAgICAgfQoKICAgICMgQXJjaGV0eXBlOgogICAgIyAgICgiSXNvdG9wZU5hbWUxIiwgIklzb3RvcGVOYW1lMiIpIDoKICAgICMgICAgICAgewogICAgIyAgICAgICAic3JjX3VuaXQiICA6IHsgImRlc3RfdW5pdCIgOiAocXVhbGl0eV9jb2RlLCBDb252ZXJzaW9uIEZhY3RvciksCiAgICAjICAgICAgICAgICAgICAgICAgICAgICJkZXN0X3VuaXQyIiA6IChxdWFsaXR5X2NvZGUsIENvbnZlcnNpb24gRmFjdG9yKX0sCiAgICAjICAgICAgICJzcmNfdW5pdDIiIDogeyAiZGVzdF91bml0IiA6IChxdWFsaXR5X2NvZGUsIENvbnZlcnNpb24gRmFjdG9yKSwKICAgICMgICAgICAgICAgICAgICAgICAgICAg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cmludCgiXG5BdHRlbXB0aW5nIHRvIGF1dG8tY29udmVydCBzdHJpbmcgOiBcIiIgKyAKICAgICAgICAgICAgICAgICAgc3RyaW5nICsgIlwiXG4iKQogICAgICAgICAgICBzdHJpbmdDb252ZXJ0KHN0cmluZykKICAgICAgICAgICAgcHJpbnQoIlxuXG5TdWNjZXNzLiIpCiAgICAgICAgICAgIGF1dG9Db252ZXJ0ID0gVHJ1ZQogICAgICAgIGV4Y2VwdDoKICAgICAgICAgICAgcHJpbnQoIlxuXG4tLS0tLS0tLS0tLVxuIgogICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIGF1dG8tY29udmVydCBzdHJpbmcuXG4iCiAgICAgICAgICAgICAgICAgICJQbGVhc2UgY2hlY2sgdGhhdCBhbGwgcmVxdWlzaXRlIGluZm9ybWF0aW9uIGlzIHRoZXJlLlxuIgogICAgICAgICAgICAgICAgICAiUHJvY2VlZGluZyB0byBpbnRlcmFjdGl2ZSBtb2RlLlxuLS0tLS0tLS0tLS1cblxuIikKCiAgICBpZiBub3QgYXV0b0NvbnZlcnQ6CiAgICAgICAgcHJpbnQoIldlbGNvbWUgdG8gdW5pdFRvb2xzLnB5OlxuXG4iCiAgICAgICAgICAgICAgIkN1cnJlbnRseSBzdXBwb3J0ZWQgY29udmVyc2lvbnMgYXJlOiIpCiAgICAgICAgZm9yIGlzb3RvcGUsIHZhbCBpbiBjb252X2ZhY3Rvci5pdGVtcygpOgogICAgICAgICAgICBwcmludCgnICcpCiAgICAgICAgICAgIHByaW50KGlzb3RvcGVbMF0gKyAiIDoiKQogICAgICAgICAgICBmb3Igc191bml0LCB2YWwyIGluIHZhbC5pdGVtcygpOgogICAgICAgICAgICAgICAgZm9yIGRfdW5pdCwgUUNfZmFjdG9yX3R1cGxlIGluIHZhbDIuaXRlbXMoKToKICAgICAgICAgICAgICAgICAgICBwcmludChzX3VuaXQuY2VudGVyKDEyKSArICI8LS0+IiArCiAgICAgICAgICAgICAgICAgICAgICAgICAgZF91b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c290b3BlID09IHNyY19pc290b3BlOgogICAgICAgIGRlc3RfaXNvdG9wZSA9IHNyY19pc290b3BlCiAgICBlbHNlOgogICAgICAgIHByaW50KCJcblxuKioqKioqKioqKioqKioqKioqKioqKlxuIgogICAgICAgICAgICAgICJcbldhcm5pbmc6IElzb3RvcGUgdG8gSXNvdG9wZSBjb252ZXJzaW9uIG5vdCIKICAgICAgICAgICAgICAiY3VycmVudGx5IHN1cHBvcnRlZC5cbklHTk9SSU5HIERFU1RJTkFUSU9OIElTT1RPUEUuIikKICAgICAgICBwcmludCgiXG5Db250aW51aW5nIHdpdGggY29udmVyc2lvbjogIiwgc3JjX3ZhbHVlLCBzcmNfdW5pdCwKICAgICAgICAgICAgICAiKCIsIHNyY19pc290b3BlLCAiKSB0byIsIGRlc3RfdW5pdCwKICAgICAgICAgICAgICAiXG5cbioqKioqKioqKioqKioqKioqKioqKipcblxuIikKCiAgICBpbnRlcm1lZGlhdGVfcXVhbGl0eV9jb2RlID0gMAogICAgaWludGVybWVkaWF0ZV9xdWFsaXR5X2NvZGVfMiA9IDAKICAgIHF1YWxpdHlfY29kZSA9IDMKICAgIGRlc3RfdmFsdWUgPSBOb25lCiAgICBpbnRlcm1lZGlhdGVfdW5pdCA9ICIiCgogICAgaWYgc3JjX2lzb3RvcGUgIT0gInN0ZCI6CiAgICAgICAgZm9yIGssIHYgaW4gY29udl9mYWN0b3IuaXRlbXMoKToKICAgICAgICAgICAgaWYgInN0ZCIgaW4gazoKICAgICAgICAgICAgICAgIHRlbXBEaWN0ID0gdgogICAgICAgIGZvciBzdGRfdW5pdCwgdmFsIGluIHRlbXBEaWN0Lml0ZW1zKCk6CiAgICAgICAgICAgIGZvciBub25zdGRfdW5pdCwgdmFsMiBpbiB2YWwuaXRlbXMoKToKICAgICAgICAgICAgICAgIGlmIHNyY191bml0ID09IG5vbnN0ZF91bml0OgogICAgICAgICAgICAgICAgICAgIGludGVybWVkaWF0ZV91bml0ID0gc3RkX3VuaXQKICAgICAgICBpZiBpbnRlcm1lZGlhdGVfdW5pdCAhPSAiIjoKICAgICAgICAgICAgaW50ZXJtZWRpYXRlX3F1YWxpdHlfY29kZSwgc3JjX3ZhbHVlIFwKICAgICAgICAgICAgICAgID0gY29udmVydCgic3RkIiwgc3JjX3ZhbHVlLCBzcmNfdW5pdCwgaW50ZXJtZWRpYXRlX3VuaXQpCiAgICAgICAgICAgIHNyY191bml0ID0gaW50ZXJtZWRpYXRlX3VuaXQKCiAgICAgICAgaW50ZXJtZWRpYXRlX3VuaXQgPSAiIgoKICAgICAgICBmb3IgaywgdiBpbiBjb252X2ZhY3Rvci5pdGVtcygpOgogICAgICAgICAgICBpZiAic3RkIiBpbiBrOgogICAgICAgICAgICAgICAgdGVtcERpY3QgPSB2CiAgICAgICAgZm9yIHN0ZF91bml0LCB2YWwgaW4gdGVtcERpY3QuaXRlbXMoKToKICAgICAgICAgICAgZm9yIG5vbnN0ZF91bml0LCB2YWwyIGluIHZhbC5pdGVtcygpOgogICAgICAgICAgICAgICAgaWYgZGVzdF91bml0ID09IG5vbnN0ZF91bml0OgogICAgICAgICAgICAgICAgICAgIGludGVybWVkaWF0ZV91bml0ID0gc3RkX3VuaXQKICAgICAgICBpZiBpbnRlcm1lZGlhdGVfdW5pdCAhPSAiIjoKICAgICAgICAgICAgaWludGVybWVkaWF0ZV9xdWFsaXR5X2NvZGVfMiwgc3JjX3ZhbHVlIFwKICAgICAgICAgICAgICAgID0gY29udmVydCgic3RkIiwgc3JjX3ZhbHVlLCBpbnRlcm1lZGlhdGVfdW5pdCwgIGRlc3RfdW5pdCkKICAgICAgICAgICAgZGVzdF91bml0ID0gaW50ZXJtZWRpYXRlX3VuaXQKCiAgICBpZiBzcmNfdW5pdC5sb3dlcigpID09IGRlc3RfdW5pdC5sb3dlcigpOgogICAgICAgIHF1YWxpdHlfY29kZSA9IDEKICAgICAgICBkZXN0X3ZhbHVlID0gc3JjX3ZhbHVlCgogICAgZm9yIHNyY19pc290b3BlX2tleSwgdmFsMCBpbiBjb252X2ZhY3Rvci5pdGVtcygpOgogICAgICAgIGlmIHNyY19pc290b3BlIGluIHNyY19pc290b3BlX2tleToKICAgICAgICAgICAgZm9yIHVuaXQxLCB2YWwxIGluIHZhbDAuaXRlbXMoKToKICAgICAgICAgICAgICAgIGlmIHNyY191bml0IGluIHVuaXQxOgogICAgICAgICAgICAgICAgICAgIGZvciB1bml0MiwgUUNfZmFjdG9yX3R1cGxlIGluIHZhbDEuaXRlbXMoKToKICAgICAgICAgICAgICAgICAgICAgICAgaWYgZGVzdF91bml0IGluIHVuaXQyOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eV9jb2RlID0gUUNfZmFjdG9yX3R1cGxlWzBdCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0X3ZhbHVlID0gc3JjX3ZhbHVlICogUUNfZmFjdG9yX3R1cGxlWzFdCiAgICAgICAgICAgICAgICBlbGlmIGRlc3RfdW5pdCBpbiB1bml0MToKICAgICAgICAgICAgICAgICAgICBmb3IgdW5pdDIsIFFDX2ZhY3Rvcl90dXBsZSBpbiB2YWwxLml0ZW1zKCk6CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIHNyY191bml0IGluIHVuaXQyOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eV9jb2RlID0gUUNfZmFjdG9yX3R1cGxlWzBdCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0X3ZhbHVlID0gc3JjX3ZhbHVlICogKDEvUUNfZmFjdG9yX3R1cGxlWzFdKQoKICAgIGlmIGludGVybWVkaWF0ZV9xdWFsaXR5X2NvZGUgPiBxdWFsaXR5X2NvZGU6CiAgICAgICAgcXVhbGl0eV9jb2RlID0gaW50ZXJtZWRpYXRlX3F1YWxpdHlfY29kZQogICAgaWYgaWludGVybWVkaWF0ZV9xdWFsaXR5X2NvZGVfMiA+IHF1YWxpdHlfY29kZToKICAgICAgICBxdWFsaXR5X2NvZGUgPSBpbnRlcm1lZGlhdGVfcXVhbGl0eV9jb2RlCgogICAgcmV0dXJuIHF1YWxpdHlfY29kZSwgZGVzdF92YWx1ZQoKCmRlZiBzdHJpbmdDb252ZXJ0KHN0cmluZywgcmV0dXJuVHVwbGU9RmFsc2UpOgogICAgdHJ5OiAKICAgICAgICBtb2RpZmllZF9pbnB1dCA9IGlucHV0CiAgICBleGNlcHQgTmFtZUVycm9yOgogICAgICAgIHBhc3MKCiAgICBpbXBvcnQgcmUKICAgIHdhcm5pbmcgPSBGYWxzZQoKICAgIHN0cmluZyA9ICIgIiArIHN0cmluZyArICIgIgogICAgc3RyaW5nID0gcmUuc3ViKCIgIiwgIiAgICIsIHN0cmluZykKICAgIG51bWJlciA9IHJlLmZpbmRhbGwoIiBbXmEtekEtWlwtXSo/KFswLTldKlwuWzAtOV0rfFswLTldKylbXmEtekEtWlwtXSo/ICIsCiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZykKICAgIGlmIG51bWJlciA9PSBbXToKICAgICAgICBwcmludCgiKioqKioqKipcbk5vIG51bWVyaWNhbCB2YWx1ZSBmb3VuZC4gRXhpdGluZy5cbioqKioqKioqIikKICAgICAgICByYWlzZQogICAgaWYgbGVuKG51bWJlcikgPiAxOgogICAgICAgIHByaW50ICgiKioqKioqKipcbldhcm5pbmc6IFRvbyBtYW55IG51bWJlcnMgbWF0Y2hlZCIKICAgICAgICAgICAgICAgIiBpbiBzdHJpbmcuXG5Qb3NzaWJpbGl0eSBvZiBFcnJvciBpcyBWRVJZIEhJR0guIgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgICAgICAgICJcbioqKioqKioqIikKPHxmaW1fZW5kfD4=
afd29656bd65776430d43003e021eb88b089c4e6-2
afd29656bd65776430d43003e021eb88b089c4e6
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9weXRob24KCiMgPT09PT09PT09PT09CiMgdW5pdFRvb2xzLnB5CiMgPT09PT09PT09PT09CiMKIyAgICBT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Li4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uCiMgRGljdGlvbmFyeSBDb250YWluaW5nIFF1YWxpdHkgQ29kZXMKcXVhbGl0eV9jb2RlID0gewogICAgMTogImV4YWN0IGNvbnZlcnNpb24iLAogICAgMjogImFwcHJveGltYXRlIGNvbnZlcnNpb24iLAogICAgMzogIk5vIENvbnZlcnNpb24gLyBFcnJvciIKICAgIH0KCiMgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4KIyBEaWN0aW9uYXJ5IENvbnRhaW5pbmcgQ29udmVyc2lvbiBGYWN0b3JzOgpjb252X2ZhY3RvciA9IHsKCiAgICAjIFN0YW5kYXJkIENvbnZlcnNpb25zCiAgICAoIlN0YW5kYXJkIENvbnZlcnNpb25zIiwgInN0ZCIpOgogICAgICAgIHsKICAgICAgICAgICAgInBwbSI6IHsgCiAgICAgICAgICAgICAgICAicHBiIjogICAgICggMSwgICAgICAgMTAwMC4wICAgICAgKSwKICAgICAgICAgICAgICAgICJwcHQiOiAgICAgKCAxLCAgICAxMDAwMDAwLjAgICAgICApLAogICAgICAgICAgICAgICAgInBwcSI6ICAgICAoIDEsIDEwMDAwMDAwMDAuMCAgICAgICksCiAgICAgICAgICAgICAgICAiZy9nIjogICAgICggMSwgICAgICAgICAgIC4wMDAwMDEgKQogICAgICAgICAgICB9LAogICAgICAgICAgICAiQnEva2ciOiB7CiAgICAgICAgICAgICAgICAibUJxL2tnIiA6ICggMSwgICAgICAgMTAwMC4wICAgICAgKSwKICAgICAgICAgICAgICAgICJtdUJxL2tnIjogKCAxLCAgICAxMDAwMDAwLjAgICAgICApLAogICAgICAgICAgICAgICAgInVCcS9rZyIgOiAoIDEsICAgIDEwMDAwMDAuMCAgICAgICksCiAgICAgICAgICAgICAgICAiQnEvZyIgICA6ICggMSwgICAgICAgICAgMC4wMDEgICAgKSwKICAgICAgICAgICAgICAgICIvZyIgICAgIDogKCAxLCAgICAgICAgICAwLjAwMSAgICApLAogICAgICAgICAgICAgICAgIm11QnEvZyIgOiAoIDEsICAgICAgIDEwMDAuMCAgICAgICksCiAgICAgICAgICAgICAgICAidUJxL2ciICA6ICggMSwgICAgICAgMTAwMC4wICAgICAgKSwKICAgICAgICAgICAgICAgICJuQnEva2ciIDogKCAxLCAxMDAwMDAwMDAwLjAgICAgICApCiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICMgVXJhbml1bSAyMzggRmFjdG9ycwogICAgKCJVLTIzOCIsICJVMjM4IiwgIjIzOFUiLCAiMjM4LVUiKToKICAgICAgICB7CiAgICAgICAgInBwbSI6IHsiQnEva2ciOiAoMSwgMTIuNDM2Nil9CiAgICAgICAgfSwKCiAgICAjIFRob3JpdW0gMjMyIEZhY3RvcnMKICAgICgiVGgtMjMyIiwgIlRoMjMyIiwgIjIzMlRoIiwgIjIzMi1UaCIpOgogICAgICAgIHsKICAgICAgICAicHBtIjogeyJCcS9rZyI6ICgxLCA0LjA3MTkpfQogICAgICAgIH0sCgogICAgIyBQb3Rhc3NpdW0gNDAgRmFjdG9ycwogICAgKCJLLTQwIiwgIks0MCIsICI0MEsiLCAiNDAtSyIpOgogICAgICAgIHsKICAgICAgICAicHBtIjogeyJCcS9rZyI6ICgxLCAyNjUuMjQxNil9CiAgICAgICAgfQoKICAgICMgQXJjaGV0eXBlOgogICAgIyAgICgiSXNvdG9wZU5hbWUxIiwgIklzb3RvcGVOYW1lMiIpIDoKPHxmaW1faG9sZXw+CiAgICAjICAgICAgICAgICAgICAgICAgICAgICJkZXN0X3VuaXQyIiA6IChxdWFsaXR5X2NvZGUsIENvbnZlcnNpb24gRmFjdG9yKX0KICAgICMgICAgICAgfSwKICAgICMKICAgICMgTm90ZTogZHVlIHRvIHRoZSBub24tbGluZWFyIG5hdHVyZSBvZiBkYXRhLWFjY2VzcyBpbiBkaWN0aW9uYXJpZXMsCiAgICAjIGR1cGxpY2F0ZSBlbnRyaWVzIGFyZSBhbiBleGNlZWRpbmdseSBiYWQgaWRlYSwgc2luY2UgdGhlIHByb2dyYW0KICAgICMgY291bGQgcGljayBlaXRoZXIgdmFsdWUuCiAgICB9CgoKZGVmIG1haW4oKToKICAgICIiIk1haW4gRnVuY3Rpb24sIHdoZW4gcnVuIGluIGNvbW1hbmQgbGluZSB3aWxsIGFzawogICAgICAgZm9yIHZhbHVlcyBhbmQgcnVuIGNvbnZlcnNpb24iIiIKICAgIGltcG9ydCBzeXMKICAgIGF1dG9Db252ZXJ0ID0gRmFsc2UKICAgIAogICAgdHJ5OiAgIyBGaXggUHl0aG9uIDIueC4KICAgICAgICBpZiBzeXMudmVyc2lvbl9pbmZvPj0oMywwKToKICAgICAgICAgICAgbW9kaWZpZWRfaW5wdXQgPSBpbnB1dAogICAgICAgICAgICBwcmludCgiUHl0aG9uIDMueCBDb21wYXRpYmxlISIpCiAgICAgICAgZWxzZToKICAgICAgICAgICAgbW9kaWZpZWRfaW5wdXQ9cmF3X2lucHV0CiAgICBleGNlcHQgTmFtZUVycm9yOgogICAgICAgIHBhc3MKCiAgICBzdHJpbmcgPSAiIgogICAgaWYgbGVuKHN5cy5hcmd2KSA+PSAyOgogICAgICAgIHN0cmluZyA9IHN5cy5hcmd2WzFdCiMgICAgICAgIGZvciBpIGluIHN5cy5hcmd2OgojICAgICAgICAgICAgaWYgbm90IGkgPT0gc3lzLmFyZ3ZbMF06CiMgICAgICAgICAgICAgICAgc3RyaW5nID0gc3RyaW5nICsgIiAiICsgaQogICAgICAgIHRyeToKICAgICAgICAgICAgcHJpbnQoIlxuQXR0ZW1wdGluZyB0byBhdXRvLWNvbnZlcnQgc3RyaW5nIDogXCIiICsgCiAgICAgICAgICAgICAgICAgIHN0cmluZyArICJcIlxuIikKICAgICAgICAgICAgc3RyaW5nQ29udmVydChzdHJpbmcpCiAgICAgICAgICAgIHByaW50KCJcblxuU3VjY2Vzcy4iKQogICAgICAgICAgICBhdXRvQ29udmVydCA9IFRydWUKICAgICAgICBleGNlcHQ6CiAgICAgICAgICAgIHByaW50KCJcblxuLS0tLS0tLS0tLS1cbiIKICAgICAgICAgICAgICAgICAgIkZhaWxlZCB0byBhdXRvLWNvbnZlcnQgc3RyaW5nLlxuIgogICAgICAgICAgICAgICAgICAiUGxlYXNlIGNoZWNrIHRoYXQgYWxsIHJlcXVpc2l0ZSBpbmZvcm1hdGlvbiBpcyB0aGVyZS5cbiIKICAgICAgICAgICAgICAgICAgIlByb2NlZWRpbmcgdG8gaW50ZXJhY3RpdmUgbW9kZS5cbi0tLS0tLS0tLS0tXG5cbiIpCgogICAgaWYgbm90IGF1dG9Db252ZXJ0OgogICAgICAgIHByaW50KCJXZWxjb21lIHRvIHVuaXRUb29scy5weTpcblxuIgogICAgICAgICAgICAgICJDdXJyZW50bHkgc3VwcG9ydGVkIGNvbnZlcnNpb25zIGFyZToiKQogICAgICAgIGZvciBpc290b3BlLCB2YWwgaW4gY29udl9mYWN0b3IuaXRlbXMoKToKICAgICAgICAgICAgcHJpbnQoJyAnKQogICAgICAgICAgICBwcmludChpc290b3BlWzBdICsgIiA6IikKICAgICAgICAgICAgZm9yIHNfdW5pdCwgdmFsMiBpbiB2YWwuaXRlbXMoKToKICAgICAgICAgICAgICAgIGZvciBkX3VuaXQsIFFDX2ZhY3Rvcl90dXBsZSBpbiB2YWwyLml0ZW1zKCk6CiAgICAgICAgICAgICAgICAgICAgcHJpbnQoc191bml0LmNlbnRlcigxMikgKyAiPC0tPiIgKwogICAgICAgICAgICAgICAgICAgICAgICAgIGRfdW5pdC5jZW50ZXIoMTIpICsgIiAoIiArCiAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eV9jb2RlW1FDX2ZhY3Rvcl90dXBsZVswXV0gKyAiKSIpCiAgICAgICAgcHJpbnQgKCJcblxuIikKICAgICAgICBTSXNvID0gbW9kaWZpZWRfaW5wdXQoIlBsZWFzZSBlbnRlciB0aGUgU291cmNlIElzb3RvcGUgIgogICAgICAgICAgICAgICAgICAgICAgICAgIihvciBzdGQgZm9yIFN0YW5kYXJkIENvbnZlcnNpb25zKTogIikKICAgICAgICBTVmFsdWUgPSBmbG9hdChtb2RpZmllZF9pbnB1dCgiUGxlYXNlIGVudGVyIHRoZSB2YWx1ZSB0byBjb252ZXJ0IDogIikpCiAgICAgICAgU1VuaXQgPSBtb2RpZmllZF9pbnB1dCgiUGxlYXNlIGVudGVyIHRoZSB1bml0cyBiZWZvcmUgY29udmVyc2lvbiA6ICIpCiAgICAgICAgRFVuaXQgPSBtb2RpZmllZF9pbnB1dCgiUGxlYXNlIGVudGVyIHRoZSB1bml0IHRvIGNvbnZlcnQgdG8gOiAiKQogICAgICAgICMgICAgRElzbyAgID0gbW9kaWZpZWRfaW5wdXQoIlBsZWFzZSBlbnRlciB0aGUgSXNvdG9wZSB0byBjb252ZXJ0IHRvIDogIikKICAgICAgICBRQywgdmFsID0gY29udmVydChTSXNvLCBTVmFsdWUsIFNVbml0LCBEVW5pdCkKICAgICAgICBwcmludCgiUmVzdWx0IDogIiArIHN0cih2YWwpICsgIiAiICsgRFVuaXQgKyAiXG4iCiAgICAgICAgICAgICAgIlRoaXMgaXMgYShuKSIgKyBxdWFsaXR5X2NvZGVbUUNdICsgIi4iKQoKCmRlZiBjb252ZXJ0KHNyY19pc290b3BlLCBzcmNfdmFsdWUsIHNyY191bml0LCBkZXN0X3VuaXQsIGRlc3RfaXNvdG9wZT1Ob25lKToKICAgIGlmIGRlc3RfaXNvdG9wZSBpcyBOb25lIG9yIGRlc3RfaXNvdG9wZSA9PSBzcmNfaXNvdG9wZToKICAgICAgICBkZXN0X2lzb3RvcGUgPSBzcmNfaXNvdG9wZQogICAgZWxzZToKICAgICAgICBwcmludCgiXG5cbioqKioqKioqKioqKioqKioqKioqKipcbiIKICAgICAgICAgICAgICAiXG5XYXJuaW5nOiBJc290b3BlIHRvIElzb3RvcGUgY29udmVyc2lvbiBub3QiCiAgICAgICAgICAgICAgImN1cnJlbnRseSBzdXBwb3J0ZWQuXG5JR05PUklORyBERVNUSU5BVElPTiBJU09UT1BFLiIpCiAgICAgICAgcHJpbnQoIlxuQ29udGludWluZyB3aXRoIGNvbnZlcnNpb246ICIsIHNyY192YWx1ZSwgc3JjX3VuaXQsCiAgICAgICAgICAgICAgIigiLCBzcmNfaXNvdG9wZSwgIikgdG8iLCBkZXN0X3VuaXQsCiAgICAgICAgICAgICAgIlxuXG4qKioqKioqKioqKioqKioqKioqKioqXG5cbiIpCgogICAgaW50ZXJtZWRpYXRlX3F1YWxpdHlfY29kZSA9IDAKICAgIGlpbnRlcm1lZGlhdGVfcXVhbGl0eV9jb2RlXzIgPSAwCiAgICBxdWFsaXR5X2NvZGUgPSAzCiAgICBkZXN0X3ZhbHVlID0gTm9uZQogICAgaW50ZXJtZWRpYXRlX3VuaXQgPSAiIgoKICAgIGlmIHNyY19pc290b3BlICE9ICJzdGQiOgogICAgICAgIGZvciBrLCB2IGluIGNvbnZfZmFjdG9yLml0ZW1zKCk6CiAgICAgICAgICAgIGlmICJzdGQiIGluIGs6CiAgICAgICAgICAgICAgICB0ZW1wRGljdCA9IHYKICAgICAgICBmb3Igc3RkX3VuaXQsIHZhbCBpbiB0ZW1wRGljdC5pdGVtcygpOgogICAgICAgICAgICBmb3Igbm9uc3RkX3VuaXQsIHZhbDIgaW4gdmFsLml0ZW1zKCk6CiAgICAgICAgICAgICAgICBpZiBzcmNfdW5pdCA9PSBub25zdGRfdW5pdDoKICAgICAgICAgICAgICAgICAgICBpbnRlcm1lZGlhdGVfdW5pdCA9IHN0ZF91bml0CiAgICAgICAgaWYgaW50ZXJtZWRpYXRlX3VuaXQgIT0gIiI6CiAgICAgICAgICAgIGludGVybWVkaWF0ZV9xdWFsaXR5X2NvZGUsIHNyY192YWx1ZSBcCiAgICAgICAgICAgICAgICA9IGNvbnZlcnQoInN0ZCIsIHNyY192YWx1ZSwgc3JjX3VuaXQsIGludGVybWVkaWF0ZV91bml0KQogICAgICAgICAgICBzcmNfdW5pdCA9IGludGVybWVkaWF0ZV91bml0CgogICAgICAgIGludGVybWVkaWF0ZV91bml0ID0gIiIKCiAgICAgICAgZm9yIGssIHYgaW4gY29udl9mYWN0b3IuaXRlbXMoKToKICAgICAgICAgICAgaWYgInN0ZCIgaW4gazoKICAgICAgICAgICAgICAgIHRlbXBEaWN0ID0gdgogICAgICAgIGZvciBzdGRfdW5pdCwgdmFsIGluIHRlbXBEaWN0Lml0ZW1zKCk6CiAgICAgICAgICAgIGZvciBub25zdGRfdW5pdCwgdmFsMiBpbiB2YWwuaXRlbXMoKToKICAgICAgICAgICAgICAgIGlmIGRlc3RfdW5pdCA9PSBub25zdGRfdW5pdDoKICAgICAgICAgICAgICAgICAgICBpbnRlcm1lZGlhdGVfdW5pdCA9IHN0ZF91bml0CiAgICAgICAgaWYgaW50ZXJtZWRpYXRlX3VuaXQgIT0gIiI6CiAgICAgICAgICAgIGlpbnRlcm1lZGlhdGVfcXVhbGl0eV9jb2RlXzIsIHNyY192YWx1ZSBcCiAgICAgICAgICAgICAgICA9IGNvbnZlcnQoInN0ZCIsIHNyY192YWx1ZSwgaW50ZXJtZWRpYXRlX3VuaXQsICBkZXN0X3VuaXQpCiAgICAgICAgICAgIGRlc3RfdW5pdCA9IGludGVybWVkaWF0ZV91bml0CgogICAgaWYgc3JjX3VuaXQubG93ZXIoKSA9PSBkZXN0X3VuaXQubG93ZXIoKToKICAgICAgICBxdWFsaXR5X2NvZGUgPSAxCiAgICAgICAgZGVzdF92YWx1ZSA9IHNyY192YWx1ZQoKICAgIGZvciBzcmNfaXNvdG9wZV9rZXksIHZhbDAgaW4gY29udl9mYWN0b3IuaXRlbXMoKToKICAgICAgICBpZiBzcmNfaXNvdG9wZSBpbiBzcmNfaXNvdG9wZV9rZXk6CiAgICAgICAgICAgIGZvciB1bml0MSwgdmFsMSBpbiB2YWwwLml0ZW1zKCk6CiAgICAgICAgICAgICAgICBpZiBzcmNfdW5pdCBpbiB1bml0MToKICAgICAgICAgICAgICAgICAgICBmb3IgdW5pdDIsIFFDX2ZhY3Rvcl90dXBsZSBpbiB2YWwxLml0ZW1zKCk6CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIGRlc3RfdW5pdCBpbiB1bml0MjoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHlfY29kZSA9IFFDX2ZhY3Rvcl90dXBsZVswXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdF92YWx1ZSA9IHNyY192YWx1ZSAqIFFDX2ZhY3Rvcl90dXBsZVsxXQogICAgICAgICAgICAgICAgZWxpZiBkZXN0X3VuaXQgaW4gdW5pdDE6CiAgICAgICAgICAgICAgICAgICAgZm9yIHVuaXQyLCBRQ19mYWN0b3JfdHVwbGUgaW4gdmFsMS5pdGVtcygpOgogICAgICAgICAgICAgICAgICAgICAgICBpZiBzcmNfdW5pdCBpbiB1bml0MjoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHlfY29kZSA9IFFDX2ZhY3Rvcl90dXBsZVswXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdF92YWx1ZSA9IHNyY192YWx1ZSAqICgxL1FDX2ZhY3Rvcl90dXBsZVsxXSkKCiAgICBpZiBpbnRlcm1lZGlhdGVfcXVhbGl0eV9jb2RlID4gcXVhbGl0eV9jb2RlOgogICAgICAgIHF1YWxpdHlfY29kZSA9IGludGVybWVkaWF0ZV9xdWFsaXR5X2NvZGUKICAgIGlmIGlpbnRlcm1lZGlhdGVfcXVhbGl0eV9jb2RlXzIgPiBxdWFsaXR5X2NvZGU6CiAgICAgICAgcXVhbGl0eV9jb2RlID0gaW50ZXJtZWRpYXRlX3F1YWxpdHlfY29kZQoKICAgIHJldHVybiBxdWFsaXR5X2NvZGUsIGRlc3RfdmFsdWUKCgpkZWYgc3RyaW5nQ29udmVydChzdHJpbmcsIHJldHVyblR1cGxlPUZhbHNlKToKICAgIHRyeTogCiAgICAgICAgbW9kaWZpZWRfaW5wdXQgPSBpbnB1dAogICAgZXhjZXB0IE5hbWVFcnJvcjoKICAgICAgICBwYXNzCgogICAgaW1wb3J0IHJlCiAgICB3YXJuaW5nID0gRmFsc2UKCiAgICBzdHJpbmcgPSAiICIgKyBzdHJpbmcgKyAiICIKICAgIHN0cmluZyA9IHJlLnN1YigiICIsICIgICAiLCBzdHJpbmcpCiAgICBudW1iZXIgPSByZS5maW5kYWxsKCIgW15hLXpBLVpcLV0qPyhbMC05XSpcLlswLTldK3xbMC05XSspW15hLXpBLVpcLV0qPyAiLAogICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcpCiAgICBpZiBudW1iZXIgPT0gW106CiAgICAgICAgcHJpbnQoIioqKioqKioqXG5ObyBudW1lcmljYWwgdmFsdWUgZm91bmQuIEV4aXRpbmcuXG4qKioqKioqKiIpCiAgICAgICAgcmFpc2UKICAgIGlmIGxlbihudW1iZXIpID4gMToKICAgICAgICBwcmludCAoIioqKioqKioqXG5XYXJuaW5nOiBUb28gbWFueSBudW1iZXJzIG1hdGNoZWQiCiAgICAgICAgICAgICAgICIgaW4gc3RyaW5nLlxuUG9zc2liaWxpdHkgb2YgRXJyb3IgaXMgVkVSWSBISUdILiIKICAgICAgICAgICAgICAgIlxuKioqKioqKioiKQogICAgICAgIHdhcm5pbmcgPSBUcnVlCgogICAgdW5pdHMgPSBbXQogICAgaXNvdG9wZXMgPSBbXQogICAgZm9yIGssIHYgaW4gY29udl9mYWN0b3IuaXRlbXMoKToKICAgICAgICBpc290b3Blcy5hcHBlbmQoaykKICAgICAgICBmb3Igc3RkX3VuaXQsIHZhbCBpbiB2Lml0ZW1zKCk6CiAgICAgICAgICAgIHVuaXRzLmFwcGVuZChzdGRfdW5pdCkKICAgICAgICAgICAgZm9yIG5vbnN0ZF91bml0LCB2YWwyIGluIHZhbC5pdGVtcygpOgogICAgICAgICAgICAgICAgdW5pdHMuYXBwZW5kKG5vbnN0ZF91bml0KQoKICAgIHRlbXAgPSBbXQogICAgZm9yIGkgaW4gdW5pdHM6CiAgICAgICAgaWYgbm90IGkgaW4gdGVtcDoKICAgICAgICAgICAgdGVtcC5hcHBlbmQoaSkKICAgIHVuaXRzID0gdGVtcAogICAgc3BsaXRfc3RyaW5nID0gcmUuc3BsaXQoIlsgXSIsIHN0cmluZykKICAgIGZpcnN0X3VuaXQgPSAiIgogICAgc2Vjb25kX3VuaXQgPSAiIgoKICAgIGZvciBpIGluIHNwbGl0X3N0cmluZzoKICAgICAgICBmb3IgeCBpbiB1bml0czoKICAgICAgICAgICAgaWYgaSA9PSB4OgogICAgICAgICAgICAgICAgaWYgZmlyc3RfdW5pdCA9PSAiIjoKICAgICAgICAgICAgICAgICAgICBmaXJzdF91bml0ID0geAogICAgICAgICAgICAgICAgZWxpZiBzZWNvbmRfdW5pdCA9PSAiIjoKICAgICAgICAgICAgICAgICAgICBzZWNvbmRfdW5pdCA9IHgKICAgICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAgICAgcHJpbnQoIioqKioqKioqXG5XYXJuaW5nOiBUb28gbWFueSB1bml0cyBtYXRjaGVkICIKICAgICAgICAgICAgICAgICAgICAgICAgICAiaW4gc3RyaW5nLlxuUG9zc2liaWxpdHkgb2YgRXJyb3IgaXMgVkVSWSBISUdILlxuIgogICAgICAgICAgICAgICAgICAgICAgICAgICIqKioqKioqKiIpCiAgICAgICAgICAgICAgICAgICAgd2FybmluZyA9IFRydWUKCiAgICBmaXJzdF9pc290b3BlID0gIiIKICAgIHNlY29uZF9pc290b3BlID0gIiIKCiAgICBmb3IgaSBpbiBzcGxpdF9zdHJpbmc6CiAgICAgICAgZm9yIHggaW4gaXNvdG9wZXM6CiAgICAgICAgICAgIGlmIGkgaW4geDoKICAgICAgICAgICAgICAgIGlmIGZpcnN0X2lzb3RvcGUgPT0gIiI6CiAgICAgICAgICAgICAgICAgICAgZmlyc3RfaXNvdG9wZSA9IHhbMF0KICAgICAgICAgICAgICAgIGVsaWYgc2Vjb25kX2lzb3RvcGUgPT0gIiI6CiAgICAgICAgICAgICAgICAgICAgc2Vjb25kX2lzb3RvcGUgPSB4WzBdCiAgICAgICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgICAgIHByaW50KCIqKioqKioqKlxuV2FybmluZzogVG9vIG1hbnkgaXNvdG9wZXMgbWF0Y2hlZCAiCiAgICAgICAgICAgICAgICAgICAgICAgICAgImluIHN0cmluZy5cblBvc3NpYmlsaXR5IG9mIEVycm9yIGlzIFZFUlkgSElHSC5cbiIKICAgICAgICAgICAgICAgICAgICAgICAgICAiKioqKioqKioiKQogICAgICAgICAgICAgICAgICAgIHdhcm5pbmcgPSBUcnVlCgogICAgaWYgc2Vjb25kX2lzb3RvcGUgPT0gIiI6CiAgICAgICAgc2Vjb25kX2lzb3RvcGUgPSBmaXJzdF9pc290b3BlCgogICAgcHJpbnQoIi0tLS0tLS0tLS0tLVxuQ29udmVydGluZyAiICsgbnVtYmVyWzBdICsgIiAiICsgZmlyc3RfdW5pdCArCiAgICAgICAgICAiICgiICsgZmlyc3RfaXNvdG9wZSArICIpIHRvICIgKyBzZWNvbmRfdW5pdCArCiAgICAgICAgICAiICgiICsgc2Vjb25kX2lzb3RvcGUgKyAiKS5cbi0tLS0tLS0tLS0tLSIpCgogICAgaWYgZmlyc3RfdW5pdCA9PSAiIjoKICAgICAgICBwcmludCgiKioqKioqKipcbk5vIHVuaXRzIG1hdGNoZWQuIEV4aXRpbmcuXG4qKioqKioqKiIpCiAgICAgICAgcmFpc2UKICAgIGlmIHNlY29uZF91bml0ID09ICIiOgogICAgICAgIHByaW50KCIqKioqKioqKlxuTm90IGVub3VnaCB1bml0cyBtYXRjaGVkLiBFeGl0aW5nLlxuKioqKioqKioiKQogICAgICAgIHJhaXNlCiAgICBpZiBmaXJzdF9pc290b3BlID09ICIiOgogICAgICAgIHByaW50KCIqKioqKioqKlxuTm8gaXNvdG9wZSBtYXRjaGVkLiBFeGl0aW5nLlxuKioqKioqKioiKQogICAgICAgIHJhaXNlCiAgICBpZiB3YXJuaW5nOgogICAgICAgIHByaW50KCIqKioqKioqKlxuV2FybmluZzogVGhlIGFjY3VyYWN5IG9mIHRoZSBjb252ZXJzaW9uICIKICAgICAgICAgICAgICAiaXMgSElHSExZIFNVU1BFQ1QuXG4iCiAgICAgICAgICAgICAgIlBMRUFTRSBDSEVDSyBUSEFUIFRIRSBBQk9WRSBMSU5FIElTIENPUlJFQ1QhISFcbioqKioqKioqIikKCiAgICBRQywgdmFsID0gY29udmVydChmaXJzdF9pc290b3BlLCBmbG9hdChudW1iZXJbMF0pLCBmaXJzdF91bml0LAogICAgICAgICAgICAgICAgICAgICAgc2Vjb25kX3VuaXQsIHNlY29uZF9pc290b3BlKQoKICAgIHByaW50KCJSZXN1bHQgOiAiICsgc3RyKHZhbCkgKyAiICIgKyBzdHIoc2Vjb25kX3VuaXQpICsKICAgICAgICAgICJcblRoaXMgaXMgYShuKSAiICsgc3RyKHF1YWxpdHlfY29kZVtRQ10pICsgIi4iKQoKICAgIGlmIHJldHVyblR1cGxlOgogICAgICAgIHJldHVybiBRQywgdmFsCgoKaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKICAgIG1haW4oKQo8fGZpbV9zdWZmaXh8PgogICAgIyAgICAgICB7CiAgICAjICAgICAgICJzcmNfdW5pdCIgIDogeyAiZGVzdF91bml0IiA6IChxdWFsaXR5X2NvZGUsIENvbnZlcnNpb24gRmFjdG9yKSwKICAgICMgICAgICAgICAgICAgICAgICAgICAgImRlc3RfdW5pdDIiIDogKHF1YWxpdHlfY29kZSwgQ29udmVyc2lvbiBGYWN0b3IpfSwKICAgICMgICAgICAgInNyY191bml0MiIgOiB7ICJkZXN0X3VuaXQiIDogKHF1YWxpdHlfY29kZSwgQ29udmVyc2lvbiBGYWN0b3IpLAo8fGZpbV9lbmR8Pg==