id
stringlengths
42
42
src_hexsha
stringlengths
40
40
example
stringlengths
80
1.37M
afd29656bd65776430d43003e021eb88b089c4e6-3
afd29656bd65776430d43003e021eb88b089c4e6
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9weXRob24KCiMgPT09PT09PT09PT09CiMgdW5pdFRvb2xzLnB5CiMgPT09PT09PT09PT09CiMKIyAgICBTZWUgUkVBRE1FLm1kCiMKIyAgICAgICAgICAgICA9PT09PT09PT09PT09PT09PT0KIyAgICBCYXNlZCBvbiBSYWRpb0NvbnZlcnNpb24ucHkgYnkgQmVuIFdpc2UuCiMgICAgICAgICAgICAgPT09PT09PT09PT09PT09PT09CiMKIyAgICBUaGlzIGNvZGUgaXMgaGVhdmlseSBiYXNlZCB1cG9uIGFuIG9wZW4gc291cmNlIGNvZGUgZGV2ZWxvcGVkIGJ5CiMgICAgQmVuIFdpc2UuIFRoZSBvcmlnaW5hbCBmaWxlIGhlYWRlcjoKIwojICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiMgICAgTmFtZTogICAgICAgICAgIHVuaXRUb29scy5weQojICAgIFB1cnBvc2U6ICAgICAgICBUbyBmYWNpbGl0YXRlIGNvbnZlcnNpb24gYmV0d2VlbiBkaWZmZXJlbnQgcmFkaW9sb2dpY2FsCiMgICAgICAgICAgICAgICAgICAgIHVuaXRzLCBzdWNoIGFzIEJxL2tnLCBnL2csIHBwbSwgcHBiLCBwcHQsIGV0Yy4KIwojICAgIEF1dGhvcjogICAgICAgICBCZW4gV2lzZQojICAgIEVtYWlsOiAgICAgICAgICBid2lzZUBzbXUuZWR1CiMKIyAgICBDcmVhdGVkOiAgICAgICAgMDkgSnVseSAyMDEzCiMgICAgQ29weXJpZ2h0OiAgICAgIChjKSBCZW4gV2lzZSAyMDEzCiMgICAgTGljZW5jZTogICAgICAgIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlCiMgICAgVmVyc2lvbjogICAgICAgIDEuMAojICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgojIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uCiMgRGljdGlvbmFyeSBDb250YWluaW5nIFF1YWxpdHkgQ29kZXMKcXVhbGl0eV9jb2RlID0gewogICAgMTogImV4YWN0IGNvbnZlcnNpb24iLAogICAgMjogImFwcHJveGltYXRlIGNvbnZlcnNpb24iLAogICAgMzogIk5vIENvbnZlcnNpb24gLyBFcnJvciIKICAgIH0KCiMgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4KIyBEaWN0aW9uYXJ5IENvbnRhaW5pbmcgQ29udmVyc2lvbiBGYWN0b3JzOgpjb252X2ZhY3RvciA9IHsKCiAgICAjIFN0YW5kYXJkIENvbnZlcnNpb25zCiAgICAoIlN0YW5kYXJkIENvbnZlcnNpb25zIiwgInN0ZCIpOgogICAgICAgIHsKICAgICAgICAgICAgInBwbSI6IHsgCiAgICAgICAgICAgICAgICAicHBiIjogICAgICggMSwgICAgICAgMTAwMC4wICAgICAgKSwKICAgICAgICAgICAgICAgICJwcHQiOiAgICAgKCAxLCAgICAxMDAwMDAwLjAgICAgICApLAogICAgICAgICAgICAgICAgInBwcSI6ICAgICAoIDEsIDEwMDAwMDAwMDAuMCAgICAgICksCiAgICAgICAgICAgICAgICAiZy9nIjogICAgICggMSwgICAgICAgICAgIC4wMDAwMDEgKQogICAgICAgICAgICB9LAogICAgICAgICAgICAiQnEva2ciOiB7CiAgICAgICAgICAgICAgICAibUJxL2tnIiA6ICggMSwgICAgICAgMTAwMC4wICAgICAgKSwKICAgICAgICAgICAgICAgICJtdUJxL2tnIjogKCAxLCAgICAxMDAwMDAwLjAgICAgICApLAogICAgICAgICAgICAgICAgInVCcS9rZyIgOiAoIDEsICAgIDEwMDAwMDAuMCAgICAgICksCiAgICAgICAgICAgICAgICAiQnEvZyIgICA6ICggMSwgICAgICAgICAgMC4wMDEgICAgKSwKICAgICAgICAgICAgICAgICIvZyIgICAgIDogKCAxLCAgICAgICAgICAwLjAwMSAgICApLAogICAgICAgICAgICAgICAgIm11QnEvZyIgOiAoIDEsICAgICAgIDEwMDAuMCAgICAgICksCiAgICAgICAgICAgICAgICAidUJxL2ciICA6ICggMSwgICAgICAgMTAwMC4wICAgICAgKSwKICAgICAgICAgICAgICAgICJuQnEva2ciIDogKCAxLCAxMDAwMDAwMDAwLjAgICAgICApCiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICMgVXJhbml1bSAyMzggRmFjdG9ycwogICAgKCJVLTIzOCIsICJVMjM4IiwgIjIzOFUiLCAiMjM4LVUiKToKICAgICAgICB7CiAgICAgICAgInBwbSI6IHsiQnEva2ciOiAoMSwgMTIuNDM2Nil9CiAgICAgICAgfSwKCiAgICAjIFRob3JpdW0gMjMyIEZhY3RvcnMKICAgICgiVGgtMjMyIiwgIlRoMjMyIiwgIjIzMlRoIiwgIjIzMi1UaCIpOgogICAgICAgIHsKICAgICAgICAicHBtIjogeyJCcS9rZyI6ICgxLCA0LjA3MTkpfQogICAgICAgIH0sCgogICAgIyBQb3Rhc3NpdW0gNDAgRmFjdG9ycwogICAgKCJLLTQwIiwgIks0MCIsICI0MEsiLCAiNDAtSyIpOgogICAgICAgIHsKICAgICAgICAicHBtIjogeyJCcS9rZyI6ICgxLCAyNjUuMjQxNil9CiAgICAgICAgfQoKICAgICMgQXJjaGV0eXBlOgogICAgIyAgICgiSXNvdG9wZU5hbWUxIiwgIklzb3RvcGVOYW1lMiIpIDoKICAgICMgICAgICAgewogICAgIyAgICAgICAic3JjX3VuaXQiICA6IHsgImRlc3RfdW5pdCIgOiAocXVhbGl0eV9jb2RlLCBDb252ZXJzaW9uIEZhY3RvciksCiAgICAjICAgICAgICAgICAgICAgICAgICAgICJkZXN0X3VuaXQyIiA6IChxdWFsaXR5X2NvZGUsIENvbnZlcnNpb24gRmFjdG9yKX0sCiAgICAjICAgICAgICJzcmNfdW5pdDIiIDogeyAiZGVzdF91bml0IiA6IChxdWFsaXR5X2NvZGUsIENvbnZlcnNpb24gRmFjdG9yKSwKICAgICMgICAgICAgICAgICAgICAgICAgICAgImRlc3RfdW5pdDIiIDogKHF1YWxpdHlfY29kZSwgQ29udmVyc2lvbiBGYWN0b3IpfQogICAgIyAgICAgICB9LAogICAgIwogICAgIyBOb3RlOiBkdWUgdG8gdGhlIG5vbi1saW5lYXIgbmF0dXJlIG9mIGRhdGEtYWNjZXNzIGluIGRpY3Rpb25hcmllcywKICAgICMgZHVwbGljYXRlIGVudHJpZXMgYXJlIGFuIGV4Y2VlZGluZ2x5IGJhZCBpZGVhLCBzaW5jZSB0aGUgcHJvZ3JhbQogICAgIyBjb3VsZCBwaWNrIGVpdGhlciB2YWx1ZS4KICAgIH0KCgpkZWYgbWFpbigpOgogICAgIiIiTWFpbiBGdW5jdGlvbiwgd2hlbiBydW4gaW4gY29tbWFuZCBsaW5lIHdpbGwgYXNrCiAgICAgICBmb3IgdmFsdWVzIGFuZCBydW4gY29udmVyc2lvbiIiIgogICAgaW1wb3J0IHN5cwogICAgYXV0b0NvbnZlcnQgPSBGYWxzZQogICAgCiAgICB0cnk6ICAjIEZpeCBQeXRob24gMi54LgogICAgICAgIGlmIHN5cy52ZXJzaW9uX2luZm8+PSgzLDApOgogICAgICAgICAgICBtb2RpZmllZF9pbnB1dCA9IGlucHV0CiAgICAgICAgICAgIHByaW50KCJQeXRob24gMy54IENvbXBhdGlibGUhIikKICAgICAgICBlbHNlOgogICAgICAgICAgICBtb2RpZm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vcGUsIHZhbCBpbiBjb252X2ZhY3Rvci5pdGVtcygpOgogICAgICAgICAgICBwcmludCgnICcpCiAgICAgICAgICAgIHByaW50KGlzb3RvcGVbMF0gKyAiIDoiKQogICAgICAgICAgICBmb3Igc191bml0LCB2YWwyIGluIHZhbC5pdGVtcygpOgogICAgICAgICAgICAgICAgZm9yIGRfdW5pdCwgUUNfZmFjdG9yX3R1cGxlIGluIHZhbDIuaXRlbXMoKToKICAgICAgICAgICAgICAgICAgICBwcmludChzX3VuaXQuY2VudGVyKDEyKSArICI8LS0+IiArCiAgICAgICAgICAgICAgICAgICAgICAgICAgZF91bml0LmNlbnRlcigxMikgKyAiICgiICsKICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5X2NvZGVbUUNfZmFjdG9yX3R1cGxlWzBdXSArICIpIikKICAgICAgICBwcmludCAoIlxuXG4iKQogICAgICAgIFNJc28gPSBtb2RpZmllZF9pbnB1dCgiUGxlYXNlIGVudGVyIHRoZSBTb3VyY2UgSXNvdG9wZSAiCiAgICAgICAgICAgICAgICAgICAgICAgICAiKG9yIHN0ZCBmb3IgU3RhbmRhcmQgQ29udmVyc2lvbnMpOiAiKQogICAgICAgIFNWYWx1ZSA9IGZsb2F0KG1vZGlmaWVkX2lucHV0KCJQbGVhc2UgZW50ZXIgdGhlIHZhbHVlIHRvIGNvbnZlcnQgOiAiKSkKICAgICAgICBTVW5pdCA9IG1vZGlmaWVkX2lucHV0KCJQbGVhc2UgZW50ZXIgdGhlIHVuaXRzIGJlZm9yZSBjb252ZXJzaW9uIDogIikKICAgICAgICBEVW5pdCA9IG1vZGlmaWVkX2lucHV0KCJQbGVhc2UgZW50ZXIgdGhlIHVuaXQgdG8gY29udmVydCB0byA6ICIpCiAgICAgICAgIyAgICBESXNvICAgPSBtb2RpZmllZF9pbnB1dCgiUGxlYXNlIGVudGVyIHRoZSBJc290b3BlIHRvIGNvbnZlcnQgdG8gOiAiKQogICAgICAgIFFDLCB2YWwgPSBjb252ZXJ0KFNJc28sIFNWYWx1ZSwgU1VuaXQsIERVbml0KQogICAgICAgIHByaW50KCJSZXN1bHQgOiAiICsgc3RyKHZhbCkgKyAiICIgKyBEVW5pdCArICJcbiIKICAgICAgICAgICAgICAiVGhpcyBpcyBhKG4pIiArIHF1YWxpdHlfY29kZVtRQ10gKyAiLiIpCgoKZGVmIGNvbnZlcnQoc3JjX2lzb3RvcGUsIHNyY192YWx1ZSwgc3JjX3VuaXQsIGRlc3RfdW5pdCwgZGVzdF9pc290b3BlPU5vbmUpOgogICAgaWYgZGVzdF9pc290b3BlIGlzIE5vbmUgb3IgZGVzdF9pc290b3BlID09IHNyY19pc290b3BlOgogICAgICAgIGRlc3RfaXNvdG9wZSA9IHNyY19pc290b3BlCiAgICBlbHNlOgogICAgICAgIHByaW50KCJcblxuKioqKioqKioqKioqKioqKioqKioqKlxuIgogICAgICAgICAgICAgICJcbldhcm5pbmc6IElzb3RvcGUgdG8gSXNvdG9wZSBjb252ZXJzaW9uIG5vdCIKICAgICAgICAgICAgICAiY3VycmVudGx5IHN1cHBvcnRlZC5cbklHTk9SSU5HIERFU1RJTkFUSU9OIElTT1RPUEUuIikKICAgICAgICBwcmludCgiXG5Db250aW51aW5nIHdpdGggY29udmVyc2lvbjogIiwgc3JjX3ZhbHVlLCBzcmNfdW5pdCwKICAgICAgICAgICAgICAiKCIsIHNyY19pc290b3BlLCAiKSB0byIsIGRlc3RfdW5pdCwKICAgICAgICAgICAgICAiXG5cbioqKioqKioqKioqKioqKioqKioqKipcblxuIikKCiAgICBpbnRlcm1lZGlhdGVfcXVhbGl0eV9jb2RlID0gMAogICAgaWludGVybWVkaWF0ZV9xdWFsaXR5X2NvZGVfMiA9IDAKICAgIHF1YWxpdHlfY29kZSA9IDMKICAgIGRlc3RfdmFsdWUgPSBOb25lCiAgICBpbnRlcm1lZGlhdGVfdW5pdCA9ICIiCgogICAgaWYgc3JjX2lzb3RvcGUgIT0gInN0ZCI6CiAgICAgICAgZm9yIGssIHYgaW4gY29udl9mYWN0b3IuaXRlbXMoKToKICAgICAgICAgICAgaWYgInN0ZCIgaW4gazoKICAgICAgICAgICAgICAgIHRlbXBEaWN0ID0gdgogICAgICAgIGZvciBzdGRfdW5pdCwgdmFsIGluIHRlbXBEaWN0Lml0ZW1zKCk6CiAgICAgICAgICAgIGZvciBub25zdGRfdW5pdCwgdmFsMiBpbiB2YWwuaXRlbXMoKToKICAgICAgICAgICAgICAgIGlmIHNyY191bml0ID09IG5vbnN0ZF91bml0OgogICAgICAgICAgICAgICAgICAgIGludGVybWVkaWF0ZV91bml0ID0gc3RkX3VuaXQKICAgICAgICBpZiBpbnRlcm1lZGlhdGVfdW5pdCAhPSAiIjoKICAgICAgICAgICAgaW50ZXJtZWRpYXRlX3F1YWxpdHlfY29kZSwgc3JjX3ZhbHVlIFwKICAgICAgICAgICAgICAgID0gY29udmVydCgic3RkIiwgc3JjX3ZhbHVlLCBzcmNfdW5pdCwgaW50ZXJtZWRpYXRlX3VuaXQpCiAgICAgICAgICAgIHNyY191bml0ID0gaW50ZXJtZWRpYXRlX3VuaXQKCiAgICAgICAgaW50ZXJtZWRpYXRlX3VuaXQgPSAiIgoKICAgICAgICBmb3IgaywgdiBpbiBjb252X2ZhY3Rvci5pdGVtcygpOgogICAgICAgICAgICBpZiAic3RkIiBpbiBrOgogICAgICAgICAgICAgICAgdGVtcERpY3QgPSB2CiAgICAgICAgZm9yIHN0ZF91bml0LCB2YWwgaW4gdGVtcERpY3QuaXRlbXMoKToKICAgICAgICAgICAgZm9yIG5vbnN0ZF91bml0LCB2YWwyIGluIHZhbC5pdGVtcygpOgogICAgICAgICAgICAgICAgaWYgZGVzdF91bml0ID09IG5vbnN0ZF91bml0OgogICAgICAgICAgICAgICAgICAgIGludGVybWVkaWF0ZV91bml0ID0gc3RkX3VuaXQKICAgICAgICBpZiBpbnRlcm1lZGlhdGVfdW5pdCAhPSAiIjoKICAgICAgICAgICAgaWludGVybWVkaWF0ZV9xdWFsaXR5X2NvZGVfMiwgc3JjX3ZhbHVlIFwKICAgICAgICAgICAgICAgID0gY29udmVydCgic3RkIiwgc3JjX3ZhbHVlLCBpbnRlcm1lZGlhdGVfdW5pdCwgIGRlc3RfdW5pdCkKICAgICAgICAgICAgZGVzdF91bml0ID0gaW50ZXJtZWRpYXRlX3VuaXQKCiAgICBpZiBzcmNfdW5pdC5sb3dlcigpID09IGRlc3RfdW5pdC5sb3dlcigpOgogICAgICAgIHF1YWxpdHlfY29kZSA9IDEKICAgICAgICBkZXN0X3ZhbHVlID0gc3JjX3ZhbHVlCgogICAgZm9yIHNyY19pc290b3BlX2tleSwgdmFsMCBpbiBjb252X2ZhY3Rvci5pdGVtcygpOgogICAgICAgIGlmIHNyY19pc290b3BlIGluIHNyY19pc290b3BlX2tleToKICAgICAgICAgICAgZm9yIHVuaXQxLCB2YWwxIGluIHZhbDAuaXRlbXMoKToKICAgICAgICAgICAgICAgIGlmIHNyY191bml0IGluIHVuaXQxOgogICAgICAgICAgICAgICAgICAgIGZvciB1bml0MiwgUUNfZmFjdG9yX3R1cGxlIGluIHZhbDEuaXRlbXMoKToKICAgICAgICAgICAgICAgICAgICAgICAgaWYgZGVzdF91bml0IGluIHVuaXQyOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eV9jb2RlID0gUUNfZmFjdG9yX3R1cGxlWzBdCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0X3ZhbHVlID0gc3JjX3ZhbHVlICogUUNfZmFjdG9yX3R1cGxlWzFdCiAgICAgICAgICAgICAgICBlbGlmIGRlc3RfdW5pdCBpbiB1bml0MToKICAgICAgICAgICAgICAgICAgICBmb3IgdW5pdDIsIFFDX2ZhY3Rvcl90dXBsZSBpbiB2YWwxLml0ZW1zKCk6CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIHNyY191bml0IGluIHVuaXQyOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eV9jb2RlID0gUUNfZmFjdG9yX3R1cGxlWzBdCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0X3ZhbHVlID0gc3JjX3ZhbHVlICogKDEvUUNfZmFjdG9yX3R1cGxlWzFdKQoKICAgIGlmIGludGVybWVkaWF0ZV9xdWFsaXR5X2NvZGUgPiBxdWFsaXR5X2NvZGU6CiAgICAgICAgcXVhbGl0eV9jb2RlID0gaW50ZXJtZWRpYXRlX3F1YWxpdHlfY29kZQogICAgaWYgaWludGVybWVkaWF0ZV9xdWFsaXR5X2NvZGVfMiA+IHF1YWxpdHlfY29kZToKICAgICAgICBxdWFsaXR5X2NvZGUgPSBpbnRlcm1lZGlhdGVfcXVhbGl0eV9jb2RlCgogICAgcmV0dXJuIHF1YWxpdHlfY29kZSwgZGVzdF92YWx1ZQoKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgoKZGVmIHN0cmluZ0NvbnZlcnQoc3RyaW5nLCByZXR1cm5UdXBsZT1GYWxzZSk6CiAgICB0cnk6IAogICAgICAgIG1vZGlmaWVkX2lucHV0ID0gaW5wdXQKPHxmaW1fZW5kfD4=
afd29656bd65776430d43003e021eb88b089c4e6-4
afd29656bd65776430d43003e021eb88b089c4e6
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9weXRob24KCiMgPT09PT09PT09PT09CiMgdW5pdFRvb2xzLnB5CiMgPT09PT09PT09PT09CiMKIyAgICBTZWUgUkVBRE1FLm1kCiMKIyAgICAgICAgICAgICA9PT09PT09PT09PT09PT09PT0KIyAgICBCYXNlZCBvbiBSYWRpb0NvbnZlcnNpb24ucHkgYnkgQmVuIFdpc2UuCiMgICAgICAgICAgICAgPT09PT09PT09PT09PT09PT09CiMKIyAgICBUaGlzIGNvZGUgaXMgaGVhdmlseSBiYXNlZCB1cG9uIGFuIG9wZW4gc291cmNlIGNvZGUgZGV2ZWxvcGVkIGJ5CiMgICAgQmVuIFdpc2UuIFRoZSBvcmlnaW5hbCBmaWxlIGhlYWRlcjoKIwojICAgIC0tLS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gPSBnZXRfY291cnNlX2lkKHsKICAgICAgICAgICAgIm5hbWUiOiBjb3Vyc2VbIm5hbWUiXSwKICAgICAgICAgICAgImxlc3Nvbl90eXBlIjogY291cnNlWyJsZXNzb25fdHlwZSJdLAo8fGZpbV9ob2xlfD4KICAgICAgICBpZiBjb3Vyc2VfaWQgaXMgTm9uZToKICAgICAgICAgICAgIyBhZGQgbmV3IGNvdXJzZQogICAgICAgICAgICBjb3Vyc2VfaWQgPSBjcmVhdGVfY291cnNlKGNvdXJzZSwgYWNjZXNzX3Rva2VuKQogICAgICAgICAgICBwcmludChmIkNyZWF0ZWQgY291cnNlIHdpdGggaWQ9e2NvdXJzZV9pZH0iKQoKICAgICAgICBpZiBjb3Vyc2VfaWQgaXMgbm90IE5vbmU6CiAgICAgICAgICAgIHByaW50KGYiR29pbmcgb3ZlciBsZXNzb25zIGZvciBjb3Vyc2Ugd2l0aCBpZD17Y291cnNlX2lkfSIpCiAgICAgICAgICAgIGZvciBsZXNzb24gaW4gY291cnNlWydsZXNzb24nXToKICAgICAgICAgICAgICAgIGxlc3Nvbl9pZCA9IGdldF9sZXNzb25faWQoewogICAgICAgICAgICAgICAgICAgICJ3aGVuIjogbGVzc29uWyJ3aGVuIl0sCiAgICAgICAgICAgICAgICAgICAgInN0YXJ0X3RpbWUiOiBsZXNzb25bInN0YXJ0X3RpbWUiXSwKICAgICAgICAgICAgICAgICAgICAiZW5kX3RpbWUiOiBsZXNzb25bImVuZF90aW1lIl0KICAgICAgICAgICAgICAgIH0sIGNvdXJzZV9pZCwgYWNjZXNzX3Rva2VuKQoKICAgICAgICAgICAgICAgIGlmIGxlc3Nvbl9pZCBpcyBOb25lOgogICAgICAgICAgICAgICAgICAgICMgY3JlYXRlIG5ldyBsZXNzb24KICAgICAgICAgICAgICAgICAgICBsZXNzb25faWQgPSBjcmVhdGVfbGVzc29uKGxlc3NvbiwgY291cnNlX2lkLCBhY2Nlc3NfdG9rZW4pCiAgICAgICAgICAgICAgICAgICAgc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Y291cnNlX2lkLCBhY2Nlc3NfdG9rZW4pOgogICAgcmVzcG9uc2UgPSByZXF1ZXN0cy5nZXQoZid7Q09VUlNFU19VUkx9e2NvdXJzZV9pZH17TEVTU09OU19VUkx9JywgaGVhZGVycz17J0F1dGhvcml6YXRpb24nOiBmJ0JlYXJlciB7YWNjZXNzX3Rva2VufSd9KQogICAganNvbl9kYXRhID0ganNvbi5sb2FkcyhyZXNwb25zZS50ZXh0KQoKICAgIGZvciBsZXNzb24gaW4ganNvbl9kYXRhOgogICAgICAgIGlmIGFsbChbbGVzc29uW2tleV0gPT0gbGVzc29uX2RhdGFba2V5XSBmb3Iga2V5IGluIGxlc3Nvbl9kYXRhLmtleXMoKV0pOgogICAgICAgICAgICByZXR1cm4gbGVzc29uWydpZCddCgogICAgcmV0dXJuIE5vbmUKCgpkZWYgY3JlYXRlX2xlc3NvbihsZXNzb24sIGNvdXJzZV9pZCwgYWNjZXNzX3Rva2VuKToKICAgIGxlc3Nvbl9wYXlsb2FkID0gewogICAgICAgICJ3aGVuIjogbGVzc29uWyd3aGVuJ10sCiAgICAgICAgInN0YXJ0X3RpbWUiOiBsZXNzb25bJ3N0YXJ0X3RpbWUnXSwKICAgICAgICAiZW5kX3RpbWUiOiBsZXNzb25bJ2VuZF90aW1lJ10sCiAgICAgICAgImJ1aWxkaW5nIjogbGVzc29uWydidWlsZGluZyddLAogICAgICAgICJyb29tIjogbGVzc29uWydyb29tJ10KICAgIH0KCiAgICByZXNwb25zZSA9IHJlcXVlc3RzLnBvc3QoZid7Q09VUlNFU19VUkx9e2NvdXJzZV9pZH17TEVTU09OU19VUkx9JywgZGF0YT1sZXNzb25fcGF5bG9hZCwKICAgICAgICAgICAgICAgICAgaGVhZGVycz17J0F1dGhvcml6YXRpb24nOiBmJ0JlYXJlciB7YWNjZXNzX3Rva2VufSd9KQogICAganNvbl9kYXRhID0ganNvbi5sb2FkcyhyZXNwb25zZS50ZXh0KQoKICAgIHJldHVybiBqc29uX2RhdGFbJ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ZXNzb25zIGZvciBjb3Vyc2Ugd2l0aCBpZD17Y291cnNlX2lkfSIpCiAgICAgICAgICAgIGZvciBsZXNzb24gaW4gY291cnNlWydsZXNzb24nXToKICAgICAgICAgICAgICAgIGxlc3Nvbl9pZCA9IGdldF9sZXNzb25faWQoewogICAgICAgICAgICAgICAgICAgICJ3aGVuIjogbGVzc29uWyJ3aGVuIl0sCiAgICAgICAgICAgICAgICAgICAgInN0YXJ0X3RpbWUiOiBsZXNzb25bInN0YXJ0X3RpbWUiXSwKICAgICAgICAgICAgICAgICAgICAiZW5kX3RpbWUiOiBsZXNzb25bImVuZF90aW1lIl0KICAgICAgICAgICAgICAgIH0sIGNvdXJzZV9pZCwgYWNjZXNzX3Rva2VuKQoKICAgICAgICAgICAgICAgIGlmIGxlc3Nvbl9pZCBpcyBOb25lOgogICAgICAgICAgICAgICAgICAgICMgY3JlYXRlIG5ldyBsZXNzb24KICAgICAgICAgICAgICAgICAgICBsZXNzb25faWQgPSBjcmVhdGVfbGVzc29uKGxlc3NvbiwgY291cnNlX2lkLCBhY2Nlc3NfdG9rZW4pCiAgICAgICAgICAgICAgICAgICAgcHJpbnQoZidDcmVhdGVkIGxlc3NvbiB3aXRoIGlkPXtsZXNzb25faWR9JykKCgppZiBfX25hbWVfXyA9PSAiX19tYWluX18iOgogICAgbWFpbigpCjx8ZmltX3N1ZmZpeHw+CgogICAgZm9yIGNvdXJzZSBpbiBjb3Vyc2VzOgogICAgICAgIHRlYWNoZXJfbmFtZSA9ICcgJy5qb2luKGNvdXJzZVsndGVhY2hlcl9pZCddLnNwbGl0KClbLTI6XSkKICAgICAgICB0ZWFjaGVyX2lkID0gZ2V0X3RlYWNoZXJfaWQodGVhY2hlcl9uYW1lLCBhY2Nlc3NfdG9rZW4pCjx8ZmltX2VuZHw+
0557f46c34081e80d75e3a7983fe2a1911c74d0f-5
0557f46c34081e80d75e3a7983fe2a1911c74d0f
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHJlcXVlc3Rz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bfb83fedc68ff42b955d9e8c83234e30c-1
552dd4fbfb83fedc68ff42b955d9e8c83234e30c
PHxmaW1fcHJlZml4fD4KZnJvbSBzcmMudXRpbHMudXRpbHMgaW1wb3J0IGdldF9maWxlX25hbWVzCmZyb20gc3JjLmRhdGEubWFrZV9zYW1wbGVfZGF0YXNldCBpbXBvcnQgZGl2aWRlLCB3cml0ZV9uZXdfcGlja2xlLCBkaXZpZGVfZXN0dXBpZG8KZnJvbSBzcmMuZGF0YS5pbXBvcnRfZGF0YXNldCBpbXBvcnQgIHJlYWRfcGlja2xlCgoKZGVmIHNhbXBsaW5nKCk6CiAgICBmaWxlcyA9IGdldF9maWxlX25hbWVzKCkKICAgIHRyYWluaW5nID0gbGlzdCgpCiAgICB0ZXN0aW5nID0gbGlzdCgpCiAgICBmb3IgZmlsZSBpbiBmaWxlczoKICAgICAgICBwcmludCgiRmlsZTogIiArIGZpbGUpCiAgICAgICAgb3V0ID0gcmVhZF9waWNrbGUoInJhdyIsIGZpbGUpCiAgICAgICAgcHJpbnQoInNhbXBsaW5nIikKICAgICAgICB0cmFpbmluZ19zYW1wbGUsIHRlc3Rpbmdfc2FtcGxlID0gZGl2aWRlKG91dCkKICAgICAgICB0cmFpbmluZyA9IHRyYWluaW5nICsgdHJhaW5pbmdfc2FtcGxlCjx8ZmltX2hvbGV8PgogICAgd3JpdGVfbmV3X3BpY2tsZSh0cmFpbmluZywgInRyYWluaW5nIikKICAgIHdyaXRlX25ld19waWNrbGUodGVzdGluZywgInRlc3RpbmciKQoKCmRlZiBzYW1wbGluZ19lc3R1cGlkbygpOgogICAgZmlsZXMgPSBnZXRfZmlsZV9uYW1lcygpCiAgICBmaW5hbCA9IGxpc3QoKQogICAgZm9yIGZpbGUgaW4gZmlsZXM6CiAgICAgICAgcHJpbnQoIkZpbGU6ICIgKyBmaWxlKQogICAgICAgIG91dCA9IHJlYWRfcGlja2xlKCJyYXciLCBmaWxlKQogICAgICAgIHByaW50KCJzYW1wbGluZyIpCiAgICAgICAgc3R1cGlkID0gZGl2aWRlX2VzdHVwaWRvKG91dCkKICAgICAgICBmaW5hbCA9IGZpbmFsICsgc3R1cGlkCiAgICAgICAgcHJpbnQoInRvIHBpY2tsZSIpCgogICAgd3JpdGVfbmV3X3BpY2tsZShmaW5hbCwgImxleGljb25fZGF0YXNldF9zbWFsbGVyIikKCgppZiBfX25hbWVfXyA9PSAnX19tYWluX18nOgogICAgc2FtcGxpbmdfZXN0dXBpZG8oKQo8fGZpbV9zdWZmaXh8PgogICAgICAgIHRlc3RpbmcgPSB0ZXN0aW5nICsgdGVzdGluZ19zYW1wbGUKICAgICAgICBwcmludCgidG8gcGlja2xlIikKCjx8ZmltX2VuZHw+
552dd4fbfb83fedc68ff42b955d9e8c83234e30c-2
552dd4fbfb83fedc68ff42b955d9e8c83234e30c
PHxmaW1fcHJlZml4fD4KZnJvbSBzcmMudXRpbHMudXRpbHMgaW1wb3J0IGdldF9maWxlX25hbWVzCmZyb20gc3JjLmRhdGEubWFrZV9zYW1wbGVfZGF0YXNldCBpbXBvcnQgZGl2aWRlLCB3cml0ZV9uZXdfcGlja2xlLCBkaXZpZGVfZXN0dXBpZG8KZnJvbSBzcmMuZGF0YS5pbXBvcnRfZGF0YXNldCBpbXBvcnQgIHJlYWRfcGlja2xlCgoKZGVmIHNhbXBsaW5nKCk6CiAgICBmaWxlcyA9IGdldF9maWxlX25hbWVzKCkKICAgIHRyYWluaW5nID0gbGlzdCgpCiAgICB0ZXN0aW5nID0gbGlzdCgpCiAgICBmb3IgZmlsZSBpbiBmaWxlczoKICAgICAgICBwcmludCgiRmlsZTogIiArIGZpbGUpCiAgICAgICAgb3V0ID0gcmVhZF9waWNrbGUoInJhdyIsIGZpbGUpCiAgICAgICAgcHJpbnQoInNhbXBsaW5nIikKICAgICAgICB0cmFpbmluZ19zYW1wbGUsIHRlc3Rpbmdfc2FtcGxlID0gZGl2aWRlKG91dCkKICAgICAgICB0cmFpbmluZyA9IHRyYWluaW5nICsgdHJhaW5pbmdfc2FtcGxlCiAgICAgICAgdGVzdGluZyA9IHRlc3RpbmcgKyB0ZXN0aW5nX3NhbXBsZQogICAgICAgIHByaW50KCJ0byBwaWNrbGUiKQoKICAgIHdyaXRlX25ld19waWNrbGUodHJhaW5pbmcsICJ0cmFpbmluZyIpCiAgICB3cml0ZV9uZXdfcGlja2xlKHRlc3RpbmcsICJ0ZXN0aW5nIikKCgpkZWYgc2FtcGxpbmdfZXN0dXBpZG8oKToKICAgIGZpbGVzID0gZ2V0X2ZpbGVfbmFtZXMoKQogICAgZmluYWwgPSBsaXN0KCkKICAgIGZvciBmaWxlIGluIGZpbGVzOgogICAgICAgIHByaW50KCJGaWxlOiAiICsgZmlsZSkKICAgICAgICBvdXQgPSByZWFkX3BpY2tsZSgicmF3IiwgZmlsZSkKICAgICAgICBwcmludCgic2FtcGxpbmciKQogICAgICAgIHN0dXBpZCA9IGRpdmlkZV9lc3R1cGlkbyhvdXQpCjx8ZmltX2hvbGV8PgogICAgd3JpdGVfbmV3X3BpY2tsZShmaW5hbCwgImxleGljb25fZGF0YXNldF9zbWFsbGVyIikKCgppZiBfX25hbWVfXyA9PSAnX19tYWluX18nOgogICAgc2FtcGxpbmdfZXN0dXBpZG8oKQo8fGZpbV9zdWZmaXh8PgogICAgICAgIGZpbmFsID0gZmluYWwgKyBzdHVwaWQKICAgICAgICBwcmludCgidG8gcGlja2xlIikKCjx8ZmltX2VuZHw+
552dd4fbfb83fedc68ff42b955d9e8c83234e30c-3
552dd4fbfb83fedc68ff42b955d9e8c83234e30c
PHxmaW1fcHJlZml4fD4KZnJvbSBzcmMudXRpbHMudXRpbHMgaW1wb3J0IGdldF9maWxlX25hbWVzCmZyb20gc3JjLmRhdGEubWFrZV9zYW1wbGVfZGF0YXNldCBpbXBvcnQgZGl2aWRlLCB3cml0ZV9uZXdfcGlja2xlLCBkaXZpZGVfZXN0dXBpZG8KZnJvbSBzcmMuZGF0YS5pbXBvcnRfZGF0YXNldCBpbXBvcnQgIHJlYWRfcGlja2xlCgoKZGVmIHNhbXBsaW5nKCk6CiAgICBmaWxlcyA9IGdldF9maWxlX25hbWVzKCkKICAgIHRyYWluaW5nID0gbGlzdCgpCiAgICB0ZXN0aW5nID0gbGlzdCgpCiAgICBmb3IgZmlsZSBpbiBmaWxlczoKICAgICAgICBwcmludCgiRmlsZTogIiArIGZpbGUpCiAgICAgICAgb3V0ID0gcmVhZF9waWNrbGUoInJhdyIsIGZpbGUpCiAgICAgICAgcHJpbnQoInNhbXBsaW5nIikKICAgICAgICB0cmFpbmluZ19zYW1wbGUsIHRlc3Rpbmdfc2FtcGxlID0gZGl2aWRlKG91dCkKICAgICAgICB0cmFpbmluZyA9IHRyYWluaW5nICsgdHJhaW5pbmdfc2FtcGxlCiAgICAgICAgdGVzdGluZyA9IHRlc3RpbmcgKyB0ZXN0aW5nX3NhbXBsZQogICAgICAgIHByaW50KCJ0byBwaWNrbGUiKQoKICAgIHdyaXRlX25ld19waWNrbGUodHJhaW5pbmcsICJ0cmFpbmluZyIpCiAgICB3cml0ZV9uZXdfcGlja2xlKHRlc3RpbmcsICJ0ZXN0aW5nIikKCgpkZWYgc2FtcGxpbmdfZXN0dXBpZG8oKToKICAgIGZpbGVzID0gZ2V0X2ZpbGVfbmFtZXMoKQogICAgZmluYWwgPSBsaXN0KCkKICAgIGZvciBmaWxlIGluIGZpbGVzOgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgcHJpbnQoIkZpbGU6ICIgKyBmaWxlKQogICAgICAgIG91dCA9IHJlYWRfcGlja2xlKCJyYXciLCBmaWxlKQogICAgICAgIHByaW50KCJzYW1wbGluZyIpCiAgICAgICAgc3R1cGlkID0gZGl2aWRlX2VzdHVwaWRvKG91dCkKPHxmaW1fZW5kfD4=
552dd4fbfb83fedc68ff42b955d9e8c83234e30c-4
552dd4fbfb83fedc68ff42b955d9e8c83234e30c
PHxmaW1fcHJlZml4fD4KZnJvbSBzcmMudXRpbHMudXRpb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iIyMjIiwgIlxuXG4iXQogICAgc3RvcCA9IE5vbmUKICAgIGVjaG86IGJvb2wgPSBUcnVlCiAgICAiIiIKPHxmaW1faG9sZXw+CiAgICBxdWVyeSA9IHJlLnN1YigiXG4rIiwgIiAiLCBxdWVyeSkKCiAgICBwcm9tcHQgPSBhc3NlbWJsZV9wcm9tcHQocXVlcnksIGV4YW1wbGVzPWV4YW1wbGVzLCBwcmVmaXhlcz0oIlRleHQ6ICIsICJDYXRlZ29yeTogIiksIHN1ZmZpeGVzPSgiXG4iLCAiXG4jIyNcbiIpKS5zdHJpcCgpCgogICAgcmVzcG9uc2UgPSBvcGVuYWkuQ29tcGxldGlvbi5jcmVhdGUoCiAgICAgICAgZW5naW5lPWVuZ2luZSwKICAgICAgICBwcm9tcHQ9cHJvbXB0LAogICAgICAgIHRlbXBlcmF0dXJlPXRlbXBlcmF0dXJlLAogICAgICAgIG1heF90b2tlbnM9bWF4X3Rva2VucywKICAgICAgICB0b3BfcD10b3BfcCwKICAgICAgICBmcmVxdWVuY3lfcGVuYWx0eT1mcmVxdWVuY3lfcGVuYWx0eSwKICAgICAgICBwcmVzZW5jZV9wZW5hbHR5PXByZXNlbmNlX3BlbmFsdHksCiAgICAgICAgc3RvcD1zdG9wLAogICAgICAgIGVjaG89ZWNobwogICAgKQoKICAgIGxvZ2dlci5kZWJ1ZyhyZXNwb25zZS5jaG9pY2VzWzBdLnRleHQpCgogICAgcmV0dXJuIHJlc3BvbnNlLmNob2ljZXNbMF0udGV4dAo8fGZpbV9zdWZmaXh8PgogICAgIyByZXBsYWNlICMje259IHdpdGggIy17bn0KICAgIHF1ZXJ5ID0gcmUuc3ViKHIiKD88PSMpIyIsICItIiwgc3RyKHF1ZXJ5KSkKCiAgICAjIHJlbW92ZSBcbgo8fGZpbV9lbmR8Pg==
592adf0d12e8de996c877652621c881059246d43-1
592adf0d12e8de996c877652621c881059246d43
PHxmaW1fcHJlZml4fD4KIwojIEBsYyBhcHA9bGVldGNvZGUgaWQ9MTUzIGxhbmc9cHl0aG9uMwojCiMgWzE1M10gRmluZCBNaW5pbXVtIGluIFJvdGF0ZWQgU29ydGVkIEFycmF5CiMKCiMgQGxjIGNvZGU9c3RhcnQKY2xhc3MgU29sdXRpb246Cjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgIGRlZiBmaW5kTWluKHNlbGYsIG51bXM6IExpc3RbaW50XSk6CiAgICAgICAgZm9yIGkgaW4gcmFuZ2UobGVuKG51bXMpIC0gMSk6CiAgICAgICAgICAgIGlmIG51bXNbaV0gPiBudW1zW2kgKyAxXToKICAgICAgICAgICAgICAgIHJldHVybiBudW1zW2kgKyAxXQo8fGZpbV9lbmR8Pg==
592adf0d12e8de996c877652621c881059246d43-2
592adf0d12e8de996c877652621c881059246d43
PHxmaW1fcHJlZml4fD4KIwojIEBsYyBhcHA9bGVldGNvZGUgaWQ9MTUzIGxhbmc9cHl0aG9uMwojCiMgWzE1M10gRmluZCBNaW5pbXVtIGluIFJvdGF0ZWQgU29ydGVkIEFycmF5Cjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KIwoKIyBAbGMgY29kZT1zdGFydApjbGFzcyBTb2x1dGlvbjoKPHxmaW1fZW5kfD4=
592adf0d12e8de996c877652621c881059246d43-3
592adf0d12e8de996c877652621c881059246d43
PHxmaW1fcHJlZml4fD4KIwojIEBsYyBhcHA9bGVldGNvZGUgaWQ9MTUzIGxhbmc9cHl0aG9uMwojCiMgWzE1M10gRmluZCBNaW5pbXVtIGluIFJvdGF0ZWQgU29ydGVkIEFycmF5CiMKCiMgQGxjIGNvZGU9c3RhcnQKPHxmaW1faG9sZXw+CiAgICAgICAgICAgICAgICByZXR1cm4gbnVtc1tpICsgMV0KICAgICAgICByZXR1cm4gbnVtc1swXQojIEBsYyBjb2RlPWVuZAoKPHxmaW1fc3VmZml4fD4KY2xhc3MgU29sdXRpb246CiAgICBkZWYgZmluZE1pbihzZWxmLCBudW1zOiBMaXN0W2ludF0pOgogICAgICAgIGZvciBpIGluIHJhbmdlKGxlbihudW1zKSAtIDEpOgogICAgICAgICAgICBpZiBudW1zW2ldID4gbnVtc1tpICsgMV06Cjx8ZmltX2VuZHw+
05826a5dd2474fa0f5ee6a57f4538065b0480a95-1
05826a5dd2474fa0f5ee6a57f4538065b0480a95
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9weXRob24KIyAtKi0gY29kaW5nOiB1dGYtOCAtKi0KaW1wb3J0IHB5Z2FtZQpmcm9tIHB5Z2FtZS5sb2NhbHMgaW1wb3J0ICoKZnJvbSBweWdhbWUuc3ByaXRlIGltcG9ydCBTcHJpdGUKaW1wb3J0IHBhdGhsaWIKaW1wb3J0IG9zCmltcG9ydCB0aW1lCgoKY2xhc3MgUGVyc29uYWplKFNwcml0ZSk6CiAgICBkZWYgX19pbml0X18oc2VsZik6CiAgICAgICAgc2VsZi5pbWFnZSA9IHBlcnNvbmFqZSA9IHB5Z2FtZS5pbWFnZS5sb2FkKAogICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdS5wbmciKS5jb252ZXJ0X2FscGhhKCkKICAgICAgICBzZWxmLnJlY3QgPSBzZWxmLmltYWdlLmdldF9yZWN0KCkKICAgICAgICBzZWxmLnJlY3QubW92ZV9pcCg1MCwgMzAwKQogICAgICAgIHNlbGYubXVlcnRvID0gMAoKICAgIGRlZiB1cGRhdGUoc2VsZik6CiAgICAgICAgdGVjbGFzID0gcHlnYW1lLmtleS5nZXRfcHJlc3NlZCgpCiAgICAgICAgaWYgdGVjbGFzW0tfU1BBQ0VdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWthbWVoYW1laGEucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgZWxpZiBrYW1laGFtZWhhLnJlY3QueCA+IDg2MDoKICAgICAgICAgICAgc2VsZi5pbWFnZSA9IHBlcnNvbmFqZSA9IHB5Z2FtZS5pbWFnZS5sb2FkKAogICAgICAgICAgICAgICAgIkltYWdlbmVzL2dva3UucG5nIikuY29udmVydF9hbHBoYSgpCgogICAgICAgIGlmIHRlY2xhc1tLX0xFRlRdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWxlZnQucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgICAgIGlmIHNlbGYucmVjdC54ID4gMDoKICAgICAgICAgICAgICAgIHNlbGYucmVjdC54IC09IDEwCiAgICAgICAgZWxpZiB0ZWNsYXNbS19SSUdIVF06CiAgICAgICAgICAgIHNlbGYuaW1hZ2UgPSBwZXJzb25hamUgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgICAgICJJbWFnZW5lcy9nb2t1cmlnaHQucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgICAgIGlmIHNlbGYucmVjdC54IDwgNzQwOgogICAgICAgICAgICAgICAgc2VsZi5yZWN0LnggKz0gMTAKCiAgICAgICAgaWYgdGVjbGFzW0tfVVBdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdXVwLnBuZyIpLmNvbnZlcnRfYWxwaGEoKQogICAgICAgICAgICBpZiBzZWxmLnJlY3QueSA+IDMyOgogICAgICAgICAgICAgICAgc2VsZi5yZWN0LnkgLT0gMTAKICAgICAgICBlbGlmIHRlY2xhc1tLX0RPV05dOgogICAgICAgICAgICBpZiBzZWxmLnJlY3QueSA8IDUzMDoKICAgICAgICAgICAgICAgIHNlbGYuaW1hZ2UgPSBwZXJzb25hamUgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWR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VdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWthbWVoYW1laGEucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgZWxpZiBrYW1laGFtZWhhLnJlY3QueCA+IDg2MDoKICAgICAgICAgICAgc2VsZi5pbWFnZSA9IHBlcnNvbmFqZSA9IHB5Z2FtZS5pbWFnZS5sb2FkKAogICAgICAgICAgICAgICAgIkltYWdlbmVzL2dva3UucG5nIikuY29udmVydF9hbHBoYSgpCgogICAgICAgIGlmIHRlY2xhc1tLX0xFRlRdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWxlZnQucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgICAgIGlmIHNlbGYucmVjdC54ID4gMDoKICAgICAgICAgICAgICAgIHNlbGYucmVjdC54IC09IDEwCiAgICAgICAgZWxpZiB0ZWNsYXNbS19SSUdIVF06CiAgICAgICAgICAgIHNlbGYuaW1hZ2UgPSBwZXJzb25hamUgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgICAgICJJbWFnZW5lcy9nb2t1cmlnaHQucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgICAgIGlmIHNlbGYucmVjdC54IDwgNzQwOgogICAgICAgICAgICAgICAgc2VsZi5yZWN0LnggKz0gMTAKCiAgICAgICAgaWYgdGVjbGFzW0tfVVBdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdXVwLnBuZyIpLmNvbnZlcnRfYWxwaGEoKQogICAgICAgICAgICBpZiBzZWxmLnJlY3QueSA+IDMyOgogICAgICAgICAgICAgICAgc2VsZi5yZWN0LnkgLT0gMTAKICAgICAgICBlbGlmIHRlY2xhc1tLX0RPV05dOgogICAgICAgICAgICBpZiBzZWxmLnJlY3QueSA8IDUzMDoKICAgICAgICAgICAgICAgIHNlbGYuaW1hZ2UgPSBwZXJzb25hamUgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWRvd24ucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgICAgICAgICBzZWxmLnJlY3QueSArPSAxMAoKCmNsYXNzIEthbWVoYW1laGEoU3ByaXRlKToKICAgIGRlZiBfX2luaXRfXyhzZWxmKToKICAgICAgICBzZWxmLmltYWdlID0ga2FtZWhhbWVoYSA9IHB5Z2FtZS5pbWFnZS5sb2FkKAogICAgICAgICAgICAiSW1hZ2VuZXMva2FtZWhhbWVoYS5naWYiKS5jb252ZXJ0X2FscGhhKCkKICAgICAgICBzZWxmLnJlY3QgPSBzZWxmLmltYWdlLmdldF9yZWN0KCkKICAgICAgICBzZWxmLnJlY3QubW92ZV9pcCg5MDAsIDcwMCkKCiAgICBkZWYgdXBkYXRlKHNlbGYpOgogICAgICAgIHRlY2xhcyA9IHB5Z2FtZS5rZXkuZ2V0X3ByZXNzZWQoKQogICAgICAgIGlmIHNlbGYucmVjdC54ID4gODQwOgogICAgICAgICAgICBpZiB0ZWNsYXNbS19TUEFDRV06CiAgICAgICAgICAgICAgICBzZWxmLnJlY3QueCA9IChwZXJzb25hamUucmVjdC54ICsgNjApCiAgICAgICAgICAgICAgICBzZWxmLnJlY3QueSA9IChwZXJzb25hamUucmVjdC55ICsgMTQpCiAgICAgICAgaWYgc2VsZi5yZWN0LnggPCA4NzA6CiAgICAgICAgICAgIHNlbGYucmVjdC54ICs9IDIwCgoKY2xhc3MgQmFycmF2aWRhZ29rdShTcHJpdGUpOgogICAgZGVmIF9faW5pdF9fKHNlbGYpOgogICAgICAgIHNlbGYuaW1hZ2UgPSBiYXJyYXZpZGFnb2t1ID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICJJbWFnZW5lcy9iYXJyYXZpZGFnb2t1LnBuZyIpLmNvbnZlcnRfYWxwaGEoKQogICAgICAgIHNlbGYucmVjdCA9IHNlbGYuaW1hZ2UuZ2V0X3JlY3QoKQogICAgICAgIHNlbGYucmVjdC5tb3ZlX2lwKDE4LCA0KQoKICAgIGRlZiB1cGRhdGUoc2VsZik6CiAgICAgICAgaWYgYmFycmF2aWRhZ29rdS5yZWN0LnggPD0gLTE1MjoKICAgICAgICAgICAgcGVyc29uYWplLm11ZXJ0byA9IDEKICAgICAgICBpZiBkaXNwYXJvLnJlY3QueSA+PSAocGVyc29uYWplLnJlY3QueSAtIDU2KToKICAgICAgICAgICAgaWYgZGlzcGFyby5yZWN0LnkgPD0gKHBlcnNvbmFqZS5yZWN0LnkgKyA2Mik6CiAgICAgICAgICAgICAgICBpZiBkaXNwYXJvLnJlY3QueCA+PSBwZXJzb25hamUucmVjdC54OgogICAgICAgICAgICAgICAgICAgIGlmIGRpc3Bhcm8ucmVjdC54IDw9IChwZXJzb25hamUucmVjdC54ICsgNDMpOgogICAgICAgICAgICAgICAgICAgICAgICBiYXJyYXZpZGFnb2t1LnJlY3QueCAtPSAyNgogICAgICAgICAgICAgICAgICAgICAgICBkaXNwYXJvLnJlY3QueCA9IC00MDAKICAgICAgICBpZiBtaW5pY2VsbC5yZWN0LnkgPj0gKHBlcnNvbmFqZS5yZWN0LnkgLSA1Nik6CiAgICAgICAgICAgIGlmIG1pbmljZWxsLnJlY3QueSA8PSAocGVyc29uYWplLnJlY3QueSArIDYyKToKICAgICAgICAgICAgICAgIGlmIG1pbmljZWxsLnJlY3QueCA+PSBwZXJzb25hamUucmVjdC54OgogICAgICAgICAgICAgICAgICAgIGlmIG1pbmljZWxsLnJlY3QueCA8PSAocGVyc29uYWplLnJlY3QueCArIDQzKToKICAgICAgICAgICAgICAgICAgICAgICAgYmFycmF2aWRhZ29rdS5yZWN0LnggLT0gMjYKICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGFyby5yZWN0LnggPSAtNDAwCgoKY2xhc3MgTWluaWNlbGwoU3ByaXRlKToKICAgIGRlZiBfX2luaXRfXyhzZWxmKToKICAgICAgICBzZWxmLmltYWdlID0gbWluaWNlbGwgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgIkltYWdlbmVzL21pbmljZWxsLnBuZyIpLmNvbnZlcnRfYWxwaGEoKQogICAgICAgIHNlbGYucmVjdCA9IHNlbGYuaW1hZ2UuZ2V0X3JlY3QoKQogICAgICAgIHNlbGYucmVjdC5tb3ZlX2lwKDc1MCwgMzAwKQogICAgICAgIHNlbGYuYmFuZGVyYSA9IDAKICAgICAgICBzZWxmLm11ZXJ0byA9IDAKCiAgICBkZWYgdXBkYXRlKHNlbGYpOgogICAgICAgIGlmIHNlbGYucmVjdC55ID09IDQwOgogICAgICAgICAgICBzZWxmLmJhbmRlcmEgPSAwCiAgICAgICAgZWxpZiBzZWxmLnJlY3QueSA9PSA1NDA6CiAgICAgICAgICAgIHNlbGYuYmFuZGVyYSA9IDEKCiAgICAgICAgaWYgc2VsZi5iYW5kZXJhID09IDA6CiAgICAgICAgICAgIHNlbGYucmVjdC55ICs9IDEwCiAgICAgICAgZWxpZiBzZWxmLmJhbmRlcmEgPT0gMToKICAgICAgICAgICAgc2VsZi5yZWN0LnkgLT0gMTAKCiAgICBkZWYgZGlmaWNpbChzZWxmKToKICAgICAgICBpZiBzZWxmLnJlY3QueCA8IDA6CiAgICAgICAgICAgIHNlbGYucmVjdC54ID0gODAwCiAgICAgICAgaWYgc2VsZi5yZWN0LnkgPiA2MDA6CiAgICAgICAgICAgIHNlbGYucmVjdC55ID0gMAogICAgICAgIHNlbGYucmVjdC54IC09IDEwCiAgICAgICAgc2VsZi5yZWN0LnkgKz0gMTAKCgpjbGFzcyBEaXNwYXJvKFNwcml0ZSk6CiAgICBkZWYgX19pbml0X18oc2VsZik6C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FscGhhKCkKICAgICAgICBzZWxmLnJlY3QgPSBzZWxmLmltYWdlLmdldF9yZWN0KCkKICAgICAgICBzZWxmLnJlY3QubW92ZV9pcCg1MCwgMzAwKQogICAgICAgIHNlbGYubXVlcnRvID0gMAoKICAgIGRlZiB1cGRhdGUoc2VsZik6CiAgICAgICAgdGVjbGFzID0gcHlnYW1lLmtleS5nZXRfcHJlc3NlZCgpCiAgICAgICAgaWYgdGVjbGFzW0tfU1BBQ0VdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWthbWVoYW1laGEucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgZWxpZiBrYW1laGFtZWhhLnJlY3QueCA+IDg2MDoKICAgICAgICAgICAgc2VsZi5pbWFnZSA9IHBlcnNvbmFqZSA9IHB5Z2FtZS5pbWFnZS5sb2FkKAogICAgICAgICAgICAgICAgIkltYWdlbmVzL2dva3UucG5nIikuY29udmVydF9hbHBoYSgpCgogICAgICAgIGlmIHRlY2xhc1tLX0xFRlRdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWxlZnQucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgICAgIGlmIHNlbGYucmVjdC54ID4gMDoKICAgICAgICAgICAgICAgIHNlbGYucmVjdC54IC09IDEwCiAgICAgICAgZWxpZiB0ZWNsYXNbS19SSUdIVF06CiAgICAgICAgICAgIHNlbGYuaW1hZ2UgPSBwZXJzb25hamUgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgICAgICJJbWFnZW5lcy9nb2t1cmlnaHQucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgICAgIGlmIHNlbGYucmVjdC54IDwgNzQwOgogICAgICAgICAgICAgICAgc2VsZi5yZWN0LnggKz0gMTAKCiAgICAgICAgaWYgdGVjbGFzW0tfVVBdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdXVwLnBuZyIpLmNvbnZlcnRfYWxwaGEoKQogICAgICAgICAgICBpZiBzZWxmLnJlY3QueSA+IDMyOgogICAgICAgICAgICAgICAgc2VsZi5yZWN0LnkgLT0gMTAKICAgICAgICBlbGlmIHRlY2xhc1tLX0RPV05dOgogICAgICAgICAgICBpZiBzZWxmLnJlY3QueSA8IDUzMDoKICAgICAgICAgICAgICAgIHNlbGYuaW1hZ2UgPSBwZXJzb25hamUgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWRvd24ucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgICAgICAgICBzZWxmLnJlY3QueSArPSAxMAoKCmNsYXNzIEthbWVoYW1laGEoU3ByaXRlKToKICAgIGRlZiBfX2luaXRfXyhzZWxmKToKICAgICAgICBzZWxmLmltYWdlID0ga2FtZWhhbWVoYSA9IHB5Z2FtZS5pbWFnZS5sb2FkKAogICAgICAgICAgICAiSW1hZ2VuZXMva2FtZWhhbWVoYS5naWYiKS5jb252ZXJ0X2FscGhhKCkKICAgICAgICBzZWxmLnJlY3QgPSBzZWxmLmltYWdlLmdldF9yZWN0KCkKICAgICAgICBzZWxmLnJlY3QubW92ZV9pcCg5MDAsIDcwMCkKCiAgICBkZWYgdXBkYXRlKHNlbGYpOgogICAgICAgIHRlY2xhcyA9IHB5Z2FtZS5rZXkuZ2V0X3ByZXNzZWQoKQogICAgICAgIGlmIHNlbGYucmVjdC54ID4gODQwOgogICAgICAgICAgICBpZiB0ZWNsYXNbS19TUEFDRV06CiAgICAgICAgICAgICAgICBzZWxmLnJlY3QueCA9IChwZXJzb25hamUucmVjdC54ICsgNjApCiAgICAgICAgICAgICAgICBzZWxmLnJlY3QueSA9IChwZXJzb25hamUucmVjdC55ICsgMTQpCiAgICAgICAgaWYgc2VsZi5yZWN0LnggPCA4NzA6CiAgICAgICAgICAgIHNlbGYucmVjdC54ICs9IDIwCgoKY2xhc3MgQmFycmF2aWRhZ29rdShTcHJpdGUpOgogICAgZGVmIF9faW5pdF9fKHNlbGYpOgogICAgICAgIHNlbGYuaW1hZ2UgPSBiYXJyYXZpZGFnb2t1ID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICJJbWFnZW5lcy9iYXJyYXZpZGFnb2t1LnBuZyIpLmNvbnZlcnRfYWxwaGEoKQogICAgICAgIHNlbGYucmVjdCA9IHNlbGYuaW1hZ2UuZ2V0X3JlY3QoKQogICAgICAgIHNlbGYucmVjdC5tb3ZlX2lwKDE4LCA0KQoKICAgIGRlZiB1cGRhdGUoc2VsZik6CiAgICAgICAgaWYgYmFycmF2aWRhZ29rdS5yZWN0LnggPD0gLTE1MjoKICAgICAgICAgICAgcGVyc29uYWplLm11ZXJ0byA9IDEKICAgICAgICBpZiBkaXNwYXJvLnJlY3QueSA+PSAocGVyc29uYWplLnJlY3QueSAtIDU2KToKICAgICAgICAgICAgaWYgZGlzcGFyby5yZWN0LnkgPD0gKHBlcnNvbmFqZS5yZWN0LnkgKyA2Mik6CiAgICAgICAgICAgICAgICBpZiBkaXNwYXJvLnJlY3QueCA+PSBwZXJzb25hamUucmVjdC54OgogICAgICAgICAgICAgICAgICAgIGlmIGRpc3Bhcm8ucmVjdC54IDw9IChwZXJzb25hamUucmVjdC54ICsgNDMpOgogICAgICAgICAgICAgICAgICAgICAgICBiYXJyYXZpZGFnb2t1LnJlY3QueCAtPSAyNgogICAgICAgICAgICAgICAgICAgICAgICBkaXNwYXJvLnJlY3QueCA9IC00MDAKICAgICAgICBpZiBtaW5pY2VsbC5yZWN0LnkgPj0gKHBlcnNvbmFqZS5yZWN0LnkgLSA1Nik6CiAgICAgICAgICAgIGlmIG1pbmljZWxsLnJlY3QueSA8PSAocGVyc29uYWplLnJlY3QueSArIDYyKToKICAgICAgICAgICAgICAgIGlmIG1pbmljZWxsLnJlY3QueCA+PSBwZXJzb25hamUucmVjdC54OgogICAgICAgICAgICAgICAgICAgIGlmIG1pbmljZWxsLnJlY3QueCA8PSAocGVyc29uYWplLnJlY3QueCArIDQzKToKICAgICAgICAgICAgICAgICAgICAgICAgYmFycmF2aWRhZ29rdS5yZWN0LnggLT0gMjYKICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGFyby5yZWN0LnggPSAtNDAwCgoKY2xhc3MgTWluaWNlbGwoU3ByaXRlKToKICAgIGRlZiBfX2luaXRfXyhzZWxmKToKICAgICAgICBzZWxmLmltYWdlID0gbWluaWNlbGwgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgIkltYWdlbmVzL21pbmljZWxsLnBuZyIpLmNvbnZlcnRfYWxwaGEoKQogICAgICAgIHNlbGYucmVjdCA9IHNlbGYuaW1hZ2UuZ2V0X3JlY3QoKQogICAgICAgIHNlbGYucmVjdC5tb3ZlX2lwKDc1MCwgMzAwKQogICAgICAgIHNlbGYuYmFuZGVyYSA9IDAKICAgICAgICBzZWxmLm11ZXJ0byA9IDAKCiAgICBkZWYgdXBkYXRlKHNlbGYpOgogICAgICAgIGlmIHNlbGYucmVjdC55ID09IDQwOgogICAgICAgICAgICBzZWxmLmJhbmRlcmEgPSAwCiAgICAgICAgZWxpZiBzZWxmLnJlY3QueSA9PSA1NDA6CiAgICAgICAgICAgIHNlbGYuYmFuZGVyYSA9IDEKCiAgICAgICAgaWYgc2VsZi5iYW5kZXJhID09IDA6CiAgICAgICAgICAgIHNlbGYucmVjdC55ICs9IDEwCiAgICAgICAgZWxpZiBzZWxmLmJhbmRlcmEgPT0gMToKICAgICAgICAgICAgc2VsZi5yZWN0LnkgLT0gMTAKCiAgICBkZWYgZGlmaWNpbChzZWxmKToKICAgICAgICBpZiBzZWxm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YXRlKHNlbGYpOgogICAgICAgIGlmIHNlbGYucmVjdC54ID49IDc4MjoKICAgICAgICAgICAgbWluaWNlbGwubXVlcnRvID0gMQogICAgICAgIGlmIGthbWVoYW1laGEucmVjdC55ID49IG1pbmljZWxsLnJlY3QueToKICAgICAgICAgICAgaWYga2FtZWhhbWVoYS5yZWN0LnkgPD0gKG1pbmljZWxsLnJlY3QueSArIDYyKToKICAgICAgICAgICAgICAgIGlmIGthbWVoYW1laGEucmVjdC54ID49IG1pbmljZWxsLnJlY3QueDoKICAgICAgICAgICAgICAgICAgICBpZiBrYW1laGFtZWhhLnJlY3QueCA8PSAobWluaWNlbGwucmVjdC54ICsgNDMpOgogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnJlY3QueCArPSA2CiAgICAgICAgICAgICAgICAgICAgICAgIGthbWVoYW1laGEucmVjdC54ID0gOTAwCgoKaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKICAgICMgVmFyaWFibGVzLgogICAgc2FsaXIgPSBGYWxzZQoKICAgICMgRXN0YWJsZXpjbyBsYSBwYW50YWxsYS4KICAgIHNjcmVlbiA9IHB5Z2FtZS5kaXNwbGF5LnNldF9tb2RlKCg4MDAsIDYwMCkpCgogICAgIyBFc3RhYmxlemNvIGVsIHTDrXR1bG8uCiAgICBweWdhbWUuZGlzcGxheS5zZXRfY2FwdGlvbigiRHJhZ29uIEJhbGwgLSBNaW5pVmVyc2UiKQoKICAgIHJvb3QgPSBwYXRobGliLlBhdGgoX19maWxlX18pLnBhcmVudC5hYnNvbHV0ZSgpCiAgICBwYXRobmFtZSA9IG9zLnBhdGguam9pbihyb290LCAidGl0dWxvREIuanBnIikKICAgIHRpdGxlX2ltYWdlID0gcHlnYW1lLmltYWdlLmxvYWQocGF0aG5hbWUpCiAgICBzY3JlZW4uYmxpdCh0aXRsZV9pbWFnZSwgKDAsIDApKQogICAgcHlnYW1lLmRpc3BsYXkudXBkYXRlKCkKICAgIHRpbWUuc2xlZXAoMikKCi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mRpZG8sICgyNTAsIDI2NCkpCiAgICAgICAgaWYgbWluaWNlbGwubXVlcnRvID09IDE6CiAgICAgICAgICAgIHNjcmVlbi5ibGl0KGhhc2dhbmFkbywgKDI1MCwgMjY0KSkKICAgICAgICBweWdhbWUuZGlzcGxheS5mbGlwKCkKCiAgICAgICAgaWYgcGVyc29uYWplLm11ZXJ0byA9PSAxOgogICAgICAgICAgICBweWdhbWUudGltZS5kZWxheSgzMDAwKQogICAgICAgICAgICBzYWxpciA9IFRydWUKICAgICAgICBlbGlmIG1pbmljZWxsLm11ZXJ0byA9PSAxOgogICAgICAgICAgICBweWdhbWUudGltZS5kZWxheSgzMDAwKQogICAgICAgICAgICBzYWxpciA9IFRydWUKICAgICAgICB0ZW1wb3JpemFkb3IudGljayg2MCkKCiAgICAgICAgIyBnZXN0aW9uIGRlIGV2ZW50b3MKICAgICAgICBmb3IgZXZlbnRvIGluIHB5Z2FtZS5ldmVudC5nZXQoKToKICAgICAgICAgICAgaWYgZXZlbnRvLnR5cGUgPT0gcHlnYW1lLlFVSVQ6CiAgICAgICAgICAgICAgICBzYWxpciA9IFRydWUKPHxmaW1fc3VmZml4fD4KICAgICAgICBpZiBzZWxmLnJlY3QueSA+IDYwMDoKICAgICAgICAgICAgc2VsZi5yZWN0LnkgPSAwCiAgICAgICAgc2VsZi5yZWN0LnggLT0gMTAKICAgICAgICBzZWxmLnJlY3QueSArPSAxMAo8fGZpbV9lbmR8Pg==
05826a5dd2474fa0f5ee6a57f4538065b0480a95-4
05826a5dd2474fa0f5ee6a57f4538065b0480a95
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9weXRob24KIyAtKi0gY29kaW5nOiB1dGYtOCAtKi0KaW1wb3J0IHB5Z2FtZQpmcm9tIHB5Z2FtZS5sb2NhbHMgaW1wb3J0ICoKZnJvbSBweWdhbWUuc3ByaXRlIGltcG9ydCBTcHJpdGUKaW1wb3J0IHBhdGhsaWIKaW1wb3J0IG9zCmltcG9ydCB0aW1lCgoKY2xhc3MgUGVyc29uYWplKFNwcml0ZSk6CiAgICBkZWYgX19pbml0X18oc2VsZik6CiAgICAgICAgc2VsZi5pbWFnZSA9IHBlcnNvbmFqZSA9IHB5Z2FtZS5pbWFnZS5sb2FkKAogICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdS5wbmciKS5jb252ZXJ0X2FscGhhKCkKICAgICAgICBzZWxmLnJlY3QgPSBzZWxmLmltYWdlLmdldF9yZWN0KCkKICAgICAgICBzZWxmLnJlY3QubW92ZV9pcCg1MCwgMzAwKQogICAgICAgIHNlbGYubXVlcnRvID0gMAoKICAgIGRlZiB1cGRhdGUoc2VsZik6CiAgICAgICAgdGVjbGFzID0gcHlnYW1lLmtleS5nZXRfcHJlc3NlZCgpCiAgICAgICAgaWYgdGVjbGFzW0tfU1BBQ0VdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWthbWVoYW1laGEucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgZWxpZiBrYW1laGFtZWhhLnJlY3QueCA+IDg2MDoKICAgICAgICAgICAgc2VsZi5pbWFnZSA9IHBlcnNvbmFqZSA9IHB5Z2FtZS5pbWFnZS5sb2FkKAogICAgICAgICAgICAgICAgIkltYWdlbmVzL2dva3UucG5nIikuY29udmVydF9hbHBoYSgpCgogICAgICAgIGlmIHRlY2xhc1tLX0xFRlRdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWxlZnQucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgICAgIGlmIHNlbGYucmVjdC54ID4gMDoKICAgICAgICAgICAgICAgIHNlbGYucmVjdC54IC09IDEwCiAgICAgICAgZWxpZiB0ZWNsYXNbS19SSUdIVF06CiAgICAgICAgICAgIHNlbGYuaW1hZ2UgPSBwZXJzb25hamUgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgICAgICJJbWFnZW5lcy9nb2t1cmlnaHQucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgICAgIGlmIHNlbGYucmVjdC54IDwgNzQwOgogICAgICAgICAgICAgICAgc2VsZi5yZWN0LnggKz0gMTAKCiAgICAgICAgaWYgdGVjbGFzW0tfVVBdOgogICAgICAgICAgICBzZWxmLmltYWdlID0gcGVyc29uYWplID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdXVwLnBuZyIpLmNvbnZlcnRfYWxwaGEoKQogICAgICAgICAgICBpZiBzZWxmLnJlY3QueSA+IDMyOgogICAgICAgICAgICAgICAgc2VsZi5yZWN0LnkgLT0gMTAKICAgICAgICBlbGlmIHRlY2xhc1tLX0RPV05dOgogICAgICAgICAgICBpZiBzZWxmLnJlY3QueSA8IDUzMDoKICAgICAgICAgICAgICAgIHNlbGYuaW1hZ2UgPSBwZXJzb25hamUgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgICAgICAgICAiSW1hZ2VuZXMvZ29rdWRvd24ucG5nIikuY29udmVydF9hbHBoYSgpCiAgICAgICAgICAgICAgICBzZWxmLnJlY3QueSArPSAxMAoKCmNsYXNzIEthbWVoYW1laGEoU3ByaXRlKToKICAgIGRlZiBfX2luaXRfXyhzZWxmKToKICAgICAgICBzZWxmLmltYWdlID0ga2FtZWhhbWVoYSA9IHB5Z2FtZS5pbWFnZS5sb2FkKAogICAgICAgICAgICAiSW1hZ2VuZXMva2FtZWhhbWVoYS5naWYiKS5jb252ZXJ0X2FscGhhKCkKICAgICAgICBzZWxmLnJlY3QgPSBzZWxmLmltYWdlLmdldF9yZWN0KCkKICAgICAgICBzZWxmLnJlY3QubW92ZV9pcCg5MDAsIDcwMCkKCiAgICBkZWYgdXBkYXRlKHNlbGYpOgogICAgICAgIHRlY2xhcyA9IHB5Z2FtZS5rZXkuZ2V0X3ByZXNzZWQoKQogICAgICAgIGlmIHNlbGYucmVjdC54ID4gODQwOgogICAgICAgICAgICBpZiB0ZWNsYXNbS19TUEFDRV06CiAgICAgICAgICAgICAgICBzZWxmLnJlY3QueCA9IChwZXJzb25hamUucmVjdC54ICsgNjApCiAgICAgICAgICAgICAgICBzZWxmLnJlY3QueSA9IChwZXJzb25hamUucmVjdC55ICsgMTQpCiAgICAgICAgaWYgc2VsZi5yZWN0LnggPCA4NzA6CiAgICAgICAgICAgIHNlbGYucmVjdC54ICs9IDIwCgoKY2xhc3MgQmFycmF2aWRhZ29rdShTcHJpdGUpOgogICAgZGVmIF9faW5pdF9fKHNlbGYpOgogICAgICAgIHNlbGYuaW1hZ2UgPSBiYXJyYXZpZGFnb2t1ID0gcHlnYW1lLmltYWdlLmxvYWQoCiAgICAgICAgICAgICJJbWFnZW5lcy9iYXJyYXZpZGFnb2t1LnBuZyIpLmNvbnZlcnRfYWxwaGEoKQogICAgICAgIHNlbGYucmVjdCA9IHNlbGYuaW1hZ2UuZ2V0X3JlY3QoKQogICAgICAgIHNlbGYucmVjdC5tb3ZlX2lwKDE4LCA0KQoKICAgIGRlZiB1cGRhdGUoc2VsZik6CiAgICAgICAgaWYgYmFycmF2aWRhZ29rdS5yZWN0LnggPD0gLTE1MjoKICAgICAgICAgICAgcGVyc29uYWplLm11ZXJ0byA9IDEKICAgICAgICBpZiBkaXNwYXJvLnJlY3QueSA+PSAocGVyc29uYWplLnJlY3QueSAtIDU2KToKICAgICAgICAgICAgaWYgZGlzcGFyby5yZWN0LnkgPD0gKHBlcnNvbmFqZS5yZWN0LnkgKyA2Mik6CiAgICAgICAgICAgICAgICBpZiBkaXNwYXJvLnJlY3QueCA+PSBwZXJzb25hamUucmVjdC54OgogICAgICAgICAgICAgICAgICAgIGlmIGRpc3Bhcm8ucmVjdC54IDw9IChwZXJzb25hamUucmVjdC54ICsgNDMpOgogICAgICAgICAgICAgICAgICAgICAgICBiYXJyYXZpZGFnb2t1LnJlY3QueCAtPSAyNgogICAgICAgICAgICAgICAgICAgICAgICBkaXNwYXJvLnJlY3QueCA9IC00MDAKICAgICAgICBpZiBtaW5pY2VsbC5yZWN0LnkgPj0gKHBlcnNvbmFqZS5yZWN0LnkgLSA1Nik6CiAgICAgICAgICAgIGlmIG1pbmljZWxsLnJlY3QueSA8PSAocGVyc29uYWplLnJlY3QueSArIDYyKToKICAgICAgICAgICAgICAgIGlmIG1pbmljZWxsLnJlY3QueCA+PSBwZXJzb25hamUucmVjdC54OgogICAgICAgICAgICAgICAgICAgIGlmIG1pbmljZWxsLnJlY3QueCA8PSAocGVyc29uYWplLnJlY3QueCArIDQzKToKICAgICAgICAgICAgICAgICAgICAgICAgYmFycmF2aWRhZ29rdS5yZWN0LnggLT0gMjYKICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGFyby5yZWN0LnggPSAtNDAwCgoKY2xhc3MgTWluaWNlbGwoU3ByaXRlKToKICAgIGRlZiBfX2luaXRfXyhzZWxmKToKICAgICAgICBzZWxmLmltYWdlID0gbWluaWNlbGwgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgIkltYWdlbmVzL21pbmljZWxsLnBuZyIpLmNvbnZlcnRfYWxwaGEoKQogICAgICAgIHNlbGYucmVjdCA9IHNlbGYuaW1hZ2UuZ2V0X3JlY3QoKQogICAgICAgIHNlbGYucmVjdC5tb3ZlX2lwKDc1MCwgMzAwKQogICAgICAgIHNlbGYuYmFuZGVyYSA9IDAKICAgICAgICBzZWxmLm11ZXJ0byA9IDAKCiAgICBkZWYgdXBkYXRlKHNlbGYpOgogICAgICAgIGlmIHNlbGYucmVjdC55ID09IDQwOgogICAgICAgICAgICBzZWxmLmJhbmRlcmEgPSAwCiAgICAgICAgZWxpZiBzZWxmLnJlY3QueSA9PSA1NDA6CiAgICAgICAgICAgIHNlbGYuYmFuZGVyYSA9IDEKCiAgICAgICAgaWYgc2VsZi5iYW5kZXJhID09IDA6CiAgICAgICAgICAgIHNlbGYucmVjdC55ICs9IDEwCiAgICAgICAgZWxpZiBzZWxmLmJhbmRlcmEgPT0gMToKICAgICAgICAgICAgc2VsZi5yZWN0LnkgLT0gMTAKCiAgICBkZWYgZGlmaWNpbChzZWxmKToKICAgICAgICBpZiBzZWxmLnJlY3QueCA8IDA6CiAgICAgICAgICAgIHNlbGYucmVjdC54ID0gODAwCiAgICAgICAgaWYgc2VsZi5yZWN0LnkgPiA2MDA6CiAgICAgICAgICAgIHNlbGYucmVjdC55ID0gMAogICAgICAgIHNlbGYucmVjdC54IC09IDEwCiAgICAgICAgc2VsZi5yZWN0LnkgKz0gMTAKCgpjbGFzcyBEaXNwYXJvKFNwcml0ZSk6CiAgICBkZWYgX19pbml0X18oc2VsZik6CiAgICAgICAgc2VsZi5pbWFnZSA9IGJhcnJhdmlkYWdva3UgPSBweWdhbWUuaW1hZ2UubG9hZCgKICAgICAgICAgICAgIkltYWdlbmVzL2Rpc3Bhcm9taW5pY2VsbC5wbmciKS5jb252ZXJ0X2FscGhhKCkKICAgICAgICBzZWxmLnJlY3QgPSBzZWxmLmltYWdlLmdldF9yZWN0KCkKICAgICAgICBzZWxmLnJlY3QubW92ZV9pcCgtNDAwLCAtNDAwKQoKICAgIGRlZiB1cGRhdGUoc2VsZik6CiAgICAgICAgaWYgc2VsZi5yZWN0LnggPT0gLTQwMDoKICAgICAgICAgICAgaWYgbWluaWNlbGwucmVjdC55ID09IHBlcnNvbmFqZS5yZWN0Lnk6CiAgICAgICAgICAgICAgICBzZWxmLnJlY3QueCA9IChtaW5pY2VsbC5yZWN0LnggLSA2MCkKICAgICAgICAgICAgICAgIHNlbGYucmVjdC55ID0gKG1pbmljZWxsLnJlY3QueSAtIDE0KQogICAgICAgIGlmIHNlbGYucmVjdC54ID4gLTQwMDoKICAgICAgICAgICAgc2VsZi5yZWN0LnggLT0gNQoKCmNsYXNzIEJhcnJhdmlkYW1pbmljZWxs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W4gbmFtZS4iKQoKICAgIGRlZiB0cmFpbihzZWxmKToKICAgICAgICAiIiJUcmFpbnMgdGhlIFEgbmV0d29yayB1c2luZyB0aGUgcmVwbGF5IG1lbW9yeSBhbmQgdGhlIGZyb3plbiBRCiAgICAgICAgdGFyZ2V0IG5ldHdvcmsuIEFmdGVyd2FyZHMgaXQgc2F2ZXMgdGhlIFEgbW9kZWwuIiIiCiAgICAgICAgcHJpbnQoIlN0YXJ0aW5nIHRyYWluaW5nIG9mIG1vZGVsOiAiLCBzZWxmLmNmZy5tb2RlbF9kaXIpCgo8fGZpbV9ob2xlfD4KICAgICAgICB0cnk6CgogICAgICAgICAgICBmb3Igc2VsZi5jZmcuZXBpc29kZV9jb3VudGVyIGluIHJhbmdlKHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlciwgc2VsZi5jZmcuZXBpc29kZXMpOgoKICAgICAgICAgICAgICAgIHN0YXRlID0gc2VsZi53cmFwcGVkX2Vudi5nZXRfaW5pdGlhbF9zdGF0ZSgpCiAgICAgICAgICAgICAgICBzZWxmLmNmZy5zZXRfYWN0aW9uX3N0YXQoc2VsZi53cmFwcGVkX2Vudi5hY3Rpb25fc3BhY2Vfc2l6ZSkKCiAgICAgICAgICAgICAgICBzY29yZSA9IDAKCiAgICAgICAgICAgICAgICBmb3IgXyBpbiByYW5nZShzZWxmLmNmZy50aW1lX3N0ZXBzKToKICAgICAgICAgICAgICAgICAgICBRX3ZhbHVlc19mb3JfYWN0aW9ucyA9IHNlbGYub3BlcmF0aW9uc1siUSJdLmV2YWwoCiAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb249c2VsZi5zZXNzaW9uLAogICAgICAgICAgICAgICAgICAgICAgICBmZWVkX2RpY3Q9ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vcGVyYXRpb25zWyJRX3N0YXRlIl06IFtzdGF0ZV0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICkKCiAgICAgIC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zZWxmLmNmZy5yZXBsYXlfc3RhcnRfc2l6ZToKCiAgICAgICAgICAgICAgICAgICAgICAgIHJlcGxheV9tZW1vcnlfc2FtcGxlID0gcmVwbGF5X21lbW9yeS5zYW1wbGUoKQoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zZXNzaW9uLnJ1bihzZWxmLm9wZXJhdGlvbnNbInVwZGF0ZSJdLCBmZWVkX2RpY3Q9ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vcGVyYXRpb25zWyJRX3N0YXRlIl06IHJlcGxheV9tZW1vcnlfc2FtcGxlLnN0YXRlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vcGVyYXRpb25zWyJRX3RhcmdldF9zdGF0ZSJdOiByZXBsYXlfbWVtb3J5X3NhbXBsZS5uZXh0X3N0YXRlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vcGVyYXRpb25zWyJhY3Rpb24iXTogcmVwbGF5X21lbW9yeV9zYW1wbGUuYWN0aW9uLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vcGVyYXRpb25zWyJyZXdhcmQiXTogcmVwbGF5X21lbW9yeV9zYW1wbGUucmV3YXJkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vcGVyYXRpb25zWyJkb25lIl06IHJlcGxheV9tZW1vcnlfc2FtcGxlLmRvbmUKICAgICAgICAgICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuY2ZnLnRyYWluX3N0ZXBzX2NvdW50ZXIgKz0gMQoKICAgICAgICAgICAgICAgICAgICBzZWxmLmNmZy5hY3Rpb25fc3RhdFthY3Rpb25dICs9IDEKICAgICAgICAgICAgICAgICAgICBzY29yZSArPSByZXdhcmQKICAgICAgICAgICAgICAgICAgICBzZWxmLmNmZy50b3RhbF9zdGVwc19jb3VudGVyICs9IDEKCiAgICAgICAgICAgICAgICAgICAgaWYgZG9uZToKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWsKCiAgICAgICAgICAgICAgICBzY29yZXMuYXBwZW5kKHNjb3JlKQoKICAgICAgICAgICAgICAgIHByaW50KCJFcGlzb2RlOiAiLCBzZWxmLmNmZy5lcGlzb2RlX2NvdW50ZXIpCiAgICAgICAgICAgICAgICBwcmludCgiXHRTY29yZSBtZWFuOiAiLCByb3VuZChtZWFuKHNjb3JlcyksMikpCiAgICAgICAgICAgICAgICBwcmludCgiXHRTY29yZSBtZWRpYW46ICIsIG1lZGlhbihzY29yZXMpKQogICAgICAgICAgICAgICAgcHJpbnQoIlx0U2NvcmUgbW9kZTogIiwgbWF4KHNldChzY29yZXMpLCBrZXk9c2NvcmVzLmNvdW50KSkKICAgICAgICAgICAgICAgIHByaW50KCJcdEFjdGlvbiBzdGF0OiAiLCBzZWxmLmNmZy5hY3Rpb25fc3RhdCkKICAgICAgICAgICAgICAgIHByaW50KCJcdFRvdGFsIHN0ZXBzOiAiLCBzZWxmLmNmZy50b3RhbF9zdGVwc19jb3VudGVyKQogICAgICAgICAgICAgICAgcHJpbnQoIlx0VHJhaW4gc3RlcHM6ICIsIHNlbGYuY2ZnLnRyYWluX3N0ZXBzX2NvdW50ZXIpCiAgICAgICAgICAgICAgICBwcmludCgiXHRFcHNpbG9uOiAiLCByb3VuZChzZWxmLmNmZy5lcHNpbG9uLCAyKSkKICAgICAgICAgICAgICAgIHByaW50KCkKCiAgICAgICAgICAgICAgICAjIEV2YWx1YXRpbmcKICAgICAgICAgICAgICAgIGlmIChzZWxmLmNmZy5lcGlzb2RlX2NvdW50ZXIrMSkgJSA1MCA9PSAwOgogICAgICAgICAgICAgICAgICAgIHNlbGYuZXZhbHVhdGlvbihzZWxmLmNmZy5lcGlzb2RlX2NvdW50ZXIpCiAgICAgICAgICAgICAgICAKICAgICAgICBleGNlcHQgS2V5Ym9hcmRJbnRlcnJ1cHQ6CiAgICAgICAgICAgIHByaW50KCJTYXZpbmcgbW9kZWwgdG8gIiw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ICAgICAgICAgICAgICAgICAgICAgIHNlbGYub3BlcmF0aW9uc1siUV9zdGF0ZSJdOiBbc3RhdGVdCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgKQoKICAgICAgICAgICAgICAgIGFjdGlvbiA9IG5wLmFyZ21heChRX3ZhbHVlc19mb3JfYWN0aW9ucykKICAgICAgICAgICAgICAgIHN0YXRlLCByZXdhcmQsIGRvbmUgPSBzZWxmLndyYXBwZWRfZW52LnN0ZXAoYWN0aW9uKQoKICAgICAgICAgICAgICAgIHNjb3JlICs9IHJld2FyZAogICAgICAgICAgICAgICAgc3RlcCArPSAxCgogICAgICAgICAgICBzY29yZXMuYXBwZW5kKHNjb3JlKQoKICAgICAgICBzZWxmLmV2YWxfc3RhdHMuc2V0ZGVmYXVsdCh0cmFpbl9lcGlzb2RlX2NvdW50ZXIsIHNjb3JlcykKCiAgICAgICAgIyBEcmF3IHN0YXQKICAgICAgICBmaWcgPSBwbHQuZmlndXJlKCkKICAgICAgICB4ID0gW10KICAgICAgICB5ID0gW10KICAgICAgICBmb3IgZXBpc29kZSwgc2NvcmVzIGluIHNlbGYuZXZhbF9zdGF0cy5pdGVtcygpOgogICAgICAgICAgICAgICAgeCArPSBbZXBpc29kZV0qbGVuKHNjb3JlcykKICAgICAgICAgICAgICAgIHkuZXh0ZW5kKHNjb3JlcykKICAgICAgICBwbHQucGxvdCh4LCB5LCAiLiIpCiAgICAgICAgcGx0LnhsYWJlbCgiVHJhaW4gZXBpc29kZXMiKQogICAgICAgIHBsdC55bGFiZWwoIkV2YWx1YXRpb24gc2NvcmVzIikKICAgICAgICBmaWcuc2F2ZWZpZyhvcy5wYXRoLmpvaW4oc2VsZi5jZmcubW9kZWxfZGlyLCAiZXZhbCIpKQogICAgICAgIHBsdC5jbG9zZShmaWcpCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgcmVwbGF5X21lbW9yeSA9IFJlcGxheU1lbW9yeShzZWxmLmNmZykKCiAgICAgICAgc2N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MgdGhlIFEgbW9kZWwuIiIiCiAgICAgICAgcHJpbnQoIlN0YXJ0aW5nIHRyYWluaW5nIG9mIG1vZGVsOiAiLCBzZWxmLmNmZy5tb2RlbF9kaXIpCgogICAgICAgIHJlcGxheV9tZW1vcnkgPSBSZXBsYXlNZW1vcnkoc2VsZi5jZmcpCgogICAgICAgIHNjb3JlcyA9IHNlbGYuY2ZnLmdldF9zY29yZXNfbGlzdCgpCgogICAgICAgIHRyeToKCiAgICAgICAgICAgIGZvciBzZWxmLmNmZy5lcGlzb2RlX2NvdW50ZXIgaW4gcmFuZ2Uoc2VsZi5jZmcuZXBpc29kZV9jb3VudGVyLCBzZWxmLmNmZy5lcGlzb2Rlcyk6CgogICAgICAgICAgICAgICAgc3RhdGUgPSBzZWxmLndyYXBwZWRfZW52LmdldF9pbml0aWFsX3N0YXRlKCkKICAgICAgICAgICAgICAgIHNlbGYuY2ZnLnNldF9hY3Rpb25fc3RhdChzZWxmLndyYXBwZWRfZW52LmFjdGlvbl9zcGFjZV9zaXplKQoKICAgICAgICAgICAgICAgIHNjb3JlID0gMAoKICAgICAgICAgICAgICAgIGZvciBfIGluIHJhbmdlKHNlbGYuY2ZnLnRpbWVfc3RlcHMpOgogICAgICAgICAgICAgICAgICAgIFFfdmFsdWVzX2Zvcl9hY3Rpb25zID0gc2VsZi5vcGVyYXRpb25zWyJRIl0uZXZhbCgKICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbj1zZWxmLnNlc3Npb24sCiAgICAgICAgICAgICAgICAgICAgICAgIGZlZWRfZGljdD17CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbIlFfc3RhdGUiXTogW3N0YXRlXQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgKQoKICAgICAgICAgICAgICAgICAgICBhY3Rpb24gPSBzZWxmLndyYXBwZWRfZW52LmdldF9hY3Rpb24oUV92YWx1ZXNfZm9yX2FjdGlvbn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sYXlfbWVtb3J5LnNhbXBsZSgpCgogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNlc3Npb24ucnVuKHNlbGYub3BlcmF0aW9uc1sidXBkYXRlIl0sIGZlZWRfZGljdD17CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbIlFfc3RhdGUiXTogcmVwbGF5X21lbW9yeV9zYW1wbGUuc3RhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbIlFfdGFyZ2V0X3N0YXRlIl06IHJlcGxheV9tZW1vcnlfc2FtcGxlLm5leHRfc3RhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbImFjdGlvbiJdOiByZXBsYXlfbWVtb3J5X3NhbXBsZS5hY3Rpb24sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbInJld2FyZCJdOiByZXBsYXlfbWVtb3J5X3NhbXBsZS5yZXdhcmQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbImRvbmUiXTogcmVwbGF5X21lbW9yeV9zYW1wbGUuZG9uZQogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5jZmcudHJhaW5fc3RlcHNfY291bnRlciArPSAxCgogICAgICAgICAgICAgICAgICAgIHNlbGYuY2ZnLmFjdGlvbl9zdGF0W2FjdGlvbl0gKz0gMQogICAgICAgICAgICAgICAgICAgIHNjb3JlICs9IHJld2FyZAogICAgICAgICAgICAgICAgICAgIHNlbGYuY2ZnLnRvdGFsX3N0ZXBzX2NvdW50ZXIgKz0gMQoKICAgICAgICAgICAgICAgICAgICBpZiBkb25lOgogICAgICAgICAgICAgICAgICAgICAgICBicmVhawoKICAgICAgICAgICAgICAgIHNjb3Jlcy5hcHBlbmQoc2NvcmUpCgogICAgICAgICAgICAgICAgcHJpbnQoIkVwaXNvZGU6ICIsIHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcikKICAgICAgICAgICAgICAgIHByaW50KCJcdFNjb3JlIG1lYW46ICIsIHJvdW5kKG1lYW4oc2NvcmVzKSwyKSkKICAgICAgICAgICAgICAgIHByaW50KCJcdFNjb3JlIG1lZGlhbjogIiwgbWVkaWFuKHNjb3JlcykpCiAgICAgICAgICAgICAgICBwcmludCgiXHRTY29yZSBtb2RlOiAiLCBtYXgoc2V0KHNjb3JlcyksIGtleT1zY29yZXMuY291bnQpKQogICAgICAgICAgICAgICAgcHJpbnQoIlx0QWN0aW9uIHN0YXQ6ICIsIHNlbGYuY2ZnLmFjdGlvbl9zdGF0KQogICAgICAgICAgICAgICAgcHJpbnQoIlx0VG90YWwgc3RlcHM6ICIsIHNlbGYuY2ZnLnRvdGFsX3N0ZXBzX2NvdW50ZXIpCiAgICAgICAgICAgICAgICBwcmludCgiXHRUcmFpbiBzdGVwczogIiwgc2VsZi5jZmcudHJhaW5fc3RlcHNfY291bnRlcikKICAgICAgICAgICAgICAgIHByaW50KCJcdEVwc2lsb246ICIsIHJvdW5kKHNlbGYuY2ZnLmVwc2lsb24sIDIpKQogICAgICAgICAgICAgICAgcHJpbnQoKQoKICAgICAgICAgICAgICAgICMgRXZhbHVhdGluZwogICAgICAgICAgICAgICAgaWYgKHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcisxKSAlIDUwID09IDA6CiAgICAgICAgICAgICAgICAgICAgc2VsZi5ldmFsdWF0aW9uKHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcikKICAgICAgICAgICAgICAgIAogICAgICAgIGV4Y2VwdCBLZXlib2FyZEludGVycnVwdDoKICAgICAgICAgICAgcHJpbnQoIlNhdmluZyBtb2RlbCB0byAiLCBzZWxmLmNmZy5tb2RlbF9kaXIpCgogICAgICAgICAgICBzZWxmLnNhdmVyLnNhdmUoc2VsZi5zZXNzaW9uLCBvcy5wYXRoLmpvaW4oc2VsZi5jZmcubW9kZWxfZGlyLCAicS1tb2RlbCIpKQoKICAgICAgICAgICAgc2VsZi5jZmcuc2F2ZShzY29yZXMsIHNlbGYuZXZhbF9zdGF0cykKCiAgICAgICAgICAgIHNlbGYuZXZhbHVhdGlvbihzZWxmLmNmZy5lcGlzb2RlX2NvdW50ZXIpCgogICAgICAgICAgICBzZWxmLndyYXBwZWRfZW52LmNsb3NlKCkKCiAgICBkZWYgZXZhbHVhdGlvbihzZWxmLCB0cmFpbl9lcGlzb2RlX2NvdW50ZXIpOgogICAgICAgICIiIkV2YWx1YXRlcyBhIGdpdmVuIFEgbW9kZWwgaW4gYSBnYW1lIGVudmlyb25tZW50LiIiIgoKICAgICAgICBwcmludCgiU3RhcnRpbmcgZXZhbHVhdGlvbiBvZiBtb2RlbDogIiwgc2VsZi5jZmcubW9kZWxfZGlyKQoKICAgICAgICBzY29yZXMgPSBbXQogICAgICAgIGZvciBlcGlzb2RlIGluIHJhbmdlKHNlbGYuY2ZnLmV2YWxfZXBpc29kZXMpOgogICAgICAgICAgICBkb25lID0gRmFsc2UKICAgICAgICAgICAgc2NvcmUgPSAwCiAgICAgICAgICAgIHN0YXRlID0gc2VsZi53cmFwcGVkX2Vudi5nZXRfaW5pdGlhbF9zdGF0ZSgpCiAgICAgICAgICAgIHN0ZXAgPSAwCiAgICAgICAgICAgIHdoaWxlIG5vdCBkb25lIGFuZCBzdGVwIDwgc2VsZi5jZmcudGltZV9zdGVwczoKCiAgICAgICAgICAgICAgICBRX3ZhbHVlc19mb3JfYWN0aW9ucyA9IHNlbGYub3BlcmF0aW9uc1siUSJdLmV2YWwoCiAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbj1zZWxmLnNlc3Npb24sCiAgICAgICAgICAgICAgICAgICAgZmVlZF9kaWN0PXsKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vcGVyYXRpb25zWyJRX3N0YXRlIl06IFtzdGF0ZV0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICA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sdWVzX2Zvcl9hY3Rpb25zID0gc2VsZi5vcGVyYXRpb25zWyJRIl0uZXZhbCgKICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbj1zZWxmLnNlc3Npb24sCiAgICAgICAgICAgICAgICAgICAgICAgIGZlZWRfZGljdD17CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbIlFfc3RhdGUiXTogW3N0YXRlXQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgKQoKICAgICAgICAgICAgICAgICAgICBhY3Rpb24gPSBzZWxmLndyYXBwZWRfZW52LmdldF9hY3Rpb24oUV92YWx1ZXNfZm9yX2FjdGlvbnMpCgogICAgICAgICAgICAgICAgICAgIG5leHRfc3RhdGUsIHJld2FyZCwgZG9uZSA9IHNlbGYud3JhcHBlZF9lbnYuc3RlcChhY3Rpb24pCgogICAgICAgICAgICAgICAgICAgIHJlcGxheV9tZW1vcnkucmVjb3JkX2V4cGVyaWVuY2Uoc3RhdGUsIGFjdGlvbiwgcmV3YXJkLCBuZXh0X3N0YXRlLCBkb25lKQoKICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IG5leHRfc3RhdGUKCiAgICAgICAgICAgICAgICAgICAgIyBDbG9uZSBRIG5ldHdvcmsgd2VpZ2h0cyBldmVyeSBzZWxmLmNmZy50YXJnZXRfbmV0d29ya191cGRhdGVfZnJlcXVlbmN5IHN0ZXAuCiAgICAgICAgICAgICAgICAgICAgaWYgc2VsZi5jZmcudG90YWxfc3RlcHNfY291bnRlciAlIHNlbGYuY2ZnLnRhcmdldF9uZXR3b3JrX3VwZGF0ZV9mcmVxdWVuY3kgPT0gMDoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zZXNzaW9uLnJ1bihzZWxmLm9wZXJhdGlvbnNbImNsb25lX1FfdG9fUV90YXJnZXQiXSkKCiAgICAgICAgICAgICAgICAgICAgIyBFc2NhbGF0ZSBhIGdyYWRpZW50IHVwZGF0ZSBzdGVwIG9uIFEgbmV0d29yayBldmVyeSBzZWxmLmNmZy51cGRhdGVfZnJlcXVlbmN5IHN0ZXAgKGlmIHdlIGhhdmUgZW5vdWdoIGRhdGEpLgogICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLmNmZy50b3RhbF9zdGVwc19jb3VudGVyICUgc2VsZi5jZmcudXBkYXRlX2ZyZXF1ZW5jeSA9PSAwIG9yIGRvbmUpIGFuZCBzZWxmLmNmZy50b3RhbF9zdGVwc19jb3VudGVyID49IHNlbGYuY2ZnLnJlcGxheV9zdGFydF9zaXplOgoKICAgICAgICAgICAgICAgICAgICAgICAgcmVwbGF5X21lbW9yeV9zYW1wbGUgPSByZXBsYXlfbWVtb3J5LnNhbXBsZSgpCgogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNlc3Npb24ucnVuKHNlbGYub3BlcmF0aW9uc1sidXBkYXRlIl0sIGZlZWRfZGljdD17CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbIlFfc3RhdGUiXTogcmVwbGF5X21lbW9yeV9zYW1wbGUuc3RhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbIlFfdGFyZ2V0X3N0YXRlIl06IHJlcGxheV9tZW1vcnlfc2FtcGxlLm5leHRfc3RhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbImFjdGlvbiJdOiByZXBsYXlfbWVtb3J5X3NhbXBsZS5hY3Rpb24sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbInJld2FyZCJdOiByZXBsYXlfbWVtb3J5X3NhbXBsZS5yZXdhcmQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbImRvbmUiXTogcmVwbGF5X21lbW9yeV9zYW1wbGUuZG9uZQogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5jZmcudHJhaW5fc3RlcHNfY291bnRlciArPSAxCgogICAgICAgICAgICAgICAgICAgIHNlbGYuY2ZnLmFjdGlvbl9zdGF0W2FjdGlvbl0gKz0gMQogICAgICAgICAgICAgICAgICAgIHNjb3JlICs9IHJld2FyZAogICAgICAgICAgICAgICAgICAgIHNlbGYuY2ZnLnRvdGFsX3N0ZXBzX2NvdW50ZXIgKz0gMQoKICAgICAgICAgICAgICAgICAgICBpZiBkb25lOgogICAgICAgICAgICAgICAgICAgICAgICBicmVhawoKICAgICAgICAgICAgICAgIHNjb3Jlcy5hcHBlbmQoc2NvcmUpCgogICAgICAgICAgICAgICAgcHJpbnQoIkVwaXNvZGU6ICIsIHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcikKICAgICAgICAgICAgICAgIHByaW50KCJcdFNjb3JlIG1lYW46ICIsIHJvdW5kKG1lYW4oc2NvcmVzKSwyKSkKICAgICAgICAgICAgICAgIHByaW50KCJcdFNjb3JlIG1lZGlhbjogIiwgbWVkaWFuKHNjb3JlcykpCiAgICAgICAgICAgICAgICBwcmludCgiXHRTY29yZSBtb2RlOiAiLCBtYXgoc2V0KHNjb3JlcyksIGtleT1zY29yZXMuY291bnQpKQogICAgICAgICAgICAgICAgcHJpbnQoIlx0QWN0aW9uIHN0YXQ6ICIsIHNlbGYuY2ZnLmFjdGlvbl9zdGF0KQogICAgICAgICAgICAgICAgcHJpbnQoIlx0VG90YWwgc3RlcHM6ICIsIHNlbGYuY2ZnLnRvdGFsX3N0ZXBzX2NvdW50ZXIpCiAgICAgICAgICAgICAgICBwcmludCgiXHRUcmFpbiBzdGVwczogIiwgc2VsZi5jZmcudHJhaW5fc3RlcHNfY291bnRlcikKICAgICAgICAgICAgICAgIHByaW50KCJcdEVwc2lsb246ICIsIHJvdW5kKHNlbGYuY2ZnLmVwc2lsb24sIDIpKQogICAgICAgICAgICAgICAgcHJpbnQoKQoKICAgICAgICAgICAgICAgICMgRXZhbHVhdGluZwogICAgICAgICAgICAgICAgaWYgKHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcisxKSAlIDUwID09IDA6CiAgICAgICAgICAgICAgICAgICAgc2VsZi5ldmFsdWF0aW9uKHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcikKICAgICAgICAgICAgICAgIAogICAgICAgIGV4Y2VwdCBLZXlib2FyZEludGVycnVwdDoKICAgICAgICAgICAgcHJpbnQoIlNhdmluZyBtb2RlbCB0byAiLCBzZWxmLmNmZy5tb2RlbF9kaXIpCgogICAgICAgICAgICBzZWxmLnNhdmVyLnNhdmUoc2VsZi5zZXNzaW9uLCBvcy5wYXRoLmpvaW4oc2VsZi5jZmcubW9kZWxfZGlyLCAicS1tb2RlbCIpKQoKICAgICAgICAgICAgc2VsZi5jZmcuc2F2ZShzY29yZXMsIHNlbGYuZXZhbF9zdGF0cykKCiAgICAgICAgICAgIHNlbGYuZXZhbHVhdGlvbihzZWxmLmNmZy5lcGlzb2RlX2NvdW50ZXIpCgogICAgICAgICAgICBzZWxmLndyYXBwZWRfZW52LmNsb3NlKCkKCiAgICBkZWYgZXZhbHVhdGlvbihzZWxmLCB0cmFpbl9lcGlzb2RlX2NvdW50ZXIpOgogICAgICAgICIiIkV2YWx1YXRlcyBhIGdpdmVuIFEgbW9kZWwgaW4gYSBnYW1lIGVudmlyb25tZW50LiIiIgoKICAgICAgICBwcmludCgiU3RhcnRpbmcgZXZhbHVhdGlvbiBvZiBtb2RlbDogIiwgc2VsZi5jZmcubW9kZWxfZGlyKQoKICAgICAgICBzY29yZXMgPSBbXQogICAgICAgIGZvciBlcGlzb2RlIGluIHJhbmdlKHNlbGYuY2ZnLmV2YWxfZXBpc29kZXMpOgogICAgICAgICAgICBkb25lID0gRmFsc2UKICAgICAgICAgICAgc2NvcmUgPSAwCjx8ZmltX2hvbGV8PgogICAgICAgICAgICAgICAgUV92YWx1ZXNfZm9yX2FjdGlvbnMgPSBzZWxmLm9wZXJhdGlvbnNbIlEiXS5ldmFsKAogICAgICAgICAgICAgICAgICAgIHNlc3Npb249c2VsZi5zZXNzaW9uLAogICAgICAgICAgICAgICAgICAgIGZlZWRfZGljdD17CiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYub3BlcmF0aW9uc1siUV9zdGF0ZSJdOiBbc3RhdGVdCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgKQoKICAgICAgICAgICAgICAgIGFjdGlvbiA9IG5wLmFyZ21heChRX3ZhbHVlc19mb3JfYWN0aW9ucykKICAgICAgICAgICAgICAgIHN0YXRlLCByZXdhcmQsIGRvbmUgPSBzZWxmLndyYXBwZWRfZW52LnN0ZXAoYWN0aW9uKQoKICAgICAgICAgICAgICAgIHNjb3JlICs9IHJld2FyZAogICAgICAgICAgICAgICAgc3RlcCArPSAxCgogICAgICAgICAgICBzY29yZXMuYXBwZW5kKHNjb3JlKQoKICAgICAgICBzZWxmLmV2YWxfc3RhdHMuc2V0ZGVmYXVsdCh0cmFpbl9lcGlzb2RlX2NvdW50ZXIsIHNjb3JlcykKCiAgICAgICAgIyBEcmF3IHN0YXQKICAgICAgICBmaWcgPSBwbHQuZmlndXJlKCkKICAgICAgICB4ID0gW10KICAgICAgICB5ID0gW10KICAgICAgICBmb3IgZXBpc29kZSwgc2NvcmVzIGluIHNlbGYuZXZhbF9zdGF0cy5pdGVtcygpOgogICAgICAgICAgICAgICAgeCArPSBbZXBpc29kZV0qbGVuKHNjb3JlcykKICAgICAgICAgICAgICAgIHkuZXh0ZW5kKHNjb3JlcykKICAgICAgICBwbHQucGxvdCh4LCB5LCAiLiIpCiAgICAgICAgcGx0LnhsYWJlbCgiVHJhaW4gZXBpc29kZXMiKQogICAgICAgIHBsdC55bGFiZWwoIkV2YWx1YXRpb24gc2NvcmVzIikKICAgICAgICBmaWcuc2F2ZWZpZyhvcy5wYXRoLmpvaW4oc2VsZi5jZmcubW9kZWxfZGlyLCAiZXZhbCIpKQogICAgICAgI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Ffc3RhdGUiXTogW3N0YXRlXQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgKQoKICAgICAgICAgICAgICAgICAgICBhY3Rpb24gPSBzZWxmLndyYXBwZWRfZW52LmdldF9hY3Rpb24oUV92YWx1ZXNfZm9yX2FjdGlvbnMpCgogICAgICAgICAgICAgICAgICAgIG5leHRfc3RhdGUsIHJld2FyZCwgZG9uZSA9IHNlbGYud3JhcHBlZF9lbnYuc3RlcChhY3Rpb24pCgogICAgICAgICAgICAgICAgICAgIHJlcGxheV9tZW1vcnkucmVjb3JkX2V4cGVyaWVuY2Uoc3RhdGUsIGFjdGlvbiwgcmV3YXJkLCBuZXh0X3N0YXRlLCBkb25lKQoKICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IG5leHRfc3RhdGUKCiAgICAgICAgICAgICAgICAgICAgIyBDbG9uZSBRIG5ldHdvcmsgd2VpZ2h0cyBldmVyeSBzZWxmLmNmZy50YXJnZXRfbmV0d29ya191cGRhdGVfZnJlcXVlbmN5IHN0ZXAuCiAgICAgICAgICAgICAgICAgICAgaWYgc2VsZi5jZmcudG90YWxfc3RlcHNfY291bnRlciAlIHNlbGYuY2ZnLnRhcmdldF9uZXR3b3JrX3VwZGF0ZV9mcmVxdWVuY3kgPT0gMDoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zZXNzaW9uLnJ1bihzZWxmLm9wZXJhdGlvbnNbImNsb25lX1FfdG9fUV90YXJnZXQiXSkKCiAgICAgICAgICAgICAgICAgICAgIyBFc2NhbGF0ZSBhIGdyYWRpZW50IHVwZGF0ZSBzdGVwIG9uIFEgbmV0d29yayBldmVyeSBzZWxmLmNmZy51cGRhdGVfZnJlcXVlbmN5IHN0ZXAgKGlmIHdlIGhhdmUgZW5vdWdoIGRhdGEpLgogICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLmNmZy50b3RhbF9zdGVwc19jb3VudGVyICUgc2VsZi5jZmcudXBkYXRlX2ZyZXF1ZW5jeSA9PSAwIG9yIGRvbmUpIGFuZCBzZWxmLmNmZy50b3RhbF9zdGVwc19jb3VudGVyID49IHNlbGYuY2ZnLnJlcGxheV9zdGFydF9zaXplOgoKICAgICAgICAgICAgICAgICAgICAgICAgcmVwbGF5X21lbW9yeV9zYW1wbGUgPSByZXBsYXlfbWVtb3J5LnNhbXBsZSgpCgogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNlc3Npb24ucnVuKHNlbGYub3BlcmF0aW9uc1sidXBkYXRlIl0sIGZlZWRfZGljdD17CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbIlFfc3RhdGUiXTogcmVwbGF5X21lbW9yeV9zYW1wbGUuc3RhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbIlFfdGFyZ2V0X3N0YXRlIl06IHJlcGxheV9tZW1vcnlfc2FtcGxlLm5leHRfc3RhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbImFjdGlvbiJdOiByZXBsYXlfbWVtb3J5X3NhbXBsZS5hY3Rpb24sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbInJld2FyZCJdOiByZXBsYXlfbWVtb3J5X3NhbXBsZS5yZXdhcmQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbImRvbmUiXTogcmVwbGF5X21lbW9yeV9zYW1wbGUuZG9uZQogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5jZmcudHJhaW5fc3RlcHNfY291bnRlciArPSAxCgogICAgICAgICAgICAgICAgICAgIHNlbGYuY2ZnLmFjdGlvbl9zdGF0W2FjdGlvbl0gKz0gMQogICAgICAgICAgICAgICAgICAgIHNjb3JlICs9IHJld2FyZAogICAgICAgICAgICAgICAgICAgIHNlbGYuY2ZnLnRvdGFsX3N0ZXBzX2NvdW50ZXIgKz0gMQoKICAgICAgICAgICAgICAgICAgICBpZiBkb25lOgogICAgICAgICAgICAgICAgICAgICAgICBicmVhawoKICAgICAgICAgICAgICAgIHNjb3Jlcy5hcHBlbmQoc2NvcmUpCgogICAgICAgICAgICAgICAgcHJpbnQoIkVwaXNvZGU6ICIsIHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcikKICAgICAgICAgICAgICAgIHByaW50KCJcdFNjb3JlIG1lYW46ICIsIHJvdW5kKG1lYW4oc2NvcmVzKSwyKSkKICAgICAgICAgICAgICAgIHByaW50KCJcdFNjb3JlIG1lZGlhbjogIiwgbWVkaWFuKHNjb3JlcykpCiAgICAgICAgICAgICAgICBwcmludCgiXHRTY29yZSBtb2RlOiAiLCBtYXgoc2V0KHNjb3JlcyksIGtleT1zY29yZXMuY291bnQpKQogICAgICAgICAgICAgICAgcHJpbnQoIlx0QWN0aW9uIHN0YXQ6ICIsIHNlbGYuY2ZnLmFjdGlvbl9zdGF0KQogICAgICAgICAgICAgICAgcHJpbnQoIlx0VG90YWwgc3RlcHM6ICIsIHNlbGYuY2ZnLnRvdGFsX3N0ZXBzX2NvdW50ZXIpCiAgICAgICAgICAgICAgICBwcmludCgiXHRUcmFpbiBzdGVwczogIiwgc2VsZi5jZmcudHJhaW5fc3RlcHNfY291bnRlcikKICAgICAgICAgICAgICAgIHByaW50KCJcdEVwc2lsb246ICIsIHJvdW5kKHNlbGYuY2ZnLmVwc2lsb24sIDIpKQogICAgICAgICAgICAgICAgcHJpbnQoKQoKICAgICAgICAgICAgICAgICMgRXZhbHVhdGluZwogICAgICAgICAgICAgICAgaWYgKHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcisxKSAlIDUwID09IDA6CiAgICAgICAgICAgICAgICAgICAgc2VsZi5ldmFsdWF0aW9uKHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcikKICAgICAgICAgICAgICAgIAogICAgICAgIGV4Y2VwdCBL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XRlXQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgKQoKICAgICAgICAgICAgICAgICAgICBhY3Rpb24gPSBzZWxmLndyYXBwZWRfZW52LmdldF9hY3Rpb24oUV92YWx1ZXNfZm9yX2FjdGlvbnMpCjx8ZmltX2hvbGV8PgoKICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IG5leHRfc3RhdGUKCiAgICAgICAgICAgICAgICAgICAgIyBDbG9uZSBRIG5ldHdvcmsgd2VpZ2h0cyBldmVyeSBzZWxmLmNmZy50YXJnZXRfbmV0d29ya191cGRhdGVfZnJlcXVlbmN5IHN0ZXAuCiAgICAgICAgICAgICAgICAgICAgaWYgc2VsZi5jZmcudG90YWxfc3RlcHNfY291bnRlciAlIHNlbGYuY2ZnLnRhcmdldF9uZXR3b3JrX3VwZGF0ZV9mcmVxdWVuY3kgPT0gMDoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zZXNzaW9uLnJ1bihzZWxmLm9wZXJhdGlvbnNbImNsb25lX1FfdG9fUV90YXJnZXQiXSkKCiAgICAgICAgICAgICAgICAgICAgIyBFc2NhbGF0ZSBhIGdyYWRpZW50IHVwZGF0ZSBzdGVwIG9uIFEgbmV0d29yayBldmVyeSBzZWxmLmNmZy51cGRhdGVfZnJlcXVlbmN5IHN0ZXAgKGlmIHdlIGhhdmUgZW5vdWdoIGRhdGEpLgogICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLmNmZy50b3RhbF9zdGVwc19jb3VudGVyICUgc2VsZi5jZmcudXBkYXRlX2ZyZXF1ZW5jeSA9PSAwIG9yIGRvbmUpIGFuZCBzZWxmLmNmZy50b3RhbF9zdGVwc19jb3VudGVyID49IHNlbGYuY2ZnLnJlcGxheV9zdGFydF9zaXplOgoKICAgICAgICAgICAgICAgICAgICAgICAgcmVwbGF5X21lbW9yeV9zYW1wbGUgPSByZXBsYXlfbWVtb3J5LnNhbXBsZSgpCgogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNlc3Npb24ucnVuKHNlbGYub3BlcmF0aW9uc1sidXBkYXRlIl0sIGZlZWRfZGljdD17CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbIlFfc3RhdGUiXTogcmVwbGF5X21lbW9yeV9zYW1wbGUuc3RhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbIlFfdGFyZ2V0X3N0YXRlIl06IHJlcGxheV9tZW1vcnlfc2FtcGxlLm5leHRfc3RhdGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbImFjdGlvbiJdOiByZXBsYXlfbWVtb3J5X3NhbXBsZS5hY3Rpb24sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbInJld2FyZCJdOiByZXBsYXlfbWVtb3J5X3NhbXBsZS5yZXdhcmQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZXJhdGlvbnNbImRvbmUiXTogcmVwbGF5X21lbW9yeV9zYW1wbGUuZG9uZQogICAgICAgICAgICAgICAgICAgICAgICB9KQoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5jZmcudHJhaW5fc3RlcHNfY291bnRlciArPSAxCgogICAgICAgICAgICAgICAgICAgIHNlbGYuY2ZnLmFjdGlvbl9zdGF0W2FjdGlvbl0gKz0gMQogICAgICAgICAgICAgICAgICAgIHNjb3JlICs9IHJld2FyZAogICAgICAgICAgICAgICAgICAgIHNlbGYuY2ZnLnRvdGFsX3N0ZXBzX2NvdW50ZXIgKz0gMQoKICAgICAgICAgICAgICAgICAgICBpZiBkb25lOgogICAgICAgICAgICAgICAgICAgICAgICBicmVhawoKICAgICAgICAgICAgICAgIHNjb3Jlcy5hcHBlbmQoc2NvcmUpCgogICAgICAgICAgICAgICAgcHJpbnQoIkVwaXNvZGU6ICIsIHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcikKICAgICAgICAgICAgICAgIHByaW50KCJcdFNjb3JlIG1lYW46ICIsIHJvdW5kKG1lYW4oc2NvcmVzKSwyKSkKICAgICAgICAgICAgICAgIHByaW50KCJcdFNjb3JlIG1lZGlhbjogIiwgbWVkaWFuKHNjb3JlcykpCiAgICAgICAgICAgICAgICBwcmludCgiXHRTY29yZSBtb2RlOiAiLCBtYXgoc2V0KHNjb3JlcyksIGtleT1zY29yZXMuY291bnQpKQogICAgICAgICAgICAgICAgcHJpbnQoIlx0QWN0aW9uIHN0YXQ6ICIsIHNlbGYuY2ZnLmFjdGlvbl9zdGF0KQogICAgICAgICAgICAgICAgcHJpbnQoIlx0VG90YWwgc3RlcHM6ICIsIHNlbGYuY2ZnLnRvdGFsX3N0ZXBzX2NvdW50ZXIpCiAgICAgICAgICAgICAgICBwcmludCgiXHRUcmFpbiBzdGVwczogIiwgc2VsZi5jZmcudHJhaW5fc3RlcHNfY291bnRlcikKICAgICAgICAgICAgICAgIHByaW50KCJcdEVwc2lsb246ICIsIHJvdW5kKHNlbGYuY2ZnLmVwc2lsb24sIDIpKQogICAgICAgICAgICAgICAgcHJpbnQoKQoKICAgICAgICAgICAgICAgICMgRXZhbHVhdGluZwogICAgICAgICAgICAgICAgaWYgKHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcisxKSAlIDUwID09IDA6CiAgICAgICAgICAgICAgICAgICAgc2VsZi5ldmFsdWF0aW9uKHNlbGYuY2ZnLmVwaXNvZGVfY291bnRlcikKICAgICAgICAgICAgICAgIAogICAgICAgIGV4Y2VwdCBLZXlib2FyZEludGVycnVwdDoKICAgICAgICAgICAgcHJpbnQoIlNhdmluZyBtb2RlbCB0byAiLCBzZWxmLmNmZy5tb2RlbF9kaXIpCgogICAgICAgICAgICBzZWxmLnNhdmVyLnNhdmUoc2VsZi5zZXNzaW9uLCBvcy5wYXRoLmpvaW4oc2VsZi5jZmcubW9kZWxfZGlyLCAicS1tb2RlbCIpKQoKICAgICAgICAgICAgc2VsZi5jZmcuc2F2ZShzY29yZXMsIHNlbGYuZXZhbF9zdGF0cykKCiAgICAgICAgICAgIHNlbGYuZXZhbHVhdGlvbihzZWxmLmNmZy5lcGlzb2RlX2NvdW50ZXIpCgogICAgICAgICAgICBzZWxmLndyYXBwZWRfZW52LmNsb3NlKCkKCiAgICBkZWYgZXZhbHVhdGlvbihzZWxmLCB0cmFpbl9lcGlzb2RlX2NvdW50ZXIpOgogICAgICAgICIiIkV2YWx1YXRlcyBhIGdpdmVuIFEgbW9kZWwgaW4gYSBnYW1lIGVudmlyb25tZW50LiIiIgoKICAgICAgICBwcmludCgiU3RhcnRpbmcgZXZhbHVhdGlvbiBvZiBtb2RlbDogIiwgc2VsZi5jZmcubW9kZWxfZGlyKQoKICAgICAgICBzY29yZXMgPSBbXQogICAgICAgIGZvciBlcGlzb2RlIGluIHJhbmdlKHNlbGYuY2ZnLmV2YWxfZXBpc29kZXMpOgogICAgICAgICAgICBkb25lID0gRmFsc2UKICAgICAgICAgICAgc2NvcmUgPSAwCiAgICAgICAgICAgIHN0YXRlID0gc2VsZi53cmFwcGVkX2Vudi5nZXRfaW5pdGlhbF9zdGF0ZSgpCiAgICAgICAgICAgIHN0ZXAgPSAwCiAgICAgICAgICAgIHdoaWxlIG5vdCBkb25lIGFuZCBzdGVwIDwgc2VsZi5jZmcudGltZV9zdGVwczoKCiAgICAgICAgICAgICAgICBRX3ZhbHVlc19mb3JfYWN0aW9ucyA9IHNlbGYub3BlcmF0aW9uc1siUSJdLmV2YWwoCiAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbj1zZWxmLnNlc3Npb24sCiAgICAgICAgICAgICAgICAgICAgZmVlZF9kaWN0PXsKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vcGVyYXRpb25zWyJRX3N0YXRlIl06IFtzdGF0ZV0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICApCgogICAgICAgICAgICAgICAgYWN0aW9uID0gbnAuYXJnbWF4KFFfdmFsdWVzX2Zvcl9hY3Rpb25zKQogICAgICAgICAgICAgICAgc3RhdGUsIHJld2FyZCwgZG9uZSA9IHNlbGYud3JhcHBlZF9lbnYuc3RlcChhY3Rpb24pCgogICAgICAgICAgICAgICAgc2NvcmUgKz0gcmV3YXJkCiAgICAgICAgICAgICAgICBzdGVwICs9IDEKCiAgICAgICAgICAgIHNjb3Jlcy5hcHBlbmQoc2NvcmUpCgogICAgICAgIHNlbGYuZXZhbF9zdGF0cy5zZXRkZWZhdWx0KHRyYWluX2VwaXNvZGVfY291bnRlciwgc2NvcmVzKQoKICAgICAgICAjIERyYXcgc3RhdAogICAgICAgIGZpZyA9IHBsdC5maWd1cmUoKQogICAgICAgIHggPSBbXQogICAgICAgIHkgPSBbXQogICAgICAgIGZvciBlcGlzb2RlLCBzY29yZXMgaW4gc2VsZi5ldmFsX3N0YXRzLml0ZW1zKCk6CiAgICAgICAgICAgICAgICB4ICs9IFtlcGlzb2RlXSpsZW4oc2NvcmVzKQogICAgICAgICAgICAgICAgeS5leHRlbmQoc2NvcmVzKQogICAgICAgIHBsdC5wbG90KHgsIHksICIuIikKICAgICAgICBwbHQueGxhYmVsKCJUcmFpbiBlcGlzb2RlcyIpCiAgICAgICAgcGx0LnlsYWJlbCgiRXZhbHVhdGlvbiBzY29yZXMiKQogICAgICAgIGZpZy5zYXZlZmlnKG9zLnBhdGguam9pbihzZWxmLmNmZy5tb2RlbF9kaXIsICJldmFsIikpCiAgICAgICAgcGx0LmNsb3NlKGZpZykKPHxmaW1fc3VmZml4fD4KCiAgICAgICAgICAgICAgICAgICAgbmV4dF9zdGF0ZSwgcmV3YXJkLCBkb25lID0gc2VsZi53cmFwcGVkX2Vudi5zdGVwKGFjdGlvbikKCiAgICAgICAgICAgICAgICAgICAgcmVwbGF5X21lbW9yeS5yZWNvcmRfZXhwZXJpZW5jZShzdGF0ZSwgYWN0aW9uLCByZXdhcmQsIG5leHRfc3RhdGUsIGRvbmUpCjx8ZmltX2VuZHw+
af0fabc13e1f14cc4f0479934f102c4c898cdf1c-1
af0fabc13e1f14cc4f0479934f102c4c898cdf1c
PHxmaW1fcHJlZml4fD4KZnJvbSBhYmMgaW1wb3J0IGFic3RyYWN0bWV0aG9kCmZyb20gdXVpZCBpbXBvcnQgVVVJRAoKCmNsYXNzIFRhc2tNYW5hZ2VyKG9iamVjdCk6CiAgICBAcHJvcGVydHkKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgogICAgZGVmIGNsaWVudChzZWxmKToKICAgICAgICByYWlzZSBOb3RJbXBsZW1lbnRlZEVycm9yCgogICAgQHByb3BlcnR5Cjx8ZmltX2VuZHw+
af0fabc13e1f14cc4f0479934f102c4c898cdf1c-2
af0fabc13e1f14cc4f0479934f102c4c898cdf1c
PHxmaW1fcHJlZml4fD4KZnJvbSBhYmMgaW1wb3J0IGFic3RyYWN0bWV0aG9kCmZyb20gdXVpZCBpbXBvcnQgVVVJRAoKCmNsYXNzIFRhc2tNYW5hZ2VyKG9iamVjdCk6CiAgICBAcHJvcGVydHkKICAgIGRlZiBjbGllbnQoc2VsZik6CiAgICAgICAgcmFpc2UgTm90SW1wbGVtZW50ZWRFcnJvcgoKICAgIEBwcm9wZXJ0eQogICAgZGVmIG1hbmFnZXIoc2VsZik6CiAgICAgICAgcmFpc2UgTm90SW1wbGVtZW50ZWRFcnJvcgoKICAgIEBhYnN0cmFjdG1ldGhvZAogICAgZGVmIGNvbm5lY3RfdG9fdGFza19tYW5hZ2VyKHNlbGYpOgogICAgICAgIHBhc3MKCiAgICBAYWJzdHJhY3RtZXRob2QKICAgIGRlZiBjcmVhdGVfdGFzayhzZWxmLCB0YXNrX2lucHV0KSAtPiBVVUlEOgogICAgICAgIHBhc3MKCiAgICBAYWJzdHJhY3RtZXRob2QKICAgIGRlZiBnZXRfdGFza19zdGF0dXMoc2VsZiwgdGFza19pZDogVVVJRCkgLT4gc3RyOgogICAgICAgIHBhc3MKCiAgICBAYWJzdHJhY3RtZX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bGYucGFnZV9ucyA9PSAiMTAiOgogICAgICAgICB0aXRsZSA9IE15U1FMZGIuZXNjYXBlX3N0cmluZyhzZWxmLnBhZ2VfdGl0bGVbOTpdKS5kZWNvZGUoKQogICAgICBlbHNlOgogICAgICAgICB0aXRsZSA9IE15U1FMZGIuZXNjYXBlX3N0cmluZyhzZWxmLnBhZ2VfdGl0bGVbNzpdKS5kZWNvZGUoKQogICAgICB0ZXh0ID0gTXlTUUxkYi5lc2NhcGVfc3RyaW5nKHNlbGYucmV2aXNpb25fdGV4dCkuZGVjb2RlKCkKCiAgICAgIGlmIGNvbW1hOgogICAgICAgICBsaW5lID0gIiwgKCAxLCAlcywgJXMsICclcycsICVzLCAnJXMnLCAlcywgJyVzJywgJyVzJywgMSApIiAlIFwKICAgICAgICAgICAgKHBhZ2VfbGVuLCByZWRpcmVjdCwgc2VsZi5yZXZpc2lvbl9tb2RlbCwgdGltZXN0YW1wLCBzZWxmLnJldmlzaW9uX3NoYTEsIHNlbGYucGFnZV9ucywgdGl0bGUsIHRleHQpCiAgICAgIGVsc2U6CiAgICAgICAgIGxpbmUgPSAiKCAxLCAlcywgJXMsICclcycsICVzLCAnJXMnLCAlcywgJyVzJywgJyVzJywgMSApIiAlIFwKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgogICAgICAgICAgICAocGFnZV9sZW4sIHJlZGlyZWN0LCBzZWxmLnJldmlzaW9uX21vZGVsLCB0aW1lc3RhbXAsIHNlbGYucmV2aXNpb25fc2hhMSwgc2VsZi5wYWdlX25zLCB0aXRsZSwgdGV4dCkKCjx8ZmltX2VuZHw+
59b40d0fc988f7eea78ec65e13838895fe33088a-1
59b40d0fc988f7eea78ec65e13838895fe33088a
PHxmaW1fcHJlZml4fD4KZnJvbSBzZXR1cHRvb2xzIGltcG9ydCBzZXR1cCwgZmluZF9wYWNrYWdlcwppbXBvcnQgdGhlX3JhY2sKCnNldHVwKAogICAgbmFtZT0ndGhlX3JhY2snLAogICAgdmVy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xlcyhzZWxmKToKICAgICAgICBzZWxmLmFzc2VydEVxdWFscyhzZWxmLm5ld19waXRjaC5jb21tZW50cywiVGhpcyBpcyBhIG5ldyBwaXRjaCIpCiAgICAgIAo8fGZpbV9lbmR8Pg==
596399fb3cbfbb57cd2981a88ddeb5571a3391c4-3
596399fb3cbfbb57cd2981a88ddeb5571a3391c4
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHVuaXR0ZXN0CmZyb20gYXBwLm1vZGVscyBpbXBvcnQgUGl0Y2gsIFVzZXIKZnJvbSBhcHAgaW1wb3J0IGRiCgpjbGFzcyBQaXRjaFRlc3QodW5pdHRlc3QuVGVzdENhc2UpOgoKICAgIGRlZiBzZXRVcChzZWxmKToKICAgICAgICAnJycKICAgICAgICBTZXQgdXAgbWV0aG9kIHRvIHJ1biBiZWZvcmUgZWFjaCB0ZXN0IGNhc2VzLgogICAgICAgICcnJwogICAgICAgIHNlbGYubmV3X3BpdGNoID0gUGl0Y2goIlRoaXMgaXMgYSBuZXcgcGl0Y2giKQoKCiAgICBkZWYgdGVzdF9jaGVja19pbnN0YW5jZV92YXJpYWJsZXMoc2VsZik6Cjx8ZmltX2hvbGV8PgogICAgZGVmIHRlc3Rfc2F2ZV9waXRjaChzZWxmKToKICAgICAgICAiIiIKICAgICAgICBUbyB0ZXN0cyBvbiB3aGV0aGVyIHBpdGNoZXMgYXJlIGJlaW5nIHNhdmVkCiAgICAgICAgIiIiCiAgICAgICAgc2VsZi5uZXdfcGl0Y2guc2F2ZV9waXRjaCgpCiAgICAgICAgc2VsZi5hc3NlcnRUcnVlKGxlbihQaXRjaC5xdWVyeS5hbGwoKSk+MCkKPHxmaW1fc3VmZml4fD4KICAgICAgICBzZWxmLmFzc2VydEVxdWFscyhzZWxmLm5ld19waXRjaC5jb21tZW50cywiVGhpcyBpcyBhIG5ldyBwaXRjaCIpCiAgICAgIAo8fGZpbV9lbmR8Pg==
596399fb3cbfbb57cd2981a88ddeb5571a3391c4-4
596399fb3cbfb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IFNvbHV0aW9uLmNvbXB1dGVIZWlnaHQocm9vdC5sZWZ0LCAgMSArIGN1ckhlaWdodCksIAogICAgICAgICAgICBTb2x1dGlvbi5jb21wdXRlSGVpZ2h0KHJvb3QucmlnaHQsIDEgKyBjdXJIZWlnaHQpCiAgICAgICAgKQogICAgCiAgICAiIiIKICAgIEBwYXJhbSByb290OiBUaGUgcm9vdCBvZiBiaW5hcnkgdHJlZS4KICAgIEByZXR1cm46IFRydWUgaWYgdGhpcyBCaW5hcnkgdHJlZSBpcyBCYWxhbmNlZCwgb3IgZmFsc2UuCiAgICAiIiIKICAgIGRlZiBpc0JhbGFuY2VkKHNlbGYsIHJvb3QpOgogICAgICAgIGlmIHJvb3QgPT0gTm9uZToKICAgICAgICAgICAgcmV0dXJuIFRydWUKICAgICAgICAgICAgCiAgICAgICAgaWYgYWJzKCAgU29sdXRpb24uY29tcHV0ZUhlaWdodChyb290LmxlZnQpCiAgICAgICAgICAgICAgIC0gU29sdXRpb24uY29tcHV0ZUhlaWdodChyb290LnJpZ2h0KQogICAgICAgICAgICAgICApIDwgMjoKICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgIHJldHVybiBzZWxmLmlzQmFsYW5jZWQocm9vdC5sZWZ0KSBhbmQgc2VsZi5pc0JhbGFuY2VkKHJvb3QucmlnaHQpCiAgICAgICAgICAgIAogICAgICAgIHJldHVybiBGYWxzZQo8fGZpbV9zdWZmaXh8PgogICAgZGVmIGNvbXB1dGVIZWlnaHQocm9vdCwgY3VySGVpZ2h0PTApOgogICAgICAgIGlmIHJvb3QgPT0gTm9uZToKICAgICAgICAgICAgcmV0dXJuIGN1ckhlaWdodAogICAgICAgICAgICAKPHxmaW1fZW5kfD4=
b1e759a380eb13f3500a569ea6e68c0164aec3fb-2
b1e759a380eb13f3500a569ea6e68c0164aec3fb
PHxmaW1fcHJlZml4fD4KIyBTbG93LiBIb3JyaWJsZS4gVWdseS4gRG9uJ3QgdHJ5IHRoaXMgYXQgaG9tZS4KCiIiIgpEZWZpbml0aW9uIG9mIFRyZWVOb2RlOgpjbGFzcyBUcmVlTm9kZToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCB2YWwpOgogICAgICAgIHNlbGYudmFsID0gdmFsCiAgICAgICAgc2VsZi5sZWZ0LCBzZWxmLnJpZ2h0ID0gTm9uZSwgTm9uZQoiIiIKY2xhc3MgU29sdXRpb246CiAgICBAc3RhdGljbWV0aG9kCiAgICBkZWYgY29tcHV0ZUhlaWdodChyb290LCBjdXJIZWlnaHQ9MCk6CiAgICAgICAgaWYgcm9vdCA9PSBOb25lOgogICAgICAgICAgICByZXR1cm4gY3VySGVpZ2h0CiAgICAgICAgICAgIAogICAgICAgIHJldHVybiBtYXgoCiAgICAgICAgICAgIFNvbHV0aW9uLmNvbXB1dGVIZWlnaHQocm9vdC5sZWZ0LCAgMSArIGN1ckhlaWdodCksIAo8fGZpbV9ob2xlfD4KICAgICAgICApCiAgICAKICAgICIiIgogICAgQHBhcmFtIHJvb3Q6IFRoZSByb290IG9mIGJpbmFyeSB0cmVlLgogICAgQHJldHVybjogVHJ1ZSBpZiB0aGlzIEJpbmFyeSB0cmVlIGlzIEJhbGFuY2VkLCBvciBmYWxzZS4KICAgICIiIgogICAgZGVmIGlzQmFsYW5jZWQoc2VsZiwgcm9vdCk6CiAgICAgICAgaWYgcm9vdCA9PSBOb25lOgogICAgICAgICAgICByZXR1cm4gVHJ1ZQogICAgICAgICAgICAKICAgICAgICBpZiBhYnMoICBTb2x1dGlvbi5jb21wdXRlSGVpZ2h0KHJvb3QubGVmdCkKICAgICAgICAgICAgICAgLSBTb2x1dGlvbi5jb21wdXRlSGVpZ2h0KHJvb3QucmlnaHQpCiAgICAgICAgICAgICAgICkgPCAyOgogICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgcmV0dXJuIHNlbGYuaXNCYWxhbmNlZChyb290LmxlZnQpIGFuZCBzZWxmLmlzQmFsYW5jZWQocm9vdC5yaWdodCkKICAgICAgICAgICAgCiAgIC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KICAgICAgICBzcGxpdGluZGV4ID0gaW50KHJvdW5kKE4qdHJhaW5pbmdyYXRlKSkKICAgICAgICB0cmFpbmluZ3NldCwgdGVzdHNldCA9IFRyYWluaW5nRGF0YSgpLCBUcmFpbmluZ0RhdGEoKQogICAgICAgIHRyYWluaW5nc2V0LmRpYyA9IGRpY3QobGlzdCh0cmFpbmluZ2RhdGEuZGljLml0ZW1zKCkpWzpzcGxpdGluZGV4XSkKICAgICAgICB0ZXN0c2V0LmRpYyA9IGRpY3QobGlzdCh0cmFpbmluZ2RhdGEuZGljLml0ZW1zKCkpW3NwbGl0aW5kZXg6XSkKICAgICAgICAKICAgICAgICAKICAgICAgICBlcnJvciA9IHRvbGVyYW5jZSArIDEKICAgICAgICBlcG9jaHMgPSAwCiAgICAgICAgd2hpbGUgZXJyb3IgPiB0b2xlcmFuY2UgYW5kIGVwb2NocyA8IG1heGVwb2NoczoKICAgICAgICAgICAgZXBvY2hzICs9IDEKICAgICAgICAgICAgc2VsZi5MZWFybnByb3BhZ2F0ZShldGEsIHRyYWluaW5nc2V0KQogICAgICAgICAgICBlcnJvciA9IHNlbGYuUHJvcGFnYXRlU2V0KHRlc3RzZXQpCiAgICAgICAgcmV0dXJuIFtlcnJvcixlcG9jaHNdCiAgICAKICAgIAogICAgZGVmIExlYXJucHJvcGFnYXRlKHNlbGYsIGV0YSwgdHJhaW5pbmdkYXRhKToKICAgICAgICBmb3IgZW50cnkgaW4gdHJhaW5pbmdkYXRhLmRpYzoKICAgICAgICAgICAgdGVzdGRhdGE9SGFzaGFibGUudW53cmFwKGVudHJ5KQogICAgICAgICAgICB0YXJnPXRyYWluaW5nZGF0YS5kaWNbZW50cnldLnJlc2hhcGUoOSo5KQogICAgICAgICAgICBpZihucC5zdW0odGFyZyk+MCk6ICNXZSBjYW4gb25seSBsZWFybiBpZiB0aGVyZSBhcmUgYWN0dWFsIHRhcmdldCB2ZWN0b3JzCiAgICAgICAgICAgICAgICB5ID0gbnAuYXBwZW5kKHRlc3RkYXRhLFsxXSkKICAgICAgICAgICAgICAgIHlzID0gWzBdKnNlbGYubGF5ZXJjb3VudAogICAgICAgICAgICAgICAgI0ZvcndhcmQtcHJvcGFnYXRlCiAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgwLHNlbGYubGF5ZXJjb3VudCk6IAogICAgICAgICAgICAgICAgICAgIFcgPSBzZWxmLndlaWdodHNbaV0gI2FuZGVycyBtYWNoZW4/CiAgICAgICAgICAgICAgICAgICAgcyA9IFcuZG90KHkpCiAgICAgICAgICAgICAgICAgICAgaWYgaT09c2VsZi5sYXllcmNvdW50LTE6ICNzb2Z0bWF4IGFzIGFjdGl2YXRpb25mY3Qgb25seSBpbiBsYXN0IGxheWVyICAgIAogICAgICAgICAgICAgICAgICAgICAgICB5ID0gbnAuYXBwZW5kKHNvZnRtYXgocyksWzFdKSAjV2UgYXBwZW5kIDEgZm9yIHRoZSBiaWFzCiAgICAgICAgICAgICAgICAgICAgZWxzZTogI2luIGFsbCBvdGhlciBoaWRkZW4gbGF5ZXJzIHdlIHVzZSB0YW5oIGFzIGFjdGl2YXRpb24gZmN0CiAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBucC5hcHBlbmQobnAudGFuaChzKSxbMV0pICNXZSBhcHBlbmQgMSBmb3IgdGhlIGJpYXMKICAgICAgICAgICAgICAgICAgICB5c1tpXT15ICNzYXZlIHRoZSB5IHZhbHVlcyBmb3IgYmFja3Byb3AgKD8pCiAgICAgICAgICAgICAgICBvdXQ9eQogICAgICAgICAgICAgICAgaWYgJ2ZpcnN0b3V0JyBub3QgaW4gbG9jYWxzKCk6CiAgICAgICAgICAgICAgICAgICAgZmlyc3RvdXQ9eVs6LTFdICNzYXZlIGZpcnN0IGVwb2NoIG91dHB1dCBmb3IgY29tcGFyaXNvbiBhbmQgdmlzdWFsaXphdGlvbgogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAjQmFja3Byb3BhZ2F0aW9uCiAgICAgICAgICAgICAgICA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gICAgICAgICAgZm9yIGogaW4gcmFuZ2UoMCxsZSk6CiAgICAgICAgICAgICAgICAgICAgICAgIERGdFs6LGpdKj15dFtqXQogICAgICAgICAgICAgICAgICAgIERGW2ldPURGdAogICAgICAgICAgICAgICAgI0RGIGlzIGEgSmFjb2JpYW4sIHRodXMgaXQgaXMgcXVhZHJhdGljIGFuZCBzeW1tZXRyaWMKICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAjQ2FsYyBKYWNvYmlhbiBvZiB0YW5oCiAgICAgICAgICAgICAgICBERnRhbj1bMF0qc2VsZi5sYXllcmNvdW50CiAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgwLHNlbGYubGF5ZXJjb3VudCk6ICNwbGVhc2Ugbm90ZSB0aGF0IEkgdGhpbmsgdGhpcyBpcyBwdXJlIHdpdGNoY3JhZnQgaGFwcGVuaW5nIGhlcmUKICAgICAgICAgICAgICAgICAgICB5dD15c1tpXSAjbG9hZCB5IGZyb20geXMgYW5kIGxldHMgY2FsbCBpdCB5dAogICAgICAgICAgICAgICAgICAgIHl0PXl0WzotMV0gI3RoZSBsYXN0IGVudHJ5IGlzIGZyb20gdGhlIG9mZnNldCwgd2UgZG9uJ3QgbmVlZCB0aGlzCiAgICAgICAgICAgICAgICAgICAgbGU9bGVuKHl0KQogICAgICAgICAgICAgICAgICAgIHU9MS15dCp5dAogICAgICAgICAgICAgICAgICAgIERGdGFuW2ldPW5wLmRpYWcodSkKICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgI1VzZSAoTDIpIGFuZCAoTDMpIHRvIGdldCB0aGUgZXJyb3Igc2lnbmFscyBvZiB0aGUgbGF5ZXJzCiAgICAgICAgICAgICAgICBlcnJvcnNpZ25hbHM9WzBdKnNlbGYubGF5ZXJjb3VudAogICAgICAgICAgICAgICAgZXJyb3JzaWduYWxzW3NlbGYubGF5ZXJjb3VudC0xXT1ERltzZWxmLmxheWVyY291bnQtMV0gIyAoTDIpLCB0aGUgZXJyb3Igc2lnbmFsIG9mIHRoZSBvdXRwdXQgbGF5ZXIgY2FuIGJlIGNvbXB1dGVkIGRpcmVjdGx5LCBoZXJlIHdlIGFjdHVhbGx5IHVzZSBzb2Z0bWF4CiAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgyLHNlbGYubGF5ZXJjb3VudCsxKToKICAgICAgICAgICAgICAgICAgICAiIiJpZiBpPT1sYXllcmNvdW50KzE6I3NvZnRtYXgKICAgICAgICAgICAgICAgICAgICAgICAgdz13ZWlnaHRzW2xheWVyY291bnQtaSsxXQogICAgICAgICAgICAgICAgICAgICAgICBlcnJkZXQ9bnAubWF0bXVsKHdbOiw6LTFdLERGW2xheWVyY291bnQtaV0pICN0ZW1wb3JhcnkKICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzaWduYWxzW2xheWVyY291bnQtaV09bnAuZG90KGVycm9yc2lnbmFsc1tsYXllcmNvdW50LWkrMV0sZXJyZGV0KSAjIChMMyksIGRvZXMgcHl0aG9uIGZ1Y2tpbmcgZ2V0IHRoYXQ/CiAgICAgICAgICAgICAgICAgICAgZWxzZToiIiIKICAgICAgICAgICAgICAgICAgICB3PXNlbGYud2VpZ2h0c1tzZWxmLmxheWVyY291bnQtaSsxXQogICAgICAgICAgICAgICAgICAgIERGdD1ERnRhbltzZWxmLmxheWVyY291bnQtaV0gI3RhbmgKICAgICAgICAgICAgICAgICAgICBlcnJkZXQ9bnAubWF0bXVsKHdbOiw6LTFdLERGdCkgI3RlbXBvcmFyeQogICAgICAgICAgICAgICAgICAgIGVycm9yc2lnbmFsc1tzZWxmLmxheWVyY291bnQtaV09bnAuZG90KGVycm9yc2lnbmFsc1tzZWxmLmxheWVyY291bnQtaSsxXSxlcnJkZXQpICMgKEwzKSwgZG9lcyBweXRob24gZnVja2luZyBnZXQgdGhhdD8KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgI1VzZSAoRDMpIHRvIGNvbXB1dGUgZXJyX2Vycm9yc2lnbmFscyBhc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JvcnNpZ25hbHNbMF0sdGVzdGRhdGEpLlQgI1doeSBkbyBJIG5lZWQgdG8gdHJhbnNwb3NlIGhlcmU/Pz8KICAgICAgICAgICAgICAgIGZvciBpIGluIHJhbmdlKDEsc2VsZi5sYXllcmNvdW50KTogCiAgICAgICAgICAgICAgICAgICAgZXJyb3JieXdlaWdodHNbaV09bnAub3V0ZXIoZXJyX2Vycm9yc2lnbmFsc1tpLTFdLHlzW2ldWzotMV0pICMgKEwxKQogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAjQ29tcHV0ZSB0aGUgY2hhbmdlIG9mIHdlaWdodHMsIHRoYXQgbWVhbnMsIHRoZW4gYXBwbHkgYWN0dWFsaXphdGlvbiBzdGVwIG9mIEdyYWRpZW50IERlc2NlbnQgdG8gd2VpZ2h0IG1hdHJpY2VzCiAgICAgICAgICAgICAgICBkZWx0YXdlaWdodHM9WzBdKnNlbGYubGF5ZXJjb3VudAogICAgICAgICAgICAgICAgZm9yIGkgaW4gcmFuZ2UoMCxzZWxmLmxheWVyY291bnQpOgo8fGZpbV9ob2xlfD4KICAgICAgICAgICAgICAgICNGb3IgRXJyb3Igc3RhdGlzdGljcwogICAgICAgICAgICAgICAgc2VsZi5lcnJvcnNieWVwb2NoLmFwcGVuZChzZWxmLmNvbXB1dGVfbXNfZXJyb3IgKHlbOi0xXSwgdGFyZykpCiAgICAgICAgICAgICAgICBzZWxmLmFic2Vycm9yYnllcG9jaFswXT1zZWxmLmNvbXB1dGVfZXJyb3IgKHlbOi0xXSwgdGFyZykKICAgICAgICAgICAgICAgIHNlbGYuS0xkYnllcG9jaFswXT1zZWxmLmNvbXB1dGVfS0xfZGl2ZXJnZW5jZSh5WzotMV0sIHRhcmcpCiAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIGVycm9yID0gc2VsZi5jb21wdXRlX0tMX2RpdmVyZ2VuY2UoeVs6LTFdLCB0YXJnKQogICAgICAgICAgICAgICAgCiAgICAgICAgICAgIHJldHVybi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xheWVycyB3ZSB1c2UgdGFuaCBhcyBhY3RpdmF0aW9uIGZjdAogICAgICAgICAgICAgICAgeSA9IG5wLmFwcGVuZChucC50YW5oKHMpLFsxXSkgI1dlIGFwcGVuZCAxIGZvciB0aGUgYmlhcwogICAgICAgICAgICB5c1tpXT15ICNzYXZlIHRoZSB5IHZhbHVlcyBmb3IgYmFja3Byb3AgKD8pCiAgICAgICAgb3V0PXlbOi0xXQogICAgICAgICIiIgogICAgICAgIG1vdmU9bnAuYXJnbWF4KG91dCkKICAgICAgICB4PWludChtb3ZlJTkpCiAgICAgICAgeT1pbnQobnAuZmxvb3IobW92ZS85KSkKICAgICAgICBtb3ZlMj1beCx5XSAjY2hlY2sgaWYgdGhpcyBpcyByaWdodCwgaSBkb250IHRoaW5rIHNvLiBUaGUgY291bnRpbmcgaXMgd3JvbmcKICAgICAgICByZXR1cm4gbW92ZTIKICAgICAgICAiIiIKICAgICAgICByZXR1cm4gb3V0CiAgICAKICAgIGRlZiBQcm9wYWdhdGVTZXQoc2VsZix0ZXN0c2V0KToKICAgICAgICBlcnJvciA9IDAKICAgICAgICBjaGVja2VkID0gMAogICAgICAgIGZvciBlbnRyeSBpbiB0ZXN0c2V0LmRpYzoKICAgICAgICAgICAgdGVzdGRhdGE9SGFzaGFibGUudW53cmFwKGVudHJ5KS0wLjI1CiAgICAgICAgICAgIHRhcmc9dGVzdHNldC5kaWNbZW50cnldLnJlc2hhcGUoOSo5KQogICAgICAgICAgICBpZihucC5zdW0odGFyZyk+MCk6ICNXZSBjYW4gb25seSBsZWFybiBpZiB0aGVyZSBhcmUgYWN0dWFsIHRhcmdldCB2ZWN0b3JzCiAgICAgICAgICAgICAgICB5ID0gbnAuYXBwZW5kKHRlc3RkYXRhLFsxXSkKICAgICAgICAgICAgICAgIHlzID0gWzBdKnNlbGYubGF5ZXJjb3VudAogICAgICAgICAgICAgICAgI0ZvcndhcmQtcHJvcGFnYXRlCiAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgwLHNlbGYubGF5ZXJjb3VudCk6IAogICAgICAgICAgICAgICAgICAgIFcgPSBzZWxmLndlaWdodHNbaV0gI2FuZGVycyBtYWNoZW4/CiAgICAgICAgICAgICAgICAgICAgcyA9IFcuZG90KHkpCiAgICAgICAgICAgICAgICAgICAgaWYgaT09c2VsZi5sYXllcmNvdW50LTE6ICNzb2Z0bWF4IGFzIGFjdGl2YXRpb25mY3Qgb25seSBpbiBsYXN0IGxheWVyICAgIAogICAgICAgICAgICAgICAgICAgICAgICB5ID0gbnAuYXBwZW5kKHNvZnRtYXgocyksWzFdKSAjV2UgYXBwZW5kIDEgZm9yIHRoZSBiaWFzCiAgICAgICAgICAgICAgICAgICAgZWxzZTogI2luIGFsbCBvdGhlciBoaWRkZW4gbGF5ZXJzIHdlIHVzZSB0YW5oIGFzIGFjdGl2YXRpb24gZmN0CiAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBucC5hcHBlbmQobnAudGFuaChzKSxbMV0pICNXZSBhcHBlbmQgMSBmb3IgdGhlIGJpYXMKICAgICAgICAgICAgICAgICAgICB5c1tpXT15ICNzYXZlIHRoZSB5IHZhbHVlcyBmb3IgYmFja3Byb3AgKD8pCiAgICAgICAgICAgICAgICBvdXQ9eVs6LTFdCiAgICAgICAgICAgICAgICBlcnJvciArPSBzZWxmLmNvbXB1dGVfS0xfZGl2ZXJnZW5jZSh5WzotMV0sIHRhcmcpCiAgICAgICAgICAgICAgICBjaGVja2VkICs9IDEKICAgICAgICBlcnJvciA9IGVycm9yL2NoZWNrZWQgI2F2ZXJhZ2Ugb3ZlciB0cmFpbmluZyBzZXQKICAgICAgICByZXR1cm4gZXJyb3IKICAgIAogICAgIyMjIFBsb3QgcmVzdWx0cyBhbmQgZXJyb3I6CiAgICBkZWYgdmlzdWFsaXplKHNlbGYsIGdhbWVzLCBmaXJzdG91dCwgb3V0LCB0YXJnKToKICAgICAgICBmLCBheGEgPSBwbHQuc3VicGxvdHMoMywgc2hhcmV4PVRydWUpC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vY2gKICAgICAgICAKICAgICAgICBheGFyclsyXS5zZXRfeGxhYmVsKCJCb2FyZCBmaWVsZCBudW1iZXIiKQogICAgICAgIGF4YXJyWzJdLmJhcihyYW5nZSgxLChzZWxmLm4qc2VsZi5uKzEpKSwgdGFyZykgI3RhcmdldCBkaXN0cmlidXRpb24KICAgICAgICAKICAgICAgICAiIiIKICAgICAgICAjVmlzdWFsaXphdGlvbiBvZiB0aGUgb3V0cHV0IG9uIGEgYm9hcmQgcmVwcmVzZW50YXRpb246CiAgICAgICAgI3BsdC5maWd1cmUoMykKICAgICAgICBpbWFnZSA9IG5wLnplcm9zKG4qbikKICAgICAgICBpbWFnZSA9IG91dFs6LTFdCiAgICAgICAgaW1hZ2UgPSBpbWFnZS5yZXNoYXBlKChuLCBuKSkgIyBSZXNoYXBlIHRoaW5ncyBpbnRvIGEgbnhuIGdyaWQuCiAgICAgICAgcm93X2xhYmVscyA9IHJldmVyc2VkKG5wLmFycmF5KHJhbmdlKG4pKSsxKSAjZnVjayBQeXRob24KICAgICAgICBjb2xfbGFiZWxzID0gWydBJywgJ0InLCAnQycsICdEJywgJ0UnLCAnRicsICdHJywgJ0gnLCAnSSddCiAgICAgICAgcGx0Lm1hdHNob3coaW1hZ2UpCiAgICAgICAgcGx0Lnh0aWNrcyhyYW5nZShuKSwgY29sX2xhYmVscykKICAgICAgICBwbHQueXRpY2tzKHJhbmdlKG4pLCByb3dfbGFiZWxzKQogICAgICAgIHBsdC5zaG93KCkKICAgICAgICAiIiIKICAgICAgICAKICAgICAgICAKICAgICAgICAiIiIgVG8gYmUgYWRkZWQgKD8pCiAgICAgICAgI1Zpc3VhbGl6YXRpb24gb2YgdGhlIGlucHV0IG9uIGEgYm9hcmQgcmVwcmVzZW50YXRpb246CiAgICAgICAgaW1hZ2UgPSBucC56ZXJvcyhuKm4pCiAgICAgICAgaW1hZ2UgPSB0ZXN0ZGF0YVswXQogICAgICAgIGltYWdlID0gaW1hZ2UucmVzaGFwZSgobiwgbikp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i5sYXllcj1bZGF0YVsnYXJyXzAnXVswXS5zaGFwZVsxXV0gI3RoZXJlIGFyZSBuKzEgbGF5ZXJzIGlmIHRoZXJlIGFyZSBuIHdlaWdodG1hdHJpY2VzCiAgICAgICAgICAgICAgICAgICAgZm9yIGkgaW4gcmFuZ2UobGVuKGRhdGFbJ2Fycl8wJ10pKToKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi53ZWlnaHRzLmFwcGVuZChkYXRhWydhcnJfMCddW2ldKQogICAgICAgICAgICAgICAgICAgICAgICB0ZW1wc2hhcGU9ZGF0YVsnYXJyXzAnXVtpXS5zaGFwZQogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmxheWVyLmFwcGVuZCh0ZW1wc2hhcGVbMF0pCiAgICAgICAgICAgICAgICAgICAgc2VsZi5sYXllcmNvdW50PWxlbihzZWxmLmxheWVyKS0xCiAgICAgICAgICAgIGVsaWYgb3MucGF0aC5leGlzdHMoZmlsZW5hbWUgKyAiLm5weiIpOgogICAgICAgICAgICAgICAgd2l0aCBucC5sb2FkKGZpbGVuYW1lICsgIi5ucHoiKSBhcyBkYXRhOgogICAgICAgICAgICAgICAgICAgIHNlbGYud2VpZ2h0cz1bXQogICAgICAgICAgICAgICAgICAgIGZvciBpIGluIHJhbmdlKGxlbihkYXRhWydhcnJfMCddKSk6CiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYud2VpZ2h0cy5hcHBlbmQoZGF0YVsnYXJyXzAnXVtpXSkKICAgICAgICAgICAgICAgIAojVGVzdHMKCmRlZiB0ZXN0KCk6CiAgICBpZiAnVk4nIG5vdCBpbiBsb2NhbHMoKToKICAgICAgICBWTiA9IFZhbHVlTmV0KCkKICAgIGdhbWVzPTIwMDAKICAgIGV0YSA9IDAuMDEKICAgIFt0YXJnLHRlc3RkYXRhXSA9IFZOLmdlbmVyYXRlX2RhdGEoZ2FtZXMpCiAgICBmb3IgaSBpbiByYW5nZSgwLDEpOgogICAgICAgIFtmaXJzdG91dCxv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odHJhaW5pbmdkYXRhLmRpYykKICAgICAgICBzcGxpdGluZGV4ID0gaW50KHJvdW5kKE4qdHJhaW5pbmdyYXRlKSkKICAgICAgICB0cmFpbmluZ3NldCwgdGVzdHNldCA9IFRyYWluaW5nRGF0YSgpLCBUcmFpbmluZ0RhdGEoKQogICAgICAgIHRyYWluaW5nc2V0LmRpYyA9IGRpY3QobGlzdCh0cmFpbmluZ2RhdGEuZGljLml0ZW1zKCkpWzpzcGxpdGluZGV4XSkKICAgICAgICB0ZXN0c2V0LmRpYyA9IGRpY3QobGlzdCh0cmFpbmluZ2RhdGEuZGljLml0ZW1zKCkpW3NwbGl0aW5kZXg6XSkKICAgICAgICAKICAgICAgICAKICAgICAgICBlcnJvciA9IHRvbGVyYW5jZSArIDEKICAgICAgICBlcG9jaHMgPSAwCiAgICAgICAgd2hpbGUgZXJyb3IgPiB0b2xlcmFuY2UgYW5kIGVwb2NocyA8IG1heGVwb2NoczoKICAgICAgICAgICAgZXBvY2hzICs9IDEKICAgICAgICAgICAgc2VsZi5MZWFybnByb3BhZ2F0ZShldGEsIHRyYWluaW5nc2V0KQogICAgICAgICAgICBlcnJvciA9IHNlbGYuUHJvcGFnYXRlU2V0KHRlc3RzZXQpCiAgICAgICAgcmV0dXJuIFtlcnJvcixlcG9jaHNdCiAgICAKICAgIAogICAgZGVmIExlYXJucHJvcGFnYXRlKHNlbGYsIGV0YSwgdHJhaW5pbmdkYXRhKToKICAgICAgICBmb3IgZW50cnkgaW4gdHJhaW5pbmdkYXRhLmRpYzoKICAgICAgICAgICAgdGVzdGRhdGE9SGFzaGFibGUudW53cmFwKGVudHJ5KQogICAgICAgICAgICB0YXJnPXRyYWluaW5nZGF0YS5kaWNbZW50cnldLnJlc2hhcGUoOSo5KQogICAgICAgICAgICBpZihucC5zdW0odGFyZyk+MCk6ICNXZSBjYW4gb25seSBsZWFybiBpZiB0aGVyZSBhcmUgYWN0dWFsIHRhcmdldCB2ZWN0b3JzCiAgICAgICAgICAgICAgICB5ID0gbnAuYXBwZW5kKHRlc3RkYXRhLFsxXSkKICAgICAgICAgICAgICAgIHlzID0gWzBdKnNlbGYubGF5ZXJjb3VudAogICAgICAgICAgICAgICAgI0ZvcndhcmQtcHJvcGFnYXRlCiAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgwLHNlbGYubGF5ZXJjb3VudCk6IAogICAgICAgICAgICAgICAgICAgIFcgPSBzZWxmLndlaWdodHNbaV0gI2FuZGVycyBtYWNoZW4/CiAgICAgICAgICAgICAgICAgICAgcyA9IFcuZG90KHkpCiAgICAgICAgICAgICAgICAgICAgaWYgaT09c2VsZi5sYXllcmNvdW50LTE6ICNzb2Z0bWF4IGFzIGFjdGl2YXRpb25mY3Qgb25seSBpbiBsYXN0IGxheWVyICAgIAogICAgICAgICAgICAgICAgICAgICAgICB5ID0gbnAuYXBwZW5kKHNvZnRtYXgocyksWzFdKSAjV2UgYXBwZW5kIDEgZm9yIHRoZSBiaWFzCiAgICAgICAgICAgICAgICAgICAgZWxzZTogI2luIGFsbCBvdGhlciBoaWRkZW4gbGF5ZXJzIHdlIHVzZSB0YW5oIGFzIGFjdGl2YXRpb24gZmN0CiAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBucC5hcHBlbmQobnAudGFuaChzKSxbMV0pICNXZSBhcHBlbmQgMSBmb3IgdGhlIGJpYXMKICAgICAgICAgICAgICAgICAgICB5c1tpXT15ICNzYXZlIHRoZSB5IHZhbHVlcyBmb3IgYmFja3Byb3AgKD8pCiAgICAgICAgICAgICAgICBvdXQ9eQogICAgICAgICAgICAgICAgaWYgJ2ZpcnN0b3V0JyBub3QgaW4gbG9jYWxzKCk6CiAgICAgICAgICAgICAgICAgICAgZmlyc3RvdXQ9eVs6LTFdICNzYXZlIGZpcnN0IGVwb2NoIG91dHB1dCBmb3IgY29tcGFyaXNvbiBhbmQgdmlzdWFsaXphdGlvbgogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAjQmFja3Byb3BhZ2F0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UpIC0gREZ0CiAgICAgICAgICAgICAgICAgICAgZm9yIGogaW4gcmFuZ2UoMCxsZSk6CiAgICAgICAgICAgICAgICAgICAgICAgIERGdFs6LGpdKj15dFtqXQogICAgICAgICAgICAgICAgICAgIERGW2ldPURGdAogICAgICAgICAgICAgICAgI0RGIGlzIGEgSmFjb2JpYW4sIHRodXMgaXQgaXMgcXVhZHJhdGljIGFuZCBzeW1tZXRyaWMKICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAjQ2FsYyBKYWNvYmlhbiBvZiB0YW5oCiAgICAgICAgICAgICAgICBERnRhbj1bMF0qc2VsZi5sYXllcmNvdW50CiAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgwLHNlbGYubGF5ZXJjb3VudCk6ICNwbGVhc2Ugbm90ZSB0aGF0IEkgdGhpbmsgdGhpcyBpcyBwdXJlIHdpdGNoY3JhZnQgaGFwcGVuaW5nIGhlcmUKICAgICAgICAgICAgICAgICAgICB5dD15c1tpXSAjbG9hZCB5IGZyb20geXMgYW5kIGxldHMgY2FsbCBpdCB5dAogICAgICAgICAgICAgICAgICAgIHl0PXl0WzotMV0gI3RoZSBsYXN0IGVudHJ5IGlzIGZyb20gdGhlIG9mZnNldCwgd2UgZG9uJ3QgbmVlZCB0aGlzCiAgICAgICAgICAgICAgICAgICAgbGU9bGVuKHl0KQogICAgICAgICAgICAgICAgICAgIHU9MS15dCp5dAogICAgICAgICAgICAgICAgICAgIERGdGFuW2ldPW5wLmRpYWcodSkKICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgI1VzZSAoTDIpIGFuZCAoTDMpIHRvIGdldCB0aGUgZXJyb3Igc2lnbmFscyBvZiB0aGUgbGF5ZXJzCiAgICAgICAgICAgICAgICBlcnJvcnNpZ25hbHM9WzBdKnNlbGYubGF5ZXJjb3VudAogICAgICAgICAgICAgICAgZXJyb3JzaWduYWxzW3NlbGYubGF5ZXJjb3VudC0xXT1ERltzZWxmLmxheWVyY291bnQtMV0gIyAoTDIpLCB0aGUgZXJyb3Igc2lnbmFsIG9mIHRoZSBvdXRwdXQgbGF5ZXIgY2FuIGJlIGNvbXB1dGVkIGRpcmVjdGx5LCBoZXJlIHdlIGFjdHVhbGx5IHVzZSBzb2Z0bWF4CiAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgyLHNlbGYubGF5ZXJjb3VudCsxKToKICAgICAgICAgICAgICAgICAgICAiIiJpZiBpPT1sYXllcmNvdW50KzE6I3NvZnRtYXgKICAgICAgICAgICAgICAgICAgICAgICAgdz13ZWlnaHRzW2xheWVyY291bnQtaSsxXQogICAgICAgICAgICAgICAgICAgICAgICBlcnJkZXQ9bnAubWF0bXVsKHdbOiw6LTFdLERGW2xheWVyY291bnQtaV0pICN0ZW1wb3JhcnkKICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzaWduYWxzW2xheWVyY291bnQtaV09bnAuZG90KGVycm9yc2lnbmFsc1tsYXllcmNvdW50LWkrMV0sZXJyZGV0KSAjIChMMyksIGRvZXMgcHl0aG9uIGZ1Y2tpbmcgZ2V0IHRoYXQ/CiAgICAgICAgICAgICAgICAgICAgZWxzZToiIiIKICAgICAgICAgICAgICAgICAgICB3PXNlbGYud2VpZ2h0c1tzZWxmLmxheWVyY291bnQtaSsxXQogICAgICAgICAgICAgICAgICAgIERGdD1ERnRhbltzZWxmLmxheWVyY291bnQtaV0gI3RhbmgKICAgICAgICAgICAgICAgICAgICBlcnJkZXQ9bnAubWF0bXVsKHdbOiw6LTFdLERGdCkgI3RlbXBvcmFyeQogICAgICAgICAgICAgICAgICAgIGVycm9yc2lnbmFsc1tzZWxmLmxheWVyY291bnQtaV09bnAuZG90KGVycm9yc2lnbmFsc1tzZWxmLmxheWVyY291bnQtaSsxXSxlcnJkZXQpICMgKEwzKSwgZG9lcyBweXRob24gZnVja2luZyBnZXQgdGhhdD8KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgI1VzZSAoRDMpIHRvIGNvbXB1dGUgZX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NlbGYud2VpZ2h0c1tpXSAjYW5kZXJzIG1hY2hlbj8KICAgICAgICAgICAgcyA9IFcuZG90KHkpCiAgICAgICAgICAgIGlmIGk9PXNlbGYubGF5ZXJjb3VudC0xOiAjc29mdG1heCBhcyBhY3RpdmF0aW9uZmN0IG9ubHkgaW4gbGFzdCBsYXllciAgICAKICAgICAgICAgICAgICAgIHkgPSBucC5hcHBlbmQoc29mdG1heChzKSxbMV0pICNXZSBhcHBlbmQgMSBmb3IgdGhlIGJpYXMKICAgICAgICAgICAgZWxzZTogI2luIGFsbCBvdGhlciBoaWRkZW4gbGF5ZXJzIHdlIHVzZSB0YW5oIGFzIGFjdGl2YXRpb24gZmN0CiAgICAgICAgICAgICAgICB5ID0gbnAuYXBwZW5kKG5wLnRhbmgocyksWzFdKSAjV2UgYXBwZW5kIDEgZm9yIHRoZSBiaWFzCiAgICAgICAgICAgIHlzW2ldPXkgI3NhdmUgdGhlIHkgdmFsdWVzIGZvciBiYWNrcHJvcCAoPykKICAgICAgICBvdXQ9eVs6LTFdCiAgICAgICAgIiIiCiAgICAgICAgbW92ZT1ucC5hcmdtYXgob3V0KQogICAgICAgIHg9aW50KG1vdmUlOSkKICAgICAgICB5PWludChucC5mbG9vcihtb3ZlLzkpKQogICAgICAgIG1vdmUyPVt4LHldICNjaGVjayBpZiB0aGlzIGlzIHJpZ2h0LCBpIGRvbnQgdGhpbmsgc28uIFRoZSBjb3VudGluZyBpcyB3cm9uZwogICAgICAgIHJldHVybiBtb3ZlMgogICAgICAgICIiIgogICAgICAgIHJldHVybiBvdXQKICAgIAogICAgZGVmIFByb3BhZ2F0ZVNldChzZWxmLHRlc3RzZXQpOgogICAgICAgIGVycm9yID0gMAogICAgICAgIGNoZWNrZWQgPSAwCiAgICAgICAgZm9yIGVudHJ5IGluIHRlc3RzZXQuZGljOgogICAgICAgICAgICB0ZXN0ZGF0YT1IYXNoYWJsZS51bndyYXAoZW50cnkpLTAuMjUKICAgICAgICAgICAgdGFyZz10ZXN0c2V0LmRpY1tlbnRyeV0ucmVzaGFwZSg5KjkpCiAgICAgICAgICAgIGlmKG5wLnN1bSh0YXJnKT4wKTogI1dlIGNhbiBvbmx5IGxlYXJuIGlmIHRoZXJlIGFyZSBhY3R1YWwgdGFyZ2V0IHZlY3RvcnMKICAgICAgICAgICAgICAgIHkgPSBucC5hcHBlbmQodGVzdGRhdGEsWzFdKQogICAgICAgICAgICAgICAgeXMgPSBbMF0qc2VsZi5sYXllcmNvdW50CiAgICAgICAgICAgICAgICAjRm9yd2FyZC1wcm9wYWdhdGUKICAgICAgICAgICAgICAgIGZvciBpIGluIHJhbmdlKDAsc2VsZi5sYXllcmNvdW50KTogCiAgICAgICAgICAgICAgICAgICAgVyA9IHNlbGYud2VpZ2h0c1tpXSAjYW5kZXJzIG1hY2hlbj8KICAgICAgICAgICAgICAgICAgICBzID0gVy5kb3QoeSkKICAgICAgICAgICAgICAgICAgICBpZiBpPT1zZWxmLmxheWVyY291bnQtMTogI3NvZnRtYXggYXMgYWN0aXZhdGlvbmZjdCBvbmx5IGluIGxhc3QgbGF5ZXIgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBucC5hcHBlbmQoc29mdG1heChzKSxbMV0pICNXZSBhcHBlbmQgMSBmb3IgdGhlIGJpYXMKICAgICAgICAgICAgICAgICAgICBlbHNlOiAjaW4gYWxsIG90aGVyIGhpZGRlbiBsYXllcnMgd2UgdXNlIHRhbmggYXMgYWN0aXZhdGlvbiBmY3QKICAgICAgICAgICAgICAgICAgICAgICAgeSA9IG5wLmFwcGVuZChucC50YW5oKHMpLFsxXSkgI1dlIGFwcGVuZCAxIGZvciB0aGUgYmlhcwogICAgICAgICAgICAgICAgICAgIHlzW2ldPXkgI3NhdmUgdGhlIHkgdmFsdWVzIGZvciBiYWNrcHJvcCAoPykKICAgICAgICAgICAgICAgIG91dD15WzotMV0KICAgICAgICAgICAgICAgIGVycm9yICs9IHNlbGYuY29tcHV0ZV9LTF9kaXZlcmdlbmNl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C55dGlja3MocmFuZ2UobiksIHJvd19sYWJlbHMpCiAgICAgICAgcGx0LnNob3coKQogICAgICAgICIiIgogICAgICAgIAogICAgICAgIAogICAgICAgICIiIiBUbyBiZSBhZGRlZCAoPykKICAgICAgICAjVmlzdWFsaXphdGlvbiBvZiB0aGUgaW5wdXQgb24gYSBib2FyZCByZXByZXNlbnRhdGlvbjoKICAgICAgICBpbWFnZSA9IG5wLnplcm9zKG4qbikKICAgICAgICBpbWFnZSA9IHRlc3RkYXRhWzBdCiAgICAgICAgaW1hZ2UgPSBpbWFnZS5yZXNoYXBlKChuLCBuKSkgIyBSZXNoYXBlIHRoaW5ncyBpbnRvIGEgbnhuIGdyaWQuCiAgICAgICAgcm93X2xhYmVscyA9IHJldmVyc2VkKG5wLmFycmF5KHJhbmdlKG4pKSsxKSAjZnVjayBQeXRob24KICAgICAgICBjb2xfbGFiZWxzID0gWydBJywgJ0InLCAnQycsICdEJywgJ0UnLCAnRicsICdHJywgJ0gnLCAnSSddCiAgICAgICAgcGx0Lm1hdHNob3coaW1hZ2UpCiAgICAgICAgcGx0Lnh0aWNrcyhyYW5nZShuKSwgY29sX2xhYmVscykKICAgICAgICBwbHQueXRpY2tzKHJhbmdlKG4pLCByb3dfbGFiZWxzKQogICAgICAgIHBsdC5zaG93KCkKICAgICAgICAiIiIKICAgIAogICAgI3ByaW50KCJXZSBhcmUgIixucC5yb3VuZChjb21wdXRlX2Vycm9yKHN1Z2dlc3RlZG1vdmUsMikqMTAwLDIpLCIlIGF3YXkgZnJvbSB0aGUgcmlnaHQgc29sdXRpb24gbW92ZS4iKSN0ZXN0LCBsZXRzIGp1c3Qgc2F5IHRoYXQgMiB3b3VsZCBiZSB0aGUgYmVzdCBtb3ZlIGZvciBub3cKCiAgICBkZWYgc2F2ZXdlaWdodHMoc2VsZixmaWxlbmFtZSk6CiAgICAgICAgI2ZvciBpIGluIHJhbmdlKGxlbihzZWxmLndlaWdodHMpKToKICAgICAgICBucC5zYXZleihmaWxlbmFtZSxzZWxmLndlaWdodHMpCiAgICAgICAgCiAgICBkZWYgbG9hZHdlaWdodHNmcm9tZmlsZShzZWxmLGZpbGVuYW1lKToKICAgICAgICAjIGlmIGZpbGUgZG9lc250IGV4aXN0LCBkbyBub3RoaW5nCiAgICAgICAgICAgIGlmIG9zLnBhdGguZXhpc3RzKGZpbGVuYW1lKToKICAgICAgICAgICAgICAgIHdpdGggbnAubG9hZChmaWxlbmFtZSkgYXMgZGF0YToKICAgICAgICAgICAgICAgICAgICBzZWxmLndlaWdodHM9W10KICAgICAgICAgICAgICAgICAgICBzZWxmLmxheWVyPVtkYXRhWydhcnJfMCddWzBdLnNoYXBlWzFdXSAjdGhlcmUgYXJlIG4rMSBsYXllcnMgaWYgdGhlcmUgYXJlIG4gd2VpZ2h0bWF0cmljZXMKICAgICAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZShsZW4oZGF0YVsnYXJyXzAnXSkpOgogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLndlaWdodHMuYXBwZW5kKGRhdGFbJ2Fycl8wJ11baV0pCiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBzaGFwZT1kYXRhWydhcnJfMCddW2ldLnNoYXBlCiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYubGF5ZXIuYXBwZW5kKHRlbXBzaGFwZVswXSkKICAgICAgICAgICAgICAgICAgICBzZWxmLmxheWVyY291bnQ9bGVuKHNlbGYubGF5ZXIpLTEKICAgICAgICAgICAgZWxpZiBvcy5wYXRoLmV4aXN0cyhmaWxlbmFtZSArICIubnB6Iik6CiAgICAgICAgICAgICAgICB3aXRoIG5wLmxvYWQoZmlsZW5hbWUgKyAiLm5weiIpIGFzIGRhdGE6CiAgICAgICAgICAgICAgICAgICAgc2VsZi53ZWlnaHRzPVtdCiAgICAgICAgICAgICAgICAgICAgZm9yIGkgaW4gcmFuZ2UobGVuKGRhdGFbJ2Fycl8wJ10pKToKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi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wCiAgICAgICAgd2hpbGUgZXJyb3IgPiB0b2xlcmFuY2UgYW5kIGVwb2NocyA8IG1heGVwb2NoczoKICAgICAgICAgICAgZXBvY2hzICs9IDEKICAgICAgICAgICAgc2VsZi5MZWFybnByb3BhZ2F0ZShldGEsIHRyYWluaW5nc2V0KQogICAgICAgICAgICBlcnJvciA9IHNlbGYuUHJvcGFnYXRlU2V0KHRlc3RzZXQpCiAgICAgICAgcmV0dXJuIFtlcnJvcixlcG9jaHNdCiAgICAKICAgIAogICAgZGVmIExlYXJucHJvcGFnYXRlKHNlbGYsIGV0YSwgdHJhaW5pbmdkYXRhKToKICAgICAgICBmb3IgZW50cnkgaW4gdHJhaW5pbmdkYXRhLmRpYzoKICAgICAgICAgICAgdGVzdGRhdGE9SGFzaGFibGUudW53cmFwKGVudHJ5KQogICAgICAgICAgICB0YXJnPXRyYWluaW5nZGF0YS5kaWNbZW50cnldLnJlc2hhcGUoOSo5KQogICAgICAgICAgICBpZihucC5zdW0odGFyZyk+MCk6ICNXZSBjYW4gb25seSBsZWFybiBpZiB0aGVyZSBhcmUgYWN0dWFsIHRhcmdldCB2ZWN0b3JzCiAgICAgICAgICAgICAgICB5ID0gbnAuYXBwZW5kKHRlc3RkYXRhLFsxXSkKICAgICAgICAgICAgICAgIHlzID0gWzBdKnNlbGYubGF5ZXJjb3VudAogICAgICAgICAgICAgICAgI0ZvcndhcmQtcHJvcGFnYXRlCiAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgwLHNlbGYubGF5ZXJjb3VudCk6IAogICAgICAgICAgICAgICAgICAgIFcgPSBzZWxmLndlaWdodHNbaV0gI2FuZGVycyBtYWNoZW4/CiAgICAgICAgICAgICAgICAgICAgcyA9IFcuZG90KHkpCiAgICAgICAgICAgICAgICAgICAgaWYgaT09c2VsZi5sYXllcmNvdW50LTE6ICNzb2Z0bWF4IGFzIGFjdGl2YXRpb25mY3Qgb25seSBpbiBsYXN0IGxheWVyICAgIAogICAgICAgICAgICAgIC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Y9WzBdKnNlbGYubGF5ZXJjb3VudAogICAgICAgICAgICAgICAgZm9yIGkgaW4gcmFuZ2UoMCxzZWxmLmxheWVyY291bnQpOiAjcGxlYXNlIG5vdGUgdGhhdCBJIHRoaW5rIHRoaXMgaXMgcHVyZSB3aXRjaGNyYWZ0IGhhcHBlbmluZyBoZXJlCiAgICAgICAgICAgICAgICAgICAgeXQ9eXNbaV0gI2xvYWQgeSBmcm9tIHlzIGFuZCBsZXRzIGNhbGwgaXQgeXQKICAgICAgICAgICAgICAgICAgICB5dD15dFs6LTFdICN0aGUgbGFzdCBlbnRyeSBpcyBmcm9tIHRoZSBvZmZzZXQsIHdlIGRvbid0IG5lZWQgdGhpcwogICAgICAgICAgICAgICAgICAgIGxlPWxlbih5dCkKICAgICAgICAgICAgICAgICAgICBERnQ9bnAub25lcygobGUsbGUpKSAjYWxsb2Mgc3RvcmFnZSB0ZW1wb3JhcmlseQogICAgICAgICAgICAgICAgICAgIGZvciBqIGluIHJhbmdlKDAsbGUpOgogICAgICAgICAgICAgICAgICAgICAgICBERnRbaiw6XSo9eXRbal0KICAgICAgICAgICAgICAgICAgICBERnQ9bnAuaWRlbnRpdHkobGUpIC0gREZ0CiAgICAgICAgICAgICAgICAgICAgZm9yIGogaW4gcmFuZ2UoMCxsZSk6CiAgICAgICAgICAgICAgICAgICAgICAgIERGdFs6LGpdKj15dFtqXQogICAgICAgICAgICAgICAgICAgIERGW2ldPURGdAogICAgICAgICAgICAgICAgI0RGIGlzIGEgSmFjb2JpYW4sIHRodXMgaXQgaXMgcXVhZHJhdGljIGFuZCBzeW1tZXRyaWMKICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAjQ2FsYyBKYWNvYmlhbiBvZiB0YW5oCiAgICAgICAgICAgICAgICBERnRhbj1bMF0qc2VsZi5sYXllcmNvdW50CiAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgwLHNlbGYubGF5ZXJjb3VudCk6ICNwbGVhc2Ugbm90ZSB0aGF0IEkgdGhpbmsgdGhpcyBpcyBwdXJlIHdpdGNoY3JhZnQgaGFwcGVuaW5nIGhlcmUKICAgICAgICAgICAgICAgICAgICB5dD15c1tpXSAjbG9hZCB5IGZyb20geXMgYW5kIGxldHMgY2FsbCBpdCB5dAogICAgICAgICAgICAgICAgICAgIHl0PXl0WzotMV0gI3RoZSBsYXN0IGVudHJ5IGlzIGZyb20gdGhlIG9mZnNldCwgd2UgZG9uJ3QgbmVlZCB0aGlzCiAgICAgICAgICAgICAgICAgICAgbGU9bGVuKHl0KQogICAgICAgICAgICAgICAgICAgIHU9MS15dCp5dAogICAgICAgICAgICAgICAgICAgIERGdGFuW2ldPW5wLmRpYWcodSkKICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgI1VzZSAoTDIpIGFuZCAoTDMpIHRvIGdldCB0aGUgZXJyb3Igc2lnbmFscyBvZiB0aGUgbGF5ZXJzCiAgICAgICAgICAgICAgICBlcnJvcnNpZ25hbHM9WzBdKnNlbGYubGF5ZXJjb3VudAogICAgICAgICAgICAgICAgZXJyb3JzaWduYWxzW3NlbGYubGF5ZXJjb3VudC0xXT1ERltzZWxmLmxheWVyY291bnQtMV0gIyAoTDIpLCB0aGUgZXJyb3Igc2lnbmFsIG9mIHRoZSBvdXRwdXQgbGF5ZXIgY2FuIGJlIGNvbXB1dGVkIGRpcmVjdGx5LCBoZXJlIHdlIGFjdHVhbGx5IHVzZSBzb2Z0bWF4CiAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZSgyLHNlbGYubGF5ZXJjb3VudCsxKToKICAgICAgICAgICAgICAgICAgICAiIiJpZiBpPT1sYXllcmNvdW50KzE6I3NvZnRtYXgKICAgICAgICAgICAgICAgICAgICAgICAgdz13ZWlnaHRzW2xheWVyY291bnQtaSsxXQogICAgICAgICAgICAgICAgICAgICAgICBlcnJkZXQ9bnAubWF0bXVsKHdbOiw6LTFdLERGW2xheWVyY291bnQtaV0pICN0ZW1wb3JhcnkKICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzaWduYWxzW2xheWVyY291bnQtaV09bnAuZG90KGVycm9yc2lnbmFsc1tsYXllcmNvdW50LWkrMV0sZXJyZGV0KSAjIChMMyksIGRvZXMgcHl0aG9uIGZ1Y2tpbmcgZ2V0IHRoYXQ/CiAgICAgICAgICAgICAgICAgICAgZWxzZToiIiIKICAgICAgICAgICAgICAgICAgICB3PXNlbGYud2VpZ2h0c1tzZWxmLmxheWVyY291bnQtaSsxXQogICAgICAgICAgICAgICAgICAgIERGdD1ERnRhbltzZWxmLmxheWVyY291bnQtaV0gI3RhbmgKICAgICAgICAgICAgICAgICAgICBlcnJkZXQ9bnAubWF0bXVsKHdbOiw6LTFdLERGdCkgI3RlbXBvcmFyeQogICAgICAgICAgICAgICAgICAgIGVycm9yc2lnbmFsc1tzZWxmLmxheWVyY291bnQtaV09bnAuZG90KGVycm9yc2lnbmFsc1tzZWxmLmxheWVyY291bnQtaSsxXSxlcnJkZXQpICMgKEwzKSwgZG9lcyBweXRob24gZnVja2luZyBnZXQgdGhhdD8KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgI1VzZSAoRDMpIHRvIGNvbXB1dGUgZXJyX2Vycm9yc2lnbmFscyBhcyBzdW0gb3ZlciB0aGUgcm93cy9jb2x1bW5zPyBvZiB0aGUgZXJyb3JzaWduYWxzIHdlaWdodGVkIGJ5IHRoZSBkZXJpdiBvZiB0aGUgZXJyb3IgZmN0IGJ5IHRoZSBvdXRwdXQgbGF5ZXIuIFdlIGRvbid0IHVzZSBMZW1tYSAzIGRpcmNldGx5IGhlcmUsIHdlIGp1c3QgYXBwbHkgdGhlIGRlZmluaXRpb24gb2YgZGVsdGFfZXJyb3IKICAgICAgICAgICAgICAgIGVycl9lcnJvcnNpZ25hbHM9WzBdKnNlbGYubGF5ZXJjb3VudAogICAgICAgICAgICAgICAgI2Vycm9yYnl5emVybyA9IG91dFs6LTFdLXRhcmcgI01lYW4tc3F1YXJlZC1lcnJvcgogICAgICAgIC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lzIGlzIHJpZ2h0LCBpIGRvbnQgdGhpbmsgc28uIFRoZSBjb3VudGluZyBpcyB3cm9uZwogICAgICAgIHJldHVybiBtb3ZlMgogICAgICAgICIiIgogICAgICAgIHJldHVybiBvdXQKICAgIAogICAgZGVmIFByb3BhZ2F0ZVNldChzZWxmLHRlc3RzZXQpOgogICAgICAgIGVycm9yID0gMAogICAgICAgIGNoZWNrZWQgPSAwCiAgICAgICAgZm9yIGVudHJ5IGluIHRlc3RzZXQuZGljOgogICAgICAgICAgICB0ZXN0ZGF0YT1IYXNoYWJsZS51bndyYXAoZW50cnkpLTAuMjUKICAgICAgICAgICAgdGFyZz10ZXN0c2V0LmRpY1tlbnRyeV0ucmVzaGFwZSg5KjkpCiAgICAgICAgICAgIGlmKG5wLnN1bSh0YXJnKT4wKTogI1dlIGNhbiBvbmx5IGxlYXJuIGlmIHRoZXJlIGFyZSBhY3R1YWwgdGFyZ2V0IHZlY3RvcnMKICAgICAgICAgICAgICAgIHkgPSBucC5hcHBlbmQodGVzdGRhdGEsWzFdKQogICAgICAgICAgICAgICAgeXMgPSBbMF0qc2VsZi5sYXllcmNvdW50CiAgICAgICAgICAgICAgICAjRm9yd2FyZC1wcm9wYWdhdGUKICAgICAgICAgICAgICAgIGZvciBpIGluIHJhbmdlKDAsc2VsZi5sYXllcmNvdW50KTogCiAgICAgICAgICAgICAgICAgICAgVyA9IHNlbGYud2VpZ2h0c1tpXSAjYW5kZXJzIG1hY2hlbj8KICAgICAgICAgICAgICAgICAgICBzID0gVy5kb3QoeSkKICAgICAgICAgICAgICAgICAgICBpZiBpPT1zZWxmLmxheWVyY291bnQtMTogI3NvZnRtYXggYXMgYWN0aXZhdGlvbmZjdCBvbmx5IGluIGxhc3QgbGF5ZXIgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHkgPSBucC5hcHBlbmQoc29mdG1heChzKSxbMV0pICNXZSBhcHBlbmQgMSBmb3IgdGhlIGJpYXMKICAgICAgICAgICAgICAgICAgICBlbHNlOiAjaW4gYWxsIG90aGVyIGhpZGRlbiBsYXllcnMgd2UgdXNlIHRhbmggYXMgYWN0aXZhdGlvbiBmY3QKICAgICAgICAgICAgICAgICAgICAgICAgeSA9IG5wLmFwcGVuZChucC50YW5oKHMpLFsxXSkgI1dlIGFwcGVuZCAxIGZvciB0aGUgYmlhcwogICAgICAgICAgICAgICAgICAgIHlzW2ldPXkgI3NhdmUgdGhlIHkgdmFsdWVzIGZvciBiYWNrcHJvcCAoPykKICAgICAgICAgICAgICAgIG91dD15WzotMV0KICAgICAgICAgICAgICAgIGVycm9yICs9IHNlbGYuY29tcHV0ZV9LTF9kaXZlcmdlbmNlKHlbOi0xXSwgdGFyZykKICAgICAgICAgICAgICAgIGNoZWNrZWQgKz0gMQogICAgICAgIGVycm9yID0gZXJyb3IvY2hlY2tlZCAjYXZlcmFnZSBvdmVyIHRyYWluaW5nIHNldAogICAgICAgIHJldHVybiBlcnJvcgogICAgCiAgICAjIyMgUGxvdCByZXN1bHRzIGFuZCBlcnJvcjoKICAgIGRlZiB2aXN1YWxpemUoc2VsZiwgZ2FtZXMsIGZpcnN0b3V0LCBvdXQsIHRhcmcpOgogICAgICAgIGYsIGF4YSA9IHBsdC5zdWJwbG90cygzLCBzaGFyZXg9VHJ1ZSkKICAgICAgICBheGFbMF0uc2V0X3RpdGxlKCJFcnJvciBQbG90IikKICAgICAgICBheGFbMF0uc2V0X3lsYWJlbCgiTWVhbiBzcXVhcmUgRXJyb3IiKQogICAgICAgIGF4YVswXS5wbG90KHJhbmdlKDAsZ2FtZXMpLHNlbGYuZXJyb3JzYnllcG9jaCkKICAgICAgICAKICAgICAgICBheGFbMV0uc2V0X3lsYWJlbCgiQWJzIEVycm9yIikKICAgICAgICBheGFbMV0uc2V0X3lsaW0oIDAsIDIgKQogICAgICAgIGF4YVsxXS5wbG90KHJhbmdlKDAsZ2FtZXMpLHNlbGYuYWJzZXJyb3JieWVwb2NoKQogICAgICAgIAogICAgICAgIGF4YVsyXS5zZX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ICBpbWFnZSA9IGltYWdlLnJlc2hhcGUoKG4sIG4pKSAjIFJlc2hhcGUgdGhpbmdzIGludG8gYSBueG4gZ3JpZC4KICAgICAgICByb3dfbGFiZWxzID0gcmV2ZXJzZWQobnAuYXJyYXkocmFuZ2UobikpKzEpICNmdWNrIFB5dGhvbgogICAgICAgIGNvbF9sYWJlbHMgPSBbJ0EnLCAnQicsICdDJywgJ0QnLCAnRScsICdGJywgJ0cnLCAnSCcsICdJJ10KICAgICAgICBwbHQubWF0c2hvdyhpbWFnZSkKICAgICAgICBwbHQueHRpY2tzKHJhbmdlKG4pLCBjb2xfbGFiZWxzKQogICAgICAgIHBsdC55dGlja3MocmFuZ2UobiksIHJvd19sYWJlbHMpCiAgICAgICAgcGx0LnNob3coKQogICAgICAgICIiIgogICAgICAgIAogICAgICAgIAogICAgICAgICIiIiBUbyBiZSBhZGRlZCAoPykKICAgICAgICAjVmlzdWFsaXphdGlvbiBvZiB0aGUgaW5wdXQgb24gYSBib2FyZCByZXByZXNlbnRhdGlvbjoKICAgICAgICBpbWFnZSA9IG5wLnplcm9zKG4qbikKICAgICAgICBpbWFnZSA9IHRlc3RkYXRhWzBdCiAgICAgICAgaW1hZ2UgPSBpbWFnZS5yZXNoYXBlKChuLCBuKSkgIyBSZXNoYXBlIHRoaW5ncyBpbnRvIGEgbnhuIGdyaWQuCiAgICAgICAgcm93X2xhYmVscyA9IHJldmVyc2VkKG5wLmFycmF5KHJhbmdlKG4pKSsxKSAjZnVjayBQeXRob24KICAgICAgICBjb2xfbGFiZWxzID0gWydBJywgJ0InLCAnQycsICdEJywgJ0UnLCAnRicsICdHJywgJ0gnLCAnSSddCiAgICAgICAgcGx0Lm1hdHNob3coaW1hZ2UpCiAgICAgICAgcGx0Lnh0aWNrcyhyYW5nZShuKSwgY29sX2xhYmVscykKICAgICAgICBwbHQueXRpY2tzKHJhbmdlKG4pLCByb3dfbGFiZWxzKQogICAgICAgIHBsdC5zaG93KCkKICAgICAgICAiIiIKICAgIAogICAgI3ByaW50KCJXZSBhcmUgIixucC5yb3VuZChjb21wdXRlX2Vycm9yKHN1Z2dlc3RlZG1vdmUsMikqMTAwLDIpLCIlIGF3YXkgZnJvbSB0aGUgcmlnaHQgc29sdXRpb24gbW92ZS4iKSN0ZXN0LCBsZXRzIGp1c3Qgc2F5IHRoYXQgMiB3b3VsZCBiZSB0aGUgYmVzdCBtb3ZlIGZvciBub3cKCiAgICBkZWYgc2F2ZXdlaWdodHMoc2VsZixmaWxlbmFtZSk6CiAgICAgICAgI2ZvciBpIGluIHJhbmdlKGxlbihzZWxmLndlaWdodHMpKToKICAgICAgICBucC5zYXZleihmaWxlbmFtZSxzZWxmLndlaWdodHMpCiAgICAgICAgCiAgICBkZWYgbG9hZHdlaWdodHNmcm9tZmlsZShzZWxmLGZpbGVuYW1lKToKICAgICAgICAjIGlmIGZpbGUgZG9lc250IGV4aXN0LCBkbyBub3RoaW5nCiAgICAgICAgICAgIGlmIG9zLnBhdGguZXhpc3RzKGZpbGVuYW1lKToKICAgICAgICAgICAgICAgIHdpdGggbnAubG9hZChmaWxlbmFtZSkgYXMgZGF0YToKICAgICAgICAgICAgICAgICAgICBzZWxmLndlaWdodHM9W10KICAgICAgICAgICAgICAgICAgICBzZWxmLmxheWVyPVtkYXRhWydhcnJfMCddWzBdLnNoYXBlWzFdXSAjdGhlcmUgYXJlIG4rMSBsYXllcnMgaWYgdGhlcmUgYXJlIG4gd2VpZ2h0bWF0cmljZXMKICAgICAgICAgICAgICAgICAgICBmb3IgaSBpbiByYW5nZShsZW4oZGF0YVsnYXJyXzAnXSkpOgogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLndlaWdodHMuYXBwZW5kKGRhdGFbJ2Fycl8wJ11baV0pCiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBzaGFwZT1kYXRhWydhcnJfMCddW2ldLnNoYXBlCiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYubGF5ZXIuYXBwZW5kKHRlbXBzaGFwZVswXSkKICAgICAgICAgICAgICAgICAgICBzZWxmLmxheWVyY291bnQ9bGVuKHNlbGYubGF5ZXIpLTEKICAgICAgICAgICAgZWxpZiBvcy5wYXRoLmV4aXN0cyhmaWxlbmFtZSArICIubnB6Iik6CiAgICAgICAgICAgICAgICB3aXRoIG5wLmxvYWQoZmlsZW5hbWUgKyAiLm5weiIpIGFzIGRhdGE6CiAgICAgICAgICAgICAgICAgICAgc2VsZi53ZWlnaHRzPVtdCiAgICAgICAgICAgICAgICAgICAgZm9yIGkgaW4gcmFuZ2UobGVuKGRhdGFbJ2Fycl8wJ10pKToKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi53ZWlnaHRzLmFwcGVuZChkYXRhWydhcnJfMCddW2ldKQogICAgICAgICAgICAgICAgCiNUZXN0cwoKZGVmIHRlc3QoKToKICAgIGlmICdWTicgbm90IGluIGxvY2FscygpOgogICAgICAgIFZOID0gVmFsdWVOZXQoKQogICAgZ2FtZXM9MjAwMAogICAgZXRhID0gMC4wMQogICAgW3RhcmcsdGVzdGRhdGFdID0gVk4uZ2VuZXJhdGVfZGF0YShnYW1lcykKICAgIGZvciBpIGluIHJhbmdlKDAsMSk6CiAgICAgICAgW2ZpcnN0b3V0LG91dCxlcnJvcl0gPSBWTi5MZWFybnByb3BhZ2F0ZShldGEgLHRlc3RkYXRhKQogICAgVk4udmlzdWFsaXplKGdhbWVzLGZpcnN0b3V0LG91dCx0YXJnKQogICAgCiAgICAKI3Rlc3QoKQo8fGZpbV9zdWZmaXh8PgogICAgICAgICAgICAgICAgc2VsZi5hYnNlcnJvcmJ5ZXBvY2hbMF09c2VsZi5jb21wdXRlX2Vycm9yICh5WzotMV0sIHRhcmcpCiAgICAgICAgICAgICAgICBzZWxmLktMZGJ5ZXBvY2hbMF09c2VsZi5jb21wdXRlX0tMX2RpdmVyZ2VuY2UoeVs6LTFdLCB0YXJnKQogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBlcnJvciA9IHNlbGYuY29tcHV0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fGZpbV9lbmR8Pg==
bbe72b0d397f0c879fec66ab4e6b9ea4a8b3efc8-4
bbe72b0d397f0c879fec66ab4e6b9ea4a8b3efc8
PHxmaW1fcHJlZml4fD4KIyBHZW5lcmF0ZWQgYnkgRGphbmdvIDIuMS40IG9uIDIwMTktMDEtMTggMTM6MTgKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgoKaW1wb3J0IGRqYW5nby5jb250cmliLnBvc3RncmVzLmZpZWxkcwpmcm9tIGRqYW5nby5kYiBpbXBvcnQgbWlncmF0aW9ucywgbW9kZWxzCgo8fGZpbV9lbmR8Pg==
3c49710675cf16db63995624974c08606da073ba-1
3c49710675cf16db63995624974c08606da073ba
PHxmaW1fcHJlZml4fD4KIyBBdXRob3I6IEphY29iIFNjaG9maWVsZCA8amFjb2JAaGVscHNvY2lhbC5jb20+CiMgQ29weXJpZ2h0IChjKSAyMDE3IEhlbHBTb2NpYWwsIEluYy4KIyBTZWUgTElDRU5TRSBmb3IgZGV0YWlscwoKdHJ5OgogICAgaW1wb3J0IHVqc29uIGFzIGpzb24KZXhjZXB0IEltcG9ydEVycm9yOgogICAgaW1wb3J0IGpzb24KCmZyb20gZnVuY3Rvb2xzIGltcG9ydCByZWR1Y2UKZnJvbSByZXF1ZXN0cyBpbXBvcnQgVGltZW91dApmcm9tIHNzbCBpbXBvcnQgU1NMRXJyb3IKCgpkZWYgX3BvcF9rZXlfdG9rZW4oa2V5X3BhdGgpOgogICAgaWYga2V5X3BhdGggaXMgTm9uZSBvciAnLicgbm90IGluIGtleV9wYXRoOgogICAgICAgIHJldHVybiBrZXlfcGF0aCwgTm9uZQogICAgcGFydHMgPSBrZXlfcGF0aC5zcGxpdCgnLicpCiAgICByZXR1cm4gcGFydHNbMF0sICcuJy5qb2luKHBhcnRzWzE6XSkKCgpkZWYgZGF0YV9nZXQodmFsdWVzLCBrZXk9Tm9uZSwgZGVmYXVsdD1Ob25lKToKICAgICIiIlJldHJpZXZlIHRoZSBrZ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AgICAgICAgICAgICAgICAgaW4ganNvbi5kdW1wcyhkYXRhLCBpbmRlbnQ9aW5kZW50KS5zcGxpdGxpbmVzKCkKICAgICAgICAgICAgICAgICAgICAgaWYgbGluZSkKPHxmaW1fZW5kfD4=
3c49710675cf16db63995624974c08606da073ba-3
3c49710675cf16db63995624974c08606da073ba
PHxmaW1fcHJlZml4fD4KIyBBdXRob3I6IEphY29iIFNjaG9maWVsZCA8amFjb2JAaGVscHNvY2lhbC5jb20+CiMgQ29weXJpZ2h0IChjKSAyMDE3IEhlbHBTb2NpYWwsIEluYy4KIyBTZWUgTElDRU5TRSBmb3IgZGV0YWlscwoKdHJ5OgogICAgaW1wb3J0IHVqc29uIGFzIGpzb24KZXhjZXB0IEltcG9ydEVycm9yOgogICAgaW1wb3J0IGpzb24KCmZyb20gZnVuY3Rvb2xzIGltcG9ydCByZWR1Y2UKZnJvbSByZXF1ZXN0cyBpbXBvcnQgVGltZW91dApmcm9tIHNzbCBpbXBvcnQgU1NMRXJyb3IKCgpkZWYgX3BvcF9rZXlfdG9rZW4oa2V5X3BhdGgpOgogICAgaWYga2V5X3BhdGggaXMgTm9uZSBvciAnLicgbm90IGluIGtleV9wYXRoOgogICAgICAgIHJldHVybiBrZXlfcGF0aCwgTm9uZQogICAgcGFydHMgPSBrZXlfcGF0aC5zcGxpdCgnLicpCiAgICByZXR1cm4gcGFydHNbMF0sICcuJy5qb2luKHBhcnRzWzE6XSkKCgpkZWYgZGF0YV9nZXQodmFsdWVzLCBrZXk9Tm9uZSwgZGVmYXVsdD1Ob25lKToKICAgICIiIlJldHJpZXZlIHRoZSBrZXkgZnJvbSB0aGUgYGB2YWx1ZXNgYCBkaWN0aW9uYXJ5CiAgICB1c2luZyBhICJkb3Qgbm90YXRpb24iIGtleSBzdHJpbmcuCgogICAgOnR5cGUgdmFsdWVzOiBkaWN0CiAgICA6cGFyYW0gdmFsdWVzOiB0aGUgdmFsdWVzIGRpY3QgY29udGFpbmluZyB0aGUga2V5CgogIC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ogICAgICAgICAgICAgICAgICAgICAgaGVscD0iYmFzZSBuYW1lIGZvciBvdXRwdXQgZmlsZXMiKQogICAgb3B0cywgYXJncyA9IHBhcnNlci5wYXJzZV9hcmdzKCkKPHxmaW1faG9sZXw+CiAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXJ0dGltZSc6IDAsCiAgICAgICAgICAgICAgICAgICAgICAgJ2VuZHRpbWUnOiAyKiozMiAtIDEwfSkKICAgIGxvYWRlciA9IGRhdGFsb2FkZXIuRGF0YUxvYWRlcihyZXF2ZWMsIGhvc3Q9KCJnZWNrby5jcy5iZXJrZWxleS5lZHUiLCA0MjQzKSwgZnVsbD1UcnVlKQogICAgZGF0YSA9IGxvYWRlci5ydW4oKQogICAgaWYgb3B0cy5vdXRwdXQgPT0gJy0nOgogICAgICAgIHByaW50IGRhdGEKICAgICAgICBwYXNzCiAgICBlbHNlOgogICAgICAgIGZvciBrLGQgaW4gZGF0YS5pdGVyaXRlbXMoKToKICAgICAgICAgICAgd2l0aCBvcGVuKG9wdHMub3V0cHV0ICsgJy4nICsgc3RyKGspLCAndycpIGFzIGZwOgogICAgICAgICAgICAgICAgd3JpdGVyID0gY3N2LndyaXRlcihmcCkKICAgICAgICAgICAgICAgIHdyaXRlci53cml0ZXJvd3MoZCkKPHxmaW1fc3VmZml4fD4KCiAgICByZXF2ZWMgPSBbXQogICAgZm9yIHN0cmVhbSBpbiBhcmdzOgogICAgICAgIHJlcXZlYy5hcHBlbmQoeydzdHJlYW1pZCc6IGludChzdHJlYW0pLAo8fGZpbV9lbmR8Pg==
b1e9400017e3d8fde708a9ea78963a84da002b83-2
b1e9400017e3d8fde708a9ea78963a84da002b83
PHxmaW1fcHJlZml4fD4KCmltcG9ydCBzeXMKaW1wb3J0IG9zCmltcG9ydCBvcHRwYXJzZQppbXBvcnQgY3N2CgppbXBvcnQgZGF0YWxvYWRlcgoKaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKICAgIHBhcnNlciA9IG9wdHBhcnNlLk9wdGlvblBhcnNlcihkZXNjcmlwdGlvbj0iRmV0Y2ggZGF0YSBmcm9tIHJlYWRpbmdkYiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNhZ2U9InVzYWdlOiAlcHJvZyBbb3B0aW9uc10gc3RyZWFtIHNwZWNzIC4uIikKICAgIHBhcnNlci5hZGRfb3B0aW9uKCctbycsICctLW91dHB1dCcsIGRlc3Q9J291dHB1dCcsIGRlZmF1bHQ9Jy0nLAogICAgICAgICAgICAgICAgICAgICAgaGVscD0iYmFzZSBuYW1lIGZvciBvdXRwdXQgZmlsZXMiKQogICAgb3B0cywgYXJncyA9IHBhcnNlci5wYXJzZV9hcmdzKCkKPHxmaW1faG9sZXw+CiAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXJ0dGltZSc6IDAsCiAgICAgICAgICAgICAgICAgICAgICAgJ2VuZHRpbWUnOiAyKiozMiAtIDEwfSkKICAgIGxvYWRlciA9IGRhdGFsb2FkZXIuRGF0YUxvYWRlcihyZXF2ZWMsIGhvc3Q9KCJnZWNrby5jcy5iZXJrZWxleS5lZHUiLCA0MjQzKSwgZnVsbD1UcnVlKQogICAgZGF0YSA9IGxvYWRlci5ydW4oKQogICAgaWYgb3B0cy5vdXRwdXQgPT0gJy0nOgogICAgICAgIHByaW50IGRhdGEKICAgICAgICBwYXNzCiAgICBlbHNlOgogICAgICAgIGZvciBrLGQgaW4gZGF0YS5pdGVyaXRlbXMoKToKICAgICAgICAgICAgd2l0aCBvcGVuKG9wdHMub3V0cHV0ICsgJy4nICsgc3RyKGspLCAndycpIGFzIGZwOgogICAgICAgICAgICAgICAgd3JpdGVyID0gY3N2LndyaXRlcihmcCkKICAgICAgICAgICAgICAgIHdyaXRlci53cml0ZXJvd3MoZCkKPHxmaW1fc3VmZml4fD4KCiAgICByZXF2ZWMgPSBbXQogICAgZm9yIHN0cmVhbSBpbiBhcmdzOgogICAgICAgIHJlcXZlYy5hcHBlbmQoeydzdHJlYW1pZCc6IGludChzdHJlYW0pLAo8fGZpbV9lbmR8Pg==
b1e9400017e3d8fde708a9ea78963a84da002b83-3
b1e9400017e3d8fde708a9ea78963a84da002b83
PHxmaW1fcHJlZml4fD4KCmltcG9ydCBzeXMKaW1wb3J0IG9zCmltcG9ydCBvcHRwYXJzZQppbXBvcnQgY3N2CgppbXBvcnQgZGF0YWxvYWRlcgoKaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKICAgIHBhcnNlciA9IG9wdHBhcnNlLk9wdGlvblBhcnNlcihkZXNjcmlwdGlvbj0iRmV0Y2ggZGF0YSBmcm9tIHJlYWRpbmdkYiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNhZ2U9InVzYWdlOiAlcHJvZyBbb3B0aW9uc10gc3RyZWFtIHNwZWNzIC4uIikKICAgIHBhcnNlci5hZGRfb3B0aW9uKCctbycsICctLW91dHB1dCcsIGRlc3Q9J291dHB1dCcsIGRlZmF1bHQ9Jy0nLAogICAgICAgICAgICAgICAgICAgICAgaGVscD0iYmFzZSBuYW1lIGZvciBvdXRwdXQgZmlsZXMiKQogICAgb3B0cywgYXJncyA9IHBhcnNlci5wYXJzZV9hcmdzKCkKCiAgICByZXF2ZWMgPSBbXQogICAgZm9yIHN0cmVhbSBpbiBhcmdzOgogICAgICAgIHJlcXZlYy5hcHBlbmQoeydzdHJlYW1pZCc6IGludChzdHJlYW0pLAogICAgICAgICAgICAgICAgICAgICAgICdzdGFydHRpbWUnOiAwLAogICAgICAgICAgICAgICAgICAgICAgICdlbmR0aW1lJzogMioqMzIgLSAxMH0pCiAgICBsb2FkZXIgPSBkYXRhbG9hZGVyLkRhdGFMb2FkZXIocmVxdmVjLCBob3N0PSgiZ2Vja28uY3MuYmVya2VsZXkuZWR1IiwgNDI0MyksIGZ1bGw9VHJ1ZSkKICAgIGRhdGEgPSBsb2FkZXIucnVuKCkKICAgIGlmIG9wdHMub3V0cHV0ID09ICctJzoKPHxmaW1faG9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9pZCA9IGRsaXN0c19pZFtpXQogICAgICAgIFNjaG9sYXJfaWQgPSBzbGlzdHNfaWRbal0KICAgICAgICBEQkxQX3llYXIgPSBpbnQoZGxpc3RzX3llYXJbaV0pCiAgICAgICAgaWYgc2xpc3RzX3llYXJbal0gIT0gJ251bGwnOgogICAgICAgICAgICB0ZW1wID0gZmxvYXQoc2xpc3RzX3llYXJbal0pCiAgICAgICAgICAgIFNjaG9sYXJfeWVhciA9IGludCh0ZW1wKQogICAgICAgICPorqHnrpfnm7jkvLzluqYKICAgICAgICBqYWNkID0gSmFjY3JhZChhLGIpCiAgICAgICAgc3RkID0gZWRpdF9kaXN0YW5jZShhLGIpL21heChsZW4oYSksbGVuKGIpKQogICAgICAgIGVkaXQgPSAxLXN0ZAogICAgICAgICPorqHnrpflubPlnYflgLwKICAgICAgICBodWl6b24gPSAoamFjZCtlZGl0KS8yCiAgICAgICAgI+WIpOaWrQogICAgICAgIGlmIDAuNzAgPCBodWl6b24gPCAxLjE6CiAgICAgICAgICAgICPmn6Xmib7lnKjljLnphY3pm4bkuK3nmoTmlbDmja4KICAgICAgICAgICAgZGF0YSA9IGNzdl9kYXRhLmxvY1tjc3ZfZGF0YVsnaWREQkxQJ10gPT0gREJMUF9pZCwgJ2lkU2Nob2xhciddCiAgICAgICAgICAgICAj5Yik5pat5qCH6K6wCiAgICAgICAgICAgIHRhZyA9IFRydWUKICAgICAgICAgICAgI+WIpOaWrei/m+ihjOWMuemFjQogICAgICAgICAgICBpZiBTY2hvbGFyX3llYXIgIT0gJ251bGwnOgogICAgICAgICAgICAgICAgaWYgREJMUF95ZWFyID09IFNjaG9sYXJfeWVhcjoKICAgICAgICAgICAgICAgICAgICB0YWcgPSBUcnVlCiAgICAgICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgICAgIHRhZyA9IEZhbHNlCiAgICAgICAgICAgICPlvqrnjq/mn6Xor6LmlbDnu4TliKTmlq3mmK/lkKbmraPnoa4KICAgICAgICAgICAgaWYgZGF0YS5zaGFwZSAhPSAoMCwpOgogICAgICAgICAgICAgICAgZm9yIG0gaW4gcmFuZ2UobGVuKGRhdGEpKToKICAgICAgICAgICAgICAgICAgICBkYXRhX3QgPSBzdHIoZGF0YS52YWx1ZXNbbV0pCiAgICAgICAgICAgICAgICAgICAgaWYgZGF0YV90ID09IFNjaG9sYXJfaWQ6CiAgICAgICAgICAgICAgICAgICAgICAgIEZsYWcgPSBUcnVlCiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrCiAgICAgICAgICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgICAgICAgICAgRmxhZyA9IEZhbHNlCiAgICAgICAgICAgIAogICAgICAgICAgICAgICAgaWYgRmxhZyBhbmQgdGFnOgogICAgICAgICAgICAgICAgICAgIFRQKz0xCiAgICAgICAgICAgICAgICAgICAgI+eUn+aIkOWMuemFjeaIkOWKn+eahOihqOagvAogICAgICAgICAgICAgICAgICAgIGNzdl9kYXRhLmxvY1tjc3ZfZGF0YVsnaWREQkxQJ10gPT0gREJMUF9pZCwgJ1NjaG9sYXJfaWQnXSA9ICdDT1JSRUNUISEhISEhJwogICAgICAgICAgICAgICAgICAgICNwcmludCgiPERCTFBfbmFtZSxTY2hvbGFyX25hbWU+LTwlcywlcz4tPCVzLCVzPnzlubPlnYfnm7jkvLzluqY6ICVmICIgJSAoZGxpc3RzW2ldLCBzbGlzdHNbal0sIGRsaXN0c19pZFtpXSxzbGlzdHNfaWRbal0saHVpem9uKSkKICAgICAgICAgICAgICAgICAgICAjLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLeiejeWQiOWKn+iDvS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICAgICAgICAgICAgICAgICMgI+aWh+eroOe7k+eCueiejeWQiAogICAgICAgICAgICAgICAgICAgICMgdHJ5OgogICAgICAgICAgICAgICAgICAgICMgICAgIHNlc3Npb24ucnVuKCIgTUFUQ0ggKGExOkFDTV9wYXBlciB7QUNNX2lkOiclcyd9KSwoYTI6REJMUDJfcGFwZXIge0RCTFAyX2lkOiclcyd9KSBXSVRIIGhlYWQoY29sbGVjdChbYTEsYTJdKSkgYXMgbm9kZXMgQ0FMTCBhcG9jLnJlZmFjdG9yLm1lcmdlTm9kZXMobm9kZXMse3Byb3BlcnRpZXM6J2NvbWJpbmUnLCBtZXJnZVJlbHM6dHJ1ZX0pIHlpZWxkIG5vZGUgcmV0dXJuIG5vZGVzIiAlIChBQ01faWQsREJMUDJfaWQpKQogICAgICAgICAgICAgICAgICAgICMgZXhjZXB0OgogICAgICAgICAgICAgICAgICAgICMgI+aWh+eroOWvueW6lOeahOS8muiurue7k+eCueiejeWQiAogICAgICAgICAgICAgICAgICAgICMgICAgIEFfdmVudWVfSUQgPSBBQ01fVmVudWUoQUNNX2lkKQogICAgICAgICAgICAgICAgICAgICMgICAgIERfdmVudWVfSUQgPSBEQkxQMl9WZW51ZShEQkxQMl9pZCkKICAgICAgICAgICAgICAgICAgICAjICAgICBzZXNzaW9uLnJ1bigiTUFUQ0ggKGExOkFDTV92ZW51ZSB7dmVudWU6JyVzJ30pLChhMjpEQkxQMl92ZW51ZSB7dmVudWU6JyVzJ30pIFdJVEggaGVhZChjb2xsZWN0KFthMSxhMl0pKSBhcyBub2RlcyBDQUxMIGFwb2MucmVmYWN0b3IubWVyZ2VOb2Rlcyhub2Rlcyx7cHJvcGVydGllczonY29tYmluZScsIG1lcmdlUmVsczp0cnVlfSkgeWllbGQgbm9kZSByZXR1cm4gbm9kZXMiICUgKEFfdmVudWVfSUQsRF92ZW51ZV9JRCkpCiAgICAgICAgICAgICAgICAgICAgIyAgICAgI+afpeivouaWh+eroOWvueW6lOeahOS9nOiAhQogICAgICAgICAgICAgICAgICAgICMgICAgIGFsaXN0c190ID0gQUNNX2F1dGhvcihBQ01faWQpCiAgICAgICAgICAgICAgICAgICAgIyAgICAgZGxpc3RzX3QgPSBEQkxQMl9hdXRob3IoREJMUDJfaWQpCiAgICAgICAgICAgICAgICAgICAgIyAgICAgcHJpbnQoYWxpc3RzX3QsZGxpc3RzX3QpCiAgICAgICAgICAgICAgICAgICAgIyAgICAgI+aWh+eroOWvueW6lOeahOS9nOiAheeahOe7k+eCueiejeWQiCzlnKjmlofnq6Dlr7nlupTnmoTmlbDmja7pm4bkuK3ov5vooYzljLnphY3vvIzlpKfkuo4wLjXnmoTlsLHov5vooYzono3lkIgKICAgICAgICAgICAgICAgICAgICAjICAgICBmb3IgbiBpbiByYW5nZShsZW4oYWxpc3RzX3QpKToKICAgICAgICAgICAgICAgICAgICAjICAgICAgICAgZm9yIG0gaW4gcmFuZ2UobGVuKGRsaXN0c190KSk6CiAgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgICBhYSA9IGFsaXN0c190W25dCiAgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgICBiYiA9IGRsaXN0c190W21dCiAgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgICAj6K6h566X5L2c6ICF57uT54K555qE55u45Ly85bqmCiAgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgICBqYWNkX3QgPSBKYWNjcmFkKGFhLGJiKQogICAgICAgICAgICAgICAgICAgICMgICAgICAgICAgICAgc3RkX3QgPSBlZGl0X2Rpc3RhbmNlKGFhLGJiKS9tYXgobGVuKGFhKSxsZW4oYmIpKQogICAgICAgICAgICAgICAgICAgICMgICAgICAgICAgICAgZWRpdF90ID0gMS1zdGRfdAogICAgICAgICAgICAgICAgICAgICMgICAgICAgICAgICAgaHVpem9uX3QgPSAoamFjZF90K2VkaXRfdCkvMgogICAgICAgICAgICAgICAgICAgICMgICAgICAgICAgICAgI+W5s+Wdh+ebuOS8vOW6puWkp+S6jjAuNjnlsLHov5vooYzono3lkIgKICAgICAgICAgICAgICAgICAgICAjICAgICAgICAgICAgIGlmIGh1aXpvbl90ID4gMC42OToKICAgICAgICAgICAgICAgICAgICAjICAgICAgICAgICAgICAgICBwcmludCgnLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLeWNs+WwhuWBmuiejeWQiOeahOS9nOiAhee7k+eCuScpCiAgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgICAgICAgcHJpbnQoaHVpem9uX3QpCiAgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgICAgICAgcHJpbnQoYWEsYmIpCiAgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgICAgICAgdHJ5OgogICAgICAgICAgICAgICAgICAgICMgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLnJ1bigiTUFUQ0ggKGExOkFDTV9hdXRob3Ige25hbWU6JyVzJ30pLChhMjpEQkxQMl9hdXRob3Ige25hbWU6JyVzJ30pIFdJVEggaGVhZChjb2xsZWN0KFthMSxhMl0pKSBhcyBub2RlcyBDQUxMIGFwb2MucmVmYWN0b3IubWVyZ2VOb2Rlcyhub2Rlcyx7cHJvcGVydGllczonY29tYmluZScsIG1lcmdlUmVsczp0cnVlfSkgeWllbGQgbm9kZSByZXR1cm4gbm9kZXMgIiAlIChhYSxiYikpCiAgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgICAgICAgZXhjZXB0OgogICAgICAgICAgICAgICAgICAgICMgICAgICAgICAgICAgICAgICAgICBwYXNzCiAgICAgICAgICAgICAgICAgICAgICAgICMgI+a4heepumxpc3QKICAgICAgICAgICAgICAgICAgICAgICAgIyBhbGlzdHNfdC5jbGVhcigpCiAgICAgICAgICAgICAgICAgICAgICAgICMgZGxpc3RzX3QuY2xlYXIoKQogICAgICAgICAgICAgICAgICAgICMtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLeiejeWQiOWKn+iDvS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgICAgICBGUCs9MQogICAgICAgICAgICAgICA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Lm9uZXMoKDEwMCwpKSwgIlRoZSBudW1iZXIgb2YgZnJlcXVlbmNpZXMiKV0pCjx8ZmltX2VuZHw+
bbde94716fab70a19da84a2a3eabb083eb1ae47c-1
bbde94716fab70a19da84a2a3eabb083eb1ae47c
PHxmaW1fcHJlZml4fD4KaW1wb3J0IG51bXB5IGFzIG5wCmltcG9ydCBwYW5kYXMgYXMgcGQKZnJvbSBza2xlYXJuIGltcG9ydCBjcm9zc192YWxpZGF0aW9uIGFzIGN2CmltcG9ydCBtYXRwbG90bGliLnB5cGxvdCBhcyBwbHQKCmRlZiBtYWluKCk6CgogICAgaGVhZGVyID0gWyd1c2VyX2lkJywgJ2l0ZW1faWQnLCAncmF0aW5nJywgJ3RpbWVzdGFtcCddCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgIGRoZWFkZXIgPSB7InVzZXJfaWQiOmludCwgIml0ZW1faWQiOmludCwgJ3JhdGluZyc6aW50fQoKCiAgICBkZiA9IHBkLnJlYWRfY3N2KCd0cmFpbl9hY3Rpdml0eS5jc3YnLCBzZXA9JywnLCBuYW1lcz1kaGVhZGVyKQo8fGZpbV9lbmR8Pg==
bbde94716fab70a19da84a2a3eabb083eb1ae47c-2
bbde94716fab70a19da84a2a3eabb083eb1ae47c
PHxmaW1fcHJlZml4fD4KaW1wb3J0IG51bXB5IGFzIG5wCmltcG9ydCBwYW5kYXMgYXMgcGQKZnJvbSBza2xlYXJuIGltcG9ydCBjcm9zc192YWxpZGF0aW9uIGFzIGN2CmltcG9ydCBtYXRwbG90bGliLnB5cGxvdCBhcyBwbHQKCmRlZiBtYWluKCk6CgogICAgaGVhZGVyID0gWyd1c2VyX2lkJywgJ2l0ZW1faWQnLCAncmF0aW5nJywgJ3RpbWVzdGFtcCddCiAgICBkaGVhZGVyID0geyJ1c2VyX2lkIjppbnQsICJpdGVtX2lkIjppbnQsICdyYXRpbmcnOmludH0KCgogICAgZGYgPSBwZC5yZWFkX2NzdigndHJhaW5fYW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eHw+CiAgICBvcGVyYXRpb25zID0gWwogICAgICAgIG1pZ3JhdGlvbnMuQWx0ZXJGaWVsZCgKICAgICAgICAgICAgbW9kZWxfbmFtZT0nY291cnNlb3JtJywKICAgICAgICAgICAgbmFtZT0nY29kZScsCjx8ZmltX2VuZHw+
af3203d7ead356677e3cbad686706b0038bb61b5-3
af3203d7ead356677e3cbad686706b0038bb61b5
PHxmaW1fcHJlZml4fD4KIyBHZW5lcmF0ZWQgYnkgRGphbmdvIDMuMi43IG9uIDIwMjEtMTAtMDYgMDg6NDQKCmZyb20gZGphbmdvLmRiIGltcG9ydCBtaWdyYXRpb25zLCBtb2RlbHMKCgpjbGFzcyBNaWdyYXRpb24obWlncmF0aW9ucy5NaWdyYXRpb24pOgoKICAgIGRlcGVuZGVuY2llcyA9IFsKICAgICAgICAoJ2NvdXJzZXMnLCAnMDAwMV9pbml0aWFsJyksCiAgICBdCgogICAgb3BlcmF0aW9ucyA9IFsKICAgICAgICBtaWdyYXRpb25zLkFsdGVyRmllbGQoCiAgICAgICAgICAgIG1vZGVsX25hbWU9J2NvdXJzZW9ybScsCiAgICAgICAgICAgIG5hbWU9J2NvZGUnLAogICAgICAgICAgICBmaWVsZD1tb2RlbHMuQ2hhckZpZWxkKGJsYW5rPVRydWUsIGRlZmF1bHQ9JzJCNEM3MCcsIG1heF9sZW5ndGg9NiwgdmVyYm9zZV9uYW1lPSdDb2RlJyksCjx8ZmltX2hvbGV8PgogICAgXQo8fGZpbV9zdWZmaXh8PgogICAgICAgICksCjx8ZmltX2VuZHw+
af3203d7ead356677e3cbad686706b0038bb61b5-4
af3203d7ead356677e3cbad686706b0038bb61b5
PHxmaW1fcHJlZml4fD4KIyBHZW5lcmF0ZWQgYnkgRGphbmdvIDMuMi43IG9uIDIwMjEtMTAtMDYgMDg6NDQKCmZyb20gZGphbmdvLmRiIGltcG9ydCBtaWdyYXRpb25zLCBtb2RlbHMKCgpjbGFzcyBNaWdyYXRpb24obWlncmF0aW9ucy5NaWdyYXRpb24pOgoKICAgIGRlcGVuZGVuY2llcyA9IFsKICAgICAgICAoJ2NvdXJzZXMnLCAnMDAwMV9pbml0aWFsJyksCjx8ZmltX2hvbGV8PgogICAgICAgICAgICBtb2RlbF9uYW1lPSdjb3Vyc2Vvcm0nLAogICAgICAgICAgICBuYW1lPSdjb2RlJywKICAgICAgICAgICAgZmllbGQ9bW9kZWxzLkNoYXJGaWVsZChibGFuaz1UcnVlLCBkZWZhdWx0PScyQjRDNzAnLCBtYXhfbGVuZ3RoPTYsIHZlcmJvc2VfbmFtZT0nQ29kZScpLAogICAgICAgICksCiAgICBdCjx8ZmltX3N1ZmZpeHw+CiAgICBdCgogICAgb3BlcmF0aW9ucyA9IFsKICAgICAgICBtaWdyYXRpb25zLkFsdGVyRmllbGQoCjx8ZmltX2VuZHw+
af3203d7ead356677e3cbad686706b0038bb61b5-5
af3203d7ead356677e3cbad686706b0038bb61b5
PHxmaW1fcHJlZml4fD4KIyBHZW5lcmF0ZWQgYnkgRGphbmdvIDMuMi43IG9uIDIwMjEtMTAtMDYgMDg6NDQKPHxmaW1faG9sZXw+CmNsYXNzIE1pZ3JhdGlvbihtaWdyYXRpb25zLk1pZ3JhdGlvbik6CgogICAgZGVwZW5kZW5jaWVzID0gWwogICAgICAgICgnY291cnNlcycsICcwMDAxX2luaXRpYWwnKSwKICAgIF0KCiAgICBvcGVyYXRpb25zID0gWwogICAgICAgIG1pZ3JhdGlvbnMuQWx0ZXJGaWVsZCgKICAgICAgICAgICAgbW9kZWxfbmFtZT0nY291cnNlb3JtJywKICAgICAgICAgICAgbmFtZT0nY29kZScsCiAgICAgICAgICAgIGZpZWxkPW1vZGVscy5DaGFyRmllbGQoYmxhbms9VHJ1ZSwgZGVmYXVsdD0nMkI0QzcwJywgbWF4X2xlbmd0aD02LCB2ZXJib3NlX25hbWU9J0NvZGUnKSwKICAgICAgICApLAogICAgXQo8fGZpbV9zdWZmaXh8PgoKZnJvbSBkamFuZ28uZGIgaW1wb3J0IG1pZ3JhdGlvbnMsIG1vZGVscwoKCjx8ZmltX2VuZHw+
3c3ec1e7be77e3fb005173280a00601ae696cc62-1
3c3ec1e7be77e3fb005173280a00601ae696cc62
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHNjcmFweQoKY2xhc3MgQmxvZ1NwaWRlcihzY3JhcHkuU3BpZGVyKToKICAgIG5hbWUgPSAnZWxmbGFjbycKPHxmaW1faG9sZXw+CiAgICAgICAgCXlpZWxkIHNjcmFweS5SZXF1ZXN0KHJlc3BvbnNlLnVybGpvaW4odXJsKSwgc2VsZi5wYXJzZV90aXRsZXMpCiAgICAgICAgCQoKICAgIGRlZiBwYXJzZV90aXRsZXMoc2VsZiwgcmVzcG9uc2UpOgogICAgICAgIGZvciBwb3N0X3RpdGxlIGluIHJlc3BvbnNlLmNzcygnZGl2LmJsb2ctbGVmdCBwJykuZXh0cmFjdCgpOgogICAgICAgICAgICB5aWVsZCB7J3RpdGxlJzogcG9zdF90aXRsZX0KPHxmaW1fc3VmZml4fD4KICAgIHN0YXJ0X3VybHMgPSBbJ2h0dHA6Ly93d3cucm9jay5jb20uYXIvZGlzY29zLzIvMjM4NS5zaHRtbCddCgogICAgZGVmIHBhcnNlKHNlbGYsIHJlc3BvbnNlKToKICAgICAgICBmb3IgdXJsIGluIHJlc3BvbnNlLmNzcygnZGl2LmRpdi10b3AgdGFibGUgYTo6YXR0cigiaHJlZiIpJykuZXh0cmFjdCgpOgo8fGZpbV9lbmR8Pg==
3c3ec1e7be77e3fb005173280a00601ae696cc62-2
3c3ec1e7be77e3fb005173280a00601ae696cc62
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHNjcmFweQoKY2xhc3MgQmxvZ1NwaWRlcihzY3JhcHkuU3BpZGVyKToKICAgIG5hbWUgPSAnZWxmbGFjbycKICAgIHN0YXJ0X3VybHMgPSBbJ2h0dHA6Ly93d3cucm9jay5jb20uYXIvZGlzY29zLzIvMjM4NS5zaHRtbCddCjx8ZmltX2hvbGV8PgoK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lID0gJycKICAgICAgICBzeXN0ZW1fbmFtZSA9ICcnCiAgICAgICAgIyBwcmludCBhIGRpYWxvZyAKICAgICAgICBtaXNzZWQgPSBGYWxzZQogICAgICAgIGZvciB0aSx0dXJuIGluIGVudW1lcmF0ZShkaWFsb2cpOgogICAgICAgICAgICBzcGVha2VyID0gdHVyblsnc3BlYWtlciddCiAgICAgICAgICAgIHNpeC5wcmludF8oJyVzOicgJSBzcGVha2VyLCBmaWxlPWZvLCBlbmQ9JycpCiAgICAgICAgICAgIGlmIHN1bShbdGlkIGluIHR3ZWV0X3Bvb2wgZm9yIHRpZCBpbiB0dXJuWydpZHMnXV0pIDwgbGVuKHR1cm5bJ2lkcyddKToKICAgICAgICAgICAgICAgIHNpeC5wcmludF8oJyBfX01JU1NJTkdfXycsIGZpbGU9Zm8pCiAgICAgICAgICAgICAgICBtaXNzZWQgPSBUcnVlCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KCiAgICAgICAgICAgIGVsaWYgbGVuKHR1cm5bJ2lkcyddKT09MCBhbmQgdGk9PWxlbihkaWFsb2cpLTE6CiAgICAgICAgICAgICAgICBzaXgucHJpbnRfKCcgX19VTkRJU0NMT1NFRF9fJywgZmlsZT1mbykKICAgICAgICAgICAgICAgIG5fdHVybnMgKz0gMQo8fGZpbV9lbmR8Pg==
3c0d60bf1408353f964c08238799e403c856aa2c-3
3c0d60bf1408353f964c08238799e403c856aa2c
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9lbnYgcHl0aG9uCiMgLSotIGNvZGluZzogdXRmLTggLSotCiIiImV4dHJhY3Rfb2ZmaWNpYWxfdHdpdHRlcl9kaWFsb2dzLnB5OgogICBBIHNjcmlwdCB0byBleHRyYWN0IHRleHQgZnJvbSB0d2l0dGVyIGRpYWxvZ3MuCgogICBDb3B5cmlnaHQgKGMpIDIwMTcgVGFrYWFraSBIb3JpICAodGhvcmlAbWVybC5jb20pCgogICBUaGlzIHNvZnR3YXJlIGlz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JykKICAgIGVsc2U6CiAgICAgICAgZm8gPSBzeXMuc3Rkb3V0CiAgICBpZiBub3QgYXJncy5ub19wcm9ncmVzc19iYXI6CiAgICAgICAgdHdlZXRfaWRfbGlzdCA9IHRxZG0oaWRfbGlzdCkKCiAgICBuX2RpYWxvZ3MgPSAwCiAgICBuX3R1cm5zID0gMAogICAgbl90dXJuc19pbl9saXN0ID0gMAogICAgZm9yIGRpYWxvZyBpbiB0d2VldF9pZF9saXN0OgogICAgICAgIHVzZXJfbmFtZSA9ICcnCiAgICAgICAgdXNlcl9maXJzdF9uYW1lID0gJycKICAgICAgICBzeXN0ZW1fbmFtZSA9ICcnCiAgICAgICAgIyBwcmludCBhIGRpYWxvZyAKICAgICAgICBtaXNzZWQgPSBGYWxzZQogICAgICAgIGZvciB0aSx0dXJuIGluIGVudW1lcmF0ZShkaWFsb2cpOgogICAgICAgICAgICBzcGVha2VyID0gdHVyblsnc3BlYWtlciddCiAgICAgICAgICAgIHNpeC5wcmludF8oJyVzOicgJSBzcGVha2VyLCBmaWxlPWZvLCBlbmQ9JycpCiAgICAgICAgICAgIGlmIHN1bShbdGlkIGluIHR3ZWV0X3Bvb2wgZm9yIHRpZCBpbiB0dXJuWydpZHMnXV0pIDwgbGVuKHR1cm5bJ2lkcyddKToKICAgICAgICAgICAgICAgIHNpeC5wcmludF8oJyBfX01JU1NJTkdfXycsIGZpbGU9Zm8pCiAgICAgICAgICAgICAgICBtaXNzZWQgPSBUcnVlCgogICAgICAgICAgICBlbGlmIGxlbih0dXJuWydpZHMnXSk9PTAgYW5kIHRpPT1sZW4oZGlhbG9nKS0xOgogICAgICAgICAgICAgICAgc2l4LnByaW50XygnIF9fVU5ESVNDTE9TRURfXycsIGZpbGU9Zm8pCiAgICAgICAgICAgICAgICBuX3R1cm5zICs9IDEKCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBmb3IgdGlkIGluIHR1cm5bJ2lkcyddOgogICAgICAgICAgICAgICAgICAgIHR3ZWV0ID0gdHdlZXRfcG9vbFt0aWRdCiAgICAgICAgICAgICAgICAgICAgc2NyZWVuX25hbWUgPSB0d2VldFsndXNlciddWydzY3JlZW5fbmFtZSddCiAgICAgICAgICAgICAgICAgICAgbmFtZSA9IHR3ZWV0Wyd1c2VyJ11bJ25hbWUnXQogICAgICAgICAgICAgICAgICAgIHRleHQgPSB0d2VldFsndGV4dCddCiAgICAgICAgICAgICAgICAgICAgaWYgc3BlYWtlciA9PSAnUyc6CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIG5vdCBhcmdzLmRlYnVnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHByZXByb2Nlc3ModGV4dCwgdXNlcl9uYW1lLCBzcGVha2VyPXNwZWFrZXIsIGZpcnN0X25hbWU9dXNlcl9maXJzdF9uYW1lKQogICAgICAgICAgICAgICAgICAgICAgICBzeXN0ZW1fbmFtZSA9IHNjcmVlbl9uYW1lCiAgICAgICAgICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgICAgICAgICAgaWYgbm90IGFyZ3MuZGVidWc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gcHJlcHJvY2Vzcyh0ZXh0LCBzeXN0ZW1fbmFtZSwgc3BlYWtlcj1zcGVha2VyKQogICAgICAgICAgICAgICAgICAgICAgICAjIHNldCB1c2VyJ3Mgc2NyZWVuIG5hbWUgYW5kIGZpcnN0IG5hbWUgdG8gcmVwbGFjZSB0aGUgbmFtZXMKPHxmaW1faG9sZXw+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtID0gcmUubWF0Y2gocicoW0EtWmEtejAtOV0rKSQnLCB0b2tlbnNbMF0pCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiBtOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZXJfZmlyc3RfbmFtZSA9IG0uZ3JvdXAoMSkKCiAgICAgICAgICAgICAgICAgICAgc2l4LnByaW50XygnICVzJyAlIHR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sIHNlbGYucGMpCgogICAgICAgIGRlZiBjYWxsKGlucHV0XywgdHJhaW4pOgogICAgICAgICAgICB4ID0gcGFyYWxsZWxfY29udihpbnB1dF8pCiAgICAgICAgICAgIHJldHVybiBnYXRpbmcoeCwgdHJhaW4pCgogICAgICAgIHJldHVybiBjYWxsLCBjbW90c3pfdG90YWwKCiAgICBkZWYgZ2V0X2RzeihzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi53c3oKCiAgICBkZWYgZ2V0X3ZzeihzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi52c3oKCiAgICBkZWYgZW5jb2RlKHNlbGYsIHgsIHRyYWluPUZhbHNlKToKICAgICAgICB4Y2ggPSB4LnRyYW5zcG9zZSgwLCAyLCAxKQogICAgICAgIFcsIFQsIEIgPSB4LnNoYXBlCiAgICAgICAgeGNoID0geC5yZXNoYXBlKFcsIC0xKQogICAgICAgICMgVyB4IChUIHggQikKICAgICAgICBlbWJlZGRlZCA9IFtzZWxmLmxvb2t1cChzZWxmLmVtYmVkZGluZ3MsIHYsIHNlbGYuZmluZXR1bmUpIGZvciB2IGluIHhjaF0KICAgICAgICBlbWJlZF9jaGFyc192ZWMgPSBkeS5jb25jYXRlbmF0ZShlbWJlZGRlZCkKICAgICAgICBlbWJlZF9jaGFyc192ZWMgPSBkeS5yZXNoYXBlKGVtYmVkX2NoYXJzX3ZlYywgKFcsIHNlbGYuZHN6KSwgVCpCKQogICAgICAgIHBvb2xlZF9jaGFycyA9IHNlbGYucG9vbChlbWJlZF9jaGFyc192ZWMsIHRyYWluKQogICAgICAgIHBvb2xlZF9jaGFycyA9IGR5LnJlc2hhcGUocG9vbGVkX2NoYXJzLCAoc2VsZi53c3osIFQpLCBCKQogICAgICAgICMgQmFjayB0byBUIHggVyB4IEIKICAgICAgICBwb29sZWRfY2hhcnMgPSBkeS50cmFuc3Bvc2UocG9vbGVkX2NoYXJzKQogICAgICAgIHJldHVybiBwb29sZWRfY2hhcnMKCgpAcmVnaXN0Z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ZD1UcnVlKQoKICAgICAgICBzdGF0ZSA9IGR5LmNvbmNhdGVuYXRlKFtmd2Rfc3RhdGVbLTFdLCBid2Rfc3RhdGVbLTFdXSkKICAgICAgICBzdGF0ZSA9IGR5LnRyYW5zcG9zZShkeS5yZXNoYXBlKHN0YXRlLCAoc2VsZi5sc3Rtc3osIFQpLCBiYXRjaF9zaXplPUIpKQogICAgICAgIHJldHVybiBzdGF0ZQo8fGZpbV9zdWZmaXh8PgogICAgICAgIHNlbGYuZHJvcG91dCA9IGZsb2F0KGt3YXJncy5nZXQoJ2Ryb3BvdXQnLCAwLjEpKQogICAgICAgIG14bGVuID0gaW50KGt3YXJncy5nZXQoJ214bGVuJywgMTAwMCkpCiAgICAgICAgbWF4X3RpbWVzY2FsZSA9IGZsb2F0KGt3YXJncy5nZXQoJ21heF90aW1lc2NhbGUnLCAxZTQpKQogICAgICAgIGxvZ190aW1lc2NhbGVfaW5jID0gbWF0aC5sb2cobWF4X3RpbWVzY2FsZSkgLyBzZWxmLmRzego8fGZpbV9lbmR8Pg==
0570c137419cdeb3936ebafd6f9573955d7e3def-1
0570c137419cdeb3936ebafd6f9573955d7e3def
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgogICAgbmFtZSA9ICdnZXN0aW9uVG9tYURhdG9zJwo8fGZpbV9zdWZmaXh8Pgpmcm9tIGRqYW5nby5hcHBzIGltcG9ydCBBcHBDb25maWcKCgpjbGFzcyBHZXN0aW9udG9tYWRhdG9zQ29uZmlnKEFwcENvbmZpZyk6Cjx8ZmltX2VuZHw+
0570c137419cdeb3936ebafd6f9573955d7e3def-2
0570c137419cdeb3936ebafd6f9573955d7e3def
PHxmaW1fcHJlZml4fD4KZnJvbSBkamFuZ28uYXBwcyBpbXBvcnQgQXBwQ29uZmlnCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KCgpjbGFzcyBHZXN0aW9udG9tYWRhdG9zQ29uZmlnKEFwcENvbmZpZyk6CiAgICBuYW1lID0gJ2dlc3Rpb25Ub21hRGF0b3MnCjx8ZmltX2VuZHw+
0570c137419cdeb3936ebafd6f9573955d7e3def-3
0570c137419cdeb3936ebafd6f9573955d7e3def
PHxmaW1fcHJlZml4fD4KZnJvbSBkamFuZ28uYXBwcyBpbXBvcnQgQXBwQ29uZmlnCgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CgpjbGFzcyBHZXN0aW9udG9tYWRhdG9zQ29uZmlnKEFwcENvbmZpZyk6CiAgICBuYW1lID0gJ2dlc3Rpb25Ub21hRGF0b3MnCjx8ZmltX2VuZHw+