id
stringlengths 42
42
| src_hexsha
stringlengths 40
40
| example
stringlengths 80
1.37M
|
---|---|---|
9e4b972f5a10f7063a02a2a382a0000dc305538b-4
|
9e4b972f5a10f7063a02a2a382a0000dc305538b
|
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9weXRob24KCmltcG9ydCBudW1weSBhcyBucAppbXBvcnQgZGVlcFNOUAppbXBvcnQgZGVlcFNOUF91dGlscwoKCmRlZiBtYXBfcXVhbF9mZWF0dXJlX21hdHJpeChyZWFkLCB3aW5kb3dfc3RhcnQpOgogICAgIiIiCiAgICBDcmVhdGVzIGEgbWF0cml4IGNvbnRhaW5pbmcgbWFwcGluZyBxdWFsaXR5IHZhbHVlCiAgICBhdCBwb3NpdGlvbnMgaW4gZmVhdHVyZSB3aW5kb3cgd2hlcmUgcmVhZCBvdmVybGFwcwoKICAgIDpwYXJhbSByZWFkOiBweXNhbSByZWFkCiAgICA6cGFyYW0gd2luZG93X3N0YXJ0OiBzdGFydGluZyBwb3NpdGlvbiBvZiBmZWF0dXJlIHdpbmRvdwo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICA6cmV0dXJuOiAoV0lORE9XX1NJWkUgeCAxKSBtYXRyaXggY29udGFpbmluZyBNUUFMIGF0IHJlYWQgcG9zaXRpb25zCiAgICAiIiIKICAgICMgY2hlY2sgaWYgd2UgaGF2ZSBvbmx5IHBhcnQgb2YgdGhlIHJlYWQgaW4gdGhlIHdpbmRvdwogICAgc2VxX3N0YXJ0LCBzZXFfZW5kID0gZGVlcFNOUF91dGlscy5zZXFfc3RhcnRfZW5kKHJlYWQsIHdpbmRvd19zdGFydCkKPHxmaW1fZW5kfD4=
|
ddf57b999f4c03636ad56f721149c7b60b8860a0-1
|
ddf57b999f4c03636ad56f721149c7b60b8860a0
|
PHxmaW1fcHJlZml4fD4KIyB5YmRhdGEKIyBFbnRyeSBwb2ludCBmb3IgQ0xJIHNjcmlwdCB1c2VkIGJ5IHB5dGhv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MjIyMjIyMjCgpkZWYgbWFpbigpOgogICAgIiIiCjx8ZmltX2hvbGV8PgoKCmlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6CiAgICBtYWluKCkKPHxmaW1fc3VmZml4fD4KICAgIExvYWRzIHRoZSBlbnZpcm9ubWVudCBpZiByZXF1aXJlZCwgbG9hZHMgdGhlIHV0aWxpdHkgYW5kIGV4ZWN1dGVzIGl0LgogICAgIiIiCiAgICB1dGlsaXR5ID0gWUJEYXRhc2V0VXRpbGl0eS5sb2FkKCkKICAgIHV0aWxpdHkuZXhlY3V0ZSgpCjx8ZmltX2VuZHw+
|
7b221f64916ec89840b236066df9fb65857cef4c-1
|
7b221f64916ec89840b236066df9fb65857cef4c
|
PHxmaW1fcHJlZml4fD4KZnJvbSBtYXRoIGltcG9ydCBwb3cKCgpkZWYgbnRocm9vdChuLCBudGgpIC0+IGZsb2F0Ogo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICAiIiIKICAgIG46IE8gbsO6bWVybyBxdWUgdmFpIHNlciBvYnRpZG8gYSBlbsOpc2ltYSByYWl6CiAgICBudGg6IEEgw6luZXNpbWEgcmFpeiBkZSBuCiAgICByZXR1cm46IFJldG9ybmEgYSBlbsOpc2ltYSByYWl6IGRlIG4KPHxmaW1fZW5kfD4=
|
7b221f64916ec89840b236066df9fb65857cef4c-2
|
7b221f64916ec89840b236066df9fb65857cef4c
|
PHxmaW1fcHJlZml4fD4KZnJvbSBtYXRoIGltcG9ydCBwb3cKPHxmaW1faG9sZXw+CiAgICBuOiBPIG7Dum1lcm8gcXVlIHZhaSBzZXIgb2J0aWRvIGEgZW7DqXNpbWEgcmFpegogICAgbnRoOiBBIMOpbmVzaW1hIHJhaXogZGUgbgogICAgcmV0dXJuOiBSZXRvcm5hIGEgZW7DqXNpbWEgcmFpeiBkZSBuCiAgICAiIiIKICAgIHJldHVybiBwb3cobiwgKDEvbnRoKSkKPHxmaW1fc3VmZml4fD4KCgpkZWYgb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dGEuRGF0YUxvYWRlcigKICAgICAgc3VibmV0X2RhdGFzZXQsCiAgICAgIGJhdGNoX3NpemU9YmF0Y2hfc2l6ZSwKICAgICAgc2h1ZmZsZT1zaHVmZmxlLAogICAgICBudW1fd29ya2Vycz1udW1fd29ya2VycywKPHxmaW1faG9sZXw+CiAgcmV0dXJuIGRhdGFfbG9hZGVyCjx8ZmltX3N1ZmZpeHw+CiAgICAgIHBpbl9tZW1vcnk9VHJ1ZSkKPHxmaW1fZW5kfD4=
|
1fa4c6172fda538008b2ddf9e429ef23dbe6962b-1
|
1fa4c6172fda538008b2ddf9e429ef23dbe6962b
|
PHxmaW1fcHJlZml4fD4KZnJvbSByZSBpbXBvcnQgY29tcGlsZSwgbWF0Y2gKPHxmaW1faG9sZXw+CmRlZiB0b19pbnRlZ2VyKHN0cm5nKToKICAgIHRyeToKICAgICAgICByZXR1cm4gaW50KHN0cm5nLCAwIGlmIG1hdGNoKFJFR0VYLCBzdHJuZykuZ3JvdXAoJ2Jhc2UnKSBlbHNlIDEwKQogICAgZXhjZXB0IChBdHRyaWJ1dGVFcnJvciwgS2V5RXJyb3IsIFZhbHVlRXJyb3IpOgogICAgICAgIHBhc3MKPHxmaW1fc3VmZml4fD4KClJFR0VYID0gY29tcGlsZShyJ1srLV0/KDAoP1A8YmFzZT5bYnhvXSkpP1tcZFx3XStcWicpCgoKPHxmaW1fZW5kfD4=
|
1fa4c6172fda538008b2ddf9e429ef23dbe6962b-2
|
1fa4c6172fda538008b2ddf9e429ef23dbe6962b
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSByZSBpbXBvcnQgY29tcGlsZSwgbWF0Y2gKClJFR0VYID0gY29tcGlsZShyJ1srLV0/KDAoP1A8YmFzZT5bYnhvXSkpP1tcZFx3XStcWicpCgo8fGZpbV9lbmR8Pg==
|
1fa4c6172fda538008b2ddf9e429ef23dbe6962b-3
|
1fa4c6172fda538008b2ddf9e429ef23dbe6962b
|
PHxmaW1fcHJlZml4fD4KZnJvbSByZSBpbXBvcnQgY29tcGlsZSwgbWF0Y2gKPHxmaW1faG9sZXw+CmRlZiB0b19pbnRlZ2VyKHN0cm5nKToKICAgIHRyeToKICAgICAgICByZXR1cm4gaW50KHN0cm5nLCAwIGlmIG1hdGNoKFJFR0VYLCBzdHJuZykuZ3JvdXAoJ2Jhc2UnKSBlbHNlIDEwKQogICAgZXhjZXB0IChBdHRyaWJ1dGVFcnJvciwgS2V5RXJyb3IsIFZhbHVlRXJyb3IpOgogICAgICAgIHBhc3MKPHxmaW1fc3VmZml4fD4KClJFR0VYID0gY29tcGlsZShyJ1srLV0/KDAoP1A8YmFzZT5bYnhvXSkpP1tcZFx3XStcWicpCgoKPHxmaW1fZW5kfD4=
|
1fa4c6172fda538008b2ddf9e429ef23dbe6962b-4
|
1fa4c6172fda538008b2ddf9e429ef23dbe6962b
|
PHxmaW1fcHJlZml4fD4KZnJvbSByZSBpbXBvcnQgY29tcGlsZSwgbWF0Y2gKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgoKUkVHRVggPSBjb21waWxlKHInWystXT8oMCg/UDxiYXNlPltieG9dKSk/W1xkXHddK1xaJykKCgo8fGZpbV9lbmR8Pg==
|
1fa4c6172fda538008b2ddf9e429ef23dbe6962b-5
|
1fa4c6172fda538008b2ddf9e429ef23dbe6962b
|
PHxmaW1fcHJlZml4fD4KZnJvbSByZSBpbXBvcnQgY29tcGlsZSwgbWF0Y2gKClJFR0VYID0gY29tcGlsZShyJ1srLV0/KDAoP1A8YmFzZT5bYnhvXSkpP1tcZFx3XStcWicpCgoKZGVmIHRvX2ludGVnZXIoc3RybmcpOgogICAgdHJ5OgogICAgICAgIHJldHVybiBpbnQoc3RybmcsIDAgaWYgbWF0Y2goUkVHRVgsIHN0cm5nKS5ncm91cCgnYmFzZScpIGVsc2UgMTApCiAgICBleGNlcHQgKEF0dHJpYnV0ZUVycm9yLCBLZXlFcnJvciwgVmFsdWVFcnJvcik6Cjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgICAgICBwYXNzCjx8ZmltX2VuZHw+
|
c0fac8630a59f69acb288cb79c5afa885ff34930-1
|
c0fac8630a59f69acb288cb79c5afa885ff34930
|
PHxmaW1fcHJlZml4fD4KZnJvbSBjb3B5IGltcG9ydCBkZWVwY29weQppbXBvcnQgdG9yY2gKZnJvbSBkYWx1a2UuZGF0YSBpbXBvcnQgRW50aXRpZXMsIFdvcmRzCmZyb20gZGFsdWtlLnByZXRyYWluLmRhdGEgaW1wb3J0IG1hc2tfZW50X2JhdGNoLCBtYXNrX3dvcmRfYmF0Y2gKCmRlZiB0ZXN0X2VudGl0eV9tYXNraW5nKCk6CiAgICBlbnRzID0gRW50aXRpZXMoCiAgICAgICAgaWRzID0gdG9yY2guSW50VGVuc29yKFsKICAgICAgICAgICAgWzQyXSoxMDAsCiAgICAgICAgICAgIFs2OV0qMTArWy0xXSo5MCwKICAgICAgICBdKSwKICAgICAgICBhdHRlbnRpb25fbWFzayA9IE5vbmUsCiAgICAgICAgTiA9IHRvcmNoLkludFRlbnNvcihbMTAwLCAxMF0pLAogICAgICAgIHNwYW5zID0gTm9uZSwKICAgICAgICBwb3MgPSBOb25lLAogICAgKQogICAgXywgbWFzayA9IG1hc2tfZW50X2JhdGNoKGVudHMsIDAuMSwgOTk5KQogICAgYXNzZXJ0IHN1bShtYXNrWzBdKSA9PSAxMAogICAgYXNzZXJ0IHN1bShtYXNrWzFdKSA9PSAxCiAgICBhc3NlcnQgc3VtKGVudHMuaWRzLnJhdmVsKCkgPT0gOTk5KSA9PSAxMQoKZGVmIHRlc3Rfd29yZF9tYXNraW5nKCk6CiAgICB3ID0gV29yZHMoCiAgICAgICAgaWRzID0gdG9yY2guSW50VGVuc29yKFsKICAgICAgICAgICAgWzQyXSoxMCwKICAgICAgICAgICAgWzY5LCA1LCA2MCwgNjAsIDNdICsgWy0xXSAqIDUsCiAgICAgICAgXSks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cGNvcHkodykKICAgIF8sIG1hc2sgPSBtYXNrX3dvcmRfYmF0Y2goCiAgICAgICAgdzMsIDEsIDAsIDEsICg2OSwgNzApLCA5OTksCiAgICApCiAgICBhc3NlcnQgc3VtKG1hc2tbMF0pID09IDEwCiAgICBhc3NlcnQgc3VtKG1hc2tbMV0pID09IDMKICAgIGFzc2VydCB0b3JjaC5lcXVhbCh3My5pZHMsIHRvcmNoLkludFRlbnNvcigKICAgICAgICBbWzY5LCA2OSwgNjksIDY5LCA2OSwgNjksIDY5LCA2OSwgNjksIDY5XSwKICAgICAgICAgWzY5LCAgNSwgNjksIDY5LCAgMywgLTEsIC0xLCAtMSwgLTEsIC0xXV0pKQoKICAgIHc0ID0gZGVlcGNvcHkodykKICAgIF8sIG1hc2sgPSBtYXNrX3dvcmRfYmF0Y2goCiAgICAgICAgdzQsIDAuNSwgMCwgMCwgKDAsIDEpLCA5OTksCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgICkKICAgIGFzc2VydCBzdW0odzQuaWRzWzBdID09IDk5OSkgPT0gMTAKICAgIGFzc2VydCBzdW0odzQuaWRzWzFdID09IDk5OSkgaW4gKDEsIDIpCjx8ZmltX2VuZHw+
|
c0fac8630a59f69acb288cb79c5afa885ff34930-2
|
c0fac8630a59f69acb288cb79c5afa885ff34930
|
PHxmaW1fcHJlZml4fD4KZnJvbSBjb3B5IGltcG9ydCBkZWVwY29weQppbXBvcnQgdG9yY2gKZnJvbSBkYWx1a2UuZGF0YSBpbXBvcnQgRW50aXRpZXMsIFdvcmRzCmZyb20gZGFsdWtlLnByZXRyYWluLmRhdGEgaW1wb3J0IG1hc2tfZW50X2JhdGNoLCBtYXNrX3dvcmRfYmF0Y2gKCmRlZiB0ZXN0X2VudGl0eV9tYXNraW5nKCk6CiAgICBlbnRzID0gRW50aXRpZXMoCiAgICAgICAgaWRzID0gdG9yY2guSW50VGVuc29yKFsKICAgICAgICAgICAgWzQyXSoxMDAsCiAgICAgICAgICAgIFs2OV0qMTArWy0xXSo5MCwKICAgICAgICBdKSwKICAgICAgICBhdHRlbnRpb25fbWFzayA9IE5vbmUsCiAgICAgICAgTiA9IHRvcmNoLkludFRlbnNvcihbMTAwLCAxMF0pLAo8fGZpbV9ob2xlfD4KICAgICkKICAgIF8sIG1hc2sgPSBtYXNrX2VudF9iYXRjaChlbnRzLCAwLjEsIDk5OSkKICAgIGFzc2VydCBzdW0obWFza1swXSkgPT0gMTAKICAgIGFzc2VydCBzdW0obWFza1sxXSkgPT0gMQogICAgYXNzZXJ0IHN1bShlbnRzLmlkcy5yYXZlbCgpID09IDk5OSkgPT0gMTEKCmRlZiB0ZXN0X3dvcmRfbWFza2luZygpOgogICAgdyA9IFdvcmRzKAogICAgICAgIGlkcyA9IHRvcmNoLkludFRlbnNvcihbCiAgICAgICAgICAgIFs0Ml0qMTAsCiAgICAgICAgICAgIFs2OSwgNSwgNjAsIDYwLCAzXSArIFstMV0gKiA1LAogICAgICAgIF0pLAogICAgICAgIGF0dGVudGlvbl9tYXNrID0gTm9uZSwKICAgICAgICBOID0gdG9yY2guSW50VGVuc29yKFsxMCwgNV0pLAogICAgICAgIHNwYW5zID0gWwogICAgICAgICAgICB0b3JjaC5JbnRUZW5zb3IoW1swLCAxMF1dKSwKICAgICAgICAgICAgdG9yY2guSW50VGVuc29yKFtbMCwgMV0sIFsyLCA0XV0pLAogICAgICAgIF0KICAgICkKICAgIHcxID0gZGVlcGNvcHkodykKICAgIF8sIG1hc2sgPSBtYXNrX3dvcmRfYmF0Y2goCiAgICAgICAgdzEsIDAuNSwgMC4yNSwgMC4yNSwgKDUsIDI5KSwgOTk5LAogICAgKQogICAgYXNzZXJ0IHN1bShtYXNrWzBdKSA9PSAxMCAgICAgIyBFbnRpcmUgMTAtbG9uZyB3b3JkIG11c3QgYmUgbWFza2VkCiAgICBhc3NlcnQgc3VtKG1hc2tbMV0pIGluICgxLCAyKSAjIEVpdGhlciB0aGUgZmlyc3QgMS1sb25nIHdvcmQ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MF0gPT0gOTk5KSA9PSAxMAogICAgYXNzZXJ0IHN1bSh3NC5pZHNbMV0gPT0gOTk5KSBpbiAoMSwgMikKPHxmaW1fc3VmZml4fD4KICAgICAgICBzcGFucyA9IE5vbmUsCiAgICAgICAgcG9zID0gTm9uZSwKPHxmaW1fZW5kfD4=
|
239702d18c9279bfab13e944da5c945c6cebecc6-1
|
239702d18c9279bfab13e944da5c945c6cebecc6
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSAuY29udGVudC5iaW8gaW1wb3J0IEJJTyBhcyBCSU8yMDE5Cjx8ZmltX2VuZHw+
|
239702d18c9279bfab13e944da5c945c6cebecc6-2
|
239702d18c9279bfab13e944da5c945c6cebecc6
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSAuY29udGVudC5iaW8gaW1wb3J0IEJJTyBhcyBCSU8yMDE5Cjx8ZmltX2VuZHw+
|
239702d18c9279bfab13e944da5c945c6cebecc6-3
|
239702d18c9279bfab13e944da5c945c6cebecc6
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSAuY29udGVudC5iaW8gaW1wb3J0IEJJTyBhcyBCSU8yMDE5Cjx8ZmltX2VuZHw+
|
239702d18c9279bfab13e944da5c945c6cebecc6-4
|
239702d18c9279bfab13e944da5c945c6cebecc6
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSAuY29udGVudC5iaW8gaW1wb3J0IEJJTyBhcyBCSU8yMDE5Cjx8ZmltX2VuZHw+
|
239702d18c9279bfab13e944da5c945c6cebecc6-5
|
239702d18c9279bfab13e944da5c945c6cebecc6
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSAuY29udGVudC5iaW8gaW1wb3J0IEJJTyBhcyBCSU8yMDE5Cjx8ZmltX2VuZHw+
|
34ffa03d6129e4fb031afa1998385c2392e0b45a-1
|
34ffa03d6129e4fb031afa1998385c2392e0b45a
|
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9weXRob24zCgppbXBvcnQgb3MKPHxmaW1faG9sZXw+CmNsYXNzIENvbmt5SW5pdCgpOgoKICAgICIiIkRvY3N0cmluZyBmb3IgQ29ua3lJbml0LiAiIiIKCiAgICBkZWYgX19pbml0X18oc2VsZik6CiAgICAgICAgIiIiVE9ETzogdG8gYmUgZGVmaW5lZDEuICIiIgogICAgICAgIGNvbmtpZXMgPSBbJ3dha2Fjb25reScsICdnaXRjb25reSddCiAgICAgICAgc3VjY2Vzc2Z1bFN0YXJ0ID0gW10KICAgICAgICBmb3IgY29ua3kgaW4gY29ua2llczoKICAgICAgICAgICAgZmlsZVBhdGggPSBvcy5wYXRoLmV4cGFuZHVzZXIoJ34vLndha2Fjb25reS8uJykgKyBjb25reQogICAgICAgICAgICBwaWQgPSBzZWxmLmNhbGxDb25reShmaWxlUGF0aCkKICAgICAgICAgICAgc3VjY2Vzc2Z1bFN0YXJ0LmFwcGVuZChwaWQpCgogICAgICAgIGZvciBwaWQgaW4gc3VjY2Vzc2Z1bFN0YXJ0OgogICAgICAgICAgICBpZiBub3QgaXNpbnN0YW5jZShwaWQsIG51bWJlcnMuTnVtYmVyKToKICAgICAgICAgICAgICAgIHByaW50KCdFUlJPUiAjIyMjJykKICAgICAgICAgICAgICAgIHByaW50KCdDb3VsZCBub3Qgc3RhcnQgY29ua3k6ICcgKyBjb25raWVzW3N1Y2Nlc3NmdWxTdGFydC5pbmRleChwaWQpXSkKICAgICAgICAgICAgICAgIHByaW50KCdTb3JyeS4uLicpCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBwcmludCgnU3RhcnRpbmcgY29ua3kgJyArIGNvbmtpZXNbc3VjY2Vzc2Z1bFN0YXJ0LmluZGV4KHBpZCldICsnLiBQSUQ6ICcgKyBzdHIocGlkKSkKCiAgICBkZWYgY2FsbENvbmt5KHNlbGYsIGNvbmt5cmMpOgogICAgICAgICIiIlRPRE86IERvY3N0cmluZyBmb3IgY2FsbENvbmt5LgoKICAgICAgICA6Y29ua3lyYzogVE9ETwogICAgICAgIDpyZXR1cm5zOiBUT0RPCgogICAgICAgICIiIgogICAgICAgIHAgPSBzdWJwcm9jZXNzLlBvcGVuKFsnY29ua3knLCAnLXEnLCAnLWMnLCBjb25reXJjXSkKICAgICAgICBwaWQgPSBwLnBpZAogICAgICAgIHJldHVybiBwaWQKCgppZiBfX25hbWVfXyA9PSAnX19tYWluX18nOgogICAgYyA9IENvbmt5SW5pdCgpCjx8ZmltX3N1ZmZpeHw+CmltcG9ydCBwcHJpbnQKaW1wb3J0IG51bWJlcnMKaW1wb3J0IHN1YnByb2Nlc3MKCjx8ZmltX2VuZHw+
|
34ffa03d6129e4fb031afa1998385c2392e0b45a-2
|
34ffa03d6129e4fb031afa1998385c2392e0b45a
|
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9weXRob24zCgppbXBvcnQgb3MKaW1wb3J0IHBwcmludAppbXBvcnQgbnVtYmVycwppbXBvcnQgc3VicHJvY2VzcwoKY2xhc3MgQ29ua3lJbml0KCk6CgogICAgIiIiRG9jc3RyaW5nIGZvciBDb25reUluaXQuICIiIgoKICAgIGRlZiBfX2luaXRfXyhzZWxmKToKICAgICAgICAiIiJUT0RPOiB0byBiZSBkZWZpbmVkMS4gIiIiCiAgICAgICAgY29ua2llcyA9IFsnd2FrYWNvbmt5JywgJ2dpdGNvbmt5J10KICAgICAgICBzdWNjZXNzZnVsU3RhcnQgPSBbXQogICAgICAgIGZvciBjb25reSBpbiBjb25raWVzOgogICAgICAgICAgICBmaWxlUGF0aCA9IG9zLnBhdGguZXhwYW5kdXNlcignfi8ud2FrYWNvbmt5Ly4nKSArIGNvbmt5CiAgICAgICAgICAgIHBpZCA9IHNlbGYuY2FsbENvbmt5KGZpbGVQYXRoKQogICAgICAgICAgICBzdWNjZXNzZnVsU3RhcnQuYXBwZW5kKHBpZCkKCiAgICAgICAgZm9yIHBpZCBpbiBzdWNjZXNzZnVsU3RhcnQ6CiAgICAgICAgICAgIGlmIG5vdCBpc2luc3RhbmNlKHBpZCwgbnVtYmVycy5OdW1iZXIpOgogICAgICAgICAgICAgICAgcHJpbnQoJ0VSUk9SICMjIyMnKQo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgICAgICAgICBwcmludCgnQ291bGQgbm90IHN0YXJ0IGNvbmt5OiAnICsgY29ua2llc1tzdWNjZXNzZnVsU3RhcnQuaW5kZXgocGlkKV0pCiAgICAgICAgICAgICAgICBwcmludCgnU29ycnkuLi4nKQo8fGZpbV9lbmR8Pg==
|
85d6d2d2a5546d56e272783003eceaae89ff28e7-1
|
85d6d2d2a5546d56e272783003eceaae89ff28e7
|
PHxmaW1fcHJlZml4fD4KbmsgPSBpbnB1dCgpLnJzdHJpcCgpLnNwbGl0KCkKbiA9IGludChua1swXSkKayA9IGludChua1sxXSkKYmlsbCA9IGxpc3QobWFwKGludCwgaW5wdXQoKS5yc3RyaXAoKS5zcGxpdCgpKSkKYiA9IGludChpbnB1dCgpLnN0cmlwKCkpCgptID0gc3VtKGJpbGwpCncgPSBtIC0gYmlsbFtrXQo8fGZpbV9ob2xlfD4KICAgIHByaW50KGIgLSB3IC8vIDIpCjx8ZmltX3N1ZmZpeHw+CgppZiBiIC0gdyAvLyAyID09IDA6CiAgICBwcmludCgiQm9uIEFwcGV0aXQiKQplbHNlOgo8fGZpbV9lbmR8Pg==
|
85d6d2d2a5546d56e272783003eceaae89ff28e7-2
|
85d6d2d2a5546d56e272783003eceaae89ff28e7
|
PHxmaW1fcHJlZml4fD4KbmsgPSBpbnB1dCgpLnJzdHJpcCgpLnNwbGl0KCkKbiA9IGludChua1swXSkKayA9IGludChua1sxXSkKYmlsbCA9IGxpc3QobWFwKGludCwgaW5wdXQoKS5yc3RyaXAoKS5zcGxpdCgpKSkKYiA9IGludChpbnB1dCgpLnN0cmlwKCkpCgptID0gc3VtKGJpbGwpCncgPSBtIC0gYmlsbFtrXQoKaWYgYiAtIHcgLy8gMiA9PSAwOgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICBwcmludCgiQm9uIEFwcGV0aXQiKQo8fGZpbV9lbmR8Pg==
|
85d6d2d2a5546d56e272783003eceaae89ff28e7-3
|
85d6d2d2a5546d56e272783003eceaae89ff28e7
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgpiID0gaW50KGlucHV0KCkuc3RyaXAoKSkKCm0gPSBzdW0oYmlsbCkKdyA9IG0gLSBiaWxsW2tdCgppZiBiIC0gdyAvLyAyID09IDA6CiAgICBwcmludCgiQm9uIEFwcGV0aXQiKQplbHNlOgogICAgcHJpbnQoYiAtIHcgLy8gMikKPHxmaW1fc3VmZml4fD4KbmsgPSBpbnB1dCgpLnJzdHJpcCgpLnNwbGl0KCkKbiA9IGludChua1swXSkKayA9IGludChua1sxXSkKYmlsbCA9IGxpc3QobWFwKGludCwgaW5wdXQoKS5yc3RyaXAoKS5zcGxpdCgpKSkKPHxmaW1fZW5kfD4=
|
85d6d2d2a5546d56e272783003eceaae89ff28e7-4
|
85d6d2d2a5546d56e272783003eceaae89ff28e7
|
PHxmaW1fcHJlZml4fD4KbmsgPSBpbnB1dCgpLnJzdHJpcCgpLnNwbGl0KCkKbiA9IGludChua1swXSkKayA9IGludChua1sxXSkKYmlsbCA9IGxpc3QobWFwKGludCwgaW5wdXQoKS5yc3RyaXAoKS5zcGxpdCgpKSkKYiA9IGludChpbnB1dCgpLnN0cmlwKCkpCgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+Cm0gPSBzdW0oYmlsbCkKdyA9IG0gLSBiaWxsW2tdCgppZiBiIC0gdyAvLyAyID09IDA6Cjx8ZmltX2VuZHw+
|
85d6d2d2a5546d56e272783003eceaae89ff28e7-5
|
85d6d2d2a5546d56e272783003eceaae89ff28e7
|
PHxmaW1fcHJlZml4fD4KbmsgPSBpbnB1dCgpLnJzdHJpcCgpLnNwbGl0KCkKbiA9IGludChua1swXSkKayA9IGludChua1sxXSkKYmlsbCA9IGxpc3QobWFwKGludCwgaW5wdXQoKS5yc3RyaXAoKS5zcGxpdCgpKSkKYiA9IGludChpbnB1dCgpLnN0cmlwKCkpCgptID0gc3VtKGJpbGwpCjx8ZmltX2hvbGV8PgplbHNlOgogICAgcHJpbnQoYiAtIHcgLy8gMikKPHxmaW1fc3VmZml4fD4KdyA9IG0gLSBiaWxsW2tdCgppZiBiIC0gdyAvLyAyID09IDA6CiAgICBwcmludCgiQm9uIEFwcGV0aXQiKQo8fGZpbV9lbmR8Pg==
|
fd40de68d90541a3be9a7794c34a1823b4122feb-1
|
fd40de68d90541a3be9a7794c34a1823b4122feb
|
PHxmaW1fcHJlZml4fD4KZnJvbSBlc3Bob21lLmNvbXBvbmVudHMgaW1wb3J0IHRpbWUgYXMgdGltZV8KaW1wb3J0IGVzcGhvbWUuY29uZmlnX3ZhbGlkYXRpb24gYXMgY3YKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgppbXBvcnQgZXNwaG9tZS5jb2RlZ2VuIGFzIGNnCmZyb20gZXNwaG9tZS5jb25zdCBpbXBvcnQgQ09ORl9JRApmcm9tIC4uIGltcG9ydCBob21lYXNzaXN0YW50X25zCgo8fGZpbV9lbmR8Pg==
|
fd40de68d90541a3be9a7794c34a1823b4122feb-2
|
fd40de68d90541a3be9a7794c34a1823b4122feb
|
PHxmaW1fcHJlZml4fD4KZnJvbSBlc3Bob21lLmNvbXBvbmVudHMgaW1wb3J0IHRpbWUgYXMgdGltZV8KaW1wb3J0IGVzcGhvbWUuY29uZmlnX3ZhbGlkYXRpb24gYXMgY3YKaW1wb3J0IGVzcGhvbWUuY29kZWdlbiBhcyBjZwpmcm9t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AgICAgICAgICAgIwogICAgICAgICAgICAgICAgIyBKb2luIHRoZSB0d28gdG8gcmVjZWl2ZSBhdHRyaWJ1dGUgY29kZXMKICAgICAgICAgICAgICAgIG5hbWVfdG9fY29kZV9tYXAgPSB7fQogICAgICAgICAgICAgICAgZm9yIGF0dHIgaW4gY2x1c3Rlcl9kZWZpbml0aW9uLmF0dHJpYnV0ZXM6CiAgICAgICAgICAgICAgICAgICAgbmFtZV90b19jb2RlX21hcFthdHRyLmRlZmluaXRpb24ubmFtZV0gPSBhdHRyLmRlZmluaXRpb24uY29kZQoKICAgICAgICAgICAgICAgIGF0dHJpYnV0ZV9jb2RlcyA9IHNldCgpCiAgICAgICAgICAgICAgICAjIEZvciBhbGwgdGhlIGluc3RhbnRpYXRlZCBhdHRyaWJ1dGVzLCBmaWd1cmUgb3V0IHRoZWlyIGNvZGUKICAgICAgICAgICAgICAgIGZvciBhdHRyIGluIGNsdXN0ZXIuYXR0cmlidXRlczoKICAgICAgICAgICAgICAgICAgICBpZiBhdHRyLm5hbWUgbm90IGluIG5hbWVfdG9fY29kZV9tYXA6CiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX0FkZExpbnRFcnJvcigiQ291bGQgbm90IGZpbmQgYXR0cmlidXRlIGRlZmludGlvbiAobm8gY29kZSkgZm9yICVzOiVzIiAlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY2x1c3Rlci5uYW1lLCBhdHRyLm5hbWUpLCBzZWxmLl9QYXJzZUxvY2F0aW9uKGNsdXN0ZXIucGFyc2VfbWV0YSkpCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlCgogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZV9jb2Rlcy5hZGQobmFtZV90b19jb2RlX21hcFthdHRyLm5hbWVdKQoKICAgICAgICAgICAgICAgICMgTGludGluZyBjb2RlcyBub3cKICAgICAgICAgICAgICAgIGZvciBjaGVjayBpbiBzZWxmLl9tYW5kYXRvcnlfYXR0cmlidXRlczoKICAgICAgICAgICAgICAgICAgICBpZiBjaGVjay5maWx0ZXJfY2x1c3RlciBpcyBub3QgTm9uZSBhbmQgY2hlY2suZmlsdGVyX2NsdXN0ZXIgIT0gY2x1c3Rlcl9kZWZpbml0aW9uLmNvZGU6CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlCgogICAgICAgICAgICAgICAgICAgIGlmIGNoZWNrLmNvZGUgbm90IGluIGF0dHJpYnV0ZV9jb2RlczoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fQWRkTGludEVycm9yKCJFUCVkOiVzIGRvZXMgbm90IGV4cG9zZSAlcyglZCkgYXR0cmlidXRlIiAlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZW5kcG9pbnQubnVtYmVyLCBjbHVzdGVyLm5hbWUsIGNoZWNrLm5hbWUsIGNoZWNrLmNvZGUpLCBzZWxmLl9QYXJzZUxvY2F0aW9uKGNsdXN0ZXIucGFyc2VfbWV0YSkpCgogICAgICAgICAgICBmb3IgcmVxdWlyZW1lbnQgaW4gc2VsZi5fbWFuZGF0b3J5X2NsdXN0ZXJzOgogICAgICAgICAgICAgICAgaWYgcmVxdWlyZW1lbnQuZW5kcG9pbnRfaWQgIT0gZW5kcG9pbnQubnVtYmVyOgogICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlCgogICAgICAgICAgICAgICAgaWYgcmVxdWlyZW1lbnQuY2x1c3Rlcl9jb2RlIG5vdCBpbiBjbHVzdGVyX2NvZGVzOgogICAgICAgICAgICAgICAgICAgIHNlbGYuX0FkZExpbnRFcnJvcigiRW5kcG9pbnQgJWQgZG9lcyBub3QgZXhwb3NlIGNsdXN0ZXIgJXMgKCVkKSIgJQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocmVxdWlyZW1lbnQuZW5kcG9pbnRfaWQsIHJlcXVpcmVtZW50LmNsdXN0ZXJfbmFtZSwgcmVx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gICAgIHJldHVybiByZXN1bHQKCiAgICBkZWYgUmVxdWlyZUNvbW1hbmQoc2VsZiwgY21kOiBDbHVzdGVyQ29tbWFuZFJlcXVpcmVtZW50KToKICAgICAgICAiIiJNYXJrIGEgY29tbWFuZCByZXF1aXJlZCIiIgoKICAgICAgICBpZiBjbWQuY2x1c3Rlcl9jb2RlIGluIHNlbGYuX21hbmRhdG9yeV9jb21tYW5kczoKICAgICAgICAgICAgc2VsZi5fbWFuZGF0b3J5X2NvbW1hbmRzW2NtZC5jbHVzdGVyX2NvZGVdLmFwcGVuZChjbWQpCiAgICAgICAgZWxzZToKICAgICAgICAgICAgc2VsZi5fbWFuZGF0b3J5X2NvbW1hbmRzW2NtZC5jbHVzdGVyX2NvZGVdID0gW2NtZF0KCiAgICBkZWYgX0xpbnRJbXBsKHNlbGYpOgogICAgICAgIGZvciBjbHVzdGVyIGluIHNlbGYuX2lkbC5jbHVzdGVyczoKICAgICAgICAgICAgaWYgY2x1c3Rlci5zaWRlICE9IENsdXN0ZXJTaWRlLlNFUlZFUjoKICAgICAgICAgICAgICAgIGNvbnRpbnVlICAjIG9ubHkgdmFsaWRhdGUgc2VydmVyLXNpZGU6CgogICAgICAgICAgICBpZiBjbHVzdGVyLmNvZGUgbm90IGluIHNlbGYuX21hbmRhdG9yeV9jb21tYW5kczoKICAgICAgICAgICAgICAgIGNvbnRpbnVlICAjIG5vIGtub3duIG1hbmRhdG9yeSBjb21tYW5kcwoKICAgICAgICAgICAgZGVmaW5lZF9jb21tYW5kcyA9IHNldChbYy5jb2RlIGZvciBjIGluIGNsdXN0ZXIuY29tbWFuZHNdKQoKICAgICAgICAgICAgZm9yIHJlcXVpcmVtZW50IGluIHNlbGYuX21hbmRhdG9yeV9jb21tYW5kc1tjbHVzdGVyLmNvZGVdOgogICAgICAgICAgICAgICAgaWYgcmVxdWlyZW1lbnQuY29tbWFuZF9jb2RlIGluIGRlZmluZWRfY29tbWFuZHM6CiAgICAgICAgICAgICAgICAgICAgY29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bHVzdGVyLnBhcnNlX21ldGEpKQogICAgICAgICAgICAgICAgaWYgbm90IGNsdXN0ZXJfZGVmaW5pdGlvbjoKICAgICAgICAgICAgICAgICAgICBjb250aW51ZQoKICAgICAgICAgICAgICAgIGNsdXN0ZXJfY29kZXMuYWRkKGNsdXN0ZXJfZGVmaW5pdGlvbi5jb2RlKQoKICAgICAgICAgICAgICAgICMgQ2x1c3RlciBjb250YWlucyBlbmFibGVkIGF0dHJpYnV0ZXMgYnkgbmFtZQogICAgICAgICAgICAgICAgIyBjbHVzdGVyX2RlZmluaXRpb24gY29udGFpbnMgdGhlIGRlZmluaXRpb24gb2YgdGhlIGF0dHJpYnV0ZXMgdGhlbXNldmVzCiAgICAgICAgICAgICAgICAjCiAgICAgICAgICAgICAgICAjIEpvaW4gdGhlIHR3byB0byByZWNlaXZlIGF0dHJpYnV0ZSBjb2RlcwogICAgICAgICAgICAgICAgbmFtZV90b19jb2RlX21hcCA9IHt9CiAgICAgICAgICAgICAgICBmb3IgYXR0ciBpbiBjbHVzdGVyX2RlZmluaXRpb24uYXR0cmlidXRlczoKICAgICAgICAgICAgICAgICAgICBuYW1lX3RvX2NvZGVfbWFwW2F0dHIuZGVmaW5pdGlvbi5uYW1lXSA9IGF0dHIuZGVmaW5pdGlvbi5jb2RlCgogICAgICAgICAgICAgICAgYXR0cmlidXRlX2NvZGVzID0gc2V0KCkKICAgICAgICAgICAgICAgICMgRm9yIGFsbCB0aGUgaW5zdGFudGlhdGVkIGF0dHJpYnV0ZXMsIGZpZ3VyZSBvdXQgdGhlaXIgY29kZQogICAgICAgICAgICAgICAgZm9yIGF0dHIgaW4gY2x1c3Rlci5hdHRyaWJ1dGVzOgogICAgICAgICAgICAgICAgICAgIGlmIGF0dHIubmFtZSBub3QgaW4gbmFtZV90b19jb2RlX21hcDoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fQWRkTGludEVycm9yKCJDb3VsZCBub3QgZmluZCBhdHRyaWJ1dGUgZGVmaW50aW9uIChubyBjb2RlKSBmb3IgJXM6JXMiICUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjbHVzdGVyLm5hbWUsIGF0dHIubmFtZSksIHNlbGYuX1BhcnNlTG9jYXRpb24oY2x1c3Rlci5wYXJzZV9tZXRhKSkKICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWUKCiAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRlX2NvZGVzLmFkZChuYW1lX3RvX2NvZGVfbWFwW2F0dHIubmFtZV0pCgogICAgICAgICAgICAgICAgIyBMaW50aW5nIGNvZGVzIG5vdwogICAgICAgICAgICAgICAgZm9yIGNoZWNrIGluIHNlbGYuX21hbmRhdG9yeV9hdHRyaWJ1dGVzOgogICAgICAgICAgICAgICAgICAgIGlmIGNoZWNrLmZpbHRlcl9jbHVzdGVyIGlzIG5vdCBOb25lIGFuZCBjaGVjay5maWx0ZXJfY2x1c3RlciAhPSBjbHVzdGVyX2RlZmluaXRpb24uY29kZToKICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWUKCiAgICAgICAgICAgICAgICAgICAgaWYgY2hlY2suY29kZSBub3QgaW4gYXR0cmlidXRlX2NvZGVzOgogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9BZGRMaW50RXJyb3IoIkVQJWQ6JXMgZG9lcyBub3QgZXhwb3NlICVzKCVkKSBhdHRyaWJ1dGUiICUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlbmRwb2ludC5udW1iZXIsIGNsdXN0ZXIubmFtZSwgY2hlY2submFtZSwgY2hlY2suY29kZSksIHNlbGYuX1BhcnNlTG9jYXRpb24oY2x1c3Rlci5wYXJzZV9tZXRhKSkKCiAgICAgICAgICAgIGZvciByZXF1aXJlbWVudCBpbiBzZWxmLl9tYW5kYXRvcnlfY2x1c3RlcnM6CiAgICAgICAgICAgICAgICBpZiByZXF1aXJlbWVudC5lbmRwb2ludF9pZCAhPSBlbmRwb2ludC5udW1iZXI6CiAgICAgICAgICAgICAgICAgICAgY29udGludWUKCiAgICAgICAgICAgICAgICBpZiByZXF1aXJlbWVudC5jbHVzdGVyX2NvZGUgbm90IGluIGNsdXN0ZXJfY29kZXM6CiAgICAgICAgICAgICAgICAgICAgc2VsZi5fQWRkTGludEVycm9yKCJFbmRwb2ludCAlZCBkb2VzIG5vdCBleHBvc2UgY2x1c3RlciAlcyAoJWQpIiAlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChyZXF1aXJlbWVudC5lbmRwb2ludF9pZCwgcmVxdWlyZW1lbnQuY2x1c3Rlcl9uYW1lLCByZXF1aXJlbWVudC5jbHVzdGVyX2NvZGUpLCBsb2NhdGlvbj1Ob25lKQoKCkBkYXRhY2xhc3MKY2xhc3MgQ2x1c3RlckNvbW1hbmRSZXF1aXJlbWVudDoKICAgIGNsdXN0ZXJfY29kZTogaW50CiAgICBjb21tYW5kX2NvZGU6IGludAogICAgY29tbWFuZF9uYW1lOiBzdHIKCgpjbGFzcyBSZXF1aXJlZENvbW1hbmRzUnVsZShFcnJvckFjY3VtdWxhdGluZ1J1bGUpOgogICAgZGVmIF9faW5pdF9fKHNlbGYsIG5hbWUpOgogICAgICAgIHN1cGVyKFJlcXVpcmVkQ29tbWFuZHNSdWxlLCBzZWxmKS5fX2luaXRfXyhuYW1lKQoKICAgICAgICAjIE1hcHMgY2x1c3RlciBpZCB0byBtYW5kYXRvcnkgY2x1c3RlciByZXF1aXJlbWVudAogICAgICAgIHNlbGYuX21hbmRhdG9yeV9jb21tYW5kczogTWFwaW5nW2ludCwgTGlzdFtDbHVzdGVyQ29tbWFuZFJlcXVpcmVtZW50XV0gPSB7fQoKICAgIGRlZiBfX3JlcHJfXyhzZWxmKToKICAgICAgICByZXN1bHQgPSAiUmVxdWlyZWRDb21tYW5kc1J1bGV7XG4iCgogICAgICAgIGlmIHNlbGYuX21hbmRhdG9yeV9jb21tYW5kczoKICAgICAgICAgICAgcmVzdWx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gogICAgICAgICAgICAgICAgY29udGludWUgICMgbm8ga25vd24gbWFuZGF0b3J5IGNvbW1hbmRzCgogICAgICAgICAgICBkZWZpbmVkX2NvbW1hbmRzID0gc2V0KFtjLmNvZGUgZm9yIGMgaW4gY2x1c3Rlci5jb21tYW5kc10pCgogICAgICAgICAgICBmb3IgcmVxdWlyZW1lbnQgaW4gc2VsZi5fbWFuZGF0b3J5X2NvbW1hbmRzW2NsdXN0ZXIuY29kZV06CiAgICAgICAgICAgICAgICBpZiByZXF1aXJlbWVudC5jb21tYW5kX2NvZGUgaW4gZGVmaW5lZF9jb21tYW5kczoKICAgICAgICAgICAgICAgICAgICBjb250aW51ZSAgIyBjb21tYW5kIGV4aXN0cwoKICAgICAgICAgICAgICAgIHNlbGYuX0FkZExpbnRFcnJvcigKICAgICAgICAgICAgICAgICAgICAiQ2x1c3RlciAlcyBkb2VzIG5vdCBkZWZpbmUgbWFuZGF0b3J5IGNvbW1hbmQgJXMoJWQpIiAlICgKICAgICAgICAgICAgICAgICAgICAgICAgY2x1c3Rlci5uYW1lLCByZXF1aXJlbWVudC5jb21tYW5kX25hbWUsIHJlcXVpcmVtZW50LmNvbW1hbmRfY29kZSksCiAgICAgICAgICAgICAgICAgICAgc2VsZi5fUGFyc2VMb2NhdGlvbihjbHVzdGVyLnBhcnNlX21ldGEpCiAgICAgICAgICAgICAgICApCjx8ZmltX3N1ZmZpeHw+CgogICAgZGVmIExpbnRJZGwoc2VsZiwgaWRsOiBJZGwpIC0+IExpc3RbTGludEVycm9yXToKICAgICAgICBzZWxmLl9pZGwgPSBpZGwKICAgICAgICBzZWxmLl9saW50X2Vycm9ycyA9IFtdCjx8ZmltX2VuZHw+
|
85dfbdeacd0bc3ffaccb180e5a39edfcef565da7-3
|
85dfbdeacd0bc3ffaccb180e5a39edfcef565da7
|
PHxmaW1fcHJlZml4fD4KIyBDb3B5cmlnaHQgKGMpIDIwMjIgUHJvamVjdCBDSElQIEF1dGhvcnMKIwojIExpY2Vuc2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ICAgICAgICAgICAgICAgICAgIG5hbWVfdG9fY29kZV9tYXBbYXR0ci5kZWZpbml0aW9uLm5hbWVdID0gYXR0ci5kZWZpbml0aW9uLmNvZGUKCiAgICAgICAgICAgICAgICBhdHRyaWJ1dGVfY29kZXMgPSBzZXQoKQogICAgICAgICAgICAgICAgIyBGb3IgYWxsIHRoZSBpbnN0YW50aWF0ZWQgYXR0cmlidXRlcywgZmlndXJlIG91dCB0aGVpciBjb2RlCiAgICAgICAgICAgICAgICBmb3IgYXR0ciBpbiBjbHVzdGVyLmF0dHJpYnV0ZXM6CiAgICAgICAgICAgICAgICAgICAgaWYgYXR0ci5uYW1lIG5vdCBpbiBuYW1lX3RvX2NvZGVfbWFwOgogICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9BZGRMaW50RXJyb3IoIkNvdWxkIG5vdCBmaW5kIGF0dHJpYnV0ZSBkZWZpbnRpb24gKG5vIGNvZGUpIGZvciAlczolcyIgJQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNsdXN0ZXIubmFtZSwgYXR0ci5uYW1lKSwgc2VsZi5fUGFyc2VMb2NhdGlvbihjbHVzdGVyLnBhcnNlX21ldGEpKQogICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZQoKICAgICAgICAgICAgICAgICAgICBhdHRyaWJ1dGVfY29kZXMuYWRkKG5hbWVfdG9fY29kZV9tYXBbYXR0ci5uYW1lXSkKCiAgICAgICAgICAgICAgICAjIExpbnRpbmcgY29kZXMgbm93CiAgICAgICAgICAgICAgICBmb3IgY2hlY2sgaW4gc2VsZi5fbWFuZGF0b3J5X2F0dHJpYnV0ZXM6CiAgICAgICAgICAgICAgICAgICAgaWYgY2hlY2suZmlsdGVyX2NsdXN0ZXIgaXMgbm90IE5vbmUgYW5kIGNoZWNrLmZpbHRlcl9jbHVzdGVyICE9IGNsdXN0ZXJfZGVmaW5pdGlvbi5jb2RlOgogICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZQoKICAgICAgICAgICAgICAgICAgICBpZiBjaGVjay5jb2RlIG5vdCBpbiBhdHRyaWJ1dGVfY29kZXM6CiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX0FkZExpbnRFcnJvcigiRVAlZDolcyBkb2VzIG5vdCBleHBvc2UgJXMoJWQpIGF0dHJpYnV0ZSIgJQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGVuZHBvaW50Lm51bWJlciwgY2x1c3Rlci5uYW1lLCBjaGVjay5uYW1lLCBjaGVjay5jb2RlKSwgc2VsZi5fUGFyc2VMb2NhdGlvbihjbHVzdGVyLnBhcnNlX21ldGEpKQoKICAgICAgICAgICAgZm9yIHJlcXVpcmVtZW50IGluIHNlbGYuX21hbmRhdG9yeV9jbHVzdGVyczoKICAgICAgICAgICAgICAgIGlmIHJlcXVpcmVtZW50LmVuZHBvaW50X2lkICE9IGVuZHBvaW50Lm51bWJlcjoKICAgICAgICAgICAgICAgICAgICBjb250aW51ZQoKICAgICAgICAgICAgICAgIGlmIHJlcXVpcmVtZW50LmNsdXN0ZXJfY29kZSBub3QgaW4gY2x1c3Rlcl9jb2RlczoKICAgICAgICAgICAgICAgICAgICBzZWxmLl9BZGRMaW50RXJyb3IoIkVuZHBvaW50ICVkIGRvZXMgbm90IGV4cG9zZSBjbHVzdGVyICVzICglZCkiICUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHJlcXVpcmVtZW50LmVuZHBvaW50X2lkLCByZXF1aXJlbWVudC5jbHVzdGVyX25hbWUsIHJlcXVpcmVtZW50LmNsdXN0ZXJfY29kZSksIGxvY2F0aW9uPU5vbmUpCgoKQGRhdGFjbGFzcwpjbGFzcyBDbHVzdGVyQ29tbWFuZFJlcXVpcmVtZW50OgogICAgY2x1c3Rlcl9jb2RlOiBpbnQKICAgIGNvbW1hbmRfY29kZTogaW50CiAgICBjb21tYW5kX25hbWU6IHN0cgoKCmNsYXNzIFJlcXVpcm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CiAgICAgICAgZWxzZToKICAgICAgICAgICAgc2VsZi5fbWFuZGF0b3J5X2NvbW1hbmRzW2NtZC5jbHVzdGVyX2NvZGVdID0gW2NtZF0KCiAgICBkZWYgX0xpbnRJbXBsKHNlbGYpOgogICAgICAgIGZvciBjbHVzdGVyIGluIHNlbGYuX2lkbC5jbHVzdGVyczoKICAgICAgICAgICAgaWYgY2x1c3Rlci5zaWRlICE9IENsdXN0ZXJTaWRlLlNFUlZFUjoKICAgICAgICAgICAgICAgIGNvbnRpbnVlICAjIG9ubHkgdmFsaWRhdGUgc2VydmVyLXNpZGU6CgogICAgICAgICAgICBpZiBjbHVzdGVyLmNvZGUgbm90IGluIHNlbGYuX21hbmRhdG9yeV9jb21tYW5kczoKICAgICAgICAgICAgICAgIGNvbnRpbnVlICAjIG5vIGtub3duIG1hbmRhdG9yeSBjb21tYW5kcwoKICAgICAgICAgICAgZGVmaW5lZF9jb21tYW5kcyA9IHNldChbYy5jb2RlIGZvciBjIGluIGNsdXN0ZXIuY29tbWFuZHNdKQoKICAgICAgICAgICAgZm9yIHJlcXVpcmVtZW50IGluIHNlbGYuX21hbmRhdG9yeV9jb21tYW5kc1tjbHVzdGVyLmNvZGVdOgogICAgICAgICAgICAgICAgaWYgcmVxdWlyZW1lbnQuY29tbWFuZF9jb2RlIGluIGRlZmluZWRfY29tbWFuZHM6CiAgICAgICAgICAgICAgICAgICAgY29udGludWUgICMgY29tbWFuZCBleGlzdHMKCiAgICAgICAgICAgICAgICBzZWxmLl9BZGRMaW50RXJyb3IoCiAgICAgICAgICAgICAgICAgICAgIkNsdXN0ZXIgJXMgZG9lcyBub3QgZGVmaW5lIG1hbmRhdG9yeSBjb21tYW5kICVzKCVkKSIgJSAoCiAgICAgICAgICAgICAgICAgICAgICAgIGNsdXN0ZXIubmFtZSwgcmVxdWlyZW1lbnQuY29tbWFuZF9uYW1lLCByZXF1aXJlbWVudC5jb21tYW5kX2NvZGUpLAogICAgICAgICAgICAgICAgICAgIHNlbG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zotMl0pICAgIAo8fGZpbV9zdWZmaXh8PgogICAgICAgIGlmIGNvbW1hbmQgPT0gJ211bHRpcGx5JzoKICAgICAgICAgICAgbHN0W2luZGV4XzFdICo9IGxzdFtpbmRleF8yXQogICAgICAgIGVsaWYgY29tbWFuZCA9PSAnc3dhcCc6CiAgICAgICAgICAgIHRtcCA9IGxzdFtpbmRleF8xXQo8fGZpbV9lbmR8Pg==
|
7b039e07ed6990db4d5d485804239a4a1747a958-4
|
7b039e07ed6990db4d5d485804239a4a1747a958
|
PHxmaW1fcHJlZml4fD4KIyBZb3UgYXJlIGdpdmVuIGFuIGFycmF5IHdpdGggaW50ZWdlcnMuIFdyaXRlIGEgcHJvZ3JhbSB0byBtb2RpZnkgdGhlIGVsZW1lbnRzIGFmdGVyIHJlY2VpdmluZyB0aGUgZm9sbG93aW5nIGNvbW1hbmRzOgojIOKAogkic3dhcCB7aW5kZXgxfSB7aW5kZXgyfSIgdGFrZXMgdHdvIGVsZW1lbnRzIGFuZCBzd2FwIHRoZWlyIHBsYWNlcy4KPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgojIOKAogkibXVsdGlwbHkge2luZGV4MX0ge2luZGV4Mn0iIHRha2VzIGVsZW1lbnQgYXQgdGhlIDFzdCBpbmRleCBhbmQgbXVsdGlwbHkgaXQgd2l0aCB0aGUgZWxlbWVudCBhdCAybmQgaW5kZXguIFNhdmUgdGhlIHByb2R1Y3QgYXQgdGhlIDFzdCBpbmRleC4KIyDigKIJImRlY3JlYXNlIiBkZWNyZWFzZXMgYWxsIGVsZW1lbnRzIGluIHRoZSBhcnJheSB3aXRoIDEuCgojIElucHV0Cjx8ZmltX2VuZHw+
|
9e6e3f0819796fc4c43610e15c732829753c9653-1
|
9e6e3f0819796fc4c43610e15c732829753c9653
|
PHxmaW1fcHJlZml4fD4KIyEvdXNyL2Jpbi9lbnYgcHl0aG9uCiMKIyBtbXMtY2FyZC11cGRhdGVyLnB5CiMgQSBkZXNrdG9wIG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WQiICUgKCBsZW4oIGJ1ZmZlckFycmF5KSwgKSkKICAgICAgICAjIHNlYXJjaCBmb3IgdGhlIDB4MDIgY2hhciwgd2hpY2ggaXMgdGhlIHN0YXJ0IG9mIHRoZSBjYXJkCiAgICAgICAgdHJ5OgogICAgICAgICAgICBzdGFydEluZGV4ID0gYnVmZmVyQXJyYXkuaW5kZXgoICdceDAyJykKICAgICAgICAgICAgZW5kSW5kZXggPSBidWZmZXJBcnJheS5pbmRleCggJ1x4MDMnKQogICAgICAgICAgICAjcHJpbnQoICIgICAgICAgU3RhcnQgSW5kZXg6ICVkIiAlICggc3RhcnRJbmRleCwgKSkKICAgICAgICAgICAgI3ByaW50KCAiICAgICAgIEVuZCBJbmRleDogJWQiICUgKCBlbmRJbmRleCwgKSkKICAgICAgICAgICAgI3ByaW50KCAiICAgICAgIGxlbmd0aDogJWQiICUgKCBlbmRJbmRleCAtIHN0YXJ0SW5kZXgsICkpCiAgICAgICAgICAgIHByaW50KCAiICAgICAgIHZhbHVlOiAlcyIgJSAoICcnLmpvaW4oIGJ1ZmZlckFycmF5WyBzdGFydEluZGV4ICsgMTogc3RhcnRJbmRleCArIDExXSksICkpCiAgICAgICAgICAgICMgUmVtb3ZlIHRoZSBjYXJkIHJlYWQgZnJvbSB0aGUgYnVmZmVyCiAgICAgICAgICAgIGJ1ZmZlckFycmF5ID0gYnVmZmVyQXJyYXlbIGVuZEluZGV4ICsgMTogXQogICAgICAgIGV4Y2VwdDoKICAgICAgICAgICAgcGFzcwoKZGVmIHJlYWRfZnJvbV9wb3J0KCBzZXIpOgogICAgZ2xvYmFsIGNvbm5lY3RlZAogICAgZ2xvYmFsIGV4aXRGbGFnCiAgICB3aGlsZSBub3QgY29ubmVjdGVkOgogICAgICAgIGNvbm5lY3RlZCA9IFRydWUKICAgICAgICAKICAgICAgICB3aGlsZSBub3QgZXhpdEZsYWc6CiAgICAgICAgICAgIHJlYWRpbmcgPSBzZXIucmVhZCgpICMgcmVhZCBhIGJ5dG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FVzdWFsbHkgY2F0Y2hpbmcgdGhlIGtleWJvYXJkIGludGVycnVwdAogICAgICAgICAgICBleGl0RmxhZyA9IFRydWUKCmlmIF9fbmFtZV9fID09ICdfX21haW5fXyc6CgltYWluKCkKPHxmaW1fc3VmZml4fD4KIyBUaGUgaW5pdGlhbCB0ZXN0IHZlcnNpb24gd2lsbCBydW4gaW4gdGhlIGNvbW1hbmQgbGluZSBhbmQgd2lsbCBqdXN0IG91dHB1dCB0aGUgY2FyZCByZWFkcyB0byB0aGUgY29uc29sZS4KCiMjIyBJTVBPUlRTICMjIwppbXBvcnQgdGltZQo8fGZpbV9lbmR8Pg==
|
e9b94b64ce093f1a0f1d8af8242a446976d7b6e5-1
|
e9b94b64ce093f1a0f1d8af8242a446976d7b6e5
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KaW1wb3J0IF9za19mYWlsOyBfc2tfZmFpbC5fKCJpbXB1dGlsIikKPHxmaW1fZW5kfD4=
|
e9b94b64ce093f1a0f1d8af8242a446976d7b6e5-2
|
e9b94b64ce093f1a0f1d8af8242a446976d7b6e5
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KaW1wb3J0IF9za19mYWlsOyBfc2tfZmFpbC5fKCJpbXB1dGlsIikKPHxmaW1fZW5kfD4=
|
2f77a672074b064df1234b8489a9fe4218743236-1
|
2f77a672074b064df1234b8489a9fe4218743236
|
PHxmaW1fcHJlZml4fD4KZm9yIGMgaW4gcmFuZ2UoMiwgNTEsMik6CiAgICBwcmludChjLCBlbmQ9JyAnKQo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CnByaW50KCdGSU0hJykKPHxmaW1fZW5kfD4=
|
2f77a672074b064df1234b8489a9fe4218743236-2
|
2f77a672074b064df1234b8489a9fe4218743236
|
PHxmaW1fcHJlZml4fD4KZm9yIGMgaW4gcmFuZ2UoMiwgNTEsMik6Cjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgIHByaW50KGMsIGVuZD0nICcpCjx8ZmltX2VuZHw+
|
2f77a672074b064df1234b8489a9fe4218743236-3
|
2f77a672074b064df1234b8489a9fe4218743236
|
PHxmaW1fcHJlZml4fD4KZm9yIGMgaW4gcmFuZ2UoMiwgNTEsMik6CiAgICBwcmludChjLCBlbmQ9JyAnKQo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CnByaW50KCdGSU0hJykKPHxmaW1fZW5kfD4=
|
1fe1064501826fa6789ab7d46612717541035c73-1
|
1fe1064501826fa6789ab7d46612717541035c73
|
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHRlbXBmaWxlCmltcG9ydCB1bml0dGVzdApmcm9tIGNvbnRleHRsaWIgaW1wb3J0IGNvbnRleHRtYW5hZ2VyCmZyb20gcGF0aGxpYiBpbXBvcnQgUGF0aApmcm9tIHVuaXR0ZXN0IGltcG9ydCBtb2NrCgpmcm9tIHNvdW5kc2VwLmNvcmUuaW8gaW1wb3J0ICgKICAgIGNvbW1vbl9zdWJzZXF1ZW5jZSwKICAgIGdyb3VwX2ZpbGVzX2J5X3BhdHRlcm4sCiAgICBndWVzc19maWxlbmFtZV9wYXR0ZXJuLAogICAgc2VhcmNoX2Zvcl93YXZzCikKCgpkZWYgbW9ja19zb3VuZGZpbGVfbWV0YWRhdGEoKToKICAgIEBjb250ZXh0bWFuYWdlcgogICAgZGVmIF9tb2NrX3NvdW5kZmlsZShwYXRoKToKICAgICAgICBpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmEoci9yZWM6czFfY2gwLTAwMTIzLndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAgICBvYmouZnJhbWVzID0gMjAKICAgICAgICAgICAgb2JqLnNhbXBsZXJhdGUgPSA0NDEwMAogICAgICAgICAgICBvYmouY2hhbm5lbHMgPSAxCiAgICAgICAgZWxpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmFyL3JlYzpzMV9jaDEtMDIzMXwyLndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAgICBvYmouZnJhbWVzID0gMjAKICAgICAgICAgICAgb2JqLnNhbXBsZXJhdGUgPSA0NDEwMAogICAgICAgICAgICBvYmouY2hhbm5lbHMgPSAyCiAgICAgICAgZWxpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmEpci9yZWM6czJfY2gwLTEyfDM0NS53YXYiKSk6CiAgICAgICAgICAgIG9iaiA9IG1vY2suTWFnaWNNb2NrKCkKICAgICAgICAgICAgb2JqLmZyYW1lcyA9IDQ0CiAgICAgICAgICAgIG9iai5zYW1wbGVyYXRlID0gNDQxMDAKICAgICAgICAgICAgb2JqLmNoYW5uZWxzID0gMQogICAgICAgIGVsaWYgcGF0aCA9PSBzdHIoUGF0aCgiZm9vL2Jhci9yZWM6czJfY2gxLTQyMzU4LndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAgICBvYmouZnJhbWVzID0gNDQKICAgICAgICAgICAgb2JqLnNhbXBsZXJhdGUgPSA0NDEwMAogICAgICAgICAgICBvYmouY2hhbm5lbHMgPSAyCgogICAgICAgIHlpZWxkIG9iagogICAgcmV0dXJuIF9tb2NrX3NvdW5kZmlsZQoKCmNsYXNzIFRlc3RJb0Z1bmN0aW9ucyh1bml0dGVzdC5UZXN0Q2FzZSk6CiAgICBkZWYgdGVzdF9zZWFyY2hfZm9yX3dhdnMoc2VsZik6CiAgICAgICAgIiIiVGVzdCB0aGF0IHNlYXJjaCBmb3Igd2F2cyByZXR1cm5zIGFic29sdXRlIHBhdGhzIiIiCiAgICAgICAgd2l0aCB0ZW1wZmlsZS5UZW1wb3JhcnlEaXJlY3RvcnkoKSBhcyB0ZW1wX2Jhc2U6CiAgICAgICAgICAgIHRlbXBfYmFzZSA9IFBhdGgodGVtcF9iYXNlKQoKICAgICAgICAgICAgIyBDcmVhdGUgYSBkdW1teSBmaWxlc3lzdGVtCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAiZmluZG1lMy53YXYiKS50b3VjaCgpCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAiZG9udGZpbmRtZTIudHh0IikudG91Y2goKQogICAgICAgICAgICAodGVtcF9iYXNlIC8gInN1YmRpcjEiKS5ta2RpcigpCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAic3ViZGlyMSIgLyAiZmluZG1lMS53YXYiKS50b3VjaCgpCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAic3ViZGlyMSIgLyAiZG9udGZpbmRtZTEudHh0IikudG91Y2goKQogICAgICAgICAgICAodGVtcF9iYXNlIC8gInN1YmRpcjIiKS5ta2RpcigpCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAic3ViZGlyMiIgLyAiZmluZG1lMi53YXYiKS50b3VjaCgpCgogICAgICAgICAgICByZXN1bHQgPSBzZWFyY2hfZm9yX3dhdnModGVtcF9iYXNlLCByZWN1cnNpdmU9RmFsc2UpCiAgICAgICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwocmVzdWx0LCBbdGVtcF9iYXNlIC8gImZpbmRtZTMud2F2Il0pCgogICAgICAgICAgICByZXN1bHRfcmVjdXJzaXZlID0gc2VhcmNoX2Zvcl93YXZzKHRlbXBfYmFzZSwgcmVjdXJzaXZlPVRydWUpCiAgICAgICAgICAgICMgVGhpcyB0ZXN0cyB0aGF0IHRoZSBjb250ZW50cyBvZiB0aGUgbGlzdHMgYXJlIHRoZSBzYW1lCiAgICAgICAgICAgIHNlbGYuYXNzZXJ0Q291bnRFcXVhbChyZXN1bHRfcmVjdXJzaXZlLAogICAgICAgICAgICAgICAgWwogICAgICAgICAgICAgICAgICAgIHRlbXBfYmFzZSAvICJmaW5kbWUzLndhdiIsCiAgICAgICAgICAgICAgICAgICAgdGVtcF9iYXNlIC8gInN1Y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bW1vbl9zdWJzZXF1ZW5jZShzZWxmKToKICAgICAgICBhID0gWwogICAgICAgICAgICAiYXFiY2RmIiwKICAgICAgICAgICAgImFiZWNkZSIsCiAgICAgICAgICAgICJnYnJjZGVmZyIsCiAgICAgICAgICAgICJiY2FjZCIsCiAgICAgICAgXQogICAgICAgIHJlc3VsdCA9IGNvbW1vbl9zdWJzZXF1ZW5jZShhKQogICAgICAgIHNlbGYuYXNzZXJ0TGlzdEVxdWFsKHJlc3VsdCwgWwogICAgICAgICAgICAoImIiLCAiYyIsICJkIiksCiAgICAgICAgXSkKCmNsYXNzIFRlc3RHcm91cEZpbGVzQnlQYXR0ZXJuKHVuaXR0ZXN0LlRlc3RDYXNlKToKCiAgICBkZWYgc2V0VXAoc2VsZik6CiAgICAgICAgc2VsZi5iYXNlX2RpcmVjdG9yeSA9IFBhdGgoImZvby8iKQogICAgICAgIHNlbGYuZmlsZWxpc3QgPSBbCiAgICAgICAgICAgIFBhdGgoImZvby9iYXIvYmF6XzAwMV9jaDAud2F2IiksCiAgICAgICAgICAgIFBhdGgoImZvby9iYXIvYmF6XzAwMV9jaDEud2F2IiksCiAgICAgICAgICAgIFBhdGgoImZvby9iYXIvYmF6XzAwMl9jaDAud2F2IiksCiAgICAgICAgICAgIFBhdGgoImZvby9iYXIvYmF6XzAwMl9jaDEud2F2IiksCiAgICAgICAgICAgIFBhdGgoImZvby9iYXIvYmF6XzAwM19jaDAud2F2IiksCiAgICAgICAgXQoKICAgIEBtb2NrLnBhdGNoKCJzb3VuZHNlcC5jb3JlLmlvLkF1ZGlvRmlsZSIsIGF1dG9zcGVjPVRydWUpCiAgICBkZWYgdGVzdF9ncm91cF9maWxlc19ieV9wYXR0ZXJuX25vX2tleXMoc2VsZiwgbW9ja19hdWRpb2ZpbGUpOgogICAgICAgICIiIlRlc3QgdGhhdCBncm91cCBmaWxlcyB3aXRob3V0IGFueSBwYXJ0aWN1bGFyIHBhdHRlcm4gd29ya3MiIiIKICAgICAgICBncm91cH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kZWYgbW9ja19zb3VuZGZpbGVfbWV0YWRhdGEoKToKICAgIEBjb250ZXh0bWFuYWdlcgogICAgZGVmIF9tb2NrX3NvdW5kZmlsZShwYXRoKToKICAgICAgICBpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmEoci9yZWM6czFfY2gwLTAwMTIzLndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAgICBvYmouZnJhbWVzID0gMjAKICAgICAgICAgICAgb2JqLnNhbXBsZXJhdGUgPSA0NDEwMAogICAgICAgICAgICBvYmouY2hhbm5lbHMgPSAxCiAgICAgICAgZWxpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmFyL3JlYzpzMV9jaDEtMDIzMXwyLndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAgICBvYmouZnJhbWVzID0gMjAKICAgICAgICAgICAgb2JqLnNhbXBsZXJhdGUgPSA0NDEwMAogICAgICAgICAgICBvYmouY2hhbm5lbHMgPSAyCiAgICAgICAgZWxpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmEpci9yZWM6czJfY2gwLTEyfDM0NS53YXYiKSk6CiAgICAgICAgICAgIG9iaiA9IG1vY2suTWFnaWNNb2NrKCkKICAgICAgICAgICAgb2JqLmZyYW1lcyA9IDQ0CiAgICAgICAgICAgIG9iai5zYW1wbGVyYXRlID0gNDQxMDAKICAgICAgICAgICAgb2JqLmNoYW5uZWxzID0gMQogICAgICAgIGVsaWYgcGF0aCA9PSBzdHIoUGF0aCgiZm9vL2Jhci9yZWM6czJfY2gxLTQyMzU4LndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAgICBvYmouZnJhbWVzID0gNDQKICAgICAgICAgICAgb2JqLnNhbXBsZXJhdGUgPSA0NDEwMAogICAgICAgICAgICBvYmouY2hhbm5lbHMgPSAyCgogICAgICAgIHlpZWxkIG9iagogICAgcmV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XJzaXZlID0gc2VhcmNoX2Zvcl93YXZzKHRlbXBfYmFzZSwgcmVjdXJzaXZlPVRydWUpCiAgICAgICAgICAgICMgVGhpcyB0ZXN0cyB0aGF0IHRoZSBjb250ZW50cyBvZiB0aGUgbGlzdHMgYXJlIHRoZSBzYW1lCiAgICAgICAgICAgIHNlbGYuYXNzZXJ0Q291bnRFcXVhbChyZXN1bHRfcmVjdXJzaXZlLAogICAgICAgICAgICAgICAgWwogICAgICAgICAgICAgICAgICAgIHRlbXBfYmFzZSAvICJmaW5kbWUzLndhdiIsCiAgICAgICAgICAgICAgICAgICAgdGVtcF9iYXNlIC8gInN1YmRpcjEiIC8gImZpbmRtZTEud2F2IiwKICAgICAgICAgICAgICAgICAgICB0ZW1wX2Jhc2UgLyAic3ViZGlyMiIgLyAiZmluZG1lMi53YXYiCiAgICAgICAgICAgICAgICBdCiAgICAgICAgICAgICkKCiAgICBAbW9jay5wYXRjaCgic291bmRmaWxlLlNvdW5kRmlsZSIsIG1vY2tfc291bmRmaWxlX21ldGFkYXRhKCkpCiAgICBkZWYgdGVzdF9ndWVzc19maWxlbmFtZV9wYXR0ZXJuKHNlbGYpOgogICAgICAgICIiIlRlc3QgdGhhdCBzZWFyY2ggZm9yIHdhdnMgcmV0dXJucyBhYnNvbHV0ZSBwYXRocyIiIgogICAgICAgIGJhc2VfZGlyZWN0b3J5ID0gUGF0aCgiZm9vLyIpCiAgICAgICAgZmlsZWxpc3QgPSBbCiAgICAgICAgICAgICJmb28vYmEoci9yZWM6czFfY2gwLTAwMTIzLndhdiIsCiAgICAgICAgICAgICJmb28vYmFyL3JlYzpzMV9jaDEtMDIzMXwyLndhdiIsCiAgICAgICAgICAgICJmb28vYmEpci9yZWM6czJfY2gwLTEyfDM0NS53YXYiLAogICAgICAgICAgICAiZm9vL2Jhci9yZWM6czJfY2gxLTQyMzU4LndhdiIsCiAgICAgICAgXQogICAgICAgIGZpbGVsaXN0ID0gW3N0cihQYXRoKHMpKSBmb3IgcyBp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KaW1wb3J0IHRlbXBmaWxlCmltcG9ydCB1bml0dGVzdApmcm9tIGNvbnRleHRsaWIgaW1wb3J0IGNvbnRleHRtYW5hZ2VyCmZyb20gcGF0aGxpYiBpbXBvcnQgUGF0aApmcm9tIHVuaXR0ZXN0IGltcG9ydCBtb2NrCgpmcm9tIHNvdW5kc2VwLmNvcmUuaW8gaW1wb3J0ICgKICAgIGNvbW1vbl9zdWJzZXF1ZW5jZSwKICAgIGdyb3VwX2ZpbGVzX2J5X3BhdHRlcm4sCiAgICBndWVzc19maWxlbmFtZV9wYXR0ZXJuLAogICAgc2VhcmNoX2Zvcl93YXZzCikKCgpkZWYgbW9ja19zb3VuZGZpbGVfbWV0YWRhdGEoKToKICAgIEBjb250ZXh0bWFuYWdlcgogICAgZGVmIF9tb2NrX3NvdW5kZmlsZShwYXRoKToKICAgICAgICBpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmEoci9yZWM6czFfY2gwLTAwMTIzLndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAgICBvYmouZnJhbWVzID0gMjAKICAgICAgICAgICAgb2JqLnNhbXBsZXJhdGUgPSA0NDEwMAogICAgICAgICAgICBvYmouY2hhbm5lbHMgPSAxCiAgICAgICAgZWxpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmFyL3JlYzpzMV9jaDEtMDIzMXwyLndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAgICBvYmouZnJhbWVzID0gMjAKICAgICAgICAgICAgb2JqLnNhbXBsZXJhdGUgPSA0NDEwMAogICAgICAgICAgICBvYmouY2hhbm5lbHMgPSAyCiAgICAgICAgZWxpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmEpci9yZWM6czJfY2gwLTEyfDM0NS53YXYiKSk6CiAgICAgICAgICAgIG9iaiA9IG1vY2suTWFnaWNNb2NrKCkKICAgICAgICAgICAgb2JqLmZyYW1lcyA9I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tZTEudHh0IikudG91Y2goKQogICAgICAgICAgICAodGVtcF9iYXNlIC8gInN1YmRpcjIiKS5ta2RpcigpCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAic3ViZGlyMiIgLyAiZmluZG1lMi53YXYiKS50b3VjaCgpCgogICAgICAgICAgICByZXN1bHQgPSBzZWFyY2hfZm9yX3dhdnModGVtcF9iYXNlLCByZWN1cnNpdmU9RmFsc2UpCiAgICAgICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwocmVzdWx0LCBbdGVtcF9iYXNlIC8gImZpbmRtZTMud2F2Il0pCgogICAgICAgICAgICByZXN1bHRfcmVjdXJzaXZlID0gc2VhcmNoX2Zvcl93YXZzKHRlbXBfYmFzZSwgcmVjdXJzaXZlPVRydWUpCiAgICAgICAgICAgICMgVGhpcyB0ZXN0cyB0aGF0IHRoZSBjb250ZW50cyBvZiB0aGUgbGlzdHMgYXJlIHRoZSBzYW1lCiAgICAgICAgICAgIHNlbGYuYXNzZXJ0Q291bnRFcXVhbChyZXN1bHRfcmVjdXJzaXZlLAogICAgICAgICAgICAgICAgWwogICAgICAgICAgICAgICAgICAgIHRlbXBfYmFzZSAvICJmaW5kbWUzLndhdiIsCiAgICAgICAgICAgICAgICAgICAgdGVtcF9iYXNlIC8gInN1YmRpcjEiIC8gImZpbmRtZTEud2F2IiwKICAgICAgICAgICAgICAgICAgICB0ZW1wX2Jhc2UgLyAic3ViZGlyMiIgLyAiZmluZG1lMi53YXYiCiAgICAgICAgICAgICAgICBdCiAgICAgICAgICAgICkKCiAgICBAbW9jay5wYXRjaCgic291bmRmaWxlLlNvdW5kRmlsZSIsIG1vY2tfc291bmRmaWxlX21ldGFkYXRhKCkpCiAgICBkZWYgdGVzdF9ndWVzc19maWxlbmFtZV9wYXR0ZXJuKHNlbGYpOgogICAgICAgICIiIlRlc3QgdGhhdCBzZWFyY2ggZm9yIHdhdnMgcmV0dXJucyBhYnNvbHV0ZSBwYXRocyIiIgogICAgICAgIGJhc2V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woZ3JvdXBzWzBdWzBdLCAoIjAwMSIsKSkKPHxmaW1fZW5kfD4=
|
1fe1064501826fa6789ab7d46612717541035c73-4
|
1fe1064501826fa6789ab7d46612717541035c73
|
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHRlbXBmaWxlCmltcG9ydCB1bml0dGVzdApmcm9tIGNvbnRleHRsaWIgaW1wb3J0IGNvbnRleHRtYW5hZ2VyCmZyb20gcGF0aGxpYiBpbXBvcnQgUGF0aApmcm9tIHVuaXR0ZXN0IGltcG9ydCBtb2NrCgpmcm9tIHNvdW5kc2VwLmNvcmUuaW8gaW1wb3J0ICgKICAgIGNvbW1vbl9zdWJzZXF1ZW5jZSwKICAgIGdyb3VwX2ZpbGVzX2J5X3BhdHRlcm4sCiAgICBndWVzc19maWxlbmFtZV9wYXR0ZXJuLAogICAgc2VhcmNoX2Zvcl93YXZzCikKCgpkZWYgbW9ja19zb3VuZGZpbGVfbWV0YWRhdGEoKToKICAgIEBjb250ZXh0bWFuYWdlcgogICAgZGVmIF9tb2NrX3NvdW5kZmlsZShwYXRoKToKICAgICAgICBpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmEoci9yZWM6czFfY2gwLTAwMTIzLndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAgICBvYmouZnJhbWVzID0gMjAKICAgICAgICAgICAgb2JqLnNhbXBsZXJhdGUgPSA0NDEwMAogICAgICAgICAgICBvYmouY2hhbm5lbHMgPSAxCiAgICAgICAgZWxpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmFyL3JlYzpzMV9jaDEtMDIzMXwyLndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAgICBvYmouZnJhbWVzID0gMjAKICAgICAgICAgICAgb2JqLnNhbXBsZXJhdGUgPSA0NDEwMAogICAgICAgICAgICBvYmouY2hhbm5lbHMgPSAyCiAgICAgICAgZWxpZiBwYXRoID09IHN0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gICAgICh0ZW1wX2Jhc2UgLyAic3ViZGlyMSIgLyAiZmluZG1lMS53YXYiKS50b3VjaCgpCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAic3ViZGlyMSIgLyAiZG9udGZpbmRtZTEudHh0IikudG91Y2goKQogICAgICAgICAgICAodGVtcF9iYXNlIC8gInN1YmRpcjIiKS5ta2RpcigpCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAic3ViZGlyMiIgLyAiZmluZG1lMi53YXYiKS50b3VjaCgpCgogICAgICAgICAgICByZXN1bHQgPSBzZWFyY2hfZm9yX3dhdnModGVtcF9iYXNlLCByZWN1cnNpdmU9RmFsc2UpCiAgICAgICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwocmVzdWx0LCBbdGVtcF9iYXNlIC8gImZpbmRtZTMud2F2Il0pCgogICAgICAgICAgICByZXN1bHRfcmVjdXJzaXZlID0gc2VhcmNoX2Zvcl93YXZzKHRlbXBfYmFzZSwgcmVjdXJzaXZlPVRydWUpCiAgICAgICAgICAgICMgVGhpcyB0ZXN0cyB0aGF0IHRoZSBjb250ZW50cyBvZiB0aGUgbGlzdHMgYXJlIHRoZSBzYW1lCiAgICAgICAgICAgIHNlbGYuYXNzZXJ0Q291bnRFcXVhbChyZXN1bHRfcmVjdXJzaXZlLAogICAgICAgICAgICAgICAgWwogICAgICAgICAgICAgICAgICAgIHRlbXBfYmFzZSAvICJmaW5kbWUzLndhdiIsCiAgICAgICAgICAgICAgICAgICAgdGVtcF9iYXNlIC8gInN1YmRpcjEiIC8gImZpbmRtZTEud2F2IiwKICAgICAgICAgICAgICAgICAgICB0ZW1wX2Jhc2UgLyAic3ViZGlyMiIgLyAiZmluZG1lMi53YXYiCiAgICAgICAgICAgICAgICBdCiAgICAgICAgICAgICkKCiAgICBAbW9jay5wYXRjaCgic291bmRmaWxlLlNvdW5kRmlsZSIsIG1vY2tfc291bmRmaWxlX21ldGFkYXRhKCkpCiAgICBkZWYgdGVzdF9ndWVzc19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NlbGYuYXNzZXJ0RXF1YWwob2JqWyJibG9ja19pZCJdLCAoIjAwMSIsICIxIikpCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgICAgICAgICAgc2VsZi5hc3NlcnRJc05vbmUob2JqWyJjaGFubmVsX2lkIl0pCgo8fGZpbV9lbmR8Pg==
|
1fe1064501826fa6789ab7d46612717541035c73-5
|
1fe1064501826fa6789ab7d46612717541035c73
|
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHRlbXBmaWxlCmltcG9ydCB1bml0dGVzdApmcm9tIGNvbnRleHRsaWIgaW1wb3J0IGNvbnRleHRtYW5hZ2VyCmZyb20gcGF0aGxpYiBpbXBvcnQgUGF0aApmcm9tIHVuaXR0ZXN0IGltcG9ydCBtb2NrCgpmcm9tIHNvdW5kc2VwLmNvcmUuaW8gaW1wb3J0ICgKICAgIGNvbW1vbl9zdWJzZXF1ZW5jZSwKICAgIGdyb3VwX2ZpbGVzX2J5X3BhdHRlcm4sCiAgICBndWVzc19maWxlbmFtZV9wYXR0ZXJuLAogICAgc2VhcmNoX2Zvcl93YXZzCikKCgpkZWYgbW9ja19zb3VuZGZpbGVfbWV0YWRhdGEoKToKICAgIEBjb250ZXh0bWFuYWdlcgogICAgZGVmIF9tb2NrX3NvdW5kZmlsZShwYXRoKToKICAgICAgICBpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmEoci9yZWM6czFfY2gwLTAwMTIzLndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAgICBvYmouZnJhbWVzID0gMjAKICAgICAgICAgICAgb2JqLnNhbXBsZXJhdGUgPSA0NDEwMAogICAgICAgICAgICBvYmouY2hhbm5lbHMgPSAxCiAgICAgICAgZWxpZiBwYXRoID09IHN0cihQYXRoKCJmb28vYmFyL3JlYzpzMV9jaDEtMDIzMXwyLndhdiIpKToKICAgICAgICAgICAgb2JqID0gbW9jay5NYWdpY01vY2soKQogICAgICAgICAg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pCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAiZG9udGZpbmRtZTIudHh0IikudG91Y2goKQogICAgICAgICAgICAodGVtcF9iYXNlIC8gInN1YmRpcjEiKS5ta2RpcigpCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAic3ViZGlyMSIgLyAiZmluZG1lMS53YXYiKS50b3VjaCgpCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAic3ViZGlyMSIgLyAiZG9udGZpbmRtZTEudHh0IikudG91Y2goKQogICAgICAgICAgICAodGVtcF9iYXNlIC8gInN1YmRpcjIiKS5ta2RpcigpCiAgICAgICAgICAgICh0ZW1wX2Jhc2UgLyAic3ViZGlyMiIgLyAiZmluZG1lMi53YXYiKS50b3VjaCgpCgogICAgICAgICAgICByZXN1bHQgPSBzZWFyY2hfZm9yX3dhdnModGVtcF9iYXNlLCByZWN1cnNpdmU9RmFsc2UpCiAgICAgICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwocmVzdWx0LCBbdGVtcF9iYXNlIC8gImZpbmRtZTMud2F2Il0pCgogICAgICAgICAgICByZXN1bHRfcmVjdXJzaXZlID0gc2VhcmNoX2Zvcl93YXZzKHRlbXBfYmFzZSwgcmVjdXJzaXZlPVRydWUpCiAgICAgICAgICAgICMgVGhpcyB0ZXN0cyB0aGF0IHRoZSBjb250ZW50cyBvZiB0aGUgbGlzdHMgYXJlIHRoZSBzYW1lCiAgICAgICAgICAgIHNlbGYuYXNzZXJ0Q291bnRFcXVhbChyZXN1bHRfcmVjdXJzaXZlLAogICAgICAgICAgICAgICAgWwogICAgICAgICAgICAgICAgICAgIHRlbXBfYmFzZSAvICJmaW5kbWUzLndhdiIsCiAgICAgICAgICAgICAgICAgICAgdGVtcF9iYXNlIC8gInN1YmRpcjEiIC8gImZpbmRtZTEud2F2IiwKICAgICAgICAgICAgICAgICAgICB0ZW1wX2Jhc2UgLyAic3ViZGlyMiIgLyAiZmluZG1lMi53YXYiCiAgICAgICAgICAgICAgIC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ltX3N1ZmZpeHw+CiAgICAgICAgICAgIGZpbGVuYW1lX3BhdHRlcm49c3RyKFBhdGgoImJhci9iYXpfe3RpbWVzdGFtcH1fY2h7Y2hhbm5lbH0ud2F2IikpLAogICAgICAgICAgICBibG9ja19rZXlzPVsidGltZXN0YW1wIl0sCiAgICAgICAgICAgIGNoYW5uZWxfa2V5cz1bImNoYW5uZWwiXQo8fGZpbV9lbmR8Pg==
|
fd0e42bb7ce3cf61092b3b6e49bc1925d7183140-1
|
fd0e42bb7ce3cf61092b3b6e49bc1925d7183140
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSB0d2Fsay50d2FsayBpbXBvcnQgbWFpbgo8fGZpbV9lbmR8Pg==
|
fd0e42bb7ce3cf61092b3b6e49bc1925d7183140-2
|
fd0e42bb7ce3cf61092b3b6e49bc1925d7183140
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSB0d2Fsay50d2FsayBpbXBvcnQgbWFpbgo8fGZpbV9lbmR8Pg==
|
fd0e42bb7ce3cf61092b3b6e49bc1925d7183140-3
|
fd0e42bb7ce3cf61092b3b6e49bc1925d7183140
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSB0d2Fsay50d2FsayBpbXBvcnQgbWFpbgo8fGZpbV9lbmR8Pg==
|
fd0e42bb7ce3cf61092b3b6e49bc1925d7183140-4
|
fd0e42bb7ce3cf61092b3b6e49bc1925d7183140
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KZnJvbSB0d2Fsay50d2FsayBpbXBvcnQgbWFpbgo8fGZpbV9lbmR8Pg==
|
fd0e42bb7ce3cf61092b3b6e49bc1925d7183140-5
|
fd0e42bb7ce3cf61092b3b6e49bc1925d7183140
|
PHxmaW1fcHJl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2VtZW50CgppZiBfX25hbWVfXyA9PSAiX19tYWluX18iOgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICBtYW5hZ2VtZW50LmV4ZWN1dGVfZnJvbV9jb21tYW5kX2xpbmUoKQo8fGZpbV9lbmR8Pg==
|
9e89451d5f68083bae69d62be3d1a6a74d871200-3
|
9e89451d5f68083bae69d62be3d1a6a74d871200
|
PHxmaW1fcHJlZml4fD4KIyEvaG9tZS9jYWVuMjgwNy9hYXAvdmVudi9iaW4vcHl0aG9uMwpmcm9tIGRqYW5nby5jb3JlIGltcG9ydCBtYW5hZ2VtZW50Cgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CmlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6CiAgICBtYW5hZ2VtZW50LmV4ZWN1dGVfZnJvbV9jb21tYW5kX2xpbmUoKQo8fGZpbV9lbmR8Pg==
|
f19e612ba9736e8ce175bf7fdb2764b814189915-1
|
f19e612ba9736e8ce175bf7fdb2764b814189915
|
PHxmaW1fcHJlZml4fD4KCjx8ZmltX2hvbGV8PgpkZWYgbWFpbigpOgogICAgcmV0dXJuIDExMSAqICgobiArIDExMSAtIDEpIC8vIDExMSkKCmlmIF9fbmFtZV9fID09ICdfX21haW5fXyc6CiAgICBhbnMgPSBtYWluKCkKICAgIHByaW50KGFucykKPHxmaW1fc3VmZml4fD4KaW1wb3J0IHN5cwoKbiA9IGludChzeXMuc3RkaW4ucmVhZGxpbmUoKS5yc3RyaXAoKSkKCjx8ZmltX2VuZHw+
|
f19e612ba9736e8ce175bf7fdb2764b814189915-2
|
f19e612ba9736e8ce175bf7fdb2764b814189915
|
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHN5cwoKPHxmaW1faG9sZXw+Cgo8fGZpbV9zdWZmaXh8PgpuID0gaW50KHN5cy5zdGRpbi5yZWFkbGluZSgpLnJzdHJpcCgpKQoKZGVmIG1haW4oKToKICAgIHJldHVybiAxMTEgKiAo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0ZXNfcGVyX2Vwb2NoX3Blcl9uYW1lID0gNDAwCiAgICAgICAgdG90YWxfbG9va3VwcyA9IDAKICAgICAgICB0b3RhbF91cGRhdGVzID0gMAogICAgICAgIG51bV9nZW9fbG9jYWxpdHlfY2hhbmdlcyA9IDMKICAgICAgICBmb3IgaSBpbiByYW5nZShudW1fZ2VvX2xvY2FsaXR5X2NoYW5nZXMpOgogICAgICAgICAgICBudW1fbG9va3VwcyA9IG51bV9uYW1lcyAqIHJlYWRzX3Blcl9lcG9jaF9wZXJfbmFtZQogICAgICAgICAgICBudW1fdXBkYXRlcyA9IG51bV9uYW1lcyAqIHdyaXRlc19wZXJfZXBvY2hfcGVyX25hbWUKICAgICAgICAgICAgZXhwZWN0ZWRfdGltZSA9IChudW1fbG9va3VwcyArIG51bV91cGRhdGVzKSAvIGxlbihsbnNfaWRzKSAvIHJlYWRfd3JpdGVfcmVxX3JhdGUKICAgICAgICAgICAgcHJpbnQgJ1JlYWQgd3JpdGUgc2VuZCB0aW1lJywgZXhwZWN0ZWRfdGltZQogICAgICAgICAgICBhY3R1YWxfbG9va3VwcywgYWN0dWFsX3VwZGF0ZXMgPSBnZW5fZ2VvbG9jYWxpdHlfdHJhY2Uoc2VsZi50cmFjZV9mb2xkZXIsIHNlbGYubG5zX2dlb19maWxlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtYmVyX25hbWVzPW51bV9uYW1lcywgbnVtX2xvb2t1cHM9bnVtX2xvb2t1cHMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1fdXBkYXRlcz1udW1fdXBkYXRlcywgYXBwZW5kX3RvX2ZpbGU9VHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxuc19pZHM9bG5zX2lkcywgbmFtZV9wcmVmaXg9cHJlZml4LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhwX2R1cmF0aW9uPWV4cGVjdGVkX3RpbWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbGl0eV9wYXJhbWV0ZXI9NCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsaXR5X3BlcmNlbnQ9MS4wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtX2xucz1zZWxmLmxucywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlZWQ9KGkrMTAwMCkpCiAgICAgICAgICAgIHRvdGFsX3RpbWUgKz0gZXhwZWN0ZWRfdGltZQogICAgICAgICAgICB0b3RhbF9sb29rdXBzICs9IGFjdHVhbF9sb29rdXBzCiAgICAgICAgICAgIHRvdGFsX3VwZGF0ZXMgKz0gYWN0dWFsX3VwZGF0ZXMKCiAgICAgICAgc2VsZi5jb25maWdfcGFyc2Uuc2V0KENvbmZpZ1BhcnNlci5ERUZBVUxUU0VDVCwgJ2V4cGVyaW1lbnRfcnVuX3RpbWUnLCBzdHIodG90YWxfdGltZSkpCiAgICAgICAgcHJpbnQgJ1RvdGFsIHRpbWU6ICcsIHRvdGFsX3RpbWUKICAgICAgICBvdXRwdXRfc3RhdHMgPSBzZWxmLnJ1bl9leHBfbXVsdGlfbG5zKCkKICAgICAgICBzZWxmLmFzc2VydEVxdWFsKG91dHB1dF9zdGF0cy5yZXF1ZXN0cywgbnVtX25hbWVzICsgdG90YWxfbG9va3VwcyArIHRvdGFsX3VwZGF0ZXMsCiAgICAgICAgICAgICAgICAgIC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ZXMgPSAxCiAgICAgICAgZm9yIGkgaW4gcmFuZ2UobnVtX2dlb19sb2NhbGl0eV9jaGFuZ2VzKToKICAgICAgICAgICAgbnVtX2xvb2t1cHMgPSBudW1fbmFtZXMgKiByZWFkc19wZXJfZXBvY2hfcGVyX25hbWUKICAgICAgICAgICAgbnVtX3VwZGF0ZXMgPSBudW1fbmFtZXMgKiB3cml0ZXNfcGVyX2Vwb2NoX3Blcl9uYW1lCiAgICAgICAgICAgIGV4cGVjdGVkX3RpbWUgPSAobnVtX2xvb2t1cHMgKyBudW1fdXBkYXRlcykgLyAxLjAgLyBsZW4obG5zX2lkcykgLyByZWFkX3dyaXRlX3JlcV9yYXRlCiAgICAgICAgICAgIHByaW50ICdFeHBlY3RlZCB0aW1lJywgZXhwZWN0ZWRfdGltZQogICAgICAgICAgICBhY3R1YWxfbG9va3VwcywgYWN0dWFsX3VwZGF0ZXMgPSBnZW5fZ2VvbG9jYWxpdHlfdHJhY2Uoc2VsZi50cmFjZV9mb2xkZXIsIHNlbGYubG5zX2dlb19maWxlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtYmVyX25hbWVzPW51bV9uYW1lcywgbnVtX2xvb2t1cHM9bnVtX2xvb2t1cHMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1fdXBkYXRlcz1udW1fdXBkYXRlcywgYXBwZW5kX3RvX2ZpbGU9VHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxuc19pZHM9bG5zX2lkcywgbmFtZV9wcmVmaXg9cHJlZml4LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhwX2R1cmF0aW9uPWV4cGVjdGVkX3RpbWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbGl0eV9wYXJhbWV0ZXI9NCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsaXR5X3BlcmNlbnQ9MS4wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtX2xucz1zZWxmLmxucywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlZWQ9KGkrMTAwMCkpCiAgICAgICAgICAgIHRvdGFsX3RpbWUgKz0gZXhwZWN0ZWRfdGltZQogICAgICAgICAgICB0b3RhbF9sb29rdXBzICs9IGFjdHVhbF9sb29rdXBzCiAgICAgICAgICAgIHRvdGFsX3VwZGF0ZXMgKz0gYWN0dWFsX3VwZGF0ZXMKCiAgICAgICAgc2VsZi5jb25maWdfcGFyc2Uuc2V0KENvbmZpZ1BhcnNlci5ERUZBVUxUU0VDVCwgJ2V4cGVyaW1lbnRfcnVuX3RpbWUnLCBzdHIodG90YWxfdGltZSkpCiAgICAgICAgcHJpbnQgJ1RvdGFsIHRpbWU6ICcsIHRvdGFsX3RpbWUKCiAgICAgICAgb3V0cHV0X3N0YXRzID0gc2VsZi5ydW5fZXhwX211bHRpX2xucygpCiAgICAgICAgc2VsZi5hc3NlcnRFcXVhbChvdXRwdXRfc3RhdHMucmVxdWVzdHMsIG51bV9uYW1lcyArIHRvdGFsX2xvb2t1cHMgKyB0b3RhbF91cGRhdGVzLAogICAgICAgICAgICAgICAgICAgICAgICAgIlRvdGFsIG51bWJlciBvZiByZXF1ZXN0cyBtaXNtYXRjaCIpCiAgICAgICAgc2VsZi5hc3NlcnRFcXVhbChvdXRwdXRfc3RhdHMuc3VjY2VzcywgbnVtX25hbWVzICsgdG90Y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UgKz0gZGVsYXkgLyAxMDAwCiAgICAgICAgcmVhZF93cml0ZV9yZXFfcmF0ZSA9IDE3MAoKICAgICAgICByZWFkc19wZXJfZXBvY2hfcGVyX25hbWUgPSA4MDAKICAgICAgICB3cml0ZXNfcGVyX2Vwb2NoX3Blcl9uYW1lID0gNDAwCiAgICAgICAgdG90YWxfbG9va3VwcyA9IDAKICAgICAgICB0b3RhbF91cGRhdGVzID0gMAogICAgICAgIG51bV9nZW9fbG9jYWxpdHlfY2hhbmdlcyA9IDMKICAgICAgICBmb3IgaSBpbiByYW5nZShudW1fZ2VvX2xvY2FsaXR5X2NoYW5nZXMpOgogICAgICAgICAgICBudW1fbG9va3VwcyA9IG51bV9uYW1lcyAqIHJlYWRzX3Blcl9lcG9jaF9wZXJfbmFtZQogICAgICAgICAgICBudW1fdXBkYXRlcyA9IG51bV9uYW1lcyAqIHdyaXRlc19wZXJfZXBvY2hfcGVyX25hbWUKICAgICAgICAgICAgZXhwZWN0ZWRfdGltZSA9IChudW1fbG9va3VwcyArIG51bV91cGRhdGVzKSAvIGxlbihsbnNfaWRzKSAvIHJlYWRfd3JpdGVfcmVxX3JhdGUKICAgICAgICAgICAgcHJpbnQgJ1JlYWQgd3JpdGUgc2VuZCB0aW1lJywgZXhwZWN0ZWRfdGltZQogICAgICAgICAgICBhY3R1YWxfbG9va3VwcywgYWN0dWFsX3VwZGF0ZXMgPSBnZW5fZ2VvbG9jYWxpdHlfdHJhY2Uoc2VsZi50cmFjZV9mb2xkZXIsIHNlbGYubG5zX2dlb19maWxlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtYmVyX25hbWVzPW51bV9uYW1lcywgbnVtX2xvb2t1cHM9bnVtX2xvb2t1cHMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1fdXBkYXRlcz1udW1fdXBkYXRlcywgYXBwZW5kX3RvX2ZpbGU9VHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxuc19pZHM9bG5zX2lkcywgbmFtZV9wcmVmaXg9cHJlZml4LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhwX2R1cmF0aW9uPWV4cGVjdGVkX3RpbWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbGl0eV9wYXJhbWV0ZXI9NCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsaXR5X3BlcmNlbnQ9MS4wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtX2xucz1zZWxmLmxucywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlZWQ9KGkrMTAwMCkpCiAgICAgICAgICAgIHRvdGFsX3RpbWUgKz0gZXhwZWN0ZWRfdGltZQogICAgICAgICAgICB0b3RhbF9sb29rdXBzICs9IGFjdHVhbF9sb29rdXBzCiAgICAgICAgICAgIHRvdGFsX3VwZGF0ZXMgKz0gYWN0dWFsX3VwZGF0ZXMKCiAgICAgICAgc2VsZi5jb25maWdfcGFyc2Uuc2V0KENvbmZpZ1BhcnNlci5ERUZBVUxUU0VDVCwgJ2V4cGVyaW1lbnRfcnVuX3RpbWUnLCBzdHIodG90YWxfdGltZSkpCiAgICAgICAgcHJpbnQgJ1RvdGFsIHRpbWU6ICcsIHRvdGFsX3RpbWUKICAgICAgICBvdXRwdXRfc3RhdHMgPSBzZWxmLnJ1bl9leHBfbXVsdGlfbG5zKCkKICAgICAg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gICAgICAgXywgYXhzID0gcGwuc3VicGxvdHMoKQoKICAgIGlmIG5vdCBpc2luc3RhbmNlKGF4cywgSXRlcmFibGUpOgogICAgICAgIGF4cyA9IFtheHNdICogTmdyb3VwcwogICAgZWxzZToKICAgICAgICBhc3NlcnQgbGVuKGF4cykgPT0gTmdyb3VwcwogICAgCiAgICBpbmQgPSB4X3N0YXJ0ICsgbnAuYXJhbmdlKE54KQogICAgYmJveHMgPSB7fQogICAgcmVjdHMgPSBbXQogICAgZm9yIGksIGF4IGluIHppcChyYW5nZShOZ3JvdXBzKSwgYXhzKToKICAgICAgICB4LCB5ID0gaW5kKyh3aWR0aCppKSwgbnAuYXJyYXkoZGF0YVtpXSkKICAgICAgICByZWN0cy5hcHBlbmQoYXguYmFyKHgsIHksIHdpZHRoLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yPWdyb3VwX2NvbG9yc1tpXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHllcnI9eWVycltpXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjb2xvcj0nYmxhY2snKSkKICAgICAgICBiYm94c1tncm91cF9sYWJlbHNbaV1dID0gW0JCb3goeFtqXSwgMCwgd2lkdGgsIHlbal0gKyB5ZXJyW2ldW2pdKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIGogaW4gcmFuZ2UoTngpXQogICAgICAgIGF4LnNldF94dGlja3MoaW5kICsgKCgxIC0gcGFkZGluZykgLyAyKSkKICAgICAgICBheC5zZXRfeHRpY2tsYWJlbHMoeGxhYmVscykKICAgICAgICBheC5zZXRfeGxpbShbLXBhZGRpbmcsIE54XSkKICAgIGxlZ2VuZCA9IGF4LmxlZ2VuZChbclswXSBmb3IgciBpbiByZWN0c10sIGdyb3VwX2xhYmVscykKICAgIHJldHVybiBheHMsIGxlZ2VuZCwgcmVjdHMsIGJib3hzCjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KCgpkZWYgbGlu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ZW5zaW9uCiAgICAiIiIKICAgIGF4LCBfID0gaW1zaG93KGltZ19hLCBpbXNob3dfYXJncz1pbXNob3dfYV9hcmdzLCBheD1heCkKICAgIGNiID0ganRtcmkubnAuY2hlY2tlcmJvYXJkKGltZ19hLnNoYXBlLCBjZWxsX2xlbikKICAgIGltZ19jYiA9IG5wLm1hLmFycmF5KGltZ19iLCBtYXNrPWNiKQogICAgYXguaW1zaG93KGltZ19jYiwgKippbXNob3dfYl9hcmdzKQoKCmRlZiBsYWJlbF9iYXJzKGJib3gwLCBiYm94MSwgdGV4dCwgeV9vZmZzZXQ9Tm9uZSwgeV90ZXh0X29mZnNldD1Ob25lLCBheD1Ob25lKToKICAgICIiIlBsYWNlIGEgbGFiZWwgYmV0d2VlbiB0d28gYmFycwogICAgVXNlZnVsIGZvciBpbmRpY2F0aW5nIHNpZ25pZmljYW50IGRpZmZlcmVuY2VzIG9uIGEgYmFyIHBsb3QKICAgIEFyZ3M6CiAgICAgICAgYmJveDAgICAgICAgICAtLQogICAgICAgIGJib3gxICAgICAgICAgLS0KICAgICAgICB0ZXh0ICAgICAgICAgIC0tCiAgICAgICAgeV9vZmZzZXQgICAgICAtLQogICAgICAgIHlfdGV4dF9vZmZzZXQgLS0KICAgICAgICBheCAgICAgICAgICAgIC0tCiAgICAiIiIKICAgIGlmIGF4IGlzIE5vbmU6CiAgICAgICAgYXggPSBwbC5nY2EoKQoKICAgIHByb3BzID0gewogICAgICAgICdjb25uZWN0aW9uc3R5bGUnOiAnYmFyJywKICAgICAgICAnYXJyb3dzdHlsZSc6ICctJywKICAgICAgICAnbHcnOiAxCiAgICB9CgogICAgeSA9IG1heChiYm94MC5oZWlnaHQsIGJib3gxLmhlaWdodCkKCiAgICB5X2xpbSA9IGF4LmdldF95bGltKCkKICAgIGlmIHlfb2Zmc2V0IGlzIE5vbmU6CiAgICAgICAgeV9vZmZzZXQgPSAwLjA1ICogKHlfbGltWzFdIC0geV9saW1bMF0pCgogICAgaWYgeV90ZXh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ICAgICAgICAgICAgICAgICB4eT0oMC41LCAxKSwKICAgICAgICAgICAgICAgICAgICB4eXRleHQ9KDAsIHBhZCksCiAgICAgICAgICAgICAgICAgICAgeHljb29yZHM9J2F4ZXMgZnJhY3Rpb24nLAogICAgICAgICAgICAgICAgICAgIHRleHRjb29yZHM9J29mZnNldCBwb2ludHMnLAogICAgICAgICAgICAgICAgICAgIHNpemU9J2xhcmdlJywKICAgICAgICAgICAgICAgICAgICBoYT0nY2VudGVyJywKICAgICAgICAgICAgICAgICAgICB2YT0nYmFzZWxpbmUnKQo8fGZpbV9zdWZmaXh8PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNvbG9yPSdibGFjaycpKQo8fGZpbV9lbmR8Pg==
|
3ca185e3ebc0dd7d44e34e5a89b72b2c6aaedd4f-3
|
3ca185e3ebc0dd7d44e34e5a89b72b2c6aaedd4f
|
PHxmaW1fcHJlZml4fD4KZnJvbSBfX2Z1dHVyZV9fIGltcG9ydCBkaXZpc2lvbgppbXBvcnQgbnVtcHkgYXMgbnAKZnJvbSBzY2lweSBpbXBvcnQgc3RhdHMKaW1wb3J0IG1hdHBsb3RsaWIucHlwbG90IGFzIHBsCmltcG9ydCBpdGVydG9vbHMKZnJvbSBjb2xsZWN0aW9ucyBpbXBvcnQgbmFtZWR0dXBsZSwgSXRlcmFibGUKCmltcG9ydCBqdG1yaS5ucAoKdGFibGVhdTIwID0gWygzMSwgMTE5LCAxODApLCAoMTc0LCAxOTksIDIzMiksICgyNTUsIDEyNywgMTQpLCAoMjU1LCAxODcsIDEyMCksICAKICAgICAgICAgICAgICg0NCwgMTYwLCA0NCksICgxNTIsIDIyMywgMTM4KSwgKDIxNCwgMzksIDQwKSwgKDI1NSwgMTUyLCAxNTApLCAgCiAgICAgICAgICAgICAoMTQ4LCAxMDMsIDE4OSksICgxOTcsIDE3NiwgMjEzKSwgKDE0MCwgODYsIDc1KSwgKDE5NiwgMTU2LCAxNDgpLCAgCiAgICAgICAgICAgICAoMjI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bnAuYXJyYXkoZGF0YVtpXSkKICAgICAgICByZWN0cy5hcHBlbmQoYXguYmFyKHgsIHksIHdpZHRoLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yPWdyb3VwX2NvbG9yc1tpXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHllcnI9eWVycltpXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjb2xvcj0nYmxhY2snKSkKICAgICAgICBiYm94c1tncm91cF9sYWJlbHNbaV1dID0gW0JCb3goeFtqXSwgMCwgd2lkdGgsIHlbal0gKyB5ZXJyW2ldW2pdKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIGogaW4gcmFuZ2UoTngpXQogICAgICAgIGF4LnNldF94dGlja3MoaW5kICsgKCgxIC0gcGFkZGluZykgLyAyKSkKICAgICAgICBheC5zZXRfeHRpY2tsYWJlbHMoeGxhYmVscykKICAgICAgICBheC5zZXRfeGxpbShbLXBhZGRpbmcsIE54XSkKICAgIGxlZ2VuZCA9IGF4LmxlZ2VuZChbclswXSBmb3IgciBpbiByZWN0c10sIGdyb3VwX2xhYmVscykKICAgIHJldHVybiBheHMsIGxlZ2VuZCwgcmVjdHMsIGJib3hzCgoKZGVmIGxpbmUoeV9pbnRlcmNlcHQsIHNsb3BlLCB4bGltaXRzPU5vbmUsIGF4PU5vbmUsIHBsb3Rfa3dkcz17fSk6CiAgICAnJydEcmF3IGEgbGluZSBieSB0aGUgeS1pbnRlcmNlcHQgYW5kIHNsb3BlIHdpdGhpbiB0aGUgbGltaXRzIG9mIHRoZSBheGVzJycnCiAgICBpZiBheCBpcyBOb25lOgogICAgICAgIF8sYXggPSBwbC5zdWJwbG90cygpCiAgICBpZiB4bGltaXRzIGlzIE5vbmU6CiAgICAgICAgeGxpbWl0cyA9IGF4LmdldF94bGltKCkKICAgIHggPSBucC5saW5zcGFjZSh4bGltaXRzWzBdLCB4bGltaXRzWzFdKQogICAgeSA9IHNsb3BlICogeCArI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gaW1nX2EgICAgLS0gaW1hZ2UgQSAoYm90dG9tIGltYWdlKQogICAgICAgIGltZ19iICAgIC0tIGltYWdlIEIgKHRvcCBpbWFnZSkKICAgICAgICBjZWxsX2xlbiAtLSBsZW5ndGggb2YgY2hlY2tlcmJvYXJkIGNlbGwgYWxvbmcgZWFjaCBkaW1lbnNpb24KICAgICIiIgogICAgYXgsIF8gPSBpbXNob3coaW1nX2EsIGltc2hvd19hcmdzPWltc2hvd19hX2FyZ3MsIGF4PWF4KQogICAgY2IgPSBqdG1yaS5ucC5jaGVja2VyYm9hcmQoaW1nX2Euc2hhcGUsIGNlbGxfbGVuKQogICAgaW1nX2NiID0gbnAubWEuYXJyYXkoaW1nX2IsIG1hc2s9Y2IpCiAgICBheC5pbXNob3coaW1nX2NiLCAqKmltc2hvd19iX2FyZ3MpCgoKZGVmIGxhYmVsX2JhcnMoYmJveDAsIGJib3gxLCB0ZXh0LCB5X29mZnNldD1Ob25lLCB5X3RleHRfb2Zmc2V0PU5vbmUsIGF4PU5vbmUpOgogICAgIiIiUGxhY2UgYSBsYWJlbCBiZXR3ZWVuIHR3byBiYXJzCiAgICBVc2VmdWwgZm9yIGluZGljYXRpbmcgc2lnbmlmaWNhbnQgZGlmZmVyZW5jZXMgb24gYSBiYXIgcGxvdAogICAgQXJnczoKICAgICAgICBiYm94MCAgICAgICAgIC0tCiAgICAgICAgYmJveDEgICAgICAgICAtLQogICAgICAgIHRleHQgICAgICAgICAgLS0KICAgICAgICB5X29mZnNldCAgICAgIC0tCiAgICAgICAgeV90ZXh0X29mZnNldCAtLQogICAgICAgIGF4ICAgICAgICAgICAgLS0KICAgICIiIgogICAgaWYgYXggaXMgTm9uZToKICAgICAgICBheCA9IHBsLmdjYSgpCgogICAgcHJvcHMgPSB7CiAgICAgICAgJ2Nvbm5lY3Rpb25zdHlsZSc6ICdiYXInLAogICAgICAgICdhcnJvd3N0eWxlJzogJy0nLAogICAgICAgICdsdyc6IDEKICAgIH0KCiAgICB5ID0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I9J3InKQogICAgYXguc2V0X3hsYWJlbCgnbWVhbicpCiAgICBheC5zZXRfeWxhYmVsKCdkaWZmJykKCiAgICBheC5zZXRfdGl0bGUoJ01lYW4tRGlmZmVyZW5jZSBwbG90XG4obWVhbjogezouM2d9IHN0ZDogezouM2d9KScuZm9ybWF0KG0sIHNkKSkKICAgIHJldHVybiBheAoKCmRlZiBzZXRfc3VicGxvdHNfcm93X3RpdGxlcyhheHMsIHRpdGxlcywgcGFkPTUpOgogICAgIiIiIFNldCB0aGUgdGl0bGVzIGZvciBlYWNoIHJvdyBhdCB0aGUgZmFyIGxlZnQgb2YgdGhlIHBsb3QgIiIiCiAgICBhc3NlcnQgbGVuKHRpdGxlcykgPT0gbGVuKGF4c1s6LCAwXSksICdOdW1iZXIgb2Ygcm93cyBtdXN0IG1hY3RjaCB0aGUgbnVtYmVyIG9mIHRpdGxlcycKICAgIGZvciBheCwgcm93IGluIHppcChheHNbOiwwXSwgdGl0bGVzKToKICAgICAgICBheC5hbm5vdGF0ZShyb3csCiAgICAgICAgICAgICAgICAgICAgeHk9KDAsIDAuNSksCiAgICAgICAgICAgICAgICAgICAgeHl0ZXh0PSgtYXgueWF4aXMubGFiZWxwYWQgLSBwYWQsIDApLAogICAgICAgICAgICAgICAgICAgIHh5Y29vcmRzPWF4LnlheGlzLmxhYmVsLAogICAgICAgICAgICAgICAgICAgIHRleHRjb29yZHM9J29mZnNldCBwb2ludHMnLAogICAgICAgICAgICAgICAgICAgIHNpemU9J2xhcmdlJywKICAgICAgICAgICAgICAgICAgICBoYT0ncmlnaHQnLAogICAgICAgICAgICAgICAgICAgIHZhPSdjZW50ZXInKQoKCmRlZiBzZXRfc3VicGxvdHNfY29sX3RpdGxlcyhheHMsIHRpdGxlcywgcGFkPTUpOgogICAgIiIiIFNldCB0aGUgdGl0bGVzIGZvciBlYWNoIGNvbHVtbiBhdCB0aGUgZmFyIGxlZnQgb2YgdGhlIHBsb3QgIiIiCiAgICBhc3NlcnQgbGVuKHR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GVbMF0KICAgIHNpemVfdGVzdCA9IHRlc3RfZGF0YS5zaGFwZVswXSAgICAKICAgICMjICBDcmVhdGUgYSAzRCBtYXRyaXggZm9yIFN0b3JpbmcgU2VjdGlvbnMgIAogICAgc2VjdGlvbnNfdHJhaW4gPSBucC56ZXJvcygoc2l6ZV90cmFpbiAsIHNpemVfZmVhdHVyZXMgLCBzbGlkaW5nX3dpbmRvd19zaXplICkpCiAgICBzZWN0aW9uc190ZXN0ID0gbnAuemVyb3MoKHNpemVfdGVzdCwgc2l6ZV9mZWF0dXJlcyAsIHNsaWRpbmdfd2luZG93X3NpemUgKSkgICAgCiAgICBsYWJlbHNfdHJhaW4gPSBucC56ZXJvcyhzaXplX3RyYWluKQogICAgbGFiZWxzX3Rlc3QgPSBucC56ZXJvcyhzaXplX3Rlc3QpCiAgICAjIGZvciByYW5kb21seSByZW1vdmluZyBzb21lIE51bGwgc2FtcGxlcyA6IGhvbGQgIigxMDAvcm5kKSUiIG9mIE51bGwgc2FtcGxlcwogICAgcm5kID0gNSAKICAgICMgVHJhaW5pbmcgRGF0YQogICAgbnVsbHM9MAogICAganRyPTAKICAgIGZvciBpIGluIHJhbmdlKDAgLChzaXplX3RyYWluKSAtIHNsaWRpbmdfd2luZG93X3NpemUgLCBzdGVwX3NpemVfb2Zfc2xpZGluZ193aW5kb3cpOiAKICAgICAgICBsYmwgPSBucC5hcmdtYXgobnAuYmluY291bnQodHJhaW5fZGF0YVtpOmkrc2xpZGluZ193aW5kb3dfc2l6ZSwgLTFdLmFzdHlwZShpbnQpKSkgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgaWYgbGJsPT0wIGFuZCBudWxscyVybmQhPTA6CiAgICAgICAgICAgIG51bGxzKz0xICAgIAogICAgICAgIGVsc2U6CiAgICAgICAgICAgIGlmIGxibD09MDoKICAgICAgICAgICAgICAgIG51bGxzKz0xICAKICAgICAgICAgICAgb25lX3NlYyA9ICh0cmFpbl9kYXRhW2k6aStzbGlkaW5nX3dpbmRvd19zaXplLCAwOnNpemVfZmVhdHVyZXNdKS5UCiAgICAgICAgICAgIHNlY3Rpb25zX3RyYWluW2p0cl0gPSBvbmVfc2VjCiAgICAgICAgICAgIGxhYmVsc190cmFpbltqdHJdID0gbGJsCiAgICAgICAgICAgIGp0ciA9IGp0cisxCiAgICAgICAgICAgIHN5cy5zdGRvdXQud3JpdGUoIlxyIHt9IGZyb20ge30iLmZvcm1hdChpLChzaXplX3RyYWluKSAtIHNsaWRpbmdfd2luZG93X3NpemUgKSkKICAgICAgICAgICAgc3lzLnN0ZG91dC5mbHVzaCgpIAogICAgc2VjdGlvbnNfdHJhaW4gPSBzZWN0aW9uc190cmFpblswOmp0ciwgOl0KICAgIGxhYmVsc190cmFpbiA9IGxhYmVsc190cmFpblswOmp0cl0KICAgIHByaW50KCJcbkluZm86IFNpemUgb2YgVHJhaW5pbmcgU2VjdGlvbnMgPSB7fSIuZm9ybWF0KHNlY3Rpb25zX3RyYWluLnNoYXBlKSkKCiAgICAjIFRlc3RpbmcgRGF0YSAKICAgIG51bGxzPTAKICAgIGp0ZT0wCiAgICBmb3IgaSBpbiByYW5nZSgwICwoc2l6ZV90ZXN0KSAtIHNsaWRpbmdfd2luZG93X3NpemUgLCBzdGVwX3NpemVfb2Zfc2xpZGluZ193aW5kb3cpOgogICAgICAgIGxibCA9IG5wLmFyZ21heChucC5iaW5jb3VudCh0ZXN0X2RhdGFbaTppK3NsaWRpbmdfd2luZG93X3NpemUsLTFdLmFzdHlwZShpbnQpKSkgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgaWYgbGJsPT0wIGFuZCBudWxscyVybmQhPTA6CiAgICAgICAgICAgIG51bGxzKz0xICAgIAogICAgICAgIGVsc2U6CiAgICAgICAgICAgIGlmIGxibD09MDoKICAgICAgICAgICAgICAgIG51bGxzKz0xICAKICAgICAgICAgICAgb25lX3Nob3QgPSAodGVzdF9kYXRhW2k6aStzbGlkaW5nX3dpbmRvd19zaXplLDA6c2l6ZV9mZ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nAuYmluY291bnQodHJhaW5fZGF0YVtpOmkrc2xpZGluZ193aW5kb3dfc2l6ZSwgLTFdLmFzdHlwZShpbnQpKSkgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgaWYgbGJsPT0wIGFuZCBudWxscyVybmQhPTA6CiAgICAgICAgICAgIG51bGxzKz0xICAgIAogICAgICAgIGVsc2U6CiAgICAgICAgICAgIGlmIGxibD09MDoKICAgICAgICAgICAgICAgIG51bGxzKz0xICAKICAgICAgICAgICAgb25lX3NlYyA9ICh0cmFpbl9kYXRhW2k6aStzbGlkaW5nX3dpbmRvd19zaXplLCAwOnNpemVfZmVhdHVyZXNdKS5UCiAgICAgICAgICAgIHNlY3Rpb25zX3RyYWluW2p0cl0gPSBvbmVfc2VjCiAgICAgICAgICAgIGxhYmVsc190cmFpbltqdHJdID0gbGJsCiAgICAgICAgICAgIGp0ciA9IGp0cisxCiAgICAgICAgICAgIHN5cy5zdGRvdXQud3JpdGUoIlxyIHt9IGZyb20ge30iLmZvcm1hdChpLChzaXplX3RyYWluKSAtIHNsaWRpbmdfd2luZG93X3NpemUgKSkKICAgICAgICAgICAgc3lzLnN0ZG91dC5mbHVzaCgpIAogICAgc2VjdGlvbnNfdHJhaW4gPSBzZWN0aW9uc190cmFpblswOmp0ciwgOl0KICAgIGxhYmVsc190cmFpbiA9IGxhYmVsc190cmFpblswOmp0cl0KICAgIHByaW50KCJcbkluZm86IFNpemUgb2YgVHJhaW5pbmcgU2VjdGlvbnMgPSB7fSIuZm9ybWF0KHNlY3Rpb25zX3RyYWluLnNoYXBlKSkKCiAgICAjIFRlc3RpbmcgRGF0YSAKICAgIG51bGxzPTAKICAgIGp0ZT0wCiAgICBmb3IgaSBpbiByYW5nZSgwICwoc2l6ZV90ZXN0KSAtIHNsaWRpbmdfd2luZG93X3NpemUgLCBzdGVwX3NpemVfb2Zfc2xpZGluZ193aW5kb3cpOgogICAgICAgIGxibCA9IG5wLmFyZ21heChucC5iaW5jb3VudCh0ZXN0X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ID0gNSAKICAgICMgVHJhaW5pbmcgRGF0YQogICAgbnVsbHM9MAogICAganRyPTAKICAgIGZvciBpIGluIHJhbmdlKDAgLChzaXplX3RyYWluKSAtIHNsaWRpbmdfd2luZG93X3NpemUgLCBzdGVwX3NpemVfb2Zfc2xpZGluZ193aW5kb3cpOiAKICAgICAgICBsYmwgPSBucC5hcmdtYXgobnAuYmluY291bnQodHJhaW5fZGF0YVtpOmkrc2xpZGluZ193aW5kb3dfc2l6ZSwgLTFdLmFzdHlwZShpbnQpKSkgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgaWYgbGJsPT0wIGFuZCBudWxscyVybmQhPTA6CiAgICAgICAgICAgIG51bGxzKz0xICAgIAogICAgICAgIGVsc2U6CiAgICAgICAgICAgIGlmIGxibD09MDoKICAgICAgICAgICAgICAgIG51bGxzKz0xICAKICAgICAgICAgICAgb25lX3NlYyA9ICh0cmFpbl9kYXRhW2k6aStzbGlkaW5nX3dpbmRvd19zaXplLCAwOnNpemVfZmVhdHVyZXNdKS5UCiAgICAgICAgICAgIHNlY3Rpb25zX3RyYWluW2p0cl0gPSBvbmVfc2VjCiAgICAgICAgICAgIGxhYmVsc190cmFpbltqdHJdID0gbGJsCiAgICAgICAgICAgIGp0ciA9IGp0cisxCiAgICAgICAgICAgIHN5cy5zdGRvdXQud3JpdGUoIlxyIHt9IGZyb20ge30iLmZvcm1hdChpLChzaXplX3RyYWluKSAtIHNsaWRpbmdfd2luZG93X3NpemUgKSkKICAgICAgICAgICAgc3lzLnN0ZG91dC5mbHVzaCgpIAogICAgc2VjdGlvbnNfdHJhaW4gPSBzZWN0aW9uc190cmFpblswOmp0ciwgOl0KICAgIGxhYmVsc190cmFpbiA9IGxhYmVsc190cmFpblswOmp0cl0KICAgIHByaW50KCJcbkluZm86IFNpemUgb2YgVHJhaW5pbmcgU2VjdGlvbnMgPSB7fSIuZm9ybWF0KHNlY3Rpb25zX3RyYWluLnNoYXBlKSkKCiAgICAjIFRlc3RpbmcgR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3MKCiAgICBkZWYgdGVhckRvd24oc2VsZik6Cjx8ZmltX2hvbGV8PgoKPHxmaW1fc3VmZml4fD4KICAgICAgICBwYXNzCgo8fGZpbV9lbmR8Pg==
|
9e7b12642029646c666156311a9ab9eb3ec4c155-1
|
9e7b12642029646c666156311a9ab9eb3ec4c155
|
PHxmaW1fcHJlZml4fD4KaW1wb3J0IG1hZ21hIGFzIG0KZnJvbSBtYWdtYS50ZXN0aW5nIGltcG9ydCBjaGVja19maWxlc19lcXVhbAppbXBvcnQgaHd0eXBlcwppbXBvcnQgb3BlcmF0b3IKaW1wb3J0IHRlbXBmaWxlCmltcG9ydCBrcmF0b3MuZGVidWcKaW1wb3J0IG9zCgoKY2xhc3MgU2ltcGxlQUxVKG0uQ2lyY3VpdCk6CiAgICBpbyA9IG0uSU8oYT1tLkluKG0uVUludFsxNl0pLCBiPW0uSW4obS5VSW50WzE2XSksCiAgICAgICAgICAgICAgYz1tLk91dChtLlVJbnRbMTZdKSwgY29uZmlnXz1tLkluKG0uQml0c1syXSkpCgogICAgQG0uY2lyY3VpdC5jb21iaW5hdGlvbmFsX3RvX3Zlcmlsb2coZGVidWc9RmFsc2UpCiAgICBkZWYgZXhlY3V0ZV9hbHUoYTogbS5VSW50WzE2XSwgYjogbS5VSW50WzE2XSwgY29uZmlnXzogbS5CaXRzWzJdKSAtPiBcCiAgICAgICAgICAgIG0uVUludFsxNl06CiAgICAgICAgaWYgY29uZmlnXyA9PSBtLmJpdHMoMCwgMik6CiAgICAgICAgICAgIGMgPSBhICsgYgogICAgICAgIGVsaWYgY29uZmlnXyA9PSBtLmJpdHMoMSwgMik6CiAgICAgICAgICAgIGMgPSBhIC0gYgogICAgICAgIGVsaWYgY29uZmlnXyA9PSBtLmJpdHMoMiwgMik6CiAgICAgICAgICAgIGMgPSBhICogYgogICAgICAgIGVsc2U6CiAgICAgICAgICAgIGMgPSBtLmJpdHMoMCwgMTYpCiAgICAgICAgcmV0dXJuIGMKCiAgICBpby5jIDw9I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0gW1Rlc3RCYXNpY1RvVmVyaWxvZy5rcmF0b3NdCiAgICAgICAga3JhdG9zLmRlYnVnLmR1bXBfZXh0ZXJuYWxfZGF0YWJhc2UoCiAgICAgICAgICAgIGdlbmVyYXRvcnMsIHRvcF9tb2R1bGVfbmFtZSwgZiJ7ZGlyZWN0b3J5fWRlYnVnLmRiIikKICAgICAgICB0ZXN0ZXIuY29tcGlsZV9hbmRfcnVuKHRhcmdldCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpcmVjdG9yeT1kaXJlY3RvcnksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFncz1bIi1Xbm8tZmF0YWwiXSwgbWFnbWFfb3V0cHV0PSJ2ZXJpbG9nIikKCiAgICBleGNlcHQgSW1wb3J0RXJyb3I6CiAgICAgICAgcGFzcwo8fGZpbV9zdWZmaXh8PgogICAgICAgIGlmIHRhcmdldCA9PSAidmVyaWxhdG9yIjoKICAgICAgICAgICAgdG9wX21vZHVsZV9uYW1lID0gIlRPUCIKICAgICAgICBlbHNlOgogICAgICAgICAgICB0b3BfbW9kdWxlX25hbWUgPSAiZHV0Igo8fGZpbV9lbmR8Pg==
|
9e7b12642029646c666156311a9ab9eb3ec4c155-2
|
9e7b12642029646c666156311a9ab9eb3ec4c155
|
PHxmaW1fcHJlZml4fD4KaW1wb3J0IG1hZ21hIGFzIG0KZnJvbSBtYWdtYS50ZXN0aW5nIGltcG9ydCBjaGVja19maWxlc19lcXVhbAppbXBvcnQgaHd0eXBlcwppbXBvcnQgb3BlcmF0b3IKaW1wb3J0IHRlbXBmaWxlCmltcG9ydCBrcmF0b3MuZGVidWcKaW1wb3J0IG9zCgoKY2xhc3MgU2ltcGxlQUxVKG0uQ2lyY3VpdCk6CiAgICBpbyA9IG0uSU8oYT1tLkluKG0uVUludFsxNl0pLCBiPW0uSW4obS5VSW50WzE2XSksCiAgICAgICAgICAgICAgYz1tLk91dChtLlVJbnRbMTZdKSwgY29uZmlnXz1tLk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HVzaW5nIG5jc2ltL3Zjcy4gZmF1bHQgdXNlcwogICAgICAgICMgZGlmZmVyZW50IG5hbWUgZm9yIGRpZmZlcmVudCB0YXJnZXRzCiAgICAgICAgdGFyZ2V0ID0gInZlcmlsYXRvciIKICAgICAgICBpZiB0YXJnZXQgPT0gInZlcmlsYXRvciI6CiAgICAgICAgICAgIHRvcF9tb2R1bGVfbmFtZSA9ICJUT1AiCiAgICAgICAgZWxzZToKICAgICAgICAgICAgdG9wX21vZHVsZV9uYW1lID0gImR1dCIKICAgICAgICBrcmF0b3MuZGVidWcuZHVtcF9leHRlcm5hbF9kYXRhYmFzZSgKICAgICAgICAgICAgZ2VuZXJhdG9ycywgdG9wX21vZHVsZV9uYW1lLCBmIntkaXJlY3Rvcnl9ZGVidWcuZGIiKQogICAgICAgIHRlc3Rlci5jb21waWxlX2FuZF9ydW4odGFyZ2V0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyZWN0b3J5PWRpcmVjdG9yeSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzPVsiLVduby1mYXRhbCJdLCBza2lwX2NvbXBpbGU9VHJ1ZSkKCiAgICBleGNlcHQgSW1wb3J0RXJyb3I6CiAgICAgICAgcGFzcwoKCmRlZiB0ZXN0X3NlcV9zaW1wbGUoKToKICAgIEBtLmNpcmN1aXQuc2VxdWVudGlhbF90b192ZXJpbG9nKGFzeW5jX3Jlc2V0PVRydWUsIGRlYnVnPUZhbHNlKQogICAgY2xhc3MgVGVzdEJhc2ljVG9WZXJpbG9nOgo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgZGVmIF9faW5pdF9fKHNlbGYpOgogICAgICAgICAgICBzZWxmLng6IG0uQml0c1syXSA9IG0uYml0cygwLCAyKQogICAgICAgICAgICBzZWxmLnk6IG0uQml0c1syXSA9IG0uYml0cygwLCAyKQoKPHxmaW1fZW5kfD4=
|
9e7b12642029646c666156311a9ab9eb3ec4c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gICB0ZXN0ZXIuZXZhbCgpCiAgICAgICAgICAgIGlmIG9wID09IG9wZXJhdG9yLmZsb29yZGl2OgogICAgICAgICAgICAgICAgdGVzdGVyLmNpcmN1aXQuYy5leHBlY3QoMCkKICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgIHRlc3Rlci5jaXJjdWl0LmMuZXhwZWN0KG9wKGEsIGIpKQogICAgICAgIGRpcmVjdG9yeSA9IGYie29zLnBhdGguYWJzcGF0aChvcy5wYXRoLmRpcm5hbWUoX19maWxlX18pKX0vYnVpbGQvIgogICAgICAgICMgZHVtcCBkYXRhYmFzZQogICAgICAgICMgY2hhbmdlIHRoZSB0YXJnZXQgdG8gc3lzdGVtIHZlcmlsb2cgaWYgeW91J3JlIHVzaW5nIG5jc2ltL3Zjcy4gZmF1bHQgdXNlcwogICAgICAgICMgZGlmZmVyZW50IG5hbWUgZm9yIGRpZmZlcmVudCB0YXJnZXRzCiAgICAgICAgdGFyZ2V0ID0gInZlcmlsYXRvciIKICAgICAgICBpZiB0YXJnZXQgPT0gInZlcmlsYXRvciI6CiAgICAgICAgICAgIHRvcF9tb2R1bGVfbmFtZSA9ICJUT1AiCiAgICAgICAgZWxzZToKICAgICAgICAgICAgdG9wX21vZHVsZV9uYW1lID0gImR1dCIKICAgICAgICBrcmF0b3MuZGVidWcuZHVtcF9leHRlcm5hbF9kYXRhYmFzZSgKICAgICAgICAgICAgZ2VuZXJhdG9ycywgdG9wX21vZHVsZV9uYW1lLCBmIntkaXJlY3Rvcnl9ZGVidWcuZGIiKQogICAgICAgIHRlc3Rlci5jb21waWxlX2FuZF9ydW4odGFyZ2V0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyZWN0b3J5PWRpcmVjdG9yeSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzPVsiLVduby1mYXRhbCJdLCBza2lwX2NvbXBpbGU9VHJ1ZSkKCiAgICBleGNlcHQgSW1wb3J0RXJyb3I6CiAgIC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nB1dF9jb21wX2ZlYScpCiAgICAgICAgICAgICAgICBzZWxmLmNvbXBfZmVhX3dlaWdodCA9IHRmLmNvbnN0YW50KFswLjcsIDAuM10sIGR0eXBlPXRmLmZsb2F0MzIpCiAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICMgcGxhY2Vob2xkZXJzIGZvciBrZyBtb2RlbHMKCQlzZWxmLnBvc19oID0gdGYucGxhY2Vob2xkZXIodGYuaW50MzIsIFtOb25lXSkKCQlzZWxmLnBvc190ID0gdGYucGxhY2Vob2xkZXIodGYuaW50MzIsIFtOb25lXSkKCQlzZWxmLnBvc19yID0gdGYucGxhY2Vob2xkZXIodGYuaW50MzIsIFtOb25lXSkKCQlzZWxmLm5lZ19oID0gdGYucGxhY2Vob2xkZXIodGYuaW50MzIsIFtOb25lXSkKCQlzZWxmLm5lZ190ID0gdGYucGxhY2Vob2xkZXIodGYuaW50MzIsIFtOb25lXSkKCQlzZWxmLm5lZ19yID0gdGYucGxhY2Vob2xkZXIodGYuaW50MzIsIFtOb25lXSkKCiAgICAgICAgICAgICAgICB3aXRoIHRmLm5hbWVfc2NvcGUoImVtYmVkZGluZy1sYXllcnMiKToKCQkJIyB3b3JkIGVtYmVkZGluZ3MKCQkJc2VsZi53b3JkX2VtYmVkZGluZyA9IHRmLmdldF92YXJpYWJsZShpbml0aWFsaXplcj13b3JkX2VtYmVkZGluZ3MsbmFtZSA9ICd3b3JkX2VtYmVkZGluZycsZHR5cGU9dGYuZmxvYXQzMikKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYucmVsYXRpb25fbWF0cml4ID0gdGYuZ2V0X3ZhcmlhYmxlKCdyZWxhdGlvbl9tYXRyaXgnLFtzZWxmLm51bV9jbGFzc2VzLCBzZWxmLm91dHB1dF9zaXplKjNdLGR0eXBlPXRmLmZsb2F0MzIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVyPXRmLmNvbnRyaWIubGF5ZXJzLnhhdmllcl9pbml0aWFsaXplcihzZWVkPXNlbGYuc2VlZCkpCiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuYmlhcyA9IHRmLmdldF92YXJpYWJsZSgnYmlhcycsW3NlbGYubnVtX2NsYXNzZXNdLGR0eXBlPXRmLmZsb2F0MzIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0aWFsaXplcj10Zi5jb250cmliLmxheWVycy54YXZpZXJfaW5pdGlhbGl6ZXIoc2VlZD1zZWxmLnNlZWQpKQoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5yZWxhdGlvbl9tYXRyaXhfbG9jID0gdGYuZ2V0X3ZhcmlhYmxlKCdyZWxhdGlvbl9tYXRyaXhfbG9jJyxbc2VsZi5udW1fY2xhc3Nlcywgc2VsZi5vdXRwdXRfc2l6ZSoxXSxkdHlwZT10Zi5mbG9hdDMyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdGlhbGl6ZXI9dGYuY29udHJpYi5sYXllcnMueGF2aWVyX2luaXRpYWxpemVyKHNlZWQ9c2VsZi5zZWVkKSkKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5iaWFzX2xvYyA9IHRmLmdldF92YXJpYWJsZSgnYmlhc19sb2MnLFtzZWxmLm51bV9jbGFzc2VzXSxkdHlwZT10Zi5mbG9hdDMyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVyPXRmLmNvbnRyaWIubGF5ZXJzLnhhdmllcl9pbml0aWFsaXplcihzZWVkPXNlbGYuc2VlZCkpCiAgICAgICAgICAgICAgICAgICAgICAgIAoJCQkjIHBvc2l0aW9uIGVtYmVkZGluZ3MKCQkJdGVtcF9wb3NpMV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zZmVyIG1hdHJpeCBiZXR3ZWVuIHJlbGF0aW9ucyBhbmQgdGV4dHVhbCByZWxhdGlvbnMKCQkJc2VsZi5yZWxfZW1iZWRkaW5ncyA9IHRmLmdldF92YXJpYWJsZShuYW1lID0gInJlbF9lbWJlZGRpbmciLCBzaGFwZSA9IFtzZWxmLnJlbF90b3RhbCwgc2VsZi53b3JkX3NpemVdLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVyID0gdGYuY29udHJpYi5sYXllcnMueGF2aWVyX2luaXRpYWxpemVyKHNlZWQ9c2VsZi5zZWVkKSkKCQkJc2VsZi50cmFuc2Zlcl9tYXRyaXggPSB0Zi5nZXRfdmFyaWFibGUoInRyYW5zZmVyX21hdHJpeCIsIFtzZWxmLm91dHB1dF9zaXplLCBzZWxmLndvcmRfc2l6ZSoxXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdGlhbGl6ZXI9dGYuY29udHJpYi5sYXllcnMueGF2aWVyX2luaXRpYWxpemVyKHNlZWQ9c2VsZi5zZWVkKSkKCQkJc2VsZi50cmFuc2Zlcl9iaWFzID0gdGYuZ2V0X3ZhcmlhYmxlKCd0cmFuc2Zlcl9iaWFzJywgW3NlbGYud29yZF9zaXplKjFdLCBkdHlwZT10Zi5mbG9hdDMyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdGlhbGl6ZXI9dGYuY29udHJpYi5sYXllcnMueGF2aWVyX2luaXRpYWxpemVyKHNlZWQ9c2VsZi5zZWVkKSkKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICB3aXRoIHRmLm5hbWVfc2NvcGUoImVtYmVkZGluZy1sb29rdXAiKToKCQkJIyB0ZXh0dWFsIGVtYmVkZGluZy1sb29rdXAgCgkJ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xfZQoJCQlhdHRlbnRpb25fbG9naXQgPSB0Zi5yZWR1Y2Vfc3VtKHNlbGYudHJhbnNmZXIoeCkgKiBrZ19hdHQsIDEpCgkJCXRvd2VyX3JlcHJlID0gW10KCiAgICAgICAgICAgICAgICAgICAgICAgIHRvd2VyX3JlcHJlX2tnID0gW10KICAgICAgICAgICAgICAgICAgICAgICAgdG93ZXJfcmVwcmVfdHggPSBbXQogICAgICAgICAgICAgICAgICAgICAgICB0b3dlcl9yZXByZV9oeSA9IFtdCiAgICAgICAgICAgICAgICAgICAgICAgIAoJCQlmb3IgaSBpbiByYW5nZShzZWxmLmJhdGNoX3NpemUpOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBpICogMwoJCQkJcGF0aF9tYXRyaXggPSB4W3Njb3BlW2ldOnNjb3BlW2krM11dI2UuZy4sIHNjb3BlOiBbMCwgMywgNywgMTQsIC4uLl0KCQkJCWF0dGVudGlvbl9zY29yZSA9IHRmLm5uLnNvZnRtYXgodGYucmVzaGFwZShhdHRlbnRpb25fbG9naXRbc2NvcGVbaV06c2NvcGVbaSszXV0sIFsxLCAtMV0pKQoJCQkJZmluYWxfcmVwcmUgPSB0Zi5yZXNoYXBlKHRmLm1hdG11bChhdHRlbnRpb25fc2NvcmUsIHBhdGhfbWF0cml4KSxbc2VsZi5vdXRwdXRfc2l6ZV0pCgkJCQl0b3dlcl9yZXByZS5hcHBlbmQoZmluYWxfcmVwcmUpCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhfbWF0cml4X2tnID0geFtzY29wZVtpXTpzY29wZVtpKzFdXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9zY29yZV9rZyA9IHRmLm5uLnNvZnRtYXgodGYucmVzaGFwZShhdHRlbnRpb25fbG9naXRbc2NvcGVbaV06c2NvcGVbaSsxXV0sIFsxLCAtMV0pKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlX2tnID0gdGYucmVzaGFwZSh0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlX2tnLCBwYXRoX21hdHJpeF9rZyksW3NlbGYub3V0cHV0X3NpemVdKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvd2VyX3JlcHJlX2tnLmFwcGVuZChmaW5hbF9yZXByZV9rZykKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aF9tYXRyaXhfdHggPSB4W3Njb3BlW2krMV06c2NvcGVbaSsyXV0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRlbnRpb25fc2NvcmVfdHggPSB0Zi5ubi5zb2Z0bWF4KHRmLnJlc2hhcGUoYXR0ZW50aW9uX2xvZ2l0W3Njb3BlW2krMV06c2NvcGVbaSsyXV0sIFsxLCAtMV0pKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlX3R4ID0gdGYucmVzaGFwZSh0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlX3R4LCBwYXRoX21hdHJpeF90eCksW3NlbGYub3V0cHV0X3NpemVdKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvd2VyX3JlcHJlX3R4LmFwcGVuZChmaW5hbF9yZXByZV90eCkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aF9tYXRyaXhfaHkgPSB4W3Njb3BlW2krMl06c2NvcGVbaSszXV0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRlbnRpb25fc2NvcmVfaHkgPSB0Zi5ubi5zb2Z0bWF4KHRmLnJlc2hhcGUoYXR0ZW50aW9uX2xvZ2l0W3Njb3BlW2krMl06c2NvcGVbaSszXV0sIFsxLCAtMV0pKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlX2h5ID0gdGYucmVzaGFwZSh0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlX2h5LCBwYXRoX21hdHJpeF9oeSksW3NlbGYub3V0cHV0X3NpemVdKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvd2VyX3JlcHJlX2h5LmFwcGVuZChmaW5hbF9yZXByZV9oeSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKCQkJaWYgZHJvcG91dDoKCQkJCXN0YWNrX3JlcHJlID0gdGYubGF5ZXJzLmRyb3BvdXQodGYuc3RhY2sodG93ZXJfcmVwcmUpLCByYXRlID0gc2VsZi5rZWVwX3Byb2IsIHRyYWluaW5nID0gaXNfdHJhaW5pbmcpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhY2tfcmVwcmVfa2cgPSB0Zi5sYXllcnMuZHJvcG91dCh0Zi5zdGFjayh0b3dlcl9yZXByZV9rZyksIHJhdGUgPSBzZWxmLmtlZXBfcHJvYiwgdHJhaW5pbmcgPSBpc190cmFpbmluZykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFja19yZXByZV90eCA9IHRmLmxheWVycy5kcm9wb3V0KHRmLnN0YWNrKHRvd2VyX3JlcHJlX3R4KSwgcmF0ZSA9IHNlbGYua2VlcF9wcm9iLCB0cmFpbmluZyA9IGlzX3RyYWluaW5nKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YWNrX3JlcHJlX2h5ID0gdGYubGF5ZXJzLmRyb3BvdXQodGYuc3RhY2sodG93ZXJfcmVwcmVfaHkpLCByYXRlID0gc2VsZi5rZWVwX3Byb2IsIHRyYWluaW5nID0gaXNfdHJhaW5pbmcpCgkJCWVsc2U6CgkJCQlzdGFja19yZXByZSA9IHRmLnN0YWNrKHRvd2VyX3JlcHJlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YWNrX3JlcHJlX2tnID0gdGYuc3RhY2sodG93ZXJfcmVwcmVfa2cpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhY2tfcmVwcmVfdHggPSB0Zi5zd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JcGF0aF9tYXRyaXggPSB4W3Njb3BlW2ldOnNjb3BlW2krMV1dCgkJCQlhdHRlbnRpb25fc2NvcmUgPSB0Zi5ubi5zb2Z0bWF4KHRmLnJlc2hhcGUoYXR0ZW50aW9uX2xvZ2l0W3Njb3BlW2ldOnNjb3BlW2krMV1dLCBbMSwgLTFdKSkKCQkJCWZpbmFsX3JlcHJlID0gdGYucmVzaGFwZSh0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlLCBwYXRoX21hdHJpeCksW3NlbGYub3V0cHV0X3NpemVdKQoJCQkJdG93ZXJfcmVwcmUuYXBwZW5kKGZpbmFsX3JlcHJlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtfc2NvcmVzX2JhdGNoID0gcmFua19zY29yZXNbc2NvcGVbaV06c2NvcGVbaSsxXV0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5rX3NpemUgPSB0Zi5zaXplKHJhbmtfc2NvcmVzX2JhdGNoKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtfaW5kID0gdGYubm4udG9wX2socmFua19zY29yZXNfYmF0Y2gsIHJhbmtfc2l6ZSlbMV0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wX25fcmFua19pbmQgPSByYW5rX2luZFs6c2VsZi5yYW5rX3RvcG5dCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdF9uX3JhbmtfaW5kID0gcmFua19pbmRbLTEgKiBzZWxmLnJhbmtfdG9wbjpdCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhfbWF0cml4X3RvcCA9IHRmLmdhdGhlcihwYXRoX21hdHJpeCwgdG9wX25fcmFua19pbmQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aF9tYXRyaXhfbGFzdCA9IHRmLmdhdGhlcihwYXRoX21hdHJpeCwgbGFzdF9uX3JhbmtfaW5kKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRlbnRpb25fbG9naXRfdG9wID0gdGYuZ2F0aGVyKGF0dGVudGlvbl9sb2dpdFtzY29wZVtpXTpzY29wZVtpKzFdXSwgdG9wX25fcmFua19pbmQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0ZW50aW9uX2xvZ2l0X2xhc3QgPSB0Zi5nYXRoZXIoYXR0ZW50aW9uX2xvZ2l0W3Njb3BlW2ldOnNjb3BlW2krMV1dLCBsYXN0X25fcmFua19pbmQpCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9zY190b3AgPSB0Zi5ubi5zb2Z0bWF4KHRmLnJlc2hhcGUoYXR0ZW50aW9uX2xvZ2l0X3RvcCwgWzEsIC0xXSkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0ZW50aW9uX3NjX2xhc3QgPSB0Zi5ubi5zb2Z0bWF4KHRmLnJlc2hhcGUoYXR0ZW50aW9uX2xvZ2l0X2xhc3QsIFsxLCAtMV0pKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbF9yZXByZV90b3AgPSB0Zi5yZXNoYXBlKHRmLm1hdG11bChhdHRlbnRpb25fc2NfdG9wLCBwYXRoX21hdHJpeF90b3ApLFtzZWxmLm91dHB1dF9zaXplXSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbF9yZXByZV9sYXN0ID0gdGYucmVzaGFwZSh0Zi5tYXRtdWwoYXR0ZW50aW9uX3NjX2xhc3QsIHBhdGhfbWF0cml4X2xhc3QpLFtzZWxmLm91dHB1dF9zaXplXSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3dlcl9yZXByZV90b3AuYXBwZW5kKGZpbmFsX3JlcHJlX3RvcCkKICAgICAgICAgICAgICAgICAgICAg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AgICAgICAgICAgICAgICAgICBsb2dpdHNfaHkgPSB0Zi5tYXRtdWwoc3RhY2tfcmVwcmVfaHksIHRmLnRyYW5zcG9zZShzZWxmLnJlbGF0aW9uX21hdHJpeF9sb2MpKSArIHNlbGYuYmlhc19sb2MKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb3NzX2tnID0gdGYubG9zc2VzLnNvZnRtYXhfY3Jvc3NfZW50cm9weShvbmVob3RfbGFiZWxzID0gc2VsZi5sYWJlbCwgbG9naXRzID0gbG9naXRzX2tnLCB3ZWlnaHRzID0gc2VsZi53ZWlnaHRzKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvc3NfdHggPSB0Zi5sb3NzZXMuc29mdG1heF9jcm9zc19lbnRyb3B5KG9uZWhvdF9sYWJlbHMgPSBzZWxmLmxhYmVsLCBsb2dpdHMgPSBsb2dpdHNfdHgsIHdlaWdodHMgPSBzZWxmLndlaWdodHMpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9zc19oeSA9IHRmLmxvc3Nlcy5zb2Z0bWF4X2Nyb3NzX2VudHJvcHkob25laG90X2xhYmVscyA9IHNlbGYubGFiZWwsIGxvZ2l0cyA9IGxvZ2l0c19oeSwgd2VpZ2h0cyA9IHNlbGYud2VpZ2h0cykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb3NzX2xvYyA9IDEuMCpsb3NzX2tnICsgMS4wKmxvc3NfdHggKyAxLjAqbG9zc19oeQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYubG9zcyA9IHNlbGYubG9zcyArIGxvc3NfbG9jCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCgkJCXNlbGYub3V0cHV0ID0gdGYubm4uc29mdG1heChsb2dpdHMpCgkJCQoJCQlzZWxmLnByZWRpY3Rpb25zID0gdGYuYXJnbWF4KGxvZ2l0cywgMSwgbmFtZT0icHJlZGljdGlvbnMiKQoJCQlzZWxmLmNvcnJlY3RfcHJlZGljdGlvbnMgPSB0Zi5lcXVhbChzZWxmLnByZWRpY3Rpb25zLCB0Zi5hcmdtYXgoc2VsZi5sYWJlbCwgMSkpCgkJCXNlbGYuYWNjdXJhY3kgPSB0Zi5yZWR1Y2VfbWVhbih0Zi5jYXN0KHNlbGYuY29ycmVjdF9wcmVkaWN0aW9ucywgImZsb2F0IiksIG5hbWU9ImFjY3VyYWN5IikKCgkJaWYgbm90IGlzX3RyYWluaW5nOgoJCQl3aXRoIHRmLm5hbWVfc2NvcGUoInRlc3QiKToKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXN0X2F0dGVudGlvbl9sb2dpdCA9IHNlbGYua2F0dF90ZXN0KHgsIHNlbGYuaGVhZF9pbmRleCwgc2VsZi50YWlsX2luZGV4KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAoJCQkJdGVzdF90b3dlcl9vdXRwdXQgPSBbXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3RfYXR0X291dHB1dCA9IFtdCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVzdF9wcmVkX291dHB1dCA9IFtdCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVzdF9wcmVkX3Njb3JlID0gW10KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiBub3QgaXNfaW5mZXJyaW5nOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmJfZGF0YSA9IHNlbGYudGVzdGluZ19iYXRjaF9zaXplCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5iX2RhdGEgPSBzZWxmLm5iX2JhZ3MKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAoJCQkJZm9yIGkgaW4gcmFuZ2UobmJfZGF0YSk6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXN0X2F0dGVudGlvbl9zY29yZSA9IHRmLm5uLnNvZnRtYXgodGYudHJhbnNwb3NlKHRlc3RfYXR0ZW50aW9uX2xvZ2l0W3NlbGYuc2NvcGVbaV06c2VsZi5zY29wZVtpKzFdLDpdKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlX3BhcnQgPSB0Zi5tYXRtdWwodGVzdF9hdHRlbnRpb25fc2NvcmUsIHhbc2VsZi5zY29wZVtpXTpzZWxmLnNjb3BlW2krMV1dKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIHNlbGYuc3RyYXRlZ3kgaW4gWydub25lJywgJ3ByZXRyYWluJywgJ2xvY2xvc3MnXToKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWxfcmVwcmUgPSB0Zi5jb25jYXQoW2ZpbmFsX3JlcHJlX3BhcnQsIGZpbmFsX3JlcHJlX3BhcnQsIGZpbmFsX3JlcHJlX3BhcnRdLCBheGlzPTEpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGlmIHNlbGYuc3RyYXRlZ3kgaW4gWydyYW5raW5nJywgJ3ByZXRyYWluX3JhbmtpbmcnXToKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcF9mZWEgPSBzZWxmLmNvbXBfZmVhW3NlbGYuc2NvcGVbaV06c2VsZi5zY29wZVtpKzFdXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5rX2luZCwgcmFua19zY29yZXMgPSBzZWxmLnJhbmtfdGVzdChjb21wX2ZlYSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFua19pbmRfdG9wID0gcmFua19pbmRbOnNlbGYucmFua190b3BuXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5rX2luZF9sYXN0ID0gcmFua19pbmRbLTEgKiBzZWxmLnJhbmtfdG9wbjpdCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2JhdGNoID0geFtzZWxmLnNjb3BlW2ldOnNlbGYuc2NvcGVbaSsxXV0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeF9iYXRjaF90b3AgPSB0Zi5nYXRoZXIoeF9iYXRjaCwgcmFua19pbmRfdG9wKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2JhdGNoX2xhc3QgPSB0Zi5nYXRoZXIoeF9iYXRjaCwgcmFua19pbmRfbGFzdCkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9sb2dpdF9iYXRjaCA9IHRlc3RfYXR0ZW50aW9uX2xvZ2l0W3NlbGYuc2NvcGVbaV06c2VsZi5zY29wZVtpKzFdLDpdCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9sb2dpdF9iYXRjaF90b3AgPSB0Zi5nYXRoZXIoYXR0ZW50aW9uX2xvZ2l0X2JhdGNoLCByYW5rX2luZF90b3ApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9sb2dpdF9iYXRjaF9sYXN0ID0gdGYuZ2F0aGVyKGF0dGVudGlvbl9sb2dpdF9iYXRjaCwgcmFua19pbmRfbGFzdCkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9zY29yZV9iYXRjaF90b3AgPSB0Zi5ubi5zb2Z0bWF4KHRmLnRyYW5zcG9zZShhdHRlbnRpb25fbG9naXRfYmF0Y2hfdG9wKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0ZW50aW9uX3Njb3JlX2JhdGNoX2xhc3QgPSB0Zi5ubi5zb2Z0bWF4KHRmLnRyYW5zcG9zZShhdHRlbnRpb25fbG9naXRfYmF0Y2hfbGFzdCkpCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbF9yZXByZV90b3AgPSB0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlX2JhdGNoX3RvcCwgeF9iYXRjaF90b3ApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlX2xhc3QgPSB0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlX2JhdGNoX2xhc3QsIHhfYmF0Y2hfbGFzdCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlID0gdGYuY29uY2F0KFtmaW5hbF9yZXByZV9wYXJ0LCBmaW5hbF9yZXByZV90b3AsIGZpbmFsX3JlcHJlX2xhc3RdLCBheGlzPTEpCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9naXRzID0gdGYubWF0bXVsKGZpbmFsX3JlcHJlLCB0Zi50cmFuc3Bvc2Uoc2VsZi5yZWxhdGlvbl9tYXRyaXgpKSArIHNlbGYuYmlhcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gdGYuZGlhZ19wYXJ0KHRmLm5uLnNvZnRtYXgobG9naXRzKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3RfYXR0ID0gdGYuZ2F0aGVyKHRlc3RfYXR0ZW50aW9uX3Njb3JlLCB0Zi5hcmdtYXgob3V0cHV0KSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3RfYXR0X291dHB1dC5hcHBlbmQodGVzdF9hdHQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXN0X3ByZWRfb3V0cHV0LmFwcGVuZCh0Zi5hcmdtYXgob3V0cHV0KSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3RfcHJlZF9zY29yZS5hcHBlbmQodGYucmVkdWNlX21heChvdXRwdXQpKQoKCQkJCQl0ZXN0X3Rvd2VyX291dHB1dC5hcHBlbmQob3V0cHV0KQoJCQkJdGVzdF9zdGFja19vdXRwdXQgPSB0Zi5yZXNoYXBlKHRmLnN0YWNrKHRlc3RfdG93ZXJfb3V0cHV0KSxbbmJfZGF0YSwgc2VsZi5udW1fY2xhc3Nlc10pCgkJCQlzZWxmLnRlc3Rfb3V0cHV0ID0gdGVzdF9zdGFja19vdXRwdXQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnRlc3RfYXR0ID0gdGYuY29uY2F0KHRlc3RfYXR0X291dHB1dCwgMCwgbmFtZT0idGVzdF9hdHQiKQo8fGZpbV9ob2xlfD4KCjx8ZmltX3N1ZmZpeHw+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi50ZXN0X3ByZWQgPSB0Zi5zdGFjayh0ZXN0X3ByZWRfb3V0cHV0LCBuYW1lPSJ0ZXN0X3ByZWQiKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYudGVzdF9zYyA9IHRmLnN0YWNrKHRlc3RfcHJlZF9zY29yZSwgbmFtZT0idGVzdF9zYyIpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCjx8ZmltX2VuZHw+
|
0554db042f73e1e848fc59197c65646d23756264-2
|
0554db042f73e1e848fc59197c65646d23756264
|
PHxmaW1fcHJlZml4fD4KaW1wb3J0IHRlbnNvcmZsb3cgYXMgdGYKaW1wb3J0IG51bXB5IGFzIG5wCgpjbGFzcyBOTihvYmplY3QpOgogICAgICAgIGRlZiBjYWxjKHNlbGYsIGUsIHQsIHIpOgoJCXJldHVybiBlICsgdGYucmVkdWNlX3N1bShlICogdCwgMSwga2VlcF9kaW1zID0gVHJ1ZSkgKiByCgoJZGVmIF9faW5pdF9fKHNlbGYsIGlzX3RyYWluaW5nLCB3b3JkX2VtYmVkZGluZ3MsIG1heF9sZW5ndGgsCiAgICAgICAgICAgICAgICAgICAgIG51bV9jbGFzc2VzLCBoaWRkZW5fc2l6ZSwgcG9zaV9zaXplLCBtYXJnaW4sIHJlbF90b3RhbCwgc2VlZCwKICAgICAgICAgICAgICAgICAgICAgYmF0Y2hfc2l6ZSwgdGVzdGluZ19iYXRjaF9zaXplLCByYW5rX3RvcG4pOgoKICAgICAgICAgICAgICAgIHNlbGYud29yZF90b3RhbCwgc2VsZi53b3JkX3NpemUgPSB3b3JkX2VtYmVkZGluZ3Muc2hhcGUKCQlzZWxmLm1heF9sZW5ndGggPSBtYXhfbGVuZ3RoCiAgICAgICAgICAgICAgICAKCQlzZWxmLm51bV9jbGFzc2VzID0gbnVtX2NsYXNzZXMKICAgICAgICAgICAgICAgIHNlbGYuaGlkZGVuX3NpemUgPSBoaWRkZW5fc2l6ZQogICAgICAgICAgICAgICAgc2VsZi5vdXRwdXRfc2l6ZSA9IGhpZGRlbl9zaXplCiAgICAgICAgICAgICAgICBzZWxmLm1hcmdpbiA9IG1hcmdpbgogICAgICAgICAgICAgICAgc2VsZi5wb3NpX251bSA9IG1heF9sZW5ndGggKiAyICsgMQogICAgICAgICAgICAgICAgc2VsZi5wb3NpX3NpemUgPSBwb3NpX3NpemUKICAgICAgICAgICAgICAgIHNlbGYucmVsX3RvdGFsID0gcmVsX3RvdGFsCiAgICAgICAgICAgICAgICBzZWxmLnNlZWQgPSBzZWVkCgkJCiAgICAgICAgICAgICAgICBzZWxmLmJhdGNoX3NpemUgPS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13b3JkX2VtYmVkZGluZ3MsbmFtZSA9ICd3b3JkX2VtYmVkZGluZycsZHR5cGU9dGYuZmxvYXQzMikKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYucmVsYXRpb25fbWF0cml4ID0gdGYuZ2V0X3ZhcmlhYmxlKCdyZWxhdGlvbl9tYXRyaXgnLFtzZWxmLm51bV9jbGFzc2VzLCBzZWxmLm91dHB1dF9zaXplKjNdLGR0eXBlPXRmLmZsb2F0MzIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVyPXRmLmNvbnRyaWIubGF5ZXJzLnhhdmllcl9pbml0aWFsaXplcihzZWVkPXNlbGYuc2VlZCkpCiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuYmlhcyA9IHRmLmdldF92YXJpYWJsZSgnYmlhcycsW3NlbGYubnVtX2NsYXNzZXNdLGR0eXBlPXRmLmZsb2F0MzIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0aWFsaXplcj10Zi5jb250cmliLmxheWVycy54YXZpZXJfaW5pdGlhbGl6ZXIoc2VlZD1zZWxmLnNlZWQpKQoKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5yZWxhdGlvbl9tYXRyaXhfbG9jID0gdGYuZ2V0X3ZhcmlhYmxlKCdyZWxhdGlvbl9tYXRyaXhfbG9jJyxbc2VsZi5udW1fY2xhc3Nlcywgc2VsZi5vdXRwdXRfc2l6ZSoxXSxkdHlwZT10Zi5mbG9hdDMyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdGlhbGl6ZXI9dGYuY29udHJpYi5sYXllcnMueGF2aWVyX2luaXRpYWxpemVyKHNlZWQ9c2VsZi5zZWVkKSkKICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5iaWFzX2xvYyA9IHRmLmdldF92YXJpYWJsZSgnYmlhc19sb2MnLFtzZWxmLm51bV9jbGFzc2VzXSxkdHlwZT10Zi5mbG9hdDMyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVyPXRmLmNvbnRyaWIubGF5ZXJzLnhhdmllcl9pbml0aWFsaXplcihzZWVkPXNlbGYuc2VlZCkpCiAgICAgICAgICAgICAgICAgICAgICAgIAoJCQkjIHBvc2l0aW9uIGVtYmVkZGluZ3MKCQkJdGVtcF9wb3NpMV9lbWJlZGRpbmcgPSB0Zi5nZXRfdmFyaWFibGUoJ3RlbXBfcG9zaTFfZW1iZWRkaW5nJyxbc2VsZi5wb3NpX251bSwgc2VsZi5wb3NpX3NpemVdLGR0eXBlPXRmLmZsb2F0MzIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVyPXRmLmNvbnRyaWIubGF5ZXJzLnhhdmllcl9pbml0aWFsaXplcihzZWVkPXNlbGYuc2VlZCkpCgkJCXRlbXBfcG9zaTJfZW1iZWRkaW5nID0gdGYuZ2V0X3ZhcmlhYmxlKCd0ZW1wX3Bvc2kyX2VtYmVkZGluZycsW3NlbGYucG9zaV9udW0sIHNlbGYucG9zaV9zaXplXSxkdHlwZT10Zi5mbG9hdDMyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0aWFsaXplcj10Zi5jb250cmliLmxheWVycy54YXZpZXJfaW5pdGlhbGl6ZXIoc2VlZD1zZWxmLnNlZWQpKQoJCQlzZWxmLnBvc2kxX2VtYmVkZGluZyA9IHRmLmNvbmNhdChbdGVtcF9wb3NpMV9lbWJlZGRpbmcsdGYucmVzaGFwZSh0Zi5jb25zdGFudChucC56ZXJvcyhzZWxmLnBvc2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6ZV0pCgkJCQl0b3dlcl9yZXByZS5hcHBlbmQoZmluYWxfcmVwcmUpCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhfbWF0cml4X2tnID0geFtzY29wZVtpXTpzY29wZVtpKzFdXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9zY29yZV9rZyA9IHRmLm5uLnNvZnRtYXgodGYucmVzaGFwZShhdHRlbnRpb25fbG9naXRbc2NvcGVbaV06c2NvcGVbaSsxXV0sIFsxLCAtMV0pKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlX2tnID0gdGYucmVzaGFwZSh0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlX2tnLCBwYXRoX21hdHJpeF9rZyksW3NlbGYub3V0cHV0X3NpemVdKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvd2VyX3JlcHJlX2tnLmFwcGVuZChmaW5hbF9yZXByZV9rZykKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aF9tYXRyaXhfdHggPSB4W3Njb3BlW2krMV06c2NvcGVbaSsyXV0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRlbnRpb25fc2NvcmVfdHggPSB0Zi5ubi5zb2Z0bWF4KHRmLnJlc2hhcGUoYXR0ZW50aW9uX2xvZ2l0W3Njb3BlW2krMV06c2NvcGVbaSsyXV0sIFsxLCAtMV0pKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlX3R4ID0gdGYucmVzaGFwZSh0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlX3R4LCBwYXRoX21hdHJpeF90eCksW3NlbGYub3V0cHV0X3NpemVdKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvd2VyX3JlcHJlX3R4LmFwcGVuZChmaW5hbF9yZXByZV90eCkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aF9tYXRyaXhfaHkgPSB4W3Njb3BlW2krMl06c2NvcGVbaSszXV0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRlbnRpb25fc2NvcmVfaHkgPSB0Zi5ubi5zb2Z0bWF4KHRmLnJlc2hhcGUoYXR0ZW50aW9uX2xvZ2l0W3Njb3BlW2krMl06c2NvcGVbaSszXV0sIFsxLCAtMV0pKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlX2h5ID0gdGYucmVzaGFwZSh0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlX2h5LCBwYXRoX21hdHJpeF9oeSksW3NlbGYub3V0cHV0X3NpemVdKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvd2VyX3JlcHJlX2h5LmFwcGVuZChmaW5hbF9yZXByZV9oeSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKCQkJaWYgZHJvcG91dDoKCQkJCXN0YWNrX3JlcHJlID0gdGYubGF5ZXJzLmRyb3BvdXQodGYuc3RhY2sodG93ZXJfcmVwcmUpLCByYXRlID0gc2VsZi5rZWVwX3Byb2IsIHRyYWluaW5nID0gaXNfdHJhaW5pbmcpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhY2tfcmVwcmVfa2cgPSB0Zi5sYXllcnMuZHJvcG91dCh0Zi5zdGFjayh0b3dlcl9yZXByZV9rZyksIHJhdGUgPSBzZWxmLmtlZXBfcHJvYiwgdHJhaW5pbmcgPSBpc190cmFpbmluZykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFja19yZXByZV90eCA9IHRmLmxheWVycy5kcm9wb3V0KHRmLnN0YWNrKHRvd2VyX3JlcHJlX3R4KSwgcmF0ZSA9IHNlbGYua2VlcF9wcm9iLCB0cmFpbmluZyA9IGlzX3RyYWluaW5nKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YWNrX3JlcHJlX2h5ID0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CwgMSkKCQkJdG93ZXJfcmVwcmUgPSBbXQogICAgICAgICAgICAgICAgICAgICAgICB0b3dlcl9yZXByZV90b3AgPSBbXQogICAgICAgICAgICAgICAgICAgICAgICB0b3dlcl9yZXByZV9sYXN0ID0gW10KCiAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtfc2NvcmVzID0gdGYuc2lnbW9pZCh0Zi5yZWR1Y2Vfc3VtKHNlbGYuY29tcF9mZWEgKiBzZWxmLmNvbXBfZmVhX3dlaWdodCwgMSkpIyhCLCAxKQoJCQlmb3IgaSBpbiByYW5nZShzZWxmLmJhdGNoX3NpemUpOgoJCQkJcGF0aF9tYXRyaXggPSB4W3Njb3BlW2ldOnNjb3BlW2krMV1dCgkJCQlhdHRlbnRpb25fc2NvcmUgPSB0Zi5ubi5zb2Z0bWF4KHRmLnJlc2hhcGUoYXR0ZW50aW9uX2xvZ2l0W3Njb3BlW2ldOnNjb3BlW2krMV1dLCBbMSwgLTFdKSkKCQkJCWZpbmFsX3JlcHJlID0gdGYucmVzaGFwZSh0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlLCBwYXRoX21hdHJpeCksW3NlbGYub3V0cHV0X3NpemVdKQoJCQkJdG93ZXJfcmVwcmUuYXBwZW5kKGZpbmFsX3JlcHJlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtfc2NvcmVzX2JhdGNoID0gcmFua19zY29yZXNbc2NvcGVbaV06c2NvcGVbaSsxXV0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5rX3NpemUgPSB0Zi5zaXplKHJhbmtfc2NvcmVzX2JhdGNoKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtfaW5kID0gdGYubm4udG9wX2socmFua19zY29yZXNfYmF0Y2gsIHJhbmtfc2l6ZSlbMV0KCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wX25fcmFua19pbmQgPSByYW5rX2luZFs6c2VsZi5yYW5rX3RvcG5dCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdF9uX3JhbmtfaW5kID0gcmFua19pbmRbLTEgKiBzZWxmLnJhbmtfdG9wbjpdCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhfbWF0cml4X3RvcCA9IHRmLmdhdGhlcihwYXRoX21hdHJpeCwgdG9wX25fcmFua19pbmQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aF9tYXRyaXhfbGFzdCA9IHRmLmdhdGhlcihwYXRoX21hdHJpeCwgbGFzdF9uX3JhbmtfaW5kKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRlbnRpb25fbG9naXRfdG9wID0gdGYuZ2F0aGVyKGF0dGVudGlvbl9sb2dpdFtzY29wZVtpXTpzY29wZVtpKzFdXSwgdG9wX25fcmFua19pbmQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0ZW50aW9uX2xvZ2l0X2xhc3QgPSB0Zi5nYXRoZXIoYXR0ZW50aW9uX2xvZ2l0W3Njb3BlW2ldOnNjb3BlW2krMV1dLCBsYXN0X25fcmFua19pbmQpCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9zY190b3AgPSB0Zi5ubi5zb2Z0bWF4KHRmLnJlc2hhcGUoYXR0ZW50aW9uX2xvZ2l0X3RvcCwgWzEsIC0xXSkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0ZW50aW9uX3NjX2xhc3QgPSB0Zi5ubi5zb2Z0bWF4KHRmLnJlc2hhcGUoYXR0ZW50aW9uX2xvZ2l0X2xhc3QsIFsxLCAtMV0pKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbF9yZXByZV90b3AgPSB0Zi5yZXNoYXBlKHRmLm1hdG11bChhdHRlbnRpb25fc2NfdG9wLCBwYXRoX21hdHJpeF90b3ApLFtzZWxmLm91dHB1dF9zaXplXSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbF9yZXByZV9sYXN0ID0gdGYucmVzaGFwZSh0Zi5tYXRtdWwoYXR0ZW50aW9uX3NjX2xhc3QsIHBhdGhfbWF0cml4X2xhc3QpLFtzZWxmLm91dHB1dF9zaXplXSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3dlcl9yZXByZV90b3AuYXBwZW5kKGZpbmFsX3JlcHJlX3RvcCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3dlcl9yZXByZV9sYXN0LmFwcGVuZChmaW5hbF9yZXByZV9sYXN0KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAoJCQlpZiBkcm9wb3V0OgoJCQkJc3RhY2tfcmVwcmUgPSB0Zi5sYXllcnMuZHJvcG91dCh0Zi5zdGFjayh0b3dlcl9yZXByZSksIHJhdGUgPSBzZWxmLmtlZXBfcHJvYiwgdHJhaW5pbmcgPSBpc190cmFpbmluZykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFja19yZXByZV90b3AgPSB0Zi5sYXllcnMuZHJvcG91dCh0Zi5zdGFjayh0b3dlcl9yZXByZV90b3ApLCByYXRlID0gc2VsZi5rZWVwX3Byb2IsIHRyYWluaW5nID0gaXNfdHJhaW5pbmcpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhY2tfcmVwcmVfbGFzdCA9IHRmLmxheWVycy5kcm9wb3V0KHRmLnN0YWNrKHRvd2VyX3JlcHJlX2xhc3QpLCByYXRlID0gc2VsZi5rZWVwX3Byb2IsIHRyYWluaW5nID0gaXNfdHJhaW5pbmcpCgkJCWVsc2U6CgkJCQlzdGFja19yZXByZSA9IHRmLnN0YWNrKHRvd2VyX3JlcHJlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YWNrX3J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Shjb21wX2ZlYSAqIHNlbGYuY29tcF9mZWFfd2VpZ2h0LCAxKSkKICAgICAgICAgICAgICAgIHJhbmtfc2l6ZSA9IHRmLnNpemUocmFua19zY29yZXMpCiAgICAgICAgICAgICAgICByYW5rX2luZCA9IHRmLm5uLnRvcF9rKHJhbmtfc2NvcmVzLCByYW5rX3NpemUpWzFdCiAgICAgICAgICAgICAgICByZXR1cm4gcmFua19pbmQsIHJhbmtfc2NvcmVzCgpjbGFzcyBDTk4oTk4pOgoKCWRlZiBfX2luaXRfXyhzZWxmLCBpc190cmFpbmluZywgd29yZF9lbWJlZGRpbmdzLCBtYXhfbGVuZ3RoLAogICAgICAgICAgICAgICAgICAgICBudW1fY2xhc3NlcywgaGlkZGVuX3NpemUsIHBvc2lfc2l6ZSwgbWFyZ2luLCByZWxfdG90YWwsIHNlZWQsCiAgICAgICAgICAgICAgICAgICAgIGJhdGNoX3NpemUsIHRlc3RpbmdfYmF0Y2hfc2l6ZSwgcmFua190b3BuLCBzdHJhdGVneSwgaXNfaW5mZXJyaW5nPUZhbHNlLCBuYl9iYWdzPU5vbmUpOgoKICAgICAgICAgICAgICAgIHNlbGYuc3RyYXRlZ3kgPSBzdHJhdGVneQogICAgICAgICAgICAgICAgc2VsZi5pc19pbmZlcnJpbmcgPSBpc19pbmZlcnJpbmcKICAgICAgICAgICAgICAgIHNlbGYubmJfYmFncyA9IG5iX2JhZ3MKICAgICAgICAgICAgICAgIAoJCU5OLl9faW5pdF9fKHNlbGYsIGlzX3RyYWluaW5nLCB3b3JkX2VtYmVkZGluZ3MsIG1heF9sZW5ndGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1fY2xhc3NlcywgaGlkZGVuX3NpemUsIHBvc2lfc2l6ZSwgbWFyZ2luLCByZWxfdG90YWwsIHNlZWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYXRjaF9zaXplLCB0ZXN0aW5nX2JhdGNoX3NpemUsIHJhbmtfdG9wbikKCgkJd2l0aCB0Zi5uYW1lX3Njb3BlKCJjb252LW1heHBvb2wiKToKCQkJaW5wdXRfcGF0aCA9IHRmLmV4cGFuZF9kaW1zKHNlbGYuaW5wdXRfZW1iZWRkaW5nLCBheGlzPTEpCgkJCXggPSB0Zi5sYXllcnMuY29udjJkKGlucHV0cyA9IGlucHV0X3BhdGgsIGZpbHRlcnM9c2VsZi5oaWRkZW5fc2l6ZSwga2VybmVsX3NpemU9WzEsM10sIHN0cmlkZXM9WzEsIDFdLCBwYWRkaW5nPSdzYW1lJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2VybmVsX2luaXRpYWxpemVyPXRmLmNvbnRyaWIubGF5ZXJzLnhhdmllcl9pbml0aWFsaXplcl9jb252MmQoc2VlZD1zZWxmLnNlZWQpKSAKCQkJeCA9IHRmLnJlZHVjZV9tYXgoeCwgYXhpcz0yKQoJCQl4ID0gdGYubm4ucmVsdSh0Zi5zcXVlZXplKHgpKQogICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIGlmIHNlbGYuc3RyYXRlZ3kgaW4gWydub25lJywgJ3ByZXRyYWluJywgJ3ByZXRyYWluX3JhbmtpbmcnXToKICAgICAgICAgICAgICAgICAgICAgICAgc3RhY2tfcmVwcmVfcGFydCA9IHNlbGYua2F0dCh4LCBzZWxmLmhlYWRfaW5kZXgsIHNlbGYudGFpbF9pbmRleCwgc2VsZi5zY29wZSwgaXNfdHJhaW5pbmcpCiAgICAgICAgICAgICAgICAgICAgICAgIHN0YWNrX3JlcHJlID0gdGYuY29uY2F0KFtzdGFja19yZXByZV9wYXJ0LCBzdGFja19yZXByZV9wYXJ0LCBzdGFja19yZXByZV9wYXJ0XSwgYXhpcz0xKQogICAgICAgICAgICAgICAgZWxpZiBzZWxmLnN0cmF0ZWd5ID09ICdyYW5raW5nJzoKICAgICAgICAgICAgICAgICAgICAgICAgc3RhY2tfcmVwcmVfYWxsLCBzdGFja19yZXByZV90b3AsIHN0Y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3NzJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2dpdHNfa2cgPSB0Zi5tYXRtdWwoc3RhY2tfcmVwcmVfa2csIHRmLnRyYW5zcG9zZShzZWxmLnJlbGF0aW9uX21hdHJpeF9sb2MpKSArIHNlbGYuYmlhc19sb2MKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2dpdHNfdHggPSB0Zi5tYXRtdWwoc3RhY2tfcmVwcmVfdHgsIHRmLnRyYW5zcG9zZShzZWxmLnJlbGF0aW9uX21hdHJpeF9sb2MpKSArIHNlbGYuYmlhc19sb2MKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2dpdHNfaHkgPSB0Zi5tYXRtdWwoc3RhY2tfcmVwcmVfaHksIHRmLnRyYW5zcG9zZShzZWxmLnJlbGF0aW9uX21hdHJpeF9sb2MpKSArIHNlbGYuYmlhc19sb2MKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb3NzX2tnID0gdGYubG9zc2VzLnNvZnRtYXhfY3Jvc3NfZW50cm9weShvbmVob3RfbGFiZWxzID0gc2VsZi5sYWJlbCwgbG9naXRzID0gbG9naXRzX2tnLCB3ZWlnaHRzID0gc2VsZi53ZWlnaHRzKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvc3NfdHggPSB0Zi5sb3NzZXMuc29mdG1heF9jcm9zc19lbnRyb3B5KG9uZWhvdF9sYWJlbHMgPSBzZWxmLmxhYmVsLCBsb2dpdHMgPSBsb2dpdHNfdHgsIHdlaWdodHMgPSBzZWxmLndlaWdodHMpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9zc19oeSA9IHRmLmxvc3Nlcy5zb2Z0bWF4X2Nyb3NzX2VudHJvcHkob25laG90X2xhYmVscyA9IHNlbGYubGFiZWwsIGxvZ2l0cyA9IGxvZ2l0c19oeSwgd2VpZ2h0cyA9IHNlbGYud2VpZ2h0cykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb3NzX2xvYyA9IDEuMCpsb3NzX2tnICsgMS4wKmxvc3NfdHggKyAxLjAqbG9zc19oeQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYubG9zcyA9IHNlbGYubG9zcyArIGxvc3NfbG9jCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCgkJCXNlbGYub3V0cHV0ID0gdGYubm4uc29mdG1heChsb2dpdHMpCgkJCQoJCQlzZWxmLnByZWRpY3Rpb25zID0gdGYuYXJnbWF4KGxvZ2l0cywgMSwgbmFtZT0icHJlZGljdGlvbnMiKQoJCQlzZWxmLmNvcnJlY3RfcHJlZGljdGlvbnMgPSB0Zi5lcXVhbChzZWxmLnByZWRpY3Rpb25zLCB0Zi5hcmdtYXgoc2VsZi5sYWJlbCwgMSkpCgkJCXNlbGYuYWNjdXJhY3kgPSB0Zi5yZWR1Y2VfbWVhbih0Zi5jYXN0KHNlbGYuY29ycmVjdF9wcmVkaWN0aW9ucywgImZsb2F0IiksIG5hbWU9ImFjY3VyYWN5IikKCgkJaWYgbm90IGlzX3RyYWluaW5nOgoJCQl3aXRoIHRmLm5hbWVfc2NvcGUoInRlc3QiKToKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXN0X2F0dGVudGlvbl9sb2dpdCA9IHNlbGYua2F0dF90ZXN0KHgsIHNlbGYuaGVhZF9pbmRleCwgc2VsZi50YWlsX2luZGV4KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAoJCQkJdGVzdF90b3dlcl9vdXRwdXQgPSBbXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3RfYXR0X291dHB1dCA9IFtdCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVzdF9wcmVkX291dHB1dCA9IFtdCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVzdF9wcmVkX3Njb3JlID0gW10KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiBub3QgaXNfaW5mZXJyaW5nOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmJfZGF0YSA9IHNlbGYudGVzdGluZ19iYXRjaF9zaXplCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZToKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5iX2RhdGEgPSBzZWxmLm5iX2JhZ3MKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAoJCQkJZm9yIGkgaW4gcmFuZ2UobmJfZGF0YSk6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXN0X2F0dGVudGlvbl9zY29yZSA9IHRmLm5uLnNvZnRtYXgodGYudHJhbnNwb3NlKHRlc3RfYXR0ZW50aW9uX2xvZ2l0W3NlbGYuc2NvcGVbaV06c2VsZi5zY29wZVtpKzFdLDpdKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlX3BhcnQgPSB0Zi5tYXRtdWwodGVzdF9hdHRlbnRpb25fc2NvcmUsIHhbc2VsZi5zY29wZVtpXTpzZWxmLnNjb3BlW2krMV1dKQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIHNlbGYuc3RyYXRlZ3kgaW4gWydub25lJywgJ3ByZXRyYWluJywgJ2xvY2xvc3MnXToKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWxfcmVwcmUgPSB0Zi5jb25jYXQoW2ZpbmFsX3JlcHJlX3BhcnQsIGZpbmFsX3JlcHJlX3BhcnQsIGZpbmFsX3JlcHJlX3BhcnRdLCBheGlzPTEpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGlmIHNlbGYuc3RyYXRlZ3kgaW4gWydyYW5raW5nJywgJ3ByZXRyYWluX3JhbmtpbmcnXToKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcF9mZWEgPSBzZWxmLmNvbXBfZmVhW3NlbGYuc2NvcGVbaV06c2VsZi5zY29wZVtpKzFdXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5rX2luZCwgcmFua19zY29yZXMgPSBzZWxmLnJhbmtfdGVzdChjb21wX2ZlYSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFua19pbmRfdG9wID0gcmFua19pbmRbOnNlbGYucmFua190b3BuXQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5rX2luZF9sYXN0ID0gcmFua19pbmRbLTEgKiBzZWxmLnJhbmtfdG9wbjpdCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2JhdGNoID0geFtzZWxmLnNjb3BlW2ldOnNlbGYuc2NvcGVbaSsxXV0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeF9iYXRjaF90b3AgPSB0Zi5nYXRoZXIoeF9iYXRjaCwgcmFua19pbmRfdG9wKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2JhdGNoX2xhc3QgPSB0Zi5nYXRoZXIoeF9iYXRjaCwgcmFua19pbmRfbGFzdCkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9sb2dpdF9iYXRjaCA9IHRlc3RfYXR0ZW50aW9uX2xvZ2l0W3NlbGYuc2NvcGVbaV06c2VsZi5zY29wZVtpKzFdLDpdCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9sb2dpdF9iYXRjaF90b3AgPSB0Zi5nYXRoZXIoYXR0ZW50aW9uX2xvZ2l0X2JhdGNoLCByYW5rX2luZF90b3ApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9sb2dpdF9iYXRjaF9sYXN0ID0gdGYuZ2F0aGVyKGF0dGVudGlvbl9sb2dpdF9iYXRjaCwgcmFua19pbmRfbGFzdCkKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGVudGlvbl9zY29yZV9iYXRjaF90b3AgPSB0Zi5ubi5zb2Z0bWF4KHRmLnRyYW5zcG9zZShhdHRlbnRpb25fbG9naXRfYmF0Y2hfdG9wKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0ZW50aW9uX3Njb3JlX2JhdGNoX2xhc3QgPSB0Zi5ubi5zb2Z0bWF4KHRmLnRyYW5zcG9zZShhdHRlbnRpb25fbG9naXRfYmF0Y2hfbGFzdCkpCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbF9yZXByZV90b3AgPSB0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlX2JhdGNoX3RvcCwgeF9iYXRjaF90b3ApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlX2xhc3QgPSB0Zi5tYXRtdWwoYXR0ZW50aW9uX3Njb3JlX2JhdGNoX2xhc3QsIHhfYmF0Y2hfbGFzdCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsX3JlcHJlID0gdGYuY29uY2F0KFtmaW5hbF9yZXByZV9wYXJ0LCBmaW5hbF9yZXByZV90b3AsIGZpbmFsX3JlcHJlX2xhc3RdLCBheGlzPTEpCgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9naXRzID0gdGYubWF0bXVsKGZpbmFsX3JlcHJlLCB0Zi50cmFuc3Bvc2Uoc2VsZi5yZWxhdGlvbl9tYXRyaXgpKSArIHNlbGYuYmlhcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gdGYuZGlhZ19wYXJ0KHRmLm5uLnNvZnRtYXgobG9naXRzKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3RfYXR0ID0gdGYuZ2F0aGVyKHRlc3RfYXR0ZW50aW9uX3Njb3JlLCB0Zi5hcmdtYXgob3V0cHV0KSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3RfYXR0X291dHB1dC5hcHBlbmQodGVzdF9hdHQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXN0X3ByZWRfb3V0cHV0LmFwcGVuZCh0Zi5hcmdtYXgob3V0cHV0KSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3RfcHJlZF9zY29yZS5hcHBlbmQodGYucmVkdWNlX21heChvdXRwdXQpKQoKCQkJCQl0ZXN0X3Rvd2VyX291dHB1dC5hcHBlbmQob3V0cHV0KQoJCQkJdGVzdF9zdGFja19vdXRwdXQgPSB0Zi5yZXNoYXBlKHRmLnN0YWNrKHRlc3RfdG93ZXJfb3V0cHV0KSxbbmJfZGF0YSwgc2VsZi5udW1fY2xhc3Nlc10pCgkJCQlzZWxmLnRlc3Rfb3V0cHV0ID0gdGVzdF9zdGFja19vdXRwdXQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnRlc3RfYXR0ID0gdGYuY29uY2F0KHRlc3RfYXR0X291dHB1dCwgMCwgbmFtZT0idGVzdF9hdHQiKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYudGVzdF9wcmVkID0gdGYuc3RhY2sodGVzdF9w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zFdXSwKICAgICAgICAgICAgICAgICAgWzAsIDBdLCBjb2xvcj0nZ3JheScpCgogICAgIyB0aGUgbmV3IG5vZGVzCiAgICBmb3IgaXRlbSBpbiBncmFwaC5ub2RlcygpOgogICAgICAgIGlmIGl0ZW0gaW4gcmVxdWVzdC5ub2RlcygpOgogICAgICAgICAgICBmb3IgbmdoYiBpbiBncmFwaC5uZWlnaGJvcnMoaXRlbSk6CiAgICAgICAgICAgICAgICBpZiBuZ2hiIGluIHRtcC5ub2RlcygpOgogICAgICAgICAgICAgICAgICAgIHhfdmFsID0gcG9zW25naGJdWzBdCiAgICAgICAgICAgICAgICAgICAgeV92YWwgPSBwb3NbbmdoYl1bMV0KICAgICAgICAgICAgICAgICAgICBpZiAoeF92YWwsIHlfdmFsKSBpbiBsaXN0KGNhY2hlLnZhbHVlcygpKToKICAgICAgICAgICAgICAgICAgICAgICAgeF92YWwgPSBwb3NbbmdoYl1bMF0gKyByYW5kb20ucmFuZGludCgxMCwgU1BBQ0UpCiAgICAgICAgICAgICAgICAgICAgICAgIHlfdmFsID0gcG9zW25naGJdWzBdICsgcmFuZG9tLnJhbmRpbnQoMTAsIFNQQUNFKQogICAgICAgICAgICAgICAgICAgIGNhY2hlW2l0ZW1dID0gKHhfdmFsLCB5X3ZhbCkKCiAgICAgICAgICAgICAgICAgICAgIyBlZGdlCiAgICAgICAgICAgICAgICAgICAgYXhlcy5wbG90KFt4X3ZhbCwgcG9zW25naGJdWzBdXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3lfdmFsLCBwb3NbbmdoYl1bMV1dLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbU1BBQ0UsIDBdLCBjb2xvcj0nYmx1ZScpCgogICAgICAgICAgICBheGVzLnBsb3QoW3hfdmFsXSwgW3lfdmFsXSwgW1NQQUNFXSwgbGluZXN0eWxlPSJOb25lIiwgbWFya2VyPSJvIiwKICAgICAgICAgICAgICAgICAgICAgIGNvbG9yPSdibHVlJykKICAgICAgICAgICAgYXhlcy50ZXh0KHhfdmFsLCB5X3ZhbCwgU1BBQ0UsIGl0ZW0pCgogICAgZm9yIHNyYywgdHJnIGluIHJlcXVlc3QuZWRnZXMoKToKICAgICAgICBpZiB0cmcgaW4gY2FjaGUgYW5kIHNyYyBpbiBjYWNoZToKICAgICAgICAgICAgYXhlcy5wbG90KFtjYWNoZVtzcmNdWzBdLCBjYWNoZVt0cmddWzBdXSwKICAgICAgICAgICAgICAgICAgICAgIFtjYWNoZVtzcmNdWzFdLCBjYWNoZVt0cmddWzFdXSwKICAgICAgICAgICAgICAgICAgICAgIFtTUEFDRSwgU1BBQ0VdLCBjb2xvcj0nYmx1ZScpCgoKZGVmIF9nZXRfc2l6ZShuX2l0ZW1zKToKICAgICIiIgogICAgQ2FsY3VsYXRlIHRoZSBzaXplIG9mIHRoZSBzdWJwbG90IGxheW91dHMgYmFzZWQgb24gbnVtYmVyIG9mIGl0ZW1zLgogICAgIiIiCiAgICBuX2NvbHMgPSBtYXRoLmNlaWwobWF0aC5zcXJ0KG5faXRlbXMpKQogICAgbl9yb3dzID0gbWF0aC5mbG9vcihtYXRoLnNxcnQobl9pdGVtcykpCiAgICBpZiBuX2NvbHMgKiBuX3Jvd3MgPCBuX2l0ZW1zOgogICAgICAgIG5fY29scyArPSAxCiAgICByZXR1cm4gaW50KG5fcm93cyksIGludChuX2NvbHMpCjx8ZmltX3N1ZmZpeHw+CiAgICBQbG90IGEgc2luZ2xlIGNhbmRpZGF0ZSBncmFwaC4KICAgICIiIgogICAgcG9zID0gbngubnhfYWdyYXBoLmdyYXBodml6X2xheW91dChncmFwaCwgcHJvZz1wcm9nKQoKPHxmaW1fZW5kfD4=
|
20f73c4045cf00049ed6d8e967e23794bf27217a-2
|
20f73c4045cf00049ed6d8e967e23794bf27217a
|
PHxmaW1fcHJlZml4fD4KCiIiIgpWaXN1YWxpemUgcG9zc2libGUgc3RpdGNoZXMgd2l0aCB0aGUgb3V0Y29tZSBvZiB0aGUgdmFsa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yID0gJ3InCiAgICAgICAgZWxpZiAncmFuaycgaW4gdmFsdWVzIGFuZCB2YWx1ZXNbJ3JhbmsnXSA8IDcgYW5kIHZhbHVlc1sncmFuayddID4gMzoKICAgICAgICAgICAgY29sb3IgPSAneScKICAgICAgICBueC5kcmF3X25ldHdvcmt4X25vZGVzKGdyYXBoLCBwb3MsIG5vZGVsaXN0PVtub2RlXSwgbm9kZV9jb2xvcj1jb2xvciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVfc2hhcGU9c2hhcGUsIGFscGhhPWFscGhhLCBheD1heGVzKQoKICAgICMgZHJhdyB0aGUgZWRnZXMKICAgIGRvdHRlZF9saW5lID0gW10KICAgIG5vcm1hbF9saW5lID0gW10KICAgIGZvciBzcmMsIHRyZyBpbiBncmFwaC5lZGdlcygpOgogICAgICAgIGlmIHNyYyBpbiBuZXdfbm9kZXMgYW5kIHRyZyBub3QgaW4gbmV3X25vZGVzOgogICAgICAgICAgICBkb3R0ZWRfbGluZS5hcHBlbmQoKHNyYywgdHJnKSkKICAgICAgICBlbHNlOgogICAgICAgICAgICBub3JtYWxfbGluZS5hcHBlbmQoKHNyYywgdHJnKSkKICAgIG54LmRyYXdfbmV0d29ya3hfZWRnZXMoZ3JhcGgsIHBvcywgZWRnZWxpc3Q9ZG90dGVkX2xpbmUsIHN0eWxlPSdkb3R0ZWQnLAogICAgICAgICAgICAgICAgICAgICAgICAgICBheD1heGVzKQogICAgbnguZHJhd19uZXR3b3JreF9lZGdlcyhncmFwaCwgcG9zLCBlZGdlbGlzdD1ub3JtYWxfbGluZSwgYXg9YXhlcykKCiAgICAjIGRyYXcgbGFiZWxzCiAgICBueC5kcmF3X25ldHdvcmt4X2xhYmVscyhncmFwaCwgcG9zLCBheD1heGVzKQoKCmRlZiBzaG93XzNkKGdyYXBocywgcmVxdWVzdCwgdGl0bGVzLCBwcm9nPSduZWF0bycsIGZpbGVuYW1lPU5vbmUpOgogICAgIiIiCiAgICBTaG93IHRoZ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dXQodG1wLCBwcm9nPXByb2cpCgogICAgIyB0aGUgY29udGFpbmVyCiAgICBmb3IgaXRlbSBpbiB0bXAubm9kZXMoKToKICAgICAgICBheGVzLnBsb3QoW3Bvc1tpdGVtXVswXV0sIFtwb3NbaXRlbV1bMV1dLCBbMF0sIGxpbmVzdHlsZT0iTm9uZSIsCiAgICAgICAgICAgICAgICAgIG1hcmtlcj0ibyIsIGNvbG9yPSdncmF5JykKICAgICAgICBheGVzLnRleHQocG9zW2l0ZW1dWzBdLCBwb3NbaXRlbV1bMV0sIDAsIGl0ZW0pCgogICAgZm9yIHNyYywgdHJnIGluIHRtcC5lZGdlcygpOgogICAgICAgIGF4ZXMucGxvdChbcG9zW3NyY11bMF0sIHBvc1t0cmddWzBdXSwKICAgICAgICAgICAgICAgICAgW3Bvc1tzcmNdWzFdLCBwb3NbdHJnXVsxXV0sCiAgICAgICAgICAgICAgICAgIFswLCAwXSwgY29sb3I9J2dyYXknKQoKICAgICMgdGhlIG5ldyBub2RlcwogICAgZm9yIGl0ZW0gaW4gZ3JhcGgubm9kZXMoKToKICAgICAgICBpZiBpdGVtIGluIHJlcXVlc3Qubm9kZXMoKToKICAgICAgICAgICAgZm9yIG5naGIgaW4gZ3JhcGgubmVpZ2hib3JzKGl0ZW0pOgogICAgICAgICAgICAgICAgaWYgbmdoYiBpbiB0bXAubm9kZXMoKToKICAgICAgICAgICAgICAgICAgICB4X3ZhbCA9IHBvc1tuZ2hiXVswXQogICAgICAgICAgICAgICAgICAgIHlfdmFsID0gcG9zW25naGJdWzFdCiAgICAgICAgICAgICAgICAgICAgaWYgKHhfdmFsLCB5X3ZhbCkgaW4gbGlzdChjYWNoZS52YWx1ZXMoKSk6CiAgICAgICAgICAgICAgICAgICAgICAgIHhfdmFsID0gcG9zW25naGJdWzBdICsgcmFuZG9tLnJhbmRpbnQoMTAsIFNQQUNFKQogICAgICAgICAgICAgICAgICAgICAgICB5X3ZhbCA9IHBvc1tuZ2hiXVswXSArIHJhbmRv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gYW5kIHZhbHVlc1sncmFuayddID4gMzoKICAgICAgICAgICAgY29sb3IgPSAneScKICAgICAgICBueC5kcmF3X25ldHdvcmt4X25vZGVzKGdyYXBoLCBwb3MsIG5vZGVsaXN0PVtub2RlXSwgbm9kZV9jb2xvcj1jb2xvciwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVfc2hhcGU9c2hhcGUsIGFscGhhPWFscGhhLCBheD1heGVzKQoKICAgICMgZHJhdyB0aGUgZWRnZXMKICAgIGRvdHRlZF9saW5lID0gW10KICAgIG5vcm1hbF9saW5lID0gW10KICAgIGZvciBzcmMsIHRyZyBpbiBncmFwaC5lZGdlcygpOgogICAgICAgIGlmIHNyYyBpbiBuZXdfbm9kZXMgYW5kIHRyZyBub3QgaW4gbmV3X25vZGVzOgogICAgICAgICAgICBkb3R0ZWRfbGluZS5hcHBlbmQoKHNyYywgdHJnKSkKICAgICAgICBlbHNlOgogICAgICAgICAgICBub3JtYWxfbGluZS5hcHBlbmQoKHNyYywgdHJnKSkKICAgIG54LmRyYXdfbmV0d29ya3hfZWRnZXMoZ3JhcGgsIHBvcywgZWRnZWxpc3Q9ZG90dGVkX2xpbmUsIHN0eWxlPSdkb3R0ZWQnLAogICAgICAgICAgICAgICAgICAgICAgICAgICBheD1heGVzKQogICAgbnguZHJhd19uZXR3b3JreF9lZGdlcyhncmFwaCwgcG9zLCBlZGdlbGlzdD1ub3JtYWxfbGluZSwgYXg9YXhlcykKCiAgICAjIGRyYXcgbGFiZWxzCiAgICBueC5kcmF3X25ldHdvcmt4X2xhYmVscyhncmFwaCwgcG9zLCBheD1heGVzKQoKCmRlZiBzaG93XzNkKGdyYXBocywgcmVxdWVzdCwgdGl0bGVzLCBwcm9nPSduZWF0bycsIGZpbGVuYW1lPU5vbmUpOgogICAgIiIiCiAgICBTaG93IHRoZSBjYW5kaWRhdGVzIGluIDNkIC0gdGhlIHJlcXVlc3QgZWxldmF0ZWQgYWJvdmUgdGhlIGNvbnRhaW5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XMoKToKICAgICAgICBheGVzLnBsb3QoW3Bvc1tpdGVtXVswXV0sIFtwb3NbaXRlbV1bMV1dLCBbMF0sIGxpbmVzdHlsZT0iTm9uZSIsCiAgICAgICAgICAgICAgICAgIG1hcmtlcj0ibyIsIGNvbG9yPSdncmF5JykKICAgICAgICBheGVzLnRleHQocG9zW2l0ZW1dWzBdLCBwb3NbaXRlbV1bMV0sIDAsIGl0ZW0pCgogICAgZm9yIHNyYywgdHJnIGluIHRtcC5lZGdlcygpOgogICAgICAgIGF4ZXMucGxvdChbcG9zW3NyY11bMF0sIHBvc1t0cmddWzBdXSwKICAgICAgICAgICAgICAgICAgW3Bvc1tzcmNdWzFdLCBwb3NbdHJnXVsxXV0sCiAgICAgICAgICAgICAgICAgIFswLCAwXSwgY29sb3I9J2dyYXknKQoKICAgICMgdGhlIG5ldyBub2RlcwogICAgZm9yIGl0ZW0gaW4gZ3JhcGgubm9kZXMoKToKICAgICAgICBpZiBpdGVtIGluIHJlcXVlc3Qubm9kZXMoKToKPHxmaW1faG9sZXw+CiAgICAgICAgICAgICAgICAgICAgaWYgKHhfdmFsLCB5X3ZhbCkgaW4gbGlzdChjYWNoZS52YWx1ZXMoKSk6CiAgICAgICAgICAgICAgICAgICAgICAgIHhfdmFsID0gcG9zW25naGJdWzBdICsgcmFuZG9tLnJhbmRpbnQoMTAsIFNQQUNFKQogICAgICAgICAgICAgICAgICAgICAgICB5X3ZhbCA9IHBvc1tuZ2hiXVswXSArIHJhbmRvbS5yYW5kaW50KDEwLCBTUEFDRSkKICAgICAgICAgICAgICAgICAgICBjYWNoZVtpdGVtXSA9ICh4X3ZhbCwgeV92YWwpCgogICAgICAgICAgICAgICAgICAgICMgZWRnZQogICAgICAgICAgICAgICAgICAgIGF4ZXMucGxvdChbeF92YWwsIHBvc1tuZ2hiXVswXV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt5X3ZhbCwgcG9zW25naGJdWzFdXSwKICAgICAgICAgICAgICAgICAgICAg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ygpOgogICAgICAgICAgICAgICAgICAgIHhfdmFsID0gcG9zW25naGJdWzBdCiAgICAgICAgICAgICAgICAgICAgeV92YWwgPSBwb3NbbmdoYl1bMV0KPHxmaW1fZW5kfD4=
|
23f2d93fb2d63b214605be7216d209f6d17dabe2-1
|
23f2d93fb2d63b214605be7216d209f6d17dabe2
|
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGlvCmltcG9ydCBsb2dnaW5nCmltcG9ydCB1bml0dGVzdApmcm9tIHVuaXR0ZXN0IGltcG9ydCBUZXN0Q2FzZQpmcm9tIGFwcCBpbXBvcnQgYXBwCgpjbGFzcyBUZXN0RnVuZGFtZW50YWxzKFRlc3RDYXNlKToKICAgIGRlZiBzZXRVcChzZWxmKToKPHxmaW1faG9sZXw+CgogICAgZGVmIHRlYXJEb3duKHNlbGYpOgogICAgICAgIHBhc3MKCiAgICBkZWYgdGVzdF9hcHBfaGVhbHRoKHNlbGYpOgogICAgICAgIHJlc3BvbnNlID0gc2VsZi5hcHAuZ2V0KCcvaGVhbHRoJywgZm9sbG93X3JlZGlyZWN0cz1UcnVlKQogICAgICAgIHNlbGYuYXNzZXJ0RXF1YWwocmVzcG9uc2Uuc3RhdHVzX2NvZGUsIDIwMCkKCiAgICBpZiBfX25hbWVfXyA9PSAiX19tYWluX18iOgogICAgICAgIHVuaXR0ZXN0Lm1haW4oKQo8fGZpbV9zdWZmaXh8PgogICAgICAgIGFwcC5jb25maWdbJ1RFU1RJTkcnXSA9IFRydWUKICAgICAgICBhcHAuY29uZmlnWydXVEZfQ1NSRl9FTkFCTEVEJ10gPSBGYWxzZQogICAgICAgIGFwcC5jb25maWdbJ0RFQlVHJ10gPSBGYWxzZQogICAgICAgIHNlbGYuYXBwID0gYXBwLnRlc3RfY2xpZW50KCkKPHxmaW1fZW5kfD4=
|
23f2d93fb2d63b214605be7216d209f6d17dabe2-2
|
23f2d93fb2d63b214605be7216d209f6d17dabe2
|
PHxmaW1fcHJlZml4fD4KaW1wb3J0IGl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YpOgogICAgICAgIGFwcC5jb25maWdbJ1RFU1RJTkcnXSA9IFRydWUKICAgICAgICBhcHAuY29uZmlnWydXVEZfQ1NSRl9FTkFCTEVEJ10gPSBGYWxzZQo8fGZpbV9lbmR8Pg==
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.