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gT1NFcnJvcjoKICAgICAgICAgICAgZSA9IHN5cy5leGNfaW5mbygpWzFd
CiAgICAgICAgICAgIGlmIGUuZXJybm8gPT0gZXJybm8uRU5PRU5UOgogICAg
ICAgICAgICAgICAgY29udGludWUKICAgICAgICAgICAgaWYgdmVyYm9zZToK
ICAgICAgICAgICAgICAgIHByaW50KCJ1bmFibGUgdG8gcnVuICVzIiAlIGRp
c3BjbWQpCiAgICAgICAgICAgICAgICBwcmludChlKQogICAgICAgICAgICBy
ZXR1cm4gTm9uZSwgTm9uZQogICAgZWxzZToKICAgICAgICBpZiB2ZXJib3Nl
OgogICAgICAgICAgICBwcmludCgidW5hYmxlIHRvIGZpbmQgY29tbWFuZCwg
dHJpZWQgJXMiICUgKGNvbW1hbmRzLCkpCiAgICAgICAgcmV0dXJuIE5vbmUs
IE5vbmUKICAgIHN0ZG91dCA9IHByb2Nlc3MuY29tbXVuaWNhdGUoKVswXS5z
dHJpcCgpLmRlY29kZSgpCiAgICBpZiBwcm9jZXNzLnJldHVybmNvZGUgIT0g
MDoKICAgICAgICBpZiB2ZXJib3NlOgogICAgICAgICAgICBwcmludCgidW5h
YmxlIHRvIHJ1biAlcyAoZXJyb3IpIiAlIGRpc3BjbWQpCiAgICAgICAgICAg
IHByaW50KCJzdGRvdXQgd2FzICVzIiAlIHN0ZG91dCkKICAgICAgICByZXR1
cm4gTm9uZSwgcHJvY2Vzcy5yZXR1cm5jb2RlCiAgICByZXR1cm4gc3Rkb3V0
LCBwcm9jZXNzLnJldHVybmNvZGUKCgpMT05HX1ZFUlNJT05fUFlbJ2dpdCdd
ID0gcicnJwojIFRoaXMgZmlsZSBoZWxwcyB0byBjb21wdXRlIGEgdmVyc2lv
biBudW1iZXIgaW4gc291cmNlIHRyZWVzIG9idGFpbmVkIGZyb20KIyBnaXQt
YXJjaGl2ZSB0YXJiYWxsIChzdWNoIGFzIHRob3NlIHByb3ZpZGVkIGJ5IGdp
dGh1YnMgZG93bmxvYWQtZnJvbS10YWcK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lkZXMgdGhlIGNvbnNvbGUgd2luZG93IGlmIHB5
dGhvbncuZXhlIGlzIHVzZWQKICAgICAgICBzdGFydHVwaW5mbyA9IHN1YnBy
b2Nlc3MuU1RBUlRVUElORk8oKQogICAgICAgIHN0YXJ0dXBpbmZvLmR3Rmxh
Z3MgfD0gc3VicHJvY2Vzcy5TVEFSVEZfVVNFU0hPV1dJTkRPVwogICAgICAg
IHBvcGVuX2t3YXJnc1sic3RhcnR1cGluZm8iXSA9IHN0YXJ0dXBpbmZvCgog
ICAgZm9yIGNvbW1hbmQgaW4gY29tbWFuZHM6CiAgICAgICAgdHJ5OgogICAg
ICAgICAgICBkaXNwY21kID0gc3RyKFtjb21tYW5kXSArIGFyZ3MpCiAgICAg
ICAgICAgICMgcmVtZW1iZXIgc2hlbGw9RmFsc2UsIHNvIHVzZSBnaXQuY21k
IG9uIHdpbmRvd3MsIG5vdCBqdXN0IGdpdAogICAgICAgICAgICBwcm9jZXNz
ID0gc3VicHJvY2Vzcy5Qb3BlbihbY29tbWFuZF0gKyBhcmdzLCBjd2Q9Y3dk
LCBlbnY9ZW52LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICBzdGRvdXQ9c3VicHJvY2Vzcy5QSVBFLAogICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBzdGRlcnI9KHN1YnByb2Nlc3MuUElQ
RSBpZiBoaWRlX3N0ZGVycgogICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIGVsc2UgTm9uZSksICoqcG9wZW5fa3dhcmdz
KQogICAgICAgICAgICBicmVhawogICAgICAgIGV4Y2VwdCBPU0Vycm9yOgog
ICAgICAgICAgICBlID0gc3lzLmV4Y19pbmZvKClbMV0KICAgICAgICAgICAg
aWYgZS5lcnJubyA9PSBlcnJuby5FTk9FTlQ6CiAgICAgICAgICAgICAgICBj
b250aW51ZQogICAgICAgICAgICBpZiB2ZXJib3NlOgogICAgICAgICAg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aGUgY29kZSBlbWJlZGRlZCBpbiBfdmVyc2lvbi5weSBjYW4ganVz
dCBmZXRjaCB0aGUgdmFsdWUgb2YgdGhlc2UKICAgICMga2V5d29yZHMuIFdo
ZW4gdXNlZCBmcm9tIHNldHVwLnB5LCB3ZSBkb24ndCB3YW50IHRvIGltcG9y
dCBfdmVyc2lvbi5weSwKICAgICMgc28gd2UgZG8gaXQgd2l0aCBhIHJlZ2V4
cCBpbnN0ZWFkLiBUaGlzIGZ1bmN0aW9uIGlzIG5vdCB1c2VkIGZyb20KICAg
ICMgX3ZlcnNpb24ucHkuCiAgICBrZXl3b3JkcyA9IHt9CiAgICB0cnk6CiAg
ICAgICAgd2l0aCBvcGVuKHZlcnNpb25maWxlX2FicywgInIiKSBhcyBmb2Jq
OgogICAgICAgICAgICBmb3IgbGluZSBpbiBmb2JqOgogICAgICAgICAgICAg
ICAgaWYgbGluZS5zdHJpcCgpLnN0YXJ0c3dpdGgoImdpdF9yZWZuYW1lcyA9
Iik6CiAgICAgICAgICAgICAgICAgICAgbW8gPSByZS5zZWFyY2gocic9XHMq
IiguKikiJywgbGluZSkKICAgICAgICAgICAgICAgICAgICBpZiBtbzoKICAg
ICAgICAgICAgICAgICAgICAgICAga2V5d29yZHNbInJlZm5hbWVzIl0gPSBt
by5ncm91cCgxKQogICAgICAgICAgICAgICAgaWYgbGluZS5zdHJpcCgpLnN0
YXJ0c3dpdGgoImdpdF9mdWxsID0iKToKICAgICAgICAgICAgICAgICAgICBt
byA9IHJlLnNlYXJjaChyJz1ccyoiKC4qKSInLCBsaW5lKQogICAgICAgICAg
ICAgICAgICAgIGlmIG1vOgogICAgICAgICAgICAgICAgICAgICAgICBrZXl3
b3Jkc1siZnVsbCJdID0gbW8uZ3JvdXAoMSkKICAgICAgICAgICAgICAgIGlm
IGxpbmUuc3RyaXAoKS5zdGFydHN3aXRoKCJnaXRfZGF0ZSA9Iik6CiAgICAg
ICAgICAgICAgICAgICAgbW8gPSByZS5zZWFyY2gocic9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IjIuMHJjMSIKICAgICAgICBpZiByZWYuc3RhcnRzd2l0aCh0YWdf
cHJlZml4KToKICAgICAgICAgICAgciA9IHJlZltsZW4odGFnX3ByZWZpeCk6
XQogICAgICAgICAgICAjIEZpbHRlciBvdXQgcmVmcyB0aGF0IGV4YWN0bHkg
bWF0Y2ggcHJlZml4IG9yIHRoYXQgZG9uJ3Qgc3RhcnQKICAgICAgICAgICAg
IyB3aXRoIGEgbnVtYmVyIG9uY2UgdGhlIHByZWZpeCBpcyBzdHJpcHBlZCAo
bW9zdGx5IGEgY29uY2VybgogICAgICAgICAgICAjIHdoZW4gcHJlZml4IGlz
ICcnKQogICAgICAgICAgICBpZiBub3QgcmUubWF0Y2gocidcZCcsIHIpOgog
ICAgICAgICAgICAgICAgY29udGludWUKICAgICAgICAgICAgaWYgdmVyYm9z
ZToKICAgICAgICAgICAgICAgIHByaW50KCJwaWNraW5nICUlcyIgJSUgcikK
ICAgICAgICAgICAgcmV0dXJuIHsidmVyc2lvbiI6IHIsCiAgICAgICAgICAg
ICAgICAgICAgImZ1bGwtcmV2aXNpb25pZCI6IGtleXdvcmRzWyJmdWxsIl0u
c3RyaXAoKSwKICAgICAgICAgICAgICAgICAgICAiZGlydHkiOiBGYWxzZSwg
ImVycm9yIjogTm9uZSwKICAgICAgICAgICAgICAgICAgICAiZGF0ZSI6IGRh
dGV9CiAgICAjIG5vIHN1aXRhYmxlIHRhZ3MsIHNvIHZlcnNpb24gaXMgIjAr
dW5rbm93biIsIGJ1dCBmdWxsIGhleCBpcyBzdGlsbCB0aGVyZQogICAgaWYg
dmVyYm9zZToKICAgICAgICBwcmludCgibm8gc3VpdGFibGUgdGFncywgdXNp
bmcgdW5rbm93biArIGZ1bGwgcmV2aXNpb24gaWQiKQogICAgcmV0dXJuIHsi
dmVyc2lvbiI6ICIwK3Vua25vd24iLAogICAgICAgICAgICAiZnVsbC1yZXZp
c2lvbmlkIjoga2V5d29yZHNbImZ1bGwiXS5zdHJpcCgpLAogICAgIC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yBkaWdpdHMiICUgIiwiLmpvaW4ocmVmcyAtIHRhZ3MpKQogICAgaWYg
dmVyYm9zZToKICAgICAgICBwcmludCgibGlrZWx5IHRhZ3M6ICVzIiAlICIs
Ii5qb2luKHNvcnRlZCh0YWdzKSkpCiAgICBmb3IgcmVmIGluIHNvcnRlZCh0
YWdzKToKICAgICAgICAjIHNvcnRpbmcgd2lsbCBwcmVmZXIgZS5nLiAiMi4w
IiBvdmVyICIyLjByYzEiCiAgICAgICAgaWYgcmVmLnN0YXJ0c3dpdGgodGFn
X3ByZWZpeCk6CiAgICAgICAgICAgIHIgPSByZWZbbGVuKHRhZ19wcmVmaXgp
Ol0KICAgICAgICAgICAgIyBGaWx0ZXIgb3V0IHJlZnMgdGhhdCBleGFjdGx5
IG1hdGNoIHByZWZpeCBvciB0aGF0IGRvbid0IHN0YXJ0CiAgICAgICAgICAg
ICMgd2l0aCBhIG51bWJlciBvbmNlIHRoZSBwcmVmaXggaXMgc3RyaXBwZWQg
KG1vc3RseSBhIGNvbmNlcm4KICAgICAgICAgICAgIyB3aGVuIHByZWZpeCBp
cyAnJykKICAgICAgICAgICAgaWYgbm90IHJlLm1hdGNoKHInXGQnLCByKToK
ICAgICAgICAgICAgICAgIGNvbnRpbnVlCiAgICAgICAgICAgIGlmIHZlcmJv
c2U6CiAgICAgICAgICAgICAgICBwcmludCgicGlja2luZyAlcyIgJSByKQog
ICAgICAgICAgICByZXR1cm4geyJ2ZXJzaW9uIjogciwKICAgICAgICAgICAg
ICAgICAgICAiZnVsbC1yZXZpc2lvbmlkIjoga2V5d29yZHNbImZ1bGwiXS5z
dHJpcCgpLAogICAgICAgICAgICAgICAgICAgICJkaXJ0eSI6IEZhbHNlLCAi
ZXJyb3IiOiBOb25lLAogICAgICAgICAgICAgICAgICAgICJkYXRlIjogZGF0
ZX0KICAgICMgbm8gc3VpdGFibGUgdGFncywgc28gdmVyc2lvbiBpcyAiMCt1
bmtub3duIiwgYnV0IGZ1bGwgaGV4IGlzIH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cmliZSBvdXRwdXQ6ICclcyciCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAlIGRlc2NyaWJlX291dCkKICAgICAgICAgICAg
cmV0dXJuIHBpZWNlcwoKICAgICAgICAjIHRhZwogICAgICAgIGZ1bGxfdGFn
ID0gbW8uZ3JvdXAoMSkKICAgICAgICBpZiBub3QgZnVsbF90YWcuc3RhcnRz
d2l0aCh0YWdfcHJlZml4KToKICAgICAgICAgICAgaWYgdmVyYm9zZToKICAg
ICAgICAgICAgICAgIGZtdCA9ICJ0YWcgJyVzJyBkb2Vzbid0IHN0YXJ0IHdp
dGggcHJlZml4ICclcyciCiAgICAgICAgICAgICAgICBwcmludChmbXQgJSAo
ZnVsbF90YWcsIHRhZ19wcmVmaXgpKQogICAgICAgICAgICBwaWVjZXNbImVy
cm9yIl0gPSAoInRhZyAnJXMnIGRvZXNuJ3Qgc3RhcnQgd2l0aCBwcmVmaXgg
JyVzJyIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICUgKGZ1bGxf
dGFnLCB0YWdfcHJlZml4KSkKICAgICAgICAgICAgcmV0dXJuIHBpZWNlcwog
ICAgICAgIHBpZWNlc1siY2xvc2VzdC10YWciXSA9IGZ1bGxfdGFnW2xlbih0
YWdfcHJlZml4KTpdCgogICAgICAgICMgZGlzdGFuY2U6IG51bWJlciBvZiBj
b21taXRzIHNpbmNlIHRhZwogICAgICAgIHBpZWNlc1siZGlzdGFuY2UiXSA9
IGludChtby5ncm91cCgyKSkKCiAgICAgICAgIyBjb21taXQ6IHNob3J0IGhl
eCByZXZpc2lvbiBJRAogICAgICAgIHBpZWNlc1sic2hvcnQiXSA9IG1vLmdy
b3VwKDMpCgogICAgZWxzZToKICAgICAgICAjIEhFWDogbm8gdGFncwogICAg
ICAgIHBpZWNlc1siY2xvc2VzdC10YWciXSA9IE5vbmUKICAgICAgICBvdXQs
IHJjID0gcnVubmVyKEdJVFMsIFsicmV2LWxpc3QiLCAiSEVBRCIsICItLWxl
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fcHkpOgogICAgICAgIGRlZiBydW4oc2VsZik6CiAgICAgICAg
ICAgIHJvb3QgPSBnZXRfcm9vdCgpCiAgICAgICAgICAgIGNmZyA9IGdldF9j
b25maWdfZnJvbV9yb290KHJvb3QpCiAgICAgICAgICAgIHZlcnNpb25zID0g
Z2V0X3ZlcnNpb25zKCkKICAgICAgICAgICAgX2J1aWxkX3B5LnJ1bihzZWxm
KQogICAgICAgICAgICBpZiBnZXRhdHRyKHNlbGYsICJlZGl0YWJsZV9tb2Rl
IiwgRmFsc2UpOgogICAgICAgICAgICAgICAgIyBEdXJpbmcgZWRpdGFibGUg
aW5zdGFsbHMgYC5weWAgYW5kIGRhdGEgZmlsZXMgYXJlCiAgICAgICAgICAg
ICAgICAjIG5vdCBjb3BpZWQgdG8gYnVpbGRfbGliCiAgICAgICAgICAgICAg
ICByZXR1cm4KICAgICAgICAgICAgIyBub3cgbG9jYXRlIF92ZXJzaW9uLnB5
IGluIHRoZSBuZXcgYnVpbGQvIGRpcmVjdG9yeSBhbmQgcmVwbGFjZQogICAg
ICAgICAgICAjIGl0IHdpdGggYW4gdXBkYXRlZCB2YWx1ZQogICAgICAgICAg
ICBpZiBjZmcudmVyc2lvbmZpbGVfYnVpbGQ6CiAgICAgICAgICAgICAgICB0
YXJnZXRfdmVyc2lvbmZpbGUgPSBvcy5wYXRoLmpvaW4oc2VsZi5idWlsZF9s
aWIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgY2ZnLnZlcnNpb25maWxlX2J1aWxkKQogICAgICAgICAgICAg
ICAgcHJpbnQoIlVQREFUSU5HICVzIiAlIHRhcmdldF92ZXJzaW9uZmlsZSkK
ICAgICAgICAgICAgICAgIHdyaXRlX3RvX3ZlcnNpb25fZmlsZSh0YXJnZXRf
dmVyc2lvbmZpbGUsIHZlcnNpb25zKQogICAgY21kc1siYnVpbGRfcHkiXSA9
IGNtZF9idWlsZF9weQoKICAgIGlmICdidWlsZF9leH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gIGYud3JpdGUoTE9ORyAl
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IkRPTExBUiI6ICIkIiwK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiU1RZTEUiOiBjZmcuc3R5
bGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlRBR19QUkVGSVgi
OiBjZmcudGFnX3ByZWZpeCwKICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAiUEFSRU5URElSX1BSRUZJWCI6IGNmZy5wYXJlbnRkaXJfcHJlZml4LAog
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICJWRVJTSU9ORklMRV9TT1VS
Q0UiOiBjZmcudmVyc2lvbmZpbGVfc291cmNlLAogICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIH0pCiAgICAgICAgY21kc1siYnVpbGRfZXhlIl0gPSBj
bWRfYnVpbGRfZXhlCiAgICAgICAgZGVsIGNtZHNbImJ1aWxkX3B5Il0KCiAg
ICBpZiAncHkyZXhlJyBpbiBzeXMubW9kdWxlczogICMgcHkyZXhlIGVuYWJs
ZWQ/CiAgICAgICAgdHJ5OgogICAgICAgICAgICBmcm9tIHB5MmV4ZS5zZXR1
cHRvb2xzX2J1aWxkZXhlIGltcG9ydCBweTJleGUgYXMgX3B5MmV4ZQogICAg
ICAgIGV4Y2VwdCBJbXBvcnRFcnJvcjoKICAgICAgICAgICAgZnJvbSBweTJl
eGUuZGlzdHV0aWxzX2J1aWxkZXhlIGltcG9ydCBweTJleGUgYXMgX3B5MmV4
ZQoKICAgICAgICBjbGFzcyBjbWRfcHkyZXhlKF9weTJleGUpOgogICAgICAg
ICAgICBkZWYgcnVuKHNlbGYpOgogICAgICAgICAgICAgICAgcm9vdCA9IGdl
dF9yb290KCkKICAgICAgICAgICAgICAgIGNmZyA9IGdldF9jb25maWdfZnJv
bV9yb290KHJvb3QpCiAgICAgICAgICAgICAgICB2ZXJzaW9ucyA9IGdldF92
ZXJzaW9ucygpCiAgICAgICAgICAgICAgICB0YXJnZXRfdmVyc2lvbmZpbGUg
PSBjZmcudmVyc2lvbmZpbGVfc291cmNlCiAgICAgICAgICAgICAgICBwcmlu
dCgiVVBEQVRJTkcgJXMiICUgdGFyZ2V0X3ZlcnNpb25maWxlKQogICAgICAg
ICAgICAgICAgd3JpdGVfdG9fdmVyc2lvbl9maWxlKHRhcmdldF92ZXJzaW9u
ZmlsZSwgdmVyc2lvbnMpCgogICAgICAgICAgICAgICAgX3B5MmV4ZS5ydW4o
c2VsZikKICAgICAgICAgICAgICAgIG9zLnVubGluayh0YXJnZXRfdmVyc2lv
bmZpbGUpCiAgICAgICAgICAgICAgICB3aXRoIG9wZW4oY2ZnLnZlcnNpb25m
aWxlX3NvdXJjZSwgInciKSBhcyBmOgogICAgICAgICAgICAgICAgICAgIExP
TkcgPSBMT05HX1ZFUlNJT05fUFlbY2ZnLlZDU10KICAgICAgICAgICAgICAg
ICAgICBmLndyaXRlKExPTkcgJQogICAgICAgICAgICAgICAgICAgICAgICAg
ICAgeyJET0xMQVIiOiAiJCIsCiAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIlNUWUxFIjogY2ZnLnN0eWxlLAogICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICJUQUdfUFJFRklYIjogY2ZnLnRhZ19wcmVmaXgsCiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIlBBUkVOVERJUl9QUkVGSVgiOiBjZmcu
cGFyZW50ZGlyX3ByZWZpeCwKICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAiVkVSU0lPTkZJTEVfU09VUkNFIjogY2ZnLnZlcnNpb25maWxlX3NvdXJj
ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgIGNt
ZHNbInB5MmV4ZSJdID0gY21kX3B5MmV4ZQoKICAgICMgc2Rpc3QgZmFybXMg
aXRzIGZpbGUgbGlzdCBidWlsZGluZyBvdXQgdG8gZWdnX2luZm8KICAgIGlm
ICdlZ2dfaW5mbycga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vU2VjdGlvbkVycm9yLAogICAg
ICAgICAgICBjb25maWdwYXJzZXIuTm9PcHRpb25FcnJvcikgYXMgZToKICAg
ICAgICBpZiBpc2luc3RhbmNlKGUsIChPU0Vycm9yLCBjb25maWdwYXJzZXIu
Tm9TZWN0aW9uRXJyb3IpKToKICAgICAgICAgICAgcHJpbnQoIkFkZGluZyBz
YW1wbGUgdmVyc2lvbmVlciBjb25maWcgdG8gc2V0dXAuY2ZnIiwKICAgICAg
ICAgICAgICAgICAgZmlsZT1zeXMuc3RkZXJyKQogICAgICAgICAgICB3aXRo
IG9wZW4ob3MucGF0aC5qb2luKHJvb3QsICJzZXR1cC5jZmciKSwgImEiKSBh
cyBmOgogICAgICAgICAgICAgICAgZi53cml0ZShTQU1QTEVfQ09ORklHKQog
ICAgICAgIHByaW50KENPTkZJR19FUlJPUiwgZmlsZT1zeXMuc3RkZXJyKQog
ICAgICAgIHJldHVybiAxCgogICAgcHJpbnQoIiBjcmVhdGluZyAlcyIgJSBj
ZmcudmVyc2lvbmZpbGVfc291cmNlKQogICAgd2l0aCBvcGVuKGNmZy52ZXJz
aW9uZmlsZV9zb3VyY2UsICJ3IikgYXMgZjoKICAgICAgICBMT05HID0gTE9O
R19WRVJTSU9OX1BZW2NmZy5WQ1NdCiAgICAgICAgZi53cml0ZShMT05HICUg
eyJET0xMQVIiOiAiJCIsCiAgICAgICAgICAgICAgICAgICAgICAgICJTVFlM
RSI6IGNmZy5zdHlsZSwKICAgICAgICAgICAgICAgICAgICAgICAgIlRBR19Q
UkVGSVgiOiBjZmcudGFnX3ByZWZpeCwKICAgICAgICAgICAgICAgICAgICAg
ICAgIlBBUkVOVERJUl9QUkVGSVgiOiBjZmcucGFyZW50ZGlyX3ByZWZpeCwK
ICAgICAgICAgICAgICAgICAgICAgICAgIlZFUlNJT05GSUxFX1NPVVJDRSI6
IGNmZy52ZXJzaW9uZmlsZV9zb3VyY2UsCiAgICAgICAgICAgICAgICAgICAg
ICAgIH0pCgogICAgaXB5ID0gb3MucGF0aC5qb2luKG9zLnBhdGguZGlybmFt
ZShjZmcudmVyc2lvbmZpbGVfc291cmNlKSwKICAgICAgICAgICAgICAgICAg
ICAgICAiX19pbml0X18ucHkiKQogICAgaWYgb3MucGF0aC5leGlzdHMoaXB5
KToKICAgICAgICB0cnk6CiAgICAgICAgICAgIHdpdGggb3BlbihpcHksICJy
IikgYXMgZjoKICAgICAgICAgICAgICAgIG9sZCA9IGYucmVhZCgpCiAgICAg
ICAgZXhjZXB0IE9TRXJyb3I6CiAgICAgICAgICAgIG9sZCA9ICIiCiAgICAg
ICAgbW9kdWxlID0gb3MucGF0aC5zcGxpdGV4dChvcy5wYXRoLmJhc2VuYW1l
KGNmZy52ZXJzaW9uZmlsZV9zb3VyY2UpKVswXQogICAgICAgIHNuaXBwZXQg
PSBJTklUX1BZX1NOSVBQRVQuZm9ybWF0KG1vZHVsZSkKICAgICAgICBpZiBP
TERfU05JUFBFVCBpbiBvbGQ6CiAgICAgICAgICAgIHByaW50KCIgcmVwbGFj
aW5nIGJvaWxlcnBsYXRlIGluICVzIiAlIGlweSkKICAgICAgICAgICAgd2l0
aCBvcGVuKGlweSwgInciKSBhcyBmOgogICAgICAgICAgICAgICAgZi53cml0
ZShvbGQucmVwbGFjZShPTERfU05JUFBFVCwgc25pcHBldCkpCiAgICAgICAg
ZWxpZiBzbmlwcGV0IG5vdCBpbiBvbGQ6CiAgICAgICAgICAgIHByaW50KCIg
YXBwZW5kaW5nIHRvICVzIiAlIGlweSkKICAgICAgICAgICAgd2l0aCBvcGVu
KGlweSwgImEiKSBhcyBmOgogICAgICAgICAgICAgICAgZi53cml0ZShzbmlw
cGV0KQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHByaW50KCIgJXMgdW5t
b2RpZmllZCIgJSBpcHkpCiAgICBlbHNlOgogICAgICAgIHByaW50KCIgJXMg
ZG9lc24ndCBleGlzdCwgb2siICUgaXB5KQogICAgICAgIGlweSA9IE5vbmUK
CiAgICAjIE1ha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aW5lOgogICAgICAgICAgICAgICAgc2V0
dGVycyA9IFRydWUKICAgIGlmIGxlbihmb3VuZCkgIT0gMzoKICAgICAgICBw
cmludCgiIikKICAgICAgICBwcmludCgiWW91ciBzZXR1cC5weSBhcHBlYXJz
IHRvIGJlIG1pc3Npbmcgc29tZSBpbXBvcnRhbnQgaXRlbXMiKQogICAgICAg
IHByaW50KCIoYnV0IEkgbWlnaHQgYmUgd3JvbmcpLiBQbGVhc2UgbWFrZSBz
dXJlIGl0IGhhcyBzb21ldGhpbmciKQogICAgICAgIHByaW50KCJyb3VnaGx5
IGxpa2UgdGhlIGZvbGxvd2luZzoiKQogICAgICAgIHByaW50KCIiKQogICAg
ICAgIHByaW50KCIgaW1wb3J0IHZlcnNpb25lZXIiKQogICAgICAgIHByaW50
KCIgc2V0dXAoIHZlcnNpb249dmVyc2lvbmVlci5nZXRfdmVyc2lvbigpLCIp
CiAgICAgICAgcHJpbnQoIiAgICAgICAgY21kY2xhc3M9dmVyc2lvbmVlci5n
ZXRfY21kY2xhc3MoKSwgIC4uLikiKQogICAgICAgIHByaW50KCIiKQogICAg
ICAgIGVycm9ycyArPSAxCiAgICBpZiBzZXR0ZXJzOgogICAgICAgIHByaW50
KCJZb3Ugc2hvdWxkIHJlbW92ZSBsaW5lcyBsaWtlICd2ZXJzaW9uZWVyLlZD
UyA9ICcgYW5kIikKICAgICAgICBwcmludCgiJ3ZlcnNpb25lZXIudmVyc2lv
bmZpbGVfc291cmNlID0gJyAuIFRoaXMgY29uZmlndXJhdGlvbiIpCiAgICAg
ICAgcHJpbnQoIm5vdyBsaXZlcyBpbiBzZXR1cC5jZmcsIGFuZCBzaG91bGQg
YmUgcmVtb3ZlZCBmcm9tIHNldHVwLnB5IikKICAgICAgICBwcmludCgiIikK
ICAgICAgICBlcnJvcnMgKz0gMQogICAgcmV0dXJuIGVycm9ycwoKCmRlZiBz
ZXR1cF9jb21tYW5kKCk6CiAgICAiIiJTZXQgdXAgVmVyc2lvbmVlciBhbmQg
ZXhpdCB3aXRoIGFwcHJvcHJpYXRlIGVycm9yIGNvZGUuIiIiCiAgICBlcnJv
cnMgPSBkb19zZXR1cCgpCiAgICBlcnJvcnMgKz0gc2Nhbl9zZXR1cF9weSgp
CiAgICBzeXMuZXhpdCgxIGlmIGVycm9ycyBlbHNlIDApCgoKaWYgX19uYW1l
X18gPT0gIl9fbWFpbl9fIjoKICAgIGNtZCA9IHN5cy5hcmd2WzFdCiAgICBp
ZiBjbWQgPT0gInNldHVwIjoKICAgICAgICBzZXR1cF9jb21tYW5kKCkK

