id
stringlengths
42
42
src_hexsha
stringlengths
40
40
example
stringlengths
80
1.37M
5972e8bae2de8ec1def4365598f67348f26797a2-1
5972e8bae2de8ec1def4365598f67348f26797a2
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHRvcmNoCmltcG9ydCB0b3JjaC5ubiBhcyBubgoKCmNsYXNzIFJhbmRvbVBvbGljeShubi5Nb2R1bGUpOgogICAgZGVmIF9faW5pdF9fKHNlbGYsIGNvbmZpZ19kaWN0KToKICAgICAgICBzdXBlcihSYW5kb21Qb2xpY3ksIHNlbGYpLl9faW5pdF9fKCkKICAgICAgICBzZWxmLm91dHB1dF9zaXplID0gY29uZmlnX2RpY3QubW9kZWwuZXhwZXJ0X3BvbGljeS5udW1fYWxsb3dlZF9hY3Rpb25zICsgMQoKICAgIGRlZiBmb3J3YXJkKHNlbGYsIGlucHV0cyk6CiAgICAgICAgYmF0Y2hfc2l6ZSA9IGlucHV0cy5zaGFwZVswXQo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgYmF0Y2hfc2l6ZSA9IDEKICAgICAgICByZXR1cm4gMiAqIHRvcmNoLnJhbmQoKGJhdGNoX3NpemUsIDYpKSAtIDEKCjx8ZmltX2VuZHw+
abfcd0ed5119c1a0cb5c504076138d7c48cc3c7f-1
abfcd0ed5119c1a0cb5c504076138d7c48cc3c7f
PHxmaW1fcHJlZml4fD4KIyAtKi0gY29kaW5nOiB1dGYtOCAtKi0KIyBDb3B5cmlnaHQgMjAxOCBBa3JldGlvbiBGcmFuY2UKIyBAYXV0aG9yOiBBbGV4aXMgZGUgTGF0dHJlIDxhbGV4aXMuZGVsYXR0cmVAYWtyZXRpb24uY29tPgojIExpY2Vuc2UgQUdQTC0zLjAgb3IgbGF0ZXIgKGh0dHA6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy9hZ3BsKS4KPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgoKCmZyb20gb2RvbyBpbXBvcnQgb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xlCmltcG9ydCBwYWxpbmdyYW1zX29wdGltaXplZAo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CgpjUHJvZmlsZS5ydW4oJ3BhbGluZ3JhbXNfb3B0aW1pemVkLmZpbmRfcGFsaW5ncmFtcygpJykKPHxmaW1fZW5kfD4=
abe6b5383ea38adadfb26f116e4d6f57dbbb4d25-2
abe6b5383ea38adadfb26f116e4d6f57dbbb4d25
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGNQcm9maWxlCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KaW1wb3J0IHBhbGluZ3JhbXNfb3B0aW1pemVkCgpjUHJvZmlsZS5ydW4oJ3BhbGluZ3JhbXNfb3B0aW1pemVkLmZpbmRfcGFsaW5ncmFtcygpJykKPHxmaW1fZW5kfD4=
abe6b5383ea38adadfb26f116e4d6f57dbbb4d25-3
abe6b5383ea38adadfb26f116e4d6f57dbbb4d25
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGNQcm9maWxlCmltcG9ydCBwYWxpbmdyYW1zX29wdGltaXplZAo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CgpjUHJvZmlsZS5ydW4oJ3BhbGluZ3JhbXNfb3B0aW1pemVkLmZpbmRfcGFsaW5ncmFtcygpJykKPHxmaW1fZW5kfD4=
abe6b5383ea38adadfb26f116e4d6f57dbbb4d25-4
abe6b5383ea38adadfb26f116e4d6f57dbbb4d25
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KaW1wb3J0IGNQcm9maWxlCmltcG9ydCBwYWxpbmdyYW1zX29wdGltaXplZAoKY1Byb2ZpbGUucnVuKCdwYWxpbmdyYW1zX29wdGltaXplZC5maW5kX3BhbGluZ3JhbXMoKScpCjx8ZmltX2VuZHw+
f9f5f636969db1683bacebbe8f9e1aed821aa1a4-1
f9f5f636969db1683bacebbe8f9e1aed821aa1a4
PHxmaW1fcH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uYW1lIl0gPSBmb3Jtcy5DaGFyRmllbGQoCiAgICAgICAgICAgIG1heF9sZW5ndGg9MzAsCiAgICAgICAgICAgIGxhYmVsPSJGaXJzdCBuYW1lIiwKICAgICAgICApCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgICAgICBzZWxmLmZpZWxkc1sibGFzdF9uYW1lIl0gPSBmb3Jtcy5DaGFyRmllbGQoCiAgICAgICAgICAgIG1heF9sZW5ndGg9MzAsCiAgICAgICAgICAgIGxhYmVsPSJMYXN0IG5hbWUiLAogICAgICAgICkKPHxmaW1fZW5kfD4=
a53758bfc84c6e576288027832f8f7f43ed09792-3
a53758bfc84c6e576288027832f8f7f43ed09792
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8Pgpmcm9tIGNyaXNweV9mb3Jtcy5sYXlvdXQgaW1wb3J0IERpdiwgTGF5b3V0CmZyb20gZGphbmdvIGltcG9ydCBmb3JtcwoKCmNsYXNzIEN1c3RvbUxvZ2luRm9ybShMb2dpbkZvcm0pOgogICAgZGVmIF9faW5pdF9fKHNlbGYsICphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgc3VwZXIoKS5fX2luaXRfXygqYXJncywgKiprd2FyZ3MpCgogICAgICAgIHNlbGYuZmllbGRzWyJsb2dpbiJdLmxhYmVsID0gIlVzZXJuYW1lIG9yIGUtbWFpbCIKCiAgICAgICAgc2VsZi5oZWxwZXIgPSBGb3JtSGVscGVyKCkKICAgICAgICBzZWxmLmhlbHBlci5mb3JtX3RhZyA9IEZhbHNlCgogICAgICAgIHNlbGYuaGVscGVyLmxheW91dCA9IExheW91dCgKICAgICAgICAgICAgRmxvYXRpbmdGaWVsZCgibG9naW4iKSwKICAgICAgICAgICAgRmxvYXRpbmdGaWVsZCgicGFzc3dvcmQiKSwKICAgICAgICApCgoKY2xhc3MgQ3VzdG9tU2lnbnVwRm9ybShTaWdudXBGb3JtKToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCAqYXJncywgKiprd2FyZ3MpOgogICAgICAgIHN1cGVyKCkuX19pbml0X18oKmFyZ3MsICoqa3dhcmdzKQoKICAgICAgICBzZWxmLmZpZWxkc1siZmlyc3RfbmFtZSJdID0gZm9ybXMuQ2hhckZpZWxkKAogICAgICAgICAgICBtYXhfbGVuZ3RoPTMwLAogICAgICAgICAgICBsYWJlbD0iRmlyc3QgbmFtZSIsCiAgICAgICAgKQogICAgICAgIHNlbGYuZmllbGRzWyJsYXN0X25hbWUiXSA9IGZvcm1zLkNoYXJGaWVsZCgKICAgICAgICAgICAgbWF4X2xlbmd0aD0zMCwKICAgICAgICAgICAgbGFiZWw9Ikxhc3QgbmFtZSIsCiAgICAgICAgKQogICAgICAgIHNlbGYuZmllbGRzWyJvcHRpbl9uZXdzbGV0dGVyIl0gPSBmb3Jtcy5Cb29sZWFuRmllbGQoCiAgICAgICAgICAgIHJlcXVpcmVkPUZhbHNlLAogICAgICAgICAgICBpbml0aWFsPUZhbHNlLAogICAgICAgICAgICBsYWJlbD0iT3B0LWluIHRvIG5ld3NsZXR0ZXIiLAogICAgICAgICkKCiAgICAgICAgc2VsZi5oZWxwZXIgPSBGb3JtSGVscGVyKHNlbGYpCiAgICAgICAgc2VsZi5oZWxwZXIuZm9ybV90YWcgPSBGYWxzZQoKICAgICAgICBzZWxmLmhlbHBlci5sYXlvdXQgPSBMYXlvdXQoCiAgICAgICAgICAgIERpdigKICAgICAgICAgICAgICAgIEZsb2F0aW5nRmllbGQoImZpcnN0X25hbWUiLCB3cmFwcGVyX2NsYXNzPSJmbGV4LWZpbGwiKSwKICAgICAgICAgICAgICAgIEZsb2F0aW5nRmllbGQoImxhc3RfbmFtZSIsIHdyYXBwZXJfY2xhc3M9ImZsZXgtZmlsbCIpLAogICAgICAgICAgICAgICAgY3NzX2NsYXNzPSJkLXNtLWZsZXgganVzdGlmeS1jb250ZW50LWJldHdlZW4gZ2FwLTMiLAogICAgICAgICAgICApLAogICAgICAgICAgICBGbG9hdGluZ0Zp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ogICAgICAgICAgICBpbml0aWFsPXNlbGYuaW5pdGlhbC5nZXQoImVtYWlsIiksCiAgICAgICAgICAgIGxhYmVsPSJFLW1haWwiLAogICAgICAgICAgICBkaXNhYmxlZD1UcnVlLAogICAgICAgICkKICAgICAgICBzZWxmLmZpZWxkc1sib3B0aW5fbmV3c2xldHRlciJdID0gZm9ybXMuQm9vbGVhbkZpZWxkKAogICAgICAgICAgICByZXF1aXJlZD1GYWxzZSwKICAgICAgICAgICAgaW5pdGlhbD1GYWxzZSwKICAgICAgICAgICAgbGFiZWw9Ik9wdC1pbiB0byBuZXdzbGV0dGVyIiwKICAgICAgICApCgogICAgICAgIHNlbGYuaGVscGVyID0gRm9ybUhlbHBlcihzZWxmKQogICAgICAgIHNlbGYuaGVscGVyLmZvcm1fdGFnID0gRmFsc2UKCiAgICAgICAgc2VsZi5oZWxwZXIubGF5b3V0ID0gTGF5b3V0KAogICAgICAgICAgICBEaXYoCiAgICAgICAgICAgICAgICBGbG9hdGluZ0ZpZWxkKCJmaXJzdF9uYW1lIiwgd3JhcHBlcl9jbGFzcz0iZmxleC1maWxsIiksCiAgICAgICAgICAgICAgICBGbG9hdGluZ0ZpZWxkKCJsYXN0X25hbWUiLCB3cmFwcGVyX2NsYXNzPSJmbGV4LWZpbGwiKSwKICAgICAgICAgICAgICAgIGNzc19jbGFzcz0iZC1zbS1mbGV4IGp1c3RpZnktY29udGVudC1iZXR3ZWVuIGdhcC0zIiwKICAgICAgICAgICAgKSwKICAgICAgICAgICAgRmxvYXRpbmdGaWVsZCgiZW1haWwiLCBkaXNhYmxlZD0iIiksCiAgICAgICAgICAgIEZsb2F0aW5nRmllbGQoInVzZXJuYW1lIiksCiAgICAgICAgICAgIEZpZWxkKCJvcHRpbl9uZXdzbGV0dGVyIiwgd3JhcHBlcl9jbGFzcz0ibXMtMiBmb3JtLWNoZWNrIGZvcm0tc3dpdGNoIiksCiAgICAgICAgKQo8fGZpbV9zdWZmaXh8Pgpmcm9tIGFsbGF1d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ICAgICAgIHNlbGYuaGVscGVyLmZvcm1fdGFnID0gRmFsc2UKCiAgICAgICAgc2VsZi5oZWxwZXIubGF5b3V0ID0gTGF5b3V0KAogICAgICAgICAgICBGbG9hdGluZ0ZpZWxkKCJsb2dpbiIpLAogICAgICAgICAgICBGbG9hdGluZ0ZpZWxkKCJwYXNzd29yZCIpLAogICAgICAgICkKCgpjbGFzcyBDdXN0b21TaWdudXBGb3JtKFNpZ251cEZvcm0pOgogICAgZGVmIF9faW5pdF9fKHNlbGYsICphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgc3VwZXIoKS5fX2luaXRfXygqYXJncywgKiprd2FyZ3MpCgogICAgICAgIHNlbGYuZmllbGRzWyJmaXJzdF9uYW1lIl0gPSBmb3Jtcy5DaGFyRmllbGQoCiAgICAgICAgICAgIG1heF9sZW5ndGg9MzAsCiAgICAgICAgICAgIGxhYmVsPSJGaXJzdCBuYW1lIiwKICAgICAgICApCiAgICAgICAgc2VsZi5maWVsZHNbImxhc3RfbmFtZSJdID0gZm9ybXMuQ2hhckZpZWxkKAogICAgICAgICAgICBtYXhfbGVuZ3RoPTMwLAogICAgICAgICAgICBsYWJlbD0iTGFzdCBuYW1lIiwKICAgICAgICApCiAgICAgICAgc2VsZi5maWVsZHNbIm9wdGluX25ld3NsZXR0ZXIiXSA9IGZvcm1zLkJvb2xlYW5GaWVsZCgKICAgICAgICAgICAgcmVxdWlyZWQ9RmFsc2UsCiAgICAgICAgICAgIGluaXRpYWw9RmFsc2UsCiAgICAgICAgICAgIGxhYmVsPSJPcHQtaW4gdG8gbmV3c2xldHRlciIsCiAgICAgICAgKQoKICAgICAgICBzZWxmLmhlbHBlciA9IEZvcm1IZWxwZXIoc2VsZikKICAgICAgICBzZWxmLmhlbHBlci5mb3JtX3RhZyA9IEZhbHNlCgogICAgICAgIHNlbGYuaGVscGVyLmxheW91dCA9IExheW91dCgKICAgICAgICAgICAgRGl2KAogICAgICAgICAgICAgICAgRmxvYXRpbmdGaWVsZCgiZmlyc3RfbmFtZSIsIHdyYXBwZXJfY2xhc3M9ImZsZXgtZmlsbCIpLAogICAgICAgICAgICAgICAgRmxvYXRpbmdGaWVsZCgibGFzdF9uYW1lIiwgd3JhcHBlcl9jbGFzcz0iZmxleC1maWxsIiksCiAgICAgICAgICAgICAgICBjc3NfY2xhc3M9ImQtc20tZmxleCBqdXN0aWZ5LWNvbnRlbnQtYmV0d2VlbiBnYXAtMyIsCiAgICAgICAgICAgICksCiAgICAgICAgICAgIEZsb2F0aW5nRmllbGQoImVtYWlsIiksCiAgICAgICAgICAgIEZsb2F0aW5nRmllbGQoInVzZXJuYW1lIiksCiAgICAgICAgICAgIEZsb2F0aW5nRmllbGQoInBhc3N3b3JkMSIpLAogICAgICAgICAgICBGbG9hdGluZ0ZpZWxkKCJwYXNzd29yZDIiKSwKICAgICAgICAgICAgRmllbGQoIm9wdGluX25ld3NsZXR0ZXIiLCB3cmFwcGVyX2NsYXNzPSJtcy0yIGZvcm0tY2hlY2sgZm9ybS1zd2l0Y2giKSwKICAgICAgICApCgoKY2xhc3MgQ3VzdG9tU29jaWFsU2lnbnVwRm9ybShTb2NpYWxTaWdudXBGb3JtKToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCAqYXJncywgKiprd2FyZ3MpOgogICAgICAgIHN1cGVyKCkuX19pbml0X18oKmFyZ3MsICoqa3dhcmdzKQoKICAgICAgICBzZWxmLmZpZWxkc1siZmlyc3RfbmFtZSJdID0gZm9ybXMuQ2hhckZpZWxkKAogICAgICAgICAgICBtYXhfbGVuZ3RoPTMwLAogICAgICAgICAgICBpbml0aWFsPXNlbGYuc29jaWFsbG9naW4udXNlci5maXJzdF9uYW1lLAogICAgICAgICAgICBsYWJlbD0iRmlyc3QgbmFtZSIsCiAgICAgICAgICAgIGRpc2FibGVkPVRydWUsCiAgICAgICAgKQogICAgICAgIHNlbGYuZmllbGRzWyJsYXN0X25hbWUiXSA9IGZvcm1zLkNoYXJGaWVsZCgKICAgICAgICAgICAgbWF4X2xlbmd0aD0zMCwKICAgICAgICAgICAgaW5pdGlhbD1zZWxmLnNvY2lhbGxvZ2luLnVzZXIubGFzdF9uYW1lLAogICAgICAgICAgICBsYWJlbD0iTGFzdCBuYW1lIiwKICAgICAgICAgICAgZGlzYWJsZWQ9VHJ1ZSwKICAgICAgICApCiAgICAgICAgc2VsZi5maWVsZHNbImVtYWlsIl0gPSBmb3Jtcy5DaGFyRmllbGQoCiAgICAgICAgICAgIG1heF9sZW5ndGg9MzAsCiAgICAgICAgICAgIGluaXRpYWw9c2VsZi5pbml0aWFsLmdldCgiZW1haWwiKSwKICAgICAgICAgICAgbGFiZWw9IkUtbWFpbCIsCiAgICAgICAgICAgIGRpc2FibGVkPVRydWUsCiAgICAgICAgKQogICAgICAgIHNlbGYuZmllbGRzWyJvcHRpbl9uZXdzbGV0dGVyIl0gPSBmb3Jtcy5Cb29sZWFuRmllbGQoCiAgICAgICAgICAgIHJlcXVpcmVkPUZhbHNlLAogICAgICAgICAgICBpbml0aWFsPUZhbHNlLAogICAgICAgICAgICBsYWJlbD0iT3B0LWluIHRvIG5ld3NsZXR0ZXIiLAogICAgICAgICkKCiAgICAgICAgc2VsZi5oZWxwZXIgPSBGb3JtSGVscGVyKHNlbGYpCiAgICAgICAgc2VsZi5oZWxwZXIuZm9ybV90YWcgPSBGYWxzZQoKICAgICAgICBzZWxmLmhlbHBlci5sYXlvdXQgPSBMYXlvdXQoCiAgICAgICAgICAgIERpdigKICAgICAgICAgICAgICAgIEZsb2F0aW5nRmllbGQoImZpcnN0X25hbWUiLCB3cmFwcGVyX2NsYXNzPSJmbGV4LWZpbGwiKSwKICAgICAgICAgICAgICAgIEZsb2F0aW5nRmllbGQoImxhc3RfbmFtZSIsIHdyYXBwZXJfY2xhc3M9ImZsZXgtZmlsbCIpLAogICAgICAgICAgICAgICAgY3NzX2NsYXNzPSJkLXNtLWZsZXgganVzdGlmeS1jb250ZW50LWJldHdlZW4gZ2FwLTMiLAogICAgICAgICAgICApLA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W5jaChiZW5jaF9maWxlKQoKICAgIG1ha2VzcGFuX2RpciA9IG9wLmRpcm5hbWUoYmVuY2hfZmlsZSkKICAgIGJlbmNoX25hbWUgPSBvcC5iYXNlbmFtZShiZW5jaF9maWxlKQoKICAgIGZzID0gczNmcy5TM0ZpbGVTeXN0ZW0oYW5vbj1hbm9uKQogICAgZnMuY2FjaGFibGUgPSBjYWNoZQogICAgYWxsX2YgPSBmcy5nbG9iKGlucHV0X2J1Y2tldF9yZ3gpCgogICAgZmlsZXMgPSBhbGxfZls6bl9maWxlc10KICAgIG91dGZpbGVzID0gW10KICAgIGNsZXZlbCA9IGludChjb21wcmVzc2lvbl9sZXZlbCkKCiAgICBmb3IgZnAgaW4gZmlsZXM6CiAgICAgICAgZm9yIGkgaW4gcmFuZ2UoaXQpOgoKICAgICAgICAgICAgaWYgdXNlX2Rhc2sgaXMgVHJ1ZToKICAgICAgICAgICAgICAgIGltID0gZGFzay5kZWxheWVkKHJlYWQpKGZwPWZwLCBhbm9uPWFub24sIGNhY2hlPWNhY2hlLCBiZmlsZT1iZW5jaF9maWxlKQogICAgICAgICAgICAgICAgaW5jID0gZGFzay5kZWxheWVkKGluY3JlbWVudCkoaW09aW0sIGZwPWZwLCBiZmlsZT1iZW5jaF9maWxlKQogICAgICAgICAgICAgICAgZnAgPSBkYXNrLmRlbGF5ZWQod3JpdGUpKAogICAgICAgICAgICAgICAgICAgIGltPWluYywKICAgICAgICAgICAgICAgICAgICBmcD1mcCwKICAgICAgICAgICAgICAgICAgICBidWNrZXQ9b3V0cHV0X2J1Y2tldCwKICAgICAgICAgICAgICAgICAgICBpPWksCiAgICAgICAgICAgICAgICAgICAgY2FjaGU9Y2FjaGUsCiAgICAgICAgICAgICAgICAgICAgY2xldmVsPWNsZXZlbCwKICAgICAgICAgICAgICAgICAgICBiZmlsZT1iZW5jaF9maWxlLAogICAgICAgICAgICAgICAgKQogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgaW0gPSByZWFkKGZwPWZwLCBhbm9uPWFub24sIGNhY2hlPWNhY2hlLCBiZmlsZT1iZW5jaF9maWxlKQogICAgICAgICAgICAgICAgaW5jID0gaW5jcmVtZW50KGltPWltLCBmcD1mcCwgYmZpbGU9YmVuY2hfZmlsZSkKICAgICAgICAgICAgICAgIGZwID0gd3JpdGUoCiAgICAgICAgICAgICAgICAgICAgaW09aW5jLAogICAgICAgICAgICAgICAgICAgIGZwPWZwLAogICAgICAgICAgICAgICAgICAgIGJ1Y2tldD1vdXRwdXRfYnVja2V0LAogICAgICAgICAgICAgICAgICAgIGk9aSwKICAgICAgICAgICAgICAgICAgICBjYWNoZT1jYWNoZSwKICAgICAgICAgICAgICAgICAgICBjbGV2ZWw9Y2xldmVsLAogICAgICAgICAgICAgICAgICAgIGJmaWxlPWJlbmNoX2ZpbGUsCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgIGFub24gPSBGYWxzZQoKICAgICAgICBvdXRmaWxlcy5hcHBlbmQoZnApCgogICAgaWYgdXNlX2Rhc2sgaXMgVHJ1ZToKICAgICAgICBvdXRmaWxlcyA9IGRhc2suZGVsYXllZChsYW1iZGEgeDogeCkob3V0ZmlsZXMpLmNvbXB1dGUoKQoKICAgIHByaW50KCIsICIuam9pbihvdXRmaWxlcykpCgogICAgZW5kID0gdGltZV9ucygpCgogICAgd2l0aCBvcGVuKG9wLmpvaW4obWFrZXNwYW5fZGlyLCAibWFrZXNwYW4uY3N2IiksICJhKyIpIGFzIGY6CiAgICAgICAgZi53cml0ZShmIntiZW5jaF9uYW1lfSx7c3RhcnR9LHtlbmR9LHsoZW5kLXN0YXJ0KSoxMCoqLTl9XG4iKQoKCmlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6CiAgICBtYWluKCkKPHxmaW1fc3VmZml4fD4KICAgIGlmIG5vdCBmcy5leGlzdHMoZnApOgogICAgICAgIGZzLmludmFsaWRhdGVfY2FjaGUoKQoKICAgIGlmIGNhY2hlIGlzIFRydWU6Cjx8ZmltX2Vu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aGVscD0iQ29tcHJlc3Npb24gbGV2ZWwiLAopCkBjbGljay5vcHRpb24oCiAgICAiLS1iZW5jaF9maWxlIiwKICAgIHR5cGU9c3RyLAogICAgaGVscD0iZmlsZSB0byBvdXRwdXQgYmVuY2htYXJrIHJlc3VsdHMgdG8uIFNURE9VVCBvdGhlcndpc2UiLAopCkBjbGljay5vcHRpb24oCiAgICItLWFub24iLAogICBpc19mbGFnPVRydWUsCiAgIGhlbHA9IklzIGEgcHVibGljbHkgYXZhaWxhYmxlIHMzIGRhdGFzZXQiCikKQGNsaWNrLm9wdGlvbigiLS11c2VfZGFzayIsIGlzX2ZsYWc9VHJ1ZSwgaGVscD0icnVuIGFzIGEgZGFzayBwaXBlbGluZSIpCmRlZiBtYWluKAogICAgaW5wdXRfYnVja2V0X3JneCwKICAgIG91dHB1dF9idWNrZXQsCiAgICBpdCwKICAgIGNhY2hlLAogICAgbl9maWxlcywKICAgIGNvbXByZXNzaW9uX2xldmVsLAogICAgYmVuY2hfZmlsZSwKICAgIHVzZV9kYXNrLAogICAgYW5vbgopOgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CgogICAgIyBwb3RlbnRpYWxseSBjcmVhdGUgYW5vdGhlciBkZWNvcmF0ZSBvciBmaXggdGhlIGJlbmNobWFyayBvbmUgZm9yIHRoaXMKICAgIHN0YXJ0ID0gdGltZV9ucygpCiAgICAjIGNyZWF0ZSBuZXcgYmVuY2htYXJrIGZpbGUKPHxmaW1fZW5kfD4=
abfd1df43e7b518c4caa20ac95a64007b8f3278b-1
abfd1df43e7b518c4caa20ac95a64007b8f3278b
PHxmaW1fcHJlZml4fD4KZnJvbSBQeVF0NS5RdFdpZGdldHMgaW1wb3J0IFFXaWRnZXQsIFFWQm94TGF5b3V0LCBRSEJveExheW91dCwgUVNsaWRlciwgUUxhYmVsCgpmcm9tIG1HZXNmLm1haW5fcGFnZV90YWJzLmdlc3R1cmVfdGFiIGltcG9ydCBoZWxwX2J0bl9hY3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MYXlvdXQoc2VsZikKICAgICAgICBzZWxmLnNldExheW91dChzZWxmLm1haW5fcGFnZSkKCiAgICAgICAgc2VsZi5zaG93KCkKPHxmaW1fc3VmZml4fD4KaW1wb3J0IGNvbmZpZwoKCmNsYXNzIERldGVjdGlvbihRV2lkZ2V0KToKPHxmaW1fZW5kfD4=
abfd1df43e7b518c4caa20ac95a64007b8f3278b-3
abfd1df43e7b518c4caa20ac95a64007b8f3278b
PHxmaW1fcHJlZml4fD4KZnJvbSBQeVF0NS5RdFdpZGdldHMgaW1wb3J0IFFXaWRnZXQsIFFWQm94TGF5b3V0LCBRSEJveExheW91dCwgUVNsaWRlciwgUUxhYmVsCgpmcm9tIG1HZXNmLm1haW5fcGFnZV90YWJzLmdlc3R1cmVfdGFiIGltcG9ydCBoZWxwX2J0bl9hY3Rpb24KZnJvbSB1dGlscy5HVUlfbWFpbl93aW5kb3cgaW1wb3J0ICoKZnJvbSB1dGlscy5HVUlfb3BlcmF0aW9uX3RhYiBpbXBvcnQgKgppbXBvcnQgY29uZmlnCgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CgpjbGFzcyBEZXRlY3Rpb24oUVdpZGdldCk6CiAgICBkZWYgX19pbml0X18oc2VsZik6CiAgICAgICAgc3VwZXIoKS5fX2luaXRfXygpCjx8ZmltX2VuZHw+
abfd1df43e7b518c4caa20ac95a64007b8f3278b-4
abfd1df43e7b518c4caa20ac95a64007b8f3278b
PHxmaW1fcHJlZml4fD4KZnJvbSBQeVF0NS5RdFdpZGdldHMgaW1wb3J0IFFXaWRnZXQsIFFWQm94TGF5b3V0LCBRSEJveExheW91dCwgUVNsaWRlciwgUUxhYmVsCgpmcm9tIG1HZXNmLm1haW5fcGFnZV90YWJzLmdlc3R1cmVfdGFiIGltcG9ydCBoZWxwX2J0bl9hY3Rpb24KZnJvbSB1dGlscy5HVUlfbWFpbl93aW5kb3cgaW1wb3J0ICoKZnJvbSB1dGlscy5HVUlfb3BlcmF0aW9uX3RhYiBpbXBvcnQgKgppbXBvcnQgY29uZmlnCgoKY2xhc3MgRGV0ZWN0aW9uKFFXaWRnZXQpOgogICAgZGVmIF9faW5pdF9fKHNlbGYpOgogICAgICAgIHN1cGVyKCkuX19pbml0X18oKQoKICAgICAgICAjIC0tLS0tLS0tLS0tLS0tLS0tLS0tIEZpcnN0IGNsYXNzIC0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgICAgICAgc2VsZi5tYWluX3BhZ2UgPSBRSEJveExheW91dChzZWxmKQogICAgICAgIHNlbGYuc2V0TGF5b3V0KHNlbGYubWFpbl9wYWdlKQo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CgogICAgICAgIHNlbGYuc2hvdygpCjx8ZmltX2VuZHw+
afc3c75f2ba699a5137b325745f39c894b8c5125-1
afc3c75f2ba699a5137b325745f39c894b8c5125
PHxmaW1fcHJlZml4fD4KIyBBVVRPR0VORVJBVEVEIEJZIE5CREVWISBETyBOT1QgRURJVCEKCjx8ZmltX2hvbGV8PgogICAgICAgICAiYWRkX21pZGRsZV9uZWNrIjogIjAwX2RsY19pbXBvcnRlci5pcHluYiIsCiAgICAgICAgICJhZGRfcm90YXRpb24iOiAiMDBfZGxjX2ltcG9ydGVyLmlweW5iIiwKICAgICAgICAgImFwcGx5X3JvdGF0aW9uIjogIjAwX2RsY19pbXBvcnRlci5pcHluYiIsCiAgICAgICAgICJQaWdlb25BbmltYXRvciI6ICIwMV9waWdlb25fYW5pbWF0b3IuaXB5bmIiLAogICAgICAgICAiUGlnZW9uQW5pbWF0b3JGYWN0b3J5IjogIjAxX3BpZ2Vvbl9hbmltYXRvci5pcHluYiIsCiAgICAgICAgICJMYWJlbEFzc2lzdGFudCI6ICIwM19sYWJlbF9hc3Npc3RhbnQuaXB5bmIiLAogICAgICAgICAiYnVpbGRfdGltZXNlcmllcyI6ICIwNF90c19wcmVwLmlweW5iIn0KCm1vZHVsZXMgPSBbImRsY19pbXBvcnRlci5weSIsCiAgICAgICAgICAgInBpZ2Vvbl9hbmltYXRvci5weSIsCiAgICAgICAgICAgImxhYmVsX2Fzc2lzdGFudC5weSIsCiAgICAgICAgICAgInRzX3ByZXAucHkiXQoKZG9jX3VybCA9ICJodHRwczovL2tpdmlldy5naXRodWIuaW8vd2lua2llLyIKCmdpdF91cmwgPSAiaHR0cHM6Ly9naXRodWIuY29tL2tpdmlldy93aW5raWUvdHJlZS9tYXN0ZXIvIgoKZGVmIGN1c3RvbV9kb2NfbGlua3MobmFtZSk6IHJldHVybiBOb25lCjx8ZmltX3N1ZmZpeHw+Cl9fYWxsX18gPSBbImluZGV4IiwgIm1vZHVsZXMiLCAiY3VzdG9tX2RvY19saW5rcyIsICJnaXRfdXJsIl0KCmluZGV4ID0geyJETENJbXBvcnRlciI6ICIwMF9kbGNfaW1wb3J0ZXIuaXB5bmIiLAogICAgICAgICAidHJhbnNmb3JtX3RvX3JlbGF0aXZlIjogIjAwX2RsY19pbXBvcnRlci5pcHluYiIsCjx8ZmltX2VuZHw+
ab9193fa754363455e7e6da7a03b0026191fd8f8-1
ab9193fa754363455e7e6da7a03b0026191fd8f8
PHxmaW1fcHJlZml4fD4KZnJvbSBQeVF0NCBpbXBvcnQgUXRDb3JlLCBRdEd1aQpmcm9tIFVpX05ld1RpZXIgaW1wb3J0IFVpX0RpYWxvZ05ld1RpZXIKCmNsYXNzIERpYWxvZ05ld1RpZXIoUXRHdWkuUURpYWxvZyk6CgogICAgZGVmIF9faW5pdF9fKHNlbGYsIHBhcmVudFRpZXIsICB0aWVyVHlwZSwgdGllckRlZmF1bHRMb2NhbGUsIHRpZXJQYXJ0aWNpcGFudCwgICphcmdzKToKICAgICAgICBRdEd1aS5RRGlhbG9nLl9faW5pdF9fKHNlbGYsICphcmdzKQogICAgICAgIHNlbGYudWkgPSBVaV9EaWFsb2dOZXdUaWVyKCkKICAgICAgICBzZWxmLnVpLnNldHVwVWkoc2VsZikKICAgICAgICBzZWxmLnVpLmxhYmVsUGFyZW50VGllci5zZXRUZXh0KHBhcmVudFRpZXIpCiAgICAgICAgc2VsZi51aS5saW5lZWRpdFRpZXJUeXBlLnNldFRleHQodGllclR5cGUpCjx8ZmltX2hvbGV8PgogICAgZGVmIGFjY2VwdChzZWxmKToKICAgICAgICBzZWxmLnRpZXJUeXBlID0gdW5pY29kZShzZWxmLnVpLmxpbmVlZGl0VGllclR5cGUudGV4dCgpKQogICAgICAgIHNlbGYudGllcklkID0gdW5pY29kZShzZWxmLnVpLmxpbmVlZGl0VGllcklkLnRleHQoKSkKICAgICAgICBzZWxmLnRpZXJEZWZhdWx0TG9jYWxlID0gdW5pY29kZShzZWxmLnVpLmxpbmVlZGl0RGVmYXVsdExvY2FsZS50ZXh0KCkpCiAgICAgICAgc2VsZi50aWVyUGFydGljaXBhbnQgPSB1bmljb2RlKHNlbGYudWkubGluZWVkaXRQYXJ0aWNpcGFudC50ZXh0KCkpCiAgICAgICAgaWYgIHNlbGYudGllclR5cGUgPT0gJycgb3Igc2VsZi50aWVySWQgPT0gJycgb3Igc2VsZi50aWVyRGVmYXVsdExvY2FsZSA9PSAnJzoKICAgICAgICAgICAgUXRHdWkuUU1lc3NhZ2VCb3guY3JpdGljYWwoc2VsZiwgIk5vIElEIGFuZCB0eXBlIiwgIlBsZWFzZSBlbnRlciBhbiBJRCwgYSB0eXBlIGFuZCBhIGxvY2FsZSBmb3IgdGhlIHRpZXIuIiwgUXRHdWkuUU1lc3NhZ2VCb3guT2spCiAgICAgICAgZWxzZToKICAgICAgICAgICAgcmV0dXJuIFF0R3VpLlFEaWFsb2cuYWNjZXB0KHNlbGYpCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgc2VsZi51aS5saW5lZWRpdFBhcnRpY2lwYW50LnNldFRleHQodGllclBhcnRpY2lwYW50KQogICAgICAgIHNlbGYudWkubGluZWVkaXREZWZhdWx0TG9jYWxlLnNldFRleHQodGllckRlZmF1bHRMb2NhbGUpCiAgICAgICAgCjx8ZmltX2VuZHw+
ab9193fa754363455e7e6da7a03b0026191fd8f8-2
ab9193fa754363455e7e6da7a03b0026191fd8f8
PHxmaW1fcHJlZml4fD4KZnJvbSBQeVF0NCBpbXBvcnQgUXRDb3JlLCBRdEd1aQpmcm9tIFVpX05ld1RpZXIgaW1wb3J0IFVpX0RpYWxvZ05ld1RpZXIKCmNsYXNzIERpYWxvZ05ld1RpZXIoUXRHdWkuUURpYWxvZyk6Cgo8fGZpbV9ob2xlfD4KICAgICAgICBzZWxmLnVpLmxhYmVsUGFyZW50VGllci5zZXRUZXh0KHBhcmVudFRpZXIpCiAgICAgICAgc2VsZi51aS5saW5lZWRpdFRpZXJUeXBlLnNldFRleHQodGllclR5cGUpCiAgICAgICAgc2VsZi51aS5saW5lZWRpdFBhcnRpY2lwYW50LnNldFRleHQodGllclBhcnRpY2lwYW50KQogICAgICAgIHNlbGYudWkubGluZWVkaXREZWZhdWx0TG9jYWxlLnNldFRleHQodGllckRlZmF1bHRMb2NhbGUpCiAgICAgICAgCiAgICBkZWYgYWNjZXB0KHNlbGYpOgogICAgICAgIHNlbGYudGllclR5cGUgPSB1bmljb2RlKHNlbGYudWkubGluZWVkaXRUaWVyVHlwZS50ZXh0KCkpCiAgICAgICAgc2VsZi50aWVySWQgPSB1bmljb2RlKHNlbGYudWkubGluZWVkaXRUaWVySWQudGV4dCgpKQogICAgICAgIHNlbGYudGllckRlZmF1bHRMb2NhbGUgPSB1bmljb2RlKHNlbGYudWkubGluZWVkaXREZWZhdWx0TG9jYWxlLnRleHQoKSkKICAgICAgICBzZWxmLnRpZXJQYXJ0aWNpcGFudCA9IHVuaWNvZGUoc2VsZi51aS5saW5lZWRpdFBhcnRpY2lwYW50LnRleHQoKSkKICAgICAgICBpZiAgc2VsZi50aWVyVHlwZSA9PSAnJyBvciBzZWxmLnRpZXJJZCA9PSAnJyBvciBzZWxmLnRpZXJEZWZhdWx0TG9jYWxlID09ICcnOgogICAgICAgICAgICBRdEd1aS5RTWVzc2FnZUJveC5jcml0aWNhbChzZWxmLCAiTm8gSUQgYW5kIHR5cGUiLCAiUGxlYXNlIGVudGVyIGFuIElELCBhIHR5cGUgYW5kIGEgbG9jYWxlIGZvciB0aGUgdGllci4iLCBRdEd1aS5RTWVzc2FnZUJveC5PaykKICAgICAgICBlbHNlOgogICAgICAgICAgICByZXR1cm4gUXRHdWkuUURpYWxvZy5hY2NlcHQoc2VsZikKPHxmaW1fc3VmZml4fD4KICAgIGRlZiBfX2luaXRfXyhzZWxmLCBwYXJlbnRUaWVyLCAgdGllclR5cGUsIHRpZXJEZWZhdWx0TG9jYWxlLCB0aWVyUGFydGljaXBhbnQsICAqYXJncyk6CiAgICAgICAgUXRHdWkuUURpYWxvZy5fX2luaXRfXyhzZWxmLCAqYXJncykKICAgICAgICBzZWxmLnVpID0gVWlfRGlhbG9nTmV3VGllcigpCiAgICAgICAgc2VsZi51aS5zZXR1cFVpKHNlbGYpCjx8ZmltX2VuZHw+
ab9193fa754363455e7e6da7a03b0026191fd8f8-3
ab9193fa754363455e7e6da7a03b0026191fd8f8
PHxmaW1fcHJlZml4fD4KZnJvbSBQeVF0NCBpbXBvcnQgUXRDb3JlLCBRdEd1aQpmcm9tIFVpX05ld1RpZXIgaW1wb3J0IFVpX0RpYWxvZ05ld1RpZXIKCmNsYXNzIERpYWxvZ05ld1RpZXIoUXRHdWkuUURpYWxvZyk6CgogICAgZGVmIF9faW5pdF9fKHNlbGYsIHBhcmVudFRpZXIsICB0aWVyVHlwZSwgdGllckRlZmF1bHRMb2NhbGUsIHRpZXJQYXJ0aWNpcGFudCwgICphcmdzKToKICAgICAgICBRdEd1aS5RRGlhbG9nLl9faW5pdF9fKHNlbGYsICphcmdzKQogICAgICAgIHNlbGYudWkgPSBVaV9EaWFsb2dOZXdUaWVyKCkKICAgICAgICBzZWxmLnVpLnNldHVwVWkoc2VsZikKICAgICAgICBzZWxmLnVpLmxhYmVsUGFyZW50VGllci5zZXRUZXh0KHBhcmVudFRpZXIpCiAgICAgICAgc2VsZi51aS5saW5lZWRpdFRpZXJUeXBlLnNldFRleHQodGllclR5cGUpCiAgICAgICAgc2VsZi51aS5saW5lZWRpdFBhcnRpY2lwYW50LnNldFRleHQodGllclBhcnRpY2lwYW50KQo8fGZpbV9ob2xlfD4KICAgIGRlZiBhY2NlcHQoc2VsZik6CiAgICAgICAgc2VsZi50aWVyVHlwZSA9IHVuaWNvZGUoc2VsZi51aS5saW5lZWRpdFRpZXJUeXBlLnRleHQoKSkKICAgICAgICBzZWxmLnRpZXJJZCA9IHVuaWNvZGUoc2VsZi51aS5saW5lZWRpdFRpZXJJZC50ZXh0KCkpCiAgICAgICAgc2VsZi50aWVyRGVmYXVsdExvY2FsZSA9IHVuaWNvZGUoc2VsZi51aS5saW5lZWRpdERlZmF1bHRMb2NhbGUudGV4dCgpKQogICAgICAgIHNlbGYudGllclBhcnRpY2lwYW50ID0gdW5pY29kZShzZWxmLnVpLmxpbmVlZGl0UGFydGljaXBhbnQudGV4dCgpKQogICAgICAgIGlmICBzZWxmLnRpZXJUeXBlID09ICcnIG9yIHNlbGYudGllcklkID09ICcnIG9yIHNlbGYudGllckRlZmF1bHRMb2NhbGUgPT0gJyc6CiAgICAgICAgICAgIFF0R3VpLlFNZXNzYWdlQm94LmNyaXRpY2FsKHNlbGYsICJObyBJRCBhbmQgdHlwZSIsICJQbGVhc2UgZW50ZXIgYW4gSUQsIGEgdHlwZSBhbmQgYSBsb2NhbGUgZm9yIHRoZSB0aWVyLiIsIFF0R3VpLlFNZXNzYWdlQm94Lk9rKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHJldHVybiBRdEd1aS5RRGlhbG9nLmFjY2VwdChzZWxmKQo8fGZpbV9zdWZmaXh8PgogICAgICAgIHNlbGYudWkubGluZWVkaXREZWZhdWx0TG9jYWxlLnNldFRleHQodGllckRlZmF1bHRMb2NhbGUpCiAgICAgICAgCjx8ZmltX2VuZHw+
ab9193fa754363455e7e6da7a03b0026191fd8f8-4
ab9193fa754363455e7e6da7a03b0026191fd8f8
PHxma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ogICAgICAgIERlbGV0ZSBSZXZpZXcgaW5zdGFuY2UgYmVmb3JlIG5leHQgdGVzdAogICAgICAgICIiIgogICAgICAgIGRlbCBzZWxmLnIxCgogICAgZGVmIHRlc3RfdW5pcXVlVVVJRChzZWxmKToKICAgICAgICAiIiIKICAgICAgICBNYWtlIHN1cmUgZWFjaCBVVUlEIGlzIHVuaXF1ZQogICAgICAgICIiIgogICAgICAgIHIyID0gUmV2aWV3KCkKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgogICAgICAgIHNlbGYuYXNzZXJ0Tm90RXF1YWwoc2VsZi5yMS5pZCwgcjIuaWQpCgo8fGZpbV9lbmR8Pg==
59e3551e1be0d168f59890d8b9fa1a4784a3601b-2
59e3551e1be0d168f59890d8b9fa1a4784a3601b
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9weXRob24zCiIiIlVuaXR0ZXN0IGZvciBjbGFzcyBSZXZpZXcKIiIiCmltcG9ydCB1bml0dGVzdApmcm9tIGRhdGV0aW1lIGltcG9ydCBkYXRldGltZQpmcm9tIG1vZGVscy5iYXNlX21vZGVsIGltcG9ydCBCYXNlTW9kZWwKZnJvbSBtb2RlbHMucmV2aWV3IGltcG9ydCBSZXZpZXcKCgpjbGFzcyBUZXN0UmV2aWV3KHVuaXR0ZXN0LlRlc3RDYXNlKToKICAgICIiIlRlc3RpbmcgUmV2aWV3IiIiCiAgICBkZWYgc2V0VXAoc2VsZik6CiAgICAgICAgIiIiCiAgICAgICAgQ3JlYXRlIGEgbmV3IGluc3RhbmNlIG9mIFJldmlldyBiZWZvcmUgZWFjaCB0ZXN0CiAgICAgICAgIiIiCiAgICAgICAgc2VsZi5yMSA9IFJldmlldygpCgogICAgZGVmIHRlYXJEb3duKHNlbGYpOgogICAgICAgICIiIgogICAgICAgIERlbGV0ZSBSZXZpZXcgaW5zdGFuY2UgYmVmb3JlIG5leHQgdGVzdAogICAgICAgICIiIgogICAgICAgIGRlbCBzZWxmLnIxC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ChzZWxmKToKICAgICAgICAiIiIKICAgICAgICBNYWtlIHN1cmUgdXNlcl9pZCBpcyBzdHIgZGF0YSB0eXBlCiAgICAgICAgIiIiCiAgICAgICAgc2VsZi5hc3NlcnRFcXVhbCh0eXBlKFJldmlldy51c2VyX2lkKSwgc3RyKQoKICAgIGRlZiB0ZXN0X3RleHQoc2VsZik6CiAgICAgICAgIiIiCiAgICAgICAgTWFrZSBzdXJlIHRleHQgaXMgc3RyIGRhdGEgdHlwZQogICAgICAgICIiIgogICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwodHlwZShSZXZpZXcudGV4dCksIHN0cikKCiAgICBkZWYgdGVzdF9zYXZlKHNlbGYpOgogICAgICAgICIiIgogICAgICAgIE1ha2Ugc3VyZSBzYXZlIGRvZXMgdXBkYXRlIHRoZSB1cGRhdGVkX2F0IGF0dHJpYnV0ZQogICAgICAgICIiIgogICAgICAgIG9sZF91cGRhdGVkX2F0ID0gc2VsZi5yMS51cGRhdGVkX2F0CiAgICAgICAgc2VsZi5yMS5zYXZlKCkKICAgICAgICBzZWxmLmFzc2VydE5vdEVxdWFsKG9sZF91cGRhdGVkX2F0LCBzZWxmLnIxLnVwZGF0ZWRfYXQpCgogICAgZGVmIHRlc3Rfc3RyKHNlbGYpOgogICAgICAgICIiIgogICAgICAgIFRlc3RpbmcgcmV0dXJuIG9mIF9fc3RyX18KICAgICAgICAiIiIKICAgICAgICBzZWxmLmFzc2VydEVxdWFsKHN0cihzZWxmLnIxKSwgIltSZXZpZXddICh7fSkge30iLgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQoc2VsZi5yMS5pZCwgc2VsZi5yMS5fX2RpY3RfXykpCgo8fGZpbV9lbmR8Pg==
59e3551e1be0d168f59890d8b9fa1a4784a3601b-3
59e3551e1be0d168f59890d8b9fa1a4784a3601b
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9weXRob24zC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gICBNYWtlIHN1cmUgY3JlYXRlZF9hdCBpcyBkYXRldGltZSBkYXRhIHR5cGUKICAgICAgICAiIiIKICAgICAgICBzZWxmLmFzc2VydEVxdWFsKHR5cGUoc2VsZi5yMS5jcmVhdGVkX2F0KSwgZGF0ZXRpbWUpCgogICAgZGVmIHRlc3RfdXBkYXRlZF9hdF90eXBlKHNlbGYpOgogICAgICAgICIiIgogICAgICAgIE1ha2Ugc3VyZSB1cGRhdGVkX2F0IGlzIGRhdGV0aW1lIGRhdGEgdHlwZQogICAgICAgICIiIgogICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwodHlwZShzZWxmLnIxLnVwZGF0ZWRfYXQpLCBkYXRldGltZSkKCiAgICBkZWYgdGVzdF9wbGFjZV9pZChzZWxmKToKICAgICAgICAiIiIKICAgICAgICBNYWtlIHN1cmUgcGxhY2VfaWQgaXMgc3RyIGRhdGEgdHlwZQogICAgICAgICIiIgogICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwodHlwZShSZXZpZXcucGxhY2VfaWQpLCBzdHIpCgogICAgZGVmIHRlc3RfdXNlcl9pZChzZWxmKToKICAgICAgICAiIiIKICAgICAgICBNYWtlIHN1cmUgdXNlcl9pZCBpcyBzdHIgZGF0YSB0eXBlCiAgICAgICAgIiIiCiAgICAgICAgc2VsZi5hc3NlcnRFcXVhbCh0eXBlKFJldmlldy51c2VyX2lkKSwgc3RyKQoKICAgIGRlZiB0ZXN0X3RleHQoc2VsZik6CiAgICAgICAgIiIiCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgICAgICBNYWtlIHN1cmUgdGV4dCBpcyBzdHIgZGF0YSB0eXBlCiAgICAgICAgIiIiCiAgICAgICAgc2VsZi5hc3NlcnRFcXVhbCh0eXBlKFJldmlldy50ZXh0KSwgc3RyKQoKPHxmaW1fZW5kfD4=
a70221db728c1939d35448fb73baf015d45c67c0-1
a70221db728c1939d35448fb73baf015d45c67c0
PHxmaW1fcHJlZml4fD4KZ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AgICAgKQogICAgICAgIHN1cGVyKCkuX19pbml0X18oCiAgICAgICAgICAgIGVuY29kZXIsCiAgICAgICAgICAgIGRlY29kZXIsCiAgICAgICAgICAgIHJld2FyZF9kZWNvZGVyLAogICAgICAgICAgICBsYXRlbnQsCiAgICAgICAgICAgIGtsX2ZhY3RvciwKICAgICAgICAgICAgc3RhdGVfZmFjdG9yLAogICAgICAgICAgICByZXdhcmRfZmFjdG9yLAogICAgICAgICAgICBwcmVkaWN0X2Zyb21fcHJpb3I9cHJlZGljdF9mcm9tX3ByaW9yLAogICAgICAgICAgICBjb25kaXRpb25fb25fcG9zdGVyaW9yPWNvbmRpdGlvbl9vbl9wb3N0ZXJpb3IsCiAgICAgICAgKQoKICAgIGRlZiBpbmZlcl9mdWxsX3NlcXVlbmNlKHNlbGYsIG9icywgYWN0aW9ucz1Ob25lLCByZXdhcmRzPU5vbmUpOgogICAgICAgIGZlYXR1cmVzX3NlcSA9IHNlbGYuZW5jb2RlcihvYnMsIHJld2FyZHMpCiAgICAgICAgaG9yaXpvbiA9IG9icy5zaGFwZVsxXQogICAgICAgIHByaW9ycyA9IFtdCiAgICAgICAgcG9zdGVyaW9ycyA9IFtdCgogICAgICAgIHByaW9yLCBwb3N0ZXJpb3IgPSBzZWxmLmxhdGVudC5vYnRhaW5faW5pdGlhbChmZWF0dXJlc19zZXFbOiwgMF0pCiAgICAgICAgcHJpb3JfbGF0ZW50ID0gcG9zdGVyaW9yWzBdCiAgICAgICAgcG9zdGVyaW9yX2xhdGVudCA9IHBvc3RlcmlvclsxXQogICAgICAgIHByaW9ycy5hcHBlbmQocHJpb3IpCiAgICAgICAgcG9zdGVyaW9ycy5hcHBlbmQocG9zdGVyaW9ycykKCiAgICAgICAgZm9yIHQgaW4gcmFuZ2UoMSwgaG9yaXpvbik6CiAgICAgICAgICAgIHByaW9yLCBwb3N0ZXJpb3IgPSBzZWxmLmxhdGVudCgKICAgICAgICAgICAgICAgIHByaW9yX2xhdGVudCwKICAgICAgIC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AgIGZvciB0YWJsZV9pZCBpbiByZXMua2V5cygpOgogICAgICAgICAgICAgICAgZG9jID0gc2VsZi5fX3Rlcy5nZXRfZG9jKHRhYmxlX2lkKQogICAgICAgICAgICAgICAgbGFiZWxzID0gZG9jWyJfc291cmNlIl1bImhlYWRpbmdzIl0KICAgICAgICAgICAgICAgIGNhbmQgKz0gbGFiZWxzCiAgICAgICAgcmV0dXJuIHNldChbaSBmb3IgaSBpbiBjYW5kIGlmIGkgbm90IGluIHNlZWRdKSwgdGFibGVzCgoKICAgIGRlZiBmaW5kX2NhbmRpZGF0ZXNfZShzZWxmLCBFLCBzZWVkLCBudW09MTAwKToKICAgICAgICAiIiJmaW5kIGNhbmRpZGF0ZSBsYWJlbHMgVXNpbmcgZW50aXRpZXMiIiIKICAgICAgICB0YWJsZXMgPSBbXQogICAgICAgIGNhbmQgPSBbXQogICAgICAgIGZvciBlbnRpdHkgaW4gRToKICAgICAgICAgICAgYm9keSA9IHNlbGYuZ2VuZXJhdGVfc2VhcmNoX2JvZHkoZW50aXR5PWVudGl0eSwgZmllbGQ9ImVudGl0eSIpCiAgICAgICAgICAgIHJlcyA9IHNlbGYuX190ZXMuc2VhcmNoX2NvbXBsZXgoYm9keT1ib2R5LCBudW09bnVtKQogICAgICAgICAgICB0YWJsZXMgKz0gbGlzdChyZXMua2V5cygpKQogICAgICAgICAgICBmb3IgdGFibGVfaWQgaW4gcmVzLmtleXMoKToKICAgICAgICAgICAgICAgIGRvYyA9IHNlbGYuX190ZXMuZ2V0X2RvYyh0YWJsZV9pZCkKICAgICAgICAgICAgICAgIGxhYmVscyA9IGRvY1siX3NvdXJjZSJdWyJoZWFkaW5ncyJdCiAgICAgICAgICAgICAgICBjYW5kICs9IGxhYmVscwogICAgICAgIHJldHVybiBzZXQoW2kgZm9yIGkgaW4gY2FuZCBpZiBpIG5vdCBpbiBzZWVkXSksIHRhYmxlcwoKICAgIGRlZiBnZW5lcmF0ZV9zZWFyY2hfYm9keShzZWxmLCBlbnRpdHksIGZpZWxkKToKICAgICAgICAiIiJHZW5lcmF0ZSBzZWFyY2ggYm9keSIiIgogICAgICAgIGJvZHkgPSB7CiAgICAgICAgICAgICJxdWVyeSI6IHsKICAgICAgICAgICAgICAgICJib29sIjogewogICAgICAgICAgICAgICAgICAgICJtdXN0IjogewogICAgICAgICAgICAgICAgICAgICAgICAidGVybSI6IHtmaWVsZDogZW50aXR5fQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gYm9keQoKICAgIGRlZiBwYXJzZShzZWxmLCB0ZXh0KToKICAgICAgICAiIiJQdXQgcXVlcnkgaW50byBhIHRlcm0gbGlzdCBmb3IgdGVybSBpdGVyYXRpb24iIiIKICAgICAgICBzdG9wd29yZHMgPSBbXQogICAgICAgIHRlcm1zID0gW10KICAgICAgICAjIFJlcGxhY2Ugc3BlY2lmaWMgY2hhcmFjdGVycyB3aXRoIHNwYWNlCiAgICAgICAgY2hhcnMgPSBbIiciLCAiLiIsICI6IiwgIiwiLCAiLyIsICIoIiwgIikiLCAiLSIsICIrIl0KICAgICAgICBmb3IgY2ggaW4gY2hhcnM6CiAgICAgICAgICAgIGlmIGNoIGluIHRleHQ6CiAgICAgICAgICAgICAgICB0ZXh0ID0gdGV4dC5yZXBsYWNlKGNoLCAiICIpCiAgICAgICAgIyBUb2tlbml6YXRpb24KICAgICAgICBmb3IgdGVybSBpbiB0ZXh0LnNwbGl0KCk6ICAjIGRlZmF1bHQgYmVoYXZpb3Igb2YgdGhlIHNwbGl0IGlzIHRvIHNwbGl0IG9uIG9uZSBvciBtb3JlIHdoaXRlc3BhY2VzCiAgICAgICAgICAgICMgU3RvcHdvcmQgcmVtb3ZhbAogICAgICAgICAgICBpZiB0ZXJtIGluIHN0b3B3b3JkczoKICAgICAgICAgICAgICAgIGNvbnRpbnVlCiAgICAgICAgICAgIHRlcm1zLmFwcGVuZCh0ZXJtKQogICAg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ICAgcGFzcwoKICAgIGRlZiBmaW5kX2NhbmRpZGF0ZXNfYyhzZWxmLCBjLCBzZWVkLCBudW09MTAwKToKICAgICAgICAiIiJmaW5kIGNhbmRpZGF0ZSB0YWJsZXMgY29tcGxlbWVudCB3aXRoIHRhYmxlIGNhcHRpb24iIiIKICAgICAgICByZXMgPSBzZWxmLl9fdGVzLnNlYXJjaChxdWVyeT1jLCBmaWVsZD0iY2FwdGlvbiIsIG51bT1udW0pCiAgICAgICAgY2FuZCA9IFtdCiAgICAgICAgZm9yIHRhYmxlX2lkIGluIHJlcy5rZXlzKCk6CiAgICAgICAgICAgIGRvYyA9IHNlbGYuX190ZXMuZ2V0X2RvYyh0YWJsZV9pZCkKICAgICAgICAgICAgbGFiZWxzID0gZG9jWyJfc291cmNlIl1bImhlYWRpbmdzX2EiXQogICAgICAgICAgICBjYW5kICs9IGxhYmVscwogICAgICAgIHJldHVybiBzZXQoW2kgZm9yIGkgaW4gY2FuZCBpZiBpIG5vdCBpbiBzZWVkXSksIGxpc3QocmVzLmtleXMoKSkKCgogICAgZGVmIGZpbmRfY2FuZGlkYXRlc19sKHNlbGYsIHNlZWQsIG51bT0xMDApOgogICAgICAgICIiImZpbmQgY2FuZGlkYXRlIGxhYmVscyBVc2luZyBsYWJlbHMgIiIiCiAgICAgICAgdGFibGVzID0gW10KICAgICAgICBjYW5kID0gW10KICAgICAgICBmb3IgbGFiZWwgaW4gc2VlZDoKICAgICAgICAgICAgcmVzID0gc2VsZi5fX3Rlcy5zZWFyY2gocXVlcnk9bGFiZWwsIGZpZWxkPSJoZWFkaW5ncyIsIG51bT1udW0pCiAgICAgICAgICAgIHRhYmxlcyArPSBsaXN0KHJlcy5rZXlzKCkpCiAgICAgICAgICAgIGZvciB0YWJsZV9pZCBpbiByZXMua2V5cygpOgogICAgICAgICAgICAgICAgZG9jID0gc2VsZi5fX3Rlcy5nZXRfZG9jKHRhYmxlX2lkKQogICAgICAgICAgICAgICAgbGFiZWxzID0gZG9jWyJfc291cmNlIl1bImhlYWRpbmdzIl0KICAgICAgICAgICAgICAgIGNhbmQgKz0gbGFiZWxzCiAgICAgICAgcmV0dXJuIHNldChbaSBmb3IgaSBpbiBjYW5kIGlmIGkgbm90IGluIHNlZWRdKSwgdGFibGVzCgoKICAgIGRlZiBmaW5kX2NhbmRpZGF0ZXNfZShzZWxmLCBFLCBzZWVkLCBudW09MTAwKToKICAgICAgICAiIiJmaW5kIGNhbmRpZGF0ZSBsYWJlbHMgVXNpbmcgZW50aXRpZXMiIiIKICAgICAgICB0YWJsZXMgPSBbXQogICAgICAgIGNhbmQgPSBbXQogICAgICAgIGZvciBlbnRpdHkgaW4gRToKICAgICAgICAgICAgYm9keSA9IHNlbGYuZ2VuZXJhdGVfc2VhcmNoX2JvZHkoZW50aXR5PWVudGl0eSwgZmllbGQ9ImVudGl0eSIpCiAgICAgICAgICAgIHJlcyA9IHNlbGYuX190ZXMuc2VhcmNoX2NvbXBsZXgoYm9keT1ib2R5LCBudW09bnVtKQogICAgICAgICAgICB0YWJsZXMgKz0gbGlzdChyZXMua2V5cygpKQogICAgICAgICAgICBmb3IgdGFibGVfaWQgaW4gcmVzLmtleXMoKToKICAgICAgICAgICAgICAgIGRvYyA9IHNlbGYuX190ZXMuZ2V0X2RvYyh0YWJsZV9pZCkKICAgICAgICAgICAgICAgIGxhYmVscyA9IGRvY1siX3NvdXJjZSJdWyJoZWFkaW5ncyJdCiAgICAgICAgICAgICAgICBjYW5kICs9IGxhYmVscwogICAgICAgIHJldHVybiBzZXQoW2kgZm9yIGkgaW4gY2FuZCBpZiBpIG5vdCBpbiBzZWVkXSksIHRhYmxlcwoKICAgIGRlZiBnZW5lcmF0ZV9zZWFyY2hfYm9keShzZWxmLCBlbnRpdHksIGZpZWxkKToKICAgICAgICAiIiJHZW5lcmF0ZSBzZWFyY2ggYm9keSIiIgogICAgICAgIGJvZHkgPSB7CiAgICAgICAgICAgICJxdWVyeSI6IHsKICAgICAgICAgICAgICAgICJib29sIjogewogICAgICAgICAgICAgICAgICAgICJtdXN0IjogewogICAgICAgICAgICAgICAgICAgICAgICAidGVybSI6IHtmaWVsZDogZW50aXR5fQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gYm9keQoKICAgIGRlZiBwYXJzZShzZWxmLCB0ZXh0KToKICAgICAgICAiIiJQdXQgcXVlcnkgaW50byBhIHRlcm0gbGlzdCBmb3IgdGVybSBpdGVyYXRpb24iIiIKICAgICAgICBzdG9wd29yZHMgPSBbXQogICAgICAgIHRlcm1zID0gW10KICAgICAgICAjIFJlcGxhY2Ugc3BlY2lmaWMgY2hhcmFjdGVycyB3aXRoIHNwYWNlCiAgICAgICAgY2hhcnMgPSBbIiciLCAiLiIsICI6IiwgIiwiLCAiLyIsICIoIiwgIikiLCAiLSIsICIrIl0KICAgICAgICBmb3IgY2ggaW4gY2hhcnM6CiAgICAgICAgICAgIGlmIGNoIGluIHRleHQ6CiAgICAgICAgICAgICAgICB0ZXh0ID0gdGV4dC5yZXBsYWNlKGNoLCAiICIpCiAgICAgICAgIyBUb2tlbml6YXRpb24KICAgICAgICBmb3IgdGVybSBpbiB0ZXh0LnNwbGl0KCk6ICAjIGRlZmF1bHQgYmVoYXZpb3Igb2YgdGhlIHNwbGl0IGlzIHRvIHNwbGl0IG9uIG9uZSBvciBtb3JlIHdoaXRlc3BhY2VzCjx8ZmltX2hvbGV8PgogICAgICAgIHJldHVybiB0ZXJtcwoKCgoKCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgICAgICMgU3RvcHdvcmQgcmVtb3ZhbAogICAgICAgICAgICBpZiB0ZXJtIGluIHN0b3B3b3JkczoKICAgICAgICAgICAgICAgIGNvbnRpbnVlCiAgICAgICAgICAgIHRlcm1zLmFwcGVuZCh0ZXJtKQo8fGZpbV9lbmR8Pg==
abb904ff0ca28ee477ed1698593b743a96f7dd61-3
abb904ff0ca28ee477ed1698593b743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pCiAgICAgICAgY2FuZCA9IFtdCiAgICAgICAgZm9yIHRhYmxlX2lkIGluIHJlcy5rZXlzKCk6CiAgICAgICAgICAgIGRvYyA9IHNlbGYuX190ZXMuZ2V0X2RvYyh0YWJsZV9pZCkKICAgICAgICAgICAgbGFiZWxzID0gZG9jWyJfc291cmNlIl1bImhlYWRpbmdzX2EiXQogICAgICAgICAgICBjYW5kICs9IGxhYmVscwogICAgICAgIHJldHVybiBzZXQoW2kgZm9yIGkgaW4gY2FuZCBpZiBpIG5vdCBpbiBzZWVkXSksIGxpc3QocmVzLmtleXMoKSkKCgogICAgZGVmIGZpbmRfY2FuZGlkYXRlc19sKHNlbGYsIHNlZWQsIG51bT0xMDApOgogICAgICAgICIiImZpbmQgY2FuZGlkYXRlIGxhYmVscyBVc2luZyBsYWJlbHMgIiIiCiAgICAgICAgdGFibGVzID0gW10KICAgICAgICBjYW5kID0gW10KICAgICAgICBmb3IgbGFiZWwgaW4gc2VlZDoKICAgICAgICAgICAgcmVzID0gc2VsZi5fX3Rlcy5zZWFyY2gocXVlcnk9bGFiZWwsIGZpZWxkPSJoZWFkaW5ncyIsIG51bT1udW0pCiAgICAgICAgICAgIHRhYmxlcyArPSBsaXN0KHJlcy5rZXlzKCkpCiAgICAgICAgICAgIGZvciB0YWJsZV9pZCBpbiByZXMua2V5cygpOgogICAgICAgICAgICAgICAgZG9jID0gc2VsZi5fX3Rlcy5nZXRfZG9jKHRhYmxlX2lkKQogICAgICAgICAgICAgICAgbGFiZWxzID0gZG9jWyJfc291cmNlIl1bImhlYWRpbmdzIl0KICAgICAgICAgICAgICAgIGNhbmQgKz0gbGFiZWxzCiAgICAgICAgcmV0dXJuIHNldChbaSBmb3IgaSBpbiBjYW5kIGlmIGkgbm90IGluIHNlZWRdKSwgdGFibGVzCgoKICAgIGRlZiBmaW5kX2NhbmRpZGF0ZXNfZShzZWxmLCBFLCBzZWVkLCBudW09MTAwKToKICAgICAgICAiIiJmaW5kIGNhbmRpZGF0ZSBsYWJlbHMgVXNpbmcgZW50aXRpZXMiIiIKICAgICAgICB0YWJsZXMgPSBbXQogICAgICAgIGNhbmQgPSBbXQogICAgICAgIGZvciBlbnRpdHkgaW4gRToKICAgICAgICAgICAgYm9keSA9IHNlbGYuZ2VuZXJhdGVfc2VhcmNoX2JvZHkoZW50aXR5PWVudGl0eSwgZmllbGQ9ImVudGl0eSIpCiAgICAgICAgICAgIHJlcyA9IHNlbGYuX190ZXMuc2VhcmNoX2NvbXBsZXgoYm9keT1ib2R5LCBudW09bnVtKQogICAgICAgICAgICB0YWJsZXMgKz0gbGlzdChyZXMua2V5cygpKQogICAgICAgICAgICBmb3IgdGFibGVfaWQgaW4gcmVzLmtleXMoKToKICAgICAgICAgICAgICAgIGRvYyA9IHNlbGYuX190ZXMuZ2V0X2RvYyh0YWJsZV9pZCkKICAgICAgICAgICAgICAgIGxhYmVscyA9IGRvY1siX3NvdXJjZSJdWyJoZWFkaW5ncyJdCiAgICAgICAgICAgICAgICBjYW5kICs9IGxhYmVscwogICAgICAgIHJldHVybiBzZXQoW2kgZm9yIGkgaW4gY2FuZCBpZiBpIG5vdCBpbiBzZWVkXSksIHRhYmxlcwoKICAgIGRlZiBnZW5lcmF0ZV9zZWFyY2hfYm9keShzZWxmLCBlbnRpdHksIGZpZWxkKToKICAgICAgICAiIiJHZW5lcmF0ZSBzZWFyY2ggYm9keSIiIgogICAgICAgIGJvZHkgPSB7CiAgICAgICAgICAgICJxdWVyeSI6IHsKICAgICAgICAgICAgICAgICJib29sIjogewogICAgICAgICAgICAgICAgICAgICJtdXN0IjogewogICAgICAgICAgICAgICAgICAgICAgICAidGVybSI6IHtmaWVsZDogZW50aXR5fQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgogICAgICAgIHJldHVybiBib2R5Cgo8fGZpbV9lbmR8Pg==
abb904ff0ca28ee477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T1jLCBmaWVsZD0iY2FwdGlvbiIsIG51bT1udW0pCiAgICAgICAgY2FuZCA9IFtdCiAgICAgICAgZm9yIHRhYmxlX2lkIGluIHJlcy5rZXlzKCk6CiAgICAgICAgICAgIGRvYyA9IHNlbGYuX190ZXMuZ2V0X2RvYyh0YWJsZV9pZCkKICAgICAgICAgICAgbGFiZWxzID0gZG9jWyJfc291cmNlIl1bImhlYWRpbmdzX2EiXQogICAgICAgICAgICBjYW5kICs9IGxhYmVscwogICAgICAgIHJldHVybiBzZXQoW2kgZm9yIGkgaW4gY2FuZCBpZiBpIG5vdCBpbiBzZWVkXSksIGxpc3QocmVzLmtleXMoKSkKCgogICAgZGVmIGZpbmRfY2FuZGlkYXRlc19sKHNlbGYsIHNlZWQsIG51bT0xMDApOgogICAgICAgICIiImZpbmQgY2FuZGlkYXRlIGxhYmVscyBVc2luZyBsYWJlbHMgIiIiCiAgICAgICAgdGFibGVzID0gW10KICAgICAgICBjYW5kID0gW10KICAgICAgICBmb3IgbGFiZWwgaW4gc2VlZDoKICAgICAgICAgICAgcmVzID0gc2VsZi5fX3Rlcy5zZWFyY2gocXVlcnk9bGFiZWwsIGZpZWxkPSJoZWFkaW5ncyIsIG51bT1udW0pCiAgICAgICAgICAgIHRhYmxlcyArPSBsaXN0KHJlcy5rZXlzKCkpCiAgICAgICAgICAgIGZvciB0YWJsZV9pZCBpbiByZXMua2V5cygpOgogICAgICAgICAgICAgICAgZG9jID0gc2VsZi5fX3Rlcy5nZXRfZG9jKHRhYmxlX2lkKQogICAgICAgICAgICAgICAgbGFiZWxzID0gZG9jWyJfc291cmNlIl1bImhlYWRpbmdzIl0KICAgICAgICAgICAgICAgIGNhbmQgKz0gbGFiZWxzCiAgICAgICAgcmV0dXJuIHNldChbaSBmb3IgaSBpbiBjYW5kIGlmIGkgbm90IGluIHNlZWRdKSwgdGFibGVzCgoKICAgIGRlZiBmaW5kX2NhbmRpZGF0ZXNfZShzZWxmLCBFLCBzZWVkLCBudW09MTAwKToKICAgICAgICAiIiJmaW5kIGNhbmRpZGF0ZSBsYWJlbHMgVXNpbmcgZW50aXRpZXMiIiIKPHxmaW1faG9sZXw+CiAgICAgICAgICAgIHJlcyA9IHNlbGYuX190ZXMuc2VhcmNoX2NvbXBsZXgoYm9keT1ib2R5LCBudW09bnVtKQogICAgICAgICAgICB0YWJsZXMgKz0gbGlzdChyZXMua2V5cygpKQogICAgICAgICAgICBmb3IgdGFibGVfaWQgaW4gcmVzLmtleXMoKToKICAgICAgICAgICAgICAgIGRvYyA9IHNlbGYuX190ZXMuZ2V0X2RvYyh0YWJsZV9pZCkKICAgICAgICAgICAgICAgIGxhYmVscyA9IGRvY1siX3NvdXJjZSJdWyJoZWFkaW5ncyJdCiAgICAgICAgICAgICAgICBjYW5kICs9IGxhYmVscwogICAgICAgIHJldHVybiBzZXQoW2kgZm9yIGkgaW4gY2FuZCBpZiBpIG5vdCBpbiBzZWVkXSksIHRhYmxlcwoKICAgIGRlZiBnZW5lcmF0ZV9zZWFyY2hfYm9keShzZWxmLCBlbnRpdHksIGZpZWxkKToKICAgICAgICAiIiJHZW5lcmF0ZSBzZWFyY2ggYm9keSIiIgogICAgICAgIGJvZHkgPSB7CiAgICAgICAgICAgICJxdWVyeSI6IHsKICAgICAgICAgICAgICAgICJib29sIjogewogICAgICAgICAgICAgICAgICAgICJtdXN0IjogewogICAgICAgICAgICAgICAgICAgICAgICAidGVybSI6IHtmaWVsZDogZW50aXR5fQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gYm9keQoKICAgIGRlZiBwYXJzZShzZWxmLCB0ZXh0KToKICAgICAgICAiIiJQdXQgcXVlcnkgaW50byBhIHRlcm0gbGlzdCBmb3IgdGVybSBpdGVyYXRpb24iIiIKICAgICAgICBzdG9wd29yZHMgPSBbXQogICAgICAgIHRlcm1zID0gW10KICAgICAgICAjIFJlcGxhY2Ugc3BlY2lmaWMgY2hhcmFjdGVycyB3aXRoIHNwYWNlCiAgICAgICAgY2hhcnMgPSBbIiciLCAiLiIsICI6IiwgIiwiLCAiLyIsICIoIiwgIikiLCAiLSIsICIrIl0KICAgICAgICBmb3IgY2ggaW4gY2hhcnM6CiAgICAgICAgICAgIGlmIGNoIGluIHRleHQ6CiAgICAgICAgICAgICAgICB0ZXh0ID0gdGV4dC5yZXBsYWNlKGNoLCAiICIpCiAgICAgICAgIyBUb2tlbml6YXRpb24KICAgICAgICBmb3IgdGVybSBpbiB0ZXh0LnNwbGl0KCk6ICAjIGRlZmF1bHQgYmVoYXZpb3Igb2YgdGhlIHNwbGl0IGlzIHRvIHNwbGl0IG9uIG9uZSBvciBtb3JlIHdoaXRlc3BhY2VzCiAgICAgICAgICAgICMgU3RvcHdvcmQgcmVtb3ZhbAogICAgICAgICAgICBpZiB0ZXJtIGluIHN0b3B3b3JkczoKICAgICAgICAgICAgICAgIGNvbnRpbnVlCiAgICAgICAgICAgIHRlcm1zLmFwcGVuZCh0ZXJtKQogICAgICAgIHJldHVybiB0ZXJtcwoKCgoKCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgdGFibGVzID0gW10KICAgICAgICBjYW5kID0gW10KICAgICAgICBmb3IgZW50aXR5IGluIEU6CiAgICAgICAgICAgIGJvZHkgPSBzZWxmLmdlbmVyYXRlX3NlYXJjaF9ib2R5KGVudGl0eT1lbnRpdHksIGZpZWxkPSJlbnRpdHkiKQo8fGZpbV9lbmR8Pg==
abb29ec2f0f201c9da05214f40d0ca321861a526-1
abb29ec2f0f201c9da05214f40d0ca321861a526
PHxmaW1fcHJlZml4fD4KIyAtKi0gY29kaW5nOiB1dGYtOCAtKi0KCiIiIgogICAgQSBjb2xsZWN0aW9uIG9mIHRvb2xzIGZvciB2aWV3cy4KIiIiCgpmcm9tIGZsYXNrIGltcG9ydCByZXF1ZXN0CmZyb20gd2Vya3pldWcudXJscyBpbXBvcnQgdXJsX3BhcnNlCgoKZGVmIGdldF9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gImJ5dGVjb2RlIgogICAgaWYgImluZm8iIGluIHJlbGV2YW50OgogICAgICAgIGxvZ2xldmVsID0gImluZm8iCiAgICBlbGlmICJkZWJ1ZyIgaW4gcmVsZXZhbnQ6CiAgICAgICAgbG9nbGV2ZWwgPSAiZGVidWciCiAgICBlbHNlOgogICAgICAgIGxvZ2xldmVsID0gZGVmYXVsdF9sb2dsZXZlbAoKICAgIGlmICIyZGlzayIgaW4gcmVsZXZhbnQ6CiAgICAgICAgbl9kaXNrcyA9IDIKICAgIGVsaWYgIjNkaXNrIiBpbiByZWxldmFudDoKICAgICAgICBuX2Rpc2tzID0gMwogICAgZWxzZToKICAgICAgICBuX2Rpc2tzID0gMQoKICAgIGlmICJzc2QiIGluIHJlbGV2YW50OgogICAgICAgIGRiX2Rpc2tfdHlwZSA9ICJzc2QiCiAgICBlbHNlOgogICAgICAgIGRiX2Rpc2tfdHlwZSA9ICJoZGQiCgogICAgaWYgIjNub2RlIiBpbiByZWxldmFudDoKICAgICAgICBuX25vZGVzID0gMwogICAgZWxzZToKICAgICAgICBuX25vZGVzID0gMQoKICAgIGlmICIxYm0iIGluIHJlbGV2YW50OgogICAgICAgIG5fYm0gPSAxCiAgICBlbGlmICIzYm0iIGluIHJlbGV2YW50OgogICAgICAgIG5fYm0gPSAzCiAgICBlbHNlOgogICAgICAgIG5fYm0gPSAxCgogICAgaWYgImV4dDIiIGluIHJlbGV2YW50OgogICAgICAgIGRiX2ZzID0gImV4dDIiCiAgICBlbHNlOgogICAgICAgIGRiX2ZzID0gImV4dDQiCgogICAgdGNfcGFyYW1zID0ge30KICAgIGdldF9wYXJhbSgiYm51bSIsIHJlbGV2YW50LCB0Y19wYXJhbXMpCiAgICBnZXRfcGFyYW0oImFwb3ciLCByZWxldmFudCwgdGNfcGFyYW1zKQogICAgZ2V0X3BhcmFtKCJsbWVtYiIsIHJlbGV2YW50LCB0Y19wYXJhbXMpCiAgICBnZXRfcGFyYW0oIm5tZW1iIiwgcmVsZXZhbnQ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LnB5cGxvdC5sZWdlbmQobG9jPSd1cHBlciBjZW50ZXInKQogICAgICAgIG1hdHBsb3RsaWIucHlwbG90LnNhdmVmaWcocG5nX3BhdGgpCgogICAgZGVmIGdlbmVyYXRlX3NldHMoc2VsZik6CiAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QuY2xmKCkKICAgICAgICBwbmdfcGF0aCA9IG9zLnBhdGguam9pbihzZWxmLm91dHB1dF9mb2xkZXIsICJzZXRzLnBuZyIpCiAgICAgICAgZm9yIGxhYmVsIGluIHNvcnRlZChzZWxmLmRhdGEua2V5cygpKToKICAgICAgICAgICAgc2V0X3RpbWVzLCBnZXRfdGltZXMsIF8gPSBzZWxmLmRhdGFbbGFiZWxdCiAgICAgICAgICAgIGFtb3VudHMgPSBbdHRbMF0gZm9yIHR0IGluIHNldF90aW1lc10KICAgICAgICAgICAgdGltZXMgPSBbdHRbMV0gZm9yIHR0IGluIHNldF90aW1lc10KICAgICAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QucGxvdChhbW91bnRzLCB0aW1lcywgbGFiZWw9c3RyKGxhYmVsKSkKICAgICAgICBtYXRwbG90bGliLnB5cGxvdC5sZWdlbmQoKQogICAgICAgIG1hdHBsb3RsaWIucHlwbG90LnNhdmVmaWcocG5nX3BhdGgpCgogICAgZGVmIGdlbmVyYXRlX2dldHMoc2VsZik6CiAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QuY2xmKCkKICAgICAgICBwbmdfcGF0aCA9IG9zLnBhdGguam9pbihzZWxmLm91dHB1dF9mb2xkZXIsICJnZXRzLnBuZyIpCiAgICAgICAgZm9yIGxhYmVsIGluIHNvcnRlZChzZWxmLmRhdGEua2V5cygpKToKICAgICAgICAgICAgc2V0X3RpbWVzLCBnZXRfdGltZXMsIF8gPSBzZWxmLmRhdGFbbGFiZWxdCiAgICAgICAgICAgIGFtb3VudHMgPSBbdHRbMF0gZm9yIHR0IGluIGdldF90aW1lc10KICAgICAgICAgICAgdGltZXMgPSBbd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ZWxmLCBmaWxlbmFtZSwgdGltZXNfaW5kZXgsIHRpdGxlLCB4bGFiZWwsIHlsYWJlbCk6CiAgICAgICAgcG5nX3BhdGhzID0gW10KICAgICAgICBkYXRhID0gY29sbGVjdGlvbnMuZGVmYXVsdGRpY3QobGlzdCkKICAgICAgICBsaW5lX3N0eWxlX2l0ZXIgPSBnZXRfbGluZV9zdHlsZV9pdGVyKCkKICAgICAgICBmb3IgZ3JvdXAsIHZhbHVlX2RpY3QgaW4gc29ydGVkX2l0ZXJpdGVtcyhzZWxmLmRhdGEpOgogICAgICAgICAgICBsaW5lX3N0eWxlID0gbGluZV9zdHlsZV9pdGVyLm5leHQoKQogICAgICAgICAgICBmb3IgdmFsdWVfc2l6ZSwgdGltZXNfbGlzdCBpbiBzb3J0ZWRfaXRlcml0ZW1zKHZhbHVlX2RpY3QpOgogICAgICAgICAgICAgICAgdGltZXMgPSB0aW1lc19saXN0W3RpbWVzX2luZGV4XQogICAgICAgICAgICAgICAgcHJldl9hbW91bnQgPSAwCiAgICAgICAgICAgICAgICBwcmV2X3RpbWUgPSAwCiAgICAgICAgICAgICAgICBzZXRzX3Blcl9zZWNvbmQgPSBbXQogICAgICAgICAgICAgICAgZm9yIGFtb3VudCwgdGltZSBpbiB0aW1lczoKICAgICAgICAgICAgICAgICAgICBzZXRzX3Blcl9zZWNvbmQuYXBwZW5kKChhbW91bnQgLSBwcmV2X2Ftb3VudCkgKiAxLjAgLyAodGltZSAtIHByZXZfdGltZSkpCgogICAgICAgICAgICAgICAgYW1vdW50cyA9IFt0dFswXSBmb3IgdHQgaW4gdGltZXNdCiAgICAgICAgICAgICAgICBsYWJlbCA9IGdyb3VwCiAgICAgICAgICAgICAgICBkYXRhW3ZhbHVlX3NpemVdLmFwcGVuZCgoYW1vdW50cywgc2V0c19wZXJfc2Vjb25kLCBsaW5lX3N0eWxlLCBsYWJlbCkpCiAgICAgICAgZm9yIHZhbHVlX3NpemUsIHZhbHVlX3NpemVfZGF0YSBpbiBz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ZV9zaXplX21hdGNoID0gcmUubWF0Y2goIl4oXGQrKSIsIHJlbGV2YW50KQogICAgaWYgbm90IHZhbHVlX3NpemVfbWF0Y2g6CiAgICAgICAgcmFpc2UgVmFsdWVFcnJvcigiRmFpbGVkIHRvIHBhcnNlIGZpbGUgbmFtZSAlcyIgJSBmaWxlbmFtZSkKCiAgICB2YWx1ZV9zaXplID0gaW50KHZhbHVlX3NpemVfbWF0Y2guZ3JvdXBzKClbMF0pCgogICAgYXJhdHlwZSA9ICJuYXRpdmUiIGlmICJuYXRpdmUiIGluIHJlbGV2YW50IGVsc2UgImJ5dGVjb2RlIgogICAgaWYgImluZm8iIGluIHJlbGV2YW50OgogICAgICAgIGxvZ2xldmVsID0gImluZm8iCiAgICBlbGlmICJkZWJ1ZyIgaW4gcmVsZXZhbnQ6CiAgICAgICAgbG9nbGV2ZWwgPSAiZGVidWciCiAgICBlbHNlOgogICAgICAgIGxvZ2xldmVsID0gZGVmYXVsdF9sb2dsZXZlbAoKICAgIGlmICIyZGlzayIgaW4gcmVsZXZhbnQ6CiAgICAgICAgbl9kaXNrcyA9IDIKICAgIGVsaWYgIjNkaXNrIiBpbiByZWxldmFudDoKICAgICAgICBuX2Rpc2tzID0gMwogICAgZWxzZToKICAgICAgICBuX2Rpc2tzID0gMQoKICAgIGlmICJzc2QiIGluIHJlbGV2YW50OgogICAgICAgIGRiX2Rpc2tfdHlwZSA9ICJzc2QiCiAgICBlbHNlOgogICAgICAgIGRiX2Rpc2tfdHlwZSA9ICJoZGQiCgogICAgaWYgIjNub2RlIiBpbiByZWxldmFudDoKICAgICAgICBuX25vZGVzID0gMwogICAgZWxzZToKICAgICAgICBuX25vZGVzID0gMQoKICAgIGlmICIxYm0iIGluIHJlbGV2YW50OgogICAgICAgIG5fYm0gPSAxCiAgICBlbGlmICIzYm0iIGluIHJlbGV2YW50OgogICAgICAgIG5fYm0gPSAzCiAgICBlbHNlOgogICAgICAgIG5fYm0gPSAxCgogICAgaWYgImV4dDIi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Ww9bGFiZWwsIGNvbG9yPWNvbG9yX2l0ZXIubmV4dCgpKQoKICAgICAgICBtYXRwbG90bGliLnB5cGxvdC50aXRsZSh0aXRsZSkKICAgICAgICBtYXRwbG90bGliLnB5cGxvdC54dGlja3MoeF9udW1iZXJzLCBbc3RyKHZzKSBmb3IgdnMgaW4gdmFsdWVfc2l6ZXNdKQogICAgICAgIG1hdHBsb3RsaWIucHlwbG90LnhsYWJlbCh4bGFiZWwpCiAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QueWxhYmVsKHlsYWJlbCkKICAgICAgICBtYXRwbG90bGliLnB5cGxvdC5sZWdlbmQobG9jPSd1cHBlciBjZW50ZXInKQogICAgICAgIG1hdHBsb3RsaWIucHlwbG90LnNhdmVmaWcocG5nX3BhdGgpCgogICAgZGVmIGdlbmVyYXRlX3NldHMoc2VsZik6CiAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QuY2xmKCkKICAgICAgICBwbmdfcGF0aCA9IG9zLnBhdGguam9pbihzZWxmLm91dHB1dF9mb2xkZXIsICJzZXRzLnBuZyIpCiAgICAgICAgZm9yIGxhYmVsIGluIHNvcnRlZChzZWxmLmRhdGEua2V5cygpKToKICAgICAgICAgICAgc2V0X3RpbWVzLCBnZXRfdGltZXMsIF8gPSBzZWxmLmRhdGFbbGFiZWxdCiAgICAgICAgICAgIGFtb3VudHMgPSBbdHRbMF0gZm9yIHR0IGluIHNldF90aW1lc10KICAgICAgICAgICAgdGltZXMgPSBbdHRbMV0gZm9yIHR0IGluIHNldF90aW1lc10KICAgICAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QucGxvdChhbW91bnRzLCB0aW1lcywgbGFiZWw9c3RyKGxhYmVsKSkKICAgICAgICBtYXRwbG90bGliLnB5cGxvdC5sZWdlbmQoKQogICAgICAgIG1hdHBsb3RsaWIucHlwbG90LnNhdmVmaWcocG5nX3BhdGgpCgogICAgZGVmIGdlbmVyYXRlX2dldHMoc2VsZik6CiAgICAgICAgbWF0cGx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IsIHJlbGV2YW50KQogICAgaWYgbm90IHZhbHVlX3NpemVfbWF0Y2g6CiAgICAgICAgcmFpc2UgVmFsdWVFcnJvcigiRmFpbGVkIHRvIHBhcnNlIGZpbGUgbmFtZSAlcyIgJSBmaWxlbmFtZSkKCiAgICB2YWx1ZV9zaXplID0gaW50KHZhbHVlX3NpemVfbWF0Y2guZ3JvdXBzKClbMF0pCgogICAgYXJhdHlwZSA9ICJuYXRpdmUiIGlmICJuYXRpdmUiIGluIHJlbGV2YW50IGVsc2UgImJ5dGVjb2RlIgogICAgaWYgImluZm8iIGluIHJlbGV2YW50OgogICAgICAgIGxvZ2xldmVsID0gImluZm8iCiAgICBlbGlmICJkZWJ1ZyIgaW4gcmVsZXZhbnQ6CiAgICAgICAgbG9nbGV2ZWwgPSAiZGVidWciCiAgICBlbHNlOgogICAgICAgIGxvZ2xldmVsID0gZGVmYXVsdF9sb2dsZXZlbAoKICAgIGlmICIyZGlzayIgaW4gcmVsZXZhbnQ6CiAgICAgICAgbl9kaXNrcyA9IDIKICAgIGVsaWYgIjNkaXNrIiBpbiByZWxldmFudDoKICAgICAgICBuX2Rpc2tzID0gMwogICAgZWxzZToKICAgICAgICBuX2Rpc2tzID0gMQoKICAgIGlmICJzc2QiIGluIHJlbGV2YW50OgogICAgICAgIGRiX2Rpc2tfdHlwZSA9ICJzc2QiCiAgICBlbHNlOgogICAgICAgIGRiX2Rpc2tfdHlwZSA9ICJoZGQiCgogICAgaWYgIjNub2RlIiBpbiByZWxldmFudDoKICAgICAgICBuX25vZGVzID0gMwogICAgZWxzZToKICAgICAgICBuX25vZGVzID0gMQoKICAgIGlmICIxYm0iIGluIHJlbGV2YW50OgogICAgICAgIG5fYm0gPSAxCiAgICBlbGlmICIzYm0iIGluIHJlbGV2YW50OgogICAgICAgIG5fYm0gPSAzCiAgICBlbHNlOgogICAgICAgIG5fYm0gPSAxCgogICAgaWYgImV4dDIiIGluIHJlbGV2YW50OgogICAgICAgIGRiX2ZzID0gImV4d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dCgpKQoKICAgICAgICBtYXRwbG90bGliLnB5cGxvdC50aXRsZSh0aXRsZSkKICAgICAgICBtYXRwbG90bGliLnB5cGxvdC54dGlja3MoeF9udW1iZXJzLCBbc3RyKHZzKSBmb3IgdnMgaW4gdmFsdWVfc2l6ZXNdKQogICAgICAgIG1hdHBsb3RsaWIucHlwbG90LnhsYWJlbCh4bGFiZWwpCiAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QueWxhYmVsKHlsYWJlbCkKICAgICAgICBtYXRwbG90bGliLnB5cGxvdC5sZWdlbmQobG9jPSd1cHBlciBjZW50ZXInKQogICAgICAgIG1hdHBsb3RsaWIucHlwbG90LnNhdmVmaWcocG5nX3BhdGgpCgogICAgZGVmIGdlbmVyYXRlX3NldHMoc2VsZik6CiAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QuY2xmKCkKICAgICAgICBwbmdfcGF0aCA9IG9zLnBhdGguam9pbihzZWxmLm91dHB1dF9mb2xkZXIsICJzZXRzLnBuZyIpCiAgICAgICAgZm9yIGxhYmVsIGluIHNvcnRlZChzZWxmLmRhdGEua2V5cygpKToKICAgICAgICAgICAgc2V0X3RpbWVzLCBnZXRfdGltZXMsIF8gPSBzZWxmLmRhdGFbbGFiZWxdCiAgICAgICAgICAgIGFtb3VudHMgPSBbdHRbMF0gZm9yIHR0IGluIHNldF90aW1lc10KICAgICAgICAgICAgdGltZXMgPSBbdHRbMV0gZm9yIHR0IGluIHNldF90aW1lc10KICAgICAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QucGxvdChhbW91bnRzLCB0aW1lcywgbGFiZWw9c3RyKGxhYmVsKSkKICAgICAgICBtYXRwbG90bGliLnB5cGxvdC5sZWdlbmQoKQogICAgICAgIG1hdHBsb3RsaWIucHlwbG90LnNhdmVmaWcocG5nX3BhdGgpCgogICAgZGVmIGdlbmVyYXRlX2dldHMoc2VsZik6CiAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QuY2xmKCkKICAgICAgICBwbmdfcG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Y3QgaW4gc29ydGVkX2l0ZXJpdGVtcyhzZWxmLmRhdGEpOgogICAgICAgICAgICBsaW5lX3N0eWxlID0gbGluZV9zdHlsZV9pdGVyLm5leHQoKQogICAgICAgICAgICBmb3IgdmFsdWVfc2l6ZSwgdGltZXNfbGlzdCBpbiBzb3J0ZWRfaXRlcml0ZW1zKHZhbHVlX2RpY3QpOgogICAgICAgICAgICAgICAgdGltZXMgPSB0aW1lc19saXN0W3RpbWVzX2luZGV4XQogICAgICAgICAgICAgICAgcHJldl9hbW91bnQgPSAwCiAgICAgICAgICAgICAgICBwcmV2X3RpbWUgPSAwCiAgICAgICAgICAgICAgICBzZXRzX3Blcl9zZWNvbmQgPSBbXQogICAgICAgICAgICAgICAgZm9yIGFtb3VudCwgdGltZSBpbiB0aW1lczoKICAgICAgICAgICAgICAgICAgICBzZXRzX3Blcl9zZWNvbmQuYXBwZW5kKChhbW91bnQgLSBwcmV2X2Ftb3VudCkgKiAxLjAgLyAodGltZSAtIHByZXZfdGltZSkpCgogICAgICAgICAgICAgICAgYW1vdW50cyA9IFt0dFswXSBmb3IgdHQgaW4gdGltZXNdCiAgICAgICAgICAgICAgICBpZiBncm91cDoKICAgICAgICAgICAgICAgICAgICBsYWJlbCA9ICIlcyAtICVzIiAlIChncm91cCwgdmFsdWVfc2l6ZSkKICAgICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAgICAgbGFiZWwgPSBzdHIodmFsdWVfc2l6ZSkKICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKChhbW91bnRzLCBzZXRzX3Blcl9zZWNvbmQsIGxpbmVfc3R5bGUsIGxhYmVsKSkKICAgICAgICBzZWxmLl9nZW4oZGF0YSwgdGl0bGUsIHhsYWJlbCwgeWxhYmVsLCBwbmdfcGF0aCkKICAgICAgICByZXR1cm4gW3BuZ19wYXRoXQoKZGVmIG5hbWVfZm9yX3BhcmFtcyhwYXJhbXMpOgogICAgbmFtZSA9ICJhcmFiZW5jaF8lKGF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gICAgICBzZXR1cC5hcHBlbmQoIiogIEFyYWtvb24gZGIgb24gYSBzcGlubmluZyBkaXNrIGRyaXZlIikKICAgICAgICBlbGlmIHBhcmFtc1siZGJfZGlza190eXBlIl0gPT0gInNzZCI6CiAgICAgICAgICAgIHNldHVwLmFwcGVuZCgiKiAgQXJha29vbiBkYiBvbiBhbiBTU0QgZHJpdmUiKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIFZhbHVlRXJyb3IoIlVua25vd24gZGlzayB0eXBlICVzIiAlIHBhcmFtc1siZGJfZGlza190eXBlIl0pCgogICAgICAgIHNldHVwLmFwcGVuZCgiKiAgREIgZnMgaXMgJXMiICUgcGFyYW1zWyJkYl9mcyJdKQogICAgICAgIHNldHVwLmFwcGVuZCgiKiAgJWQgQXJha29vbiBub2RlKHMpIiAlIHBhcmFtc1sibl9ub2RlcyJdKQogICAgICAgIHNldHVwLmFwcGVuZCgiKiAgJWQgYmVuY2htYXJrIGNsaWVudChzKSIgJSBwYXJhbXNbIm5fYm0iXSkKCiAgICAgICAgc2V0dXAuYXBwZW5kKCIqICBUb2t5byBDYWJpbmV0IHNldHVwOiIpCiAgICAgICAgdGNfcGFyYW1zID0gcGFyYW1zWyJ0YyJdCiAgICAgICAgZm9yIG5hbWUgaW4gKCJCbnVtIiwgIkFwb3ciLCAiTG1lbWIiLCAiTm1lbWIiLCAiRnBvdyIpOgogICAgICAgICAgICBrZXkgPSBuYW1lLmxvd2VyKCkKICAgICAgICAgICAgaWYga2V5IGluIHRjX3BhcmFtczoKICAgICAgICAgICAgICAgIHNldHVwLmFwcGVuZCgiKiogICVzOiAlZCIgJSAobmFtZSwgdGNfcGFyYW1zW2tleV0pKQoKICAgICAgICBzZXR1cC5hcHBlbmQoIiogIEJlbmNobWFyayBzZXR1cDoiKQogICAgICAgIGJlbmNoX3BhcmFtcyA9IHBhcmFtc1siYmVuY2giXQogICAgICAgIHNldHVwLmFwcGVuZCgiIiIqKiAgU2l6ZSBvZiB0aGUgdH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XplIGlmIGZpcnN0IGVsc2UgIiIsIGdyb3VwXSArIGJlbmNoX3RpbWVzKSkKICAgICAgICAgICAgZmlyc3QgPSBGYWxzZQoKICAgIGlmIGxlbihzZXR1cHMpID09IDE6CiAgICAgICAgc2V0dXBfZGV0YWlscyA9IFsKICAgICAgICAgICAgICAgICJcbiIuam9pbihzZXR1cCkgZm9yIHNldHVwIGluIHNldHVwcy5pdGVydmFsdWVzKCkKICAgICAgICAgICAgICAgIF0KICAgIGVsc2U6CiAgICAgICAgc2V0dXBfZGV0YWlscyA9IFsKICAgICAgICAgICAgICAgICJoMy4gQmVuY2htYXJrIElEOiAlc1xuJXMiICUgKGdyb3VwLCAiXG4iLmpvaW4oc2V0dXApKSBmb3IgZ3JvdXAsIHNldHVwIGluIHNldHVwcy5pdGVyaXRlbXMoKQogICAgICAgICAgICAgICAgXQogICAgY29udGV4dCA9IHsKICAgICAgICAgICAgInRpdGxlIjogdGl0bGUsCiAgICAgICAgICAgICJzZXR1cF9kZXRhaWxzIjogIlxuIi5qb2luKHNldHVwX2RldGFpbHMpLAogICAgICAgICAgICAidGltZV90YWJsZSI6ICJcbiIuam9pbih0aW1lc190YWJsZV9saW5lcyksCiAgICAgICAgICAgICJzZXRzX3Blcl9zZWNvbmQiOiAiXG4iLmpvaW4oWyIhJXMhIiAlIG9zLnBhdGguYmFzZW5hbWUocGF0aCkgZm9yIHBhdGggaW4gc2V0c19wZXJfc2Vjb25kXSksCiAgICAgICAgICAgICJnZXRzX3Blcl9zZWNvbmQiOiAiXG4iLmpvaW4oWyIhJXMhIiAlIG9zLnBhdGguYmFzZW5hbWUocGF0aCkgZm9yIHBhdGggaW4gZ2V0c19wZXJfc2Vjb25kXSksCiAgICAgICAgICAgIH0KICAgIHJldHVybiAiIiIKUGFyZW50OiBbQk1dCgpoMS4gJSh0aXRsZSlzCmgyLiBTZXR1cCBEZXRhaWxzCiUoc2V0dXBfZGV0YWlscylzCgpoMi4gVGltZSBUYWJsZQpUaGUgdmFs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m9yIGtleSwgdmFsdWUgaW4gaW5mb1sicGFyYW1zIl0uaXRlcml0ZW1zKCk6CiAgICAgICAgICAgIGlmIGtleSA9PSAidGMiOgogICAgICAgICAgICAgICAgZm9yIHRjX2tleSwgdGNfdmFsdWUgaW4gdmFsdWUuaXRlcml0ZW1zKCk6CiAgICAgICAgICAgICAgICAgICAgZGlmZl9kaWN0WyJ0YyJdW3RjX2tleV0uYWRkKHRjX3ZhbHVlKQogICAgICAgICAgICBlbGlmIGtleSA9PSAiYmVuY2giOgogICAgICAgICAgICAgICAgZm9yIGJlbmNoX2tleSwgYmVuY2hfdmFsdWUgaW4gdmFsdWUuaXRlcml0ZW1zKCk6CiAgICAgICAgICAgICAgICAgICAgZGlmZl9kaWN0WyJiZW5jaCJdW2JlbmNoX2tleV0uYWRkKGJlbmNoX3ZhbHVlKQogICAgICAgICAgICAgICAgZGlmZl9kaWN0WyJiZW5jaCJdCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBkaWZmX2RpY3Rba2V5XS5hZGQodmFsdWUpCgogICAgZm9yIGtleSwgdmFsdWVzIGluIGRpZmZfZGljdC5pdGVyaXRlbXMoKToKICAgICAgICBpZiBrZXkgPT0gInRjIjoKICAgICAgICAgICAgZm9yIHRjX2tleSwgdGNfdmFsdWVzIGluIHZhbHVlcy5pdGVyaXRlbXMoKToKICAgICAgICAgICAgICAgIGlmIGxlbih0Y192YWx1ZXMpID09IDE6CiAgICAgICAgICAgICAgICAgICAgY29udGludWUKCiAgICAgICAgICAgICAgICBmb3IgaW5mbyBpbiBpbmZvX2RpY3QuaXRlcnZhbHVlcygpOgogICAgICAgICAgICAgICAgICAgIGluZm9bInBhcmFtc19kaWZmIl1ba2V5XVt0Y19rZXldID0gaW5mb1sicGFyYW1zIl1ba2V5XVt0Y19rZXldCiAgICAgICAgZWxpZiBrZXkgPT0gImJlbmNoIjoKICAgICAgICAgICAgZm9yIGJlbmNoX2tleSwgYmVuY2hfdmFsdWVzIGluIHZhbHVlcy5pdGVyaXRlbXMoKToKICAgICAgICAgICAgICAgIGlmIGxlbihiZW5jaF92YWx1ZXMpID09IDE6CiAgICAgICAgICAgICAgICAgICAgY29udGludWUKCiAgICAgICAgICAgICAgICBmb3IgaW5mbyBpbiBpbmZvX2RpY3QuaXRlcnZhbHVlcygpOgogICAgICAgICAgICAgICAgICAgIGluZm9bInBhcmFtc19kaWZmIl1ba2V5XVtiZW5jaF9rZXldID0gaW5mb1sicGFyYW1zIl1ba2V5XVtiZW5jaF9rZXldCiAgICAgICAgZWxzZToKICAgICAgICAgICAgaWYgbGVuKHZhbHVlcykgPT0gMToKICAgICAgICAgICAgICAgIGNvbnRpbnVlCgogICAgICAgICAgICBmb3IgaW5mbyBpbiBpbmZvX2RpY3QuaXRlcnZhbHVlcygpOgogICAgICAgICAgICAgICAgaW5mb1sicGFyYW1zX2RpZmYiXVtrZXldID0gaW5mb1sicGFyYW1zIl1ba2V5XQoKZGVmIGJ1aWxkX2luZm9fZGljdChsb2dfZmlsZV9wYXRocyk6CiAgICBsb2dfaW5mbyA9IHt9CiAgICBmb3IgbG9nX2ZpbGVfcGF0aCBpbiBsb2dfZmlsZV9wYXRoczoKICAgICAgICB2YWx1ZV9zaXplLCBwYXJhbXMgPSBleHRyYWN0X3BhcmFtcyhsb2dfZmlsZV9wYXRoKQogICAgICAgIGxvZ19pbmZvW2xvZ19maWxlX3BhdGhdID0gewogICAgICAgICAgICAgICAgInZhbHVlX3NpemUiOiB2YWx1ZV9zaXplLAogICAgICAgICAgICAgICAgInBhcmFtcyI6IHBhcmFtcywKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgogICAgICAgICAgICAgICAgInBhcmFtc19kaWZmIjogeyJ0YyI6IHt9LCAiYmVuY2giOiB7fX0sCiAgICAgICAgICAgICAgICB9Cgo8fGZpbV9lbmR8Pg==
e63b0577f600c20a10c32b2c4b3670e1ef79e45b-4
e63b0577f600c20a10c32b2c4b3670e1ef79e45b
PHxmaW1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m5vZGVfYXQiLCByZWxldmFudCwgYmVuY2hfcGFyYW1zKQoKICAgIHJldHVybiB2YWx1ZV9zaXplLCB7CiAgICAgICAgICAgICJhcmF0eXBlIjogYXJhdHlwZSwKICAgICAgICAgICAgImxvZ2xldmVsIjogbG9nbGV2ZWwsCiAgICAgICAgICAgICJuX2Rpc2tzIjogbl9kaXNrcywKICAgICAgICAgICAgImRiX2Rpc2tfdHlwZSI6IGRiX2Rpc2tfdHlwZSwKICAgICAgICAgICAgInRjIjogdGNfcGFyYW1zLAogICAgICAgICAgICAiYmVuY2giOiBiZW5jaF9wYXJhbXMsCiAgICAgICAgICAgICJuX2JtIjogbl9ibSwKICAgICAgICAgICAgIm5fbm9kZXMiOiBuX25vZGVzLAogICAgICAgICAgICAiZGJfZnMiOiBkYl9mcywKICAgICAgICAgICAgfQoKZGVmIGdldF9saW5lX3N0eWxlX2l0ZXIoKToKICAgIHJldHVybiBpdGVydG9vbHMuY3ljbGUoWyctJywgJy0tJywgJy0uJywgJzonXSkKCmRlZiBnZXRfY29sb3JfaXRlcigpOgogICAgcmV0dXJuIGl0ZXJ0b29scy5jeWNsZShbJ2InLCAnZycsICdyJywgJ2MnLCAnbScsICd5JywgJ2snXSkKCmNsYXNzIFBsb3R0ZXIob2JqZWN0KToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCBvdXRwdXRfZm9sZGVyKToKICAgICAgICBzZWxmLm91dHB1dF9mb2xkZXIgPSBvdXRwdXRfZm9sZGVyCiAgICAgICAgc2VsZi5kYXRhID0gY29sbGVjdGlvbnMuZGVmYXVsdGRpY3QoZGljdCkKCiAgICBkZWYgcmVnaXN0ZXIoc2VsZiwgZ3JvdXAsIHZhbHVlX3NpemUsIHNldF90aW1lcywgZ2V0X3RpbWVzLCBiZW5jaF90aW1lcyk6CiAgICAgICAgc2VsZi5kYXRhW2dyb3VwXVt2YWx1ZV9zaXplXSA9IChzZXRfdGltZXMsIGdldF90aW1lcywgYmVuY2hfdGltZXMpCgogICAg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lZChzZWxmLmRhdGEua2V5cygpKToKICAgICAgICAgICAgc2V0X3RpbWVzLCBnZXRfdGltZXMsIF8gPSBzZWxmLmRhdGFbbGFiZWxdCiAgICAgICAgICAgIGFtb3VudHMgPSBbdHRbMF0gZm9yIHR0IGluIHNldF90aW1lc10KICAgICAgICAgICAgdGltZXMgPSBbdHRbMV0gZm9yIHR0IGluIHNldF90aW1lc10KICAgICAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QucGxvdChhbW91bnRzLCB0aW1lcywgbGFiZWw9c3RyKGxhYmVsKSkKICAgICAgICBtYXRwbG90bGliLnB5cGxvdC5sZWdlbmQoKQogICAgICAgIG1hdHBsb3RsaWIucHlwbG90LnNhdmVmaWcocG5nX3BhdGgpCgogICAgZGVmIGdlbmVyYXRlX2dldHMoc2VsZik6CiAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QuY2xmKCkKICAgICAgICBwbmdfcGF0aCA9IG9zLnBhdGguam9pbihzZWxmLm91dHB1dF9mb2xkZXIsICJnZXRzLnBuZyIpCiAgICAgICAgZm9yIGxhYmVsIGluIHNvcnRlZChzZWxmLmRhdGEua2V5cygpKToKICAgICAgICAgICAgc2V0X3RpbWVzLCBnZXRfdGltZXMsIF8gPSBzZWxmLmRhdGFbbGFiZWxdCiAgICAgICAgICAgIGFtb3VudHMgPSBbdHRbMF0gZm9yIHR0IGluIGdldF90aW1lc10KICAgICAgICAgICAgdGltZXMgPSBbdHRbMV0gZm9yIHR0IGluIGdldF90aW1lc10KICAgICAgICAgICAgbWF0cGxvdGxpYi5weXBsb3QucGxvdChhbW91bnRzLCB0aW1lcywgbGFiZWw9c3RyKGxhYmVsKSkKICAgICAgICBtYXRwbG90bGliLnB5cGxvdC5sZWdlbmQoKQogICAgICAgIG1hdHBsb3RsaWIucHlwbG90LnNhdmVmaWcocG5nX3BhdGgpCgogICAgZGVmIGdlbmVyYXRlX3NldHNfcGVyX3NlY29uZChzZWxmKToKICAgICAgICBzZWxmLnNldHNfcGV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LmRhdGEpOgogICAgICAgICAgICBsaW5lX3N0eWxlID0gbGluZV9zdHlsZV9pdGVyLm5leHQoKQogICAgICAgICAgICBmb3IgdmFsdWVfc2l6ZSwgdGltZXNfbGlzdCBpbiBzb3J0ZWRfaXRlcml0ZW1zKHZhbHVlX2RpY3QpOgogICAgICAgICAgICAgICAgdGltZXMgPSB0aW1lc19saXN0W3RpbWVzX2luZGV4XQogICAgICAgICAgICAgICAgcHJldl9hbW91bnQgPSAwCiAgICAgICAgICAgICAgICBwcmV2X3RpbWUgPSAwCiAgICAgICAgICAgICAgICBzZXRzX3Blcl9zZWNvbmQgPSBbXQogICAgICAgICAgICAgICAgZm9yIGFtb3VudCwgdGltZSBpbiB0aW1lczoKICAgICAgICAgICAgICAgICAgICBzZXRzX3Blcl9zZWNvbmQuYXBwZW5kKChhbW91bnQgLSBwcmV2X2Ftb3VudCkgKiAxLjAgLyAodGltZSAtIHByZXZfdGltZSkpCgogICAgICAgICAgICAgICAgYW1vdW50cyA9IFt0dFswXSBmb3IgdHQgaW4gdGltZXNdCiAgICAgICAgICAgICAgICBsYWJlbCA9IGdyb3VwCiAgICAgICAgICAgICAgICBkYXRhW3ZhbHVlX3NpemVdLmFwcGVuZCgoYW1vdW50cywgc2V0c19wZXJfc2Vjb25kLCBsaW5lX3N0eWxlLCBsYWJlbCkpCiAgICAgICAgZm9yIHZhbHVlX3NpemUsIHZhbHVlX3NpemVfZGF0YSBpbiBzb3J0ZWRfaXRlcml0ZW1zKGRhdGEpOgogICAgICAgICAgICBwbmdfcGF0aCA9IG9zLnBhdGguam9pbihzZWxmLm91dHB1dF9mb2xkZXIsICJzaXplXyVkXyVzIiAlICh2YWx1ZV9zaXplLCBmaWxlbmFtZSkpCiAgICAgICAgICAgIHZhbHVlX3NpemVfdGl0bGUgPSAiJXMgLSBWYWx1ZSBTaXplICVkIiAlICh0aXRsZSwgdmFsdWVfc2l6ZSkKICAgICAgICAgICAgc2VsZi5fZ2VuKHZhbHVlX3NpemVf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cmFtcyh2YWx1ZSkKICAgICAgICAgICAgaWYgczoKICAgICAgICAgICAgICAgIHBhcnRzICs9IFsiYmVuY2hfIiArIHNdCiAgICAgICAgZWxzZToKICAgICAgICAgICAgaWYgaXNpbnN0YW5jZSh2YWx1ZSwgaW50KToKICAgICAgICAgICAgICAgIHBhcnRzLmFwcGVuZCgiJXMlMDJkIiAlIChrZXksIHZhbHVlKSkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIHBhcnRzLmFwcGVuZCgiJXMlcyIgJSAoa2V5LCB2YWx1ZSkpCgogICAgcmV0dXJuICJfIi5qb2luKHBhcnRzKQoKZGVmIGZvbGRlcl9mb3JfZGlmZl9wYXJhbXMocGFyYW1zKToKICAgIHBhcnRzID0gW10KICAgIGZvciBrZXksIHZhbHVlcyBpbiBzb3J0ZWRfaXRlcml0ZW1zKHBhcmFtcyk6CiAgICAgICAgaWYga2V5ID09ICJ0YyI6CiAgICAgICAgICAgIHMgPSBmb2xkZXJfZm9yX2RpZmZfcGFyYW1zKHZhbHVlcykKICAgICAgICAgICAgaWYgczoKICAgICAgICAgICAgICAgIHBhcnRzICs9IFsidGNfIiArIHNdCiAgICAgICAgZWxpZiBrZXkgPT0gImJlbmNoIjoKICAgICAgICAgICAgcyA9IGZvbGRlcl9mb3JfZGlmZl9wYXJhbXModmFsdWVzKQogICAgICAgICAgICBpZiBzOgogICAgICAgICAgICAgICAgcGFydHMgKz0gWyJiZW5jaF8iICsgc10KICAgICAgICBlbHNlOgogICAgICAgICAgICB2YWx1ZXNfc3RyaW5nID0gIl92c18iLmpvaW4oc3RyKHYpIGZvciB2IGluIHZhbHVlcykKICAgICAgICAgICAgcGFydHMuYXBwZW5kKCIlc18lcyIgJSAoa2V5LCB2YWx1ZXNfc3RyaW5nKSkKCiAgICByZXR1cm4gIl8iLmpvaW4ocGFydHMpCgpkZWYgcGFyc2VfdGltZXMobG9nX2ZpbGVfbmFtZSk6CiAgICBkYXRhID0gb3Blbihsb2dfZm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AgZm9yIGtleSwgdmFsdWVzIGluIGRpZmZfZGljdC5pdGVyaXRlbXMoKToKICAgICAgICBpZiBrZXkgPT0gInRjIjoKICAgICAgICAgICAgZm9yIHRjX2tleSwgdGNfdmFsdWVzIGluIHZhbHVlcy5pdGVyaXRlbXMoKToKICAgICAgICAgICAgICAgIGlmIGxlbih0Y192YWx1ZXMpID09IDE6CiAgICAgICAgICAgICAgICAgICAgY29udGludWUKCiAgICAgICAgICAgICAgICBmb3IgaW5mbyBpbiBpbmZvX2RpY3QuaXRlcnZhbHVlcygpOgogICAgICAgICAgICAgICAgICAgIGluZm9bInBhcmFtc19kaWZmIl1ba2V5XVt0Y19rZXldID0gaW5mb1sicGFyYW1zIl1ba2V5XVt0Y19rZXldCiAgICAgICAgZWxpZiBrZXkgPT0gImJlbmNoIjoKICAgICAgICAgICAgZm9yIGJlbmNoX2tleSwgYmVuY2hfdmFsdWVzIGluIHZhbHVlcy5pdGVyaXRlbXMoKToKICAgICAgICAgICAgICAgIGlmIGxlbihiZW5jaF92YWx1ZXMpID09IDE6CiAgICAgICAgICAgICAgICAgICAgY29udGludWUKCiAgICAgICAgICAgICAgICBmb3IgaW5mbyBpbiBpbmZvX2RpY3QuaXRlcnZhbHVlcygpOgogICAgICAgICAgICAgICAgICAgIGluZm9bInBhcmFtc19kaWZmIl1ba2V5XVtiZW5jaF9rZXldID0gaW5mb1sicGFyYW1zIl1ba2V5XVtiZW5jaF9rZXldCiAgICAgICAgZWxzZToKICAgICAgICAgICAgaWYgbGVuKHZhbHVlcykgPT0gMToKICAgICAgICAgICAgICAgIGNvbnRpbnVlCgogICAgICAgICAgICBmb3IgaW5mbyBpbiBpbmZvX2RpY3QuaXRlcnZhbHVlcygpOgogICAgICAgICAgICAgICAgaW5mb1sicGFyYW1zX2RpZmYiXVtrZXldID0gaW5mb1sicGFyYW1zIl1ba2V5XQoKZGVmIGJ1aWxkX2luZm9fZGljdChsb2dfZmlsZV9wYXRocyk6CiAgICBsb2dfaW5mbyA9IHt9CiAgICBmb3IgbG9nX2ZpbGVfcGF0aCBpbiBsb2dfZmlsZV9wYXRoczoKICAgICAgICB2YWx1ZV9zaXplLCBwYXJhbXMgPSBleHRyYWN0X3BhcmFtcyhsb2dfZmlsZV9wYXRoKQogICAgICAgIGxvZ19pbmZvW2xvZ19maWxlX3BhdGhdID0gewogICAgICAgICAgICAgICAgInZhbHVlX3NpemUiOiB2YWx1ZV9zaXplLAogICAgICAgICAgICAgICAgInBhcmFtcyI6IHBhcmFtcywKICAgICAgICAgICAgICAgICJwYXJhbXNfZGlmZiI6IHsidGMiOiB7fSwgImJlbmNoIjoge319LAogICAgICAgICAgICAgICAgfQoKICAgIGZpbGxfcGFyYW1zX2RpZmYobG9nX2luZm8pCiAgICByZXR1cm4gbG9nX2luZm8KCmRlZiBkaWZmX3BhcmFtcyhhbGxfcGFyYW1zKToKICAgICMgQXNzdW1lcyBhbGwgcGFyYW1zIGRpY3RzIGhhdmUgdGhlIHNhbWUga2V5czoKICAgIGRpZmYgPSB7fQogICAgZm9yIGtleSBpbiBhbGxfcGFyYW1zWzBdLml0ZXJrZXlzKCk6CiAgICAgICAgdmFsdWVzID0gW3BhcmFtc1trZXldIGZvciBwYXJhbXMgaW4gYWxsX3BhcmFtc10KICAgICAgICBpZiBrZXkgPT0gImJlbmNoIjoKICAgICAgICAgICAgc3ViZGlmZiA9IGRpZmZfcGFyYW1zKHZhbHVlcykKICAgICAgICAgICAgZGlmZltrZXldID0gc3ViZGlmZgogICAgICAgIGVsaWYga2V5ID09ICJ0YyI6CiAgICAgICAgICAgIHN1YmRpZmYgPSBkaWZmX3BhcmFtcyh2YWx1ZXMpCiAgICAgICAgICAgIGRpZmZba2V5XSA9IHN1YmRpZmYKICAgICAgICBlbHNlOgogICAgICAgICAgICB2YWx1ZXMgPSBzZXQodmFsdWVzKQogICAgICAgICAgICBpZiBsZW4odmFsdWVzKSA+IDE6CiAgICAgICAgICAgICAgICBkaWZmW2tleV0gPSB2YWx1ZXMK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ikuCgpTVE9SRSA9IG9zLnBhdGguam9pbihvcy5wYXRoLmRpcm5hbWUoX19maWxlX18pLCAic3RvcmUuZGIiKQoKPHxmaW1fZW5kfD4=
bbcb57046968c5e764d9d259fc04e958b70e8035-1
bbcb57046968c5e764d9d259fc04e958b70e8035
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGxvZ2dpbmcKCgpmcm9tIG1lcmN1cnlfYWdlbnQuaGFyZHdhcmUuZHJpdmVycyBpbXBvcnQgZ2V0X3N1YnN5c3RlbV9kcml2ZXJzCmZyb20gbWVyY3VyeV9hZ2VudC5pbnNwZWN0b3IuaW5zcGVjdG9ycyBpbXBvcnQgZXhwb3NlX2xhdGUKCgpsb2cgPSBsb2dnaW5nLmdldExvZ2dlcihfX25hbWVfXykKCgojIG5vaW5zcGVjdGlvbiBQeVVudXNlZExvY2FsCkBleHBvc2VfbGF0ZSgnYm1jJykKZGVmIGJtY19pbnNwZWN0b3IoZGV2aWNlX2luZm8pOgoKICAgIGRyaXZlcnMgPSBnZXRfc3Vic3lzdGVtX2RyaXZlcnMoJ2JtYycpCiAgICBpZiBub3QgZHJpdmVyczoKICAgICAgICByZXR1cm4KCiAgICBpZiBsZW4oZHJpdmVycykgPiAxOgogICAgICAgIGxvZy53YXJuaW5nKCdGb3VuZCBtb3JlIHRoYW4gb25lIGRyaXZlciBmb3IgQk1DLiBUaGlzIGlzIG1vc3QgbGlrZWx5IGEgYnVnJykKCiAgICBkcml2ZXIgPSBkcml2ZXJzWzBdCgogICAgbG9nLmluZm8oJ1J1bm5pbmcgQk1DIGluc3BlY3Rvcjoge30nLmZvcm1hdChkcml2ZXIubmFtZSkpCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KCiAgICByZXR1cm4gZHJpdmVyLmluc3BlY3QoKQo8fGZpbV9lbmR8Pg==
bbcb57046968c5e764d9d259fc04e958b70e8035-2
bbcb57046968c5e764d9d259fc04e958b70e8035
PHxmaW1fcHJlZml4fD4KaW1wb3J0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GlmIGxlbihyZXZpZXdfb2JqZWN0KSA+IDA6CiAgICAgICAgICAgICAgICByZXZpZXdzID0gcmV2aWV3X29iamVjdAogICAgICAgICAgICAgICAganNvbl9vYmplY3QuYXBwZW5kKHsnbmFtZSc6IGRvY3Rvcl9saXN0W2RvY10ubmFtZSwgJ2lkJzogZG9jdG9yX2xpc3RbZG9jXS5pZCwgJ3Jldmlld3MnOiByZXZpZXdzfSkKICAgICAgICAgICAgICAgIHJldmlld19vYmplY3QgPSBbXQoKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIGpzb25fb2JqZWN0LmFwcGVuZCh7J25hbWUnOiBkb2N0b3JfbGlzdFtkb2NdLm5hbWUsICdpZCc6IGRvY3Rvcl9saXN0W2RvY10uaWR9KQoKICAgICAgICAjIFJldHVybiBqc29uIG9iamVjdAogICAgICAgIGlmIGpzb25fb2JqZWN0OgogICAgICAgICAgICByZXR1cm4ganNvbmlmeShqc29uX29iamVjdCkKICAgICAgICBlbHNlOgogICAgICAgICAgICByZXR1cm4ganNvbmlmeShbXSkKCiAgICAjQ3JlYXRlIGEgZG9jdG9yCiAgICBlbGlmIHJlcXVlc3QubWV0aG9kID09ICdQT1NUJzoKICAgICAgICAjIEdldCB0aGUgcmVxdWVzdCBhcyBhIGpzb24gb2JqZWN0CiAgICAgICAgcmVxdWVzdF9kYXRhID0gcmVxdWVzdC5nZXRfanNvbigpCgogICAgICAgICMgQ2hlY2sgdG8gc2VlIGlmIHJlcXVlc3QgaXMgaW4gY29ycmVjdCBmb3JtYXQgYW5kIGNvbnRhaW5zIGNvcnJlY3QgZGF0YQogICAgICAgIGlmICgnZG9jdG9yJyBpbiByZXF1ZXN0X2RhdGEpICYgKCduYW1lJyBpbiByZXF1ZXN0X2RhdGFbJ2RvY3RvciddKToKICAgICAgICAgICAgIyBHZXQgdGhlIHZhbHVlCiAgICAgICAgICAgIGRvY3Rvcl9uYW1lID0gcmVxdWVzdF9kYXRhWydkb2N0b3InXVsnbmFtZ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XRlbXMoKToKICAgICAgICAgICAgaWYgdmFsaWRhdG9yLnZhbGlkYXRlKG1lc3NhZ2UpOgogICAgICAgICAgICAgICAgcmV0dXJuIGNhc2VfaWQKICAgICAgICByZXR1cm4gTm9uZQoKICAgIGRlZiBzZXJpYWxpemUoc2VsZik6CiAgICAgICAgcmV0dXJuIFt7CiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsCiAgICAgICAgICAgICAgICAgICAgJ2RhdGEnOiBtYXRjaGVycy5zZXJpYWxpemUoYyksCiAgICAgICAgICAgICAgICB9IGZvciBpZCwgYyBpbiBzZWxmLmNhc2VzLml0ZW1zKCldCgogICAgQHN0YXRpY21ldGhvZAogICAgZGVmIGRlc2VyaWFsaXplKGRhdGEpOgogICAgICAgIHJldHVybiBTd2l0Y2goWyhjYXNlWydpZCddLCBtYXRjaGVycy5kZXNlcmlhbGl6ZShjYXNlWydkYXRhJ10pKQogICAgICAgICAgICAgICAgICAgICAgIGZvciBjYXNlIGluIGRhdGFdKQoKICAgIGRlZiB0b19qc29uKHNlbGYpOgogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICd0eXBlJzogJ1N3aXRjaCcsCiAgICAgICAgICAgICdjYXNlcyc6IHNlbGYuc2VyaWFsaXplKCksCiAgICAgICAgfQoKICAgIGRlZiBfX3JlcHJfXyhzZWxmKToKICAgICAgICByZXR1cm4ganNvbi5kdW1wcyhzZWxmLnRvX2pzb24oKSkKCgpjbGFzcyBTd2l0Y2hPblZhbHVlOgogICAgIiIiCiAgICBkb24ndCBuZWVkIHRvIHdhaXQgcmVzdWx0CiAgICAiIiIKCiAgICBkZWYgX19pbml0X18oc2VsZiwgdmFsdWUpOgogICAgICAgIHNlbGYudmFsdWUgPSB2YWx1ZQoKICAgIGRlZiBfX3JlcHJfXyhzZWxmKToKICAgICAgICByZXR1cm4gJ1N3aXRjaE9uVmFsdWUoe30pJy5mb3JtYXQoc2VsZi52YWx1ZSkKCgpjbGFzcyBGb3JraW5nU3Rv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zZXMuaXRlbXMoKToKICAgICAgICAgICAgaWYgdmFsaWRhdG9yLnZhbGlkYXRlKG1lc3NhZ2UpOgogICAgICAgICAgICAgICAgcmV0dXJuIGNhc2VfaWQKICAgICAgICByZXR1cm4gTm9uZQoKICAgIGRlZiBzZXJpYWxpemUoc2VsZik6CiAgICAgICAgcmV0dXJuIFt7CiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsCiAgICAgICAgICAgICAgICAgICAgJ2RhdGEnOiBtYXRjaGVycy5zZXJpYWxpemUoYyksCiAgICAgICAgICAgICAgICB9IGZvciBpZCwgYyBpbiBzZWxmLmNhc2VzLml0ZW1zKCldCgogICAgQHN0YXRpY21ldGhvZAogICAgZGVmIGRlc2VyaWFsaXplKGRhdGEpOgogICAgICAgIHJldHVybiBTd2l0Y2goWyhjYXNlWydpZCddLCBtYXRjaGVycy5kZXNlcmlhbGl6ZShjYXNlWydkYXRhJ10pKQogICAgICAgICAgICAgICAgICAgICAgIGZvciBjYXNlIGluIGRhdGFdKQoKICAgIGRlZiB0b19qc29uKHNlbGYpOgogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICd0eXBlJzogJ1N3aXRjaCcsCiAgICAgICAgICAgICdjYXNlcyc6IHNlbGYuc2VyaWFsaXplKCksCiAgICAgICAgfQoKICAgIGRlZiBfX3JlcHJfXyhzZWxmKToKICAgICAgICByZXR1cm4ganNvbi5kdW1wcyhzZWxmLnRvX2pzb24oKSkKCgpjbGFzcyBTd2l0Y2hPblZhbHVlOgogICAgIiIiCiAgICBkb24ndCBuZWVkIHRvIHdhaXQgcmVzdWx0CiAgICAiIiIKCiAgICBkZWYgX19pbml0X18oc2VsZiwgdmFsdWUpOgogICAgICAgIHNlbGYudmFsdWUgPSB2YWx1ZQoKICAgIGRlZiBfX3JlcHJfXyhzZWxmKToKICAgICAgICByZXR1cm4gJ1N3aXRjaE9uVmFsdWUoe30pJy5mb3JtYXQoc2VsZi52YWx1ZSkKCgpjbGFzcyBGb3JraW5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3Jlc3VsdCkpCiAgICAgICAgICAgIGxvZ2dlci5kZWJ1ZygnIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjJykKICAgICAgICAgICAgcmV0dXJuIE5vbmUKCiAgICAgICAgcmV0dXJuIGNhc2Vfc3Rvcmllc1swXQoKICAgIGRlZiB0b19qc29uKHNlbGYpOgogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICd0eXBlJzogJ1N0b3J5UGFydEZvcmsnLAogICAgICAgICAgICAnY2hpbGRyZW4nOiBzZWxmLmxvY2FsX3Njb3BlLnRvX2pzb24oKSwKICAgICAgICB9CgogICAgZGVmIF9fcmVwcl9fKHNlbGYpOgogICAgICAgIHJldHVybiBqc29uLmR1bXBzKHNlbGYudG9fanNvbigpKQoKCkBtYXRjaGVycy5tYXRjaGVyKCkKY2xhc3MgU3dpdGNoOgogICAgZGVmIF9faW5pdF9fKHNlbGYsIGNhc2VzKToKICAgICAgICBhc3NlcnQgaXNpbnN0YW5jZShjYXNlcywgbGlzdCkKICAgICAgICBhc3NlcnQgYWxsKGlzaW5zdGFuY2UoaSwgdHVwbGUpIGZvciBpIGluIGNhc2VzKQogICAgICAgIHNlbGYuY2FzZXMgPSBPcmRlcmVkRGljdChjYXNlcykKCiAgICBkZWYgdmFsaWRhdGUoc2VsZiwgbWVzc2FnZSk6CiAgICAgICAgZm9yIGNhc2VfaWQsIHZhbGlkYXRvciBpbiBzZWxmLmNhc2VzLml0ZW1zKCk6CiAgICAgICAgICAgIGlmIHZhbGlkYXRvci52YWxpZGF0ZShtZXNzYWdlKToKICAgICAgICAgICAgICAgIHJldHVybiBjYXNlX2lkCiAgICAgICAgcmV0dXJuIE5vbmUKCiAgICBkZWYgc2VyaWFsaXplKHNlbGYpOgogICAgICAgIHJldHVybiBbewogICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLAogICAgICAgICAgICAgICAgICAgICdkYXRhJzogbWF0Y2hlcnMuc2VyaWFsaXplKGMpLAogICAgICAgICAgICAgICAgfSBmb3IgaWQsIGMgaW4gc2VsZi5jYXNlcy5pdGVtcygpXQoKICAgIEBzdGF0aWNtZXRob2QKICAgIGRlZiBkZXNlcmlhbGl6ZShkYXRhKToKICAgICAgICByZXR1cm4gU3dpdGNoKFsoY2FzZVsnaWQnXSwgbWF0Y2hlcnMuZGVzZXJpYWxpemUoY2FzZVsnZGF0YSddKSkKICAgICAgICAgICAgICAgICAgICAgICBmb3IgY2FzZSBpbiBkYXRhXSkKCiAgICBkZWYgdG9fanNvbihzZWxmKToKICAgICAgICByZXR1cm4gewogICAgICAgICAgICAndHlwZSc6ICdTd2l0Y2gnLAogICAgICAgICAgICAnY2FzZXMnOiBzZWxmLnNlcmlhbGl6ZSgpLAogICAgICAgIH0KCiAgICBkZWYgX19yZXByX18oc2VsZik6CiAgICAgICAgcmV0dXJuIGpzb24uZHVtcHMoc2VsZi50b19qc29uKCkpCgoKY2xhc3MgU3dpdGNoT25WYWx1ZToKICAgICIiIgogICAgZG9uJ3QgbmVlZCB0byB3YWl0IHJlc3VsdAogICAgIiIiCgogICAgZGVmIF9faW5pdF9fKHNlbGYsIHZhbHVlKToKICAgICAgICBzZWxmLnZhbHVlID0gdmFsdWUKCiAgICBkZWYgX19yZXByX18oc2VsZik6CiAgICAgICAgcmV0dXJuICdTd2l0Y2hPblZhbHVlKHt9KScuZm9ybWF0KHNlbGYudmFsdWUpCgoKY2xhc3MgRm9ya2luZ1N0b3JpZXNBUEk6CiAgICBkZWYgX19pbml0X18oc2VsZiwgcGFyc2VyX2luc3RhbmNlKToKICAgICAgICBzZWxmLnBhcnNlcl9pbnN0YW5jZSA9IHBhcnNlcl9pbnN0YW5jZQoKICAgIGRlZiBjYXNlKHNlbGYsCiAgICAgICAgICAgICB2YWx1ZT1VbmRlZmluZWQsCiAgICAgICAgICAgICB2YWxpZGF0b3I9VW5kZWZpbmVkLAogICAgICAgICAgICAgZGVmYXVsdD1VbmRlZmluZWQsCiAgICAgICAgICA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nlQYXJ0Rm9yaycsCiAgICAgICAgICAgICdjaGlsZHJlbic6IHNlbGYubG9jYWxfc2NvcGUudG9fanNvbigpLAogICAgICAgIH0KCiAgICBkZWYgX19yZXByX18oc2VsZik6CiAgICAgICAgcmV0dXJuIGpzb24uZHVtcHMoc2VsZi50b19qc29uKCkpCgoKQG1hdGNoZXJzLm1hdGNoZXIoKQpjbGFzcyBTd2l0Y2g6CiAgICBkZWYgX19pbml0X18oc2VsZiwgY2FzZXMpOgogICAgICAgIGFzc2VydCBpc2luc3RhbmNlKGNhc2VzLCBsaXN0KQogICAgICAgIGFzc2VydCBhbGwoaXNpbnN0YW5jZShpLCB0dXBsZSkgZm9yIGkgaW4gY2FzZXMpCiAgICAgICAgc2VsZi5jYXNlcyA9IE9yZGVyZWREaWN0KGNhc2VzKQoKICAgIGRlZiB2YWxpZGF0ZShzZWxmLCBtZXNzYWdlKToKICAgICAgICBmb3IgY2FzZV9pZCwgdmFsaWRhdG9yIGluIHNlbGYuY2FzZXMuaXRlbXMoKToKICAgICAgICAgICAgaWYgdmFsaWRhdG9yLnZhbGlkYXRlKG1lc3NhZ2UpOgogICAgICAgICAgICAgICAgcmV0dXJuIGNhc2VfaWQKICAgICAgICByZXR1cm4gTm9uZQoKICAgIGRlZiBzZXJpYWxpemUoc2VsZik6CiAgICAgICAgcmV0dXJuIFt7CiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsCiAgICAgICAgICAgICAgICAgICAgJ2RhdGEnOiBtYXRjaGVycy5zZXJpYWxpemUoYyksCiAgICAgICAgICAgICAgICB9IGZvciBpZCwgYyBpbiBzZWxmLmNhc2VzLml0ZW1zKCldCgogICAgQHN0YXRpY21ldGhvZAogICAgZGVmIGRlc2VyaWFsaXplKGRhdGEpOgogICAgICAgIHJldHVybiBTd2l0Y2goWyhjYXNlWydpZCddLCBtYXRjaGVycy5kZXNlcmlhbGl6ZShjYXNlWydkYXRhJ10pKQogICAgICAgICAgICAgICAgICAgICAgIGZvciBjY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biAhPSBzZWxmLnBvc2l0aW9uOgogICAgICAgICAgICBzZWxmLmJsZW5kc1tuYW1lXSA9IHBvc2l0aW9uLCBub3JtYWwKCiAgICBkZWYgcGFyc2Uoc2VsZiwgdmVydGV4X2lkOiBpbnQsIHV2X2lkOiBpbnQsIHNjYWxlOiBmbG9hdCkgLT4gZXQuRWxlbWVudDoKICAgICAgICAiIiIKCiAgICAgICAgQXJnczoKICAgICAgICAgICAgdmVydGV4X2lkICgpOgogICAgICAgICAgICB1dl9pZCAoKToKICAgICAgICAgICAgc2NhbGUgKCk6CgogICAgICAgIFJldHVybnM6CiAgICAgICAgICAgIEFuIHhtbCBlbGVtZW50IHJlcHJlc2VudGluZyBhbiB4bWYgPFZFUlRFWD4gdGFnLgoKICAgICAgICAiIiIKICAgICAgICB0YWcgPSBldC5FbGVtZW50KCd2ZXJ0ZXgnKQogICAgICAgIHRhZy5hdHRyaWJbJ251bWluZmx1ZW5jZXMnXSA9IHN0cihsZW4oc2VsZi5pbmZsdWVuY2VzKSkKICAgICAgICB0YWcuYXR0cmliWydpZCddID0gc3RyKHZlcnRleF9pZCkKCiAgICAgICAgeHBvc24gPSBldC5FbGVtZW50KCdwb3MnKQogICAgICAgIHhub3JtID0gZXQuRWxlbWVudCgnbm9ybScpCiAgICAgICAgeGNvbCA9IGV0LkVsZW1lbnQoJ2NvbG9yJykKICAgICAgICB4dXYgPSBldC5FbGVtZW50KCd0ZXhjb29yZCcpCgogICAgICAgIHhwb3NuLnRleHQgPSAnICcuam9pbihbKHN0cihwICogc2NhbGUpKSBmb3IgcCBpbiBzZWxmLnBvc2l0aW9uXSkKICAgICAgICB4bm9ybS50ZXh0ID0gJyAnLmpvaW4oWyhzdHIobikpIGZvciBuIGluIHNlbGYubm9ybWFsXSkKICAgICAgICB4Y29sLnRleHQgPSAnICcuam9pbihbKHN0cihjKSkgZm9yIGMgaW4gc2VsZi5jb2xvcl0pCiAgICAgICAgeHV2LnRleHQgPSBmJ3tzZWxmLnV2W3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zdHIsIHBvc2l0aW9uOiBJdGVyYWJsZVtmbG9hdF0sIG5vcm1hbDogSXRlcmFibGVbZmxvYXRdKToKICAgICAgICBpZiBwb3NpdGlvbiAhPSBzZWxmLnBvc2l0aW9uOgogICAgICAgICAgICBzZWxmLmJsZW5kc1tuYW1lXSA9IHBvc2l0aW9uLCBub3JtYWwKCiAgICBkZWYgcGFyc2Uoc2VsZiwgdmVydGV4X2lkOiBpbnQsIHV2X2lkOiBpbnQsIHNjYWxlOiBmbG9hdCkgLT4gZXQuRWxlbWVudDoKICAgICAgICAiIiIKCiAgICAgICAgQXJnczoKICAgICAgICAgICAgdmVydGV4X2lkICgpOgogICAgICAgICAgICB1dl9pZCAoKToKICAgICAgICAgICAgc2NhbGUgKCk6CgogICAgICAgIFJldHVybnM6CiAgICAgICAgICAgIEFuIHhtbCBlbGVtZW50IHJlcHJlc2VudGluZyBhbiB4bWYgPFZFUlRFWD4gdGFnLgoKICAgICAgICAiIiIKICAgICAgICB0YWcgPSBldC5FbGVtZW50KCd2ZXJ0ZXgnKQogICAgICAgIHRhZy5hdHRyaWJbJ251bWluZmx1ZW5jZXMnXSA9IHN0cihsZW4oc2VsZi5pbmZsdWVuY2VzKSkKICAgICAgICB0YWcuYXR0cmliWydpZCddID0gc3RyKHZlcnRleF9pZCkKCiAgICAgICAgeHBvc24gPSBldC5FbGVtZW50KCdwb3MnKQogICAgICAgIHhub3JtID0gZXQuRWxlbWVudCgnbm9ybScpCiAgICAgICAgeGNvbCA9IGV0LkVsZW1lbnQoJ2NvbG9yJykKICAgICAgICB4dXYgPSBldC5FbGVtZW50KCd0ZXhjb29yZCcpCgogICAgICAgIHhwb3NuLnRleHQgPSAnICcuam9pbihbKHN0cihwICogc2NhbGUpKSBmb3IgcCBpbiBzZWxmLnBvc2l0aW9uXSkKICAgICAgICB4bm9ybS50ZXh0ID0gJyAnLmpvaW4oWyhzdHIobikpIGZvciBuIGluIHNlbGYubm9ybWFsXSkKICAgICAgICB4Y29sLnRle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RFWD4gdGFnLgoKICAgICAgICAiIiIKICAgICAgICB0YWcgPSBldC5FbGVtZW50KCd2ZXJ0ZXgnKQogICAgICAgIHRhZy5hdHRyaWJbJ251bWluZmx1ZW5jZXMnXSA9IHN0cihsZW4oc2VsZi5pbmZsdWVuY2VzKSkKICAgICAgICB0YWcuYXR0cmliWydpZCddID0gc3RyKHZlcnRleF9pZCkKCiAgICAgICAgeHBvc24gPSBldC5FbGVtZW50KCdwb3MnKQogICAgICAgIHhub3JtID0gZXQuRWxlbWVudCgnbm9ybScpCiAgICAgICAgeGNvbCA9IGV0LkVsZW1lbnQoJ2NvbG9yJykKICAgICAgICB4dXYgPSBldC5FbGVtZW50KCd0ZXhjb29yZCcpCgo8fGZpbV9ob2xlfD4KICAgICAgICAjIHh1di50ZXh0ID0gc3RyKHNlbGYudXZbdXZfaWRdWzBdKSArICcgJyArIHN0cihhYnMoMSAtIHNlbGYudXZbdXZfaWRdWzFdKSkKICAgICAgICB0YWcuYXBwZW5kKHhwb3NuKQogICAgICAgIHRhZy5hcHBlbmQoeG5vcm0pCiAgICAgICAgdGFnLmFwcGVuZCh4Y29sKQogICAgICAgIHRhZy5hcHBlbmQoeHV2KQoKICAgICAgICBmb3IgYm9uZSwgaW5mbCBpbiBzZWxmLmluZmx1ZW5jZXMuaXRlbXMoKToKICAgICAgICAgICAgeGluZiA9IGV0LkVsZW1lbnQoJ2luZmx1ZW5jZScpCiAgICAgICAgICAgIHhpbmYuYXR0cmliWydpZCddID0gYm9uZQogICAgICAgICAgICB4aW5mLnRleHQgPSBzdHIoaW5mbCkKICAgICAgICAgICAgdGFnLmFwcGVuZCh4aW5mKQoKICAgICAgICByZXR1cm4gdGFnCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgeHBvc24udGV4dCA9ICcgJy5qb2luKFsoc3RyKHAgKiBzY2FsZSkpIGZvciBwIGluIHNlbGYucG9zaXRpb25dKQogICAgICAgIHhub3JtLnRleHQgPSAnICcuam9pbihbKHN0cihuKSk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fafd166bdb916679b582b95bb-3
5945ecbc52c282bfafd166bdb916679b582b95bb
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGRhdGV0aW1lCmltcG9ydCB1dWlkCgpmcm9tIGF1dGguZG9tYWluLmFjdGl2YXRpb24gaW1wb3J0IEFjdGl2YXRpb24KZnJvbSBhdXRoLmRvbWFpbi51c2VyIGltcG9ydCBVc2VyCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSBhdXRoLnNldHRpbmdzIGltcG9ydCBBQ1RJVkFUSU9OX0VYUElSRV9USU1FCgoKZGVmIHRlc3RfdXNlcl9pZCgpOgo8fGZpbV9lbmR8Pg==
5945ecbc52c282bfafd166bdb916679b582b95bb-4
5945ecbc52c282bfafd166bdb916679b582b95bb
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGRhdGV0aW1lCmltcG9ydCB1dWlkCgpmcm9tIGF1dGguZG9tYWluLmFjdGl2YXRpb24gaW1wb3J0IEFjdGl2YXRpb24KZnJvbSBhdXRoLmRvbWFpbi51c2VyIGltcG9ydCBVc2VyCmZyb20gYXV0aC5zZXR0aW5ncyBpbXBvcnQgQUNUSVZBVElPTl9FWFBJUkVfVElNRQoKCmRlZiB0ZXN0X3VzZXJfaWQoKToKICAgIGVtYWlsID0gJ2Zvby5iYXJAZW1haWwuY29tJwogICAgdXNlciA9IFVzZXIoaWQ9dXVpZC51dWlkNCgpLCBmdWxsX25hbWU9J0ZvbyBCYXInLCBlbWFpbD1lbWFpbCwgcGFzc3dvcmQ9J2Etc2VjcmV0JykKCiAgICBhY3RpdmF0aW9uID0gQWN0aXZhdGlvbih1c2VyPXVzZXIpCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KCiAgICBhc3NlcnQgYWN0aXZhdGlvbi51c2VyX2lkID09IHVzZXIuaWQKCgo8fGZpbV9lbmR8Pg==
592162a57582fe2f019726bf24e19632ff2a64c4-1
592162a57582fe2f019726bf24e19632ff2a64c4
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZGVmIHZhbXBpcmVfdGVzdCh4LCB5KToKCQo8fGZpbV9lbmR8Pg==
592162a57582fe2f019726bf24e19632ff2a64c4-2
592162a57582fe2f019726bf24e19632ff2a64c4
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZGVmIHZhbXBpcmVfdGVzdCh4LCB5KToKCQo8fGZpbV9lbmR8Pg==
59a4034089e96ebc6d77d057109f4e269c40f8b9-1
59a4034089e96ebc6d77d057109f4e269c40f8b9
PHxmaW1fcHJlZml4fD4KIy0qLWNvZGluZzp1dGY4Oy0qLQo8fGZpbV9ob2xlfD4KbGlzdGEgPSBub21lLnNwbGl0KCkKcHJpbnQoJ1xuJykKcHJpbnQoJ1N1YSBjaWRhZGUgY29tZcOnYSBjb20gIlNBTlRPIjoge30nLmZvcm1hdCgnc2FudG8nIGluIGxpc3RhWzBdKSkKPHxmaW1fc3VmZml4fD4KI3FweTpjb25zb2xlCgpwcmludCgnXG4nKQpub21lID0gc3RyKGlucHV0KCdESUdJVEUgTyBOT01FIERBIFNVQSBDSURBREU6ICcpKS5sb3dlcigpLnN0cmlwKCkKPHxmaW1fZW5kfD4=
59a4034089e96ebc6d77d057109f4e269c40f8b9-2
59a4034089e96ebc6d77d057109f4e269c40f8b9
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KIy0qLWNvZGluZzp1dGY4Oy0qLQojcXB5OmNvbnNvbGUKCnByaW50KCdcbicpCjx8ZmltX2VuZHw+
59a4034089e96ebc6d77d057109f4e269c40f8b9-3
59a4034089e96ebc6d77d057109f4e269c40f8b9
PHxmaW1fcHJlZml4fD4KIy0qLWNvZGluZzp1dGY4Oy0qLQojcXB5OmNvbnNvbGUKCnByaW50KCdcbicpCm5vbWUgPSBzdHIoaW5wdXQoJ0RJR0lURSBPIE5PTU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gICAgICAgICAgICAgYXNzZXJ0IGxlbihwcm9jZXNzZWRfcGFyYWdyYXBoX3NlbnRlbmNlcykgPT0gb3JpZ2luYWxfc2VudGVuY2VzX2NvdW50CgogICAgICAgICAgICAgICAgICAgIGZvciBxdWVzdGlvbiBpbiBxdWVzdGlvbnM6CiAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXN0aW9uX2lkeCA9IHF1ZXN0aW9uWyJpZHgiXQogICAgICAgICAgICAgICAgICAgICAgICBxdWVzdGlvbl90ZXh0ID0gcXVlc3Rpb25bInF1ZXN0aW9uIl0KICAgICAgICAgICAgICAgICAgICAgICAgYW5zd2VycyA9IHF1ZXN0aW9uWyJhbnN3ZXJzIl0KICAgICAgICAgICAgICAgICAgICAgICAgbXVsdGlzZW50ID0gcXVlc3Rpb25bIm11bHRpc2VudCJdCiAgICAgICAgICAgICAgICAgICAgICAgIHJlbGV2YW50X3NlbnRlbmNlX2lkeHMgPSBxdWVzdGlvblsic2VudGVuY2VzX3VzZWQiXQoKICAgICAgICAgICAgICAgICAgICAgICAgaW1wbGljaXRfaHlwb3RoZXNpcyA9IHF1ZXN0aW9uX3RvX2ltcGxpY2l0X2h5cG90aGVzaXMocXVlc3Rpb25fdGV4dCkKCiAgICAgICAgICAgICAgICAgICAgICAgIGV4cGxpY2l0X2h5cG90aGVzZXMgPSBbXQogICAgICAgICAgICAgICAgICAgICAgICBlbnRhaWxtZW50cyA9IFtdCiAgICAgICAgICAgICAgICAgICAgICAgIGZvciBhbnN3ZXIgaW4gYW5zd2VyczoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuc3dlcl90ZXh0ID0gYW5zd2VyWyJ0ZXh0Il0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4cGxpY2l0X2h5cG90aGVzaXMgPSBxdWVzdGlvbl9hbnN3ZXJfdG9fZXhwbGljaXRfaHlwb3RoZXNpcyhxdWVzdGlvbl90ZXh0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuc3dlcl90ZXh0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltcGxpY2l0X2h5cG90aGVzaXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHJ1ZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudGFpbG1lbnQgPSBhbnN3ZXJbImlzQW5zd2VyIl0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4cGxpY2l0X2h5cG90aGVzZXMuYXBwZW5kKGV4cGxpY2l0X2h5cG90aGVzaXMpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnRhaWxtZW50cy5hcHBlbmQoZW50YWlsbWVudCkKCiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfZGljdCA9IHsicGFyYWdyYXBoX2lkIjogcGFyYWdyYXBoX2lkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInByZW1pc2VzIjogcHJvY2Vzc2VkX3BhcmFncmFwaF9zZW50ZW5jZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicmF3X3F1ZXN0aW9uIjogcXVlc3Rpb25fdGV4dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyZWxldmFudF9zZW50ZW5jZV9pZHhzIjogcmVsZXZhbnRfc2VudGVuY2VfaWR4cywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJxdWVzdGlvbl9pZHgiOiBxdWVzdGlvbl9pZHgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibXVsdGlzZW50IjogbXVsdGlzZW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImh5cG90aGVzZXMiOiBleHBsaWNpdF9oeXBvdGhlc2VzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImVudGFpbG1lbnRzIjogZW50YWlsbWVudHN9CgogICAgICAgICAgICAgICAgICAgICAgICB3cml0ZV9maWxlLndyaXRlKGpzb24uZHVtcHMoZGF0YV9kaWN0KSArICJcbiIpCjx8ZmltX3N1ZmZpeHw+CgogICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsX3NlbnRlbmNlc19jb3VudCA9IGxlbihyZS5maW5kYWxsKHInPGI+U2VudCBcZCs6ICo8XC9iPiguKz8pPGJyPicsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYWdyYXBoX3RleHQuc3RyaXAoKSkpCiAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc2VkX3BhcmFncmFwaF9zZW50ZW5jZXMgPSBjb3JlZl9yZXBsYWNlKHBhcmFncmFwaF90ZXh0KQo8fGZpbV9lbmR8Pg==
bbd70d142bc73d2d8f0c2b8feb1104e7cdcfe35a-2
bbd70d142bc73d2d8f0c2b8feb1104e7cdcfe35a
PHxmaW1fcHJlZml4fD4KIiIiClJlYWRzIHJhdyBtdWx0aXJjIGRhdGEgZHVtcHMgaW4gZm9sbG93aW5nIGpzb25sIGZvcm1hdDoKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgoKICAgIHsKICAgICAgICAicGFyYWdyYXBoX2lkIjogLi4uLAogICAgICAgICJxdWVzdGlvbl9pZHgiOiAuLi4sCjx8ZmltX2VuZHw+
bbd70d142bc73d2d8f0c2b8feb1104e7cdcfe35a-3
bbd70d142bc73d2d8f0c2b8feb1104e7cdcfe35a
PHxmaW1fcHJlZml4fD4KIiIiClJlYWRzIHJhdyBtdWx0aXJjIGRhdGEgZHVtcHMgaW4gZm9sbG93aW5nIGpzb25sIGZvcm1hdDoKCiAg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aFsicXVlc3Rpb25zIl0KCiAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWxfc2VudGVuY2VzX2NvdW50ID0gbGVuKHJlLmZpbmRhbGwocic8Yj5TZW50IFxkKzogKjxcL2I+KC4rPyk8YnI+JywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhZ3JhcGhfdGV4dC5zdHJpcCgpKSkKICAgICAgICAgICAgICAgICAgICBwcm9jZXNzZWRfcGFyYWdyYXBoX3NlbnRlbmNlcyA9IGNvcmVmX3JlcGxhY2UocGFyYWdyYXBoX3RleHQpCgogICAgICAgICAgICAgICAgICAgICMgU2VudGVuY2UgYm91bmRhcmllcyBtdXN0IGJlIG1haW50YWluZWQuCiAgICAgICAgICAgICAgICAgICAgYXNzZXJ0IGxlbihwcm9jZXNzZWRfcGFyYWdyYXBoX3NlbnRlbmNlcykgPT0gb3JpZ2luYWxfc2VudGVuY2VzX2NvdW50CgogICAgICAgICAgICAgICAgICAgIGZvciBxdWVzdGlvbiBpbiBxdWVzdGlvbnM6CiAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXN0aW9uX2lkeCA9IHF1ZXN0aW9uWyJpZHgiXQogICAgICAgICAgICAgICAgICAgICAgICBxdWVzdGlvbl90ZXh0ID0gcXVlc3Rpb25bInF1ZXN0aW9uIl0KICAgICAgICAgICAgICAgICAgICAgICAgYW5zd2VycyA9IHF1ZXN0aW9uWyJhbnN3ZXJzIl0KICAgICAgICAgICAgICAgICAgICAgICAgbXVsdGlzZW50ID0gcXVlc3Rpb25bIm11bHRpc2VudCJdCiAgICAgICAgICAgICAgICAgICAgICAgIHJlbGV2YW50X3NlbnRlbmNlX2lkeHMgPSBxdWVzdGlvblsic2VudGVuY2VzX3VzZWQiXQoKICAgICAgICAgICAgICAgICAgICAgICAgaW1wbGljaXRfaHlwb3RoZXNpcyA9IHF1ZXN0aW9uX3RvX2ltcGxpY2l0X2h5cG90aGVzaXMocXVlc3Rpb25fdGV4dCkKCiAgICAgICAgICAgICAgICAgICAgICAgIGV4cGxpY2l0X2h5cG90aGVzZXMgPSBbXQogICAgICAgICAgICAgICAgICAgICAgICBlbnRhaWxtZW50cyA9IFtdCiAgICAgICAgICAgICAgICAgICAgICAgIGZvciBhbnN3ZXIgaW4gYW5zd2VyczoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuc3dlcl90ZXh0ID0gYW5zd2VyWyJ0ZXh0Il0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4cGxpY2l0X2h5cG90aGVzaXMgPSBxdWVzdGlvbl9hbnN3ZXJfdG9fZXhwbGljaXRfaHlwb3RoZXNpcyhxdWVzdGlvbl90ZXh0LAo8fGZpbV9ob2xlfD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudGFpbG1lbnQgPSBhbnN3ZXJbImlzQW5zd2VyIl0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4cGxpY2l0X2h5cG90aGVzZXMuYXBwZW5kKGV4cGxpY2l0X2h5cG90aGVzaXMpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnRhaWxtZW50cy5hcHBlbmQoZW50YWlsbWVudCkKCiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfZGljdCA9IHsicGFyYWdyYXBoX2lkIjogcGFyYWdyYXBoX2lkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInByZW1pc2VzIjogcHJvY2Vzc2VkX3BhcmFncmFwaF9zZW50ZW5jZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicmF3X3F1ZXN0aW9uIjogcXVlc3Rpb25fdGV4dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyZWxldmFudF9zZW50ZW5jZV9pZHhzIjogcmVsZXZhbnRfc2VudGVuY2VfaWR4cywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJxdWVzdGlvbl9pZHgiOiBxdWVzdGlvbl9pZHgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibXVsdGlzZW50IjogbXVsdGlzZW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImh5cG90aGVzZXMiOiBleHBsaWNpdF9oeXBvdGhlc2VzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImVudGFpbG1lbnRzIjogZW50YWlsbWVudHN9CgogICAgICAgICAgICAgICAgICAgICAgICB3cml0ZV9maWxlLndyaXRlKGpzb24uZHVtcHMoZGF0YV9kaWN0KSArICJcbiIpCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5zd2VyX3RleHQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1wbGljaXRfaHlwb3RoZXNpcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUcnVlKQo8fGZpbV9lbmR8Pg==
bbd70d142bc73d2d8f0c2b8feb1104e7cdcfe35a-4
bbd70d142bc73d2d8f0c2b8feb1104e7cdcfe35a
PHxmaW1fcHJlZml4fD4KIiIiClJlYWRzIHJhdyBtdWx0aXJjIGRhdGEgZHVtcHMgaW4gZm9sbG93aW5nIGpzb25sIGZvcm1hdDoKCiAgICB7CiAgICAgICAgInBhcmFncmFwaF9pZCI6IC4uLiwKICAgICAgICAicXVlc3Rpb25faWR4IjogLi4uLAogICAgICAgICJyYXdfcXVlc3Rpb24iOiAiLi4uIgogICAgICAgICJwcmVtaXNlcyI6IFsiLi4uIiwgIi4uLiIsICIuLi4iXQogICAgICAgICJyZWxldmFudF9zZW50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F0YS9wcmVwcm9jZXNzZWQvbXVsdGlyYy9tdWx0aXJjLXtzZXRfbmFtZX0tcHJvY2Vzc2VkLXF1ZXN0aW9ucy5qc29ubCIKICAgICAgICAKICAgICAgICB0YXJnZXRfZGlyID0gb3MucGF0aC5kaXJuYW1lKHF1ZXN0aW9uX2RhdGFzZXRfcGF0aCkKICAgICAgICBpZiBub3Qgb3MucGF0aC5leGlzdHModGFyZ2V0X2Rpcik6CiAgICAgICAgICAgIG9zLm1ha2VkaXJzKHRhcmdldF9kaXIpCgogICAgICAgIHdpdGggb3BlbihxdWVzdGlvbl9kYXRhc2V0X3BhdGgsICJ3IikgYXMgd3JpdGVfZmlsZToKICAgICAgICAgICAgd2l0aCBvcGVuKGRhdGFzZXRfcGF0aCwgInIiKSBhcyByZWFkX2ZpbGU6CiAgICAgICAgICAgICAgICBkYXRhc2V0ID0ganNvbi5sb2FkKHJlYWRfZmlsZSkKICAgICAgICAgICAgICAgIHBhcmFncmFwaHMgPSBkYXRhc2V0WyJkYXRhIl0KCiAgICAgICAgICAgICAgICBmb3IgcGFyYWdyYXBoIGluIHRxZG0ocGFyYWdyYXBocyk6CiAgICAgICAgICAgICAgICAgICAgcGFyYWdyYXBoX2lkID0gcGFyYWdyYXBoWyJpZCJdCgogICAgICAgICAgICAgICAgICAgIHBhcmFncmFwaCA9IHBhcmFncmFwaFsicGFyYWdyYXBoIl0KICAgICAgICAgICAgICAgICAgICBwYXJhZ3JhcGhfdGV4dCA9IGZpeF90ZXh0KHBhcmFncmFwaFsidGV4dCJdKQogICAgICAgICAgICAgICAgICAgIHF1ZXN0aW9ucyA9IHBhcmFncmFwaFsicXVlc3Rpb25zIl0KCiAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWxfc2VudGVuY2VzX2NvdW50ID0gbGVuKHJlLmZpbmRhbGwocic8Yj5TZW50IFxkKzogKjxcL2I+KC4rPyk8YnI+JywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhZ3JhcGhfdGV4dC5zdHJpcCgpKSkKICAgICAgICAgICAgICAgICAgICBwcm9jZXNzZWRfcGFyYWdyYXBoX3NlbnRlbmNlcyA9IGNvcmVmX3JlcGxhY2UocGFyYWdyYXBoX3RleHQpCgo8fGZpbV9ob2xlfD4KICAgICAgICAgICAgICAgICAgICAgICAgcXVlc3Rpb25faWR4ID0gcXVlc3Rpb25bImlkeCJdCiAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXN0aW9uX3RleHQgPSBxdWVzdGlvblsicXVlc3Rpb24iXQogICAgICAgICAgICAgICAgICAgICAgICBhbnN3ZXJzID0gcXVlc3Rpb25bImFuc3dlcnMiXQogICAgICAgICAgICAgICAgICAgICAgICBtdWx0aXNlbnQgPSBxdWVzdGlvblsibXVsdGlzZW50Il0KICAgICAgICAgICAgICAgICAgICAgICAgcmVsZXZhbnRfc2VudGVuY2VfaWR4cyA9IHF1ZXN0aW9uWyJzZW50ZW5jZXNfdXNlZCJdCgogICAgICAgICAgICAgICAgICAgICAgICBpbXBsaWNpdF9oeXBvdGhlc2lzID0gcXVlc3Rpb25fdG9faW1wbGljaXRfaHlwb3RoZXNpcyhxdWVzdGlvbl90ZXh0KQoKICAgICAgICAgICAgICAgICAgICAgICAgZXhwbGljaXRfaHlwb3RoZXNlcyA9IFtdCiAgICAgICAgICAgICAgICAgICAgICAgIGVudGFpbG1lbnRzID0gW10KICAgICAgICAgICAgICAgICAgICAgICAgZm9yIGFuc3dlciBpbiBhbnN3ZXJzOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5zd2VyX3RleHQgPSBhbnN3ZXJbInRleHQiXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhwbGljaXRfaHlwb3RoZXNpcyA9IHF1ZXN0aW9uX2Fuc3dlcl90b19leHBsaWNpdF9oeXBvdGhlc2lzKHF1ZXN0aW9uX3RleHQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5zd2VyX3RleHQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1wbGljaXRfaHlwb3RoZXNpcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUcnVlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZW50YWlsbWVudCA9IGFuc3dlclsiaXNBbnN3ZXIiXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhwbGljaXRfaHlwb3RoZXNlcy5hcHBlbmQoZXhwbGljaXRfaHlwb3RoZXNpcykKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudGFpbG1lbnRzLmFwcGVuZChlbnRhaWxtZW50KQoKICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9kaWN0ID0geyJwYXJhZ3JhcGhfaWQiOiBwYXJhZ3JhcGhfaWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicHJlbWlzZXMiOiBwcm9jZXNzZWRfcGFyYWdyYXBoX3NlbnRlbmNlcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyYXdfcXVlc3Rpb24iOiBxdWVzdGlvbl90ZXh0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInJlbGV2YW50X3NlbnRlbmNlX2lkeHMiOiByZWxldmFudF9zZW50ZW5jZV9pZHhzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInF1ZXN0aW9uX2lkeCI6IHF1ZXN0aW9uX2lkeCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJtdWx0aXNlbnQiOiBtdWx0aXNlbnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaHlwb3RoZXNlcyI6IGV4cGxpY2l0X2h5cG90aGVzZXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZW50YWlsbWVudHMiOiBlbnRhaWxtZW50c30KCiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlX2ZpbGUud3JpdGUoanNvbi5kdW1wcyhkYXRhX2RpY3QpICsgIlxuIikKPHxmaW1fc3VmZml4fD4KICAgICAgICAgICAgICAgICAgICAjIFNlbnRlbmNlIGJvdW5kYXJpZXMgbXVzdCBiZSBtYWludGFpbmVkLgogICAgICAgICAgICAgICAgICAgIGFzc2VydCBsZW4ocHJvY2Vzc2VkX3BhcmFncmFwaF9zZW50ZW5jZXMpID09IG9yaWdpbmFsX3NlbnRlbmNlc19jb3VudAoKICAgICAgICAgICAgICAgICAgICBmb3IgcXVlc3Rpb24gaW4gcXVlc3Rpb25zOgo8fGZpbV9lbmR8Pg==
bbd70d142bc73d2d8f0c2b8feb1104e7cdcfe35a-5
bbd70d142bc73d2d8f0c2b8feb1104e7cdcfe35a
PHxmaW1fcHJlZml4fD4KIiIiClJlYWRzIHJhdyBtdWx0aXJjIGRhdGEgZHVtcHMgaW4gZm9sbG93aW5nIGpzb25sIGZvcm1hdDoKCiAgICB7CiAgICAgICAgInBhcmFncmFwaF9pZCI6IC4uLiwKICAgICAgICAicXVlc3Rpb25faWR4IjogLi4uLAogICAgICAgICJyYXdfcXVlc3Rpb24iOiAiLi4uIgogICAgICAgICJwcmVtaXNlcyI6IFsiLi4uIiwgIi4uLiIsICIuLi4iXQogICAgICAgICJyZWxldmFudF9zZW50ZW5jZV9pZHhzIjogWzAsIDIsIDVdCiAgICAgICAgImh5cG90aGVzZXMiOiBbICIuLi4iLCAiLi4uIiwgIi4uLiJdCiAgICAgICAgImVudGFpbG1lbnRzIjogW3RydWUvZmFsc2UsIHRydWUvZmFsc2UsIC4uLl0KICAgICAgICAibXVsdGlzZW50IjogdHJ1ZS9mYW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gW10KCjx8ZmltX2VuZHw+
05303f5f204f1576b507f6088a08f7ef01ac021e-1
05303f5f204f1576b507f6088a08f7ef01ac021e
PHxmaW1fcHJlZml4fD4KZnJvbSBvcy5wYXRoIGltcG9ydCBkaXJuYW1lLCBqb2luCgpjbGFzcyBDb25zdGFudHM6CiAgICAiIiIKICAgIERlZmluZSBmaXhlZCBwYXJhbWV0ZXJzIGluIHRoaXMgY2xhc3MKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgogICAgIiIiCiAgICBkZWYgX19pbml0X18oc2VsZik6CiAgICAgICAgIiIiCiAgICAgICAgSW5zdGFuY2UgYXR0cmlidXRlcwo8fGZpbV9lbmR8Pg==
3cc040dafaad6feab0c899432d1f04d89f44c27d-1
3cc040dafaad6feab0c899432d1f04d89f44c27d
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHRvcmNoCmZyb20gdG9yY2guYXV0b2dyYWQgaW1wb3J0IFZhcmlhYmxlCmltcG9ydCB0b3JjaC5ubiBhcyBubgppbXBvcnQgdG9yY2gubm4uZnVuY3Rpb25hbCBhcyBGCmltcG9ydCB0b3JjaC5vcHRpbSBhcyBvcHRpbQoKaW1wb3J0IG51bXB5IGFzIG5wCmZyb20gdHFkbSBpbXBvcnQgdHFkbQoKCmRlZiB0b19zY2FsYXIodmFyKToKICAgICMgcmV0dXJucyBhIHB5dGhvbiBmbG9hdAogICAgcmV0dXJuIHZhci52aWV3KC0xKS5kYXRhLnRvbGlzdCgpWzBdCgoKZGVmIGFyZ21heCh2ZWMpOgogICAgIyByZXR1cm4gdGhlIGFyZ21heCBhcyBhIHB5dGhvbiBpbnQKICAgIF8sIGlkeCA9IHRvcmNoLm1heCh2ZWMsIDEpCiAgICByZXR1cm4gdG9fc2NhbGFyKGlkeCkKCgpkZWYgbG9nX3N1bV9leHBfdG9yY2godmVjcywgYXhpcz1Ob25lKToKICAgICMjIFVzZSBoZWxwIGZyb206IGh0dHA6Ly9weXRvcmNoLm9yZy90dX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3RhbD1sZW4oZGF0YV90ZW5zb3JzKSwKICAgICAgICAgICAgZGVzYz0iUHJvYy4gdHJhaW4gdGVuc29ycyIsCiAgICAgICAgICAgICNsZWF2ZT1GYWxzZSwKICAgICAgICApCiAgICApCiAgICBpZiBldmFsX3RlbnNvcnMgaXMgbm90IE5vbmU6CiAgICAgICAgZXZhbF90ZW5zb3JzID0gbGlzdCgKICAgICAgICAgICAgdHFkbSgKICAgICAgICAgICAgICAgIG1vZGVsX3dyYXBwZXIuYmF0Y2hfcHJvY2Vzc190ZW5zb3JzKGV2YWxfdGVuc29ycyksCiAgICAgICAgICAgICAgICB0b3RhbD1sZW4oZXZhbF90ZW5zb3JzKSwKICAgICAgICAgICAgICAgIGRlc2M9IlByb2MuIGV2YWwgdGVuc29ycyIsCiAgICAgICAgICAgICAgICAjbGVhdmU9RmFsc2UsCiAgICAgICAgICAgICkKICAgICAgICApCiAgICAjIyAKICAgICNkYXRhX3RlbnNvcnMgPSBucC5hcnJheShkYXRhX3RlbnNvcnMpCiAgICAjaWYgZXZhbF90ZW5zb3JzIGlzIG5vdCBOb25lOgogICAgIyAgICBldmFsX3RlbnNvcnMgPSBucC5hcnJheShldmFsX3RlbnNvcnMpCiAgICBwZXJmb3JtX2Vwb2NoID0gZ2V0X2Vwb2NoX2Z1bmN0aW9uKAogICAgICAgIG1vZGVsX3dyYXBwZXIsCiAgICAgICAgb3B0aW1pemVyLAogICAgICAgIHVzZV9jdWRhPXVzZV9jdWRhKQogICAgd2l0aCBvcGVuKGxvZ19maWxlLCAidysiKSBhcyBmcDoKICAgICAgICB3aXRoIHRxZG0odG90YWw9bl9lcG9jaHMsIGRlc2M9IkVwb2NocyIsIHVuaXQ9ImVwb2NocyIpIGFzIGVwb2NoX3Byb2dyZXNzX2JhcjoKICAgICAgICAgICAgZm9yIGVwb2NoIGluIHJhbmdlKG5fZXBvY2hzKToKICAgICAgICAgICAgICAgIHdpdGggdHFkbSgKICAgICAgICAgICAgICAgICAgICB0b3Rhb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6CiAgICAgICAgICAgICMjIE9ubHkgYWxsb3cgYXV4IGVtYmVkZGluZyBpbiBjb25jYXQgbW9kZQogICAgICAgICAgICBzZWxmLmF1eF93b3JkX2VtYmVkZGluZ3MgPSBubi5FbWJlZGRpbmcodm9jYWJfc2l6ZSwgYXV4X2VtYmVkZGluZ19zaXplKQogICAgICAgIAogICAgZGVmIGZvcndhcmQoc2VsZiwgWCk6CiAgICAgICAgaWYgaXNpbnN0YW5jZShYLCB0dXBsZSk6CiAgICAgICAgICAgIFgsIFhfY2hhciA9IFgKICAgICAgICAjIFJlZjogaHR0cHM6Ly9naXRodWIuY29tL1NoYXduMTk5My9jbm4tdGV4dC1jbGFzc2lmaWNhdGlvbi1weXRvcmNoL2Jsb2IvbWFzdGVyL21vZGVsLnB5CiAgICAgICAgd29yZF92ZWNzID0gc2VsZi53b3JkX2VtYmVkZGluZ3MoWCkKICAgICAgICBpZiBYX2NoYXIgaXMgbm90IE5vbmU6CiAgICAgICAgICAgIGNoYXJfdmVjcyA9IHRvcmNoLmNhdChbCiAgICAgICAgICAgICAgICBzZWxmLmNoYXJfZW1iZWRkaW5ncyh4KS51bnNxdWVlemUoMCkKICAgICAgICAgICAgICAgIGZvciB4IGluIFhfY2hhcgogICAgICAgICAgICBdLCAxKQogICAgICAgICAgICBpZiBzZWxmLmNvbmNhdDoKICAgICAgICAgICAgICAgIGVtYmVkZGluZ19saXN0ID0gW2NoYXJfdmVjcywgd29yZF92ZWNzXQogICAgICAgICAgICAgICAgaWYgaGFzYXR0cihzZWxmLCAiYXV4X3dvcmRfZW1iZWRkaW5ncyIpOgogICAgICAgICAgICAgICAgICAgIGF1eF92ZWNzID0gc2VsZi5hdXhfd29yZF9lbWJlZGRpbmdzKFgpCiAgICAgICAgICAgICAgICAgICAgZW1iZWRkaW5nX2xpc3QuYXBwZW5kKGF1eF92ZWNzKQogICAgICAgICAgICAgICAgd29yZF92ZWNzID0gdG9yY2guY2F0KGVtYmVkZGluZ19saXN0LCAyKQog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BcGlNaXhpbik6CiAgICB2aWV3X25hbWUgPSAncnVsZXMtbGlzdCcKCiAgICBkZWYgdGVzdF9wYXJlbnRfY2FuX2NyZWF0ZShzZWxmLCBwYXJlbnRfY2xpZW50KToKICAgICAgICBjYXJkID0gZi5DYXJkRmFjdG9yeSgpCiAgICAgICAgZGF0YSA9IHsKICAgICAgICAgICAgJ2NhcmQnOiBjYXJkLnBrLAogICAgICAgICAgICAndHlwZSc6IFJ1bGUuVHlwZS5nbG9iYWxfLAogICAgICAgIH0KICAgICAgICByID0gcGFyZW50X2NsaWVudC5wb3N0KHNlbGYucmV2ZXJzZSgpLCBkYXRhKQogICAgICAgIGgucmVzcG9uc2VDcmVhdGVkKHIpCgogICAgZGVmIHRlc3RfcGFyZW50X2Nhbl9jcmVhdGVfbWVyY2hhbnQoc2VsZiwgcGFyZW50X2NsaWVudCk6CiAgICAgICAgY2FyZCA9IGYuQ2FyZEZhY3RvcnkoKQogICAgICAgIGRhdGEgPSB7CiAgICAgICAgICAgICdjYXJkJzogY2FyZC5waywKICAgICAgICAgICAgJ3R5cGUnOiBSdWxlLlR5cGUubWVyY2hhbnQsCiAgICAgICAgICAgICdtZXJjaGFudF90eXBlcyc6IFsKICAgICAgICAgICAgICAgIFJ1bGUuTWVyY2hhbnRUeXBlLmhvdXNlaG9sZCwKICAgICAgICAgICAgICAgIFJ1bGUuTWVyY2hhbnRUeXBlLnJlY3JlYXRpb24sCiAgICAgICAgICAgIF0KICAgICAgICB9CiAgICAgICAgciA9IHBhcmVudF9jbGllbnQucG9zdChzZWxmLnJldmVyc2UoKSwgZGF0YSkKICAgICAgICBoLnJlc3BvbnNlQ3JlYXRlZChyKQo8fGZpbV9zdWZmaXh8PgoKcHl0ZXN0bWFyayA9IHB5dGVzdC5tYXJrLmRqYW5nb19kYgoKCjx8ZmltX2VuZHw+
bba1fa8d440ab23eaa667ef0af18cdf3002d5163-2
bba1fa8d440ab23eaa667ef0af18cdf3002d5163
PHxmaW1fcHJlZml4fD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KSlNfSURFTlQgPSBKU19JREVOVF9TVEFSVCArICcoPzonICsgSlNfSURFTlRfUEFSVCArICcpKicKCgpjbGFzcyBKYXZhU2NyaXB0KFJlZ2V4TGV4ZXIpOgogICAgIiIiCiAgICBGb3IgSmF2YVNjcmlwdCBzb3VyY2UgY29kZS4KICAgICIiIgoKICAgIG5hbWUgPSAnSmF2YVNjcmlwdCcKICAgIGFsaWFzZXMgPSBbJ2pzJywgJ2phdmFzY3JpcHQnXQogICAgZmlsZW5hbWVzID0gWycqLmpzJywgJyouanNtJywgJyoubWpzJ10KICAgIG1pbWV0eXBlcyA9IFsnYXBwbGljYXRpb24vamF2YXNjcmlwdCcsICdhcHBsaWNhdGlvbi94LWphdmFzY3JpcHQnLAogICAgICAgICAgICAgICAgICd0ZXh0L3gtamF2YXNjcmlwdCcsICd0ZXh0L2phdmFzY3JpcHQnXQoKICAgIGZsYWdzID0gcmUuRE9UQUxMIHwgcmUuVU5JQ09ERSB8IHJlLk1VTFRJTElORQoKICAgIHRva2VucyA9IHsKICAgICAgICAnY29tbWVudHNhbmR3aGl0ZXNwYWNlJzogWwogICAgICAgICAgICAocidccysnLCBUZXh0KSwKICAgICAgICAgICAgKHInPCEtLScsIENvbW1lbnQpLAogICAgICAgICAgICAocicvLy4qP1xuJywgQ29tbWVudC5TaW5nbGUpLAogICAgICAgICAgICAocicvXCouKj9cKi8nLCBDb21tZW50Lk11bHRpbGluZSkKICAgICAgICBdLAogICAgICAgICdzbGFzaHN0YXJ0c3JlZ2V4JzogWwogICAgICAgICAgICBpbmNsdWRlKCdjb21tZW50c2FuZHdoaXRlc3BhY2UnKSwKICAgICAgICAgICAgKHInLyhcXC58W15bL1xcXG5dfFxbKFxcLnxbXlxdXFxcbl0pKl0pKy8nCiAgICAgICAgICAgICByJyhbZ2ltdXlzXStcYnxcQiknLCBTdHJpbmcuUmVnZXgsICcjcG9wJyksCiAgICAgICAgICAgIChyJyg/PS8pJywgVGV4dCwgKCcjcG9wJywgJ2JhZHJlZ2V4JykpLAogICAgICAgICAgICBkZWZhdWx0KCcjcG9wJykKICAgICAgICBdLAogICAgICAgICdiYWRyZWdleCc6IFsKICAgICAgICAgICAgKHInXG4nLCBUZXh0LCAnI3BvcCcpCiAgICAgICAgXSwKICAgICAgICAncm9vdCc6IFsKICAgICAgICAgICAgKHInXEEjISA/Ly4qP1xuJywgQ29tbWVudC5IYXNoYmFuZyksICAjIHJlY29nbml6ZWQgYnkgbm9kZS5qcwogICAgICAgICAgICAocideKD89XHN8L3w8IS0tKScsIFRleHQsICdzbGFzaHN0YXJ0c3JlZ2V4JyksCiAgICAgICAgICAgIGluY2x1ZGUoJ2NvbW1lbnRzYW5kd2hpdGVzcGFjZScpLAoKICAgICAgICAgICAgIyBOdW1lcmljIGxpdGVyYWxzCiAgICAgICAgICAgIChyJzBbYkJdWzAxXStuPycsIE51bWJlci5CaW4pLAogICAgICAgICAgICAocicwW29PXT9bMC03XStuPycsIE51bWJlci5PY3QpLCAgIyBCcm93c2VycyBzdXBwb3J0ICIwbzciIGFuZCAiMDciICg8IEVTNSkgbm90YXRpb25zCiAgICAgICAgICAgIChyJzBbeFhdWzAtOWEtZkEtRl0rbj8nLCBOdW1iZXIuSGV4KSwKICAgICAgICAgICAgKHInWzAtOV0rbicsIE51bWJlci5JbnRlZ2VyKSwgICMgSmF2YXNjcmlwdCBCaWdJbnQgcmVxdWlyZXMgYW4gIm4iIHBvc3RmaXgKICAgICAgICAgICAgIyBKYXZhc2NyaXB0IGRvZXNuJ3QgaGF2ZSBhY3R1YWwgaW50ZWdlciBsaXRlcmFscywgc28gZXZlcnkgb3RoZXIKICAgICAgICAgICAgIyBudW1lcmljIGxpdGVyYWwgaXMgaGFuZGxlZCBieSB0aGUgcmVnZXggYmVsb3cgKGluY2x1ZGluZyAibm9ybWFsIikKICAgICAgICAgICAgIyBpbnRlZ2VycwogICAgICAgICAgICAocicoXC5bMC05XSt8WzAtOV0rXC5bMC05XSp8WzAtOV0rKShbZUVdWy0rXT9bMC05XSspPycsIE51bWJlci5GbG9hdCksCgogICAgICAgICAgICAocidcLlwuXC58PT4nLCBQdW5jdHVhdGlvbiksCiAgICAgICAgICAgIChyJ1wrXCt8LS18fnwmJnxcP3w6fFx8XHx8XFwoPz1cbil8JwogICAgICAgICAgICAgcicoPDx8Pj4+P3w9PT98IT0/fFstPD4rKiUmfF4vXSk9PycsIE9wZXJhdG9yLCAnc2xhc2hzdGFydHNyZWdleCcpLAogICAgICAgICAgICAocidbeyhcWzssXScsIFB1bmN0dWF0aW9uLCAnc2xhc2hzdGFydHNyZWdleCcpLAogICAgICAgICAgICAocidbfSlcXS5dJywgUHVuY3R1YXRpb24pLAogICAgICAgICAgICAocicoZm9yfGlufHdoaWxlfGRvfGJyZWFrfHJldHVybnxjb250aW51ZXxzd2l0Y2h8Y2FzZXxkZWZhdWx0fGlmfGVsc2V8JwogICAgICAgICAgICAgcid0aHJvd3x0cnl8Y2F0Y2h8ZmluYWxseXxuZXd8ZGVsZXRlfHR5cGVvZnxpbnN0YW5jZW9mfHZvaWR8eWllbGR8YXdhaXR8YXN5bmN8JwogICAgICAgICAgICAgcid0aGlzfG9mfHN0YXRpY3xleHBvcnR8aW1wb3J0fGRlYnVnZ2VyfGV4dGVuZHN8c3VwZXIpXGInLCBLZXl3b3JkLCAnc2xhc2hzdGFydHNyZWdleCcpLAogICAgICAgICAgICAocicodmFyfGxldHxjb25zdHx3aXRofGZ1bmN0aW9ufGNsYXNzKVxiJywgS2V5d29yZC5EZWNsYXJhdGlvbiwgJ3NsYXNoc3RhcnRzcmVnZXgnKSwKICAgICAgICAgICAgKHInKGFic3RyYWN0fGJvb2xlYW58Ynl0ZXxjaGFyfGRvdWJsZXxlbnVtfGZpbmFsfGZsb2F0fGdvdG8nCiAgICAgICAgICAgICByJ2ltcGxlbWVudHN8aW50fGludGVyZmFjZXxsb25nfG5hdGl2ZXxwYWNrYWdlfHByaXZhdGV8cHJvdGVjdGVkJwogICAgICAgICAgICAgcidwdWJsaWN8c2hvcnR8c3luY2hyb25pemVkfHRocm93c3x0cmFuc2llbnR8dm9sYXRpbGUpXGInLCBLZXl3b3JkLlJlc2VydmVkKSwKICAgICAgICAgICAgKHInKHRydWV8ZmFsc2V8bnVsbHxOYU58SW5maW5pdHl8dW5kZWZpbmVkKVxiJywgS2V5d29yZC5Db25zdGFudCksCiAgICAgICAgICAgIChyJyhBcnJheXxCb29sZWFufERhdGV8QmlnSW50fEVycm9yfEZ1bmN0aW9ufE1hdGh8JwogICAgICAgICAgICAgcidOdW1iZXJ8T2JqZWN0fFJlZ0V4cHxTdHJpbmd8UHJvbWlzZXxQcm94eXxkZWNvZGVVUkl8JwogICAgICAgICAgICAgcidkZWNvZGVVUklDb21wb25lbnR8ZW5jb2RlVVJJfGVuY29kZVVSSUNvbXBvbmVudHwnCiAgICAgICAgICAgICByJ0Vycm9yfGV2YWx8aXNGaW5pdGV8aXNOYU58aXNTYWZlSW50ZWdlcnxwYXJzZUZsb2F0fHBhcnNlSW50fCcKICAgICAgICAgICAgIHInZG9jdW1lbnR8dGhpc3x3aW5kb3d8Z2xvYmFsVGhpc3xTeW1ib2wpXGInLCBOYW1lLkJ1aWx0aW4pLAogICAgICAgICAgICAoSlNfSURFTlQsIE5hbWUuT3RoZXIpLAogICAgICAgICAgICAociciKFxcXFx8XFxbXlxcXXxbXiJcXF0pKiInLCBTdHJpbmcuRG91YmxlKSwKICAgICAgICAgICAgKHIiJyhcXFxcfFxcW15cXF18W14nXFxdKSonIiwgU3RyaW5nLlNpbmdsZSksCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgICAgICAgICAgKHInYCcsIFN0cmluZy5CYWNrdGljaywgJ2ludGVycCcpLAo8fGZpbV9lbmR8Pg==
ab9313659b25f67f2b987d4eb52820b18ee40e26-2
ab9313659b25f67f2b987d4eb52820b18ee40e26
PHxmaW1fcHJlZml4fD4KIiIiCiAgICBweWdtZW50cy5sZXhlcnMuamF2YXNjcmlwdAogICAgfn5+fn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OVF9TVEFSVCArICcoPzonICsgSlNfSURFTlRfUEFSVCArICcpKicKCgpjbGFzcyBKYXZhU2NyaXB0KFJlZ2V4TGV4ZXIpOgogICAgIiIiCiAgICBGb3IgSmF2YVNjcmlwdCBzb3VyY2UgY29kZS4KICAgICIiIgoKICAgIG5hbWUgPSAnSmF2YVNjcmlwdCcKICAgIGFsaWFzZXMgPSBbJ2pzJywgJ2phdmFzY3JpcHQnXQogICAgZmlsZW5hbWVzID0gWycqLmpzJywgJyouanNtJywgJyoubWpzJ10KICAgIG1pbWV0eXBlcyA9IFsnYXBwbGljYXRpb24vamF2YXNjcmlwdCcsICdhcHBsaWNhdGlvbi94LWphdmFzY3JpcHQnLAo8fGZpbV9ob2xlfD4KICAgIGZsYWdzID0gcmUuRE9UQUxMIHwgcmUuVU5JQ09ERSB8IHJlLk1VTFRJTElORQoKICAgIHRva2VucyA9IHsKICAgICAgICAnY29tbWVudHNhbmR3aGl0ZXNwYWNlJzogWwogICAgICAgICAgICAocidccysnLCBUZXh0KSwKICAgICAgICAgICAgKHInPCEtLScsIENvbW1lbnQpLAogICAgICAgICAgICAocicvLy4qP1xuJywgQ29tbWVudC5TaW5nbGUpLAogICAgICAgICAgICAocicvXCouKj9cKi8nLCBDb21tZW50Lk11bHRpbGluZSkKICAgICAgICBdLAogICAgICAgICdzbGFzaHN0YXJ0c3JlZ2V4JzogWwogICAgICAgICAgICBpbmNsdWRlKCdjb21tZW50c2FuZHdoaXRlc3BhY2UnKSwKICAgICAgICAgICAgKHInLyhcXC58W15bL1xcXG5dfFxbKFxcLnxbXlxdXFxcbl0pKl0pKy8nCiAgICAgICAgICAgICByJyhbZ2ltdXlzXStcYnxcQiknLCBTdHJpbmcuUmVnZXgsICcjcG9wJyksCiAgICAgICAgICAgIChyJyg/PS8pJywgVGV4dCwgKCcjcG9wJywgJ2JhZHJlZ2V4JykpLAogICAgICAgICAgICBkZWZhdWx0KCcjcG9wJykKICAgICAgICBdLAogICAgICAgICdiYWRyZWdleCc6IFsKICAgICAgICAgICAgKHInXG4nLCBUZXh0LCAnI3BvcCcpCiAgICAgICAgXSwKICAgICAgICAncm9vdCc6IFsKICAgICAgICAgICAgKHInXEEjISA/Ly4qP1xuJywgQ29tbWVudC5IYXNoYmFuZyksICAjIHJlY29nbml6ZWQgYnkgbm9kZS5qcwogICAgICAgICAgICAocideKD89XHN8L3w8IS0tKScsIFRleHQsICdzbGFzaHN0YXJ0c3JlZ2V4JyksCiAgICAgICAgICAgIGluY2x1ZGUoJ2NvbW1lbnRzYW5kd2hpdGVzcGFjZScpLAoKICAgICAgICAgICAgIyBOdW1lcmljIGxpdGVyYWxzCiAgICAgICAgICAgIChyJzBbYkJdWzAxXStuPycsIE51bWJlci5CaW4pLAogICAgICAgICAgICAocicwW29PXT9bMC03XStuPycsIE51bWJlci5PY3QpLCAgIyBCcm93c2VycyBzdXBwb3J0ICIwbzciIGFuZCAiMDciICg8IEVTNSkgbm90YXRpb25zCiAgICAgICAgICAgIChyJzBbeFhdWzAtOWEtZkEtRl0rbj8nLCBOdW1iZXIuSGV4KSwKICAgICAgICAgICAgKHInWzAtOV0rbicsIE51bWJlci5JbnRlZ2VyKSwgICMgSmF2YXNjcmlwdCBCaWdJbnQgcmVxdWlyZXMgYW4gIm4iIHBvc3RmaXgKICAgICAgICAgICAgIyBKYXZhc2NyaXB0IGRvZXNuJ3QgaGF2ZSBhY3R1YWwgaW50ZWdlciBsaXRlcmFscywgc28gZXZlcnkgb3RoZXIKICAgICAgICAgICAgIyBudW1lcmljIGxpdGVyYWwgaXMgaGFuZGxlZCBieSB0aGUgcmVnZXggYmVsb3cgKGluY2x1ZGluZyAibm9ybWFsIikKICAgICAgICAgICAgIyBpbnRlZ2VycwogICAgICAgICAgICAocicoXC5bMC05XSt8WzAtOV0rXC5bMC05XSp8WzAtOV0rKShbZUVdWy0rXT9bMC05XSspPycsIE51bWJlci5GbG9hdCksCgogICAgICAgICAgICAocidcLlwuXC58PT4nLCBQdW5jdHVhdGlvb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lc2VydmVkKSwKICAgICAgICAgICAgKHInKHRydWV8ZmFsc2V8bnVsbHxOYU58SW5maW5pdHl8dW5kZWZpbmVkKVxiJywgS2V5d29yZC5Db25zdGFudCksCiAgICAgICAgICAgIChyJyhBcnJheXxCb29sZWFufERhdGV8QmlnSW50fEVycm9yfEZ1bmN0aW9ufE1hdGh8JwogICAgICAgICAgICAgcidOdW1iZXJ8T2JqZWN0fFJlZ0V4cHxTdHJpbmd8UHJvbWlzZXxQcm94eXxkZWNvZGVVUkl8JwogICAgICAgICAgICAgcidkZWNvZGVVUklDb21wb25lbnR8ZW5jb2RlVVJJfGVuY29kZVVSSUNvbXBvbmVudHwnCiAgICAgICAgICAgICByJ0Vycm9yfGV2YWx8aXNGaW5pdGV8aXNOYU58aXNTYWZlSW50ZWdlcnxwYXJzZUZsb2F0fHBhcnNlSW50fCcKICAgICAgICAgICAgIHInZG9jdW1lbnR8dGhpc3x3aW5kb3d8Z2xvYmFsVGhpc3xTeW1ib2wpXGInLCBOYW1lLkJ1aWx0aW4pLAogICAgICAgICAgICAoSlNfSURFTlQsIE5hbWUuT3RoZXIpLAogICAgICAgICAgICAociciKFxcXFx8XFxbXlxcXXxbXiJcXF0pKiInLCBTdHJpbmcuRG91YmxlKSwKICAgICAgICAgICAgKHIiJyhcXFxcfFxcW15cXF18W14nXFxdKSonIiwgU3RyaW5nLlNpbmdsZSksCiAgICAgICAgICAgIChyJ2AnLCBTdHJpbmcuQmFja3RpY2ssICdpbnRlcnAnKSwKICAgICAgICBdLAogICAgICAgICdpbnRlcnAnOiBbCiAgICAgICAgICAgIChyJ2AnLCBTdHJpbmcuQmFja3RpY2ssICcjcG9wJyksCiAgICAgICAgICAgIChyJ1xcLicsIFN0cmluZy5CYWNrdGljayksCiAgICAgICAgICAgIChyJ1wkXHsnLCBTdHJpbmcuSW50ZXJwb2wsICdpbnRlcnAtaW5zaWRlJyksCiAgICAgICAgICAgIChyJ1wkJywgU3RyaW5nLkJhY2t0aWNrKSwKICAgICAgICAgICAgKHInW15gXFwkXSsnLCBTdHJpbmcuQmFja3RpY2spLAogICAgICAgIF0sCiAgICAgICAgJ2ludGVycC1pbnNpZGUnOiBbCiAgICAgICAgICAgICMgVE9ETzogc2hvdWxkIHRoaXMgaW5jbHVkZSBzaW5nbGUtbGluZSBjb21tZW50cyBhbmQgYWxsb3cgbmVzdGluZyBzdHJpbmdzPwogICAgICAgICAgICAocidcfScsIFN0cmluZy5JbnRlcnBvbCwgJyNwb3AnKSwKICAgICAgICAgICAgaW5jbHVkZSgncm9vdCcpLAogICAgICAgIF0sCiAgICB9Cjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgICAgICAgICAgJ3RleHQveC1qYXZhc2NyaXB0JywgJ3RleHQvamF2YXNjcmlwdCddCgo8fGZpbV9lbmR8Pg==