-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdeva.sublime-workspace
643 lines (643 loc) · 207 KB
/
deva.sublime-workspace
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
{
"auto_complete":
{
"selected_items":
[
[
"sta",
"started"
],
[
"stat",
"state"
],
[
"_s",
"_scheduler"
],
[
"ti",
"timer"
],
[
"c",
"create_cps\tfunction"
]
]
},
"buffers":
[
{
"file": "deva.sublime-workspace",
"settings":
{
"buffer_size": 7572,
"encoding": "UTF-8",
"line_ending": "Unix"
},
"undo_stack":
[
]
},
{
"file": "deva/browser.py",
"settings":
{
"buffer_size": 16845,
"encoding": "UTF-8",
"line_ending": "Unix"
},
"undo_stack":
[
[
11,
1,
"revert",
null,
"AgAAAAAAAAAAAAAAAAAAAAAAAAAfLgAAZnJvbSB0b3JuYWRvIGltcG9ydCBnZW4KZnJvbSBkZXZhIGltcG9ydCBTdHJlYW0sIGh0dHB4LCBzeW5jLERldmEscHJpbnQsbG9nCmZyb20gY29sbGVjdGlvbnMgaW1wb3J0IGRlZmF1bHRkaWN0CgoiIiIK6L+Z5piv5LiA5Liq5rWP6KeI5Zmo5qih5Z2X77yM5o+Q5L6b5LqG5rWP6KeI5Zmo5rWB5a+56LGh5ZKM55u45YWz55qE5Yqf6IO944CCCua1j+iniOWZqOa1geWvueixoeWGhee9ruS6hue8k+WtmOWKn+iDve+8jOWPr+S7peS/neWtmOivt+axgueahOWTjeW6lOWGheWuue+8jOmBv+WFjemHjeWkjeivt+axguOAggrmiZPlvIDmlrB0YWLmmK8g5byC5q2l5Y+R6LW3572R57uc6K+35rGC55qE44CC5Y+v5Lul5ZCM5pe25omT5byA5aSa5LiqIHRhYuWPkei1t+WkmuS4quivt+axgu+8jOS4jeS8mumYu+Whnueoi+W6j+eahOaJp+ihjOOAggrorr/pl650YWIucGFnZeaXtu+8jOS8mueri+WNs+WQjOatpei/lOWbnuWGheWuue+8jOWmguaenOe8k+WtmOmHjOacieebtOaOpei/lOWbnue8k+WtmO+8jOWmguaenOe8k+WtmOayoeacie+8jOeri+WNs+WQjOatpeaJp+ihjOe9kee7nOivt+axguOAggoK5rWP6KeI5Zmo5qih5Z2X55qE5bel5L2c5Y6f55CGOgoKMS4g6K+35rGC5py65Yi2Ci0gVGFiIOWvueixoeaUr+aMgeS4pOenjeivt+axguaooeW8jzoKICAtIOWQjOatpeaooeW8jzog6YCa6L+HIHBhZ2Ug5bGe5oCn55u05o6l6I635Y+W57yT5a2Y5ZON5bqULOaIluiAheWPkei1t+WQjOatpee9kee7nOivt+axgu+8jOS8mumYu+WhnuetieW+hee9kee7nOivt+axguWujOaIkAogIC0g5byC5q2l5qih5byPOiDpu5jorqTliJvlu7rlr7nosaHmmK/vvIzkvJrlvILmraXor7fmsYLnvZHnu5zvvIzkv53lrZjmlbDmja7liLDnvJPlrZjvvIzlj6blpJbpgJrov4cgcmVmcmVzaCgpIOaWueazleWPkei1t+W8guatpeivt+axgizkuZ/kuI3kvJrpmLvloZ7kuLvnur/nqIsKCjIuIOe8k+WtmOacuuWItgotIEJyb3dzZXIg5a+56LGh57u05oqk5LiA5LiqIExSVSDnvJPlrZgs55So5LqO5a2Y5YKo6K+35rGC5ZON5bqUCi0g57yT5a2Y5aSn5bCP5Y+v6YWN572uLOm7mOiupOS4uiA1MDAwIOadoQotIOW9k+e8k+WtmOa7oeaXtuS8muenu+mZpOacgOaXqeeahOe8k+WtmOmhuQotIFRhYiDor7fmsYLml7bkvJjlhYjku47nvJPlrZjojrflj5Ys5peg57yT5a2Y5pe25omN5Y+R6LW3572R57uc6K+35rGCCgozLiDoh6rliqjliLfmlrDmnLrliLYKLSBUYWIg5pSv5oyB5a6a5pyf6Ieq5Yqo5Yi35pawLOm7mOiupOS4jeS8muiHquWKqOWIt+aWsAotIOWPr+mAmui/hyByZWZyZXNoX2ludGVydmFsIOWPguaVsOmFjee9ruWIt+aWsOmXtOmalAotIOavj+asoeivt+axguWujOaIkOWQjuS8muiHquWKqOWuieaOkuS4i+S4gOasoeWIt+aWsAotIOiuvue9riByZWZyZXNoX2ludGVydmFsPTAg5pe256aB55So6Ieq5Yqo5Yi35pawCgo0LiBUYWIg566h55CGCi0gQnJvd3NlciDnu7TmiqTmiYDmnInmiZPlvIDnmoQgVGFiIOWIl+ihqAotIOaUr+aMgemAmui/hyBVUkwg5Yib5bu65ZKM5YWz6ZetIFRhYgotIOWFs+mXrSBUYWIg5pe25LyaOgogIC0g5YGc5q2i6Ieq5Yqo5Yi35pawCiAgLSDku44gVGFiIOWIl+ihqOenu+mZpAogIC0g5riF6Zmk55u45YWz57yT5a2YCiAgLSDph4rmlL7lhoXlrZjotYTmupAKCjUuIOWFqOWxgOWunuS+iwotIOaooeWdl+aPkOS+m+WFqOWxgCBCcm93c2VyIOWunuS+iwotIOWPr+mAmui/hyBicm93c2VyLnRhYiDmiJbogIUgdGFi5b+r6YCf5Yib5bu65paw5qCH562+6aG1Ci0gdGFicyDlsZ7mgKflj6/ojrflj5bmiYDmnInmiZPlvIDnmoTmoIfnrb7pobXliJfooagKCioq55So5L6LKioKCjAuIOS9v+eUqOWFqOWxgOW/q+aNt+aWueW8jwogICAgYGBgcHl0aG9uCiAgICBmcm9tIGRldmEuYnJvd3NlciBpbXBvcnQgdGFiLCBicm93c2VyLCB0YWJzCiAgICBmcm9tIGRldmEgaW1wb3J0ICoKICAgIAogICAgIyDkvb/nlKjlhajlsYAgdGFiIOaWueazleWIm+W7uuagh+etvumhteW5tuaQnOe0ouWGheWuuQogICAgdGFiKCdodHRwOi8vc2Vjc2F5LmNv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TA0ODE5IDog5Li6aHR0cDovL3NlY3NheS5jb23lronmjpLlrprmnJ/liLfmlrAKICAgIGBgYAogICAg6L+Z5Lqb5pel5b+X5L+h5oGv5pi+56S65LqG5rWP6KeI5Zmo5qih5Z2X5Zyo5ZCO5Y+w5aSE55CG6K+35rGC5ZKM5Yi35paw5Lu75Yqh55qE6L+H56iL44CCCiIiIgoKCmNsYXNzIEJyb3dzZXIoU3RyZWFtKToKICAgICIiIua1j+iniOWZqOa1geWvueixoe+8jOWGhee9rue8k+WtmOWKn+iDveOAggoKICAgIOe8k+WtmOaYr+S4gOS4quWtl+WFuOWvueixoe+8jGtleSDmmK8gdXJs77yMdmFsdWUg5pivIHJlc3BvbnNlIOWvueixoeOAggogICAgIiIiCgogICAgZGVmIF9faW5pdF9fKHNlbGYsIGNhY2hlX3NpemU9MzAsICoqa3dhcmdzKToKICAgICAgICBzdXBlcigpLl9faW5pdF9fKGVuc3VyZV9pb19sb29wPVRydWUsKiprd2FyZ3MpCiAgICAgICAgc2VsZi5jYWNoZSA9IGRlZmF1bHRkaWN0KGxhbWJkYTogTm9uZSkKICAgICAgICBzZWxmLmNhY2hlX3NpemUgPSBjYWNoZV9zaXplCiAgICAgICAgc2VsZi50YWJzID0gc2V0KCkgICMg5L2/55SoIHNldCDkv53lrZggdGFiIOWvueixoQoKICAgIGRlZiB0YWIoc2VsZiwgdXJsLCByZWZyZXNoX2ludGVydmFsPTApOiAgIyDpu5jorqTkuI3oh6rliqjliLfmlrAKICAgICAgICAiIiLliJvlu7rkuIDkuKogdGFiIOWvueixoe+8jOeUqOS6juWkhOeQhiBVUkwg6K+35rGC77yM5bm25o+Q5L6b5a6a5pe25Yi35paw5Yqf6IO944CCCiAgICAgICAg55u45ZCM55qEIHVybCDkvb/nlKjnm7jlkIznmoQgdGFiIOWvueixoeadpeaJp+ihjOS7u+WKoeOAggoKICAgICAgICDlj4LmlbA6CiAgICAgICAgICAgIHVybDog6KaB6K+35rGC55qEIFVSTAogICAgICAgICAgICByZWZyZXNoX2ludGVydmFsOiDlrprml7bliLfmlrDml7bpl7TvvIzljZXkvY3kuLrnp5LvvIzpu5jorqTkuLow77yM5LiN5omn6KGM5a6a5pe25Yi35paw5Lu75YqhCgogICAgICAgIOi/lOWbnjoKICAgICAgICAgICAgVGFiIOWvueixoQogICAgICAgICIiIgogICAgICAgICMg5qOA5p+l5piv5ZCm5bey5a2Y5Zyo55u45ZCM55qEIHRhYgogICAgICAgIGZvciBleGlzdGluZ190YWIgaW4gc2VsZi50YWJzOgogICAgICAgICAgICBpZiBzdHIoZXhpc3RpbmdfdGFiKSA9PSB1cmw6CiAgICAgICAgICAgICAgICBleGlzdGluZ190YWIucmVmcmVzaF9pbnRlcnZhbCA9IHJlZnJlc2hfaW50ZXJ2YWwgICMg5pu05paw5bey5a2Y5Zyo55qEIHRhYiDnmoTliLfmlrDpl7TpmpQKICAgICAgICAgICAgICAgIHJldHVybiBleGlzdGluZ190YWIgICMg6L+U5Zue5bey5a2Y5Zyo55qEIHRhYgogICAgICAgIG5ld190YWIgPSBUYWIoc2VsZiwgdXJsLCByZWZyZXNoX2ludGVydmFsKQogICAgICAgIHNlbGYudGFicy5hZGQobmV3X3RhYikgICMg5re75Yqg5pawIHRhYiDliLAgc2V0CiAgICAgICAgCiAgICAgICAgcmV0dXJuIG5ld190YWIKICAgIGRlZiBlbWl0KHNlbGYsIHgsIGFzeW5jaHJvbm91cz1GYWxzZSk6CiAgICAgICAgcmV0dXJuIHNlbGYudGFiKHgpCiAgICAKICAgIGRlZiBfYWRkX3RvX2NhY2hlKHNlbGYsIHVybCwgcmVzcG9uc2UpOgogICAgICAgICIiIuWwhuWTjeW6lOa3u+WKoOWIsOe8k+WtmOS4reOAggoKICAgICAgICDlj4LmlbA6CiAgICAgICAgICAgIHVybDog6K+35rGC55qEIFVSTAogICAgICAgICAgICByZXNwb25zZTog5ZON5bqU5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgaWYgbGVuKHNlbGYuY2FjaGUpID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g55qE6Ieq5Yqo5Yi35pawCiAgICAgICAgc2VsZi5fc2NoZWR1bGVfcmVmcmVzaCgpCgogICAgZGVmIF9zY2hlZHVsZV9yZXF1ZXN0KHNlbGYpOgogICAgICAgICIiIuWuieaOkuW8guatpeivt+axgu+8jOeUqOS6juiOt+WPliBVUkwg55qE5ZON5bqU5YaF5a6544CCIiIiCiAgICAgICAgZiflkI7lj7Dlj5HotbflvILmraXor7fmsYJ7c2VsZi51cmx9Jz4+bG9nCiAgICAgICAgZnV0cyA9IGdlbi5jb252ZXJ0X3lpZWxkZWQoaHR0cHgoc2VsZi51cmwpKQogICAgICAgIHNlbGYuYnJvd3Nlci5sb29wLmFkZF9mdXR1cmUoZnV0cyxzZWxmLl9jYWxsYmFjaykKICAgICAgICAKCiAgICBkZWYgX3NjaGVkdWxlX3JlZnJlc2goc2VsZik6CiAgICAgICAgIiIi5a6J5o6S5a6a5pyf5Yi35paw77yM55So5LqO5a6a5pyf5pu05pawIFVSTCDnmoTlk43lupTlhoXlrrnjgIIiIiIKICAgICAgICAjIOWmguaenOWIt+aWsOmXtOmalOWAvOS4uiBOb25lIOOAgUZhbHNl5oiW6ICFIDDvvIzliJnmsLjov5zkuI3miafooYzlrprml7bliLfmlrDku7vliqEKICAgICAgICBpZiBub3Qgc2VsZi5yZWZyZXNoX2ludGVydmFsOgogICAgICAgICAgICByZXR1cm4KICAgICAgICAjIOWmguaenOW3sue7j+WtmOWcqOWIt+aWsOWumuaXtuWZqO+8jOWFiOenu+mZpAogICAgICAgIGlmIGhhc2F0dHIoc2VsZiwgJ19yZWZyZXNoX3RpbWVyJyk6CiAgICAgICAgICAgIHNlbGYuYnJvd3Nlci5sb29wLnJlbW92ZV90aW1lb3V0KHNlbGYuX3JlZnJlc2hfdGltZXIpCiAgICAgICAgIyDliJvlu7rmlrDnmoTliLfmlrDlrprml7blmagKICAgICAgICBzZWxmLl9yZWZyZXNoX3RpbWVyID0gc2VsZi5icm93c2VyLmxvb3AuY2FsbF9sYXRlcihzZWxmLnJlZnJlc2hfaW50ZXJ2YWwsIHNlbGYuX3NjaGVkdWxlX3JlcXVlc3QpCiAgICAgICAgZifkuLp7c2VsZi51cmx95a6J5o6S5a6a5pyf5Yi35pawJz4+bG9nCgogICAgQHByb3BlcnR5CiAgICBkZWYgcGFnZShzZWxmKToKICAgICAgICAiIiLojrflj5YgVVJMIOeahOWTjeW6lOWGheWuueOAggoKICAgICAgICDlpoLmnpznvJPlrZjkuK3lrZjlnKjvvIzliJnnm7TmjqXov5Tlm57nvJPlrZjlhoXlrrnjgIIKICAgICAgICDlpoLmnpznvJPlrZjkuK3kuI3lrZjlnKjvvIzliJnov5vooYzlkIzmraXor7fmsYLlubbnvJPlrZjnu5PmnpzjgIIKCiAgICAgICAg6L+U5ZueOgogICAgICAgICAgICByZXNwb25zZTog5ZON5bqU5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgaWYgc2VsZi51cmwgaW4gc2VsZi5icm93c2VyLmNhY2hlOgogICAgICAgICAgICAn5rWP6KeI5Zmo6YeM5pyJ5bey57uP5omT5byA55qEIHRhYu+8jOeri+WNs+i/lOWbnuWGheWuuSc+PmxvZwogICAgICAgICAgICByZXR1cm4gc2VsZi5icm93c2VyLmNhY2hlW3NlbGYudXJsXQogICAgICAgIGVsc2U6CiAgICAgICAgICAgICfmtY/op4jlmajph4zmsqHmnInmiJDlip/lrozlhajmiZPlvIDnirbmgIHnmoQgdGFi77yM56uL5Y2z5ZCM5q2l572R57uc6K+35rGCJz4+bG9nCiAgICAgICAgICAgIHJlc3BvbnNlID0gc3luYyhzZWxmLmJyb3dzZXIubG9vcCwgbGFtYmRhIDpodHRweChzZWxmLnVybCkpCiAgICAgICAgICAgIHNlbGYuYnJvd3Nlci5fYWRkX3RvX2NhY2hlKHNlbGYudXJsLCByZXNwb25zZSkKICAgICAgICAgICAgJ+ivt+axguWujOaIkO+8jOi/lOWbnuWGheWuuSc+PmxvZwogICAgICAgICAgICByZXR1cm4gcmVzcG9uc2UKCiAgICBkZWYgcmVmcmVzaChzZWxmKToKICAgICAgICAiIiLmiYvliqjliLfmlrAgVVJMIOeahOWTjeW6lOWGheWuueOAggoKICAgICAgICDlv73nlaXnvJPlrZjlhoXlrrnvvIzph43mlrDlj5HotbflvILmraXor7fmsYLvvIzlubbkuJTkv53lrZjmlbDmja7liLDnvJPlrZjjgIIKCiAgICAgICAg6L+U5ZueOgogICAgICAgICAgICByZXNwb25zZTog5ZON5bqU5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgc2VsZi5fc2NoZWR1bGVfcmVxdWVzdCgpCgogICAgICAgIHJldHVybiBzZWxmCiAgICAKICAgIGRlZiBfX3N0cl9fKHNlbGYpOgogICAgICAgIHJldHVybiBzZWxmLnVybCAgIyDov5Tlm54gVVJMCgogICAgZGVmIGNsb3NlKHNlbGYpOgogICAgICAgICIiIuWFs+mXrSB0YWIg5a+56LGh77yM5YGc5q2i5YmN6Z2i6K6+5a6a55qE5a6a5pyf5Yi35paw77yM5bm25LuO5rWP6KeI5Zmo55qE5YWo5bGAIHRhYnMg5Lit56e76Zmk6K+l5a+56LGh77yM5bm26YeK5pS+5YaF5a2Y44CC5ZCM5pe25LuO57yT5a2Y5Lit5Yig6Zmk5pWw5o2u44CCIiIiCiAgICAgICAgIyDlpoLmnpzlrZjlnKjliLfmlrDlrprml7blmajvvIzliJnnp7vpmaQKICAgICAgICBpZiBoYXNhdHRyKHNlbGYsICdfcmVmcmVzaF90aW1lcicpOgogICAgICAgICAgICBzZWxmLmJyb3dzZXIubG9vcC5yZW1vdmVfdGltZW91dChzZWxmLl9yZWZyZXNoX3RpbWVyKQogICAgICAgICMg5LuO5rWP6KeI5Zmo55qE5qCH562+6aG15YiX6KGo5Lit56e76Zmk5b2T5YmN5qCH562+6aG1CiAgICAgICAgc2VsZi5icm93c2VyLnRhYnMucmVtb3ZlKHNlbGYpCiAgICAgICAgIyDku47nvJPlrZjkuK3liKDpmaTmlbDmja4KICAgICAgICBpZiBzZWxmLnVyb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pY2xlCgoiIiIK6L+Z5piv5LiA5Liq5rWP6KeI5Zmo5qih5Z2X77yM5o+Q5L6b5LqG5rWP6KeI5Zmo5rWB5a+56LGh5ZKM55u45YWz55qE5Yqf6IO944CCCua1j+iniOWZqOa1geWvueixoeWGhee9ruS6hue8k+WtmOWKn+iDve+8jOWPr+S7peS/neWtmOivt+axgueahOWTjeW6lOWGheWuue+8jOmBv+WFjemHjeWkjeivt+axguOAggrmiZPlvIDmlrB0YWLmmK8g5byC5q2l5Y+R6LW3572R57uc6K+35rGC55qE44CC5Y+v5Lul5ZCM5pe25omT5byA5aSa5LiqIHRhYuWPkei1t+WkmuS4quivt+axgu+8jOS4jeS8mumYu+Whnueoi+W6j+eahOaJp+ihjOOAggrorr/pl650YWIucGFnZeaXtu+8jOS8mueri+WNs+WQjOatpei/lOWbnuWGheWuue+8jOWmguaenOe8k+WtmOmHjOacieebtOaOpei/lOWbnue8k+WtmO+8jOWmguaenOe8k+WtmOayoeacie+8jOeri+WNs+WQjOatpeaJp+ihjOe9kee7nOivt+axguOAggoK5rWP6KeI5Zmo5qih5Z2X55qE5bel5L2c5Y6f55CGOgoKMS4g6K+35rGC5py65Yi2Ci0gVGFiIOWvueixoeaUr+aMgeS4pOenjeivt+axguaooeW8jzoKICAtIOWQjOatpeaooeW8jzog6YCa6L+HIHBhZ2Ug5bGe5oCn55u05o6l6I635Y+W57yT5a2Y5ZON5bqULOaIluiAheWPkei1t+WQjOatpee9kee7nOivt+axgu+8jOS8mumYu+WhnuetieW+hee9kee7nOivt+axguWujOaIkAogIC0g5byC5q2l5qih5byPOiDpu5jorqTliJvlu7rlr7nosaHmmK/vvIzkvJrlvILmraXor7fmsYLnvZHnu5zvvIzkv53lrZjmlbDmja7liLDnvJPlrZjvvIzlj6blpJbpgJrov4cgcmVmcmVzaCgpIOaWueazleWPkei1t+W8guatpeivt+axgizkuZ/kuI3kvJrpmLvloZ7kuLvnur/nqIsKCjIuIOe8k+WtmOacuuWItgotIEJyb3dzZXIg5a+56LGh57u05oqk5LiA5LiqIExSVSDnvJPlrZgs55So5LqO5a2Y5YKo6K+35rGC5ZON5bqUCi0g57yT5a2Y5aSn5bCP5Y+v6YWN572uLOm7mOiupOS4uiA1MDAwIOadoQotIOW9k+e8k+WtmOa7oeaXtuS8muenu+mZpOacgOaXqeeahOe8k+WtmOmhuQotIFRhYiDor7fmsYLml7bkvJjlhYjku47nvJPlrZjojrflj5Ys5peg57yT5a2Y5pe25omN5Y+R6LW3572R57uc6K+35rGCCgozLiDoh6rliqjliLfmlrDmnLrliLYKLSBUYWIg5pSv5oyB5a6a5pyf6Ieq5Yqo5Yi35pawLOm7mOiupOS4jeS8muiHquWKqOWIt+aWsAotIOWPr+mAmui/hyByZWZyZXNoX2ludGVydmFsIOWPguaVsOmFjee9ruWIt+aWsOmXtOmalAotIOavj+asoeivt+axguWujOaIkOWQjuS8muiHquWKqOWuieaOkuS4i+S4gOasoeWIt+aWsAotIOiuvue9riByZWZyZXNoX2ludGVydmFsPTAg5pe256aB55So6Ieq5Yqo5Yi35pawCgo0LiBUYWIg566h55CGCi0gQnJvd3NlciDnu7TmiqTmiYDmnInmiZPlvIDnmoQgVGFiIOWIl+ihqAotIOaUr+aMgemAmui/hyBVUkwg5Yib5bu65ZKM5YWz6ZetIFRhYgotIOWFs+mXrSBUYWIg5pe25LyaOgogIC0g5YGc5q2i6Ieq5Yqo5Yi35pawCiAgLSDku44gVGFiIOWIl+ihqOenu+mZpAogIC0g5riF6Zmk55u45YWz57yT5a2YCiAgLSDph4rmlL7lhoXlrZjotYTmupAKCjUuIOWFqOWxgOWunuS+iwotIOaooeWdl+aPkOS+m+WFqOWxgCBCcm93c2VyIOWunuS+iwotIOWPr+mAmui/hyBicm93c2VyLnRhYiDmiJbogIUgdGFi5b+r6YCf5Yib5bu65paw5qCH562+6aG1Ci0gdGFicyDlsZ7mgKflj6/ojrflj5bmiYDmnInmiZPlvIDnmoTmoIfnrb7pobXliJfooagKCioq55So5L6LKioKCjAuI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vlu7rkuIDkuKogdGFiIOWvueixoe+8jOeUqOS6juWkhOeQhiBVUkwg6K+35rGC77yM5bm25o+Q5L6b5a6a5pe25Yi35paw5Yqf6IO944CCCiAgICAgICAg55u45ZCM55qEIHVybCDkvb/nlKjnm7jlkIznmoQgdGFiIOWvueixoeadpeaJp+ihjOS7u+WKoeOAggoKICAgICAgICDlj4LmlbA6CiAgICAgICAgICAgIHVybDog6KaB6K+35rGC55qEIFVSTAogICAgICAgICAgICByZWZyZXNoX2ludGVydmFsOiDlrprml7bliLfmlrDml7bpl7TvvIzljZXkvY3kuLrnp5LvvIzpu5jorqTkuLow77yM5LiN5omn6KGM5a6a5pe25Yi35paw5Lu75YqhCgogICAgICAgIOi/lOWbnjoKICAgICAgICAgICAgVGFiIOWvueixoQogICAgICAgICIiIgogICAgICAgICMg5qOA5p+l5piv5ZCm5bey5a2Y5Zyo55u45ZCM55qEIHRhYgogICAgICAgIGZvciBleGlzdGluZ190YWIgaW4gc2VsZi50YWJzOgogICAgICAgICAgICBpZiBzdHIoZXhpc3RpbmdfdGFiKSA9PSB1cmw6CiAgICAgICAgICAgICAgICBleGlzdGluZ190YWIucmVmcmVzaF9pbnRlcnZhbCA9IHJlZnJlc2hfaW50ZXJ2YWwgICMg5pu05paw5bey5a2Y5Zyo55qEIHRhYiDnmoTliLfmlrDpl7TpmpQKICAgICAgICAgICAgICAgIHJldHVybiBleGlzdGluZ190YWIgICMg6L+U5Zue5bey5a2Y5Zyo55qEIHRhYgogICAgICAgIG5ld190YWIgPSBUYWIoc2VsZiwgdXJsLCByZWZyZXNoX2ludGVydmFsKQogICAgICAgIHNlbGYudGFicy5hZGQobmV3X3RhYikgICMg5re75Yqg5pawIHRhYiDliLAgc2V0CiAgICAgICAgCiAgICAgICAgcmV0dXJuIG5ld190YWIKICAgIGRlZiBlbWl0KHNlbGYsIHgsIGFzeW5jaHJvbm91cz1GYWxzZSk6CiAgICAgICAgcmV0dXJuIHNlbGYudGFiKHgpCiAgICAKICAgIGRlZiBfYWRkX3RvX2NhY2hlKHNlbGYsIHVybCwgcmVzcG9uc2UpOgogICAgICAgICIiIuWwhuWTjeW6lOa3u+WKoOWIsOe8k+WtmOS4reOAggoKICAgICAgICDlj4LmlbA6CiAgICAgICAgICAgIHVybDog6K+35rGC55qEIFVSTAogICAgICAgICAgICByZXNwb25zZTog5ZON5bqU5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgaWYgbGVuKHNlbGYuY2FjaGUpID49IHNlbGYuY2FjaGVfc2l6ZToKICAgICAgICAgICAgIyDnp7vpmaTmnIDml6nnmoTnvJPlrZjpobkKICAgICAgICAgICAgc2VsZi5jYWNoZS5wb3AobmV4dChpdGVyKHNlbGYuY2FjaGUpKSkKICAgICAgICBzZWxmLmNhY2hlW3VybF0gPSByZXNwb25zZQoKY2xhc3MgVGFiKFN0cmVhbSk6CiAgICAiIiJUYWIg5a+56LGh77yM55So5LqO5aSE55CG5Y2V5LiqIFVSTCDor7fmsYLvvIzlubbmj5DkvpvlrprmnJ/liLfmlrDlip/og73vvIzmr4/mrKHor7fmsYLlrozmiJDlkI7lronmjpLkuIvkuIDkuKrlrprmnJ/liLfmlrDku7vliqHjgIIiIiIKCiAgICBkZWYgX19pbml0X18oc2VsZiwgYnJvd3NlciwgdXJsLCByZWZyZXNoX2ludGVydmFsPTcyMDApOiAgIyDpu5jorqTliLfmlrDpl7TpmpTkuLogMiDlsI/ml7YKICAgICAgICBzdXBlcigpLl9faW5pdF9fKGVuc3VyZV9pb19sb29wPVRydWUpCiAgICAgICAgc2VsZi5icm93c2VyID0gYnJvd3NlcgogICAgICAgIHNlbGYudXJsID0gdXJsCiAgICAgICAgc2VsZi5yZWZyZXNoX2ludGVydmFsID0gcmVmcmVzaF9pbnRlcnZhbCAgIyDlrprmnJ/liLfmlrDml7bpl7TvvIzljZXkvY3kuLrnp5IKICAgICAgICBpZiBzZWxmLnVybCBub3QgaW4gc2VsZi5icm93c2VyLmNhY2hlOgogICAgICAgICAgICBzZW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ogICAgICAgIGlmIG5vdCBzZWxmLnJlZnJlc2hfaW50ZXJ2YWw6CiAgICAgICAgICAgIHJldHVybgogICAgICAgICMg5aaC5p6c5bey57uP5a2Y5Zyo5Yi35paw5a6a5pe25Zmo77yM5YWI56e76ZmkCiAgICAgICAgaWYgaGFzYXR0cihzZWxmLCAnX3JlZnJlc2hfdGltZXInKToKICAgICAgICAgICAgc2VsZi5icm93c2VyLmxvb3AucmVtb3ZlX3RpbWVvdXQoc2VsZi5fcmVmcmVzaF90aW1lcikKICAgICAgICAjIOWIm+W7uuaWsOeahOWIt+aWsOWumuaXtuWZqAogICAgICAgIHNlbGYuX3JlZnJlc2hfdGltZXIgPSBzZWxmLmJyb3dzZXIubG9vcC5jYWxsX2xhdGVyKHNlbGYucmVmcmVzaF9pbnRlcnZhbCwgc2VsZi5fc2NoZWR1bGVfcmVxdWVzdCkKICAgICAgICBmJ+S4untzZWxmLnVybH3lronmjpLlrprmnJ/liLfmlrAnPj5sb2cKCiAgICBAcHJvcGVydHkKICAgIGRlZiBwYWdlKHNlbGYpOgogICAgICAgICIiIuiOt+WPliBVUkwg55qE5ZON5bqU5YaF5a6544CCCgogICAgICAgIOWmguaenOe8k+WtmOS4reWtmOWcqO+8jOWImeebtOaOpei/lOWbnue8k+WtmOWGheWuueOAggogICAgICAgIOWmguaenOe8k+WtmOS4reS4jeWtmOWcqO+8jOWImei/m+ihjOWQjOatpeivt+axguW5tue8k+WtmOe7k+aenOOAggoKICAgICAgICDov5Tlm546CiAgICAgICAgICAgIHJlc3BvbnNlOiDlk43lupTlr7nosaEKICAgICAgICAiIiIKICAgICAgICBpZiBzZWxmLnVybCBpbiBzZWxmLmJyb3dzZXIuY2FjaGU6CiAgICAgICAgICAgICfmtY/op4jlmajph4zmnInlt7Lnu4/miZPlvIDnmoQgdGFi77yM56uL5Y2z6L+U5Zue5YaF5a65Jz4+bG9nCiAgICAgICAgICAgIHJldHVybiBzZWxmLmJyb3dzZXIuY2FjaGVbc2VsZi51cmxdCiAgICAgICAgZWxzZToKICAgICAgICAgICAgJ+a1j+iniOWZqOmHjOayoeacieaIkOWKn+WujOWFqOaJk+W8gOeKtuaAgeeahCB0YWLvvIznq4vljbPlkIzmraXnvZHnu5zor7fmsYInPj5sb2cKICAgICAgICAgICAgcmVzcG9uc2UgPSBzeW5jKHNlbGYuYnJvd3Nlci5sb29wLCBsYW1iZGEgOmh0dHB4KHNlbGYudXJsKSkKICAgICAgICAgICAgc2VsZi5wYXJzZShyZXNwb25zZSkKICAgICAgICAgICAgJ+ivt+axguWujOaIkO+8jOi/lOWbnuWGheWuuSc+PmxvZwogICAgICAgICAgICByZXR1cm4gc2VsZi5fcGFnZQogICAgCiAgICBAcHJvcGVydHkKICAgIGRlZiBhcnRpY2xlKHNlbGYpOgogICAgICAgICIiIuiOt+WPliBVUkwg55qE5paH56ug5YaF5a6544CCCgogICAgICAgIOWmguaenOe8k+WtmOS4reWtmOWcqO+8jOWImeebtOaOpei/lOWbnue8k+WtmOeahOaWh+eroOWvueixoeOAggogICAgICAgIOWmguaenOe8k+WtmOS4reS4jeWtmOWcqO+8jOWImeWFiOiOt+WPlumhtemdouWGheWuueW5tuino+aekOaWh+eroOOAggoKICAgICAgICDov5Tlm546CiAgICAgICAgICAgIGFydGljbGU6IEFydGljbGXlr7nosaEKICAgICAgICAiIiIKICAgICAgICByZXR1cm4gc2VsZi5wYWdlLmFydGljbGUKCiAgICBkZWYgcmVmcmVzaChzZWxmKToKICAgICAgICAiIiLmiYvliqjliLfmlrAgVVJMIOeahOWTjeW6lOWGheWuueOAggoKICAgICAgICDlv73nlaXnvJPlrZjlhoXlrrnvvIzph43mlrDlj5HotbflvILmraXor7fmsYLvvIzlubbkuJTkv53lrZjmlbDmja7liLDnvJPlrZjjgIIKCiAgICAgICAg6L+U5ZueOgogICAgICAgICAgICByZXNwb25zZTog5ZON5bqU5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgc2VsZi5fc2NoZWR1bGVfcmVxdWVzdCgpCg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gogICAgICAgICAgICBzZWxmLmJyb3dzZXIubG9vcC5yZW1vdmVfdGltZW91dChzZWxmLl9yZWZyZXNoX3RpbWVyKQogICAgICAgICMg5LuO5rWP6KeI5Zmo55qE5qCH562+6aG15YiX6KGo5Lit56e76Zmk5b2T5YmN5qCH562+6aG1CiAgICAgICAgc2VsZi5icm93c2VyLnRhYnMucmVtb3ZlKHNlbGYpCiAgICAgICAgIyDku47nvJPlrZjkuK3liKDpmaTmlbDmja4KICAgICAgICBpZiBzZWxmLnVybCBpbiBzZWxmLmJyb3dzZXIuY2FjaGU6CiAgICAgICAgICAgIGRlbCBzZWxmLmJyb3dzZXIuY2FjaGVbc2VsZi51cmxdCiAgICAgICAgZGVsIHNlbGYKICAgICAgICAn5bey5Yig6ZmkIHRhYiDlr7nosaEnPj5sb2cKIyDlhajlsYDmtY/op4jlmajlrp7kvoss57yT5a2Y5aSn5bCP5Li6NTAwMApfZ2xvYmFsX2Jyb3dzZXIgPSBCcm93c2VyKGNhY2hlX3NpemU9NTAwMCkKCiMg5YWo5bGA5b+r5o235pa55byPLOaWueS+v+ebtOaOpeS9v+eUqApicm93c2VyID0gX2dsb2JhbF9icm93c2VyICAjIOa1j+iniOWZqOWunuS+iwp0YWIgPSBfZ2xvYmFsX2Jyb3dzZXIudGFiICAjIOebtOaOpeWIm+W7uuaWsOagh+etvumhteeahOWFqOWxgOaWueazlQp0YWJzID0gX2dsb2JhbF9icm93c2VyLnRhYnMgICMg5omA5pyJ5qCH562+6aG15YiX6KGoCgpkZWYgb3Blbl90YWJzX2luX2Jyb3dzZXIoKToKICAgICIiIuWcqOm7mOiupOa1j+iniOWZqOS4reaJk+W8gOaJgOaciee8k+WtmOeahOagh+etvumhteWGheWuuSIiIgogICAgaW1wb3J0IHRlbXBmaWxlCiAgICBpbXBvcnQgd2ViYnJvd3NlcgogICAgaW1wb3J0IG9zCiAgICAKICAgICMg5Li65q+P5Liq57yT5a2Y55qE5ZON5bqU5Yib5bu65Li05pe2SFRNT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ALgMAAAAAAAAAAAAAAADwvw"
],
[
17,
1,
"revert",
null,
"BAAAAAAAAAAAAAAAAAAAAAAAAAAROQAAZnJvbSB0b3JuYWRvIGltcG9ydCBnZW4KZnJvbSBkZXZhIGltcG9ydCBTdHJlYW0sIGh0dHB4LCBzeW5jLERldmEscHJpbnQsbG9nCmZyb20gY29sbGVjdGlvbnMgaW1wb3J0IGRlZmF1bHRkaWN0CmZyb20gbmV3c3BhcGVyIGltcG9ydCBBcnRpY2xlCgoiIiIK6L+Z5piv5LiA5Liq5rWP6KeI5Zmo5qih5Z2X77yM5o+Q5L6b5LqG5rWP6KeI5Zmo5rWB5a+56LGh5ZKM55u45YWz55qE5Yqf6IO944CCCua1j+iniOWZqOa1geWvueixoeWGhee9ruS6hue8k+WtmOWKn+iDve+8jOWPr+S7peS/neWtmOivt+axgueahOWTjeW6lOWGheWuue+8jOmBv+WFjemHjeWkjeivt+axguOAggrmiZPlvIDmlrB0YWLmmK8g5byC5q2l5Y+R6LW3572R57uc6K+35rGC55qE44CC5Y+v5Lul5ZCM5pe25omT5byA5aSa5LiqIHRhYuWPkei1t+WkmuS4quivt+axgu+8jOS4jeS8mumYu+Whnueoi+W6j+eahOaJp+ihjOOAggrorr/pl650YWIucGFnZeaXtu+8jOS8mueri+WNs+WQjOatpei/lOWbnuWGheWuue+8jOWmguaenOe8k+WtmOmHjOacieebtOaOpei/lOWbnue8k+WtmO+8jOWmguaenOe8k+WtmOayoeacie+8jOeri+WNs+WQjOatpeaJp+ihjOe9kee7nOivt+axguOAggoK5rWP6KeI5Zmo5qih5Z2X55qE5bel5L2c5Y6f55CGOgoKMS4g6K+35rGC5py65Yi2Ci0gVGFiIOWvueixoeaUr+aMgeS4pOenjeivt+axguaooeW8jzoKICAtIOWQjOatpeaooeW8jzog6YCa6L+HIHBhZ2Ug5bGe5oCn55u05o6l6I635Y+W57yT5a2Y5ZON5bqULOaIluiAheWPkei1t+WQjOatpee9kee7nOivt+axgu+8jOS8mumYu+WhnuetieW+hee9kee7nOivt+axguWujOaIkAogIC0g5byC5q2l5qih5byPOiDpu5jorqTliJvlu7rlr7nosaHmmK/vvIzkvJrlvILmraXor7fmsYLnvZHnu5zvvIzkv53lrZjmlbDmja7liLDnvJPlrZjvvIzlj6blpJbpgJrov4cgcmVmcmVzaCgpIOaWueazleWPkei1t+W8guatpeivt+axgizkuZ/kuI3kvJrpmLvloZ7kuLvnur/nqIsKCjIuIOe8k+WtmOacuuWItgotIEJyb3dzZXIg5a+56LGh57u05oqk5LiA5LiqIExSVSDnvJPlrZgs55So5LqO5a2Y5YKo6K+35rGC5ZON5bqUCi0g57yT5a2Y5aSn5bCP5Y+v6YWN572uLOm7mOiupOS4uiA1MDAwIOadoQotIOW9k+e8k+WtmOa7oeaXtuS8muenu+mZpOacgOaXqeeahOe8k+WtmOmhuQotIFRhYiDor7fmsYLml7bkvJjlhYjku47nvJPlrZjojrflj5Ys5peg57yT5a2Y5pe25omN5Y+R6LW3572R57uc6K+35rGCCgozLiDoh6rliqjliLfmlrDmnLrliLYKLSBUYWIg5pSv5oyB5a6a5pyf6Ieq5Yqo5Yi35pawLOm7mOiupOS4jeS8muiHquWKqOWIt+aWsAotIOWPr+mAmui/hyByZWZyZXNoX2ludGVydmFsIOWPguaVsOmFjee9ruWIt+aWsOmXtOmalAotIOavj+asoeivt+axguWujOaIkOWQjuS8muiHquWKqOWuieaOkuS4i+S4gOasoeWIt+aWsAotIOiuvue9riByZWZyZXNoX2ludGVydmFsPTAg5pe256aB55So6Ieq5Yqo5Yi35pawCgo0LiBUYWIg566h55CGCi0gQnJvd3NlciDnu7TmiqTmiYDmnInmiZPlvIDnmoQgVGFiIOWIl+ihqAotIOaUr+aMgemAmui/hyBVUkwg5Yib5bu65ZKM5YWz6ZetIFRhYgotIOWFs+mXrSBUYWIg5pe25LyaOgogIC0g5YGc5q2i6Ieq5Yqo5Yi35pawCiAgLSDku44gVGFiIOWIl+ihqOenu+mZpAogIC0g5riF6Zmk55u45YWz57yT5a2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A9IGRlZmF1bHRkaWN0KGxhbWJkYTogTm9uZSkKICAgICAgICBzZWxmLmNhY2hlX3NpemUgPSBjYWNoZV9zaXplCiAgICAgICAgc2VsZi50YWJzID0gc2V0KCkgICMg5L2/55SoIHNldCDkv53lrZggdGFiIOWvueixoQoKICAgIGRlZiB0YWIoc2VsZiwgdXJsLCByZWZyZXNoX2ludGVydmFsPTApOiAgIyDpu5jorqTkuI3oh6rliqjliLfmlrAKICAgICAgICAiIiLliJvlu7rkuIDkuKogdGFiIOWvueixoe+8jOeUqOS6juWkhOeQhiBVUkwg6K+35rGC77yM5bm25o+Q5L6b5a6a5pe25Yi35paw5Yqf6IO944CCCiAgICAgICAg55u45ZCM55qEIHVybCDkvb/nlKjnm7jlkIznmoQgdGFiIOWvueixoeadpeaJp+ihjOS7u+WKoeOAggoKICAgICAgICDlj4LmlbA6CiAgICAgICAgICAgIHVybDog6KaB6K+35rGC55qEIFVSTAogICAgICAgICAgICByZWZyZXNoX2ludGVydmFsOiDlrprml7bliLfmlrDml7bpl7TvvIzljZXkvY3kuLrnp5LvvIzpu5jorqTkuLow77yM5LiN5omn6KGM5a6a5pe25Yi35paw5Lu75YqhCgogICAgICAgIOi/lOWbnjoKICAgICAgICAgICAgVGFiIOWvueixoQogICAgICAgICIiIgogICAgICAgICMg5qOA5p+l5piv5ZCm5bey5a2Y5Zyo55u45ZCM55qEIHRhYgogICAgICAgIGZvciBleGlzdGluZ190YWIgaW4gc2VsZi50YWJzOgogICAgICAgICAgICBpZiBzdHIoZXhpc3RpbmdfdGFiKSA9PSB1cmw6CiAgICAgICAgICAgICAgICBleGlzdGluZ190YWIucmVmcmVzaF9pbnRlcnZhbCA9IHJlZnJlc2hfaW50ZXJ2YWwgICMg5pu05paw5bey5a2Y5Zyo55qEIHRhYiDnmoTliLfmlrDpl7TpmpQKICAgICAgICAgICAgICAgIHJldHVybiBleGlzdGluZ190YWIgICMg6L+U5Zue5bey5a2Y5Zyo55qEIHRhYgogICAgICAgIG5ld190YWIgPSBUYWIoc2VsZiwgdXJsLCByZWZyZXNoX2ludGVydmFsKQogICAgICAgIHNlbGYudGFicy5hZGQobmV3X3RhYikgICMg5re75Yqg5pawIHRhYiDliLAgc2V0CiAgICAgICAgCiAgICAgICAgcmV0dXJuIG5ld190YWIKCiAgICBkZWYgZW1pdChzZWxmLCB4LCBhc3luY2hyb25vdXM9RmFsc2UpOgogICAgICAgIHJldHVybiBzZWxmLnRhYih4KQogICAgCiAgICBkZWYgX2FkZF90b19jYWNoZShzZWxmLCB1cmwsIHJlc3BvbnNlKToKICAgICAgICAiIiLlsIblk43lupTmt7vliqDliLDnvJPlrZjkuK3jgIIKCiAgICAgICAg5Y+C5pWwOgogICAgICAgICAgICB1cmw6IOivt+axgueahCBVUkwKICAgICAgICAgICAgcmVzcG9uc2U6IOWTjeW6lOWvueixoQogICAgICAgICIiIgogICAgICAgIGlmIGxlbihzZWxmLmNhY2hlKSA+PSBzZWxmLmNhY2hlX3NpemU6CiAgICAgICAgICAgICMg56e76Zmk5pyA5pep55qE57yT5a2Y6aG5CiAgICAgICAgICAgIHNlbGYuY2FjaGUucG9wKG5leHQoaXRlcihzZWxmLmNhY2hlKSkpCiAgICAgICAgc2VsZi5jYWNoZVt1cmxdID0gcmVzcG9uc2UKCiAgICBkZWYgZXh0cmFjdF90ZXh0X2Zyb21faHRtbChzZWxmLCBodG1sX2NvbnRlbnQpOgogICAgICAgICIiIuS9v+eUqCBib2lsZXJweTMg5LuOIEhUTUwg5YaF5a655Lit5o+Q5Y+W5paw6Ze75q2j5paH44CCCgogICAgICAgIOWPguaVsDoKICAgICAgICAgICAgaHRtbF9jb250ZW50OiBIVE1MIOWGheWuueWtl+espuS4sgoKICAgICAgICDov5Tlm546CiAgICAgICAgICAgIHN0cjog5o+Q5Y+W55qE5paw6Ze75q2j5paH5paH5pysCiAgICAgICAgIiIiCiAgICAgICAgZnJvbSBib2lsZXJweTMgaW1wb3J0IGV4dHJhY3RvcnMKICAgICAgICBleHRyYWN0b3IgPSBleHRyYWN0b3JzLkFydGljbGVFeHRyYWN0b3IoKQogICAgICAgIHRyeToKICAgICAgICAgICAgdGV4dCA9IGV4dHJhY3Rvci5nZXRfY29udGVudChodG1sX2NvbnRlbnQpCiAgICAgICAgICAgIHJldHVybiB0ZXh0CiAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbiBhcyBlOgogICAgICAgICAgICBwcmludChmIuaPkOWPluaWh+acrOaXtuWHuumUmToge3N0cihlKX0iKQogICAgICAgICAgICByZXR1cm4gIiIKICAgICAgICAKICAgIGRlZiBjcmVhdGVfYXJ0aWNsZShzZWxmLHJlc3BvbnNlKToKICAgICAgICBhcnRpY2xlID0gQXJ0aWNsZShyZXNwb25zZS51cmwsIGxhbmd1YWdlPSd6aCcpICAjIOiuvue9ruivreiogOS4uuS4reaWhwogICAgICAgIGFydGljbGUuc2V0X2h0bWwocmVzcG9uc2UuaHRtbC5odG1sKQogICAgICAgIGFydGljbGUuY29uZmlnLk1BWF9TVU1NQVJZX1NFTlQgPSAzICAjIOmZkOWItuaRmOimgeWPpeWtkOaVsOmHjwogICAgICAgIGFydGljbGUucGFyc2UoKQogICAgICAgIGlmIG5vdCBhcnRpY2xlLnRleHQ6CiAgICAgICAgICAgIGFydGljbGUudGV4dCA9IHNlbGYuZXh0cmFjdF90ZXh0X2Zyb21faHRtbChyZXNwb25zZS5odG1sLmh0bWwpCgogICAgICAgICMgYXJ0aWNsZS5ubHAoKSAgIyDnlJ/miJDmkZjopoHotKjph4/ovoPlt64KICAgICAgICAjIOS9v+eUqHN1bXnnlJ/miJDmkZjopoEKICAgICAgICB0cnk6CiAgICAgICAgICAgIGZyb20gc3VteS5wYXJzZXJzLnBsYWludGV4dCBpbXBvcnQgUGxhaW50ZXh0UGFyc2VyCiAgICAgICAgICAgIGZyb20gc3VteS5ubHAudG9rZW5pemVycyBpbXBvcnQgVG9rZW5pemVyCiAgICAgICAgICAgIGZyb20gc3VteS5zdW1tYXJpemVycy5sc2EgaW1wb3J0IExzYVN1bW1hcml6ZXIKICAgICAgICAgICAgZnJvbSBzdW15Lm5scC5zdGVtbWVycyBpbXBvcnQgU3RlbW1lcgogICAgICAgICAgICBmcm9tIHN1bXkudXRpbHMgaW1wb3J0IGdldF9zdG9wX3dvcmRzCgogICAgICAgICAgICAjIOS9v+eUqOaWh+eroOato+aWh+eUn+aIkOaRmOimgQogICAgICAgICAgICBwYXJzZXIgPSBQbGFpbnRleHRQYXJzZXIuZnJvbV9zdHJpbmcoYXJ0aWNsZS50ZXh0LCBUb2tlbml6ZXIoJ2NoaW5lc2UnKSkKICAgICAgICAgICAgc3RlbW1lciA9IFN0ZW1tZXIoJ2NoaW5lc2UnKQogICAgICAgICAgICBzdW1tYXJpemVyID0gTHNhU3VtbWFyaXplcihzdGVtbWVyKQogICAgICAgICAgICBzdW1tYXJpemVyLnN0b3Bfd29yZHMgPSBnZXRfc3RvcF93b3JkcygnY2hpbmVzZScpCiAgICAgICAgICAgIAogICAgICAgICAgICAjIOeUn+aIkDPlj6Xor53nmoTmkZjopoEKICAgICAgICAgICAgc3VtbWFyeSA9IFtdCiAgICAgICAgICAgIGZvciBzZW50ZW5jZSBpbiBzdW1tYXJpemVyKHBhcnNlci5kb2N1bWVudCwgMyk6CiAgICAgICAgICAgICAgICBzdW1tYXJ5LmFwcGVuZChzdHIoc2VudGVuY2UpKQogICAgICAgICAgICBhcnRpY2xlLnN1bW1hcnkgPSAnXG4nLmpvaW4oc3VtbWFyeSkKICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6CiAgICAgICAgICAgIHByaW50KGYi55Sf5oiQ5pGY6KaB5pe25Ye66ZSZOiB7c3RyKGUpfSIpCiAgICAgICAgICAgIGFydGljbGUuc3VtbWFyeSA9ICIiCiAgICAgICAgcmV0dXJuIGFydGljbGUKCmNsYXNzIFRhYihTdHJlYW0pOgogICAgIiIiVGFiIOWvueixoe+8jOeUqOS6juWkhOeQhuWNleS4qiBVUkwg6K+35rGC77yM5bm25o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iIuWuieaOkuW8guatpeivt+axgu+8jOeUqOS6juiOt+WPliBVUkwg55qE5ZON5bqU5YaF5a6544CCIiIiCiAgICAgICAgZiflkI7lj7Dlj5HotbflvILmraXor7fmsYJ7c2VsZi51cmx9Jz4+bG9nCiAgICAgICAgZnV0cyA9IGdlbi5jb252ZXJ0X3lpZWxkZWQoaHR0cHgoc2VsZi51cmwpKQogICAgICAgIHNlbGYuYnJvd3Nlci5sb29wLmFkZF9mdXR1cmUoZnV0cyxzZWxmLl9jYWxsYmFjaykKICAgICAgICAKCiAgICBkZWYgX3NjaGVkdWxlX3JlZnJlc2goc2VsZik6CiAgICAgICAgIiIi5a6J5o6S5a6a5pyf5Yi35paw77yM55So5LqO5a6a5pyf5pu05pawIFVSTCDnmoTlk43lupTlhoXlrrnjgIIiIiIKICAgICAgICAjIOWmguaenOWIt+aWsOmXtOmalOWAvOS4uiBOb25lIOOAgUZhbHNl5oiW6ICFIDDvvIzliJnmsLjov5zkuI3miafooYzlrprml7bliLfmlrDku7vliqEKICAgICAgICBpZiBub3Qgc2VsZi5yZWZyZXNoX2ludGVydmFsOgogICAgICAgICAgICByZXR1cm4KICAgICAgICAjIOWmguaenOW3sue7j+WtmOWcqOWIt+aWsOWumuaXtuWZqO+8jOWFiOenu+mZpAogICAgICAgIGlmIGhhc2F0dHIoc2VsZiwgJ19yZWZyZXNoX3RpbWVyJyk6CiAgICAgICAgICAgIHNlbGYuYnJvd3Nlci5sb29wLnJlbW92ZV90aW1lb3V0KHNlbGYuX3JlZnJlc2hfdGltZXIpCiAgICAgICAgIyDliJvlu7rmlrDnmoTliLfmlrDlrprml7blmagKICAgICAgICBzZWxmLl9yZWZyZXNoX3RpbWVyID0gc2VsZi5icm93c2VyLmxvb3AuY2FsbF9sYXRlcihzZWxmLnJlZnJlc2hfaW50ZXJ2YWwsIHNlbGYuX3NjaGVkdWxlX3JlcXVlc3QpCiAgICAgICAgZifkuLp7c2VsZi51cmx95a6J5o6S5a6a5pyf5Yi35pawJz4+bG9nCgogICAgQHByb3BlcnR5CiAgICBkZWYgcGFnZShzZWxmKToKICAgICAgICAiIiLojrflj5YgVVJMIOeahOWTjeW6lOWGheWuueOAggoKICAgICAgICDlpoLmnpznvJPlrZjkuK3lrZjlnKjvvIzliJnnm7TmjqXov5Tlm57nvJPlrZjlhoXlrrnjgIIKICAgICAgICDlpoLmnpznvJPlrZjkuK3kuI3lrZjlnKjvvIzliJnov5vooYzlkIzmraXor7fmsYLlubbnvJPlrZjnu5PmnpzjgIIKCiAgICAgICAg6L+U5ZueOgogICAgICAgICAgICByZXNwb25zZTog5ZON5bqU5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgaWYgc2VsZi51cmwgaW4gc2VsZi5icm93c2VyLmNhY2hlOgogICAgICAgICAgICAn5rWP6KeI5Zmo6YeM5pyJ5bey57uP5omT5byA55qEIHRhYu+8jOeri+WNs+i/lOWbnuWGheWuuSc+PmxvZwogICAgICAgICAgICByZXR1cm4gc2VsZi5icm93c2VyLmNhY2hlW3NlbGYudXJsXQogICAgICAgIGVsc2U6CiAgICAgICAgICAgICfmtY/op4jlmajph4zmsqHmnInmiJDlip/lrozlhajmiZPlvIDnirbmgIHnmoQgdGFi77yM56uL5Y2z5ZCM5q2l572R57uc6K+35rGCJz4+bG9nCiAgICAgICAgICAgIHJlc3BvbnNlID0gc3luYyhzZWxmLmJyb3dzZXIubG9vcCwgbGFtYmRhIDpodHRweChzZWxmLnVybCkpCiAgICAgICAgICAgIHNlbGYucGFyc2UocmVzcG9uc2UpCiAgICAgICAgICAgICfor7fmsYLlrozmiJDvvIzov5Tlm57lhoXlrrknPj5sb2cKICAgICAgICAgICAgcmV0dXJuIHNlbGYuX3BhZ2UKICAgIAogICAgQHByb3BlcnR5CiAgICBkZWYgYXJ0aWNsZShzZWxmKToKICAgICAgICAiIiLojrflj5YgVVJMIOeahOaWh+eroOWGheWuueOAggoKICAgICAgICDlpoLmnpznvJPlrZjkuK3lrZjlnKjvvIzliJnnm7TmjqXov5Tlm57nvJPlrZjnmoTmlofnq6Dlr7nosaHjgIIKICAgICAgICDlpoLmnpznvJPlrZjkuK3kuI3lrZjlnKjvvIzliJnlhYjojrflj5bpobXpnaLlhoXlrrnlubbop6PmnpDmlofnq6DjgIIKCiAgICAgICAg6L+U5ZueOgogICAgICAgICAgICBhcnRpY2xlOiBBcnRpY2xl5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgcmV0dXJuIHNlbGYucGFnZS5hcnRpY2xlCgogICAgZGVmIHJlZnJlc2goc2VsZik6CiAgICAgICAgIiIi5omL5Yqo5Yi35pawIFVSTCDnmoTlk43lupTlhoXlrrnjgIIKCiAgICAgICAg5b+955Wl57yT5a2Y5YaF5a6577yM6YeN5paw5Y+R6LW35byC5q2l6K+35rGC77yM5bm25LiU5L+d5a2Y5pWw5o2u5Yiw57yT5a2Y44CCCgogICAgICAgIOi/lOWbnjoKICAgICAgICAgICAgcmVzcG9uc2U6IOWTjeW6lOWvueixoQogICAgICAgICIiIgogICAgICAgIHNlbGYuX3NjaGVkdWxlX3JlcXVlc3QoKQoKICAgICAgICByZXR1cm4gc2VsZgogICAgCiAgICBkZWYgcGFyc2Uoc2VsZiwgcmVzcG9uc2UpOgogICAgICAgICIiIuWkhOeQhue9kee7nOi/lOWbnueahOaVsOaNruOAggogICAgICAgIAogICAgICAgIOeUn+aIkCBhcnRpY2xlIOWvueixoeW5tuWtmOWCqOWIsOe8k+WtmOS4reOAggogICAgICAgIAogICAgICAgIOWPguaVsDoKICAgICAgICAgICAgcmVzcG9uc2U6IOWTjeW6lOWvueixoQogICAgICAgICIiIgogICAgICAgIHNlbGYuX3BhZ2UgPSByZXNwb25zZQogICAgICAgIHNlbGYuX3BhZ2UuYXJ0aWNsZSA9IHNlbGYuYnJvd3Nlci5jcmVhdGVfYXJ0aWNsZShyZXNwb25zZSkKICAgICAgICBzZWxmLmJyb3dzZXIuX2FkZF90b19jYWNoZShzZWxmLnVybCwgc2VsZi5fcGFnZSkKICAgICAgICByZXR1cm4gc2VsZi5fcGFnZQogICAgCiAgICBkZWYgX19zdHJfXyhzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi51cmwgICMg6L+U5ZueIFVSTAoKICAgIGRlZiBjbG9zZShzZWxmKToKICAgICAgICAiIiLlhbPpl60gdGFiIOWvueixoe+8jOWBnOatouWJjemdouiuvuWumueahOWumuacn+WIt+aWsO+8jOW5tuS7jua1j+iniOWZqOeahOWFqOWxgCB0YWJzIOS4reenu+mZpOivpeWvueixoe+8jOW5tumHiuaUvuWGheWtmOOAguWQjOaXtuS7jue8k+WtmOS4reWIoOmZpOaVsOaNruOAgiIiIgogICAgICAgICMg5aaC5p6c5a2Y5Zyo5Yi35paw5a6a5pe25Zmo77yM5YiZ56e76ZmkCiAgICAgICAgaWYgaGFzYXR0cihzZWxmLCAnX3JlZnJlc2hfdGltZXInKToKICAgICAgICAgICAgc2VsZi5icm93c2VyLmxvb3AucmVtb3ZlX3RpbWVvdXQoc2VsZi5fcmVmcmVzaF90aW1lcikKICAgICAgICAjIOS7jua1j+iniOWZqOeahOagh+etvumhteWIl+ihqOS4reenu+mZpOW9k+WJjeagh+etvumhtQogICAgICAgIHNlbGYuYnJvd3Nlci50YWJzLnJlbW92ZShzZWxmKQogICAgICAgICMg5LuO57yT5a2Y5Lit5Yig6Zmk5pWw5o2uCiAgICAgICAgaWYgc2VsZi51cmwgaW4gc2VsZi5icm93c2VyLmNhY2hlOgogICAgICAgICAgICBkZWwgc2VsZi5icm93c2VyLmNhY2hlW3NlbGYudXJsXQogICAgICAgIGRlbCBzZWxmCiAgICAgICAgJ+W3suWIoOmZpCB0YWIg5a+56LGhJz4+bG9nCiMg5YWo5bGA5rWP6KeI5Zmo5a6e5L6LLOe8k+WtmOWkp+Wwj+S4ujUwMDAKX2dsb2JhbF9icm93c2VyID0gQnJvd3NlcihjYWNoZV9zaXplPTUwMDApCgojIOWFqOWxgOW/q+aNt+aWueW8jyzmlrnkvr/nm7TmjqXkvb/nlKgKYnJ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OW5tuaPkOWPllhQYXRoCiAgICBmcm9tIGRldmEgaW1wb3J0IG9wZW5haQogICAgYXBpX2tleSA9ICc5MTlhNzk1ZC0yMDdiLTRjY2YtOGZkNC04M2VlNWEyM2U5NjEnCiAgICBBUElfVVJMID0gImh0dHBzOi8vYXBpLnNhbWJhbm92YS5haS92MS8iCiAgICBtb2RlbCA9ICJNZXRhLUxsYW1hLTMuMS04Qi1JbnN0cnVjdCIKICAgIAogICAgIyDojrflj5bnvZHpobXlhoXlrrkKICAgIGh0bWxfY29udGVudCA9IHRhYjEucGFnZS50ZXh0CiAgICAKICAgICMg5p6E5bu65o+Q56S66K+tCiAgICBwcm9tcHQgPSBmIiIi5YiG5p6Q5Lul5LiLSFRNTOWGheWuue+8jOaJvuWHuuato+aWh+WSjOagh+mimOeahFhQYXRo6Lev5b6EOgoKe2h0bWxfY29udGVudH0KCuivt+i/lOWbnkpTT07moLzlvI86Cnt7CiAgICAidGl0bGVfeHBhdGgiOiAi5qCH6aKY55qEeHBhdGjot6/lvoQiLAogICAgImNvbnRlbnRfeHBhdGgiOiAi5q2j5paH55qEeHBhdGjot6/lvoQiCn19CiIiIgoKICAgICMg6LCD55SoT3BlbkFJIEFQSeiOt+WPluWIhuaekOe7k+aenAogICAgcmVzdWx0ID0gb3BlbmFpLmNoYXQuY29tcGxldGlvbnMuY3JlYXRlKAogICAgICAgIG1vZGVsPSJncHQtMy41LXR1cmJvIiwKICAgICAgICBtZXNzYWdlcz1beyJyb2xlIjogInVzZXIiLCAiY29udGVudCI6IHByb21wdH1dCiAgICApLmNob2ljZXNbMF0ubWVzc2FnZS5jb250ZW50CgogICAgIyDop6PmnpDov5Tlm57nmoRKU09OCiAgICBpbXBvcnQganNvbgogICAgeHBhdGhfaW5mbyA9IGpzb24ubG9hZHMocmVzdWx0KQogICAgCiAgICAjIOS9v+eUqFhQYXRo5o+Q5Y+W5YaF5a65CiAgICB0aXRsZSA9IHRhYjEucGFnZS5odG1sLnhwYXRoKHhwYXRo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8jOS8mumYu+WhnuetieW+hee9kee7nOivt+axguWujOaIkAogIC0g5byC5q2l5qih5byPOiDpu5jorqTliJvlu7rlr7nosaHmmK/vvIzkvJrlvILmraXor7fmsYLnvZHnu5zvvIzkv53lrZjmlbDmja7liLDnvJPlrZjvvIzlj6blpJbpgJrov4cgcmVmcmVzaCgpIOaWueazleWPkei1t+W8guatpeivt+axgizkuZ/kuI3kvJrpmLvloZ7kuLvnur/nqIsKCjIuIOe8k+WtmOacuuWItgotIEJyb3dzZXIg5a+56LGh57u05oqk5LiA5LiqIExSVSDnvJPlrZgs55So5LqO5a2Y5YKo6K+35rGC5ZON5bqUCi0g57yT5a2Y5aSn5bCP5Y+v6YWN572uLOm7mOiupOS4uiA1MDAwIOadoQotIOW9k+e8k+WtmOa7oeaXtuS8muenu+mZpOacgOaXqeeahOe8k+WtmOmhuQotIFRhYiDor7fmsYLml7bkvJjlhYjku47nvJPlrZjojrflj5Ys5peg57yT5a2Y5pe25omN5Y+R6LW3572R57uc6K+35rGCCgozLiDoh6rliqjliLfmlrDmnLrliLYKLSBUYWIg5pSv5oyB5a6a5pyf6Ieq5Yqo5Yi35pawLOm7mOiupOS4jeS8muiHquWKqOWIt+aWsAotIOWPr+mAmui/hyByZWZyZXNoX2ludGVydmFsIOWPguaVsOmFjee9ruWIt+aWsOmXtOmalAotIOavj+asoeivt+axguWujOaIkOWQjuS8muiHquWKqOWuieaOkuS4i+S4gOasoeWIt+aWsAotIOiuvue9riByZWZyZXNoX2ludGVydmFsPTAg5pe256aB55So6Ieq5Yqo5Yi35pawCgo0LiBUYWIg566h55CGCi0gQnJvd3NlciDnu7TmiqTmiYDmnInmiZPlvIDnmoQgVGFiIOWIl+ihqAotIOaUr+aMgemAmui/hyBVUkwg5Yib5bu65ZKM5YWz6ZetIFRhYgotIOWFs+mXrSBUYWIg5pe25LyaOgogIC0g5YGc5q2i6Ieq5Yqo5Yi35pawCiAgLSDku44gVGFiIOWIl+ihqOenu+mZpAogIC0g5riF6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va7nvJPlrZjlip/og73jgIIKCiAgICDnvJPlrZjmmK/kuIDkuKrlrZflhbjlr7nosaHvvIxrZXkg5pivIHVybO+8jHZhbHVlIOaYryByZXNwb25zZSDlr7nosaHjgIIKICAgICIiIgoKICAgIGRlZiBfX2luaXRfXyhzZWxmLCBjYWNoZV9zaXplPTMwLCAqKmt3YXJncyk6CiAgICAgICAgIiIiCiAgICAgICAg5Yid5aeL5YyW5rWP6KeI5Zmo5a+56LGh77yM55So5LqO566h55CG5aSa5LiqdGFi55qE5rWP6KeI5ZKM57yT5a2Y44CCCgogICAgICAgIOS+i+WtkO+8mmJyb3dzZXIudGFiKCJodHRwOi8vYmFpZHUuY29tIikucGFnZT4+cHJpbnQKCiAgICAgICAg5Y+C5pWwOgogICAgICAgICAgICBjYWNoZV9zaXplOiDnvJPlrZjlpKflsI/vvIzljbPmnIDlpJrkv53lrZjnmoTlk43lupTlr7nosaHmlbDph4/vvIzpu5jorqTkuLozMOOAggogICAgICAgICAgICAqKmt3YXJnczog5YW25LuW5Y+C5pWw77yM5Lyg6YCS57uZ54i257G755qE5Yid5aeL5YyW5pa55rOV44CCCiAgICAgICAgIiIiCiAgICAgICAgc3VwZXIoKS5fX2luaXRfXyhlbnN1cmVfaW9fbG9vcD1UcnVlLCoqa3dhcmdzKQogICAgICAgIHNlbGYubG9nID0gU3RyZWFtKCkKICAgICAgICBzZWxmLmNhY2hlID0gZGVmYXVsdGRpY3QobGFtYmRhOiBOb25lKQogICAgICAgIHNlbGYuY2FjaGVfc2l6ZSA9IGNhY2hlX3NpemUKICAgICAgICBzZWxmLnBhZ2Vfc3RyZWFtID0gU3RyZWFtKCkgIyDkvb/nlKhwYWdlX3N0cmVhbea1geadpeaMgui9veWFtuS7luWkhOeQhuaPkuS7tgogICAgICAgIHNlbGYudGFicyA9IHNldCgpICAjIOS9v+eUqCBzZXQg5L+d5a2YIHRhYiDlr7nosaEKCiAgICAgICAgc2VsZi5wYWdlX3N0cmVhbS5zaW5rKHNlbGYuX2FkZF90b19jYWNoZSkKCiAgICBkZWYgdGFiKHNlbGYsIHVybCwgcmVmcmVzaF9pbnRlcnZhbD0wKTogICMg6buY6K6k5LiN6Ieq5Yqo5Yi35pawCiAgICAgICAgIiIi5Yib5bu65LiA5LiqIHRhYiDlr7nosaHvvIznlKjkuo7lpITnkIYgVVJMIOivt+axgu+8jOW5tuaPkOS+m+WumuaXtuWIt+aWsOWKn+iDveOAggogICAgICAgIOavj+S4qiB0YWIg6I635b6X572R57ucIHJlc3BvbnNlIOWQju+8jOWFiOino+aekOaIkCBwYWdlCiAgICAgICAg54S25ZCO5bCGIHBhZ2Ug5Y+R6YCB5Yiw5rWP6KeI5Zmo55qEIHBhZ2Vfc3RyZWFtLOaWueS+v+WQjue7reeUqOaIt+WcqCBwYWdlX3N0cmVhbeS4iuWkhOeQhiBwYWdlCgoKICAgICAgICDlj4LmlbA6CiAgICAgICAgICAgIHVybDog6KaB6K+35rGC55qEIFVSTAogICAgICAgICAgICByZWZyZXNoX2ludGVydmFsOiDlrprml7bliLfmlrDml7bpl7TvvIzljZXkvY3kuLrnp5LvvIzpu5jorqTkuLow77yM5LiN5omn6KGM5a6a5pe25Yi35paw5Lu75YqhCgogICAgICAgIOi/lOWbnjoKICAgICAgICAgICAgVGFiIOWvueixoQogICAgICAgICIiIgogICAgICAgICMg5qOA5p+l5piv5ZCm5bey5a2Y5Zyo55u45ZCM55qEIHRhYgogICAgICAgIGZvciBleGlzdGluZ190YWIgaW4gc2VsZi50YWJzOgogICAgICAgICAgICBpZiBzdHIoZXhpc3RpbmdfdGFiKSA9PSB1cmw6CiAgICAgICAgICAgICAgICBleGlzdGluZ190YWIucmVmcmVzaF9pbnRlcnZhbCA9IHJlZnJlc2hfaW50ZXJ2YWwgICMg5pu05paw5bey5a2Y5Zyo55qEIHRhYiDnmoTliLfmlrDpl7TpmpQKICAgICAgICAgICAgICAgIHJldHVybiBleGlzdGluZ190YWIgICMg6L+U5Zue5bey5a2Y5Zyo55qEIHRhYgogICAgICAgIG5ld190YWIgPSBUYWIoc2VsZiwgdXJsLCByZWZyZXNoX2ludGVydmFsKQogICAgICAgIHNlbGYudGFicy5hZGQobmV3X3RhYikgICMg5re75Yqg5pawIHRhYiDliLAgc2V0CiAgICAgICAgCiAgICAgICAgcmV0dXJuIG5ld190YWIKCiAgICBkZWYgZW1pdChzZWxmLCB4LCBhc3luY2hyb25vdXM9RmFsc2UpOgogICAgICAgIHJldHVybiBzZWxmLnRhYih4KQogICAgCiAgICBkZWYgX2FkZF90b19jYWNoZShzZWxmLCBwYWdlKToKICAgICAgICAiIiLlsIblk43lupTmt7vliqDliLDnvJPlrZjkuK3jgIIKCiAgICAgICAg5Y+C5pWwOgogICAgICAgICAgICB1cmw6IOivt+axgueahCBVUkwKICAgICAgICAgICAgcmVzcG9uc2U6IOWTjeW6lOWvueixoQogICAgICAgICIiIgogICAgICAgIGlmIGxlbihzZWxmLmNhY2hlKSA+PSBzZWxmLmNhY2hlX3NpemU6CiAgICAgICAgICAgICMg56e76Zmk5pyA5pep55qE57yT5a2Y6aG5CiAgICAgICAgICAgIHNlbGYuY2FjaGUucG9wKG5leHQoaXRlcihzZWxmLmNhY2hlKSkpCiAgICAgICAgc2VsZi5jYWNoZVtwYWdlLnVybF0gPSBwYWdlCgogICAgZGVmIF9fcmVwcl9fKHNlbGYpOgogICAgICAgIHJldHVybiBmIkJyb3dzZXIoY2FjaGVfc2l6ZT17c2VsZi5jYWNoZV9zaXplfSwgdGFicz17bGVuKHNlbGYudGFicyl9KSIKCiAgICBkZWYgZXh0cmFjdF90ZXh0X2Zyb21faHRtbChzZWxmLCBodG1sX2NvbnRlbnQpOgogICAgICAgICIiIuS9v+eUqCBib2lsZXJweTMg5LuOIEhUTUwg5YaF5a655Lit5o+Q5Y+W5paw6Ze75q2j5paH44CCCgogICAgICAgIOWPguaVsDoKICAgICAgICAgICAgaHRtbF9jb250ZW50OiBIVE1MIOWGheWuueWtl+espuS4sgoKICAgICAgICDov5Tlm546CiAgICAgICAgICAgIHN0cjog5o+Q5Y+W55qE5paw6Ze75q2j5paH5paH5pysCiAgICAgICAgIiIiCiAgICAgICAgZnJvbSBib2lsZXJweTMgaW1wb3J0IGV4dHJhY3RvcnMKICAgICAgICBleHRyYWN0b3IgPSBleHRyYWN0b3JzLkFydGljbGVFeHRyYWN0b3IoKQogICAgICAgIHRyeToKICAgICAgICAgICAgdGV4dCA9IGV4dHJhY3Rvci5nZXRfY29udGVudChodG1sX2NvbnRlbnQpCiAgICAgICAgICAgIHJldHVybiB0ZXh0CiAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbiBhcyBlOgogICAgICAgICAgICBwcmludChmIuaPkOWPluaWh+acrOaXtuWHuumUmToge3N0cihlKX0iKQogICAgICAgICAgICByZXR1cm4gIiIKICAgICAgICAKICAgIGRlZiBjcmVhdGVfYXJ0aWNsZShzZWxmLHJlc3BvbnNlKToKICAgICAgICBhcnRpY2xlID0gQXJ0aWNsZShyZXNwb25zZS51cmwsIGxhbmd1YWdlPSd6aCcpICAjIOiuvue9ruivreiogOS4uuS4reaWhwogICAgICAgIGFydGljbGUuc2V0X2h0bWwocmVzcG9uc2UuaHRtbC5odG1sKQogICAgICAgIGFydGljbGUuY29uZmlnLk1BWF9TVU1NQVJZX1NFTlQgPSAzICAjIOmZkOWItuaRmOimgeWPpeWtkOaVsOmHjwogICAgICAgIGFydGljbGUucGFyc2UoKQogICAgICAgIGlmIG5vdCBhcnRpY2xlLnRleHQ6CiAgICAgICAgICAgIGFydGljbGUudGV4dCA9IHNlbGYuZXh0cmFjdF90ZXh0X2Zyb21faHRtbChyZXNwb25zZS5odG1sLmh0bWwpCiAgICAgICAgICAgICMg5L2/55So5paH56ug5q2j5paH55Sf5oiQ5pGY6KaBCiAgICAgICAgICAgIGZyb20gYnM0IGltcG9ydCBCZWF1dGlmdWxTb3VwCgojIOa4heeQhiBIVE1MIOagh+etvgogICAgICAgICAgICBhcnRpY2xlLnRleHQgPSBCZWF1dGlmdWxTb3VwKGFydGljbGUudGV4dCwgImh0bWwucGFyc2VyIikuZ2V0X3RleHQoKQoKIyDnoa7kv53lhoXlrrnotrPlpJ/plb8KICAgICAgICAgICAgaWYgbGVuKGFydGljbGUudGV4dCkgPCA1MDogICMg6K6+572u5pyA5bCP6ZW/5bqm6ZmQ5Yi2CiAgICAgICAgICAgICAgICByYWlzZSBWYWx1ZUVycm9yKCLmlofnq6DlhoXlrrnlpKrnn63vvIzml6Dms5XnlJ/miJDmkZjopoEiKQoKICAgICAgICAjIGFydGljbGUubmxwKCkgICMg55Sf5oiQ5pGY6KaB6LSo6YeP6L6D5beuCiAgICAgICAgIyDkvb/nlKhzdW1555Sf5oiQ5pGY6KaBCiAgICAgICAgdHJ5OgogICAgICAgICAgICBmcm9tIHN1bXkucGFyc2Vycy5wbGFpbnRleHQgaW1wb3J0IFBsYWludGV4dFBhcnNlcgogICAgICAgICAgICBmcm9tIHN1bXkubmxwLnRva2VuaXplcnMgaW1wb3J0IFRva2VuaXplcgogICAgICAgICAgICBmcm9tIHN1bXkuc3VtbWFyaXplcnMubHNhIGltcG9ydCBMc2FTdW1tYXJpemVyCiAgICAgICAgICAgIGZyb20gc3VteS5ubHAuc3RlbW1lcnMgaW1wb3J0IFN0ZW1tZXIKICAgICAgICAgICAgZnJvbSBzdW15LnV0aWxzIGltcG9ydCBnZXRfc3RvcF93b3JkcwoKICAgICAgICAgICAgCgojIOWwhua4heeQhuWQjueahOaWh+acrOS8oOWFpSBzdW1tYXJpemVyCiAgICAgICAgICAgIHBhcnNlciA9IFBsYWludGV4dFBhcnNlci5mcm9tX3N0cmluZyhhcnRpY2xlLnRleHQsIFRva2VuaXplcignY2hpbmVzZScpKQogICAgICAgICAgICAjIHBhcnNlciA9IFBsYWludGV4dFBhcnNlci5mcm9tX3N0cmluZyhhcnRpY2xlLnRleHQsIFRva2VuaXplcignY2hpbmVzZScpKQogICAgICAgICAgICBzdGVtbWVyID0gU3RlbW1lcignY2hpbmVzZScpCiAgICAgICAgICAgIHN1bW1hcml6ZXIgPSBMc2FTdW1tYXJpemVyKHN0ZW1tZXIpCiAgICAgICAgICAgIHN1bW1hcml6ZXIuc3RvcF93b3JkcyA9IGdldF9zdG9wX3dvcmRzKCdjaGluZXNlJykKICAgICAgICAgICAgCiAgICAgICAgICAgICMg55Sf5oiQM+WPpeivneeahOaRmOimgQogICAgICAgICAgICBzdW1tYXJ5ID0gW10KICAgICAgICAgICAgZm9yIHNlbnRlbmNlIGluIHN1bW1hcml6ZXIocGFyc2VyLmRvY3VtZW50LCAzKToKICAgICAgICAgICAgICAgIHN1bW1hcnkuYXBwZW5kKHN0cihzZW50ZW5jZSkpCiAgICAgICAgICAgIGFydGljbGUuc3VtbWFyeSA9ICdcbicuam9pbihzdW1tYXJ5KQogICAgICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZToKICAgICAgICAgICAgcHJpbnQoZiLnlJ/miJDmkZjopoHml7blh7rplJk6IHtzdHIoZSl9IikKICAgICAgICAgICAgYXJ0aWNsZS5zdW1tYXJ5ID0gIiIKICAgICAgICByZXR1cm4gYXJ0aWNsZQoKY2xhc3MgVGFiKCk6CiAgICAiIiJUYWIg5a+56LGh77yM55So5LqO5aSE55CG5Y2V5LiqIFVSTCDor7fmsYLvvIzlubbmj5DkvpvlrprmnJ/liLfmlrDlip/og73vvIzmr4/mrKHor7fmsYLlrozmiJDlkI7lronmjpLkuIvkuIDkuKrlrprmnJ/liLfmlrDku7vliqHjgIIiIiIKCiAgICBkZWYgX19pbml0X18oc2VsZiwgYnJvd3NlciwgdXJsLCByZWZyZXNoX2ludGVydmFsPTcyMDApOiAgIyDpu5jorqTliLfmlrDpl7TpmpTkuLogMiDlsI/ml7YKICAgICAgICBzZWxmLmJyb3dzZXIgPSBicm93c2VyCiAgICAgICAgc2VsZi51cmwgPSB1cmwKICAgICAgICBzZWxmLl9wYWdlID0gTm9uZQogICAgICAgIHNlbGYucmVmcmVzaF9pbnRlcnZhbCA9IHJlZnJlc2hfaW50ZXJ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l9jYWxsYmFjaykKCgogICAgZGVmIF9zY2hlZHVsZV9yZWZyZXNoKHNlbGYpOgogICAgICAgICIiIuWuieaOkuWumuacn+WIt+aWsO+8jOeUqOS6juWumuacn+abtOaWsCBVUkwg55qE5ZON5bqU5YaF5a6544CCIiIiCiAgICAgICAgIyDlpoLmnpzliLfmlrDpl7TpmpTlgLzkuLogTm9uZSDjgIFGYWxzZeaIluiAhSAw77yM5YiZ5rC46L+c5LiN5omn6KGM5a6a5pe25Yi35paw5Lu75YqhCiAgICAgICAgaWYgbm90IHNlbGYucmVmcmVzaF9pbnRlcnZhbDoKICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgIyDlpoLmnpzlt7Lnu4/lrZjlnKjliLfmlrDlrprml7blmajvvIzlhYjnp7vpmaQKICAgICAgICBpZiBoYXNhdHRyKHNlbGYsICdfcmVmcmVzaF90aW1lcicpOgogICAgICAgICAgICBzZWxmLmJyb3dzZXIubG9vcC5yZW1vdmVfdGltZW91dChzZWxmLl9yZWZyZXNoX3RpbWVyKQogICAgICAgICMg5Yib5bu65paw55qE5Yi35paw5a6a5pe25ZmoCiAgICAgICAgc2VsZi5fcmVmcmVzaF90aW1lciA9IHNlbGYuYnJvd3Nlci5sb29wLmNhbGxfbGF0ZXIoc2VsZi5yZWZyZXNoX2ludGVydmFsLCBzZWxmLl9zY2hlZHVsZV9yZXF1ZXN0KQogICAgICAgIGYn5Li6e3NlbGYudXJsfeWuieaOkuWumuacn+WIt+aWsCc+PnNlbGYuYnJvd3Nlci5sb2cKCiAgICBAcHJvcGVydHkKICAgIGRlZiBwYWdlKHNlbGYpOgogICAgICAgICIiIuiOt+WPliBVUkwg55qE5ZON5bqU5YaF5a6544CCCgogICAgICAgIOWmguaenOe8k+WtmOS4reWtmOWcqO+8jOWImeebtOaOpei/lOWbnue8k+WtmOWGheWuueOAggogICAgICAgIOWmguaenOe8k+WtmOS4reS4jeWtmOWcqO+8jOWImei/m+ihjOWQjOatpeivt+axguW5tue8k+WtmOe7k+aenOOAggoKICAgICAgICDov5Tlm546CiAgICAgICAgICAgIHJlc3BvbnNlOiDlk43lupTlr7nosaEKICAgICAgICAiIiIKICAgICAgICBpZiBzZWxmLl9wYWdlICE9IE5vbmU6CiAgICAgICAgICAgICfmtY/op4jlmajph4zmnInlt7Lnu4/miZPlvIDnmoQgdGFi77yM56uL5Y2z6L+U5Zue5YaF5a65JyA+PiBzZWxmLmJyb3dzZXIubG9nCiAgICAgICAgICAgIHJldHVybiBzZWxmLl9wYWdlICAKICAgICAgICBlbHNlOgogICAgICAgICAgICAn5rWP6KeI5Zmo6YeM5rKh5pyJ5oiQ5Yqf5a6M5YWo5omT5byA54q25oCB55qEIHRhYu+8jOeri+WNs+WQjOatpee9kee7nOivt+axgicgPj4gc2VsZi5icm93c2VyLmxvZwogICAgICAgICAgICBzZWxmLnVybD4+c2VsZi5icm93c2VyLmxvZwogICAgICAgICAgICByZXNwb25zZSA9IHN5bmMoc2VsZi5icm93c2VyLmxvb3AsIGxhbWJkYTogaHR0cHgoc2VsZi51cmwpKQogICAgICAgICAgICAn5ZCM5q2l6K+35rGC5a6M5oiQ77yM6L+U5Zue5YaF5a65JyA+PiBzZWxmLmJyb3dzZXIubG9nCiAgICAgICAgICAgIHJldHVybiBzZWxmLnBhcnNlKHJlc3BvbnNlKQogICAgICAgICAgICAKICAgIAogICAgQHByb3BlcnR5CiAgICBkZWYgYXJ0aWNsZShzZWxmKToKICAgICAgICAiIiLojrflj5YgVVJMIOeahOaWh+eroOWGheWuueOAggoKICAgICAgICDlpoLmnpznvJPlrZjkuK3lrZjlnKjvvIzliJnnm7TmjqXov5Tlm57nvJPlrZjnmoTmlofnq6Dlr7nosaHjgIIKICAgICAgICDlpoLmnpznvJPlrZjkuK3kuI3lrZjlnKjvvIzliJnlhYjojrflj5bpobXpnaLlhoXlrrnlubbop6PmnpDmlofnq6DjgIIKCiAgICAgICAg6L+U5ZueOgogICAgICAgICAgICBhcnRpY2xlOiBBcnRpY2xl5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgcmV0dXJuIHNlbGYucGFnZS5hcnRpY2xlCgogICAgZGVmIHJlZnJlc2goc2VsZik6CiAgICAgICAgIiIi5omL5Yqo5Yi35pawIFVSTCDnmoTlk43lupTlhoXlrrnjgIIKCiAgICAgICAg5b+955Wl57yT5a2Y5YaF5a6577yM6YeN5paw5Y+R6LW35byC5q2l6K+35rGC77yM5bm25LiU5L+d5a2Y5pWw5o2u5Yiw57yT5a2Y44CCCgogICAgICAgIOi/lOWbnjoKICAgICAgICAgICAgcmVzcG9uc2U6IOWTjeW6lOWvueixoQogICAgICAgICIiIgogICAgICAgIHNlbGYuX3NjaGVkdWxlX3JlcXVlc3QoKQogICAgICAgIHJldHVybiBzZWxmCiAgICAKICAgIGRlZiBwYXJzZShzZWxmLCByZXNwb25zZSk6CiAgICAgICAgIiIiCiAgICAgICAg5aSE55CG572R57uc6L+U5Zue55qE5pWw5o2u77yM55Sf5oiQIGFydGljbGUg5a+56LGh5bm25a2Y5YKo5Yiw57yT5a2Y5Lit44CCCgogICAgICAgIOi/meS4quaWueazleWwhuaOpeaUtuWIsOeahOWTjeW6lOWvueixoei9rOaNouS4uiBhcnRpY2xlIOWvueixoe+8jOW5tuWwhuWFtuWtmOWCqOWIsOa1j+iniOWZqOeahOe8k+WtmOS4re+8jOS7peS+v+WQjue7reS9v+eUqOOAggoKICAgICAgICDlj4LmlbA6CiAgICAgICAgICAgIHJlc3BvbnNlIChvYmplY3QpOiDlk43lupTlr7nosaHvvIzljIXlkKvkuobku47nvZHnu5zor7fmsYLkuK3ojrflj5bnmoTmlbDmja7jgIIKCiAgICAgICAg6L+U5ZueOgogICAgICAgICAgICBzZWxmLl9wYWdlIChvYmplY3QpOiDljIXlkKvkuobmlofnq6Dlr7nosaHnmoTpobXpnaLlr7nosaHvvIznlKjkuo7lrZjlgqjlkozorr/pl67mlofnq6DmlbDmja7jgIIKICAgICAgICAiIiIKICAgICAgICAKICAgICAgICAjIOajgOafpeWTjeW6lOWvueixoeaYr+WQpuS4uuato+W4uOeahHJlc3BvbnNl57G75Z6LCiAgICAgICAgaWYgbm90IGlzaW5zdGFuY2UocmVzcG9uc2UsIEhUTUxSZXNwb25zZSk6CiAgICAgICAgICAgICfpnZ7mraPluLjnmoTlk43lupTlr7nosaEnID4+IHNlbGYuYnJvd3Nlci5sb2cKICAgICAgICAgICAgcmV0dXJuIE5vbmUKICAgICAgICAKICAgICAgICAjIOWwhuWTjeW6lOWvueixoeWtmOWCqOWIsOW9k+WJjemhtemdouWvueixoeS4rQogICAgICAgIHNlbGYuX3BhZ2UgPSByZXNwb25zZQogICAgICAgICMg5L2/55So5rWP6KeI5Zmo55qE5pa55rOV5Yib5bu65paH56ug5a+56LGhCiAgICAgICAgc2VsZi5fcGFnZS5fYXJ0aWNsZSA9IHNlbGYuYnJvd3Nlci5jcmVhdGVfYXJ0aWNsZShyZXNwb25zZSkKICAgICAgICAjIOWumuS5ieaWh+eroOWvueixoeeahOWxnuaAp+WIl+ihqAogICAgICAgIGFydGljbGVfYXR0cmlidXRlcyA9IFsna2V5d29yZHMnLCAnbWV0YV9rZXl3b3JkcycsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndGFncycsICdhdXRob3JzJywgJ3B1Ymxpc2hfZGF0ZScsIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3N1bW1hcnknLCAndGV4dCcsICdpbWFnZXMnLCAnbWV0YV9kYXRhJywgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWV0YV9kZXNjcmlwdGlvbicsICd0aXRsZSddCiAgICAgICAgIyDkvb/nlKhEb3REaWN05bCG5paH56ug5a+56LGh55qE5bGe5oCn6L2s5o2i5Li65a2X5YW45b2i5byPCiAgICAgICAgc2VsZi5fcGFnZS5hcnRpY2xlID0gRG90RGljdCh7CiAgICAgICAgICAgIGF0dHI6IGdldGF0dHIoc2VsZi5fcGFnZS5fYXJ0aWNsZSwgYXR0cikgCiAgICAgICAgICAgIGZvciBhdHRyIGluIGFydGljbGVfYXR0cmlidXRlc30pCiAgICAgICAgCiAgICAgICAgIyDlsIbop6PmnpDlpb3nmoTpobXpnaLlj5HliLDmtY/op4jlmajpobXpnaLmtYHkuK0KICAgICAgICBzZWxmLmJyb3dzZXIucGFnZV9zdHJlYW0uZW1pdChzZWxmLl9wYWdlKQogICAgICAgICMg6L+U5Zue5b2T5YmN6aG16Z2i5a+56LGhCiAgICAgICAgcmV0dXJuIHNlbGYuX3BhZ2UKICAgIAogICAgZGVmIF9fc3RyX18oc2VsZik6CiAgICAgICAgcmV0dXJuIHNlbGYudXJsICAjIOi/lOWbniBVUkwKCiAgICBkZWYgX19yZXByX18oc2VsZik6CiAgICAgICAgIiIi6L+U5ZueIFRhYiDlr7nosaHnmoTmnInmhI/kuYnnmoTooajnpLrlvaLlvI/vvIzljIXlkKsgVVJMIOWSjOaRmOimgeOAgiIiIgogICAgICAgIHJldHVybiBmIlRhYih1cmw9e3NlbGYudXJsfSwgc3VtbWFyeT17c2VsZi5wYWdlLmFydGljbGUudGl0bGV9KSIKCiAgICBkZWYgY2xvc2Uoc2VsZik6CiAgICAgICAgIiIi5YWz6ZetIHRhYiDlr7nosaHvvIzlgZzmraLliY3pnaLorr7lrprnmoTlrprmnJ/liLfmlrDvvIzlubbku47mtY/op4jlmajnmoTlhajlsYAgdGFicyDkuK3np7vpmaTor6Xlr7nosaHvvIzlubbph4rmlL7lhoXlrZjjgILlkIzml7bku47nvJPlrZjkuK3liKDpmaTmlbDmja7jgIIiIiIKICAgICAgICAjIOWmguaenOWtmOWcqOWIt+aWsOWumuaXtuWZqO+8jOWImeenu+mZpAogICAgICAgIGlmIGhhc2F0dHIoc2VsZiwgJ19yZWZyZXNoX3RpbWVyJyk6CiAgICAgICAgICAgIHNlbGYuYnJvd3Nlci5sb29wLnJlbW92ZV90aW1lb3V0KHNlbGYuX3JlZnJlc2hfdGltZXIpCiAgICAgICAgIyDku47mtY/op4jlmajnmoTmoIfnrb7pobXliJfooajkuK3np7vpmaTlvZPliY3moIfnrb7pobUKICAgICAgICBzZWxmLmJyb3dzZXIudGFicy5yZW1vdmUoc2VsZikKICAgICAgICAjIOS7jue8k+WtmOS4reWIoOmZpOaVsOaNrgogICAgICAgIGlmIHNlbGYudXJsIGluIHNlbGYuYnJvd3Nlci5jYWNoZToKICAgICAgICAgICAgZGVsIHNlbGYuYnJvd3Nlci5jYWNoZVtzZWxmLnVybF0KICAgICAgICBkZWwgc2VsZgogICAgICAgICflt7LliKDpmaQgdGFiIOWvueixoSc+PnNlbGYuYnJvd3Nlci5sb2cKIyDlhajlsYDmtY/op4jlmajlrp7kvoss57yT5a2Y5aSn5bCP5Li6NTAwMApfZ2xvYmFsX2Jyb3dzZXIgPSBCcm93c2VyKGNhY2hlX3NpemU9NTAwMCkKCiMg5YWo5bGA5b+r5o235pa55byPLOaWueS+v+ebtOaOpeS9v+eUqApicm93c2VyID0gX2dsb2JhbF9icm93c2VyICAjIOa1j+iniOWZqOWunuS+iwp0YWIgPSBfZ2xvYmFsX2Jyb3dzZXIudGFiICAjIOebtOaOpeWIm+W7uuaWsOagh+etvumhteeahOWFqOWxgOaWueazlQp0YWJzID0gX2dsb2JhbF9icm93c2VyLnRhYnMgICMg5omA5pyJ5qCH562+6aG15YiX6KGoCgpkZWYgb3Blbl90YWJzX2luX2Jyb3dzZXIoKToKICAgICIiIuWcqOm7mOiupOa1j+iniOWZqOS4reaJk+W8gOaJgOaciee8k+WtmOeahOagh+etvumhteWGheWuuSIiIgogICAgaW1wb3J0IHRlbXBmaWxlCiAgICBpbXBvcnQgd2ViYnJvd3NlcgogICAgaW1wb3J0IG9zCiAgICAKICAgICMg5Li65q+P5Liq57yT5a2Y55qE5ZON5bqU5Yib5bu65Li05pe2SFRNTOaWh+S7tgogICAgZm9yIHVybCwgcmVzcG9uc2UgaW4gX2dsb2JhbF9icm93c2VyLmNhY2hlLml0ZW1zKCk6CiAgICAgICAgd2l0aCB0ZW1wZmlsZS5OYW1l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F5a65CiAgICB0YWIoJ2h0dHA6Ly9zZWNzYXkuY29tJykucGFnZS5odG1sLnNlYXJjaCgnPHRpdGxlPnt9PC90aXRsZT4nKQogICAgCiAgICAjIOafpeeci+W9k+WJjeaJk+W8gOeahOaJgOacieagh+etvumhtQogICAgcHJpbnQodGFicykKICAgIAogICAgIyDkvb/nlKjlhajlsYAgYnJvd3NlciDlrp7kvovliJvlu7rmoIfnrb7pobUKICAgIGJyb3dzZXIudGFiKCdodHRwOi8vZXhhbXBsZS5jb20nKQogICAgYGBgCgoxLiDliJvlu7rmtY/op4jlmajlrp7kvosKICAgIGBgYAogICAgYnJvd3NlciA9IEJyb3dzZXIoY2FjaGVfc2l6ZT01KQogICAgYGBgCiAgICDov5nph4zliJvlu7rkuobkuIDkuKrmtY/op4jlmajlrp7kvovvvIzorr7nva7kuobnvJPlrZjlpKflsI/kuLogNeOAggoKMi4g5Yib5bu65LiA5Liq5paw55qEIHRhYiDlubbor7fmsYIgVVJMCiAgICBgYGAKICAgIHRhYjEgPSBicm93c2VyLnRhYigiaHR0cDovL3NlY3NheS5jb20iKQogICAgcmVzID0gdGFiMS5wYWdlCiAgICByZXMuY29udGVudD4+cHJpbnQKICAgIGBgYAogICAg6L+Z6YeM5Yib5bu65LqG5LiA5Liq5paw55qEIHRhYu+8jOW5tuivt+axguS6hiBVUkwgImh0dHA6Ly9zZWNzYXkuY29tIuOAgueEtuWQju+8jOaJk+WNsOS6huWTjeW6lOeahOWGheWuueOAggoKMy4g5Yi35pawIHRhYgogICAgYGBgCiAgICByZXNwb25zZTIgPSB0YWIxLnJlZnJlc2goKQogICAgcHJpbnQoIlJlZnJlc2hlZCByZXNwb25zZToiLCByZXNwb25zZTIpCiAgICBgYGAKICAgIOi/memHjOWIt+aWsOS6hiB0YWIx77yM5bm25omT5Y2w5LqG5Yi35paw5ZCO55qE5ZON5bqU5YaF5a6544CCCgo0LiDmiZPlvIDlj6bkuIDkuKogdGFiCiAgICBgYGAKICAgIHRhYjIgP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NDQ6MzYuNTA0ODE5IDog5Li6aHR0cDovL3NlY3NheS5jb23lronmjpLlrprmnJ/liLfmlrAKICAgIGBgYAogICAg6L+Z5Lqb5pel5b+X5L+h5oGv5pi+56S65LqG5rWP6KeI5Zmo5qih5Z2X5Zyo5ZCO5Y+w5aSE55CG6K+35rGC5ZKM5Yi35paw5Lu75Yqh55qE6L+H56iL44CCCiIiIgoKY2xhc3MgRG90RGljdChkaWN0KToKICAgIGRlZiBfX2dldGF0dHJfXyhzZWxmLCBrZXkpOgogICAgICAgIHRyeToKICAgICAgICAgICAgcmV0dXJuIHNlbGZba2V5XQogICAgICAgIGV4Y2VwdCBLZXlFcnJvcjoKICAgICAgICAgICAgcmFpc2UgQXR0cmlidXRlRXJyb3Ioa2V5KQogICAgCiAgICBkZWYgX19zZXRhdHRyX18oc2VsZiwga2V5LCB2YWx1ZSk6CiAgICAgICAgc2VsZltrZXldID0gdmFsdWUKCmNsYXNzIEJyb3dzZXIoU3RyZWFtKToKICAgICIiIua1j+iniOWZqOa1geWvueixoe+8jOWGhee9rue8k+WtmOWKn+iDveOAggoKICAgIOe8k+WtmOaYr+S4gOS4quWtl+WFuOWvueixoe+8jGtleSDmmK8gdXJs77yMdmFsdWUg5pivIHJlc3BvbnNlIOWvueixoeOAggogICAgIiIiCgogICAgZGVmIF9faW5pdF9fKHNlbGYsIGNhY2hlX3NpemU9MzAsICoqa3dhcmdzKToKICAgICAgICAiIiIKICAgICAgICDliJ3lp4vljJbmtY/op4jlmajlr7nosaHvvIznlKjkuo7nrqHnkIblpJrkuKp0YWLnmoTmtY/op4jlkoznvJPlrZjjgIIKCiAgICAgICAg5L6L5a2Q77yaYnJvd3Nlci50YWIoImh0dHA6Ly9iYWlkdS5jb20iKS5wYWdlPj5wcmludAoKICAgICAgICDlj4LmlbA6CiAgICAgICAgICAgIGNhY2hlX3NpemU6IOe8k+WtmOWkp+Wwj++8jOWNs+acgOWkmuS/neWtmOeahOWTjeW6lOWvueixoeaVsOmHj++8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DopoHor7fmsYLnmoQgVVJMCiAgICAgICAgICAgIHJlZnJlc2hfaW50ZXJ2YWw6IOWumuaXtuWIt+aWsOaXtumXtO+8jOWNleS9jeS4uuenku+8jOm7mOiupOS4ujDvvIzkuI3miafooYzlrprml7bliLfmlrDku7vliqEKCiAgICAgICAg6L+U5ZueOgogICAgICAgICAgICBUYWIg5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgIyDmo4Dmn6XmmK/lkKblt7LlrZjlnKjnm7jlkIznmoQgdGFiCiAgICAgICAgZm9yIGV4aXN0aW5nX3RhYiBpbiBzZWxmLnRhYnM6CiAgICAgICAgICAgIGlmIHN0cihleGlzdGluZ190YWIpID09IHVybDoKICAgICAgICAgICAgICAgIGV4aXN0aW5nX3RhYi5yZWZyZXNoX2ludGVydmFsID0gcmVmcmVzaF9pbnRlcnZhbCAgIyDmm7TmlrDlt7LlrZjlnKjnmoQgdGFiIOeahOWIt+aWsOmXtOmalAogICAgICAgICAgICAgICAgcmV0dXJuIGV4aXN0aW5nX3RhYiAgIyDov5Tlm57lt7LlrZjlnKjnmoQgdGFiCiAgICAgICAgbmV3X3RhYiA9IFRhYihzZWxmLCB1cmwsIHJlZnJlc2hfaW50ZXJ2YWwpCiAgICAgICAgc2VsZi50YWJzLmFkZChuZXdfdGFiKSAgIyDmt7vliqDmlrAgdGFiIOWIsCBzZXQKICAgICAgICAKICAgICAgICByZXR1cm4gbmV3X3RhYgoKICAgIGRlZiBlbWl0KHNlbGYsIHgsIGFzeW5jaHJvbm91cz1GYWxzZSk6CiAgICAgICAgcmV0dXJuIHNlbGYudGFiKHgpCiAgICAKICAgIGRlZiBfYWRkX3RvX2NhY2hlKHNlbGYsIHBhZ2UpOgogICAgICAgICIiIuWwhuWTjeW6lOa3u+WKoOWIsOe8k+WtmOS4reOAggoKICAgICAgICDlj4LmlbA6CiAgICAgICAgICAgIHVybDog6K+35rGC55qEIFVSTAogICAgICAgICAgICByZXNwb25zZTog5ZON5bqU5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgaWYgbGVuKHNlbGYuY2FjaGUpID49IHNlbGYuY2FjaGVfc2l6ZToKICAgICAgICAgICAgIyDnp7vpmaTmnIDml6nnmoTnvJPlrZjpobkKICAgICAgICAgICAgc2VsZi5jYWNoZS5wb3AobmV4dChpdGVyKHNlbGYuY2FjaGUpKSkKICAgICAgICBzZWxmLmNhY2hlW3BhZ2UudXJsXSA9IHBhZ2UKCiAgICBkZWYgX19yZXByX18oc2VsZik6CiAgICAgICAgcmV0dXJuIGYiQnJvd3NlcihjYWNoZV9zaXplPXtzZWxmLmNhY2hlX3NpemV9LCB0YWJzPXtsZW4oc2VsZi50YWJzKX0pIgoKICAgIGRlZiBleHRyYWN0X3RleHRfZnJvbV9odG1sKHNlbGYsIGh0bWxfY29udGVudCk6CiAgICAgICAgIiIi5L2/55SoIGJvaWxlcnB5MyDku44gSFRNTCDlhoXlrrnkuK3mj5Dlj5bmlrDpl7vmraPmlofjgIIKCiAgICAgICAg5Y+C5pWwOgogICAgICAgICAgICBodG1sX2NvbnRlbnQ6IEhUTUwg5YaF5a655a2X56ym5LiyCgogICAgICAgIOi/lOWbnjoKICAgICAgICAgICAgc3RyOiDmj5Dlj5bnmoTmlrDpl7vmraPmlofmlofmnKwKICAgICAgICAiIiIKICAgICAgICBmcm9tIGJvaWxlcnB5MyBpbXBvcnQgZXh0cmFjdG9ycwogICAgICAgIGV4dHJhY3RvciA9IGV4dHJhY3RvcnMuQXJ0aWNsZUV4dHJhY3RvcigpCiAgICAgICAgdHJ5OgogICAgICAgICAgICB0ZXh0ID0gZXh0cmFjdG9yLmdldF9jb250ZW50KGh0bWxfY29udGVudCkKICAgICAgICAgICAgcmV0dXJuIHRleHQKICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6CiAgICAgICAgICAgIHByaW50KGYi5o+Q5Y+W5paH5pys5pe25Ye66ZSZOiB7c3RyKGUpfSIpCiAgICAgICAgICAgIHJldHVybiAiIgogICAgICAgIAogIC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iAgICAgICAgICAgIHJldHVybgogICAgICAgICMg5aaC5p6c5bey57uP5a2Y5Zyo5Yi35paw5a6a5pe25Zmo77yM5YWI56e76ZmkCiAgICAgICAgaWYgaGFzYXR0cihzZWxmLCAnX3JlZnJlc2hfdGltZXInKToKICAgICAgICAgICAgc2VsZi5icm93c2VyLmxvb3AucmVtb3ZlX3RpbWVvdXQoc2VsZi5fcmVmcmVzaF90aW1lcikKICAgICAgICAjIOWIm+W7uuaWsOeahOWIt+aWsOWumuaXtuWZqAogICAgICAgIHNlbGYuX3JlZnJlc2hfdGltZXIgPSBzZWxmLmJyb3dzZXIubG9vcC5jYWxsX2xhdGVyKHNlbGYucmVmcmVzaF9pbnRlcnZhbCwgc2VsZi5fc2NoZWR1bGVfcmVxdWVzdCkKICAgICAgICBmJ+S4untzZWxmLnVybH3lronmjpLlrprmnJ/liLfmlrAnPj5zZWxmLmJyb3dzZXIubG9nCgogICAgQHByb3BlcnR5CiAgICBkZWYgc3luY19wYWdlKHNlbGYpOgogICAgICAgICIiIuiOt+WPliBVUkwg55qE5ZON5bqU5YaF5a6544CCCgogICAgICAgIOWmguaenOe8k+WtmOS4reWtmOWcqO+8jOWImeebtOaOpei/lOWbnue8k+WtmOWGheWuueOAggogICAgICAgIOWmguaenOe8k+WtmOS4reS4jeWtmOWcqO+8jOWImei/m+ihjOWQjOatpeivt+axguW5tue8k+WtmOe7k+aenOOAggoKICAgICAgICDov5Tlm546CiAgICAgICAgICAgIHJlc3BvbnNlOiDlk43lupTlr7nosaEKICAgICAgICAiIiIKICAgICAgICBpZiBzZWxmLl9wYWdlICE9IE5vbmU6CiAgICAgICAgICAgICfmtY/op4jlmajph4zmnInlt7Lnu4/miZPlvIDnmoQgdGFi77yM56uL5Y2z6L+U5Zue5YaF5a65JyA+PiBzZWxmLmJyb3dzZXIubG9nCiAgICAgICAgICAgIHJldHVybiBzZWxmLl9wYWdlICAKICAgICAgICBlbHNlOgogICAgICAgICAgICAn5rWP6KeI5Zmo6YeM5rKh5pyJ5oiQ5Yqf5a6M5YWo5omT5byA54q25oCB55qEIHRhYu+8jOeri+WNs+WQjOatpee9kee7nOivt+axgicgPj4gc2VsZi5icm93c2VyLmxvZwogICAgICAgICAgICBzZWxmLnVybD4+c2VsZi5icm93c2VyLmxvZwogICAgICAgICAgICByZXNwb25zZSA9IHN5bmMoc2VsZi5icm93c2VyLmxvb3AsIGxhbWJkYTogaHR0cHgoc2VsZi51cmwpKQogICAgICAgICAgICAn5ZCM5q2l6K+35rGC5a6M5oiQ77yM6L+U5Zue5YaF5a65JyA+PiBzZWxmLmJyb3dzZXIubG9nCiAgICAgICAgICAgIHJldHVybiBzZWxmLnBhcnNlKHJlc3BvbnNlKQogICAgICAgICAgICAKICAgIEBwcm9wZXJ0eQogICAgYXN5bmMgZGVmIHBhZ2Uoc2VsZik6CiAgICAgICAgIiIi6I635Y+WIFVSTCDnmoTlk43lupTlhoXlrrnjgIIKCiAgICAgICAg5aaC5p6c57yT5a2Y5Lit5a2Y5Zyo77yM5YiZ55u05o6l6L+U5Zue57yT5a2Y5YaF5a6544CCCiAgICAgICAg5aaC5p6c57yT5a2Y5Lit5LiN5a2Y5Zyo77yM5YiZ6L+b6KGM5ZCM5q2l6K+35rGC5bm257yT5a2Y57uT5p6c44CCCgogICAgICAgIOi/lOWbnjoKICAgICAgICAgICAgcmVzcG9uc2U6IOWTjeW6lOWvueixoQogICAgICAgICIiIgogICAgICAgIGlmIHNlbGYuX3BhZ2UgIT0gTm9uZToKICAgICAgICAgICAgJ+a1j+iniOWZqOmHjOacieW3sue7j+aJk+W8gOeahCB0YWLvvIznq4vljbPov5Tlm57lhoXlrrknID4+IHNlbGYuYnJvd3Nlci5sb2cKICAgICAgICAgICAgcmV0dXJuIHNlbGYuX3BhZ2UgIAogICAgICAgIGVsc2U6CiAgICAgICAgICAgICfmtY/op4jlmajph4zmsqHmnInmiJDlip/lrozlhajmiZPlvIDnirbmgIHnmoQgdGFi77yM56uL5Y2z5ZCM5q2l572R57uc6K+35rGCJyA+PiBzZWxmLmJyb3dzZXIubG9nCiAgICAgICAgICAgIHNlbGYudXJsPj5zZWxmLmJyb3dzZXIubG9nCiAgICAgICAgICAgIHJlc3BvbnNlID0gYXdhaXQgaHR0cHgoc2VsZi51cmwpCiAgICAgICAgICAgICflkIzmraXor7fmsYLlrozmiJDvvIzov5Tlm57lhoXlrrknID4+IHNlbGYuYnJvd3Nlci5sb2cKICAgICAgICAgICAgCiAgICAgICAgICAgICMg5bCGcGFyc2Xmk43kvZzmlL7lhaXnur/nqIvmsaDmiafooYwKICAgICAgICAgICAgbG9vcCA9IGFzeW5jaW8uZ2V0X2V2ZW50X2xvb3AoKQogICAgICAgICAgICBwYXJzZWRfcmVzcG9uc2UgPSBhd2FpdCBsb29wLnJ1bl9pbl9leGVjdXRvcihOb25lLCBzZWxmLnBhcnNlLCByZXNwb25zZSkKICAgICAgICAgICAgcmV0dXJuIHBhcnNlZF9yZXNwb25zZQogICAgICAgIAogICAgQHByb3BlcnR5CiAgICBhc3luYyBkZWYgYXJ0aWNsZShzZWxmKToKICAgICAgICAiIiLojrflj5YgVVJMIOeahOaWh+eroOWGheWuueOAggoKICAgICAgICDlpoLmnpznvJPlrZjkuK3lrZjlnKjvvIzliJnnm7TmjqXov5Tlm57nvJPlrZjnmoTmlofnq6Dlr7nosaHjgIIKICAgICAgICDlpoLmnpznvJPlrZjkuK3kuI3lrZjlnKjvvIzliJnlhYjojrflj5bpobXpnaLlhoXlrrnlubbop6PmnpDmlofnq6DjgIIKCiAgICAgICAg6L+U5ZueOgogICAgICAgICAgICBhcnRpY2xlOiBBcnRpY2xl5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgcGFnZSA9IGF3YWl0IHNlbGYucGFnZQogICAgICAgIHJldHVybiBwYWdlLmFydGljbGUKCiAgICBkZWYgcmVmcmVzaChzZWxmKToKICAgICAgICAiIiLmiYvliqjliLfmlrAgVVJMIOeahOWTjeW6lOWGheWuueOAggoKICAgICAgICDlv73nlaXnvJPlrZjlhoXlrrnvvIzph43mlrDlj5HotbflvILmraXor7fmsYLvvIzlubbkuJTkv53lrZjmlbDmja7liLDnvJPlrZjjgIIKCiAgICAgICAg6L+U5ZueOgogICAgICAgICAgICByZXNwb25zZTog5ZON5bqU5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgc2VsZi5fc2NoZWR1bGVfcmVxdWVzdCgpCiAgICAgICAgcmV0dXJuIHNlbGYKICAgIAogICAgZGVmIHBhcnNlKHNlbGYsIHJlc3BvbnNlKToKICAgICAgICAiIiIKICAgICAgICDlpITnkIbnvZHnu5zov5Tlm57nmoTmlbDmja7vvIznlJ/miJAgYXJ0aWNsZSDlr7nosaHlubblrZjlgqjliLDnvJPlrZjkuK3jgIIKCiAgICAgICAg6L+Z5Liq5pa55rOV5bCG5o6l5pS25Yiw55qE5ZON5bqU5a+56LGh6L2s5o2i5Li6IGFydGljbGUg5a+56LGh77yM5bm25bCG5YW25a2Y5YKo5Yiw5rWP6KeI5Zmo55qE57yT5a2Y5Lit77yM5Lul5L6/5ZCO57ut5L2/55So44CCCgogICAgICAgIOWPguaVsDoKICAgICAgICAgICAgcmVzcG9uc2UgKG9iamVjdCk6IOWTjeW6lOWvueixoe+8jOWMheWQq+S6huS7jue9kee7nOivt+axguS4reiOt+WPlueahOaVsOaNruOAggoKICAgICAgICDov5Tlm546CiAgICAgICAgICAgIHNlbGYuX3BhZ2UgKG9iamVjdCk6IOWMheWQq+S6huaWh+eroOWvueixoeeahOmhtemdouWvueixoe+8jOeUqOS6juWtmOWCqOWSjOiuv+mXruaWh+eroOaVsOaNruOAggogICAgICAgICIiIgogICAgICAgIAogICAgICAgICMg5qOA5p+l5ZON5bqU5a+56LGh5piv5ZCm5Li65q2j5bi455qEcmVzcG9uc2XnsbvlnosKICAgICAgICBpZiBub3QgaXNpbnN0YW5jZShyZXNwb25zZSwgSFRNTFJlc3BvbnNlKToKICAgICAgICAgICAgJ+mdnuato+W4uOeahOWTjeW6lOWvueixoScgPj4gc2VsZi5icm93c2VyLmxvZwogICAgICAgICAgICByZXR1cm4gTm9uZQogICAgICAgIAogICAgICAgICMg5bCG5ZON5bqU5a+56LGh5a2Y5YKo5Yiw5b2T5YmN6aG16Z2i5a+56LGh5LitCiAgICAgICAgc2VsZi5fcGFnZSA9IHJlc3BvbnNlCiAgICAgICAgIyDkvb/nlKjmtY/op4jlmajnmoTmlrnms5XliJvlu7rmlofnq6Dlr7nosaEKICAgICAgICBzZWxmLl9wYWdlLl9hcnRpY2xlID0gc2VsZi5icm93c2VyLmNyZWF0ZV9hcnRpY2xlKHJlc3BvbnNlKQogICAgICAgICMg5a6a5LmJ5paH56ug5a+56LGh55qE5bGe5oCn5YiX6KGoCiAgICAgICAgYXJ0aWNsZV9hdHRyaWJ1dGVzID0gWydrZXl3b3JkcycsICdtZXRhX2tleXdvcmRzJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICd0YWdzJywgJ2F1dGhvcnMnLCAncHVibGlzaF9kYXRlJywgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnc3VtbWFyeScsICd0ZXh0JywgJ2ltYWdlcycsICdtZXRhX2RhdGEnLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtZXRhX2Rlc2NyaXB0aW9uJywgJ3RpdGxlJ10KICAgICAgICAjIOS9v+eUqERvdERpY3TlsIbmlofnq6Dlr7nosaHnmoTlsZ7mgKfovazmjaLkuLrlrZflhbjlvaLlvI8KICAgICAgICBzZWxmLl9wYWdlLmFydGljbGUgPSBEb3REaWN0KHsKICAgICAgICAgICAgYXR0cjogZ2V0YXR0cihzZWxmLl9wYWdlLl9hcnRpY2xlLCBhdHRyKSAKICAgICAgICAgICAgZm9yIGF0dHIgaW4gYXJ0aWNsZV9hdHRyaWJ1dGVzfSkKICAgICAgICAKICAgICAgICAjIOWwhuino+aekOWlveeahOmhtemdouWPkeWIsOa1j+iniOWZqOmhtemdoua1geS4rQogICAgICAgIHNlbGYuYnJvd3Nlci5wYWdlX3N0cmVhbS5lbWl0KHNlbGYuX3BhZ2UpCiAgICAgICAgIyDov5Tlm57lvZPliY3pobXpnaLlr7nosaEKICAgICAgICByZXR1cm4gc2VsZi5fcGFnZQogICAgCiAgICBkZWYgX19zdHJfXyhzZWxmKToKICAgICAgICByZXR1cm4gc2VsZi51cmwgICMg6L+U5ZueIFVSTAoKICAgIGRlZiBfX3JlcHJfXyhzZWxmKToKICAgICAgICAiIiLov5Tlm54gVGFiIOWvueixoeeahOacieaEj+S5ieeahOihqOekuuW9ouW8j++8jOWMheWQqyBVUkwg5ZKM5pGY6KaB44CCIiIiCiAgICAgICAgcmV0dXJuIGYiVGFiKHVybD17c2VsZi51cmx9LCBzdW1tYXJ5PXtzZWxmLnBhZ2UuYXJ0aWNsZS50aXRsZX0pIgoKICAgIGRlZiBjbG9zZShzZWxmKToKICAgICAgICAiIiLlhbPpl60gdGFiIOWvueixoe+8jOWBnOatouWJjemdouiuvuWumueahOWumuacn+WIt+aWsO+8jOW5tuS7jua1j+iniOWZqOeahOWFqOWxgCB0YWJzIOS4reenu+mZpOivpeWvueixoe+8jOW5tumHiuaUvuWGheWtmOOAguWQjOaXtuS7jue8k+WtmOS4reWIoOmZpOaVsOaNruOAgiIiIgogICAgICAgICMg5aaC5p6c5a2Y5Zyo5Yi35paw5a6a5pe25Zmo77yM5YiZ56e76ZmkCiAgICAgICAgaWYgaGFzYXR0cihzZWxmLCAnX3JlZnJlc2hfdGltZXInKToKICAgICAgICAgICAgc2VsZi5icm93c2VyLmxvb3AucmVtb3ZlX3RpbWVvdXQoc2VsZi5fcmVmcmVzaF90aW1lcikKICAgICAgICAjIOS7jua1j+iniOWZqOeahOagh+etvumhteWIl+ihqOS4reenu+mZpOW9k+WJjeagh+etvumhtQogICAgICAgIHNlbGYuYnJvd3Nlci50YWJzLnJlbW92ZShzZWxmKQogICAgICAgICMg5LuO57yT5a2Y5Lit5Yig6Zmk5pWw5o2uCiAgICAgICAgaWYgc2VsZi51cmwga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AiY29udGVudF94cGF0aCI6ICLmraPmlofnmoR4cGF0aOi3r+W+hCIKfX0KIiIiCgogICAgIyDosIPnlKhPcGVuQUkgQVBJ6I635Y+W5YiG5p6Q57uT5p6cCiAgICByZXN1bHQgPSBvcGVuYWkuY2hhdC5jb21wbGV0aW9ucy5jcmVhdGUoCiAgICAgICAgbW9kZWw9ImdwdC0zLjUtdHVyYm8iLAogICAgICAgIG1lc3NhZ2VzPVt7InJvbGUiOiAidXNlciIsICJjb250ZW50IjogcHJvbXB0fV0KICAgICkuY2hvaWNlc1swXS5tZXNzYWdlLmNvbnRlbnQKCiAgICAjIOino+aekOi/lOWbnueahEpTT04KICAgIGltcG9ydCBqc29uCiAgICB4cGF0aF9pbmZvID0ganNvbi5sb2FkcyhyZXN1bHQpCiAgICAKICAgICMg5L2/55SoWFBhdGjmj5Dlj5blhoXlrrkKICAgIHRpdGxlID0gdGFiMS5wYWdlLmh0bWwueHBhdGgoeHBhdGhfaW5mb1sndGl0bGVfeHBhdGgnXSkuZmlyc3QudGV4dAogICAgY29udGVudCA9IHRhYjEucGFnZS5odG1sLnhwYXRoKHhwYXRoX2luZm9bJ2NvbnRlbnRfeHBhdGgnXSkuZmlyc3QudGV4dAoKICAgIGYn5qCH6aKYOiB7dGl0bGV9Jz4+cHJpbnQKICAgIGYn5q2j5paHOiB7Y29udGVudH0nPj5wcmludAoKICAgIHRhYignaHR0cDovL3NlY3NheS5jb20nKS5jbG9zZSgpCgogICAgRGV2YS5ydW4oKQojIC4uLiBleGlzdGluZyBjb2RlIC4uLgAAAAAAAAAAzUEAAAAAAAAAAAAA",
"AQAAAAAAAAABAAAASwAAAAAAAABLAAAAAAAAAAAAAAAAAPC/"
]
]
},
{
"file": "deva/page.py",
"settings":
{
"buffer_size": 17401,
"encoding": "UTF-8",
"line_ending": "Unix"
},
"undo_stack":
[
[
1,
1,
"revert",
null,
"AwAAAAAAAAAAAAAAAAAAAAAAAADFRgAAZnJvbSBjb2xsZWN0aW9ucyBpb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ihTdHJlYW1zQ29ubmVjdGlvbiwgc2VsZikuX19pbml0X18oKmFyZ3MsICoqa3dhcmdzKQoKICAgIGRlZiBvbl9vcGVuKHNlbGYsIHJlcXVlc3QpOgogICAgICAgICIiIuWkhOeQhui/nuaOpeaJk+W8gAoKICAgICAgICBBcmdzOgogICAgICAgICAgICByZXF1ZXN0OiBIVFRQ6K+35rGC5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgc2VsZi5vdXRfc3RyZWFtID0gU3RyZWFtKCkgICMgbmFtZT0nZGVmYXVsdCcpCiAgICAgICAgc2VsZi5jb25uZWN0aW9uID0gc2VsZi5vdXRfc3RyZWFtID4+IHNlbGYuX291dF9zdHJlYW0KICAgICAgICBqc29uLmR1bXBzKHsnaWQnOiAnZGVmYXVsdCcsICdodG1sJzogJ3dlbGNvbWUnfSkgPj4gc2VsZi5vdXRfc3RyZWFtCiAgICAgICAgc2VsZi5yZXF1ZXN0ID0gcmVxdWVzdAogICAgICAgIHNlbGYucmVxdWVzdC5pcCA9IG1heWJlKHNlbGYucmVxdWVzdC5oZWFkZXJzKVsKICAgICAgICAgICAgJ3gtZm9yd2FyZC1mb3InXS5vcl9lbHNlKHNlbGYucmVxdWVzdC5pcCkKCiAgICAgICAgZidvcGVuOntzZWxmLnJlcXVlc3QuaXB9OntkYXRldGltZS5kYXRldGltZS5ub3coKX0nID4+IGxvZwoKICAgIEBnZW4uY29yb3V0aW5lCiAgICBkZWYgb25fbWVzc2FnZShzZWxmLCBtc2cpOgogICAgICAgICIiIuWkhOeQhuaUtuWIsOeahOa2iOaBrwoKICAgICAgICBBcmdzOgogICAgICAgICAgICBtc2cgKHN0cik6IOaUtuWIsOeahOa2iOaBrwogICAgICAgICIiIgogICAgICAgIGpzb24ubG9hZHMobXNnKSA+PiBzZWxmLl9pbl9zdHJlYW0KCiAgICBkZWYgcHJvY2Vzc19tc2coc2VsZiwgbXNnKToKICAgICAgICAiIiLlpITnkIbmtojmga8KCiAgICAgICAgQXJnczoKICAgICAgICAgICAgbXNnIChkaWN0KTog5raI5oGv5YaF5a65CiAgICAgICAgIiIiCiAgICAgICAgc3RyZWFtX2lkcyA9IG1zZ1snc3RyZWFtX2lkcyddCgogICAgICAgICd2aWV3OiVzOiVzOiVzJyAlIChzdHJlYW1faWRzLCBzZWxmLnJlcXVlc3QuaXAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGV0aW1lLmRhdGV0aW1lLm5vdygpKSA+PiBsb2cKICAgICAgICAjIGdlbi5zbGVlcCgxMCkjI+WPquaciei/memHjOeahOaTjeS9nOmDveexu+S8vGdlbnNsZWVw5LiA5qC35piv5byC5q2l5pON5L2c5pe2LAogICAgICAgICMg5pW05Liq6K+35rGC5omN6IO95byC5q2lLOafkOS4queUqOaIt+i2heaXtuaJjeS4jeS8muW9seWTjeWIq+eahOeUqOaItyzlkKbliJnkuIDkuKrnlKjmiLflvbHlk43lhbbku5bnlKjmiLcKICAgICAgICAjIGlv55qE5Lic6KW/6LWw5byC5q2lLOWFtuS9meeahOWHveaVsOWmguaenOaYr2NwdeiuoeeulyzkuI3opoHotbDlvILmraUKCiAgICAgICAgc2VsZi5vdXRfc3RyZWFtcyA9IFtzdHJlYW0gZm9yIHN0cmVhbSBpbiBTdHJlYW0uaW5zdGFuY2VzKCkgaWYKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cihoYXNoKHN0cmVhbSkpIGluIHN0cmVhbV9pZHNdCgogICAgICAgIGRlZiBfKHNpZCk6CiAgICAgICAgICAgIHJldHVybiBsYW1iZGEgeDoganNvbi5kdW1wcyh7J2lkJzogc2lkLCAnaHRtbCc6IHh9KQoKICAgICAgICBzZWxmLmNvbm5lY3Rpb25zID0gc2V0KCkKICAgICAgICBmb3IgcyBpbiBzZWxmLm91dF9zdHJlYW1zOgogICAgICAgICAgICBzaWQgPSBzdHIoaGFzaChzKSkKICAgICAgICAgICAgZiA9IF8oc2lkKQogICAgICAgICAgICBzZWxmLmNvbm5lY3Rpb25zLmFkZChzLm1hcChyZXByKS5tYXAoZikgPj4gc2VsZi5fb3V0X3N0cmVhbSkKCiAgICAgICAgICAgIGh0bWwgPSBtYXliZShzKS5yZWNlbnQoMSlbMF0ub3JfZWxzZSgn5rWB5YaF5pqC5peg5pWw5o2uJykKICAgICAgICAgICAgIyBodG1sID0gJ+etieW+heaVsOaNruWKoOi9veOAguOAguOAguOAgicKICAgICAgICAgICAganNvbi5kdW1wcyh7J2lkJzogc2lkLCAnaHRtbCc6IGh0bWx9KSA+PiBzZWxmLl9vdXRfc3RyZWFtCgogICAgZGVmIG9uX2Nsb3NlKHNlbGYpOgogICAgICAgICIiIuWkhOeQhui/nuaOpeWFs+mXrSIiIgogICAgICAgIGYnY2xvc2U6e3NlbGYucmVxdWVzdC5pcH06e2RhdGV0aW1lLmRhdGV0aW1lLm5vdygpfScgPj4gbG9nCiAgICAgICAgZm9yIGNvbm5lY3Rpb24gaW4gc2VsZi5jb25uZWN0aW9uczoKICAgICAgICAgICAgY29ubmVjdGlvbi5kZXN0cm95KCkKCiAgICAgICAgc2VsZi5jb25uZWN0aW9ucyA9IHNldCgpCiAgICAgICAgc2VsZi5jb25uZWN0aW9uLmRlc3Ryb3koKQogICAgICAgIHNlbGYubGluazEuZGVzdHJveSgpCiAgICAgICAgc2VsZi5saW5rMi5kZXN0cm95KCkKICAgICAgICBzZWxmLm91dF9zdHJlYW0uZGVzdHJveSgpCgoKY2xhc3MgUGFnZVNlcnZlcihvYmplY3QpOgogICAgIiIi6aG16Z2i5pyN5Yqh5Zmo57G7LOeUqOS6juWQr+WKqOWSjOeuoeeQhldlYuacjeWKoeWZqAoKICAgIOS4u+imgeWKn+iDvToKICAgIC0g5ZCv5YqoVG9ybmFkbyBXZWLmnI3liqHlmagKICAgIC0g566h55CG6aG16Z2i6Lev55SxCiAgICAtIOWkhOeQhldlYlNvY2tldOi/nuaOpQogICAgLSDnrqHnkIbmlbDmja7mtYEKCiAgICDlj4LmlbA6CiAgICAgICAgbmFtZSAoc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ubbnlJ/miJBIVE1M5YiX6KGoCiAgICAgICAgCiAgICAjICAgICDlsIbmlbDmja7lupPkuK3nmoTmiYDmnInooajlkI3ovazmjaLkuLpIVE1M6ZO+5o6l5YiX6KGoLOavj+S4qumTvuaOpeaMh+WQkeWvueW6lOihqOeahOivpuaDhemhteOAggogICAgIyAgICAg6ZO+5o6l5paH5pys5Li66KGo5ZCNLOmTvuaOpeWcsOWdgOS9v+eUqOihqOWQjeS9nOS4uuagh+ivhuOAggogICAgICAgIAogICAgIyAgICAgUmV0dXJuczoKICAgICMgICAgICAgICBzdHI6IOWMheWQq+aJgOacieaVsOaNruihqOmTvuaOpeeahEhUTUzliJfooagKICAgICMgICAgICIiIgogICAgIyAgICAgZGF0YSA9IE5CKCdkZWZhdWx0JykudGFibGVzID4+IHBtYXAobGFtYmRhIHg6IGYnPGxpPjxhIGNsYXNzPSJTdHJlYW0iIGhyZWY9InRhYmxlL3t4fSI+e3h9PC9hPjwvbGk+JykgPj4gY29uY2F0KCcnKQogICAgIyAgICAgc2VsZi53cml0ZShkYXRhKQogICAgCgogICAgQHBhZ2Uucm91dGUoJy9zJykKICAgIGRlZiBteV9sb2coKToKICAgICAgICByZXR1cm4gJ2hlbGxvIHdvcmxkJwoKICAgIAogICAgbG9nLndlYnZpZXcoJy9sb2cnKQoKICAgIERldmEucnVuKCkKAAAAAAAAAAA9QAAAAAAAAAAAAAAAAAAAAAAAAD1AAAAAAAAAAAAAAA",
"AgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L8"
],
[
1,
1,
"revert",
null,
"AgAAAAAAAAAAAAAAAAAAAAAAAADFRgAAZnJvbSBjb2xsZWN0aW9ucyBpbXBvcnQgZGVmYXVsdGRpY3QKIiIiCumhtemdouinhuWbvuaooeWdlwp+fn5+fn5+fn4KCuacrOaooeWdl+aPkOS+m+S6hldlYumhtemdouinhuWbvuebuOWFs+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ICAgICAgICIiIuWkhOeQhui/nuaOpeaJk+W8gAoKICAgICAgICBBcmdzOgogICAgICAgICAgICByZXF1ZXN0OiBIVFRQ6K+35rGC5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgc2VsZi5vdXRfc3RyZWFtID0gU3RyZWFtKCkgICMgbmFtZT0nZGVmYXVsdCcpCiAgICAgICAgc2VsZi5jb25uZWN0aW9uID0gc2VsZi5vdXRfc3RyZWFtID4+IHNlbGYuX291dF9zdHJlYW0KICAgICAgICBqc29uLmR1bXBzKHsnaWQnOiAnZGVmYXVsdCcsICdodG1sJzogJ3dlbGNvbWUnfSkgPj4gc2VsZi5vdXRfc3RyZWFtCiAgICAgICAgc2VsZi5yZXF1ZXN0ID0gcmVxdWVzdAogICAgICAgIHNlbGYucmVxdWVzdC5pcCA9IG1heWJlKHNlbGYucmVxdWVzdC5oZWFkZXJzKVsKICAgICAgICAgICAgJ3gtZm9yd2FyZC1mb3InXS5vcl9lbHNlKHNlbGYucmVxdWVzdC5pcCkKCiAgICAgICAgZidvcGVuOntzZWxmLnJlcXVlc3QuaXB9OntkYXRldGltZS5kYXRldGltZS5ub3coKX0nID4+IGxvZwoKICAgIEBnZW4uY29yb3V0aW5lCiAgICBkZWYgb25fbWVzc2FnZShzZWxmLCBtc2cpOgogICAgICAgICIiIuWkhOeQhuaUtuWIsOeahOa2iOaBrwoKICAgICAgICBBcmdzOgogICAgICAgICAgICBtc2cgKHN0cik6IOaUtuWIsOeahOa2iOaBrwogICAgICAgICIiIgogICAgICAgIGpzb24ubG9hZHMobXNnKSA+PiBzZWxmLl9pbl9zdHJlYW0KCiAgICBkZWYgcHJvY2Vzc19tc2coc2VsZiwgbXNnKToKICAgICAgICAiIiLlpITnkIbmtojmga8KCiAgICAgICAgQXJnczoKICAgICAgICAgICAgbXNnIChkaWN0KTog5raI5oGv5YaF5a65CiAgICAgICAgIiIiCiAgICAgICAgc3RyZWFtX2lkcyA9IG1zZ1snc3RyZWFtX2lkcyddCgogICAgICAgICd2aWV3OiVzOiVzOiVzJyAlIChzdHJlYW1faWRzLCBzZWxmLnJlcXVlc3QuaXAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGV0aW1lLmRhdGV0aW1lLm5vdygpKSA+PiBsb2cKICAgICAgICAjIGdlbi5zbGVlcCgxMCkjI+WPquaciei/memHjOeahOaTjeS9nOmDveexu+S8vGdlbnNsZWVw5LiA5qC35piv5byC5q2l5pON5L2c5pe2LAogICAgICAgICMg5pW05Liq6K+35rGC5omN6IO95byC5q2lLOafkOS4queUqOaIt+i2heaXtuaJjeS4jeS8muW9seWTjeWIq+eahOeUqOaItyzlkKbliJnkuIDkuKrnlKjmiLflvbHlk43lhbbku5bnlKjmiLcKICAgICAgICAjIGlv55qE5Lic6KW/6LWw5byC5q2lLOWFtuS9meeahOWHveaVsOWmguaenOaYr2NwdeiuoeeulyzkuI3opoHotbDlvILmraUKCiAgICAgICAgc2VsZi5vdXRfc3RyZWFtcyA9IFtzdHJlYW0gZm9yIHN0cmVhbSBpbiBTdHJlYW0uaW5zdGFuY2VzKCkgaWYKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cihoYXNoKHN0cmVhbSkpIGluIHN0cmVhbV9pZHNdCgogICAgICAgIGRlZiBfKHNpZCk6CiAgICAgICAgICAgIHJldHVybiBsYW1iZGEgeDoganNvbi5kdW1wcyh7J2lkJzogc2lkLCAnaHRtbCc6IHh9KQoKICAgICAgICBzZWxmLmNvbm5lY3Rpb25zID0gc2V0KCkKICAgICAgICBmb3IgcyBpbiBzZWxmLm91dF9zdHJlYW1zOgogICAgICAgICAgICBzaWQgPSBzdHIoaGFzaChzKSkKICAgICAgICAgICAgZiA9IF8oc2lkKQogICAgICAgICAgICBzZWxmLmNvbm5lY3Rpb25zLmFkZChzLm1hcChyZXByKS5tYXAoZikgPj4gc2VsZi5fb3V0X3N0cmVhbSkKCiAgICAgICAgICAgIGh0bWwgPSBtYXliZShzKS5yZWNlbnQoMSlbMF0ub3JfZWxzZSgn5rWB5YaF5pqC5peg5pWw5o2uJykKICAgICAgICAgICAgIyBodG1sID0gJ+etieW+heaVsOaNruWKoOi9veOAguOAguOAguOAgicKICAgICAgICAgICAganNvbi5kdW1wcyh7J2lkJzogc2lkLCAnaHRtbCc6IGh0bWx9KSA+PiBzZWxmLl9vdXRfc3RyZWFtCgogICAgZGVmIG9uX2Nsb3NlKHNlbGYpOgogICAgICAgICIiIuWkhOeQhui/nuaOpeWFs+mXrSIiIgogICAgICAgIGYnY2xvc2U6e3NlbGYucmVxdWVzdC5pcH06e2RhdGV0aW1lLmRhdGV0aW1lLm5vdygpfScgPj4gbG9nCiAgICAgICAgZm9yIGNvbm5lY3Rpb24gaW4gc2VsZi5jb25uZWN0aW9uczoKICAgICAgICAgICAgY29ubmVjdGlvbi5kZXN0cm95KCkKCiAgICAgICAgc2VsZi5jb25uZWN0aW9ucyA9IHNldCgpCiAgICAgICAgc2VsZi5jb25uZWN0aW9uLmRlc3Ryb3koKQogICAgICAgIHNlbGYubGluazEuZGVzdHJveSgpCiAgICAgICAgc2VsZi5saW5rMi5kZXN0cm95KCkKICAgICAgICBzZWxmLm91dF9zdHJlYW0uZGVzdHJveSgpCgoKY2xhc3MgUGFnZVNlcnZlcihvYmplY3QpOgogICAgIiIi6aG16Z2i5pyN5Yqh5Zmo57G7LOeUqOS6juWQr+WKqOWSjOeuoeeQhldlYuacjeWKoeWZqAoKICAgIOS4u+imgeWKn+iDvToKICAgIC0g5ZCv5YqoVG9ybmFkbyBXZWLmnI3liqHlmagKICAgIC0g566h55CG6aG16Z2i6Lev55SxCiAgICAtIOWkhOeQhldlYlNvY2tldOi/nuaOpQogICAgLSDnrqHnkIbmlbDmja7mtYEKCiAgICDlj4LmlbA6CiAgICAgICAgbmFtZSAoc3RyKTog5pyN5Yqh5Zmo5ZCN56ewLOm7mOiupOS4uidkZWZhdWx0JwogICAgICAgIGhvc3QgKHN0cik6IOebkeWQrOeahOS4u+acuuWcsOWdgCzpu5jorq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XJncyBhbmQgaW5zcGVjdGVkLmFyZ3NbMF0gaW4gWydzZWxmJywgJ2hhbmRsZXInXQogICAgICAgICAgICAKICAgICAgICAgICAgaWYgbm90IHNlbGZfaW5fYXJnczoKICAgICAgICAgICAgICAgIGRlZiB3cmFwcGVyKHNlbGYsICphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gZm4oKmFyZ3MsICoqa3dhcmdzKQogICAgICAgICAgICAgICAgICAgIGlmIGlzaW5zdGFuY2UocmVzdWx0LCBTdHJlYW0pOgogICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSByZW5kZXJfdGVtcGxhdGUoJy4vdGVtcGxhdGVzL3N0cmVhbXMuaHRtbCcsIHN0cmVhbXM9W3Jlc3VsdF0pCiAgICAgICAgICAgICAgICAgICAgaWYgaXNpbnN0YW5jZShyZXN1bHQsIFRlbXBsYXRlUHJveHkpOgogICAgICAgICAgICAgICAgICAgICAgICBpZiBzZWxmLl90ZW1wbGF0ZV9lbmdpbmUgPT0gJ3Rvcm5hZG8nOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5yZW5kZXIoKnJlc3VsdC5hcmdzLCAqKnJlc3VsdC5rd2FyZ3MpCiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZSA9IHNlbGYuX3RlbXBsYXRlX2Vudi5nZXRfdGVtcGxhdGUocmVzdWx0LmFyZ3NbMF0pCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmZpbmlzaCh0ZW1wbGF0ZS5yZW5kZXIoaGFuZGxlcj1zZWxmLCAqKnJlc3VsdC5rd2FyZ3MpKQogICAgICAgICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuZmluaXNoKHJlc3VsdCkKICAgICAgICAgICAgICAgIG1bbWV0aG9kLmxvd2VyKCldID0gd3JhcHB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X6KGoLOavj+S4qumTvuaOpeaMh+WQkeWvueW6lOihqOeahOivpuaDhemhteOAggogICAgIyAgICAg6ZO+5o6l5paH5pys5Li66KGo5ZCNLOmTvuaOpeWcsOWdgOS9v+eUqOihqOWQjeS9nOS4uuagh+ivhuOAggogICAgICAgIAogICAgIyAgICAgUmV0dXJuczoKICAgICMgICAgICAgICBzdHI6IOWMheWQq+aJgOacieaVsOaNruihqOmTvuaOpeeahEhUTUzliJfooagKICAgICMgICAgICIiIgogICAgIyAgICAgZGF0YSA9IE5CKCdkZWZhdWx0JykudGFibGVzID4+IHBtYXAobGFtYmRhIHg6IGYnPGxpPjxhIGNsYXNzPSJTdHJlYW0iIGhyZWY9InRhYmxlL3t4fSI+e3h9PC9hPjwvbGk+JykgPj4gY29uY2F0KCcnKQogICAgIyAgICAgc2VsZi53cml0ZShkYXRhKQogICAgCgogICAgQHBhZ2Uucm91dGUoJy9zJykKICAgIGRlZiBteV9sb2coKToKICAgICAgICByZXR1cm4gJ2hlbGxvIHdvcmxkJwoKICAgIAogICAgbG9nLndlYnZpZXcoJy9sb2cnKQoKICAgIERldmEucnVuKCkKAAAAAAAAAACKPgAAAAAAAAAAAAA",
"AQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/"
],
[
2,
1,
"revert",
null,
"AgAAAAAAAAAAAAAAAAAAAAAAAAB8RAAAZnJvbSBjb2xsZWN0aW9ucyBpbXBvcnQgZGVmYXVsdGRpY3QKIiIiCumhtemdouinhuWbvuaooeWdlwp+fn5+fn5+fn4KCuacrOaooeWdl+aPkOS+m+S6hldlYumhtemdouinhuWbvuebuOWFs+eahOWKn+iDvSzljIXmi6w6CgotIOmhtemdoui3r+eUseWSjOa4suafkwotIOaVsOaNrua1geeahFdlYuWPr+inhuWMlgotIFdlYlNvY2tldOWunuaXtuabtOaWsAotIOmhtemdouacjeWKoeWZqOeuoeeQhgoK5Li76KaB57uE5Lu2OgotIHBhZ2U6IOWFqOWxgFBhZ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iAgICAgICAgc2VsZi5jb25uZWN0aW9uID0gc2VsZi5vdXRfc3RyZWFtID4+IHNlbGYuX291dF9zdHJlYW0KICAgICAgICBqc29uLmR1bXBzKHsnaWQnOiAnZGVmYXVsdCcsICdodG1sJzogJ3dlbGNvbWUnfSkgPj4gc2VsZi5vdXRfc3RyZWFtCiAgICAgICAgc2VsZi5yZXF1ZXN0ID0gcmVxdWVzdAogICAgICAgIHNlbGYucmVxdWVzdC5pcCA9IG1heWJlKHNlbGYucmVxdWVzdC5oZWFkZXJzKVsKICAgICAgICAgICAgJ3gtZm9yd2FyZC1mb3InXS5vcl9lbHNlKHNlbGYucmVxdWVzdC5pcCkKCiAgICAgICAgZidvcGVuOntzZWxmLnJlcXVlc3QuaXB9OntkYXRldGltZS5kYXRldGltZS5ub3coKX0nID4+IGxvZwoKICAgIEBnZW4uY29yb3V0aW5lCiAgICBkZWYgb25fbWVzc2FnZShzZWxmLCBtc2cpOgogICAgICAgICIiIuWkhOeQhuaUtuWIsOeahOa2iOaBrwoKICAgICAgICBBcmdzOgogICAgICAgICAgICBtc2cgKHN0cik6IOaUtuWIsOeahOa2iOaBrwogICAgICAgICIiIgogICAgICAgIGpzb24ubG9hZHMobXNnKSA+PiBzZWxmLl9pbl9zdHJlYW0KCiAgICBkZWYgcHJvY2Vzc19tc2coc2VsZiwgbXNnKToKICAgICAgICAiIiLlpITnkIbmtojmga8KCiAgICAgICAgQXJnczoKICAgICAgICAgICAgbXNnIChkaWN0KTog5raI5oGv5YaF5a65CiAgICAgICAgIiIiCiAgICAgICAgc3RyZWFtX2lkcyA9IG1zZ1snc3RyZWFtX2lkcyddCgogICAgICAgICd2aWV3OiVzOiVzOiVzJyAlIChzdHJlYW1faWRzLCBzZWxmLnJlcXVlc3QuaXAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGV0aW1lLmRhdGV0aW1lLm5vdygpKSA+PiBsb2cKICAgICAgICAjIGdlbi5zbGVlcCgxMCkjI+WPquaciei/memHjOeahOaTjeS9nOmDveexu+S8vGdlbnNsZWVw5LiA5qC35piv5byC5q2l5pON5L2c5pe2LAogICAgICAgICMg5pW05Liq6K+35rGC5omN6IO95byC5q2lLOafkOS4queUqOaIt+i2heaXtuaJjeS4jeS8muW9seWTjeWIq+eahOeUqOaItyzlkKbliJnkuIDkuKrnlKjmiLflvbHlk43lhbbku5bnlKjmiLcKICAgICAgICAjIGlv55qE5Lic6KW/6LWw5byC5q2lLOWFtuS9meeahOWHveaVsOWmguaenOaYr2NwdeiuoeeulyzkuI3opoHotbDlvILmraUKCiAgICAgICAgc2VsZi5vdXRfc3RyZWFtcyA9IFtzdHJlYW0gZm9yIHN0cmVhbSBpbiBTdHJlYW0uaW5zdGFuY2VzKCkgaWYKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cihoYXNoKHN0cmVhbSkpIGluIHN0cmVhbV9pZHNdCgogICAgICAgIGRlZiBfKHNpZCk6CiAgICAgICAgICAgIHJldHVybiBsYW1iZGEgeDoganNvbi5kdW1wcyh7J2lkJzogc2lkLCAnaHRtbCc6IHh9KQoKICAgICAgICBzZWxmLmNvbm5lY3Rpb25zID0gc2V0KCkKICAgICAgICBmb3IgcyBpbiBzZWxmLm91dF9zdHJlYW1zOgogICAgICAgICAgICBzaWQgPSBzdHIoaGFzaChzKSkKICAgICAgICAgICAgZiA9IF8oc2lkKQogICAgICAgICAgICBzZWxmLmNvbm5lY3Rpb25zLmFkZChzLm1hcChyZXByKS5tYXAoZikgPj4gc2VsZi5fb3V0X3N0cmVhbSkKCiAgICAgICAgICAgIGh0bWwgPSBtYXliZShzKS5yZWNlbnQoMSlbMF0ub3JfZWxzZSgn5rWB5YaF5pqC5peg5pWw5o2uJykKICAgICAgICAgICAgIyBodG1sID0gJ+etieW+heaVsOaNruWKoOi9veOAguOAguOAguOAgicKICAgICAgICAgICAganNvbi5kdW1wcyh7J2lkJzogc2lkLCAnaHRtbCc6IGh0bWx9KSA+PiBzZWxmLl9vdXRfc3RyZWFt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ICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gZm4oKmFyZ3MsICoqa3dhcmdzKQogICAgICAgICAgICAgICAgICAgIGlmIGlzaW5zdGFuY2UocmVzdWx0LCBTdHJlYW0pOgogICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSByZW5kZXJfdGVtcGxhdGUoJy4vdGVtcGxhdGVzL3N0cmVhbXMuaHRtbCcsIHN0cmVhbXM9W3Jlc3VsdF0pCiAgICAgICAgICAgICAgICAgICAgaWYgaXNpbnN0YW5jZShyZXN1bHQsIFRlbXBsYXRlUHJveHkpOgogICAgICAgICAgICAgICAgICAgICAgICBpZiBzZWxmLl90ZW1wbGF0ZV9lbmdpbmUgPT0gJ3Rvcm5hZG8nOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5yZW5kZXIoKnJlc3VsdC5hcmdzLCAqKnJlc3VsdC5rd2FyZ3MpCiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZSA9IHNlbGYuX3RlbXBsYXRlX2Vudi5nZXRfdGVtcGxhdGUocmVzdWx0LmFyZ3NbMF0pCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmZpbmlzaCh0ZW1wbGF0ZS5yZW5kZXIoaGFuZGxlcj1zZWxmLCAqKnJlc3VsdC5rd2FyZ3MpKQogICAgICAgICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuZmluaXNoKHJlc3VsdCkKICAgICAgICAgICAgICAgIG1bbWV0aG9kLmxvd2VyKCldID0gd3JhcHBlcgogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgbVttZXRob2QubG93ZXIoKV0gPSBmbgogICAgICAgICAgICAgICAgCiAgICAgICAgcmV0dXJuIHR5cGUoY2xzbmFtZSwgYmFzZXMsIG0pCgogICAgZGVmIHJvdXRlXyhzZWxmLCBydWxlLCBtZXRob2RzPU5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zoKICAgIGZyb20gZGV2YS5uYW1lc3BhY2UgaW1wb3J0IE5CCgogICAgQHBhZ2Uucm91dGUoJy8nKQogICAgZGVmIGdldCgpOgogICAgICAgICMg5Y+W5Ye65omA5pyJ5pyJ57yT5Yay6K6+572u5LiU5pyJ5ZCN56ew55qE5rWB5a6e5L6LLOexu+S8vE5TKCflvZPkuIvooYzmg4XmlbDmja7mir3moLcnLGNhY2hlX21heF9sZW49MSkKICAgICAgICAjICAgICBzdHJlYW1zID0gbmFtZXNwYWNlLnZhbHVlcygpPj5scwogICAgICAgIHN0cmVhbXMgPSBbc3RyZWFtIGZvciBzdHJlYW0gaW4gU3RyZWFtLmluc3RhbmNlcygpIGlmIHN0cmVhbS5uYW1lXQogICAgICAgIHRhYmxlcyA9IE5CKCdkZWZhdWx0JykudGFibGVzIHwgbHMKICAgICAgICByZXR1cm4gcmVuZGVyX3RlbXBsYXRlKCcuL3RlbXBsYXRlcy9tb25pdG9yLmh0bWwnLCBzdHJlYW1zPXN0cmVhbXMsCiAgICAgICAgICAgICAgICAgICAgdGFibGVuYW1lcz10YWJsZXMsIHNvY2tfdXJsPScvJykKICAgICAgICAKCgogICAgQHBhZ2Uucm91dGUoJy9zJykKICAgIGRlZiBteV9sb2coKToKICAgICAgICByZXR1cm4gJ2hlbGxvIHdvcmxkJwoKICAgIAogICAgbG9nLndlYnZpZXcoJy9sb2cnKQoKICAgIERldmEucnVuKCkKAAAAAAAAAACcQwAAAAAAAAAAAAA",
"AQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/"
],
[
3,
1,
"revert",
null,
"AgAAAAAAAAAAAAAAAAAAAAAAAAAySgAAaW1wb3J0IGFzeW5jaW8KZnJvbSBjb2xsZWN0aW9ucyBpbXBvcnQgZGVmYXVsdGRpY3QKIiIiCumhtemdouinhuWbvuaooeWdlwp+fn5+fn5+fn4KCuacrOaooeWdl+aPkOS+m+S6hldlYumhtemdouinhuWbvuebuOWFs+eahOWKn+iD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IuWkhOeQhui/nuaOpeaJk+W8gAoKICAgICAgICBBcmdzOgogICAgICAgICAgICByZXF1ZXN0OiBIVFRQ6K+35rGC5a+56LGhCiAgICAgICAgIiIiCiAgICAgICAgc2VsZi5vdXRfc3RyZWFtID0gU3RyZWFtKCkgICMgbmFtZT0nZGVmYXVsdCcpCiAgICAgICAgc2VsZi5jb25uZWN0aW9uID0gc2VsZi5vdXRfc3RyZWFtID4+IHNlbGYuX291dF9zdHJlYW0KICAgICAgICBqc29uLmR1bXBzKHsnaWQnOiAnZGVmYXVsdCcsICdodG1sJzogJ3dlbGNvbWUnfSkgPj4gc2VsZi5vdXRfc3RyZWFtCiAgICAgICAgc2VsZi5yZXF1ZXN0ID0gcmVxdWVzdAogICAgICAgIHNlbGYucmVxdWVzdC5pcCA9IG1heWJlKHNlbGYucmVxdWVzdC5oZWFkZXJzKVsKICAgICAgICAgICAgJ3gtZm9yd2FyZC1mb3InXS5vcl9lbHNlKHNlbGYucmVxdWVzdC5pcCkKCiAgICAgICAgZidvcGVuOntzZWxmLnJlcXVlc3QuaXB9OntkYXRldGltZS5kYXRldGltZS5ub3coKX0nID4+IGxvZwoKICAgIEBnZW4uY29yb3V0aW5lCiAgICBkZWYgb25fbWVzc2FnZShzZWxmLCBtc2cpOgogICAgICAgICIiIuWkhOeQhuaUtuWIsOeahOa2iOaBrwoKICAgICAgICBBcmdzOgogICAgICAgICAgICBtc2cgKHN0cik6IOaUtuWIsOeahOa2iOaBrwogICAgICAgICIiIgogICAgICAgIGpzb24ubG9hZHMobXNnKSA+PiBzZWxmLl9pbl9zdHJlYW0KCiAgICBkZWYgcHJvY2Vzc19tc2coc2VsZiwgbXNnKToKICAgICAgICAiIiLlpITnkIbmtojmga8KCiAgICAgICAgQXJnczoKICAgICAgICAgICAgbXNnIChkaWN0KTog5raI5oGv5YaF5a65CiAgICAgICAgIiIiCiAgICAgICAgc3RyZWFtX2lkcyA9IG1zZ1snc3RyZWFtX2lkcyddCgogICAgICAgICd2aWV3OiVzOiVzOiVzJyAlIChzdHJlYW1faWRzLCBzZWxmLnJlcXVlc3QuaXAsCiAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGV0aW1lLmRhdGV0aW1lLm5vdygpKSA+PiBsb2cKICAgICAgICAjIGdlbi5zbGVlcCgxMCkjI+WPquaciei/memHjOeahOaTjeS9nOmDveexu+S8vGdlbnNsZWVw5LiA5qC35piv5byC5q2l5pON5L2c5pe2LAogICAgICAgICMg5pW05Liq6K+35rGC5omN6IO95byC5q2lLOafkOS4queUqOaIt+i2heaXtuaJjeS4jeS8muW9seWTjeWIq+eahOeUqOaItyzlkKbliJnkuIDkuKrnlKjmiLflvbHlk43lhbbku5bnlKjmiLcKICAgICAgICAjIGlv55qE5Lic6KW/6LWw5byC5q2lLOWFtuS9meeahOWHveaVsOWmguaenOaYr2NwdeiuoeeulyzkuI3opoHotbDlvILmraUKCiAgICAgICAgc2VsZi5vdXRfc3RyZWFtcyA9IFtzdHJlYW0gZm9yIHN0cmVhbSBpbiBTdHJlYW0uaW5zdGFuY2VzKCkgaWYKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cihoYXNoKHN0cmVhbSkpIGluIHN0cmVhbV9pZHNdCgogICAgICAgIGRlZiBfKHNpZCk6CiAgICAgICAgICAgIHJldHVybiBsYW1iZGEgeDoganNvbi5kdW1wcyh7J2lkJzogc2lkLCAnaHRtbCc6IHh9KQoKICAgICAgICBzZWxmLmNvbm5lY3Rpb25zID0gc2V0KCkKICAgICAgICBmb3IgcyBpbiBzZWxmLm91dF9zdHJlYW1zOgogICAgICAgICAgICBzaWQgPSBzdHIoaGFzaChzKSkKICAgICAgICAgICAgZiA9IF8oc2lkKQogICAgICAgICAgICBzZWxmLmNvbm5lY3Rpb25zLmFkZChzLm1hcChyZXByKS5tYXAoZikgPj4gc2VsZi5fb3V0X3N0cmVhbSkKCiAgICAgICAgICAgIGh0bWwgPSBtYXliZShzKS5yZWNlbnQoMSlbMF0ub3JfZWxzZSgn5rWB5YaF5pqC5peg5pWw5o2uJykKICAgICAgICAgICAgIyBodG1sID0gJ+etieW+heaVsOaNruWKoOi9veOAguOAguOAguOAgicKICAgICAgICAgICAganNvbi5kdW1wcyh7J2lkJzogc2lkLCAnaHRtbCc6IGh0bWx9KSA+PiBzZWxmLl9vdXRfc3RyZWFtCgogICAgZGVmIG9uX2Nsb3NlKHNlbGYpOgogICAgICAgICIiIuWkhOeQhui/nuaOpeWFs+mXrSIiIgogICAgICAgIGYnY2xvc2U6e3NlbGYucmVxdWVzdC5pcH06e2RhdGV0aW1lLmRhdGV0aW1lLm5vdygpfScgPj4gbG9nCiAgICAgICAgZm9yIGNvbm5lY3Rpb24gaW4gc2VsZi5jb25uZWN0aW9uczoKICAgICAgICAgICAgY29ubmVjdGlvbi5kZXN0cm95KCkKCiAgICAgICAgc2VsZi5jb25uZWN0aW9ucyA9IHNldCgpCiAgICAgICAgc2VsZi5jb25uZWN0aW9uLmRlc3Ryb3koKQogICAgICAgIHNlbGYubGluazEuZGVzdHJveSgpCiAgICAgICAgc2VsZi5saW5rMi5kZXN0cm95KCkKICAgICAgICBzZWxmLm91dF9zdHJlYW0uZGVzdHJveSgpCgoKY2xhc3MgUGFnZVNlcnZlcihvYmplY3QpOgogICAgIiIi6aG16Z2i5pyN5Yqh5Zmo57G7LOeUqOS6juWQr+WKqOWSjOeuoeeQhldlYuacjeWKoeWZqAoKICAgIOS4u+imgeWKn+iDvToKICAgIC0g5ZCv5YqoVG9ybmFkbyBXZWLmnI3liqHlmagKICAgIC0g566h55CG6aG16Z2i6Lev55SxCiAgICAtIOWkhOeQhldlYlNvY2tldOi/nuaOpQogICAgLSDnrqHnkIbmlbDmja7mtYEKCiAgICDlj4LmlbA6CiAgICAgICAgbmFtZSAoc3RyKTog5pyN5Yqh5Zmo5ZCN56ewLOm7mOiupOS4uidkZWZhdWx0JwogICAgICAgIGhvc3QgKHN0cik6IOebkeWQrOeahOS4u+acuuWcsOWdgCzpu5jorqTkuLonMTI3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gaW5zcGVjdGVkLmFyZ3NbMF0gaW4gWydzZWxmJywgJ2hhbmRsZXInXQogICAgICAgICAgICAKICAgICAgICAgICAgaWYgbm90IHNlbGZfaW5fYXJnczoKICAgICAgICAgICAgICAgIGRlZiB3cmFwcGVyKHNlbGYsICphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gZm4oKmFyZ3MsICoqa3dhcmdzKQogICAgICAgICAgICAgICAgICAgIGlmIGlzaW5zdGFuY2UocmVzdWx0LCBTdHJlYW0pOgogICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSByZW5kZXJfdGVtcGxhdGUoJy4vdGVtcGxhdGVzL3N0cmVhbXMuaHRtbCcsIHN0cmVhbXM9W3Jlc3VsdF0pCiAgICAgICAgICAgICAgICAgICAgaWYgaXNpbnN0YW5jZShyZXN1bHQsIFRlbXBsYXRlUHJveHkpOgogICAgICAgICAgICAgICAgICAgICAgICBpZiBzZWxmLl90ZW1wbGF0ZV9lbmdpbmUgPT0gJ3Rvcm5hZG8nOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5yZW5kZXIoKnJlc3VsdC5hcmdzLCAqKnJlc3VsdC5rd2FyZ3MpCiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZSA9IHNlbGYuX3RlbXBsYXRlX2Vudi5nZXRfdGVtcGxhdGUocmVzdWx0LmFyZ3NbMF0pCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmZpbmlzaCh0ZW1wbGF0ZS5yZW5kZXIoaGFuZGxlcj1zZWxmLCAqKnJlc3VsdC5rd2FyZ3MpKQogICAgICAgICAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuZmluaXNoKHJlc3VsdCkKICAgICAgICAgICAgICAgIG1bbWV0aG9kLmxvd2VyKCldID0gd3JhcHBlcgogICAgICA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CkrdXJsKQogICAgcHJpbnQoJ3dpdGggdGhlc2Ugc3RyZWFtczonLCBzZXJ2ZXIuc3RyZWFtc1t1cmxdKQogICAgcmV0dXJuIHNlcnZlcgoKClN0cmVhbS53ZWJ2aWV3ID0gd2VidmlldwoKZGVmIHNzZV92aWV3KHNlbGYsIHVybCxzZXJ2ZXI9Tm9uZSk6CiAgICAiIiLkuLpsb2fmtYHmj5DkvptTU0XmnI3liqEKICAgIAogICAg5b2T5pyJ5paw55qE6L+e5o6l5pe277yM5bCGbG9n5rWBc2lua+WIsFNTReacjeWKoeeahHNlbGYud3JpdGXmlrnms5UKICAgIOW9k+i/nuaOpeaWreW8gOaXtu+8jOmUgOavgXNpbmvph4rmlL7lhoXlrZgKICAgIAogICAgQXJnczoKICAgICAgICB1cmwgKHN0cik6IFNTReacjeWKoeeahFVSTOi3r+W+hAogICAgIiIiCiAgICAKICAgIGZyb20gdG9ybmFkby53ZWIgaW1wb3J0IFJlcXVlc3RIYW5kbGVyCiAgICBmcm9tIHRvcm5hZG8uZXNjYXBlIGltcG9ydCBqc29uX2VuY29kZQogICAgCiAgICBjbGFzcyBTU0VIYW5kbGVyKFJlcXVlc3RIYW5kbGVyKToKICAgICAgICBzdHJlYW0gPSBzZWxmCiAgICAgICAgCiAgICAgICAgICAgIAogICAgICAgIGFzeW5jIGRlZiBnZXQoc2VsZik6CiAgICAgICAgICAgIHNlbGYuc2V0X2hlYWRlcignQ29udGVudC1UeXBlJywgJ3RleHQvZXZlbnQtc3RyZWFtJykKICAgICAgICAgICAgc2VsZi5zZXRfaGVhZGVyKCdDYWNoZS1Db250cm9sJywgJ25vLWNhY2hlJykKICAgICAgICAgICAgc2VsZi5zZXRfaGVhZGVyKCdDb25uZWN0aW9uJywgJ2tlZXAtYWxpdmUnKQogICAgICAgICAgICAKICAgICAgICAgICAgIyDliJvlu7pzaW5rCiAgICAgICAgICAgIGRlZiB3cml0ZV90b19zc2UoZGF0YSk6CiAgICAgICAgICAgICAgICAj57uT5bC+5b+F6aG75Lik5Liq5Zue6L2m56ym77yM5YmN56uv5omN6IO9IG9ubWVzc2FnZSDmraPnoa7lpITnkIYKICAgICAgICAgICAgICAgIHNlbGYud3JpdGUoZiJkYXRhOiB7anNvbl9lbmNvZGUoZGF0YSl9XG5cbiIpCiAgICAgICAgICAgICAgICBzZWxmLmZsdXNoKCkKICAgICAgICAgICAgICAgIAogICAgICAgICAgICBzaW5rID0gU1NFSGFuZGxlci5zdHJlYW0uc2luayh3cml0ZV90b19zc2UpCiAgICAgICAgICAgIAogICAgICAgICAgICAjIOS/neaMgei/nuaOpQogICAgICAgICAgICB3aGlsZSBub3Qgc2VsZi5yZXF1ZXN0LmNvbm5lY3Rpb24uc3RyZWFtLmNsb3NlZCgpOgogICAgICAgICAgICAgICAgYXdhaXQgYXN5bmNpby5zbGVlcCgxKQogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICMg6L+e5o6l5pat5byA5pe26ZSA5q+Bc2luawogICAgICAgICAgICBzaW5rLmRlc3Ryb3koKQogICAgICAgICAgICAKICAgICMg5rOo5YaM6Lev55SxCiAgICB1cmwgPSB1cmwgaWYgdXJsLnN0YXJ0c3dpdGgoJy8nKSBlbHNlICcvJyt1cmwKICAgIHNlcnZlciA9IHNlcnZlciBvciBOVygnc3RyZWFtX3dlYnZpZXcnKQogICAgc2VydmVyLmFwcGxpY2F0aW9uLmFkZF9oYW5kbGVycygnLiokJywgWyh1cmwsIFNTRUhhbmRsZXIpXSkKICAgIHJldHVybiBzZWxmCgojIOWwhuaWueazlea3u+WKoOWIsGxvZ+a1gQpTdHJlYW0uc3NlID0gc3NlX3ZpZXcKCmlmIF9fbmFtZV9fID09ICdfX21haW5fXyc6CiAgICBmcm9tIGRldmEubmFtZXNwYWNlIGltcG9ydCBOQgoKICAgIEBwYWdlLnJvdXRlKCcvJykKICAgIGRlZiBnZXQoKToKICAgICAgICAjIOWPluWHuuaJgOacieaciee8k+WGsuiuvue9ruS4lOacieWQjeensOeahOa1geWunuS+iyznsbvkvLxOUygn5b2T5LiL6KGM5oOF5pWw5o2u5oq95qC3JyxjYWNoZV9tYXhfbGVuPTEpCiAgICAgICAgIyAgICAgc3RyZWFtcyA9IG5hbWVzcGFjZS52YWx1ZXMoKT4+bHMKICAgICAgICBzdHJlYW1zID0gW3N0cmVhbSBmb3Igc3RyZWFtIGluIFN0cmVhbS5pbnN0YW5jZXMoKSBpZiBzdHJlYW0ubmFtZV0KICAgICAgICB0YWJsZXMgPSBOQignZGVmYXVsdCcpLnRhYmxlcyB8IGxzCiAgICAgICAgcmV0dXJuIHJlbmRlcl90ZW1wbGF0ZSgnLi90ZW1wbGF0ZXMvbW9uaXRvci5odG1sJywgc3RyZWFtcz1zdHJlYW1zLAogICAgICAgICAgICAgICAgICAgIHRhYmxlbmFtZXM9dGFibGVzLCBzb2NrX3VybD0nLycpCiAgICAgICAgCgoKICAgIEBwYWdlLnJvdXRlKCcvcycpCiAgICBkZWYgbXlfbG9nKCk6CiAgICAgICAgcmV0dXJuICdoZWxsbyB3b3JsZCcKCiAgICAKICAgIGxvZy53ZWJ2aWV3KCcvbG9nJykKCiAgICBEZXZhLnJ1bigpCgAAAAAAAAAA+UMAAAAAAAAAAAAA",
"AQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/"
]
]
},
{
"file": "deva/monitor.py",
"settings":
{
"buffer_size": 10008,
"encoding": "UTF-8",
"line_ending": "Unix"
},
"undo_stack":
[
]
}
],
"build_system": "",
"build_system_choices":
[
[
[
[
"Packages/Python/Python.sublime-build",
""
],
[
"Packages/Python/Python.sublime-build",
"Syntax Check"
],
[
"Packages/Python 3/Python3.sublime-build",
""
],
[
"Packages/SublimeREPL/sublimerepl_build_system_hack.sublime-build",
""
]
],
[
"Packages/Python 3/Python3.sublime-build",
""
]
]
],
"build_varint": "",
"command_palette":
{
"height": 0.0,
"last_filter": "",
"selected_items":
[
[
"sspy3",
"Set Syntax: Python3"
],
[
"sspy",
"Set Syntax: Python"
],
[
"in",
"Interrupt IPython Notebook Kernel"
],
[
"pyth",
"Set Syntax: Python3"
],
[
"py",
"Package Control: Add Repository"
],
[
"ins",
"Package Control: Install Package"
],
[
"install",
"Package Control: Install Package"
]
],
"width": 0.0
},
"console":
{
"height": 136.0,
"history":
[
"import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)"
]
},
"distraction_free":
{
"menu_visible": true,
"show_minimap": false,
"show_open_files": false,
"show_tabs": false,
"side_bar_visible": false,
"status_bar_visible": false
},
"expanded_folders":
[
"/Users/spark/pycharmproject/deva",
"/Users/spark/pycharmproject/deva/deva",
"/Users/spark/pycharmproject/deva/deva/utils"
],
"file_history":
[
"/usr/local/bin/ninja",
"/Users/spark/pycharmproject/deva/requirements.txt",
"/Users/spark/pycharmproject/naja/news/xinhuashe.py",
"/Users/spark/pycharmproject/deva/deva/utils/sqlitedict.py",
"/Users/spark/pycharmproject/deva/deva/store.py",
"/Users/spark/pycharmproject/naja/test.py",
"/Users/spark/pycharmproject/secsay/dayou.py",
"/usr/local/bin/xattr",
"/Users/spark/pycharmproject/deva/deva/when.py",
"/Users/spark/pycharmproject/deva/deva/core.py",
"/Users/spark/tmp.txt",
"/Users/spark/pycharmproject/naja/chatgpt_pywebio.py",
"/Users/spark/pycharmproject/naja/pigprice.py",
"/Users/spark/pycharmproject/deva/deva/endpoints.py",
"/Users/spark/pycharmproject/secsay/j4096.py",
"/Users/spark/.bashrc",
"/Users/spark/自动操作/JupyterAutoStart.app/Contents/document.wflow",
"/opt/homebrew/bin/jupyter-notebook",
"/Users/spark/.jupyter/lab/user-settings/@jupyterlab/extensionmanager-extension/plugin.jupyterlab-settings",
"/Users/spark/.pip/pip.conf",
"/Users/spark/pship/hello-python/main.py",
"/Users/spark/.jupyter/jupyter_notebook_config.py",
"/opt/homebrew/bin/jupyter",
"/usr/local/bin/thefuck",
"/opt/homebrew/bin/pip",
"/Users/spark/pycharmproject/secsay/zhouyi_api.py",
"/Users/spark/pycharmproject/deva/.git/config",
"/Users/spark/pycharmproject/deva/deva/compute.py",
"/Users/spark/pycharmproject/deva/deva/topic.py",
"/usr/local/lib/python3.10/site-packages/aioredis/__init__.py",
"/Users/spark/pycharmproject/secsay/g64.py",
"/Users/spark/pycharmproject/deva/deva/pipe.py",
"/Users/spark/pycharmproject/naja/twitter/trump.py",
"/Users/spark/pycharmproject/naja/twitter/twitter.py",
"/Users/spark/pycharmproject/deva/deva/__init__.py",
"/Users/spark/pycharmproject/deva/deva/page.py",
"/Users/spark/pship/down_m3u8/index-f1-v1-a1.m3u8",
"/Users/spark/.vim/bundle/vim-gsc/plugin/gsc.vim",
"/Users/spark/.vimrc",
"/Users/spark/pycharmproject/deva/deva/stream.py",
"/Users/spark/pycharmproject/deva/.gitignore",
"/Users/spark/pycharmproject/easyquant/.gitignore",
"/private/etc/hosts",
"/Users/spark/pycharmproject/easyquant/stock_2468/model.py",
"/Users/spark/pship/snipte_test.py",
"/Users/spark/pycharmproject/easyquant/stream_web_server.py",
"/Users/spark/pycharmproject/easyquant/stock_2468/main.py",
"/Users/spark/pycharmproject/deva/deva/streamz/core.py",
"/Users/spark/pycharmproject/deva/deva/streamz/sources.py",
"/usr/local/lib/python3.7/site-packages/tornado/process.py",
"/Users/spark/Downloads/streamz-0.5.1/MANIFEST.in",
"/Users/spark/Downloads/streamz-0.5.1/setup.cfg",
"/Users/spark/pycharmproject/deva/setup.py",
"/Users/spark/Downloads/streamz-0.5.1/requirements.txt",
"/Users/spark/pycharmproject/deva/deva/search.py",
"/Users/spark/pship/tmp.txt"
],
"find":
{
"height": 24.0
},
"find_in_files":
{
"height": 0.0,
"where_history":
[
]
},
"find_state":
{
"case_sensitive": true,
"find_history":
[
"dis",
"tables",
"异常",
"bug",
"resa",
"resample",
"sample",
"ME",
"me",
"sink",
"nbextensions",
"nbex",
"Thread",
"cache",
"_rule_re",
"is_werkzeug_route",
"_rule_re",
"timer",
"islice",
"head",
"detail",
"SyntasticStatuslineFlag",
"tagbar",
"核桃",
"大畜",
"pay",
"九四"
],
"highlight": true,
"in_selection": false,
"preserve_case": false,
"regex": false,
"replace_history":
[
],
"reverse": false,
"scrollbar_highlights": true,
"show_context": true,
"use_buffer2": true,
"use_gitignore": true,
"whole_word": false,
"wrap": true
},
"folders":
[
{
"path": "/Users/spark/pycharmproject/deva"
},
{
"path": "/Users/spark/pycharmproject/secsay"
},
{
"path": "/Users/spark/pycharmproject/naja"
}
],
"groups":
[
{
"sheets":
[
{
"buffer": 0,
"file": "deva.sublime-workspace",
"semi_transient": false,
"settings":
{
"buffer_size": 7572,
"regions":
{
},
"selection":
[
[
0,
0
]
],
"settings":
{
"is_init_dirty_state": false,
"origin_encoding": "UTF-8",
"syntax": "Packages/JSON/JSON.sublime-syntax",
"tab_size": 4,
"translate_tabs_to_spaces": false
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 3,
"stack_multiselect": false,
"type": "text"
},
{
"buffer": 1,
"file": "deva/browser.py",
"semi_transient": false,
"settings":
{
"buffer_size": 16845,
"regions":
{
},
"selection":
[
[
75,
75
]
],
"settings":
{
"is_init_dirty_state": false,
"origin_encoding": "UTF-8",
"syntax": "Packages/Python/Python.sublime-syntax",
"tab_size": 4,
"translate_tabs_to_spaces": true
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 2,
"stack_multiselect": false,
"type": "text"
},
{
"buffer": 2,
"file": "deva/page.py",
"semi_transient": false,
"settings":
{
"buffer_size": 17401,
"regions":
{
},
"selection":
[
[
0,
0
]
],
"settings":
{
"is_init_dirty_state": false,
"origin_encoding": "UTF-8",
"syntax": "Packages/Python/Python.sublime-syntax",
"tab_size": 4,
"translate_tabs_to_spaces": true
},
"translation.x": 0.0,
"translation.y": 540.0,
"zoom_level": 1.0
},
"stack_index": 1,
"stack_multiselect": false,
"type": "text"
},
{
"buffer": 3,
"file": "deva/monitor.py",
"selected": true,
"semi_transient": true,
"settings":
{
"buffer_size": 10008,
"regions":
{
},
"selection":
[
[
5613,
5613
]
],
"settings":
{
"syntax": "Packages/Python/Python.sublime-syntax",
"tab_size": 4,
"translate_tabs_to_spaces": true
},
"translation.x": 0.0,
"translation.y": 2877.0,
"zoom_level": 1.0
},
"stack_index": 0,
"stack_multiselect": false,
"type": "text"
}
]
}
],
"incremental_find":
{
"height": 24.0
},
"input":
{
"height": 36.0
},
"layout":
{
"cells":
[
[
0,
0,
1,
1
]
],
"cols":
[
0.0,
1.0
],
"rows":
[
0.0,
1.0
]
},
"menu_visible": true,
"output.SublimeLinter":
{
"height": 0.0
},
"output.SublimeLinter Messages":
{
"height": 108.0
},
"output.autopep8":
{
"height": 108.0
},
"output.exec":
{
"height": 108.0
},
"output.find_results":
{
"height": 0.0
},
"pinned_build_system": "",
"project": "",
"replace":
{
"height": 44.0
},
"save_all_on_build": true,
"select_file":
{
"height": 0.0,
"last_filter": "",
"selected_items":
[
[
"re",
"deva/requirements.txt"
],
[
"core",
"deva/deva/core.py"
],
[
"xinhuashe",
"naja/news/xinhuashe.py"
],
[
"pig",
"naja/pigprice.py"
],
[
"chat",
"naja/chatgpt_pywebio.py"
],
[
"dayou",
"secsay/dayou.py"
],
[
"stre",
"deva/stream.py"
],
[
"str",
"deva/stream.py"
]
],
"width": 0.0
},
"select_project":
{
"height": 500.0,
"last_filter": "",
"selected_items":
[
[
"",
"~/pycharmproject/deva/deva.sublime-workspace"
]
],
"width": 380.0
},
"select_symbol":
{
"height": 0.0,
"last_filter": "",
"selected_items":
[
],
"width": 0.0
},
"selected_group": 0,
"settings":
{
},
"show_minimap": true,
"show_open_files": false,
"show_tabs": true,
"side_bar_visible": true,
"side_bar_width": 150.0,
"status_bar_visible": true,
"template_settings":
{
}
}