"""
newver = "0.28"

VERSIONEER_PEP518 = True

VERSIONEER = base64.b64decode(VERSIONEER_b64.encode('ASCII'))


# Stub overwritten by exec()
def setup_command(): ...

# Make versioneer usable via import
exec(VERSIONEER.decode(), globals())


def detect_installed_version() -> str:
    """Find version string in vendored versioneer

    Raises FileNotFoundError if missing.
    """
    with open("versioneer.py") as fobj:
        for i, line in enumerate(fobj):
            if line.startswith("# Version: "):
                return line[len("# Version: "):].strip()
            if i > 5:
                break
    return "unknown version"


def vendor():
    """Install versioneer into current directory"""
    try:
        oldver = detect_installed_version()
    except FileNotFoundError:
        pass
    else:
        print(f"replacing old versioneer.py ({oldver})")

    with open("versioneer.py", "wb") as fobj:
        fobj.write(VERSIONEER)
    print(f"versioneer.py ({newver}) installed into local tree")


def main():
    usage = "Usage: versioneer install [--vendor|--no-vendor]"
    if len(sys.argv) < 2 or len(sys.argv) > 3:
        print(usage)
        sys.exit(1)

    command = sys.argv[1]
    mode = "--vendor" if len(sys.argv) == 2 else sys.argv[2]

    if command in ("version", "--version"):
        print("versioneer (installer) %s" % newver)
        sys.exit(0)
    elif command in ("help", "-help", "--help"):
        print(usage)
        sys.exit(0)
    elif command != "install" or mode not in ("--vendor", "--no-vendor"):
        print(usage)
        sys.exit(1)

    if mode == "--vendor":
        vendor()
        print("Now running 'versioneer.py setup' to install the generated files..")

    setup_command()


if __name__ == '__main__':
    main()
