repo_name
stringlengths 6
100
| path
stringlengths 4
294
| copies
stringclasses 981
values | size
stringlengths 4
6
| content
stringlengths 606
896k
| license
stringclasses 15
values | input_ids
listlengths 1.02k
1.02k
| labels
listlengths 1.02k
1.02k
| attention_mask
listlengths 1.02k
1.02k
|
|---|---|---|---|---|---|---|---|---|
rep/certificate-transparency
|
python/ct/cert_analysis/algorithm_test.py
|
6
|
3138
|
#!/usr/bin/env python
import unittest
import mock
import time
from ct.cert_analysis import algorithm
from ct.cert_analysis import base_check_test
from ct.crypto.asn1 import oid
from ct.crypto.asn1 import x509_common
FAKE_SHA1_IDENTIFIER = mock.Mock(return_value=
x509_common.AlgorithmIdentifier({"algorithm": oid.ECDSA_WITH_SHA1}))
FAKE_NOT_SHA1_IDENTIFIER = mock.Mock(return_value=
x509_common.AlgorithmIdentifier({"algorithm": oid.ECDSA_WITH_SHA224}))
FAKE_NOT_AFTER_12122017 = mock.Mock(return_value=
time.strptime("12 Dec 18", "%d %b %y"))
FAKE_NOT_AFTER_06141992 = mock.Mock(return_value=
time.strptime("12 Apr 92", "%d %b %y"))
class AlgorithmTest(base_check_test.BaseCheckTest):
def test_check_signature_algorithms_mismatch(self):
certificate = mock.MagicMock()
# use real types to make this test something harder than x != y
certificate.signature = FAKE_SHA1_IDENTIFIER
certificate.signature_algorithm = FAKE_NOT_SHA1_IDENTIFIER
check = algorithm.CheckSignatureAlgorithmsMismatch()
self.assertGreater(len(check.check(certificate)), 0)
def test_check_signature_algorithms_match(self):
certificate = mock.MagicMock()
certificate.signature = FAKE_NOT_SHA1_IDENTIFIER
certificate.signature_algorithm = FAKE_NOT_SHA1_IDENTIFIER
check = algorithm.CheckSignatureAlgorithmsMismatch()
self.assertEqual(check.check(certificate), None)
def test_check_tbs_certificate_algorithm_sha1_after_2017(self):
certificate = mock.MagicMock()
certificate.signature_algorithm = FAKE_SHA1_IDENTIFIER
certificate.not_after = FAKE_NOT_AFTER_12122017
check = algorithm.CheckTbsCertificateAlgorithmSHA1Ater2017()
result = check.check(certificate)
self.assertEqual(len(result), 1)
self.assertIn("SHA1", result[0].description)
def test_check_tbs_certificate_algorithm_sha1_before_2017(self):
certificate = mock.MagicMock()
certificate.signature_algorithm = FAKE_SHA1_IDENTIFIER
certificate.not_after = FAKE_NOT_AFTER_06141992
check = algorithm.CheckTbsCertificateAlgorithmSHA1Ater2017()
result = check.check(certificate)
self.assertIsNone(result)
def test_check_certificate_algorithm_sha1_after_2017(self):
certificate = mock.MagicMock()
certificate.signature = FAKE_SHA1_IDENTIFIER
certificate.not_after = FAKE_NOT_AFTER_12122017
check = algorithm.CheckCertificateAlgorithmSHA1After2017()
result = check.check(certificate)
self.assertEqual(len(result), 1)
self.assertIn("SHA1", result[0].description)
def test_check_certificate_algorithm_sha1_before_2017(self):
certificate = mock.MagicMock()
certificate.signature = FAKE_SHA1_IDENTIFIER
certificate.not_after = FAKE_NOT_AFTER_06141992
check = algorithm.CheckCertificateAlgorithmSHA1After2017()
result = check.check(certificate)
self.assertIsNone(result)
if __name__ == '__main__':
unittest.main()
|
apache-2.0
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
646,
2882,
199,
646,
1683,
199,
646,
900,
199,
504,
9428,
14,
4736,
63,
10466,
492,
5563,
199,
504,
9428,
14,
4736,
63,
10466,
492,
1300,
63,
1074,
63,
396,
199,
504,
9428,
14,
10316,
14,
6228,
17,
492,
20109,
199,
504,
9428,
14,
10316,
14,
6228,
17,
492,
671,
6576,
63,
2330,
199,
199,
14623,
63,
8461,
17,
63,
22698,
275,
1683,
14,
3346,
8,
1107,
63,
585,
29,
267,
671,
6576,
63,
2330,
14,
11570,
7544,
6333,
8833,
582,
20109,
14,
4220,
23007,
63,
9139,
63,
8461,
17,
12466,
199,
14623,
63,
4609,
63,
8461,
17,
63,
22698,
275,
1683,
14,
3346,
8,
1107,
63,
585,
29,
267,
671,
6576,
63,
2330,
14,
11570,
7544,
6333,
8833,
582,
20109,
14,
4220,
23007,
63,
9139,
63,
8461,
8731,
12466,
199,
14623,
63,
4609,
63,
31883,
63,
25481,
10680,
275,
1683,
14,
3346,
8,
1107,
63,
585,
29,
1816,
900,
14,
9866,
480,
713,
13966,
6155,
401,
2071,
68,
450,
66,
450,
89,
2237,
199,
14623,
63,
4609,
63,
31883,
63,
1690,
1079,
7155,
18,
275,
1683,
14,
3346,
8,
1107,
63,
585,
29,
1816,
900,
14,
9866,
480,
713,
437,
2700,
20140,
401,
2071,
68,
450,
66,
450,
89,
2237,
199,
199,
533,
23823,
774,
8,
1095,
63,
1074,
63,
396,
14,
1563,
1799,
774,
304,
272,
347,
511,
63,
1074,
63,
5233,
63,
24365,
63,
20759,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
327,
675,
3363,
2943,
370,
1852,
642,
511,
6020,
12159,
424,
2419,
671,
1137,
612,
267,
5897,
14,
5233,
275,
25699,
63,
8461,
17,
63,
22698,
267,
5897,
14,
5233,
63,
8833,
275,
25699,
63,
4609,
63,
8461,
17,
63,
22698,
267,
1104,
275,
5563,
14,
1799,
10014,
2439,
12719,
23055,
342,
267,
291,
14,
15070,
8,
552,
8,
1074,
14,
1074,
8,
6999,
1826,
378,
9,
339,
347,
511,
63,
1074,
63,
5233,
63,
24365,
63,
1431,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
5897,
14,
5233,
275,
25699,
63,
4609,
63,
8461,
17,
63,
22698,
267,
5897,
14,
5233,
63,
8833,
275,
25699,
63,
4609,
63,
8461,
17,
63,
22698,
267,
1104,
275,
5563,
14,
1799,
10014,
2439,
12719,
23055,
342,
267,
291,
14,
629,
8,
1074,
14,
1074,
8,
6999,
395,
488,
9,
339,
347,
511,
63,
1074,
63,
84,
1533,
63,
6999,
63,
8833,
63,
4835,
17,
63,
4399,
63,
10680,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
5897,
14,
5233,
63,
8833,
275,
25699,
63,
8461,
17,
63,
22698,
267,
5897,
14,
1397,
63,
4399,
275,
25699,
63,
4609,
63,
31883,
63,
25481,
10680,
267,
1104,
275,
5563,
14,
1799,
52,
1533,
11414,
11570,
8461,
17,
33,
351,
10680,
342,
267,
754,
275,
1104,
14,
1074,
8,
6999,
9,
267,
291,
14,
629,
8,
552,
8,
1099,
395,
413,
9,
267,
291,
14,
4080,
480,
8461,
17,
401,
754,
59,
16,
1055,
1802,
9,
339,
347,
511,
63,
1074,
63,
84,
1533,
63,
6999,
63,
8833,
63,
4835,
17,
63,
5182,
63,
10680,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
5897,
14,
5233,
63,
8833,
275,
25699,
63,
8461,
17,
63,
22698,
267,
5897,
14,
1397,
63,
4399,
275,
25699,
63,
4609,
63,
31883,
63,
1690,
1079,
7155,
18,
267,
1104,
275,
5563,
14,
1799,
52,
1533,
11414,
11570,
8461,
17,
33,
351,
10680,
342,
267,
754,
275,
1104,
14,
1074,
8,
6999,
9,
267,
291,
14,
7702,
8,
1099,
9,
339,
347,
511,
63,
1074,
63,
6999,
63,
8833,
63,
4835,
17,
63,
4399,
63,
10680,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
5897,
14,
5233,
275,
25699,
63,
8461,
17,
63,
22698,
267,
5897,
14,
1397,
63,
4399,
275,
25699,
63,
4609,
63,
31883,
63,
25481,
10680,
267,
1104,
275,
5563,
14,
1799,
11414,
11570,
8461,
17,
10881,
10680,
342,
267,
754,
275,
1104,
14,
1074,
8,
6999,
9,
267,
291,
14,
629,
8,
552,
8,
1099,
395,
413,
9,
267,
291,
14,
4080,
480,
8461,
17,
401,
754,
59,
16,
1055,
1802,
9,
339,
347,
511,
63,
1074,
63,
6999,
63,
8833,
63,
4835,
17,
63,
5182,
63,
10680,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
5897,
14,
5233,
275,
25699,
63,
8461,
17,
63,
22698,
267,
5897,
14,
1397,
63,
4399,
275,
25699,
63,
4609,
63,
31883,
63,
1690,
1079,
7155,
18,
267,
1104,
275,
5563,
14,
1799,
11414,
11570,
8461,
17,
10881,
10680,
342,
267,
754,
275,
1104,
14,
1074,
8,
6999,
9,
267,
291,
14,
7702,
8,
1099,
9,
199,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
2882,
14,
973,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
646,
2882,
199,
646,
1683,
199,
646,
900,
199,
504,
9428,
14,
4736,
63,
10466,
492,
5563,
199,
504,
9428,
14,
4736,
63,
10466,
492,
1300,
63,
1074,
63,
396,
199,
504,
9428,
14,
10316,
14,
6228,
17,
492,
20109,
199,
504,
9428,
14,
10316,
14,
6228,
17,
492,
671,
6576,
63,
2330,
199,
199,
14623,
63,
8461,
17,
63,
22698,
275,
1683,
14,
3346,
8,
1107,
63,
585,
29,
267,
671,
6576,
63,
2330,
14,
11570,
7544,
6333,
8833,
582,
20109,
14,
4220,
23007,
63,
9139,
63,
8461,
17,
12466,
199,
14623,
63,
4609,
63,
8461,
17,
63,
22698,
275,
1683,
14,
3346,
8,
1107,
63,
585,
29,
267,
671,
6576,
63,
2330,
14,
11570,
7544,
6333,
8833,
582,
20109,
14,
4220,
23007,
63,
9139,
63,
8461,
8731,
12466,
199,
14623,
63,
4609,
63,
31883,
63,
25481,
10680,
275,
1683,
14,
3346,
8,
1107,
63,
585,
29,
1816,
900,
14,
9866,
480,
713,
13966,
6155,
401,
2071,
68,
450,
66,
450,
89,
2237,
199,
14623,
63,
4609,
63,
31883,
63,
1690,
1079,
7155,
18,
275,
1683,
14,
3346,
8,
1107,
63,
585,
29,
1816,
900,
14,
9866,
480,
713,
437,
2700,
20140,
401,
2071,
68,
450,
66,
450,
89,
2237,
199,
199,
533,
23823,
774,
8,
1095,
63,
1074,
63,
396,
14,
1563,
1799,
774,
304,
272,
347,
511,
63,
1074,
63,
5233,
63,
24365,
63,
20759,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
327,
675,
3363,
2943,
370,
1852,
642,
511,
6020,
12159,
424,
2419,
671,
1137,
612,
267,
5897,
14,
5233,
275,
25699,
63,
8461,
17,
63,
22698,
267,
5897,
14,
5233,
63,
8833,
275,
25699,
63,
4609,
63,
8461,
17,
63,
22698,
267,
1104,
275,
5563,
14,
1799,
10014,
2439,
12719,
23055,
342,
267,
291,
14,
15070,
8,
552,
8,
1074,
14,
1074,
8,
6999,
1826,
378,
9,
339,
347,
511,
63,
1074,
63,
5233,
63,
24365,
63,
1431,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
5897,
14,
5233,
275,
25699,
63,
4609,
63,
8461,
17,
63,
22698,
267,
5897,
14,
5233,
63,
8833,
275,
25699,
63,
4609,
63,
8461,
17,
63,
22698,
267,
1104,
275,
5563,
14,
1799,
10014,
2439,
12719,
23055,
342,
267,
291,
14,
629,
8,
1074,
14,
1074,
8,
6999,
395,
488,
9,
339,
347,
511,
63,
1074,
63,
84,
1533,
63,
6999,
63,
8833,
63,
4835,
17,
63,
4399,
63,
10680,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
5897,
14,
5233,
63,
8833,
275,
25699,
63,
8461,
17,
63,
22698,
267,
5897,
14,
1397,
63,
4399,
275,
25699,
63,
4609,
63,
31883,
63,
25481,
10680,
267,
1104,
275,
5563,
14,
1799,
52,
1533,
11414,
11570,
8461,
17,
33,
351,
10680,
342,
267,
754,
275,
1104,
14,
1074,
8,
6999,
9,
267,
291,
14,
629,
8,
552,
8,
1099,
395,
413,
9,
267,
291,
14,
4080,
480,
8461,
17,
401,
754,
59,
16,
1055,
1802,
9,
339,
347,
511,
63,
1074,
63,
84,
1533,
63,
6999,
63,
8833,
63,
4835,
17,
63,
5182,
63,
10680,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
5897,
14,
5233,
63,
8833,
275,
25699,
63,
8461,
17,
63,
22698,
267,
5897,
14,
1397,
63,
4399,
275,
25699,
63,
4609,
63,
31883,
63,
1690,
1079,
7155,
18,
267,
1104,
275,
5563,
14,
1799,
52,
1533,
11414,
11570,
8461,
17,
33,
351,
10680,
342,
267,
754,
275,
1104,
14,
1074,
8,
6999,
9,
267,
291,
14,
7702,
8,
1099,
9,
339,
347,
511,
63,
1074,
63,
6999,
63,
8833,
63,
4835,
17,
63,
4399,
63,
10680,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
5897,
14,
5233,
275,
25699,
63,
8461,
17,
63,
22698,
267,
5897,
14,
1397,
63,
4399,
275,
25699,
63,
4609,
63,
31883,
63,
25481,
10680,
267,
1104,
275,
5563,
14,
1799,
11414,
11570,
8461,
17,
10881,
10680,
342,
267,
754,
275,
1104,
14,
1074,
8,
6999,
9,
267,
291,
14,
629,
8,
552,
8,
1099,
395,
413,
9,
267,
291,
14,
4080,
480,
8461,
17,
401,
754,
59,
16,
1055,
1802,
9,
339,
347,
511,
63,
1074,
63,
6999,
63,
8833,
63,
4835,
17,
63,
5182,
63,
10680,
8,
277,
304,
267,
5897,
275,
1683,
14,
11988,
342,
267,
5897,
14,
5233,
275,
25699,
63,
8461,
17,
63,
22698,
267,
5897,
14,
1397,
63,
4399,
275,
25699,
63,
4609,
63,
31883,
63,
1690,
1079,
7155,
18,
267,
1104,
275,
5563,
14,
1799,
11414,
11570,
8461,
17,
10881,
10680,
342,
267,
754,
275,
1104,
14,
1074,
8,
6999,
9,
267,
291,
14,
7702,
8,
1099,
9,
199,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
2882,
14,
973,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
fengxiaoiie/volatility
|
volatility/plugins/linux/enumerate_files.py
|
12
|
2031
|
# Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Volatility is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Volatility. If not, see <http://www.gnu.org/licenses/>.
#
"""
@author: Andrew Case
@license: GNU General Public License 2.0
@contact: atcuno@gmail.com
@organization:
"""
import volatility.obj as obj
import volatility.plugins.linux.common as linux_common
import volatility.plugins.linux.find_file as linux_find_file
from volatility.renderers import TreeGrid
from volatility.renderers.basic import Address
class linux_enumerate_files(linux_common.AbstractLinuxCommand):
"""Lists files referenced by the filesystem cache"""
def calculate(self):
linux_common.set_plugin_members(self)
for (_, _, file_path, file_dentry)in linux_find_file.linux_find_file(self._config).walk_sbs():
inode = file_dentry.d_inode
yield inode, inode.i_ino, file_path
def unified_output(self, data):
return TreeGrid([("Inode Address", Address), ("Inode Number", int), ("Path", str)],
self.generator(data))
def generator(self, data):
for inode, inum, path in data:
yield (0, [Address(inode.v()), int(inum), str(path)])
def render_text(self, outfd, data):
self.table_header(outfd, [("Inode Address", "[addr]"), ("Inode Number", "25"), ("Path", "")])
for inode, inum, path in data:
self.table_row(outfd, inode, inum, path)
|
gpl-2.0
|
[
3,
28367,
199,
3,
1898,
334,
35,
9,
10219,
13,
6965,
28367,
2752,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
28367,
14,
199,
3,
199,
3,
28367,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
314,
2868,
2290,
2752,
27,
1902,
1015,
499,
402,
314,
844,
12,
503,
199,
3,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
28367,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
3,
3180,
543,
28367,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
199,
624,
199,
32,
2502,
26,
755,
6061,
5257,
12425,
199,
32,
1682,
26,
420,
1664,
1696,
1684,
844,
499,
14,
16,
199,
32,
7811,
26,
420,
737,
67,
324,
79,
32,
6799,
14,
957,
199,
32,
9071,
26,
221,
199,
624,
199,
199,
646,
5236,
18783,
14,
1113,
465,
1559,
199,
646,
5236,
18783,
14,
5265,
14,
5135,
14,
2330,
465,
18369,
63,
2330,
199,
646,
5236,
18783,
14,
5265,
14,
5135,
14,
1623,
63,
493,
221,
465,
18369,
63,
1623,
63,
493,
199,
504,
5236,
18783,
14,
828,
26529,
492,
12178,
7900,
199,
504,
5236,
18783,
14,
828,
26529,
14,
4316,
492,
9906,
199,
199,
533,
18369,
63,
26318,
63,
1725,
8,
5135,
63,
2330,
14,
8458,
14091,
3110,
304,
272,
408,
15116,
1584,
11812,
701,
314,
10036,
2581,
624,
339,
347,
8671,
8,
277,
304,
267,
18369,
63,
2330,
14,
409,
63,
2718,
63,
6334,
8,
277,
9,
398,
367,
27017,
5501,
570,
63,
515,
12,
570,
63,
1326,
651,
9,
262,
18369,
63,
1623,
63,
493,
14,
5135,
63,
1623,
63,
493,
8,
277,
423,
888,
680,
7757,
63,
83,
1533,
837,
288,
25115,
275,
570,
63,
1326,
651,
14,
68,
63,
15993,
953,
1995,
25115,
12,
25115,
14,
73,
63,
10175,
12,
570,
63,
515,
339,
347,
25344,
63,
1199,
8,
277,
12,
666,
304,
267,
372,
12178,
7900,
27187,
607,
380,
9906,
401,
9906,
395,
1689,
607,
380,
4860,
401,
1109,
395,
1689,
2042,
401,
620,
4360,
717,
291,
14,
4679,
8,
576,
430,
339,
347,
4306,
8,
277,
12,
666,
304,
267,
367,
25115,
12,
315,
453,
12,
931,
315,
666,
26,
288,
1995,
334,
16,
12,
359,
1476,
8,
15993,
14,
86,
4000,
1109,
8,
262,
453,
395,
620,
8,
515,
3948,
339,
347,
3795,
63,
505,
8,
277,
12,
734,
2592,
12,
666,
304,
267,
291,
14,
1224,
63,
1291,
8,
548,
2592,
12,
10003,
607,
380,
9906,
401,
7369,
2697,
31937,
1689,
607,
380,
4860,
401,
298,
821,
1288,
1689,
2042,
401,
6899,
566,
267,
367,
25115,
12,
315,
453,
12,
931,
315,
666,
26,
288,
291,
14,
1224,
63,
1143,
8,
548,
2592,
12,
25115,
12,
315,
453,
12,
931,
9,
9948,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
28367,
199,
3,
1898,
334,
35,
9,
10219,
13,
6965,
28367,
2752,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
28367,
14,
199,
3,
199,
3,
28367,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
314,
2868,
2290,
2752,
27,
1902,
1015,
499,
402,
314,
844,
12,
503,
199,
3,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
28367,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
3,
3180,
543,
28367,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
199,
624,
199,
32,
2502,
26,
755,
6061,
5257,
12425,
199,
32,
1682,
26,
420,
1664,
1696,
1684,
844,
499,
14,
16,
199,
32,
7811,
26,
420,
737,
67,
324,
79,
32,
6799,
14,
957,
199,
32,
9071,
26,
221,
199,
624,
199,
199,
646,
5236,
18783,
14,
1113,
465,
1559,
199,
646,
5236,
18783,
14,
5265,
14,
5135,
14,
2330,
465,
18369,
63,
2330,
199,
646,
5236,
18783,
14,
5265,
14,
5135,
14,
1623,
63,
493,
221,
465,
18369,
63,
1623,
63,
493,
199,
504,
5236,
18783,
14,
828,
26529,
492,
12178,
7900,
199,
504,
5236,
18783,
14,
828,
26529,
14,
4316,
492,
9906,
199,
199,
533,
18369,
63,
26318,
63,
1725,
8,
5135,
63,
2330,
14,
8458,
14091,
3110,
304,
272,
408,
15116,
1584,
11812,
701,
314,
10036,
2581,
624,
339,
347,
8671,
8,
277,
304,
267,
18369,
63,
2330,
14,
409,
63,
2718,
63,
6334,
8,
277,
9,
398,
367,
27017,
5501,
570,
63,
515,
12,
570,
63,
1326,
651,
9,
262,
18369,
63,
1623,
63,
493,
14,
5135,
63,
1623,
63,
493,
8,
277,
423,
888,
680,
7757,
63,
83,
1533,
837,
288,
25115,
275,
570,
63,
1326,
651,
14,
68,
63,
15993,
953,
1995,
25115,
12,
25115,
14,
73,
63,
10175,
12,
570,
63,
515,
339,
347,
25344,
63,
1199,
8,
277,
12,
666,
304,
267,
372,
12178,
7900,
27187,
607,
380,
9906,
401,
9906,
395,
1689,
607,
380,
4860,
401,
1109,
395,
1689,
2042,
401,
620,
4360,
717,
291,
14,
4679,
8,
576,
430,
339,
347,
4306,
8,
277,
12,
666,
304,
267,
367,
25115,
12,
315,
453,
12,
931,
315,
666,
26,
288,
1995,
334,
16,
12,
359,
1476,
8,
15993,
14,
86,
4000,
1109,
8,
262,
453,
395,
620,
8,
515,
3948,
339,
347,
3795,
63,
505,
8,
277,
12,
734,
2592,
12,
666,
304,
267,
291,
14,
1224,
63,
1291,
8,
548,
2592,
12,
10003,
607,
380,
9906,
401,
7369,
2697,
31937,
1689,
607,
380,
4860,
401,
298,
821,
1288,
1689,
2042,
401,
6899,
566,
267,
367,
25115,
12,
315,
453,
12,
931,
315,
666,
26,
288,
291,
14,
1224,
63,
1143,
8,
548,
2592,
12,
25115,
12,
315,
453,
12,
931,
9,
9948,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
stefanstrogin/linux
|
tools/perf/scripts/python/sctop.py
|
1996
|
2102
|
# system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified, the display
# will be refreshed every [interval] seconds. The default interval is
# 3 seconds.
import os, sys, thread, time
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
usage = "perf script -s sctop.py [comm] [interval]\n";
for_comm = None
default_interval = 3
interval = default_interval
if len(sys.argv) > 3:
sys.exit(usage)
if len(sys.argv) > 2:
for_comm = sys.argv[1]
interval = int(sys.argv[2])
elif len(sys.argv) > 1:
try:
interval = int(sys.argv[1])
except ValueError:
for_comm = sys.argv[1]
interval = default_interval
syscalls = autodict()
def trace_begin():
thread.start_new_thread(print_syscall_totals, (interval,))
pass
def raw_syscalls__sys_enter(event_name, context, common_cpu,
common_secs, common_nsecs, common_pid, common_comm,
common_callchain, id, args):
if for_comm is not None:
if common_comm != for_comm:
return
try:
syscalls[id] += 1
except TypeError:
syscalls[id] = 1
def syscalls__sys_enter(event_name, context, common_cpu,
common_secs, common_nsecs, common_pid, common_comm,
id, args):
raw_syscalls__sys_enter(**locals())
def print_syscall_totals(interval):
while 1:
clear_term()
if for_comm is not None:
print "\nsyscall events for %s:\n\n" % (for_comm),
else:
print "\nsyscall events:\n\n",
print "%-40s %10s\n" % ("event", "count"),
print "%-40s %10s\n" % ("----------------------------------------", \
"----------"),
for id, val in sorted(syscalls.iteritems(), key = lambda(k, v): (v, k), \
reverse = True):
try:
print "%-40s %10d\n" % (syscall_name(id), val),
except TypeError:
pass
syscalls.clear()
time.sleep(interval)
|
gpl-2.0
|
[
3,
2656,
1240,
2746,
199,
3,
334,
67,
9,
7129,
12,
21644,
29385,
665,
29453,
32,
6799,
14,
957,
30,
199,
3,
3909,
1334,
314,
2895,
402,
314,
1664,
14629,
844,
1015,
499,
199,
3,
199,
3,
3492,
11273,
1183,
17561,
2656,
13,
13062,
2656,
1240,
23576,
12,
10529,
3224,
701,
199,
3,
18901,
14,
221,
982,
282,
359,
1404,
61,
1680,
365,
2013,
12,
1454,
19473,
2797,
701,
199,
3,
359,
1404,
61,
787,
9080,
14,
982,
376,
359,
4284,
61,
1680,
365,
2013,
12,
314,
2929,
199,
3,
911,
506,
9236,
379,
4036,
359,
4284,
61,
4696,
14,
221,
710,
849,
6252,
365,
199,
3,
650,
4696,
14,
199,
199,
646,
747,
12,
984,
12,
2462,
12,
900,
199,
199,
1274,
14,
515,
14,
740,
8,
736,
14,
2314,
459,
17038,
63,
10276,
63,
3243,
418,
435,
971,
199,
198,
9807,
6429,
15,
1548,
15,
12387,
13,
3921,
13,
9562,
15,
773,
15,
12387,
15,
3921,
358,
199,
199,
504,
8582,
63,
3446,
63,
1100,
492,
627,
199,
504,
11672,
492,
627,
199,
504,
21248,
492,
627,
199,
199,
3807,
275,
298,
9452,
2884,
446,
83,
308,
319,
411,
14,
647,
359,
1404,
61,
359,
4284,
7272,
78,
11436,
199,
199,
509,
63,
1404,
275,
488,
199,
885,
63,
4284,
275,
650,
199,
4284,
275,
849,
63,
4284,
199,
199,
692,
822,
8,
1274,
14,
3020,
9,
690,
650,
26,
199,
198,
1274,
14,
2224,
8,
3807,
9,
199,
199,
692,
822,
8,
1274,
14,
3020,
9,
690,
499,
26,
199,
198,
509,
63,
1404,
275,
984,
14,
3020,
59,
17,
61,
199,
198,
4284,
275,
1109,
8,
1274,
14,
3020,
59,
18,
566,
199,
4164,
822,
8,
1274,
14,
3020,
9,
690,
413,
26,
199,
198,
893,
26,
507,
198,
4284,
275,
1109,
8,
1274,
14,
3020,
59,
17,
566,
199,
198,
2590,
1722,
26,
507,
198,
509,
63,
1404,
275,
984,
14,
3020,
59,
17,
61,
507,
198,
4284,
275,
849,
63,
4284,
199,
199,
14507,
275,
27477,
342,
199,
199,
318,
3307,
63,
5037,
837,
199,
198,
2671,
14,
928,
63,
1222,
63,
2671,
8,
1361,
63,
19444,
63,
17552,
12,
334,
4284,
4641,
199,
198,
1529,
199,
199,
318,
3066,
63,
14507,
363,
1274,
63,
4200,
8,
1430,
63,
354,
12,
1067,
12,
2863,
63,
3541,
12,
199,
198,
2330,
63,
4855,
12,
2863,
63,
9618,
12,
2863,
63,
3150,
12,
2863,
63,
1404,
12,
199,
198,
2330,
63,
1250,
4429,
12,
1305,
12,
1249,
304,
199,
198,
692,
367,
63,
1404,
365,
440,
488,
26,
507,
198,
692,
2863,
63,
1404,
1137,
367,
63,
1404,
26,
686,
198,
1107,
199,
198,
893,
26,
507,
198,
14507,
59,
344,
61,
847,
413,
199,
198,
2590,
3146,
26,
507,
198,
14507,
59,
344,
61,
275,
413,
199,
199,
318,
19473,
363,
1274,
63,
4200,
8,
1430,
63,
354,
12,
1067,
12,
2863,
63,
3541,
12,
199,
198,
2330,
63,
4855,
12,
2863,
63,
9618,
12,
2863,
63,
3150,
12,
2863,
63,
1404,
12,
199,
198,
344,
12,
1249,
304,
199,
198,
1773,
63,
14507,
363,
1274,
63,
4200,
3682,
9350,
1012,
199,
199,
318,
870,
63,
19444,
63,
17552,
8,
4284,
304,
199,
198,
6710,
413,
26,
507,
198,
3584,
63,
5125,
342,
507,
198,
692,
367,
63,
1404,
365,
440,
488,
26,
686,
198,
1361,
1867,
26605,
4474,
367,
450,
83,
3427,
78,
60,
78,
2,
450,
334,
509,
63,
1404,
395,
507,
198,
2836,
26,
686,
198,
1361,
1867,
26605,
4474,
3427,
78,
60,
78,
401,
2742,
198,
1361,
18301,
2167,
83,
221,
450,
709,
83,
60,
78,
2,
450,
1689,
1430,
401,
298,
835,
1288,
507,
198,
1361,
18301,
2167,
83,
221,
450,
709,
83,
60,
78,
2,
450,
1689,
32111,
401,
971,
5264,
298,
9460,
1288,
2742,
198,
509,
1305,
12,
1139,
315,
3355,
8,
14507,
14,
4611,
1062,
790,
275,
2400,
8,
75,
12,
373,
304,
334,
86,
12,
1022,
395,
971,
4671,
420,
3837,
275,
715,
304,
686,
198,
893,
26,
1585,
198,
1361,
18301,
2167,
83,
221,
450,
709,
68,
60,
78,
2,
450,
334,
19444,
63,
354,
8,
344,
395,
1139,
395,
686,
198,
2590,
3146,
26,
1585,
198,
1529,
507,
198,
14507,
14,
3584,
342,
507,
198,
521,
14,
4532,
8,
4284,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2656,
1240,
2746,
199,
3,
334,
67,
9,
7129,
12,
21644,
29385,
665,
29453,
32,
6799,
14,
957,
30,
199,
3,
3909,
1334,
314,
2895,
402,
314,
1664,
14629,
844,
1015,
499,
199,
3,
199,
3,
3492,
11273,
1183,
17561,
2656,
13,
13062,
2656,
1240,
23576,
12,
10529,
3224,
701,
199,
3,
18901,
14,
221,
982,
282,
359,
1404,
61,
1680,
365,
2013,
12,
1454,
19473,
2797,
701,
199,
3,
359,
1404,
61,
787,
9080,
14,
982,
376,
359,
4284,
61,
1680,
365,
2013,
12,
314,
2929,
199,
3,
911,
506,
9236,
379,
4036,
359,
4284,
61,
4696,
14,
221,
710,
849,
6252,
365,
199,
3,
650,
4696,
14,
199,
199,
646,
747,
12,
984,
12,
2462,
12,
900,
199,
199,
1274,
14,
515,
14,
740,
8,
736,
14,
2314,
459,
17038,
63,
10276,
63,
3243,
418,
435,
971,
199,
198,
9807,
6429,
15,
1548,
15,
12387,
13,
3921,
13,
9562,
15,
773,
15,
12387,
15,
3921,
358,
199,
199,
504,
8582,
63,
3446,
63,
1100,
492,
627,
199,
504,
11672,
492,
627,
199,
504,
21248,
492,
627,
199,
199,
3807,
275,
298,
9452,
2884,
446,
83,
308,
319,
411,
14,
647,
359,
1404,
61,
359,
4284,
7272,
78,
11436,
199,
199,
509,
63,
1404,
275,
488,
199,
885,
63,
4284,
275,
650,
199,
4284,
275,
849,
63,
4284,
199,
199,
692,
822,
8,
1274,
14,
3020,
9,
690,
650,
26,
199,
198,
1274,
14,
2224,
8,
3807,
9,
199,
199,
692,
822,
8,
1274,
14,
3020,
9,
690,
499,
26,
199,
198,
509,
63,
1404,
275,
984,
14,
3020,
59,
17,
61,
199,
198,
4284,
275,
1109,
8,
1274,
14,
3020,
59,
18,
566,
199,
4164,
822,
8,
1274,
14,
3020,
9,
690,
413,
26,
199,
198,
893,
26,
507,
198,
4284,
275,
1109,
8,
1274,
14,
3020,
59,
17,
566,
199,
198,
2590,
1722,
26,
507,
198,
509,
63,
1404,
275,
984,
14,
3020,
59,
17,
61,
507,
198,
4284,
275,
849,
63,
4284,
199,
199,
14507,
275,
27477,
342,
199,
199,
318,
3307,
63,
5037,
837,
199,
198,
2671,
14,
928,
63,
1222,
63,
2671,
8,
1361,
63,
19444,
63,
17552,
12,
334,
4284,
4641,
199,
198,
1529,
199,
199,
318,
3066,
63,
14507,
363,
1274,
63,
4200,
8,
1430,
63,
354,
12,
1067,
12,
2863,
63,
3541,
12,
199,
198,
2330,
63,
4855,
12,
2863,
63,
9618,
12,
2863,
63,
3150,
12,
2863,
63,
1404,
12,
199,
198,
2330,
63,
1250,
4429,
12,
1305,
12,
1249,
304,
199,
198,
692,
367,
63,
1404,
365,
440,
488,
26,
507,
198,
692,
2863,
63,
1404,
1137,
367,
63,
1404,
26,
686,
198,
1107,
199,
198,
893,
26,
507,
198,
14507,
59,
344,
61,
847,
413,
199,
198,
2590,
3146,
26,
507,
198,
14507,
59,
344,
61,
275,
413,
199,
199,
318,
19473,
363,
1274,
63,
4200,
8,
1430,
63,
354,
12,
1067,
12,
2863,
63,
3541,
12,
199,
198,
2330,
63,
4855,
12,
2863,
63,
9618,
12,
2863,
63,
3150,
12,
2863,
63,
1404,
12,
199,
198,
344,
12,
1249,
304,
199,
198,
1773,
63,
14507,
363,
1274,
63,
4200,
3682,
9350,
1012,
199,
199,
318,
870,
63,
19444,
63,
17552,
8,
4284,
304,
199,
198,
6710,
413,
26,
507,
198,
3584,
63,
5125,
342,
507,
198,
692,
367,
63,
1404,
365,
440,
488,
26,
686,
198,
1361,
1867,
26605,
4474,
367,
450,
83,
3427,
78,
60,
78,
2,
450,
334,
509,
63,
1404,
395,
507,
198,
2836,
26,
686,
198,
1361,
1867,
26605,
4474,
3427,
78,
60,
78,
401,
2742,
198,
1361,
18301,
2167,
83,
221,
450,
709,
83,
60,
78,
2,
450,
1689,
1430,
401,
298,
835,
1288,
507,
198,
1361,
18301,
2167,
83,
221,
450,
709,
83,
60,
78,
2,
450,
1689,
32111,
401,
971,
5264,
298,
9460,
1288,
2742,
198,
509,
1305,
12,
1139,
315,
3355,
8,
14507,
14,
4611,
1062,
790,
275,
2400,
8,
75,
12,
373,
304,
334,
86,
12,
1022,
395,
971,
4671,
420,
3837,
275,
715,
304,
686,
198,
893,
26,
1585,
198,
1361,
18301,
2167,
83,
221,
450,
709,
68,
60,
78,
2,
450,
334,
19444,
63,
354,
8,
344,
395,
1139,
395,
686,
198,
2590,
3146,
26,
1585,
198,
1529,
507,
198,
14507,
14,
3584,
342,
507,
198,
521,
14,
4532,
8,
4284,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
caisq/tensorflow
|
tensorflow/python/feature_column/feature_column_v2_test.py
|
6
|
269665
|
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for feature_column."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import copy
import numpy as np
from tensorflow.core.example import example_pb2
from tensorflow.core.example import feature_pb2
from tensorflow.core.protobuf import config_pb2
from tensorflow.core.protobuf import rewriter_config_pb2
from tensorflow.python.client import session
from tensorflow.python.eager import backprop
from tensorflow.python.eager import context
from tensorflow.python.estimator.inputs import numpy_io
from tensorflow.python.feature_column import feature_column as fc_old
from tensorflow.python.feature_column import feature_column_v2 as fc
from tensorflow.python.feature_column.feature_column_v2 import FeatureColumn
from tensorflow.python.feature_column.feature_column_v2 import FeatureTransformationCache
from tensorflow.python.feature_column.feature_column_v2 import InputLayer
from tensorflow.python.feature_column.feature_column_v2 import StateManager
from tensorflow.python.feature_column.feature_column_v2 import _LinearModel
from tensorflow.python.feature_column.feature_column_v2 import _transform_features
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
from tensorflow.python.framework import ops
from tensorflow.python.framework import sparse_tensor
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import lookup_ops
from tensorflow.python.ops import parsing_ops
from tensorflow.python.ops import partitioned_variables
from tensorflow.python.ops import variable_scope
from tensorflow.python.ops import variables as variables_lib
from tensorflow.python.platform import test
from tensorflow.python.training import coordinator
from tensorflow.python.training import queue_runner_impl
def _initialized_session(config=None):
sess = session.Session(config=config)
sess.run(variables_lib.global_variables_initializer())
sess.run(lookup_ops.tables_initializer())
return sess
class LazyColumnTest(test.TestCase):
def test_transformations_called_once(self):
class TransformCounter(FeatureColumn):
def __init__(self):
self.num_transform = 0
@property
def name(self):
return 'TransformCounter'
def transform_feature(self, transformation_cache, state_manager):
self.num_transform += 1 # Count transform calls.
return transformation_cache.get('a', state_manager)
@property
def parse_example_spec(self):
pass
transformation_cache = FeatureTransformationCache(
features={'a': [[2], [3.]]})
column = TransformCounter()
self.assertEqual(0, column.num_transform)
transformation_cache.get(column, None)
self.assertEqual(1, column.num_transform)
transformation_cache.get(column, None)
self.assertEqual(1, column.num_transform)
def test_returns_transform_output(self):
class Transformer(FeatureColumn):
@property
def name(self):
return 'Transformer'
def transform_feature(self, transformation_cache, state_manager):
return 'Output'
@property
def parse_example_spec(self):
pass
transformation_cache = FeatureTransformationCache(
features={'a': [[2], [3.]]})
column = Transformer()
self.assertEqual('Output', transformation_cache.get(column, None))
self.assertEqual('Output', transformation_cache.get(column, None))
def test_does_not_pollute_given_features_dict(self):
class Transformer(FeatureColumn):
@property
def name(self):
return 'Transformer'
def transform_feature(self, transformation_cache, state_manager):
return 'Output'
@property
def parse_example_spec(self):
pass
features = {'a': [[2], [3.]]}
transformation_cache = FeatureTransformationCache(features=features)
transformation_cache.get(Transformer(), None)
self.assertEqual(['a'], list(features.keys()))
def test_error_if_feature_is_not_found(self):
transformation_cache = FeatureTransformationCache(
features={'a': [[2], [3.]]})
with self.assertRaisesRegexp(ValueError,
'bbb is not in features dictionary'):
transformation_cache.get('bbb', None)
with self.assertRaisesRegexp(ValueError,
'bbb is not in features dictionary'):
transformation_cache.get(u'bbb', None)
def test_not_supported_feature_column(self):
class NotAProperColumn(FeatureColumn):
@property
def name(self):
return 'NotAProperColumn'
def transform_feature(self, transformation_cache, state_manager):
# It should return not None.
pass
@property
def parse_example_spec(self):
pass
transformation_cache = FeatureTransformationCache(
features={'a': [[2], [3.]]})
with self.assertRaisesRegexp(ValueError,
'NotAProperColumn is not supported'):
transformation_cache.get(NotAProperColumn(), None)
def test_key_should_be_string_or_feature_colum(self):
class NotAFeatureColumn(object):
pass
transformation_cache = FeatureTransformationCache(
features={'a': [[2], [3.]]})
with self.assertRaisesRegexp(
TypeError, '"key" must be either a "str" or "FeatureColumn".'):
transformation_cache.get(NotAFeatureColumn(), None)
class NumericColumnTest(test.TestCase):
def test_defaults(self):
a = fc.numeric_column('aaa')
self.assertEqual('aaa', a.key)
self.assertEqual('aaa', a.name)
self.assertEqual((1,), a.shape)
self.assertIsNone(a.default_value)
self.assertEqual(dtypes.float32, a.dtype)
self.assertIsNone(a.normalizer_fn)
def test_key_should_be_string(self):
with self.assertRaisesRegexp(ValueError, 'key must be a string.'):
fc.numeric_column(key=('aaa',))
def test_shape_saved_as_tuple(self):
a = fc.numeric_column('aaa', shape=[1, 2], default_value=[[3, 2.]])
self.assertEqual((1, 2), a.shape)
def test_default_value_saved_as_tuple(self):
a = fc.numeric_column('aaa', default_value=4.)
self.assertEqual((4.,), a.default_value)
a = fc.numeric_column('aaa', shape=[1, 2], default_value=[[3, 2.]])
self.assertEqual(((3., 2.),), a.default_value)
def test_shape_and_default_value_compatibility(self):
fc.numeric_column('aaa', shape=[2], default_value=[1, 2.])
with self.assertRaisesRegexp(ValueError, 'The shape of default_value'):
fc.numeric_column('aaa', shape=[2], default_value=[1, 2, 3.])
fc.numeric_column(
'aaa', shape=[3, 2], default_value=[[2, 3], [1, 2], [2, 3.]])
with self.assertRaisesRegexp(ValueError, 'The shape of default_value'):
fc.numeric_column(
'aaa', shape=[3, 1], default_value=[[2, 3], [1, 2], [2, 3.]])
with self.assertRaisesRegexp(ValueError, 'The shape of default_value'):
fc.numeric_column(
'aaa', shape=[3, 3], default_value=[[2, 3], [1, 2], [2, 3.]])
def test_default_value_type_check(self):
fc.numeric_column(
'aaa', shape=[2], default_value=[1, 2.], dtype=dtypes.float32)
fc.numeric_column(
'aaa', shape=[2], default_value=[1, 2], dtype=dtypes.int32)
with self.assertRaisesRegexp(TypeError, 'must be compatible with dtype'):
fc.numeric_column(
'aaa', shape=[2], default_value=[1, 2.], dtype=dtypes.int32)
with self.assertRaisesRegexp(TypeError,
'default_value must be compatible with dtype'):
fc.numeric_column('aaa', default_value=['string'])
def test_shape_must_be_positive_integer(self):
with self.assertRaisesRegexp(TypeError, 'shape dimensions must be integer'):
fc.numeric_column(
'aaa', shape=[
1.0,
])
with self.assertRaisesRegexp(ValueError,
'shape dimensions must be greater than 0'):
fc.numeric_column(
'aaa', shape=[
0,
])
def test_dtype_is_convertible_to_float(self):
with self.assertRaisesRegexp(ValueError,
'dtype must be convertible to float'):
fc.numeric_column('aaa', dtype=dtypes.string)
def test_scalar_default_value_fills_the_shape(self):
a = fc.numeric_column('aaa', shape=[2, 3], default_value=2.)
self.assertEqual(((2., 2., 2.), (2., 2., 2.)), a.default_value)
def test_parse_spec(self):
a = fc.numeric_column('aaa', shape=[2, 3], dtype=dtypes.int32)
self.assertEqual({
'aaa': parsing_ops.FixedLenFeature((2, 3), dtype=dtypes.int32)
}, a.parse_example_spec)
def test_parse_example_no_default_value(self):
price = fc.numeric_column('price', shape=[2])
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'price':
feature_pb2.Feature(float_list=feature_pb2.FloatList(
value=[20., 110.]))
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([price]))
self.assertIn('price', features)
with self.test_session():
self.assertAllEqual([[20., 110.]], features['price'].eval())
def test_parse_example_with_default_value(self):
price = fc.numeric_column('price', shape=[2], default_value=11.)
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'price':
feature_pb2.Feature(float_list=feature_pb2.FloatList(
value=[20., 110.]))
}))
no_data = example_pb2.Example(features=feature_pb2.Features(
feature={
'something_else':
feature_pb2.Feature(float_list=feature_pb2.FloatList(
value=[20., 110.]))
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString(),
no_data.SerializeToString()],
features=fc.make_parse_example_spec([price]))
self.assertIn('price', features)
with self.test_session():
self.assertAllEqual([[20., 110.], [11., 11.]], features['price'].eval())
def test_normalizer_fn_must_be_callable(self):
with self.assertRaisesRegexp(TypeError, 'must be a callable'):
fc.numeric_column('price', normalizer_fn='NotACallable')
def test_normalizer_fn_transform_feature(self):
def _increment_two(input_tensor):
return input_tensor + 2.
price = fc.numeric_column('price', shape=[2], normalizer_fn=_increment_two)
output = _transform_features({'price': [[1., 2.], [5., 6.]]}, [price], None)
with self.test_session():
self.assertAllEqual([[3., 4.], [7., 8.]], output[price].eval())
def test_get_dense_tensor(self):
def _increment_two(input_tensor):
return input_tensor + 2.
price = fc.numeric_column('price', shape=[2], normalizer_fn=_increment_two)
transformation_cache = FeatureTransformationCache({
'price': [[1., 2.], [5., 6.]]
})
self.assertEqual(
transformation_cache.get(price, None),
price.get_dense_tensor(transformation_cache, None))
def test_sparse_tensor_not_supported(self):
price = fc.numeric_column('price')
transformation_cache = FeatureTransformationCache({
'price':
sparse_tensor.SparseTensor(
indices=[[0, 0]], values=[0.3], dense_shape=[1, 1])
})
with self.assertRaisesRegexp(ValueError, 'must be a Tensor'):
price.transform_feature(transformation_cache, None)
def test_deep_copy(self):
a = fc.numeric_column('aaa', shape=[1, 2], default_value=[[3., 2.]])
a_copy = copy.deepcopy(a)
self.assertEqual(a_copy.name, 'aaa')
self.assertEqual(a_copy.shape, (1, 2))
self.assertEqual(a_copy.default_value, ((3., 2.),))
def test_numpy_default_value(self):
a = fc.numeric_column(
'aaa', shape=[1, 2], default_value=np.array([[3., 2.]]))
self.assertEqual(a.default_value, ((3., 2.),))
def test_linear_model(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default():
features = {'price': [[1.], [5.]]}
predictions = fc.linear_model(features, [price])
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
self.assertAllClose([[0.]], price_var.eval())
self.assertAllClose([[0.], [0.]], predictions.eval())
sess.run(price_var.assign([[10.]]))
self.assertAllClose([[10.], [50.]], predictions.eval())
def test_keras_linear_model(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default():
features = {'price': [[1.], [5.]]}
predictions = get_keras_linear_model_predictions(features, [price])
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
self.assertAllClose([[0.]], price_var.eval())
self.assertAllClose([[0.], [0.]], predictions.eval())
sess.run(price_var.assign([[10.]]))
self.assertAllClose([[10.], [50.]], predictions.eval())
class BucketizedColumnTest(test.TestCase):
def test_invalid_source_column_type(self):
a = fc.categorical_column_with_hash_bucket('aaa', hash_bucket_size=10)
with self.assertRaisesRegexp(
ValueError,
'source_column must be a column generated with numeric_column'):
fc.bucketized_column(a, boundaries=[0, 1])
def test_invalid_source_column_shape(self):
a = fc.numeric_column('aaa', shape=[2, 3])
with self.assertRaisesRegexp(
ValueError, 'source_column must be one-dimensional column'):
fc.bucketized_column(a, boundaries=[0, 1])
def test_invalid_boundaries(self):
a = fc.numeric_column('aaa')
with self.assertRaisesRegexp(
ValueError, 'boundaries must be a sorted list'):
fc.bucketized_column(a, boundaries=None)
with self.assertRaisesRegexp(
ValueError, 'boundaries must be a sorted list'):
fc.bucketized_column(a, boundaries=1.)
with self.assertRaisesRegexp(
ValueError, 'boundaries must be a sorted list'):
fc.bucketized_column(a, boundaries=[1, 0])
with self.assertRaisesRegexp(
ValueError, 'boundaries must be a sorted list'):
fc.bucketized_column(a, boundaries=[1, 1])
def test_name(self):
a = fc.numeric_column('aaa', dtype=dtypes.int32)
b = fc.bucketized_column(a, boundaries=[0, 1])
self.assertEqual('aaa_bucketized', b.name)
def test_parse_spec(self):
a = fc.numeric_column('aaa', shape=[2], dtype=dtypes.int32)
b = fc.bucketized_column(a, boundaries=[0, 1])
self.assertEqual({
'aaa': parsing_ops.FixedLenFeature((2,), dtype=dtypes.int32)
}, b.parse_example_spec)
def test_variable_shape(self):
a = fc.numeric_column('aaa', shape=[2], dtype=dtypes.int32)
b = fc.bucketized_column(a, boundaries=[0, 1])
# Column 'aaa` has shape [2] times three buckets -> variable_shape=[2, 3].
self.assertAllEqual((2, 3), b.variable_shape)
def test_num_buckets(self):
a = fc.numeric_column('aaa', shape=[2], dtype=dtypes.int32)
b = fc.bucketized_column(a, boundaries=[0, 1])
# Column 'aaa` has shape [2] times three buckets -> num_buckets=6.
self.assertEqual(6, b.num_buckets)
def test_parse_example(self):
price = fc.numeric_column('price', shape=[2])
bucketized_price = fc.bucketized_column(price, boundaries=[0, 50])
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'price':
feature_pb2.Feature(float_list=feature_pb2.FloatList(
value=[20., 110.]))
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([bucketized_price]))
self.assertIn('price', features)
with self.test_session():
self.assertAllEqual([[20., 110.]], features['price'].eval())
def test_transform_feature(self):
price = fc.numeric_column('price', shape=[2])
bucketized_price = fc.bucketized_column(price, boundaries=[0, 2, 4, 6])
with ops.Graph().as_default():
transformed_tensor = _transform_features({
'price': [[-1., 1.], [5., 6.]]
}, [bucketized_price], None)
with _initialized_session():
self.assertAllEqual([[0, 1], [3, 4]],
transformed_tensor[bucketized_price].eval())
def test_get_dense_tensor_one_input_value(self):
"""Tests _get_dense_tensor() for input with shape=[1]."""
price = fc.numeric_column('price', shape=[1])
bucketized_price = fc.bucketized_column(price, boundaries=[0, 2, 4, 6])
with ops.Graph().as_default():
transformation_cache = FeatureTransformationCache({
'price': [[-1.], [1.], [5.], [6.]]
})
with _initialized_session():
bucketized_price_tensor = bucketized_price.get_dense_tensor(
transformation_cache, None)
self.assertAllClose(
# One-hot tensor.
[[[1., 0., 0., 0., 0.]],
[[0., 1., 0., 0., 0.]],
[[0., 0., 0., 1., 0.]],
[[0., 0., 0., 0., 1.]]],
bucketized_price_tensor.eval())
def test_get_dense_tensor_two_input_values(self):
"""Tests _get_dense_tensor() for input with shape=[2]."""
price = fc.numeric_column('price', shape=[2])
bucketized_price = fc.bucketized_column(price, boundaries=[0, 2, 4, 6])
with ops.Graph().as_default():
transformation_cache = FeatureTransformationCache({
'price': [[-1., 1.], [5., 6.]]
})
with _initialized_session():
bucketized_price_tensor = bucketized_price.get_dense_tensor(
transformation_cache, None)
self.assertAllClose(
# One-hot tensor.
[[[1., 0., 0., 0., 0.], [0., 1., 0., 0., 0.]],
[[0., 0., 0., 1., 0.], [0., 0., 0., 0., 1.]]],
bucketized_price_tensor.eval())
def test_get_sparse_tensors_one_input_value(self):
"""Tests _get_sparse_tensors() for input with shape=[1]."""
price = fc.numeric_column('price', shape=[1])
bucketized_price = fc.bucketized_column(price, boundaries=[0, 2, 4, 6])
with ops.Graph().as_default():
transformation_cache = FeatureTransformationCache({
'price': [[-1.], [1.], [5.], [6.]]
})
with _initialized_session() as sess:
id_weight_pair = bucketized_price.get_sparse_tensors(
transformation_cache, None)
self.assertIsNone(id_weight_pair.weight_tensor)
id_tensor_value = sess.run(id_weight_pair.id_tensor)
self.assertAllEqual(
[[0, 0], [1, 0], [2, 0], [3, 0]], id_tensor_value.indices)
self.assertAllEqual([0, 1, 3, 4], id_tensor_value.values)
self.assertAllEqual([4, 1], id_tensor_value.dense_shape)
def test_get_sparse_tensors_two_input_values(self):
"""Tests _get_sparse_tensors() for input with shape=[2]."""
price = fc.numeric_column('price', shape=[2])
bucketized_price = fc.bucketized_column(price, boundaries=[0, 2, 4, 6])
with ops.Graph().as_default():
transformation_cache = FeatureTransformationCache({
'price': [[-1., 1.], [5., 6.]]
})
with _initialized_session() as sess:
id_weight_pair = bucketized_price.get_sparse_tensors(
transformation_cache, None)
self.assertIsNone(id_weight_pair.weight_tensor)
id_tensor_value = sess.run(id_weight_pair.id_tensor)
self.assertAllEqual(
[[0, 0], [0, 1], [1, 0], [1, 1]], id_tensor_value.indices)
# Values 0-4 correspond to the first column of the input price.
# Values 5-9 correspond to the second column of the input price.
self.assertAllEqual([0, 6, 3, 9], id_tensor_value.values)
self.assertAllEqual([2, 2], id_tensor_value.dense_shape)
def test_sparse_tensor_input_not_supported(self):
price = fc.numeric_column('price')
bucketized_price = fc.bucketized_column(price, boundaries=[0, 1])
transformation_cache = FeatureTransformationCache({
'price':
sparse_tensor.SparseTensor(
indices=[[0, 0]], values=[0.3], dense_shape=[1, 1])
})
with self.assertRaisesRegexp(ValueError, 'must be a Tensor'):
bucketized_price.transform_feature(transformation_cache, None)
def test_deep_copy(self):
a = fc.numeric_column('aaa', shape=[2])
a_bucketized = fc.bucketized_column(a, boundaries=[0, 1])
a_bucketized_copy = copy.deepcopy(a_bucketized)
self.assertEqual(a_bucketized_copy.name, 'aaa_bucketized')
self.assertAllEqual(a_bucketized_copy.variable_shape, (2, 3))
self.assertEqual(a_bucketized_copy.boundaries, (0, 1))
def test_linear_model_one_input_value(self):
"""Tests linear_model() for input with shape=[1]."""
price = fc_old.numeric_column('price', shape=[1])
bucketized_price = fc_old.bucketized_column(price, boundaries=[0, 2, 4, 6])
with ops.Graph().as_default():
features = {'price': [[-1.], [1.], [5.], [6.]]}
predictions = fc.linear_model(features, [bucketized_price])
bias = get_linear_model_bias()
bucketized_price_var = get_linear_model_column_var(bucketized_price)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
# One weight variable per bucket, all initialized to zero.
self.assertAllClose(
[[0.], [0.], [0.], [0.], [0.]], bucketized_price_var.eval())
self.assertAllClose([[0.], [0.], [0.], [0.]], predictions.eval())
sess.run(bucketized_price_var.assign(
[[10.], [20.], [30.], [40.], [50.]]))
# price -1. is in the 0th bucket, whose weight is 10.
# price 1. is in the 1st bucket, whose weight is 20.
# price 5. is in the 3rd bucket, whose weight is 40.
# price 6. is in the 4th bucket, whose weight is 50.
self.assertAllClose([[10.], [20.], [40.], [50.]], predictions.eval())
sess.run(bias.assign([1.]))
self.assertAllClose([[11.], [21.], [41.], [51.]], predictions.eval())
def test_linear_model_two_input_values(self):
"""Tests linear_model() for input with shape=[2]."""
price = fc_old.numeric_column('price', shape=[2])
bucketized_price = fc_old.bucketized_column(price, boundaries=[0, 2, 4, 6])
with ops.Graph().as_default():
features = {'price': [[-1., 1.], [5., 6.]]}
predictions = fc.linear_model(features, [bucketized_price])
bias = get_linear_model_bias()
bucketized_price_var = get_linear_model_column_var(bucketized_price)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
# One weight per bucket per input column, all initialized to zero.
self.assertAllClose(
[[0.], [0.], [0.], [0.], [0.], [0.], [0.], [0.], [0.], [0.]],
bucketized_price_var.eval())
self.assertAllClose([[0.], [0.]], predictions.eval())
sess.run(bucketized_price_var.assign(
[[10.], [20.], [30.], [40.], [50.],
[60.], [70.], [80.], [90.], [100.]]))
# 1st example:
# price -1. is in the 0th bucket, whose weight is 10.
# price 1. is in the 6th bucket, whose weight is 70.
# 2nd example:
# price 5. is in the 3rd bucket, whose weight is 40.
# price 6. is in the 9th bucket, whose weight is 100.
self.assertAllClose([[80.], [140.]], predictions.eval())
sess.run(bias.assign([1.]))
self.assertAllClose([[81.], [141.]], predictions.eval())
def test_keras_linear_model_one_input_value(self):
"""Tests _LinearModel for input with shape=[1]."""
price = fc_old.numeric_column('price', shape=[1])
bucketized_price = fc_old.bucketized_column(price, boundaries=[0, 2, 4, 6])
with ops.Graph().as_default():
features = {'price': [[-1.], [1.], [5.], [6.]]}
predictions = get_keras_linear_model_predictions(features,
[bucketized_price])
bias = get_linear_model_bias()
bucketized_price_var = get_linear_model_column_var(bucketized_price)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
# One weight variable per bucket, all initialized to zero.
self.assertAllClose([[0.], [0.], [0.], [0.], [0.]],
bucketized_price_var.eval())
self.assertAllClose([[0.], [0.], [0.], [0.]], predictions.eval())
sess.run(
bucketized_price_var.assign([[10.], [20.], [30.], [40.], [50.]]))
# price -1. is in the 0th bucket, whose weight is 10.
# price 1. is in the 1st bucket, whose weight is 20.
# price 5. is in the 3rd bucket, whose weight is 40.
# price 6. is in the 4th bucket, whose weight is 50.
self.assertAllClose([[10.], [20.], [40.], [50.]], predictions.eval())
sess.run(bias.assign([1.]))
self.assertAllClose([[11.], [21.], [41.], [51.]], predictions.eval())
def test_keras_linear_model_two_input_values(self):
"""Tests _LinearModel for input with shape=[2]."""
price = fc_old.numeric_column('price', shape=[2])
bucketized_price = fc_old.bucketized_column(price, boundaries=[0, 2, 4, 6])
with ops.Graph().as_default():
features = {'price': [[-1., 1.], [5., 6.]]}
predictions = get_keras_linear_model_predictions(features,
[bucketized_price])
bias = get_linear_model_bias()
bucketized_price_var = get_linear_model_column_var(bucketized_price)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
# One weight per bucket per input column, all initialized to zero.
self.assertAllClose(
[[0.], [0.], [0.], [0.], [0.], [0.], [0.], [0.], [0.], [0.]],
bucketized_price_var.eval())
self.assertAllClose([[0.], [0.]], predictions.eval())
sess.run(
bucketized_price_var.assign([[10.], [20.], [30.], [40.], [50.],
[60.], [70.], [80.], [90.], [100.]]))
# 1st example:
# price -1. is in the 0th bucket, whose weight is 10.
# price 1. is in the 6th bucket, whose weight is 70.
# 2nd example:
# price 5. is in the 3rd bucket, whose weight is 40.
# price 6. is in the 9th bucket, whose weight is 100.
self.assertAllClose([[80.], [140.]], predictions.eval())
sess.run(bias.assign([1.]))
self.assertAllClose([[81.], [141.]], predictions.eval())
class HashedCategoricalColumnTest(test.TestCase):
def test_defaults(self):
a = fc.categorical_column_with_hash_bucket('aaa', 10)
self.assertEqual('aaa', a.name)
self.assertEqual('aaa', a.key)
self.assertEqual(10, a.hash_bucket_size)
self.assertEqual(dtypes.string, a.dtype)
def test_key_should_be_string(self):
with self.assertRaisesRegexp(ValueError, 'key must be a string.'):
fc.categorical_column_with_hash_bucket(('key',), 10)
def test_bucket_size_should_be_given(self):
with self.assertRaisesRegexp(ValueError, 'hash_bucket_size must be set.'):
fc.categorical_column_with_hash_bucket('aaa', None)
def test_bucket_size_should_be_positive(self):
with self.assertRaisesRegexp(ValueError,
'hash_bucket_size must be at least 1'):
fc.categorical_column_with_hash_bucket('aaa', 0)
def test_dtype_should_be_string_or_integer(self):
fc.categorical_column_with_hash_bucket('aaa', 10, dtype=dtypes.string)
fc.categorical_column_with_hash_bucket('aaa', 10, dtype=dtypes.int32)
with self.assertRaisesRegexp(ValueError, 'dtype must be string or integer'):
fc.categorical_column_with_hash_bucket('aaa', 10, dtype=dtypes.float32)
def test_deep_copy(self):
original = fc.categorical_column_with_hash_bucket('aaa', 10)
for column in (original, copy.deepcopy(original)):
self.assertEqual('aaa', column.name)
self.assertEqual(10, column.hash_bucket_size)
self.assertEqual(10, column.num_buckets)
self.assertEqual(dtypes.string, column.dtype)
def test_parse_spec_string(self):
a = fc.categorical_column_with_hash_bucket('aaa', 10)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.string)
}, a.parse_example_spec)
def test_parse_spec_int(self):
a = fc.categorical_column_with_hash_bucket('aaa', 10, dtype=dtypes.int32)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int32)
}, a.parse_example_spec)
def test_parse_example(self):
a = fc.categorical_column_with_hash_bucket('aaa', 10)
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'aaa':
feature_pb2.Feature(bytes_list=feature_pb2.BytesList(
value=[b'omar', b'stringer']))
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([a]))
self.assertIn('aaa', features)
with self.test_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=[[0, 0], [0, 1]],
values=np.array([b'omar', b'stringer'], dtype=np.object_),
dense_shape=[1, 2]),
features['aaa'].eval())
def test_strings_should_be_hashed(self):
hashed_sparse = fc.categorical_column_with_hash_bucket('wire', 10)
wire_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'],
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
outputs = _transform_features({'wire': wire_tensor}, [hashed_sparse], None)
output = outputs[hashed_sparse]
# Check exact hashed output. If hashing changes this test will break.
expected_values = [6, 4, 1]
with self.test_session():
self.assertEqual(dtypes.int64, output.values.dtype)
self.assertAllEqual(expected_values, output.values.eval())
self.assertAllEqual(wire_tensor.indices.eval(), output.indices.eval())
self.assertAllEqual(wire_tensor.dense_shape.eval(),
output.dense_shape.eval())
def test_tensor_dtype_should_be_string_or_integer(self):
string_fc = fc.categorical_column_with_hash_bucket(
'a_string', 10, dtype=dtypes.string)
int_fc = fc.categorical_column_with_hash_bucket(
'a_int', 10, dtype=dtypes.int32)
float_fc = fc.categorical_column_with_hash_bucket(
'a_float', 10, dtype=dtypes.string)
int_tensor = sparse_tensor.SparseTensor(
values=[101],
indices=[[0, 0]],
dense_shape=[1, 1])
string_tensor = sparse_tensor.SparseTensor(
values=['101'],
indices=[[0, 0]],
dense_shape=[1, 1])
float_tensor = sparse_tensor.SparseTensor(
values=[101.],
indices=[[0, 0]],
dense_shape=[1, 1])
transformation_cache = FeatureTransformationCache({
'a_int': int_tensor,
'a_string': string_tensor,
'a_float': float_tensor
})
transformation_cache.get(string_fc, None)
transformation_cache.get(int_fc, None)
with self.assertRaisesRegexp(ValueError, 'dtype must be string or integer'):
transformation_cache.get(float_fc, None)
def test_dtype_should_match_with_tensor(self):
hashed_sparse = fc.categorical_column_with_hash_bucket(
'wire', 10, dtype=dtypes.int64)
wire_tensor = sparse_tensor.SparseTensor(
values=['omar'], indices=[[0, 0]], dense_shape=[1, 1])
transformation_cache = FeatureTransformationCache({'wire': wire_tensor})
with self.assertRaisesRegexp(ValueError, 'dtype must be compatible'):
transformation_cache.get(hashed_sparse, None)
def test_ints_should_be_hashed(self):
hashed_sparse = fc.categorical_column_with_hash_bucket(
'wire', 10, dtype=dtypes.int64)
wire_tensor = sparse_tensor.SparseTensor(
values=[101, 201, 301],
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
transformation_cache = FeatureTransformationCache({'wire': wire_tensor})
output = transformation_cache.get(hashed_sparse, None)
# Check exact hashed output. If hashing changes this test will break.
expected_values = [3, 7, 5]
with self.test_session():
self.assertAllEqual(expected_values, output.values.eval())
def test_int32_64_is_compatible(self):
hashed_sparse = fc.categorical_column_with_hash_bucket(
'wire', 10, dtype=dtypes.int64)
wire_tensor = sparse_tensor.SparseTensor(
values=constant_op.constant([101, 201, 301], dtype=dtypes.int32),
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
transformation_cache = FeatureTransformationCache({'wire': wire_tensor})
output = transformation_cache.get(hashed_sparse, None)
# Check exact hashed output. If hashing changes this test will break.
expected_values = [3, 7, 5]
with self.test_session():
self.assertAllEqual(expected_values, output.values.eval())
def test_get_sparse_tensors(self):
hashed_sparse = fc.categorical_column_with_hash_bucket('wire', 10)
transformation_cache = FeatureTransformationCache({
'wire':
sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'],
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
})
id_weight_pair = hashed_sparse.get_sparse_tensors(transformation_cache,
None)
self.assertIsNone(id_weight_pair.weight_tensor)
self.assertEqual(
transformation_cache.get(hashed_sparse, None), id_weight_pair.id_tensor)
def DISABLED_test_get_sparse_tensors_weight_collections(self):
column = fc.categorical_column_with_hash_bucket('aaa', 10)
inputs = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'],
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
column._get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}),
weight_collections=('my_weights',))
self.assertItemsEqual(
[], ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES))
self.assertItemsEqual([], ops.get_collection('my_weights'))
def test_get_sparse_tensors_dense_input(self):
hashed_sparse = fc.categorical_column_with_hash_bucket('wire', 10)
transformation_cache = FeatureTransformationCache({
'wire': (('omar', ''), ('stringer', 'marlo'))
})
id_weight_pair = hashed_sparse.get_sparse_tensors(transformation_cache,
None)
self.assertIsNone(id_weight_pair.weight_tensor)
self.assertEqual(
transformation_cache.get(hashed_sparse, None), id_weight_pair.id_tensor)
def test_linear_model(self):
wire_column = fc_old.categorical_column_with_hash_bucket('wire', 4)
self.assertEqual(4, wire_column._num_buckets)
with ops.Graph().as_default():
predictions = fc.linear_model({
wire_column.name: sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
}, (wire_column,))
bias = get_linear_model_bias()
wire_var = get_linear_model_column_var(wire_column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,), (0.,)), wire_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
wire_var.assign(((1.,), (2.,), (3.,), (4.,))).eval()
# 'marlo' -> 3: wire_var[3] = 4
# 'skywalker' -> 2, 'omar' -> 2: wire_var[2] + wire_var[2] = 3+3 = 6
self.assertAllClose(((4.,), (6.,)), predictions.eval())
def test_keras_linear_model(self):
wire_column = fc_old.categorical_column_with_hash_bucket('wire', 4)
self.assertEqual(4, wire_column._num_buckets)
with ops.Graph().as_default():
predictions = get_keras_linear_model_predictions({
wire_column.name:
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
}, (wire_column,))
bias = get_linear_model_bias()
wire_var = get_linear_model_column_var(wire_column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,), (0.,)), wire_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
wire_var.assign(((1.,), (2.,), (3.,), (4.,))).eval()
# 'marlo' -> 3: wire_var[3] = 4
# 'skywalker' -> 2, 'omar' -> 2: wire_var[2] + wire_var[2] = 3+3 = 6
self.assertAllClose(((4.,), (6.,)), predictions.eval())
class CrossedColumnTest(test.TestCase):
def test_keys_empty(self):
with self.assertRaisesRegexp(
ValueError, 'keys must be a list with length > 1'):
fc.crossed_column([], 10)
def test_keys_length_one(self):
with self.assertRaisesRegexp(
ValueError, 'keys must be a list with length > 1'):
fc.crossed_column(['a'], 10)
def test_key_type_unsupported(self):
with self.assertRaisesRegexp(ValueError, 'Unsupported key type'):
fc.crossed_column(['a', fc.numeric_column('c')], 10)
with self.assertRaisesRegexp(
ValueError, 'categorical_column_with_hash_bucket is not supported'):
fc.crossed_column(
['a', fc.categorical_column_with_hash_bucket('c', 10)], 10)
def test_hash_bucket_size_negative(self):
with self.assertRaisesRegexp(
ValueError, 'hash_bucket_size must be > 1'):
fc.crossed_column(['a', 'c'], -1)
def test_hash_bucket_size_zero(self):
with self.assertRaisesRegexp(
ValueError, 'hash_bucket_size must be > 1'):
fc.crossed_column(['a', 'c'], 0)
def test_hash_bucket_size_none(self):
with self.assertRaisesRegexp(
ValueError, 'hash_bucket_size must be > 1'):
fc.crossed_column(['a', 'c'], None)
def test_name(self):
a = fc.numeric_column('a', dtype=dtypes.int32)
b = fc.bucketized_column(a, boundaries=[0, 1])
crossed1 = fc.crossed_column(['d1', 'd2'], 10)
crossed2 = fc.crossed_column([b, 'c', crossed1], 10)
self.assertEqual('a_bucketized_X_c_X_d1_X_d2', crossed2.name)
def test_name_ordered_alphabetically(self):
"""Tests that the name does not depend on the order of given columns."""
a = fc.numeric_column('a', dtype=dtypes.int32)
b = fc.bucketized_column(a, boundaries=[0, 1])
crossed1 = fc.crossed_column(['d1', 'd2'], 10)
crossed2 = fc.crossed_column([crossed1, 'c', b], 10)
self.assertEqual('a_bucketized_X_c_X_d1_X_d2', crossed2.name)
def test_name_leaf_keys_ordered_alphabetically(self):
"""Tests that the name does not depend on the order of given columns."""
a = fc.numeric_column('a', dtype=dtypes.int32)
b = fc.bucketized_column(a, boundaries=[0, 1])
crossed1 = fc.crossed_column(['d2', 'c'], 10)
crossed2 = fc.crossed_column([crossed1, 'd1', b], 10)
self.assertEqual('a_bucketized_X_c_X_d1_X_d2', crossed2.name)
def test_parse_spec(self):
a = fc.numeric_column('a', shape=[2], dtype=dtypes.int32)
b = fc.bucketized_column(a, boundaries=[0, 1])
crossed = fc.crossed_column([b, 'c'], 10)
self.assertEqual({
'a': parsing_ops.FixedLenFeature((2,), dtype=dtypes.int32),
'c': parsing_ops.VarLenFeature(dtypes.string),
}, crossed.parse_example_spec)
def test_num_buckets(self):
a = fc.numeric_column('a', shape=[2], dtype=dtypes.int32)
b = fc.bucketized_column(a, boundaries=[0, 1])
crossed = fc.crossed_column([b, 'c'], 15)
self.assertEqual(15, crossed.num_buckets)
def test_deep_copy(self):
a = fc.numeric_column('a', dtype=dtypes.int32)
b = fc.bucketized_column(a, boundaries=[0, 1])
crossed1 = fc.crossed_column(['d1', 'd2'], 10)
crossed2 = fc.crossed_column([b, 'c', crossed1], 15, hash_key=5)
crossed2_copy = copy.deepcopy(crossed2)
self.assertEqual('a_bucketized_X_c_X_d1_X_d2', crossed2_copy.name,)
self.assertEqual(15, crossed2_copy.hash_bucket_size)
self.assertEqual(5, crossed2_copy.hash_key)
def test_parse_example(self):
price = fc.numeric_column('price', shape=[2])
bucketized_price = fc.bucketized_column(price, boundaries=[0, 50])
price_cross_wire = fc.crossed_column([bucketized_price, 'wire'], 10)
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'price':
feature_pb2.Feature(float_list=feature_pb2.FloatList(
value=[20., 110.])),
'wire':
feature_pb2.Feature(bytes_list=feature_pb2.BytesList(
value=[b'omar', b'stringer'])),
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([price_cross_wire]))
self.assertIn('price', features)
self.assertIn('wire', features)
with self.test_session():
self.assertAllEqual([[20., 110.]], features['price'].eval())
wire_sparse = features['wire']
self.assertAllEqual([[0, 0], [0, 1]], wire_sparse.indices.eval())
# Use byte constants to pass the open-source test.
self.assertAllEqual([b'omar', b'stringer'], wire_sparse.values.eval())
self.assertAllEqual([1, 2], wire_sparse.dense_shape.eval())
def test_transform_feature(self):
price = fc.numeric_column('price', shape=[2])
bucketized_price = fc.bucketized_column(price, boundaries=[0, 50])
hash_bucket_size = 10
price_cross_wire = fc.crossed_column(
[bucketized_price, 'wire'], hash_bucket_size)
features = {
'price': constant_op.constant([[1., 2.], [5., 6.]]),
'wire': sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'],
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2]),
}
outputs = _transform_features(features, [price_cross_wire], None)
output = outputs[price_cross_wire]
with self.test_session() as sess:
output_val = sess.run(output)
self.assertAllEqual(
[[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [1, 3]], output_val.indices)
for val in output_val.values:
self.assertIn(val, list(range(hash_bucket_size)))
self.assertAllEqual([2, 4], output_val.dense_shape)
def test_get_sparse_tensors(self):
a = fc.numeric_column('a', dtype=dtypes.int32, shape=(2,))
b = fc.bucketized_column(a, boundaries=(0, 1))
crossed1 = fc.crossed_column(['d1', 'd2'], 10)
crossed2 = fc.crossed_column([b, 'c', crossed1], 15, hash_key=5)
with ops.Graph().as_default():
transformation_cache = FeatureTransformationCache({
'a':
constant_op.constant(((-1., .5), (.5, 1.))),
'c':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=['cA', 'cB', 'cC'],
dense_shape=(2, 2)),
'd1':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=['d1A', 'd1B', 'd1C'],
dense_shape=(2, 2)),
'd2':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=['d2A', 'd2B', 'd2C'],
dense_shape=(2, 2)),
})
id_weight_pair = crossed2.get_sparse_tensors(transformation_cache, None)
with _initialized_session():
id_tensor_eval = id_weight_pair.id_tensor.eval()
self.assertAllEqual(
((0, 0), (0, 1), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),
(1, 6), (1, 7), (1, 8), (1, 9), (1, 10), (1, 11), (1, 12), (1, 13),
(1, 14), (1, 15)),
id_tensor_eval.indices)
# Check exact hashed output. If hashing changes this test will break.
# All values are within [0, hash_bucket_size).
expected_values = (
6, 14, 0, 13, 8, 8, 10, 12, 2, 0, 1, 9, 8, 12, 2, 0, 10, 11)
self.assertAllEqual(expected_values, id_tensor_eval.values)
self.assertAllEqual((2, 16), id_tensor_eval.dense_shape)
def test_get_sparse_tensors_simple(self):
"""Same as test_get_sparse_tensors, but with simpler values."""
a = fc.numeric_column('a', dtype=dtypes.int32, shape=(2,))
b = fc.bucketized_column(a, boundaries=(0, 1))
crossed = fc.crossed_column([b, 'c'], hash_bucket_size=5, hash_key=5)
with ops.Graph().as_default():
transformation_cache = FeatureTransformationCache({
'a':
constant_op.constant(((-1., .5), (.5, 1.))),
'c':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=['cA', 'cB', 'cC'],
dense_shape=(2, 2)),
})
id_weight_pair = crossed.get_sparse_tensors(transformation_cache, None)
with _initialized_session():
id_tensor_eval = id_weight_pair.id_tensor.eval()
self.assertAllEqual(
((0, 0), (0, 1), (1, 0), (1, 1), (1, 2), (1, 3)),
id_tensor_eval.indices)
# Check exact hashed output. If hashing changes this test will break.
# All values are within [0, hash_bucket_size).
expected_values = (1, 0, 1, 3, 4, 2)
self.assertAllEqual(expected_values, id_tensor_eval.values)
self.assertAllEqual((2, 4), id_tensor_eval.dense_shape)
def test_linear_model(self):
"""Tests linear_model.
Uses data from test_get_sparse_tesnsors_simple.
"""
a = fc_old.numeric_column('a', dtype=dtypes.int32, shape=(2,))
b = fc_old.bucketized_column(a, boundaries=(0, 1))
crossed = fc_old.crossed_column([b, 'c'], hash_bucket_size=5, hash_key=5)
with ops.Graph().as_default():
predictions = fc.linear_model({
'a': constant_op.constant(((-1., .5), (.5, 1.))),
'c': sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=['cA', 'cB', 'cC'],
dense_shape=(2, 2)),
}, (crossed,))
bias = get_linear_model_bias()
crossed_var = get_linear_model_column_var(crossed)
with _initialized_session() as sess:
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(
((0.,), (0.,), (0.,), (0.,), (0.,)), crossed_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
sess.run(crossed_var.assign(((1.,), (2.,), (3.,), (4.,), (5.,))))
# Expected ids after cross = (1, 0, 1, 3, 4, 2)
self.assertAllClose(((3.,), (14.,)), predictions.eval())
sess.run(bias.assign((.1,)))
self.assertAllClose(((3.1,), (14.1,)), predictions.eval())
def test_linear_model_with_weights(self):
class _TestColumnWithWeights(fc_old._CategoricalColumn):
"""Produces sparse IDs and sparse weights."""
@property
def name(self):
return 'test_column'
@property
def _parse_example_spec(self):
return {
self.name: parsing_ops.VarLenFeature(dtypes.int32),
'{}_weights'.format(self.name): parsing_ops.VarLenFeature(
dtypes.float32),
}
@property
def _num_buckets(self):
return 5
def _transform_feature(self, inputs):
return (inputs.get(self.name),
inputs.get('{}_weights'.format(self.name)))
def _get_sparse_tensors(self, inputs, weight_collections=None,
trainable=None):
"""Populates both id_tensor and weight_tensor."""
ids_and_weights = inputs.get(self)
return fc_old._CategoricalColumn.IdWeightPair(
id_tensor=ids_and_weights[0], weight_tensor=ids_and_weights[1])
t = _TestColumnWithWeights()
crossed = fc_old.crossed_column([t, 'c'], hash_bucket_size=5, hash_key=5)
with ops.Graph().as_default():
with self.assertRaisesRegexp(
ValueError,
'crossed_column does not support weight_tensor.*{}'.format(t.name)):
fc.linear_model({
t.name: sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=[0, 1, 2],
dense_shape=(2, 2)),
'{}_weights'.format(t.name): sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=[1., 10., 2.],
dense_shape=(2, 2)),
'c': sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=['cA', 'cB', 'cC'],
dense_shape=(2, 2)),
}, (crossed,))
def test_keras_linear_model(self):
"""Tests _LinearModel.
Uses data from test_get_sparse_tesnsors_simple.
"""
a = fc_old.numeric_column('a', dtype=dtypes.int32, shape=(2,))
b = fc_old.bucketized_column(a, boundaries=(0, 1))
crossed = fc_old.crossed_column([b, 'c'], hash_bucket_size=5, hash_key=5)
with ops.Graph().as_default():
predictions = get_keras_linear_model_predictions({
'a':
constant_op.constant(((-1., .5), (.5, 1.))),
'c':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=['cA', 'cB', 'cC'],
dense_shape=(2, 2)),
}, (crossed,))
bias = get_linear_model_bias()
crossed_var = get_linear_model_column_var(crossed)
with _initialized_session() as sess:
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,), (0.,), (0.,)),
crossed_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
sess.run(crossed_var.assign(((1.,), (2.,), (3.,), (4.,), (5.,))))
# Expected ids after cross = (1, 0, 1, 3, 4, 2)
self.assertAllClose(((3.,), (14.,)), predictions.eval())
sess.run(bias.assign((.1,)))
self.assertAllClose(((3.1,), (14.1,)), predictions.eval())
def test_keras_linear_model_with_weights(self):
class _TestColumnWithWeights(fc_old._CategoricalColumn):
"""Produces sparse IDs and sparse weights."""
@property
def name(self):
return 'test_column'
@property
def _parse_example_spec(self):
return {
self.name:
parsing_ops.VarLenFeature(dtypes.int32),
'{}_weights'.format(self.name):
parsing_ops.VarLenFeature(dtypes.float32),
}
@property
def _num_buckets(self):
return 5
def _transform_feature(self, inputs):
return (inputs.get(self.name),
inputs.get('{}_weights'.format(self.name)))
def _get_sparse_tensors(self,
inputs,
weight_collections=None,
trainable=None):
"""Populates both id_tensor and weight_tensor."""
ids_and_weights = inputs.get(self)
return fc_old._CategoricalColumn.IdWeightPair(
id_tensor=ids_and_weights[0], weight_tensor=ids_and_weights[1])
t = _TestColumnWithWeights()
crossed = fc_old.crossed_column([t, 'c'], hash_bucket_size=5, hash_key=5)
with ops.Graph().as_default():
with self.assertRaisesRegexp(
ValueError,
'crossed_column does not support weight_tensor.*{}'.format(t.name)):
get_keras_linear_model_predictions({
t.name:
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=[0, 1, 2],
dense_shape=(2, 2)),
'{}_weights'.format(t.name):
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=[1., 10., 2.],
dense_shape=(2, 2)),
'c':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=['cA', 'cB', 'cC'],
dense_shape=(2, 2)),
}, (crossed,))
def get_linear_model_bias(name='linear_model'):
with variable_scope.variable_scope(name, reuse=True):
return variable_scope.get_variable('bias_weights')
def get_linear_model_column_var(column, name='linear_model'):
return ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES,
name + '/' + column.name)[0]
def get_keras_linear_model_predictions(features,
feature_columns,
units=1,
sparse_combiner='sum',
weight_collections=None,
trainable=True,
cols_to_vars=None):
keras_linear_model = _LinearModel(
feature_columns,
units,
sparse_combiner,
weight_collections,
trainable,
name='linear_model')
retval = keras_linear_model(features) # pylint: disable=not-callable
if cols_to_vars is not None:
cols_to_vars.update(keras_linear_model.cols_to_vars())
return retval
class LinearModelTest(test.TestCase):
def test_raises_if_empty_feature_columns(self):
with self.assertRaisesRegexp(ValueError,
'feature_columns must not be empty'):
fc.linear_model(features={}, feature_columns=[])
def test_should_be_feature_column(self):
with self.assertRaisesRegexp(ValueError, 'must be a _FeatureColumn'):
fc.linear_model(features={'a': [[0]]}, feature_columns='NotSupported')
def test_should_be_dense_or_categorical_column(self):
class NotSupportedColumn(fc_old._FeatureColumn):
@property
def name(self):
return 'NotSupportedColumn'
def _transform_feature(self, cache):
pass
@property
def _parse_example_spec(self):
pass
with self.assertRaisesRegexp(
ValueError, 'must be either a _DenseColumn or _CategoricalColumn'):
fc.linear_model(
features={'a': [[0]]}, feature_columns=[NotSupportedColumn()])
def test_does_not_support_dict_columns(self):
with self.assertRaisesRegexp(
ValueError, 'Expected feature_columns to be iterable, found dict.'):
fc.linear_model(
features={'a': [[0]]},
feature_columns={'a': fc_old.numeric_column('a')})
def test_raises_if_duplicate_name(self):
with self.assertRaisesRegexp(
ValueError, 'Duplicate feature column name found for columns'):
fc.linear_model(
features={'a': [[0]]},
feature_columns=[
fc_old.numeric_column('a'),
fc_old.numeric_column('a')
])
def test_dense_bias(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default():
features = {'price': [[1.], [5.]]}
predictions = fc.linear_model(features, [price])
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
sess.run(price_var.assign([[10.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[15.], [55.]], predictions.eval())
def test_sparse_bias(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default():
wire_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'], # hashed to = [2, 0, 3]
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
features = {'wire_cast': wire_tensor}
predictions = fc.linear_model(features, [wire_cast])
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
self.assertAllClose([[0.], [0.], [0.], [0.]], wire_cast_var.eval())
sess.run(wire_cast_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[1005.], [10015.]], predictions.eval())
def test_dense_and_sparse_bias(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
price = fc_old.numeric_column('price')
with ops.Graph().as_default():
wire_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'], # hashed to = [2, 0, 3]
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
features = {'wire_cast': wire_tensor, 'price': [[1.], [5.]]}
predictions = fc.linear_model(features, [wire_cast, price])
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
sess.run(wire_cast_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(bias.assign([5.]))
sess.run(price_var.assign([[10.]]))
self.assertAllClose([[1015.], [10065.]], predictions.eval())
def test_dense_and_sparse_column(self):
"""When the column is both dense and sparse, uses sparse tensors."""
class _DenseAndSparseColumn(fc_old._DenseColumn, fc_old._CategoricalColumn):
@property
def name(self):
return 'dense_and_sparse_column'
@property
def _parse_example_spec(self):
return {self.name: parsing_ops.VarLenFeature(self.dtype)}
def _transform_feature(self, inputs):
return inputs.get(self.name)
@property
def _variable_shape(self):
raise ValueError('Should not use this method.')
def _get_dense_tensor(self, inputs, weight_collections=None,
trainable=None):
raise ValueError('Should not use this method.')
@property
def _num_buckets(self):
return 4
def _get_sparse_tensors(self, inputs, weight_collections=None,
trainable=None):
sp_tensor = sparse_tensor.SparseTensor(
indices=[[0, 0], [1, 0], [1, 1]],
values=[2, 0, 3],
dense_shape=[2, 2])
return fc_old._CategoricalColumn.IdWeightPair(sp_tensor, None)
dense_and_sparse_column = _DenseAndSparseColumn()
with ops.Graph().as_default():
sp_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'],
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
features = {dense_and_sparse_column.name: sp_tensor}
predictions = fc.linear_model(features, [dense_and_sparse_column])
bias = get_linear_model_bias()
dense_and_sparse_column_var = get_linear_model_column_var(
dense_and_sparse_column)
with _initialized_session() as sess:
sess.run(dense_and_sparse_column_var.assign(
[[10.], [100.], [1000.], [10000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[1005.], [10015.]], predictions.eval())
def test_dense_multi_output(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default():
features = {'price': [[1.], [5.]]}
predictions = fc.linear_model(features, [price], units=3)
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose(np.zeros((3,)), bias.eval())
self.assertAllClose(np.zeros((1, 3)), price_var.eval())
sess.run(price_var.assign([[10., 100., 1000.]]))
sess.run(bias.assign([5., 6., 7.]))
self.assertAllClose([[15., 106., 1007.], [55., 506., 5007.]],
predictions.eval())
def test_sparse_multi_output(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default():
wire_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'], # hashed to = [2, 0, 3]
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
features = {'wire_cast': wire_tensor}
predictions = fc.linear_model(features, [wire_cast], units=3)
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
with _initialized_session() as sess:
self.assertAllClose(np.zeros((3,)), bias.eval())
self.assertAllClose(np.zeros((4, 3)), wire_cast_var.eval())
sess.run(
wire_cast_var.assign([[10., 11., 12.], [100., 110., 120.], [
1000., 1100., 1200.
], [10000., 11000., 12000.]]))
sess.run(bias.assign([5., 6., 7.]))
self.assertAllClose([[1005., 1106., 1207.], [10015., 11017., 12019.]],
predictions.eval())
def test_dense_multi_dimension(self):
price = fc_old.numeric_column('price', shape=2)
with ops.Graph().as_default():
features = {'price': [[1., 2.], [5., 6.]]}
predictions = fc.linear_model(features, [price])
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose([[0.], [0.]], price_var.eval())
sess.run(price_var.assign([[10.], [100.]]))
self.assertAllClose([[210.], [650.]], predictions.eval())
def test_sparse_multi_rank(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default():
wire_tensor = array_ops.sparse_placeholder(dtypes.string)
wire_value = sparse_tensor.SparseTensorValue(
values=['omar', 'stringer', 'marlo', 'omar'], # hashed = [2, 0, 3, 2]
indices=[[0, 0, 0], [0, 1, 0], [1, 0, 0], [1, 0, 1]],
dense_shape=[2, 2, 2])
features = {'wire_cast': wire_tensor}
predictions = fc.linear_model(features, [wire_cast])
wire_cast_var = get_linear_model_column_var(wire_cast)
with _initialized_session() as sess:
self.assertAllClose(np.zeros((4, 1)), wire_cast_var.eval())
self.assertAllClose(
np.zeros((2, 1)),
predictions.eval(feed_dict={wire_tensor: wire_value}))
sess.run(wire_cast_var.assign([[10.], [100.], [1000.], [10000.]]))
self.assertAllClose(
[[1010.], [11000.]],
predictions.eval(feed_dict={wire_tensor: wire_value}))
def test_sparse_combiner(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default():
wire_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'], # hashed to = [2, 0, 3]
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
features = {'wire_cast': wire_tensor}
predictions = fc.linear_model(
features, [wire_cast], sparse_combiner='mean')
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
with _initialized_session() as sess:
sess.run(wire_cast_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[1005.], [5010.]], predictions.eval())
def test_sparse_combiner_with_negative_weights(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
wire_cast_weights = fc_old.weighted_categorical_column(wire_cast, 'weights')
with ops.Graph().as_default():
wire_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'], # hashed to = [2, 0, 3]
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
features = {
'wire_cast': wire_tensor,
'weights': constant_op.constant([[1., 1., -1.0]])
}
predictions = fc.linear_model(
features, [wire_cast_weights], sparse_combiner='sum')
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
with _initialized_session() as sess:
sess.run(wire_cast_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[1005.], [-9985.]], predictions.eval())
def test_dense_multi_dimension_multi_output(self):
price = fc_old.numeric_column('price', shape=2)
with ops.Graph().as_default():
features = {'price': [[1., 2.], [5., 6.]]}
predictions = fc.linear_model(features, [price], units=3)
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose(np.zeros((3,)), bias.eval())
self.assertAllClose(np.zeros((2, 3)), price_var.eval())
sess.run(price_var.assign([[1., 2., 3.], [10., 100., 1000.]]))
sess.run(bias.assign([2., 3., 4.]))
self.assertAllClose([[23., 205., 2007.], [67., 613., 6019.]],
predictions.eval())
def test_raises_if_shape_mismatch(self):
price = fc_old.numeric_column('price', shape=2)
with ops.Graph().as_default():
features = {'price': [[1.], [5.]]}
with self.assertRaisesRegexp(
Exception,
r'Cannot reshape a tensor with 2 elements to shape \[2,2\]'):
fc.linear_model(features, [price])
def test_dense_reshaping(self):
price = fc_old.numeric_column('price', shape=[1, 2])
with ops.Graph().as_default():
features = {'price': [[[1., 2.]], [[5., 6.]]]}
predictions = fc.linear_model(features, [price])
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
self.assertAllClose([[0.], [0.]], price_var.eval())
self.assertAllClose([[0.], [0.]], predictions.eval())
sess.run(price_var.assign([[10.], [100.]]))
self.assertAllClose([[210.], [650.]], predictions.eval())
def test_dense_multi_column(self):
price1 = fc_old.numeric_column('price1', shape=2)
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {
'price1': [[1., 2.], [5., 6.]],
'price2': [[3.], [4.]]
}
predictions = fc.linear_model(features, [price1, price2])
bias = get_linear_model_bias()
price1_var = get_linear_model_column_var(price1)
price2_var = get_linear_model_column_var(price2)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
self.assertAllClose([[0.], [0.]], price1_var.eval())
self.assertAllClose([[0.]], price2_var.eval())
self.assertAllClose([[0.], [0.]], predictions.eval())
sess.run(price1_var.assign([[10.], [100.]]))
sess.run(price2_var.assign([[1000.]]))
sess.run(bias.assign([7.]))
self.assertAllClose([[3217.], [4657.]], predictions.eval())
def test_fills_cols_to_vars(self):
price1 = fc_old.numeric_column('price1', shape=2)
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {'price1': [[1., 2.], [5., 6.]], 'price2': [[3.], [4.]]}
cols_to_vars = {}
fc.linear_model(features, [price1, price2], cols_to_vars=cols_to_vars)
bias = get_linear_model_bias()
price1_var = get_linear_model_column_var(price1)
price2_var = get_linear_model_column_var(price2)
self.assertAllEqual(cols_to_vars['bias'], [bias])
self.assertAllEqual(cols_to_vars[price1], [price1_var])
self.assertAllEqual(cols_to_vars[price2], [price2_var])
def test_fills_cols_to_vars_partitioned_variables(self):
price1 = fc_old.numeric_column('price1', shape=2)
price2 = fc_old.numeric_column('price2', shape=3)
with ops.Graph().as_default():
features = {
'price1': [[1., 2.], [6., 7.]],
'price2': [[3., 4., 5.], [8., 9., 10.]]
}
cols_to_vars = {}
with variable_scope.variable_scope(
'linear',
partitioner=partitioned_variables.fixed_size_partitioner(2, axis=0)):
fc.linear_model(features, [price1, price2], cols_to_vars=cols_to_vars)
with _initialized_session():
self.assertEqual([0.], cols_to_vars['bias'][0].eval())
# Partitioning shards the [2, 1] price1 var into 2 [1, 1] Variables.
self.assertAllEqual([[0.]], cols_to_vars[price1][0].eval())
self.assertAllEqual([[0.]], cols_to_vars[price1][1].eval())
# Partitioning shards the [3, 1] price2 var into a [2, 1] Variable and
# a [1, 1] Variable.
self.assertAllEqual([[0.], [0.]], cols_to_vars[price2][0].eval())
self.assertAllEqual([[0.]], cols_to_vars[price2][1].eval())
def test_dense_collection(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default() as g:
features = {'price': [[1.], [5.]]}
fc.linear_model(features, [price], weight_collections=['my-vars'])
my_vars = g.get_collection('my-vars')
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
self.assertIn(bias, my_vars)
self.assertIn(price_var, my_vars)
def test_sparse_collection(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default() as g:
wire_tensor = sparse_tensor.SparseTensor(
values=['omar'], indices=[[0, 0]], dense_shape=[1, 1])
features = {'wire_cast': wire_tensor}
fc.linear_model(
features, [wire_cast], weight_collections=['my-vars'])
my_vars = g.get_collection('my-vars')
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
self.assertIn(bias, my_vars)
self.assertIn(wire_cast_var, my_vars)
def test_dense_trainable_default(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default() as g:
features = {'price': [[1.], [5.]]}
fc.linear_model(features, [price])
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
trainable_vars = g.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
self.assertIn(bias, trainable_vars)
self.assertIn(price_var, trainable_vars)
def test_sparse_trainable_default(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default() as g:
wire_tensor = sparse_tensor.SparseTensor(
values=['omar'], indices=[[0, 0]], dense_shape=[1, 1])
features = {'wire_cast': wire_tensor}
fc.linear_model(features, [wire_cast])
trainable_vars = g.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
self.assertIn(bias, trainable_vars)
self.assertIn(wire_cast_var, trainable_vars)
def test_dense_trainable_false(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default() as g:
features = {'price': [[1.], [5.]]}
fc.linear_model(features, [price], trainable=False)
trainable_vars = g.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
self.assertEqual([], trainable_vars)
def test_sparse_trainable_false(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default() as g:
wire_tensor = sparse_tensor.SparseTensor(
values=['omar'], indices=[[0, 0]], dense_shape=[1, 1])
features = {'wire_cast': wire_tensor}
fc.linear_model(features, [wire_cast], trainable=False)
trainable_vars = g.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
self.assertEqual([], trainable_vars)
def test_column_order(self):
price_a = fc_old.numeric_column('price_a')
price_b = fc_old.numeric_column('price_b')
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default() as g:
features = {
'price_a': [[1.]],
'price_b': [[3.]],
'wire_cast':
sparse_tensor.SparseTensor(
values=['omar'], indices=[[0, 0]], dense_shape=[1, 1])
}
fc.linear_model(
features, [price_a, wire_cast, price_b],
weight_collections=['my-vars'])
my_vars = g.get_collection('my-vars')
self.assertIn('price_a', my_vars[0].name)
self.assertIn('price_b', my_vars[1].name)
self.assertIn('wire_cast', my_vars[2].name)
with ops.Graph().as_default() as g:
features = {
'price_a': [[1.]],
'price_b': [[3.]],
'wire_cast':
sparse_tensor.SparseTensor(
values=['omar'], indices=[[0, 0]], dense_shape=[1, 1])
}
fc.linear_model(
features, [wire_cast, price_b, price_a],
weight_collections=['my-vars'])
my_vars = g.get_collection('my-vars')
self.assertIn('price_a', my_vars[0].name)
self.assertIn('price_b', my_vars[1].name)
self.assertIn('wire_cast', my_vars[2].name)
def test_static_batch_size_mismatch(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {
'price1': [[1.], [5.], [7.]], # batchsize = 3
'price2': [[3.], [4.]] # batchsize = 2
}
with self.assertRaisesRegexp(
ValueError,
'Batch size \(first dimension\) of each feature must be same.'): # pylint: disable=anomalous-backslash-in-string
fc.linear_model(features, [price1, price2])
def test_subset_of_static_batch_size_mismatch(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
price3 = fc_old.numeric_column('price3')
with ops.Graph().as_default():
features = {
'price1': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 3
'price2': [[3.], [4.]], # batchsize = 2
'price3': [[3.], [4.], [5.]] # batchsize = 3
}
with self.assertRaisesRegexp(
ValueError,
'Batch size \(first dimension\) of each feature must be same.'): # pylint: disable=anomalous-backslash-in-string
fc.linear_model(features, [price1, price2, price3])
def test_runtime_batch_size_mismatch(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {
'price1': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 3
'price2': [[3.], [4.]] # batchsize = 2
}
predictions = fc.linear_model(features, [price1, price2])
with _initialized_session() as sess:
with self.assertRaisesRegexp(errors.OpError,
'must have the same size and shape'):
sess.run(
predictions, feed_dict={features['price1']: [[1.], [5.], [7.]]})
def test_runtime_batch_size_matches(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {
'price1': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 2
'price2': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 2
}
predictions = fc.linear_model(features, [price1, price2])
with _initialized_session() as sess:
sess.run(
predictions,
feed_dict={
features['price1']: [[1.], [5.]],
features['price2']: [[1.], [5.]],
})
def test_with_numpy_input_fn(self):
price = fc_old.numeric_column('price')
price_buckets = fc_old.bucketized_column(
price, boundaries=[
0.,
10.,
100.,
])
body_style = fc_old.categorical_column_with_vocabulary_list(
'body-style', vocabulary_list=['hardtop', 'wagon', 'sedan'])
input_fn = numpy_io.numpy_input_fn(
x={
'price': np.array([-1., 2., 13., 104.]),
'body-style': np.array(['sedan', 'hardtop', 'wagon', 'sedan']),
},
batch_size=2,
shuffle=False)
features = input_fn()
net = fc.linear_model(features, [price_buckets, body_style])
# self.assertEqual(1 + 3 + 5, net.shape[1])
with _initialized_session() as sess:
coord = coordinator.Coordinator()
threads = queue_runner_impl.start_queue_runners(sess, coord=coord)
bias = get_linear_model_bias()
price_buckets_var = get_linear_model_column_var(price_buckets)
body_style_var = get_linear_model_column_var(body_style)
sess.run(price_buckets_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(body_style_var.assign([[-10.], [-100.], [-1000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[10 - 1000 + 5.], [100 - 10 + 5.]], sess.run(net))
coord.request_stop()
coord.join(threads)
def test_with_1d_sparse_tensor(self):
price = fc_old.numeric_column('price')
price_buckets = fc_old.bucketized_column(
price, boundaries=[
0.,
10.,
100.,
])
body_style = fc_old.categorical_column_with_vocabulary_list(
'body-style', vocabulary_list=['hardtop', 'wagon', 'sedan'])
# Provides 1-dim tensor and dense tensor.
features = {
'price': constant_op.constant([-1., 12.,]),
'body-style': sparse_tensor.SparseTensor(
indices=((0,), (1,)),
values=('sedan', 'hardtop'),
dense_shape=(2,)),
}
self.assertEqual(1, features['price'].shape.ndims)
self.assertEqual(1, features['body-style'].dense_shape.get_shape()[0])
net = fc.linear_model(features, [price_buckets, body_style])
with _initialized_session() as sess:
bias = get_linear_model_bias()
price_buckets_var = get_linear_model_column_var(price_buckets)
body_style_var = get_linear_model_column_var(body_style)
sess.run(price_buckets_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(body_style_var.assign([[-10.], [-100.], [-1000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[10 - 1000 + 5.], [1000 - 10 + 5.]], sess.run(net))
def test_with_1d_unknown_shape_sparse_tensor(self):
price = fc_old.numeric_column('price')
price_buckets = fc_old.bucketized_column(
price, boundaries=[
0.,
10.,
100.,
])
body_style = fc_old.categorical_column_with_vocabulary_list(
'body-style', vocabulary_list=['hardtop', 'wagon', 'sedan'])
country = fc_old.categorical_column_with_vocabulary_list(
'country', vocabulary_list=['US', 'JP', 'CA'])
# Provides 1-dim tensor and dense tensor.
features = {
'price': array_ops.placeholder(dtypes.float32),
'body-style': array_ops.sparse_placeholder(dtypes.string),
'country': array_ops.placeholder(dtypes.string),
}
self.assertIsNone(features['price'].shape.ndims)
self.assertIsNone(features['body-style'].get_shape().ndims)
price_data = np.array([-1., 12.])
body_style_data = sparse_tensor.SparseTensorValue(
indices=((0,), (1,)),
values=('sedan', 'hardtop'),
dense_shape=(2,))
country_data = np.array(['US', 'CA'])
net = fc.linear_model(features, [price_buckets, body_style, country])
bias = get_linear_model_bias()
price_buckets_var = get_linear_model_column_var(price_buckets)
body_style_var = get_linear_model_column_var(body_style)
with _initialized_session() as sess:
sess.run(price_buckets_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(body_style_var.assign([[-10.], [-100.], [-1000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[10 - 1000 + 5.], [1000 - 10 + 5.]],
sess.run(
net,
feed_dict={
features['price']: price_data,
features['body-style']: body_style_data,
features['country']: country_data
}))
def test_with_rank_0_feature(self):
price = fc_old.numeric_column('price')
features = {
'price': constant_op.constant(0),
}
self.assertEqual(0, features['price'].shape.ndims)
# Static rank 0 should fail
with self.assertRaisesRegexp(ValueError, 'Feature .* cannot have rank 0'):
fc.linear_model(features, [price])
# Dynamic rank 0 should fail
features = {
'price': array_ops.placeholder(dtypes.float32),
}
net = fc.linear_model(features, [price])
self.assertEqual(1, net.shape[1])
with _initialized_session() as sess:
with self.assertRaisesOpError('Feature .* cannot have rank 0'):
sess.run(net, feed_dict={features['price']: np.array(1)})
def test_multiple_linear_models(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default():
features1 = {'price': [[1.], [5.]]}
features2 = {'price': [[2.], [10.]]}
predictions1 = fc.linear_model(features1, [price])
predictions2 = fc.linear_model(features2, [price])
bias1 = get_linear_model_bias(name='linear_model')
bias2 = get_linear_model_bias(name='linear_model_1')
price_var1 = get_linear_model_column_var(price, name='linear_model')
price_var2 = get_linear_model_column_var(price, name='linear_model_1')
with _initialized_session() as sess:
self.assertAllClose([0.], bias1.eval())
sess.run(price_var1.assign([[10.]]))
sess.run(bias1.assign([5.]))
self.assertAllClose([[15.], [55.]], predictions1.eval())
self.assertAllClose([0.], bias2.eval())
sess.run(price_var2.assign([[10.]]))
sess.run(bias2.assign([5.]))
self.assertAllClose([[25.], [105.]], predictions2.eval())
class _LinearModelTest(test.TestCase):
def test_raises_if_empty_feature_columns(self):
with self.assertRaisesRegexp(ValueError,
'feature_columns must not be empty'):
get_keras_linear_model_predictions(features={}, feature_columns=[])
def test_should_be_feature_column(self):
with self.assertRaisesRegexp(ValueError, 'must be a _FeatureColumn'):
get_keras_linear_model_predictions(
features={'a': [[0]]}, feature_columns='NotSupported')
def test_should_be_dense_or_categorical_column(self):
class NotSupportedColumn(fc_old._FeatureColumn):
@property
def name(self):
return 'NotSupportedColumn'
def _transform_feature(self, cache):
pass
@property
def _parse_example_spec(self):
pass
with self.assertRaisesRegexp(
ValueError, 'must be either a _DenseColumn or _CategoricalColumn'):
get_keras_linear_model_predictions(
features={'a': [[0]]}, feature_columns=[NotSupportedColumn()])
def test_does_not_support_dict_columns(self):
with self.assertRaisesRegexp(
ValueError, 'Expected feature_columns to be iterable, found dict.'):
fc.linear_model(
features={'a': [[0]]},
feature_columns={'a': fc_old.numeric_column('a')})
def test_raises_if_duplicate_name(self):
with self.assertRaisesRegexp(
ValueError, 'Duplicate feature column name found for columns'):
get_keras_linear_model_predictions(
features={'a': [[0]]},
feature_columns=[
fc_old.numeric_column('a'),
fc_old.numeric_column('a')
])
def test_dense_bias(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default():
features = {'price': [[1.], [5.]]}
predictions = get_keras_linear_model_predictions(features, [price])
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
sess.run(price_var.assign([[10.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[15.], [55.]], predictions.eval())
def test_sparse_bias(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default():
wire_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'], # hashed to = [2, 0, 3]
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
features = {'wire_cast': wire_tensor}
predictions = get_keras_linear_model_predictions(features, [wire_cast])
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
self.assertAllClose([[0.], [0.], [0.], [0.]], wire_cast_var.eval())
sess.run(wire_cast_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[1005.], [10015.]], predictions.eval())
def test_dense_and_sparse_bias(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
price = fc_old.numeric_column('price')
with ops.Graph().as_default():
wire_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'], # hashed to = [2, 0, 3]
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
features = {'wire_cast': wire_tensor, 'price': [[1.], [5.]]}
predictions = get_keras_linear_model_predictions(features,
[wire_cast, price])
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
sess.run(wire_cast_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(bias.assign([5.]))
sess.run(price_var.assign([[10.]]))
self.assertAllClose([[1015.], [10065.]], predictions.eval())
def test_dense_and_sparse_column(self):
"""When the column is both dense and sparse, uses sparse tensors."""
class _DenseAndSparseColumn(fc_old._DenseColumn, fc_old._CategoricalColumn):
@property
def name(self):
return 'dense_and_sparse_column'
@property
def _parse_example_spec(self):
return {self.name: parsing_ops.VarLenFeature(self.dtype)}
def _transform_feature(self, inputs):
return inputs.get(self.name)
@property
def _variable_shape(self):
raise ValueError('Should not use this method.')
def _get_dense_tensor(self,
inputs,
weight_collections=None,
trainable=None):
raise ValueError('Should not use this method.')
@property
def _num_buckets(self):
return 4
def _get_sparse_tensors(self,
inputs,
weight_collections=None,
trainable=None):
sp_tensor = sparse_tensor.SparseTensor(
indices=[[0, 0], [1, 0], [1, 1]],
values=[2, 0, 3],
dense_shape=[2, 2])
return fc_old._CategoricalColumn.IdWeightPair(sp_tensor, None)
dense_and_sparse_column = _DenseAndSparseColumn()
with ops.Graph().as_default():
sp_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'],
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
features = {dense_and_sparse_column.name: sp_tensor}
predictions = get_keras_linear_model_predictions(
features, [dense_and_sparse_column])
bias = get_linear_model_bias()
dense_and_sparse_column_var = get_linear_model_column_var(
dense_and_sparse_column)
with _initialized_session() as sess:
sess.run(
dense_and_sparse_column_var.assign([[10.], [100.], [1000.],
[10000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[1005.], [10015.]], predictions.eval())
def test_dense_multi_output(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default():
features = {'price': [[1.], [5.]]}
predictions = get_keras_linear_model_predictions(
features, [price], units=3)
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose(np.zeros((3,)), bias.eval())
self.assertAllClose(np.zeros((1, 3)), price_var.eval())
sess.run(price_var.assign([[10., 100., 1000.]]))
sess.run(bias.assign([5., 6., 7.]))
self.assertAllClose([[15., 106., 1007.], [55., 506., 5007.]],
predictions.eval())
def test_sparse_multi_output(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default():
wire_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'], # hashed to = [2, 0, 3]
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
features = {'wire_cast': wire_tensor}
predictions = get_keras_linear_model_predictions(
features, [wire_cast], units=3)
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
with _initialized_session() as sess:
self.assertAllClose(np.zeros((3,)), bias.eval())
self.assertAllClose(np.zeros((4, 3)), wire_cast_var.eval())
sess.run(
wire_cast_var.assign([[10., 11., 12.], [100., 110., 120.],
[1000., 1100.,
1200.], [10000., 11000., 12000.]]))
sess.run(bias.assign([5., 6., 7.]))
self.assertAllClose([[1005., 1106., 1207.], [10015., 11017., 12019.]],
predictions.eval())
def test_dense_multi_dimension(self):
price = fc_old.numeric_column('price', shape=2)
with ops.Graph().as_default():
features = {'price': [[1., 2.], [5., 6.]]}
predictions = get_keras_linear_model_predictions(features, [price])
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose([[0.], [0.]], price_var.eval())
sess.run(price_var.assign([[10.], [100.]]))
self.assertAllClose([[210.], [650.]], predictions.eval())
def test_sparse_multi_rank(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default():
wire_tensor = array_ops.sparse_placeholder(dtypes.string)
wire_value = sparse_tensor.SparseTensorValue(
values=['omar', 'stringer', 'marlo', 'omar'], # hashed = [2, 0, 3, 2]
indices=[[0, 0, 0], [0, 1, 0], [1, 0, 0], [1, 0, 1]],
dense_shape=[2, 2, 2])
features = {'wire_cast': wire_tensor}
predictions = get_keras_linear_model_predictions(features, [wire_cast])
wire_cast_var = get_linear_model_column_var(wire_cast)
with _initialized_session() as sess:
self.assertAllClose(np.zeros((4, 1)), wire_cast_var.eval())
self.assertAllClose(
np.zeros((2, 1)),
predictions.eval(feed_dict={wire_tensor: wire_value}))
sess.run(wire_cast_var.assign([[10.], [100.], [1000.], [10000.]]))
self.assertAllClose(
[[1010.], [11000.]],
predictions.eval(feed_dict={wire_tensor: wire_value}))
def test_sparse_combiner(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default():
wire_tensor = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'], # hashed to = [2, 0, 3]
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
features = {'wire_cast': wire_tensor}
predictions = get_keras_linear_model_predictions(
features, [wire_cast], sparse_combiner='mean')
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
with _initialized_session() as sess:
sess.run(wire_cast_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[1005.], [5010.]], predictions.eval())
def test_dense_multi_dimension_multi_output(self):
price = fc_old.numeric_column('price', shape=2)
with ops.Graph().as_default():
features = {'price': [[1., 2.], [5., 6.]]}
predictions = get_keras_linear_model_predictions(
features, [price], units=3)
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose(np.zeros((3,)), bias.eval())
self.assertAllClose(np.zeros((2, 3)), price_var.eval())
sess.run(price_var.assign([[1., 2., 3.], [10., 100., 1000.]]))
sess.run(bias.assign([2., 3., 4.]))
self.assertAllClose([[23., 205., 2007.], [67., 613., 6019.]],
predictions.eval())
def test_raises_if_shape_mismatch(self):
price = fc_old.numeric_column('price', shape=2)
with ops.Graph().as_default():
features = {'price': [[1.], [5.]]}
with self.assertRaisesRegexp(
Exception,
r'Cannot reshape a tensor with 2 elements to shape \[2,2\]'):
get_keras_linear_model_predictions(features, [price])
def test_dense_reshaping(self):
price = fc_old.numeric_column('price', shape=[1, 2])
with ops.Graph().as_default():
features = {'price': [[[1., 2.]], [[5., 6.]]]}
predictions = get_keras_linear_model_predictions(features, [price])
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
self.assertAllClose([[0.], [0.]], price_var.eval())
self.assertAllClose([[0.], [0.]], predictions.eval())
sess.run(price_var.assign([[10.], [100.]]))
self.assertAllClose([[210.], [650.]], predictions.eval())
def test_dense_multi_column(self):
price1 = fc_old.numeric_column('price1', shape=2)
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {'price1': [[1., 2.], [5., 6.]], 'price2': [[3.], [4.]]}
predictions = get_keras_linear_model_predictions(features,
[price1, price2])
bias = get_linear_model_bias()
price1_var = get_linear_model_column_var(price1)
price2_var = get_linear_model_column_var(price2)
with _initialized_session() as sess:
self.assertAllClose([0.], bias.eval())
self.assertAllClose([[0.], [0.]], price1_var.eval())
self.assertAllClose([[0.]], price2_var.eval())
self.assertAllClose([[0.], [0.]], predictions.eval())
sess.run(price1_var.assign([[10.], [100.]]))
sess.run(price2_var.assign([[1000.]]))
sess.run(bias.assign([7.]))
self.assertAllClose([[3217.], [4657.]], predictions.eval())
def test_fills_cols_to_vars(self):
price1 = fc_old.numeric_column('price1', shape=2)
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {'price1': [[1., 2.], [5., 6.]], 'price2': [[3.], [4.]]}
cols_to_vars = {}
get_keras_linear_model_predictions(
features, [price1, price2], cols_to_vars=cols_to_vars)
bias = get_linear_model_bias()
price1_var = get_linear_model_column_var(price1)
price2_var = get_linear_model_column_var(price2)
self.assertAllEqual(cols_to_vars['bias'], [bias])
self.assertAllEqual(cols_to_vars[price1], [price1_var])
self.assertAllEqual(cols_to_vars[price2], [price2_var])
def test_fills_cols_to_vars_partitioned_variables(self):
price1 = fc_old.numeric_column('price1', shape=2)
price2 = fc_old.numeric_column('price2', shape=3)
with ops.Graph().as_default():
features = {
'price1': [[1., 2.], [6., 7.]],
'price2': [[3., 4., 5.], [8., 9., 10.]]
}
cols_to_vars = {}
with variable_scope.variable_scope(
'linear',
partitioner=partitioned_variables.fixed_size_partitioner(2, axis=0)):
get_keras_linear_model_predictions(
features, [price1, price2], cols_to_vars=cols_to_vars)
with _initialized_session():
self.assertEqual([0.], cols_to_vars['bias'][0].eval())
# Partitioning shards the [2, 1] price1 var into 2 [1, 1] Variables.
self.assertAllEqual([[0.]], cols_to_vars[price1][0].eval())
self.assertAllEqual([[0.]], cols_to_vars[price1][1].eval())
# Partitioning shards the [3, 1] price2 var into a [2, 1] Variable and
# a [1, 1] Variable.
self.assertAllEqual([[0.], [0.]], cols_to_vars[price2][0].eval())
self.assertAllEqual([[0.]], cols_to_vars[price2][1].eval())
def test_dense_collection(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default() as g:
features = {'price': [[1.], [5.]]}
get_keras_linear_model_predictions(
features, [price], weight_collections=['my-vars'])
my_vars = g.get_collection('my-vars')
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
self.assertIn(bias, my_vars)
self.assertIn(price_var, my_vars)
def test_sparse_collection(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default() as g:
wire_tensor = sparse_tensor.SparseTensor(
values=['omar'], indices=[[0, 0]], dense_shape=[1, 1])
features = {'wire_cast': wire_tensor}
get_keras_linear_model_predictions(
features, [wire_cast], weight_collections=['my-vars'])
my_vars = g.get_collection('my-vars')
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
self.assertIn(bias, my_vars)
self.assertIn(wire_cast_var, my_vars)
def test_dense_trainable_default(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default() as g:
features = {'price': [[1.], [5.]]}
get_keras_linear_model_predictions(features, [price])
bias = get_linear_model_bias()
price_var = get_linear_model_column_var(price)
trainable_vars = g.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
self.assertIn(bias, trainable_vars)
self.assertIn(price_var, trainable_vars)
def test_sparse_trainable_default(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default() as g:
wire_tensor = sparse_tensor.SparseTensor(
values=['omar'], indices=[[0, 0]], dense_shape=[1, 1])
features = {'wire_cast': wire_tensor}
get_keras_linear_model_predictions(features, [wire_cast])
trainable_vars = g.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
bias = get_linear_model_bias()
wire_cast_var = get_linear_model_column_var(wire_cast)
self.assertIn(bias, trainable_vars)
self.assertIn(wire_cast_var, trainable_vars)
def test_dense_trainable_false(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default() as g:
features = {'price': [[1.], [5.]]}
get_keras_linear_model_predictions(features, [price], trainable=False)
trainable_vars = g.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
self.assertEqual([], trainable_vars)
def test_sparse_trainable_false(self):
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default() as g:
wire_tensor = sparse_tensor.SparseTensor(
values=['omar'], indices=[[0, 0]], dense_shape=[1, 1])
features = {'wire_cast': wire_tensor}
get_keras_linear_model_predictions(features, [wire_cast], trainable=False)
trainable_vars = g.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
self.assertEqual([], trainable_vars)
def test_column_order(self):
price_a = fc_old.numeric_column('price_a')
price_b = fc_old.numeric_column('price_b')
wire_cast = fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
with ops.Graph().as_default() as g:
features = {
'price_a': [[1.]],
'price_b': [[3.]],
'wire_cast':
sparse_tensor.SparseTensor(
values=['omar'], indices=[[0, 0]], dense_shape=[1, 1])
}
get_keras_linear_model_predictions(
features, [price_a, wire_cast, price_b],
weight_collections=['my-vars'])
my_vars = g.get_collection('my-vars')
self.assertIn('price_a', my_vars[0].name)
self.assertIn('price_b', my_vars[1].name)
self.assertIn('wire_cast', my_vars[2].name)
with ops.Graph().as_default() as g:
features = {
'price_a': [[1.]],
'price_b': [[3.]],
'wire_cast':
sparse_tensor.SparseTensor(
values=['omar'], indices=[[0, 0]], dense_shape=[1, 1])
}
get_keras_linear_model_predictions(
features, [wire_cast, price_b, price_a],
weight_collections=['my-vars'])
my_vars = g.get_collection('my-vars')
self.assertIn('price_a', my_vars[0].name)
self.assertIn('price_b', my_vars[1].name)
self.assertIn('wire_cast', my_vars[2].name)
def test_static_batch_size_mismatch(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {
'price1': [[1.], [5.], [7.]], # batchsize = 3
'price2': [[3.], [4.]] # batchsize = 2
}
with self.assertRaisesRegexp(
ValueError,
'Batch size \(first dimension\) of each feature must be same.'): # pylint: disable=anomalous-backslash-in-string
get_keras_linear_model_predictions(features, [price1, price2])
def test_subset_of_static_batch_size_mismatch(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
price3 = fc_old.numeric_column('price3')
with ops.Graph().as_default():
features = {
'price1': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 3
'price2': [[3.], [4.]], # batchsize = 2
'price3': [[3.], [4.], [5.]] # batchsize = 3
}
with self.assertRaisesRegexp(
ValueError,
'Batch size \(first dimension\) of each feature must be same.'): # pylint: disable=anomalous-backslash-in-string
get_keras_linear_model_predictions(features, [price1, price2, price3])
def test_runtime_batch_size_mismatch(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {
'price1': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 3
'price2': [[3.], [4.]] # batchsize = 2
}
predictions = get_keras_linear_model_predictions(features,
[price1, price2])
with _initialized_session() as sess:
with self.assertRaisesRegexp(errors.OpError,
'must have the same size and shape'):
sess.run(
predictions, feed_dict={features['price1']: [[1.], [5.], [7.]]})
def test_runtime_batch_size_matches(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {
'price1': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 2
'price2': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 2
}
predictions = get_keras_linear_model_predictions(features,
[price1, price2])
with _initialized_session() as sess:
sess.run(
predictions,
feed_dict={
features['price1']: [[1.], [5.]],
features['price2']: [[1.], [5.]],
})
def test_with_numpy_input_fn(self):
price = fc_old.numeric_column('price')
price_buckets = fc_old.bucketized_column(
price, boundaries=[
0.,
10.,
100.,
])
body_style = fc_old.categorical_column_with_vocabulary_list(
'body-style', vocabulary_list=['hardtop', 'wagon', 'sedan'])
input_fn = numpy_io.numpy_input_fn(
x={
'price': np.array([-1., 2., 13., 104.]),
'body-style': np.array(['sedan', 'hardtop', 'wagon', 'sedan']),
},
batch_size=2,
shuffle=False)
features = input_fn()
net = get_keras_linear_model_predictions(features,
[price_buckets, body_style])
# self.assertEqual(1 + 3 + 5, net.shape[1])
with _initialized_session() as sess:
coord = coordinator.Coordinator()
threads = queue_runner_impl.start_queue_runners(sess, coord=coord)
bias = get_linear_model_bias()
price_buckets_var = get_linear_model_column_var(price_buckets)
body_style_var = get_linear_model_column_var(body_style)
sess.run(price_buckets_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(body_style_var.assign([[-10.], [-100.], [-1000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[10 - 1000 + 5.], [100 - 10 + 5.]], sess.run(net))
coord.request_stop()
coord.join(threads)
def test_with_1d_sparse_tensor(self):
price = fc_old.numeric_column('price')
price_buckets = fc_old.bucketized_column(
price, boundaries=[
0.,
10.,
100.,
])
body_style = fc_old.categorical_column_with_vocabulary_list(
'body-style', vocabulary_list=['hardtop', 'wagon', 'sedan'])
# Provides 1-dim tensor and dense tensor.
features = {
'price':
constant_op.constant([
-1.,
12.,
]),
'body-style':
sparse_tensor.SparseTensor(
indices=((0,), (1,)),
values=('sedan', 'hardtop'),
dense_shape=(2,)),
}
self.assertEqual(1, features['price'].shape.ndims)
self.assertEqual(1, features['body-style'].dense_shape.get_shape()[0])
net = get_keras_linear_model_predictions(features,
[price_buckets, body_style])
with _initialized_session() as sess:
bias = get_linear_model_bias()
price_buckets_var = get_linear_model_column_var(price_buckets)
body_style_var = get_linear_model_column_var(body_style)
sess.run(price_buckets_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(body_style_var.assign([[-10.], [-100.], [-1000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[10 - 1000 + 5.], [1000 - 10 + 5.]], sess.run(net))
def test_with_1d_unknown_shape_sparse_tensor(self):
price = fc_old.numeric_column('price')
price_buckets = fc_old.bucketized_column(
price, boundaries=[
0.,
10.,
100.,
])
body_style = fc_old.categorical_column_with_vocabulary_list(
'body-style', vocabulary_list=['hardtop', 'wagon', 'sedan'])
country = fc_old.categorical_column_with_vocabulary_list(
'country', vocabulary_list=['US', 'JP', 'CA'])
# Provides 1-dim tensor and dense tensor.
features = {
'price': array_ops.placeholder(dtypes.float32),
'body-style': array_ops.sparse_placeholder(dtypes.string),
'country': array_ops.placeholder(dtypes.string),
}
self.assertIsNone(features['price'].shape.ndims)
self.assertIsNone(features['body-style'].get_shape().ndims)
price_data = np.array([-1., 12.])
body_style_data = sparse_tensor.SparseTensorValue(
indices=((0,), (1,)), values=('sedan', 'hardtop'), dense_shape=(2,))
country_data = np.array(['US', 'CA'])
net = get_keras_linear_model_predictions(
features, [price_buckets, body_style, country])
bias = get_linear_model_bias()
price_buckets_var = get_linear_model_column_var(price_buckets)
body_style_var = get_linear_model_column_var(body_style)
with _initialized_session() as sess:
sess.run(price_buckets_var.assign([[10.], [100.], [1000.], [10000.]]))
sess.run(body_style_var.assign([[-10.], [-100.], [-1000.]]))
sess.run(bias.assign([5.]))
self.assertAllClose([[10 - 1000 + 5.], [1000 - 10 + 5.]],
sess.run(
net,
feed_dict={
features['price']: price_data,
features['body-style']: body_style_data,
features['country']: country_data
}))
def test_with_rank_0_feature(self):
price = fc_old.numeric_column('price')
features = {
'price': constant_op.constant(0),
}
self.assertEqual(0, features['price'].shape.ndims)
# Static rank 0 should fail
with self.assertRaisesRegexp(ValueError, 'Feature .* cannot have rank 0'):
get_keras_linear_model_predictions(features, [price])
# Dynamic rank 0 should fail
features = {
'price': array_ops.placeholder(dtypes.float32),
}
net = get_keras_linear_model_predictions(features, [price])
self.assertEqual(1, net.shape[1])
with _initialized_session() as sess:
with self.assertRaisesOpError('Feature .* cannot have rank 0'):
sess.run(net, feed_dict={features['price']: np.array(1)})
class InputLayerTest(test.TestCase):
@test_util.run_in_graph_and_eager_modes()
def test_retrieving_input(self):
features = {'a': [0.]}
input_layer = InputLayer(fc_old.numeric_column('a'))
inputs = self.evaluate(input_layer(features))
self.assertAllClose([[0.]], inputs)
def test_reuses_variables(self):
with context.eager_mode():
sparse_input = sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (2, 0)),
values=(0, 1, 2),
dense_shape=(3, 3))
# Create feature columns (categorical and embedding).
categorical_column = fc_old.categorical_column_with_identity(
key='a', num_buckets=3)
embedding_dimension = 2
def _embedding_column_initializer(shape, dtype, partition_info):
del shape # unused
del dtype # unused
del partition_info # unused
embedding_values = (
(1, 0), # id 0
(0, 1), # id 1
(1, 1)) # id 2
return embedding_values
embedding_column = fc_old.embedding_column(
categorical_column,
dimension=embedding_dimension,
initializer=_embedding_column_initializer)
input_layer = InputLayer([embedding_column])
features = {'a': sparse_input}
inputs = input_layer(features)
variables = input_layer.variables
# Sanity check: test that the inputs are correct.
self.assertAllEqual([[1, 0], [0, 1], [1, 1]], inputs)
# Check that only one variable was created.
self.assertEqual(1, len(variables))
# Check that invoking input_layer on the same features does not create
# additional variables
_ = input_layer(features)
self.assertEqual(1, len(variables))
self.assertEqual(variables[0], input_layer.variables[0])
def test_feature_column_input_layer_gradient(self):
with context.eager_mode():
sparse_input = sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (2, 0)),
values=(0, 1, 2),
dense_shape=(3, 3))
# Create feature columns (categorical and embedding).
categorical_column = fc_old.categorical_column_with_identity(
key='a', num_buckets=3)
embedding_dimension = 2
def _embedding_column_initializer(shape, dtype, partition_info):
del shape # unused
del dtype # unused
del partition_info # unused
embedding_values = (
(1, 0), # id 0
(0, 1), # id 1
(1, 1)) # id 2
return embedding_values
embedding_column = fc_old.embedding_column(
categorical_column,
dimension=embedding_dimension,
initializer=_embedding_column_initializer)
input_layer = InputLayer([embedding_column])
features = {'a': sparse_input}
def scale_matrix():
matrix = input_layer(features)
return 2 * matrix
# Sanity check: Verify that scale_matrix returns the correct output.
self.assertAllEqual([[2, 0], [0, 2], [2, 2]], scale_matrix())
# Check that the returned gradient is correct.
grad_function = backprop.implicit_grad(scale_matrix)
grads_and_vars = grad_function()
indexed_slice = grads_and_vars[0][0]
gradient = grads_and_vars[0][0].values
self.assertAllEqual([0, 1, 2], indexed_slice.indices)
self.assertAllEqual([[2, 2], [2, 2], [2, 2]], gradient)
class FunctionalInputLayerTest(test.TestCase):
def test_raises_if_empty_feature_columns(self):
with self.assertRaisesRegexp(ValueError,
'feature_columns must not be empty'):
fc.input_layer(features={}, feature_columns=[])
def test_should_be_dense_column(self):
with self.assertRaisesRegexp(ValueError, 'must be a _DenseColumn'):
fc.input_layer(
features={'a': [[0]]},
feature_columns=[
fc_old.categorical_column_with_hash_bucket('wire_cast', 4)
])
def test_does_not_support_dict_columns(self):
with self.assertRaisesRegexp(
ValueError, 'Expected feature_columns to be iterable, found dict.'):
fc.input_layer(
features={'a': [[0]]},
feature_columns={'a': fc_old.numeric_column('a')})
def test_bare_column(self):
with ops.Graph().as_default():
features = features = {'a': [0.]}
net = fc.input_layer(features, fc_old.numeric_column('a'))
with _initialized_session():
self.assertAllClose([[0.]], net.eval())
def test_column_generator(self):
with ops.Graph().as_default():
features = features = {'a': [0.], 'b': [1.]}
columns = (fc_old.numeric_column(key) for key in features)
net = fc.input_layer(features, columns)
with _initialized_session():
self.assertAllClose([[0., 1.]], net.eval())
def test_raises_if_duplicate_name(self):
with self.assertRaisesRegexp(
ValueError, 'Duplicate feature column name found for columns'):
fc.input_layer(
features={'a': [[0]]},
feature_columns=[
fc_old.numeric_column('a'),
fc_old.numeric_column('a')
])
def test_one_column(self):
price = fc_old.numeric_column('price')
with ops.Graph().as_default():
features = {'price': [[1.], [5.]]}
net = fc.input_layer(features, [price])
with _initialized_session():
self.assertAllClose([[1.], [5.]], net.eval())
def test_multi_dimension(self):
price = fc_old.numeric_column('price', shape=2)
with ops.Graph().as_default():
features = {'price': [[1., 2.], [5., 6.]]}
net = fc.input_layer(features, [price])
with _initialized_session():
self.assertAllClose([[1., 2.], [5., 6.]], net.eval())
def test_raises_if_shape_mismatch(self):
price = fc_old.numeric_column('price', shape=2)
with ops.Graph().as_default():
features = {'price': [[1.], [5.]]}
with self.assertRaisesRegexp(
Exception,
r'Cannot reshape a tensor with 2 elements to shape \[2,2\]'):
fc.input_layer(features, [price])
def test_reshaping(self):
price = fc_old.numeric_column('price', shape=[1, 2])
with ops.Graph().as_default():
features = {'price': [[[1., 2.]], [[5., 6.]]]}
net = fc.input_layer(features, [price])
with _initialized_session():
self.assertAllClose([[1., 2.], [5., 6.]], net.eval())
def test_multi_column(self):
price1 = fc_old.numeric_column('price1', shape=2)
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {
'price1': [[1., 2.], [5., 6.]],
'price2': [[3.], [4.]]
}
net = fc.input_layer(features, [price1, price2])
with _initialized_session():
self.assertAllClose([[1., 2., 3.], [5., 6., 4.]], net.eval())
def test_fills_cols_to_vars(self):
# Provide three _DenseColumn's to input_layer: a _NumericColumn, a
# _BucketizedColumn, and an _EmbeddingColumn. Only the _EmbeddingColumn
# creates a Variable.
price1 = fc_old.numeric_column('price1')
dense_feature = fc_old.numeric_column('dense_feature')
dense_feature_bucketized = fc_old.bucketized_column(
dense_feature, boundaries=[0.])
some_sparse_column = fc_old.categorical_column_with_hash_bucket(
'sparse_feature', hash_bucket_size=5)
some_embedding_column = fc_old.embedding_column(
some_sparse_column, dimension=10)
with ops.Graph().as_default():
features = {
'price1': [[3.], [4.]],
'dense_feature': [[-1.], [4.]],
'sparse_feature': [['a'], ['x']],
}
cols_to_vars = {}
all_cols = [price1, dense_feature_bucketized, some_embedding_column]
fc.input_layer(features, all_cols, cols_to_vars=cols_to_vars)
self.assertItemsEqual(list(cols_to_vars.keys()), all_cols)
self.assertEqual(0, len(cols_to_vars[price1]))
self.assertEqual(0, len(cols_to_vars[dense_feature_bucketized]))
self.assertEqual(1, len(cols_to_vars[some_embedding_column]))
self.assertIsInstance(cols_to_vars[some_embedding_column][0],
variables_lib.Variable)
self.assertAllEqual(cols_to_vars[some_embedding_column][0].shape, [5, 10])
def test_fills_cols_to_vars_partitioned_variables(self):
price1 = fc_old.numeric_column('price1')
dense_feature = fc_old.numeric_column('dense_feature')
dense_feature_bucketized = fc_old.bucketized_column(
dense_feature, boundaries=[0.])
some_sparse_column = fc_old.categorical_column_with_hash_bucket(
'sparse_feature', hash_bucket_size=5)
some_embedding_column = fc_old.embedding_column(
some_sparse_column, dimension=10)
with ops.Graph().as_default():
features = {
'price1': [[3.], [4.]],
'dense_feature': [[-1.], [4.]],
'sparse_feature': [['a'], ['x']],
}
cols_to_vars = {}
all_cols = [price1, dense_feature_bucketized, some_embedding_column]
with variable_scope.variable_scope(
'input_from_feature_columns',
partitioner=partitioned_variables.fixed_size_partitioner(3, axis=0)):
fc.input_layer(features, all_cols, cols_to_vars=cols_to_vars)
self.assertItemsEqual(list(cols_to_vars.keys()), all_cols)
self.assertEqual(0, len(cols_to_vars[price1]))
self.assertEqual(0, len(cols_to_vars[dense_feature_bucketized]))
self.assertEqual(3, len(cols_to_vars[some_embedding_column]))
self.assertAllEqual(cols_to_vars[some_embedding_column][0].shape, [2, 10])
self.assertAllEqual(cols_to_vars[some_embedding_column][1].shape, [2, 10])
self.assertAllEqual(cols_to_vars[some_embedding_column][2].shape, [1, 10])
def test_column_order(self):
price_a = fc_old.numeric_column('price_a')
price_b = fc_old.numeric_column('price_b')
with ops.Graph().as_default():
features = {
'price_a': [[1.]],
'price_b': [[3.]],
}
net1 = fc.input_layer(features, [price_a, price_b])
net2 = fc.input_layer(features, [price_b, price_a])
with _initialized_session():
self.assertAllClose([[1., 3.]], net1.eval())
self.assertAllClose([[1., 3.]], net2.eval())
def test_fails_for_categorical_column(self):
animal = fc_old.categorical_column_with_identity('animal', num_buckets=4)
with ops.Graph().as_default():
features = {
'animal':
sparse_tensor.SparseTensor(
indices=[[0, 0], [0, 1]], values=[1, 2], dense_shape=[1, 2])
}
with self.assertRaisesRegexp(Exception, 'must be a _DenseColumn'):
fc.input_layer(features, [animal])
def test_static_batch_size_mismatch(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {
'price1': [[1.], [5.], [7.]], # batchsize = 3
'price2': [[3.], [4.]] # batchsize = 2
}
with self.assertRaisesRegexp(
ValueError,
'Batch size \(first dimension\) of each feature must be same.'): # pylint: disable=anomalous-backslash-in-string
fc.input_layer(features, [price1, price2])
def test_subset_of_static_batch_size_mismatch(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
price3 = fc_old.numeric_column('price3')
with ops.Graph().as_default():
features = {
'price1': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 3
'price2': [[3.], [4.]], # batchsize = 2
'price3': [[3.], [4.], [5.]] # batchsize = 3
}
with self.assertRaisesRegexp(
ValueError,
'Batch size \(first dimension\) of each feature must be same.'): # pylint: disable=anomalous-backslash-in-string
fc.input_layer(features, [price1, price2, price3])
def test_runtime_batch_size_mismatch(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {
'price1': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 3
'price2': [[3.], [4.]] # batchsize = 2
}
net = fc.input_layer(features, [price1, price2])
with _initialized_session() as sess:
with self.assertRaisesRegexp(errors.OpError,
'Dimensions of inputs should match'):
sess.run(net, feed_dict={features['price1']: [[1.], [5.], [7.]]})
def test_runtime_batch_size_matches(self):
price1 = fc_old.numeric_column('price1')
price2 = fc_old.numeric_column('price2')
with ops.Graph().as_default():
features = {
'price1': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 2
'price2': array_ops.placeholder(dtype=dtypes.int64), # batchsize = 2
}
net = fc.input_layer(features, [price1, price2])
with _initialized_session() as sess:
sess.run(
net,
feed_dict={
features['price1']: [[1.], [5.]],
features['price2']: [[1.], [5.]],
})
def test_multiple_layers_with_same_embedding_column(self):
some_sparse_column = fc_old.categorical_column_with_hash_bucket(
'sparse_feature', hash_bucket_size=5)
some_embedding_column = fc_old.embedding_column(
some_sparse_column, dimension=10)
with ops.Graph().as_default():
features = {
'sparse_feature': [['a'], ['x']],
}
all_cols = [some_embedding_column]
fc.input_layer(features, all_cols)
fc.input_layer(features, all_cols)
# Make sure that 2 variables get created in this case.
self.assertEqual(2, len(
ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)))
expected_var_names = [
'input_layer/sparse_feature_embedding/embedding_weights:0',
'input_layer_1/sparse_feature_embedding/embedding_weights:0'
]
self.assertItemsEqual(
expected_var_names,
[v.name for v in ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)])
def test_multiple_layers_with_same_shared_embedding_column(self):
categorical_column_a = fc_old.categorical_column_with_identity(
key='aaa', num_buckets=3)
categorical_column_b = fc_old.categorical_column_with_identity(
key='bbb', num_buckets=3)
embedding_dimension = 2
embedding_column_b, embedding_column_a = fc_old.shared_embedding_columns(
[categorical_column_b, categorical_column_a],
dimension=embedding_dimension)
with ops.Graph().as_default():
features = {
'aaa':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 1, 0),
dense_shape=(2, 2)),
'bbb':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=(1, 2, 1),
dense_shape=(2, 2)),
}
all_cols = [embedding_column_a, embedding_column_b]
fc.input_layer(features, all_cols)
fc.input_layer(features, all_cols)
# Make sure that only 1 variable gets created in this case.
self.assertEqual(1, len(
ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)))
self.assertItemsEqual(
['input_layer/aaa_bbb_shared_embedding/embedding_weights:0'],
[v.name for v in ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)])
def test_multiple_layers_with_same_shared_embedding_column_diff_graphs(self):
categorical_column_a = fc_old.categorical_column_with_identity(
key='aaa', num_buckets=3)
categorical_column_b = fc_old.categorical_column_with_identity(
key='bbb', num_buckets=3)
embedding_dimension = 2
embedding_column_b, embedding_column_a = fc_old.shared_embedding_columns(
[categorical_column_b, categorical_column_a],
dimension=embedding_dimension)
all_cols = [embedding_column_a, embedding_column_b]
with ops.Graph().as_default():
features = {
'aaa':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 1, 0),
dense_shape=(2, 2)),
'bbb':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=(1, 2, 1),
dense_shape=(2, 2)),
}
fc.input_layer(features, all_cols)
# Make sure that only 1 variable gets created in this case.
self.assertEqual(1, len(
ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)))
with ops.Graph().as_default():
features1 = {
'aaa':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 1, 0),
dense_shape=(2, 2)),
'bbb':
sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=(1, 2, 1),
dense_shape=(2, 2)),
}
fc.input_layer(features1, all_cols)
# Make sure that only 1 variable gets created in this case.
self.assertEqual(1, len(
ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)))
self.assertItemsEqual(
['input_layer/aaa_bbb_shared_embedding/embedding_weights:0'],
[v.name for v in ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)])
def test_with_numpy_input_fn(self):
embedding_values = (
(1., 2., 3., 4., 5.), # id 0
(6., 7., 8., 9., 10.), # id 1
(11., 12., 13., 14., 15.) # id 2
)
def _initializer(shape, dtype, partition_info):
del shape, dtype, partition_info
return embedding_values
# price has 1 dimension in input_layer
price = fc_old.numeric_column('price')
body_style = fc_old.categorical_column_with_vocabulary_list(
'body-style', vocabulary_list=['hardtop', 'wagon', 'sedan'])
# one_hot_body_style has 3 dims in input_layer.
one_hot_body_style = fc_old.indicator_column(body_style)
# embedded_body_style has 5 dims in input_layer.
embedded_body_style = fc_old.embedding_column(
body_style, dimension=5, initializer=_initializer)
input_fn = numpy_io.numpy_input_fn(
x={
'price': np.array([11., 12., 13., 14.]),
'body-style': np.array(['sedan', 'hardtop', 'wagon', 'sedan']),
},
batch_size=2,
shuffle=False)
features = input_fn()
net = fc.input_layer(features,
[price, one_hot_body_style, embedded_body_style])
self.assertEqual(1 + 3 + 5, net.shape[1])
with _initialized_session() as sess:
coord = coordinator.Coordinator()
threads = queue_runner_impl.start_queue_runners(sess, coord=coord)
# Each row is formed by concatenating `embedded_body_style`,
# `one_hot_body_style`, and `price` in order.
self.assertAllEqual(
[[11., 12., 13., 14., 15., 0., 0., 1., 11.],
[1., 2., 3., 4., 5., 1., 0., 0., 12]],
sess.run(net))
coord.request_stop()
coord.join(threads)
def test_with_1d_sparse_tensor(self):
embedding_values = (
(1., 2., 3., 4., 5.), # id 0
(6., 7., 8., 9., 10.), # id 1
(11., 12., 13., 14., 15.) # id 2
)
def _initializer(shape, dtype, partition_info):
del shape, dtype, partition_info
return embedding_values
# price has 1 dimension in input_layer
price = fc_old.numeric_column('price')
# one_hot_body_style has 3 dims in input_layer.
body_style = fc_old.categorical_column_with_vocabulary_list(
'body-style', vocabulary_list=['hardtop', 'wagon', 'sedan'])
one_hot_body_style = fc_old.indicator_column(body_style)
# embedded_body_style has 5 dims in input_layer.
country = fc_old.categorical_column_with_vocabulary_list(
'country', vocabulary_list=['US', 'JP', 'CA'])
embedded_country = fc_old.embedding_column(
country, dimension=5, initializer=_initializer)
# Provides 1-dim tensor and dense tensor.
features = {
'price': constant_op.constant([11., 12.,]),
'body-style': sparse_tensor.SparseTensor(
indices=((0,), (1,)),
values=('sedan', 'hardtop'),
dense_shape=(2,)),
# This is dense tensor for the categorical_column.
'country': constant_op.constant(['CA', 'US']),
}
self.assertEqual(1, features['price'].shape.ndims)
self.assertEqual(1, features['body-style'].dense_shape.get_shape()[0])
self.assertEqual(1, features['country'].shape.ndims)
net = fc.input_layer(features,
[price, one_hot_body_style, embedded_country])
self.assertEqual(1 + 3 + 5, net.shape[1])
with _initialized_session() as sess:
# Each row is formed by concatenating `embedded_body_style`,
# `one_hot_body_style`, and `price` in order.
self.assertAllEqual(
[[0., 0., 1., 11., 12., 13., 14., 15., 11.],
[1., 0., 0., 1., 2., 3., 4., 5., 12.]],
sess.run(net))
def test_with_1d_unknown_shape_sparse_tensor(self):
embedding_values = (
(1., 2.), # id 0
(6., 7.), # id 1
(11., 12.) # id 2
)
def _initializer(shape, dtype, partition_info):
del shape, dtype, partition_info
return embedding_values
# price has 1 dimension in input_layer
price = fc_old.numeric_column('price')
# one_hot_body_style has 3 dims in input_layer.
body_style = fc_old.categorical_column_with_vocabulary_list(
'body-style', vocabulary_list=['hardtop', 'wagon', 'sedan'])
one_hot_body_style = fc_old.indicator_column(body_style)
# embedded_body_style has 5 dims in input_layer.
country = fc_old.categorical_column_with_vocabulary_list(
'country', vocabulary_list=['US', 'JP', 'CA'])
embedded_country = fc_old.embedding_column(
country, dimension=2, initializer=_initializer)
# Provides 1-dim tensor and dense tensor.
features = {
'price': array_ops.placeholder(dtypes.float32),
'body-style': array_ops.sparse_placeholder(dtypes.string),
# This is dense tensor for the categorical_column.
'country': array_ops.placeholder(dtypes.string),
}
self.assertIsNone(features['price'].shape.ndims)
self.assertIsNone(features['body-style'].get_shape().ndims)
self.assertIsNone(features['country'].shape.ndims)
price_data = np.array([11., 12.])
body_style_data = sparse_tensor.SparseTensorValue(
indices=((0,), (1,)),
values=('sedan', 'hardtop'),
dense_shape=(2,))
country_data = np.array([['US'], ['CA']])
net = fc.input_layer(features,
[price, one_hot_body_style, embedded_country])
self.assertEqual(1 + 3 + 2, net.shape[1])
with _initialized_session() as sess:
# Each row is formed by concatenating `embedded_body_style`,
# `one_hot_body_style`, and `price` in order.
self.assertAllEqual(
[[0., 0., 1., 1., 2., 11.], [1., 0., 0., 11., 12., 12.]],
sess.run(
net,
feed_dict={
features['price']: price_data,
features['body-style']: body_style_data,
features['country']: country_data
}))
def test_with_rank_0_feature(self):
# price has 1 dimension in input_layer
price = fc_old.numeric_column('price')
features = {
'price': constant_op.constant(0),
}
self.assertEqual(0, features['price'].shape.ndims)
# Static rank 0 should fail
with self.assertRaisesRegexp(ValueError, 'Feature .* cannot have rank 0'):
fc.input_layer(features, [price])
# Dynamic rank 0 should fail
features = {
'price': array_ops.placeholder(dtypes.float32),
}
net = fc.input_layer(features, [price])
self.assertEqual(1, net.shape[1])
with _initialized_session() as sess:
with self.assertRaisesOpError('Feature .* cannot have rank 0'):
sess.run(net, feed_dict={features['price']: np.array(1)})
class MakeParseExampleSpecTest(test.TestCase):
class _TestFeatureColumn(FeatureColumn,
collections.namedtuple('_TestFeatureColumn',
('parse_spec'))):
@property
def name(self):
return "_TestFeatureColumn"
def transform_feature(self, transformation_cache, state_manager):
pass
@property
def parse_example_spec(self):
return self.parse_spec
def test_no_feature_columns(self):
actual = fc.make_parse_example_spec([])
self.assertDictEqual({}, actual)
def test_invalid_type(self):
key1 = 'key1'
parse_spec1 = parsing_ops.FixedLenFeature(
shape=(2,), dtype=dtypes.float32, default_value=0.)
with self.assertRaisesRegexp(
ValueError,
'All feature_columns must be FeatureColumn instances.*invalid_column'):
fc.make_parse_example_spec(
(self._TestFeatureColumn({key1: parse_spec1}), 'invalid_column'))
def test_one_feature_column(self):
key1 = 'key1'
parse_spec1 = parsing_ops.FixedLenFeature(
shape=(2,), dtype=dtypes.float32, default_value=0.)
actual = fc.make_parse_example_spec(
(self._TestFeatureColumn({key1: parse_spec1}),))
self.assertDictEqual({key1: parse_spec1}, actual)
def test_two_feature_columns(self):
key1 = 'key1'
parse_spec1 = parsing_ops.FixedLenFeature(
shape=(2,), dtype=dtypes.float32, default_value=0.)
key2 = 'key2'
parse_spec2 = parsing_ops.VarLenFeature(dtype=dtypes.string)
actual = fc.make_parse_example_spec(
(self._TestFeatureColumn({key1: parse_spec1}),
self._TestFeatureColumn({key2: parse_spec2})))
self.assertDictEqual({key1: parse_spec1, key2: parse_spec2}, actual)
def test_equal_keys_different_parse_spec(self):
key1 = 'key1'
parse_spec1 = parsing_ops.FixedLenFeature(
shape=(2,), dtype=dtypes.float32, default_value=0.)
parse_spec2 = parsing_ops.VarLenFeature(dtype=dtypes.string)
with self.assertRaisesRegexp(
ValueError,
'feature_columns contain different parse_spec for key key1'):
fc.make_parse_example_spec(
(self._TestFeatureColumn({key1: parse_spec1}),
self._TestFeatureColumn({key1: parse_spec2})))
def test_equal_keys_equal_parse_spec(self):
key1 = 'key1'
parse_spec1 = parsing_ops.FixedLenFeature(
shape=(2,), dtype=dtypes.float32, default_value=0.)
actual = fc.make_parse_example_spec(
(self._TestFeatureColumn({key1: parse_spec1}),
self._TestFeatureColumn({key1: parse_spec1})))
self.assertDictEqual({key1: parse_spec1}, actual)
def test_multiple_features_dict(self):
"""parse_spc for one column is a dict with length > 1."""
key1 = 'key1'
parse_spec1 = parsing_ops.FixedLenFeature(
shape=(2,), dtype=dtypes.float32, default_value=0.)
key2 = 'key2'
parse_spec2 = parsing_ops.VarLenFeature(dtype=dtypes.string)
key3 = 'key3'
parse_spec3 = parsing_ops.VarLenFeature(dtype=dtypes.int32)
actual = fc.make_parse_example_spec(
(self._TestFeatureColumn({key1: parse_spec1}),
self._TestFeatureColumn({key2: parse_spec2, key3: parse_spec3})))
self.assertDictEqual(
{key1: parse_spec1, key2: parse_spec2, key3: parse_spec3}, actual)
def _assert_sparse_tensor_value(test_case, expected, actual):
test_case.assertEqual(np.int64, np.array(actual.indices).dtype)
test_case.assertAllEqual(expected.indices, actual.indices)
test_case.assertEqual(
np.array(expected.values).dtype, np.array(actual.values).dtype)
test_case.assertAllEqual(expected.values, actual.values)
test_case.assertEqual(np.int64, np.array(actual.dense_shape).dtype)
test_case.assertAllEqual(expected.dense_shape, actual.dense_shape)
class VocabularyFileCategoricalColumnTest(test.TestCase):
def setUp(self):
super(VocabularyFileCategoricalColumnTest, self).setUp()
# Contains ints, Golden State Warriors jersey numbers: 30, 35, 11, 23, 22
self._warriors_vocabulary_file_name = test.test_src_dir_path(
'python/feature_column/testdata/warriors_vocabulary.txt')
self._warriors_vocabulary_size = 5
# Contains strings, character names from 'The Wire': omar, stringer, marlo
self._wire_vocabulary_file_name = test.test_src_dir_path(
'python/feature_column/testdata/wire_vocabulary.txt')
self._wire_vocabulary_size = 3
def test_defaults(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file='path_to_file', vocabulary_size=3)
self.assertEqual('aaa', column.name)
self.assertEqual('aaa', column.key)
self.assertEqual(3, column.num_buckets)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.string)
}, column.parse_example_spec)
def test_key_should_be_string(self):
with self.assertRaisesRegexp(ValueError, 'key must be a string.'):
fc.categorical_column_with_vocabulary_file(
key=('aaa',), vocabulary_file='path_to_file', vocabulary_size=3)
def test_all_constructor_args(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file='path_to_file', vocabulary_size=3,
num_oov_buckets=4, dtype=dtypes.int32)
self.assertEqual(7, column.num_buckets)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int32)
}, column.parse_example_spec)
def test_deep_copy(self):
original = fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file='path_to_file', vocabulary_size=3,
num_oov_buckets=4, dtype=dtypes.int32)
for column in (original, copy.deepcopy(original)):
self.assertEqual('aaa', column.name)
self.assertEqual(7, column.num_buckets)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int32)
}, column.parse_example_spec)
def test_vocabulary_file_none(self):
with self.assertRaisesRegexp(ValueError, 'Missing vocabulary_file'):
fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file=None, vocabulary_size=3)
def test_vocabulary_file_empty_string(self):
with self.assertRaisesRegexp(ValueError, 'Missing vocabulary_file'):
fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file='', vocabulary_size=3)
def test_invalid_vocabulary_file(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file='file_does_not_exist', vocabulary_size=10)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
column.get_sparse_tensors(FeatureTransformationCache({'aaa': inputs}), None)
with self.assertRaisesRegexp(errors.OpError, 'file_does_not_exist'):
with self.test_session():
lookup_ops.tables_initializer().run()
def test_invalid_vocabulary_size(self):
with self.assertRaisesRegexp(ValueError, 'Invalid vocabulary_size'):
fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=-1)
with self.assertRaisesRegexp(ValueError, 'Invalid vocabulary_size'):
fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=0)
def test_too_large_vocabulary_size(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size + 1)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
column.get_sparse_tensors(FeatureTransformationCache({'aaa': inputs}), None)
with self.assertRaisesRegexp(errors.OpError, 'Invalid vocab_size'):
with self.test_session():
lookup_ops.tables_initializer().run()
def test_invalid_num_oov_buckets(self):
with self.assertRaisesRegexp(ValueError, 'Invalid num_oov_buckets'):
fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file='path', vocabulary_size=3,
num_oov_buckets=-1)
def test_invalid_dtype(self):
with self.assertRaisesRegexp(ValueError, 'dtype must be string or integer'):
fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file='path', vocabulary_size=3,
dtype=dtypes.float64)
def test_invalid_buckets_and_default_value(self):
with self.assertRaisesRegexp(
ValueError, 'both num_oov_buckets and default_value'):
fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size,
num_oov_buckets=100,
default_value=2)
def test_invalid_input_dtype_int32(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size,
dtype=dtypes.string)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(12, 24, 36),
dense_shape=(2, 2))
with self.assertRaisesRegexp(ValueError, 'dtype must be compatible'):
column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
def test_invalid_input_dtype_string(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._warriors_vocabulary_file_name,
vocabulary_size=self._warriors_vocabulary_size,
dtype=dtypes.int32)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('omar', 'stringer', 'marlo'),
dense_shape=(2, 2))
with self.assertRaisesRegexp(ValueError, 'dtype must be compatible'):
column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
def test_parse_example(self):
a = fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file='path_to_file', vocabulary_size=3)
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'aaa':
feature_pb2.Feature(bytes_list=feature_pb2.BytesList(
value=[b'omar', b'stringer']))
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([a]))
self.assertIn('aaa', features)
with self.test_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=[[0, 0], [0, 1]],
values=np.array([b'omar', b'stringer'], dtype=np.object_),
dense_shape=[1, 2]),
features['aaa'].eval())
def test_get_sparse_tensors(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((2, -1, 0), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_none_vocabulary_size(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa', vocabulary_file=self._wire_vocabulary_file_name)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array(
(2, -1, 0), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_transform_feature(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
id_tensor = _transform_features({'aaa': inputs}, [column], None)[column]
with _initialized_session():
_assert_sparse_tensor_value(self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array(
(2, -1, 0), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_tensor.eval())
def DISABLED_test_get_sparse_tensors_weight_collections(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size)
inputs = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'],
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}),
weight_collections=('my_weights',))
self.assertItemsEqual(
[], ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES))
self.assertItemsEqual([], ops.get_collection('my_weights'))
def test_get_sparse_tensors_dense_input(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size)
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': (('marlo', ''), ('skywalker', 'omar'))
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=np.array((2, -1, 0), dtype=np.int64),
dense_shape=(2, 2)),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_default_value_in_vocabulary(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size,
default_value=2)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((2, 2, 0), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_with_oov_buckets(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size,
num_oov_buckets=100)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1), (1, 2)),
values=('marlo', 'skywalker', 'omar', 'heisenberg'),
dense_shape=(2, 3))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((2, 33, 0, 62), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_small_vocabulary_size(self):
# 'marlo' is the last entry in our vocabulary file, so be setting
# `vocabulary_size` to 1 less than number of entries in file, we take
# 'marlo' out of the vocabulary.
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size - 1)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((-1, -1, 0), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_int32(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._warriors_vocabulary_file_name,
vocabulary_size=self._warriors_vocabulary_size,
dtype=dtypes.int32)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1), (2, 2)),
values=(11, 100, 30, 22),
dense_shape=(3, 3))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((2, -1, 0, 4), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_int32_dense_input(self):
default_value = -100
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._warriors_vocabulary_file_name,
vocabulary_size=self._warriors_vocabulary_size,
dtype=dtypes.int32,
default_value=default_value)
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': ((11, -1, -1), (100, 30, -1), (-1, -1, 22))
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1), (2, 2)),
values=np.array((2, default_value, 0, 4), dtype=np.int64),
dense_shape=(3, 3)),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_int32_with_oov_buckets(self):
column = fc.categorical_column_with_vocabulary_file(
key='aaa',
vocabulary_file=self._warriors_vocabulary_file_name,
vocabulary_size=self._warriors_vocabulary_size,
dtype=dtypes.int32,
num_oov_buckets=100)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1), (2, 2)),
values=(11, 100, 30, 22),
dense_shape=(3, 3))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((2, 60, 0, 4), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_linear_model(self):
wire_column = fc_old.categorical_column_with_vocabulary_file(
key='wire',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size,
num_oov_buckets=1)
self.assertEqual(4, wire_column._num_buckets)
with ops.Graph().as_default():
predictions = fc.linear_model({
wire_column.name: sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
}, (wire_column,))
bias = get_linear_model_bias()
wire_var = get_linear_model_column_var(wire_column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,), (0.,)), wire_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
wire_var.assign(((1.,), (2.,), (3.,), (4.,))).eval()
# 'marlo' -> 2: wire_var[2] = 3
# 'skywalker' -> 3, 'omar' -> 0: wire_var[3] + wire_var[0] = 4+1 = 5
self.assertAllClose(((3.,), (5.,)), predictions.eval())
def test_keras_linear_model(self):
wire_column = fc_old.categorical_column_with_vocabulary_file(
key='wire',
vocabulary_file=self._wire_vocabulary_file_name,
vocabulary_size=self._wire_vocabulary_size,
num_oov_buckets=1)
self.assertEqual(4, wire_column._num_buckets)
with ops.Graph().as_default():
predictions = get_keras_linear_model_predictions({
wire_column.name:
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
}, (wire_column,))
bias = get_linear_model_bias()
wire_var = get_linear_model_column_var(wire_column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,), (0.,)), wire_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
wire_var.assign(((1.,), (2.,), (3.,), (4.,))).eval()
# 'marlo' -> 2: wire_var[2] = 3
# 'skywalker' -> 3, 'omar' -> 0: wire_var[3] + wire_var[0] = 4+1 = 5
self.assertAllClose(((3.,), (5.,)), predictions.eval())
class VocabularyListCategoricalColumnTest(test.TestCase):
def test_defaults_string(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=('omar', 'stringer', 'marlo'))
self.assertEqual('aaa', column.name)
self.assertEqual('aaa', column.key)
self.assertEqual(3, column.num_buckets)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.string)
}, column.parse_example_spec)
def test_key_should_be_string(self):
with self.assertRaisesRegexp(ValueError, 'key must be a string.'):
fc.categorical_column_with_vocabulary_list(
key=('aaa',), vocabulary_list=('omar', 'stringer', 'marlo'))
def test_defaults_int(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=(12, 24, 36))
self.assertEqual('aaa', column.name)
self.assertEqual('aaa', column.key)
self.assertEqual(3, column.num_buckets)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int64)
}, column.parse_example_spec)
def test_all_constructor_args(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=(12, 24, 36), dtype=dtypes.int32,
default_value=-99)
self.assertEqual(3, column.num_buckets)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int32)
}, column.parse_example_spec)
def test_deep_copy(self):
original = fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=(12, 24, 36), dtype=dtypes.int32)
for column in (original, copy.deepcopy(original)):
self.assertEqual('aaa', column.name)
self.assertEqual(3, column.num_buckets)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int32)
}, column.parse_example_spec)
def test_invalid_dtype(self):
with self.assertRaisesRegexp(ValueError, 'dtype must be string or integer'):
fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=('omar', 'stringer', 'marlo'),
dtype=dtypes.float32)
def test_invalid_mapping_dtype(self):
with self.assertRaisesRegexp(
ValueError, r'vocabulary dtype must be string or integer'):
fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=(12., 24., 36.))
def test_mismatched_int_dtype(self):
with self.assertRaisesRegexp(
ValueError, r'dtype.*and vocabulary dtype.*do not match'):
fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=('omar', 'stringer', 'marlo'),
dtype=dtypes.int32)
def test_mismatched_string_dtype(self):
with self.assertRaisesRegexp(
ValueError, r'dtype.*and vocabulary dtype.*do not match'):
fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=(12, 24, 36), dtype=dtypes.string)
def test_none_mapping(self):
with self.assertRaisesRegexp(
ValueError, r'vocabulary_list.*must be non-empty'):
fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=None)
def test_empty_mapping(self):
with self.assertRaisesRegexp(
ValueError, r'vocabulary_list.*must be non-empty'):
fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=tuple([]))
def test_duplicate_mapping(self):
with self.assertRaisesRegexp(ValueError, 'Duplicate keys'):
fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=(12, 24, 12))
def test_invalid_num_oov_buckets(self):
with self.assertRaisesRegexp(ValueError, 'Invalid num_oov_buckets'):
fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=(12, 24, 36),
num_oov_buckets=-1)
def test_invalid_buckets_and_default_value(self):
with self.assertRaisesRegexp(
ValueError, 'both num_oov_buckets and default_value'):
fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=(12, 24, 36),
num_oov_buckets=100,
default_value=2)
def test_invalid_input_dtype_int32(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=('omar', 'stringer', 'marlo'))
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(12, 24, 36),
dense_shape=(2, 2))
with self.assertRaisesRegexp(ValueError, 'dtype must be compatible'):
column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
def test_invalid_input_dtype_string(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=(12, 24, 36))
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('omar', 'stringer', 'marlo'),
dense_shape=(2, 2))
with self.assertRaisesRegexp(ValueError, 'dtype must be compatible'):
column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
def test_parse_example_string(self):
a = fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=('omar', 'stringer', 'marlo'))
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'aaa':
feature_pb2.Feature(bytes_list=feature_pb2.BytesList(
value=[b'omar', b'stringer']))
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([a]))
self.assertIn('aaa', features)
with self.test_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=[[0, 0], [0, 1]],
values=np.array([b'omar', b'stringer'], dtype=np.object_),
dense_shape=[1, 2]),
features['aaa'].eval())
def test_parse_example_int(self):
a = fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=(11, 21, 31))
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'aaa':
feature_pb2.Feature(int64_list=feature_pb2.Int64List(
value=[11, 21]))
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([a]))
self.assertIn('aaa', features)
with self.test_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=[[0, 0], [0, 1]],
values=[11, 21],
dense_shape=[1, 2]),
features['aaa'].eval())
def test_get_sparse_tensors(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=('omar', 'stringer', 'marlo'))
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((2, -1, 0), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_transform_feature(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=('omar', 'stringer', 'marlo'))
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
id_tensor = _transform_features({'aaa': inputs}, [column], None)[column]
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((2, -1, 0), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_tensor.eval())
def DISABLED_test_get_sparse_tensors_weight_collections(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=('omar', 'stringer', 'marlo'))
inputs = sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'],
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}),
weight_collections=('my_weights',))
self.assertItemsEqual(
[], ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES))
self.assertItemsEqual([], ops.get_collection('my_weights'))
def test_get_sparse_tensors_dense_input(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=('omar', 'stringer', 'marlo'))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': (('marlo', ''), ('skywalker', 'omar'))
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=np.array((2, -1, 0), dtype=np.int64),
dense_shape=(2, 2)),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_default_value_in_vocabulary(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=('omar', 'stringer', 'marlo'),
default_value=2)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((2, 2, 0), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_with_oov_buckets(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=('omar', 'stringer', 'marlo'),
num_oov_buckets=100)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1), (1, 2)),
values=('marlo', 'skywalker', 'omar', 'heisenberg'),
dense_shape=(2, 3))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((2, 33, 0, 62), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_int32(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=np.array((30, 35, 11, 23, 22), dtype=np.int32),
dtype=dtypes.int32)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1), (2, 2)),
values=np.array((11, 100, 30, 22), dtype=np.int32),
dense_shape=(3, 3))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((2, -1, 0, 4), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_int32_dense_input(self):
default_value = -100
column = fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=np.array((30, 35, 11, 23, 22), dtype=np.int32),
dtype=dtypes.int32,
default_value=default_value)
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa':
np.array(
((11, -1, -1), (100, 30, -1), (-1, -1, 22)), dtype=np.int32)
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1), (2, 2)),
values=np.array((2, default_value, 0, 4), dtype=np.int64),
dense_shape=(3, 3)),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_int32_with_oov_buckets(self):
column = fc.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=np.array((30, 35, 11, 23, 22), dtype=np.int32),
dtype=dtypes.int32,
num_oov_buckets=100)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1), (2, 2)),
values=(11, 100, 30, 22),
dense_shape=(3, 3))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((2, 60, 0, 4), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_linear_model(self):
wire_column = fc_old.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=('omar', 'stringer', 'marlo'),
num_oov_buckets=1)
self.assertEqual(4, wire_column._num_buckets)
with ops.Graph().as_default():
predictions = fc.linear_model({
wire_column.name: sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
}, (wire_column,))
bias = get_linear_model_bias()
wire_var = get_linear_model_column_var(wire_column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,), (0.,)), wire_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
wire_var.assign(((1.,), (2.,), (3.,), (4.,))).eval()
# 'marlo' -> 2: wire_var[2] = 3
# 'skywalker' -> 3, 'omar' -> 0: wire_var[3] + wire_var[0] = 4+1 = 5
self.assertAllClose(((3.,), (5.,)), predictions.eval())
def test_keras_linear_model(self):
wire_column = fc_old.categorical_column_with_vocabulary_list(
key='aaa',
vocabulary_list=('omar', 'stringer', 'marlo'),
num_oov_buckets=1)
self.assertEqual(4, wire_column._num_buckets)
with ops.Graph().as_default():
predictions = get_keras_linear_model_predictions({
wire_column.name:
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
}, (wire_column,))
bias = get_linear_model_bias()
wire_var = get_linear_model_column_var(wire_column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,), (0.,)), wire_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
wire_var.assign(((1.,), (2.,), (3.,), (4.,))).eval()
# 'marlo' -> 2: wire_var[2] = 3
# 'skywalker' -> 3, 'omar' -> 0: wire_var[3] + wire_var[0] = 4+1 = 5
self.assertAllClose(((3.,), (5.,)), predictions.eval())
class IdentityCategoricalColumnTest(test.TestCase):
def test_constructor(self):
column = fc.categorical_column_with_identity(key='aaa', num_buckets=3)
self.assertEqual('aaa', column.name)
self.assertEqual('aaa', column.key)
self.assertEqual(3, column.num_buckets)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int64)
}, column.parse_example_spec)
def test_key_should_be_string(self):
with self.assertRaisesRegexp(ValueError, 'key must be a string.'):
fc.categorical_column_with_identity(key=('aaa',), num_buckets=3)
def test_deep_copy(self):
original = fc.categorical_column_with_identity(key='aaa', num_buckets=3)
for column in (original, copy.deepcopy(original)):
self.assertEqual('aaa', column.name)
self.assertEqual(3, column.num_buckets)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int64)
}, column.parse_example_spec)
def test_invalid_num_buckets_zero(self):
with self.assertRaisesRegexp(ValueError, 'num_buckets 0 < 1'):
fc.categorical_column_with_identity(key='aaa', num_buckets=0)
def test_invalid_num_buckets_negative(self):
with self.assertRaisesRegexp(ValueError, 'num_buckets -1 < 1'):
fc.categorical_column_with_identity(key='aaa', num_buckets=-1)
def test_invalid_default_value_too_small(self):
with self.assertRaisesRegexp(ValueError, 'default_value -1 not in range'):
fc.categorical_column_with_identity(
key='aaa', num_buckets=3, default_value=-1)
def test_invalid_default_value_too_big(self):
with self.assertRaisesRegexp(ValueError, 'default_value 3 not in range'):
fc.categorical_column_with_identity(
key='aaa', num_buckets=3, default_value=3)
def test_invalid_input_dtype(self):
column = fc.categorical_column_with_identity(key='aaa', num_buckets=3)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('omar', 'stringer', 'marlo'),
dense_shape=(2, 2))
with self.assertRaisesRegexp(ValueError, 'Invalid input, not integer'):
column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
def test_parse_example(self):
a = fc.categorical_column_with_identity(key='aaa', num_buckets=30)
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'aaa':
feature_pb2.Feature(int64_list=feature_pb2.Int64List(
value=[11, 21]))
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([a]))
self.assertIn('aaa', features)
with self.test_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=[[0, 0], [0, 1]],
values=np.array([11, 21], dtype=np.int64),
dense_shape=[1, 2]),
features['aaa'].eval())
def test_get_sparse_tensors(self):
column = fc.categorical_column_with_identity(key='aaa', num_buckets=3)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 1, 0),
dense_shape=(2, 2))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((0, 1, 0), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_transform_feature(self):
column = fc.categorical_column_with_identity(key='aaa', num_buckets=3)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 1, 0),
dense_shape=(2, 2))
id_tensor = _transform_features({'aaa': inputs}, [column], None)[column]
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((0, 1, 0), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_tensor.eval())
def DISABLED_test_get_sparse_tensors_weight_collections(self):
column = fc.categorical_column_with_identity(key='aaa', num_buckets=3)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 1, 0),
dense_shape=(2, 2))
column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}),
weight_collections=('my_weights',))
self.assertItemsEqual(
[], ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES))
self.assertItemsEqual([], ops.get_collection('my_weights'))
def test_get_sparse_tensors_dense_input(self):
column = fc.categorical_column_with_identity(key='aaa', num_buckets=3)
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': ((0, -1), (1, 0))
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=np.array((0, 1, 0), dtype=np.int64),
dense_shape=(2, 2)),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_with_inputs_too_small(self):
column = fc.categorical_column_with_identity(key='aaa', num_buckets=3)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(1, -1, 0),
dense_shape=(2, 2))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
with self.assertRaisesRegexp(
errors.OpError, 'assert_greater_or_equal_0'):
id_weight_pair.id_tensor.eval()
def test_get_sparse_tensors_with_inputs_too_big(self):
column = fc.categorical_column_with_identity(key='aaa', num_buckets=3)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(1, 99, 0),
dense_shape=(2, 2))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
with self.assertRaisesRegexp(
errors.OpError, 'assert_less_than_num_buckets'):
id_weight_pair.id_tensor.eval()
def test_get_sparse_tensors_with_default_value(self):
column = fc.categorical_column_with_identity(
key='aaa', num_buckets=4, default_value=3)
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(1, -1, 99),
dense_shape=(2, 2))
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array((1, 3, 3), dtype=np.int64),
dense_shape=inputs.dense_shape),
id_weight_pair.id_tensor.eval())
def test_get_sparse_tensors_with_default_value_and_placeholder_inputs(self):
column = fc.categorical_column_with_identity(
key='aaa', num_buckets=4, default_value=3)
input_indices = array_ops.placeholder(dtype=dtypes.int64)
input_values = array_ops.placeholder(dtype=dtypes.int32)
input_shape = array_ops.placeholder(dtype=dtypes.int64)
inputs = sparse_tensor.SparseTensorValue(
indices=input_indices,
values=input_values,
dense_shape=input_shape)
id_weight_pair = column.get_sparse_tensors(
FeatureTransformationCache({
'aaa': inputs
}), None)
self.assertIsNone(id_weight_pair.weight_tensor)
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=np.array(((0, 0), (1, 0), (1, 1)), dtype=np.int64),
values=np.array((1, 3, 3), dtype=np.int64),
dense_shape=np.array((2, 2), dtype=np.int64)),
id_weight_pair.id_tensor.eval(feed_dict={
input_indices: ((0, 0), (1, 0), (1, 1)),
input_values: (1, -1, 99),
input_shape: (2, 2),
}))
def test_linear_model(self):
column = fc_old.categorical_column_with_identity(key='aaa', num_buckets=3)
self.assertEqual(3, column.num_buckets)
with ops.Graph().as_default():
predictions = fc.linear_model({
column.name: sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 2, 1),
dense_shape=(2, 2))
}, (column,))
bias = get_linear_model_bias()
weight_var = get_linear_model_column_var(column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,)), weight_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
weight_var.assign(((1.,), (2.,), (3.,))).eval()
# weight_var[0] = 1
# weight_var[2] + weight_var[1] = 3+2 = 5
self.assertAllClose(((1.,), (5.,)), predictions.eval())
def test_keras_linear_model(self):
column = fc_old.categorical_column_with_identity(key='aaa', num_buckets=3)
self.assertEqual(3, column.num_buckets)
with ops.Graph().as_default():
predictions = get_keras_linear_model_predictions({
column.name:
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 2, 1),
dense_shape=(2, 2))
}, (column,))
bias = get_linear_model_bias()
weight_var = get_linear_model_column_var(column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,)), weight_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
weight_var.assign(((1.,), (2.,), (3.,))).eval()
# weight_var[0] = 1
# weight_var[2] + weight_var[1] = 3+2 = 5
self.assertAllClose(((1.,), (5.,)), predictions.eval())
class TransformFeaturesTest(test.TestCase):
# All transform tests are distributed in column test.
# Here we only test multi column case and naming
def transform_multi_column(self):
bucketized_price = fc.bucketized_column(
fc.numeric_column('price'), boundaries=[0, 2, 4, 6])
hashed_sparse = fc.categorical_column_with_hash_bucket('wire', 10)
with ops.Graph().as_default():
features = {
'price': [[-1.], [5.]],
'wire':
sparse_tensor.SparseTensor(
values=['omar', 'stringer', 'marlo'],
indices=[[0, 0], [1, 0], [1, 1]],
dense_shape=[2, 2])
}
transformed = _transform_features(features,
[bucketized_price, hashed_sparse], None)
with _initialized_session():
self.assertIn(bucketized_price.name, transformed[bucketized_price].name)
self.assertAllEqual([[0], [3]], transformed[bucketized_price].eval())
self.assertIn(hashed_sparse.name, transformed[hashed_sparse].name)
self.assertAllEqual([6, 4, 1], transformed[hashed_sparse].values.eval())
def test_column_order(self):
"""When the column is both dense and sparse, uses sparse tensors."""
class _LoggerColumn(FeatureColumn):
def __init__(self, name):
self._name = name
@property
def name(self):
return self._name
def transform_feature(self, transformation_cache, state_manager):
self.call_order = call_logger['count']
call_logger['count'] += 1
return 'Anything'
@property
def parse_example_spec(self):
pass
with ops.Graph().as_default():
column1 = _LoggerColumn('1')
column2 = _LoggerColumn('2')
call_logger = {'count': 0}
_transform_features({}, [column1, column2], None)
self.assertEqual(0, column1.call_order)
self.assertEqual(1, column2.call_order)
call_logger = {'count': 0}
_transform_features({}, [column2, column1], None)
self.assertEqual(0, column1.call_order)
self.assertEqual(1, column2.call_order)
class IndicatorColumnTest(test.TestCase):
def test_indicator_column(self):
a = fc.categorical_column_with_hash_bucket('a', 4)
indicator_a = fc.indicator_column(a)
self.assertEqual(indicator_a.categorical_column.name, 'a')
self.assertEqual(indicator_a.name, 'a_indicator')
self.assertEqual(indicator_a.variable_shape, [1, 4])
b = fc.categorical_column_with_hash_bucket('b', hash_bucket_size=100)
indicator_b = fc.indicator_column(b)
self.assertEqual(indicator_b.categorical_column.name, 'b')
self.assertEqual(indicator_b.name, 'b_indicator')
self.assertEqual(indicator_b.variable_shape, [1, 100])
def test_1D_shape_succeeds(self):
animal = fc.indicator_column(
fc.categorical_column_with_hash_bucket('animal', 4))
transformation_cache = FeatureTransformationCache({
'animal': ['fox', 'fox']
})
output = transformation_cache.get(animal, None)
with self.test_session():
self.assertAllEqual([[0., 0., 1., 0.], [0., 0., 1., 0.]], output.eval())
def test_2D_shape_succeeds(self):
# TODO(ispir/cassandrax): Swith to categorical_column_with_keys when ready.
animal = fc.indicator_column(
fc.categorical_column_with_hash_bucket('animal', 4))
transformation_cache = FeatureTransformationCache({
'animal':
sparse_tensor.SparseTensor(
indices=[[0, 0], [1, 0]],
values=['fox', 'fox'],
dense_shape=[2, 1])
})
output = transformation_cache.get(animal, None)
with self.test_session():
self.assertAllEqual([[0., 0., 1., 0.], [0., 0., 1., 0.]], output.eval())
def test_multi_hot(self):
animal = fc.indicator_column(
fc.categorical_column_with_identity('animal', num_buckets=4))
transformation_cache = FeatureTransformationCache({
'animal':
sparse_tensor.SparseTensor(
indices=[[0, 0], [0, 1]], values=[1, 1], dense_shape=[1, 2])
})
output = transformation_cache.get(animal, None)
with self.test_session():
self.assertAllEqual([[0., 2., 0., 0.]], output.eval())
def test_multi_hot2(self):
animal = fc.indicator_column(
fc.categorical_column_with_identity('animal', num_buckets=4))
transformation_cache = FeatureTransformationCache({
'animal':
sparse_tensor.SparseTensor(
indices=[[0, 0], [0, 1]], values=[1, 2], dense_shape=[1, 2])
})
output = transformation_cache.get(animal, None)
with self.test_session():
self.assertAllEqual([[0., 1., 1., 0.]], output.eval())
def test_deep_copy(self):
a = fc.categorical_column_with_hash_bucket('a', 4)
column = fc.indicator_column(a)
column_copy = copy.deepcopy(column)
self.assertEqual(column_copy.categorical_column.name, 'a')
self.assertEqual(column.name, 'a_indicator')
self.assertEqual(column.variable_shape, [1, 4])
def test_parse_example(self):
a = fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=('omar', 'stringer', 'marlo'))
a_indicator = fc.indicator_column(a)
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'aaa':
feature_pb2.Feature(bytes_list=feature_pb2.BytesList(
value=[b'omar', b'stringer']))
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([a_indicator]))
self.assertIn('aaa', features)
with self.test_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=[[0, 0], [0, 1]],
values=np.array([b'omar', b'stringer'], dtype=np.object_),
dense_shape=[1, 2]),
features['aaa'].eval())
def test_transform(self):
a = fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=('omar', 'stringer', 'marlo'))
a_indicator = fc.indicator_column(a)
features = {
'aaa': sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('marlo', 'skywalker', 'omar'),
dense_shape=(2, 2))
}
indicator_tensor = _transform_features(features, [a_indicator],
None)[a_indicator]
with _initialized_session():
self.assertAllEqual([[0, 0, 1], [1, 0, 0]], indicator_tensor.eval())
def test_transform_with_weighted_column(self):
# Github issue 12557
ids = fc.categorical_column_with_vocabulary_list(
key='ids', vocabulary_list=('a', 'b', 'c'))
weights = fc.weighted_categorical_column(ids, 'weights')
indicator = fc.indicator_column(weights)
features = {
'ids': constant_op.constant([['c', 'b', 'a']]),
'weights': constant_op.constant([[2., 4., 6.]])
}
indicator_tensor = _transform_features(features, [indicator],
None)[indicator]
with _initialized_session():
self.assertAllEqual([[6., 4., 2.]], indicator_tensor.eval())
def test_transform_with_missing_value_in_weighted_column(self):
# Github issue 12583
ids = fc.categorical_column_with_vocabulary_list(
key='ids', vocabulary_list=('a', 'b', 'c'))
weights = fc.weighted_categorical_column(ids, 'weights')
indicator = fc.indicator_column(weights)
features = {
'ids': constant_op.constant([['c', 'b', 'unknown']]),
'weights': constant_op.constant([[2., 4., 6.]])
}
indicator_tensor = _transform_features(features, [indicator],
None)[indicator]
with _initialized_session():
self.assertAllEqual([[0., 4., 2.]], indicator_tensor.eval())
def test_transform_with_missing_value_in_categorical_column(self):
# Github issue 12583
ids = fc.categorical_column_with_vocabulary_list(
key='ids', vocabulary_list=('a', 'b', 'c'))
indicator = fc.indicator_column(ids)
features = {
'ids': constant_op.constant([['c', 'b', 'unknown']]),
}
indicator_tensor = _transform_features(features, [indicator],
None)[indicator]
with _initialized_session():
self.assertAllEqual([[0., 1., 1.]], indicator_tensor.eval())
def test_linear_model(self):
animal = fc_old.indicator_column(
fc_old.categorical_column_with_identity('animal', num_buckets=4))
with ops.Graph().as_default():
features = {
'animal':
sparse_tensor.SparseTensor(
indices=[[0, 0], [0, 1]], values=[1, 2], dense_shape=[1, 2])
}
predictions = fc.linear_model(features, [animal])
weight_var = get_linear_model_column_var(animal)
with _initialized_session():
# All should be zero-initialized.
self.assertAllClose([[0.], [0.], [0.], [0.]], weight_var.eval())
self.assertAllClose([[0.]], predictions.eval())
weight_var.assign([[1.], [2.], [3.], [4.]]).eval()
self.assertAllClose([[2. + 3.]], predictions.eval())
def test_keras_linear_model(self):
animal = fc_old.indicator_column(
fc_old.categorical_column_with_identity('animal', num_buckets=4))
with ops.Graph().as_default():
features = {
'animal':
sparse_tensor.SparseTensor(
indices=[[0, 0], [0, 1]], values=[1, 2], dense_shape=[1, 2])
}
predictions = get_keras_linear_model_predictions(features, [animal])
weight_var = get_linear_model_column_var(animal)
with _initialized_session():
# All should be zero-initialized.
self.assertAllClose([[0.], [0.], [0.], [0.]], weight_var.eval())
self.assertAllClose([[0.]], predictions.eval())
weight_var.assign([[1.], [2.], [3.], [4.]]).eval()
self.assertAllClose([[2. + 3.]], predictions.eval())
def test_input_layer(self):
animal = fc_old.indicator_column(
fc_old.categorical_column_with_identity('animal', num_buckets=4))
with ops.Graph().as_default():
features = {
'animal':
sparse_tensor.SparseTensor(
indices=[[0, 0], [0, 1]], values=[1, 2], dense_shape=[1, 2])
}
net = fc.input_layer(features, [animal])
with _initialized_session():
self.assertAllClose([[0., 1., 1., 0.]], net.eval())
class _TestStateManager(StateManager):
def __init__(self, trainable=True):
# Dict of feature_column to a dict of variables.
self._all_variables = {}
self._trainable = trainable
def get_variable(self,
feature_column,
name,
shape,
dtype=None,
initializer=None):
if feature_column not in self._all_variables:
self._all_variables[feature_column] = {}
var_dict = self._all_variables[feature_column]
if name in var_dict:
return var_dict[name]
else:
var = variable_scope.get_variable(
name=name,
shape=shape,
initializer=initializer,
trainable=self._trainable)
var_dict[name] = var
return var
class EmbeddingColumnTest(test.TestCase):
def test_defaults(self):
categorical_column = fc.categorical_column_with_identity(
key='aaa', num_buckets=3)
embedding_dimension = 2
embedding_column = fc.embedding_column(
categorical_column, dimension=embedding_dimension)
self.assertIs(categorical_column, embedding_column.categorical_column)
self.assertEqual(embedding_dimension, embedding_column.dimension)
self.assertEqual('mean', embedding_column.combiner)
self.assertIsNone(embedding_column.ckpt_to_load_from)
self.assertIsNone(embedding_column.tensor_name_in_ckpt)
self.assertIsNone(embedding_column.max_norm)
self.assertTrue(embedding_column.trainable)
self.assertEqual('aaa_embedding', embedding_column.name)
self.assertEqual((embedding_dimension,), embedding_column.variable_shape)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int64)
}, embedding_column.parse_example_spec)
def test_all_constructor_args(self):
categorical_column = fc.categorical_column_with_identity(
key='aaa', num_buckets=3)
embedding_dimension = 2
embedding_column = fc.embedding_column(
categorical_column, dimension=embedding_dimension,
combiner='my_combiner', initializer=lambda: 'my_initializer',
ckpt_to_load_from='my_ckpt', tensor_name_in_ckpt='my_ckpt_tensor',
max_norm=42., trainable=False)
self.assertIs(categorical_column, embedding_column.categorical_column)
self.assertEqual(embedding_dimension, embedding_column.dimension)
self.assertEqual('my_combiner', embedding_column.combiner)
self.assertEqual('my_ckpt', embedding_column.ckpt_to_load_from)
self.assertEqual('my_ckpt_tensor', embedding_column.tensor_name_in_ckpt)
self.assertEqual(42., embedding_column.max_norm)
self.assertFalse(embedding_column.trainable)
self.assertEqual('aaa_embedding', embedding_column.name)
self.assertEqual((embedding_dimension,), embedding_column.variable_shape)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int64)
}, embedding_column.parse_example_spec)
def test_deep_copy(self):
categorical_column = fc.categorical_column_with_identity(
key='aaa', num_buckets=3)
embedding_dimension = 2
original = fc.embedding_column(
categorical_column, dimension=embedding_dimension,
combiner='my_combiner', initializer=lambda: 'my_initializer',
ckpt_to_load_from='my_ckpt', tensor_name_in_ckpt='my_ckpt_tensor',
max_norm=42., trainable=False)
for embedding_column in (original, copy.deepcopy(original)):
self.assertEqual('aaa', embedding_column.categorical_column.name)
self.assertEqual(3, embedding_column.categorical_column.num_buckets)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int64)
}, embedding_column.categorical_column.parse_example_spec)
self.assertEqual(embedding_dimension, embedding_column.dimension)
self.assertEqual('my_combiner', embedding_column.combiner)
self.assertEqual('my_ckpt', embedding_column.ckpt_to_load_from)
self.assertEqual('my_ckpt_tensor', embedding_column.tensor_name_in_ckpt)
self.assertEqual(42., embedding_column.max_norm)
self.assertFalse(embedding_column.trainable)
self.assertEqual('aaa_embedding', embedding_column.name)
self.assertEqual((embedding_dimension,), embedding_column.variable_shape)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int64)
}, embedding_column.parse_example_spec)
def test_invalid_initializer(self):
categorical_column = fc.categorical_column_with_identity(
key='aaa', num_buckets=3)
with self.assertRaisesRegexp(ValueError, 'initializer must be callable'):
fc.embedding_column(categorical_column, dimension=2, initializer='not_fn')
def test_parse_example(self):
a = fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=('omar', 'stringer', 'marlo'))
a_embedded = fc.embedding_column(a, dimension=2)
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'aaa':
feature_pb2.Feature(bytes_list=feature_pb2.BytesList(
value=[b'omar', b'stringer']))
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([a_embedded]))
self.assertIn('aaa', features)
with self.test_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=[[0, 0], [0, 1]],
values=np.array([b'omar', b'stringer'], dtype=np.object_),
dense_shape=[1, 2]),
features['aaa'].eval())
def test_transform_feature(self):
a = fc.categorical_column_with_identity(key='aaa', num_buckets=3)
a_embedded = fc.embedding_column(a, dimension=2)
features = {
'aaa': sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 1, 0),
dense_shape=(2, 2))
}
outputs = _transform_features(features, [a, a_embedded], None)
output_a = outputs[a]
output_embedded = outputs[a_embedded]
with _initialized_session():
_assert_sparse_tensor_value(
self, output_a.eval(), output_embedded.eval())
def test_get_dense_tensor(self):
# Inputs.
vocabulary_size = 3
sparse_input = sparse_tensor.SparseTensorValue(
# example 0, ids [2]
# example 1, ids [0, 1]
# example 2, ids []
# example 3, ids [1]
indices=((0, 0), (1, 0), (1, 4), (3, 0)),
values=(2, 0, 1, 1),
dense_shape=(4, 5))
# Embedding variable.
embedding_dimension = 2
embedding_values = (
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual((vocabulary_size, embedding_dimension), shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return embedding_values
# Expected lookup result, using combiner='mean'.
expected_lookups = (
# example 0, ids [2], embedding = [7, 11]
(7., 11.),
# example 1, ids [0, 1], embedding = mean([1, 2] + [3, 5]) = [2, 3.5]
(2., 3.5),
# example 2, ids [], embedding = [0, 0]
(0., 0.),
# example 3, ids [1], embedding = [3, 5]
(3., 5.),
)
# Build columns.
categorical_column = fc.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
embedding_column = fc.embedding_column(
categorical_column, dimension=embedding_dimension,
initializer=_initializer)
state_manager = _TestStateManager()
# Provide sparse input and get dense result.
embedding_lookup = embedding_column.get_dense_tensor(
FeatureTransformationCache({
'aaa': sparse_input
}), state_manager)
# Assert expected embedding variable and lookups.
global_vars = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)
self.assertItemsEqual(('embedding_weights:0',),
tuple([v.name for v in global_vars]))
with _initialized_session():
self.assertAllEqual(embedding_values, global_vars[0].eval())
self.assertAllEqual(expected_lookups, embedding_lookup.eval())
def test_get_dense_tensor_3d(self):
# Inputs.
vocabulary_size = 4
sparse_input = sparse_tensor.SparseTensorValue(
# example 0, ids [2]
# example 1, ids [0, 1]
# example 2, ids []
# example 3, ids [1]
indices=((0, 0, 0), (1, 1, 0), (1, 1, 4), (3, 0, 0), (3, 1, 2)),
values=(2, 0, 1, 1, 2),
dense_shape=(4, 2, 5))
# Embedding variable.
embedding_dimension = 3
embedding_values = (
(1., 2., 4.), # id 0
(3., 5., 1.), # id 1
(7., 11., 2.), # id 2
(2., 7., 12.) # id 3
)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual((vocabulary_size, embedding_dimension), shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return embedding_values
# Expected lookup result, using combiner='mean'.
expected_lookups = (
# example 0, ids [[2], []], embedding = [[7, 11, 2], [0, 0, 0]]
((7., 11., 2.), (0., 0., 0.)),
# example 1, ids [[], [0, 1]], embedding
# = mean([[], [1, 2, 4] + [3, 5, 1]]) = [[0, 0, 0], [2, 3.5, 2.5]]
((0., 0., 0.), (2., 3.5, 2.5)),
# example 2, ids [[], []], embedding = [[0, 0, 0], [0, 0, 0]]
((0., 0., 0.), (0., 0., 0.)),
# example 3, ids [[1], [2]], embedding = [[3, 5, 1], [7, 11, 2]]
((3., 5., 1.), (7., 11., 2.)),
)
# Build columns.
categorical_column = fc.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
embedding_column = fc.embedding_column(
categorical_column, dimension=embedding_dimension,
initializer=_initializer)
state_manager = _TestStateManager()
# Provide sparse input and get dense result.
embedding_lookup = embedding_column.get_dense_tensor(
FeatureTransformationCache({
'aaa': sparse_input
}), state_manager)
# Assert expected embedding variable and lookups.
global_vars = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)
self.assertItemsEqual(('embedding_weights:0',),
tuple([v.name for v in global_vars]))
with _initialized_session():
self.assertAllEqual(embedding_values, global_vars[0].eval())
self.assertAllEqual(expected_lookups, embedding_lookup.eval())
def DISABLED_test_get_dense_tensor_weight_collections(self):
sparse_input = sparse_tensor.SparseTensorValue(
# example 0, ids [2]
# example 1, ids [0, 1]
# example 2, ids []
# example 3, ids [1]
indices=((0, 0), (1, 0), (1, 4), (3, 0)),
values=(2, 0, 1, 1),
dense_shape=(4, 5))
# Build columns.
categorical_column = fc.categorical_column_with_identity(
key='aaa', num_buckets=3)
embedding_column = fc.embedding_column(categorical_column, dimension=2)
# Provide sparse input and get dense result.
embedding_column.get_dense_tensor(
FeatureTransformationCache({
'aaa': sparse_input
}),
weight_collections=('my_vars',))
# Assert expected embedding variable and lookups.
global_vars = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)
self.assertItemsEqual(('embedding_weights:0',),
tuple([v.name for v in global_vars]))
my_vars = ops.get_collection('my_vars')
self.assertItemsEqual(
('embedding_weights:0',), tuple([v.name for v in my_vars]))
def test_get_dense_tensor_placeholder_inputs(self):
# Inputs.
vocabulary_size = 3
sparse_input = sparse_tensor.SparseTensorValue(
# example 0, ids [2]
# example 1, ids [0, 1]
# example 2, ids []
# example 3, ids [1]
indices=((0, 0), (1, 0), (1, 4), (3, 0)),
values=(2, 0, 1, 1),
dense_shape=(4, 5))
# Embedding variable.
embedding_dimension = 2
embedding_values = (
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual((vocabulary_size, embedding_dimension), shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return embedding_values
# Expected lookup result, using combiner='mean'.
expected_lookups = (
# example 0, ids [2], embedding = [7, 11]
(7., 11.),
# example 1, ids [0, 1], embedding = mean([1, 2] + [3, 5]) = [2, 3.5]
(2., 3.5),
# example 2, ids [], embedding = [0, 0]
(0., 0.),
# example 3, ids [1], embedding = [3, 5]
(3., 5.),
)
# Build columns.
categorical_column = fc.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
embedding_column = fc.embedding_column(
categorical_column, dimension=embedding_dimension,
initializer=_initializer)
state_manager = _TestStateManager()
# Provide sparse input and get dense result.
input_indices = array_ops.placeholder(dtype=dtypes.int64)
input_values = array_ops.placeholder(dtype=dtypes.int64)
input_shape = array_ops.placeholder(dtype=dtypes.int64)
embedding_lookup = embedding_column.get_dense_tensor(
FeatureTransformationCache({
'aaa':
sparse_tensor.SparseTensorValue(
indices=input_indices,
values=input_values,
dense_shape=input_shape)
}), state_manager)
# Assert expected embedding variable and lookups.
global_vars = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)
self.assertItemsEqual(
('embedding_weights:0',), tuple([v.name for v in global_vars]))
with _initialized_session():
self.assertAllEqual(embedding_values, global_vars[0].eval())
self.assertAllEqual(expected_lookups, embedding_lookup.eval(
feed_dict={
input_indices: sparse_input.indices,
input_values: sparse_input.values,
input_shape: sparse_input.dense_shape,
}))
def test_get_dense_tensor_restore_from_ckpt(self):
# Inputs.
vocabulary_size = 3
sparse_input = sparse_tensor.SparseTensorValue(
# example 0, ids [2]
# example 1, ids [0, 1]
# example 2, ids []
# example 3, ids [1]
indices=((0, 0), (1, 0), (1, 4), (3, 0)),
values=(2, 0, 1, 1),
dense_shape=(4, 5))
# Embedding variable. The checkpoint file contains _embedding_values.
embedding_dimension = 2
embedding_values = (
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)
ckpt_path = test.test_src_dir_path(
'python/feature_column/testdata/embedding.ckpt')
ckpt_tensor = 'my_embedding'
# Expected lookup result, using combiner='mean'.
expected_lookups = (
# example 0, ids [2], embedding = [7, 11]
(7., 11.),
# example 1, ids [0, 1], embedding = mean([1, 2] + [3, 5]) = [2, 3.5]
(2., 3.5),
# example 2, ids [], embedding = [0, 0]
(0., 0.),
# example 3, ids [1], embedding = [3, 5]
(3., 5.),
)
# Build columns.
categorical_column = fc.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
embedding_column = fc.embedding_column(
categorical_column, dimension=embedding_dimension,
ckpt_to_load_from=ckpt_path,
tensor_name_in_ckpt=ckpt_tensor)
state_manager = _TestStateManager()
# Provide sparse input and get dense result.
embedding_lookup = embedding_column.get_dense_tensor(
FeatureTransformationCache({
'aaa': sparse_input
}), state_manager)
# Assert expected embedding variable and lookups.
global_vars = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)
self.assertItemsEqual(
('embedding_weights:0',), tuple([v.name for v in global_vars]))
with _initialized_session():
self.assertAllEqual(embedding_values, global_vars[0].eval())
self.assertAllEqual(expected_lookups, embedding_lookup.eval())
def test_linear_model(self):
# Inputs.
batch_size = 4
vocabulary_size = 3
sparse_input = sparse_tensor.SparseTensorValue(
# example 0, ids [2]
# example 1, ids [0, 1]
# example 2, ids []
# example 3, ids [1]
indices=((0, 0), (1, 0), (1, 4), (3, 0)),
values=(2, 0, 1, 1),
dense_shape=(batch_size, 5))
# Embedding variable.
embedding_dimension = 2
embedding_shape = (vocabulary_size, embedding_dimension)
zeros_embedding_values = np.zeros(embedding_shape)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual(embedding_shape, shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return zeros_embedding_values
# Build columns.
categorical_column = fc_old.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
embedding_column = fc_old.embedding_column(
categorical_column,
dimension=embedding_dimension,
initializer=_initializer)
with ops.Graph().as_default():
predictions = fc.linear_model({
categorical_column.name: sparse_input
}, (embedding_column,))
expected_var_names = (
'linear_model/bias_weights:0',
'linear_model/aaa_embedding/weights:0',
'linear_model/aaa_embedding/embedding_weights:0',
)
self.assertItemsEqual(
expected_var_names,
[v.name for v in ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)])
trainable_vars = {
v.name: v for v in ops.get_collection(
ops.GraphKeys.TRAINABLE_VARIABLES)
}
self.assertItemsEqual(expected_var_names, trainable_vars.keys())
bias = trainable_vars['linear_model/bias_weights:0']
embedding_weights = trainable_vars[
'linear_model/aaa_embedding/embedding_weights:0']
linear_weights = trainable_vars[
'linear_model/aaa_embedding/weights:0']
with _initialized_session():
# Predictions with all zero weights.
self.assertAllClose(np.zeros((1,)), bias.eval())
self.assertAllClose(zeros_embedding_values, embedding_weights.eval())
self.assertAllClose(
np.zeros((embedding_dimension, 1)), linear_weights.eval())
self.assertAllClose(np.zeros((batch_size, 1)), predictions.eval())
# Predictions with all non-zero weights.
embedding_weights.assign((
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)).eval()
linear_weights.assign(((4.,), (6.,))).eval()
# example 0, ids [2], embedding[0] = [7, 11]
# example 1, ids [0, 1], embedding[1] = mean([1, 2] + [3, 5]) = [2, 3.5]
# example 2, ids [], embedding[2] = [0, 0]
# example 3, ids [1], embedding[3] = [3, 5]
# sum(embeddings * linear_weights)
# = [4*7 + 6*11, 4*2 + 6*3.5, 4*0 + 6*0, 4*3 + 6*5] = [94, 29, 0, 42]
self.assertAllClose(((94.,), (29.,), (0.,), (42.,)), predictions.eval())
def test_keras_linear_model(self):
# Inputs.
batch_size = 4
vocabulary_size = 3
sparse_input = sparse_tensor.SparseTensorValue(
# example 0, ids [2]
# example 1, ids [0, 1]
# example 2, ids []
# example 3, ids [1]
indices=((0, 0), (1, 0), (1, 4), (3, 0)),
values=(2, 0, 1, 1),
dense_shape=(batch_size, 5))
# Embedding variable.
embedding_dimension = 2
embedding_shape = (vocabulary_size, embedding_dimension)
zeros_embedding_values = np.zeros(embedding_shape)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual(embedding_shape, shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return zeros_embedding_values
# Build columns.
categorical_column = fc_old.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
embedding_column = fc_old.embedding_column(
categorical_column,
dimension=embedding_dimension,
initializer=_initializer)
with ops.Graph().as_default():
predictions = get_keras_linear_model_predictions({
categorical_column.name: sparse_input
}, (embedding_column,))
expected_var_names = (
'linear_model/bias_weights:0',
'linear_model/aaa_embedding/weights:0',
'linear_model/aaa_embedding/embedding_weights:0',
)
self.assertItemsEqual(
expected_var_names,
[v.name for v in ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)])
trainable_vars = {
v.name: v
for v in ops.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
}
self.assertItemsEqual(expected_var_names, trainable_vars.keys())
bias = trainable_vars['linear_model/bias_weights:0']
embedding_weights = trainable_vars[
'linear_model/aaa_embedding/embedding_weights:0']
linear_weights = trainable_vars['linear_model/aaa_embedding/weights:0']
with _initialized_session():
# Predictions with all zero weights.
self.assertAllClose(np.zeros((1,)), bias.eval())
self.assertAllClose(zeros_embedding_values, embedding_weights.eval())
self.assertAllClose(
np.zeros((embedding_dimension, 1)), linear_weights.eval())
self.assertAllClose(np.zeros((batch_size, 1)), predictions.eval())
# Predictions with all non-zero weights.
embedding_weights.assign((
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)).eval()
linear_weights.assign(((4.,), (6.,))).eval()
# example 0, ids [2], embedding[0] = [7, 11]
# example 1, ids [0, 1], embedding[1] = mean([1, 2] + [3, 5]) = [2, 3.5]
# example 2, ids [], embedding[2] = [0, 0]
# example 3, ids [1], embedding[3] = [3, 5]
# sum(embeddings * linear_weights)
# = [4*7 + 6*11, 4*2 + 6*3.5, 4*0 + 6*0, 4*3 + 6*5] = [94, 29, 0, 42]
self.assertAllClose(((94.,), (29.,), (0.,), (42.,)), predictions.eval())
def test_input_layer(self):
# Inputs.
vocabulary_size = 3
sparse_input = sparse_tensor.SparseTensorValue(
# example 0, ids [2]
# example 1, ids [0, 1]
# example 2, ids []
# example 3, ids [1]
indices=((0, 0), (1, 0), (1, 4), (3, 0)),
values=(2, 0, 1, 1),
dense_shape=(4, 5))
# Embedding variable.
embedding_dimension = 2
embedding_values = (
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual((vocabulary_size, embedding_dimension), shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return embedding_values
# Expected lookup result, using combiner='mean'.
expected_lookups = (
# example 0, ids [2], embedding = [7, 11]
(7., 11.),
# example 1, ids [0, 1], embedding = mean([1, 2] + [3, 5]) = [2, 3.5]
(2., 3.5),
# example 2, ids [], embedding = [0, 0]
(0., 0.),
# example 3, ids [1], embedding = [3, 5]
(3., 5.),
)
# Build columns.
categorical_column = fc_old.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
embedding_column = fc_old.embedding_column(
categorical_column,
dimension=embedding_dimension,
initializer=_initializer)
# Provide sparse input and get dense result.
input_layer = fc.input_layer({'aaa': sparse_input}, (embedding_column,))
# Assert expected embedding variable and lookups.
global_vars = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)
self.assertItemsEqual(
('input_layer/aaa_embedding/embedding_weights:0',),
tuple([v.name for v in global_vars]))
trainable_vars = ops.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
self.assertItemsEqual(
('input_layer/aaa_embedding/embedding_weights:0',),
tuple([v.name for v in trainable_vars]))
with _initialized_session():
self.assertAllEqual(embedding_values, trainable_vars[0].eval())
self.assertAllEqual(expected_lookups, input_layer.eval())
def test_input_layer_not_trainable(self):
# Inputs.
vocabulary_size = 3
sparse_input = sparse_tensor.SparseTensorValue(
# example 0, ids [2]
# example 1, ids [0, 1]
# example 2, ids []
# example 3, ids [1]
indices=((0, 0), (1, 0), (1, 4), (3, 0)),
values=(2, 0, 1, 1),
dense_shape=(4, 5))
# Embedding variable.
embedding_dimension = 2
embedding_values = (
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual((vocabulary_size, embedding_dimension), shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return embedding_values
# Expected lookup result, using combiner='mean'.
expected_lookups = (
# example 0, ids [2], embedding = [7, 11]
(7., 11.),
# example 1, ids [0, 1], embedding = mean([1, 2] + [3, 5]) = [2, 3.5]
(2., 3.5),
# example 2, ids [], embedding = [0, 0]
(0., 0.),
# example 3, ids [1], embedding = [3, 5]
(3., 5.),
)
# Build columns.
categorical_column = fc_old.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
embedding_column = fc_old.embedding_column(
categorical_column,
dimension=embedding_dimension,
initializer=_initializer,
trainable=False)
# Provide sparse input and get dense result.
input_layer = fc.input_layer({'aaa': sparse_input}, (embedding_column,))
# Assert expected embedding variable and lookups.
global_vars = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)
self.assertItemsEqual(
('input_layer/aaa_embedding/embedding_weights:0',),
tuple([v.name for v in global_vars]))
self.assertItemsEqual(
[], ops.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES))
with _initialized_session():
self.assertAllEqual(embedding_values, global_vars[0].eval())
self.assertAllEqual(expected_lookups, input_layer.eval())
class _TestSharedEmbeddingStateManager(StateManager):
"""Manages the state for shared embedding columns.
This can handle multiple groups of shared embedding columns.
"""
def __init__(self, trainable=True):
# Dict of shared_embedding_collection_name to a dict of variables.
self._all_variables = {}
self._trainable = trainable
def get_variable(self,
feature_column,
name,
shape,
dtype=None,
initializer=None):
if not isinstance(feature_column, fc.SharedEmbeddingColumn):
raise ValueError(
'SharedEmbeddingStateManager can only handle SharedEmbeddingColumns. '
'Given type: {} '.format(type(feature_column)))
collection_name = feature_column.shared_collection_name
if collection_name not in self._all_variables:
self._all_variables[collection_name] = {}
var_dict = self._all_variables[collection_name]
if name in var_dict:
return var_dict[name]
else:
var = variable_scope.get_variable(
name=name,
shape=shape,
initializer=initializer,
trainable=self._trainable)
var_dict[name] = var
return var
class SharedEmbeddingColumnTest(test.TestCase):
def test_defaults(self):
categorical_column_a = fc.categorical_column_with_identity(
key='aaa', num_buckets=3)
categorical_column_b = fc.categorical_column_with_identity(
key='bbb', num_buckets=3)
embedding_dimension = 2
embedding_column_b, embedding_column_a = fc.shared_embedding_columns(
[categorical_column_b, categorical_column_a],
dimension=embedding_dimension)
self.assertIs(categorical_column_a, embedding_column_a.categorical_column)
self.assertIs(categorical_column_b, embedding_column_b.categorical_column)
self.assertEqual(embedding_dimension, embedding_column_a.dimension)
self.assertEqual(embedding_dimension, embedding_column_b.dimension)
self.assertEqual('mean', embedding_column_a.combiner)
self.assertEqual('mean', embedding_column_b.combiner)
self.assertIsNone(embedding_column_a.ckpt_to_load_from)
self.assertIsNone(embedding_column_b.ckpt_to_load_from)
self.assertEqual('aaa_bbb_shared_embedding',
embedding_column_a.shared_collection_name)
self.assertEqual('aaa_bbb_shared_embedding',
embedding_column_b.shared_collection_name)
self.assertIsNone(embedding_column_a.tensor_name_in_ckpt)
self.assertIsNone(embedding_column_b.tensor_name_in_ckpt)
self.assertIsNone(embedding_column_a.max_norm)
self.assertIsNone(embedding_column_b.max_norm)
self.assertTrue(embedding_column_a.trainable)
self.assertTrue(embedding_column_b.trainable)
self.assertEqual('aaa_shared_embedding', embedding_column_a.name)
self.assertEqual('bbb_shared_embedding', embedding_column_b.name)
self.assertEqual((embedding_dimension,), embedding_column_a.variable_shape)
self.assertEqual((embedding_dimension,), embedding_column_b.variable_shape)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int64)
}, embedding_column_a.parse_example_spec)
self.assertEqual({
'bbb': parsing_ops.VarLenFeature(dtypes.int64)
}, embedding_column_b.parse_example_spec)
def test_all_constructor_args(self):
categorical_column_a = fc.categorical_column_with_identity(
key='aaa', num_buckets=3)
categorical_column_b = fc.categorical_column_with_identity(
key='bbb', num_buckets=3)
embedding_dimension = 2
embedding_column_a, embedding_column_b = fc.shared_embedding_columns(
[categorical_column_a, categorical_column_b],
dimension=embedding_dimension,
combiner='my_combiner',
initializer=lambda: 'my_initializer',
shared_embedding_collection_name='shared_embedding_collection_name',
ckpt_to_load_from='my_ckpt',
tensor_name_in_ckpt='my_ckpt_tensor',
max_norm=42.,
trainable=False)
self.assertIs(categorical_column_a, embedding_column_a.categorical_column)
self.assertIs(categorical_column_b, embedding_column_b.categorical_column)
self.assertEqual(embedding_dimension, embedding_column_a.dimension)
self.assertEqual(embedding_dimension, embedding_column_b.dimension)
self.assertEqual('my_combiner', embedding_column_a.combiner)
self.assertEqual('my_combiner', embedding_column_b.combiner)
self.assertEqual('shared_embedding_collection_name',
embedding_column_a.shared_collection_name)
self.assertEqual('shared_embedding_collection_name',
embedding_column_b.shared_collection_name)
self.assertEqual('my_ckpt', embedding_column_a.ckpt_to_load_from)
self.assertEqual('my_ckpt', embedding_column_b.ckpt_to_load_from)
self.assertEqual('my_ckpt_tensor', embedding_column_a.tensor_name_in_ckpt)
self.assertEqual('my_ckpt_tensor', embedding_column_b.tensor_name_in_ckpt)
self.assertEqual(42., embedding_column_a.max_norm)
self.assertEqual(42., embedding_column_b.max_norm)
self.assertFalse(embedding_column_a.trainable)
self.assertFalse(embedding_column_b.trainable)
self.assertEqual('aaa_shared_embedding', embedding_column_a.name)
self.assertEqual('bbb_shared_embedding', embedding_column_b.name)
self.assertEqual((embedding_dimension,), embedding_column_a.variable_shape)
self.assertEqual((embedding_dimension,), embedding_column_b.variable_shape)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int64)
}, embedding_column_a.parse_example_spec)
self.assertEqual({
'bbb': parsing_ops.VarLenFeature(dtypes.int64)
}, embedding_column_b.parse_example_spec)
def test_deep_copy(self):
categorical_column_a = fc.categorical_column_with_identity(
key='aaa', num_buckets=3)
categorical_column_b = fc.categorical_column_with_identity(
key='bbb', num_buckets=3)
embedding_dimension = 2
original_a, _ = fc.shared_embedding_columns(
[categorical_column_a, categorical_column_b],
dimension=embedding_dimension,
combiner='my_combiner',
initializer=lambda: 'my_initializer',
shared_embedding_collection_name='shared_embedding_collection_name',
ckpt_to_load_from='my_ckpt',
tensor_name_in_ckpt='my_ckpt_tensor',
max_norm=42., trainable=False)
for embedding_column_a in (original_a, copy.deepcopy(original_a)):
self.assertEqual('aaa', embedding_column_a.categorical_column.name)
self.assertEqual(3, embedding_column_a.categorical_column.num_buckets)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int64)
}, embedding_column_a.categorical_column.parse_example_spec)
self.assertEqual(embedding_dimension, embedding_column_a.dimension)
self.assertEqual('my_combiner', embedding_column_a.combiner)
self.assertEqual('shared_embedding_collection_name',
embedding_column_a.shared_collection_name)
self.assertEqual('my_ckpt', embedding_column_a.ckpt_to_load_from)
self.assertEqual('my_ckpt_tensor', embedding_column_a.tensor_name_in_ckpt)
self.assertEqual(42., embedding_column_a.max_norm)
self.assertFalse(embedding_column_a.trainable)
self.assertEqual('aaa_shared_embedding', embedding_column_a.name)
self.assertEqual((embedding_dimension,),
embedding_column_a.variable_shape)
self.assertEqual({
'aaa': parsing_ops.VarLenFeature(dtypes.int64)
}, embedding_column_a.parse_example_spec)
def test_invalid_initializer(self):
categorical_column_a = fc.categorical_column_with_identity(
key='aaa', num_buckets=3)
categorical_column_b = fc.categorical_column_with_identity(
key='bbb', num_buckets=3)
with self.assertRaisesRegexp(ValueError, 'initializer must be callable'):
fc.shared_embedding_columns(
[categorical_column_a, categorical_column_b], dimension=2,
initializer='not_fn')
def test_incompatible_column_type(self):
categorical_column_a = fc.categorical_column_with_identity(
key='aaa', num_buckets=3)
categorical_column_b = fc.categorical_column_with_identity(
key='bbb', num_buckets=3)
categorical_column_c = fc.categorical_column_with_hash_bucket(
key='ccc', hash_bucket_size=3)
with self.assertRaisesRegexp(
ValueError, 'all categorical_columns must have the same type.*'
'IdentityCategoricalColumn.*HashedCategoricalColumn'):
fc.shared_embedding_columns(
[categorical_column_a, categorical_column_b, categorical_column_c],
dimension=2)
def test_weighted_categorical_column_ok(self):
categorical_column_a = fc.categorical_column_with_identity(
key='aaa', num_buckets=3)
weighted_categorical_column_a = fc.weighted_categorical_column(
categorical_column_a, weight_feature_key='aaa_weights')
categorical_column_b = fc.categorical_column_with_identity(
key='bbb', num_buckets=3)
weighted_categorical_column_b = fc.weighted_categorical_column(
categorical_column_b, weight_feature_key='bbb_weights')
fc.shared_embedding_columns(
[weighted_categorical_column_a, categorical_column_b], dimension=2)
fc.shared_embedding_columns(
[categorical_column_a, weighted_categorical_column_b], dimension=2)
fc.shared_embedding_columns(
[weighted_categorical_column_a, weighted_categorical_column_b],
dimension=2)
def test_parse_example(self):
a = fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=('omar', 'stringer', 'marlo'))
b = fc.categorical_column_with_vocabulary_list(
key='bbb', vocabulary_list=('omar', 'stringer', 'marlo'))
a_embedded, b_embedded = fc.shared_embedding_columns(
[a, b], dimension=2)
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'aaa':
feature_pb2.Feature(bytes_list=feature_pb2.BytesList(
value=[b'omar', b'stringer'])),
'bbb':
feature_pb2.Feature(bytes_list=feature_pb2.BytesList(
value=[b'stringer', b'marlo'])),
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([a_embedded, b_embedded]))
self.assertIn('aaa', features)
self.assertIn('bbb', features)
with self.test_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=[[0, 0], [0, 1]],
values=np.array([b'omar', b'stringer'], dtype=np.object_),
dense_shape=[1, 2]),
features['aaa'].eval())
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=[[0, 0], [0, 1]],
values=np.array([b'stringer', b'marlo'], dtype=np.object_),
dense_shape=[1, 2]),
features['bbb'].eval())
def test_transform_feature(self):
a = fc.categorical_column_with_identity(key='aaa', num_buckets=3)
b = fc.categorical_column_with_identity(key='bbb', num_buckets=3)
a_embedded, b_embedded = fc.shared_embedding_columns(
[a, b], dimension=2)
features = {
'aaa': sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 1, 0),
dense_shape=(2, 2)),
'bbb': sparse_tensor.SparseTensor(
indices=((0, 0), (1, 0), (1, 1)),
values=(1, 2, 1),
dense_shape=(2, 2)),
}
outputs = _transform_features(features, [a, a_embedded, b, b_embedded],
None)
output_a = outputs[a]
output_a_embedded = outputs[a_embedded]
output_b = outputs[b]
output_b_embedded = outputs[b_embedded]
with _initialized_session():
_assert_sparse_tensor_value(
self, output_a.eval(), output_a_embedded.eval())
_assert_sparse_tensor_value(
self, output_b.eval(), output_b_embedded.eval())
def test_get_dense_tensor(self):
# Inputs.
vocabulary_size = 3
# -1 values are ignored.
input_a = np.array(
[[2, -1, -1], # example 0, ids [2]
[0, 1, -1]]) # example 1, ids [0, 1]
input_b = np.array(
[[0, -1, -1], # example 0, ids [0]
[-1, -1, -1]]) # example 1, ids []
input_features = {
'aaa': input_a,
'bbb': input_b
}
# Embedding variable.
embedding_dimension = 2
embedding_values = (
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual((vocabulary_size, embedding_dimension), shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return embedding_values
# Expected lookup result, using combiner='mean'.
expected_lookups_a = (
# example 0:
(7., 11.), # ids [2], embedding = [7, 11]
# example 1:
(2., 3.5), # ids [0, 1], embedding = mean([1, 2] + [3, 5]) = [2, 3.5]
)
expected_lookups_b = (
# example 0:
(1., 2.), # ids [0], embedding = [1, 2]
# example 1:
(0., 0.), # ids [], embedding = [0, 0]
)
# Build columns.
categorical_column_a = fc.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
categorical_column_b = fc.categorical_column_with_identity(
key='bbb', num_buckets=vocabulary_size)
embedding_column_a, embedding_column_b = fc.shared_embedding_columns(
[categorical_column_a, categorical_column_b],
dimension=embedding_dimension, initializer=_initializer)
state_manager = _TestSharedEmbeddingStateManager()
# Provide sparse input and get dense result.
embedding_lookup_a = embedding_column_a.get_dense_tensor(
FeatureTransformationCache(input_features), state_manager)
embedding_lookup_b = embedding_column_b.get_dense_tensor(
FeatureTransformationCache(input_features), state_manager)
# Assert expected embedding variable and lookups.
global_vars = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)
self.assertItemsEqual(('embedding_weights:0',),
tuple([v.name for v in global_vars]))
embedding_var = global_vars[0]
with _initialized_session():
self.assertAllEqual(embedding_values, embedding_var.eval())
self.assertAllEqual(expected_lookups_a, embedding_lookup_a.eval())
self.assertAllEqual(expected_lookups_b, embedding_lookup_b.eval())
def DISABLED_test_get_dense_tensor_weight_collections(self):
# Inputs.
vocabulary_size = 3
# -1 values are ignored.
input_a = np.array([
[2, -1, -1], # example 0, ids [2]
[0, 1, -1]
]) # example 1, ids [0, 1]
input_b = np.array([
[0, -1, -1], # example 0, ids [0]
[-1, -1, -1]
]) # example 1, ids []
input_features = {'aaa': input_a, 'bbb': input_b}
# Embedding variable.
embedding_dimension = 2
embedding_values = (
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual((vocabulary_size, embedding_dimension), shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return embedding_values
# Build columns.
categorical_column_a = fc.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
categorical_column_b = fc.categorical_column_with_identity(
key='bbb', num_buckets=vocabulary_size)
embedding_column_a, embedding_column_b = fc.shared_embedding_columns(
[categorical_column_a, categorical_column_b],
dimension=embedding_dimension,
initializer=_initializer)
fc.input_layer(
input_features, [embedding_column_a, embedding_column_b],
weight_collections=('my_vars',))
# Assert expected embedding variable and lookups.
global_vars = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)
self.assertItemsEqual(
('input_layer/aaa_bbb_shared_embedding/embedding_weights:0',),
tuple(v.name for v in global_vars))
my_vars = ops.get_collection('my_vars')
self.assertItemsEqual(
('input_layer/aaa_bbb_shared_embedding/embedding_weights:0',),
tuple(v.name for v in my_vars))
def test_get_dense_tensor_placeholder_inputs(self):
# Inputs.
vocabulary_size = 3
# -1 values are ignored.
input_a = np.array(
[[2, -1, -1], # example 0, ids [2]
[0, 1, -1]]) # example 1, ids [0, 1]
input_b = np.array(
[[0, -1, -1], # example 0, ids [0]
[-1, -1, -1]]) # example 1, ids []
# Specify shape, because dense input must have rank specified.
input_a_placeholder = array_ops.placeholder(
dtype=dtypes.int64, shape=[None, 3])
input_b_placeholder = array_ops.placeholder(
dtype=dtypes.int64, shape=[None, 3])
input_features = {
'aaa': input_a_placeholder,
'bbb': input_b_placeholder,
}
feed_dict = {
input_a_placeholder: input_a,
input_b_placeholder: input_b,
}
# Embedding variable.
embedding_dimension = 2
embedding_values = (
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual((vocabulary_size, embedding_dimension), shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return embedding_values
# Build columns.
categorical_column_a = fc.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
categorical_column_b = fc.categorical_column_with_identity(
key='bbb', num_buckets=vocabulary_size)
embedding_column_a, embedding_column_b = fc.shared_embedding_columns(
[categorical_column_a, categorical_column_b],
dimension=embedding_dimension, initializer=_initializer)
state_manager = _TestSharedEmbeddingStateManager()
# Provide sparse input and get dense result.
embedding_lookup_a = embedding_column_a.get_dense_tensor(
FeatureTransformationCache(input_features), state_manager)
embedding_lookup_b = embedding_column_b.get_dense_tensor(
FeatureTransformationCache(input_features), state_manager)
with _initialized_session() as sess:
sess.run([embedding_lookup_a, embedding_lookup_b], feed_dict=feed_dict)
def test_linear_model(self):
# Inputs.
batch_size = 2
vocabulary_size = 3
# -1 values are ignored.
input_a = np.array(
[[2, -1, -1], # example 0, ids [2]
[0, 1, -1]]) # example 1, ids [0, 1]
input_b = np.array(
[[0, -1, -1], # example 0, ids [0]
[-1, -1, -1]]) # example 1, ids []
# Embedding variable.
embedding_dimension = 2
embedding_shape = (vocabulary_size, embedding_dimension)
zeros_embedding_values = np.zeros(embedding_shape)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual(embedding_shape, shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return zeros_embedding_values
# Build columns.
categorical_column_a = fc_old.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
categorical_column_b = fc_old.categorical_column_with_identity(
key='bbb', num_buckets=vocabulary_size)
embedding_column_a, embedding_column_b = fc_old.shared_embedding_columns(
[categorical_column_a, categorical_column_b],
dimension=embedding_dimension,
initializer=_initializer)
with ops.Graph().as_default():
predictions = fc.linear_model({
categorical_column_a.name: input_a,
categorical_column_b.name: input_b,
}, (embedding_column_a, embedding_column_b))
# Linear weights do not follow the column name. But this is a rare use
# case, and fixing it would add too much complexity to the code.
expected_var_names = (
'linear_model/bias_weights:0',
'linear_model/aaa_bbb_shared_embedding/weights:0',
'linear_model/aaa_bbb_shared_embedding/embedding_weights:0',
'linear_model/aaa_bbb_shared_embedding_1/weights:0',
)
self.assertItemsEqual(
expected_var_names,
[v.name for v in ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)])
trainable_vars = {
v.name: v for v in ops.get_collection(
ops.GraphKeys.TRAINABLE_VARIABLES)
}
self.assertItemsEqual(expected_var_names, trainable_vars.keys())
bias = trainable_vars['linear_model/bias_weights:0']
embedding_weights = trainable_vars[
'linear_model/aaa_bbb_shared_embedding/embedding_weights:0']
linear_weights_a = trainable_vars[
'linear_model/aaa_bbb_shared_embedding/weights:0']
linear_weights_b = trainable_vars[
'linear_model/aaa_bbb_shared_embedding_1/weights:0']
with _initialized_session():
# Predictions with all zero weights.
self.assertAllClose(np.zeros((1,)), bias.eval())
self.assertAllClose(zeros_embedding_values, embedding_weights.eval())
self.assertAllClose(
np.zeros((embedding_dimension, 1)), linear_weights_a.eval())
self.assertAllClose(
np.zeros((embedding_dimension, 1)), linear_weights_b.eval())
self.assertAllClose(np.zeros((batch_size, 1)), predictions.eval())
# Predictions with all non-zero weights.
embedding_weights.assign((
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)).eval()
linear_weights_a.assign(((4.,), (6.,))).eval()
# example 0, ids [2], embedding[0] = [7, 11]
# example 1, ids [0, 1], embedding[1] = mean([1, 2] + [3, 5]) = [2, 3.5]
# sum(embeddings * linear_weights)
# = [4*7 + 6*11, 4*2 + 6*3.5] = [94, 29]
linear_weights_b.assign(((3.,), (5.,))).eval()
# example 0, ids [0], embedding[0] = [1, 2]
# example 1, ids [], embedding[1] = 0, 0]
# sum(embeddings * linear_weights)
# = [3*1 + 5*2, 3*0 +5*0] = [13, 0]
self.assertAllClose([[94. + 13.], [29.]], predictions.eval())
def test_keras_linear_model(self):
# Inputs.
batch_size = 2
vocabulary_size = 3
# -1 values are ignored.
input_a = np.array([
[2, -1, -1], # example 0, ids [2]
[0, 1, -1]
]) # example 1, ids [0, 1]
input_b = np.array([
[0, -1, -1], # example 0, ids [0]
[-1, -1, -1]
]) # example 1, ids []
# Embedding variable.
embedding_dimension = 2
embedding_shape = (vocabulary_size, embedding_dimension)
zeros_embedding_values = np.zeros(embedding_shape)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual(embedding_shape, shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return zeros_embedding_values
# Build columns.
categorical_column_a = fc_old.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
categorical_column_b = fc_old.categorical_column_with_identity(
key='bbb', num_buckets=vocabulary_size)
embedding_column_a, embedding_column_b = fc_old.shared_embedding_columns(
[categorical_column_a, categorical_column_b],
dimension=embedding_dimension,
initializer=_initializer)
with ops.Graph().as_default():
predictions = get_keras_linear_model_predictions({
categorical_column_a.name: input_a,
categorical_column_b.name: input_b,
}, (embedding_column_a, embedding_column_b))
# Linear weights do not follow the column name. But this is a rare use
# case, and fixing it would add too much complexity to the code.
expected_var_names = (
'linear_model/bias_weights:0',
'linear_model/aaa_bbb_shared_embedding/weights:0',
'linear_model/aaa_bbb_shared_embedding/embedding_weights:0',
'linear_model/aaa_bbb_shared_embedding_1/weights:0',
)
self.assertItemsEqual(
expected_var_names,
[v.name for v in ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)])
trainable_vars = {
v.name: v
for v in ops.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
}
self.assertItemsEqual(expected_var_names, trainable_vars.keys())
bias = trainable_vars['linear_model/bias_weights:0']
embedding_weights = trainable_vars[
'linear_model/aaa_bbb_shared_embedding/embedding_weights:0']
linear_weights_a = trainable_vars[
'linear_model/aaa_bbb_shared_embedding/weights:0']
linear_weights_b = trainable_vars[
'linear_model/aaa_bbb_shared_embedding_1/weights:0']
with _initialized_session():
# Predictions with all zero weights.
self.assertAllClose(np.zeros((1,)), bias.eval())
self.assertAllClose(zeros_embedding_values, embedding_weights.eval())
self.assertAllClose(
np.zeros((embedding_dimension, 1)), linear_weights_a.eval())
self.assertAllClose(
np.zeros((embedding_dimension, 1)), linear_weights_b.eval())
self.assertAllClose(np.zeros((batch_size, 1)), predictions.eval())
# Predictions with all non-zero weights.
embedding_weights.assign((
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)).eval()
linear_weights_a.assign(((4.,), (6.,))).eval()
# example 0, ids [2], embedding[0] = [7, 11]
# example 1, ids [0, 1], embedding[1] = mean([1, 2] + [3, 5]) = [2, 3.5]
# sum(embeddings * linear_weights)
# = [4*7 + 6*11, 4*2 + 6*3.5] = [94, 29]
linear_weights_b.assign(((3.,), (5.,))).eval()
# example 0, ids [0], embedding[0] = [1, 2]
# example 1, ids [], embedding[1] = 0, 0]
# sum(embeddings * linear_weights)
# = [3*1 + 5*2, 3*0 +5*0] = [13, 0]
self.assertAllClose([[94. + 13.], [29.]], predictions.eval())
def _test_input_layer(self, trainable=True):
# Inputs.
vocabulary_size = 3
sparse_input_a = sparse_tensor.SparseTensorValue(
# example 0, ids [2]
# example 1, ids [0, 1]
indices=((0, 0), (1, 0), (1, 4)),
values=(2, 0, 1),
dense_shape=(2, 5))
sparse_input_b = sparse_tensor.SparseTensorValue(
# example 0, ids [0]
# example 1, ids []
indices=((0, 0),),
values=(0,),
dense_shape=(2, 5))
# Embedding variable.
embedding_dimension = 2
embedding_values = (
(1., 2.), # id 0
(3., 5.), # id 1
(7., 11.) # id 2
)
def _initializer(shape, dtype, partition_info):
self.assertAllEqual((vocabulary_size, embedding_dimension), shape)
self.assertEqual(dtypes.float32, dtype)
self.assertIsNone(partition_info)
return embedding_values
# Expected lookup result, using combiner='mean'.
expected_lookups = (
# example 0:
# A ids [2], embedding = [7, 11]
# B ids [0], embedding = [1, 2]
(7., 11., 1., 2.),
# example 1:
# A ids [0, 1], embedding = mean([1, 2] + [3, 5]) = [2, 3.5]
# B ids [], embedding = [0, 0]
(2., 3.5, 0., 0.),
)
# Build columns.
categorical_column_a = fc_old.categorical_column_with_identity(
key='aaa', num_buckets=vocabulary_size)
categorical_column_b = fc_old.categorical_column_with_identity(
key='bbb', num_buckets=vocabulary_size)
embedding_column_a, embedding_column_b = fc_old.shared_embedding_columns(
[categorical_column_a, categorical_column_b],
dimension=embedding_dimension,
initializer=_initializer,
trainable=trainable)
# Provide sparse input and get dense result.
input_layer = fc.input_layer(
features={'aaa': sparse_input_a, 'bbb': sparse_input_b},
feature_columns=(embedding_column_b, embedding_column_a))
# Assert expected embedding variable and lookups.
global_vars = ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)
self.assertItemsEqual(
['input_layer/aaa_bbb_shared_embedding/embedding_weights:0'],
tuple([v.name for v in global_vars]))
trainable_vars = ops.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)
if trainable:
self.assertItemsEqual(
['input_layer/aaa_bbb_shared_embedding/embedding_weights:0'],
tuple([v.name for v in trainable_vars]))
else:
self.assertItemsEqual([], tuple([v.name for v in trainable_vars]))
shared_embedding_vars = global_vars
with _initialized_session():
self.assertAllEqual(embedding_values, shared_embedding_vars[0].eval())
self.assertAllEqual(expected_lookups, input_layer.eval())
def test_input_layer(self):
self._test_input_layer()
def test_input_layer_no_trainable(self):
self._test_input_layer(trainable=False)
class WeightedCategoricalColumnTest(test.TestCase):
def test_defaults(self):
column = fc.weighted_categorical_column(
categorical_column=fc.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
self.assertEqual('ids_weighted_by_values', column.name)
self.assertEqual(3, column.num_buckets)
self.assertEqual({
'ids': parsing_ops.VarLenFeature(dtypes.int64),
'values': parsing_ops.VarLenFeature(dtypes.float32)
}, column.parse_example_spec)
def test_deep_copy(self):
"""Tests deepcopy of categorical_column_with_hash_bucket."""
original = fc.weighted_categorical_column(
categorical_column=fc.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
for column in (original, copy.deepcopy(original)):
self.assertEqual('ids_weighted_by_values', column.name)
self.assertEqual(3, column.num_buckets)
self.assertEqual({
'ids': parsing_ops.VarLenFeature(dtypes.int64),
'values': parsing_ops.VarLenFeature(dtypes.float32)
}, column.parse_example_spec)
def test_invalid_dtype_none(self):
with self.assertRaisesRegexp(ValueError, 'is not convertible to float'):
fc.weighted_categorical_column(
categorical_column=fc.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values',
dtype=None)
def test_invalid_dtype_string(self):
with self.assertRaisesRegexp(ValueError, 'is not convertible to float'):
fc.weighted_categorical_column(
categorical_column=fc.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values',
dtype=dtypes.string)
def test_invalid_input_dtype(self):
column = fc.weighted_categorical_column(
categorical_column=fc.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
strings = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('omar', 'stringer', 'marlo'),
dense_shape=(2, 2))
with self.assertRaisesRegexp(ValueError, 'Bad dtype'):
_transform_features({'ids': strings, 'values': strings}, (column,), None)
def test_column_name_collision(self):
with self.assertRaisesRegexp(ValueError, r'Parse config.*already exists'):
fc.weighted_categorical_column(
categorical_column=fc.categorical_column_with_identity(
key='aaa', num_buckets=3),
weight_feature_key='aaa').parse_example_spec()
def test_missing_weights(self):
column = fc.weighted_categorical_column(
categorical_column=fc.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=('omar', 'stringer', 'marlo'),
dense_shape=(2, 2))
with self.assertRaisesRegexp(
ValueError, 'values is not in features dictionary'):
_transform_features({'ids': inputs}, (column,), None)
def test_parse_example(self):
a = fc.categorical_column_with_vocabulary_list(
key='aaa', vocabulary_list=('omar', 'stringer', 'marlo'))
a_weighted = fc.weighted_categorical_column(a, weight_feature_key='weights')
data = example_pb2.Example(features=feature_pb2.Features(
feature={
'aaa':
feature_pb2.Feature(bytes_list=feature_pb2.BytesList(
value=[b'omar', b'stringer'])),
'weights':
feature_pb2.Feature(float_list=feature_pb2.FloatList(
value=[1., 10.]))
}))
features = parsing_ops.parse_example(
serialized=[data.SerializeToString()],
features=fc.make_parse_example_spec([a_weighted]))
self.assertIn('aaa', features)
self.assertIn('weights', features)
with self.test_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=[[0, 0], [0, 1]],
values=np.array([b'omar', b'stringer'], dtype=np.object_),
dense_shape=[1, 2]),
features['aaa'].eval())
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=[[0, 0], [0, 1]],
values=np.array([1., 10.], dtype=np.float32),
dense_shape=[1, 2]),
features['weights'].eval())
def test_transform_features(self):
column = fc.weighted_categorical_column(
categorical_column=fc.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 1, 0),
dense_shape=(2, 2))
weights = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0.5, 1.0, 0.1),
dense_shape=(2, 2))
id_tensor, weight_tensor = _transform_features({
'ids': inputs,
'values': weights,
}, (column,), None)[column]
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array(inputs.values, dtype=np.int64),
dense_shape=inputs.dense_shape),
id_tensor.eval())
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=weights.indices,
values=np.array(weights.values, dtype=np.float32),
dense_shape=weights.dense_shape),
weight_tensor.eval())
def test_transform_features_dense_input(self):
column = fc.weighted_categorical_column(
categorical_column=fc.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
weights = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0.5, 1.0, 0.1),
dense_shape=(2, 2))
id_tensor, weight_tensor = _transform_features({
'ids': ((0, -1), (1, 0)),
'values': weights,
}, (column,), None)[column]
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=np.array((0, 1, 0), dtype=np.int64),
dense_shape=(2, 2)),
id_tensor.eval())
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=weights.indices,
values=np.array(weights.values, dtype=np.float32),
dense_shape=weights.dense_shape),
weight_tensor.eval())
def test_transform_features_dense_weights(self):
column = fc.weighted_categorical_column(
categorical_column=fc.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
inputs = sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(2, 1, 0),
dense_shape=(2, 2))
id_tensor, weight_tensor = _transform_features({
'ids': inputs,
'values': ((.5, 0.), (1., .1)),
}, (column,), None)[column]
with _initialized_session():
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=inputs.indices,
values=np.array(inputs.values, dtype=np.int64),
dense_shape=inputs.dense_shape),
id_tensor.eval())
_assert_sparse_tensor_value(
self,
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=np.array((.5, 1., .1), dtype=np.float32),
dense_shape=(2, 2)),
weight_tensor.eval())
def test_keras_linear_model(self):
column = fc_old.weighted_categorical_column(
categorical_column=fc_old.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
with ops.Graph().as_default():
predictions = get_keras_linear_model_predictions({
'ids':
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 2, 1),
dense_shape=(2, 2)),
'values':
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(.5, 1., .1),
dense_shape=(2, 2))
}, (column,))
bias = get_linear_model_bias()
weight_var = get_linear_model_column_var(column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,)), weight_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
weight_var.assign(((1.,), (2.,), (3.,))).eval()
# weight_var[0] * weights[0, 0] = 1 * .5 = .5
# weight_var[2] * weights[1, 0] + weight_var[1] * weights[1, 1]
# = 3*1 + 2*.1 = 3+.2 = 3.2
self.assertAllClose(((.5,), (3.2,)), predictions.eval())
def test_keras_linear_model_mismatched_shape(self):
column = fc_old.weighted_categorical_column(
categorical_column=fc_old.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
with ops.Graph().as_default():
with self.assertRaisesRegexp(ValueError,
r'Dimensions.*are not compatible'):
get_keras_linear_model_predictions({
'ids':
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 2, 1),
dense_shape=(2, 2)),
'values':
sparse_tensor.SparseTensorValue(
indices=((0, 0), (0, 1), (1, 0), (1, 1)),
values=(.5, 11., 1., .1),
dense_shape=(2, 2))
}, (column,))
def test_keras_linear_model_mismatched_dense_values(self):
column = fc_old.weighted_categorical_column(
categorical_column=fc_old.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
with ops.Graph().as_default():
predictions = get_keras_linear_model_predictions(
{
'ids':
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 2, 1),
dense_shape=(2, 2)),
'values': ((.5,), (1.,))
}, (column,),
sparse_combiner='mean')
# Disabling the constant folding optimizer here since it changes the
# error message differently on CPU and GPU.
config = config_pb2.ConfigProto()
config.graph_options.rewrite_options.constant_folding = (
rewriter_config_pb2.RewriterConfig.OFF)
with _initialized_session(config):
with self.assertRaisesRegexp(errors.OpError, 'Incompatible shapes'):
predictions.eval()
def test_keras_linear_model_mismatched_dense_shape(self):
column = fc_old.weighted_categorical_column(
categorical_column=fc_old.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
with ops.Graph().as_default():
predictions = get_keras_linear_model_predictions({
'ids':
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 2, 1),
dense_shape=(2, 2)),
'values': ((.5,), (1.,), (.1,))
}, (column,))
bias = get_linear_model_bias()
weight_var = get_linear_model_column_var(column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,)), weight_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
weight_var.assign(((1.,), (2.,), (3.,))).eval()
# weight_var[0] * weights[0, 0] = 1 * .5 = .5
# weight_var[2] * weights[1, 0] + weight_var[1] * weights[1, 1]
# = 3*1 + 2*.1 = 3+.2 = 3.2
self.assertAllClose(((.5,), (3.2,)), predictions.eval())
def test_linear_model(self):
column = fc_old.weighted_categorical_column(
categorical_column=fc_old.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
with ops.Graph().as_default():
predictions = fc.linear_model({
'ids': sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 2, 1),
dense_shape=(2, 2)),
'values': sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(.5, 1., .1),
dense_shape=(2, 2))
}, (column,))
bias = get_linear_model_bias()
weight_var = get_linear_model_column_var(column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,)), weight_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
weight_var.assign(((1.,), (2.,), (3.,))).eval()
# weight_var[0] * weights[0, 0] = 1 * .5 = .5
# weight_var[2] * weights[1, 0] + weight_var[1] * weights[1, 1]
# = 3*1 + 2*.1 = 3+.2 = 3.2
self.assertAllClose(((.5,), (3.2,)), predictions.eval())
def test_linear_model_mismatched_shape(self):
column = fc_old.weighted_categorical_column(
categorical_column=fc_old.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
with ops.Graph().as_default():
with self.assertRaisesRegexp(
ValueError, r'Dimensions.*are not compatible'):
fc.linear_model({
'ids': sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 2, 1),
dense_shape=(2, 2)),
'values': sparse_tensor.SparseTensorValue(
indices=((0, 0), (0, 1), (1, 0), (1, 1)),
values=(.5, 11., 1., .1),
dense_shape=(2, 2))
}, (column,))
def test_linear_model_mismatched_dense_values(self):
column = fc_old.weighted_categorical_column(
categorical_column=fc_old.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
with ops.Graph().as_default():
predictions = fc.linear_model(
{
'ids':
sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 2, 1),
dense_shape=(2, 2)),
'values': ((.5,), (1.,))
}, (column,),
sparse_combiner='mean')
# Disabling the constant folding optimizer here since it changes the
# error message differently on CPU and GPU.
config = config_pb2.ConfigProto()
config.graph_options.rewrite_options.constant_folding = (
rewriter_config_pb2.RewriterConfig.OFF)
with _initialized_session(config):
with self.assertRaisesRegexp(errors.OpError, 'Incompatible shapes'):
predictions.eval()
def test_linear_model_mismatched_dense_shape(self):
column = fc_old.weighted_categorical_column(
categorical_column=fc_old.categorical_column_with_identity(
key='ids', num_buckets=3),
weight_feature_key='values')
with ops.Graph().as_default():
predictions = fc.linear_model({
'ids': sparse_tensor.SparseTensorValue(
indices=((0, 0), (1, 0), (1, 1)),
values=(0, 2, 1),
dense_shape=(2, 2)),
'values': ((.5,), (1.,), (.1,))
}, (column,))
bias = get_linear_model_bias()
weight_var = get_linear_model_column_var(column)
with _initialized_session():
self.assertAllClose((0.,), bias.eval())
self.assertAllClose(((0.,), (0.,), (0.,)), weight_var.eval())
self.assertAllClose(((0.,), (0.,)), predictions.eval())
weight_var.assign(((1.,), (2.,), (3.,))).eval()
# weight_var[0] * weights[0, 0] = 1 * .5 = .5
# weight_var[2] * weights[1, 0] + weight_var[1] * weights[1, 1]
# = 3*1 + 2*.1 = 3+.2 = 3.2
self.assertAllClose(((.5,), (3.2,)), predictions.eval())
# TODO(ptucker): Add test with embedding of weighted categorical.
if __name__ == '__main__':
test.main()
|
apache-2.0
|
[
3,
1898,
9708,
710,
9134,
6642,
14,
2900,
5924,
5702,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
3,
11148,
199,
624,
2925,
367,
3878,
63,
2301,
1041,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
4629,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
199,
646,
5055,
199,
646,
1331,
199,
199,
646,
2680,
465,
980,
199,
199,
504,
3228,
14,
1018,
14,
2694,
492,
2893,
63,
3317,
18,
199,
504,
3228,
14,
1018,
14,
2694,
492,
3878,
63,
3317,
18,
199,
504,
3228,
14,
1018,
14,
7204,
492,
1101,
63,
3317,
18,
199,
504,
3228,
14,
1018,
14,
7204,
492,
295,
5491,
63,
888,
63,
3317,
18,
199,
504,
3228,
14,
1548,
14,
1258,
492,
2351,
199,
504,
3228,
14,
1548,
14,
10283,
492,
1771,
4469,
199,
504,
3228,
14,
1548,
14,
10283,
492,
1067,
199,
504,
3228,
14,
1548,
14,
8627,
14,
3711,
492,
2680,
63,
2308,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
492,
3878,
63,
2301,
465,
10821,
63,
1753,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
492,
3878,
63,
2301,
63,
86,
18,
465,
10821,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
13407,
4547,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
13407,
26283,
4437,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
6924,
5003,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
8511,
2988,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
485,
10608,
1685,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
485,
4711,
63,
3179,
199,
504,
3228,
14,
1548,
14,
4857,
492,
4413,
63,
411,
199,
504,
3228,
14,
1548,
14,
4857,
492,
6674,
199,
504,
3228,
14,
1548,
14,
4857,
492,
2552,
199,
504,
3228,
14,
1548,
14,
4857,
492,
4156,
199,
504,
3228,
14,
1548,
14,
4857,
492,
5178,
63,
3128,
199,
504,
3228,
14,
1548,
14,
4857,
492,
511,
63,
1974,
199,
504,
3228,
14,
1548,
14,
1483,
492,
1625,
63,
1483,
199,
504,
3228,
14,
1548,
14,
1483,
492,
4237,
63,
1483,
199,
504,
3228,
14,
1548,
14,
1483,
492,
6057,
63,
1483,
199,
504,
3228,
14,
1548,
14,
1483,
492,
27105,
63,
3669,
199,
504,
3228,
14,
1548,
14,
1483,
492,
1750,
63,
2645,
199,
504,
3228,
14,
1548,
14,
1483,
492,
2860,
465,
2860,
63,
773,
199,
504,
3228,
14,
1548,
14,
3246,
492,
511,
199,
504,
3228,
14,
1548,
14,
7588,
492,
29186,
199,
504,
3228,
14,
1548,
14,
7588,
492,
4126,
63,
5933,
63,
5472,
421,
199,
318,
485,
12486,
63,
1730,
8,
888,
29,
403,
304,
523,
4043,
275,
2351,
14,
4434,
8,
888,
29,
888,
9,
523,
4043,
14,
1065,
8,
3669,
63,
773,
14,
2966,
63,
3669,
63,
6498,
1012,
523,
4043,
14,
1065,
8,
3892,
63,
1483,
14,
5987,
63,
6498,
1012,
523,
372,
4043,
421,
199,
533,
22373,
4547,
774,
8,
396,
14,
1746,
304,
819,
347,
511,
63,
1515,
17308,
63,
3527,
63,
5089,
8,
277,
304,
339,
1021,
19463,
11348,
8,
5968,
4547,
304,
2541,
347,
636,
826,
721,
277,
304,
267,
291,
14,
1507,
63,
4711,
275,
378,
2541,
768,
1829,
489,
347,
536,
8,
277,
304,
267,
372,
283,
6939,
11348,
7,
2541,
347,
5793,
63,
4445,
8,
277,
12,
13315,
63,
1637,
12,
1174,
63,
2609,
304,
267,
291,
14,
1507,
63,
4711,
847,
413,
221,
327,
14826,
5793,
4882,
14,
267,
372,
13315,
63,
1637,
14,
362,
360,
65,
297,
1174,
63,
2609,
9,
2541,
768,
1829,
489,
347,
2198,
63,
2694,
63,
1650,
8,
277,
304,
267,
986,
339,
13315,
63,
1637,
275,
13407,
26283,
4437,
8,
267,
4534,
3713,
65,
356,
3474,
18,
467,
359,
19,
28132,
1552,
272,
2763,
275,
19463,
11348,
342,
272,
291,
14,
629,
8,
16,
12,
2763,
14,
1507,
63,
4711,
9,
272,
13315,
63,
1637,
14,
362,
8,
2301,
12,
488,
9,
272,
291,
14,
629,
8,
17,
12,
2763,
14,
1507,
63,
4711,
9,
272,
13315,
63,
1637,
14,
362,
8,
2301,
12,
488,
9,
272,
291,
14,
629,
8,
17,
12,
2763,
14,
1507,
63,
4711,
9,
819,
347,
511,
63,
5808,
63,
4711,
63,
1199,
8,
277,
304,
339,
1021,
30486,
8,
5968,
4547,
304,
2541,
768,
1829,
489,
347,
536,
8,
277,
304,
267,
372,
283,
19761,
7,
2541,
347,
5793,
63,
4445,
8,
277,
12,
13315,
63,
1637,
12,
1174,
63,
2609,
304,
267,
372,
283,
2959,
7,
2541,
768,
1829,
489,
347,
2198,
63,
2694,
63,
1650,
8,
277,
304,
267,
986,
339,
13315,
63,
1637,
275,
13407,
26283,
4437,
8,
267,
4534,
3713,
65,
356,
3474,
18,
467,
359,
19,
28132,
1552,
272,
2763,
275,
30486,
342,
272,
291,
14,
629,
360,
2959,
297,
13315,
63,
1637,
14,
362,
8,
2301,
12,
488,
430,
272,
291,
14,
629,
360,
2959,
297,
13315,
63,
1637,
14,
362,
8,
2301,
12,
488,
430,
819,
347,
511,
63,
9105,
63,
1397,
63,
6843,
938,
63,
11809,
63,
3179,
63,
807,
8,
277,
304,
339,
1021,
30486,
8,
5968,
4547,
304,
2541,
768,
1829,
489,
347,
536,
8,
277,
304
] |
[
1898,
9708,
710,
9134,
6642,
14,
2900,
5924,
5702,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
3,
11148,
199,
624,
2925,
367,
3878,
63,
2301,
1041,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
4629,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
199,
646,
5055,
199,
646,
1331,
199,
199,
646,
2680,
465,
980,
199,
199,
504,
3228,
14,
1018,
14,
2694,
492,
2893,
63,
3317,
18,
199,
504,
3228,
14,
1018,
14,
2694,
492,
3878,
63,
3317,
18,
199,
504,
3228,
14,
1018,
14,
7204,
492,
1101,
63,
3317,
18,
199,
504,
3228,
14,
1018,
14,
7204,
492,
295,
5491,
63,
888,
63,
3317,
18,
199,
504,
3228,
14,
1548,
14,
1258,
492,
2351,
199,
504,
3228,
14,
1548,
14,
10283,
492,
1771,
4469,
199,
504,
3228,
14,
1548,
14,
10283,
492,
1067,
199,
504,
3228,
14,
1548,
14,
8627,
14,
3711,
492,
2680,
63,
2308,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
492,
3878,
63,
2301,
465,
10821,
63,
1753,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
492,
3878,
63,
2301,
63,
86,
18,
465,
10821,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
13407,
4547,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
13407,
26283,
4437,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
6924,
5003,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
8511,
2988,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
485,
10608,
1685,
199,
504,
3228,
14,
1548,
14,
4445,
63,
2301,
14,
4445,
63,
2301,
63,
86,
18,
492,
485,
4711,
63,
3179,
199,
504,
3228,
14,
1548,
14,
4857,
492,
4413,
63,
411,
199,
504,
3228,
14,
1548,
14,
4857,
492,
6674,
199,
504,
3228,
14,
1548,
14,
4857,
492,
2552,
199,
504,
3228,
14,
1548,
14,
4857,
492,
4156,
199,
504,
3228,
14,
1548,
14,
4857,
492,
5178,
63,
3128,
199,
504,
3228,
14,
1548,
14,
4857,
492,
511,
63,
1974,
199,
504,
3228,
14,
1548,
14,
1483,
492,
1625,
63,
1483,
199,
504,
3228,
14,
1548,
14,
1483,
492,
4237,
63,
1483,
199,
504,
3228,
14,
1548,
14,
1483,
492,
6057,
63,
1483,
199,
504,
3228,
14,
1548,
14,
1483,
492,
27105,
63,
3669,
199,
504,
3228,
14,
1548,
14,
1483,
492,
1750,
63,
2645,
199,
504,
3228,
14,
1548,
14,
1483,
492,
2860,
465,
2860,
63,
773,
199,
504,
3228,
14,
1548,
14,
3246,
492,
511,
199,
504,
3228,
14,
1548,
14,
7588,
492,
29186,
199,
504,
3228,
14,
1548,
14,
7588,
492,
4126,
63,
5933,
63,
5472,
421,
199,
318,
485,
12486,
63,
1730,
8,
888,
29,
403,
304,
523,
4043,
275,
2351,
14,
4434,
8,
888,
29,
888,
9,
523,
4043,
14,
1065,
8,
3669,
63,
773,
14,
2966,
63,
3669,
63,
6498,
1012,
523,
4043,
14,
1065,
8,
3892,
63,
1483,
14,
5987,
63,
6498,
1012,
523,
372,
4043,
421,
199,
533,
22373,
4547,
774,
8,
396,
14,
1746,
304,
819,
347,
511,
63,
1515,
17308,
63,
3527,
63,
5089,
8,
277,
304,
339,
1021,
19463,
11348,
8,
5968,
4547,
304,
2541,
347,
636,
826,
721,
277,
304,
267,
291,
14,
1507,
63,
4711,
275,
378,
2541,
768,
1829,
489,
347,
536,
8,
277,
304,
267,
372,
283,
6939,
11348,
7,
2541,
347,
5793,
63,
4445,
8,
277,
12,
13315,
63,
1637,
12,
1174,
63,
2609,
304,
267,
291,
14,
1507,
63,
4711,
847,
413,
221,
327,
14826,
5793,
4882,
14,
267,
372,
13315,
63,
1637,
14,
362,
360,
65,
297,
1174,
63,
2609,
9,
2541,
768,
1829,
489,
347,
2198,
63,
2694,
63,
1650,
8,
277,
304,
267,
986,
339,
13315,
63,
1637,
275,
13407,
26283,
4437,
8,
267,
4534,
3713,
65,
356,
3474,
18,
467,
359,
19,
28132,
1552,
272,
2763,
275,
19463,
11348,
342,
272,
291,
14,
629,
8,
16,
12,
2763,
14,
1507,
63,
4711,
9,
272,
13315,
63,
1637,
14,
362,
8,
2301,
12,
488,
9,
272,
291,
14,
629,
8,
17,
12,
2763,
14,
1507,
63,
4711,
9,
272,
13315,
63,
1637,
14,
362,
8,
2301,
12,
488,
9,
272,
291,
14,
629,
8,
17,
12,
2763,
14,
1507,
63,
4711,
9,
819,
347,
511,
63,
5808,
63,
4711,
63,
1199,
8,
277,
304,
339,
1021,
30486,
8,
5968,
4547,
304,
2541,
768,
1829,
489,
347,
536,
8,
277,
304,
267,
372,
283,
19761,
7,
2541,
347,
5793,
63,
4445,
8,
277,
12,
13315,
63,
1637,
12,
1174,
63,
2609,
304,
267,
372,
283,
2959,
7,
2541,
768,
1829,
489,
347,
2198,
63,
2694,
63,
1650,
8,
277,
304,
267,
986,
339,
13315,
63,
1637,
275,
13407,
26283,
4437,
8,
267,
4534,
3713,
65,
356,
3474,
18,
467,
359,
19,
28132,
1552,
272,
2763,
275,
30486,
342,
272,
291,
14,
629,
360,
2959,
297,
13315,
63,
1637,
14,
362,
8,
2301,
12,
488,
430,
272,
291,
14,
629,
360,
2959,
297,
13315,
63,
1637,
14,
362,
8,
2301,
12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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
UK992/servo
|
tests/wpt/web-platform-tests/tools/third_party/pywebsocket3/mod_pywebsocket/__init__.py
|
29
|
6145
|
# Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
""" A Standalone WebSocket Server for testing purposes
mod_pywebsocket is an API that provides WebSocket functionalities with
a standalone WebSocket server. It is intended for testing or
experimental purposes.
Installation
============
1. Follow standalone server documentation to start running the
standalone server. It can be read by running the following command:
$ pydoc mod_pywebsocket.standalone
2. Once the standalone server is launched verify it by accessing
http://localhost[:port]/console.html. Include the port number when
specified on launch. If everything is working correctly, you
will see a simple echo console.
Writing WebSocket handlers
==========================
When a WebSocket request comes in, the resource name
specified in the handshake is considered as if it is a file path under
<websock_handlers> and the handler defined in
<websock_handlers>/<resource_name>_wsh.py is invoked.
For example, if the resource name is /example/chat, the handler defined in
<websock_handlers>/example/chat_wsh.py is invoked.
A WebSocket handler is composed of the following three functions:
web_socket_do_extra_handshake(request)
web_socket_transfer_data(request)
web_socket_passive_closing_handshake(request)
where:
request: mod_python request.
web_socket_do_extra_handshake is called during the handshake after the
headers are successfully parsed and WebSocket properties (ws_origin,
and ws_resource) are added to request. A handler
can reject the request by raising an exception.
A request object has the following properties that you can use during the
extra handshake (web_socket_do_extra_handshake):
- ws_resource
- ws_origin
- ws_version
- ws_extensions
- ws_deflate
- ws_protocol
- ws_requested_protocols
The last two are a bit tricky. See the next subsection.
Subprotocol Negotiation
-----------------------
ws_protocol is always set to None when
web_socket_do_extra_handshake is called. If ws_requested_protocols is not
None, you must choose one subprotocol from this list and set it to
ws_protocol.
Data Transfer
-------------
web_socket_transfer_data is called after the handshake completed
successfully. A handler can receive/send messages from/to the client
using request. mod_pywebsocket.msgutil module provides utilities
for data transfer.
You can receive a message by the following statement.
message = request.ws_stream.receive_message()
This call blocks until any complete text frame arrives, and the payload data
of the incoming frame will be stored into message. When you're using IETF
HyBi 00 or later protocol, receive_message() will return None on receiving
client-initiated closing handshake. When any error occurs, receive_message()
will raise some exception.
You can send a message by the following statement.
request.ws_stream.send_message(message)
Closing Connection
------------------
Executing the following statement or just return-ing from
web_socket_transfer_data cause connection close.
request.ws_stream.close_connection()
close_connection will wait
for closing handshake acknowledgement coming from the client. When it
couldn't receive a valid acknowledgement, raises an exception.
web_socket_passive_closing_handshake is called after the server receives
incoming closing frame from the client peer immediately. You can specify
code and reason by return values. They are sent as a outgoing closing frame
from the server. A request object has the following properties that you can
use in web_socket_passive_closing_handshake.
- ws_close_code
- ws_close_reason
Threading
---------
A WebSocket handler must be thread-safe. The standalone
server uses threads by default.
Configuring WebSocket Extension Processors
------------------------------------------
See extensions.py for supported WebSocket extensions. Note that they are
unstable and their APIs are subject to change substantially.
A request object has these extension processing related attributes.
- ws_requested_extensions:
A list of common.ExtensionParameter instances representing extension
parameters received from the client in the client's opening handshake.
You shouldn't modify it manually.
- ws_extensions:
A list of common.ExtensionParameter instances representing extension
parameters to send back to the client in the server's opening handshake.
You shouldn't touch it directly. Instead, call methods on extension
processors.
- ws_extension_processors:
A list of loaded extension processors. Find the processor for the
extension you want to configure from it, and call its methods.
"""
# vi:sts=4 sw=4 et tw=72
|
mpl-2.0
|
[
3,
1898,
7760,
12,
4475,
3277,
14,
199,
3,
2900,
4481,
4644,
14,
199,
3,
199,
3,
10114,
436,
675,
315,
1350,
436,
3366,
4513,
12,
543,
503,
1928,
199,
3,
7100,
12,
787,
8211,
2741,
626,
314,
2569,
3704,
787,
199,
3,
7647,
26,
199,
3,
199,
3,
258,
627,
6823,
402,
1350,
1233,
1471,
8074,
314,
3432,
4248,
199,
3,
4245,
12,
642,
769,
402,
3704,
436,
314,
2569,
6450,
14,
199,
3,
258,
627,
6823,
315,
3366,
1824,
1471,
9172,
314,
3432,
199,
3,
4248,
4245,
12,
642,
769,
402,
3704,
436,
314,
2569,
6450,
199,
3,
315,
314,
3794,
436,
15,
269,
1163,
8418,
2741,
543,
314,
199,
3,
4084,
14,
199,
3,
258,
627,
11443,
314,
536,
402,
4475,
3277,
14,
6590,
314,
1561,
402,
2399,
199,
3,
8417,
1443,
506,
1202,
370,
10692,
503,
10016,
7585,
7131,
687,
199,
3,
642,
2032,
1928,
2488,
6791,
5313,
4983,
14,
199,
3,
199,
3,
5749,
4141,
2281,
7049,
6515,
2334,
5877,
8164,
2401,
6483,
199,
3,
298,
1179,
2281,
2,
2401,
1821,
7168,
1549,
5292,
2990,
12,
6931,
12,
5400,
2845,
199,
3,
5471,
2296,
12,
2334,
5292,
2990,
1634,
3169,
2401,
3092,
2381,
199,
3,
437,
3115,
3104,
9315,
9706,
14,
1621,
4825,
6461,
7000,
2334,
5877,
199,
3,
11489,
1549,
6483,
6262,
7024,
2381,
1821,
8703,
12,
9168,
12,
9716,
12,
199,
3,
8820,
12,
9836,
12,
1549,
9110,
6736,
334,
6446,
12,
5400,
2845,
199,
3,
5471,
2296,
12,
9838,
1634,
9103,
9764,
1549,
9714,
27,
9102,
1634,
4815,
12,
199,
3,
7126,
12,
1549,
9206,
27,
1549,
9748,
9831,
9,
9802,
9817,
2401,
5258,
1821,
199,
3,
9815,
1634,
5603,
12,
7061,
1621,
7066,
12,
9644,
5603,
12,
1549,
7056,
199,
3,
334,
6446,
9254,
1549,
7334,
9,
7043,
1621,
1821,
9683,
5738,
1634,
2334,
4815,
199,
3,
1634,
5749,
4141,
12,
9704,
8036,
9691,
1634,
2334,
9726,
1634,
9712,
9784,
14,
199,
624,
437,
1933,
460,
10636,
18846,
7146,
367,
5343,
12901,
199,
199,
1494,
63,
21387,
365,
376,
3261,
626,
6571,
18846,
805,
10874,
1417,
543,
199,
65,
18042,
18846,
1654,
14,
2779,
365,
11619,
367,
5343,
503,
199,
18924,
12901,
14,
199,
199,
31456,
199,
5769,
199,
17,
14,
21876,
18042,
1654,
3794,
370,
1343,
3879,
314,
199,
20323,
1654,
14,
2779,
883,
506,
1586,
701,
3879,
314,
2569,
1414,
26,
339,
2672,
29164,
3413,
63,
21387,
14,
20323,
199,
199,
18,
14,
19468,
314,
18042,
1654,
365,
27725,
4911,
652,
701,
18549,
199,
1014,
921,
5967,
1491,
719,
12978,
6614,
14,
1360,
14,
15783,
314,
1844,
1329,
1380,
199,
10085,
641,
10623,
14,
982,
8137,
365,
6449,
6657,
12,
1265,
199,
14117,
1937,
282,
3486,
11343,
8559,
14,
421,
199,
16646,
18846,
8297,
199,
1280,
17575,
199,
199,
11423,
282,
18846,
1056,
12477,
315,
12,
314,
2073,
536,
199,
10085,
315,
314,
14305,
365,
8652,
465,
340,
652,
365,
282,
570,
931,
1334,
199,
28,
1129,
1533,
766,
63,
5586,
30,
436,
314,
3016,
3247,
315,
199,
28,
1129,
1533,
766,
63,
5586,
23220,
1927,
63,
354,
30,
63,
87,
609,
14,
647,
365,
10302,
14,
199,
199,
1858,
2893,
12,
340,
314,
2073,
536,
365,
1182,
2694,
15,
10289,
12,
314,
3016,
3247,
315,
199,
28,
1129,
1533,
766,
63,
5586,
12202,
2694,
15,
10289,
63,
87,
609,
14,
647,
365,
10302,
14,
199,
199,
33,
18846,
3016,
365,
26356,
402,
314,
2569,
7795,
3423,
26,
339,
3330,
63,
3450,
63,
1117,
63,
2911,
63,
11913,
8,
1069,
9,
272,
3330,
63,
3450,
63,
9609,
63,
576,
8,
1069,
9,
272,
3330,
63,
3450,
63,
25166,
63,
11707,
63,
11913,
8,
1069,
9,
199,
199,
4509,
26,
272,
1056,
26,
3413,
63,
1548,
1056,
14,
199,
199,
2520,
63,
3450,
63,
1117,
63,
2911,
63,
11913,
365,
2797,
5309,
314,
14305,
2410,
314,
199,
2139,
787,
8792,
4565,
436,
18846,
4382,
334,
3569,
63,
6493,
12,
199,
460,
10900,
63,
1927,
9,
787,
3483,
370,
1056,
14,
437,
3016,
199,
2425,
17100,
314,
1056,
701,
17026,
376,
1919,
14,
199,
199,
33,
1056,
909,
965,
314,
2569,
4382,
626,
1265,
883,
675,
5309,
314,
199,
2911,
14305,
334,
2520,
63,
3450,
63,
1117,
63,
2911,
63,
11913,
304,
199,
13,
10900,
63,
1927,
199,
13,
10900,
63,
6493,
199,
13,
10900,
63,
1023,
199,
13,
10900,
63,
5359,
199,
13,
10900,
63,
20902,
199,
13,
10900,
63,
3922,
199,
13,
10900,
63,
11151,
63,
16541,
199,
199,
1918,
2061,
2877,
787,
282,
4546,
32553,
14,
1666,
314,
2163,
19876,
14,
421,
199,
2610,
3922,
5612,
14727,
425,
199,
777,
12797,
199,
199,
3569,
63,
3922,
365,
3544,
663,
370,
488,
1380,
199,
2520,
63,
3450,
63,
1117,
63,
2911,
63,
11913,
365,
2797,
14,
982,
10900,
63,
11151,
63,
16541,
365,
440,
199,
403,
12,
1265,
1471,
11496,
1373,
1007,
3922,
687,
642,
769,
436,
663,
652,
370,
199,
3569,
63,
3922,
14,
199,
199,
1451,
27507,
199,
8684,
199,
199,
2520,
63,
3450,
63,
9609,
63,
576,
365,
2797,
2410,
314,
14305,
9709,
199,
26193,
14,
437,
3016,
883,
9128,
15,
2254,
3788,
687,
15,
475,
314,
1890,
199,
4941,
1056,
14,
3413,
63,
21387,
14,
1328,
1974,
859,
6571,
15841,
199,
509,
666,
9307,
14,
199,
199,
5556,
883,
9128,
282,
1245,
701,
314,
2569,
5164,
14,
339,
1245,
275,
1056,
14,
3569,
63,
1745,
14,
9391,
63,
1188,
342,
199,
199,
2765,
1240,
5664,
5133,
1263,
4890,
1318,
2787,
601,
322,
2310,
12,
436,
314,
4886,
666,
199,
1618,
314,
12467,
2787,
911,
506,
5489,
1901,
1245,
14,
3979,
1265,
3984,
1808,
473,
775,
38,
199,
21568,
17975,
8733,
503,
2945,
4113,
12,
9128,
63,
1188,
342,
911,
372,
488,
641,
18390,
199,
1258,
13,
14188,
972,
11261,
14305,
14,
3979,
1263,
1125,
11058,
12,
9128,
63,
1188,
342,
199,
14117,
746,
2005,
1919,
14,
199,
199,
5556,
883,
3222,
282,
1245,
701,
314,
2569,
5164,
14,
339,
1056,
14,
3569,
63,
1745,
14,
2254,
63,
1188,
8,
1188,
9,
421,
199,
18433,
8113,
199,
777,
306,
199,
199,
4858,
4655,
314,
2569,
5164,
503,
2951,
372,
13,
316,
687,
199,
2520,
63,
3450,
63,
9609,
63,
576
] |
[
1898,
7760,
12,
4475,
3277,
14,
199,
3,
2900,
4481,
4644,
14,
199,
3,
199,
3,
10114,
436,
675,
315,
1350,
436,
3366,
4513,
12,
543,
503,
1928,
199,
3,
7100,
12,
787,
8211,
2741,
626,
314,
2569,
3704,
787,
199,
3,
7647,
26,
199,
3,
199,
3,
258,
627,
6823,
402,
1350,
1233,
1471,
8074,
314,
3432,
4248,
199,
3,
4245,
12,
642,
769,
402,
3704,
436,
314,
2569,
6450,
14,
199,
3,
258,
627,
6823,
315,
3366,
1824,
1471,
9172,
314,
3432,
199,
3,
4248,
4245,
12,
642,
769,
402,
3704,
436,
314,
2569,
6450,
199,
3,
315,
314,
3794,
436,
15,
269,
1163,
8418,
2741,
543,
314,
199,
3,
4084,
14,
199,
3,
258,
627,
11443,
314,
536,
402,
4475,
3277,
14,
6590,
314,
1561,
402,
2399,
199,
3,
8417,
1443,
506,
1202,
370,
10692,
503,
10016,
7585,
7131,
687,
199,
3,
642,
2032,
1928,
2488,
6791,
5313,
4983,
14,
199,
3,
199,
3,
5749,
4141,
2281,
7049,
6515,
2334,
5877,
8164,
2401,
6483,
199,
3,
298,
1179,
2281,
2,
2401,
1821,
7168,
1549,
5292,
2990,
12,
6931,
12,
5400,
2845,
199,
3,
5471,
2296,
12,
2334,
5292,
2990,
1634,
3169,
2401,
3092,
2381,
199,
3,
437,
3115,
3104,
9315,
9706,
14,
1621,
4825,
6461,
7000,
2334,
5877,
199,
3,
11489,
1549,
6483,
6262,
7024,
2381,
1821,
8703,
12,
9168,
12,
9716,
12,
199,
3,
8820,
12,
9836,
12,
1549,
9110,
6736,
334,
6446,
12,
5400,
2845,
199,
3,
5471,
2296,
12,
9838,
1634,
9103,
9764,
1549,
9714,
27,
9102,
1634,
4815,
12,
199,
3,
7126,
12,
1549,
9206,
27,
1549,
9748,
9831,
9,
9802,
9817,
2401,
5258,
1821,
199,
3,
9815,
1634,
5603,
12,
7061,
1621,
7066,
12,
9644,
5603,
12,
1549,
7056,
199,
3,
334,
6446,
9254,
1549,
7334,
9,
7043,
1621,
1821,
9683,
5738,
1634,
2334,
4815,
199,
3,
1634,
5749,
4141,
12,
9704,
8036,
9691,
1634,
2334,
9726,
1634,
9712,
9784,
14,
199,
624,
437,
1933,
460,
10636,
18846,
7146,
367,
5343,
12901,
199,
199,
1494,
63,
21387,
365,
376,
3261,
626,
6571,
18846,
805,
10874,
1417,
543,
199,
65,
18042,
18846,
1654,
14,
2779,
365,
11619,
367,
5343,
503,
199,
18924,
12901,
14,
199,
199,
31456,
199,
5769,
199,
17,
14,
21876,
18042,
1654,
3794,
370,
1343,
3879,
314,
199,
20323,
1654,
14,
2779,
883,
506,
1586,
701,
3879,
314,
2569,
1414,
26,
339,
2672,
29164,
3413,
63,
21387,
14,
20323,
199,
199,
18,
14,
19468,
314,
18042,
1654,
365,
27725,
4911,
652,
701,
18549,
199,
1014,
921,
5967,
1491,
719,
12978,
6614,
14,
1360,
14,
15783,
314,
1844,
1329,
1380,
199,
10085,
641,
10623,
14,
982,
8137,
365,
6449,
6657,
12,
1265,
199,
14117,
1937,
282,
3486,
11343,
8559,
14,
421,
199,
16646,
18846,
8297,
199,
1280,
17575,
199,
199,
11423,
282,
18846,
1056,
12477,
315,
12,
314,
2073,
536,
199,
10085,
315,
314,
14305,
365,
8652,
465,
340,
652,
365,
282,
570,
931,
1334,
199,
28,
1129,
1533,
766,
63,
5586,
30,
436,
314,
3016,
3247,
315,
199,
28,
1129,
1533,
766,
63,
5586,
23220,
1927,
63,
354,
30,
63,
87,
609,
14,
647,
365,
10302,
14,
199,
199,
1858,
2893,
12,
340,
314,
2073,
536,
365,
1182,
2694,
15,
10289,
12,
314,
3016,
3247,
315,
199,
28,
1129,
1533,
766,
63,
5586,
12202,
2694,
15,
10289,
63,
87,
609,
14,
647,
365,
10302,
14,
199,
199,
33,
18846,
3016,
365,
26356,
402,
314,
2569,
7795,
3423,
26,
339,
3330,
63,
3450,
63,
1117,
63,
2911,
63,
11913,
8,
1069,
9,
272,
3330,
63,
3450,
63,
9609,
63,
576,
8,
1069,
9,
272,
3330,
63,
3450,
63,
25166,
63,
11707,
63,
11913,
8,
1069,
9,
199,
199,
4509,
26,
272,
1056,
26,
3413,
63,
1548,
1056,
14,
199,
199,
2520,
63,
3450,
63,
1117,
63,
2911,
63,
11913,
365,
2797,
5309,
314,
14305,
2410,
314,
199,
2139,
787,
8792,
4565,
436,
18846,
4382,
334,
3569,
63,
6493,
12,
199,
460,
10900,
63,
1927,
9,
787,
3483,
370,
1056,
14,
437,
3016,
199,
2425,
17100,
314,
1056,
701,
17026,
376,
1919,
14,
199,
199,
33,
1056,
909,
965,
314,
2569,
4382,
626,
1265,
883,
675,
5309,
314,
199,
2911,
14305,
334,
2520,
63,
3450,
63,
1117,
63,
2911,
63,
11913,
304,
199,
13,
10900,
63,
1927,
199,
13,
10900,
63,
6493,
199,
13,
10900,
63,
1023,
199,
13,
10900,
63,
5359,
199,
13,
10900,
63,
20902,
199,
13,
10900,
63,
3922,
199,
13,
10900,
63,
11151,
63,
16541,
199,
199,
1918,
2061,
2877,
787,
282,
4546,
32553,
14,
1666,
314,
2163,
19876,
14,
421,
199,
2610,
3922,
5612,
14727,
425,
199,
777,
12797,
199,
199,
3569,
63,
3922,
365,
3544,
663,
370,
488,
1380,
199,
2520,
63,
3450,
63,
1117,
63,
2911,
63,
11913,
365,
2797,
14,
982,
10900,
63,
11151,
63,
16541,
365,
440,
199,
403,
12,
1265,
1471,
11496,
1373,
1007,
3922,
687,
642,
769,
436,
663,
652,
370,
199,
3569,
63,
3922,
14,
199,
199,
1451,
27507,
199,
8684,
199,
199,
2520,
63,
3450,
63,
9609,
63,
576,
365,
2797,
2410,
314,
14305,
9709,
199,
26193,
14,
437,
3016,
883,
9128,
15,
2254,
3788,
687,
15,
475,
314,
1890,
199,
4941,
1056,
14,
3413,
63,
21387,
14,
1328,
1974,
859,
6571,
15841,
199,
509,
666,
9307,
14,
199,
199,
5556,
883,
9128,
282,
1245,
701,
314,
2569,
5164,
14,
339,
1245,
275,
1056,
14,
3569,
63,
1745,
14,
9391,
63,
1188,
342,
199,
199,
2765,
1240,
5664,
5133,
1263,
4890,
1318,
2787,
601,
322,
2310,
12,
436,
314,
4886,
666,
199,
1618,
314,
12467,
2787,
911,
506,
5489,
1901,
1245,
14,
3979,
1265,
3984,
1808,
473,
775,
38,
199,
21568,
17975,
8733,
503,
2945,
4113,
12,
9128,
63,
1188,
342,
911,
372,
488,
641,
18390,
199,
1258,
13,
14188,
972,
11261,
14305,
14,
3979,
1263,
1125,
11058,
12,
9128,
63,
1188,
342,
199,
14117,
746,
2005,
1919,
14,
199,
199,
5556,
883,
3222,
282,
1245,
701,
314,
2569,
5164,
14,
339,
1056,
14,
3569,
63,
1745,
14,
2254,
63,
1188,
8,
1188,
9,
421,
199,
18433,
8113,
199,
777,
306,
199,
199,
4858,
4655,
314,
2569,
5164,
503,
2951,
372,
13,
316,
687,
199,
2520,
63,
3450,
63,
9609,
63,
576,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
shuquan/leetcode
|
medium/combination-sum-iii/python/combination_sum_iii.py
|
1
|
1638
|
class Solution(object):
def combinationSum3(self, k, n):
"""
:type k: int
:type n: int
:rtype: List[List[int]]
"""
# Use recursion to resolve the problem
# The algorithm complexity is high due to it has to iterate from one
# for each call given k, n. Another optimization is passing another
# parameter in mycombinationSum3(self, k, n, start) for tracking.
if k < 0 or k > 0 and ((10 - k) + 9)*k/2 < n:
return []
elif k == 1 and n < 10:
return [[n]]
# Check the worst recursion sitiation and try to avoid it.
elif (1 + k)*k/2 == n:
return [range(1, k + 1)]
# Check the worst recursion sitiation and try to avoid it.
elif ((10 - k) + 9)*k/2 == n:
return [range(9, 9 - k, -1)]
else:
l = []
for i in range(n):
if i > 0 and i <= n/2 and i < 10:
for j in self.combinationSum3(k - 1, n - i):
# If the number is not unique, then skip it.
# If the return list is empty, then skip it.
if i not in j and len(j) != 0:
j.append(i)
l.append(sorted(j))
# If the length of final list is less than 2, then return it.
if len(l) < 2:
return l
else:
# Drop any duplicated element.
c = []
for i in l:
if i not in c:
c.append(i);
return c
|
apache-2.0
|
[
533,
9274,
8,
785,
304,
272,
347,
14665,
6959,
19,
8,
277,
12,
1022,
12,
302,
304,
267,
408,
267,
520,
466,
1022,
26,
1109,
267,
520,
466,
302,
26,
1109,
267,
520,
4500,
26,
3820,
59,
1296,
59,
442,
2677,
267,
408,
398,
327,
3645,
16189,
370,
7512,
314,
5160,
267,
327,
710,
5563,
6114,
1209,
365,
4721,
7037,
370,
652,
965,
370,
13974,
687,
1373,
267,
327,
367,
1924,
1240,
1627,
1022,
12,
302,
14,
22604,
13712,
365,
9476,
4573,
267,
327,
2725,
315,
3002,
6560,
3155,
6959,
19,
8,
277,
12,
1022,
12,
302,
12,
1343,
9,
367,
15161,
14,
267,
340,
1022,
665,
378,
503,
1022,
690,
378,
436,
3666,
709,
446,
1022,
9,
435,
1749,
3342,
75,
15,
18,
665,
302,
26,
288,
372,
942,
267,
916,
1022,
508,
413,
436,
302,
665,
1616,
26,
686,
198,
1107,
3474,
78,
2677,
267,
327,
2670,
314,
1319,
270,
16189,
308,
5277,
425,
436,
862,
370,
5126,
652,
14,
267,
916,
334,
17,
435,
1022,
3342,
75,
15,
18,
508,
302,
26,
288,
372,
359,
1842,
8,
17,
12,
1022,
435,
413,
1874,
267,
327,
2670,
314,
1319,
270,
16189,
308,
5277,
425,
436,
862,
370,
5126,
652,
14,
267,
916,
3666,
709,
446,
1022,
9,
435,
1749,
3342,
75,
15,
18,
508,
302,
26,
288,
372,
359,
1842,
8,
25,
12,
1749,
446,
1022,
12,
446,
17,
1874,
267,
587,
26,
288,
634,
275,
942,
288,
367,
284,
315,
1425,
8,
78,
304,
355,
340,
284,
690,
378,
436,
284,
2695,
302,
15,
18,
436,
284,
665,
1616,
26,
490,
367,
1335,
315,
291,
14,
6560,
3155,
6959,
19,
8,
75,
446,
413,
12,
302,
446,
284,
304,
717,
327,
982,
314,
1329,
365,
440,
3747,
12,
2066,
3372,
652,
14,
717,
327,
982,
314,
372,
769,
365,
2701,
12,
2066,
3372,
652,
14,
717,
340,
284,
440,
315,
1335,
436,
822,
8,
74,
9,
1137,
378,
26,
1169,
1335,
14,
740,
8,
73,
9,
1169,
634,
14,
740,
8,
5917,
8,
74,
430,
288,
327,
982,
314,
2582,
402,
4242,
769,
365,
6656,
2419,
499,
12,
2066,
372,
652,
14,
288,
340,
822,
8,
76,
9,
665,
499,
26,
355,
372,
634,
288,
587,
26,
355,
327,
18110,
1263,
21747,
1819,
14,
355,
286,
275,
942,
355,
367,
284,
315,
634,
26,
490,
340,
284,
440,
315,
286,
26,
717,
286,
14,
740,
8,
73,
2736,
355,
372,
286,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
9274,
8,
785,
304,
272,
347,
14665,
6959,
19,
8,
277,
12,
1022,
12,
302,
304,
267,
408,
267,
520,
466,
1022,
26,
1109,
267,
520,
466,
302,
26,
1109,
267,
520,
4500,
26,
3820,
59,
1296,
59,
442,
2677,
267,
408,
398,
327,
3645,
16189,
370,
7512,
314,
5160,
267,
327,
710,
5563,
6114,
1209,
365,
4721,
7037,
370,
652,
965,
370,
13974,
687,
1373,
267,
327,
367,
1924,
1240,
1627,
1022,
12,
302,
14,
22604,
13712,
365,
9476,
4573,
267,
327,
2725,
315,
3002,
6560,
3155,
6959,
19,
8,
277,
12,
1022,
12,
302,
12,
1343,
9,
367,
15161,
14,
267,
340,
1022,
665,
378,
503,
1022,
690,
378,
436,
3666,
709,
446,
1022,
9,
435,
1749,
3342,
75,
15,
18,
665,
302,
26,
288,
372,
942,
267,
916,
1022,
508,
413,
436,
302,
665,
1616,
26,
686,
198,
1107,
3474,
78,
2677,
267,
327,
2670,
314,
1319,
270,
16189,
308,
5277,
425,
436,
862,
370,
5126,
652,
14,
267,
916,
334,
17,
435,
1022,
3342,
75,
15,
18,
508,
302,
26,
288,
372,
359,
1842,
8,
17,
12,
1022,
435,
413,
1874,
267,
327,
2670,
314,
1319,
270,
16189,
308,
5277,
425,
436,
862,
370,
5126,
652,
14,
267,
916,
3666,
709,
446,
1022,
9,
435,
1749,
3342,
75,
15,
18,
508,
302,
26,
288,
372,
359,
1842,
8,
25,
12,
1749,
446,
1022,
12,
446,
17,
1874,
267,
587,
26,
288,
634,
275,
942,
288,
367,
284,
315,
1425,
8,
78,
304,
355,
340,
284,
690,
378,
436,
284,
2695,
302,
15,
18,
436,
284,
665,
1616,
26,
490,
367,
1335,
315,
291,
14,
6560,
3155,
6959,
19,
8,
75,
446,
413,
12,
302,
446,
284,
304,
717,
327,
982,
314,
1329,
365,
440,
3747,
12,
2066,
3372,
652,
14,
717,
327,
982,
314,
372,
769,
365,
2701,
12,
2066,
3372,
652,
14,
717,
340,
284,
440,
315,
1335,
436,
822,
8,
74,
9,
1137,
378,
26,
1169,
1335,
14,
740,
8,
73,
9,
1169,
634,
14,
740,
8,
5917,
8,
74,
430,
288,
327,
982,
314,
2582,
402,
4242,
769,
365,
6656,
2419,
499,
12,
2066,
372,
652,
14,
288,
340,
822,
8,
76,
9,
665,
499,
26,
355,
372,
634,
288,
587,
26,
355,
327,
18110,
1263,
21747,
1819,
14,
355,
286,
275,
942,
355,
367,
284,
315,
634,
26,
490,
340,
284,
440,
315,
286,
26,
717,
286,
14,
740,
8,
73,
2736,
355,
372,
286,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
grembo/buildbot
|
master/buildbot/test/util/endpoint.py
|
10
|
4272
|
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Copyright Buildbot Team Members
from __future__ import absolute_import
from __future__ import print_function
from twisted.internet import defer
from buildbot.data import base
from buildbot.data import resultspec
from buildbot.test.fake import fakemaster
from buildbot.test.util import interfaces
from buildbot.test.util import validation
from buildbot.util import pathmatch
class EndpointMixin(interfaces.InterfaceTests):
# test mixin for testing Endpoint subclasses
# class being tested
endpointClass = None
# the corresponding resource type - this will be instantiated at
# self.data.rtypes[rtype.type] and self.rtype
resourceTypeClass = None
def setUpEndpoint(self):
self.master = fakemaster.make_master(wantMq=True, wantDb=True,
wantData=True, testcase=self)
self.db = self.master.db
self.mq = self.master.mq
self.data = self.master.data
self.matcher = pathmatch.Matcher()
rtype = self.rtype = self.resourceTypeClass(self.master)
setattr(self.data.rtypes, rtype.name, rtype)
self.ep = self.endpointClass(rtype, self.master)
# this usually fails when a single-element pathPattern does not have a
# trailing comma
pathPatterns = self.ep.pathPatterns.split()
for pp in pathPatterns:
if pp == '/':
continue
if not pp.startswith('/') or pp.endswith('/'):
raise AssertionError("invalid pattern %r" % (pp,))
pathPatterns = [tuple(pp.split('/')[1:])
for pp in pathPatterns]
for pp in pathPatterns:
self.matcher[pp] = self.ep
self.pathArgs = [
set([arg.split(':', 1)[1] for arg in pp if ':' in arg])
for pp in pathPatterns if pp is not None]
def tearDownEndpoint(self):
pass
def validateData(self, object):
validation.verifyData(self, self.rtype.entityType, {}, object)
# call methods, with extra checks
def callGet(self, path, resultSpec=None):
self.assertIsInstance(path, tuple)
if resultSpec is None:
resultSpec = resultspec.ResultSpec()
endpoint, kwargs = self.matcher[path]
self.assertIdentical(endpoint, self.ep)
d = endpoint.get(resultSpec, kwargs)
self.assertIsInstance(d, defer.Deferred)
@d.addCallback
def checkNumber(rv):
if self.ep.isCollection:
self.assertIsInstance(rv, (list, base.ListResult))
else:
self.assertIsInstance(rv, (dict, type(None)))
return rv
return d
def callControl(self, action, args, path):
self.assertIsInstance(path, tuple)
endpoint, kwargs = self.matcher[path]
self.assertIdentical(endpoint, self.ep)
d = self.ep.control(action, args, kwargs)
self.assertIsInstance(d, defer.Deferred)
return d
# interface tests
def test_get_spec(self):
@self.assertArgSpecMatches(self.ep.get)
def get(self, resultSpec, kwargs):
pass
def test_control_spec(self):
@self.assertArgSpecMatches(self.ep.control)
def control(self, action, args, kwargs):
pass
def test_rootLinkName(self):
rootLinkName = self.ep.rootLinkName
if not rootLinkName:
return
try:
self.assertEqual(self.matcher[(rootLinkName,)][0], self.ep)
except KeyError:
self.fail('No match for rootlink: ' + rootLinkName)
|
gpl-2.0
|
[
3,
961,
570,
365,
1777,
402,
6516,
3018,
14,
221,
6516,
3018,
365,
2867,
2032,
26,
1265,
883,
199,
3,
3604,
652,
436,
15,
269,
2811,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
199,
3,
844,
465,
3267,
701,
314,
2868,
2290,
2752,
12,
1015,
499,
14,
199,
3,
199,
3,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
1325,
2428,
199,
3,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
3169,
503,
3092,
199,
3,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
1696,
1684,
844,
367,
1655,
199,
3,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
3180,
543,
199,
3,
642,
2240,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
2752,
12,
3277,
2020,
8026,
199,
3,
11236,
14259,
12,
12066,
11844,
12,
8226,
12,
4828,
11315,
13,
10067,
8217,
14,
199,
3,
199,
3,
1898,
6516,
3018,
11682,
14409,
83,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
199,
504,
7390,
14,
4901,
492,
10133,
199,
199,
504,
21306,
14,
576,
492,
1300,
199,
504,
21306,
14,
576,
492,
754,
1650,
199,
504,
21306,
14,
396,
14,
3183,
492,
4026,
4133,
199,
504,
21306,
14,
396,
14,
1974,
492,
8386,
199,
504,
21306,
14,
396,
14,
1974,
492,
6411,
199,
504,
21306,
14,
1974,
492,
931,
1431,
421,
199,
533,
9599,
1403,
4256,
8,
7436,
14,
4267,
2925,
304,
272,
327,
511,
20048,
367,
5343,
9599,
1403,
9180,
339,
327,
1021,
3769,
12470,
272,
6037,
2543,
275,
488,
339,
327,
314,
5226,
2073,
730,
446,
642,
911,
506,
17544,
737,
272,
327,
291,
14,
576,
14,
82,
1313,
59,
4500,
14,
466,
61,
436,
291,
14,
4500,
272,
2073,
804,
2543,
275,
488,
339,
347,
3613,
11442,
8,
277,
304,
267,
291,
14,
4133,
275,
4026,
4133,
14,
1875,
63,
4133,
8,
7051,
45,
81,
29,
549,
12,
2934,
8882,
29,
549,
12,
6163,
2934,
1451,
29,
549,
12,
16228,
29,
277,
9,
267,
291,
14,
697,
275,
291,
14,
4133,
14,
697,
267,
291,
14,
8334,
275,
291,
14,
4133,
14,
8334,
267,
291,
14,
576,
275,
291,
14,
4133,
14,
576,
267,
291,
14,
16135,
275,
931,
1431,
14,
16073,
342,
398,
519,
466,
275,
291,
14,
4500,
275,
291,
14,
1927,
804,
2543,
8,
277,
14,
4133,
9,
267,
5371,
8,
277,
14,
576,
14,
82,
1313,
12,
519,
466,
14,
354,
12,
519,
466,
9,
398,
291,
14,
1545,
275,
291,
14,
6520,
2543,
8,
4500,
12,
291,
14,
4133,
9,
398,
327,
642,
9987,
6918,
1380,
282,
2849,
13,
2108,
931,
9959,
1630,
440,
1172,
282,
267,
327,
8520,
10029,
267,
931,
25662,
275,
291,
14,
1545,
14,
515,
25662,
14,
1294,
342,
267,
367,
11618,
315,
931,
25662,
26,
288,
340,
11618,
508,
20549,
355,
1980,
288,
340,
440,
11618,
14,
2460,
7825,
503,
11618,
14,
4130,
18265,
355,
746,
9070,
480,
3197,
3851,
450,
82,
2,
450,
334,
802,
4641,
267,
931,
25662,
275,
359,
2960,
8,
802,
14,
1294,
30746,
17,
5728,
717,
367,
11618,
315,
931,
25662,
61,
267,
367,
11618,
315,
931,
25662,
26,
288,
291,
14,
16135,
59,
802,
61,
275,
291,
14,
1545,
398,
291,
14,
515,
6213,
275,
359,
288,
663,
779,
1273,
14,
1294,
16451,
413,
2788,
17,
61,
367,
1680,
315,
11618,
340,
10871,
315,
1680,
566,
288,
367,
11618,
315,
931,
25662,
340,
11618,
365,
440,
488,
61,
339,
347,
6766,
11442,
8,
277,
304,
267,
986,
339,
347,
4107,
1451,
8,
277,
12,
909,
304,
267,
6411,
14,
4712,
1451,
8,
277,
12,
291,
14,
4500,
14,
4502,
804,
12,
5479,
909,
9,
339,
327,
1240,
3102,
12,
543,
2402,
5920,
339,
347,
1240,
1002,
8,
277,
12,
931,
12,
754,
5307,
29,
403,
304,
267,
291,
14,
6926,
8,
515,
12,
2008,
9,
267,
340,
754,
5307,
365,
488,
26,
288,
754,
5307,
275,
754,
1650,
14,
2889,
5307,
342,
267,
6037,
12,
2074,
275,
291,
14,
16135,
59,
515,
61,
267,
291,
14,
479,
22469,
8,
6520,
12,
291,
14,
1545,
9,
267,
366,
275,
6037,
14,
362,
8,
1099,
5307,
12,
2074,
9,
267,
291,
14,
6926,
8,
68,
12,
10133,
14,
9937,
9,
398,
768,
68,
14,
10053,
267,
347,
1104,
3259,
8,
6310,
304,
288,
340,
291,
14,
1545,
14,
374,
7768,
26,
355,
291,
14,
6926,
8,
6310,
12,
334,
513,
12,
1300,
14,
27577,
430,
288,
587,
26,
355,
291,
14,
6926,
8,
6310,
12,
334,
807,
12,
730,
8,
403,
1724,
288,
372,
4336,
267,
372,
366,
339,
347,
1240,
3717,
8,
277,
12,
1595,
12,
1249,
12,
931,
304,
267,
291,
14,
6926,
8,
515,
12,
2008,
9,
267,
6037,
12,
2074,
275,
291,
14,
16135,
59,
515,
61,
267,
291,
14,
479,
22469,
8,
6520,
12,
291,
14,
1545,
9,
267,
366,
275,
291,
14,
1545,
14,
2785,
8,
1287,
12,
1249,
12,
2074,
9,
267,
291,
14,
6926,
8,
68,
12,
10133,
14,
9937,
9,
267,
372,
366,
339,
327,
3217,
2295,
339,
347,
511,
63,
362,
63,
1650,
8,
277,
304,
267,
768,
277,
14,
479,
6373,
5307,
12962,
8,
277,
14,
1545,
14,
362,
9,
267,
347,
664,
8,
277,
12,
754,
5307,
12,
2074,
304,
288,
986,
339,
347,
511,
63,
2785,
63,
1650,
8,
277,
304,
267,
768,
277,
14,
479,
6373,
5307,
12962,
8,
277,
14,
1545,
14,
2785,
9,
267,
347,
3304,
8,
277,
12,
1595,
12,
1249,
12,
2074,
304,
288,
986,
339,
347,
511,
63,
1231,
3834,
985,
8,
277,
304,
267,
1738,
3834,
985,
275,
291,
14,
1545,
14,
1231,
3834,
985,
267,
340,
440,
1738,
3834,
985,
26,
288,
372,
267,
862,
26,
288,
291,
14,
629,
8,
277,
14,
16135,
7528,
1231,
3834,
985,
4258,
1527,
16,
467,
291,
14,
1545,
9,
267,
871,
4067,
26,
288,
291,
14,
1633,
360,
1944,
1336,
367,
1738,
1073,
26,
283,
435,
1738,
3834,
985,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
961,
570,
365,
1777,
402,
6516,
3018,
14,
221,
6516,
3018,
365,
2867,
2032,
26,
1265,
883,
199,
3,
3604,
652,
436,
15,
269,
2811,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
199,
3,
844,
465,
3267,
701,
314,
2868,
2290,
2752,
12,
1015,
499,
14,
199,
3,
199,
3,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
1325,
2428,
199,
3,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
3169,
503,
3092,
199,
3,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
1696,
1684,
844,
367,
1655,
199,
3,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
3180,
543,
199,
3,
642,
2240,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
2752,
12,
3277,
2020,
8026,
199,
3,
11236,
14259,
12,
12066,
11844,
12,
8226,
12,
4828,
11315,
13,
10067,
8217,
14,
199,
3,
199,
3,
1898,
6516,
3018,
11682,
14409,
83,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
199,
504,
7390,
14,
4901,
492,
10133,
199,
199,
504,
21306,
14,
576,
492,
1300,
199,
504,
21306,
14,
576,
492,
754,
1650,
199,
504,
21306,
14,
396,
14,
3183,
492,
4026,
4133,
199,
504,
21306,
14,
396,
14,
1974,
492,
8386,
199,
504,
21306,
14,
396,
14,
1974,
492,
6411,
199,
504,
21306,
14,
1974,
492,
931,
1431,
421,
199,
533,
9599,
1403,
4256,
8,
7436,
14,
4267,
2925,
304,
272,
327,
511,
20048,
367,
5343,
9599,
1403,
9180,
339,
327,
1021,
3769,
12470,
272,
6037,
2543,
275,
488,
339,
327,
314,
5226,
2073,
730,
446,
642,
911,
506,
17544,
737,
272,
327,
291,
14,
576,
14,
82,
1313,
59,
4500,
14,
466,
61,
436,
291,
14,
4500,
272,
2073,
804,
2543,
275,
488,
339,
347,
3613,
11442,
8,
277,
304,
267,
291,
14,
4133,
275,
4026,
4133,
14,
1875,
63,
4133,
8,
7051,
45,
81,
29,
549,
12,
2934,
8882,
29,
549,
12,
6163,
2934,
1451,
29,
549,
12,
16228,
29,
277,
9,
267,
291,
14,
697,
275,
291,
14,
4133,
14,
697,
267,
291,
14,
8334,
275,
291,
14,
4133,
14,
8334,
267,
291,
14,
576,
275,
291,
14,
4133,
14,
576,
267,
291,
14,
16135,
275,
931,
1431,
14,
16073,
342,
398,
519,
466,
275,
291,
14,
4500,
275,
291,
14,
1927,
804,
2543,
8,
277,
14,
4133,
9,
267,
5371,
8,
277,
14,
576,
14,
82,
1313,
12,
519,
466,
14,
354,
12,
519,
466,
9,
398,
291,
14,
1545,
275,
291,
14,
6520,
2543,
8,
4500,
12,
291,
14,
4133,
9,
398,
327,
642,
9987,
6918,
1380,
282,
2849,
13,
2108,
931,
9959,
1630,
440,
1172,
282,
267,
327,
8520,
10029,
267,
931,
25662,
275,
291,
14,
1545,
14,
515,
25662,
14,
1294,
342,
267,
367,
11618,
315,
931,
25662,
26,
288,
340,
11618,
508,
20549,
355,
1980,
288,
340,
440,
11618,
14,
2460,
7825,
503,
11618,
14,
4130,
18265,
355,
746,
9070,
480,
3197,
3851,
450,
82,
2,
450,
334,
802,
4641,
267,
931,
25662,
275,
359,
2960,
8,
802,
14,
1294,
30746,
17,
5728,
717,
367,
11618,
315,
931,
25662,
61,
267,
367,
11618,
315,
931,
25662,
26,
288,
291,
14,
16135,
59,
802,
61,
275,
291,
14,
1545,
398,
291,
14,
515,
6213,
275,
359,
288,
663,
779,
1273,
14,
1294,
16451,
413,
2788,
17,
61,
367,
1680,
315,
11618,
340,
10871,
315,
1680,
566,
288,
367,
11618,
315,
931,
25662,
340,
11618,
365,
440,
488,
61,
339,
347,
6766,
11442,
8,
277,
304,
267,
986,
339,
347,
4107,
1451,
8,
277,
12,
909,
304,
267,
6411,
14,
4712,
1451,
8,
277,
12,
291,
14,
4500,
14,
4502,
804,
12,
5479,
909,
9,
339,
327,
1240,
3102,
12,
543,
2402,
5920,
339,
347,
1240,
1002,
8,
277,
12,
931,
12,
754,
5307,
29,
403,
304,
267,
291,
14,
6926,
8,
515,
12,
2008,
9,
267,
340,
754,
5307,
365,
488,
26,
288,
754,
5307,
275,
754,
1650,
14,
2889,
5307,
342,
267,
6037,
12,
2074,
275,
291,
14,
16135,
59,
515,
61,
267,
291,
14,
479,
22469,
8,
6520,
12,
291,
14,
1545,
9,
267,
366,
275,
6037,
14,
362,
8,
1099,
5307,
12,
2074,
9,
267,
291,
14,
6926,
8,
68,
12,
10133,
14,
9937,
9,
398,
768,
68,
14,
10053,
267,
347,
1104,
3259,
8,
6310,
304,
288,
340,
291,
14,
1545,
14,
374,
7768,
26,
355,
291,
14,
6926,
8,
6310,
12,
334,
513,
12,
1300,
14,
27577,
430,
288,
587,
26,
355,
291,
14,
6926,
8,
6310,
12,
334,
807,
12,
730,
8,
403,
1724,
288,
372,
4336,
267,
372,
366,
339,
347,
1240,
3717,
8,
277,
12,
1595,
12,
1249,
12,
931,
304,
267,
291,
14,
6926,
8,
515,
12,
2008,
9,
267,
6037,
12,
2074,
275,
291,
14,
16135,
59,
515,
61,
267,
291,
14,
479,
22469,
8,
6520,
12,
291,
14,
1545,
9,
267,
366,
275,
291,
14,
1545,
14,
2785,
8,
1287,
12,
1249,
12,
2074,
9,
267,
291,
14,
6926,
8,
68,
12,
10133,
14,
9937,
9,
267,
372,
366,
339,
327,
3217,
2295,
339,
347,
511,
63,
362,
63,
1650,
8,
277,
304,
267,
768,
277,
14,
479,
6373,
5307,
12962,
8,
277,
14,
1545,
14,
362,
9,
267,
347,
664,
8,
277,
12,
754,
5307,
12,
2074,
304,
288,
986,
339,
347,
511,
63,
2785,
63,
1650,
8,
277,
304,
267,
768,
277,
14,
479,
6373,
5307,
12962,
8,
277,
14,
1545,
14,
2785,
9,
267,
347,
3304,
8,
277,
12,
1595,
12,
1249,
12,
2074,
304,
288,
986,
339,
347,
511,
63,
1231,
3834,
985,
8,
277,
304,
267,
1738,
3834,
985,
275,
291,
14,
1545,
14,
1231,
3834,
985,
267,
340,
440,
1738,
3834,
985,
26,
288,
372,
267,
862,
26,
288,
291,
14,
629,
8,
277,
14,
16135,
7528,
1231,
3834,
985,
4258,
1527,
16,
467,
291,
14,
1545,
9,
267,
871,
4067,
26,
288,
291,
14,
1633,
360,
1944,
1336,
367,
1738,
1073,
26,
283,
435,
1738,
3834,
985,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
poojavade/Genomics_Docker
|
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/scipy/linalg/_matfuncs_sqrtm.py
|
77
|
5867
|
"""
Matrix square root for general matrices and for upper triangular matrices.
This module exists to avoid cyclic imports.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['sqrtm']
import numpy as np
from scipy._lib._util import _asarray_validated
# Local imports
from .misc import norm
from .lapack import ztrsyl, dtrsyl
from .decomp_schur import schur, rsf2csf
class SqrtmError(np.linalg.LinAlgError):
pass
def _sqrtm_triu(T, blocksize=64):
"""
Matrix square root of an upper triangular matrix.
This is a helper function for `sqrtm` and `logm`.
Parameters
----------
T : (N, N) array_like upper triangular
Matrix whose square root to evaluate
blocksize : int, optional
If the blocksize is not degenerate with respect to the
size of the input array, then use a blocked algorithm. (Default: 64)
Returns
-------
sqrtm : (N, N) ndarray
Value of the sqrt function at `T`
References
----------
.. [1] Edvin Deadman, Nicholas J. Higham, Rui Ralha (2013)
"Blocked Schur Algorithms for Computing the Matrix Square Root,
Lecture Notes in Computer Science, 7782. pp. 171-182.
"""
T_diag = np.diag(T)
keep_it_real = np.isrealobj(T) and np.min(T_diag) >= 0
if not keep_it_real:
T_diag = T_diag.astype(complex)
R = np.diag(np.sqrt(T_diag))
# Compute the number of blocks to use; use at least one block.
n, n = T.shape
nblocks = max(n // blocksize, 1)
# Compute the smaller of the two sizes of blocks that
# we will actually use, and compute the number of large blocks.
bsmall, nlarge = divmod(n, nblocks)
blarge = bsmall + 1
nsmall = nblocks - nlarge
if nsmall * bsmall + nlarge * blarge != n:
raise Exception('internal inconsistency')
# Define the index range covered by each block.
start_stop_pairs = []
start = 0
for count, size in ((nsmall, bsmall), (nlarge, blarge)):
for i in range(count):
start_stop_pairs.append((start, start + size))
start += size
# Within-block interactions.
for start, stop in start_stop_pairs:
for j in range(start, stop):
for i in range(j-1, start-1, -1):
s = 0
if j - i > 1:
s = R[i, i+1:j].dot(R[i+1:j, j])
denom = R[i, i] + R[j, j]
if not denom:
raise SqrtmError('failed to find the matrix square root')
R[i, j] = (T[i, j] - s) / denom
# Between-block interactions.
for j in range(nblocks):
jstart, jstop = start_stop_pairs[j]
for i in range(j-1, -1, -1):
istart, istop = start_stop_pairs[i]
S = T[istart:istop, jstart:jstop]
if j - i > 1:
S = S - R[istart:istop, istop:jstart].dot(R[istop:jstart,
jstart:jstop])
# Invoke LAPACK.
# For more details, see the solve_sylvester implemention
# and the fortran dtrsyl and ztrsyl docs.
Rii = R[istart:istop, istart:istop]
Rjj = R[jstart:jstop, jstart:jstop]
if keep_it_real:
x, scale, info = dtrsyl(Rii, Rjj, S)
else:
x, scale, info = ztrsyl(Rii, Rjj, S)
R[istart:istop, jstart:jstop] = x * scale
# Return the matrix square root.
return R
def sqrtm(A, disp=True, blocksize=64):
"""
Matrix square root.
Parameters
----------
A : (N, N) array_like
Matrix whose square root to evaluate
disp : bool, optional
Print warning if error in the result is estimated large
instead of returning estimated error. (Default: True)
blocksize : integer, optional
If the blocksize is not degenerate with respect to the
size of the input array, then use a blocked algorithm. (Default: 64)
Returns
-------
sqrtm : (N, N) ndarray
Value of the sqrt function at `A`
errest : float
(if disp == False)
Frobenius norm of the estimated error, ||err||_F / ||A||_F
References
----------
.. [1] Edvin Deadman, Nicholas J. Higham, Rui Ralha (2013)
"Blocked Schur Algorithms for Computing the Matrix Square Root,
Lecture Notes in Computer Science, 7782. pp. 171-182.
Examples
--------
>>> from scipy.linalg import sqrtm
>>> a = np.array([[1.0, 3.0], [1.0, 4.0]])
>>> r = sqrtm(a)
>>> r
array([[ 0.75592895, 1.13389342],
[ 0.37796447, 1.88982237]])
>>> r.dot(r)
array([[ 1., 3.],
[ 1., 4.]])
"""
A = _asarray_validated(A, check_finite=True, as_inexact=True)
if len(A.shape) != 2:
raise ValueError("Non-matrix input to matrix function.")
if blocksize < 1:
raise ValueError("The blocksize should be at least 1.")
keep_it_real = np.isrealobj(A)
if keep_it_real:
T, Z = schur(A)
if not np.array_equal(T, np.triu(T)):
T, Z = rsf2csf(T, Z)
else:
T, Z = schur(A, output='complex')
failflag = False
try:
R = _sqrtm_triu(T, blocksize=blocksize)
ZH = np.conjugate(Z).T
X = Z.dot(R).dot(ZH)
except SqrtmError:
failflag = True
X = np.empty_like(A)
X.fill(np.nan)
if disp:
nzeig = np.any(np.diag(T) == 0)
if nzeig:
print("Matrix is singular and may not have a square root.")
elif failflag:
print("Failed to find a square root.")
return X
else:
try:
arg2 = norm(X.dot(X) - A, 'fro')**2 / norm(A, 'fro')
except ValueError:
# NaNs in matrix
arg2 = np.inf
return X, arg2
|
apache-2.0
|
[
624,
199,
6443,
12386,
1738,
367,
8605,
12627,
436,
367,
7008,
3229,
11572,
12627,
14,
199,
199,
2765,
859,
3495,
370,
5126,
32637,
8925,
14,
199,
199,
624,
199,
504,
636,
2443,
363,
492,
4629,
12,
870,
63,
1593,
12,
3679,
63,
646,
199,
199,
363,
452,
363,
275,
788,
5079,
77,
418,
199,
199,
646,
2680,
465,
980,
199,
199,
504,
7026,
423,
773,
423,
1974,
492,
485,
8748,
63,
24372,
421,
199,
3,
10111,
8925,
199,
504,
1275,
9923,
492,
6316,
199,
504,
1275,
26760,
492,
1315,
454,
1786,
76,
12,
366,
454,
1786,
76,
199,
504,
1275,
271,
863,
63,
15820,
300,
492,
308,
335,
300,
12,
519,
7646,
18,
1259,
70,
421,
199,
533,
428,
81,
2591,
77,
547,
8,
1590,
14,
10096,
14,
27889,
28846,
547,
304,
272,
986,
421,
199,
318,
485,
5079,
77,
63,
599,
85,
8,
52,
12,
27461,
29,
772,
304,
272,
408,
272,
8449,
12386,
1738,
402,
376,
7008,
3229,
11572,
3634,
14,
339,
961,
365,
282,
5922,
805,
367,
658,
5079,
77,
64,
436,
658,
793,
77,
2313,
339,
3897,
272,
4143,
272,
377,
520,
334,
46,
12,
653,
9,
1625,
63,
2930,
7008,
3229,
11572,
267,
8449,
7447,
12386,
1738,
370,
9352,
272,
27461,
520,
1109,
12,
2716,
267,
982,
314,
27461,
365,
440,
477,
4208,
543,
14021,
370,
314,
267,
1568,
402,
314,
1324,
1625,
12,
2066,
675,
282,
19697,
5563,
14,
334,
2698,
26,
5049,
9,
339,
1803,
272,
5514,
272,
7452,
77,
520,
334,
46,
12,
653,
9,
6800,
267,
1594,
402,
314,
7452,
805,
737,
658,
52,
64,
339,
14504,
272,
4143,
272,
2508,
359,
17,
61,
662,
8398,
262,
1487,
350,
1237,
12,
653,
1158,
393,
305,
1603,
14,
16332,
455,
12,
820,
1907,
820,
279,
2411,
334,
6965,
9,
1779,
298,
3142,
379,
22985,
300,
4580,
12719,
367,
27799,
314,
8449,
428,
5937,
12826,
12,
1779,
491,
449,
608,
8144,
315,
3599,
2699,
27491,
12,
8375,
2564,
14,
11618,
14,
413,
3172,
13,
12894,
14,
339,
408,
272,
377,
63,
6706,
275,
980,
14,
6706,
8,
52,
9,
272,
4215,
63,
390,
63,
3093,
275,
980,
14,
374,
3093,
1113,
8,
52,
9,
436,
980,
14,
827,
8,
52,
63,
6706,
9,
2356,
378,
272,
340,
440,
4215,
63,
390,
63,
3093,
26,
267,
377,
63,
6706,
275,
377,
63,
6706,
14,
6041,
8,
5254,
9,
272,
820,
275,
980,
14,
6706,
8,
1590,
14,
5079,
8,
52,
63,
6706,
430,
339,
327,
8354,
314,
1329,
402,
5664,
370,
675,
27,
675,
737,
5210,
1373,
1853,
14,
272,
302,
12,
302,
275,
377,
14,
1392,
272,
302,
4166,
275,
1390,
8,
78,
5001,
27461,
12,
413,
9,
339,
327,
8354,
314,
12700,
402,
314,
2877,
10627,
402,
5664,
626,
272,
327,
781,
911,
5965,
675,
12,
436,
4526,
314,
1329,
402,
7031,
5664,
14,
272,
330,
7241,
12,
302,
9629,
275,
16438,
8,
78,
12,
302,
4166,
9,
272,
6826,
4430,
275,
330,
7241,
435,
413,
272,
700,
8060,
275,
302,
4166,
446,
302,
9629,
272,
340,
700,
8060,
627,
330,
7241,
435,
302,
9629,
627,
6826,
4430,
1137,
302,
26,
267,
746,
2186,
360,
4672,
315,
20249,
358,
339,
327,
13930,
314,
1478,
1425,
24295,
701,
1924,
1853,
14,
272,
1343,
63,
2379,
63,
7322,
275,
942,
272,
1343,
275,
378,
272,
367,
2338,
12,
1568,
315,
3666,
561,
8060,
12,
330,
7241,
395,
334,
7530,
4430,
12,
6826,
4430,
2298,
267,
367,
284,
315,
1425,
8,
835,
304,
288,
1343,
63,
2379,
63,
7322,
14,
740,
1332,
928,
12,
1343,
435,
1568,
430,
288,
1343,
847,
1568,
339,
327,
8777,
262,
13,
1457,
315,
22990,
14,
272,
367,
1343,
12,
3631,
315,
1343,
63,
2379,
63,
7322,
26,
267,
367,
1335,
315,
1425,
8,
928,
12,
3631,
304,
288,
367,
284,
315,
1425,
8,
74,
13,
17,
12,
1343,
13,
17,
12,
446,
17,
304,
355,
308,
275,
378,
355,
340,
1335,
446,
284,
690,
413,
26,
490,
308,
275,
820,
59,
73,
12,
284,
11,
17,
26,
74,
1055,
3287,
8,
50,
59,
73,
11,
17,
26,
74,
12,
1335,
566,
355,
27878,
275,
820,
59,
73,
12,
284,
61,
435,
820,
59,
74,
12,
1335,
61,
355,
340,
440,
27878,
26,
490,
746,
428,
81,
2591,
77,
547,
360,
4892,
370,
2342,
314,
3634,
12386,
1738,
358,
355,
820,
59,
73,
12,
1335,
61,
275,
334,
52,
59,
73,
12,
1335,
61,
446,
308,
9,
1182,
27878,
339,
327,
31535,
3109,
13,
1457,
315,
22990,
14,
272,
367,
1335,
315,
1425,
8,
78,
4166,
304,
267,
1335,
928,
12,
1335,
2379,
275,
1343,
63,
2379,
63,
7322,
59,
74,
61,
267,
367,
284,
315,
1425,
8,
74,
13,
17,
12,
446,
17,
12,
446,
17,
304,
288,
284,
928,
12,
284,
2379,
275,
1343,
63,
2379,
63,
7322,
59,
73,
61,
288,
428,
275,
377,
59,
631,
580,
26,
631,
411,
12,
1335,
928,
26,
74,
2379,
61,
288,
340,
1335,
446,
284,
690,
413,
26,
355,
428,
275,
428,
446,
820,
59,
631,
580,
26,
631,
411,
12,
284,
2379,
26,
74,
928,
1055,
3287,
8,
50,
59,
631,
411,
26,
74,
928,
12,
14663,
1335,
928,
26,
74,
2379,
566,
953,
327,
31049,
491,
1282,
3099,
14,
288,
327,
2104,
1655,
2436,
12,
1937,
314,
14241,
63,
1786,
24279,
351,
2456,
32016,
288,
327,
436,
314,
289,
14522,
366,
454,
1786,
76,
436,
1315,
454,
1786,
76,
9149,
14,
288,
820,
5908,
275,
820,
59,
631,
580,
26,
631,
411,
12,
284,
928,
26,
631,
411,
61,
288,
820,
12098,
275,
820,
59,
74,
928,
26,
74,
2379,
12,
1335,
928,
26,
74,
2379,
61,
288,
340,
4215,
63,
390,
63,
3093,
26,
355,
671,
12,
4666,
12,
2256,
275,
366,
454,
1786,
76,
8,
50,
5908,
12,
820,
12098,
12,
428,
9,
288,
587,
26,
355,
671,
12,
4666,
12,
2256,
275,
1315,
454,
1786,
76,
8,
50,
5908,
12,
820,
12098,
12,
428,
9,
288,
820,
59,
631,
580,
26,
631,
411,
12,
1335,
928,
26,
74,
2379,
61,
275,
671,
627,
4666,
339,
327,
1432,
314,
3634,
12386,
1738,
14,
272,
372,
820,
421,
199,
318,
7452
] |
[
199,
6443,
12386,
1738,
367,
8605,
12627,
436,
367,
7008,
3229,
11572,
12627,
14,
199,
199,
2765,
859,
3495,
370,
5126,
32637,
8925,
14,
199,
199,
624,
199,
504,
636,
2443,
363,
492,
4629,
12,
870,
63,
1593,
12,
3679,
63,
646,
199,
199,
363,
452,
363,
275,
788,
5079,
77,
418,
199,
199,
646,
2680,
465,
980,
199,
199,
504,
7026,
423,
773,
423,
1974,
492,
485,
8748,
63,
24372,
421,
199,
3,
10111,
8925,
199,
504,
1275,
9923,
492,
6316,
199,
504,
1275,
26760,
492,
1315,
454,
1786,
76,
12,
366,
454,
1786,
76,
199,
504,
1275,
271,
863,
63,
15820,
300,
492,
308,
335,
300,
12,
519,
7646,
18,
1259,
70,
421,
199,
533,
428,
81,
2591,
77,
547,
8,
1590,
14,
10096,
14,
27889,
28846,
547,
304,
272,
986,
421,
199,
318,
485,
5079,
77,
63,
599,
85,
8,
52,
12,
27461,
29,
772,
304,
272,
408,
272,
8449,
12386,
1738,
402,
376,
7008,
3229,
11572,
3634,
14,
339,
961,
365,
282,
5922,
805,
367,
658,
5079,
77,
64,
436,
658,
793,
77,
2313,
339,
3897,
272,
4143,
272,
377,
520,
334,
46,
12,
653,
9,
1625,
63,
2930,
7008,
3229,
11572,
267,
8449,
7447,
12386,
1738,
370,
9352,
272,
27461,
520,
1109,
12,
2716,
267,
982,
314,
27461,
365,
440,
477,
4208,
543,
14021,
370,
314,
267,
1568,
402,
314,
1324,
1625,
12,
2066,
675,
282,
19697,
5563,
14,
334,
2698,
26,
5049,
9,
339,
1803,
272,
5514,
272,
7452,
77,
520,
334,
46,
12,
653,
9,
6800,
267,
1594,
402,
314,
7452,
805,
737,
658,
52,
64,
339,
14504,
272,
4143,
272,
2508,
359,
17,
61,
662,
8398,
262,
1487,
350,
1237,
12,
653,
1158,
393,
305,
1603,
14,
16332,
455,
12,
820,
1907,
820,
279,
2411,
334,
6965,
9,
1779,
298,
3142,
379,
22985,
300,
4580,
12719,
367,
27799,
314,
8449,
428,
5937,
12826,
12,
1779,
491,
449,
608,
8144,
315,
3599,
2699,
27491,
12,
8375,
2564,
14,
11618,
14,
413,
3172,
13,
12894,
14,
339,
408,
272,
377,
63,
6706,
275,
980,
14,
6706,
8,
52,
9,
272,
4215,
63,
390,
63,
3093,
275,
980,
14,
374,
3093,
1113,
8,
52,
9,
436,
980,
14,
827,
8,
52,
63,
6706,
9,
2356,
378,
272,
340,
440,
4215,
63,
390,
63,
3093,
26,
267,
377,
63,
6706,
275,
377,
63,
6706,
14,
6041,
8,
5254,
9,
272,
820,
275,
980,
14,
6706,
8,
1590,
14,
5079,
8,
52,
63,
6706,
430,
339,
327,
8354,
314,
1329,
402,
5664,
370,
675,
27,
675,
737,
5210,
1373,
1853,
14,
272,
302,
12,
302,
275,
377,
14,
1392,
272,
302,
4166,
275,
1390,
8,
78,
5001,
27461,
12,
413,
9,
339,
327,
8354,
314,
12700,
402,
314,
2877,
10627,
402,
5664,
626,
272,
327,
781,
911,
5965,
675,
12,
436,
4526,
314,
1329,
402,
7031,
5664,
14,
272,
330,
7241,
12,
302,
9629,
275,
16438,
8,
78,
12,
302,
4166,
9,
272,
6826,
4430,
275,
330,
7241,
435,
413,
272,
700,
8060,
275,
302,
4166,
446,
302,
9629,
272,
340,
700,
8060,
627,
330,
7241,
435,
302,
9629,
627,
6826,
4430,
1137,
302,
26,
267,
746,
2186,
360,
4672,
315,
20249,
358,
339,
327,
13930,
314,
1478,
1425,
24295,
701,
1924,
1853,
14,
272,
1343,
63,
2379,
63,
7322,
275,
942,
272,
1343,
275,
378,
272,
367,
2338,
12,
1568,
315,
3666,
561,
8060,
12,
330,
7241,
395,
334,
7530,
4430,
12,
6826,
4430,
2298,
267,
367,
284,
315,
1425,
8,
835,
304,
288,
1343,
63,
2379,
63,
7322,
14,
740,
1332,
928,
12,
1343,
435,
1568,
430,
288,
1343,
847,
1568,
339,
327,
8777,
262,
13,
1457,
315,
22990,
14,
272,
367,
1343,
12,
3631,
315,
1343,
63,
2379,
63,
7322,
26,
267,
367,
1335,
315,
1425,
8,
928,
12,
3631,
304,
288,
367,
284,
315,
1425,
8,
74,
13,
17,
12,
1343,
13,
17,
12,
446,
17,
304,
355,
308,
275,
378,
355,
340,
1335,
446,
284,
690,
413,
26,
490,
308,
275,
820,
59,
73,
12,
284,
11,
17,
26,
74,
1055,
3287,
8,
50,
59,
73,
11,
17,
26,
74,
12,
1335,
566,
355,
27878,
275,
820,
59,
73,
12,
284,
61,
435,
820,
59,
74,
12,
1335,
61,
355,
340,
440,
27878,
26,
490,
746,
428,
81,
2591,
77,
547,
360,
4892,
370,
2342,
314,
3634,
12386,
1738,
358,
355,
820,
59,
73,
12,
1335,
61,
275,
334,
52,
59,
73,
12,
1335,
61,
446,
308,
9,
1182,
27878,
339,
327,
31535,
3109,
13,
1457,
315,
22990,
14,
272,
367,
1335,
315,
1425,
8,
78,
4166,
304,
267,
1335,
928,
12,
1335,
2379,
275,
1343,
63,
2379,
63,
7322,
59,
74,
61,
267,
367,
284,
315,
1425,
8,
74,
13,
17,
12,
446,
17,
12,
446,
17,
304,
288,
284,
928,
12,
284,
2379,
275,
1343,
63,
2379,
63,
7322,
59,
73,
61,
288,
428,
275,
377,
59,
631,
580,
26,
631,
411,
12,
1335,
928,
26,
74,
2379,
61,
288,
340,
1335,
446,
284,
690,
413,
26,
355,
428,
275,
428,
446,
820,
59,
631,
580,
26,
631,
411,
12,
284,
2379,
26,
74,
928,
1055,
3287,
8,
50,
59,
631,
411,
26,
74,
928,
12,
14663,
1335,
928,
26,
74,
2379,
566,
953,
327,
31049,
491,
1282,
3099,
14,
288,
327,
2104,
1655,
2436,
12,
1937,
314,
14241,
63,
1786,
24279,
351,
2456,
32016,
288,
327,
436,
314,
289,
14522,
366,
454,
1786,
76,
436,
1315,
454,
1786,
76,
9149,
14,
288,
820,
5908,
275,
820,
59,
631,
580,
26,
631,
411,
12,
284,
928,
26,
631,
411,
61,
288,
820,
12098,
275,
820,
59,
74,
928,
26,
74,
2379,
12,
1335,
928,
26,
74,
2379,
61,
288,
340,
4215,
63,
390,
63,
3093,
26,
355,
671,
12,
4666,
12,
2256,
275,
366,
454,
1786,
76,
8,
50,
5908,
12,
820,
12098,
12,
428,
9,
288,
587,
26,
355,
671,
12,
4666,
12,
2256,
275,
1315,
454,
1786,
76,
8,
50,
5908,
12,
820,
12098,
12,
428,
9,
288,
820,
59,
631,
580,
26,
631,
411,
12,
1335,
928,
26,
74,
2379,
61,
275,
671,
627,
4666,
339,
327,
1432,
314,
3634,
12386,
1738,
14,
272,
372,
820,
421,
199,
318,
7452,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
balticembedded/be-kernel
|
Documentation/networking/cxacru-cf.py
|
14668
|
1626
|
#!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Usage: cxacru-cf.py < cxacru-cf.bin
# Output: values string suitable for the sysfs adsl_config attribute
#
# Warning: cxacru-cf.bin with MD5 hash cdbac2689969d5ed5d4850f117702110
# contains mis-aligned values which will stop the modem from being able
# to make a connection. If the first and last two bytes are removed then
# the values become valid, but the modulation will be forced to ANSI
# T1.413 only which may not be appropriate.
#
# The original binary format is a packed list of le32 values.
import sys
import struct
i = 0
while True:
buf = sys.stdin.read(4)
if len(buf) == 0:
break
elif len(buf) != 4:
sys.stdout.write("\n")
sys.stderr.write("Error: read {0} not 4 bytes\n".format(len(buf)))
sys.exit(1)
if i > 0:
sys.stdout.write(" ")
sys.stdout.write("{0:x}={1}".format(i, struct.unpack("<I", buf)[0]))
i += 1
sys.stdout.write("\n")
|
gpl-2.0
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
3,
1898,
8937,
10751,
265,
1952,
1653,
84,
199,
3,
199,
3,
961,
2240,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
2811,
652,
199,
3,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
314,
2868,
199,
3,
2290,
2752,
27,
1902,
1015,
499,
402,
314,
844,
12,
503,
334,
292,
2195,
945,
9,
199,
3,
1263,
2945,
1015,
14,
199,
3,
199,
3,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
1325,
2428,
199,
3,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
3169,
503,
199,
3,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
1696,
1684,
844,
367,
199,
3,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
3180,
543,
199,
3,
642,
2240,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
2752,
12,
3277,
2020,
8155,
199,
3,
15630,
10902,
446,
14453,
13540,
12,
8226,
12,
4828,
221,
15673,
13,
13421,
12,
8217,
14,
199,
3,
199,
3,
11028,
26,
286,
10104,
6558,
13,
2177,
14,
647,
665,
286,
10104,
6558,
13,
2177,
14,
1393,
199,
3,
7242,
26,
1338,
1059,
11233,
367,
314,
984,
2319,
282,
795,
76,
63,
888,
2225,
199,
3,
199,
3,
15902,
26,
286,
10104,
6558,
13,
2177,
14,
1393,
543,
15830,
21,
2631,
286,
697,
645,
13731,
1020,
1876,
68,
21,
379,
21,
68,
2006,
1400,
70,
845,
1138,
996,
6019,
199,
3,
3509,
3201,
13,
19175,
1338,
1314,
911,
3631,
314,
818,
77,
687,
3769,
7688,
199,
3,
370,
1852,
282,
1950,
14,
982,
314,
1642,
436,
2061,
2877,
2783,
787,
4829,
2066,
199,
3,
314,
1338,
8649,
1686,
12,
1325,
314,
3413,
5332,
911,
506,
19565,
370,
25600,
199,
3,
377,
17,
14,
23663,
1454,
1314,
1443,
440,
506,
5827,
14,
199,
3,
199,
3,
710,
3379,
3366,
1475,
365,
282,
13170,
769,
402,
1026,
708,
1338,
14,
199,
199,
646,
984,
199,
646,
2702,
199,
199,
73,
275,
378,
199,
6710,
715,
26,
199,
198,
1436,
275,
984,
14,
6626,
14,
739,
8,
20,
9,
421,
198,
692,
822,
8,
1436,
9,
508,
378,
26,
507,
198,
4785,
199,
198,
4164,
822,
8,
1436,
9,
1137,
841,
26,
507,
198,
1274,
14,
2703,
14,
952,
4582,
78,
531,
507,
198,
1274,
14,
3083,
14,
952,
480,
547,
26,
1586,
469,
16,
93,
440,
841,
2783,
60,
78,
1674,
908,
8,
552,
8,
1436,
1724,
507,
198,
1274,
14,
2224,
8,
17,
9,
421,
198,
692,
284,
690,
378,
26,
507,
198,
1274,
14,
2703,
14,
952,
480,
6099,
199,
198,
1274,
14,
2703,
14,
952,
13076,
16,
26,
88,
93,
3126,
17,
5469,
908,
8,
73,
12,
2702,
14,
5301,
6757,
41,
401,
4123,
2788,
16,
2459,
199,
198,
73,
847,
413,
199,
199,
1274,
14,
2703,
14,
952,
4582,
78,
531,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
3,
1898,
8937,
10751,
265,
1952,
1653,
84,
199,
3,
199,
3,
961,
2240,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
2811,
652,
199,
3,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
314,
2868,
199,
3,
2290,
2752,
27,
1902,
1015,
499,
402,
314,
844,
12,
503,
334,
292,
2195,
945,
9,
199,
3,
1263,
2945,
1015,
14,
199,
3,
199,
3,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
1325,
2428,
199,
3,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
3169,
503,
199,
3,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
1696,
1684,
844,
367,
199,
3,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
3180,
543,
199,
3,
642,
2240,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
2752,
12,
3277,
2020,
8155,
199,
3,
15630,
10902,
446,
14453,
13540,
12,
8226,
12,
4828,
221,
15673,
13,
13421,
12,
8217,
14,
199,
3,
199,
3,
11028,
26,
286,
10104,
6558,
13,
2177,
14,
647,
665,
286,
10104,
6558,
13,
2177,
14,
1393,
199,
3,
7242,
26,
1338,
1059,
11233,
367,
314,
984,
2319,
282,
795,
76,
63,
888,
2225,
199,
3,
199,
3,
15902,
26,
286,
10104,
6558,
13,
2177,
14,
1393,
543,
15830,
21,
2631,
286,
697,
645,
13731,
1020,
1876,
68,
21,
379,
21,
68,
2006,
1400,
70,
845,
1138,
996,
6019,
199,
3,
3509,
3201,
13,
19175,
1338,
1314,
911,
3631,
314,
818,
77,
687,
3769,
7688,
199,
3,
370,
1852,
282,
1950,
14,
982,
314,
1642,
436,
2061,
2877,
2783,
787,
4829,
2066,
199,
3,
314,
1338,
8649,
1686,
12,
1325,
314,
3413,
5332,
911,
506,
19565,
370,
25600,
199,
3,
377,
17,
14,
23663,
1454,
1314,
1443,
440,
506,
5827,
14,
199,
3,
199,
3,
710,
3379,
3366,
1475,
365,
282,
13170,
769,
402,
1026,
708,
1338,
14,
199,
199,
646,
984,
199,
646,
2702,
199,
199,
73,
275,
378,
199,
6710,
715,
26,
199,
198,
1436,
275,
984,
14,
6626,
14,
739,
8,
20,
9,
421,
198,
692,
822,
8,
1436,
9,
508,
378,
26,
507,
198,
4785,
199,
198,
4164,
822,
8,
1436,
9,
1137,
841,
26,
507,
198,
1274,
14,
2703,
14,
952,
4582,
78,
531,
507,
198,
1274,
14,
3083,
14,
952,
480,
547,
26,
1586,
469,
16,
93,
440,
841,
2783,
60,
78,
1674,
908,
8,
552,
8,
1436,
1724,
507,
198,
1274,
14,
2224,
8,
17,
9,
421,
198,
692,
284,
690,
378,
26,
507,
198,
1274,
14,
2703,
14,
952,
480,
6099,
199,
198,
1274,
14,
2703,
14,
952,
13076,
16,
26,
88,
93,
3126,
17,
5469,
908,
8,
73,
12,
2702,
14,
5301,
6757,
41,
401,
4123,
2788,
16,
2459,
199,
198,
73,
847,
413,
199,
199,
1274,
14,
2703,
14,
952,
4582,
78,
531,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
vybstat/scikit-learn
|
sklearn/externals/joblib/parallel.py
|
79
|
35628
|
"""
Helpers for embarrassingly parallel code.
"""
# Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org >
# Copyright: 2010, Gael Varoquaux
# License: BSD 3 clause
from __future__ import division
import os
import sys
import gc
import warnings
from math import sqrt
import functools
import time
import threading
import itertools
from numbers import Integral
try:
import cPickle as pickle
except:
import pickle
from ._multiprocessing_helpers import mp
if mp is not None:
from .pool import MemmapingPool
from multiprocessing.pool import ThreadPool
from .format_stack import format_exc, format_outer_frames
from .logger import Logger, short_format_time
from .my_exceptions import TransportableException, _mk_exception
from .disk import memstr_to_kbytes
from ._compat import _basestring
VALID_BACKENDS = ['multiprocessing', 'threading']
# Environment variables to protect against bad situations when nesting
JOBLIB_SPAWNED_PROCESS = "__JOBLIB_SPAWNED_PARALLEL__"
# In seconds, should be big enough to hide multiprocessing dispatching
# overhead.
# This settings was found by running benchmarks/bench_auto_batching.py
# with various parameters on various platforms.
MIN_IDEAL_BATCH_DURATION = .2
# Should not be too high to avoid stragglers: long jobs running alone
# on a single worker while other workers have no work to process any more.
MAX_IDEAL_BATCH_DURATION = 2
# Under Python 3.4+ use the 'forkserver' start method by default: this makes it
# possible to avoid crashing 3rd party libraries that manage an internal thread
# pool that does not tolerate forking
if hasattr(mp, 'get_start_method'):
method = os.environ.get('JOBLIB_START_METHOD')
if (method is None and mp.get_start_method() == 'fork'
and 'forkserver' in mp.get_all_start_methods()):
method = 'forkserver'
DEFAULT_MP_CONTEXT = mp.get_context(method=method)
else:
DEFAULT_MP_CONTEXT = None
class BatchedCalls(object):
"""Wrap a sequence of (func, args, kwargs) tuples as a single callable"""
def __init__(self, iterator_slice):
self.items = list(iterator_slice)
self._size = len(self.items)
def __call__(self):
return [func(*args, **kwargs) for func, args, kwargs in self.items]
def __len__(self):
return self._size
###############################################################################
# CPU count that works also when multiprocessing has been disabled via
# the JOBLIB_MULTIPROCESSING environment variable
def cpu_count():
""" Return the number of CPUs.
"""
if mp is None:
return 1
return mp.cpu_count()
###############################################################################
# For verbosity
def _verbosity_filter(index, verbose):
""" Returns False for indices increasingly apart, the distance
depending on the value of verbose.
We use a lag increasing as the square of index
"""
if not verbose:
return True
elif verbose > 10:
return False
if index == 0:
return False
verbose = .5 * (11 - verbose) ** 2
scale = sqrt(index / verbose)
next_scale = sqrt((index + 1) / verbose)
return (int(next_scale) == int(scale))
###############################################################################
class WorkerInterrupt(Exception):
""" An exception that is not KeyboardInterrupt to allow subprocesses
to be interrupted.
"""
pass
###############################################################################
class SafeFunction(object):
""" Wraps a function to make it exception with full traceback in
their representation.
Useful for parallel computing with multiprocessing, for which
exceptions cannot be captured.
"""
def __init__(self, func):
self.func = func
def __call__(self, *args, **kwargs):
try:
return self.func(*args, **kwargs)
except KeyboardInterrupt:
# We capture the KeyboardInterrupt and reraise it as
# something different, as multiprocessing does not
# interrupt processing for a KeyboardInterrupt
raise WorkerInterrupt()
except:
e_type, e_value, e_tb = sys.exc_info()
text = format_exc(e_type, e_value, e_tb, context=10,
tb_offset=1)
if issubclass(e_type, TransportableException):
raise
else:
raise TransportableException(text, e_type)
###############################################################################
def delayed(function, check_pickle=True):
"""Decorator used to capture the arguments of a function.
Pass `check_pickle=False` when:
- performing a possibly repeated check is too costly and has been done
already once outside of the call to delayed.
- when used in conjunction `Parallel(backend='threading')`.
"""
# Try to pickle the input function, to catch the problems early when
# using with multiprocessing:
if check_pickle:
pickle.dumps(function)
def delayed_function(*args, **kwargs):
return function, args, kwargs
try:
delayed_function = functools.wraps(function)(delayed_function)
except AttributeError:
" functools.wraps fails on some callable objects "
return delayed_function
###############################################################################
class ImmediateComputeBatch(object):
"""Sequential computation of a batch of tasks.
This replicates the async computation API but actually does not delay
the computations when joblib.Parallel runs in sequential mode.
"""
def __init__(self, batch):
# Don't delay the application, to avoid keeping the input
# arguments in memory
self.results = batch()
def get(self):
return self.results
###############################################################################
class BatchCompletionCallBack(object):
"""Callback used by joblib.Parallel's multiprocessing backend.
This callable is executed by the parent process whenever a worker process
has returned the results of a batch of tasks.
It is used for progress reporting, to update estimate of the batch
processing duration and to schedule the next batch of tasks to be
processed.
"""
def __init__(self, dispatch_timestamp, batch_size, parallel):
self.dispatch_timestamp = dispatch_timestamp
self.batch_size = batch_size
self.parallel = parallel
def __call__(self, out):
self.parallel.n_completed_tasks += self.batch_size
this_batch_duration = time.time() - self.dispatch_timestamp
if (self.parallel.batch_size == 'auto'
and self.batch_size == self.parallel._effective_batch_size):
# Update the smoothed streaming estimate of the duration of a batch
# from dispatch to completion
old_duration = self.parallel._smoothed_batch_duration
if old_duration == 0:
# First record of duration for this batch size after the last
# reset.
new_duration = this_batch_duration
else:
# Update the exponentially weighted average of the duration of
# batch for the current effective size.
new_duration = 0.8 * old_duration + 0.2 * this_batch_duration
self.parallel._smoothed_batch_duration = new_duration
self.parallel.print_progress()
if self.parallel._original_iterator is not None:
self.parallel.dispatch_next()
###############################################################################
class Parallel(Logger):
''' Helper class for readable parallel mapping.
Parameters
-----------
n_jobs: int, default: 1
The maximum number of concurrently running jobs, such as the number
of Python worker processes when backend="multiprocessing"
or the size of the thread-pool when backend="threading".
If -1 all CPUs are used. If 1 is given, no parallel computing code
is used at all, which is useful for debugging. For n_jobs below -1,
(n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all
CPUs but one are used.
backend: str or None, default: 'multiprocessing'
Specify the parallelization backend implementation.
Supported backends are:
- "multiprocessing" used by default, can induce some
communication and memory overhead when exchanging input and
output data with the with the worker Python processes.
- "threading" is a very low-overhead backend but it suffers
from the Python Global Interpreter Lock if the called function
relies a lot on Python objects. "threading" is mostly useful
when the execution bottleneck is a compiled extension that
explicitly releases the GIL (for instance a Cython loop wrapped
in a "with nogil" block or an expensive call to a library such
as NumPy).
verbose: int, optional
The verbosity level: if non zero, progress messages are
printed. Above 50, the output is sent to stdout.
The frequency of the messages increases with the verbosity level.
If it more than 10, all iterations are reported.
pre_dispatch: {'all', integer, or expression, as in '3*n_jobs'}
The number of batches (of tasks) to be pre-dispatched.
Default is '2*n_jobs'. When batch_size="auto" this is reasonable
default and the multiprocessing workers shoud never starve.
batch_size: int or 'auto', default: 'auto'
The number of atomic tasks to dispatch at once to each
worker. When individual evaluations are very fast, multiprocessing
can be slower than sequential computation because of the overhead.
Batching fast computations together can mitigate this.
The ``'auto'`` strategy keeps track of the time it takes for a batch
to complete, and dynamically adjusts the batch size to keep the time
on the order of half a second, using a heuristic. The initial batch
size is 1.
``batch_size="auto"`` with ``backend="threading"`` will dispatch
batches of a single task at a time as the threading backend has
very little overhead and using larger batch size has not proved to
bring any gain in that case.
temp_folder: str, optional
Folder to be used by the pool for memmaping large arrays
for sharing memory with worker processes. If None, this will try in
order:
- a folder pointed by the JOBLIB_TEMP_FOLDER environment variable,
- /dev/shm if the folder exists and is writable: this is a RAMdisk
filesystem available by default on modern Linux distributions,
- the default system temporary folder that can be overridden
with TMP, TMPDIR or TEMP environment variables, typically /tmp
under Unix operating systems.
Only active when backend="multiprocessing".
max_nbytes int, str, or None, optional, 1M by default
Threshold on the size of arrays passed to the workers that
triggers automated memory mapping in temp_folder. Can be an int
in Bytes, or a human-readable string, e.g., '1M' for 1 megabyte.
Use None to disable memmaping of large arrays.
Only active when backend="multiprocessing".
Notes
-----
This object uses the multiprocessing module to compute in
parallel the application of a function to many different
arguments. The main functionality it brings in addition to
using the raw multiprocessing API are (see examples for details):
* More readable code, in particular since it avoids
constructing list of arguments.
* Easier debugging:
- informative tracebacks even when the error happens on
the client side
- using 'n_jobs=1' enables to turn off parallel computing
for debugging without changing the codepath
- early capture of pickling errors
* An optional progress meter.
* Interruption of multiprocesses jobs with 'Ctrl-C'
* Flexible pickling control for the communication to and from
the worker processes.
* Ability to use shared memory efficiently with worker
processes for large numpy-based datastructures.
Examples
--------
A simple example:
>>> from math import sqrt
>>> from sklearn.externals.joblib import Parallel, delayed
>>> Parallel(n_jobs=1)(delayed(sqrt)(i**2) for i in range(10))
[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]
Reshaping the output when the function has several return
values:
>>> from math import modf
>>> from sklearn.externals.joblib import Parallel, delayed
>>> r = Parallel(n_jobs=1)(delayed(modf)(i/2.) for i in range(10))
>>> res, i = zip(*r)
>>> res
(0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5)
>>> i
(0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0)
The progress meter: the higher the value of `verbose`, the more
messages::
>>> from time import sleep
>>> from sklearn.externals.joblib import Parallel, delayed
>>> r = Parallel(n_jobs=2, verbose=5)(delayed(sleep)(.1) for _ in range(10)) #doctest: +SKIP
[Parallel(n_jobs=2)]: Done 1 out of 10 | elapsed: 0.1s remaining: 0.9s
[Parallel(n_jobs=2)]: Done 3 out of 10 | elapsed: 0.2s remaining: 0.5s
[Parallel(n_jobs=2)]: Done 6 out of 10 | elapsed: 0.3s remaining: 0.2s
[Parallel(n_jobs=2)]: Done 9 out of 10 | elapsed: 0.5s remaining: 0.1s
[Parallel(n_jobs=2)]: Done 10 out of 10 | elapsed: 0.5s finished
Traceback example, note how the line of the error is indicated
as well as the values of the parameter passed to the function that
triggered the exception, even though the traceback happens in the
child process::
>>> from heapq import nlargest
>>> from sklearn.externals.joblib import Parallel, delayed
>>> Parallel(n_jobs=2)(delayed(nlargest)(2, n) for n in (range(4), 'abcde', 3)) #doctest: +SKIP
#...
---------------------------------------------------------------------------
Sub-process traceback:
---------------------------------------------------------------------------
TypeError Mon Nov 12 11:37:46 2012
PID: 12934 Python 2.7.3: /usr/bin/python
...........................................................................
/usr/lib/python2.7/heapq.pyc in nlargest(n=2, iterable=3, key=None)
419 if n >= size:
420 return sorted(iterable, key=key, reverse=True)[:n]
421
422 # When key is none, use simpler decoration
423 if key is None:
--> 424 it = izip(iterable, count(0,-1)) # decorate
425 result = _nlargest(n, it)
426 return map(itemgetter(0), result) # undecorate
427
428 # General case, slowest method
TypeError: izip argument #1 must support iteration
___________________________________________________________________________
Using pre_dispatch in a producer/consumer situation, where the
data is generated on the fly. Note how the producer is first
called a 3 times before the parallel loop is initiated, and then
called to generate new data on the fly. In this case the total
number of iterations cannot be reported in the progress messages::
>>> from math import sqrt
>>> from sklearn.externals.joblib import Parallel, delayed
>>> def producer():
... for i in range(6):
... print('Produced %s' % i)
... yield i
>>> out = Parallel(n_jobs=2, verbose=100, pre_dispatch='1.5*n_jobs')(
... delayed(sqrt)(i) for i in producer()) #doctest: +SKIP
Produced 0
Produced 1
Produced 2
[Parallel(n_jobs=2)]: Done 1 jobs | elapsed: 0.0s
Produced 3
[Parallel(n_jobs=2)]: Done 2 jobs | elapsed: 0.0s
Produced 4
[Parallel(n_jobs=2)]: Done 3 jobs | elapsed: 0.0s
Produced 5
[Parallel(n_jobs=2)]: Done 4 jobs | elapsed: 0.0s
[Parallel(n_jobs=2)]: Done 5 out of 6 | elapsed: 0.0s remaining: 0.0s
[Parallel(n_jobs=2)]: Done 6 out of 6 | elapsed: 0.0s finished
'''
def __init__(self, n_jobs=1, backend='multiprocessing', verbose=0,
pre_dispatch='2 * n_jobs', batch_size='auto',
temp_folder=None, max_nbytes='1M', mmap_mode='r'):
self.verbose = verbose
self._mp_context = DEFAULT_MP_CONTEXT
if backend is None:
# `backend=None` was supported in 0.8.2 with this effect
backend = "multiprocessing"
elif hasattr(backend, 'Pool') and hasattr(backend, 'Lock'):
# Make it possible to pass a custom multiprocessing context as
# backend to change the start method to forkserver or spawn or
# preload modules on the forkserver helper process.
self._mp_context = backend
backend = "multiprocessing"
if backend not in VALID_BACKENDS:
raise ValueError("Invalid backend: %s, expected one of %r"
% (backend, VALID_BACKENDS))
self.backend = backend
self.n_jobs = n_jobs
if (batch_size == 'auto'
or isinstance(batch_size, Integral) and batch_size > 0):
self.batch_size = batch_size
else:
raise ValueError(
"batch_size must be 'auto' or a positive integer, got: %r"
% batch_size)
self.pre_dispatch = pre_dispatch
self._temp_folder = temp_folder
if isinstance(max_nbytes, _basestring):
self._max_nbytes = 1024 * memstr_to_kbytes(max_nbytes)
else:
self._max_nbytes = max_nbytes
self._mmap_mode = mmap_mode
# Not starting the pool in the __init__ is a design decision, to be
# able to close it ASAP, and not burden the user with closing it
# unless they choose to use the context manager API with a with block.
self._pool = None
self._output = None
self._jobs = list()
self._managed_pool = False
# This lock is used coordinate the main thread of this process with
# the async callback thread of our the pool.
self._lock = threading.Lock()
def __enter__(self):
self._managed_pool = True
self._initialize_pool()
return self
def __exit__(self, exc_type, exc_value, traceback):
self._terminate_pool()
self._managed_pool = False
def _effective_n_jobs(self):
n_jobs = self.n_jobs
if n_jobs == 0:
raise ValueError('n_jobs == 0 in Parallel has no meaning')
elif mp is None or n_jobs is None:
# multiprocessing is not available or disabled, fallback
# to sequential mode
return 1
elif n_jobs < 0:
n_jobs = max(mp.cpu_count() + 1 + n_jobs, 1)
return n_jobs
def _initialize_pool(self):
"""Build a process or thread pool and return the number of workers"""
n_jobs = self._effective_n_jobs()
# The list of exceptions that we will capture
self.exceptions = [TransportableException]
if n_jobs == 1:
# Sequential mode: do not use a pool instance to avoid any
# useless dispatching overhead
self._pool = None
elif self.backend == 'threading':
self._pool = ThreadPool(n_jobs)
elif self.backend == 'multiprocessing':
if mp.current_process().daemon:
# Daemonic processes cannot have children
self._pool = None
warnings.warn(
'Multiprocessing-backed parallel loops cannot be nested,'
' setting n_jobs=1',
stacklevel=3)
return 1
elif threading.current_thread().name != 'MainThread':
# Prevent posix fork inside in non-main posix threads
self._pool = None
warnings.warn(
'Multiprocessing backed parallel loops cannot be nested'
' below threads, setting n_jobs=1',
stacklevel=3)
return 1
else:
already_forked = int(os.environ.get(JOBLIB_SPAWNED_PROCESS, 0))
if already_forked:
raise ImportError('[joblib] Attempting to do parallel computing '
'without protecting your import on a system that does '
'not support forking. To use parallel-computing in a '
'script, you must protect your main loop using "if '
"__name__ == '__main__'"
'". Please see the joblib documentation on Parallel '
'for more information'
)
# Set an environment variable to avoid infinite loops
os.environ[JOBLIB_SPAWNED_PROCESS] = '1'
# Make sure to free as much memory as possible before forking
gc.collect()
poolargs = dict(
max_nbytes=self._max_nbytes,
mmap_mode=self._mmap_mode,
temp_folder=self._temp_folder,
verbose=max(0, self.verbose - 50),
context_id=0, # the pool is used only for one call
)
if self._mp_context is not None:
# Use Python 3.4+ multiprocessing context isolation
poolargs['context'] = self._mp_context
self._pool = MemmapingPool(n_jobs, **poolargs)
# We are using multiprocessing, we also want to capture
# KeyboardInterrupts
self.exceptions.extend([KeyboardInterrupt, WorkerInterrupt])
else:
raise ValueError("Unsupported backend: %s" % self.backend)
return n_jobs
def _terminate_pool(self):
if self._pool is not None:
self._pool.close()
self._pool.terminate() # terminate does a join()
self._pool = None
if self.backend == 'multiprocessing':
os.environ.pop(JOBLIB_SPAWNED_PROCESS, 0)
def _dispatch(self, batch):
"""Queue the batch for computing, with or without multiprocessing
WARNING: this method is not thread-safe: it should be only called
indirectly via dispatch_one_batch.
"""
# If job.get() catches an exception, it closes the queue:
if self._aborting:
return
if self._pool is None:
job = ImmediateComputeBatch(batch)
self._jobs.append(job)
self.n_dispatched_batches += 1
self.n_dispatched_tasks += len(batch)
self.n_completed_tasks += len(batch)
if not _verbosity_filter(self.n_dispatched_batches, self.verbose):
self._print('Done %3i tasks | elapsed: %s',
(self.n_completed_tasks,
short_format_time(time.time() - self._start_time)
))
else:
dispatch_timestamp = time.time()
cb = BatchCompletionCallBack(dispatch_timestamp, len(batch), self)
job = self._pool.apply_async(SafeFunction(batch), callback=cb)
self._jobs.append(job)
self.n_dispatched_tasks += len(batch)
self.n_dispatched_batches += 1
def dispatch_next(self):
"""Dispatch more data for parallel processing
This method is meant to be called concurrently by the multiprocessing
callback. We rely on the thread-safety of dispatch_one_batch to protect
against concurrent consumption of the unprotected iterator.
"""
if not self.dispatch_one_batch(self._original_iterator):
self._iterating = False
self._original_iterator = None
def dispatch_one_batch(self, iterator):
"""Prefetch the tasks for the next batch and dispatch them.
The effective size of the batch is computed here.
If there are no more jobs to dispatch, return False, else return True.
The iterator consumption and dispatching is protected by the same
lock so calling this function should be thread safe.
"""
if self.batch_size == 'auto' and self.backend == 'threading':
# Batching is never beneficial with the threading backend
batch_size = 1
elif self.batch_size == 'auto':
old_batch_size = self._effective_batch_size
batch_duration = self._smoothed_batch_duration
if (batch_duration > 0 and
batch_duration < MIN_IDEAL_BATCH_DURATION):
# The current batch size is too small: the duration of the
# processing of a batch of task is not large enough to hide
# the scheduling overhead.
ideal_batch_size = int(
old_batch_size * MIN_IDEAL_BATCH_DURATION / batch_duration)
# Multiply by two to limit oscilations between min and max.
batch_size = max(2 * ideal_batch_size, 1)
self._effective_batch_size = batch_size
if self.verbose >= 10:
self._print("Batch computation too fast (%.4fs.) "
"Setting batch_size=%d.", (
batch_duration, batch_size))
elif (batch_duration > MAX_IDEAL_BATCH_DURATION and
old_batch_size >= 2):
# The current batch size is too big. If we schedule overly long
# running batches some CPUs might wait with nothing left to do
# while a couple of CPUs a left processing a few long running
# batches. Better reduce the batch size a bit to limit the
# likelihood of scheduling such stragglers.
self._effective_batch_size = batch_size = old_batch_size // 2
if self.verbose >= 10:
self._print("Batch computation too slow (%.2fs.) "
"Setting batch_size=%d.", (
batch_duration, batch_size))
else:
# No batch size adjustment
batch_size = old_batch_size
if batch_size != old_batch_size:
# Reset estimation of the smoothed mean batch duration: this
# estimate is updated in the multiprocessing apply_async
# CallBack as long as the batch_size is constant. Therefore
# we need to reset the estimate whenever we re-tune the batch
# size.
self._smoothed_batch_duration = 0
else:
# Fixed batch size strategy
batch_size = self.batch_size
with self._lock:
tasks = BatchedCalls(itertools.islice(iterator, batch_size))
if not tasks:
# No more tasks available in the iterator: tell caller to stop.
return False
else:
self._dispatch(tasks)
return True
def _print(self, msg, msg_args):
"""Display the message on stout or stderr depending on verbosity"""
# XXX: Not using the logger framework: need to
# learn to use logger better.
if not self.verbose:
return
if self.verbose < 50:
writer = sys.stderr.write
else:
writer = sys.stdout.write
msg = msg % msg_args
writer('[%s]: %s\n' % (self, msg))
def print_progress(self):
"""Display the process of the parallel execution only a fraction
of time, controlled by self.verbose.
"""
if not self.verbose:
return
elapsed_time = time.time() - self._start_time
# This is heuristic code to print only 'verbose' times a messages
# The challenge is that we may not know the queue length
if self._original_iterator:
if _verbosity_filter(self.n_dispatched_batches, self.verbose):
return
self._print('Done %3i tasks | elapsed: %s',
(self.n_completed_tasks,
short_format_time(elapsed_time),
))
else:
index = self.n_dispatched_batches
# We are finished dispatching
total_tasks = self.n_dispatched_tasks
# We always display the first loop
if not index == 0:
# Display depending on the number of remaining items
# A message as soon as we finish dispatching, cursor is 0
cursor = (total_tasks - index + 1
- self._pre_dispatch_amount)
frequency = (total_tasks // self.verbose) + 1
is_last_item = (index + 1 == total_tasks)
if (is_last_item or cursor % frequency):
return
remaining_time = (elapsed_time / (index + 1) *
(self.n_dispatched_tasks - index - 1.))
self._print('Done %3i out of %3i | elapsed: %s remaining: %s',
(index + 1,
total_tasks,
short_format_time(elapsed_time),
short_format_time(remaining_time),
))
def retrieve(self):
self._output = list()
while self._iterating or len(self._jobs) > 0:
if len(self._jobs) == 0:
# Wait for an async callback to dispatch new jobs
time.sleep(0.01)
continue
# We need to be careful: the job list can be filling up as
# we empty it and Python list are not thread-safe by default hence
# the use of the lock
with self._lock:
job = self._jobs.pop(0)
try:
self._output.extend(job.get())
except tuple(self.exceptions) as exception:
# Stop dispatching any new job in the async callback thread
self._aborting = True
if isinstance(exception, TransportableException):
# Capture exception to add information on the local
# stack in addition to the distant stack
this_report = format_outer_frames(context=10,
stack_start=1)
report = """Multiprocessing exception:
%s
---------------------------------------------------------------------------
Sub-process traceback:
---------------------------------------------------------------------------
%s""" % (this_report, exception.message)
# Convert this to a JoblibException
exception_type = _mk_exception(exception.etype)[0]
exception = exception_type(report)
# Kill remaining running processes without waiting for
# the results as we will raise the exception we got back
# to the caller instead of returning any result.
with self._lock:
self._terminate_pool()
if self._managed_pool:
# In case we had to terminate a managed pool, let
# us start a new one to ensure that subsequent calls
# to __call__ on the same Parallel instance will get
# a working pool as they expect.
self._initialize_pool()
raise exception
def __call__(self, iterable):
if self._jobs:
raise ValueError('This Parallel instance is already running')
# A flag used to abort the dispatching of jobs in case an
# exception is found
self._aborting = False
if not self._managed_pool:
n_jobs = self._initialize_pool()
else:
n_jobs = self._effective_n_jobs()
if self.batch_size == 'auto':
self._effective_batch_size = 1
iterator = iter(iterable)
pre_dispatch = self.pre_dispatch
if pre_dispatch == 'all' or n_jobs == 1:
# prevent further dispatch via multiprocessing callback thread
self._original_iterator = None
self._pre_dispatch_amount = 0
else:
self._original_iterator = iterator
if hasattr(pre_dispatch, 'endswith'):
pre_dispatch = eval(pre_dispatch)
self._pre_dispatch_amount = pre_dispatch = int(pre_dispatch)
# The main thread will consume the first pre_dispatch items and
# the remaining items will later be lazily dispatched by async
# callbacks upon task completions.
iterator = itertools.islice(iterator, pre_dispatch)
self._start_time = time.time()
self.n_dispatched_batches = 0
self.n_dispatched_tasks = 0
self.n_completed_tasks = 0
self._smoothed_batch_duration = 0.0
try:
self._iterating = True
while self.dispatch_one_batch(iterator):
pass
if pre_dispatch == "all" or n_jobs == 1:
# The iterable was consumed all at once by the above for loop.
# No need to wait for async callbacks to trigger to
# consumption.
self._iterating = False
self.retrieve()
# Make sure that we get a last message telling us we are done
elapsed_time = time.time() - self._start_time
self._print('Done %3i out of %3i | elapsed: %s finished',
(len(self._output), len(self._output),
short_format_time(elapsed_time)))
finally:
if not self._managed_pool:
self._terminate_pool()
self._jobs = list()
output = self._output
self._output = None
return output
def __repr__(self):
return '%s(n_jobs=%s)' % (self.__class__.__name__, self.n_jobs)
|
bsd-3-clause
|
[
624,
199,
4433,
83,
367,
25316,
5250,
405,
316,
590,
9861,
1233,
14,
199,
624,
199,
3,
6529,
26,
9647,
352,
21084,
79,
392,
10962,
665,
486,
10643,
6308,
2729,
79,
392,
10962,
737,
6590,
17667,
1961,
6308,
5981,
690,
199,
3,
1898,
26,
7129,
12,
9647,
352,
21084,
79,
392,
10962,
199,
3,
844,
26,
6289,
650,
8502,
199,
199,
504,
636,
2443,
363,
492,
4629,
199,
199,
646,
747,
199,
646,
984,
199,
646,
9486,
199,
646,
3598,
199,
504,
3473,
492,
7452,
199,
646,
9143,
199,
646,
900,
199,
646,
5796,
199,
646,
7975,
199,
504,
5579,
492,
23095,
199,
893,
26,
272,
492,
17572,
465,
5927,
199,
2590,
26,
272,
492,
5927,
199,
199,
504,
13653,
25725,
63,
7546,
492,
6118,
199,
692,
6118,
365,
440,
488,
26,
272,
687,
1275,
2293,
492,
3194,
20671,
316,
5453,
272,
687,
12866,
14,
2293,
492,
11086,
5453,
199,
199,
504,
1275,
908,
63,
2340,
492,
1475,
63,
2804,
12,
1475,
63,
7837,
63,
8444,
199,
504,
1275,
2921,
492,
15996,
12,
3974,
63,
908,
63,
521,
199,
504,
1275,
1662,
63,
3924,
492,
27018,
461,
1726,
12,
485,
3880,
63,
1971,
199,
504,
1275,
4032,
492,
7573,
495,
63,
475,
63,
75,
2394,
199,
504,
13653,
5819,
492,
485,
17628,
421,
199,
5600,
63,
28988,
275,
788,
25725,
297,
283,
12562,
418,
199,
199,
3,
9711,
2860,
370,
25863,
6169,
4875,
24325,
1380,
19500,
199,
14879,
5617,
63,
5763,
33,
3705,
1149,
63,
10494,
275,
4396,
14879,
5617,
63,
5763,
33,
3705,
1149,
63,
4014,
748,
906,
44,
16526,
199,
199,
3,
1010,
4696,
12,
1077,
506,
7282,
8321,
370,
13714,
12866,
7634,
316,
199,
3,
24075,
14,
199,
3,
961,
2202,
1990,
1911,
701,
3879,
12338,
83,
15,
16571,
63,
2495,
63,
2912,
316,
14,
647,
199,
3,
543,
7750,
2633,
641,
7750,
10677,
14,
199,
4896,
63,
11259,
748,
63,
20813,
63,
36,
15301,
275,
1275,
18,
199,
199,
3,
7719,
440,
506,
4634,
4721,
370,
5126,
410,
2527,
71,
29099,
26,
1846,
9643,
3879,
23016,
199,
3,
641,
282,
2849,
7239,
1830,
1163,
14123,
1172,
949,
1736,
370,
2112,
1263,
1655,
14,
199,
4283,
63,
11259,
748,
63,
20813,
63,
36,
15301,
275,
499,
199,
199,
3,
25010,
2018,
650,
14,
20,
11,
675,
314,
283,
11796,
1000,
7,
1343,
1083,
701,
849,
26,
642,
7704,
652,
199,
3,
3962,
370,
5126,
12420,
316,
650,
6883,
17135,
8363,
626,
9635,
376,
5007,
2462,
199,
3,
4203,
626,
1630,
440,
370,
1435,
323,
14926,
316,
199,
692,
2688,
8,
311,
12,
283,
362,
63,
928,
63,
765,
735,
272,
1083,
275,
747,
14,
2314,
14,
362,
360,
14879,
5617,
63,
7363,
63,
9977,
358,
272,
340,
334,
765,
365,
488,
436,
6118,
14,
362,
63,
928,
63,
765,
342,
508,
283,
11796,
7,
288,
436,
283,
11796,
1000,
7,
315,
6118,
14,
362,
63,
452,
63,
928,
63,
2474,
5109,
267,
1083,
275,
283,
11796,
1000,
7,
272,
6186,
63,
1658,
63,
9059,
275,
6118,
14,
362,
63,
1100,
8,
765,
29,
765,
9,
199,
2836,
26,
272,
6186,
63,
1658,
63,
9059,
275,
488,
421,
199,
533,
17206,
379,
18287,
8,
785,
304,
272,
408,
15991,
282,
3414,
402,
334,
1532,
12,
1249,
12,
2074,
9,
6346,
465,
282,
2849,
4550,
624,
339,
347,
636,
826,
721,
277,
12,
6122,
63,
5224,
304,
267,
291,
14,
1744,
275,
769,
8,
5778,
63,
5224,
9,
267,
291,
423,
890,
275,
822,
8,
277,
14,
1744,
9,
339,
347,
636,
1250,
721,
277,
304,
267,
372,
359,
1532,
2031,
589,
12,
1011,
958,
9,
367,
2562,
12,
1249,
12,
2074,
315,
291,
14,
1744,
61,
339,
347,
636,
552,
721,
277,
304,
267,
372,
291,
423,
890,
421,
199,
11490,
199,
3,
11952,
2338,
626,
5419,
2597,
1380,
12866,
965,
2757,
6980,
4799,
199,
3,
314,
1603,
5488,
5617,
63,
21894,
24762,
1608,
1206,
3734,
1750,
199,
318,
5033,
63,
835,
837,
272,
408,
1432,
314,
1329,
402,
28504,
14,
272,
408,
272,
340,
6118,
365,
488,
26,
267,
372,
413,
272,
372,
6118,
14,
3541,
63,
835,
342,
421,
199,
11490,
199,
3,
2104,
8661,
199,
199,
318,
485,
9833,
63,
1541,
8,
1080,
12,
3376,
304,
272,
408,
1803,
756,
367,
4918,
22255,
590,
29430,
12,
314,
6033,
267,
10298,
641,
314,
574,
402,
3376,
14,
398,
2136,
675,
282,
17891,
22255,
465,
314,
12386,
402,
1478,
272,
408,
272,
340,
440,
3376,
26,
267,
372,
715,
272,
916,
3376,
690,
1616,
26,
267,
372,
756,
272,
340,
1478,
508,
378,
26,
267,
372,
756,
272,
3376,
275,
1275,
21,
627,
334,
845,
446,
3376,
9,
1011,
499,
272,
4666,
275,
7452,
8,
1080,
1182,
3376,
9,
272,
2163,
63,
3467,
275,
7452,
1332,
1080,
435,
413,
9,
1182,
3376,
9,
272,
372,
334,
442,
8,
2184,
63,
3467,
9,
508,
1109,
8,
3467,
430,
421,
199,
11490,
199,
533,
23886,
10647,
8,
1726,
304,
272,
408,
1626,
1919,
626,
365,
440,
13483,
370,
2040,
1007,
11816,
267,
370,
506,
31366,
14,
272,
408,
272,
986,
421,
199,
11490,
199,
533,
14969,
3481,
8,
785,
304,
272,
408,
644,
8146,
282,
805,
370,
1852,
652,
1919,
543,
2615,
5190,
315,
267,
3932,
6025,
14,
267,
18491,
367,
9861,
17226,
543,
12866,
12,
367,
1314,
267,
4967,
3913,
506,
17487,
14,
272,
408,
272,
347,
636,
826,
721,
277,
12,
2562,
304,
267,
291,
14,
1532,
275,
2562,
339,
347,
636,
1250,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
862,
26,
288,
372,
291,
14,
1532,
2031,
589,
12,
1011,
958,
9,
267,
871,
13483,
26,
288,
327,
2136,
12296,
314,
13483,
436,
24139,
652,
465,
288,
327,
6020,
3365,
12,
465,
12866,
1630,
440,
288,
327,
26791,
6661,
367,
282,
13483,
288,
746,
23886,
10647,
342,
267,
871,
26,
288,
325,
63,
466,
12,
325,
63,
585,
12,
325,
63,
5842,
275,
984,
14,
2804,
63,
815,
342,
288,
1318,
275,
1475,
63,
2804,
8,
69,
63,
466,
12,
325,
63,
585,
12,
325,
63,
5842,
12,
1067,
29,
709,
12,
2892,
7070,
63,
2743,
29,
17,
9,
288,
340,
11602,
8,
69,
63,
466,
12
] |
[
199,
4433,
83,
367,
25316,
5250,
405,
316,
590,
9861,
1233,
14,
199,
624,
199,
3,
6529,
26,
9647,
352,
21084,
79,
392,
10962,
665,
486,
10643,
6308,
2729,
79,
392,
10962,
737,
6590,
17667,
1961,
6308,
5981,
690,
199,
3,
1898,
26,
7129,
12,
9647,
352,
21084,
79,
392,
10962,
199,
3,
844,
26,
6289,
650,
8502,
199,
199,
504,
636,
2443,
363,
492,
4629,
199,
199,
646,
747,
199,
646,
984,
199,
646,
9486,
199,
646,
3598,
199,
504,
3473,
492,
7452,
199,
646,
9143,
199,
646,
900,
199,
646,
5796,
199,
646,
7975,
199,
504,
5579,
492,
23095,
199,
893,
26,
272,
492,
17572,
465,
5927,
199,
2590,
26,
272,
492,
5927,
199,
199,
504,
13653,
25725,
63,
7546,
492,
6118,
199,
692,
6118,
365,
440,
488,
26,
272,
687,
1275,
2293,
492,
3194,
20671,
316,
5453,
272,
687,
12866,
14,
2293,
492,
11086,
5453,
199,
199,
504,
1275,
908,
63,
2340,
492,
1475,
63,
2804,
12,
1475,
63,
7837,
63,
8444,
199,
504,
1275,
2921,
492,
15996,
12,
3974,
63,
908,
63,
521,
199,
504,
1275,
1662,
63,
3924,
492,
27018,
461,
1726,
12,
485,
3880,
63,
1971,
199,
504,
1275,
4032,
492,
7573,
495,
63,
475,
63,
75,
2394,
199,
504,
13653,
5819,
492,
485,
17628,
421,
199,
5600,
63,
28988,
275,
788,
25725,
297,
283,
12562,
418,
199,
199,
3,
9711,
2860,
370,
25863,
6169,
4875,
24325,
1380,
19500,
199,
14879,
5617,
63,
5763,
33,
3705,
1149,
63,
10494,
275,
4396,
14879,
5617,
63,
5763,
33,
3705,
1149,
63,
4014,
748,
906,
44,
16526,
199,
199,
3,
1010,
4696,
12,
1077,
506,
7282,
8321,
370,
13714,
12866,
7634,
316,
199,
3,
24075,
14,
199,
3,
961,
2202,
1990,
1911,
701,
3879,
12338,
83,
15,
16571,
63,
2495,
63,
2912,
316,
14,
647,
199,
3,
543,
7750,
2633,
641,
7750,
10677,
14,
199,
4896,
63,
11259,
748,
63,
20813,
63,
36,
15301,
275,
1275,
18,
199,
199,
3,
7719,
440,
506,
4634,
4721,
370,
5126,
410,
2527,
71,
29099,
26,
1846,
9643,
3879,
23016,
199,
3,
641,
282,
2849,
7239,
1830,
1163,
14123,
1172,
949,
1736,
370,
2112,
1263,
1655,
14,
199,
4283,
63,
11259,
748,
63,
20813,
63,
36,
15301,
275,
499,
199,
199,
3,
25010,
2018,
650,
14,
20,
11,
675,
314,
283,
11796,
1000,
7,
1343,
1083,
701,
849,
26,
642,
7704,
652,
199,
3,
3962,
370,
5126,
12420,
316,
650,
6883,
17135,
8363,
626,
9635,
376,
5007,
2462,
199,
3,
4203,
626,
1630,
440,
370,
1435,
323,
14926,
316,
199,
692,
2688,
8,
311,
12,
283,
362,
63,
928,
63,
765,
735,
272,
1083,
275,
747,
14,
2314,
14,
362,
360,
14879,
5617,
63,
7363,
63,
9977,
358,
272,
340,
334,
765,
365,
488,
436,
6118,
14,
362,
63,
928,
63,
765,
342,
508,
283,
11796,
7,
288,
436,
283,
11796,
1000,
7,
315,
6118,
14,
362,
63,
452,
63,
928,
63,
2474,
5109,
267,
1083,
275,
283,
11796,
1000,
7,
272,
6186,
63,
1658,
63,
9059,
275,
6118,
14,
362,
63,
1100,
8,
765,
29,
765,
9,
199,
2836,
26,
272,
6186,
63,
1658,
63,
9059,
275,
488,
421,
199,
533,
17206,
379,
18287,
8,
785,
304,
272,
408,
15991,
282,
3414,
402,
334,
1532,
12,
1249,
12,
2074,
9,
6346,
465,
282,
2849,
4550,
624,
339,
347,
636,
826,
721,
277,
12,
6122,
63,
5224,
304,
267,
291,
14,
1744,
275,
769,
8,
5778,
63,
5224,
9,
267,
291,
423,
890,
275,
822,
8,
277,
14,
1744,
9,
339,
347,
636,
1250,
721,
277,
304,
267,
372,
359,
1532,
2031,
589,
12,
1011,
958,
9,
367,
2562,
12,
1249,
12,
2074,
315,
291,
14,
1744,
61,
339,
347,
636,
552,
721,
277,
304,
267,
372,
291,
423,
890,
421,
199,
11490,
199,
3,
11952,
2338,
626,
5419,
2597,
1380,
12866,
965,
2757,
6980,
4799,
199,
3,
314,
1603,
5488,
5617,
63,
21894,
24762,
1608,
1206,
3734,
1750,
199,
318,
5033,
63,
835,
837,
272,
408,
1432,
314,
1329,
402,
28504,
14,
272,
408,
272,
340,
6118,
365,
488,
26,
267,
372,
413,
272,
372,
6118,
14,
3541,
63,
835,
342,
421,
199,
11490,
199,
3,
2104,
8661,
199,
199,
318,
485,
9833,
63,
1541,
8,
1080,
12,
3376,
304,
272,
408,
1803,
756,
367,
4918,
22255,
590,
29430,
12,
314,
6033,
267,
10298,
641,
314,
574,
402,
3376,
14,
398,
2136,
675,
282,
17891,
22255,
465,
314,
12386,
402,
1478,
272,
408,
272,
340,
440,
3376,
26,
267,
372,
715,
272,
916,
3376,
690,
1616,
26,
267,
372,
756,
272,
340,
1478,
508,
378,
26,
267,
372,
756,
272,
3376,
275,
1275,
21,
627,
334,
845,
446,
3376,
9,
1011,
499,
272,
4666,
275,
7452,
8,
1080,
1182,
3376,
9,
272,
2163,
63,
3467,
275,
7452,
1332,
1080,
435,
413,
9,
1182,
3376,
9,
272,
372,
334,
442,
8,
2184,
63,
3467,
9,
508,
1109,
8,
3467,
430,
421,
199,
11490,
199,
533,
23886,
10647,
8,
1726,
304,
272,
408,
1626,
1919,
626,
365,
440,
13483,
370,
2040,
1007,
11816,
267,
370,
506,
31366,
14,
272,
408,
272,
986,
421,
199,
11490,
199,
533,
14969,
3481,
8,
785,
304,
272,
408,
644,
8146,
282,
805,
370,
1852,
652,
1919,
543,
2615,
5190,
315,
267,
3932,
6025,
14,
267,
18491,
367,
9861,
17226,
543,
12866,
12,
367,
1314,
267,
4967,
3913,
506,
17487,
14,
272,
408,
272,
347,
636,
826,
721,
277,
12,
2562,
304,
267,
291,
14,
1532,
275,
2562,
339,
347,
636,
1250,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
862,
26,
288,
372,
291,
14,
1532,
2031,
589,
12,
1011,
958,
9,
267,
871,
13483,
26,
288,
327,
2136,
12296,
314,
13483,
436,
24139,
652,
465,
288,
327,
6020,
3365,
12,
465,
12866,
1630,
440,
288,
327,
26791,
6661,
367,
282,
13483,
288,
746,
23886,
10647,
342,
267,
871,
26,
288,
325,
63,
466,
12,
325,
63,
585,
12,
325,
63,
5842,
275,
984,
14,
2804,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
GStreamer/cerbero
|
test/test_cerbero_build_filesprovider.py
|
4
|
4885
|
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
import shutil
import unittest
import tempfile
from cerbero.build import filesprovider
from cerbero.config import Platform, License
from test.test_build_common import add_files
from test.test_common import DummyConfig
class Config(DummyConfig):
def __init__(self, tmp, platform):
self.prefix = tmp
self.target_platform = platform
class FilesProvider(filesprovider.FilesProvider):
files_misc = ['README', 'libexec/gstreamer-0.10/pluginsloader%(bext)s']
files_libs = ['libgstreamer-0.10']
files_bins = ['gst-launch']
files_devel = ['include/gstreamer.h']
licenses_devel = [License.LGPL]
platform_files_bins = {
Platform.WINDOWS: ['windows'],
Platform.LINUX: ['linux']}
platform_files_libs = {
Platform.WINDOWS: ['libgstreamer-win32'],
Platform.LINUX: ['libgstreamer-x11']}
class PackageTest(unittest.TestCase):
def setUp(self):
self.tmp = tempfile.mkdtemp()
win32config = Config(self.tmp, Platform.WINDOWS)
linuxconfig = Config(self.tmp, Platform.LINUX)
self.win32recipe = FilesProvider(win32config)
self.linuxrecipe = FilesProvider(linuxconfig)
self.winbin = ['bin/gst-launch.exe', 'bin/windows.exe']
self.linuxbin = ['bin/gst-launch', 'bin/linux']
self.winlib = ['bin/libgstreamer-0.10.dll', 'bin/libgstreamer-win32.dll']
self.linuxlib = ['lib/libgstreamer-0.10.so.1', 'lib/libgstreamer-x11.so.1']
self.winmisc = ['README', 'libexec/gstreamer-0.10/pluginsloader.exe']
self.linuxmisc = ['README', 'libexec/gstreamer-0.10/pluginsloader']
devfiles = ['include/gstreamer.h', 'lib/libgstreamer-0.10.a',
'lib/libgstreamer-0.10.la']
self.windevfiles = devfiles + ['lib/libgstreamer-win32.a',
'lib/libgstreamer-win32.la', 'lib/libgstreamer-win32.dll.a',
'lib/libgstreamer-win32.def', 'lib/gstreamer-win32.lib',
'lib/libgstreamer-0.10.dll.a', 'lib/libgstreamer-0.10.def',
'lib/gstreamer-0.10.lib']
self.lindevfiles = devfiles + ['lib/libgstreamer-0.10.so',
'lib/libgstreamer-x11.a', 'lib/libgstreamer-x11.la',
'lib/libgstreamer-x11.so']
def tearDown(self):
shutil.rmtree(self.tmp)
def testFilesCategories(self):
self.assertEqual(sorted(['bins', 'libs', 'misc', 'devel']),
self.win32recipe._files_categories())
def testListBinaries(self):
self.assertEqual(self.win32recipe.files_list_by_category('bins'),
sorted(self.winbin))
self.assertEqual(self.linuxrecipe.files_list_by_category('bins'),
sorted(self.linuxbin))
def testListLibraries(self):
add_files(self.tmp)
self.assertEqual(self.win32recipe.files_list_by_category('libs'),
sorted(self.winlib))
self.assertEqual(self.linuxrecipe.files_list_by_category('libs'),
sorted(self.linuxlib))
def testDevelFiles(self):
add_files(self.tmp)
self.assertEqual(self.win32recipe.devel_files_list(),
sorted(self.windevfiles))
self.assertEqual(self.linuxrecipe.devel_files_list(),
sorted(self.lindevfiles))
def testDistFiles(self):
win32files = self.winlib + self.winbin + self.winmisc
linuxfiles = self.linuxlib + self.linuxbin + self.linuxmisc
add_files(self.tmp)
self.assertEqual(self.win32recipe.dist_files_list(), sorted(win32files))
self.assertEqual(self.linuxrecipe.dist_files_list(), sorted(linuxfiles))
def testGetAllFiles(self):
win32files = self.winlib + self.winbin + self.winmisc + self.windevfiles
linuxfiles = self.linuxlib + self.linuxbin + self.linuxmisc + self.lindevfiles
add_files(self.tmp)
self.assertEqual(self.win32recipe.files_list(), sorted(win32files))
self.assertEqual(self.linuxrecipe.files_list(), sorted(linuxfiles))
|
lgpl-2.1
|
[
3,
3361,
605,
79,
446,
282,
3510,
13,
3246,
1900,
2656,
367,
3232,
5800,
2032,
199,
3,
1898,
334,
35,
9,
6029,
6061,
265,
73,
603,
269,
7098,
437,
2019,
431,
89,
665,
89,
4452,
85,
11552,
32,
6799,
14,
957,
30,
199,
3,
199,
3,
961,
3555,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
199,
3,
2811,
652,
1334,
314,
2895,
402,
314,
1664,
11243,
1696,
1684,
199,
3,
844,
465,
3267,
701,
314,
2868,
2290,
2752,
27,
1902,
199,
3,
1015,
499,
402,
314,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
961,
3555,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
199,
3,
11243,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
11243,
1696,
1684,
199,
3,
844,
3180,
543,
642,
3555,
27,
340,
440,
12,
2218,
370,
314,
199,
3,
2868,
2290,
2752,
12,
3277,
2020,
8155,
15630,
10902,
446,
14453,
13540,
12,
199,
3,
8226,
12,
4828,
15673,
13,
13421,
12,
8217,
14,
199,
199,
646,
5145,
199,
646,
2882,
199,
646,
5549,
199,
199,
504,
3361,
605,
79,
14,
1506,
492,
1584,
3780,
199,
504,
3361,
605,
79,
14,
888,
492,
16078,
12,
844,
199,
504,
511,
14,
396,
63,
1506,
63,
2330,
492,
1050,
63,
1725,
199,
504,
511,
14,
396,
63,
2330,
492,
9762,
2028,
421,
199,
533,
4094,
8,
11324,
2028,
304,
339,
347,
636,
826,
721,
277,
12,
3529,
12,
4298,
304,
267,
291,
14,
1861,
275,
3529,
267,
291,
14,
1375,
63,
3246,
275,
4298,
421,
199,
533,
16920,
6663,
8,
1725,
3780,
14,
5535,
6663,
304,
339,
1584,
63,
9923,
275,
788,
18195,
297,
283,
773,
1628,
15,
23908,
24362,
13,
16,
14,
709,
15,
5265,
3422,
2840,
66,
832,
9,
83,
418,
272,
1584,
63,
8450,
275,
788,
773,
23908,
24362,
13,
16,
14,
709,
418,
272,
1584,
63,
11329,
275,
788,
23908,
13,
9850,
418,
272,
1584,
63,
27870,
275,
788,
2613,
15,
23908,
24362,
14,
72,
418,
272,
12378,
63,
27870,
275,
359,
3761,
14,
44,
12006,
61,
272,
4298,
63,
1725,
63,
11329,
275,
469,
288,
16078,
14,
20509,
26,
788,
8258,
995,
288,
16078,
14,
26030,
26,
788,
5135,
12074,
272,
4298,
63,
1725,
63,
8450,
275,
469,
288,
16078,
14,
20509,
26,
788,
773,
23908,
24362,
13,
2676,
708,
995,
288,
16078,
14,
26030,
26,
788,
773,
23908,
24362,
13,
88,
845,
12074,
421,
199,
533,
15665,
774,
8,
2796,
14,
1746,
304,
339,
347,
3613,
8,
277,
304,
267,
291,
14,
2791,
275,
5549,
14,
11983,
342,
267,
4747,
708,
888,
275,
4094,
8,
277,
14,
2791,
12,
16078,
14,
20509,
9,
267,
18369,
888,
275,
4094,
8,
277,
14,
2791,
12,
16078,
14,
26030,
9,
267,
291,
14,
2676,
708,
13191,
275,
16920,
6663,
8,
2676,
708,
888,
9,
267,
291,
14,
5135,
13191,
275,
16920,
6663,
8,
5135,
888,
9,
398,
291,
14,
2676,
1393,
275,
788,
1393,
15,
23908,
13,
9850,
14,
5803,
297,
283,
1393,
15,
8258,
14,
5803,
418,
267,
291,
14,
5135,
1393,
275,
788,
1393,
15,
23908,
13,
9850,
297,
283,
1393,
15,
5135,
418,
267,
291,
14,
2676,
773,
275,
788,
1393,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
9259,
297,
283,
1393,
15,
773,
23908,
24362,
13,
2676,
708,
14,
9259,
418,
267,
291,
14,
5135,
773,
275,
788,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
1152,
14,
17,
297,
283,
773,
15,
773,
23908,
24362,
13,
88,
845,
14,
1152,
14,
17,
418,
267,
291,
14,
2676,
9923,
275,
788,
18195,
297,
283,
773,
1628,
15,
23908,
24362,
13,
16,
14,
709,
15,
5265,
3422,
14,
5803,
418,
267,
291,
14,
5135,
9923,
275,
788,
18195,
297,
283,
773,
1628,
15,
23908,
24362,
13,
16,
14,
709,
15,
5265,
3422,
418,
267,
4866,
1725,
275,
788,
2613,
15,
23908,
24362,
14,
72,
297,
283,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
65,
297,
490,
283,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
416,
418,
398,
291,
14,
2676,
2374,
1725,
275,
4866,
1725,
435,
788,
773,
15,
773,
23908,
24362,
13,
2676,
708,
14,
65,
297,
355,
283,
773,
15,
773,
23908,
24362,
13,
2676,
708,
14,
416,
297,
283,
773,
15,
773,
23908,
24362,
13,
2676,
708,
14,
9259,
14,
65,
297,
355,
283,
773,
15,
773,
23908,
24362,
13,
2676,
708,
14,
318,
297,
283,
773,
15,
23908,
24362,
13,
2676,
708,
14,
773,
297,
355,
283,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
9259,
14,
65,
297,
283,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
318,
297,
355,
283,
773,
15,
23908,
24362,
13,
16,
14,
709,
14,
773,
418,
267,
291,
14,
472,
2374,
1725,
275,
4866,
1725,
435,
788,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
1152,
297,
355,
283,
773,
15,
773,
23908,
24362,
13,
88,
845,
14,
65,
297,
283,
773,
15,
773,
23908,
24362,
13,
88,
845,
14,
416,
297,
355,
283,
773,
15,
773,
23908,
24362,
13,
88,
845,
14,
1152,
418,
339,
347,
6766,
8,
277,
304,
267,
5145,
14,
9242,
8,
277,
14,
2791,
9,
339,
347,
511,
5535,
28731,
8,
277,
304,
267,
291,
14,
629,
8,
5917,
2941,
11329,
297,
283,
8450,
297,
283,
9923,
297,
283,
27870,
3815,
355,
291,
14,
2676,
708,
13191,
423,
1725,
63,
8906,
1012,
339,
347,
511,
1296,
13394,
3433,
8,
277,
304,
267,
291,
14,
629,
8,
277,
14,
2676,
708,
13191,
14,
1725,
63,
513,
63,
991,
63,
3710,
360,
11329,
659,
355,
3355,
8,
277,
14,
2676,
1393,
430,
267,
291,
14,
629,
8,
277,
14,
5135,
13191,
14,
1725,
63,
513,
63,
991,
63,
3710,
360,
11329,
659,
355,
3355,
8,
277,
14,
5135,
1393,
430,
339,
347,
511,
1296,
23624,
8,
277,
304,
267,
1050,
63,
1725
] |
[
3361,
605,
79,
446,
282,
3510,
13,
3246,
1900,
2656,
367,
3232,
5800,
2032,
199,
3,
1898,
334,
35,
9,
6029,
6061,
265,
73,
603,
269,
7098,
437,
2019,
431,
89,
665,
89,
4452,
85,
11552,
32,
6799,
14,
957,
30,
199,
3,
199,
3,
961,
3555,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
199,
3,
2811,
652,
1334,
314,
2895,
402,
314,
1664,
11243,
1696,
1684,
199,
3,
844,
465,
3267,
701,
314,
2868,
2290,
2752,
27,
1902,
199,
3,
1015,
499,
402,
314,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
961,
3555,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
199,
3,
11243,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
11243,
1696,
1684,
199,
3,
844,
3180,
543,
642,
3555,
27,
340,
440,
12,
2218,
370,
314,
199,
3,
2868,
2290,
2752,
12,
3277,
2020,
8155,
15630,
10902,
446,
14453,
13540,
12,
199,
3,
8226,
12,
4828,
15673,
13,
13421,
12,
8217,
14,
199,
199,
646,
5145,
199,
646,
2882,
199,
646,
5549,
199,
199,
504,
3361,
605,
79,
14,
1506,
492,
1584,
3780,
199,
504,
3361,
605,
79,
14,
888,
492,
16078,
12,
844,
199,
504,
511,
14,
396,
63,
1506,
63,
2330,
492,
1050,
63,
1725,
199,
504,
511,
14,
396,
63,
2330,
492,
9762,
2028,
421,
199,
533,
4094,
8,
11324,
2028,
304,
339,
347,
636,
826,
721,
277,
12,
3529,
12,
4298,
304,
267,
291,
14,
1861,
275,
3529,
267,
291,
14,
1375,
63,
3246,
275,
4298,
421,
199,
533,
16920,
6663,
8,
1725,
3780,
14,
5535,
6663,
304,
339,
1584,
63,
9923,
275,
788,
18195,
297,
283,
773,
1628,
15,
23908,
24362,
13,
16,
14,
709,
15,
5265,
3422,
2840,
66,
832,
9,
83,
418,
272,
1584,
63,
8450,
275,
788,
773,
23908,
24362,
13,
16,
14,
709,
418,
272,
1584,
63,
11329,
275,
788,
23908,
13,
9850,
418,
272,
1584,
63,
27870,
275,
788,
2613,
15,
23908,
24362,
14,
72,
418,
272,
12378,
63,
27870,
275,
359,
3761,
14,
44,
12006,
61,
272,
4298,
63,
1725,
63,
11329,
275,
469,
288,
16078,
14,
20509,
26,
788,
8258,
995,
288,
16078,
14,
26030,
26,
788,
5135,
12074,
272,
4298,
63,
1725,
63,
8450,
275,
469,
288,
16078,
14,
20509,
26,
788,
773,
23908,
24362,
13,
2676,
708,
995,
288,
16078,
14,
26030,
26,
788,
773,
23908,
24362,
13,
88,
845,
12074,
421,
199,
533,
15665,
774,
8,
2796,
14,
1746,
304,
339,
347,
3613,
8,
277,
304,
267,
291,
14,
2791,
275,
5549,
14,
11983,
342,
267,
4747,
708,
888,
275,
4094,
8,
277,
14,
2791,
12,
16078,
14,
20509,
9,
267,
18369,
888,
275,
4094,
8,
277,
14,
2791,
12,
16078,
14,
26030,
9,
267,
291,
14,
2676,
708,
13191,
275,
16920,
6663,
8,
2676,
708,
888,
9,
267,
291,
14,
5135,
13191,
275,
16920,
6663,
8,
5135,
888,
9,
398,
291,
14,
2676,
1393,
275,
788,
1393,
15,
23908,
13,
9850,
14,
5803,
297,
283,
1393,
15,
8258,
14,
5803,
418,
267,
291,
14,
5135,
1393,
275,
788,
1393,
15,
23908,
13,
9850,
297,
283,
1393,
15,
5135,
418,
267,
291,
14,
2676,
773,
275,
788,
1393,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
9259,
297,
283,
1393,
15,
773,
23908,
24362,
13,
2676,
708,
14,
9259,
418,
267,
291,
14,
5135,
773,
275,
788,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
1152,
14,
17,
297,
283,
773,
15,
773,
23908,
24362,
13,
88,
845,
14,
1152,
14,
17,
418,
267,
291,
14,
2676,
9923,
275,
788,
18195,
297,
283,
773,
1628,
15,
23908,
24362,
13,
16,
14,
709,
15,
5265,
3422,
14,
5803,
418,
267,
291,
14,
5135,
9923,
275,
788,
18195,
297,
283,
773,
1628,
15,
23908,
24362,
13,
16,
14,
709,
15,
5265,
3422,
418,
267,
4866,
1725,
275,
788,
2613,
15,
23908,
24362,
14,
72,
297,
283,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
65,
297,
490,
283,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
416,
418,
398,
291,
14,
2676,
2374,
1725,
275,
4866,
1725,
435,
788,
773,
15,
773,
23908,
24362,
13,
2676,
708,
14,
65,
297,
355,
283,
773,
15,
773,
23908,
24362,
13,
2676,
708,
14,
416,
297,
283,
773,
15,
773,
23908,
24362,
13,
2676,
708,
14,
9259,
14,
65,
297,
355,
283,
773,
15,
773,
23908,
24362,
13,
2676,
708,
14,
318,
297,
283,
773,
15,
23908,
24362,
13,
2676,
708,
14,
773,
297,
355,
283,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
9259,
14,
65,
297,
283,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
318,
297,
355,
283,
773,
15,
23908,
24362,
13,
16,
14,
709,
14,
773,
418,
267,
291,
14,
472,
2374,
1725,
275,
4866,
1725,
435,
788,
773,
15,
773,
23908,
24362,
13,
16,
14,
709,
14,
1152,
297,
355,
283,
773,
15,
773,
23908,
24362,
13,
88,
845,
14,
65,
297,
283,
773,
15,
773,
23908,
24362,
13,
88,
845,
14,
416,
297,
355,
283,
773,
15,
773,
23908,
24362,
13,
88,
845,
14,
1152,
418,
339,
347,
6766,
8,
277,
304,
267,
5145,
14,
9242,
8,
277,
14,
2791,
9,
339,
347,
511,
5535,
28731,
8,
277,
304,
267,
291,
14,
629,
8,
5917,
2941,
11329,
297,
283,
8450,
297,
283,
9923,
297,
283,
27870,
3815,
355,
291,
14,
2676,
708,
13191,
423,
1725,
63,
8906,
1012,
339,
347,
511,
1296,
13394,
3433,
8,
277,
304,
267,
291,
14,
629,
8,
277,
14,
2676,
708,
13191,
14,
1725,
63,
513,
63,
991,
63,
3710,
360,
11329,
659,
355,
3355,
8,
277,
14,
2676,
1393,
430,
267,
291,
14,
629,
8,
277,
14,
5135,
13191,
14,
1725,
63,
513,
63,
991,
63,
3710,
360,
11329,
659,
355,
3355,
8,
277,
14,
5135,
1393,
430,
339,
347,
511,
1296,
23624,
8,
277,
304,
267,
1050,
63,
1725,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
SLongofono/448_Project4
|
mutatorTest.py
|
1
|
3874
|
import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import Mutators
def getUniquesTest():
print "Testing getUniques Function..."
knownUniques = [0,99,8000]
l1 = [1,2,3,4,5,6,7,8,9]
l2 = [0,1,2,3,4,99,5,6,7,8,9,8000]
return Mutators.getUniques(l1,l2) == knownUniques
def artistMutatorTest():
print "Testing ArtistMutator Function"
values = ['a','b','c']
newValues = ['a','b','c','d']
newValueswithNorepeats = ['a','b','c']
return (Mutators.artistMutator(values,newValues) == newValues and (Mutators.artistMutator(values,newValueswithNorepeats)==values))
def popularityMutatorTest():
print "Testing PopularityMutator Function"
values = [1,2,3]
newValues = [1,2,3,1]
return (Mutators.popularityMutator(values,1) == newValues)
def acousticnessMutatorTest():
print "Testing AcousticnessMutator Function"
values = [1,2,3]
newValues = [1,2,3,1]
return (Mutators.acousticnessMutator(values,1) == newValues)
def valenceMutatorTest():
print"Testing ValenceMutator Function"
values = [1,2,3]
newValues = [1,2,3,1]
return (Mutators.valenceMutator(values,1) == newValues)
def danceabilityMutatorTest():
print"Testing danceabilityMutator Function"
values = [1,2,3]
newValues = [1,2,3,1]
return (Mutators.danceabilityMutator(values,1) == newValues)
def energyMutatorTest():
print"Testing energyMutator Function"
values = [1,2,3]
newValues = [1,2,3,1]
return (Mutators.energyMutator(values,1) == newValues)
def instrumentalnessMutatorTest():
print"Testing instrumentatlnessMutator Function"
values = [1,2,3]
newValues = [1,2,3,1]
return (Mutators.instrumentalnessMutator(values,1) == newValues)
def keyMutatorTest():
print"Testing keyMutator Function"
values = [1,2,3]
newValues = [1,2,3,1]
return (Mutators.keyMutator(values,1) == newValues)
def livenessMutatorTest():
print"Testing livenessMutator Function"
values = [1,2,3]
newValues = [1,2,3,1]
return (Mutators.livenessMutator(values,1) == newValues)
def go():
print "**************************************"
print "********MUTATOR FUNCTION TESTING******"
print "**************************************"
numTests = 0
numPassed = 0
numTests +=1
if getUniquesTest():
print "\t getUniques Test Passed"
numPassed += 1
numTests += 1
if artistMutatorTest():
print "\t artistMutator Test Passed "
numPassed += 1
numTests += 1
if popularityMutatorTest():
print "\t popularityMutator Test Passed "
numPassed += 1
numTests += 1
if acousticnessMutatorTest():
print "\t acousticnessMutator Test Passed "
numPassed += 1
numTests += 1
if danceabilityMutatorTest():
print "\t danceabilityMutator Test Passed "
numPassed += 1
numTests += 1
if keyMutatorTest():
print "\t keyMutator Test Passed "
numPassed += 1
numTests += 1
if energyMutatorTest():
print "\t acousticnessMutator Test Passed "
numPassed += 1
numTests += 1
if valenceMutatorTest():
print "\t valenceMutator Test Passed "
numPassed += 1
numTests += 1
if instrumentalnessMutatorTest():
print "\t instrumentalnessMutator Test Passed "
numPassed += 1
numTests += 1
if livenessMutatorTest():
print "\t livenessMutator Test Passed "
numPassed += 1
print "Tests: %d\nTests passed: %d\nPercentage: %f\n\n" % (numTests,numPassed, (float(numPassed)/numTests)*100)
return numTests, numPassed
if __name__ == "__main__":
x,y = go()
print "Tests: %d\nTests passed: %d\nPercentage: %f\n\n" % (x,y, (float(y)/x)*100)
|
mit
|
[
646,
747,
12,
1274,
12,
10955,
199,
1818,
694,
275,
747,
14,
515,
14,
3475,
8,
736,
14,
515,
14,
4832,
8,
10955,
14,
23462,
8,
10955,
14,
1818,
1943,
16890,
199,
1708,
694,
275,
747,
14,
515,
14,
3475,
8,
1818,
694,
9,
199,
1274,
14,
515,
14,
3176,
8,
16,
12,
1708,
694,
9,
199,
199,
646,
26550,
2750,
199,
199,
318,
221,
664,
11427,
26935,
837,
272,
870,
298,
9029,
664,
11427,
83,
6801,
11500,
272,
6040,
11427,
83,
275,
359,
16,
12,
1020,
12,
15214,
61,
272,
634,
17,
275,
359,
17,
12,
18,
12,
19,
12,
20,
12,
21,
12,
22,
12,
23,
12,
24,
12,
25,
61,
272,
634,
18,
275,
359,
16,
12,
17,
12,
18,
12,
19,
12,
20,
12,
1020,
12,
21,
12,
22,
12,
23,
12,
24,
12,
25,
12,
15214,
61,
272,
372,
26550,
2750,
14,
362,
11427,
83,
8,
76,
17,
12,
76,
18,
9,
508,
6040,
11427,
83,
199,
199,
318,
16459,
22539,
707,
774,
837,
272,
870,
298,
9029,
1952,
5011,
22539,
707,
6801,
2,
272,
1338,
275,
788,
65,
1673,
66,
1673,
67,
418,
272,
892,
6550,
275,
788,
65,
1673,
66,
1673,
67,
1673,
68,
418,
272,
892,
1110,
1908,
46,
720,
321,
1956,
275,
788,
65,
1673,
66,
1673,
67,
418,
272,
372,
334,
22539,
2750,
14,
11215,
22539,
707,
8,
1459,
12,
1222,
6550,
9,
508,
892,
6550,
436,
334,
22539,
2750,
14,
11215,
22539,
707,
8,
1459,
12,
1222,
1110,
1908,
46,
720,
321,
1956,
12694,
1459,
430,
199,
199,
318,
4560,
22504,
22539,
707,
774,
837,
272,
870,
298,
9029,
13244,
22504,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
1935,
22504,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
282,
331,
833,
530,
4171,
22539,
707,
774,
837,
272,
870,
298,
9029,
437,
331,
833,
530,
4171,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
13286,
833,
530,
4171,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
25819,
17072,
22539,
707,
774,
837,
272,
870,
2,
9029,
812,
65,
17072,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
3042,
17072,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
366,
554,
3616,
22539,
707,
774,
837,
272,
870,
2,
9029,
366,
554,
3616,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
20327,
3616,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
12304,
22539,
707,
774,
837,
272,
870,
2,
9029,
12304,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
8443,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
14498,
279,
4171,
22539,
707,
774,
837,
272,
870,
2,
9029,
14498,
292,
76,
4171,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
13321,
279,
4171,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
790,
22539,
707,
774,
837,
272,
870,
2,
9029,
790,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
498,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
1212,
1856,
16709,
22539,
707,
774,
837,
272,
870,
2,
9029,
1212,
1856,
16709,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
317,
1856,
16709,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
2621,
837,
272,
870,
298,
5815,
26537,
2,
272,
870,
298,
1801,
25890,
6467,
32744,
7393,
1206,
26537,
2,
272,
870,
298,
5815,
26537,
2,
272,
1967,
2925,
275,
378,
272,
1967,
48,
2744,
275,
378,
272,
1967,
2925,
847,
17,
272,
340,
664,
11427,
26935,
837,
267,
870,
1867,
84,
664,
11427,
83,
1379,
510,
2744,
2,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
16459,
22539,
707,
774,
837,
267,
870,
1867,
84,
16459,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
4560,
22504,
22539,
707,
774,
837,
267,
870,
1867,
84,
4560,
22504,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
282,
331,
833,
530,
4171,
22539,
707,
774,
837,
267,
870,
1867,
84,
282,
331,
833,
530,
4171,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
366,
554,
3616,
22539,
707,
774,
837,
267,
870,
1867,
84,
366,
554,
3616,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
790,
22539,
707,
774,
837,
267,
870,
1867,
84,
790,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
12304,
22539,
707,
774,
837,
267,
870,
1867,
84,
282,
331,
833,
530,
4171,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
25819
] |
[
747,
12,
1274,
12,
10955,
199,
1818,
694,
275,
747,
14,
515,
14,
3475,
8,
736,
14,
515,
14,
4832,
8,
10955,
14,
23462,
8,
10955,
14,
1818,
1943,
16890,
199,
1708,
694,
275,
747,
14,
515,
14,
3475,
8,
1818,
694,
9,
199,
1274,
14,
515,
14,
3176,
8,
16,
12,
1708,
694,
9,
199,
199,
646,
26550,
2750,
199,
199,
318,
221,
664,
11427,
26935,
837,
272,
870,
298,
9029,
664,
11427,
83,
6801,
11500,
272,
6040,
11427,
83,
275,
359,
16,
12,
1020,
12,
15214,
61,
272,
634,
17,
275,
359,
17,
12,
18,
12,
19,
12,
20,
12,
21,
12,
22,
12,
23,
12,
24,
12,
25,
61,
272,
634,
18,
275,
359,
16,
12,
17,
12,
18,
12,
19,
12,
20,
12,
1020,
12,
21,
12,
22,
12,
23,
12,
24,
12,
25,
12,
15214,
61,
272,
372,
26550,
2750,
14,
362,
11427,
83,
8,
76,
17,
12,
76,
18,
9,
508,
6040,
11427,
83,
199,
199,
318,
16459,
22539,
707,
774,
837,
272,
870,
298,
9029,
1952,
5011,
22539,
707,
6801,
2,
272,
1338,
275,
788,
65,
1673,
66,
1673,
67,
418,
272,
892,
6550,
275,
788,
65,
1673,
66,
1673,
67,
1673,
68,
418,
272,
892,
1110,
1908,
46,
720,
321,
1956,
275,
788,
65,
1673,
66,
1673,
67,
418,
272,
372,
334,
22539,
2750,
14,
11215,
22539,
707,
8,
1459,
12,
1222,
6550,
9,
508,
892,
6550,
436,
334,
22539,
2750,
14,
11215,
22539,
707,
8,
1459,
12,
1222,
1110,
1908,
46,
720,
321,
1956,
12694,
1459,
430,
199,
199,
318,
4560,
22504,
22539,
707,
774,
837,
272,
870,
298,
9029,
13244,
22504,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
1935,
22504,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
282,
331,
833,
530,
4171,
22539,
707,
774,
837,
272,
870,
298,
9029,
437,
331,
833,
530,
4171,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
13286,
833,
530,
4171,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
25819,
17072,
22539,
707,
774,
837,
272,
870,
2,
9029,
812,
65,
17072,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
3042,
17072,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
366,
554,
3616,
22539,
707,
774,
837,
272,
870,
2,
9029,
366,
554,
3616,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
20327,
3616,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
12304,
22539,
707,
774,
837,
272,
870,
2,
9029,
12304,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
8443,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
14498,
279,
4171,
22539,
707,
774,
837,
272,
870,
2,
9029,
14498,
292,
76,
4171,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
13321,
279,
4171,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
790,
22539,
707,
774,
837,
272,
870,
2,
9029,
790,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
498,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
1212,
1856,
16709,
22539,
707,
774,
837,
272,
870,
2,
9029,
1212,
1856,
16709,
22539,
707,
6801,
2,
272,
1338,
275,
359,
17,
12,
18,
12,
19,
61,
272,
892,
6550,
275,
359,
17,
12,
18,
12,
19,
12,
17,
61,
272,
372,
334,
22539,
2750,
14,
317,
1856,
16709,
22539,
707,
8,
1459,
12,
17,
9,
508,
892,
6550,
9,
199,
199,
318,
2621,
837,
272,
870,
298,
5815,
26537,
2,
272,
870,
298,
1801,
25890,
6467,
32744,
7393,
1206,
26537,
2,
272,
870,
298,
5815,
26537,
2,
272,
1967,
2925,
275,
378,
272,
1967,
48,
2744,
275,
378,
272,
1967,
2925,
847,
17,
272,
340,
664,
11427,
26935,
837,
267,
870,
1867,
84,
664,
11427,
83,
1379,
510,
2744,
2,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
16459,
22539,
707,
774,
837,
267,
870,
1867,
84,
16459,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
4560,
22504,
22539,
707,
774,
837,
267,
870,
1867,
84,
4560,
22504,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
282,
331,
833,
530,
4171,
22539,
707,
774,
837,
267,
870,
1867,
84,
282,
331,
833,
530,
4171,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
366,
554,
3616,
22539,
707,
774,
837,
267,
870,
1867,
84,
366,
554,
3616,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
790,
22539,
707,
774,
837,
267,
870,
1867,
84,
790,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,
1967,
2925,
847,
413,
272,
340,
12304,
22539,
707,
774,
837,
267,
870,
1867,
84,
282,
331,
833,
530,
4171,
22539,
707,
1379,
510,
2744,
298,
267,
1967,
48,
2744,
847,
413,
339,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
rosenvladimirov/odoo-fixes
|
account_analytic_plans/wizard/__init__.py
|
445
|
1117
|
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import analytic_plan_create_model
import account_crossovered_analytic
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
agpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
199,
3,
259,
7653,
12,
3232,
5800,
8259,
9274,
199,
3,
259,
1898,
334,
35,
9,
8353,
13,
6542,
11947,
12361,
8642,
1014,
921,
9864,
14,
1235,
10121,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
4605,
199,
199,
646,
20705,
63,
5140,
63,
981,
63,
1238,
199,
646,
2933,
63,
7925,
79,
10050,
63,
9782,
199,
199,
3,
6695,
26,
10379,
26,
10558,
26,
6492,
29,
20,
26,
10503,
29,
20,
26,
10425,
29,
20,
26,
421,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
199,
3,
259,
7653,
12,
3232,
5800,
8259,
9274,
199,
3,
259,
1898,
334,
35,
9,
8353,
13,
6542,
11947,
12361,
8642,
1014,
921,
9864,
14,
1235,
10121,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
4605,
199,
199,
646,
20705,
63,
5140,
63,
981,
63,
1238,
199,
646,
2933,
63,
7925,
79,
10050,
63,
9782,
199,
199,
3,
6695,
26,
10379,
26,
10558,
26,
6492,
29,
20,
26,
10503,
29,
20,
26,
10425,
29,
20,
26,
421,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
duqiao/django
|
tests/managers_regress/tests.py
|
264
|
8342
|
from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.template import Context, Template
from django.test import TestCase, override_settings
from django.utils.encoding import force_text
from .models import (
AbstractBase1, AbstractBase2, AbstractBase3, Child1, Child2, Child3,
Child4, Child5, Child6, Child7, RelatedModel, RelationModel,
)
class ManagersRegressionTests(TestCase):
def test_managers(self):
Child1.objects.create(name='fred', data='a1')
Child1.objects.create(name='barney', data='a2')
Child2.objects.create(name='fred', data='b1', value=1)
Child2.objects.create(name='barney', data='b2', value=42)
Child3.objects.create(name='fred', data='c1', comment='yes')
Child3.objects.create(name='barney', data='c2', comment='no')
Child4.objects.create(name='fred', data='d1')
Child4.objects.create(name='barney', data='d2')
Child5.objects.create(name='fred', comment='yes')
Child5.objects.create(name='barney', comment='no')
Child6.objects.create(name='fred', data='f1', value=42)
Child6.objects.create(name='barney', data='f2', value=42)
Child7.objects.create(name='fred')
Child7.objects.create(name='barney')
self.assertQuerysetEqual(Child1.manager1.all(), ["<Child1: a1>"])
self.assertQuerysetEqual(Child1.manager2.all(), ["<Child1: a2>"])
self.assertQuerysetEqual(Child1._default_manager.all(), ["<Child1: a1>"])
self.assertQuerysetEqual(Child2._default_manager.all(), ["<Child2: b1>"])
self.assertQuerysetEqual(Child2.restricted.all(), ["<Child2: b2>"])
self.assertQuerysetEqual(Child3._default_manager.all(), ["<Child3: c1>"])
self.assertQuerysetEqual(Child3.manager1.all(), ["<Child3: c1>"])
self.assertQuerysetEqual(Child3.manager2.all(), ["<Child3: c2>"])
# Since Child6 inherits from Child4, the corresponding rows from f1 and
# f2 also appear here. This is the expected result.
self.assertQuerysetEqual(Child4._default_manager.order_by('data'), [
"<Child4: d1>",
"<Child4: d2>",
"<Child4: f1>",
"<Child4: f2>"
]
)
self.assertQuerysetEqual(Child4.manager1.all(), [
"<Child4: d1>",
"<Child4: f1>"
],
ordered=False
)
self.assertQuerysetEqual(Child5._default_manager.all(), ["<Child5: fred>"])
self.assertQuerysetEqual(Child6._default_manager.all(), ["<Child6: f1>"])
self.assertQuerysetEqual(Child7._default_manager.order_by('name'), [
"<Child7: barney>",
"<Child7: fred>"
]
)
def test_abstract_manager(self):
# Accessing the manager on an abstract model should
# raise an attribute error with an appropriate message.
# This error message isn't ideal, but if the model is abstract and
# a lot of the class instantiation logic isn't invoked; if the
# manager is implied, then we don't get a hook to install the
# error-raising manager.
msg = "type object 'AbstractBase3' has no attribute 'objects'"
with self.assertRaisesMessage(AttributeError, msg):
AbstractBase3.objects.all()
def test_custom_abstract_manager(self):
# Accessing the manager on an abstract model with an custom
# manager should raise an attribute error with an appropriate
# message.
msg = "Manager isn't available; AbstractBase2 is abstract"
with self.assertRaisesMessage(AttributeError, msg):
AbstractBase2.restricted.all()
def test_explicit_abstract_manager(self):
# Accessing the manager on an abstract model with an explicit
# manager should raise an attribute error with an appropriate
# message.
msg = "Manager isn't available; AbstractBase1 is abstract"
with self.assertRaisesMessage(AttributeError, msg):
AbstractBase1.objects.all()
@override_settings(TEST_SWAPPABLE_MODEL='managers_regress.Parent')
def test_swappable_manager(self):
# The models need to be removed after the test in order to prevent bad
# interactions with the flush operation in other tests.
_old_models = apps.app_configs['managers_regress'].models.copy()
try:
class SwappableModel(models.Model):
class Meta:
swappable = 'TEST_SWAPPABLE_MODEL'
# Accessing the manager on a swappable model should
# raise an attribute error with a helpful message
msg = (
"Manager isn't available; 'managers_regress.SwappableModel' "
"has been swapped for 'managers_regress.Parent'"
)
with self.assertRaisesMessage(AttributeError, msg):
SwappableModel.objects.all()
finally:
apps.app_configs['managers_regress'].models = _old_models
apps.all_models['managers_regress'] = _old_models
apps.clear_cache()
@override_settings(TEST_SWAPPABLE_MODEL='managers_regress.Parent')
def test_custom_swappable_manager(self):
# The models need to be removed after the test in order to prevent bad
# interactions with the flush operation in other tests.
_old_models = apps.app_configs['managers_regress'].models.copy()
try:
class SwappableModel(models.Model):
stuff = models.Manager()
class Meta:
swappable = 'TEST_SWAPPABLE_MODEL'
# Accessing the manager on a swappable model with an
# explicit manager should raise an attribute error with a
# helpful message
msg = (
"Manager isn't available; 'managers_regress.SwappableModel' "
"has been swapped for 'managers_regress.Parent'"
)
with self.assertRaisesMessage(AttributeError, msg):
SwappableModel.stuff.all()
finally:
apps.app_configs['managers_regress'].models = _old_models
apps.all_models['managers_regress'] = _old_models
apps.clear_cache()
@override_settings(TEST_SWAPPABLE_MODEL='managers_regress.Parent')
def test_explicit_swappable_manager(self):
# The models need to be removed after the test in order to prevent bad
# interactions with the flush operation in other tests.
_old_models = apps.app_configs['managers_regress'].models.copy()
try:
class SwappableModel(models.Model):
objects = models.Manager()
class Meta:
swappable = 'TEST_SWAPPABLE_MODEL'
# Accessing the manager on a swappable model with an
# explicit manager should raise an attribute error with a
# helpful message
msg = (
"Manager isn't available; 'managers_regress.SwappableModel' "
"has been swapped for 'managers_regress.Parent'"
)
with self.assertRaisesMessage(AttributeError, msg):
SwappableModel.objects.all()
finally:
apps.app_configs['managers_regress'].models = _old_models
apps.all_models['managers_regress'] = _old_models
apps.clear_cache()
def test_regress_3871(self):
related = RelatedModel.objects.create()
relation = RelationModel()
relation.fk = related
relation.gfk = related
relation.save()
relation.m2m.add(related)
t = Template('{{ related.test_fk.all.0 }}{{ related.test_gfk.all.0 }}{{ related.test_m2m.all.0 }}')
self.assertEqual(
t.render(Context({'related': related})),
''.join([force_text(relation.pk)] * 3),
)
def test_field_can_be_called_exact(self):
# Make sure related managers core filters don't include an
# explicit `__exact` lookup that could be interpreted as a
# reference to a foreign `exact` field. refs #23940.
related = RelatedModel.objects.create(exact=False)
relation = related.test_fk.create()
self.assertEqual(related.test_fk.get(), relation)
|
bsd-3-clause
|
[
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
504,
1639,
14,
5181,
492,
8686,
199,
504,
1639,
14,
697,
492,
1709,
199,
504,
1639,
14,
1160,
492,
9470,
12,
5458,
199,
504,
1639,
14,
396,
492,
7640,
12,
4278,
63,
1751,
199,
504,
1639,
14,
1208,
14,
2991,
492,
3542,
63,
505,
199,
199,
504,
1275,
992,
492,
334,
272,
11836,
1563,
17,
12,
11836,
1563,
18,
12,
11836,
1563,
19,
12,
12988,
17,
12,
12988,
18,
12,
12988,
19,
12,
272,
12988,
20,
12,
12988,
21,
12,
12988,
22,
12,
12988,
23,
12,
20116,
1685,
12,
23230,
1685,
12,
199,
9,
421,
199,
533,
4688,
10246,
13013,
2925,
8,
1746,
304,
272,
347,
511,
63,
16259,
8,
277,
304,
267,
12988,
17,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
666,
534,
65,
17,
358,
267,
12988,
17,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
666,
534,
65,
18,
358,
267,
12988,
18,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
666,
534,
66,
17,
297,
574,
29,
17,
9,
267,
12988,
18,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
666,
534,
66,
18,
297,
574,
29,
2260,
9,
267,
12988,
19,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
666,
534,
67,
17,
297,
3721,
534,
5066,
358,
267,
12988,
19,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
666,
534,
67,
18,
297,
3721,
534,
889,
358,
267,
12988,
20,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
666,
534,
68,
17,
358,
267,
12988,
20,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
666,
534,
68,
18,
358,
267,
12988,
21,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
3721,
534,
5066,
358,
267,
12988,
21,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
3721,
534,
889,
358,
267,
12988,
22,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
666,
534,
70,
17,
297,
574,
29,
2260,
9,
267,
12988,
22,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
666,
534,
70,
18,
297,
574,
29,
2260,
9,
267,
12988,
23,
14,
1462,
14,
981,
8,
354,
534,
22980,
358,
267,
12988,
23,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
358,
398,
291,
14,
7108,
8,
3493,
17,
14,
2609,
17,
14,
452,
1062,
24652,
3493,
17,
26,
282,
17,
30,
3135,
267,
291,
14,
7108,
8,
3493,
17,
14,
2609,
18,
14,
452,
1062,
24652,
3493,
17,
26,
282,
18,
30,
3135,
267,
291,
14,
7108,
8,
3493,
17,
423,
885,
63,
2609,
14,
452,
1062,
24652,
3493,
17,
26,
282,
17,
30,
3135,
398,
291,
14,
7108,
8,
3493,
18,
423,
885,
63,
2609,
14,
452,
1062,
24652,
3493,
18,
26,
330,
17,
30,
3135,
267,
291,
14,
7108,
8,
3493,
18,
14,
17973,
14,
452,
1062,
24652,
3493,
18,
26,
330,
18,
30,
3135,
398,
291,
14,
7108,
8,
3493,
19,
423,
885,
63,
2609,
14,
452,
1062,
24652,
3493,
19,
26,
286,
17,
30,
3135,
267,
291,
14,
7108,
8,
3493,
19,
14,
2609,
17,
14,
452,
1062,
24652,
3493,
19,
26,
286,
17,
30,
3135,
267,
291,
14,
7108,
8,
3493,
19,
14,
2609,
18,
14,
452,
1062,
24652,
3493,
19,
26,
286,
18,
30,
3135,
398,
327,
9336,
12988,
22,
21592,
687,
12988,
20,
12,
314,
5226,
4730,
687,
289,
17,
436,
267,
327,
289,
18,
2597,
7468,
2348,
14,
961,
365,
314,
1420,
754,
14,
267,
291,
14,
7108,
8,
3493,
20,
423,
885,
63,
2609,
14,
1648,
63,
991,
360,
576,
659,
359,
288,
3886,
3493,
20,
26,
366,
17,
7166,
288,
3886,
3493,
20,
26,
366,
18,
7166,
288,
3886,
3493,
20,
26,
289,
17,
7166,
288,
3886,
3493,
20,
26,
289,
18,
4335,
267,
1622,
267,
776,
267,
291,
14,
7108,
8,
3493,
20,
14,
2609,
17,
14,
452,
1062,
359,
288,
3886,
3493,
20,
26,
366,
17,
7166,
288,
3886,
3493,
20,
26,
289,
17,
4335,
267,
2156,
288,
7741,
29,
797,
267,
776,
267,
291,
14,
7108,
8,
3493,
21,
423,
885,
63,
2609,
14,
452,
1062,
24652,
3493,
21,
26,
289,
581,
30,
3135,
267,
291,
14,
7108,
8,
3493,
22,
423,
885,
63,
2609,
14,
452,
1062,
24652,
3493,
22,
26,
289,
17,
30,
3135,
267,
291,
14,
7108,
8,
3493,
23,
423,
885,
63,
2609,
14,
1648,
63,
991,
360,
354,
659,
359,
288,
3886,
3493,
23,
26,
4681,
23263,
7166,
288,
3886,
3493,
23,
26,
289,
581,
4335,
267,
1622,
267,
776,
339,
347,
511,
63,
6198,
63,
2609,
8,
277,
304,
267,
327,
11003,
316,
314,
5256,
641,
376,
9006,
1402,
1077,
267,
327,
746,
376,
2225,
1125,
543,
376,
5827,
1245,
14,
267,
327,
961,
1125,
1245,
5712,
1133,
28264,
12,
1325,
340,
314,
1402,
365,
9006,
436,
267,
327,
282,
13918,
402,
314,
1021,
26621,
9661,
5712,
1133,
10302,
27,
340,
314,
267,
327,
5256,
365,
2478,
12,
2066,
781,
2793,
1133,
664,
282,
5759,
370,
3907,
314,
267,
327,
1125,
13,
345,
11136,
5256,
14,
267,
1499,
275,
298,
466,
909,
283,
8458,
1563,
19,
7,
965,
949,
2225,
283,
1462,
4065,
267,
543,
291,
14,
14638,
8,
10227,
12,
1499,
304,
288,
11836,
1563,
19,
14,
1462,
14,
452,
342,
339,
347,
511,
63,
4229,
63,
6198,
63,
2609,
8,
277,
304,
267,
327,
11003,
316,
314,
5256,
641,
376,
9006,
1402,
543,
376,
3537,
267,
327,
5256,
1077,
746,
376,
2225,
1125,
543,
376,
5827,
267,
327,
1245,
14,
267,
1499,
275,
298,
2988,
5712,
1133,
2808,
27,
11836,
1563,
18,
365,
9006,
2,
267,
543,
291,
14,
14638,
8,
10227,
12,
1499,
304,
288,
11836,
1563,
18,
14,
17973,
14,
452,
342,
339,
347,
511,
63,
10306,
63,
6198,
63,
2609,
8,
277,
304,
267,
327,
11003,
316,
314,
5256,
641,
376,
9006,
1402,
543,
376,
5027,
267,
327,
5256,
1077,
746,
376,
2225,
1125,
543,
376,
5827,
267,
327,
1245,
14,
267,
1499,
275,
298,
2988,
5712,
1133,
2808,
27,
11836,
1563,
17,
365,
9006,
2,
267,
543,
291,
14,
14638,
8,
10227,
12,
1499,
304,
288,
11836,
1563,
17,
14,
1462
] |
[
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
504,
1639,
14,
5181,
492,
8686,
199,
504,
1639,
14,
697,
492,
1709,
199,
504,
1639,
14,
1160,
492,
9470,
12,
5458,
199,
504,
1639,
14,
396,
492,
7640,
12,
4278,
63,
1751,
199,
504,
1639,
14,
1208,
14,
2991,
492,
3542,
63,
505,
199,
199,
504,
1275,
992,
492,
334,
272,
11836,
1563,
17,
12,
11836,
1563,
18,
12,
11836,
1563,
19,
12,
12988,
17,
12,
12988,
18,
12,
12988,
19,
12,
272,
12988,
20,
12,
12988,
21,
12,
12988,
22,
12,
12988,
23,
12,
20116,
1685,
12,
23230,
1685,
12,
199,
9,
421,
199,
533,
4688,
10246,
13013,
2925,
8,
1746,
304,
272,
347,
511,
63,
16259,
8,
277,
304,
267,
12988,
17,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
666,
534,
65,
17,
358,
267,
12988,
17,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
666,
534,
65,
18,
358,
267,
12988,
18,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
666,
534,
66,
17,
297,
574,
29,
17,
9,
267,
12988,
18,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
666,
534,
66,
18,
297,
574,
29,
2260,
9,
267,
12988,
19,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
666,
534,
67,
17,
297,
3721,
534,
5066,
358,
267,
12988,
19,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
666,
534,
67,
18,
297,
3721,
534,
889,
358,
267,
12988,
20,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
666,
534,
68,
17,
358,
267,
12988,
20,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
666,
534,
68,
18,
358,
267,
12988,
21,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
3721,
534,
5066,
358,
267,
12988,
21,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
3721,
534,
889,
358,
267,
12988,
22,
14,
1462,
14,
981,
8,
354,
534,
22980,
297,
666,
534,
70,
17,
297,
574,
29,
2260,
9,
267,
12988,
22,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
297,
666,
534,
70,
18,
297,
574,
29,
2260,
9,
267,
12988,
23,
14,
1462,
14,
981,
8,
354,
534,
22980,
358,
267,
12988,
23,
14,
1462,
14,
981,
8,
354,
534,
1700,
23263,
358,
398,
291,
14,
7108,
8,
3493,
17,
14,
2609,
17,
14,
452,
1062,
24652,
3493,
17,
26,
282,
17,
30,
3135,
267,
291,
14,
7108,
8,
3493,
17,
14,
2609,
18,
14,
452,
1062,
24652,
3493,
17,
26,
282,
18,
30,
3135,
267,
291,
14,
7108,
8,
3493,
17,
423,
885,
63,
2609,
14,
452,
1062,
24652,
3493,
17,
26,
282,
17,
30,
3135,
398,
291,
14,
7108,
8,
3493,
18,
423,
885,
63,
2609,
14,
452,
1062,
24652,
3493,
18,
26,
330,
17,
30,
3135,
267,
291,
14,
7108,
8,
3493,
18,
14,
17973,
14,
452,
1062,
24652,
3493,
18,
26,
330,
18,
30,
3135,
398,
291,
14,
7108,
8,
3493,
19,
423,
885,
63,
2609,
14,
452,
1062,
24652,
3493,
19,
26,
286,
17,
30,
3135,
267,
291,
14,
7108,
8,
3493,
19,
14,
2609,
17,
14,
452,
1062,
24652,
3493,
19,
26,
286,
17,
30,
3135,
267,
291,
14,
7108,
8,
3493,
19,
14,
2609,
18,
14,
452,
1062,
24652,
3493,
19,
26,
286,
18,
30,
3135,
398,
327,
9336,
12988,
22,
21592,
687,
12988,
20,
12,
314,
5226,
4730,
687,
289,
17,
436,
267,
327,
289,
18,
2597,
7468,
2348,
14,
961,
365,
314,
1420,
754,
14,
267,
291,
14,
7108,
8,
3493,
20,
423,
885,
63,
2609,
14,
1648,
63,
991,
360,
576,
659,
359,
288,
3886,
3493,
20,
26,
366,
17,
7166,
288,
3886,
3493,
20,
26,
366,
18,
7166,
288,
3886,
3493,
20,
26,
289,
17,
7166,
288,
3886,
3493,
20,
26,
289,
18,
4335,
267,
1622,
267,
776,
267,
291,
14,
7108,
8,
3493,
20,
14,
2609,
17,
14,
452,
1062,
359,
288,
3886,
3493,
20,
26,
366,
17,
7166,
288,
3886,
3493,
20,
26,
289,
17,
4335,
267,
2156,
288,
7741,
29,
797,
267,
776,
267,
291,
14,
7108,
8,
3493,
21,
423,
885,
63,
2609,
14,
452,
1062,
24652,
3493,
21,
26,
289,
581,
30,
3135,
267,
291,
14,
7108,
8,
3493,
22,
423,
885,
63,
2609,
14,
452,
1062,
24652,
3493,
22,
26,
289,
17,
30,
3135,
267,
291,
14,
7108,
8,
3493,
23,
423,
885,
63,
2609,
14,
1648,
63,
991,
360,
354,
659,
359,
288,
3886,
3493,
23,
26,
4681,
23263,
7166,
288,
3886,
3493,
23,
26,
289,
581,
4335,
267,
1622,
267,
776,
339,
347,
511,
63,
6198,
63,
2609,
8,
277,
304,
267,
327,
11003,
316,
314,
5256,
641,
376,
9006,
1402,
1077,
267,
327,
746,
376,
2225,
1125,
543,
376,
5827,
1245,
14,
267,
327,
961,
1125,
1245,
5712,
1133,
28264,
12,
1325,
340,
314,
1402,
365,
9006,
436,
267,
327,
282,
13918,
402,
314,
1021,
26621,
9661,
5712,
1133,
10302,
27,
340,
314,
267,
327,
5256,
365,
2478,
12,
2066,
781,
2793,
1133,
664,
282,
5759,
370,
3907,
314,
267,
327,
1125,
13,
345,
11136,
5256,
14,
267,
1499,
275,
298,
466,
909,
283,
8458,
1563,
19,
7,
965,
949,
2225,
283,
1462,
4065,
267,
543,
291,
14,
14638,
8,
10227,
12,
1499,
304,
288,
11836,
1563,
19,
14,
1462,
14,
452,
342,
339,
347,
511,
63,
4229,
63,
6198,
63,
2609,
8,
277,
304,
267,
327,
11003,
316,
314,
5256,
641,
376,
9006,
1402,
543,
376,
3537,
267,
327,
5256,
1077,
746,
376,
2225,
1125,
543,
376,
5827,
267,
327,
1245,
14,
267,
1499,
275,
298,
2988,
5712,
1133,
2808,
27,
11836,
1563,
18,
365,
9006,
2,
267,
543,
291,
14,
14638,
8,
10227,
12,
1499,
304,
288,
11836,
1563,
18,
14,
17973,
14,
452,
342,
339,
347,
511,
63,
10306,
63,
6198,
63,
2609,
8,
277,
304,
267,
327,
11003,
316,
314,
5256,
641,
376,
9006,
1402,
543,
376,
5027,
267,
327,
5256,
1077,
746,
376,
2225,
1125,
543,
376,
5827,
267,
327,
1245,
14,
267,
1499,
275,
298,
2988,
5712,
1133,
2808,
27,
11836,
1563,
17,
365,
9006,
2,
267,
543,
291,
14,
14638,
8,
10227,
12,
1499,
304,
288,
11836,
1563,
17,
14,
1462,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
hfp/tensorflow-xsmm
|
tensorflow/contrib/learn/python/learn/session_run_hook.py
|
42
|
1334
|
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""This file is deprecated. Use `tensorflow.python.training.session_run_hook`.
See [contrib/learn/README.md](https://www.tensorflow.org/code/tensorflow/contrib/learn/README.md)
for migration instructions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.training import session_run_hook
# pylint: disable=invalid-name
SessionRunHook = session_run_hook.SessionRunHook
SessionRunArgs = session_run_hook.SessionRunArgs
SessionRunContext = session_run_hook.SessionRunContext
SessionRunValues = session_run_hook.SessionRunValues
# pylint: enable=invalid-name
|
apache-2.0
|
[
3,
1898,
7800,
710,
9134,
6642,
14,
2900,
5924,
5702,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
3,
11148,
199,
624,
2765,
570,
365,
5906,
14,
3645,
658,
16008,
14,
1548,
14,
7588,
14,
1730,
63,
1065,
63,
3664,
2313,
199,
199,
9295,
359,
2828,
15,
4643,
15,
18195,
14,
1064,
8738,
2859,
921,
1544,
14,
16008,
14,
1308,
15,
600,
15,
16008,
15,
2828,
15,
4643,
15,
18195,
14,
1064,
9,
199,
509,
8367,
15794,
14,
199,
624,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
4629,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
199,
504,
3228,
14,
1548,
14,
7588,
492,
2351,
63,
1065,
63,
3664,
199,
199,
3,
4287,
26,
3507,
29,
3197,
13,
354,
199,
4434,
2540,
8481,
275,
2351,
63,
1065,
63,
3664,
14,
4434,
2540,
8481,
199,
4434,
2540,
6213,
275,
2351,
63,
1065,
63,
3664,
14,
4434,
2540,
6213,
199,
4434,
2540,
2998,
275,
2351,
63,
1065,
63,
3664,
14,
4434,
2540,
2998,
199,
4434,
2540,
6550,
275,
2351,
63,
1065,
63,
3664,
14,
4434,
2540,
6550,
199,
3,
4287,
26,
4756,
29,
3197,
13,
354,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1898,
7800,
710,
9134,
6642,
14,
2900,
5924,
5702,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
3,
11148,
199,
624,
2765,
570,
365,
5906,
14,
3645,
658,
16008,
14,
1548,
14,
7588,
14,
1730,
63,
1065,
63,
3664,
2313,
199,
199,
9295,
359,
2828,
15,
4643,
15,
18195,
14,
1064,
8738,
2859,
921,
1544,
14,
16008,
14,
1308,
15,
600,
15,
16008,
15,
2828,
15,
4643,
15,
18195,
14,
1064,
9,
199,
509,
8367,
15794,
14,
199,
624,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
4629,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
199,
504,
3228,
14,
1548,
14,
7588,
492,
2351,
63,
1065,
63,
3664,
199,
199,
3,
4287,
26,
3507,
29,
3197,
13,
354,
199,
4434,
2540,
8481,
275,
2351,
63,
1065,
63,
3664,
14,
4434,
2540,
8481,
199,
4434,
2540,
6213,
275,
2351,
63,
1065,
63,
3664,
14,
4434,
2540,
6213,
199,
4434,
2540,
2998,
275,
2351,
63,
1065,
63,
3664,
14,
4434,
2540,
2998,
199,
4434,
2540,
6550,
275,
2351,
63,
1065,
63,
3664,
14,
4434,
2540,
6550,
199,
3,
4287,
26,
4756,
29,
3197,
13,
354,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
glemaitre/UnbalancedDataset
|
imblearn/under_sampling/prototype_generation/cluster_centroids.py
|
2
|
7740
|
"""Class to perform under-sampling by generating centroids based on
clustering."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Fernando Nogueira
# Christos Aridas
# License: MIT
from __future__ import division, print_function
import numpy as np
from scipy import sparse
from sklearn.cluster import KMeans
from sklearn.neighbors import NearestNeighbors
from sklearn.utils import safe_indexing
from ..base import BaseUnderSampler
VOTING_KIND = ('auto', 'hard', 'soft')
class ClusterCentroids(BaseUnderSampler):
"""Perform under-sampling by generating centroids based on
clustering methods.
Method that under samples the majority class by replacing a
cluster of majority samples by the cluster centroid of a KMeans
algorithm. This algorithm keeps N majority samples by fitting the
KMeans algorithm with N cluster to the majority class and using
the coordinates of the N cluster centroids as the new majority
samples.
Read more in the :ref:`User Guide <cluster_centroids>`.
Parameters
----------
ratio : str, dict, or callable, optional (default='auto')
Ratio to use for resampling the data set.
- If ``str``, has to be one of: (i) ``'minority'``: resample the
minority class; (ii) ``'majority'``: resample the majority class,
(iii) ``'not minority'``: resample all classes apart of the minority
class, (iv) ``'all'``: resample all classes, and (v) ``'auto'``:
correspond to ``'all'`` with for over-sampling methods and ``'not
minority'`` for under-sampling methods. The classes targeted will be
over-sampled or under-sampled to achieve an equal number of sample
with the majority or minority class.
- If ``dict``, the keys correspond to the targeted classes. The values
correspond to the desired number of samples.
- If callable, function taking ``y`` and returns a ``dict``. The keys
correspond to the targeted classes. The values correspond to the
desired number of samples.
random_state : int, RandomState instance or None, optional (default=None)
If int, ``random_state`` is the seed used by the random number
generator; If ``RandomState`` instance, random_state is the random
number generator; If ``None``, the random number generator is the
``RandomState`` instance used by ``np.random``.
estimator : object, optional(default=KMeans())
Pass a :class:`sklearn.cluster.KMeans` estimator.
voting : str, optional (default='auto')
Voting strategy to generate the new samples:
- If ``'hard'``, the nearest-neighbors of the centroids found using the
clustering algorithm will be used.
- If ``'soft'``, the centroids found by the clustering algorithm will
be used.
- If ``'auto'``, if the input is sparse, it will default on ``'hard'``
otherwise, ``'soft'`` will be used.
.. versionadded:: 0.3.0
n_jobs : int, optional (default=1)
The number of threads to open if possible.
Notes
-----
Supports mutli-class resampling by sampling each class independently.
See :ref:`sphx_glr_auto_examples_under-sampling_plot_cluster_centroids.py`.
Examples
--------
>>> from collections import Counter
>>> from sklearn.datasets import make_classification
>>> from imblearn.under_sampling import \
ClusterCentroids # doctest: +NORMALIZE_WHITESPACE
>>> X, y = make_classification(n_classes=2, class_sep=2,
... weights=[0.1, 0.9], n_informative=3, n_redundant=1, flip_y=0,
... n_features=20, n_clusters_per_class=1, n_samples=1000, random_state=10)
>>> print('Original dataset shape {}'.format(Counter(y)))
Original dataset shape Counter({1: 900, 0: 100})
>>> cc = ClusterCentroids(random_state=42)
>>> X_res, y_res = cc.fit_sample(X, y)
>>> print('Resampled dataset shape {}'.format(Counter(y_res)))
... # doctest: +ELLIPSIS
Resampled dataset shape Counter({...})
"""
def __init__(self,
ratio='auto',
random_state=None,
estimator=None,
voting='auto',
n_jobs=1):
super(ClusterCentroids, self).__init__(
ratio=ratio)
self.random_state = random_state
self.estimator = estimator
self.voting = voting
self.n_jobs = n_jobs
def _validate_estimator(self):
"""Private function to create the KMeans estimator"""
if self.estimator is None:
self.estimator_ = KMeans(
random_state=self.random_state, n_jobs=self.n_jobs)
elif isinstance(self.estimator, KMeans):
self.estimator_ = self.estimator
else:
raise ValueError('`estimator` has to be a KMeans clustering.'
' Got {} instead.'.format(type(self.estimator)))
def _generate_sample(self, X, y, centroids, target_class):
if self.voting_ == 'hard':
nearest_neighbors = NearestNeighbors(n_neighbors=1)
nearest_neighbors.fit(X, y)
indices = nearest_neighbors.kneighbors(centroids,
return_distance=False)
X_new = safe_indexing(X, np.squeeze(indices))
else:
if sparse.issparse(X):
X_new = sparse.csr_matrix(centroids)
else:
X_new = centroids
y_new = np.array([target_class] * centroids.shape[0])
return X_new, y_new
def _sample(self, X, y):
"""Resample the dataset.
Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Matrix containing the data which have to be sampled.
y : array-like, shape (n_samples,)
Corresponding label for each sample in X.
Returns
-------
X_resampled : {ndarray, sparse matrix}, shape \
(n_samples_new, n_features)
The array containing the resampled data.
y_resampled : ndarray, shape (n_samples_new,)
The corresponding label of `X_resampled`
"""
self._validate_estimator()
if self.voting == 'auto':
if sparse.issparse(X):
self.voting_ = 'hard'
else:
self.voting_ = 'soft'
else:
if self.voting in VOTING_KIND:
self.voting_ = self.voting
else:
raise ValueError("'voting' needs to be one of {}. Got {}"
" instead.".format(VOTING_KIND, self.voting))
X_resampled, y_resampled = [], []
for target_class in np.unique(y):
if target_class in self.ratio_.keys():
n_samples = self.ratio_[target_class]
self.estimator_.set_params(**{'n_clusters': n_samples})
self.estimator_.fit(X[y == target_class])
X_new, y_new = self._generate_sample(
X, y, self.estimator_.cluster_centers_, target_class)
X_resampled.append(X_new)
y_resampled.append(y_new)
else:
target_class_indices = np.flatnonzero(y == target_class)
X_resampled.append(safe_indexing(X, target_class_indices))
y_resampled.append(safe_indexing(y, target_class_indices))
if sparse.issparse(X):
X_resampled = sparse.vstack(X_resampled)
else:
X_resampled = np.vstack(X_resampled)
y_resampled = np.hstack(y_resampled)
return X_resampled, np.array(y_resampled)
|
mit
|
[
624,
2543,
370,
5147,
1334,
13,
17376,
701,
12999,
13345,
26188,
4079,
641,
199,
25802,
1041,
199,
199,
3,
6642,
26,
12436,
6165,
940,
7005,
391,
390,
264,
665,
71,
14,
274,
391,
390,
264,
2010,
32,
6799,
14,
957,
30,
199,
3,
3515,
481,
27569,
22066,
653,
974,
310,
20936,
199,
3,
3515,
2799,
18824,
736,
437,
1677,
305,
199,
3,
844,
26,
10697,
199,
199,
504,
636,
2443,
363,
492,
4629,
12,
870,
63,
1593,
199,
199,
646,
2680,
465,
980,
199,
504,
7026,
492,
5178,
199,
199,
504,
6357,
14,
4201,
492,
1804,
21190,
199,
504,
6357,
14,
11113,
492,
5612,
9540,
20011,
199,
504,
6357,
14,
1208,
492,
5048,
63,
28703,
199,
199,
504,
2508,
1095,
492,
3523,
16001,
27434,
199,
199,
54,
1387,
1206,
63,
43,
3192,
275,
661,
2495,
297,
283,
8726,
297,
283,
4617,
358,
421,
199,
533,
16454,
22744,
26188,
8,
1563,
16001,
27434,
304,
272,
408,
20906,
1334,
13,
17376,
701,
12999,
13345,
26188,
4079,
641,
272,
19454,
3102,
14,
339,
9075,
626,
1334,
5845,
314,
610,
74,
3822,
1021,
701,
15810,
282,
272,
4350,
402,
610,
74,
3822,
5845,
701,
314,
4350,
27587,
402,
282,
1804,
21190,
272,
5563,
14,
221,
961,
5563,
18578,
653,
610,
74,
3822,
5845,
701,
21774,
314,
272,
1804,
21190,
5563,
543,
653,
4350,
370,
314,
610,
74,
3822,
1021,
436,
1808,
272,
314,
8983,
402,
314,
653,
4350,
13345,
26188,
465,
314,
892,
610,
74,
3822,
272,
5845,
14,
339,
5574,
1655,
315,
314,
520,
1121,
1705,
1899,
15423,
665,
4201,
63,
2946,
26188,
14943,
339,
3897,
272,
4143,
272,
10463,
520,
620,
12,
1211,
12,
503,
4550,
12,
2716,
334,
885,
534,
2495,
358,
267,
820,
32736,
370,
675,
367,
522,
23144,
314,
666,
663,
14,
398,
446,
982,
1124,
495,
4542,
965,
370,
506,
1373,
402,
26,
334,
73,
9,
12692,
827,
3822,
14700,
26,
31744,
314,
881,
1748,
3822,
1021,
27,
334,
5908,
9,
12692,
31611,
3822,
14700,
26,
31744,
314,
610,
74,
3822,
1021,
12,
881,
334,
5908,
73,
9,
12692,
1397,
1748,
3822,
14700,
26,
31744,
1006,
3992,
29430,
402,
314,
1748,
3822,
881,
1021,
12,
334,
1003,
9,
12692,
452,
14700,
26,
31744,
1006,
3992,
12,
436,
334,
86,
9,
12692,
2495,
14700,
26,
881,
17118,
370,
12692,
452,
14700,
543,
367,
1806,
13,
17376,
3102,
436,
12692,
1397,
881,
1748,
3822,
14700,
367,
1334,
13,
17376,
3102,
14,
710,
3992,
307,
20174,
911,
506,
881,
1806,
13,
25042,
503,
1334,
13,
25042,
370,
32194,
376,
4472,
1329,
402,
2690,
881,
543,
314,
610,
74,
3822,
503,
1748,
3822,
1021,
14,
267,
446,
982,
1124,
807,
4542,
314,
2883,
17118,
370,
314,
307,
20174,
3992,
14,
710,
1338,
881,
17118,
370,
314,
6387,
1329,
402,
5845,
14,
267,
446,
982,
4550,
12,
805,
16466,
1124,
89,
1040,
436,
2529,
282,
1124,
807,
4345,
710,
2883,
881,
17118,
370,
314,
307,
20174,
3992,
14,
710,
1338,
17118,
370,
314,
881,
6387,
1329,
402,
5845,
14,
339,
2196,
63,
929,
520,
1109,
12,
22233,
1256,
503,
488,
12,
2716,
334,
885,
29,
403,
9,
267,
982,
1109,
12,
1124,
2355,
63,
929,
1040,
365,
314,
6347,
1202,
701,
314,
2196,
1329,
267,
4306,
27,
982,
1124,
15726,
1040,
1256,
12,
2196,
63,
929,
365,
314,
2196,
267,
1329,
4306,
27,
982,
1124,
403,
4542,
314,
2196,
1329,
4306,
365,
314,
267,
1124,
15726,
1040,
1256,
1202,
701,
1124,
1590,
14,
2355,
4345,
339,
8943,
520,
909,
12,
2716,
8,
885,
29,
43,
21190,
1012,
267,
8325,
282,
520,
533,
1705,
27993,
14,
4201,
14,
43,
21190,
64,
8943,
14,
339,
373,
15866,
520,
620,
12,
2716,
334,
885,
534,
2495,
358,
267,
812,
15866,
10054,
370,
3550,
314,
892,
5845,
26,
398,
446,
982,
12692,
8726,
31638,
314,
17173,
13,
11113,
402,
314,
13345,
26188,
1911,
1808,
314,
881,
19454,
5563,
911,
506,
1202,
14,
267,
446,
982,
12692,
4617,
31638,
314,
13345,
26188,
1911,
701,
314,
19454,
5563,
911,
881,
506,
1202,
14,
267,
446,
982,
12692,
2495,
31638,
340,
314,
1324,
365,
5178,
12,
652,
911,
849,
641,
12692,
8726,
14700,
881,
4257,
12,
12692,
4617,
14700,
911,
506,
1202,
14,
398,
2508,
7445,
447,
378,
14,
19,
14,
16,
339,
302,
63,
6920,
520,
1109,
12,
2716,
334,
885,
29,
17,
9,
267,
710,
1329,
402,
7183,
370,
1551,
340,
3962,
14,
339,
8144,
272,
9063,
272,
32090,
8567,
317,
13,
533,
522,
23144,
701,
15877,
1924,
1021,
30426,
14,
339,
1666,
520,
1121,
1705,
7616,
88,
63,
3528,
82,
63,
2495,
63,
8589,
63,
7138,
13,
17376,
63,
2798,
63,
4201,
63,
2946,
26188,
14,
647,
2313,
339,
6058,
272,
3001,
339,
1306,
687,
5055,
492,
14427,
272,
1306,
687,
6357,
14,
12281,
492,
1852,
63,
14368,
272,
1306,
687,
3416,
830,
1060,
14,
7138,
63,
17376,
492,
971,
199,
9581,
22744,
26188,
327,
8868,
26,
435,
10765,
11025,
63,
20620,
272,
1306,
1323,
12,
612,
275,
1852,
63,
14368,
8,
78,
63,
2888,
29,
18,
12,
1021,
63,
4127,
29,
18,
12,
272,
2263,
4931,
1524,
16,
14,
17,
12,
378,
14,
25,
467,
302,
63,
27666,
29,
19,
12,
302,
63,
581,
17013,
29,
17,
12,
18761,
63,
89,
29,
16,
12,
272,
2263,
302,
63,
3179,
29,
1165,
12,
302,
63,
9170,
63,
529,
63,
533,
29,
17,
12,
302,
63,
3356,
29,
5279,
12,
2196,
63,
929,
29,
709,
9,
272,
1306,
870,
360,
17286,
4789,
2215,
9499,
908,
8,
11348,
8,
89,
1724,
272,
12769,
4789,
2215,
14427,
2561,
17,
26,
27151,
12,
378,
26,
2948,
1552,
272,
1306,
7429,
275,
16454,
22744,
26188,
8,
2355,
63,
929,
29,
2260,
9,
272,
1306,
1323,
63,
470,
12,
612,
63,
470,
275,
7429,
14,
3269,
63,
3271,
8,
56,
12,
612,
9,
272,
1306,
870,
360,
1322,
865,
68,
4789,
2215,
9499,
908,
8,
11348,
8,
89,
63,
470,
1724,
272,
2263,
327,
8868,
26,
435,
21677,
272,
3591,
865,
68,
4789,
2215,
14427,
2561,
1396,
1552,
339,
408,
339,
347,
636,
826,
721,
277,
12,
326,
10463,
534,
2495,
297,
326,
2196,
63,
929,
29,
403,
12,
326,
8943,
29,
403,
12,
326,
373,
15866
] |
[
2543,
370,
5147,
1334,
13,
17376,
701,
12999,
13345,
26188,
4079,
641,
199,
25802,
1041,
199,
199,
3,
6642,
26,
12436,
6165,
940,
7005,
391,
390,
264,
665,
71,
14,
274,
391,
390,
264,
2010,
32,
6799,
14,
957,
30,
199,
3,
3515,
481,
27569,
22066,
653,
974,
310,
20936,
199,
3,
3515,
2799,
18824,
736,
437,
1677,
305,
199,
3,
844,
26,
10697,
199,
199,
504,
636,
2443,
363,
492,
4629,
12,
870,
63,
1593,
199,
199,
646,
2680,
465,
980,
199,
504,
7026,
492,
5178,
199,
199,
504,
6357,
14,
4201,
492,
1804,
21190,
199,
504,
6357,
14,
11113,
492,
5612,
9540,
20011,
199,
504,
6357,
14,
1208,
492,
5048,
63,
28703,
199,
199,
504,
2508,
1095,
492,
3523,
16001,
27434,
199,
199,
54,
1387,
1206,
63,
43,
3192,
275,
661,
2495,
297,
283,
8726,
297,
283,
4617,
358,
421,
199,
533,
16454,
22744,
26188,
8,
1563,
16001,
27434,
304,
272,
408,
20906,
1334,
13,
17376,
701,
12999,
13345,
26188,
4079,
641,
272,
19454,
3102,
14,
339,
9075,
626,
1334,
5845,
314,
610,
74,
3822,
1021,
701,
15810,
282,
272,
4350,
402,
610,
74,
3822,
5845,
701,
314,
4350,
27587,
402,
282,
1804,
21190,
272,
5563,
14,
221,
961,
5563,
18578,
653,
610,
74,
3822,
5845,
701,
21774,
314,
272,
1804,
21190,
5563,
543,
653,
4350,
370,
314,
610,
74,
3822,
1021,
436,
1808,
272,
314,
8983,
402,
314,
653,
4350,
13345,
26188,
465,
314,
892,
610,
74,
3822,
272,
5845,
14,
339,
5574,
1655,
315,
314,
520,
1121,
1705,
1899,
15423,
665,
4201,
63,
2946,
26188,
14943,
339,
3897,
272,
4143,
272,
10463,
520,
620,
12,
1211,
12,
503,
4550,
12,
2716,
334,
885,
534,
2495,
358,
267,
820,
32736,
370,
675,
367,
522,
23144,
314,
666,
663,
14,
398,
446,
982,
1124,
495,
4542,
965,
370,
506,
1373,
402,
26,
334,
73,
9,
12692,
827,
3822,
14700,
26,
31744,
314,
881,
1748,
3822,
1021,
27,
334,
5908,
9,
12692,
31611,
3822,
14700,
26,
31744,
314,
610,
74,
3822,
1021,
12,
881,
334,
5908,
73,
9,
12692,
1397,
1748,
3822,
14700,
26,
31744,
1006,
3992,
29430,
402,
314,
1748,
3822,
881,
1021,
12,
334,
1003,
9,
12692,
452,
14700,
26,
31744,
1006,
3992,
12,
436,
334,
86,
9,
12692,
2495,
14700,
26,
881,
17118,
370,
12692,
452,
14700,
543,
367,
1806,
13,
17376,
3102,
436,
12692,
1397,
881,
1748,
3822,
14700,
367,
1334,
13,
17376,
3102,
14,
710,
3992,
307,
20174,
911,
506,
881,
1806,
13,
25042,
503,
1334,
13,
25042,
370,
32194,
376,
4472,
1329,
402,
2690,
881,
543,
314,
610,
74,
3822,
503,
1748,
3822,
1021,
14,
267,
446,
982,
1124,
807,
4542,
314,
2883,
17118,
370,
314,
307,
20174,
3992,
14,
710,
1338,
881,
17118,
370,
314,
6387,
1329,
402,
5845,
14,
267,
446,
982,
4550,
12,
805,
16466,
1124,
89,
1040,
436,
2529,
282,
1124,
807,
4345,
710,
2883,
881,
17118,
370,
314,
307,
20174,
3992,
14,
710,
1338,
17118,
370,
314,
881,
6387,
1329,
402,
5845,
14,
339,
2196,
63,
929,
520,
1109,
12,
22233,
1256,
503,
488,
12,
2716,
334,
885,
29,
403,
9,
267,
982,
1109,
12,
1124,
2355,
63,
929,
1040,
365,
314,
6347,
1202,
701,
314,
2196,
1329,
267,
4306,
27,
982,
1124,
15726,
1040,
1256,
12,
2196,
63,
929,
365,
314,
2196,
267,
1329,
4306,
27,
982,
1124,
403,
4542,
314,
2196,
1329,
4306,
365,
314,
267,
1124,
15726,
1040,
1256,
1202,
701,
1124,
1590,
14,
2355,
4345,
339,
8943,
520,
909,
12,
2716,
8,
885,
29,
43,
21190,
1012,
267,
8325,
282,
520,
533,
1705,
27993,
14,
4201,
14,
43,
21190,
64,
8943,
14,
339,
373,
15866,
520,
620,
12,
2716,
334,
885,
534,
2495,
358,
267,
812,
15866,
10054,
370,
3550,
314,
892,
5845,
26,
398,
446,
982,
12692,
8726,
31638,
314,
17173,
13,
11113,
402,
314,
13345,
26188,
1911,
1808,
314,
881,
19454,
5563,
911,
506,
1202,
14,
267,
446,
982,
12692,
4617,
31638,
314,
13345,
26188,
1911,
701,
314,
19454,
5563,
911,
881,
506,
1202,
14,
267,
446,
982,
12692,
2495,
31638,
340,
314,
1324,
365,
5178,
12,
652,
911,
849,
641,
12692,
8726,
14700,
881,
4257,
12,
12692,
4617,
14700,
911,
506,
1202,
14,
398,
2508,
7445,
447,
378,
14,
19,
14,
16,
339,
302,
63,
6920,
520,
1109,
12,
2716,
334,
885,
29,
17,
9,
267,
710,
1329,
402,
7183,
370,
1551,
340,
3962,
14,
339,
8144,
272,
9063,
272,
32090,
8567,
317,
13,
533,
522,
23144,
701,
15877,
1924,
1021,
30426,
14,
339,
1666,
520,
1121,
1705,
7616,
88,
63,
3528,
82,
63,
2495,
63,
8589,
63,
7138,
13,
17376,
63,
2798,
63,
4201,
63,
2946,
26188,
14,
647,
2313,
339,
6058,
272,
3001,
339,
1306,
687,
5055,
492,
14427,
272,
1306,
687,
6357,
14,
12281,
492,
1852,
63,
14368,
272,
1306,
687,
3416,
830,
1060,
14,
7138,
63,
17376,
492,
971,
199,
9581,
22744,
26188,
327,
8868,
26,
435,
10765,
11025,
63,
20620,
272,
1306,
1323,
12,
612,
275,
1852,
63,
14368,
8,
78,
63,
2888,
29,
18,
12,
1021,
63,
4127,
29,
18,
12,
272,
2263,
4931,
1524,
16,
14,
17,
12,
378,
14,
25,
467,
302,
63,
27666,
29,
19,
12,
302,
63,
581,
17013,
29,
17,
12,
18761,
63,
89,
29,
16,
12,
272,
2263,
302,
63,
3179,
29,
1165,
12,
302,
63,
9170,
63,
529,
63,
533,
29,
17,
12,
302,
63,
3356,
29,
5279,
12,
2196,
63,
929,
29,
709,
9,
272,
1306,
870,
360,
17286,
4789,
2215,
9499,
908,
8,
11348,
8,
89,
1724,
272,
12769,
4789,
2215,
14427,
2561,
17,
26,
27151,
12,
378,
26,
2948,
1552,
272,
1306,
7429,
275,
16454,
22744,
26188,
8,
2355,
63,
929,
29,
2260,
9,
272,
1306,
1323,
63,
470,
12,
612,
63,
470,
275,
7429,
14,
3269,
63,
3271,
8,
56,
12,
612,
9,
272,
1306,
870,
360,
1322,
865,
68,
4789,
2215,
9499,
908,
8,
11348,
8,
89,
63,
470,
1724,
272,
2263,
327,
8868,
26,
435,
21677,
272,
3591,
865,
68,
4789,
2215,
14427,
2561,
1396,
1552,
339,
408,
339,
347,
636,
826,
721,
277,
12,
326,
10463,
534,
2495,
297,
326,
2196,
63,
929,
29,
403,
12,
326,
8943,
29,
403,
12,
326,
373,
15866,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
noba3/KoTos
|
addons/plugin.video.mega/resources/lib/platform_libraries/Linux/arm/Crypto/Hash/SHA.py
|
123
|
2841
|
# -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to exercise all rights associated with the
# contents of this file for any purpose whatsoever.
# No rights are reserved.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# ===================================================================
"""SHA-1 cryptographic hash algorithm.
SHA-1_ produces the 160 bit digest of a message.
>>> from Crypto.Hash import SHA
>>>
>>> h = SHA.new()
>>> h.update(b'Hello')
>>> print h.hexdigest()
*SHA* stands for Secure Hash Algorithm.
This algorithm is not considered secure. Do not use it for new designs.
.. _SHA-1: http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
"""
_revision__ = "$Id$"
__all__ = ['new', 'digest_size', 'SHA1Hash' ]
from Crypto.Util.py3compat import *
from Crypto.Hash.hashalgo import HashAlgo
try:
# The sha module is deprecated in Python 2.6, so use hashlib when possible.
import hashlib
hashFactory = hashlib.sha1
except ImportError:
import sha
hashFactory = sha
class SHA1Hash(HashAlgo):
"""Class that implements a SHA-1 hash
:undocumented: block_size
"""
#: ASN.1 Object identifier (OID)::
#:
#: id-sha1 OBJECT IDENTIFIER ::= {
#: iso(1) identified-organization(3) oiw(14) secsig(3)
#: algorithms(2) 26
#: }
#:
#: This value uniquely identifies the SHA-1 algorithm.
oid = b('\x06\x05\x2b\x0e\x03\x02\x1a')
digest_size = 20
block_size = 64
def __init__(self, data=None):
HashAlgo.__init__(self, hashFactory, data)
def new(self, data=None):
return SHA1Hash(data)
def new(data=None):
"""Return a fresh instance of the hash object.
:Parameters:
data : byte string
The very first chunk of the message to hash.
It is equivalent to an early call to `SHA1Hash.update()`.
Optional.
:Return: A `SHA1Hash` object
"""
return SHA1Hash().new(data)
#: The size of the resulting hash in bytes.
digest_size = SHA1Hash.digest_size
#: The internal block size of the hash algorithm in bytes.
block_size = SHA1Hash.block_size
|
gpl-2.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
7819,
389,
199,
3,
710,
4072,
402,
642,
570,
787,
29711,
370,
314,
4575,
2881,
14,
221,
4005,
199,
3,
314,
13675,
626,
477,
21171,
370,
314,
4575,
2881,
365,
440,
2808,
12,
199,
3,
4036,
368,
365,
10009,
282,
6701,
13062,
12,
1126,
321,
1688,
12,
882,
89,
13248,
13,
4624,
12,
199,
3,
2222,
13,
12730,
4190,
370,
26511,
1006,
4481,
4568,
543,
314,
199,
3,
4072,
402,
642,
570,
367,
1263,
12016,
4052,
1152,
5907,
14,
199,
3,
3091,
4481,
787,
4644,
14,
199,
3,
199,
3,
2334,
4141,
2281,
7049,
298,
1179,
2281,
401,
2428,
3408,
1634,
1821,
3826,
12,
199,
3,
7168,
1549,
5292,
12,
6931,
5400,
2845,
5471,
2296,
2334,
2990,
1634,
199,
3,
3169,
12,
3092,
2381,
437,
3115,
3104,
2401,
199,
3,
13229,
14,
1621,
4825,
6461,
7000,
2334,
10610,
1549,
5877,
8164,
199,
3,
6262,
7024,
2381,
1821,
13140,
12,
6736,
1549,
5010,
5603,
12,
7061,
1621,
1261,
199,
3,
9612,
1634,
7066,
12,
7056,
1549,
7334,
12,
7043,
4442,
12,
5738,
1634,
1549,
1621,
199,
3,
11287,
1663,
2334,
4141,
1549,
2334,
4815,
1549,
5010,
13198,
1621,
2334,
199,
3,
4141,
14,
199,
3,
7819,
389,
199,
199,
624,
8461,
13,
17,
13230,
9770,
2631,
5563,
14,
199,
199,
8461,
13,
17,
63,
16904,
314,
21235,
4546,
10017,
402,
282,
1245,
14,
339,
1306,
687,
18855,
14,
3476,
492,
12002,
272,
1306,
272,
1306,
394,
275,
12002,
14,
1222,
342,
272,
1306,
394,
14,
873,
8,
66,
7,
6257,
358,
272,
1306,
870,
394,
14,
11453,
342,
199,
199,
10,
8461,
10,
410,
5915,
367,
30894,
16101,
23823,
14,
199,
199,
2765,
5563,
365,
440,
8652,
11153,
14,
4226,
440,
675,
652,
367,
892,
477,
20440,
14,
199,
199,
703,
485,
8461,
13,
17,
26,
1455,
921,
1259,
1195,
14,
78,
631,
14,
16294,
15,
27190,
15,
329,
1190,
15,
329,
1190,
7663,
13,
18,
15,
329,
1190,
7663,
13,
18,
14,
5607,
199,
624,
199,
199,
63,
5792,
363,
275,
7880,
1304,
17351,
199,
199,
363,
452,
363,
275,
788,
1222,
297,
283,
5671,
63,
890,
297,
283,
8461,
17,
3476,
7,
1622,
199,
199,
504,
18855,
14,
9562,
14,
647,
19,
5819,
492,
627,
199,
504,
18855,
14,
3476,
14,
2227,
21734,
492,
16101,
2439,
1939,
199,
199,
893,
26,
272,
327,
710,
7793,
859,
365,
5906,
315,
2018,
499,
14,
22,
12,
880,
675,
8337,
1380,
3962,
14,
272,
492,
8337,
272,
2631,
2927,
275,
8337,
14,
4835,
17,
199,
199,
2590,
3545,
26,
272,
492,
7793,
272,
2631,
2927,
275,
7793,
199,
199,
533,
12002,
17,
3476,
8,
3476,
2439,
1939,
304,
272,
408,
2543,
626,
9031,
282,
12002,
13,
17,
2631,
2286,
520,
30107,
12546,
26,
1853,
63,
890,
272,
408,
339,
6079,
31139,
14,
17,
6935,
5148,
334,
16337,
304,
26,
272,
6079,
272,
6079,
221,
1305,
13,
4835,
17,
259,
28652,
5550,
26179,
16910,
11351,
469,
272,
6079,
420,
11601,
8,
17,
9,
15836,
13,
9071,
8,
19,
9,
312,
73,
87,
8,
1079,
9,
6513,
4093,
8,
19,
9,
272,
6079,
755,
18036,
8,
18,
9,
7875,
272,
6079,
221,
789,
272,
6079,
272,
6079,
961,
574,
28727,
22975,
314,
12002,
13,
17,
5563,
14,
272,
20109,
275,
330,
2258,
88,
1690,
60,
88,
1717,
60,
88,
18,
66,
60,
88,
16,
69,
60,
88,
1644,
60,
88,
996,
60,
88,
17,
65,
358,
339,
10017,
63,
890,
275,
3388,
272,
1853,
63,
890,
275,
5049,
339,
347,
636,
826,
721,
277,
12,
666,
29,
403,
304,
267,
16101,
2439,
1939,
855,
826,
721,
277,
12,
2631,
2927,
12,
666,
9,
339,
347,
892,
8,
277,
12,
666,
29,
403,
304,
267,
372,
12002,
17,
3476,
8,
576,
9,
199,
199,
318,
892,
8,
576,
29,
403,
304,
272,
408,
1767,
282,
17480,
1256,
402,
314,
2631,
909,
14,
339,
520,
5976,
26,
2126,
666,
520,
3696,
1059,
267,
710,
7437,
1642,
3728,
402,
314,
1245,
370,
2631,
14,
267,
2779,
365,
7353,
370,
376,
14670,
1240,
370,
658,
8461,
17,
3476,
14,
873,
25593,
267,
4879,
14,
339,
520,
1767,
26,
437,
658,
8461,
17,
3476,
64,
909,
272,
408,
272,
372,
12002,
17,
3476,
1252,
1222,
8,
576,
9,
199,
199,
12573,
710,
1568,
402,
314,
9183,
2631,
315,
2783,
14,
199,
5671,
63,
890,
275,
12002,
17,
3476,
14,
5671,
63,
890,
199,
199,
12573,
710,
5007,
1853,
1568,
402,
314,
2631,
5563,
315,
2783,
14,
199,
1457,
63,
890,
275,
12002,
17,
3476,
14,
1457,
63,
890,
4388,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
7819,
389,
199,
3,
710,
4072,
402,
642,
570,
787,
29711,
370,
314,
4575,
2881,
14,
221,
4005,
199,
3,
314,
13675,
626,
477,
21171,
370,
314,
4575,
2881,
365,
440,
2808,
12,
199,
3,
4036,
368,
365,
10009,
282,
6701,
13062,
12,
1126,
321,
1688,
12,
882,
89,
13248,
13,
4624,
12,
199,
3,
2222,
13,
12730,
4190,
370,
26511,
1006,
4481,
4568,
543,
314,
199,
3,
4072,
402,
642,
570,
367,
1263,
12016,
4052,
1152,
5907,
14,
199,
3,
3091,
4481,
787,
4644,
14,
199,
3,
199,
3,
2334,
4141,
2281,
7049,
298,
1179,
2281,
401,
2428,
3408,
1634,
1821,
3826,
12,
199,
3,
7168,
1549,
5292,
12,
6931,
5400,
2845,
5471,
2296,
2334,
2990,
1634,
199,
3,
3169,
12,
3092,
2381,
437,
3115,
3104,
2401,
199,
3,
13229,
14,
1621,
4825,
6461,
7000,
2334,
10610,
1549,
5877,
8164,
199,
3,
6262,
7024,
2381,
1821,
13140,
12,
6736,
1549,
5010,
5603,
12,
7061,
1621,
1261,
199,
3,
9612,
1634,
7066,
12,
7056,
1549,
7334,
12,
7043,
4442,
12,
5738,
1634,
1549,
1621,
199,
3,
11287,
1663,
2334,
4141,
1549,
2334,
4815,
1549,
5010,
13198,
1621,
2334,
199,
3,
4141,
14,
199,
3,
7819,
389,
199,
199,
624,
8461,
13,
17,
13230,
9770,
2631,
5563,
14,
199,
199,
8461,
13,
17,
63,
16904,
314,
21235,
4546,
10017,
402,
282,
1245,
14,
339,
1306,
687,
18855,
14,
3476,
492,
12002,
272,
1306,
272,
1306,
394,
275,
12002,
14,
1222,
342,
272,
1306,
394,
14,
873,
8,
66,
7,
6257,
358,
272,
1306,
870,
394,
14,
11453,
342,
199,
199,
10,
8461,
10,
410,
5915,
367,
30894,
16101,
23823,
14,
199,
199,
2765,
5563,
365,
440,
8652,
11153,
14,
4226,
440,
675,
652,
367,
892,
477,
20440,
14,
199,
199,
703,
485,
8461,
13,
17,
26,
1455,
921,
1259,
1195,
14,
78,
631,
14,
16294,
15,
27190,
15,
329,
1190,
15,
329,
1190,
7663,
13,
18,
15,
329,
1190,
7663,
13,
18,
14,
5607,
199,
624,
199,
199,
63,
5792,
363,
275,
7880,
1304,
17351,
199,
199,
363,
452,
363,
275,
788,
1222,
297,
283,
5671,
63,
890,
297,
283,
8461,
17,
3476,
7,
1622,
199,
199,
504,
18855,
14,
9562,
14,
647,
19,
5819,
492,
627,
199,
504,
18855,
14,
3476,
14,
2227,
21734,
492,
16101,
2439,
1939,
199,
199,
893,
26,
272,
327,
710,
7793,
859,
365,
5906,
315,
2018,
499,
14,
22,
12,
880,
675,
8337,
1380,
3962,
14,
272,
492,
8337,
272,
2631,
2927,
275,
8337,
14,
4835,
17,
199,
199,
2590,
3545,
26,
272,
492,
7793,
272,
2631,
2927,
275,
7793,
199,
199,
533,
12002,
17,
3476,
8,
3476,
2439,
1939,
304,
272,
408,
2543,
626,
9031,
282,
12002,
13,
17,
2631,
2286,
520,
30107,
12546,
26,
1853,
63,
890,
272,
408,
339,
6079,
31139,
14,
17,
6935,
5148,
334,
16337,
304,
26,
272,
6079,
272,
6079,
221,
1305,
13,
4835,
17,
259,
28652,
5550,
26179,
16910,
11351,
469,
272,
6079,
420,
11601,
8,
17,
9,
15836,
13,
9071,
8,
19,
9,
312,
73,
87,
8,
1079,
9,
6513,
4093,
8,
19,
9,
272,
6079,
755,
18036,
8,
18,
9,
7875,
272,
6079,
221,
789,
272,
6079,
272,
6079,
961,
574,
28727,
22975,
314,
12002,
13,
17,
5563,
14,
272,
20109,
275,
330,
2258,
88,
1690,
60,
88,
1717,
60,
88,
18,
66,
60,
88,
16,
69,
60,
88,
1644,
60,
88,
996,
60,
88,
17,
65,
358,
339,
10017,
63,
890,
275,
3388,
272,
1853,
63,
890,
275,
5049,
339,
347,
636,
826,
721,
277,
12,
666,
29,
403,
304,
267,
16101,
2439,
1939,
855,
826,
721,
277,
12,
2631,
2927,
12,
666,
9,
339,
347,
892,
8,
277,
12,
666,
29,
403,
304,
267,
372,
12002,
17,
3476,
8,
576,
9,
199,
199,
318,
892,
8,
576,
29,
403,
304,
272,
408,
1767,
282,
17480,
1256,
402,
314,
2631,
909,
14,
339,
520,
5976,
26,
2126,
666,
520,
3696,
1059,
267,
710,
7437,
1642,
3728,
402,
314,
1245,
370,
2631,
14,
267,
2779,
365,
7353,
370,
376,
14670,
1240,
370,
658,
8461,
17,
3476,
14,
873,
25593,
267,
4879,
14,
339,
520,
1767,
26,
437,
658,
8461,
17,
3476,
64,
909,
272,
408,
272,
372,
12002,
17,
3476,
1252,
1222,
8,
576,
9,
199,
199,
12573,
710,
1568,
402,
314,
9183,
2631,
315,
2783,
14,
199,
5671,
63,
890,
275,
12002,
17,
3476,
14,
5671,
63,
890,
199,
199,
12573,
710,
5007,
1853,
1568,
402,
314,
2631,
5563,
315,
2783,
14,
199,
1457,
63,
890,
275,
12002,
17,
3476,
14,
1457,
63,
890,
4388,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
kopiro/titanium_mobile
|
support/iphone/tools.py
|
34
|
8313
|
import os, sys, codecs, shutil, filecmp, subprocess
# the template_dir is the path where this file lives on disk
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
def ensure_dev_path(debug=True):
rc = subprocess.call(["xcode-select", "-print-path"], stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'))
if rc == 0 :
return
if debug:
print '[INFO] XCode 4.3+ likely. Searching for developer folders.'
trypath = '/Developer'
if os.path.isdir(trypath):
os.putenv('DEVELOPER_DIR',trypath)
return
trypath = '/Applications/Xcode.app/Contents/Developer'
if os.path.isdir(trypath):
os.putenv('DEVELOPER_DIR',trypath)
return
spotlight_args = ['mdfind','kMDItemDisplayName==Xcode&&kMDItemKind==Application']
spotlight = subprocess.Popen(spotlight_args, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
for line in spotlight.stdout.readlines():
trypath = line.rstrip()+'/Contents/Developer'
if os.path.isdir(trypath):
os.putenv('DEVELOPER_DIR',trypath)
return
def read_config(f):
props = {}
if os.path.exists(f):
contents = open(f).read()
for line in contents.splitlines(False):
if line[0:1]=='#': continue
(k,v) = line.split("=")
props[k]=v
return props
def locate_modules(modules, project_dir, assets_dest_dir, log):
module_lib_search_path = []
module_asset_dirs = []
for module in modules:
if module.js:
# Skip CommonJS modules. These will be processed in a later pass.
continue
module_id = module.manifest.moduleid.lower()
module_version = module.manifest.version
module_lib_name = ('lib%s.a' % module_id).lower()
# check first in the local project
local_module_lib = os.path.join(project_dir, 'modules', 'iphone', module_lib_name)
local = False
if os.path.exists(local_module_lib):
module_lib_search_path.append([module_lib_name, local_module_lib])
local = True
log("[INFO] Detected (local) third-party module: %s" % (local_module_lib))
else:
if module.lib is None:
module_lib_path = module.get_resource(module_lib_name)
log("[ERROR] Third-party module: %s/%s missing library at %s" % (module_id, module_version, module_lib_path))
sys.exit(1)
module_lib_search_path.append([module_lib_name, os.path.abspath(module.lib).rsplit('/',1)[0]])
log("[INFO] Detected third-party module: %s/%s" % (module_id, module_version))
if not local:
# copy module resources
img_dir = module.get_resource('assets', 'images')
if os.path.exists(img_dir):
dest_img_dir = os.path.join(assets_dest_dir, 'modules', module_id, 'images')
if not os.path.exists(dest_img_dir):
os.makedirs(dest_img_dir)
module_asset_dirs.append([img_dir, dest_img_dir])
# copy in any module assets
module_assets_dir = module.get_resource('assets')
if os.path.exists(module_assets_dir):
module_dir = os.path.join(assets_dest_dir, 'modules', module_id)
module_asset_dirs.append([module_assets_dir, module_dir])
return module_lib_search_path, module_asset_dirs
def link_modules(modules, name, proj_dir, relative=False):
if len(modules)>0:
from pbxproj import PBXProj
proj = PBXProj()
xcode_proj = os.path.join(proj_dir,'%s.xcodeproj'%name,'project.pbxproj')
current_xcode = open(xcode_proj).read()
for tp in modules:
proj.add_static_library(tp[0], tp[1], relative)
out = proj.parse(xcode_proj)
# since xcode changes can be destructive, only write as necessary (if changed)
if current_xcode!=out:
xo = open(xcode_proj, 'w')
xo.write(out)
xo.close()
def create_info_plist(tiapp, template_dir, project_dir, output):
def write_info_plist(infoplist_tmpl):
name = tiapp.properties['name']
appid = tiapp.properties['id']
plist = codecs.open(infoplist_tmpl, encoding='utf-8').read()
plist = plist.replace('__PROJECT_NAME__',name)
plist = plist.replace('__PROJECT_ID__',appid)
plist = plist.replace('__URL__',appid)
urlscheme = name.replace('.','_').replace(' ','').lower()
plist = plist.replace('__URLSCHEME__',urlscheme)
if tiapp.has_app_property('ti.facebook.appid'):
fbid = tiapp.get_app_property('ti.facebook.appid')
plist = plist.replace('__ADDITIONAL_URL_SCHEMES__', '<string>fb%s</string>' % fbid)
else:
plist = plist.replace('__ADDITIONAL_URL_SCHEMES__','')
pf = codecs.open(output,'w', encoding='utf-8')
pf.write(plist)
pf.close()
# if the user has a Info.plist in their project directory, consider
# that a custom override
infoplist_tmpl = os.path.join(project_dir,'Info.plist')
if os.path.exists(infoplist_tmpl):
shutil.copy(infoplist_tmpl,output)
else:
infoplist_tmpl = os.path.join(template_dir,'Info.plist')
write_info_plist(infoplist_tmpl)
def write_debugger_plist(debughost, debugport, debugairkey, debughosts, template_dir, debuggerplist):
debugger_tmpl = os.path.join(template_dir,'debugger.plist')
plist = codecs.open(debugger_tmpl, encoding='utf-8').read()
if debughost:
plist = plist.replace('__DEBUGGER_HOST__',debughost)
plist = plist.replace('__DEBUGGER_PORT__',debugport)
else:
plist = plist.replace('__DEBUGGER_HOST__','')
plist = plist.replace('__DEBUGGER_PORT__','')
if debugairkey:
plist = plist.replace('__DEBUGGER_AIRKEY__',debugairkey)
else:
plist = plist.replace('__DEBUGGER_AIRKEY__','')
if debughosts:
plist = plist.replace('__DEBUGGER_HOSTS__',debughosts)
else:
plist = plist.replace('__DEBUGGER_HOSTS__','')
tempfile = debuggerplist+'.tmp'
pf = codecs.open(tempfile,'w',encoding='utf-8')
pf.write(plist)
pf.close()
if os.path.exists(debuggerplist):
changed = not filecmp.cmp(tempfile, debuggerplist, shallow=False)
else:
changed = True
shutil.move(tempfile, debuggerplist)
return changed
def install_default(image, project_dir, template_dir, dest):
project_resources = os.path.join(project_dir, 'Resources')
platform_resources = os.path.join(project_resources, 'iphone')
template_resources = os.path.join(template_dir, 'resources')
if image is not None:
graphic_path = os.path.join(platform_resources,image)
else:
graphic_path = os.path.join(template_resources, image)
if not os.path.exists(graphic_path):
graphic_path = os.path.join(project_resources,image)
if not os.path.exists(graphic_path):
graphic_path = os.path.join(template_resources,image)
if os.path.exists(graphic_path):
dest_graphic_path = os.path.join(dest,image)
if os.path.exists(dest_graphic_path):
os.remove(dest_graphic_path)
shutil.copy(graphic_path, dest)
def install_logo(tiapp, applogo, project_dir, template_dir, dest):
# copy over the appicon
if applogo==None and tiapp.properties.has_key('icon'):
applogo = tiapp.properties['icon']
install_default(applogo, project_dir, template_dir, dest)
def install_defaults(project_dir, template_dir, dest):
for graphic in os.listdir(os.path.join(template_dir, 'resources')):
install_default(graphic, project_dir, template_dir, dest)
def fix_xcode_script(content,script_name,script_contents):
# fix up xcode compile scripts in build phase
start = 0
while start >= 0:
start = content.find("name = \"%s\";" % script_name, start)
if start > 0:
begin = content.find("shellScript = ",start)
if begin > 0:
end = content.find("};",begin+1)
if end > 0:
before = content[0:begin+15]
after = content[end:]
script = "%s\";\n " % script_contents
content = before + script + after
start = begin
return content
SPLICE_START_MARKER="TI_AUTOGEN_BEGIN"
SPLICE_END_MARKER="TI_AUTOGEN_END"
def splice_code(file, section, replacement):
if not os.path.exists(file):
return False
with open(file, 'r') as fd:
contents = fd.read()
# want to preserve this as part of the preamble
start_search = "//##%s %s" % (SPLICE_START_MARKER, section)
start_marker = contents.find(start_search)
if start_marker == -1:
return False
end_marker = contents.find("//##%s %s" % (SPLICE_END_MARKER, section), start_marker)
if end_marker == -1:
print "[ERROR] Couldn't splice section %s in %s: No end marker" % (section, file)
return False
preamble = contents[0:start_marker+len(start_search)] + "\n"
appendix = contents[end_marker:]
new_contents = preamble + replacement + appendix
if contents != new_contents:
with open(file, 'w') as fd:
fd.write(new_contents)
return True
return False
|
apache-2.0
|
[
199,
646,
747,
12,
984,
12,
6010,
12,
5145,
12,
570,
5730,
12,
3873,
199,
199,
3,
314,
1978,
63,
694,
365,
314,
931,
2382,
642,
570,
27576,
641,
4543,
199,
1160,
63,
694,
275,
747,
14,
515,
14,
4832,
8,
736,
14,
515,
14,
3475,
8,
1274,
423,
20912,
8,
16,
680,
70,
63,
600,
14,
331,
63,
1501,
430,
199,
199,
318,
4868,
63,
2374,
63,
515,
8,
1757,
29,
549,
304,
199,
198,
1195,
275,
3873,
14,
1250,
5234,
8701,
13,
2416,
401,
3905,
1361,
13,
515,
2255,
3839,
29,
1490,
8,
736,
14,
19778,
12,
283,
87,
659,
4635,
29,
1490,
8,
736,
14,
19778,
12,
283,
87,
1333,
199,
198,
692,
4819,
508,
378,
520,
507,
198,
1107,
199,
198,
692,
3105,
26,
507,
198,
1361,
6730,
4531,
61,
1323,
3034,
841,
14,
19,
11,
12060,
14,
8730,
316,
367,
15030,
16533,
3530,
199,
198,
893,
515,
275,
1994,
31032,
7,
199,
198,
692,
747,
14,
515,
14,
6027,
8,
893,
515,
304,
507,
198,
736,
14,
3165,
9072,
360,
1093,
2524,
1484,
4227,
63,
3022,
297,
893,
515,
9,
507,
198,
1107,
199,
198,
893,
515,
275,
1994,
31907,
15,
18442,
14,
571,
15,
11383,
15,
31032,
7,
199,
198,
692,
747,
14,
515,
14,
6027,
8,
893,
515,
304,
507,
198,
736,
14,
3165,
9072,
360,
1093,
2524,
1484,
4227,
63,
3022,
297,
893,
515,
9,
507,
198,
1107,
199,
198,
15185,
4040,
63,
589,
275,
788,
1064,
1623,
1673,
75,
45,
1914,
563,
24885,
389,
18442,
12574,
75,
45,
1914,
563,
13028,
389,
5039,
418,
199,
198,
15185,
4040,
275,
3873,
14,
7942,
8,
15185,
4040,
63,
589,
12,
4635,
29,
5781,
14,
13850,
12,
3839,
29,
5781,
14,
6089,
9,
199,
198,
509,
1004,
315,
23226,
4040,
14,
2703,
14,
9684,
837,
507,
198,
893,
515,
275,
1004,
14,
6735,
342,
23164,
11383,
15,
31032,
7,
507,
198,
692,
747,
14,
515,
14,
6027,
8,
893,
515,
304,
686,
198,
736,
14,
3165,
9072,
360,
1093,
2524,
1484,
4227,
63,
3022,
297,
893,
515,
9,
686,
198,
1107,
199,
199,
318,
1586,
63,
888,
8,
70,
304,
199,
198,
6750,
275,
1052,
199,
198,
692,
747,
14,
515,
14,
2444,
8,
70,
304,
507,
198,
4407,
275,
1551,
8,
70,
680,
739,
342,
507,
198,
509,
1004,
315,
4072,
14,
7644,
8,
797,
304,
686,
198,
692,
1004,
59,
16,
26,
17,
22954,
24397,
1980,
686,
198,
8,
75,
12,
86,
9,
275,
1004,
14,
1294,
480,
23758,
686,
198,
6750,
59,
75,
10404,
86,
199,
198,
1107,
10792,
199,
199,
318,
16592,
63,
3112,
8,
3112,
12,
2199,
63,
694,
12,
17202,
63,
2614,
63,
694,
12,
943,
304,
199,
198,
578,
63,
773,
63,
1733,
63,
515,
275,
942,
199,
198,
578,
63,
6562,
63,
3220,
275,
942,
421,
198,
509,
859,
315,
4621,
26,
507,
198,
692,
859,
14,
3596,
26,
686,
198,
3,
8232,
13964,
11378,
4621,
14,
5723,
911,
506,
7686,
315,
282,
2945,
986,
14,
686,
198,
6958,
507,
198,
578,
63,
344,
275,
859,
14,
6418,
14,
578,
344,
14,
2325,
342,
507,
198,
578,
63,
1023,
275,
859,
14,
6418,
14,
1023,
507,
198,
578,
63,
773,
63,
354,
275,
661,
773,
5,
83,
14,
65,
7,
450,
859,
63,
344,
680,
2325,
342,
507,
198,
3,
1104,
1642,
315,
314,
2257,
2199,
507,
198,
1832,
63,
578,
63,
773,
275,
747,
14,
515,
14,
904,
8,
1715,
63,
694,
12,
283,
3112,
297,
283,
28303,
297,
859,
63,
773,
63,
354,
9,
507,
198,
1832,
275,
756,
507,
198,
692,
747,
14,
515,
14,
2444,
8,
1832,
63,
578,
63,
773,
304,
686,
198,
578,
63,
773,
63,
1733,
63,
515,
14,
740,
779,
578,
63,
773,
63,
354,
12,
2257,
63,
578,
63,
773,
566,
686,
198,
1832,
275,
715,
686,
198,
793,
10994,
4531,
61,
1487,
4530,
334,
1832,
9,
10919,
13,
7522,
859,
26,
450,
83,
2,
450,
334,
1832,
63,
578,
63,
773,
430,
507,
198,
2836,
26,
686,
198,
692,
859,
14,
773,
365,
488,
26,
1585,
198,
578,
63,
773,
63,
515,
275,
859,
14,
362,
63,
1927,
8,
578,
63,
773,
63,
354,
9,
1585,
198,
793,
10994,
3170,
61,
31079,
13,
7522,
859,
26,
450,
83,
3149,
83,
4124,
3555,
737,
450,
83,
2,
450,
334,
578,
63,
344,
12,
859,
63,
1023,
12,
859,
63,
773,
63,
515,
430,
1585,
198,
1274,
14,
2224,
8,
17,
9,
686,
198,
578,
63,
773,
63,
1733,
63,
515,
14,
740,
779,
578,
63,
773,
63,
354,
12,
747,
14,
515,
14,
4832,
8,
578,
14,
773,
680,
13490,
10998,
17,
2788,
16,
3934,
686,
198,
793,
10994,
4531,
61,
1487,
4530,
10919,
13,
7522,
859,
26,
450,
83,
3149,
83,
2,
450,
334,
578,
63,
344,
12,
859,
63,
1023,
430,
2742,
198,
692,
440,
2257,
26,
686,
198,
3,
1331,
859,
5944,
686,
198,
4060,
63,
694,
275,
859,
14,
362,
63,
1927,
360,
12186,
297,
283,
4782,
358,
686,
198,
692,
747,
14,
515,
14,
2444,
8,
4060,
63,
694,
304,
1585,
198,
2614,
63,
4060,
63,
694,
275,
747,
14,
515,
14,
904,
8,
12186,
63,
2614,
63,
694,
12,
283,
3112,
297,
859,
63,
344,
12,
283,
4782,
358,
1585,
198,
692,
440,
747,
14,
515,
14,
2444,
8,
2614,
63,
4060,
63,
694,
304,
1871,
198,
736,
14,
8347,
8,
2614,
63,
4060,
63,
694,
9,
1585,
198,
578,
63,
6562,
63,
3220,
14,
740,
779,
4060,
63,
694,
12,
2053,
63,
4060,
63,
694,
566,
6319,
198,
3,
1331,
315,
1263,
859,
17202,
686,
198,
578,
63,
12186,
63,
694,
275,
859,
14,
362,
63,
1927,
360,
12186,
358,
686,
198,
692,
747,
14,
515,
14,
2444,
8,
578,
63,
12186,
63,
694,
304,
1585,
198,
578,
63,
694,
275,
747,
14,
515,
14,
904,
8,
12186,
63,
2614,
63,
694,
12,
283,
3112,
297,
859,
63,
344,
9,
1585,
198,
578,
63,
6562,
63,
3220,
14,
740,
779,
578,
63,
12186,
63,
694,
12,
859,
63,
694,
566,
421,
198,
1107,
859,
63,
773,
63,
1733,
63,
515,
12,
859,
63,
6562
] |
[
646,
747,
12,
984,
12,
6010,
12,
5145,
12,
570,
5730,
12,
3873,
199,
199,
3,
314,
1978,
63,
694,
365,
314,
931,
2382,
642,
570,
27576,
641,
4543,
199,
1160,
63,
694,
275,
747,
14,
515,
14,
4832,
8,
736,
14,
515,
14,
3475,
8,
1274,
423,
20912,
8,
16,
680,
70,
63,
600,
14,
331,
63,
1501,
430,
199,
199,
318,
4868,
63,
2374,
63,
515,
8,
1757,
29,
549,
304,
199,
198,
1195,
275,
3873,
14,
1250,
5234,
8701,
13,
2416,
401,
3905,
1361,
13,
515,
2255,
3839,
29,
1490,
8,
736,
14,
19778,
12,
283,
87,
659,
4635,
29,
1490,
8,
736,
14,
19778,
12,
283,
87,
1333,
199,
198,
692,
4819,
508,
378,
520,
507,
198,
1107,
199,
198,
692,
3105,
26,
507,
198,
1361,
6730,
4531,
61,
1323,
3034,
841,
14,
19,
11,
12060,
14,
8730,
316,
367,
15030,
16533,
3530,
199,
198,
893,
515,
275,
1994,
31032,
7,
199,
198,
692,
747,
14,
515,
14,
6027,
8,
893,
515,
304,
507,
198,
736,
14,
3165,
9072,
360,
1093,
2524,
1484,
4227,
63,
3022,
297,
893,
515,
9,
507,
198,
1107,
199,
198,
893,
515,
275,
1994,
31907,
15,
18442,
14,
571,
15,
11383,
15,
31032,
7,
199,
198,
692,
747,
14,
515,
14,
6027,
8,
893,
515,
304,
507,
198,
736,
14,
3165,
9072,
360,
1093,
2524,
1484,
4227,
63,
3022,
297,
893,
515,
9,
507,
198,
1107,
199,
198,
15185,
4040,
63,
589,
275,
788,
1064,
1623,
1673,
75,
45,
1914,
563,
24885,
389,
18442,
12574,
75,
45,
1914,
563,
13028,
389,
5039,
418,
199,
198,
15185,
4040,
275,
3873,
14,
7942,
8,
15185,
4040,
63,
589,
12,
4635,
29,
5781,
14,
13850,
12,
3839,
29,
5781,
14,
6089,
9,
199,
198,
509,
1004,
315,
23226,
4040,
14,
2703,
14,
9684,
837,
507,
198,
893,
515,
275,
1004,
14,
6735,
342,
23164,
11383,
15,
31032,
7,
507,
198,
692,
747,
14,
515,
14,
6027,
8,
893,
515,
304,
686,
198,
736,
14,
3165,
9072,
360,
1093,
2524,
1484,
4227,
63,
3022,
297,
893,
515,
9,
686,
198,
1107,
199,
199,
318,
1586,
63,
888,
8,
70,
304,
199,
198,
6750,
275,
1052,
199,
198,
692,
747,
14,
515,
14,
2444,
8,
70,
304,
507,
198,
4407,
275,
1551,
8,
70,
680,
739,
342,
507,
198,
509,
1004,
315,
4072,
14,
7644,
8,
797,
304,
686,
198,
692,
1004,
59,
16,
26,
17,
22954,
24397,
1980,
686,
198,
8,
75,
12,
86,
9,
275,
1004,
14,
1294,
480,
23758,
686,
198,
6750,
59,
75,
10404,
86,
199,
198,
1107,
10792,
199,
199,
318,
16592,
63,
3112,
8,
3112,
12,
2199,
63,
694,
12,
17202,
63,
2614,
63,
694,
12,
943,
304,
199,
198,
578,
63,
773,
63,
1733,
63,
515,
275,
942,
199,
198,
578,
63,
6562,
63,
3220,
275,
942,
421,
198,
509,
859,
315,
4621,
26,
507,
198,
692,
859,
14,
3596,
26,
686,
198,
3,
8232,
13964,
11378,
4621,
14,
5723,
911,
506,
7686,
315,
282,
2945,
986,
14,
686,
198,
6958,
507,
198,
578,
63,
344,
275,
859,
14,
6418,
14,
578,
344,
14,
2325,
342,
507,
198,
578,
63,
1023,
275,
859,
14,
6418,
14,
1023,
507,
198,
578,
63,
773,
63,
354,
275,
661,
773,
5,
83,
14,
65,
7,
450,
859,
63,
344,
680,
2325,
342,
507,
198,
3,
1104,
1642,
315,
314,
2257,
2199,
507,
198,
1832,
63,
578,
63,
773,
275,
747,
14,
515,
14,
904,
8,
1715,
63,
694,
12,
283,
3112,
297,
283,
28303,
297,
859,
63,
773,
63,
354,
9,
507,
198,
1832,
275,
756,
507,
198,
692,
747,
14,
515,
14,
2444,
8,
1832,
63,
578,
63,
773,
304,
686,
198,
578,
63,
773,
63,
1733,
63,
515,
14,
740,
779,
578,
63,
773,
63,
354,
12,
2257,
63,
578,
63,
773,
566,
686,
198,
1832,
275,
715,
686,
198,
793,
10994,
4531,
61,
1487,
4530,
334,
1832,
9,
10919,
13,
7522,
859,
26,
450,
83,
2,
450,
334,
1832,
63,
578,
63,
773,
430,
507,
198,
2836,
26,
686,
198,
692,
859,
14,
773,
365,
488,
26,
1585,
198,
578,
63,
773,
63,
515,
275,
859,
14,
362,
63,
1927,
8,
578,
63,
773,
63,
354,
9,
1585,
198,
793,
10994,
3170,
61,
31079,
13,
7522,
859,
26,
450,
83,
3149,
83,
4124,
3555,
737,
450,
83,
2,
450,
334,
578,
63,
344,
12,
859,
63,
1023,
12,
859,
63,
773,
63,
515,
430,
1585,
198,
1274,
14,
2224,
8,
17,
9,
686,
198,
578,
63,
773,
63,
1733,
63,
515,
14,
740,
779,
578,
63,
773,
63,
354,
12,
747,
14,
515,
14,
4832,
8,
578,
14,
773,
680,
13490,
10998,
17,
2788,
16,
3934,
686,
198,
793,
10994,
4531,
61,
1487,
4530,
10919,
13,
7522,
859,
26,
450,
83,
3149,
83,
2,
450,
334,
578,
63,
344,
12,
859,
63,
1023,
430,
2742,
198,
692,
440,
2257,
26,
686,
198,
3,
1331,
859,
5944,
686,
198,
4060,
63,
694,
275,
859,
14,
362,
63,
1927,
360,
12186,
297,
283,
4782,
358,
686,
198,
692,
747,
14,
515,
14,
2444,
8,
4060,
63,
694,
304,
1585,
198,
2614,
63,
4060,
63,
694,
275,
747,
14,
515,
14,
904,
8,
12186,
63,
2614,
63,
694,
12,
283,
3112,
297,
859,
63,
344,
12,
283,
4782,
358,
1585,
198,
692,
440,
747,
14,
515,
14,
2444,
8,
2614,
63,
4060,
63,
694,
304,
1871,
198,
736,
14,
8347,
8,
2614,
63,
4060,
63,
694,
9,
1585,
198,
578,
63,
6562,
63,
3220,
14,
740,
779,
4060,
63,
694,
12,
2053,
63,
4060,
63,
694,
566,
6319,
198,
3,
1331,
315,
1263,
859,
17202,
686,
198,
578,
63,
12186,
63,
694,
275,
859,
14,
362,
63,
1927,
360,
12186,
358,
686,
198,
692,
747,
14,
515,
14,
2444,
8,
578,
63,
12186,
63,
694,
304,
1585,
198,
578,
63,
694,
275,
747,
14,
515,
14,
904,
8,
12186,
63,
2614,
63,
694,
12,
283,
3112,
297,
859,
63,
344,
9,
1585,
198,
578,
63,
6562,
63,
3220,
14,
740,
779,
578,
63,
12186,
63,
694,
12,
859,
63,
694,
566,
421,
198,
1107,
859,
63,
773,
63,
1733,
63,
515,
12,
859,
63,
6562,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
ericlyf/screenly-tools-schedulespreadsheet
|
src/model/Asset.py
|
1
|
1601
|
'''
Created on 11May,2016
@author: linyufeng
'''
from utils.TimeZoneConverter import TimeZoneConverter
class Asset(object):
'''
contain the values will be insert into table Asset
'''
convert = TimeZoneConverter();
def __init__(self, startTime, endTime, directory, fileName, fileType, duration, sequence):
self.startTime = self.convert.victoriaToUCT(startTime)
self.endTime = self.convert.victoriaToUCT(endTime)
self.directory = directory
self.fileName = fileName
self.fileType = fileType
self.duration = int(duration)
self.sequence = int(sequence)
def getStartTime(self):
return self.startTime
def getEndTime(self):
return self.endTime
def getDirectory(self):
return self.directory
def getFileName(self):
return self.fileName
def getFileType(self):
return self.fileType
def getDuration(self):
return self.duration
def getSequence(self):
return self.sequence
def __eq__(self,other):
if isinstance(other, self.__class__):
if self.startTime == other.startTime:
if self.endTime == other.endTime:
if self.directory == other.directory:
if self.duration == other.duration:
if self.fileName == other.fileName:
if self.fileType == other.fileType:
return True
return False
|
gpl-3.0
|
[
2344,
199,
10502,
641,
4119,
15586,
12,
9261,
199,
199,
32,
2502,
26,
7403,
89,
1286,
7420,
199,
2344,
199,
504,
3778,
14,
32515,
11907,
492,
4703,
11860,
11907,
199,
199,
533,
25670,
8,
785,
304,
272,
1449,
272,
1395,
314,
1338,
911,
506,
5518,
1901,
1817,
25670,
272,
1449,
339,
3957,
275,
4703,
11860,
11907,
7303,
2286,
347,
636,
826,
721,
277,
12,
28517,
12,
1284,
1366,
12,
2082,
12,
18305,
12,
570,
804,
12,
7373,
12,
3414,
304,
267,
291,
14,
28276,
275,
291,
14,
3916,
14,
433,
630,
4674,
1378,
7996,
8,
28276,
9,
267,
291,
14,
500,
1366,
275,
291,
14,
3916,
14,
433,
630,
4674,
1378,
7996,
8,
500,
1366,
9,
267,
291,
14,
3619,
275,
2082,
267,
291,
14,
15450,
275,
18305,
267,
291,
14,
493,
804,
275,
570,
804,
267,
291,
14,
5553,
275,
1109,
8,
5553,
9,
267,
291,
14,
4041,
275,
1109,
8,
4041,
9,
5493,
347,
664,
25087,
8,
277,
304,
267,
372,
291,
14,
28276,
2286,
347,
664,
3005,
1366,
8,
277,
304,
267,
372,
291,
14,
500,
1366,
2286,
347,
664,
6231,
8,
277,
304,
267,
372,
291,
14,
3619,
2286,
347,
664,
7733,
8,
277,
304,
267,
372,
291,
14,
15450,
2286,
347,
664,
20683,
8,
277,
304,
267,
372,
291,
14,
493,
804,
2286,
347,
664,
13283,
8,
277,
304,
267,
372,
291,
14,
5553,
2286,
347,
664,
5826,
8,
277,
304,
267,
372,
291,
14,
4041,
2286,
347,
636,
4077,
721,
277,
12,
1848,
304,
267,
340,
1228,
8,
1848,
12,
291,
855,
533,
18580,
288,
340,
291,
14,
28276,
508,
1163,
14,
28276,
26,
355,
340,
291,
14,
500,
1366,
508,
1163,
14,
500,
1366,
26,
490,
340,
291,
14,
3619,
508,
1163,
14,
3619,
26,
717,
340,
291,
14,
5553,
508,
1163,
14,
5553,
26,
1169,
340,
291,
14,
15450,
508,
1163,
14,
15450,
26,
1816,
340,
291,
14,
493,
804,
508,
1163,
14,
493,
804,
26,
2511,
372,
715,
267,
372,
756,
2490,
27844,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
199,
10502,
641,
4119,
15586,
12,
9261,
199,
199,
32,
2502,
26,
7403,
89,
1286,
7420,
199,
2344,
199,
504,
3778,
14,
32515,
11907,
492,
4703,
11860,
11907,
199,
199,
533,
25670,
8,
785,
304,
272,
1449,
272,
1395,
314,
1338,
911,
506,
5518,
1901,
1817,
25670,
272,
1449,
339,
3957,
275,
4703,
11860,
11907,
7303,
2286,
347,
636,
826,
721,
277,
12,
28517,
12,
1284,
1366,
12,
2082,
12,
18305,
12,
570,
804,
12,
7373,
12,
3414,
304,
267,
291,
14,
28276,
275,
291,
14,
3916,
14,
433,
630,
4674,
1378,
7996,
8,
28276,
9,
267,
291,
14,
500,
1366,
275,
291,
14,
3916,
14,
433,
630,
4674,
1378,
7996,
8,
500,
1366,
9,
267,
291,
14,
3619,
275,
2082,
267,
291,
14,
15450,
275,
18305,
267,
291,
14,
493,
804,
275,
570,
804,
267,
291,
14,
5553,
275,
1109,
8,
5553,
9,
267,
291,
14,
4041,
275,
1109,
8,
4041,
9,
5493,
347,
664,
25087,
8,
277,
304,
267,
372,
291,
14,
28276,
2286,
347,
664,
3005,
1366,
8,
277,
304,
267,
372,
291,
14,
500,
1366,
2286,
347,
664,
6231,
8,
277,
304,
267,
372,
291,
14,
3619,
2286,
347,
664,
7733,
8,
277,
304,
267,
372,
291,
14,
15450,
2286,
347,
664,
20683,
8,
277,
304,
267,
372,
291,
14,
493,
804,
2286,
347,
664,
13283,
8,
277,
304,
267,
372,
291,
14,
5553,
2286,
347,
664,
5826,
8,
277,
304,
267,
372,
291,
14,
4041,
2286,
347,
636,
4077,
721,
277,
12,
1848,
304,
267,
340,
1228,
8,
1848,
12,
291,
855,
533,
18580,
288,
340,
291,
14,
28276,
508,
1163,
14,
28276,
26,
355,
340,
291,
14,
500,
1366,
508,
1163,
14,
500,
1366,
26,
490,
340,
291,
14,
3619,
508,
1163,
14,
3619,
26,
717,
340,
291,
14,
5553,
508,
1163,
14,
5553,
26,
1169,
340,
291,
14,
15450,
508,
1163,
14,
15450,
26,
1816,
340,
291,
14,
493,
804,
508,
1163,
14,
493,
804,
26,
2511,
372,
715,
267,
372,
756,
2490,
27844,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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oExtractor
from ..utils import (
unified_strdate
)
class THVideoIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?thvideo\.tv/(?:v/th|mobile\.php\?cid=)(?P<id>[0-9]+)'
_TEST = {
'url': 'http://thvideo.tv/v/th1987/',
'md5': 'fa107b1f73817e325e9433505a70db50',
'info_dict': {
'id': '1987',
'ext': 'mp4',
'title': '【动画】秘封活动记录 ~ The Sealed Esoteric History.分镜稿预览',
'display_id': 'th1987',
'thumbnail': 'http://thvideo.tv/uploadfile/2014/0722/20140722013459856.jpg',
'description': '社团京都幻想剧团的第一个东方二次同人动画作品「秘封活动记录 ~ The Sealed Esoteric History.」 本视频是该动画第一期的分镜草稿...',
'upload_date': '20140722'
}
}
def _real_extract(self, url):
video_id = self._match_id(url)
# extract download link from mobile player page
webpage_player = self._download_webpage(
'http://thvideo.tv/mobile.php?cid=%s-0' % (video_id),
video_id, note='Downloading video source page')
video_url = self._html_search_regex(
r'<source src="(.*?)" type', webpage_player, 'video url')
# extract video info from main page
webpage = self._download_webpage(
'http://thvideo.tv/v/th%s' % (video_id), video_id)
title = self._og_search_title(webpage)
display_id = 'th%s' % video_id
thumbnail = self._og_search_thumbnail(webpage)
description = self._og_search_description(webpage)
upload_date = unified_strdate(self._html_search_regex(
r'span itemprop="datePublished" content="(.*?)">', webpage,
'upload date', fatal=False))
return {
'id': video_id,
'ext': 'mp4',
'url': video_url,
'title': title,
'display_id': display_id,
'thumbnail': thumbnail,
'description': description,
'upload_date': upload_date
}
class THVideoPlaylistIE(InfoExtractor):
_VALID_URL = r'http?://(?:www\.)?thvideo\.tv/mylist(?P<id>[0-9]+)'
_TEST = {
'url': 'http://thvideo.tv/mylist2',
'info_dict': {
'id': '2',
'title': '幻想万華鏡',
},
'playlist_mincount': 23,
}
def _real_extract(self, url):
playlist_id = self._match_id(url)
webpage = self._download_webpage(url, playlist_id)
list_title = self._html_search_regex(
r'<h1 class="show_title">(.*?)<b id', webpage, 'playlist title',
fatal=False)
entries = [
self.url_result('http://thvideo.tv/v/th' + id, 'THVideo')
for id in re.findall(r'<dd><a href="http://thvideo.tv/v/th(\d+)/" target=', webpage)]
return self.playlist_result(entries, playlist_id, list_title)
|
unlicense
|
[
3,
2803,
26,
2774,
13,
24,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
295,
199,
199,
504,
1275,
2330,
492,
21298,
199,
504,
2508,
1208,
492,
334,
272,
25344,
63,
495,
602,
199,
9,
421,
199,
533,
4221,
9166,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
1014,
921,
5169,
1544,
20316,
273,
3722,
4537,
6993,
32576,
86,
15,
273,
92,
11375,
4537,
8624,
29635,
7504,
29,
18168,
48,
28,
344,
9514,
16,
13,
25,
29716,
272,
485,
2864,
275,
469,
267,
283,
633,
356,
283,
1014,
921,
273,
3722,
14,
6993,
15,
86,
15,
273,
30828,
3678,
267,
283,
1064,
21,
356,
283,
667,
7555,
66,
17,
70,
23,
1703,
1196,
69,
13288,
69,
2635,
1153,
13938,
65,
2760,
697,
1400,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
30828,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
12805,
239,
31001,
8383,
120,
12805,
240,
19012,
247,
15348,
224,
163,
113,
8698,
233,
102,
14082,
109,
22918,
244,
221,
172,
122,
253,
710,
3240,
65,
1146,
662,
1152,
266,
1567,
27829,
14,
21514,
166,
244,
251,
25203,
124,
21262,
227,
21482,
231,
297,
288,
283,
2918,
63,
344,
356,
283,
273,
30828,
297,
288,
283,
8311,
356,
283,
1014,
921,
273,
3722,
14,
6993,
15,
5064,
493,
15,
7280,
15,
1780,
1081,
15,
7280,
1780,
1081,
614,
1082,
15897,
1367,
14,
8476,
297,
288,
283,
1802,
356,
283,
29875,
123,
14339,
96,
6923,
106,
166,
25315,
16322,
120,
28190,
112,
19642,
101,
14339,
96,
8106,
25238,
106,
12033,
4344,
251,
24302,
6923,
235,
30493,
28956,
25196,
31001,
8383,
120,
21927,
32531,
12805,
235,
19012,
247,
15348,
224,
163,
113,
8698,
233,
102,
14082,
109,
22918,
244,
221,
172,
122,
253,
710,
3240,
65,
1146,
662,
1152,
266,
1567,
27829,
14,
12805,
236,
221,
26304,
21482,
229,
21262,
240,
9729,
8400,
99,
31001,
8383,
120,
25238,
106,
9372,
14152,
8106,
21514,
166,
244,
251,
165,
236,
232,
25203,
124,
20833,
288,
283,
5064,
63,
602,
356,
283,
7280,
1780,
1081,
7,
267,
789,
272,
789,
339,
347,
485,
3093,
63,
5005,
8,
277,
12,
1166,
304,
267,
3991,
63,
344,
275,
291,
423,
1431,
63,
344,
8,
633,
9,
398,
327,
5536,
5235,
2142,
687,
21305,
7748,
2034,
267,
9248,
63,
6147,
275,
291,
423,
4249,
63,
12022,
8,
288,
283,
1014,
921,
273,
3722,
14,
6993,
15,
11375,
14,
8624,
31,
7504,
2458,
83,
13,
16,
7,
450,
334,
3722,
63,
344,
395,
288,
3991,
63,
344,
12,
5317,
534,
18085,
3991,
1350,
2034,
358,
267,
3991,
63,
633,
275,
291,
423,
1360,
63,
1733,
63,
3821,
8,
288,
519,
7601,
1365,
2928,
628,
17140,
2924,
730,
297,
9248,
63,
6147,
12,
283,
3722,
1166,
358,
398,
327,
5536,
3991,
2256,
687,
2446,
2034,
267,
9248,
275,
291,
423,
4249,
63,
12022,
8,
288,
283,
1014,
921,
273,
3722,
14,
6993,
15,
86,
15,
273,
5,
83,
7,
450,
334,
3722,
63,
344,
395,
3991,
63,
344,
9,
267,
2538,
275,
291,
423,
974,
63,
1733,
63,
1213,
8,
12022,
9,
267,
2929,
63,
344,
275,
283,
273,
5,
83,
7,
450,
3991,
63,
344,
267,
10062,
275,
291,
423,
974,
63,
1733,
63,
8311,
8,
12022,
9,
267,
1369,
275,
291,
423,
974,
63,
1733,
63,
1802,
8,
12022,
9,
267,
5802,
63,
602,
275,
25344,
63,
495,
602,
8,
277,
423,
1360,
63,
1733,
63,
3821,
8,
288,
519,
1159,
10384,
284,
808,
2675,
628,
602,
27862,
2,
1564,
628,
17140,
9,
1743,
297,
9248,
12,
288,
283,
5064,
1434,
297,
14294,
29,
797,
430,
398,
372,
469,
288,
283,
344,
356,
3991,
63,
344,
12,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
633,
356,
3991,
63,
633,
12,
288,
283,
1213,
356,
2538,
12,
288,
283,
2918,
63,
344,
356,
2929,
63,
344,
12,
288,
283,
8311,
356,
10062,
12,
288,
283,
1802,
356,
1369,
12,
288,
283,
5064,
63,
602,
356,
5802,
63,
602,
267,
789,
421,
199,
533,
4221,
9166,
27259,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
1014,
24524,
1544,
20316,
273,
3722,
4537,
6993,
15,
1662,
513,
2229,
48,
28,
344,
9514,
16,
13,
25,
29716,
272,
485,
2864,
275,
469,
267,
283,
633,
356,
283,
1014,
921,
273,
3722,
14,
6993,
15,
1662,
513,
18,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
18,
297,
288,
283,
1213,
356,
283,
16322,
120,
28190,
112,
4344,
230,
165,
238,
108,
166,
238,
95,
297,
267,
1660,
267,
283,
10411,
63,
827,
835,
356,
6546,
12,
272,
789,
339,
347,
485,
3093,
63,
5005,
8,
277,
12,
1166,
304,
267,
13210,
63,
344,
275,
291,
423,
1431,
63,
344,
8,
633,
9,
398,
9248,
275,
291,
423,
4249,
63,
12022,
8,
633,
12,
13210,
63,
344,
9,
267,
769,
63,
1213,
275,
291,
423,
1360,
63,
1733,
63,
3821,
8,
288,
519,
7601,
72,
17,
1021,
628,
2384,
63,
1213,
1743,
17140,
21528,
66,
1305,
297,
9248,
12,
283,
10411,
2538,
297,
288,
14294,
29,
797,
9,
398,
4811,
275,
359,
288,
291,
14,
633,
63,
1099,
360,
1014,
921,
273,
3722,
14,
6993,
15,
86,
15,
273,
7,
435,
1305,
12,
283,
2080,
9166,
358,
288,
367,
1305,
315,
295,
14,
6452,
8,
82,
7601,
617,
2535,
65,
4369,
628,
1014,
921,
273,
3722,
14,
6993,
15,
86,
15,
273,
2961,
68,
18830,
2,
1347,
4009,
9248,
1874,
398,
372,
291,
14,
10411,
63,
1099,
8,
3189,
12,
13210,
63,
344,
12,
769,
63,
1213,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2803,
26,
2774,
13,
24,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
295,
199,
199,
504,
1275,
2330,
492,
21298,
199,
504,
2508,
1208,
492,
334,
272,
25344,
63,
495,
602,
199,
9,
421,
199,
533,
4221,
9166,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
1014,
921,
5169,
1544,
20316,
273,
3722,
4537,
6993,
32576,
86,
15,
273,
92,
11375,
4537,
8624,
29635,
7504,
29,
18168,
48,
28,
344,
9514,
16,
13,
25,
29716,
272,
485,
2864,
275,
469,
267,
283,
633,
356,
283,
1014,
921,
273,
3722,
14,
6993,
15,
86,
15,
273,
30828,
3678,
267,
283,
1064,
21,
356,
283,
667,
7555,
66,
17,
70,
23,
1703,
1196,
69,
13288,
69,
2635,
1153,
13938,
65,
2760,
697,
1400,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
30828,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
12805,
239,
31001,
8383,
120,
12805,
240,
19012,
247,
15348,
224,
163,
113,
8698,
233,
102,
14082,
109,
22918,
244,
221,
172,
122,
253,
710,
3240,
65,
1146,
662,
1152,
266,
1567,
27829,
14,
21514,
166,
244,
251,
25203,
124,
21262,
227,
21482,
231,
297,
288,
283,
2918,
63,
344,
356,
283,
273,
30828,
297,
288,
283,
8311,
356,
283,
1014,
921,
273,
3722,
14,
6993,
15,
5064,
493,
15,
7280,
15,
1780,
1081,
15,
7280,
1780,
1081,
614,
1082,
15897,
1367,
14,
8476,
297,
288,
283,
1802,
356,
283,
29875,
123,
14339,
96,
6923,
106,
166,
25315,
16322,
120,
28190,
112,
19642,
101,
14339,
96,
8106,
25238,
106,
12033,
4344,
251,
24302,
6923,
235,
30493,
28956,
25196,
31001,
8383,
120,
21927,
32531,
12805,
235,
19012,
247,
15348,
224,
163,
113,
8698,
233,
102,
14082,
109,
22918,
244,
221,
172,
122,
253,
710,
3240,
65,
1146,
662,
1152,
266,
1567,
27829,
14,
12805,
236,
221,
26304,
21482,
229,
21262,
240,
9729,
8400,
99,
31001,
8383,
120,
25238,
106,
9372,
14152,
8106,
21514,
166,
244,
251,
165,
236,
232,
25203,
124,
20833,
288,
283,
5064,
63,
602,
356,
283,
7280,
1780,
1081,
7,
267,
789,
272,
789,
339,
347,
485,
3093,
63,
5005,
8,
277,
12,
1166,
304,
267,
3991,
63,
344,
275,
291,
423,
1431,
63,
344,
8,
633,
9,
398,
327,
5536,
5235,
2142,
687,
21305,
7748,
2034,
267,
9248,
63,
6147,
275,
291,
423,
4249,
63,
12022,
8,
288,
283,
1014,
921,
273,
3722,
14,
6993,
15,
11375,
14,
8624,
31,
7504,
2458,
83,
13,
16,
7,
450,
334,
3722,
63,
344,
395,
288,
3991,
63,
344,
12,
5317,
534,
18085,
3991,
1350,
2034,
358,
267,
3991,
63,
633,
275,
291,
423,
1360,
63,
1733,
63,
3821,
8,
288,
519,
7601,
1365,
2928,
628,
17140,
2924,
730,
297,
9248,
63,
6147,
12,
283,
3722,
1166,
358,
398,
327,
5536,
3991,
2256,
687,
2446,
2034,
267,
9248,
275,
291,
423,
4249,
63,
12022,
8,
288,
283,
1014,
921,
273,
3722,
14,
6993,
15,
86,
15,
273,
5,
83,
7,
450,
334,
3722,
63,
344,
395,
3991,
63,
344,
9,
267,
2538,
275,
291,
423,
974,
63,
1733,
63,
1213,
8,
12022,
9,
267,
2929,
63,
344,
275,
283,
273,
5,
83,
7,
450,
3991,
63,
344,
267,
10062,
275,
291,
423,
974,
63,
1733,
63,
8311,
8,
12022,
9,
267,
1369,
275,
291,
423,
974,
63,
1733,
63,
1802,
8,
12022,
9,
267,
5802,
63,
602,
275,
25344,
63,
495,
602,
8,
277,
423,
1360,
63,
1733,
63,
3821,
8,
288,
519,
1159,
10384,
284,
808,
2675,
628,
602,
27862,
2,
1564,
628,
17140,
9,
1743,
297,
9248,
12,
288,
283,
5064,
1434,
297,
14294,
29,
797,
430,
398,
372,
469,
288,
283,
344,
356,
3991,
63,
344,
12,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
633,
356,
3991,
63,
633,
12,
288,
283,
1213,
356,
2538,
12,
288,
283,
2918,
63,
344,
356,
2929,
63,
344,
12,
288,
283,
8311,
356,
10062,
12,
288,
283,
1802,
356,
1369,
12,
288,
283,
5064,
63,
602,
356,
5802,
63,
602,
267,
789,
421,
199,
533,
4221,
9166,
27259,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
1014,
24524,
1544,
20316,
273,
3722,
4537,
6993,
15,
1662,
513,
2229,
48,
28,
344,
9514,
16,
13,
25,
29716,
272,
485,
2864,
275,
469,
267,
283,
633,
356,
283,
1014,
921,
273,
3722,
14,
6993,
15,
1662,
513,
18,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
18,
297,
288,
283,
1213,
356,
283,
16322,
120,
28190,
112,
4344,
230,
165,
238,
108,
166,
238,
95,
297,
267,
1660,
267,
283,
10411,
63,
827,
835,
356,
6546,
12,
272,
789,
339,
347,
485,
3093,
63,
5005,
8,
277,
12,
1166,
304,
267,
13210,
63,
344,
275,
291,
423,
1431,
63,
344,
8,
633,
9,
398,
9248,
275,
291,
423,
4249,
63,
12022,
8,
633,
12,
13210,
63,
344,
9,
267,
769,
63,
1213,
275,
291,
423,
1360,
63,
1733,
63,
3821,
8,
288,
519,
7601,
72,
17,
1021,
628,
2384,
63,
1213,
1743,
17140,
21528,
66,
1305,
297,
9248,
12,
283,
10411,
2538,
297,
288,
14294,
29,
797,
9,
398,
4811,
275,
359,
288,
291,
14,
633,
63,
1099,
360,
1014,
921,
273,
3722,
14,
6993,
15,
86,
15,
273,
7,
435,
1305,
12,
283,
2080,
9166,
358,
288,
367,
1305,
315,
295,
14,
6452,
8,
82,
7601,
617,
2535,
65,
4369,
628,
1014,
921,
273,
3722,
14,
6993,
15,
86,
15,
273,
2961,
68,
18830,
2,
1347,
4009,
9248,
1874,
398,
372,
291,
14,
10411,
63,
1099,
8,
3189,
12,
13210,
63,
344,
12,
769,
63,
1213,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from jacket.api.compute.openstack import common
from jacket.api.compute.openstack import extensions
from jacket.api.compute.openstack import wsgi
from jacket.compute import cloud
ALIAS = "os-lock-server"
authorize = extensions.os_compute_authorizer(ALIAS)
class LockServerController(wsgi.Controller):
def __init__(self, *args, **kwargs):
super(LockServerController, self).__init__(*args, **kwargs)
self.compute_api = cloud.API(skip_policy_check=True)
@wsgi.response(202)
@extensions.expected_errors(404)
@wsgi.action('lock')
def _lock(self, req, id, body):
"""Lock a server instance."""
context = req.environ['compute.context']
authorize(context, action='lock')
instance = common.get_instance(self.compute_api, context, id)
self.compute_api.lock(context, instance)
@wsgi.response(202)
@extensions.expected_errors(404)
@wsgi.action('unlock')
def _unlock(self, req, id, body):
"""Unlock a server instance."""
context = req.environ['compute.context']
authorize(context, action='unlock')
instance = common.get_instance(self.compute_api, context, id)
if not self.compute_api.is_expected_locked_by(context, instance):
authorize(context, target=instance,
action='unlock:unlock_override')
self.compute_api.unlock(context, instance)
class LockServer(extensions.V21APIExtensionBase):
"""Enable lock/unlock server actions."""
name = "LockServer"
alias = ALIAS
version = 1
def get_controller_extensions(self):
controller = LockServerController()
extension = extensions.ControllerExtension(self, 'servers', controller)
return [extension]
def get_resources(self):
return []
|
apache-2.0
|
[
3,
1898,
7760,
14260,
2752,
199,
3,
1898,
6171,
26202,
22304,
14,
199,
3,
199,
3,
257,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
1265,
1443,
199,
3,
257,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
2047,
1443,
3332,
199,
3,
257,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
755,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
257,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
257,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
2428,
199,
3,
257,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
1666,
314,
199,
3,
257,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
4204,
199,
3,
257,
1334,
314,
844,
14,
199,
199,
504,
1335,
564,
386,
14,
1246,
14,
3357,
14,
8512,
492,
2863,
199,
504,
1335,
564,
386,
14,
1246,
14,
3357,
14,
8512,
492,
5478,
199,
504,
1335,
564,
386,
14,
1246,
14,
3357,
14,
8512,
492,
12464,
199,
504,
1335,
564,
386,
14,
3357,
492,
8002,
199,
199,
12644,
275,
298,
736,
13,
831,
13,
1000,
2,
199,
199,
14204,
275,
5478,
14,
736,
63,
3357,
63,
2502,
1793,
8,
12644,
9,
421,
199,
533,
15536,
3120,
7506,
8,
6508,
14,
7506,
304,
272,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
1613,
8,
6432,
3120,
7506,
12,
291,
2843,
826,
9308,
589,
12,
1011,
958,
9,
267,
291,
14,
3357,
63,
1246,
275,
8002,
14,
3735,
8,
2759,
63,
3185,
63,
1074,
29,
549,
9,
339,
768,
6508,
14,
1310,
8,
4999,
9,
272,
768,
5359,
14,
2062,
63,
2550,
8,
5188,
9,
272,
768,
6508,
14,
1287,
360,
831,
358,
272,
347,
485,
831,
8,
277,
12,
2648,
12,
1305,
12,
2396,
304,
267,
408,
6432,
282,
1654,
1256,
1041,
267,
1067,
275,
2648,
14,
2314,
459,
3357,
14,
1100,
418,
267,
20210,
8,
1100,
12,
1595,
534,
831,
358,
267,
1256,
275,
2863,
14,
362,
63,
842,
8,
277,
14,
3357,
63,
1246,
12,
1067,
12,
1305,
9,
267,
291,
14,
3357,
63,
1246,
14,
831,
8,
1100,
12,
1256,
9,
339,
768,
6508,
14,
1310,
8,
4999,
9,
272,
768,
5359,
14,
2062,
63,
2550,
8,
5188,
9,
272,
768,
6508,
14,
1287,
360,
17966,
358,
272,
347,
485,
17966,
8,
277,
12,
2648,
12,
1305,
12,
2396,
304,
267,
408,
1358,
831,
282,
1654,
1256,
1041,
267,
1067,
275,
2648,
14,
2314,
459,
3357,
14,
1100,
418,
267,
20210,
8,
1100,
12,
1595,
534,
17966,
358,
267,
1256,
275,
2863,
14,
362,
63,
842,
8,
277,
14,
3357,
63,
1246,
12,
1067,
12,
1305,
9,
267,
340,
440,
291,
14,
3357,
63,
1246,
14,
374,
63,
2062,
63,
9325,
63,
991,
8,
1100,
12,
1256,
304,
288,
20210,
8,
1100,
12,
1347,
29,
842,
12,
1993,
1595,
534,
17966,
26,
17966,
63,
4415,
358,
398,
291,
14,
3357,
63,
1246,
14,
17966,
8,
1100,
12,
1256,
9,
421,
199,
533,
15536,
3120,
8,
5359,
14,
54,
2025,
3735,
6382,
1563,
304,
272,
408,
6476,
4650,
15,
17966,
1654,
5445,
1041,
339,
536,
275,
298,
6432,
3120,
2,
272,
5162,
275,
437,
2673,
1179,
272,
1015,
275,
413,
339,
347,
664,
63,
5538,
63,
5359,
8,
277,
304,
267,
7614,
275,
15536,
3120,
7506,
342,
267,
3329,
275,
5478,
14,
7506,
6382,
8,
277,
12,
283,
5871,
297,
7614,
9,
267,
372,
359,
3435,
61,
339,
347,
664,
63,
4435,
8,
277,
304,
267,
372,
942,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1898,
7760,
14260,
2752,
199,
3,
1898,
6171,
26202,
22304,
14,
199,
3,
199,
3,
257,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
1265,
1443,
199,
3,
257,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
2047,
1443,
3332,
199,
3,
257,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
755,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
257,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
257,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
2428,
199,
3,
257,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
1666,
314,
199,
3,
257,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
4204,
199,
3,
257,
1334,
314,
844,
14,
199,
199,
504,
1335,
564,
386,
14,
1246,
14,
3357,
14,
8512,
492,
2863,
199,
504,
1335,
564,
386,
14,
1246,
14,
3357,
14,
8512,
492,
5478,
199,
504,
1335,
564,
386,
14,
1246,
14,
3357,
14,
8512,
492,
12464,
199,
504,
1335,
564,
386,
14,
3357,
492,
8002,
199,
199,
12644,
275,
298,
736,
13,
831,
13,
1000,
2,
199,
199,
14204,
275,
5478,
14,
736,
63,
3357,
63,
2502,
1793,
8,
12644,
9,
421,
199,
533,
15536,
3120,
7506,
8,
6508,
14,
7506,
304,
272,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
1613,
8,
6432,
3120,
7506,
12,
291,
2843,
826,
9308,
589,
12,
1011,
958,
9,
267,
291,
14,
3357,
63,
1246,
275,
8002,
14,
3735,
8,
2759,
63,
3185,
63,
1074,
29,
549,
9,
339,
768,
6508,
14,
1310,
8,
4999,
9,
272,
768,
5359,
14,
2062,
63,
2550,
8,
5188,
9,
272,
768,
6508,
14,
1287,
360,
831,
358,
272,
347,
485,
831,
8,
277,
12,
2648,
12,
1305,
12,
2396,
304,
267,
408,
6432,
282,
1654,
1256,
1041,
267,
1067,
275,
2648,
14,
2314,
459,
3357,
14,
1100,
418,
267,
20210,
8,
1100,
12,
1595,
534,
831,
358,
267,
1256,
275,
2863,
14,
362,
63,
842,
8,
277,
14,
3357,
63,
1246,
12,
1067,
12,
1305,
9,
267,
291,
14,
3357,
63,
1246,
14,
831,
8,
1100,
12,
1256,
9,
339,
768,
6508,
14,
1310,
8,
4999,
9,
272,
768,
5359,
14,
2062,
63,
2550,
8,
5188,
9,
272,
768,
6508,
14,
1287,
360,
17966,
358,
272,
347,
485,
17966,
8,
277,
12,
2648,
12,
1305,
12,
2396,
304,
267,
408,
1358,
831,
282,
1654,
1256,
1041,
267,
1067,
275,
2648,
14,
2314,
459,
3357,
14,
1100,
418,
267,
20210,
8,
1100,
12,
1595,
534,
17966,
358,
267,
1256,
275,
2863,
14,
362,
63,
842,
8,
277,
14,
3357,
63,
1246,
12,
1067,
12,
1305,
9,
267,
340,
440,
291,
14,
3357,
63,
1246,
14,
374,
63,
2062,
63,
9325,
63,
991,
8,
1100,
12,
1256,
304,
288,
20210,
8,
1100,
12,
1347,
29,
842,
12,
1993,
1595,
534,
17966,
26,
17966,
63,
4415,
358,
398,
291,
14,
3357,
63,
1246,
14,
17966,
8,
1100,
12,
1256,
9,
421,
199,
533,
15536,
3120,
8,
5359,
14,
54,
2025,
3735,
6382,
1563,
304,
272,
408,
6476,
4650,
15,
17966,
1654,
5445,
1041,
339,
536,
275,
298,
6432,
3120,
2,
272,
5162,
275,
437,
2673,
1179,
272,
1015,
275,
413,
339,
347,
664,
63,
5538,
63,
5359,
8,
277,
304,
267,
7614,
275,
15536,
3120,
7506,
342,
267,
3329,
275,
5478,
14,
7506,
6382,
8,
277,
12,
283,
5871,
297,
7614,
9,
267,
372,
359,
3435,
61,
339,
347,
664,
63,
4435,
8,
277,
304,
267,
372,
942,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
Glignos/inspire-next
|
inspirehep/utils/normalizers.py
|
4
|
1560
|
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# INSPIRE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with INSPIRE. If not, see <http://www.gnu.org/licenses/>.
#
# In applying this license, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.
from __future__ import absolute_import, division, print_function
from flask import current_app
from inspirehep.modules.search.api import JournalsSearch
def normalize_journal_title(journal_title):
normalized_journal_title = journal_title
hits = JournalsSearch().query(
'match',
lowercase_journal_titles=journal_title
).execute()
if hits:
try:
normalized_journal_title = hits[0].short_title
except (AttributeError, IndexError):
current_app.logger.debug(
"Failed to normalize journal title in: %s", repr(hits[0])
)
return normalized_journal_title
|
gpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
1621,
20495,
907,
14,
199,
3,
1898,
334,
35,
9,
6927,
13,
10680,
24354,
14,
199,
3,
199,
3,
1621,
20495,
907,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
199,
3,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
1621,
20495,
907,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
1666,
314,
199,
3,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
3,
3180,
543,
1621,
20495,
907,
14,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
3,
1010,
18876,
642,
4190,
12,
24354,
1630,
440,
14442,
1912,
314,
20001,
436,
25531,
22047,
199,
3,
10009,
370,
652,
701,
12043,
310,
402,
2399,
2004,
465,
376,
6551,
71,
27639,
279,
18863,
199,
3,
503,
11482,
6337,
370,
1263,
1335,
17656,
26382,
14,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
12,
4629,
12,
870,
63,
1593,
199,
199,
504,
7209,
492,
1453,
63,
571,
199,
199,
504,
315,
681,
3621,
426,
80,
14,
3112,
14,
1733,
14,
1246,
492,
7135,
31212,
5278,
421,
199,
318,
7666,
63,
7067,
63,
1213,
8,
7067,
63,
1213,
304,
272,
9657,
63,
7067,
63,
1213,
275,
9605,
63,
1213,
272,
19745,
275,
7135,
31212,
5278,
1252,
1131,
8,
267,
283,
1431,
297,
267,
12141,
63,
7067,
63,
8916,
29,
7067,
63,
1213,
272,
7092,
2526,
342,
339,
340,
19745,
26,
267,
862,
26,
288,
9657,
63,
7067,
63,
1213,
275,
19745,
59,
16,
1055,
3612,
63,
1213,
267,
871,
334,
10227,
12,
7888,
304,
288,
1453,
63,
571,
14,
2921,
14,
1757,
8,
355,
298,
4276,
370,
7666,
9605,
2538,
315,
26,
450,
83,
401,
4700,
8,
16595,
59,
16,
566,
288,
776,
272,
372,
9657,
63,
7067,
63,
1213,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
1621,
20495,
907,
14,
199,
3,
1898,
334,
35,
9,
6927,
13,
10680,
24354,
14,
199,
3,
199,
3,
1621,
20495,
907,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
199,
3,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
1621,
20495,
907,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
1666,
314,
199,
3,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
3,
3180,
543,
1621,
20495,
907,
14,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
3,
1010,
18876,
642,
4190,
12,
24354,
1630,
440,
14442,
1912,
314,
20001,
436,
25531,
22047,
199,
3,
10009,
370,
652,
701,
12043,
310,
402,
2399,
2004,
465,
376,
6551,
71,
27639,
279,
18863,
199,
3,
503,
11482,
6337,
370,
1263,
1335,
17656,
26382,
14,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
12,
4629,
12,
870,
63,
1593,
199,
199,
504,
7209,
492,
1453,
63,
571,
199,
199,
504,
315,
681,
3621,
426,
80,
14,
3112,
14,
1733,
14,
1246,
492,
7135,
31212,
5278,
421,
199,
318,
7666,
63,
7067,
63,
1213,
8,
7067,
63,
1213,
304,
272,
9657,
63,
7067,
63,
1213,
275,
9605,
63,
1213,
272,
19745,
275,
7135,
31212,
5278,
1252,
1131,
8,
267,
283,
1431,
297,
267,
12141,
63,
7067,
63,
8916,
29,
7067,
63,
1213,
272,
7092,
2526,
342,
339,
340,
19745,
26,
267,
862,
26,
288,
9657,
63,
7067,
63,
1213,
275,
19745,
59,
16,
1055,
3612,
63,
1213,
267,
871,
334,
10227,
12,
7888,
304,
288,
1453,
63,
571,
14,
2921,
14,
1757,
8,
355,
298,
4276,
370,
7666,
9605,
2538,
315,
26,
450,
83,
401,
4700,
8,
16595,
59,
16,
566,
288,
776,
272,
372,
9657,
63,
7067,
63,
1213,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
matthiascy/panda3d
|
direct/src/showbase/ContainerLeakDetector.py
|
8
|
50251
|
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.showbase.PythonUtil import makeFlywheelGen
from direct.showbase.PythonUtil import itype, serialNum, safeRepr, fastRepr
from direct.showbase.Job import Job
import types, weakref, random, __builtin__
def _createContainerLeak():
def leakContainer(task=None):
base = getBase()
if not hasattr(base, 'leakContainer'):
base.leakContainer = {}
# use tuples as keys since they can't be weakref'd, and use an instance
# since it can't be repr/eval'd
# that will force the leak detector to hold a normal 'non-weak' reference
class LeakKey:
pass
base.leakContainer[(LeakKey(),)] = {}
# test the non-weakref object reference handling
if random.random() < .01:
key = random.choice(base.leakContainer.keys())
ContainerLeakDetector.notify.debug(
'removing reference to leakContainer key %s so it will be garbage-collected' % safeRepr(key))
del base.leakContainer[key]
taskMgr.doMethodLater(10, leakContainer, 'leakContainer-%s' % serialNum())
if task:
return task.done
leakContainer()
def _createTaskLeak():
leakTaskName = uniqueName('leakedTask')
leakDoLaterName = uniqueName('leakedDoLater')
def nullTask(task=None):
return task.cont
def nullDoLater(task=None):
return task.done
def leakTask(task=None, leakTaskName=leakTaskName):
base = getBase()
taskMgr.add(nullTask, uniqueName(leakTaskName))
taskMgr.doMethodLater(1 << 31, nullDoLater, uniqueName(leakDoLaterName))
taskMgr.doMethodLater(10, leakTask, 'doLeakTask-%s' % serialNum())
if task:
return task.done
leakTask()
class NoDictKey:
pass
class Indirection:
"""
Represents the indirection that brings you from a container to an element of the container.
Stored as a string to be used as part of an eval, or as a key to be looked up in a dict.
Each dictionary dereference is individually eval'd since the dict key might have been
garbage-collected
TODO: store string components that are duplicates of strings in the actual system so that
Python will keep one copy and reduce memory usage
"""
def __init__(self, evalStr=None, dictKey=NoDictKey):
# if this is a dictionary lookup, pass dictKey instead of evalStr
self.evalStr = evalStr
self.dictKey = NoDictKey
# is the dictKey a weak reference?
self._isWeakRef = False
self._refCount = 0
if dictKey is not NoDictKey:
# if we can repr/eval the key, store it as an evalStr
keyRepr = safeRepr(dictKey)
useEval = False
try:
keyEval = eval(keyRepr)
useEval = True
except:
pass
if useEval:
# check to make sure the eval succeeded
if hash(keyEval) != hash(dictKey):
useEval = False
if useEval:
# eval/repr succeeded, store as an evalStr
self.evalStr = '[%s]' % keyRepr
else:
try:
# store a weakref to the key
self.dictKey = weakref.ref(dictKey)
self._isWeakRef = True
except TypeError, e:
ContainerLeakDetector.notify.debug('could not weakref dict key %s' % keyRepr)
self.dictKey = dictKey
self._isWeakRef = False
def destroy(self):
# re-entrant
self.dictKey = NoDictKey
def acquire(self):
self._refCount += 1
def release(self):
self._refCount -= 1
if self._refCount == 0:
self.destroy()
def isDictKey(self):
# is this an indirection through a dictionary?
return self.dictKey is not NoDictKey
def _getNonWeakDictKey(self):
if not self._isWeakRef:
return self.dictKey
else:
key = self.dictKey()
if key is None:
return '<garbage-collected dict key>'
return key
def dereferenceDictKey(self, parentDict):
# look ourselves up in parentDict
key = self._getNonWeakDictKey()
# objects in __builtin__ will have parentDict==None
if parentDict is None:
return key
return parentDict[key]
def getString(self, prevIndirection=None, nextIndirection=None):
# return our contribution to the full name of an object
instanceDictStr = '.__dict__'
if self.evalStr is not None:
# if we're an instance dict, skip over this one (obj.__dict__[keyName] == obj.keyName)
if nextIndirection is not None and self.evalStr[-len(instanceDictStr):] == instanceDictStr:
return self.evalStr[:-len(instanceDictStr)]
# if the previous indirection was an instance dict, change our syntax from ['key'] to .key
if prevIndirection is not None and prevIndirection.evalStr is not None:
if prevIndirection.evalStr[-len(instanceDictStr):] == instanceDictStr:
return '.%s' % self.evalStr[2:-2]
return self.evalStr
# we're stored as a dict key
keyRepr = safeRepr(self._getNonWeakDictKey())
# if the previous indirection was an instance dict, change our syntax from ['key'] to .key
if prevIndirection is not None and prevIndirection.evalStr is not None:
if prevIndirection.evalStr[-len(instanceDictStr):] == instanceDictStr:
return '.%s' % keyRepr
return '[%s]' % keyRepr
def __repr__(self):
return self.getString()
class ObjectRef:
"""
stores a reference to a container in a way that does not prevent garbage
collection of the container if possible
stored as a series of 'indirections' (obj.foo -> '.foo', dict[key] -> '[key]', etc.)
"""
notify = directNotify.newCategory("ObjectRef")
class FailedEval(Exception):
pass
def __init__(self, indirection, objId, other=None):
self._indirections = []
# are we building off of an existing ref?
if other is not None:
for ind in other._indirections:
self._indirections.append(ind)
# make sure we're not storing a reference to the actual object,
# that could cause a memory leak
assert type(objId) in (types.IntType, types.LongType)
# prevent cycles (i.e. base.loader.base.loader)
assert not self.goesThrough(objId=objId)
self._indirections.append(indirection)
# make sure our indirections don't get destroyed while we're using them
for ind in self._indirections:
ind.acquire()
self.notify.debug(repr(self))
def destroy(self):
for indirection in self._indirections:
indirection.release()
del self._indirections
def getNumIndirections(self):
return len(self._indirections)
def goesThroughGen(self, obj=None, objId=None):
if obj is None:
assert type(objId) in (types.IntType, types.LongType)
else:
objId = id(obj)
o = None
evalStr = ''
curObj = None
# make sure the indirections don't go away on us
indirections = self._indirections
for indirection in indirections:
yield None
indirection.acquire()
for indirection in indirections:
yield None
if not indirection.isDictKey():
# build up a string to be eval'd
evalStr += indirection.getString()
else:
curObj = self._getContainerByEval(evalStr, curObj=curObj)
if curObj is None:
raise FailedEval(evalStr)
# try to look up this key in the curObj dictionary
curObj = indirection.dereferenceDictKey(curObj)
evalStr = ''
yield None
o = self._getContainerByEval(evalStr, curObj=curObj)
if id(o) == objId:
break
for indirection in indirections:
yield None
indirection.release()
yield id(o) == objId
def goesThrough(self, obj=None, objId=None):
# since we cache the ids involved in this reference,
# this isn't perfect, for example if base.myObject is reassigned
# to a different object after this Ref was created this would return
# false, allowing a ref to base.myObject.otherObject.myObject
for goesThrough in self.goesThroughGen(obj=obj, objId=objId):
pass
return goesThrough
def _getContainerByEval(self, evalStr, curObj=None):
if curObj is not None:
# eval('curObj.foo.bar.someDict')
evalStr = 'curObj%s' % evalStr
else:
# this eval is not based off of curObj, use the global__builtin__ namespace
# put __builtin__ at the start if it's not already there
bis = '__builtin__'
if evalStr[:len(bis)] != bis:
evalStr = '%s.%s' % (bis, evalStr)
try:
container = eval(evalStr)
except NameError, ne:
return None
except AttributeError, ae:
return None
except KeyError, ke:
return None
return container
def getContainerGen(self, getInstance=False):
# try to get a handle on the container by eval'ing and looking things
# up in dictionaries, depending on the type of each indirection
# if getInstance is True, will return instance instead of instance dict
#import pdb;pdb.set_trace()
evalStr = ''
curObj = None
# make sure the indirections don't go away on us
indirections = self._indirections
for indirection in indirections:
indirection.acquire()
for indirection in indirections:
yield None
if not indirection.isDictKey():
# build up a string to be eval'd
evalStr += indirection.getString()
else:
curObj = self._getContainerByEval(evalStr, curObj=curObj)
if curObj is None:
raise FailedEval(evalStr)
# try to look up this key in the curObj dictionary
curObj = indirection.dereferenceDictKey(curObj)
evalStr = ''
for indirection in indirections:
yield None
indirection.release()
if getInstance:
lenDict = len('.__dict__')
if evalStr[-lenDict:] == '.__dict__':
evalStr = evalStr[:-lenDict]
# TODO: check that this is still the object we originally pointed to
yield self._getContainerByEval(evalStr, curObj=curObj)
def getEvalStrGen(self, getInstance=False):
str = ''
prevIndirection = None
curIndirection = None
nextIndirection = None
# make sure the indirections don't go away on us
indirections = self._indirections
for indirection in indirections:
indirection.acquire()
for i in xrange(len(indirections)):
yield None
if i > 0:
prevIndirection = indirections[i-1]
else:
prevIndirection = None
curIndirection = indirections[i]
if i < len(indirections)-1:
nextIndirection = indirections[i+1]
else:
nextIndirection = None
str += curIndirection.getString(prevIndirection=prevIndirection,
nextIndirection=nextIndirection)
if getInstance:
lenDict = len('.__dict__')
if str[-lenDict:] == '.__dict__':
str = str[:-lenDict]
for indirection in indirections:
yield None
indirection.release()
yield str
def getFinalIndirectionStr(self):
prevIndirection = None
if len(self._indirections) > 1:
prevIndirection = self._indirections[-2]
return self._indirections[-1].getString(prevIndirection=prevIndirection)
def __repr__(self):
for result in self.getEvalStrGen():
pass
return result
class FindContainers(Job):
"""
Explore the Python graph, looking for objects that support __len__()
"""
def __init__(self, name, leakDetector):
Job.__init__(self, name)
self._leakDetector = leakDetector
self._id2ref = self._leakDetector._id2ref
# these hold objects that we should start traversals from often and not-as-often,
# respectively
self._id2baseStartRef = {}
self._id2discoveredStartRef = {}
# these are working copies so that our iterations aren't disturbed by changes to the
# definitive ref sets
self._baseStartRefWorkingList = ScratchPad(refGen=nullGen(),
source=self._id2baseStartRef)
self._discoveredStartRefWorkingList = ScratchPad(refGen=nullGen(),
source=self._id2discoveredStartRef)
self.notify = self._leakDetector.notify
ContainerLeakDetector.addPrivateObj(self.__dict__)
# set up the base containers, the ones that hold most objects
ref = ObjectRef(Indirection(evalStr='__builtin__.__dict__'), id(__builtin__.__dict__))
self._id2baseStartRef[id(__builtin__.__dict__)] = ref
# container for objects that want to make sure they are found by
# the object exploration algorithm, including objects that exist
# just to measure things such as C++ memory usage, scene graph size,
# framerate, etc. See LeakDetectors.py
if not hasattr(__builtin__, "leakDetectors"):
__builtin__.leakDetectors = {}
ref = ObjectRef(Indirection(evalStr='leakDetectors'), id(leakDetectors))
self._id2baseStartRef[id(leakDetectors)] = ref
for i in self._addContainerGen(__builtin__.__dict__, ref):
pass
try:
base
except:
pass
else:
ref = ObjectRef(Indirection(evalStr='base.__dict__'), id(base.__dict__))
self._id2baseStartRef[id(base.__dict__)] = ref
for i in self._addContainerGen(base.__dict__, ref):
pass
try:
simbase
except:
pass
else:
ref = ObjectRef(Indirection(evalStr='simbase.__dict__'), id(simbase.__dict__))
self._id2baseStartRef[id(simbase.__dict__)] = ref
for i in self._addContainerGen(simbase.__dict__, ref):
pass
def destroy(self):
ContainerLeakDetector.removePrivateObj(self.__dict__)
Job.destroy(self)
def getPriority(self):
return Job.Priorities.Low
@staticmethod
def getStartObjAffinity(startObj):
# how good of a starting object is this object for traversing the object graph?
try:
return len(startObj)
except:
return 1
def _isDeadEnd(self, obj, objName=None):
if type(obj) in (types.BooleanType, types.BuiltinFunctionType,
types.BuiltinMethodType, types.ComplexType,
types.FloatType, types.IntType, types.LongType,
types.NoneType, types.NotImplementedType,
types.TypeType, types.CodeType, types.FunctionType,
types.StringType, types.UnicodeType,
types.TupleType):
return True
# if it's an internal object, ignore it
if id(obj) in ContainerLeakDetector.PrivateIds:
return True
# prevent crashes in objects that define __cmp__ and don't handle strings
if type(objName) == types.StringType and objName in ('im_self', 'im_class'):
return True
try:
className = obj.__class__.__name__
except:
pass
else:
# prevent infinite recursion in built-in containers related to methods
if className == 'method-wrapper':
return True
return False
def _hasLength(self, obj):
return hasattr(obj, '__len__')
def _addContainerGen(self, cont, objRef):
contId = id(cont)
# if this container is new, or the objRef repr is shorter than what we already have,
# put it in the table
if contId in self._id2ref:
for existingRepr in self._id2ref[contId].getEvalStrGen():
yield None
for newRepr in objRef.getEvalStrGen():
yield None
if contId not in self._id2ref or len(newRepr) < len(existingRepr):
if contId in self._id2ref:
self._leakDetector.removeContainerById(contId)
self._id2ref[contId] = objRef
def _addDiscoveredStartRef(self, obj, ref):
# we've discovered an object that can be used to start an object graph traversal
objId = id(obj)
if objId in self._id2discoveredStartRef:
existingRef = self._id2discoveredStartRef[objId]
if type(existingRef) not in (types.IntType, types.LongType):
if (existingRef.getNumIndirections() >=
ref.getNumIndirections()):
# the ref that we already have is more concise than the new ref
return
if objId in self._id2ref:
if (self._id2ref[objId].getNumIndirections() >=
ref.getNumIndirections()):
# the ref that we already have is more concise than the new ref
return
storedItem = ref
# if we already are storing a reference to this object, don't store a second reference
if objId in self._id2ref:
storedItem = objId
self._id2discoveredStartRef[objId] = storedItem
def run(self):
try:
# this yields a different set of start refs every time we start a new traversal
# force creation of a new workingListSelector inside the while loop right off the bat
workingListSelector = nullGen()
# this holds the current step of the current traversal
curObjRef = None
while True:
# yield up here instead of at the end, since we skip back to the
# top of the while loop from various points
yield None
#import pdb;pdb.set_trace()
if curObjRef is None:
# choose an object to start a traversal from
try:
startRefWorkingList = workingListSelector.next()
except StopIteration:
# do relative # of traversals on each set based on how many refs it contains
baseLen = len(self._baseStartRefWorkingList.source)
discLen = len(self._discoveredStartRefWorkingList.source)
minLen = float(max(1, min(baseLen, discLen)))
# this will cut down the traversals of the larger set by 2/3
minLen *= 3.
workingListSelector = flywheel([self._baseStartRefWorkingList, self._discoveredStartRefWorkingList],
[baseLen/minLen, discLen/minLen])
yield None
continue
# grab the next start ref from this sequence and see if it's still valid
while True:
yield None
try:
curObjRef = startRefWorkingList.refGen.next()
break
except StopIteration:
# we've run out of refs, grab a new set
if len(startRefWorkingList.source) == 0:
# ref set is empty, choose another
break
# make a generator that yields containers a # of times that is
# proportional to their length
for fw in makeFlywheelGen(
startRefWorkingList.source.values(),
countFunc=lambda x: self.getStartObjAffinity(x),
scale=.05):
yield None
startRefWorkingList.refGen = fw
if curObjRef is None:
# this ref set is empty, choose another
# the base set should never be empty (__builtin__ etc.)
continue
# do we need to go look up the object in _id2ref? sometimes we do that
# to avoid storing multiple redundant refs to a single item
if type(curObjRef) in (types.IntType, types.LongType):
startId = curObjRef
curObjRef = None
try:
for containerRef in self._leakDetector.getContainerByIdGen(startId):
yield None
except:
# ref is invalid
self.notify.debug('invalid startRef, stored as id %s' % startId)
self._leakDetector.removeContainerById(startId)
continue
curObjRef = containerRef
try:
for curObj in curObjRef.getContainerGen():
yield None
except:
self.notify.debug('lost current container, ref.getContainerGen() failed')
# that container is gone, try again
curObjRef = None
continue
self.notify.debug('--> %s' % curObjRef)
#import pdb;pdb.set_trace()
# store a copy of the current objRef
parentObjRef = curObjRef
# if we hit a dead end, start over from another container
curObjRef = None
if hasattr(curObj, '__dict__'):
child = curObj.__dict__
hasLength = self._hasLength(child)
notDeadEnd = not self._isDeadEnd(child)
if hasLength or notDeadEnd:
# prevent cycles in the references (i.e. base.loader.base)
for goesThrough in parentObjRef.goesThroughGen(child):
# don't yield, container might lose this element
pass
if not goesThrough:
objRef = ObjectRef(Indirection(evalStr='.__dict__'),
id(child), parentObjRef)
yield None
if hasLength:
for i in self._addContainerGen(child, objRef):
yield None
if notDeadEnd:
self._addDiscoveredStartRef(child, objRef)
curObjRef = objRef
continue
if type(curObj) is types.DictType:
key = None
attr = None
keys = curObj.keys()
# we will continue traversing the object graph via one key of the dict,
# choose it at random without taking a big chunk of CPU time
numKeysLeft = len(keys) + 1
for key in keys:
yield None
numKeysLeft -= 1
try:
attr = curObj[key]
except KeyError, e:
# this is OK because we are yielding during the iteration
self.notify.debug('could not index into %s with key %s' % (
parentObjRef, safeRepr(key)))
continue
hasLength = self._hasLength(attr)
notDeadEnd = False
# if we haven't picked the next ref, check if this one is a candidate
if curObjRef is None:
notDeadEnd = not self._isDeadEnd(attr, key)
if hasLength or notDeadEnd:
# prevent cycles in the references (i.e. base.loader.base)
for goesThrough in parentObjRef.goesThroughGen(curObj[key]):
# don't yield, container might lose this element
pass
if not goesThrough:
if curObj is __builtin__.__dict__:
objRef = ObjectRef(Indirection(evalStr='%s' % key),
id(curObj[key]))
else:
objRef = ObjectRef(Indirection(dictKey=key),
id(curObj[key]), parentObjRef)
yield None
if hasLength:
for i in self._addContainerGen(attr, objRef):
yield None
if notDeadEnd:
self._addDiscoveredStartRef(attr, objRef)
if curObjRef is None and random.randrange(numKeysLeft) == 0:
curObjRef = objRef
del key
del attr
continue
try:
childNames = dir(curObj)
except:
pass
else:
try:
index = -1
attrs = []
while 1:
yield None
try:
attr = itr.next()
except:
# some custom classes don't do well when iterated
attr = None
break
attrs.append(attr)
# we will continue traversing the object graph via one attr,
# choose it at random without taking a big chunk of CPU time
numAttrsLeft = len(attrs) + 1
for attr in attrs:
yield None
index += 1
numAttrsLeft -= 1
hasLength = self._hasLength(attr)
notDeadEnd = False
if curObjRef is None:
notDeadEnd = not self._isDeadEnd(attr)
if hasLength or notDeadEnd:
# prevent cycles in the references (i.e. base.loader.base)
for goesThrough in parentObjRef.goesThrough(curObj[index]):
# don't yield, container might lose this element
pass
if not goesThrough:
objRef = ObjectRef(Indirection(evalStr='[%s]' % index),
id(curObj[index]), parentObjRef)
yield None
if hasLength:
for i in self._addContainerGen(attr, objRef):
yield None
if notDeadEnd:
self._addDiscoveredStartRef(attr, objRef)
if curObjRef is None and random.randrange(numAttrsLeft) == 0:
curObjRef = objRef
del attr
except StopIteration, e:
pass
del itr
continue
except Exception, e:
print 'FindContainers job caught exception: %s' % e
if __dev__:
raise
yield Job.Done
class CheckContainers(Job):
"""
Job to check container sizes and find potential leaks; sub-job of ContainerLeakDetector
"""
ReprItems = 5
def __init__(self, name, leakDetector, index):
Job.__init__(self, name)
self._leakDetector = leakDetector
self.notify = self._leakDetector.notify
self._index = index
ContainerLeakDetector.addPrivateObj(self.__dict__)
def destroy(self):
ContainerLeakDetector.removePrivateObj(self.__dict__)
Job.destroy(self)
def getPriority(self):
return Job.Priorities.Normal
def run(self):
try:
self._leakDetector._index2containerId2len[self._index] = {}
ids = self._leakDetector.getContainerIds()
# record the current len of each container
for objId in ids:
yield None
try:
for result in self._leakDetector.getContainerByIdGen(objId):
yield None
container = result
except Exception, e:
# this container no longer exists
if self.notify.getDebug():
for contName in self._leakDetector.getContainerNameByIdGen(objId):
yield None
self.notify.debug(
'%s no longer exists; caught exception in getContainerById (%s)' % (
contName, e))
self._leakDetector.removeContainerById(objId)
continue
if container is None:
# this container no longer exists
if self.notify.getDebug():
for contName in self._leakDetector.getContainerNameByIdGen(objId):
yield None
self.notify.debug('%s no longer exists; getContainerById returned None' %
contName)
self._leakDetector.removeContainerById(objId)
continue
try:
cLen = len(container)
except Exception, e:
# this container no longer exists
if self.notify.getDebug():
for contName in self._leakDetector.getContainerNameByIdGen(objId):
yield None
self.notify.debug(
'%s is no longer a container, it is now %s (%s)' %
(contName, safeRepr(container), e))
self._leakDetector.removeContainerById(objId)
continue
self._leakDetector._index2containerId2len[self._index][objId] = cLen
# compare the current len of each container to past lens
if self._index > 0:
idx2id2len = self._leakDetector._index2containerId2len
for objId in idx2id2len[self._index]:
yield None
if objId in idx2id2len[self._index-1]:
diff = idx2id2len[self._index][objId] - idx2id2len[self._index-1][objId]
"""
# this check is too spammy
if diff > 20:
if diff > idx2id2len[self._index-1][objId]:
minutes = (self._leakDetector._index2delay[self._index] -
self._leakDetector._index2delay[self._index-1]) / 60.
name = self._leakDetector.getContainerNameById(objId)
if idx2id2len[self._index-1][objId] != 0:
percent = 100. * (float(diff) / float(idx2id2len[self._index-1][objId]))
try:
for container in self._leakDetector.getContainerByIdGen(objId):
yield None
except:
# TODO
self.notify.debug('caught exception in getContainerByIdGen (1)')
else:
self.notify.warning(
'%s (%s) grew %.2f%% in %.2f minutes (%s items at last measurement, current contents: %s)' % (
name, itype(container), percent, minutes, idx2id2len[self._index][objId],
fastRepr(container, maxLen=CheckContainers.ReprItems)))
yield None
"""
if (self._index > 2 and
objId in idx2id2len[self._index-2] and
objId in idx2id2len[self._index-3]):
diff2 = idx2id2len[self._index-1][objId] - idx2id2len[self._index-2][objId]
diff3 = idx2id2len[self._index-2][objId] - idx2id2len[self._index-3][objId]
if self._index <= 4:
if diff > 0 and diff2 > 0 and diff3 > 0:
name = self._leakDetector.getContainerNameById(objId)
try:
for container in self._leakDetector.getContainerByIdGen(objId):
yield None
except:
# TODO
self.notify.debug('caught exception in getContainerByIdGen (2)')
else:
msg = ('%s (%s) consistently increased in size over the last '
'3 periods (%s items at last measurement, current contents: %s)' %
(name, itype(container), idx2id2len[self._index][objId],
fastRepr(container, maxLen=CheckContainers.ReprItems)))
self.notify.warning(msg)
yield None
elif (objId in idx2id2len[self._index-4] and
objId in idx2id2len[self._index-5]):
# if size has consistently increased over the last 5 checks,
# send out a warning
diff4 = idx2id2len[self._index-3][objId] - idx2id2len[self._index-4][objId]
diff5 = idx2id2len[self._index-4][objId] - idx2id2len[self._index-5][objId]
if diff > 0 and diff2 > 0 and diff3 > 0 and diff4 > 0 and diff5 > 0:
name = self._leakDetector.getContainerNameById(objId)
try:
for container in self._leakDetector.getContainerByIdGen(objId):
yield None
except:
# TODO
self.notify.debug('caught exception in getContainerByIdGen (3)')
else:
msg = ('leak detected: %s (%s) consistently increased in size over the last '
'5 periods (%s items at last measurement, current contents: %s)' %
(name, itype(container), idx2id2len[self._index][objId],
fastRepr(container, maxLen=CheckContainers.ReprItems)))
self.notify.warning(msg)
yield None
messenger.send(self._leakDetector.getLeakEvent(), [container, name])
if config.GetBool('pdb-on-leak-detect', 0):
import pdb;pdb.set_trace()
pass
except Exception, e:
print 'CheckContainers job caught exception: %s' % e
if __dev__:
raise
yield Job.Done
class FPTObjsOfType(Job):
def __init__(self, name, leakDetector, otn, doneCallback=None):
Job.__init__(self, name)
self._leakDetector = leakDetector
self.notify = self._leakDetector.notify
self._otn = otn
self._doneCallback = doneCallback
self._ldde = self._leakDetector._getDestroyEvent()
self.accept(self._ldde, self._handleLDDestroy)
ContainerLeakDetector.addPrivateObj(self.__dict__)
def destroy(self):
self.ignore(self._ldde)
self._leakDetector = None
self._doneCallback = None
ContainerLeakDetector.removePrivateObj(self.__dict__)
Job.destroy(self)
def _handleLDDestroy(self):
self.destroy()
def getPriority(self):
return Job.Priorities.High
def run(self):
ids = self._leakDetector.getContainerIds()
try:
for id in ids:
getInstance = (self._otn.lower() not in 'dict')
yield None
try:
for container in self._leakDetector.getContainerByIdGen(
id, getInstance=getInstance):
yield None
except:
pass
else:
if hasattr(container, '__class__'):
cName = container.__class__.__name__
else:
cName = container.__name__
if (self._otn.lower() in cName.lower()):
try:
for ptc in self._leakDetector.getContainerNameByIdGen(
id, getInstance=getInstance):
yield None
except:
pass
else:
print 'GPTC(' + self._otn + '):' + self.getJobName() + ': ' + ptc
except Exception, e:
print 'FPTObjsOfType job caught exception: %s' % e
if __dev__:
raise
yield Job.Done
def finished(self):
if self._doneCallback:
self._doneCallback(self)
class FPTObjsNamed(Job):
def __init__(self, name, leakDetector, on, doneCallback=None):
Job.__init__(self, name)
self._leakDetector = leakDetector
self.notify = self._leakDetector.notify
self._on = on
self._doneCallback = doneCallback
self._ldde = self._leakDetector._getDestroyEvent()
self.accept(self._ldde, self._handleLDDestroy)
ContainerLeakDetector.addPrivateObj(self.__dict__)
def destroy(self):
self.ignore(self._ldde)
self._leakDetector = None
self._doneCallback = None
ContainerLeakDetector.removePrivateObj(self.__dict__)
Job.destroy(self)
def _handleLDDestroy(self):
self.destroy()
def getPriority(self):
return Job.Priorities.High
def run(self):
ids = self._leakDetector.getContainerIds()
try:
for id in ids:
yield None
try:
for container in self._leakDetector.getContainerByIdGen(id):
yield None
except:
pass
else:
name = self._leakDetector._id2ref[id].getFinalIndirectionStr()
if self._on.lower() in name.lower():
try:
for ptc in self._leakDetector.getContainerNameByIdGen(id):
yield None
except:
pass
else:
print 'GPTCN(' + self._on + '):' + self.getJobName() + ': ' + ptc
except Exception, e:
print 'FPTObjsNamed job caught exception: %s' % e
if __dev__:
raise
yield Job.Done
def finished(self):
if self._doneCallback:
self._doneCallback(self)
class PruneObjectRefs(Job):
"""
Job to destroy any container refs that are no longer valid.
Checks validity by asking for each container
"""
def __init__(self, name, leakDetector):
Job.__init__(self, name)
self._leakDetector = leakDetector
self.notify = self._leakDetector.notify
ContainerLeakDetector.addPrivateObj(self.__dict__)
def destroy(self):
ContainerLeakDetector.removePrivateObj(self.__dict__)
Job.destroy(self)
def getPriority(self):
return Job.Priorities.Normal
def run(self):
try:
ids = self._leakDetector.getContainerIds()
for id in ids:
yield None
try:
for container in self._leakDetector.getContainerByIdGen(id):
yield None
except:
# reference is invalid, remove it
self._leakDetector.removeContainerById(id)
_id2baseStartRef = self._leakDetector._findContainersJob._id2baseStartRef
ids = _id2baseStartRef.keys()
for id in ids:
yield None
try:
for container in _id2baseStartRef[id].getContainerGen():
yield None
except:
# reference is invalid, remove it
del _id2baseStartRef[id]
_id2discoveredStartRef = self._leakDetector._findContainersJob._id2discoveredStartRef
ids = _id2discoveredStartRef.keys()
for id in ids:
yield None
try:
for container in _id2discoveredStartRef[id].getContainerGen():
yield None
except:
# reference is invalid, remove it
del _id2discoveredStartRef[id]
except Exception, e:
print 'PruneObjectRefs job caught exception: %s' % e
if __dev__:
raise
yield Job.Done
class ContainerLeakDetector(Job):
"""
Low-priority Python object-graph walker that looks for leaking containers.
To reduce memory usage, this does a random walk of the Python objects to
discover containers rather than keep a set of all visited objects; it may
visit the same object many times but eventually it will discover every object.
Checks container sizes at ever-increasing intervals.
"""
notify = directNotify.newCategory("ContainerLeakDetector")
# set of containers that should not be examined
PrivateIds = set()
def __init__(self, name, firstCheckDelay = None):
Job.__init__(self, name)
self._serialNum = serialNum()
self._findContainersJob = None
self._checkContainersJob = None
self._pruneContainersJob = None
if firstCheckDelay is None:
firstCheckDelay = 60. * 15.
# divide by two, since the first check just takes length measurements and
# doesn't check for leaks
self._nextCheckDelay = firstCheckDelay/2.
self._checkDelayScale = config.GetFloat('leak-detector-check-delay-scale', 1.5)
self._pruneTaskPeriod = config.GetFloat('leak-detector-prune-period', 60. * 30.)
# main dict of id(container)->containerRef
self._id2ref = {}
# storage for results of check-container job
self._index2containerId2len = {}
self._index2delay = {}
if config.GetBool('leak-container', 0):
_createContainerLeak()
if config.GetBool('leak-tasks', 0):
_createTaskLeak()
# don't check our own tables for leaks
ContainerLeakDetector.addPrivateObj(ContainerLeakDetector.PrivateIds)
ContainerLeakDetector.addPrivateObj(self.__dict__)
self.setPriority(Job.Priorities.Min)
jobMgr.add(self)
def destroy(self):
messenger.send(self._getDestroyEvent())
self.ignoreAll()
if self._pruneContainersJob is not None:
jobMgr.remove(self._pruneContainersJob)
self._pruneContainersJob = None
if self._checkContainersJob is not None:
jobMgr.remove(self._checkContainersJob)
self._checkContainersJob = None
jobMgr.remove(self._findContainersJob)
self._findContainersJob = None
del self._id2ref
del self._index2containerId2len
del self._index2delay
def _getDestroyEvent(self):
# sent when leak detector is about to be destroyed
return 'cldDestroy-%s' % self._serialNum
def getLeakEvent(self):
# sent when a leak is detected
# passes description string as argument
return 'containerLeakDetected-%s' % self._serialNum
@classmethod
def addPrivateObj(cls, obj):
cls.PrivateIds.add(id(obj))
@classmethod
def removePrivateObj(cls, obj):
cls.PrivateIds.remove(id(obj))
def _getCheckTaskName(self):
return 'checkForLeakingContainers-%s' % self._serialNum
def _getPruneTaskName(self):
return 'pruneLeakingContainerRefs-%s' % self._serialNum
def getContainerIds(self):
return self._id2ref.keys()
def getContainerByIdGen(self, id, **kwArgs):
# return a generator to look up a container
return self._id2ref[id].getContainerGen(**kwArgs)
def getContainerById(self, id):
for result in self._id2ref[id].getContainerGen():
pass
return result
def getContainerNameByIdGen(self, id, **kwArgs):
return self._id2ref[id].getEvalStrGen(**kwArgs)
def getContainerNameById(self, id):
if id in self._id2ref:
return repr(self._id2ref[id])
return '<unknown container>'
def removeContainerById(self, id):
if id in self._id2ref:
self._id2ref[id].destroy()
del self._id2ref[id]
def run(self):
# start looking for containers
self._findContainersJob = FindContainers(
'%s-findContainers' % self.getJobName(), self)
jobMgr.add(self._findContainersJob)
self._scheduleNextLeakCheck()
self._scheduleNextPruning()
while True:
yield Job.Sleep
def getPathsToContainers(self, name, ot, doneCallback=None):
j = FPTObjsOfType(name, self, ot, doneCallback)
jobMgr.add(j)
return j
def getPathsToContainersNamed(self, name, on, doneCallback=None):
j = FPTObjsNamed(name, self, on, doneCallback)
jobMgr.add(j)
return j
def _scheduleNextLeakCheck(self):
taskMgr.doMethodLater(self._nextCheckDelay, self._checkForLeaks,
self._getCheckTaskName())
# delay between checks
# fib: 1 1 2 3 5 8 13 21 34 55 89
# * 2.: 1 2 4 8 16 32 64 128 256 512 1024
# * 1.5: 1 1.5 2.3 3.4 5.1 7.6 11.4 17.1 25.6 38.4 57.7
#
# delay from job start
# fib: 1 2 4 7 12 20 33 54 88 143 232
# * 2.: 1 3 7 15 31 63 127 255 511 1023 2047
# * 1.5: 1 2.5 4.75 8.1 13.2 20.8 32.2 49.3 74.9 113.3 171
self._nextCheckDelay = self._nextCheckDelay * self._checkDelayScale
def _checkForLeaks(self, task=None):
self._index2delay[len(self._index2containerId2len)] = self._nextCheckDelay
self._checkContainersJob = CheckContainers(
'%s-checkForLeaks' % self.getJobName(), self, len(self._index2containerId2len))
self.acceptOnce(self._checkContainersJob.getFinishedEvent(),
self._scheduleNextLeakCheck)
jobMgr.add(self._checkContainersJob)
return task.done
def _scheduleNextPruning(self):
taskMgr.doMethodLater(self._pruneTaskPeriod, self._pruneObjectRefs,
self._getPruneTaskName())
def _pruneObjectRefs(self, task=None):
self._pruneContainersJob = PruneObjectRefs(
'%s-pruneObjectRefs' % self.getJobName(), self)
self.acceptOnce(self._pruneContainersJob.getFinishedEvent(),
self._scheduleNextPruning)
jobMgr.add(self._pruneContainersJob)
return task.done
|
bsd-3-clause
|
[
504,
4125,
14,
2275,
6814,
14,
16281,
8645,
7025,
492,
4125,
8645,
199,
504,
4125,
14,
2384,
1095,
14,
4718,
9562,
492,
1852,
38,
590,
11798,
8168,
199,
504,
4125,
14,
2384,
1095,
14,
4718,
9562,
492,
284,
466,
12,
3012,
5667,
12,
5048,
15713,
12,
7377,
15713,
199,
504,
4125,
14,
2384,
1095,
14,
6694,
492,
15057,
199,
646,
2943,
12,
13852,
12,
2196,
12,
636,
5351,
363,
199,
199,
318,
485,
981,
4076,
2553,
1151,
837,
272,
347,
25831,
4076,
8,
1765,
29,
403,
304,
267,
1300,
275,
664,
1563,
342,
267,
340,
440,
2688,
8,
1095,
12,
283,
28212,
4076,
735,
288,
1300,
14,
28212,
4076,
275,
1052,
267,
327,
675,
6346,
465,
2883,
3967,
2985,
883,
1133,
506,
13852,
5121,
12,
436,
675,
376,
1256,
267,
327,
3967,
652,
883,
1133,
506,
4700,
15,
2579,
5121,
267,
327,
626,
911,
3542,
314,
25831,
17842,
370,
10266,
282,
3293,
283,
2865,
13,
10350,
7,
3659,
267,
1021,
7005,
1151,
1197,
26,
288,
986,
267,
1300,
14,
28212,
4076,
7528,
2553,
1151,
1197,
1062,
1874,
275,
1052,
267,
327,
511,
314,
2222,
13,
21330,
909,
3659,
7252,
267,
340,
2196,
14,
2355,
342,
665,
1275,
614,
26,
288,
790,
275,
2196,
14,
5095,
8,
1095,
14,
28212,
4076,
14,
1612,
1012,
288,
15395,
2553,
1151,
24402,
14,
6814,
14,
1757,
8,
355,
283,
264,
7665,
3659,
370,
25831,
4076,
790,
450,
83,
880,
652,
911,
506,
17516,
13,
22766,
7,
450,
5048,
15713,
8,
498,
430,
288,
2150,
1300,
14,
28212,
4076,
59,
498,
61,
267,
2120,
20752,
14,
1117,
3767,
22028,
8,
709,
12,
25831,
4076,
12,
283,
28212,
4076,
3295,
83,
7,
450,
3012,
5667,
1012,
267,
340,
2120,
26,
288,
372,
2120,
14,
4456,
272,
25831,
4076,
342,
199,
199,
318,
485,
981,
4476,
2553,
1151,
837,
272,
25831,
4476,
985,
275,
3747,
985,
360,
274,
16702,
4476,
358,
272,
25831,
2585,
22028,
985,
275,
3747,
985,
360,
274,
16702,
2585,
22028,
358,
272,
347,
2973,
4476,
8,
1765,
29,
403,
304,
267,
372,
2120,
14,
11096,
272,
347,
2973,
2585,
22028,
8,
1765,
29,
403,
304,
267,
372,
2120,
14,
4456,
272,
347,
25831,
4476,
8,
1765,
29,
403,
12,
25831,
4476,
985,
29,
28212,
4476,
985,
304,
267,
1300,
275,
664,
1563,
342,
267,
2120,
20752,
14,
525,
8,
2307,
4476,
12,
3747,
985,
8,
28212,
4476,
985,
430,
267,
2120,
20752,
14,
1117,
3767,
22028,
8,
17,
5213,
7105,
12,
2973,
2585,
22028,
12,
3747,
985,
8,
28212,
2585,
22028,
985,
430,
267,
2120,
20752,
14,
1117,
3767,
22028,
8,
709,
12,
25831,
4476,
12,
283,
1117,
2553,
1151,
4476,
3295,
83,
7,
450,
3012,
5667,
1012,
267,
340,
2120,
26,
288,
372,
2120,
14,
4456,
272,
25831,
4476,
342,
199,
199,
533,
3091,
2141,
1197,
26,
272,
986,
199,
199,
533,
1010,
6874,
26,
272,
408,
272,
21591,
314,
2539,
4017,
626,
11665,
780,
1265,
687,
282,
3970,
370,
376,
1819,
402,
314,
3970,
14,
272,
9785,
581,
465,
282,
1059,
370,
506,
1202,
465,
1777,
402,
376,
3468,
12,
503,
465,
282,
790,
370,
506,
21182,
1536,
315,
282,
1211,
14,
272,
7048,
2600,
477,
4443,
365,
7814,
3163,
3468,
5121,
3967,
314,
1211,
790,
5594,
1172,
2757,
272,
17516,
13,
22766,
272,
3254,
26,
3877,
1059,
7323,
626,
787,
15755,
402,
3326,
315,
314,
3503,
2656,
880,
626,
272,
2018,
911,
4215,
1373,
1331,
436,
7114,
4402,
4503,
272,
408,
272,
347,
636,
826,
721,
277,
12,
3468,
2848,
29,
403,
12,
1211,
1197,
29,
1944,
2141,
1197,
304,
267,
327,
340,
642,
365,
282,
2600,
4237,
12,
986,
1211,
1197,
3140,
402,
3468,
2848,
267,
291,
14,
2579,
2848,
275,
3468,
2848,
267,
291,
14,
807,
1197,
275,
3091,
2141,
1197,
267,
327,
365,
314,
1211,
1197,
282,
9282,
3659,
31,
267,
291,
423,
374,
18889,
2891,
275,
756,
267,
291,
423,
1121,
2353,
275,
378,
267,
340,
1211,
1197,
365,
440,
3091,
2141,
1197,
26,
288,
327,
340,
781,
883,
4700,
15,
2579,
314,
790,
12,
3877,
652,
465,
376,
3468,
2848,
288,
790,
15713,
275,
5048,
15713,
8,
807,
1197,
9,
288,
675,
10006,
275,
756,
288,
862,
26,
355,
790,
10006,
275,
3468,
8,
498,
15713,
9,
355,
675,
10006,
275,
715,
288,
871,
26,
355,
986,
288,
340,
675,
10006,
26,
355,
327,
1104,
370,
1852,
3238,
314,
3468,
19268,
355,
340,
2631,
8,
498,
10006,
9,
1137,
2631,
8,
807,
1197,
304,
490,
675,
10006,
275,
756,
288,
340,
675,
10006,
26,
355,
327,
3468,
15,
2722,
19268,
12,
3877,
465,
376,
3468,
2848,
355,
291,
14,
2579,
2848,
275,
30423,
83,
6616,
450,
790,
15713,
288,
587,
26,
355,
862,
26,
490,
327,
3877,
282,
13852,
370,
314,
790,
490,
291,
14,
807,
1197,
275,
13852,
14,
1121,
8,
807,
1197,
9,
490,
291,
423,
374,
18889,
2891,
275,
715,
355,
871,
3146,
12,
325,
26,
490,
15395,
2553,
1151,
24402,
14,
6814,
14,
1757,
360,
15153,
440,
13852,
1211,
790,
450,
83,
7,
450,
790,
15713,
9,
490,
291,
14,
807,
1197,
275,
1211,
1197,
490,
291,
423,
374,
18889,
2891,
275,
756,
339,
347,
11972,
8,
277,
304,
267,
327,
295,
13,
18626,
867,
267,
291,
14,
807,
1197,
275,
3091,
2141,
1197,
339,
347,
16919,
8,
277,
304,
267,
291,
423,
1121,
2353,
847,
413,
272,
347,
4683,
8,
277,
304,
267,
291,
423,
1121,
2353,
4862,
413,
267,
340,
291,
423,
1121,
2353,
508,
378,
26,
288,
291,
14,
7237,
342,
339,
347,
365,
2141,
1197,
8,
277,
304,
267,
327,
365,
642,
376,
2539,
4017,
4012,
282,
2600,
31,
267,
372,
291,
14,
807,
1197,
365,
440,
3091,
2141,
1197,
339,
347,
485,
362,
6932,
18889,
2141,
1197,
8,
277,
304,
267,
340,
440,
291,
423,
374,
18889,
2891,
26,
288,
372,
291,
14,
807,
1197,
267,
587,
26,
288,
790,
275,
291,
14,
807,
1197,
342,
288,
340,
790,
365,
488,
26,
355,
372,
2650,
28737,
13,
22766,
1211,
790,
3524,
288,
372,
790,
339,
347,
477,
4443,
2141,
1197,
8,
277,
12,
1676,
2141,
304,
267,
327,
3648,
26495,
1536,
315,
1676,
2141,
267,
790,
275,
291,
423,
362
] |
[
4125,
14,
2275,
6814,
14,
16281,
8645,
7025,
492,
4125,
8645,
199,
504,
4125,
14,
2384,
1095,
14,
4718,
9562,
492,
1852,
38,
590,
11798,
8168,
199,
504,
4125,
14,
2384,
1095,
14,
4718,
9562,
492,
284,
466,
12,
3012,
5667,
12,
5048,
15713,
12,
7377,
15713,
199,
504,
4125,
14,
2384,
1095,
14,
6694,
492,
15057,
199,
646,
2943,
12,
13852,
12,
2196,
12,
636,
5351,
363,
199,
199,
318,
485,
981,
4076,
2553,
1151,
837,
272,
347,
25831,
4076,
8,
1765,
29,
403,
304,
267,
1300,
275,
664,
1563,
342,
267,
340,
440,
2688,
8,
1095,
12,
283,
28212,
4076,
735,
288,
1300,
14,
28212,
4076,
275,
1052,
267,
327,
675,
6346,
465,
2883,
3967,
2985,
883,
1133,
506,
13852,
5121,
12,
436,
675,
376,
1256,
267,
327,
3967,
652,
883,
1133,
506,
4700,
15,
2579,
5121,
267,
327,
626,
911,
3542,
314,
25831,
17842,
370,
10266,
282,
3293,
283,
2865,
13,
10350,
7,
3659,
267,
1021,
7005,
1151,
1197,
26,
288,
986,
267,
1300,
14,
28212,
4076,
7528,
2553,
1151,
1197,
1062,
1874,
275,
1052,
267,
327,
511,
314,
2222,
13,
21330,
909,
3659,
7252,
267,
340,
2196,
14,
2355,
342,
665,
1275,
614,
26,
288,
790,
275,
2196,
14,
5095,
8,
1095,
14,
28212,
4076,
14,
1612,
1012,
288,
15395,
2553,
1151,
24402,
14,
6814,
14,
1757,
8,
355,
283,
264,
7665,
3659,
370,
25831,
4076,
790,
450,
83,
880,
652,
911,
506,
17516,
13,
22766,
7,
450,
5048,
15713,
8,
498,
430,
288,
2150,
1300,
14,
28212,
4076,
59,
498,
61,
267,
2120,
20752,
14,
1117,
3767,
22028,
8,
709,
12,
25831,
4076,
12,
283,
28212,
4076,
3295,
83,
7,
450,
3012,
5667,
1012,
267,
340,
2120,
26,
288,
372,
2120,
14,
4456,
272,
25831,
4076,
342,
199,
199,
318,
485,
981,
4476,
2553,
1151,
837,
272,
25831,
4476,
985,
275,
3747,
985,
360,
274,
16702,
4476,
358,
272,
25831,
2585,
22028,
985,
275,
3747,
985,
360,
274,
16702,
2585,
22028,
358,
272,
347,
2973,
4476,
8,
1765,
29,
403,
304,
267,
372,
2120,
14,
11096,
272,
347,
2973,
2585,
22028,
8,
1765,
29,
403,
304,
267,
372,
2120,
14,
4456,
272,
347,
25831,
4476,
8,
1765,
29,
403,
12,
25831,
4476,
985,
29,
28212,
4476,
985,
304,
267,
1300,
275,
664,
1563,
342,
267,
2120,
20752,
14,
525,
8,
2307,
4476,
12,
3747,
985,
8,
28212,
4476,
985,
430,
267,
2120,
20752,
14,
1117,
3767,
22028,
8,
17,
5213,
7105,
12,
2973,
2585,
22028,
12,
3747,
985,
8,
28212,
2585,
22028,
985,
430,
267,
2120,
20752,
14,
1117,
3767,
22028,
8,
709,
12,
25831,
4476,
12,
283,
1117,
2553,
1151,
4476,
3295,
83,
7,
450,
3012,
5667,
1012,
267,
340,
2120,
26,
288,
372,
2120,
14,
4456,
272,
25831,
4476,
342,
199,
199,
533,
3091,
2141,
1197,
26,
272,
986,
199,
199,
533,
1010,
6874,
26,
272,
408,
272,
21591,
314,
2539,
4017,
626,
11665,
780,
1265,
687,
282,
3970,
370,
376,
1819,
402,
314,
3970,
14,
272,
9785,
581,
465,
282,
1059,
370,
506,
1202,
465,
1777,
402,
376,
3468,
12,
503,
465,
282,
790,
370,
506,
21182,
1536,
315,
282,
1211,
14,
272,
7048,
2600,
477,
4443,
365,
7814,
3163,
3468,
5121,
3967,
314,
1211,
790,
5594,
1172,
2757,
272,
17516,
13,
22766,
272,
3254,
26,
3877,
1059,
7323,
626,
787,
15755,
402,
3326,
315,
314,
3503,
2656,
880,
626,
272,
2018,
911,
4215,
1373,
1331,
436,
7114,
4402,
4503,
272,
408,
272,
347,
636,
826,
721,
277,
12,
3468,
2848,
29,
403,
12,
1211,
1197,
29,
1944,
2141,
1197,
304,
267,
327,
340,
642,
365,
282,
2600,
4237,
12,
986,
1211,
1197,
3140,
402,
3468,
2848,
267,
291,
14,
2579,
2848,
275,
3468,
2848,
267,
291,
14,
807,
1197,
275,
3091,
2141,
1197,
267,
327,
365,
314,
1211,
1197,
282,
9282,
3659,
31,
267,
291,
423,
374,
18889,
2891,
275,
756,
267,
291,
423,
1121,
2353,
275,
378,
267,
340,
1211,
1197,
365,
440,
3091,
2141,
1197,
26,
288,
327,
340,
781,
883,
4700,
15,
2579,
314,
790,
12,
3877,
652,
465,
376,
3468,
2848,
288,
790,
15713,
275,
5048,
15713,
8,
807,
1197,
9,
288,
675,
10006,
275,
756,
288,
862,
26,
355,
790,
10006,
275,
3468,
8,
498,
15713,
9,
355,
675,
10006,
275,
715,
288,
871,
26,
355,
986,
288,
340,
675,
10006,
26,
355,
327,
1104,
370,
1852,
3238,
314,
3468,
19268,
355,
340,
2631,
8,
498,
10006,
9,
1137,
2631,
8,
807,
1197,
304,
490,
675,
10006,
275,
756,
288,
340,
675,
10006,
26,
355,
327,
3468,
15,
2722,
19268,
12,
3877,
465,
376,
3468,
2848,
355,
291,
14,
2579,
2848,
275,
30423,
83,
6616,
450,
790,
15713,
288,
587,
26,
355,
862,
26,
490,
327,
3877,
282,
13852,
370,
314,
790,
490,
291,
14,
807,
1197,
275,
13852,
14,
1121,
8,
807,
1197,
9,
490,
291,
423,
374,
18889,
2891,
275,
715,
355,
871,
3146,
12,
325,
26,
490,
15395,
2553,
1151,
24402,
14,
6814,
14,
1757,
360,
15153,
440,
13852,
1211,
790,
450,
83,
7,
450,
790,
15713,
9,
490,
291,
14,
807,
1197,
275,
1211,
1197,
490,
291,
423,
374,
18889,
2891,
275,
756,
339,
347,
11972,
8,
277,
304,
267,
327,
295,
13,
18626,
867,
267,
291,
14,
807,
1197,
275,
3091,
2141,
1197,
339,
347,
16919,
8,
277,
304,
267,
291,
423,
1121,
2353,
847,
413,
272,
347,
4683,
8,
277,
304,
267,
291,
423,
1121,
2353,
4862,
413,
267,
340,
291,
423,
1121,
2353,
508,
378,
26,
288,
291,
14,
7237,
342,
339,
347,
365,
2141,
1197,
8,
277,
304,
267,
327,
365,
642,
376,
2539,
4017,
4012,
282,
2600,
31,
267,
372,
291,
14,
807,
1197,
365,
440,
3091,
2141,
1197,
339,
347,
485,
362,
6932,
18889,
2141,
1197,
8,
277,
304,
267,
340,
440,
291,
423,
374,
18889,
2891,
26,
288,
372,
291,
14,
807,
1197,
267,
587,
26,
288,
790,
275,
291,
14,
807,
1197,
342,
288,
340,
790,
365,
488,
26,
355,
372,
2650,
28737,
13,
22766,
1211,
790,
3524,
288,
372,
790,
339,
347,
477,
4443,
2141,
1197,
8,
277,
12,
1676,
2141,
304,
267,
327,
3648,
26495,
1536,
315,
1676,
2141,
267,
790,
275,
291,
423,
362,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
guanxi55nba/db-improvement
|
pylib/cqlshlib/test/test_cqlsh_invocation.py
|
160
|
1941
|
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# to configure behavior, define $CQL_TEST_HOST to the destination address
# for Thrift connections, and $CQL_TEST_PORT to the associated port.
from .basecase import BaseTestCase
class TestCqlshInvocation(BaseTestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_normal_run(self):
pass
def test_python_interpreter_location(self):
pass
def test_color_capability_detection(self):
pass
def test_colored_output(self):
pass
def test_color_cmdline_option(self):
pass
def test_debug_option(self):
pass
def test_connection_args(self):
pass
def test_connection_config(self):
pass
def test_connection_envvars(self):
pass
def test_command_history(self):
pass
def test_missing_dependencies(self):
pass
def test_completekey_config(self):
pass
def test_ctrl_c(self):
pass
def test_eof(self):
pass
def test_output_encoding_detection(self):
pass
def test_output_encoding(self):
pass
def test_retries(self):
pass
|
apache-2.0
|
[
3,
3909,
370,
314,
3668,
2290,
2752,
334,
14950,
9,
1334,
1373,
199,
3,
503,
1655,
11615,
4190,
14024,
14,
221,
1666,
314,
12840,
570,
199,
3,
1854,
543,
642,
1736,
367,
4722,
2556,
199,
3,
12602,
4248,
12715,
14,
221,
710,
14857,
12378,
642,
570,
199,
3,
370,
1265,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
199,
3,
298,
3761,
3547,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
199,
3,
543,
314,
844,
14,
221,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
199,
3,
370,
7908,
5953,
12,
5627,
2672,
35,
2940,
63,
2864,
63,
5449,
370,
314,
5724,
2287,
199,
3,
367,
3868,
6501,
6947,
12,
436,
2672,
35,
2940,
63,
2864,
63,
3657,
370,
314,
4568,
1844,
14,
199,
199,
504,
1275,
1095,
2546,
492,
3523,
1746,
199,
199,
533,
1379,
35,
81,
23025,
14883,
13364,
8,
20760,
304,
272,
347,
3613,
8,
277,
304,
267,
986,
339,
347,
6766,
8,
277,
304,
267,
986,
339,
347,
511,
63,
3302,
63,
1065,
8,
277,
304,
267,
986,
339,
347,
511,
63,
1548,
63,
20244,
63,
1985,
8,
277,
304,
267,
986,
339,
347,
511,
63,
2326,
63,
21181,
63,
11934,
8,
277,
304,
267,
986,
339,
347,
511,
63,
331,
21252,
63,
1199,
8,
277,
304,
267,
986,
339,
347,
511,
63,
2326,
63,
15612,
63,
1422,
8,
277,
304,
267,
986,
339,
347,
511,
63,
1757,
63,
1422,
8,
277,
304,
267,
986,
339,
347,
511,
63,
2105,
63,
589,
8,
277,
304,
267,
986,
339,
347,
511,
63,
2105,
63,
888,
8,
277,
304,
267,
986,
339,
347,
511,
63,
2105,
63,
1813,
2936,
8,
277,
304,
267,
986,
339,
347,
511,
63,
1531,
63,
5570,
8,
277,
304,
267,
986,
339,
347,
511,
63,
4752,
63,
5714,
8,
277,
304,
267,
986,
339,
347,
511,
63,
4883,
498,
63,
888,
8,
277,
304,
267,
986,
339,
347,
511,
63,
12476,
63,
67,
8,
277,
304,
267,
986,
339,
347,
511,
63,
11670,
8,
277,
304,
267,
986,
339,
347,
511,
63,
1199,
63,
2991,
63,
11934,
8,
277,
304,
267,
986,
339,
347,
511,
63,
1199,
63,
2991,
8,
277,
304,
267,
986,
339,
347,
511,
63,
10937,
8,
277,
304,
267,
986,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
3909,
370,
314,
3668,
2290,
2752,
334,
14950,
9,
1334,
1373,
199,
3,
503,
1655,
11615,
4190,
14024,
14,
221,
1666,
314,
12840,
570,
199,
3,
1854,
543,
642,
1736,
367,
4722,
2556,
199,
3,
12602,
4248,
12715,
14,
221,
710,
14857,
12378,
642,
570,
199,
3,
370,
1265,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
199,
3,
298,
3761,
3547,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
199,
3,
543,
314,
844,
14,
221,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
199,
3,
370,
7908,
5953,
12,
5627,
2672,
35,
2940,
63,
2864,
63,
5449,
370,
314,
5724,
2287,
199,
3,
367,
3868,
6501,
6947,
12,
436,
2672,
35,
2940,
63,
2864,
63,
3657,
370,
314,
4568,
1844,
14,
199,
199,
504,
1275,
1095,
2546,
492,
3523,
1746,
199,
199,
533,
1379,
35,
81,
23025,
14883,
13364,
8,
20760,
304,
272,
347,
3613,
8,
277,
304,
267,
986,
339,
347,
6766,
8,
277,
304,
267,
986,
339,
347,
511,
63,
3302,
63,
1065,
8,
277,
304,
267,
986,
339,
347,
511,
63,
1548,
63,
20244,
63,
1985,
8,
277,
304,
267,
986,
339,
347,
511,
63,
2326,
63,
21181,
63,
11934,
8,
277,
304,
267,
986,
339,
347,
511,
63,
331,
21252,
63,
1199,
8,
277,
304,
267,
986,
339,
347,
511,
63,
2326,
63,
15612,
63,
1422,
8,
277,
304,
267,
986,
339,
347,
511,
63,
1757,
63,
1422,
8,
277,
304,
267,
986,
339,
347,
511,
63,
2105,
63,
589,
8,
277,
304,
267,
986,
339,
347,
511,
63,
2105,
63,
888,
8,
277,
304,
267,
986,
339,
347,
511,
63,
2105,
63,
1813,
2936,
8,
277,
304,
267,
986,
339,
347,
511,
63,
1531,
63,
5570,
8,
277,
304,
267,
986,
339,
347,
511,
63,
4752,
63,
5714,
8,
277,
304,
267,
986,
339,
347,
511,
63,
4883,
498,
63,
888,
8,
277,
304,
267,
986,
339,
347,
511,
63,
12476,
63,
67,
8,
277,
304,
267,
986,
339,
347,
511,
63,
11670,
8,
277,
304,
267,
986,
339,
347,
511,
63,
1199,
63,
2991,
63,
11934,
8,
277,
304,
267,
986,
339,
347,
511,
63,
1199,
63,
2991,
8,
277,
304,
267,
986,
339,
347,
511,
63,
10937,
8,
277,
304,
267,
986,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
gkoh/pynab
|
scripts/nzedb_pre_import.py
|
2
|
7655
|
"""
Pynab nzedb pre import
Imports pre files from nzedb dropbox
Usage:
nzedb_pre_import.py large|small
Options:
-h --help Show this screen.
--version Show version.
"""
# This is quite possibly the most hilariously complex import process...
# What I can gather as the column names from the csv, in case anyone else wants to do this.
# title 1, nfo, size, files, filename 9, nuked 11, nukereason, category 15 , predate 17, source 19, requestid 21, groupname 23
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
from pynab.db import db_session, engine, Pre, copy_file
from pynab import releases
import urllib
import regex
import json
import io
from docopt import docopt
from pySmartDL import SmartDL
# Panadas is required
try:
import pandas
except:
print("pandas is required to use nzedb pre import: pip install pandas")
# BeautifulSoup is required
try:
from bs4 import BeautifulSoup
except:
print("BeautifulSoup is required to use nzedb pre import: pip install beautifulsoup4")
# Regex used to strip out the file name
FILENAME_REGEX = regex.compile(
"https:\/\/raw.githubusercontent.com\/nZEDb\/nZEDbPre_Dumps\/master\/dumps\/(?P<lastfile>.+)_.+_.+")
COLNAMES = ["name", "filename", "nuked", "category", "pretime", "source", "requestid", "requestgroup"]
INSERTFAILS = []
def nzedbPre():
downloadLinks = []
try:
rawpreJSON = urllib.request.urlopen("https://api.github.com/repositories/45781004/contents/dumps").read()
except:
print("pre-import: Error connecting to dropbox, try again later")
try:
data = open('lastfile.json')
lastFileFromDisk = json.load(data)
except:
print("pre-import: No existinfg file found, will attempt to download and insert all pres")
lastFileFromDisk = None
preJSON = json.loads(rawpreJSON.decode('utf8'))
for x in preJSON:
if x["name"] != "0README.txt":
downloadLinks.append(x["download_url"])
# Try and process each of the csv's. If they are
for preCSV in downloadLinks:
processingFile = FILENAME_REGEX.search(preCSV).groupdict()
if lastFileFromDisk is None or int(processingFile['lastfile']) > lastFileFromDisk['lastfile']:
try:
print("pre-import: Attempting to download file: {}".format(processingFile['lastfile']))
urllib.request.urlretrieve(preCSV, "unformattedDL.gz")
except:
print("pre-import: Error downloading: {} - Please run the process again".format(preCSV))
INSERTFAILS.append(processingFile['lastfile'])
# The assumption here is, if one fails, you should probably just start again at that file.
break
# Get the data into datatable, much easier to work with.
dirtyFile = pandas.read_csv('unformattedDL.gz', sep='\t', compression='gzip', header=None, na_values='\\N',
usecols=[0, 8, 10, 14, 16, 18, 20, 22], names=COLNAMES)
# Clean and process the file
process(dirtyFile, processingFile)
else:
print("pre-import: More than likely {} has already been imported".format(processingFile['lastfile']))
pass
if INSERTFAILS is not None:
print("pre-import: Failures: {}".format(INSERTFAILS))
def largeNzedbPre():
if os.path.isfile('predb_dump-062714.csv.gz'):
fileExists = True
else:
try:
url = "https://www.dropbox.com/s/btr42dtzzyu3hh3/predb_dump-062714.csv.gz?dl=1"
dest = "."
print("pre-import: File predb_dump-062714.csv not found, attempt to download - may take a while, its 300mb")
obj = SmartDL(url, dest)
obj.start()
fileExists = True
except:
print("pre-import: Error downloading/unzipping. Please try again.")
exit(0)
if fileExists:
dirtyChunk = pandas.read_table('predb_dump-062714.csv.gz', compression='gzip', sep='\t', header=None,
na_values='\\N', usecols=[0, 8, 10, 14, 16, 18, 20, 22], names=COLNAMES,
chunksize=10000, engine='c', error_bad_lines=False, warn_bad_lines=False)
else:
print("pre-import: File predb_dump-062714.csv not found, please try again.")
exit(0)
i = 0
for chunk in dirtyChunk:
process(chunk)
print("pre-import: Imported chunk {}".format(i))
i += 1
def process(precsv, processingFile=None):
ordering = ['name', 'filename', 'nuked', 'category', 'pretime', 'source', 'requestid', 'requestgroup', 'searchname']
# Clean up the file a bit.
precsv.replace("'", "", inplace=True, regex=True)
precsv["nuked"].replace("2", "0", inplace=True)
precsv["nuked"].replace("3", "1", inplace=True)
precsv["nuked"].replace("4", "1", inplace=True)
precsv["nuked"].replace("5", "1", inplace=True)
precsv["nuked"].replace("69", "0", inplace=True)
precsv.replace(".\\N$", '', inplace=True, regex=True)
# Sometimes there are duplicates within the table itself, remove them
precsv.drop_duplicates(subset='name', take_last=True, inplace=True)
# Add clean searchname column
precsv['searchname'] = precsv['name'].map(lambda name: releases.clean_release_name(name))
# Drop the pres without requestid's
precsv = precsv[precsv.requestid != '0']
# Create a list of names to check if they exist
names = list(precsv.name)
# Query to find any existing pres, we need to delete them so COPY doesn't fail
prenamelist = []
with db_session() as db:
if names:
pres = db.query(Pre).filter(Pre.name.in_(names)).all()
for pre in pres:
prenamelist.append(pre.name)
data = io.StringIO()
precsv.to_csv(data, index=False, header=False)
# Delete any pres found as we are essentially going to update them
if prenamelist:
for pre in pres:
db.delete(pre)
db.commit()
print("pre-import: Deleted {} pres that will re-inserted".format(len(prenamelist)))
else:
print("pre-import: File clean, no pres need to be deleted before re-insert")
try:
if processingFile is not None:
print("pre-import: Attempting to add {} to the database".format(processingFile['lastfile']))
data.seek(0)
copy_file(engine, data, ordering, Pre)
# Write out the last pre csv name so it can be restarted later without downloading all the pres.
with open('lastfile.json', 'w') as outfile:
json.dump({'lastfile': int(processingFile['lastfile'])}, outfile)
else:
data.seek(0)
copy_file(engine, data, ordering, Pre)
data.close()
print("pre-import: Chunk import successful")
except Exception as e:
print("pre-import: Error inserting into database - {}".format(e))
if processingFile is not None:
INSERTFAILS.append(processingFile['lastfile'])
else:
print("pre-import: Error processing chunk")
if __name__ == '__main__':
arguments = docopt(__doc__)
if arguments['small']:
nzedbPre()
elif arguments['large']:
largeNzedbPre()
|
gpl-2.0
|
[
624,
202,
199,
48,
1236,
371,
302,
7068,
66,
876,
492,
2999,
199,
32447,
876,
1584,
687,
302,
7068,
66,
5978,
1977,
2999,
199,
7692,
26,
1128,
302,
7068,
66,
63,
657,
63,
646,
14,
647,
7031,
92,
7241,
2999,
199,
4558,
26,
1128,
446,
72,
1553,
3437,
755,
12968,
642,
6426,
14,
1128,
1553,
1023,
755,
12968,
1015,
14,
2999,
199,
624,
202,
199,
3,
961,
365,
18794,
12570,
314,
4750,
394,
382,
759,
1785,
590,
6114,
492,
2112,
1396,
202,
199,
3,
14791,
473,
883,
13082,
465,
314,
2763,
1561,
687,
314,
7392,
12,
315,
1930,
29165,
587,
15061,
370,
886,
642,
14,
202,
199,
3,
2538,
413,
12,
302,
545,
12,
1568,
12,
1584,
12,
1788,
1749,
12,
302,
3210,
379,
4119,
12,
15699,
415,
5764,
12,
4637,
4114,
2360,
8869,
323,
5557,
12,
1350,
5851,
12,
1056,
344,
7829,
12,
1572,
354,
6546,
2999,
199,
646,
747,
202,
199,
646,
984,
2999,
199,
1274,
14,
515,
14,
740,
8,
736,
14,
515,
14,
904,
8,
736,
14,
515,
14,
3475,
8,
736,
14,
515,
14,
11091,
3460,
493,
22159,
11541,
1333,
2999,
199,
504,
1134,
78,
371,
14,
697,
492,
1592,
63,
1730,
12,
6869,
12,
5543,
12,
1331,
63,
493,
202,
199,
504,
1134,
78,
371,
492,
19015,
202,
199,
646,
4011,
202,
199,
646,
5163,
202,
199,
646,
2022,
202,
199,
646,
5890,
202,
199,
504,
886,
32626,
492,
886,
32626,
202,
199,
504,
1134,
29111,
8045,
492,
26017,
8045,
2999,
199,
3,
510,
290,
350,
305,
365,
1415,
202,
199,
893,
26,
1128,
492,
10634,
202,
199,
2590,
26,
1128,
870,
480,
15718,
365,
1415,
370,
675,
302,
7068,
66,
876,
492,
26,
7305,
3907,
10634,
531,
2999,
199,
3,
17132,
365,
1415,
202,
199,
893,
26,
1128,
687,
9922,
20,
492,
17132,
202,
199,
2590,
26,
1128,
870,
480,
30117,
12341,
365,
1415,
370,
675,
302,
7068,
66,
876,
492,
26,
7305,
3907,
506,
25146,
9317,
20,
531,
2999,
199,
3,
12939,
1202,
370,
6202,
734,
314,
570,
536,
202,
199,
15440,
63,
10710,
275,
5163,
14,
2014,
8,
1128,
298,
2859,
3427,
6307,
15,
1773,
14,
5031,
751,
1317,
14,
957,
19814,
78,
58,
1149,
66,
19814,
78,
58,
1149,
66,
2398,
63,
11772,
83,
19814,
4133,
19814,
4180,
60,
9448,
48,
28,
2019,
493,
31411,
9,
3754,
11,
3754,
21425,
202,
199,
3978,
14546,
275,
2097,
354,
401,
298,
1501,
401,
298,
78,
3210,
379,
401,
298,
3710,
401,
298,
657,
521,
401,
298,
1365,
401,
298,
1069,
344,
401,
298,
1069,
923,
937,
202,
199,
10258,
8784,
51,
275,
942,
8065,
199,
318,
302,
7068,
66,
2398,
837,
1128,
5235,
16974,
275,
942,
1128,
862,
26,
1039,
3066,
657,
6243,
275,
4011,
14,
1069,
14,
10890,
480,
2859,
921,
1246,
14,
5031,
14,
957,
15,
23949,
15,
20,
14992,
1960,
20,
15,
4407,
15,
4180,
3471,
739,
342,
1128,
871,
26,
1039,
870,
480,
657,
13,
646,
26,
4520,
18170,
370,
5978,
1977,
12,
862,
4020,
2945,
531,
2958,
862,
26,
1039,
666,
275,
1551,
360,
2019,
493,
14,
1001,
358,
1039,
2061,
1173,
2532,
10690,
275,
2022,
14,
912,
8,
576,
9,
1128,
871,
26,
1039,
870,
480,
657,
13,
646,
26,
3091,
2187,
4904,
71,
570,
1911,
12,
911,
7427,
370,
5235,
436,
5518,
1006,
25210,
531,
1039,
2061,
1173,
2532,
10690,
275,
488,
2958,
876,
6243,
275,
2022,
14,
3640,
8,
1773,
657,
6243,
14,
2708,
360,
1624,
24,
1333,
2958,
367,
671,
315,
876,
6243,
26,
1039,
340,
671,
905,
354,
937,
1137,
298,
16,
18195,
14,
2424,
582,
1675,
5235,
16974,
14,
740,
8,
88,
905,
4249,
63,
633,
3135,
2958,
327,
7649,
436,
2112,
1924,
402,
314,
7392,
1159,
14,
982,
2985,
787,
1128,
367,
876,
19018,
315,
5235,
16974,
26,
1039,
6661,
1173,
275,
16444,
11536,
63,
10710,
14,
1733,
8,
657,
19018,
680,
20567,
342,
4341,
340,
2061,
1173,
2532,
10690,
365,
488,
503,
1109,
8,
6338,
1173,
459,
2019,
493,
1105,
690,
2061,
1173,
2532,
10690,
459,
2019,
493,
2565,
11556,
862,
26,
2628,
870,
480,
657,
13,
646,
26,
17413,
1337,
370,
5235,
570,
26,
8352,
908,
8,
6338,
1173,
459,
2019,
493,
5156,
2628,
4011,
14,
1069,
14,
633,
14270,
8,
657,
19018,
12,
298,
324,
15317,
8045,
14,
6838,
531,
1675,
871,
26,
2628,
870,
480,
657,
13,
646,
26,
4520,
25937,
26,
1052,
446,
7754,
1255,
314,
2112,
4020,
1674,
908,
8,
657,
19018,
430,
2628,
22542,
8784,
51,
14,
740,
8,
6338,
1173,
459,
2019,
493,
1105,
2628,
327,
710,
30075,
2348,
365,
12,
340,
1373,
6918,
12,
1265,
1077,
8646,
2951,
1343,
4020,
737,
626,
570,
14,
2628,
2059,
11556,
327,
2372,
314,
666,
1901,
6394,
15511,
12,
8298,
14905,
370,
1736,
543,
14,
1675,
14650,
1173,
275,
10634,
14,
739,
63,
4737,
360,
324,
15317,
8045,
14,
6838,
297,
7375,
17115,
84,
297,
10291,
534,
12256,
297,
1406,
29,
403,
12,
11802,
63,
1459,
534,
1103,
46,
297,
202,
3147,
675,
4574,
1524,
16,
12,
1695,
12,
1616,
12,
4329,
12,
3193,
12,
6155,
12,
3388,
12,
6928,
467,
1561,
29,
3978,
14546,
9,
11556,
327,
12762,
436,
2112,
314,
570,
1675,
2112,
8,
8799,
1173,
12,
6661,
1173,
9,
4341,
587,
26,
1675,
870,
480,
657,
13,
646,
26,
16917,
2419,
12060,
1052,
965,
2575,
2757,
8439,
1674,
908,
8,
6338,
1173,
459,
2019,
493,
5156,
1675,
986,
2958,
340,
22542,
8784,
51,
365,
440,
488,
26,
1039,
870,
480,
657,
13,
646,
26,
12176,
1482,
26,
8352,
908,
8,
10258,
8784,
51,
430,
8065,
199,
318,
7031,
46,
7068,
66,
2398,
837,
1128,
340,
747,
14,
515,
14,
6292,
360,
5991,
66,
63,
2724,
13,
1690,
1465,
1079,
14,
4737,
14,
6838,
735,
1039,
570,
7965,
275,
715,
1128,
587,
26,
1039,
862,
26,
1675,
1166,
275,
298,
2859,
921,
1544,
14,
32118,
14,
957,
15,
83,
15,
66,
454,
2260,
3583,
90,
3605,
85,
19,
12156,
19,
15,
5991,
66,
63,
2724,
13,
1690,
1465,
1079,
14,
4737,
14,
6838,
31,
5030,
29,
17,
2,
1675,
2053,
275,
14530,
11556,
870,
480,
657,
13,
646,
26,
3814,
8869,
66,
63,
2724,
13,
1690,
1465
] |
[
202,
199,
48,
1236,
371,
302,
7068,
66,
876,
492,
2999,
199,
32447,
876,
1584,
687,
302,
7068,
66,
5978,
1977,
2999,
199,
7692,
26,
1128,
302,
7068,
66,
63,
657,
63,
646,
14,
647,
7031,
92,
7241,
2999,
199,
4558,
26,
1128,
446,
72,
1553,
3437,
755,
12968,
642,
6426,
14,
1128,
1553,
1023,
755,
12968,
1015,
14,
2999,
199,
624,
202,
199,
3,
961,
365,
18794,
12570,
314,
4750,
394,
382,
759,
1785,
590,
6114,
492,
2112,
1396,
202,
199,
3,
14791,
473,
883,
13082,
465,
314,
2763,
1561,
687,
314,
7392,
12,
315,
1930,
29165,
587,
15061,
370,
886,
642,
14,
202,
199,
3,
2538,
413,
12,
302,
545,
12,
1568,
12,
1584,
12,
1788,
1749,
12,
302,
3210,
379,
4119,
12,
15699,
415,
5764,
12,
4637,
4114,
2360,
8869,
323,
5557,
12,
1350,
5851,
12,
1056,
344,
7829,
12,
1572,
354,
6546,
2999,
199,
646,
747,
202,
199,
646,
984,
2999,
199,
1274,
14,
515,
14,
740,
8,
736,
14,
515,
14,
904,
8,
736,
14,
515,
14,
3475,
8,
736,
14,
515,
14,
11091,
3460,
493,
22159,
11541,
1333,
2999,
199,
504,
1134,
78,
371,
14,
697,
492,
1592,
63,
1730,
12,
6869,
12,
5543,
12,
1331,
63,
493,
202,
199,
504,
1134,
78,
371,
492,
19015,
202,
199,
646,
4011,
202,
199,
646,
5163,
202,
199,
646,
2022,
202,
199,
646,
5890,
202,
199,
504,
886,
32626,
492,
886,
32626,
202,
199,
504,
1134,
29111,
8045,
492,
26017,
8045,
2999,
199,
3,
510,
290,
350,
305,
365,
1415,
202,
199,
893,
26,
1128,
492,
10634,
202,
199,
2590,
26,
1128,
870,
480,
15718,
365,
1415,
370,
675,
302,
7068,
66,
876,
492,
26,
7305,
3907,
10634,
531,
2999,
199,
3,
17132,
365,
1415,
202,
199,
893,
26,
1128,
687,
9922,
20,
492,
17132,
202,
199,
2590,
26,
1128,
870,
480,
30117,
12341,
365,
1415,
370,
675,
302,
7068,
66,
876,
492,
26,
7305,
3907,
506,
25146,
9317,
20,
531,
2999,
199,
3,
12939,
1202,
370,
6202,
734,
314,
570,
536,
202,
199,
15440,
63,
10710,
275,
5163,
14,
2014,
8,
1128,
298,
2859,
3427,
6307,
15,
1773,
14,
5031,
751,
1317,
14,
957,
19814,
78,
58,
1149,
66,
19814,
78,
58,
1149,
66,
2398,
63,
11772,
83,
19814,
4133,
19814,
4180,
60,
9448,
48,
28,
2019,
493,
31411,
9,
3754,
11,
3754,
21425,
202,
199,
3978,
14546,
275,
2097,
354,
401,
298,
1501,
401,
298,
78,
3210,
379,
401,
298,
3710,
401,
298,
657,
521,
401,
298,
1365,
401,
298,
1069,
344,
401,
298,
1069,
923,
937,
202,
199,
10258,
8784,
51,
275,
942,
8065,
199,
318,
302,
7068,
66,
2398,
837,
1128,
5235,
16974,
275,
942,
1128,
862,
26,
1039,
3066,
657,
6243,
275,
4011,
14,
1069,
14,
10890,
480,
2859,
921,
1246,
14,
5031,
14,
957,
15,
23949,
15,
20,
14992,
1960,
20,
15,
4407,
15,
4180,
3471,
739,
342,
1128,
871,
26,
1039,
870,
480,
657,
13,
646,
26,
4520,
18170,
370,
5978,
1977,
12,
862,
4020,
2945,
531,
2958,
862,
26,
1039,
666,
275,
1551,
360,
2019,
493,
14,
1001,
358,
1039,
2061,
1173,
2532,
10690,
275,
2022,
14,
912,
8,
576,
9,
1128,
871,
26,
1039,
870,
480,
657,
13,
646,
26,
3091,
2187,
4904,
71,
570,
1911,
12,
911,
7427,
370,
5235,
436,
5518,
1006,
25210,
531,
1039,
2061,
1173,
2532,
10690,
275,
488,
2958,
876,
6243,
275,
2022,
14,
3640,
8,
1773,
657,
6243,
14,
2708,
360,
1624,
24,
1333,
2958,
367,
671,
315,
876,
6243,
26,
1039,
340,
671,
905,
354,
937,
1137,
298,
16,
18195,
14,
2424,
582,
1675,
5235,
16974,
14,
740,
8,
88,
905,
4249,
63,
633,
3135,
2958,
327,
7649,
436,
2112,
1924,
402,
314,
7392,
1159,
14,
982,
2985,
787,
1128,
367,
876,
19018,
315,
5235,
16974,
26,
1039,
6661,
1173,
275,
16444,
11536,
63,
10710,
14,
1733,
8,
657,
19018,
680,
20567,
342,
4341,
340,
2061,
1173,
2532,
10690,
365,
488,
503,
1109,
8,
6338,
1173,
459,
2019,
493,
1105,
690,
2061,
1173,
2532,
10690,
459,
2019,
493,
2565,
11556,
862,
26,
2628,
870,
480,
657,
13,
646,
26,
17413,
1337,
370,
5235,
570,
26,
8352,
908,
8,
6338,
1173,
459,
2019,
493,
5156,
2628,
4011,
14,
1069,
14,
633,
14270,
8,
657,
19018,
12,
298,
324,
15317,
8045,
14,
6838,
531,
1675,
871,
26,
2628,
870,
480,
657,
13,
646,
26,
4520,
25937,
26,
1052,
446,
7754,
1255,
314,
2112,
4020,
1674,
908,
8,
657,
19018,
430,
2628,
22542,
8784,
51,
14,
740,
8,
6338,
1173,
459,
2019,
493,
1105,
2628,
327,
710,
30075,
2348,
365,
12,
340,
1373,
6918,
12,
1265,
1077,
8646,
2951,
1343,
4020,
737,
626,
570,
14,
2628,
2059,
11556,
327,
2372,
314,
666,
1901,
6394,
15511,
12,
8298,
14905,
370,
1736,
543,
14,
1675,
14650,
1173,
275,
10634,
14,
739,
63,
4737,
360,
324,
15317,
8045,
14,
6838,
297,
7375,
17115,
84,
297,
10291,
534,
12256,
297,
1406,
29,
403,
12,
11802,
63,
1459,
534,
1103,
46,
297,
202,
3147,
675,
4574,
1524,
16,
12,
1695,
12,
1616,
12,
4329,
12,
3193,
12,
6155,
12,
3388,
12,
6928,
467,
1561,
29,
3978,
14546,
9,
11556,
327,
12762,
436,
2112,
314,
570,
1675,
2112,
8,
8799,
1173,
12,
6661,
1173,
9,
4341,
587,
26,
1675,
870,
480,
657,
13,
646,
26,
16917,
2419,
12060,
1052,
965,
2575,
2757,
8439,
1674,
908,
8,
6338,
1173,
459,
2019,
493,
5156,
1675,
986,
2958,
340,
22542,
8784,
51,
365,
440,
488,
26,
1039,
870,
480,
657,
13,
646,
26,
12176,
1482,
26,
8352,
908,
8,
10258,
8784,
51,
430,
8065,
199,
318,
7031,
46,
7068,
66,
2398,
837,
1128,
340,
747,
14,
515,
14,
6292,
360,
5991,
66,
63,
2724,
13,
1690,
1465,
1079,
14,
4737,
14,
6838,
735,
1039,
570,
7965,
275,
715,
1128,
587,
26,
1039,
862,
26,
1675,
1166,
275,
298,
2859,
921,
1544,
14,
32118,
14,
957,
15,
83,
15,
66,
454,
2260,
3583,
90,
3605,
85,
19,
12156,
19,
15,
5991,
66,
63,
2724,
13,
1690,
1465,
1079,
14,
4737,
14,
6838,
31,
5030,
29,
17,
2,
1675,
2053,
275,
14530,
11556,
870,
480,
657,
13,
646,
26,
3814,
8869,
66,
63,
2724,
13,
1690,
1465,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
bukzor/sympy
|
sympy/printing/octave.py
|
52
|
22542
|
"""
Octave (and Matlab) code printer
The `OctaveCodePrinter` converts SymPy expressions into Octave expressions.
It uses a subset of the Octave language for Matlab compatibility.
A complete code generator, which uses `octave_code` extensively, can be found
in `sympy.utilities.codegen`. The `codegen` module can be used to generate
complete source code files.
"""
from __future__ import print_function, division
from sympy.core import Mul, Pow, S, Rational
from sympy.core.compatibility import string_types, range
from sympy.core.mul import _keep_coeff
from sympy.printing.codeprinter import CodePrinter, Assignment
from sympy.printing.precedence import precedence
from re import search
# List of known functions. First, those that have the same name in
# SymPy and Octave. This is almost certainly incomplete!
known_fcns_src1 = ["sin", "cos", "tan", "asin", "acos", "atan", "atan2",
"sinh", "cosh", "tanh", "asinh", "acosh", "atanh",
"log", "exp", "erf", "gamma", "sign", "floor", "csc",
"sec", "cot", "coth", "acot", "acoth", "erfc",
"besselj", "bessely", "besseli", "besselk",
"erfinv", "erfcinv", "factorial" ]
# These functions have different names ("Sympy": "Octave"), more
# generally a mapping to (argument_conditions, octave_function).
known_fcns_src2 = {
"Abs": "abs",
"ceiling": "ceil",
"conjugate": "conj",
"DiracDelta": "dirac",
"Heaviside": "heaviside",
}
class OctaveCodePrinter(CodePrinter):
"""
A printer to convert expressions to strings of Octave/Matlab code.
"""
printmethod = "_octave"
language = "Octave"
_operators = {
'and': '&',
'or': '|',
'not': '~',
}
_default_settings = {
'order': None,
'full_prec': 'auto',
'precision': 16,
'user_functions': {},
'human': True,
'contract': True,
'inline': True,
}
# Note: contract is for expressing tensors as loops (if True), or just
# assignment (if False). FIXME: this should be looked a more carefully
# for Octave.
def __init__(self, settings={}):
super(OctaveCodePrinter, self).__init__(settings)
self.known_functions = dict(zip(known_fcns_src1, known_fcns_src1))
self.known_functions.update(dict(known_fcns_src2))
userfuncs = settings.get('user_functions', {})
self.known_functions.update(userfuncs)
def _rate_index_position(self, p):
return p*5
def _get_statement(self, codestring):
return "%s;" % codestring
def _get_comment(self, text):
return "% {0}".format(text)
def _declare_number_const(self, name, value):
return "{0} = {1};".format(name, value)
def _format_code(self, lines):
return self.indent_code(lines)
def _traverse_matrix_indices(self, mat):
# Octave uses Fortran order (column-major)
rows, cols = mat.shape
return ((i, j) for j in range(cols) for i in range(rows))
def _get_loop_opening_ending(self, indices):
open_lines = []
close_lines = []
for i in indices:
# Octave arrays start at 1 and end at dimension
var, start, stop = map(self._print,
[i.label, i.lower + 1, i.upper + 1])
open_lines.append("for %s = %s:%s" % (var, start, stop))
close_lines.append("end")
return open_lines, close_lines
def _print_Mul(self, expr):
# print complex numbers nicely in Octave
if (expr.is_number and expr.is_imaginary and
expr.as_coeff_Mul()[0].is_integer):
return "%si" % self._print(-S.ImaginaryUnit*expr)
# cribbed from str.py
prec = precedence(expr)
c, e = expr.as_coeff_Mul()
if c < 0:
expr = _keep_coeff(-c, e)
sign = "-"
else:
sign = ""
a = [] # items in the numerator
b = [] # items that are in the denominator (if any)
if self.order not in ('old', 'none'):
args = expr.as_ordered_factors()
else:
# use make_args in case expr was something like -x -> x
args = Mul.make_args(expr)
# Gather args for numerator/denominator
for item in args:
if (item.is_commutative and item.is_Pow and item.exp.is_Rational
and item.exp.is_negative):
if item.exp != -1:
b.append(Pow(item.base, -item.exp, evaluate=False))
else:
b.append(Pow(item.base, -item.exp))
elif item.is_Rational and item is not S.Infinity:
if item.p != 1:
a.append(Rational(item.p))
if item.q != 1:
b.append(Rational(item.q))
else:
a.append(item)
a = a or [S.One]
a_str = [self.parenthesize(x, prec) for x in a]
b_str = [self.parenthesize(x, prec) for x in b]
# from here it differs from str.py to deal with "*" and ".*"
def multjoin(a, a_str):
# here we probably are assuming the constants will come first
r = a_str[0]
for i in range(1, len(a)):
mulsym = '*' if a[i-1].is_number else '.*'
r = r + mulsym + a_str[i]
return r
if len(b) == 0:
return sign + multjoin(a, a_str)
elif len(b) == 1:
divsym = '/' if b[0].is_number else './'
return sign + multjoin(a, a_str) + divsym + b_str[0]
else:
divsym = '/' if all([bi.is_number for bi in b]) else './'
return (sign + multjoin(a, a_str) +
divsym + "(%s)" % multjoin(b, b_str))
def _print_Pow(self, expr):
powsymbol = '^' if all([x.is_number for x in expr.args]) else '.^'
PREC = precedence(expr)
if expr.exp == S.Half:
return "sqrt(%s)" % self._print(expr.base)
if expr.is_commutative:
if expr.exp == -S.Half:
sym = '/' if expr.base.is_number else './'
return "1" + sym + "sqrt(%s)" % self._print(expr.base)
if expr.exp == -S.One:
sym = '/' if expr.base.is_number else './'
return "1" + sym + "%s" % self.parenthesize(expr.base, PREC)
return '%s%s%s' % (self.parenthesize(expr.base, PREC), powsymbol,
self.parenthesize(expr.exp, PREC))
def _print_MatPow(self, expr):
PREC = precedence(expr)
return '%s^%s' % (self.parenthesize(expr.base, PREC),
self.parenthesize(expr.exp, PREC))
def _print_Pi(self, expr):
return 'pi'
def _print_ImaginaryUnit(self, expr):
return "1i"
def _print_Exp1(self, expr):
return "exp(1)"
def _print_GoldenRatio(self, expr):
# FIXME: how to do better, e.g., for octave_code(2*GoldenRatio)?
#return self._print((1+sqrt(S(5)))/2)
return "(1+sqrt(5))/2"
def _print_NumberSymbol(self, expr):
if self._settings["inline"]:
return self._print(expr.evalf(self._settings["precision"]))
else:
# assign to a variable, perhaps more readable for longer program
return super(OctaveCodePrinter, self)._print_NumberSymbol(expr)
def _print_Assignment(self, expr):
from sympy.functions.elementary.piecewise import Piecewise
from sympy.tensor.indexed import IndexedBase
# Copied from codeprinter, but remove special MatrixSymbol treatment
lhs = expr.lhs
rhs = expr.rhs
# We special case assignments that take multiple lines
if not self._settings["inline"] and isinstance(expr.rhs, Piecewise):
# Here we modify Piecewise so each expression is now
# an Assignment, and then continue on the print.
expressions = []
conditions = []
for (e, c) in rhs.args:
expressions.append(Assignment(lhs, e))
conditions.append(c)
temp = Piecewise(*zip(expressions, conditions))
return self._print(temp)
if self._settings["contract"] and (lhs.has(IndexedBase) or
rhs.has(IndexedBase)):
# Here we check if there is looping to be done, and if so
# print the required loops.
return self._doprint_loops(rhs, lhs)
else:
lhs_code = self._print(lhs)
rhs_code = self._print(rhs)
return self._get_statement("%s = %s" % (lhs_code, rhs_code))
def _print_Infinity(self, expr):
return 'inf'
def _print_NegativeInfinity(self, expr):
return '-inf'
def _print_NaN(self, expr):
return 'NaN'
def _print_list(self, expr):
return '{' + ', '.join(self._print(a) for a in expr) + '}'
_print_tuple = _print_list
_print_Tuple = _print_list
def _print_BooleanTrue(self, expr):
return "true"
def _print_BooleanFalse(self, expr):
return "false"
def _print_bool(self, expr):
return str(expr).lower()
# Could generate quadrature code for definite Integrals?
#_print_Integral = _print_not_supported
def _print_MatrixBase(self, A):
# Handle zero dimensions:
if (A.rows, A.cols) == (0, 0):
return '[]'
elif A.rows == 0 or A.cols == 0:
return 'zeros(%s, %s)' % (A.rows, A.cols)
elif (A.rows, A.cols) == (1, 1):
# Octave does not distinguish between scalars and 1x1 matrices
return self._print(A[0, 0])
elif A.rows == 1:
return "[%s]" % A.table(self, rowstart='', rowend='', colsep=' ')
elif A.cols == 1:
# note .table would unnecessarily equispace the rows
return "[%s]" % "; ".join([self._print(a) for a in A])
return "[%s]" % A.table(self, rowstart='', rowend='',
rowsep=';\n', colsep=' ')
def _print_SparseMatrix(self, A):
from sympy.matrices import Matrix
L = A.col_list();
# make row vectors of the indices and entries
I = Matrix([[k[0] + 1 for k in L]])
J = Matrix([[k[1] + 1 for k in L]])
AIJ = Matrix([[k[2] for k in L]])
return "sparse(%s, %s, %s, %s, %s)" % (self._print(I), self._print(J),
self._print(AIJ), A.rows, A.cols)
# FIXME: Str/CodePrinter could define each of these to call the _print
# method from higher up the class hierarchy (see _print_NumberSymbol).
# Then subclasses like us would not need to repeat all this.
_print_Matrix = \
_print_DenseMatrix = \
_print_MutableDenseMatrix = \
_print_ImmutableMatrix = \
_print_ImmutableDenseMatrix = \
_print_MatrixBase
_print_MutableSparseMatrix = \
_print_ImmutableSparseMatrix = \
_print_SparseMatrix
def _print_MatrixElement(self, expr):
return self._print(expr.parent) + '(%s, %s)'%(expr.i+1, expr.j+1)
def _print_MatrixSlice(self, expr):
def strslice(x, lim):
l = x[0] + 1
h = x[1]
step = x[2]
lstr = self._print(l)
hstr = 'end' if h == lim else self._print(h)
if step == 1:
if l == 1 and h == lim:
return ':'
if l == h:
return lstr
else:
return lstr + ':' + hstr
else:
return ':'.join((lstr, self._print(step), hstr))
return (self._print(expr.parent) + '(' +
strslice(expr.rowslice, expr.parent.shape[0]) + ', ' +
strslice(expr.colslice, expr.parent.shape[1]) + ')')
def _print_Indexed(self, expr):
inds = [ self._print(i) for i in expr.indices ]
return "%s(%s)" % (self._print(expr.base.label), ", ".join(inds))
def _print_Idx(self, expr):
return self._print(expr.label)
def _print_Identity(self, expr):
return "eye(%s)" % self._print(expr.shape[0])
def _print_hankel1(self, expr):
return "besselh(%s, 1, %s)" % (self._print(expr.order),
self._print(expr.argument))
def _print_hankel2(self, expr):
return "besselh(%s, 2, %s)" % (self._print(expr.order),
self._print(expr.argument))
# Note: as of 2015, Octave doesn't have spherical Bessel functions
def _print_jn(self, expr):
from sympy.functions import sqrt, besselj
x = expr.argument
expr2 = sqrt(S.Pi/(2*x))*besselj(expr.order + S.Half, x)
return self._print(expr2)
def _print_yn(self, expr):
from sympy.functions import sqrt, bessely
x = expr.argument
expr2 = sqrt(S.Pi/(2*x))*bessely(expr.order + S.Half, x)
return self._print(expr2)
def _print_airyai(self, expr):
return "airy(0, %s)" % self._print(expr.args[0])
def _print_airyaiprime(self, expr):
return "airy(1, %s)" % self._print(expr.args[0])
def _print_airybi(self, expr):
return "airy(2, %s)" % self._print(expr.args[0])
def _print_airybiprime(self, expr):
return "airy(3, %s)" % self._print(expr.args[0])
def _print_Piecewise(self, expr):
if expr.args[-1].cond != True:
# We need the last conditional to be a True, otherwise the resulting
# function may not return a result.
raise ValueError("All Piecewise expressions must contain an "
"(expr, True) statement to be used as a default "
"condition. Without one, the generated "
"expression may not evaluate to anything under "
"some condition.")
lines = []
if self._settings["inline"]:
# Express each (cond, expr) pair in a nested Horner form:
# (condition) .* (expr) + (not cond) .* (<others>)
# Expressions that result in multiple statements won't work here.
ecpairs = ["({0}).*({1}) + (~({0})).*(".format
(self._print(c), self._print(e))
for e, c in expr.args[:-1]]
elast = "%s" % self._print(expr.args[-1].expr)
pw = " ...\n".join(ecpairs) + elast + ")"*len(ecpairs)
# Note: current need these outer brackets for 2*pw. Would be
# nicer to teach parenthesize() to do this for us when needed!
return "(" + pw + ")"
else:
for i, (e, c) in enumerate(expr.args):
if i == 0:
lines.append("if (%s)" % self._print(c))
elif i == len(expr.args) - 1 and c == True:
lines.append("else")
else:
lines.append("elseif (%s)" % self._print(c))
code0 = self._print(e)
lines.append(code0)
if i == len(expr.args) - 1:
lines.append("end")
return "\n".join(lines)
def indent_code(self, code):
"""Accepts a string of code or a list of code lines"""
# code mostly copied from ccode
if isinstance(code, string_types):
code_lines = self.indent_code(code.splitlines(True))
return ''.join(code_lines)
tab = " "
inc_regex = ('^function ', '^if ', '^elseif ', '^else$', '^for ')
dec_regex = ('^end$', '^elseif ', '^else$')
# pre-strip left-space from the code
code = [ line.lstrip(' \t') for line in code ]
increase = [ int(any([search(re, line) for re in inc_regex]))
for line in code ]
decrease = [ int(any([search(re, line) for re in dec_regex]))
for line in code ]
pretty = []
level = 0
for n, line in enumerate(code):
if line == '' or line == '\n':
pretty.append(line)
continue
level -= decrease[n]
pretty.append("%s%s" % (tab*level, line))
level += increase[n]
return pretty
def octave_code(expr, assign_to=None, **settings):
r"""Converts `expr` to a string of Octave (or Matlab) code.
The string uses a subset of the Octave language for Matlab compatibility.
Parameters
==========
expr : Expr
A sympy expression to be converted.
assign_to : optional
When given, the argument is used as the name of the variable to which
the expression is assigned. Can be a string, ``Symbol``,
``MatrixSymbol``, or ``Indexed`` type. This can be helpful for
expressions that generate multi-line statements.
precision : integer, optional
The precision for numbers such as pi [default=16].
user_functions : dict, optional
A dictionary where keys are ``FunctionClass`` instances and values are
their string representations. Alternatively, the dictionary value can
be a list of tuples i.e. [(argument_test, cfunction_string)]. See
below for examples.
human : bool, optional
If True, the result is a single string that may contain some constant
declarations for the number symbols. If False, the same information is
returned in a tuple of (symbols_to_declare, not_supported_functions,
code_text). [default=True].
contract: bool, optional
If True, ``Indexed`` instances are assumed to obey tensor contraction
rules and the corresponding nested loops over indices are generated.
Setting contract=False will not generate loops, instead the user is
responsible to provide values for the indices in the code.
[default=True].
inline: bool, optional
If True, we try to create single-statement code instead of multiple
statements. [default=True].
Examples
========
>>> from sympy import octave_code, symbols, sin, pi
>>> x = symbols('x')
>>> octave_code(sin(x).series(x).removeO())
'x.^5/120 - x.^3/6 + x'
>>> from sympy import Rational, ceiling, Abs
>>> x, y, tau = symbols("x, y, tau")
>>> octave_code((2*tau)**Rational(7, 2))
'8*sqrt(2)*tau.^(7/2)'
Note that element-wise (Hadamard) operations are used by default between
symbols. This is because its very common in Octave to write "vectorized"
code. It is harmless if the values are scalars.
>>> octave_code(sin(pi*x*y), assign_to="s")
's = sin(pi*x.*y);'
If you need a matrix product "*" or matrix power "^", you can specify the
symbol as a ``MatrixSymbol``.
>>> from sympy import Symbol, MatrixSymbol
>>> n = Symbol('n', integer=True, positive=True)
>>> A = MatrixSymbol('A', n, n)
>>> octave_code(3*pi*A**3)
'(3*pi)*A^3'
This class uses several rules to decide which symbol to use a product.
Pure numbers use "*", Symbols use ".*" and MatrixSymbols use "*".
A HadamardProduct can be used to specify componentwise multiplication ".*"
of two MatrixSymbols. There is currently there is no easy way to specify
scalar symbols, so sometimes the code might have some minor cosmetic
issues. For example, suppose x and y are scalars and A is a Matrix, then
while a human programmer might write "(x^2*y)*A^3", we generate:
>>> octave_code(x**2*y*A**3)
'(x.^2.*y)*A^3'
Matrices are supported using Octave inline notation. When using
``assign_to`` with matrices, the name can be specified either as a string
or as a ``MatrixSymbol``. The dimenions must align in the latter case.
>>> from sympy import Matrix, MatrixSymbol
>>> mat = Matrix([[x**2, sin(x), ceiling(x)]])
>>> octave_code(mat, assign_to='A')
'A = [x.^2 sin(x) ceil(x)];'
``Piecewise`` expressions are implemented with logical masking by default.
Alternatively, you can pass "inline=False" to use if-else conditionals.
Note that if the ``Piecewise`` lacks a default term, represented by
``(expr, True)`` then an error will be thrown. This is to prevent
generating an expression that may not evaluate to anything.
>>> from sympy import Piecewise
>>> pw = Piecewise((x + 1, x > 0), (x, True))
>>> octave_code(pw, assign_to=tau)
'tau = ((x > 0).*(x + 1) + (~(x > 0)).*(x));'
Note that any expression that can be generated normally can also exist
inside a Matrix:
>>> mat = Matrix([[x**2, pw, sin(x)]])
>>> octave_code(mat, assign_to='A')
'A = [x.^2 ((x > 0).*(x + 1) + (~(x > 0)).*(x)) sin(x)];'
Custom printing can be defined for certain types by passing a dictionary of
"type" : "function" to the ``user_functions`` kwarg. Alternatively, the
dictionary value can be a list of tuples i.e., [(argument_test,
cfunction_string)]. This can be used to call a custom Octave function.
>>> from sympy import Function
>>> f = Function('f')
>>> g = Function('g')
>>> custom_functions = {
... "f": "existing_octave_fcn",
... "g": [(lambda x: x.is_Matrix, "my_mat_fcn"),
... (lambda x: not x.is_Matrix, "my_fcn")]
... }
>>> mat = Matrix([[1, x]])
>>> octave_code(f(x) + g(x) + g(mat), user_functions=custom_functions)
'existing_octave_fcn(x) + my_fcn(x) + my_mat_fcn([1 x])'
Support for loops is provided through ``Indexed`` types. With
``contract=True`` these expressions will be turned into loops, whereas
``contract=False`` will just print the assignment expression that should be
looped over:
>>> from sympy import Eq, IndexedBase, Idx, ccode
>>> len_y = 5
>>> y = IndexedBase('y', shape=(len_y,))
>>> t = IndexedBase('t', shape=(len_y,))
>>> Dy = IndexedBase('Dy', shape=(len_y-1,))
>>> i = Idx('i', len_y-1)
>>> e = Eq(Dy[i], (y[i+1]-y[i])/(t[i+1]-t[i]))
>>> octave_code(e.rhs, assign_to=e.lhs, contract=False)
'Dy(i) = (y(i + 1) - y(i))./(t(i + 1) - t(i));'
"""
return OctaveCodePrinter(settings).doprint(expr, assign_to)
def print_octave_code(expr, **settings):
"""Prints the Octave (or Matlab) representation of the given expression.
See `octave_code` for the meaning of the optional arguments.
"""
print(octave_code(expr, **settings))
|
bsd-3-clause
|
[
624,
199,
17584,
811,
334,
460,
18619,
5561,
9,
1233,
16639,
199,
199,
1918,
658,
17584,
811,
3034,
14131,
64,
15373,
21478,
2713,
8455,
1901,
18365,
811,
8455,
14,
199,
7940,
4440,
282,
10026,
402,
314,
18365,
811,
2637,
367,
18619,
5561,
7163,
14,
199,
199,
33,
4890,
1233,
4306,
12,
1314,
4440,
658,
15560,
811,
63,
600,
64,
2178,
9840,
12,
883,
506,
1911,
199,
262,
658,
18132,
14,
16355,
14,
600,
2268,
2313,
221,
710,
658,
600,
2268,
64,
859,
883,
506,
1202,
370,
3550,
199,
4883,
1350,
1233,
1584,
14,
199,
199,
624,
199,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
12,
4629,
199,
504,
5840,
14,
1018,
492,
22578,
12,
510,
583,
12,
428,
12,
20164,
199,
504,
5840,
14,
1018,
14,
15390,
492,
1059,
63,
1313,
12,
1425,
199,
504,
5840,
14,
1018,
14,
3703,
492,
485,
3250,
63,
8903,
199,
504,
5840,
14,
26514,
14,
600,
11835,
492,
5495,
14131,
12,
16927,
434,
199,
504,
5840,
14,
26514,
14,
19571,
492,
13823,
199,
504,
295,
492,
2754,
199,
199,
3,
3820,
402,
6040,
3423,
14,
221,
7758,
12,
5204,
626,
1172,
314,
2011,
536,
315,
199,
3,
21478,
2713,
436,
18365,
811,
14,
257,
961,
365,
18871,
9842,
590,
17110,
1,
199,
3159,
63,
3003,
561,
63,
2164,
17,
275,
2097,
5911,
401,
298,
5197,
401,
298,
12990,
401,
298,
24202,
401,
298,
65,
5197,
401,
298,
16080,
401,
298,
16080,
18,
401,
673,
298,
15831,
401,
298,
15106,
401,
298,
21468,
401,
298,
305,
17695,
401,
298,
13286,
609,
401,
298,
16080,
72,
401,
673,
298,
793,
401,
298,
1474,
401,
298,
31740,
401,
298,
7325,
401,
298,
1037,
401,
298,
11289,
401,
298,
17000,
401,
673,
298,
3321,
401,
298,
331,
84,
401,
298,
331,
273,
401,
298,
13286,
84,
401,
298,
13286,
273,
401,
298,
281,
3003,
401,
673,
298,
11562,
5891,
74,
401,
298,
11562,
261,
590,
401,
298,
11562,
261,
317,
401,
298,
11562,
5891,
75,
401,
673,
298,
281,
2408,
86,
401,
298,
281,
3003,
5350,
401,
298,
28165,
2,
1622,
199,
3,
5723,
3423,
1172,
3365,
1561,
1689,
4323,
5086,
582,
298,
17584,
811,
1288,
1655,
199,
3,
16711,
282,
4412,
370,
334,
2094,
63,
9855,
12,
17162,
811,
63,
1593,
680,
199,
3159,
63,
3003,
561,
63,
2164,
18,
275,
469,
272,
298,
15447,
582,
298,
2101,
401,
272,
298,
301,
5662,
582,
298,
14085,
401,
272,
298,
26000,
582,
298,
14765,
401,
272,
298,
1341,
6457,
13411,
582,
298,
328,
6457,
401,
272,
298,
1966,
7194,
2441,
582,
298,
426,
7194,
2441,
401,
199,
93,
421,
199,
533,
18365,
811,
3034,
14131,
8,
3034,
14131,
304,
272,
408,
272,
437,
16639,
370,
3957,
8455,
370,
3326,
402,
18365,
811,
15,
14817,
5561,
1233,
14,
272,
408,
272,
870,
765,
275,
2668,
15560,
811,
2,
272,
2637,
275,
298,
17584,
811,
2,
339,
485,
12688,
275,
469,
267,
283,
460,
356,
7673,
297,
267,
283,
269,
356,
11280,
297,
267,
283,
1397,
356,
17352,
297,
272,
789,
339,
485,
885,
63,
1751,
275,
469,
267,
283,
1648,
356,
488,
12,
267,
283,
2861,
63,
9218,
356,
283,
2495,
297,
267,
283,
6833,
356,
3193,
12,
267,
283,
751,
63,
5777,
356,
5479,
267,
283,
14864,
356,
715,
12,
267,
283,
14624,
356,
715,
12,
267,
283,
6460,
356,
715,
12,
272,
789,
272,
327,
3390,
26,
16077,
365,
367,
4056,
316,
10519,
465,
17222,
334,
692,
715,
395,
503,
2951,
272,
327,
9801,
334,
692,
756,
680,
221,
7600,
26,
642,
1077,
506,
21182,
282,
1655,
21191,
8525,
272,
327,
367,
18365,
811,
14,
339,
347,
636,
826,
721,
277,
12,
2202,
16420,
267,
1613,
8,
17584,
811,
3034,
14131,
12,
291,
2843,
826,
721,
1751,
9,
267,
291,
14,
3159,
63,
5777,
275,
1211,
8,
3065,
8,
3159,
63,
3003,
561,
63,
2164,
17,
12,
6040,
63,
3003,
561,
63,
2164,
17,
430,
267,
291,
14,
3159,
63,
5777,
14,
873,
8,
807,
8,
3159,
63,
3003,
561,
63,
2164,
18,
430,
267,
922,
9204,
275,
2202,
14,
362,
360,
751,
63,
5777,
297,
5009,
267,
291,
14,
3159,
63,
5777,
14,
873,
8,
751,
9204,
9,
2378,
347,
485,
1866,
63,
1080,
63,
3124,
8,
277,
12,
299,
304,
267,
372,
299,
10,
21,
2378,
347,
485,
362,
63,
6242,
8,
277,
12,
1233,
875,
304,
267,
372,
2071,
83,
9426,
450,
1233,
875,
2378,
347,
485,
362,
63,
3349,
8,
277,
12,
1318,
304,
267,
372,
2071,
469,
16,
5469,
908,
8,
505,
9,
2378,
347,
485,
16536,
63,
1955,
63,
1297,
8,
277,
12,
536,
12,
574,
304,
267,
372,
5310,
16,
93,
275,
469,
17,
12084,
1674,
908,
8,
354,
12,
574,
9,
2378,
347,
485,
908,
63,
600,
8,
277,
12,
2385,
304,
267,
372,
291,
14,
3724,
63,
600,
8,
1278,
9,
2378,
347,
485,
23650,
63,
3642,
63,
4108,
8,
277,
12,
2530,
304,
267,
327,
18365,
811,
4440,
19998,
1865,
334,
2301,
13,
8452,
9,
267,
4730,
12,
8850,
275,
2530,
14,
1392,
267,
372,
3666,
73,
12,
1335,
9,
367,
1335,
315,
1425,
8,
4574,
9,
367,
284,
315,
1425,
8,
3838,
430,
2378,
347,
485,
362,
63,
3813,
63,
21849,
63,
3219,
8,
277,
12,
4918,
304,
267,
1551,
63,
1278,
275,
942,
267,
4002,
63,
1278,
275,
942,
267,
367,
284,
315,
4918,
26,
288,
327,
18365,
811,
6572,
1343,
737,
413,
436,
1284,
737,
6240,
288,
2729,
12,
1343,
12,
3631,
275,
2341,
8,
277,
423,
1361,
12,
490,
359,
73,
14,
1302,
12,
284,
14,
2325,
435,
413,
12,
284,
14,
4142,
435,
413,
566,
288,
1551,
63,
1278,
14,
740,
480,
509,
450,
83,
275,
450,
83,
2689,
83,
2,
450,
334,
1391,
12,
1343,
12,
3631,
430,
288,
4002,
63,
1278,
14,
740,
480,
500,
531,
267,
372,
1551,
63,
1278,
12,
4002,
63,
1278,
2378,
347,
485,
1361,
63,
16867,
8,
277,
12,
5348,
304,
267,
327,
870,
6114,
5579,
14213,
590,
315,
18365,
811,
267,
340,
334,
3684,
14,
374,
63,
1955,
436,
5348,
14,
374,
63,
32192,
436,
355,
5348,
14,
305,
63,
8903,
63,
16867,
3430,
16,
1055
] |
[
199,
17584,
811,
334,
460,
18619,
5561,
9,
1233,
16639,
199,
199,
1918,
658,
17584,
811,
3034,
14131,
64,
15373,
21478,
2713,
8455,
1901,
18365,
811,
8455,
14,
199,
7940,
4440,
282,
10026,
402,
314,
18365,
811,
2637,
367,
18619,
5561,
7163,
14,
199,
199,
33,
4890,
1233,
4306,
12,
1314,
4440,
658,
15560,
811,
63,
600,
64,
2178,
9840,
12,
883,
506,
1911,
199,
262,
658,
18132,
14,
16355,
14,
600,
2268,
2313,
221,
710,
658,
600,
2268,
64,
859,
883,
506,
1202,
370,
3550,
199,
4883,
1350,
1233,
1584,
14,
199,
199,
624,
199,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
12,
4629,
199,
504,
5840,
14,
1018,
492,
22578,
12,
510,
583,
12,
428,
12,
20164,
199,
504,
5840,
14,
1018,
14,
15390,
492,
1059,
63,
1313,
12,
1425,
199,
504,
5840,
14,
1018,
14,
3703,
492,
485,
3250,
63,
8903,
199,
504,
5840,
14,
26514,
14,
600,
11835,
492,
5495,
14131,
12,
16927,
434,
199,
504,
5840,
14,
26514,
14,
19571,
492,
13823,
199,
504,
295,
492,
2754,
199,
199,
3,
3820,
402,
6040,
3423,
14,
221,
7758,
12,
5204,
626,
1172,
314,
2011,
536,
315,
199,
3,
21478,
2713,
436,
18365,
811,
14,
257,
961,
365,
18871,
9842,
590,
17110,
1,
199,
3159,
63,
3003,
561,
63,
2164,
17,
275,
2097,
5911,
401,
298,
5197,
401,
298,
12990,
401,
298,
24202,
401,
298,
65,
5197,
401,
298,
16080,
401,
298,
16080,
18,
401,
673,
298,
15831,
401,
298,
15106,
401,
298,
21468,
401,
298,
305,
17695,
401,
298,
13286,
609,
401,
298,
16080,
72,
401,
673,
298,
793,
401,
298,
1474,
401,
298,
31740,
401,
298,
7325,
401,
298,
1037,
401,
298,
11289,
401,
298,
17000,
401,
673,
298,
3321,
401,
298,
331,
84,
401,
298,
331,
273,
401,
298,
13286,
84,
401,
298,
13286,
273,
401,
298,
281,
3003,
401,
673,
298,
11562,
5891,
74,
401,
298,
11562,
261,
590,
401,
298,
11562,
261,
317,
401,
298,
11562,
5891,
75,
401,
673,
298,
281,
2408,
86,
401,
298,
281,
3003,
5350,
401,
298,
28165,
2,
1622,
199,
3,
5723,
3423,
1172,
3365,
1561,
1689,
4323,
5086,
582,
298,
17584,
811,
1288,
1655,
199,
3,
16711,
282,
4412,
370,
334,
2094,
63,
9855,
12,
17162,
811,
63,
1593,
680,
199,
3159,
63,
3003,
561,
63,
2164,
18,
275,
469,
272,
298,
15447,
582,
298,
2101,
401,
272,
298,
301,
5662,
582,
298,
14085,
401,
272,
298,
26000,
582,
298,
14765,
401,
272,
298,
1341,
6457,
13411,
582,
298,
328,
6457,
401,
272,
298,
1966,
7194,
2441,
582,
298,
426,
7194,
2441,
401,
199,
93,
421,
199,
533,
18365,
811,
3034,
14131,
8,
3034,
14131,
304,
272,
408,
272,
437,
16639,
370,
3957,
8455,
370,
3326,
402,
18365,
811,
15,
14817,
5561,
1233,
14,
272,
408,
272,
870,
765,
275,
2668,
15560,
811,
2,
272,
2637,
275,
298,
17584,
811,
2,
339,
485,
12688,
275,
469,
267,
283,
460,
356,
7673,
297,
267,
283,
269,
356,
11280,
297,
267,
283,
1397,
356,
17352,
297,
272,
789,
339,
485,
885,
63,
1751,
275,
469,
267,
283,
1648,
356,
488,
12,
267,
283,
2861,
63,
9218,
356,
283,
2495,
297,
267,
283,
6833,
356,
3193,
12,
267,
283,
751,
63,
5777,
356,
5479,
267,
283,
14864,
356,
715,
12,
267,
283,
14624,
356,
715,
12,
267,
283,
6460,
356,
715,
12,
272,
789,
272,
327,
3390,
26,
16077,
365,
367,
4056,
316,
10519,
465,
17222,
334,
692,
715,
395,
503,
2951,
272,
327,
9801,
334,
692,
756,
680,
221,
7600,
26,
642,
1077,
506,
21182,
282,
1655,
21191,
8525,
272,
327,
367,
18365,
811,
14,
339,
347,
636,
826,
721,
277,
12,
2202,
16420,
267,
1613,
8,
17584,
811,
3034,
14131,
12,
291,
2843,
826,
721,
1751,
9,
267,
291,
14,
3159,
63,
5777,
275,
1211,
8,
3065,
8,
3159,
63,
3003,
561,
63,
2164,
17,
12,
6040,
63,
3003,
561,
63,
2164,
17,
430,
267,
291,
14,
3159,
63,
5777,
14,
873,
8,
807,
8,
3159,
63,
3003,
561,
63,
2164,
18,
430,
267,
922,
9204,
275,
2202,
14,
362,
360,
751,
63,
5777,
297,
5009,
267,
291,
14,
3159,
63,
5777,
14,
873,
8,
751,
9204,
9,
2378,
347,
485,
1866,
63,
1080,
63,
3124,
8,
277,
12,
299,
304,
267,
372,
299,
10,
21,
2378,
347,
485,
362,
63,
6242,
8,
277,
12,
1233,
875,
304,
267,
372,
2071,
83,
9426,
450,
1233,
875,
2378,
347,
485,
362,
63,
3349,
8,
277,
12,
1318,
304,
267,
372,
2071,
469,
16,
5469,
908,
8,
505,
9,
2378,
347,
485,
16536,
63,
1955,
63,
1297,
8,
277,
12,
536,
12,
574,
304,
267,
372,
5310,
16,
93,
275,
469,
17,
12084,
1674,
908,
8,
354,
12,
574,
9,
2378,
347,
485,
908,
63,
600,
8,
277,
12,
2385,
304,
267,
372,
291,
14,
3724,
63,
600,
8,
1278,
9,
2378,
347,
485,
23650,
63,
3642,
63,
4108,
8,
277,
12,
2530,
304,
267,
327,
18365,
811,
4440,
19998,
1865,
334,
2301,
13,
8452,
9,
267,
4730,
12,
8850,
275,
2530,
14,
1392,
267,
372,
3666,
73,
12,
1335,
9,
367,
1335,
315,
1425,
8,
4574,
9,
367,
284,
315,
1425,
8,
3838,
430,
2378,
347,
485,
362,
63,
3813,
63,
21849,
63,
3219,
8,
277,
12,
4918,
304,
267,
1551,
63,
1278,
275,
942,
267,
4002,
63,
1278,
275,
942,
267,
367,
284,
315,
4918,
26,
288,
327,
18365,
811,
6572,
1343,
737,
413,
436,
1284,
737,
6240,
288,
2729,
12,
1343,
12,
3631,
275,
2341,
8,
277,
423,
1361,
12,
490,
359,
73,
14,
1302,
12,
284,
14,
2325,
435,
413,
12,
284,
14,
4142,
435,
413,
566,
288,
1551,
63,
1278,
14,
740,
480,
509,
450,
83,
275,
450,
83,
2689,
83,
2,
450,
334,
1391,
12,
1343,
12,
3631,
430,
288,
4002,
63,
1278,
14,
740,
480,
500,
531,
267,
372,
1551,
63,
1278,
12,
4002,
63,
1278,
2378,
347,
485,
1361,
63,
16867,
8,
277,
12,
5348,
304,
267,
327,
870,
6114,
5579,
14213,
590,
315,
18365,
811,
267,
340,
334,
3684,
14,
374,
63,
1955,
436,
5348,
14,
374,
63,
32192,
436,
355,
5348,
14,
305,
63,
8903,
63,
16867,
3430,
16,
1055,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
jbbskinny/sympy
|
sympy/concrete/tests/test_delta.py
|
87
|
23654
|
from sympy.concrete import Sum
from sympy.concrete.delta import deltaproduct as dp, deltasummation as ds
from sympy.core import Eq, S, symbols, oo
from sympy.functions import KroneckerDelta as KD, Piecewise, piecewise_fold
from sympy.logic import And
i, j, k, l, m = symbols("i j k l m", integer=True, finite=True)
x, y = symbols("x y", commutative=False)
def test_deltaproduct_trivial():
assert dp(x, (j, 1, 0)) == 1
assert dp(x, (j, 1, 3)) == x**3
assert dp(x + y, (j, 1, 3)) == (x + y)**3
assert dp(x*y, (j, 1, 3)) == (x*y)**3
assert dp(KD(i, j), (k, 1, 3)) == KD(i, j)
assert dp(x*KD(i, j), (k, 1, 3)) == x**3*KD(i, j)
assert dp(x*y*KD(i, j), (k, 1, 3)) == (x*y)**3*KD(i, j)
def test_deltaproduct_basic():
assert dp(KD(i, j), (j, 1, 3)) == 0
assert dp(KD(i, j), (j, 1, 1)) == KD(i, 1)
assert dp(KD(i, j), (j, 2, 2)) == KD(i, 2)
assert dp(KD(i, j), (j, 3, 3)) == KD(i, 3)
assert dp(KD(i, j), (j, 1, k)) == KD(i, 1)*KD(k, 1) + KD(k, 0)
assert dp(KD(i, j), (j, k, 3)) == KD(i, 3)*KD(k, 3) + KD(k, 4)
assert dp(KD(i, j), (j, k, l)) == KD(i, l)*KD(k, l) + KD(k, l + 1)
def test_deltaproduct_mul_x_kd():
assert dp(x*KD(i, j), (j, 1, 3)) == 0
assert dp(x*KD(i, j), (j, 1, 1)) == x*KD(i, 1)
assert dp(x*KD(i, j), (j, 2, 2)) == x*KD(i, 2)
assert dp(x*KD(i, j), (j, 3, 3)) == x*KD(i, 3)
assert dp(x*KD(i, j), (j, 1, k)) == x*KD(i, 1)*KD(k, 1) + KD(k, 0)
assert dp(x*KD(i, j), (j, k, 3)) == x*KD(i, 3)*KD(k, 3) + KD(k, 4)
assert dp(x*KD(i, j), (j, k, l)) == x*KD(i, l)*KD(k, l) + KD(k, l + 1)
def test_deltaproduct_mul_add_x_y_kd():
assert dp((x + y)*KD(i, j), (j, 1, 3)) == 0
assert dp((x + y)*KD(i, j), (j, 1, 1)) == (x + y)*KD(i, 1)
assert dp((x + y)*KD(i, j), (j, 2, 2)) == (x + y)*KD(i, 2)
assert dp((x + y)*KD(i, j), (j, 3, 3)) == (x + y)*KD(i, 3)
assert dp((x + y)*KD(i, j), (j, 1, k)) == \
(x + y)*KD(i, 1)*KD(k, 1) + KD(k, 0)
assert dp((x + y)*KD(i, j), (j, k, 3)) == \
(x + y)*KD(i, 3)*KD(k, 3) + KD(k, 4)
assert dp((x + y)*KD(i, j), (j, k, l)) == \
(x + y)*KD(i, l)*KD(k, l) + KD(k, l + 1)
def test_deltaproduct_add_kd_kd():
assert dp(KD(i, k) + KD(j, k), (k, 1, 3)) == 0
assert dp(KD(i, k) + KD(j, k), (k, 1, 1)) == KD(i, 1) + KD(j, 1)
assert dp(KD(i, k) + KD(j, k), (k, 2, 2)) == KD(i, 2) + KD(j, 2)
assert dp(KD(i, k) + KD(j, k), (k, 3, 3)) == KD(i, 3) + KD(j, 3)
assert dp(KD(i, k) + KD(j, k), (k, 1, l)) == KD(l, 0) + \
KD(i, 1)*KD(l, 1) + KD(j, 1)*KD(l, 1) + \
KD(i, 1)*KD(j, 2)*KD(l, 2) + KD(j, 1)*KD(i, 2)*KD(l, 2)
assert dp(KD(i, k) + KD(j, k), (k, l, 3)) == KD(l, 4) + \
KD(i, 3)*KD(l, 3) + KD(j, 3)*KD(l, 3) + \
KD(i, 2)*KD(j, 3)*KD(l, 2) + KD(i, 3)*KD(j, 2)*KD(l, 2)
assert dp(KD(i, k) + KD(j, k), (k, l, m)) == KD(l, m + 1) + \
KD(i, m)*KD(l, m) + KD(j, m)*KD(l, m) + \
KD(i, m)*KD(j, m - 1)*KD(l, m - 1) + KD(i, m - 1)*KD(j, m)*KD(l, m - 1)
def test_deltaproduct_mul_x_add_kd_kd():
assert dp(x*(KD(i, k) + KD(j, k)), (k, 1, 3)) == 0
assert dp(x*(KD(i, k) + KD(j, k)), (k, 1, 1)) == x*(KD(i, 1) + KD(j, 1))
assert dp(x*(KD(i, k) + KD(j, k)), (k, 2, 2)) == x*(KD(i, 2) + KD(j, 2))
assert dp(x*(KD(i, k) + KD(j, k)), (k, 3, 3)) == x*(KD(i, 3) + KD(j, 3))
assert dp(x*(KD(i, k) + KD(j, k)), (k, 1, l)) == KD(l, 0) + \
x*KD(i, 1)*KD(l, 1) + x*KD(j, 1)*KD(l, 1) + \
x**2*KD(i, 1)*KD(j, 2)*KD(l, 2) + x**2*KD(j, 1)*KD(i, 2)*KD(l, 2)
assert dp(x*(KD(i, k) + KD(j, k)), (k, l, 3)) == KD(l, 4) + \
x*KD(i, 3)*KD(l, 3) + x*KD(j, 3)*KD(l, 3) + \
x**2*KD(i, 2)*KD(j, 3)*KD(l, 2) + x**2*KD(i, 3)*KD(j, 2)*KD(l, 2)
assert dp(x*(KD(i, k) + KD(j, k)), (k, l, m)) == KD(l, m + 1) + \
x*KD(i, m)*KD(l, m) + x*KD(j, m)*KD(l, m) + \
x**2*KD(i, m - 1)*KD(j, m)*KD(l, m - 1) + \
x**2*KD(i, m)*KD(j, m - 1)*KD(l, m - 1)
def test_deltaproduct_mul_add_x_y_add_kd_kd():
assert dp((x + y)*(KD(i, k) + KD(j, k)), (k, 1, 3)) == 0
assert dp((x + y)*(KD(i, k) + KD(j, k)), (k, 1, 1)) == \
(x + y)*(KD(i, 1) + KD(j, 1))
assert dp((x + y)*(KD(i, k) + KD(j, k)), (k, 2, 2)) == \
(x + y)*(KD(i, 2) + KD(j, 2))
assert dp((x + y)*(KD(i, k) + KD(j, k)), (k, 3, 3)) == \
(x + y)*(KD(i, 3) + KD(j, 3))
assert dp((x + y)*(KD(i, k) + KD(j, k)), (k, 1, l)) == KD(l, 0) + \
(x + y)*KD(i, 1)*KD(l, 1) + (x + y)*KD(j, 1)*KD(l, 1) + \
(x + y)**2*KD(i, 1)*KD(j, 2)*KD(l, 2) + \
(x + y)**2*KD(j, 1)*KD(i, 2)*KD(l, 2)
assert dp((x + y)*(KD(i, k) + KD(j, k)), (k, l, 3)) == KD(l, 4) + \
(x + y)*KD(i, 3)*KD(l, 3) + (x + y)*KD(j, 3)*KD(l, 3) + \
(x + y)**2*KD(i, 2)*KD(j, 3)*KD(l, 2) + \
(x + y)**2*KD(i, 3)*KD(j, 2)*KD(l, 2)
assert dp((x + y)*(KD(i, k) + KD(j, k)), (k, l, m)) == KD(l, m + 1) + \
(x + y)*KD(i, m)*KD(l, m) + (x + y)*KD(j, m)*KD(l, m) + \
(x + y)**2*KD(i, m - 1)*KD(j, m)*KD(l, m - 1) + \
(x + y)**2*KD(i, m)*KD(j, m - 1)*KD(l, m - 1)
def test_deltaproduct_add_mul_x_y_mul_x_kd():
assert dp(x*y + x*KD(i, j), (j, 1, 3)) == (x*y)**3 + \
x*(x*y)**2*KD(i, 1) + (x*y)*x*(x*y)*KD(i, 2) + (x*y)**2*x*KD(i, 3)
assert dp(x*y + x*KD(i, j), (j, 1, 1)) == x*y + x*KD(i, 1)
assert dp(x*y + x*KD(i, j), (j, 2, 2)) == x*y + x*KD(i, 2)
assert dp(x*y + x*KD(i, j), (j, 3, 3)) == x*y + x*KD(i, 3)
assert dp(x*y + x*KD(i, j), (j, 1, k)) == \
(x*y)**k + Piecewise(
((x*y)**(i - 1)*x*(x*y)**(k - i), And(S(1) <= i, i <= k)),
(0, True)
)
assert dp(x*y + x*KD(i, j), (j, k, 3)) == \
(x*y)**(-k + 4) + Piecewise(
((x*y)**(i - k)*x*(x*y)**(3 - i), And(k <= i, i <= 3)),
(0, True)
)
assert dp(x*y + x*KD(i, j), (j, k, l)) == \
(x*y)**(-k + l + 1) + Piecewise(
((x*y)**(i - k)*x*(x*y)**(l - i), And(k <= i, i <= l)),
(0, True)
)
def test_deltaproduct_mul_x_add_y_kd():
assert dp(x*(y + KD(i, j)), (j, 1, 3)) == (x*y)**3 + \
x*(x*y)**2*KD(i, 1) + (x*y)*x*(x*y)*KD(i, 2) + (x*y)**2*x*KD(i, 3)
assert dp(x*(y + KD(i, j)), (j, 1, 1)) == x*(y + KD(i, 1))
assert dp(x*(y + KD(i, j)), (j, 2, 2)) == x*(y + KD(i, 2))
assert dp(x*(y + KD(i, j)), (j, 3, 3)) == x*(y + KD(i, 3))
assert dp(x*(y + KD(i, j)), (j, 1, k)) == \
(x*y)**k + Piecewise(
((x*y)**(i - 1)*x*(x*y)**(k - i), And(S(1) <= i, i <= k)),
(0, True)
)
assert dp(x*(y + KD(i, j)), (j, k, 3)) == \
(x*y)**(-k + 4) + Piecewise(
((x*y)**(i - k)*x*(x*y)**(3 - i), And(k <= i, i <= 3)),
(0, True)
)
assert dp(x*(y + KD(i, j)), (j, k, l)) == \
(x*y)**(-k + l + 1) + Piecewise(
((x*y)**(i - k)*x*(x*y)**(l - i), And(k <= i, i <= l)),
(0, True)
)
def test_deltaproduct_mul_x_add_y_twokd():
assert dp(x*(y + 2*KD(i, j)), (j, 1, 3)) == (x*y)**3 + \
2*x*(x*y)**2*KD(i, 1) + 2*x*y*x*x*y*KD(i, 2) + 2*(x*y)**2*x*KD(i, 3)
assert dp(x*(y + 2*KD(i, j)), (j, 1, 1)) == x*(y + 2*KD(i, 1))
assert dp(x*(y + 2*KD(i, j)), (j, 2, 2)) == x*(y + 2*KD(i, 2))
assert dp(x*(y + 2*KD(i, j)), (j, 3, 3)) == x*(y + 2*KD(i, 3))
assert dp(x*(y + 2*KD(i, j)), (j, 1, k)) == \
(x*y)**k + Piecewise(
(2*(x*y)**(i - 1)*x*(x*y)**(k - i), And(S(1) <= i, i <= k)),
(0, True)
)
assert dp(x*(y + 2*KD(i, j)), (j, k, 3)) == \
(x*y)**(-k + 4) + Piecewise(
(2*(x*y)**(i - k)*x*(x*y)**(3 - i), And(k <= i, i <= 3)),
(0, True)
)
assert dp(x*(y + 2*KD(i, j)), (j, k, l)) == \
(x*y)**(-k + l + 1) + Piecewise(
(2*(x*y)**(i - k)*x*(x*y)**(l - i), And(k <= i, i <= l)),
(0, True)
)
def test_deltaproduct_mul_add_x_y_add_y_kd():
assert dp((x + y)*(y + KD(i, j)), (j, 1, 3)) == ((x + y)*y)**3 + \
(x + y)*((x + y)*y)**2*KD(i, 1) + \
(x + y)*y*(x + y)**2*y*KD(i, 2) + \
((x + y)*y)**2*(x + y)*KD(i, 3)
assert dp((x + y)*(y + KD(i, j)), (j, 1, 1)) == (x + y)*(y + KD(i, 1))
assert dp((x + y)*(y + KD(i, j)), (j, 2, 2)) == (x + y)*(y + KD(i, 2))
assert dp((x + y)*(y + KD(i, j)), (j, 3, 3)) == (x + y)*(y + KD(i, 3))
assert dp((x + y)*(y + KD(i, j)), (j, 1, k)) == \
((x + y)*y)**k + Piecewise(
(((x + y)*y)**(i - 1)*(x + y)*((x + y)*y)**(k - i),
And(S(1) <= i, i <= k)),
(0, True)
)
assert dp((x + y)*(y + KD(i, j)), (j, k, 3)) == \
((x + y)*y)**(-k + 4) + Piecewise(
(((x + y)*y)**(i - k)*(x + y)*((x + y)*y)**(3 - i),
And(k <= i, i <= 3)),
(0, True)
)
assert dp((x + y)*(y + KD(i, j)), (j, k, l)) == \
((x + y)*y)**(-k + l + 1) + Piecewise(
(((x + y)*y)**(i - k)*(x + y)*((x + y)*y)**(l - i),
And(k <= i, i <= l)),
(0, True)
)
def test_deltaproduct_mul_add_x_kd_add_y_kd():
assert dp((x + KD(i, k))*(y + KD(i, j)), (j, 1, 3)) == \
KD(i, 1)*(KD(i, k) + x)*((KD(i, k) + x)*y)**2 + \
KD(i, 2)*(KD(i, k) + x)*y*(KD(i, k) + x)**2*y + \
KD(i, 3)*((KD(i, k) + x)*y)**2*(KD(i, k) + x) + \
((KD(i, k) + x)*y)**3
assert dp((x + KD(i, k))*(y + KD(i, j)), (j, 1, 1)) == \
(x + KD(i, k))*(y + KD(i, 1))
assert dp((x + KD(i, k))*(y + KD(i, j)), (j, 2, 2)) == \
(x + KD(i, k))*(y + KD(i, 2))
assert dp((x + KD(i, k))*(y + KD(i, j)), (j, 3, 3)) == \
(x + KD(i, k))*(y + KD(i, 3))
assert dp((x + KD(i, k))*(y + KD(i, j)), (j, 1, k)) == \
((x + KD(i, k))*y)**k + Piecewise(
(((x + KD(i, k))*y)**(i - 1)*(x + KD(i, k))*
((x + KD(i, k))*y)**(-i + k), And(S(1) <= i, i <= k)),
(0, True)
)
assert dp((x + KD(i, k))*(y + KD(i, j)), (j, k, 3)) == \
((x + KD(i, k))*y)**(4 - k) + Piecewise(
(((x + KD(i, k))*y)**(i - k)*(x + KD(i, k))*
((x + KD(i, k))*y)**(-i + 3), And(k <= i, i <= 3)),
(0, True)
)
assert dp((x + KD(i, k))*(y + KD(i, j)), (j, k, l)) == \
((x + KD(i, k))*y)**(-k + l + 1) + Piecewise(
(((x + KD(i, k))*y)**(i - k)*(x + KD(i, k))*
((x + KD(i, k))*y)**(-i + l), And(k <= i, i <= l)),
(0, True)
)
def test_deltasummation_trivial():
assert ds(x, (j, 1, 0)) == 0
assert ds(x, (j, 1, 3)) == 3*x
assert ds(x + y, (j, 1, 3)) == 3*(x + y)
assert ds(x*y, (j, 1, 3)) == 3*x*y
assert ds(KD(i, j), (k, 1, 3)) == 3*KD(i, j)
assert ds(x*KD(i, j), (k, 1, 3)) == 3*x*KD(i, j)
assert ds(x*y*KD(i, j), (k, 1, 3)) == 3*x*y*KD(i, j)
def test_deltasummation_basic_numerical():
n = symbols('n', integer=True, nonzero=True)
assert ds(KD(n, 0), (n, 1, 3)) == 0
# return unevaluated, until it gets implemented
assert ds(KD(i**2, j**2), (j, -oo, oo)) == \
Sum(KD(i**2, j**2), (j, -oo, oo))
assert Piecewise((KD(i, k), And(S(1) <= i, i <= 3)), (0, True)) == \
ds(KD(i, j)*KD(j, k), (j, 1, 3)) == \
ds(KD(j, k)*KD(i, j), (j, 1, 3))
assert ds(KD(i, k), (k, -oo, oo)) == 1
assert ds(KD(i, k), (k, 0, oo)) == Piecewise((1, S(0) <= i), (0, True))
assert ds(KD(i, k), (k, 1, 3)) == \
Piecewise((1, And(S(1) <= i, i <= 3)), (0, True))
assert ds(k*KD(i, j)*KD(j, k), (k, -oo, oo)) == j*KD(i, j)
assert ds(j*KD(i, j), (j, -oo, oo)) == i
assert ds(i*KD(i, j), (i, -oo, oo)) == j
assert ds(x, (i, 1, 3)) == 3*x
assert ds((i + j)*KD(i, j), (j, -oo, oo)) == 2*i
def test_deltasummation_basic_symbolic():
assert ds(KD(i, j), (j, 1, 3)) == \
Piecewise((1, And(S(1) <= i, i <= 3)), (0, True))
assert ds(KD(i, j), (j, 1, 1)) == Piecewise((1, Eq(i, 1)), (0, True))
assert ds(KD(i, j), (j, 2, 2)) == Piecewise((1, Eq(i, 2)), (0, True))
assert ds(KD(i, j), (j, 3, 3)) == Piecewise((1, Eq(i, 3)), (0, True))
assert ds(KD(i, j), (j, 1, k)) == \
Piecewise((1, And(S(1) <= i, i <= k)), (0, True))
assert ds(KD(i, j), (j, k, 3)) == \
Piecewise((1, And(k <= i, i <= 3)), (0, True))
assert ds(KD(i, j), (j, k, l)) == \
Piecewise((1, And(k <= i, i <= l)), (0, True))
def test_deltasummation_mul_x_kd():
assert ds(x*KD(i, j), (j, 1, 3)) == \
Piecewise((x, And(S(1) <= i, i <= 3)), (0, True))
assert ds(x*KD(i, j), (j, 1, 1)) == Piecewise((x, Eq(i, 1)), (0, True))
assert ds(x*KD(i, j), (j, 2, 2)) == Piecewise((x, Eq(i, 2)), (0, True))
assert ds(x*KD(i, j), (j, 3, 3)) == Piecewise((x, Eq(i, 3)), (0, True))
assert ds(x*KD(i, j), (j, 1, k)) == \
Piecewise((x, And(S(1) <= i, i <= k)), (0, True))
assert ds(x*KD(i, j), (j, k, 3)) == \
Piecewise((x, And(k <= i, i <= 3)), (0, True))
assert ds(x*KD(i, j), (j, k, l)) == \
Piecewise((x, And(k <= i, i <= l)), (0, True))
def test_deltasummation_mul_add_x_y_kd():
assert ds((x + y)*KD(i, j), (j, 1, 3)) == \
Piecewise((x + y, And(S(1) <= i, i <= 3)), (0, True))
assert ds((x + y)*KD(i, j), (j, 1, 1)) == \
Piecewise((x + y, Eq(i, 1)), (0, True))
assert ds((x + y)*KD(i, j), (j, 2, 2)) == \
Piecewise((x + y, Eq(i, 2)), (0, True))
assert ds((x + y)*KD(i, j), (j, 3, 3)) == \
Piecewise((x + y, Eq(i, 3)), (0, True))
assert ds((x + y)*KD(i, j), (j, 1, k)) == \
Piecewise((x + y, And(S(1) <= i, i <= k)), (0, True))
assert ds((x + y)*KD(i, j), (j, k, 3)) == \
Piecewise((x + y, And(k <= i, i <= 3)), (0, True))
assert ds((x + y)*KD(i, j), (j, k, l)) == \
Piecewise((x + y, And(k <= i, i <= l)), (0, True))
def test_deltasummation_add_kd_kd():
assert ds(KD(i, k) + KD(j, k), (k, 1, 3)) == piecewise_fold(
Piecewise((1, And(S(1) <= i, i <= 3)), (0, True)) +
Piecewise((1, And(S(1) <= j, j <= 3)), (0, True)))
assert ds(KD(i, k) + KD(j, k), (k, 1, 1)) == piecewise_fold(
Piecewise((1, Eq(i, 1)), (0, True)) +
Piecewise((1, Eq(j, 1)), (0, True)))
assert ds(KD(i, k) + KD(j, k), (k, 2, 2)) == piecewise_fold(
Piecewise((1, Eq(i, 2)), (0, True)) +
Piecewise((1, Eq(j, 2)), (0, True)))
assert ds(KD(i, k) + KD(j, k), (k, 3, 3)) == piecewise_fold(
Piecewise((1, Eq(i, 3)), (0, True)) +
Piecewise((1, Eq(j, 3)), (0, True)))
assert ds(KD(i, k) + KD(j, k), (k, 1, l)) == piecewise_fold(
Piecewise((1, And(S(1) <= i, i <= l)), (0, True)) +
Piecewise((1, And(S(1) <= j, j <= l)), (0, True)))
assert ds(KD(i, k) + KD(j, k), (k, l, 3)) == piecewise_fold(
Piecewise((1, And(l <= i, i <= 3)), (0, True)) +
Piecewise((1, And(l <= j, j <= 3)), (0, True)))
assert ds(KD(i, k) + KD(j, k), (k, l, m)) == piecewise_fold(
Piecewise((1, And(l <= i, i <= m)), (0, True)) +
Piecewise((1, And(l <= j, j <= m)), (0, True)))
def test_deltasummation_add_mul_x_kd_kd():
assert ds(x*KD(i, k) + KD(j, k), (k, 1, 3)) == piecewise_fold(
Piecewise((x, And(S(1) <= i, i <= 3)), (0, True)) +
Piecewise((1, And(S(1) <= j, j <= 3)), (0, True)))
assert ds(x*KD(i, k) + KD(j, k), (k, 1, 1)) == piecewise_fold(
Piecewise((x, Eq(i, 1)), (0, True)) +
Piecewise((1, Eq(j, 1)), (0, True)))
assert ds(x*KD(i, k) + KD(j, k), (k, 2, 2)) == piecewise_fold(
Piecewise((x, Eq(i, 2)), (0, True)) +
Piecewise((1, Eq(j, 2)), (0, True)))
assert ds(x*KD(i, k) + KD(j, k), (k, 3, 3)) == piecewise_fold(
Piecewise((x, Eq(i, 3)), (0, True)) +
Piecewise((1, Eq(j, 3)), (0, True)))
assert ds(x*KD(i, k) + KD(j, k), (k, 1, l)) == piecewise_fold(
Piecewise((x, And(S(1) <= i, i <= l)), (0, True)) +
Piecewise((1, And(S(1) <= j, j <= l)), (0, True)))
assert ds(x*KD(i, k) + KD(j, k), (k, l, 3)) == piecewise_fold(
Piecewise((x, And(l <= i, i <= 3)), (0, True)) +
Piecewise((1, And(l <= j, j <= 3)), (0, True)))
assert ds(x*KD(i, k) + KD(j, k), (k, l, m)) == piecewise_fold(
Piecewise((x, And(l <= i, i <= m)), (0, True)) +
Piecewise((1, And(l <= j, j <= m)), (0, True)))
def test_deltasummation_mul_x_add_kd_kd():
assert ds(x*(KD(i, k) + KD(j, k)), (k, 1, 3)) == piecewise_fold(
Piecewise((x, And(S(1) <= i, i <= 3)), (0, True)) +
Piecewise((x, And(S(1) <= j, j <= 3)), (0, True)))
assert ds(x*(KD(i, k) + KD(j, k)), (k, 1, 1)) == piecewise_fold(
Piecewise((x, Eq(i, 1)), (0, True)) +
Piecewise((x, Eq(j, 1)), (0, True)))
assert ds(x*(KD(i, k) + KD(j, k)), (k, 2, 2)) == piecewise_fold(
Piecewise((x, Eq(i, 2)), (0, True)) +
Piecewise((x, Eq(j, 2)), (0, True)))
assert ds(x*(KD(i, k) + KD(j, k)), (k, 3, 3)) == piecewise_fold(
Piecewise((x, Eq(i, 3)), (0, True)) +
Piecewise((x, Eq(j, 3)), (0, True)))
assert ds(x*(KD(i, k) + KD(j, k)), (k, 1, l)) == piecewise_fold(
Piecewise((x, And(S(1) <= i, i <= l)), (0, True)) +
Piecewise((x, And(S(1) <= j, j <= l)), (0, True)))
assert ds(x*(KD(i, k) + KD(j, k)), (k, l, 3)) == piecewise_fold(
Piecewise((x, And(l <= i, i <= 3)), (0, True)) +
Piecewise((x, And(l <= j, j <= 3)), (0, True)))
assert ds(x*(KD(i, k) + KD(j, k)), (k, l, m)) == piecewise_fold(
Piecewise((x, And(l <= i, i <= m)), (0, True)) +
Piecewise((x, And(l <= j, j <= m)), (0, True)))
def test_deltasummation_mul_add_x_y_add_kd_kd():
assert ds((x + y)*(KD(i, k) + KD(j, k)), (k, 1, 3)) == piecewise_fold(
Piecewise((x + y, And(S(1) <= i, i <= 3)), (0, True)) +
Piecewise((x + y, And(S(1) <= j, j <= 3)), (0, True)))
assert ds((x + y)*(KD(i, k) + KD(j, k)), (k, 1, 1)) == piecewise_fold(
Piecewise((x + y, Eq(i, 1)), (0, True)) +
Piecewise((x + y, Eq(j, 1)), (0, True)))
assert ds((x + y)*(KD(i, k) + KD(j, k)), (k, 2, 2)) == piecewise_fold(
Piecewise((x + y, Eq(i, 2)), (0, True)) +
Piecewise((x + y, Eq(j, 2)), (0, True)))
assert ds((x + y)*(KD(i, k) + KD(j, k)), (k, 3, 3)) == piecewise_fold(
Piecewise((x + y, Eq(i, 3)), (0, True)) +
Piecewise((x + y, Eq(j, 3)), (0, True)))
assert ds((x + y)*(KD(i, k) + KD(j, k)), (k, 1, l)) == piecewise_fold(
Piecewise((x + y, And(S(1) <= i, i <= l)), (0, True)) +
Piecewise((x + y, And(S(1) <= j, j <= l)), (0, True)))
assert ds((x + y)*(KD(i, k) + KD(j, k)), (k, l, 3)) == piecewise_fold(
Piecewise((x + y, And(l <= i, i <= 3)), (0, True)) +
Piecewise((x + y, And(l <= j, j <= 3)), (0, True)))
assert ds((x + y)*(KD(i, k) + KD(j, k)), (k, l, m)) == piecewise_fold(
Piecewise((x + y, And(l <= i, i <= m)), (0, True)) +
Piecewise((x + y, And(l <= j, j <= m)), (0, True)))
def test_deltasummation_add_mul_x_y_mul_x_kd():
assert ds(x*y + x*KD(i, j), (j, 1, 3)) == \
Piecewise((3*x*y + x, And(S(1) <= i, i <= 3)), (3*x*y, True))
assert ds(x*y + x*KD(i, j), (j, 1, 1)) == \
Piecewise((x*y + x, Eq(i, 1)), (x*y, True))
assert ds(x*y + x*KD(i, j), (j, 2, 2)) == \
Piecewise((x*y + x, Eq(i, 2)), (x*y, True))
assert ds(x*y + x*KD(i, j), (j, 3, 3)) == \
Piecewise((x*y + x, Eq(i, 3)), (x*y, True))
assert ds(x*y + x*KD(i, j), (j, 1, k)) == \
Piecewise((k*x*y + x, And(S(1) <= i, i <= k)), (k*x*y, True))
assert ds(x*y + x*KD(i, j), (j, k, 3)) == \
Piecewise(((4 - k)*x*y + x, And(k <= i, i <= 3)), ((4 - k)*x*y, True))
assert ds(x*y + x*KD(i, j), (j, k, l)) == Piecewise(
((l - k + 1)*x*y + x, And(k <= i, i <= l)), ((l - k + 1)*x*y, True))
def test_deltasummation_mul_x_add_y_kd():
assert ds(x*(y + KD(i, j)), (j, 1, 3)) == \
Piecewise((3*x*y + x, And(S(1) <= i, i <= 3)), (3*x*y, True))
assert ds(x*(y + KD(i, j)), (j, 1, 1)) == \
Piecewise((x*y + x, Eq(i, 1)), (x*y, True))
assert ds(x*(y + KD(i, j)), (j, 2, 2)) == \
Piecewise((x*y + x, Eq(i, 2)), (x*y, True))
assert ds(x*(y + KD(i, j)), (j, 3, 3)) == \
Piecewise((x*y + x, Eq(i, 3)), (x*y, True))
assert ds(x*(y + KD(i, j)), (j, 1, k)) == \
Piecewise((k*x*y + x, And(S(1) <= i, i <= k)), (k*x*y, True))
assert ds(x*(y + KD(i, j)), (j, k, 3)) == \
Piecewise(((4 - k)*x*y + x, And(k <= i, i <= 3)), ((4 - k)*x*y, True))
assert ds(x*(y + KD(i, j)), (j, k, l)) == Piecewise(
((l - k + 1)*x*y + x, And(k <= i, i <= l)), ((l - k + 1)*x*y, True))
def test_deltasummation_mul_x_add_y_twokd():
assert ds(x*(y + 2*KD(i, j)), (j, 1, 3)) == \
Piecewise((3*x*y + 2*x, And(S(1) <= i, i <= 3)), (3*x*y, True))
assert ds(x*(y + 2*KD(i, j)), (j, 1, 1)) == \
Piecewise((x*y + 2*x, Eq(i, 1)), (x*y, True))
assert ds(x*(y + 2*KD(i, j)), (j, 2, 2)) == \
Piecewise((x*y + 2*x, Eq(i, 2)), (x*y, True))
assert ds(x*(y + 2*KD(i, j)), (j, 3, 3)) == \
Piecewise((x*y + 2*x, Eq(i, 3)), (x*y, True))
assert ds(x*(y + 2*KD(i, j)), (j, 1, k)) == \
Piecewise((k*x*y + 2*x, And(S(1) <= i, i <= k)), (k*x*y, True))
assert ds(x*(y + 2*KD(i, j)), (j, k, 3)) == Piecewise(
((4 - k)*x*y + 2*x, And(k <= i, i <= 3)), ((4 - k)*x*y, True))
assert ds(x*(y + 2*KD(i, j)), (j, k, l)) == Piecewise(
((l - k + 1)*x*y + 2*x, And(k <= i, i <= l)), ((l - k + 1)*x*y, True))
def test_deltasummation_mul_add_x_y_add_y_kd():
assert ds((x + y)*(y + KD(i, j)), (j, 1, 3)) == Piecewise(
(3*(x + y)*y + x + y, And(S(1) <= i, i <= 3)), (3*(x + y)*y, True))
assert ds((x + y)*(y + KD(i, j)), (j, 1, 1)) == \
Piecewise(((x + y)*y + x + y, Eq(i, 1)), ((x + y)*y, True))
assert ds((x + y)*(y + KD(i, j)), (j, 2, 2)) == \
Piecewise(((x + y)*y + x + y, Eq(i, 2)), ((x + y)*y, True))
assert ds((x + y)*(y + KD(i, j)), (j, 3, 3)) == \
Piecewise(((x + y)*y + x + y, Eq(i, 3)), ((x + y)*y, True))
assert ds((x + y)*(y + KD(i, j)), (j, 1, k)) == Piecewise(
(k*(x + y)*y + x + y, And(S(1) <= i, i <= k)), (k*(x + y)*y, True))
assert ds((x + y)*(y + KD(i, j)), (j, k, 3)) == Piecewise(
((4 - k)*(x + y)*y + x + y, And(k <= i, i <= 3)),
((4 - k)*(x + y)*y, True))
assert ds((x + y)*(y + KD(i, j)), (j, k, l)) == Piecewise(
((l - k + 1)*(x + y)*y + x + y, And(k <= i, i <= l)),
((l - k + 1)*(x + y)*y, True))
def test_deltasummation_mul_add_x_kd_add_y_kd():
assert ds((x + KD(i, k))*(y + KD(i, j)), (j, 1, 3)) == piecewise_fold(
Piecewise((KD(i, k) + x, And(S(1) <= i, i <= 3)), (0, True)) +
3*(KD(i, k) + x)*y)
assert ds((x + KD(i, k))*(y + KD(i, j)), (j, 1, 1)) == piecewise_fold(
Piecewise((KD(i, k) + x, Eq(i, 1)), (0, True)) +
(KD(i, k) + x)*y)
assert ds((x + KD(i, k))*(y + KD(i, j)), (j, 2, 2)) == piecewise_fold(
Piecewise((KD(i, k) + x, Eq(i, 2)), (0, True)) +
(KD(i, k) + x)*y)
assert ds((x + KD(i, k))*(y + KD(i, j)), (j, 3, 3)) == piecewise_fold(
Piecewise((KD(i, k) + x, Eq(i, 3)), (0, True)) +
(KD(i, k) + x)*y)
assert ds((x + KD(i, k))*(y + KD(i, j)), (j, 1, k)) == piecewise_fold(
Piecewise((KD(i, k) + x, And(S(1) <= i, i <= k)), (0, True)) +
k*(KD(i, k) + x)*y)
assert ds((x + KD(i, k))*(y + KD(i, j)), (j, k, 3)) == piecewise_fold(
Piecewise((KD(i, k) + x, And(k <= i, i <= 3)), (0, True)) +
(4 - k)*(KD(i, k) + x)*y)
assert ds((x + KD(i, k))*(y + KD(i, j)), (j, k, l)) == piecewise_fold(
Piecewise((KD(i, k) + x, And(k <= i, i <= l)), (0, True)) +
(l - k + 1)*(KD(i, k) + x)*y)
|
bsd-3-clause
|
[
504,
5840,
14,
13455,
492,
12094,
199,
504,
5840,
14,
13455,
14,
3136,
492,
2150,
16609,
293,
1601,
465,
12392,
12,
27446,
453,
1615,
465,
6364,
199,
504,
5840,
14,
1018,
492,
21779,
12,
428,
12,
6698,
12,
16390,
199,
504,
5840,
14,
5777,
492,
1804,
82,
368,
22043,
13411,
465,
31368,
12,
31362,
12,
14854,
2605,
63,
14011,
199,
504,
5840,
14,
15370,
492,
6061,
199,
199,
73,
12,
1335,
12,
1022,
12,
634,
12,
333,
275,
6698,
480,
73,
1335,
1022,
634,
333,
401,
3000,
29,
549,
12,
21837,
29,
549,
9,
199,
88,
12,
612,
275,
6698,
480,
88,
612,
401,
1923,
28177,
29,
797,
9,
421,
199,
318,
511,
63,
2264,
16609,
293,
1601,
63,
23844,
837,
272,
702,
12392,
8,
88,
12,
334,
74,
12,
413,
12,
378,
430,
508,
413,
272,
702,
12392,
8,
88,
12,
334,
74,
12,
413,
12,
650,
430,
508,
671,
538,
19,
272,
702,
12392,
8,
88,
435,
612,
12,
334,
74,
12,
413,
12,
650,
430,
508,
334,
88,
435,
612,
6422,
19,
272,
702,
12392,
8,
88,
10,
89,
12,
334,
74,
12,
413,
12,
650,
430,
508,
334,
88,
10,
89,
6422,
19,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
75,
12,
413,
12,
650,
430,
508,
31368,
8,
73,
12,
1335,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
75,
12,
413,
12,
650,
430,
508,
671,
538,
19,
10,
13368,
8,
73,
12,
1335,
9,
272,
702,
12392,
8,
88,
10,
89,
10,
13368,
8,
73,
12,
1335,
395,
334,
75,
12,
413,
12,
650,
430,
508,
334,
88,
10,
89,
6422,
19,
10,
13368,
8,
73,
12,
1335,
9,
421,
199,
318,
511,
63,
2264,
16609,
293,
1601,
63,
4316,
837,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
650,
430,
508,
378,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
413,
430,
508,
31368,
8,
73,
12,
413,
9,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
499,
12,
499,
430,
508,
31368,
8,
73,
12,
499,
9,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
650,
12,
650,
430,
508,
31368,
8,
73,
12,
650,
9,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
1022,
430,
508,
31368,
8,
73,
12,
413,
3342,
13368,
8,
75,
12,
413,
9,
435,
31368,
8,
75,
12,
378,
9,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
650,
430,
508,
31368,
8,
73,
12,
650,
3342,
13368,
8,
75,
12,
650,
9,
435,
31368,
8,
75,
12,
841,
9,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
634,
430,
508,
31368,
8,
73,
12,
634,
3342,
13368,
8,
75,
12,
634,
9,
435,
31368,
8,
75,
12,
634,
435,
413,
9,
421,
199,
318,
511,
63,
2264,
16609,
293,
1601,
63,
3703,
63,
88,
63,
25606,
837,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
650,
430,
508,
378,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
413,
430,
508,
671,
10,
13368,
8,
73,
12,
413,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
499,
12,
499,
430,
508,
671,
10,
13368,
8,
73,
12,
499,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
650,
12,
650,
430,
508,
671,
10,
13368,
8,
73,
12,
650,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
1022,
430,
508,
671,
10,
13368,
8,
73,
12,
413,
3342,
13368,
8,
75,
12,
413,
9,
435,
31368,
8,
75,
12,
378,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
650,
430,
508,
671,
10,
13368,
8,
73,
12,
650,
3342,
13368,
8,
75,
12,
650,
9,
435,
31368,
8,
75,
12,
841,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
634,
430,
508,
671,
10,
13368,
8,
73,
12,
634,
3342,
13368,
8,
75,
12,
634,
9,
435,
31368,
8,
75,
12,
634,
435,
413,
9,
421,
199,
318,
511,
63,
2264,
16609,
293,
1601,
63,
3703,
63,
525,
63,
88,
63,
89,
63,
25606,
837,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
650,
430,
508,
378,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
413,
430,
508,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
413,
9,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
499,
12,
499,
430,
508,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
499,
9,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
650,
12,
650,
430,
508,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
650,
9,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
1022,
430,
508,
971,
267,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
413,
3342,
13368,
8,
75,
12,
413,
9,
435,
31368,
8,
75,
12,
378,
9,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
650,
430,
508,
971,
267,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
650,
3342,
13368,
8,
75,
12,
650,
9,
435,
31368,
8,
75,
12,
841,
9,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
634,
430,
508,
971,
267,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
634,
3342,
13368,
8,
75
] |
[
5840,
14,
13455,
492,
12094,
199,
504,
5840,
14,
13455,
14,
3136,
492,
2150,
16609,
293,
1601,
465,
12392,
12,
27446,
453,
1615,
465,
6364,
199,
504,
5840,
14,
1018,
492,
21779,
12,
428,
12,
6698,
12,
16390,
199,
504,
5840,
14,
5777,
492,
1804,
82,
368,
22043,
13411,
465,
31368,
12,
31362,
12,
14854,
2605,
63,
14011,
199,
504,
5840,
14,
15370,
492,
6061,
199,
199,
73,
12,
1335,
12,
1022,
12,
634,
12,
333,
275,
6698,
480,
73,
1335,
1022,
634,
333,
401,
3000,
29,
549,
12,
21837,
29,
549,
9,
199,
88,
12,
612,
275,
6698,
480,
88,
612,
401,
1923,
28177,
29,
797,
9,
421,
199,
318,
511,
63,
2264,
16609,
293,
1601,
63,
23844,
837,
272,
702,
12392,
8,
88,
12,
334,
74,
12,
413,
12,
378,
430,
508,
413,
272,
702,
12392,
8,
88,
12,
334,
74,
12,
413,
12,
650,
430,
508,
671,
538,
19,
272,
702,
12392,
8,
88,
435,
612,
12,
334,
74,
12,
413,
12,
650,
430,
508,
334,
88,
435,
612,
6422,
19,
272,
702,
12392,
8,
88,
10,
89,
12,
334,
74,
12,
413,
12,
650,
430,
508,
334,
88,
10,
89,
6422,
19,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
75,
12,
413,
12,
650,
430,
508,
31368,
8,
73,
12,
1335,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
75,
12,
413,
12,
650,
430,
508,
671,
538,
19,
10,
13368,
8,
73,
12,
1335,
9,
272,
702,
12392,
8,
88,
10,
89,
10,
13368,
8,
73,
12,
1335,
395,
334,
75,
12,
413,
12,
650,
430,
508,
334,
88,
10,
89,
6422,
19,
10,
13368,
8,
73,
12,
1335,
9,
421,
199,
318,
511,
63,
2264,
16609,
293,
1601,
63,
4316,
837,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
650,
430,
508,
378,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
413,
430,
508,
31368,
8,
73,
12,
413,
9,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
499,
12,
499,
430,
508,
31368,
8,
73,
12,
499,
9,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
650,
12,
650,
430,
508,
31368,
8,
73,
12,
650,
9,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
1022,
430,
508,
31368,
8,
73,
12,
413,
3342,
13368,
8,
75,
12,
413,
9,
435,
31368,
8,
75,
12,
378,
9,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
650,
430,
508,
31368,
8,
73,
12,
650,
3342,
13368,
8,
75,
12,
650,
9,
435,
31368,
8,
75,
12,
841,
9,
272,
702,
12392,
8,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
634,
430,
508,
31368,
8,
73,
12,
634,
3342,
13368,
8,
75,
12,
634,
9,
435,
31368,
8,
75,
12,
634,
435,
413,
9,
421,
199,
318,
511,
63,
2264,
16609,
293,
1601,
63,
3703,
63,
88,
63,
25606,
837,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
650,
430,
508,
378,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
413,
430,
508,
671,
10,
13368,
8,
73,
12,
413,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
499,
12,
499,
430,
508,
671,
10,
13368,
8,
73,
12,
499,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
650,
12,
650,
430,
508,
671,
10,
13368,
8,
73,
12,
650,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
1022,
430,
508,
671,
10,
13368,
8,
73,
12,
413,
3342,
13368,
8,
75,
12,
413,
9,
435,
31368,
8,
75,
12,
378,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
650,
430,
508,
671,
10,
13368,
8,
73,
12,
650,
3342,
13368,
8,
75,
12,
650,
9,
435,
31368,
8,
75,
12,
841,
9,
272,
702,
12392,
8,
88,
10,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
634,
430,
508,
671,
10,
13368,
8,
73,
12,
634,
3342,
13368,
8,
75,
12,
634,
9,
435,
31368,
8,
75,
12,
634,
435,
413,
9,
421,
199,
318,
511,
63,
2264,
16609,
293,
1601,
63,
3703,
63,
525,
63,
88,
63,
89,
63,
25606,
837,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
650,
430,
508,
378,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
413,
430,
508,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
413,
9,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
499,
12,
499,
430,
508,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
499,
9,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
650,
12,
650,
430,
508,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
650,
9,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
413,
12,
1022,
430,
508,
971,
267,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
413,
3342,
13368,
8,
75,
12,
413,
9,
435,
31368,
8,
75,
12,
378,
9,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
650,
430,
508,
971,
267,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
650,
3342,
13368,
8,
75,
12,
650,
9,
435,
31368,
8,
75,
12,
841,
9,
272,
702,
12392,
1332,
88,
435,
612,
3342,
13368,
8,
73,
12,
1335,
395,
334,
74,
12,
1022,
12,
634,
430,
508,
971,
267,
334,
88,
435,
612,
3342,
13368,
8,
73,
12,
634,
3342,
13368,
8,
75,
0
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,
1
] |
eugena/django
|
django/contrib/auth/middleware.py
|
258
|
5718
|
from django.contrib import auth
from django.contrib.auth import load_backend
from django.contrib.auth.backends import RemoteUserBackend
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import SimpleLazyObject
def get_user(request):
if not hasattr(request, '_cached_user'):
request._cached_user = auth.get_user(request)
return request._cached_user
class AuthenticationMiddleware(object):
def process_request(self, request):
assert hasattr(request, 'session'), (
"The Django authentication middleware requires session middleware "
"to be installed. Edit your MIDDLEWARE_CLASSES setting to insert "
"'django.contrib.sessions.middleware.SessionMiddleware' before "
"'django.contrib.auth.middleware.AuthenticationMiddleware'."
)
request.user = SimpleLazyObject(lambda: get_user(request))
class SessionAuthenticationMiddleware(object):
"""
Formerly, a middleware for invalidating a user's sessions that don't
correspond to the user's current session authentication hash. However, it
caused the "Vary: Cookie" header on all responses.
Now a backwards compatibility shim that enables session verification in
auth.get_user() if this middleware is in MIDDLEWARE_CLASSES.
"""
def process_request(self, request):
pass
class RemoteUserMiddleware(object):
"""
Middleware for utilizing Web-server-provided authentication.
If request.user is not authenticated, then this middleware attempts to
authenticate the username passed in the ``REMOTE_USER`` request header.
If authentication is successful, the user is automatically logged in to
persist the user in the session.
The header used is configurable and defaults to ``REMOTE_USER``. Subclass
this class and change the ``header`` attribute if you need to use a
different header.
"""
# Name of request header to grab username from. This will be the key as
# used in the request.META dictionary, i.e. the normalization of headers to
# all uppercase and the addition of "HTTP_" prefix apply.
header = "REMOTE_USER"
force_logout_if_no_header = True
def process_request(self, request):
# AuthenticationMiddleware is required so that request.user exists.
if not hasattr(request, 'user'):
raise ImproperlyConfigured(
"The Django remote user auth middleware requires the"
" authentication middleware to be installed. Edit your"
" MIDDLEWARE_CLASSES setting to insert"
" 'django.contrib.auth.middleware.AuthenticationMiddleware'"
" before the RemoteUserMiddleware class.")
try:
username = request.META[self.header]
except KeyError:
# If specified header doesn't exist then remove any existing
# authenticated remote-user, or return (leaving request.user set to
# AnonymousUser by the AuthenticationMiddleware).
if self.force_logout_if_no_header and request.user.is_authenticated():
self._remove_invalid_user(request)
return
# If the user is already authenticated and that user is the user we are
# getting passed in the headers, then the correct user is already
# persisted in the session and we don't need to continue.
if request.user.is_authenticated():
if request.user.get_username() == self.clean_username(username, request):
return
else:
# An authenticated user is associated with the request, but
# it does not match the authorized user in the header.
self._remove_invalid_user(request)
# We are seeing this user for the first time in this session, attempt
# to authenticate the user.
user = auth.authenticate(remote_user=username)
if user:
# User is valid. Set request.user and persist user in the session
# by logging the user in.
request.user = user
auth.login(request, user)
def clean_username(self, username, request):
"""
Allows the backend to clean the username, if the backend defines a
clean_username method.
"""
backend_str = request.session[auth.BACKEND_SESSION_KEY]
backend = auth.load_backend(backend_str)
try:
username = backend.clean_username(username)
except AttributeError: # Backend has no clean_username method.
pass
return username
def _remove_invalid_user(self, request):
"""
Removes the current authenticated user in the request which is invalid
but only if the user is authenticated via the RemoteUserBackend.
"""
try:
stored_backend = load_backend(request.session.get(auth.BACKEND_SESSION_KEY, ''))
except ImportError:
# backend failed to load
auth.logout(request)
else:
if isinstance(stored_backend, RemoteUserBackend):
auth.logout(request)
class PersistentRemoteUserMiddleware(RemoteUserMiddleware):
"""
Middleware for Web-server provided authentication on logon pages.
Like RemoteUserMiddleware but keeps the user authenticated even if
the header (``REMOTE_USER``) is not found in the request. Useful
for setups when the external authentication via ``REMOTE_USER``
is only expected to happen on some "logon" URL and the rest of
the application wants to use Django's authentication mechanism.
"""
force_logout_if_no_header = False
|
bsd-3-clause
|
[
504,
1639,
14,
2828,
492,
1790,
199,
504,
1639,
14,
2828,
14,
1178,
492,
2248,
63,
4620,
199,
504,
1639,
14,
2828,
14,
1178,
14,
7765,
492,
17283,
1899,
8447,
199,
504,
1639,
14,
1018,
14,
3924,
492,
11897,
199,
504,
1639,
14,
1208,
14,
15481,
492,
5870,
14269,
1692,
421,
199,
318,
664,
63,
751,
8,
1069,
304,
272,
340,
440,
2688,
8,
1069,
12,
2513,
5245,
63,
751,
735,
267,
1056,
423,
5245,
63,
751,
275,
1790,
14,
362,
63,
751,
8,
1069,
9,
272,
372,
1056,
423,
5245,
63,
751,
421,
199,
533,
15995,
6608,
8,
785,
304,
272,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
702,
2688,
8,
1069,
12,
283,
1730,
659,
334,
288,
298,
1918,
5634,
6299,
10816,
5074,
2351,
10816,
298,
288,
298,
475,
506,
4903,
14,
16407,
2195,
30718,
63,
13748,
4260,
370,
5518,
298,
288,
3546,
1176,
14,
2828,
14,
11676,
14,
5754,
14,
4434,
6608,
7,
2544,
298,
288,
3546,
1176,
14,
2828,
14,
1178,
14,
5754,
14,
10348,
6608,
16669,
267,
776,
267,
1056,
14,
751,
275,
5870,
14269,
1692,
8,
2734,
26,
664,
63,
751,
8,
1069,
430,
421,
199,
533,
8596,
10348,
6608,
8,
785,
304,
272,
408,
272,
2104,
2626,
590,
12,
282,
10816,
367,
3866,
1958,
282,
922,
1159,
12184,
626,
2793,
1133,
272,
17118,
370,
314,
922,
1159,
1453,
2351,
6299,
2631,
14,
9738,
12,
652,
272,
18104,
314,
298,
54,
695,
26,
14798,
2,
1406,
641,
1006,
9320,
14,
339,
7356,
282,
8552,
7163,
25905,
626,
22741,
2351,
14786,
315,
272,
1790,
14,
362,
63,
751,
342,
340,
642,
10816,
365,
315,
30718,
63,
13748,
14,
272,
408,
272,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
986,
421,
199,
533,
17283,
1899,
6608,
8,
785,
304,
272,
408,
272,
603,
3551,
367,
7678,
19030,
316,
6001,
13,
1000,
13,
16929,
6299,
14,
339,
982,
1056,
14,
751,
365,
440,
15082,
12,
2066,
642,
10816,
12454,
370,
272,
12895,
314,
3434,
3032,
315,
314,
1124,
16058,
63,
3791,
1040,
1056,
1406,
14,
272,
982,
6299,
365,
9512,
12,
314,
922,
365,
5847,
10367,
315,
370,
272,
22400,
314,
922,
315,
314,
2351,
14,
339,
710,
1406,
1202,
365,
30241,
436,
4243,
370,
1124,
16058,
63,
3791,
4345,
221,
30184,
272,
642,
1021,
436,
1570,
314,
1124,
1291,
1040,
2225,
340,
1265,
1929,
370,
675,
282,
272,
3365,
1406,
14,
272,
408,
339,
327,
2812,
402,
1056,
1406,
370,
18200,
3434,
687,
14,
221,
961,
911,
506,
314,
790,
465,
272,
327,
1202,
315,
314,
1056,
14,
10614,
2600,
12,
284,
14,
69,
14,
314,
16973,
402,
2323,
370,
272,
327,
1006,
22681,
436,
314,
10234,
402,
298,
2856,
12172,
2403,
4838,
14,
272,
1406,
275,
298,
16058,
63,
3791,
2,
272,
3542,
63,
11646,
63,
692,
63,
889,
63,
1291,
275,
715,
339,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
327,
15995,
6608,
365,
1415,
880,
626,
1056,
14,
751,
3495,
14,
267,
340,
440,
2688,
8,
1069,
12,
283,
751,
735,
288,
746,
11897,
8,
355,
298,
1918,
5634,
3982,
922,
1790,
10816,
5074,
314,
2,
355,
298,
6299,
10816,
370,
506,
4903,
14,
221,
16407,
2195,
2,
355,
298,
30718,
63,
13748,
4260,
370,
5518,
2,
355,
298,
283,
1176,
14,
2828,
14,
1178,
14,
5754,
14,
10348,
6608,
4065,
355,
298,
2544,
314,
17283,
1899,
6608,
1021,
2685,
267,
862,
26,
288,
3434,
275,
1056,
14,
10614,
59,
277,
14,
1291,
61,
267,
871,
4067,
26,
288,
327,
982,
2013,
1406,
3181,
1133,
2187,
2066,
2813,
1263,
3411,
288,
327,
15082,
3982,
13,
751,
12,
503,
372,
334,
274,
5519,
1056,
14,
751,
663,
370,
288,
327,
29952,
701,
314,
15995,
6608,
680,
288,
340,
291,
14,
3990,
63,
11646,
63,
692,
63,
889,
63,
1291,
436,
1056,
14,
751,
14,
374,
63,
12177,
837,
355,
291,
423,
2168,
63,
3197,
63,
751,
8,
1069,
9,
288,
372,
267,
327,
982,
314,
922,
365,
2575,
15082,
436,
626,
922,
365,
314,
922,
781,
787,
267,
327,
10232,
3032,
315,
314,
2323,
12,
2066,
314,
3211,
922,
365,
2575,
267,
327,
1126,
24925,
315,
314,
2351,
436,
781,
2793,
1133,
1929,
370,
1980,
14,
267,
340,
1056,
14,
751,
14,
374,
63,
12177,
837,
288,
340,
1056,
14,
751,
14,
362,
63,
2473,
342,
508,
291,
14,
3118,
63,
2473,
8,
2473,
12,
1056,
304,
355,
372,
288,
587,
26,
355,
327,
1626,
15082,
922,
365,
4568,
543,
314,
1056,
12,
1325,
355,
327,
652,
1630,
440,
1336,
314,
18788,
922,
315,
314,
1406,
14,
355,
291,
423,
2168,
63,
3197,
63,
751,
8,
1069,
9,
398,
327,
2136,
787,
1937,
316,
642,
922,
367,
314,
1642,
900,
315,
642,
2351,
12,
7427,
267,
327,
370,
12895,
314,
922,
14,
267,
922,
275,
1790,
14,
13975,
8,
3846,
63,
751,
29,
2473,
9,
267,
340,
922,
26,
288,
327,
2876,
365,
1686,
14,
221,
2494,
1056,
14,
751,
436,
22400,
922,
315,
314,
2351,
288,
327,
701,
2050,
314,
922,
315,
14,
288,
1056,
14,
751,
275,
922,
288,
1790,
14,
2886,
8,
1069,
12,
922,
9,
339,
347,
3633,
63,
2473,
8,
277,
12,
3434,
12,
1056,
304,
267,
408,
267,
22819,
314,
4865,
370,
3633,
314,
3434,
12,
340,
314,
4865,
7890,
282,
267,
3633,
63,
2473,
1083,
14,
267,
408,
267,
4865,
63,
495,
275,
1056,
14,
1730,
59,
1178,
14,
18145,
63,
12763,
63,
3078,
61,
267,
4865,
275,
1790,
14,
912,
63,
4620,
8,
4620,
63,
495,
9,
267,
862,
26,
288,
3434,
275,
4865,
14,
3118,
63,
2473,
8,
2473,
9,
267,
871,
4281,
26,
221,
327,
25674,
965,
949,
3633,
63,
2473,
1083,
14,
288,
986,
267,
372,
3434,
339,
347,
485,
2168,
63,
3197,
63,
751,
8,
277,
12,
1056,
304,
267,
408,
267,
23169,
314,
1453,
15082,
922,
315,
314,
1056,
1314,
365,
3866,
267,
1325,
1454,
340,
314,
922,
365,
15082,
4799,
314,
17283,
1899,
8447,
14,
267,
408,
267,
862,
26,
288,
5489,
63,
4620,
275,
2248,
63,
4620,
8,
1069,
14,
1730,
14,
362,
8,
1178,
14,
18145,
63,
12763,
63,
3078,
12,
12381,
267
] |
[
1639,
14,
2828,
492,
1790,
199,
504,
1639,
14,
2828,
14,
1178,
492,
2248,
63,
4620,
199,
504,
1639,
14,
2828,
14,
1178,
14,
7765,
492,
17283,
1899,
8447,
199,
504,
1639,
14,
1018,
14,
3924,
492,
11897,
199,
504,
1639,
14,
1208,
14,
15481,
492,
5870,
14269,
1692,
421,
199,
318,
664,
63,
751,
8,
1069,
304,
272,
340,
440,
2688,
8,
1069,
12,
2513,
5245,
63,
751,
735,
267,
1056,
423,
5245,
63,
751,
275,
1790,
14,
362,
63,
751,
8,
1069,
9,
272,
372,
1056,
423,
5245,
63,
751,
421,
199,
533,
15995,
6608,
8,
785,
304,
272,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
702,
2688,
8,
1069,
12,
283,
1730,
659,
334,
288,
298,
1918,
5634,
6299,
10816,
5074,
2351,
10816,
298,
288,
298,
475,
506,
4903,
14,
16407,
2195,
30718,
63,
13748,
4260,
370,
5518,
298,
288,
3546,
1176,
14,
2828,
14,
11676,
14,
5754,
14,
4434,
6608,
7,
2544,
298,
288,
3546,
1176,
14,
2828,
14,
1178,
14,
5754,
14,
10348,
6608,
16669,
267,
776,
267,
1056,
14,
751,
275,
5870,
14269,
1692,
8,
2734,
26,
664,
63,
751,
8,
1069,
430,
421,
199,
533,
8596,
10348,
6608,
8,
785,
304,
272,
408,
272,
2104,
2626,
590,
12,
282,
10816,
367,
3866,
1958,
282,
922,
1159,
12184,
626,
2793,
1133,
272,
17118,
370,
314,
922,
1159,
1453,
2351,
6299,
2631,
14,
9738,
12,
652,
272,
18104,
314,
298,
54,
695,
26,
14798,
2,
1406,
641,
1006,
9320,
14,
339,
7356,
282,
8552,
7163,
25905,
626,
22741,
2351,
14786,
315,
272,
1790,
14,
362,
63,
751,
342,
340,
642,
10816,
365,
315,
30718,
63,
13748,
14,
272,
408,
272,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
986,
421,
199,
533,
17283,
1899,
6608,
8,
785,
304,
272,
408,
272,
603,
3551,
367,
7678,
19030,
316,
6001,
13,
1000,
13,
16929,
6299,
14,
339,
982,
1056,
14,
751,
365,
440,
15082,
12,
2066,
642,
10816,
12454,
370,
272,
12895,
314,
3434,
3032,
315,
314,
1124,
16058,
63,
3791,
1040,
1056,
1406,
14,
272,
982,
6299,
365,
9512,
12,
314,
922,
365,
5847,
10367,
315,
370,
272,
22400,
314,
922,
315,
314,
2351,
14,
339,
710,
1406,
1202,
365,
30241,
436,
4243,
370,
1124,
16058,
63,
3791,
4345,
221,
30184,
272,
642,
1021,
436,
1570,
314,
1124,
1291,
1040,
2225,
340,
1265,
1929,
370,
675,
282,
272,
3365,
1406,
14,
272,
408,
339,
327,
2812,
402,
1056,
1406,
370,
18200,
3434,
687,
14,
221,
961,
911,
506,
314,
790,
465,
272,
327,
1202,
315,
314,
1056,
14,
10614,
2600,
12,
284,
14,
69,
14,
314,
16973,
402,
2323,
370,
272,
327,
1006,
22681,
436,
314,
10234,
402,
298,
2856,
12172,
2403,
4838,
14,
272,
1406,
275,
298,
16058,
63,
3791,
2,
272,
3542,
63,
11646,
63,
692,
63,
889,
63,
1291,
275,
715,
339,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
327,
15995,
6608,
365,
1415,
880,
626,
1056,
14,
751,
3495,
14,
267,
340,
440,
2688,
8,
1069,
12,
283,
751,
735,
288,
746,
11897,
8,
355,
298,
1918,
5634,
3982,
922,
1790,
10816,
5074,
314,
2,
355,
298,
6299,
10816,
370,
506,
4903,
14,
221,
16407,
2195,
2,
355,
298,
30718,
63,
13748,
4260,
370,
5518,
2,
355,
298,
283,
1176,
14,
2828,
14,
1178,
14,
5754,
14,
10348,
6608,
4065,
355,
298,
2544,
314,
17283,
1899,
6608,
1021,
2685,
267,
862,
26,
288,
3434,
275,
1056,
14,
10614,
59,
277,
14,
1291,
61,
267,
871,
4067,
26,
288,
327,
982,
2013,
1406,
3181,
1133,
2187,
2066,
2813,
1263,
3411,
288,
327,
15082,
3982,
13,
751,
12,
503,
372,
334,
274,
5519,
1056,
14,
751,
663,
370,
288,
327,
29952,
701,
314,
15995,
6608,
680,
288,
340,
291,
14,
3990,
63,
11646,
63,
692,
63,
889,
63,
1291,
436,
1056,
14,
751,
14,
374,
63,
12177,
837,
355,
291,
423,
2168,
63,
3197,
63,
751,
8,
1069,
9,
288,
372,
267,
327,
982,
314,
922,
365,
2575,
15082,
436,
626,
922,
365,
314,
922,
781,
787,
267,
327,
10232,
3032,
315,
314,
2323,
12,
2066,
314,
3211,
922,
365,
2575,
267,
327,
1126,
24925,
315,
314,
2351,
436,
781,
2793,
1133,
1929,
370,
1980,
14,
267,
340,
1056,
14,
751,
14,
374,
63,
12177,
837,
288,
340,
1056,
14,
751,
14,
362,
63,
2473,
342,
508,
291,
14,
3118,
63,
2473,
8,
2473,
12,
1056,
304,
355,
372,
288,
587,
26,
355,
327,
1626,
15082,
922,
365,
4568,
543,
314,
1056,
12,
1325,
355,
327,
652,
1630,
440,
1336,
314,
18788,
922,
315,
314,
1406,
14,
355,
291,
423,
2168,
63,
3197,
63,
751,
8,
1069,
9,
398,
327,
2136,
787,
1937,
316,
642,
922,
367,
314,
1642,
900,
315,
642,
2351,
12,
7427,
267,
327,
370,
12895,
314,
922,
14,
267,
922,
275,
1790,
14,
13975,
8,
3846,
63,
751,
29,
2473,
9,
267,
340,
922,
26,
288,
327,
2876,
365,
1686,
14,
221,
2494,
1056,
14,
751,
436,
22400,
922,
315,
314,
2351,
288,
327,
701,
2050,
314,
922,
315,
14,
288,
1056,
14,
751,
275,
922,
288,
1790,
14,
2886,
8,
1069,
12,
922,
9,
339,
347,
3633,
63,
2473,
8,
277,
12,
3434,
12,
1056,
304,
267,
408,
267,
22819,
314,
4865,
370,
3633,
314,
3434,
12,
340,
314,
4865,
7890,
282,
267,
3633,
63,
2473,
1083,
14,
267,
408,
267,
4865,
63,
495,
275,
1056,
14,
1730,
59,
1178,
14,
18145,
63,
12763,
63,
3078,
61,
267,
4865,
275,
1790,
14,
912,
63,
4620,
8,
4620,
63,
495,
9,
267,
862,
26,
288,
3434,
275,
4865,
14,
3118,
63,
2473,
8,
2473,
9,
267,
871,
4281,
26,
221,
327,
25674,
965,
949,
3633,
63,
2473,
1083,
14,
288,
986,
267,
372,
3434,
339,
347,
485,
2168,
63,
3197,
63,
751,
8,
277,
12,
1056,
304,
267,
408,
267,
23169,
314,
1453,
15082,
922,
315,
314,
1056,
1314,
365,
3866,
267,
1325,
1454,
340,
314,
922,
365,
15082,
4799,
314,
17283,
1899,
8447,
14,
267,
408,
267,
862,
26,
288,
5489,
63,
4620,
275,
2248,
63,
4620,
8,
1069,
14,
1730,
14,
362,
8,
1178,
14,
18145,
63,
12763,
63,
3078,
12,
12381,
267,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
outofbits/tracker
|
tests/functional-tests/unittest2/__init__.py
|
5
|
2432
|
#!/usr/bin/python
"""
unittest2
unittest2 is a backport of the new features added to the unittest testing
framework in Python 2.7. It is tested to run on Python 2.4 - 2.6.
To use unittest2 instead of unittest simply replace ``import unittest`` with
``import unittest2``.
Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-2010 Python Software Foundation
This module is free software, and you may redistribute it and/or modify
it under the same terms as Python itself, so long as this copyright message
and disclaimer are retained in their original form.
IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
"""
__all__ = ['TestResult', 'TestCase', 'TestSuite',
'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main',
'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless',
'expectedFailure', 'TextTestResult', '__version__']
__version__ = '0.4.1'
# Expose obsolete functions for backwards compatibility
__all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases'])
# To use the local copy!
import sys
sys.path.insert (0, "./common")
from unittest2.result import TestResult
from unittest2.case import (
TestCase, FunctionTestCase, SkipTest, skip, skipIf,
skipUnless, expectedFailure
)
from unittest2.suite import BaseTestSuite, TestSuite
from unittest2.loader import (
TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,
findTestCases
)
from unittest2.main import TestProgram, main
from unittest2.runner import TextTestRunner, TextTestResult
try:
from unittest2.signals import (
installHandler, registerResult, removeResult, removeHandler
)
except ImportError:
# Compatibility with platforms that don't have the signal module
pass
else:
__all__.extend(['installHandler', 'registerResult', 'removeResult',
'removeHandler'])
# deprecated
_TextTestResult = TextTestResult
__unittest = True
|
lgpl-2.1
|
[
3381,
2647,
15,
1393,
15,
1548,
199,
199,
624,
199,
2796,
18,
199,
199,
2796,
18,
365,
282,
1771,
719,
402,
314,
892,
4534,
3483,
370,
314,
2882,
5343,
199,
4857,
315,
2018,
499,
14,
23,
14,
2779,
365,
12470,
370,
1255,
641,
2018,
499,
14,
20,
446,
499,
14,
22,
14,
199,
199,
1378,
675,
2882,
18,
3140,
402,
2882,
9329,
3350,
1124,
646,
2882,
1040,
543,
199,
1040,
646,
2882,
18,
4345,
421,
199,
7384,
334,
67,
9,
21300,
13,
17919,
17854,
432,
23177,
3890,
199,
7384,
334,
67,
9,
13004,
13,
6542,
2018,
2290,
2752,
199,
2765,
859,
365,
2867,
2032,
12,
436,
1265,
1443,
3604,
652,
436,
15,
269,
2811,
199,
390,
1334,
314,
2011,
2895,
465,
2018,
6337,
12,
880,
1846,
465,
642,
4248,
1245,
199,
460,
6450,
787,
30403,
315,
3932,
3379,
1824,
14,
199,
199,
568,
4825,
6461,
7000,
2334,
17632,
6262,
7024,
2296,
1821,
10263,
2099,
2381,
8703,
12,
9168,
12,
199,
25748,
12,
9716,
12,
1549,
9110,
6736,
7043,
5738,
1634,
2334,
4815,
1634,
199,
24571,
22547,
12,
9704,
8036,
2334,
17632,
7509,
6262,
742,
9691,
1634,
2334,
9726,
1634,
9712,
199,
36,
1156,
2962,
14,
199,
199,
18061,
17632,
428,
7236,
23380,
28292,
8990,
51,
1821,
2990,
12,
6931,
12,
5400,
2845,
199,
13387,
1149,
2296,
12,
2334,
5292,
2990,
1634,
3169,
2401,
3092,
2381,
437,
199,
14848,
3106,
3104,
14,
221,
2334,
22547,
7049,
869,
28106,
6131,
540,
2281,
5258,
1261,
298,
1179,
2281,
2,
4207,
12,
199,
3649,
377,
5293,
2281,
4825,
593,
7847,
1277,
2594,
28752,
4118,
27362,
2296,
6837,
37,
4828,
2919,
742,
7140,
12,
199,
10640,
12,
7215,
6521,
654,
12,
5070,
40,
7140,
20967,
12,
1549,
10362,
1914,
23380,
12969,
14,
199,
624,
199,
199,
363,
452,
363,
275,
788,
13120,
297,
283,
1746,
297,
283,
10591,
297,
1779,
283,
24285,
297,
283,
15824,
297,
283,
3481,
1746,
297,
283,
973,
297,
1779,
283,
885,
15824,
297,
283,
25755,
297,
283,
2759,
297,
283,
15118,
297,
283,
11278,
297,
1779,
283,
2062,
6782,
297,
283,
1872,
13120,
297,
2560,
1023,
17501,
199,
199,
363,
1023,
363,
275,
283,
16,
14,
20,
14,
17,
7,
199,
199,
3,
1316,
4070,
24985,
3423,
367,
8552,
7163,
199,
363,
452,
4343,
2880,
2941,
362,
1746,
5866,
297,
283,
18275,
297,
283,
1623,
19346,
1105,
199,
199,
3,
4005,
675,
314,
2257,
1331,
1,
199,
646,
984,
199,
1274,
14,
515,
14,
3176,
334,
16,
12,
26069,
2330,
531,
199,
199,
504,
2882,
18,
14,
1099,
492,
23795,
199,
504,
2882,
18,
14,
2546,
492,
334,
272,
7640,
12,
6801,
1746,
12,
18795,
12,
3372,
12,
3372,
3917,
12,
272,
3372,
5524,
12,
1420,
6782,
199,
9,
199,
504,
2882,
18,
14,
5768,
492,
3523,
10591,
12,
20979,
199,
504,
2882,
18,
14,
3422,
492,
334,
272,
1379,
5455,
12,
849,
15824,
12,
1852,
6207,
12,
664,
1746,
5866,
12,
272,
2342,
19346,
199,
9,
199,
504,
2882,
18,
14,
973,
492,
1379,
9184,
12,
2446,
199,
504,
2882,
18,
14,
5933,
492,
4516,
13649,
12,
4516,
13120,
199,
199,
893,
26,
272,
687,
2882,
18,
14,
10458,
492,
334,
267,
3907,
2461,
12,
2274,
2889,
12,
2813,
2889,
12,
2813,
2461,
272,
776,
199,
2590,
3545,
26,
272,
327,
3599,
5880,
543,
10677,
626,
2793,
1133,
1172,
314,
4673,
859,
272,
986,
199,
2836,
26,
272,
636,
452,
4343,
2880,
2941,
3174,
2461,
297,
283,
2683,
2889,
297,
283,
2168,
2889,
297,
15324,
283,
2168,
2461,
1105,
199,
199,
3,
5906,
199,
63,
1872,
13120,
275,
4516,
13120,
199,
199,
363,
2796,
275,
715,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2647,
15,
1393,
15,
1548,
199,
199,
624,
199,
2796,
18,
199,
199,
2796,
18,
365,
282,
1771,
719,
402,
314,
892,
4534,
3483,
370,
314,
2882,
5343,
199,
4857,
315,
2018,
499,
14,
23,
14,
2779,
365,
12470,
370,
1255,
641,
2018,
499,
14,
20,
446,
499,
14,
22,
14,
199,
199,
1378,
675,
2882,
18,
3140,
402,
2882,
9329,
3350,
1124,
646,
2882,
1040,
543,
199,
1040,
646,
2882,
18,
4345,
421,
199,
7384,
334,
67,
9,
21300,
13,
17919,
17854,
432,
23177,
3890,
199,
7384,
334,
67,
9,
13004,
13,
6542,
2018,
2290,
2752,
199,
2765,
859,
365,
2867,
2032,
12,
436,
1265,
1443,
3604,
652,
436,
15,
269,
2811,
199,
390,
1334,
314,
2011,
2895,
465,
2018,
6337,
12,
880,
1846,
465,
642,
4248,
1245,
199,
460,
6450,
787,
30403,
315,
3932,
3379,
1824,
14,
199,
199,
568,
4825,
6461,
7000,
2334,
17632,
6262,
7024,
2296,
1821,
10263,
2099,
2381,
8703,
12,
9168,
12,
199,
25748,
12,
9716,
12,
1549,
9110,
6736,
7043,
5738,
1634,
2334,
4815,
1634,
199,
24571,
22547,
12,
9704,
8036,
2334,
17632,
7509,
6262,
742,
9691,
1634,
2334,
9726,
1634,
9712,
199,
36,
1156,
2962,
14,
199,
199,
18061,
17632,
428,
7236,
23380,
28292,
8990,
51,
1821,
2990,
12,
6931,
12,
5400,
2845,
199,
13387,
1149,
2296,
12,
2334,
5292,
2990,
1634,
3169,
2401,
3092,
2381,
437,
199,
14848,
3106,
3104,
14,
221,
2334,
22547,
7049,
869,
28106,
6131,
540,
2281,
5258,
1261,
298,
1179,
2281,
2,
4207,
12,
199,
3649,
377,
5293,
2281,
4825,
593,
7847,
1277,
2594,
28752,
4118,
27362,
2296,
6837,
37,
4828,
2919,
742,
7140,
12,
199,
10640,
12,
7215,
6521,
654,
12,
5070,
40,
7140,
20967,
12,
1549,
10362,
1914,
23380,
12969,
14,
199,
624,
199,
199,
363,
452,
363,
275,
788,
13120,
297,
283,
1746,
297,
283,
10591,
297,
1779,
283,
24285,
297,
283,
15824,
297,
283,
3481,
1746,
297,
283,
973,
297,
1779,
283,
885,
15824,
297,
283,
25755,
297,
283,
2759,
297,
283,
15118,
297,
283,
11278,
297,
1779,
283,
2062,
6782,
297,
283,
1872,
13120,
297,
2560,
1023,
17501,
199,
199,
363,
1023,
363,
275,
283,
16,
14,
20,
14,
17,
7,
199,
199,
3,
1316,
4070,
24985,
3423,
367,
8552,
7163,
199,
363,
452,
4343,
2880,
2941,
362,
1746,
5866,
297,
283,
18275,
297,
283,
1623,
19346,
1105,
199,
199,
3,
4005,
675,
314,
2257,
1331,
1,
199,
646,
984,
199,
1274,
14,
515,
14,
3176,
334,
16,
12,
26069,
2330,
531,
199,
199,
504,
2882,
18,
14,
1099,
492,
23795,
199,
504,
2882,
18,
14,
2546,
492,
334,
272,
7640,
12,
6801,
1746,
12,
18795,
12,
3372,
12,
3372,
3917,
12,
272,
3372,
5524,
12,
1420,
6782,
199,
9,
199,
504,
2882,
18,
14,
5768,
492,
3523,
10591,
12,
20979,
199,
504,
2882,
18,
14,
3422,
492,
334,
272,
1379,
5455,
12,
849,
15824,
12,
1852,
6207,
12,
664,
1746,
5866,
12,
272,
2342,
19346,
199,
9,
199,
504,
2882,
18,
14,
973,
492,
1379,
9184,
12,
2446,
199,
504,
2882,
18,
14,
5933,
492,
4516,
13649,
12,
4516,
13120,
199,
199,
893,
26,
272,
687,
2882,
18,
14,
10458,
492,
334,
267,
3907,
2461,
12,
2274,
2889,
12,
2813,
2889,
12,
2813,
2461,
272,
776,
199,
2590,
3545,
26,
272,
327,
3599,
5880,
543,
10677,
626,
2793,
1133,
1172,
314,
4673,
859,
272,
986,
199,
2836,
26,
272,
636,
452,
4343,
2880,
2941,
3174,
2461,
297,
283,
2683,
2889,
297,
283,
2168,
2889,
297,
15324,
283,
2168,
2461,
1105,
199,
199,
3,
5906,
199,
63,
1872,
13120,
275,
4516,
13120,
199,
199,
363,
2796,
275,
715,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
matteomattei/RemoteCommander
|
remotecommander.py
|
1
|
7055
|
#!/usr/bin/env python
"""
This program open a simple dialog that allows to issue a command to a remote server using SSH.
It needs a configuration file called remotecommander.ini with the following structure:
[GENERAL]
Host = 127.0.0.1
Port = 22
User = root
Password = xxxxx
Command = shutdown -h now
CommandName = SHUTDOWN
"""
import sys, time, socket, configparser, re
import paramiko
from PySide.QtGui import *
from PySide.QtCore import *
class MySignal(QObject):
sig = Signal(str)
""" This is a thread used to issue commands """
class CommandThread(QThread):
def __init__(self, parent = None, host='127.0.0.1', port=22, user='root', password='', command=''):
QThread.__init__(self, parent)
self.signal = MySignal()
self.host = host
self.port = port
self.user = user
self.password = password
self.command = command
def run(self):
try:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
#print('connecting to '+self.host+' '+self.user+' '+self.password)
ssh.connect(self.host, username=self.user, password=self.password)
#print('command '+self.command)
stdin, stdout, stderr = ssh.exec_command(self.command)
result = stdout.read()+stderr.read()
ssh.close()
result = result.strip().decode()
#print(result)
if len(result) > 0:
self.signal.sig.emit(result)
else:
self.signal.sig.emit('OK')
except:
self.signal.sig.emit('ERROR')
"""This is a thread used to monitor the server status"""
class PingThread(QThread):
def __init__(self, parent = None, host='127.0.0.1', port=22):
QThread.__init__(self, parent)
self.signal = MySignal()
self.host = host
self.port = port
self.thread_close = False
def run(self):
while True:
if self.thread_close == True:
return
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect((self.host, self.port))
self.signal.sig.emit('ONLINE')
except socket.error:
self.signal.sig.emit('OFFLINE')
sock.close()
time.sleep(1)
class MainWindow(QMainWindow):
def __init__(self, parent=None):
QMainWindow.__init__(self,parent)
self.Section = None
self.Host = None
self.Port = None
self.User = None
self.Password = None
self.Command = None
self.CommandName = None
self.pingthread = None
self.commandthread = None
self.isPressed = False
self.setWindowTitle('RemoteCommander')
self.centralwidget = QWidget(self)
self.servername = QLabel()
self.serverstatus = QLabel('OFFLINE')
self.cmdbutton = QPushButton('CMD',self)
self.vbox = QVBoxLayout()
self.vbox.addWidget(self.servername)
self.vbox.addWidget(self.serverstatus)
self.vbox.addWidget(self.cmdbutton)
self.setCentralWidget(self.centralwidget)
self.centralwidget.setLayout(self.vbox)
self.cmdbutton.clicked.connect(self.cmdoperation)
self.init()
self.center()
def center(self):
self.setFixedSize(250, 150)
self.servername.setAlignment(Qt.AlignCenter)
self.servername.setStyleSheet('font-weight: bold; font-size:22px;')
self.serverstatus.setAlignment(Qt.AlignCenter)
self.serverstatus.setStyleSheet('font-weight: bold; font-size:22px;')
self.cmdbutton.setStyleSheet('font-weight: bold; font-size:22px; padding: 10px 0;')
frameGm = self.frameGeometry()
screen = QApplication.desktop().screenNumber(QApplication.desktop().cursor().pos())
centerPoint = QApplication.desktop().screenGeometry(screen).center()
frameGm.moveCenter(centerPoint)
self.move(frameGm.topLeft())
""" Initialize the interface """
def init(self):
try:
config = configparser.ConfigParser()
config.read('remotecommander.ini')
self.Section = config.sections()[0]
self.Host = config[self.Section]['Host']
self.Port = config[self.Section]['Port']
self.User = config[self.Section]['User']
self.Password = config[self.Section]['Password']
self.Command = config[self.Section]['Command']
self.CommandName = config[self.Section]['CommandName']
except:
msgBox = QMessageBox()
msgBox.setText('The configuration file has not been properly loaded')
ret = msgBox.exec_()
sys.exit(1)
regex = re.compile("(^rm\s|.*\srm\s|.*;rm\s)")
if regex.match(self.Command)!=None:
msgBox = QMessageBox()
msgBox.setText('You are trying to issue a potential risky remote command: program aborted.')
ret = msgBox.exec_()
sys.exit(1)
self.cmdbutton.setText(self.CommandName)
self.servername.setText(self.Section)
self.pingthread = PingThread(self,host=self.Host,port=int(self.Port))
self.commandthread = CommandThread(self,host=self.Host,port=int(self.Port),user=self.User,password=self.Password,command=self.Command)
self.pingthread.signal.sig.connect(self.updatehoststatus)
self.commandthread.signal.sig.connect(self.cmdoperationcomplete)
self.cmdbutton.setEnabled(False)
self.pingthread.start()
def closeEvent(self,event):
self.pingthread.thread_close = True
self.pingthread.wait()
def updatehoststatus(self,data):
self.serverstatus.setText(data)
if data == 'ONLINE':
self.serverstatus.setStyleSheet('font-weight: bold; font-size:22px; color: green')
if self.isPressed == False:
self.cmdbutton.setEnabled(True)
elif data == 'OFFLINE':
self.serverstatus.setStyleSheet('font-weight: bold; font-size:22px; color: red')
self.cmdbutton.setEnabled(False)
def cmdoperation(self):
self.commandthread.start()
self.cmdbutton.setEnabled(False)
self.isPressed = True
def cmdoperationcomplete(self,data):
self.isPressed = False
self.cmdbutton.setEnabled(True)
msgBox = QMessageBox()
if data=='ERROR':
msgBox.setText('ERROR issuing command!!!')
elif data=='OK':
msgBox.setText('Command issued correctly!')
else:
msgBox.setText(data)
ret = msgBox.exec_()
if __name__=='__main__':
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec_())
|
mit
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
2999,
199,
624,
202,
199,
2765,
2240,
1551,
282,
3486,
9592,
626,
6127,
370,
4976,
282,
1414,
370,
282,
3982,
1654,
1808,
12027,
14,
202,
199,
7940,
4839,
282,
2897,
570,
2797,
3982,
1404,
11438,
14,
2730,
543,
314,
2569,
5523,
26,
2999,
199,
59,
31548,
61,
202,
199,
4965,
275,
12792,
14,
16,
14,
16,
14,
17,
202,
199,
4313,
275,
6928,
202,
199,
1899,
275,
1738,
202,
199,
6139,
275,
671,
5336,
202,
199,
3110,
275,
12842,
446,
72,
3063,
202,
199,
3110,
985,
275,
4410,
934,
8819,
202,
199,
624,
2999,
199,
646,
984,
12,
900,
12,
2838,
12,
21230,
12,
295,
202,
199,
646,
26162,
202,
199,
504,
1611,
15414,
14,
10604,
492,
627,
202,
199,
504,
1611,
15414,
14,
10901,
492,
627,
8065,
199,
533,
4932,
11274,
8,
32260,
304,
1128,
5259,
275,
18288,
8,
495,
9,
8065,
199,
624,
961,
365,
282,
2462,
1202,
370,
4976,
3718,
408,
202,
199,
533,
5817,
4436,
8,
49,
4436,
304,
1128,
347,
636,
826,
721,
277,
12,
1676,
275,
488,
12,
1591,
534,
4195,
14,
16,
14,
16,
14,
17,
297,
1844,
29,
1081,
12,
922,
534,
1231,
297,
2505,
4581,
1414,
9280,
1039,
1413,
4436,
855,
826,
721,
277,
12,
1676,
9,
1039,
291,
14,
4653,
275,
4932,
11274,
342,
1039,
291,
14,
1102,
275,
1591,
1039,
291,
14,
719,
275,
1844,
1039,
291,
14,
751,
275,
922,
1039,
291,
14,
2060,
275,
2505,
1039,
291,
14,
1531,
275,
1414,
2958,
347,
1255,
8,
277,
304,
1039,
862,
26,
1675,
8635,
275,
26162,
14,
13716,
3041,
342,
1675,
8635,
14,
409,
63,
4752,
63,
1102,
63,
498,
63,
3185,
8,
635,
16625,
14,
3358,
1123,
4845,
1012,
1675,
327,
1361,
360,
2242,
316,
370,
6681,
277,
14,
1102,
4786,
6681,
277,
14,
751,
4786,
6681,
277,
14,
2060,
9,
1675,
8635,
14,
2242,
8,
277,
14,
1102,
12,
3434,
29,
277,
14,
751,
12,
2505,
29,
277,
14,
2060,
9,
1675,
327,
1361,
360,
1531,
6681,
277,
14,
1531,
9,
1675,
9009,
12,
3839,
12,
4635,
275,
8635,
14,
1628,
63,
1531,
8,
277,
14,
1531,
9,
1675,
754,
275,
3839,
14,
739,
24543,
3083,
14,
739,
342,
1675,
8635,
14,
1600,
342,
1675,
754,
275,
754,
14,
1913,
1252,
2708,
342,
1675,
327,
1361,
8,
1099,
9,
1675,
340,
822,
8,
1099,
9,
690,
378,
26,
2628,
291,
14,
4653,
14,
4093,
14,
8159,
8,
1099,
9,
1675,
587,
26,
2628,
291,
14,
4653,
14,
4093,
14,
8159,
360,
3593,
358,
1039,
871,
26,
1675,
291,
14,
4653,
14,
4093,
14,
8159,
360,
3170,
358,
8065,
199,
624,
2765,
365,
282,
2462,
1202,
370,
8372,
314,
1654,
2004,
624,
202,
199,
533,
510,
316,
4436,
8,
49,
4436,
304,
1128,
347,
636,
826,
721,
277,
12,
1676,
275,
488,
12,
1591,
534,
4195,
14,
16,
14,
16,
14,
17,
297,
1844,
29,
1081,
304,
1039,
1413,
4436,
855,
826,
721,
277,
12,
1676,
9,
1039,
291,
14,
4653,
275,
4932,
11274,
342,
1039,
291,
14,
1102,
275,
1591,
1039,
291,
14,
719,
275,
1844,
1039,
291,
14,
2671,
63,
1600,
275,
756,
2958,
347,
1255,
8,
277,
304,
1039,
1830,
715,
26,
1675,
340,
291,
14,
2671,
63,
1600,
508,
715,
26,
2628,
372,
1675,
6771,
275,
2838,
14,
3450,
8,
3450,
14,
5699,
63,
11367,
12,
2838,
14,
9469,
63,
9484,
9,
1675,
862,
26,
2628,
6771,
14,
2242,
1332,
277,
14,
1102,
12,
291,
14,
719,
430,
2628,
291,
14,
4653,
14,
4093,
14,
8159,
360,
615,
6174,
358,
1675,
871,
2838,
14,
705,
26,
2628,
291,
14,
4653,
14,
4093,
14,
8159,
360,
7517,
6174,
358,
1675,
6771,
14,
1600,
342,
1675,
900,
14,
4532,
8,
17,
9,
25052,
202,
199,
533,
11298,
4301,
8,
49,
16031,
304,
1128,
347,
636,
826,
721,
277,
12,
1676,
29,
403,
304,
1039,
1413,
16031,
855,
826,
721,
277,
12,
1708,
9,
1039,
291,
14,
8660,
275,
488,
1039,
291,
14,
4965,
275,
488,
1039,
291,
14,
4313,
275,
488,
1039,
291,
14,
1899,
275,
488,
1039,
291,
14,
6139,
275,
488,
1039,
291,
14,
3110,
275,
488,
1039,
291,
14,
3110,
985,
275,
488,
1039,
291,
14,
4073,
2671,
275,
488,
1039,
291,
14,
1531,
2671,
275,
488,
1039,
291,
14,
374,
32153,
275,
756,
4341,
291,
14,
30601,
360,
6713,
5150,
11438,
358,
1039,
291,
14,
16067,
3440,
275,
1413,
3339,
8,
277,
9,
1039,
291,
14,
1000,
354,
275,
1413,
4314,
342,
1039,
291,
14,
1000,
1205,
275,
1413,
4314,
360,
7517,
6174,
358,
1039,
291,
14,
4400,
697,
2471,
275,
1413,
20083,
360,
9744,
297,
277,
9,
1039,
291,
14,
19508,
275,
1413,
54,
18536,
342,
1039,
291,
14,
19508,
14,
9475,
8,
277,
14,
1000,
354,
9,
1039,
291,
14,
19508,
14,
9475,
8,
277,
14,
1000,
1205,
9,
1039,
291,
14,
19508,
14,
9475,
8,
277,
14,
4400,
697,
2471,
9,
1039,
291,
14,
409,
25290,
3339,
8,
277,
14,
16067,
3440,
9,
1039,
291,
14,
16067,
3440,
14,
409,
4798,
8,
277,
14,
19508,
9,
4341,
291,
14,
4400,
697,
2471,
14,
11276,
14,
2242,
8,
277,
14,
1760,
5735,
9,
1039,
291,
14,
826,
342,
1039,
291,
14,
4218,
342,
2958,
347,
8126,
8,
277,
304,
1039,
291,
14,
409,
9515,
2320,
8,
7991,
12,
14711,
9,
1039,
291,
14,
1000,
354,
14,
409,
16613,
8,
4238,
14,
9497,
13551,
9,
1039,
291,
14,
1000,
354,
14,
31091,
16715,
360,
4246,
13,
3463,
26,
17268,
27,
5023,
13,
890,
26,
1081,
5326,
10784,
1039,
291,
14,
1000,
1205,
14,
409,
16613,
8,
4238,
14,
9497,
13551,
9,
1039,
291,
14,
1000,
1205,
14,
31091,
16715,
360,
4246,
13,
3463,
26,
17268,
27,
5023,
13,
890,
26,
1081,
5326,
10784,
1039,
291,
14,
4400,
697,
2471,
14,
31091,
16715,
360,
4246,
13,
3463,
26,
17268,
27,
5023,
13,
890,
26,
1081,
5326,
27,
6273,
26,
1616,
5326,
378,
10784,
1039,
2787,
39,
77,
275,
291,
14,
1943,
6831,
342,
1039,
6426,
275,
29469,
14,
14487,
1252,
5410,
3259,
8,
12757,
14,
14487,
1252,
3937,
1252,
1712,
1012,
1039,
8126,
3428,
275,
29469,
14,
14487,
1252
] |
[
2647,
15,
1393,
15,
1813,
2366,
2999,
199,
624,
202,
199,
2765,
2240,
1551,
282,
3486,
9592,
626,
6127,
370,
4976,
282,
1414,
370,
282,
3982,
1654,
1808,
12027,
14,
202,
199,
7940,
4839,
282,
2897,
570,
2797,
3982,
1404,
11438,
14,
2730,
543,
314,
2569,
5523,
26,
2999,
199,
59,
31548,
61,
202,
199,
4965,
275,
12792,
14,
16,
14,
16,
14,
17,
202,
199,
4313,
275,
6928,
202,
199,
1899,
275,
1738,
202,
199,
6139,
275,
671,
5336,
202,
199,
3110,
275,
12842,
446,
72,
3063,
202,
199,
3110,
985,
275,
4410,
934,
8819,
202,
199,
624,
2999,
199,
646,
984,
12,
900,
12,
2838,
12,
21230,
12,
295,
202,
199,
646,
26162,
202,
199,
504,
1611,
15414,
14,
10604,
492,
627,
202,
199,
504,
1611,
15414,
14,
10901,
492,
627,
8065,
199,
533,
4932,
11274,
8,
32260,
304,
1128,
5259,
275,
18288,
8,
495,
9,
8065,
199,
624,
961,
365,
282,
2462,
1202,
370,
4976,
3718,
408,
202,
199,
533,
5817,
4436,
8,
49,
4436,
304,
1128,
347,
636,
826,
721,
277,
12,
1676,
275,
488,
12,
1591,
534,
4195,
14,
16,
14,
16,
14,
17,
297,
1844,
29,
1081,
12,
922,
534,
1231,
297,
2505,
4581,
1414,
9280,
1039,
1413,
4436,
855,
826,
721,
277,
12,
1676,
9,
1039,
291,
14,
4653,
275,
4932,
11274,
342,
1039,
291,
14,
1102,
275,
1591,
1039,
291,
14,
719,
275,
1844,
1039,
291,
14,
751,
275,
922,
1039,
291,
14,
2060,
275,
2505,
1039,
291,
14,
1531,
275,
1414,
2958,
347,
1255,
8,
277,
304,
1039,
862,
26,
1675,
8635,
275,
26162,
14,
13716,
3041,
342,
1675,
8635,
14,
409,
63,
4752,
63,
1102,
63,
498,
63,
3185,
8,
635,
16625,
14,
3358,
1123,
4845,
1012,
1675,
327,
1361,
360,
2242,
316,
370,
6681,
277,
14,
1102,
4786,
6681,
277,
14,
751,
4786,
6681,
277,
14,
2060,
9,
1675,
8635,
14,
2242,
8,
277,
14,
1102,
12,
3434,
29,
277,
14,
751,
12,
2505,
29,
277,
14,
2060,
9,
1675,
327,
1361,
360,
1531,
6681,
277,
14,
1531,
9,
1675,
9009,
12,
3839,
12,
4635,
275,
8635,
14,
1628,
63,
1531,
8,
277,
14,
1531,
9,
1675,
754,
275,
3839,
14,
739,
24543,
3083,
14,
739,
342,
1675,
8635,
14,
1600,
342,
1675,
754,
275,
754,
14,
1913,
1252,
2708,
342,
1675,
327,
1361,
8,
1099,
9,
1675,
340,
822,
8,
1099,
9,
690,
378,
26,
2628,
291,
14,
4653,
14,
4093,
14,
8159,
8,
1099,
9,
1675,
587,
26,
2628,
291,
14,
4653,
14,
4093,
14,
8159,
360,
3593,
358,
1039,
871,
26,
1675,
291,
14,
4653,
14,
4093,
14,
8159,
360,
3170,
358,
8065,
199,
624,
2765,
365,
282,
2462,
1202,
370,
8372,
314,
1654,
2004,
624,
202,
199,
533,
510,
316,
4436,
8,
49,
4436,
304,
1128,
347,
636,
826,
721,
277,
12,
1676,
275,
488,
12,
1591,
534,
4195,
14,
16,
14,
16,
14,
17,
297,
1844,
29,
1081,
304,
1039,
1413,
4436,
855,
826,
721,
277,
12,
1676,
9,
1039,
291,
14,
4653,
275,
4932,
11274,
342,
1039,
291,
14,
1102,
275,
1591,
1039,
291,
14,
719,
275,
1844,
1039,
291,
14,
2671,
63,
1600,
275,
756,
2958,
347,
1255,
8,
277,
304,
1039,
1830,
715,
26,
1675,
340,
291,
14,
2671,
63,
1600,
508,
715,
26,
2628,
372,
1675,
6771,
275,
2838,
14,
3450,
8,
3450,
14,
5699,
63,
11367,
12,
2838,
14,
9469,
63,
9484,
9,
1675,
862,
26,
2628,
6771,
14,
2242,
1332,
277,
14,
1102,
12,
291,
14,
719,
430,
2628,
291,
14,
4653,
14,
4093,
14,
8159,
360,
615,
6174,
358,
1675,
871,
2838,
14,
705,
26,
2628,
291,
14,
4653,
14,
4093,
14,
8159,
360,
7517,
6174,
358,
1675,
6771,
14,
1600,
342,
1675,
900,
14,
4532,
8,
17,
9,
25052,
202,
199,
533,
11298,
4301,
8,
49,
16031,
304,
1128,
347,
636,
826,
721,
277,
12,
1676,
29,
403,
304,
1039,
1413,
16031,
855,
826,
721,
277,
12,
1708,
9,
1039,
291,
14,
8660,
275,
488,
1039,
291,
14,
4965,
275,
488,
1039,
291,
14,
4313,
275,
488,
1039,
291,
14,
1899,
275,
488,
1039,
291,
14,
6139,
275,
488,
1039,
291,
14,
3110,
275,
488,
1039,
291,
14,
3110,
985,
275,
488,
1039,
291,
14,
4073,
2671,
275,
488,
1039,
291,
14,
1531,
2671,
275,
488,
1039,
291,
14,
374,
32153,
275,
756,
4341,
291,
14,
30601,
360,
6713,
5150,
11438,
358,
1039,
291,
14,
16067,
3440,
275,
1413,
3339,
8,
277,
9,
1039,
291,
14,
1000,
354,
275,
1413,
4314,
342,
1039,
291,
14,
1000,
1205,
275,
1413,
4314,
360,
7517,
6174,
358,
1039,
291,
14,
4400,
697,
2471,
275,
1413,
20083,
360,
9744,
297,
277,
9,
1039,
291,
14,
19508,
275,
1413,
54,
18536,
342,
1039,
291,
14,
19508,
14,
9475,
8,
277,
14,
1000,
354,
9,
1039,
291,
14,
19508,
14,
9475,
8,
277,
14,
1000,
1205,
9,
1039,
291,
14,
19508,
14,
9475,
8,
277,
14,
4400,
697,
2471,
9,
1039,
291,
14,
409,
25290,
3339,
8,
277,
14,
16067,
3440,
9,
1039,
291,
14,
16067,
3440,
14,
409,
4798,
8,
277,
14,
19508,
9,
4341,
291,
14,
4400,
697,
2471,
14,
11276,
14,
2242,
8,
277,
14,
1760,
5735,
9,
1039,
291,
14,
826,
342,
1039,
291,
14,
4218,
342,
2958,
347,
8126,
8,
277,
304,
1039,
291,
14,
409,
9515,
2320,
8,
7991,
12,
14711,
9,
1039,
291,
14,
1000,
354,
14,
409,
16613,
8,
4238,
14,
9497,
13551,
9,
1039,
291,
14,
1000,
354,
14,
31091,
16715,
360,
4246,
13,
3463,
26,
17268,
27,
5023,
13,
890,
26,
1081,
5326,
10784,
1039,
291,
14,
1000,
1205,
14,
409,
16613,
8,
4238,
14,
9497,
13551,
9,
1039,
291,
14,
1000,
1205,
14,
31091,
16715,
360,
4246,
13,
3463,
26,
17268,
27,
5023,
13,
890,
26,
1081,
5326,
10784,
1039,
291,
14,
4400,
697,
2471,
14,
31091,
16715,
360,
4246,
13,
3463,
26,
17268,
27,
5023,
13,
890,
26,
1081,
5326,
27,
6273,
26,
1616,
5326,
378,
10784,
1039,
2787,
39,
77,
275,
291,
14,
1943,
6831,
342,
1039,
6426,
275,
29469,
14,
14487,
1252,
5410,
3259,
8,
12757,
14,
14487,
1252,
3937,
1252,
1712,
1012,
1039,
8126,
3428,
275,
29469,
14,
14487,
1252,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
kalxas/QGIS
|
tests/src/python/test_qgsdatabaseschemamodel.py
|
32
|
10288
|
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsDatabaseSchemaModel
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__author__ = 'Nyall Dawson'
__date__ = '07/03/2020'
__copyright__ = 'Copyright 2020, The QGIS Project'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
from qgis.core import (
QgsDatabaseSchemaModel,
QgsProviderRegistry,
)
from qgis.PyQt.QtCore import (
QCoreApplication,
QModelIndex,
Qt
)
from qgis.testing import unittest, start_app
class TestPyQgsDatabaseSchemaModel(unittest.TestCase):
# Provider test cases must define the string URI for the test
uri = ''
# Provider test cases must define the provider name (e.g. "postgres" or "ogr")
providerKey = 'postgres'
@classmethod
def setUpClass(cls):
"""Run before all tests"""
QCoreApplication.setOrganizationName("QGIS_Test")
QCoreApplication.setOrganizationDomain(cls.__name__)
QCoreApplication.setApplicationName(cls.__name__)
start_app()
cls.postgres_conn = "service='qgis_test'"
if 'QGIS_PGTEST_DB' in os.environ:
cls.postgres_conn = os.environ['QGIS_PGTEST_DB']
cls.uri = cls.postgres_conn + ' sslmode=disable'
def testModel(self):
conn = QgsProviderRegistry.instance().providerMetadata('postgres').createConnection(self.uri, {})
self.assertTrue(conn)
model = QgsDatabaseSchemaModel(conn)
self.assertGreaterEqual(model.rowCount(), 3)
old_count = model.rowCount()
self.assertEqual(model.columnCount(), 1)
schemas = [model.data(model.index(r, 0, QModelIndex()), Qt.DisplayRole) for r in range(model.rowCount())]
self.assertIn('public', schemas)
self.assertIn('CamelCaseSchema', schemas)
self.assertIn('qgis_test', schemas)
self.assertEqual(model.data(model.index(schemas.index('qgis_test'), 0, QModelIndex()), Qt.ToolTipRole), 'qgis_test')
self.assertIsNone(model.data(model.index(model.rowCount(), 0, QModelIndex()), Qt.DisplayRole))
model.refresh()
self.assertEqual(model.rowCount(), old_count)
conn.createSchema('myNewSchema')
self.assertEqual(model.rowCount(), old_count)
model.refresh()
self.assertEqual(model.rowCount(), old_count + 1)
schemas = [model.data(model.index(r, 0, QModelIndex()), Qt.DisplayRole) for r in range(model.rowCount())]
self.assertIn('public', schemas)
self.assertIn('CamelCaseSchema', schemas)
self.assertIn('qgis_test', schemas)
self.assertIn('myNewSchema', schemas)
conn.createSchema('myNewSchema2')
conn.createSchema('myNewSchema3')
model.refresh()
self.assertEqual(model.rowCount(), old_count + 3)
schemas = [model.data(model.index(r, 0, QModelIndex()), Qt.DisplayRole) for r in range(model.rowCount())]
self.assertIn('public', schemas)
self.assertIn('CamelCaseSchema', schemas)
self.assertIn('qgis_test', schemas)
self.assertIn('myNewSchema', schemas)
self.assertIn('myNewSchema2', schemas)
self.assertIn('myNewSchema3', schemas)
conn.createSchema('myNewSchema4')
conn.dropSchema('myNewSchema2')
conn.dropSchema('myNewSchema')
model.refresh()
self.assertEqual(model.rowCount(), old_count + 2)
schemas = [model.data(model.index(r, 0, QModelIndex()), Qt.DisplayRole) for r in range(model.rowCount())]
self.assertIn('public', schemas)
self.assertIn('CamelCaseSchema', schemas)
self.assertIn('qgis_test', schemas)
self.assertNotIn('myNewSchema', schemas)
self.assertNotIn('myNewSchema2', schemas)
self.assertIn('myNewSchema3', schemas)
self.assertIn('myNewSchema4', schemas)
conn.dropSchema('myNewSchema3')
conn.dropSchema('myNewSchema4')
model.refresh()
self.assertEqual(model.rowCount(), old_count)
schemas = [model.data(model.index(r, 0, QModelIndex()), Qt.DisplayRole) for r in range(model.rowCount())]
self.assertIn('public', schemas)
self.assertIn('CamelCaseSchema', schemas)
self.assertIn('qgis_test', schemas)
self.assertNotIn('myNewSchema3', schemas)
self.assertNotIn('myNewSchema4', schemas)
def test_model_allow_empty(self):
"""Test model with empty entry"""
conn = QgsProviderRegistry.instance().providerMetadata('postgres').createConnection(self.uri, {})
self.assertTrue(conn)
model = QgsDatabaseSchemaModel(conn)
self.assertGreaterEqual(model.rowCount(), 3)
old_count = model.rowCount()
model.setAllowEmptySchema(True)
self.assertEqual(model.rowCount(), old_count + 1)
schemas = [model.data(model.index(r, 0, QModelIndex()), Qt.DisplayRole) for r in range(model.rowCount())]
self.assertIn('public', schemas)
self.assertIn('CamelCaseSchema', schemas)
self.assertIn('qgis_test', schemas)
self.assertFalse(model.data(model.index(0, 0, QModelIndex()), Qt.DisplayRole))
self.assertTrue(model.data(model.index(0, 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
self.assertFalse(model.data(model.index(schemas.index('qgis_test'), 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
self.assertIsNone(model.data(model.index(model.rowCount(), 0, QModelIndex()), Qt.DisplayRole))
model.refresh()
self.assertEqual(model.rowCount(), old_count + 1)
conn.createSchema('myNewSchema')
self.assertEqual(model.rowCount(), old_count + 1)
model.refresh()
self.assertEqual(model.rowCount(), old_count + 2)
schemas = [model.data(model.index(r, 0, QModelIndex()), Qt.DisplayRole) for r in range(model.rowCount())]
self.assertIn('public', schemas)
self.assertIn('CamelCaseSchema', schemas)
self.assertIn('qgis_test', schemas)
self.assertIn('myNewSchema', schemas)
self.assertFalse(model.data(model.index(0, 0, QModelIndex()), Qt.DisplayRole))
self.assertTrue(model.data(model.index(0, 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
self.assertFalse(model.data(model.index(schemas.index('qgis_test'), 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
model.setAllowEmptySchema(False)
self.assertEqual(model.rowCount(), old_count + 1)
self.assertTrue(model.data(model.index(0, 0, QModelIndex()), Qt.DisplayRole))
self.assertFalse(model.data(model.index(0, 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
model.setAllowEmptySchema(True)
self.assertEqual(model.rowCount(), old_count + 2)
self.assertFalse(model.data(model.index(0, 0, QModelIndex()), Qt.DisplayRole))
self.assertTrue(model.data(model.index(0, 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
self.assertFalse(model.data(model.index(schemas.index('qgis_test'), 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
conn.createSchema('myNewSchema2')
conn.createSchema('myNewSchema3')
model.refresh()
self.assertEqual(model.rowCount(), old_count + 4)
schemas = [model.data(model.index(r, 0, QModelIndex()), Qt.DisplayRole) for r in range(model.rowCount())]
self.assertIn('public', schemas)
self.assertIn('CamelCaseSchema', schemas)
self.assertIn('qgis_test', schemas)
self.assertIn('myNewSchema', schemas)
self.assertIn('myNewSchema2', schemas)
self.assertIn('myNewSchema3', schemas)
self.assertFalse(model.data(model.index(0, 0, QModelIndex()), Qt.DisplayRole))
self.assertTrue(model.data(model.index(0, 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
self.assertFalse(model.data(model.index(schemas.index('qgis_test'), 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
conn.createSchema('myNewSchema4')
conn.dropSchema('myNewSchema2')
conn.dropSchema('myNewSchema')
model.refresh()
self.assertEqual(model.rowCount(), old_count + 3)
schemas = [model.data(model.index(r, 0, QModelIndex()), Qt.DisplayRole) for r in range(model.rowCount())]
self.assertIn('public', schemas)
self.assertIn('CamelCaseSchema', schemas)
self.assertIn('qgis_test', schemas)
self.assertNotIn('myNewSchema', schemas)
self.assertNotIn('myNewSchema2', schemas)
self.assertIn('myNewSchema3', schemas)
self.assertIn('myNewSchema4', schemas)
self.assertFalse(model.data(model.index(0, 0, QModelIndex()), Qt.DisplayRole))
self.assertTrue(model.data(model.index(0, 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
self.assertFalse(model.data(model.index(schemas.index('qgis_test'), 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
conn.dropSchema('myNewSchema3')
conn.dropSchema('myNewSchema4')
model.refresh()
self.assertEqual(model.rowCount(), old_count + 1)
schemas = [model.data(model.index(r, 0, QModelIndex()), Qt.DisplayRole) for r in range(model.rowCount())]
self.assertIn('public', schemas)
self.assertIn('CamelCaseSchema', schemas)
self.assertIn('qgis_test', schemas)
self.assertNotIn('myNewSchema3', schemas)
self.assertNotIn('myNewSchema4', schemas)
self.assertFalse(model.data(model.index(0, 0, QModelIndex()), Qt.DisplayRole))
self.assertTrue(model.data(model.index(0, 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
self.assertFalse(model.data(model.index(schemas.index('qgis_test'), 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
model.setAllowEmptySchema(False)
self.assertEqual(model.rowCount(), old_count)
self.assertTrue(model.data(model.index(0, 0, QModelIndex()), Qt.DisplayRole))
self.assertFalse(model.data(model.index(0, 0, QModelIndex()), QgsDatabaseSchemaModel.RoleEmpty))
if __name__ == '__main__':
unittest.main()
|
gpl-2.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
624,
31329,
12008,
2295,
367,
4888,
7243,
6700,
1685,
199,
199,
703,
5317,
447,
961,
2240,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
390,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
1589,
2868,
2290,
2752,
27,
1902,
1015,
499,
402,
314,
844,
12,
503,
199,
8,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
199,
624,
199,
363,
2502,
363,
275,
283,
22781,
452,
577,
10084,
834,
7,
199,
363,
602,
363,
275,
283,
1780,
15,
1644,
15,
13934,
7,
199,
363,
7307,
363,
275,
283,
7384,
25455,
12,
710,
27024,
7290,
7,
199,
3,
961,
911,
664,
8717,
543,
282,
6135,
12002,
17,
1380,
1265,
886,
282,
6135,
6359,
199,
363,
5792,
363,
275,
4505,
3484,
2689,
40,
12913,
199,
199,
646,
747,
199,
504,
15640,
14,
1018,
492,
334,
272,
4888,
7243,
6700,
1685,
12,
272,
4888,
6663,
10899,
12,
199,
9,
199,
504,
15640,
14,
24107,
14,
10901,
492,
334,
272,
1413,
29263,
12,
272,
1413,
1685,
2681,
12,
272,
3959,
199,
9,
199,
504,
15640,
14,
4776,
492,
2882,
12,
1343,
63,
571,
421,
199,
533,
1379,
2713,
7350,
7243,
6700,
1685,
8,
2796,
14,
1746,
304,
339,
327,
18489,
511,
5560,
1471,
5627,
314,
1059,
9022,
367,
314,
511,
272,
5108,
275,
2125,
272,
327,
18489,
511,
5560,
1471,
5627,
314,
5022,
536,
334,
69,
14,
71,
14,
298,
10675,
2,
503,
298,
14945,
531,
272,
5022,
1197,
275,
283,
10675,
7,
339,
768,
3744,
272,
347,
18561,
8,
1886,
304,
267,
408,
2540,
2544,
1006,
2295,
624,
398,
1413,
29263,
14,
409,
15928,
985,
480,
31329,
63,
774,
531,
267,
1413,
29263,
14,
409,
15928,
7705,
8,
1886,
855,
354,
3368,
267,
1413,
29263,
14,
409,
5039,
985,
8,
1886,
855,
354,
3368,
267,
1343,
63,
571,
342,
267,
843,
14,
10675,
63,
1631,
275,
298,
1364,
534,
25325,
63,
396,
4065,
267,
340,
283,
31329,
63,
11115,
2864,
63,
2846,
7,
315,
747,
14,
2314,
26,
288,
843,
14,
10675,
63,
1631,
275,
747,
14,
2314,
459,
31329,
63,
11115,
2864,
63,
2846,
418,
267,
843,
14,
2302,
275,
843,
14,
10675,
63,
1631,
435,
283,
6149,
632,
29,
5993,
7,
339,
347,
511,
1685,
8,
277,
304,
267,
2557,
275,
4888,
6663,
10899,
14,
842,
1252,
3780,
5142,
360,
10675,
1959,
981,
3225,
8,
277,
14,
2302,
12,
5009,
267,
291,
14,
1815,
8,
1631,
9,
267,
1402,
275,
4888,
7243,
6700,
1685,
8,
1631,
9,
267,
291,
14,
26875,
8,
1238,
14,
1143,
2353,
1062,
650,
9,
267,
2269,
63,
835,
275,
1402,
14,
1143,
2353,
342,
267,
291,
14,
629,
8,
1238,
14,
2301,
2353,
1062,
413,
9,
267,
32536,
275,
359,
1238,
14,
576,
8,
1238,
14,
1080,
8,
82,
12,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
7687,
7422,
9,
367,
519,
315,
1425,
8,
1238,
14,
1143,
2353,
24821,
267,
291,
14,
4080,
360,
3455,
297,
32536,
9,
267,
291,
14,
4080,
360,
35,
14868,
1538,
6700,
297,
32536,
9,
267,
291,
14,
4080,
360,
25325,
63,
396,
297,
32536,
9,
267,
291,
14,
629,
8,
1238,
14,
576,
8,
1238,
14,
1080,
8,
9482,
14,
1080,
360,
25325,
63,
396,
659,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
21784,
7422,
395,
283,
25325,
63,
396,
358,
267,
291,
14,
7702,
8,
1238,
14,
576,
8,
1238,
14,
1080,
8,
1238,
14,
1143,
2353,
1062,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
7687,
7422,
430,
398,
1402,
14,
6635,
342,
267,
291,
14,
629,
8,
1238,
14,
1143,
2353,
1062,
2269,
63,
835,
9,
398,
2557,
14,
981,
6700,
360,
1662,
4665,
6700,
358,
267,
291,
14,
629,
8,
1238,
14,
1143,
2353,
1062,
2269,
63,
835,
9,
267,
1402,
14,
6635,
342,
267,
291,
14,
629,
8,
1238,
14,
1143,
2353,
1062,
2269,
63,
835,
435,
413,
9,
267,
32536,
275,
359,
1238,
14,
576,
8,
1238,
14,
1080,
8,
82,
12,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
7687,
7422,
9,
367,
519,
315,
1425,
8,
1238,
14,
1143,
2353,
24821,
267,
291,
14,
4080,
360,
3455,
297,
32536,
9,
267,
291,
14,
4080,
360,
35,
14868,
1538,
6700,
297,
32536,
9,
267,
291,
14,
4080,
360,
25325,
63,
396,
297,
32536,
9,
267,
291,
14,
4080,
360,
1662,
4665,
6700,
297,
32536,
9,
398,
2557,
14,
981,
6700,
360,
1662,
4665,
6700,
18,
358,
267,
2557,
14,
981,
6700,
360,
1662,
4665,
6700,
19,
358,
267,
1402,
14,
6635,
342,
267,
291,
14,
629,
8,
1238,
14,
1143,
2353,
1062,
2269,
63,
835,
435,
650,
9,
267,
32536,
275,
359,
1238,
14,
576,
8,
1238,
14,
1080,
8,
82,
12,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
7687,
7422,
9,
367,
519,
315,
1425,
8,
1238,
14,
1143,
2353,
24821,
267,
291,
14,
4080,
360,
3455,
297,
32536,
9,
267,
291,
14,
4080,
360,
35,
14868,
1538,
6700,
297,
32536,
9,
267,
291,
14,
4080,
360,
25325,
63,
396,
297,
32536,
9,
267,
291,
14,
4080,
360,
1662,
4665,
6700,
297,
32536,
9,
267,
291,
14,
4080,
360,
1662,
4665,
6700,
18,
297,
32536,
9,
267,
291,
14,
4080,
360,
1662,
4665,
6700,
19,
297,
32536,
9,
398,
2557,
14,
981,
6700,
360,
1662,
4665,
6700,
20,
358,
267,
2557,
14,
4824,
6700,
360,
1662,
4665,
6700,
18,
358,
267,
2557,
14,
4824,
6700,
360,
1662,
4665,
6700,
358,
267,
1402,
14,
6635,
342,
267,
291,
14,
629,
8,
1238,
14,
1143,
2353,
1062,
2269,
63,
835,
435,
499,
9,
267,
32536,
275,
359,
1238,
14,
576,
8,
1238,
14,
1080,
8,
82,
12,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
7687,
7422,
9,
367,
519,
315,
1425,
8,
1238,
14,
1143,
2353,
24821,
267,
291,
14,
4080,
360,
3455,
297,
32536,
9,
267,
291,
14,
4080,
360,
35,
14868,
1538,
6700,
297,
32536,
9,
267,
291,
14,
4080,
360,
25325,
63,
396,
297,
32536,
9,
267,
291,
14,
8795,
360,
1662,
4665,
6700,
297,
32536,
9,
267,
291,
14,
8795,
360,
1662,
4665,
6700,
18,
297,
32536,
9,
267
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
624,
31329,
12008,
2295,
367,
4888,
7243,
6700,
1685,
199,
199,
703,
5317,
447,
961,
2240,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
390,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
1589,
2868,
2290,
2752,
27,
1902,
1015,
499,
402,
314,
844,
12,
503,
199,
8,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
199,
624,
199,
363,
2502,
363,
275,
283,
22781,
452,
577,
10084,
834,
7,
199,
363,
602,
363,
275,
283,
1780,
15,
1644,
15,
13934,
7,
199,
363,
7307,
363,
275,
283,
7384,
25455,
12,
710,
27024,
7290,
7,
199,
3,
961,
911,
664,
8717,
543,
282,
6135,
12002,
17,
1380,
1265,
886,
282,
6135,
6359,
199,
363,
5792,
363,
275,
4505,
3484,
2689,
40,
12913,
199,
199,
646,
747,
199,
504,
15640,
14,
1018,
492,
334,
272,
4888,
7243,
6700,
1685,
12,
272,
4888,
6663,
10899,
12,
199,
9,
199,
504,
15640,
14,
24107,
14,
10901,
492,
334,
272,
1413,
29263,
12,
272,
1413,
1685,
2681,
12,
272,
3959,
199,
9,
199,
504,
15640,
14,
4776,
492,
2882,
12,
1343,
63,
571,
421,
199,
533,
1379,
2713,
7350,
7243,
6700,
1685,
8,
2796,
14,
1746,
304,
339,
327,
18489,
511,
5560,
1471,
5627,
314,
1059,
9022,
367,
314,
511,
272,
5108,
275,
2125,
272,
327,
18489,
511,
5560,
1471,
5627,
314,
5022,
536,
334,
69,
14,
71,
14,
298,
10675,
2,
503,
298,
14945,
531,
272,
5022,
1197,
275,
283,
10675,
7,
339,
768,
3744,
272,
347,
18561,
8,
1886,
304,
267,
408,
2540,
2544,
1006,
2295,
624,
398,
1413,
29263,
14,
409,
15928,
985,
480,
31329,
63,
774,
531,
267,
1413,
29263,
14,
409,
15928,
7705,
8,
1886,
855,
354,
3368,
267,
1413,
29263,
14,
409,
5039,
985,
8,
1886,
855,
354,
3368,
267,
1343,
63,
571,
342,
267,
843,
14,
10675,
63,
1631,
275,
298,
1364,
534,
25325,
63,
396,
4065,
267,
340,
283,
31329,
63,
11115,
2864,
63,
2846,
7,
315,
747,
14,
2314,
26,
288,
843,
14,
10675,
63,
1631,
275,
747,
14,
2314,
459,
31329,
63,
11115,
2864,
63,
2846,
418,
267,
843,
14,
2302,
275,
843,
14,
10675,
63,
1631,
435,
283,
6149,
632,
29,
5993,
7,
339,
347,
511,
1685,
8,
277,
304,
267,
2557,
275,
4888,
6663,
10899,
14,
842,
1252,
3780,
5142,
360,
10675,
1959,
981,
3225,
8,
277,
14,
2302,
12,
5009,
267,
291,
14,
1815,
8,
1631,
9,
267,
1402,
275,
4888,
7243,
6700,
1685,
8,
1631,
9,
267,
291,
14,
26875,
8,
1238,
14,
1143,
2353,
1062,
650,
9,
267,
2269,
63,
835,
275,
1402,
14,
1143,
2353,
342,
267,
291,
14,
629,
8,
1238,
14,
2301,
2353,
1062,
413,
9,
267,
32536,
275,
359,
1238,
14,
576,
8,
1238,
14,
1080,
8,
82,
12,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
7687,
7422,
9,
367,
519,
315,
1425,
8,
1238,
14,
1143,
2353,
24821,
267,
291,
14,
4080,
360,
3455,
297,
32536,
9,
267,
291,
14,
4080,
360,
35,
14868,
1538,
6700,
297,
32536,
9,
267,
291,
14,
4080,
360,
25325,
63,
396,
297,
32536,
9,
267,
291,
14,
629,
8,
1238,
14,
576,
8,
1238,
14,
1080,
8,
9482,
14,
1080,
360,
25325,
63,
396,
659,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
21784,
7422,
395,
283,
25325,
63,
396,
358,
267,
291,
14,
7702,
8,
1238,
14,
576,
8,
1238,
14,
1080,
8,
1238,
14,
1143,
2353,
1062,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
7687,
7422,
430,
398,
1402,
14,
6635,
342,
267,
291,
14,
629,
8,
1238,
14,
1143,
2353,
1062,
2269,
63,
835,
9,
398,
2557,
14,
981,
6700,
360,
1662,
4665,
6700,
358,
267,
291,
14,
629,
8,
1238,
14,
1143,
2353,
1062,
2269,
63,
835,
9,
267,
1402,
14,
6635,
342,
267,
291,
14,
629,
8,
1238,
14,
1143,
2353,
1062,
2269,
63,
835,
435,
413,
9,
267,
32536,
275,
359,
1238,
14,
576,
8,
1238,
14,
1080,
8,
82,
12,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
7687,
7422,
9,
367,
519,
315,
1425,
8,
1238,
14,
1143,
2353,
24821,
267,
291,
14,
4080,
360,
3455,
297,
32536,
9,
267,
291,
14,
4080,
360,
35,
14868,
1538,
6700,
297,
32536,
9,
267,
291,
14,
4080,
360,
25325,
63,
396,
297,
32536,
9,
267,
291,
14,
4080,
360,
1662,
4665,
6700,
297,
32536,
9,
398,
2557,
14,
981,
6700,
360,
1662,
4665,
6700,
18,
358,
267,
2557,
14,
981,
6700,
360,
1662,
4665,
6700,
19,
358,
267,
1402,
14,
6635,
342,
267,
291,
14,
629,
8,
1238,
14,
1143,
2353,
1062,
2269,
63,
835,
435,
650,
9,
267,
32536,
275,
359,
1238,
14,
576,
8,
1238,
14,
1080,
8,
82,
12,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
7687,
7422,
9,
367,
519,
315,
1425,
8,
1238,
14,
1143,
2353,
24821,
267,
291,
14,
4080,
360,
3455,
297,
32536,
9,
267,
291,
14,
4080,
360,
35,
14868,
1538,
6700,
297,
32536,
9,
267,
291,
14,
4080,
360,
25325,
63,
396,
297,
32536,
9,
267,
291,
14,
4080,
360,
1662,
4665,
6700,
297,
32536,
9,
267,
291,
14,
4080,
360,
1662,
4665,
6700,
18,
297,
32536,
9,
267,
291,
14,
4080,
360,
1662,
4665,
6700,
19,
297,
32536,
9,
398,
2557,
14,
981,
6700,
360,
1662,
4665,
6700,
20,
358,
267,
2557,
14,
4824,
6700,
360,
1662,
4665,
6700,
18,
358,
267,
2557,
14,
4824,
6700,
360,
1662,
4665,
6700,
358,
267,
1402,
14,
6635,
342,
267,
291,
14,
629,
8,
1238,
14,
1143,
2353,
1062,
2269,
63,
835,
435,
499,
9,
267,
32536,
275,
359,
1238,
14,
576,
8,
1238,
14,
1080,
8,
82,
12,
378,
12,
1413,
1685,
2681,
4000,
3959,
14,
7687,
7422,
9,
367,
519,
315,
1425,
8,
1238,
14,
1143,
2353,
24821,
267,
291,
14,
4080,
360,
3455,
297,
32536,
9,
267,
291,
14,
4080,
360,
35,
14868,
1538,
6700,
297,
32536,
9,
267,
291,
14,
4080,
360,
25325,
63,
396,
297,
32536,
9,
267,
291,
14,
8795,
360,
1662,
4665,
6700,
297,
32536,
9,
267,
291,
14,
8795,
360,
1662,
4665,
6700,
18,
297,
32536,
9,
267,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
JackKelly/neuralnilm_prototype
|
scripts/e288.py
|
2
|
5039
|
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
BidirectionalRecurrentLayer)
from neuralnilm.source import standardise, discretize, fdiff, power_and_fdiff
from neuralnilm.experiment import run_experiment, init_experiment
from neuralnilm.net import TrainingError
from neuralnilm.layers import MixtureDensityLayer
from neuralnilm.objectives import scaled_cost, mdn_nll
from neuralnilm.plot import MDNPlotter
from lasagne.nonlinearities import sigmoid, rectify, tanh
from lasagne.objectives import mse
from lasagne.init import Uniform, Normal
from lasagne.layers import (LSTMLayer, DenseLayer, Conv1DLayer,
ReshapeLayer, FeaturePoolLayer, RecurrentLayer)
from lasagne.updates import nesterov_momentum, momentum
from functools import partial
import os
import __main__
from copy import deepcopy
from math import sqrt
import numpy as np
import theano.tensor as T
NAME = os.path.splitext(os.path.split(__main__.__file__)[1])[0]
PATH = "/homes/dk3810/workspace/python/neuralnilm/figures"
SAVE_PLOT_INTERVAL = 500
GRADIENT_STEPS = 100
source_dict = dict(
filename='/data/dk3810/ukdale.h5',
appliances=[
['fridge freezer', 'fridge', 'freezer'],
'hair straighteners',
'television'
# 'dish washer',
# ['washer dryer', 'washing machine']
],
max_appliance_powers=[300, 500, 200, 2500, 2400],
on_power_thresholds=[5] * 5,
# max_input_power=5900,
min_on_durations=[60, 60, 60, 1800, 1800],
min_off_durations=[12, 12, 12, 1800, 600],
window=("2013-06-01", "2014-07-01"),
seq_length=512,
output_one_appliance=False,
boolean_targets=False,
train_buildings=[1],
validation_buildings=[1],
# skip_probability=0.7,
n_seq_per_batch=16,
subsample_target=4,
include_diff=False,
clip_appliance_power=True,
target_is_prediction=False,
standardise_input=True,
standardise_targets=True,
input_padding=0,
lag=0,
reshape_target_to_2D=True
# input_stats={'mean': np.array([ 0.05526326], dtype=np.float32),
# 'std': np.array([ 0.12636775], dtype=np.float32)},
# target_stats={
# 'mean': np.array([ 0.04066789, 0.01881946,
# 0.24639061, 0.17608672, 0.10273963],
# dtype=np.float32),
# 'std': np.array([ 0.11449792, 0.07338708,
# 0.26608968, 0.33463112, 0.21250485],
# dtype=np.float32)}
)
net_dict = dict(
save_plot_interval=SAVE_PLOT_INTERVAL,
loss_function=lambda x, t: mdn_nll(x, t).mean(),
# loss_function=lambda x, t: mse(x, t).mean(),
updates_func=momentum,
learning_rate=1e-03,
learning_rate_changes_by_iteration={
100: 5e-04,
500: 1e-04,
4000: 5e-05,
8000: 1e-05
# 3000: 5e-06,
# 4000: 1e-06,
# 10000: 5e-07,
# 50000: 1e-07
},
plotter=MDNPlotter
)
def exp_a(name):
global source
source_dict_copy = deepcopy(source_dict)
source = RealApplianceSource(**source_dict_copy)
net_dict_copy = deepcopy(net_dict)
net_dict_copy.update(dict(
experiment_name=name,
source=source
))
N = 50
net_dict_copy['layers_config'] = [
{
'type': BidirectionalRecurrentLayer,
'num_units': N,
'gradient_steps': GRADIENT_STEPS,
'W_in_to_hid': Normal(std=1.),
'nonlinearity': tanh
},
{
'type': FeaturePoolLayer,
'ds': 4, # number of feature maps to be pooled together
'axis': 1, # pool over the time axis
'pool_function': T.max
},
{
'type': BidirectionalRecurrentLayer,
'num_units': N,
'gradient_steps': GRADIENT_STEPS,
'W_in_to_hid': Normal(std=1/sqrt(N)),
'nonlinearity': tanh
},
{
'type': MixtureDensityLayer,
'num_units': source.n_outputs,
'num_components': 2
}
]
net = Net(**net_dict_copy)
return net
def main():
# EXPERIMENTS = list('abcdefghijklmnopqrstuvwxyz')
EXPERIMENTS = list('a')
for experiment in EXPERIMENTS:
full_exp_name = NAME + experiment
func_call = init_experiment(PATH, experiment, full_exp_name)
logger = logging.getLogger(full_exp_name)
try:
net = eval(func_call)
run_experiment(net, epochs=None)
except KeyboardInterrupt:
logger.info("KeyboardInterrupt")
break
except Exception as exception:
logger.exception("Exception")
raise
finally:
logging.shutdown()
if __name__ == "__main__":
main()
|
mit
|
[
504,
636,
2443,
363,
492,
870,
63,
1593,
12,
4629,
199,
646,
8027,
199,
646,
2050,
199,
504,
984,
492,
3839,
199,
16440,
14,
1180,
360,
7248,
358,
327,
9498,
506,
2544,
16306,
8027,
14,
13563,
503,
19199,
1,
199,
504,
1279,
4889,
20613,
77,
492,
334,
2480,
12,
14849,
2640,
3636,
2980,
12,
12723,
15979,
840,
1698,
1187,
281,
12,
577,
1017,
11777,
5003,
12,
12723,
31012,
21360,
497,
1818,
5003,
9,
199,
504,
1279,
4889,
20613,
77,
14,
1365,
492,
28974,
261,
12,
4339,
264,
30510,
12,
289,
3028,
12,
7074,
63,
460,
63,
70,
3028,
199,
504,
1279,
4889,
20613,
77,
14,
10873,
492,
1255,
63,
10873,
12,
4205,
63,
10873,
199,
504,
1279,
4889,
20613,
77,
14,
846,
492,
22859,
547,
199,
504,
1279,
4889,
20613,
77,
14,
4359,
492,
603,
73,
4167,
26211,
5003,
199,
504,
1279,
4889,
20613,
77,
14,
1113,
825,
7301,
492,
17923,
63,
6336,
12,
333,
4272,
63,
78,
914,
199,
504,
1279,
4889,
20613,
77,
14,
2798,
492,
603,
10872,
10711,
351,
199,
199,
504,
23325,
29575,
14,
2865,
604,
27894,
492,
28886,
12,
6488,
3338,
12,
20162,
72,
199,
504,
23325,
29575,
14,
1113,
825,
7301,
492,
333,
261,
199,
504,
23325,
29575,
14,
826,
492,
1910,
8241,
12,
11514,
199,
504,
23325,
29575,
14,
4359,
492,
334,
29805,
1698,
1187,
281,
12,
20847,
5003,
12,
19140,
17,
36,
5003,
12,
29157,
3591,
15221,
5003,
12,
13407,
5453,
5003,
12,
799,
1818,
5003,
9,
199,
504,
23325,
29575,
14,
7618,
492,
302,
397,
24208,
86,
63,
25710,
12,
23887,
199,
504,
9143,
492,
7417,
199,
646,
747,
199,
646,
636,
973,
363,
199,
504,
1331,
492,
14800,
199,
504,
3473,
492,
7452,
199,
646,
2680,
465,
980,
199,
646,
14377,
14,
3128,
465,
377,
199,
199,
2339,
275,
747,
14,
515,
14,
7973,
8,
736,
14,
515,
14,
1294,
3460,
973,
4914,
493,
363,
2788,
17,
11057,
16,
61,
199,
3243,
275,
3286,
4219,
83,
15,
6341,
1703,
709,
15,
13249,
15,
1548,
15,
685,
4889,
20613,
77,
15,
592,
1482,
2,
199,
19318,
63,
2749,
1387,
63,
17359,
275,
6891,
199,
3975,
1554,
25451,
63,
840,
25711,
275,
2948,
199,
199,
1365,
63,
807,
275,
1211,
8,
272,
1788,
8805,
576,
15,
6341,
1703,
709,
15,
3210,
29258,
14,
72,
21,
297,
272,
20986,
83,
1524,
267,
788,
70,
5562,
2867,
2282,
297,
283,
70,
5562,
297,
283,
4624,
2282,
995,
4960,
283,
2411,
723,
20370,
2056,
724,
1192,
297,
4960,
283,
15253,
2317,
7,
267,
327,
283,
29159,
29050,
281,
297,
267,
327,
788,
87,
1119,
281,
9951,
281,
297,
283,
87,
1119,
316,
6844,
418,
272,
2156,
272,
1390,
63,
19858,
63,
8278,
1192,
1524,
5863,
12,
6891,
12,
1926,
12,
5661,
383,
12,
499,
5303,
467,
272,
641,
63,
5652,
63,
22611,
1524,
21,
61,
627,
959,
12,
199,
3,
259,
1390,
63,
1210,
63,
5652,
29,
1427,
383,
12,
272,
1748,
63,
265,
63,
68,
6556,
1524,
2259,
12,
5212,
12,
5212,
12,
6155,
383,
12,
6155,
383,
467,
272,
1748,
63,
1997,
63,
68,
6556,
1524,
713,
12,
3144,
12,
3144,
12,
6155,
383,
12,
11624,
467,
272,
4353,
15387,
6965,
13,
1690,
13,
614,
401,
298,
7280,
13,
1780,
13,
614,
1288,
272,
5412,
63,
1267,
29,
7736,
12,
272,
1072,
63,
368,
63,
19858,
29,
797,
12,
272,
5046,
63,
4684,
29,
797,
12,
272,
3560,
63,
32589,
1524,
17,
467,
272,
6411,
63,
32589,
1524,
17,
467,
221,
199,
3,
259,
3372,
63,
17210,
29,
16,
14,
23,
12,
272,
302,
63,
3610,
63,
529,
63,
2912,
29,
975,
12,
272,
1007,
3271,
63,
1375,
29,
20,
12,
272,
2387,
63,
3028,
29,
797,
12,
272,
11353,
63,
19858,
63,
5652,
29,
549,
12,
272,
1347,
63,
374,
63,
14845,
29,
797,
12,
272,
28974,
261,
63,
1210,
29,
549,
12,
272,
28974,
261,
63,
4684,
29,
549,
12,
272,
1324,
63,
8358,
29,
16,
12,
272,
17891,
29,
16,
12,
272,
21460,
63,
1375,
63,
475,
63,
18,
36,
29,
549,
272,
327,
1324,
63,
3200,
3713,
3670,
356,
980,
14,
1144,
779,
378,
14,
16458,
1479,
8342,
467,
2152,
29,
1590,
14,
1609,
708,
395,
272,
327,
4519,
283,
1516,
356,
980,
14,
1144,
779,
378,
14,
7957,
1344,
12710,
467,
2152,
29,
1590,
14,
1609,
708,
16658,
272,
327,
1347,
63,
3200,
3126,
272,
327,
258,
283,
3670,
356,
980,
14,
1144,
779,
378,
14,
11189,
14916,
1407,
12,
221,
378,
14,
614,
1299,
1167,
2466,
12,
23855,
327,
12788,
378,
14,
11440,
1355,
22531,
12,
221,
378,
14,
1196,
2259,
1184,
2819,
12,
221,
378,
14,
709,
1465,
1355,
2766,
467,
5591,
327,
10473,
2152,
29,
1590,
14,
1609,
708,
395,
272,
327,
258,
283,
1516,
356,
980,
14,
1144,
779,
378,
14,
845,
19738,
22364,
12,
221,
378,
14,
1780,
1153,
1555,
2036,
12,
23855,
327,
8540,
378,
14,
9969,
29981,
2333,
12,
221,
378,
14,
8425,
22,
2192,
713,
12,
221,
378,
14,
18,
6889,
966,
2426,
467,
5591,
327,
8295,
2152,
29,
1590,
14,
1609,
708,
6769,
199,
9,
421,
199,
846,
63,
807,
275,
1211,
8,
260,
272,
3354,
63,
2798,
63,
4284,
29,
19318,
63,
2749,
1387,
63,
17359,
12,
272,
5621,
63,
1593,
29,
2734,
671,
12,
307,
26,
333,
4272,
63,
78,
914,
8,
88,
12,
307,
680,
3670,
1062,
199,
3,
259,
5621,
63,
1593,
29,
2734,
671,
12,
307,
26,
333,
261,
8,
88,
12,
307,
680,
3670,
1062,
272,
7029,
63,
1532,
29,
25710,
12,
272,
9328,
63,
1866,
29,
17,
69,
13,
1644,
12,
2043,
9328,
63,
1866,
63,
6627,
63,
991,
63,
12575,
3126,
2126,
2948,
26,
959,
69,
13,
966,
12,
28872,
6891,
26,
413,
69,
13,
966,
12,
2126,
31092,
26,
959,
69,
13,
1717,
12,
28872,
29855,
26,
413,
69,
13,
1717,
267,
327,
29664,
26,
959,
69,
13,
1690,
12,
267,
327,
31092,
26,
413,
69,
13,
1690,
12,
267,
327,
11630,
26,
959,
69,
13,
1780,
12,
267,
327,
959,
993,
26,
413,
69,
13,
1780,
272,
1660,
272,
5137,
351,
29,
5127,
46,
10711,
351,
199,
9,
421,
199,
318,
1437,
63
] |
[
636,
2443,
363,
492,
870,
63,
1593,
12,
4629,
199,
646,
8027,
199,
646,
2050,
199,
504,
984,
492,
3839,
199,
16440,
14,
1180,
360,
7248,
358,
327,
9498,
506,
2544,
16306,
8027,
14,
13563,
503,
19199,
1,
199,
504,
1279,
4889,
20613,
77,
492,
334,
2480,
12,
14849,
2640,
3636,
2980,
12,
12723,
15979,
840,
1698,
1187,
281,
12,
577,
1017,
11777,
5003,
12,
12723,
31012,
21360,
497,
1818,
5003,
9,
199,
504,
1279,
4889,
20613,
77,
14,
1365,
492,
28974,
261,
12,
4339,
264,
30510,
12,
289,
3028,
12,
7074,
63,
460,
63,
70,
3028,
199,
504,
1279,
4889,
20613,
77,
14,
10873,
492,
1255,
63,
10873,
12,
4205,
63,
10873,
199,
504,
1279,
4889,
20613,
77,
14,
846,
492,
22859,
547,
199,
504,
1279,
4889,
20613,
77,
14,
4359,
492,
603,
73,
4167,
26211,
5003,
199,
504,
1279,
4889,
20613,
77,
14,
1113,
825,
7301,
492,
17923,
63,
6336,
12,
333,
4272,
63,
78,
914,
199,
504,
1279,
4889,
20613,
77,
14,
2798,
492,
603,
10872,
10711,
351,
199,
199,
504,
23325,
29575,
14,
2865,
604,
27894,
492,
28886,
12,
6488,
3338,
12,
20162,
72,
199,
504,
23325,
29575,
14,
1113,
825,
7301,
492,
333,
261,
199,
504,
23325,
29575,
14,
826,
492,
1910,
8241,
12,
11514,
199,
504,
23325,
29575,
14,
4359,
492,
334,
29805,
1698,
1187,
281,
12,
20847,
5003,
12,
19140,
17,
36,
5003,
12,
29157,
3591,
15221,
5003,
12,
13407,
5453,
5003,
12,
799,
1818,
5003,
9,
199,
504,
23325,
29575,
14,
7618,
492,
302,
397,
24208,
86,
63,
25710,
12,
23887,
199,
504,
9143,
492,
7417,
199,
646,
747,
199,
646,
636,
973,
363,
199,
504,
1331,
492,
14800,
199,
504,
3473,
492,
7452,
199,
646,
2680,
465,
980,
199,
646,
14377,
14,
3128,
465,
377,
199,
199,
2339,
275,
747,
14,
515,
14,
7973,
8,
736,
14,
515,
14,
1294,
3460,
973,
4914,
493,
363,
2788,
17,
11057,
16,
61,
199,
3243,
275,
3286,
4219,
83,
15,
6341,
1703,
709,
15,
13249,
15,
1548,
15,
685,
4889,
20613,
77,
15,
592,
1482,
2,
199,
19318,
63,
2749,
1387,
63,
17359,
275,
6891,
199,
3975,
1554,
25451,
63,
840,
25711,
275,
2948,
199,
199,
1365,
63,
807,
275,
1211,
8,
272,
1788,
8805,
576,
15,
6341,
1703,
709,
15,
3210,
29258,
14,
72,
21,
297,
272,
20986,
83,
1524,
267,
788,
70,
5562,
2867,
2282,
297,
283,
70,
5562,
297,
283,
4624,
2282,
995,
4960,
283,
2411,
723,
20370,
2056,
724,
1192,
297,
4960,
283,
15253,
2317,
7,
267,
327,
283,
29159,
29050,
281,
297,
267,
327,
788,
87,
1119,
281,
9951,
281,
297,
283,
87,
1119,
316,
6844,
418,
272,
2156,
272,
1390,
63,
19858,
63,
8278,
1192,
1524,
5863,
12,
6891,
12,
1926,
12,
5661,
383,
12,
499,
5303,
467,
272,
641,
63,
5652,
63,
22611,
1524,
21,
61,
627,
959,
12,
199,
3,
259,
1390,
63,
1210,
63,
5652,
29,
1427,
383,
12,
272,
1748,
63,
265,
63,
68,
6556,
1524,
2259,
12,
5212,
12,
5212,
12,
6155,
383,
12,
6155,
383,
467,
272,
1748,
63,
1997,
63,
68,
6556,
1524,
713,
12,
3144,
12,
3144,
12,
6155,
383,
12,
11624,
467,
272,
4353,
15387,
6965,
13,
1690,
13,
614,
401,
298,
7280,
13,
1780,
13,
614,
1288,
272,
5412,
63,
1267,
29,
7736,
12,
272,
1072,
63,
368,
63,
19858,
29,
797,
12,
272,
5046,
63,
4684,
29,
797,
12,
272,
3560,
63,
32589,
1524,
17,
467,
272,
6411,
63,
32589,
1524,
17,
467,
221,
199,
3,
259,
3372,
63,
17210,
29,
16,
14,
23,
12,
272,
302,
63,
3610,
63,
529,
63,
2912,
29,
975,
12,
272,
1007,
3271,
63,
1375,
29,
20,
12,
272,
2387,
63,
3028,
29,
797,
12,
272,
11353,
63,
19858,
63,
5652,
29,
549,
12,
272,
1347,
63,
374,
63,
14845,
29,
797,
12,
272,
28974,
261,
63,
1210,
29,
549,
12,
272,
28974,
261,
63,
4684,
29,
549,
12,
272,
1324,
63,
8358,
29,
16,
12,
272,
17891,
29,
16,
12,
272,
21460,
63,
1375,
63,
475,
63,
18,
36,
29,
549,
272,
327,
1324,
63,
3200,
3713,
3670,
356,
980,
14,
1144,
779,
378,
14,
16458,
1479,
8342,
467,
2152,
29,
1590,
14,
1609,
708,
395,
272,
327,
4519,
283,
1516,
356,
980,
14,
1144,
779,
378,
14,
7957,
1344,
12710,
467,
2152,
29,
1590,
14,
1609,
708,
16658,
272,
327,
1347,
63,
3200,
3126,
272,
327,
258,
283,
3670,
356,
980,
14,
1144,
779,
378,
14,
11189,
14916,
1407,
12,
221,
378,
14,
614,
1299,
1167,
2466,
12,
23855,
327,
12788,
378,
14,
11440,
1355,
22531,
12,
221,
378,
14,
1196,
2259,
1184,
2819,
12,
221,
378,
14,
709,
1465,
1355,
2766,
467,
5591,
327,
10473,
2152,
29,
1590,
14,
1609,
708,
395,
272,
327,
258,
283,
1516,
356,
980,
14,
1144,
779,
378,
14,
845,
19738,
22364,
12,
221,
378,
14,
1780,
1153,
1555,
2036,
12,
23855,
327,
8540,
378,
14,
9969,
29981,
2333,
12,
221,
378,
14,
8425,
22,
2192,
713,
12,
221,
378,
14,
18,
6889,
966,
2426,
467,
5591,
327,
8295,
2152,
29,
1590,
14,
1609,
708,
6769,
199,
9,
421,
199,
846,
63,
807,
275,
1211,
8,
260,
272,
3354,
63,
2798,
63,
4284,
29,
19318,
63,
2749,
1387,
63,
17359,
12,
272,
5621,
63,
1593,
29,
2734,
671,
12,
307,
26,
333,
4272,
63,
78,
914,
8,
88,
12,
307,
680,
3670,
1062,
199,
3,
259,
5621,
63,
1593,
29,
2734,
671,
12,
307,
26,
333,
261,
8,
88,
12,
307,
680,
3670,
1062,
272,
7029,
63,
1532,
29,
25710,
12,
272,
9328,
63,
1866,
29,
17,
69,
13,
1644,
12,
2043,
9328,
63,
1866,
63,
6627,
63,
991,
63,
12575,
3126,
2126,
2948,
26,
959,
69,
13,
966,
12,
28872,
6891,
26,
413,
69,
13,
966,
12,
2126,
31092,
26,
959,
69,
13,
1717,
12,
28872,
29855,
26,
413,
69,
13,
1717,
267,
327,
29664,
26,
959,
69,
13,
1690,
12,
267,
327,
31092,
26,
413,
69,
13,
1690,
12,
267,
327,
11630,
26,
959,
69,
13,
1780,
12,
267,
327,
959,
993,
26,
413,
69,
13,
1780,
272,
1660,
272,
5137,
351,
29,
5127,
46,
10711,
351,
199,
9,
421,
199,
318,
1437,
63,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
joequery/django
|
tests/generic_relations_regress/models.py
|
269
|
5666
|
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.deletion import ProtectedError
from django.utils.encoding import python_2_unicode_compatible
__all__ = ('Link', 'Place', 'Restaurant', 'Person', 'Address',
'CharLink', 'TextLink', 'OddRelation1', 'OddRelation2',
'Contact', 'Organization', 'Note', 'Company')
@python_2_unicode_compatible
class Link(models.Model):
content_type = models.ForeignKey(ContentType, models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey()
def __str__(self):
return "Link to %s id=%s" % (self.content_type, self.object_id)
@python_2_unicode_compatible
class Place(models.Model):
name = models.CharField(max_length=100)
links = GenericRelation(Link)
def __str__(self):
return "Place: %s" % self.name
@python_2_unicode_compatible
class Restaurant(Place):
def __str__(self):
return "Restaurant: %s" % self.name
@python_2_unicode_compatible
class Address(models.Model):
street = models.CharField(max_length=80)
city = models.CharField(max_length=50)
state = models.CharField(max_length=2)
zipcode = models.CharField(max_length=5)
content_type = models.ForeignKey(ContentType, models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey()
def __str__(self):
return '%s %s, %s %s' % (self.street, self.city, self.state, self.zipcode)
@python_2_unicode_compatible
class Person(models.Model):
account = models.IntegerField(primary_key=True)
name = models.CharField(max_length=128)
addresses = GenericRelation(Address)
def __str__(self):
return self.name
class CharLink(models.Model):
content_type = models.ForeignKey(ContentType, models.CASCADE)
object_id = models.CharField(max_length=100)
content_object = GenericForeignKey()
class TextLink(models.Model):
content_type = models.ForeignKey(ContentType, models.CASCADE)
object_id = models.TextField()
content_object = GenericForeignKey()
class OddRelation1(models.Model):
name = models.CharField(max_length=100)
clinks = GenericRelation(CharLink)
class OddRelation2(models.Model):
name = models.CharField(max_length=100)
tlinks = GenericRelation(TextLink)
# models for test_q_object_or:
class Note(models.Model):
content_type = models.ForeignKey(ContentType, models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey()
note = models.TextField()
class Contact(models.Model):
notes = GenericRelation(Note)
class Organization(models.Model):
name = models.CharField(max_length=255)
contacts = models.ManyToManyField(Contact, related_name='organizations')
@python_2_unicode_compatible
class Company(models.Model):
name = models.CharField(max_length=100)
links = GenericRelation(Link)
def __str__(self):
return "Company: %s" % self.name
# For testing #13085 fix, we also use Note model defined above
class Developer(models.Model):
name = models.CharField(max_length=15)
@python_2_unicode_compatible
class Team(models.Model):
name = models.CharField(max_length=15)
members = models.ManyToManyField(Developer)
def __str__(self):
return "%s team" % self.name
def __len__(self):
return self.members.count()
class Guild(models.Model):
name = models.CharField(max_length=15)
members = models.ManyToManyField(Developer)
def __nonzero__(self):
return self.members.count()
class Tag(models.Model):
content_type = models.ForeignKey(ContentType, models.CASCADE, related_name='g_r_r_tags')
object_id = models.CharField(max_length=15)
content_object = GenericForeignKey()
label = models.CharField(max_length=15)
class Board(models.Model):
name = models.CharField(primary_key=True, max_length=15)
class SpecialGenericRelation(GenericRelation):
def __init__(self, *args, **kwargs):
super(SpecialGenericRelation, self).__init__(*args, **kwargs)
self.editable = True
self.save_form_data_calls = 0
def save_form_data(self, *args, **kwargs):
self.save_form_data_calls += 1
class HasLinks(models.Model):
links = SpecialGenericRelation(Link)
class Meta:
abstract = True
class HasLinkThing(HasLinks):
pass
class A(models.Model):
flag = models.NullBooleanField()
content_type = models.ForeignKey(ContentType, models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey('content_type', 'object_id')
class B(models.Model):
a = GenericRelation(A)
class Meta:
ordering = ('id',)
class C(models.Model):
b = models.ForeignKey(B, models.CASCADE)
class Meta:
ordering = ('id',)
class D(models.Model):
b = models.ForeignKey(B, models.SET_NULL, null=True)
class Meta:
ordering = ('id',)
# Ticket #22998
class Node(models.Model):
content_type = models.ForeignKey(ContentType, models.CASCADE)
object_id = models.PositiveIntegerField()
content = GenericForeignKey('content_type', 'object_id')
class Content(models.Model):
nodes = GenericRelation(Node)
related_obj = models.ForeignKey('Related', models.CASCADE)
class Related(models.Model):
pass
def prevent_deletes(sender, instance, **kwargs):
raise ProtectedError("Not allowed to delete.", [instance])
models.signals.pre_delete.connect(prevent_deletes, sender=Node)
|
bsd-3-clause
|
[
504,
1639,
14,
2828,
14,
10778,
14,
955,
492,
334,
272,
8307,
3190,
12,
8307,
12617,
12,
199,
9,
199,
504,
1639,
14,
2828,
14,
10778,
14,
992,
492,
14501,
199,
504,
1639,
14,
697,
492,
1709,
199,
504,
1639,
14,
697,
14,
992,
14,
14281,
492,
2165,
4530,
547,
199,
504,
1639,
14,
1208,
14,
2991,
492,
2366,
63,
18,
63,
2975,
63,
6490,
199,
199,
363,
452,
363,
275,
661,
3834,
297,
283,
11613,
297,
283,
32075,
297,
283,
7344,
297,
283,
1476,
297,
1779,
283,
1610,
3834,
297,
283,
1872,
3834,
297,
283,
47,
617,
12617,
17,
297,
283,
47,
617,
12617,
18,
297,
1779,
283,
14499,
297,
283,
15928,
297,
283,
7443,
297,
283,
16063,
358,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
10967,
8,
992,
14,
1685,
304,
272,
1564,
63,
466,
275,
1709,
14,
3190,
8,
11282,
12,
1709,
14,
10855,
9,
272,
909,
63,
344,
275,
1709,
14,
8591,
342,
272,
1564,
63,
785,
275,
8307,
3190,
342,
339,
347,
636,
495,
721,
277,
304,
267,
372,
298,
3834,
370,
450,
83,
1305,
2458,
83,
2,
450,
334,
277,
14,
1317,
63,
466,
12,
291,
14,
785,
63,
344,
9,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
10902,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1960,
9,
272,
6220,
275,
8307,
12617,
8,
3834,
9,
339,
347,
636,
495,
721,
277,
304,
267,
372,
298,
11613,
26,
450,
83,
2,
450,
291,
14,
354,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
799,
14436,
8,
11613,
304,
272,
347,
636,
495,
721,
277,
304,
267,
372,
298,
32075,
26,
450,
83,
2,
450,
291,
14,
354,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
9906,
8,
992,
14,
1685,
304,
272,
410,
7936,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1257,
9,
272,
14492,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1400,
9,
272,
1174,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
18,
9,
272,
3482,
600,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
21,
9,
272,
1564,
63,
466,
275,
1709,
14,
3190,
8,
11282,
12,
1709,
14,
10855,
9,
272,
909,
63,
344,
275,
1709,
14,
8591,
342,
272,
1564,
63,
785,
275,
8307,
3190,
342,
339,
347,
636,
495,
721,
277,
304,
267,
372,
1543,
83,
450,
83,
12,
450,
83,
450,
83,
7,
450,
334,
277,
14,
20451,
12,
291,
14,
3690,
12,
291,
14,
929,
12,
291,
14,
3065,
600,
9,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
8028,
8,
992,
14,
1685,
304,
272,
2933,
275,
1709,
14,
3901,
8,
3327,
63,
498,
29,
549,
9,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
3933,
9,
272,
7149,
275,
8307,
12617,
8,
1476,
9,
339,
347,
636,
495,
721,
277,
304,
267,
372,
291,
14,
354,
421,
199,
533,
6659,
3834,
8,
992,
14,
1685,
304,
272,
1564,
63,
466,
275,
1709,
14,
3190,
8,
11282,
12,
1709,
14,
10855,
9,
272,
909,
63,
344,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1960,
9,
272,
1564,
63,
785,
275,
8307,
3190,
342,
421,
199,
533,
4516,
3834,
8,
992,
14,
1685,
304,
272,
1564,
63,
466,
275,
1709,
14,
3190,
8,
11282,
12,
1709,
14,
10855,
9,
272,
909,
63,
344,
275,
1709,
14,
6254,
342,
272,
1564,
63,
785,
275,
8307,
3190,
342,
421,
199,
533,
593,
617,
12617,
17,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1960,
9,
272,
286,
4614,
275,
8307,
12617,
8,
1610,
3834,
9,
421,
199,
533,
593,
617,
12617,
18,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1960,
9,
272,
307,
4614,
275,
8307,
12617,
8,
1872,
3834,
9,
421,
199,
3,
1709,
367,
511,
63,
81,
63,
785,
63,
269,
26,
199,
533,
3390,
8,
992,
14,
1685,
304,
272,
1564,
63,
466,
275,
1709,
14,
3190,
8,
11282,
12,
1709,
14,
10855,
9,
272,
909,
63,
344,
275,
1709,
14,
8591,
342,
272,
1564,
63,
785,
275,
8307,
3190,
342,
272,
5317,
275,
1709,
14,
6254,
342,
421,
199,
533,
18684,
8,
992,
14,
1685,
304,
272,
12681,
275,
8307,
12617,
8,
7443,
9,
421,
199,
533,
18863,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
2299,
9,
272,
27989,
275,
1709,
14,
7624,
8,
14499,
12,
4048,
63,
354,
534,
19916,
12270,
358,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
15878,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1960,
9,
272,
6220,
275,
8307,
12617,
8,
3834,
9,
339,
347,
636,
495,
721,
277,
304,
267,
372,
298,
16063,
26,
450,
83,
2,
450,
291,
14,
354,
421,
199,
3,
2104,
5343,
327,
969,
17494,
5325,
12,
781,
2597,
675,
3390,
1402,
3247,
3432,
199,
533,
9607,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1046,
9,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
11682,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1046,
9,
272,
7556,
275,
1709,
14,
7624,
8,
31032,
9,
339,
347,
636,
495,
721,
277,
304,
267,
372,
2071,
83,
8099,
2,
450,
291,
14,
354,
339,
347,
636,
552,
721,
277,
304,
267,
372,
291,
14,
6334,
14,
835,
342,
421,
199,
533,
12436,
668,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1046,
9,
272,
7556,
275,
1709,
14,
7624,
8,
31032,
9,
339,
347,
636,
10262,
721,
277,
304,
398,
372,
291,
14,
6334,
14,
835,
342,
421,
199,
533,
8053,
8,
992,
14,
1685,
304,
272,
1564,
63,
466,
275,
1709,
14,
3190,
8,
11282,
12,
1709,
14,
10855,
12,
4048,
63,
354,
534,
71,
63,
82,
63
] |
[
1639,
14,
2828,
14,
10778,
14,
955,
492,
334,
272,
8307,
3190,
12,
8307,
12617,
12,
199,
9,
199,
504,
1639,
14,
2828,
14,
10778,
14,
992,
492,
14501,
199,
504,
1639,
14,
697,
492,
1709,
199,
504,
1639,
14,
697,
14,
992,
14,
14281,
492,
2165,
4530,
547,
199,
504,
1639,
14,
1208,
14,
2991,
492,
2366,
63,
18,
63,
2975,
63,
6490,
199,
199,
363,
452,
363,
275,
661,
3834,
297,
283,
11613,
297,
283,
32075,
297,
283,
7344,
297,
283,
1476,
297,
1779,
283,
1610,
3834,
297,
283,
1872,
3834,
297,
283,
47,
617,
12617,
17,
297,
283,
47,
617,
12617,
18,
297,
1779,
283,
14499,
297,
283,
15928,
297,
283,
7443,
297,
283,
16063,
358,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
10967,
8,
992,
14,
1685,
304,
272,
1564,
63,
466,
275,
1709,
14,
3190,
8,
11282,
12,
1709,
14,
10855,
9,
272,
909,
63,
344,
275,
1709,
14,
8591,
342,
272,
1564,
63,
785,
275,
8307,
3190,
342,
339,
347,
636,
495,
721,
277,
304,
267,
372,
298,
3834,
370,
450,
83,
1305,
2458,
83,
2,
450,
334,
277,
14,
1317,
63,
466,
12,
291,
14,
785,
63,
344,
9,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
10902,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1960,
9,
272,
6220,
275,
8307,
12617,
8,
3834,
9,
339,
347,
636,
495,
721,
277,
304,
267,
372,
298,
11613,
26,
450,
83,
2,
450,
291,
14,
354,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
799,
14436,
8,
11613,
304,
272,
347,
636,
495,
721,
277,
304,
267,
372,
298,
32075,
26,
450,
83,
2,
450,
291,
14,
354,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
9906,
8,
992,
14,
1685,
304,
272,
410,
7936,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1257,
9,
272,
14492,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1400,
9,
272,
1174,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
18,
9,
272,
3482,
600,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
21,
9,
272,
1564,
63,
466,
275,
1709,
14,
3190,
8,
11282,
12,
1709,
14,
10855,
9,
272,
909,
63,
344,
275,
1709,
14,
8591,
342,
272,
1564,
63,
785,
275,
8307,
3190,
342,
339,
347,
636,
495,
721,
277,
304,
267,
372,
1543,
83,
450,
83,
12,
450,
83,
450,
83,
7,
450,
334,
277,
14,
20451,
12,
291,
14,
3690,
12,
291,
14,
929,
12,
291,
14,
3065,
600,
9,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
8028,
8,
992,
14,
1685,
304,
272,
2933,
275,
1709,
14,
3901,
8,
3327,
63,
498,
29,
549,
9,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
3933,
9,
272,
7149,
275,
8307,
12617,
8,
1476,
9,
339,
347,
636,
495,
721,
277,
304,
267,
372,
291,
14,
354,
421,
199,
533,
6659,
3834,
8,
992,
14,
1685,
304,
272,
1564,
63,
466,
275,
1709,
14,
3190,
8,
11282,
12,
1709,
14,
10855,
9,
272,
909,
63,
344,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1960,
9,
272,
1564,
63,
785,
275,
8307,
3190,
342,
421,
199,
533,
4516,
3834,
8,
992,
14,
1685,
304,
272,
1564,
63,
466,
275,
1709,
14,
3190,
8,
11282,
12,
1709,
14,
10855,
9,
272,
909,
63,
344,
275,
1709,
14,
6254,
342,
272,
1564,
63,
785,
275,
8307,
3190,
342,
421,
199,
533,
593,
617,
12617,
17,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1960,
9,
272,
286,
4614,
275,
8307,
12617,
8,
1610,
3834,
9,
421,
199,
533,
593,
617,
12617,
18,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1960,
9,
272,
307,
4614,
275,
8307,
12617,
8,
1872,
3834,
9,
421,
199,
3,
1709,
367,
511,
63,
81,
63,
785,
63,
269,
26,
199,
533,
3390,
8,
992,
14,
1685,
304,
272,
1564,
63,
466,
275,
1709,
14,
3190,
8,
11282,
12,
1709,
14,
10855,
9,
272,
909,
63,
344,
275,
1709,
14,
8591,
342,
272,
1564,
63,
785,
275,
8307,
3190,
342,
272,
5317,
275,
1709,
14,
6254,
342,
421,
199,
533,
18684,
8,
992,
14,
1685,
304,
272,
12681,
275,
8307,
12617,
8,
7443,
9,
421,
199,
533,
18863,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
2299,
9,
272,
27989,
275,
1709,
14,
7624,
8,
14499,
12,
4048,
63,
354,
534,
19916,
12270,
358,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
15878,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1960,
9,
272,
6220,
275,
8307,
12617,
8,
3834,
9,
339,
347,
636,
495,
721,
277,
304,
267,
372,
298,
16063,
26,
450,
83,
2,
450,
291,
14,
354,
421,
199,
3,
2104,
5343,
327,
969,
17494,
5325,
12,
781,
2597,
675,
3390,
1402,
3247,
3432,
199,
533,
9607,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1046,
9,
421,
199,
32,
1548,
63,
18,
63,
2975,
63,
6490,
199,
533,
11682,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1046,
9,
272,
7556,
275,
1709,
14,
7624,
8,
31032,
9,
339,
347,
636,
495,
721,
277,
304,
267,
372,
2071,
83,
8099,
2,
450,
291,
14,
354,
339,
347,
636,
552,
721,
277,
304,
267,
372,
291,
14,
6334,
14,
835,
342,
421,
199,
533,
12436,
668,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1046,
9,
272,
7556,
275,
1709,
14,
7624,
8,
31032,
9,
339,
347,
636,
10262,
721,
277,
304,
398,
372,
291,
14,
6334,
14,
835,
342,
421,
199,
533,
8053,
8,
992,
14,
1685,
304,
272,
1564,
63,
466,
275,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
TheoChevalier/bedrock
|
bin/cron.py
|
1
|
3478
|
#!/usr/bin/env python
from __future__ import print_function, unicode_literals
import datetime
import os
import sys
from subprocess import check_call
import requests
from apscheduler.schedulers.blocking import BlockingScheduler
from decouple import config
from pathlib2 import Path
schedule = BlockingScheduler()
DEAD_MANS_SNITCH_URL = config('DEAD_MANS_SNITCH_URL', default='')
# ROOT path of the project. A pathlib.Path object.
ROOT_PATH = Path(__file__).resolve().parents[1]
ROOT = str(ROOT_PATH)
MANAGE = str(ROOT_PATH / 'manage.py')
def call_command(command):
check_call('python {0} {1}'.format(MANAGE, command), shell=True)
class scheduled_job(object):
"""Decorator for scheduled jobs. Takes same args as apscheduler.schedule_job."""
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
def __call__(self, fn):
self.name = fn.__name__
self.callback = fn
schedule.add_job(self.run, id=self.name, *self.args, **self.kwargs)
self.log('Registered')
return self.run
def run(self):
self.log('starting')
try:
self.callback()
except Exception as e:
self.log('CRASHED: {}'.format(e))
raise
else:
self.log('finished successfully')
def log(self, message):
msg = '[{}] Clock job {}@{}: {}'.format(
datetime.datetime.utcnow(), self.name,
os.getenv('DEIS_APP', 'default_app'), message)
print(msg, file=sys.stderr)
def ping_dms(function):
"""Pings Dead Man's Snitch after job completion if URL is set."""
def _ping():
function()
if DEAD_MANS_SNITCH_URL:
utcnow = datetime.datetime.utcnow()
payload = {'m': 'Run {} on {}'.format(function.__name__, utcnow.isoformat())}
requests.get(DEAD_MANS_SNITCH_URL, params=payload)
_ping.__name__ = function.__name__
return _ping
def schedule_database_jobs():
@scheduled_job('interval', minutes=15)
@ping_dms
def update_product_details():
call_command('update_product_details_files --database bedrock')
@scheduled_job('interval', minutes=30)
def update_externalfiles():
call_command('update_externalfiles')
@scheduled_job('interval', minutes=30)
def update_security_advisories():
call_command('update_security_advisories')
@scheduled_job('interval', minutes=5)
def rnasync():
# running in a subprocess as rnasync was not designed for long-running process
call_command('rnasync')
@scheduled_job('interval', hours=6)
def update_tweets():
call_command('cron update_tweets')
@scheduled_job('interval', hours=1)
def ical_feeds():
call_command('cron update_ical_feeds')
call_command('cron cleanup_ical_events')
@scheduled_job('interval', hours=1)
def update_blog_feeds():
call_command('update_blog_feeds --database bedrock')
def schedul_l10n_jobs():
@scheduled_job('interval', minutes=10)
def update_locales():
call_command('l10n_update')
if __name__ == '__main__':
args = sys.argv[1:]
has_jobs = False
if 'db' in args:
schedule_database_jobs()
has_jobs = True
if 'l10n' in args:
schedul_l10n_jobs()
has_jobs = True
if has_jobs:
try:
schedule.start()
except (KeyboardInterrupt, SystemExit):
pass
|
mpl-2.0
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
12,
2649,
63,
5955,
199,
199,
646,
2197,
199,
646,
747,
199,
646,
984,
199,
504,
3873,
492,
1104,
63,
1250,
199,
199,
646,
4145,
199,
504,
282,
1190,
5085,
14,
7211,
2393,
14,
13091,
492,
8651,
316,
11251,
199,
504,
477,
17600,
492,
1101,
199,
504,
32212,
18,
492,
6912,
421,
199,
7211,
275,
8651,
316,
11251,
342,
199,
29031,
63,
45,
5622,
63,
8199,
15894,
63,
2632,
275,
1101,
360,
29031,
63,
45,
5622,
63,
8199,
15894,
63,
2632,
297,
849,
13275,
199,
199,
3,
16547,
931,
402,
314,
2199,
14,
437,
32212,
14,
2042,
909,
14,
199,
5441,
63,
3243,
275,
6912,
3460,
493,
28634,
6983,
1252,
8859,
59,
17,
61,
199,
5441,
275,
620,
8,
5441,
63,
3243,
9,
199,
6588,
2962,
275,
620,
8,
5441,
63,
3243,
1182,
283,
9053,
14,
647,
358,
421,
199,
318,
1240,
63,
1531,
8,
1531,
304,
272,
1104,
63,
1250,
360,
1548,
469,
16,
93,
469,
17,
5285,
908,
8,
6588,
2962,
12,
1414,
395,
5218,
29,
549,
9,
421,
199,
533,
18416,
63,
2423,
8,
785,
304,
272,
408,
14946,
367,
18416,
9643,
14,
17415,
2011,
1249,
465,
282,
1190,
5085,
14,
7211,
63,
2423,
1041,
339,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
291,
14,
589,
275,
1249,
267,
291,
14,
958,
275,
2074,
339,
347,
636,
1250,
721,
277,
12,
4325,
304,
267,
291,
14,
354,
275,
4325,
855,
354,
363,
267,
291,
14,
3058,
275,
4325,
267,
8732,
14,
525,
63,
2423,
8,
277,
14,
1065,
12,
1305,
29,
277,
14,
354,
12,
627,
277,
14,
589,
12,
1011,
277,
14,
958,
9,
267,
291,
14,
793,
360,
20341,
358,
267,
372,
291,
14,
1065,
339,
347,
1255,
8,
277,
304,
267,
291,
14,
793,
360,
15769,
358,
267,
862,
26,
288,
291,
14,
3058,
342,
267,
871,
2186,
465,
325,
26,
288,
291,
14,
793,
360,
2944,
8100,
1149,
26,
9499,
908,
8,
69,
430,
288,
746,
267,
587,
26,
288,
291,
14,
793,
360,
8669,
8792,
358,
339,
347,
943,
8,
277,
12,
1245,
304,
267,
1499,
275,
6730,
27922,
32425,
3906,
1052,
32,
2440,
26,
9499,
908,
8,
288,
2197,
14,
2083,
14,
10779,
1062,
291,
14,
354,
12,
288,
747,
14,
12959,
360,
1093,
1311,
63,
7121,
297,
283,
885,
63,
571,
659,
1245,
9,
267,
870,
8,
1328,
12,
570,
29,
1274,
14,
3083,
9,
421,
199,
318,
18249,
63,
68,
706,
8,
1593,
304,
272,
408,
48,
780,
1487,
350,
4688,
1159,
428,
78,
9414,
2410,
3906,
13659,
340,
2851,
365,
663,
1041,
339,
347,
485,
4073,
837,
267,
805,
342,
267,
340,
3265,
1554,
63,
45,
5622,
63,
8199,
15894,
63,
2632,
26,
288,
221,
10779,
275,
2197,
14,
2083,
14,
10779,
342,
288,
4886,
275,
791,
77,
356,
283,
2540,
1052,
641,
9499,
908,
8,
1593,
855,
354,
3108,
221,
10779,
14,
17070,
1012,
93,
288,
4145,
14,
362,
8,
29031,
63,
45,
5622,
63,
8199,
15894,
63,
2632,
12,
1862,
29,
4749,
9,
339,
485,
4073,
855,
354,
363,
275,
805,
855,
354,
363,
272,
372,
485,
4073,
421,
199,
318,
8732,
63,
4659,
63,
6920,
837,
272,
768,
19274,
63,
2423,
360,
4284,
297,
9395,
29,
1046,
9,
272,
768,
4073,
63,
68,
706,
272,
347,
1678,
63,
2558,
63,
5087,
837,
267,
1240,
63,
1531,
360,
873,
63,
2558,
63,
5087,
63,
1725,
1553,
4659,
30739,
24892,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
9395,
29,
1216,
9,
272,
347,
1678,
63,
18587,
7411,
22894,
837,
267,
1240,
63,
1531,
360,
873,
63,
18587,
7411,
22894,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
9395,
29,
1216,
9,
272,
347,
1678,
63,
4416,
63,
350,
5068,
6112,
837,
267,
1240,
63,
1531,
360,
873,
63,
4416,
63,
350,
5068,
6112,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
9395,
29,
21,
9,
272,
347,
519,
78,
4146,
837,
267,
327,
3879,
315,
282,
3873,
465,
519,
78,
4146,
1990,
440,
19829,
367,
1846,
13,
5720,
2112,
267,
1240,
63,
1531,
360,
11641,
4146,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
10857,
29,
22,
9,
272,
347,
1678,
63,
84,
18588,
837,
267,
1240,
63,
1531,
360,
14829,
1678,
63,
84,
18588,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
10857,
29,
17,
9,
272,
347,
284,
915,
63,
11522,
837,
267,
1240,
63,
1531,
360,
14829,
1678,
63,
2652,
63,
11522,
358,
267,
1240,
63,
1531,
360,
14829,
9058,
63,
2652,
63,
4368,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
10857,
29,
17,
9,
272,
347,
1678,
63,
11486,
63,
11522,
837,
267,
1240,
63,
1531,
360,
873,
63,
11486,
63,
11522,
1553,
4659,
30739,
24892,
358,
421,
199,
318,
10286,
348,
63,
76,
709,
78,
63,
6920,
837,
272,
768,
19274,
63,
2423,
360,
4284,
297,
9395,
29,
709,
9,
272,
347,
1678,
63,
24763,
837,
267,
1240,
63,
1531,
360,
76,
709,
78,
63,
873,
358,
421,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
1249,
275,
984,
14,
3020,
59,
17,
2938,
272,
965,
63,
6920,
275,
756,
272,
340,
283,
697,
7,
315,
1249,
26,
267,
8732,
63,
4659,
63,
6920,
342,
267,
965,
63,
6920,
275,
715,
272,
340,
283,
76,
709,
78,
7,
315,
1249,
26,
267,
10286,
348,
63,
76,
709,
78,
63,
6920,
342,
267,
965,
63,
6920,
275,
715,
339,
340,
965,
63,
6920,
26,
267,
862,
26,
288,
8732,
14,
928,
342,
267,
871,
334,
31538,
12,
14838,
304,
288,
986,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
12,
2649,
63,
5955,
199,
199,
646,
2197,
199,
646,
747,
199,
646,
984,
199,
504,
3873,
492,
1104,
63,
1250,
199,
199,
646,
4145,
199,
504,
282,
1190,
5085,
14,
7211,
2393,
14,
13091,
492,
8651,
316,
11251,
199,
504,
477,
17600,
492,
1101,
199,
504,
32212,
18,
492,
6912,
421,
199,
7211,
275,
8651,
316,
11251,
342,
199,
29031,
63,
45,
5622,
63,
8199,
15894,
63,
2632,
275,
1101,
360,
29031,
63,
45,
5622,
63,
8199,
15894,
63,
2632,
297,
849,
13275,
199,
199,
3,
16547,
931,
402,
314,
2199,
14,
437,
32212,
14,
2042,
909,
14,
199,
5441,
63,
3243,
275,
6912,
3460,
493,
28634,
6983,
1252,
8859,
59,
17,
61,
199,
5441,
275,
620,
8,
5441,
63,
3243,
9,
199,
6588,
2962,
275,
620,
8,
5441,
63,
3243,
1182,
283,
9053,
14,
647,
358,
421,
199,
318,
1240,
63,
1531,
8,
1531,
304,
272,
1104,
63,
1250,
360,
1548,
469,
16,
93,
469,
17,
5285,
908,
8,
6588,
2962,
12,
1414,
395,
5218,
29,
549,
9,
421,
199,
533,
18416,
63,
2423,
8,
785,
304,
272,
408,
14946,
367,
18416,
9643,
14,
17415,
2011,
1249,
465,
282,
1190,
5085,
14,
7211,
63,
2423,
1041,
339,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
291,
14,
589,
275,
1249,
267,
291,
14,
958,
275,
2074,
339,
347,
636,
1250,
721,
277,
12,
4325,
304,
267,
291,
14,
354,
275,
4325,
855,
354,
363,
267,
291,
14,
3058,
275,
4325,
267,
8732,
14,
525,
63,
2423,
8,
277,
14,
1065,
12,
1305,
29,
277,
14,
354,
12,
627,
277,
14,
589,
12,
1011,
277,
14,
958,
9,
267,
291,
14,
793,
360,
20341,
358,
267,
372,
291,
14,
1065,
339,
347,
1255,
8,
277,
304,
267,
291,
14,
793,
360,
15769,
358,
267,
862,
26,
288,
291,
14,
3058,
342,
267,
871,
2186,
465,
325,
26,
288,
291,
14,
793,
360,
2944,
8100,
1149,
26,
9499,
908,
8,
69,
430,
288,
746,
267,
587,
26,
288,
291,
14,
793,
360,
8669,
8792,
358,
339,
347,
943,
8,
277,
12,
1245,
304,
267,
1499,
275,
6730,
27922,
32425,
3906,
1052,
32,
2440,
26,
9499,
908,
8,
288,
2197,
14,
2083,
14,
10779,
1062,
291,
14,
354,
12,
288,
747,
14,
12959,
360,
1093,
1311,
63,
7121,
297,
283,
885,
63,
571,
659,
1245,
9,
267,
870,
8,
1328,
12,
570,
29,
1274,
14,
3083,
9,
421,
199,
318,
18249,
63,
68,
706,
8,
1593,
304,
272,
408,
48,
780,
1487,
350,
4688,
1159,
428,
78,
9414,
2410,
3906,
13659,
340,
2851,
365,
663,
1041,
339,
347,
485,
4073,
837,
267,
805,
342,
267,
340,
3265,
1554,
63,
45,
5622,
63,
8199,
15894,
63,
2632,
26,
288,
221,
10779,
275,
2197,
14,
2083,
14,
10779,
342,
288,
4886,
275,
791,
77,
356,
283,
2540,
1052,
641,
9499,
908,
8,
1593,
855,
354,
3108,
221,
10779,
14,
17070,
1012,
93,
288,
4145,
14,
362,
8,
29031,
63,
45,
5622,
63,
8199,
15894,
63,
2632,
12,
1862,
29,
4749,
9,
339,
485,
4073,
855,
354,
363,
275,
805,
855,
354,
363,
272,
372,
485,
4073,
421,
199,
318,
8732,
63,
4659,
63,
6920,
837,
272,
768,
19274,
63,
2423,
360,
4284,
297,
9395,
29,
1046,
9,
272,
768,
4073,
63,
68,
706,
272,
347,
1678,
63,
2558,
63,
5087,
837,
267,
1240,
63,
1531,
360,
873,
63,
2558,
63,
5087,
63,
1725,
1553,
4659,
30739,
24892,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
9395,
29,
1216,
9,
272,
347,
1678,
63,
18587,
7411,
22894,
837,
267,
1240,
63,
1531,
360,
873,
63,
18587,
7411,
22894,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
9395,
29,
1216,
9,
272,
347,
1678,
63,
4416,
63,
350,
5068,
6112,
837,
267,
1240,
63,
1531,
360,
873,
63,
4416,
63,
350,
5068,
6112,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
9395,
29,
21,
9,
272,
347,
519,
78,
4146,
837,
267,
327,
3879,
315,
282,
3873,
465,
519,
78,
4146,
1990,
440,
19829,
367,
1846,
13,
5720,
2112,
267,
1240,
63,
1531,
360,
11641,
4146,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
10857,
29,
22,
9,
272,
347,
1678,
63,
84,
18588,
837,
267,
1240,
63,
1531,
360,
14829,
1678,
63,
84,
18588,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
10857,
29,
17,
9,
272,
347,
284,
915,
63,
11522,
837,
267,
1240,
63,
1531,
360,
14829,
1678,
63,
2652,
63,
11522,
358,
267,
1240,
63,
1531,
360,
14829,
9058,
63,
2652,
63,
4368,
358,
339,
768,
19274,
63,
2423,
360,
4284,
297,
10857,
29,
17,
9,
272,
347,
1678,
63,
11486,
63,
11522,
837,
267,
1240,
63,
1531,
360,
873,
63,
11486,
63,
11522,
1553,
4659,
30739,
24892,
358,
421,
199,
318,
10286,
348,
63,
76,
709,
78,
63,
6920,
837,
272,
768,
19274,
63,
2423,
360,
4284,
297,
9395,
29,
709,
9,
272,
347,
1678,
63,
24763,
837,
267,
1240,
63,
1531,
360,
76,
709,
78,
63,
873,
358,
421,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
1249,
275,
984,
14,
3020,
59,
17,
2938,
272,
965,
63,
6920,
275,
756,
272,
340,
283,
697,
7,
315,
1249,
26,
267,
8732,
63,
4659,
63,
6920,
342,
267,
965,
63,
6920,
275,
715,
272,
340,
283,
76,
709,
78,
7,
315,
1249,
26,
267,
10286,
348,
63,
76,
709,
78,
63,
6920,
342,
267,
965,
63,
6920,
275,
715,
339,
340,
965,
63,
6920,
26,
267,
862,
26,
288,
8732,
14,
928,
342,
267,
871,
334,
31538,
12,
14838,
304,
288,
986,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
neiudemo1/django
|
tests/inspectdb/models.py
|
208
|
2737
|
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class People(models.Model):
name = models.CharField(max_length=255)
parent = models.ForeignKey('self', models.CASCADE)
class Message(models.Model):
from_field = models.ForeignKey(People, models.CASCADE, db_column='from_id')
class PeopleData(models.Model):
people_pk = models.ForeignKey(People, models.CASCADE, primary_key=True)
ssn = models.CharField(max_length=11)
class PeopleMoreData(models.Model):
people_unique = models.ForeignKey(People, models.CASCADE, unique=True)
license = models.CharField(max_length=255)
class DigitsInColumnName(models.Model):
all_digits = models.CharField(max_length=11, db_column='123')
leading_digit = models.CharField(max_length=11, db_column='4extra')
leading_digits = models.CharField(max_length=11, db_column='45extra')
class SpecialName(models.Model):
field = models.IntegerField(db_column='field')
# Underscores
field_field_0 = models.IntegerField(db_column='Field_')
field_field_1 = models.IntegerField(db_column='Field__')
field_field_2 = models.IntegerField(db_column='__field')
# Other chars
prc_x = models.IntegerField(db_column='prc(%) x')
non_ascii = models.IntegerField(db_column='tamaño')
class Meta:
db_table = "inspectdb_special.table name"
class ColumnTypes(models.Model):
id = models.AutoField(primary_key=True)
big_int_field = models.BigIntegerField()
bool_field = models.BooleanField(default=False)
null_bool_field = models.NullBooleanField()
char_field = models.CharField(max_length=10)
null_char_field = models.CharField(max_length=10, blank=True, null=True)
comma_separated_int_field = models.CommaSeparatedIntegerField(max_length=99)
date_field = models.DateField()
date_time_field = models.DateTimeField()
decimal_field = models.DecimalField(max_digits=6, decimal_places=1)
email_field = models.EmailField()
file_field = models.FileField(upload_to="unused")
file_path_field = models.FilePathField()
float_field = models.FloatField()
int_field = models.IntegerField()
gen_ip_adress_field = models.GenericIPAddressField(protocol="ipv4")
pos_int_field = models.PositiveIntegerField()
pos_small_int_field = models.PositiveSmallIntegerField()
slug_field = models.SlugField()
small_int_field = models.SmallIntegerField()
text_field = models.TextField()
time_field = models.TimeField()
url_field = models.URLField()
class UniqueTogether(models.Model):
field1 = models.IntegerField()
field2 = models.CharField(max_length=10)
class Meta:
unique_together = ('field1', 'field2')
|
bsd-3-clause
|
[
3,
1882,
2644,
26,
2774,
13,
24,
1882,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
504,
1639,
14,
697,
492,
1709,
421,
199,
533,
11379,
7939,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
2299,
9,
272,
1676,
275,
1709,
14,
3190,
360,
277,
297,
1709,
14,
10855,
9,
421,
199,
533,
6430,
8,
992,
14,
1685,
304,
272,
687,
63,
698,
275,
1709,
14,
3190,
8,
8070,
7939,
12,
1709,
14,
10855,
12,
1592,
63,
2301,
534,
504,
63,
344,
358,
421,
199,
533,
11379,
7939,
1451,
8,
992,
14,
1685,
304,
272,
13135,
63,
2051,
275,
1709,
14,
3190,
8,
8070,
7939,
12,
1709,
14,
10855,
12,
5062,
63,
498,
29,
549,
9,
272,
308,
5167,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
845,
9,
421,
199,
533,
11379,
7939,
11053,
1451,
8,
992,
14,
1685,
304,
272,
13135,
63,
3235,
275,
1709,
14,
3190,
8,
8070,
7939,
12,
1709,
14,
10855,
12,
3747,
29,
549,
9,
272,
4190,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
2299,
9,
421,
199,
533,
22442,
1405,
607,
4547,
985,
8,
992,
14,
1685,
304,
272,
1006,
63,
7022,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
845,
12,
1592,
63,
2301,
534,
4288,
358,
272,
9186,
63,
8573,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
845,
12,
1592,
63,
2301,
534,
20,
2911,
358,
272,
9186,
63,
7022,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
845,
12,
1592,
63,
2301,
534,
2322,
2911,
358,
421,
199,
533,
12568,
985,
8,
992,
14,
1685,
304,
272,
901,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
698,
358,
272,
327,
25010,
7107,
272,
901,
63,
698,
63,
16,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
792,
15452,
272,
901,
63,
698,
63,
17,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
792,
13766,
272,
901,
63,
698,
63,
18,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
363,
698,
358,
272,
327,
5439,
8365,
272,
299,
1195,
63,
88,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
80,
1195,
4042,
9,
671,
358,
272,
2222,
63,
4371,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
502,
391,
22692,
79,
358,
339,
1021,
6288,
26,
267,
1592,
63,
1224,
275,
298,
10955,
697,
63,
6664,
14,
1224,
536,
2,
421,
199,
533,
4996,
4100,
8,
992,
14,
1685,
304,
272,
1305,
275,
1709,
14,
4378,
8,
3327,
63,
498,
29,
549,
9,
272,
7282,
63,
442,
63,
698,
275,
1709,
14,
25175,
342,
272,
2155,
63,
698,
275,
1709,
14,
5036,
8,
885,
29,
797,
9,
272,
2973,
63,
2245,
63,
698,
275,
1709,
14,
29068,
342,
272,
1495,
63,
698,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
709,
9,
272,
2973,
63,
1560,
63,
698,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
709,
12,
4596,
29,
549,
12,
2973,
29,
549,
9,
272,
10029,
63,
12794,
63,
442,
63,
698,
275,
1709,
14,
25732,
20727,
3901,
8,
988,
63,
1267,
29,
1020,
9,
272,
1434,
63,
698,
275,
1709,
14,
14071,
342,
272,
1434,
63,
521,
63,
698,
275,
1709,
14,
4626,
342,
272,
6107,
63,
698,
275,
1709,
14,
15975,
8,
988,
63,
7022,
29,
22,
12,
6107,
63,
10696,
29,
17,
9,
272,
3031,
63,
698,
275,
1709,
14,
16577,
342,
272,
570,
63,
698,
275,
1709,
14,
23252,
8,
5064,
63,
475,
628,
8618,
531,
272,
570,
63,
515,
63,
698,
275,
1709,
14,
14225,
792,
342,
272,
2069,
63,
698,
275,
1709,
14,
13019,
342,
272,
1109,
63,
698,
275,
1709,
14,
3901,
342,
272,
3805,
63,
711,
63,
350,
753,
63,
698,
275,
1709,
14,
9417,
26969,
8,
3922,
628,
4774,
20,
531,
272,
2086,
63,
442,
63,
698,
275,
1709,
14,
8591,
342,
272,
2086,
63,
7241,
63,
442,
63,
698,
275,
1709,
14,
25197,
342,
272,
8889,
63,
698,
275,
1709,
14,
17315,
342,
272,
7425,
63,
442,
63,
698,
275,
1709,
14,
14640,
342,
272,
1318,
63,
698,
275,
1709,
14,
6254,
342,
272,
900,
63,
698,
275,
1709,
14,
27115,
342,
272,
1166,
63,
698,
275,
1709,
14,
17363,
342,
421,
199,
533,
18276,
1378,
4920,
8,
992,
14,
1685,
304,
272,
901,
17,
275,
1709,
14,
3901,
342,
272,
901,
18,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
709,
9,
339,
1021,
6288,
26,
267,
3747,
63,
6314,
275,
661,
698,
17,
297,
283,
698,
18,
358,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1882,
2644,
26,
2774,
13,
24,
1882,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
504,
1639,
14,
697,
492,
1709,
421,
199,
533,
11379,
7939,
8,
992,
14,
1685,
304,
272,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
2299,
9,
272,
1676,
275,
1709,
14,
3190,
360,
277,
297,
1709,
14,
10855,
9,
421,
199,
533,
6430,
8,
992,
14,
1685,
304,
272,
687,
63,
698,
275,
1709,
14,
3190,
8,
8070,
7939,
12,
1709,
14,
10855,
12,
1592,
63,
2301,
534,
504,
63,
344,
358,
421,
199,
533,
11379,
7939,
1451,
8,
992,
14,
1685,
304,
272,
13135,
63,
2051,
275,
1709,
14,
3190,
8,
8070,
7939,
12,
1709,
14,
10855,
12,
5062,
63,
498,
29,
549,
9,
272,
308,
5167,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
845,
9,
421,
199,
533,
11379,
7939,
11053,
1451,
8,
992,
14,
1685,
304,
272,
13135,
63,
3235,
275,
1709,
14,
3190,
8,
8070,
7939,
12,
1709,
14,
10855,
12,
3747,
29,
549,
9,
272,
4190,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
2299,
9,
421,
199,
533,
22442,
1405,
607,
4547,
985,
8,
992,
14,
1685,
304,
272,
1006,
63,
7022,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
845,
12,
1592,
63,
2301,
534,
4288,
358,
272,
9186,
63,
8573,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
845,
12,
1592,
63,
2301,
534,
20,
2911,
358,
272,
9186,
63,
7022,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
845,
12,
1592,
63,
2301,
534,
2322,
2911,
358,
421,
199,
533,
12568,
985,
8,
992,
14,
1685,
304,
272,
901,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
698,
358,
272,
327,
25010,
7107,
272,
901,
63,
698,
63,
16,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
792,
15452,
272,
901,
63,
698,
63,
17,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
792,
13766,
272,
901,
63,
698,
63,
18,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
363,
698,
358,
272,
327,
5439,
8365,
272,
299,
1195,
63,
88,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
80,
1195,
4042,
9,
671,
358,
272,
2222,
63,
4371,
275,
1709,
14,
3901,
8,
697,
63,
2301,
534,
502,
391,
22692,
79,
358,
339,
1021,
6288,
26,
267,
1592,
63,
1224,
275,
298,
10955,
697,
63,
6664,
14,
1224,
536,
2,
421,
199,
533,
4996,
4100,
8,
992,
14,
1685,
304,
272,
1305,
275,
1709,
14,
4378,
8,
3327,
63,
498,
29,
549,
9,
272,
7282,
63,
442,
63,
698,
275,
1709,
14,
25175,
342,
272,
2155,
63,
698,
275,
1709,
14,
5036,
8,
885,
29,
797,
9,
272,
2973,
63,
2245,
63,
698,
275,
1709,
14,
29068,
342,
272,
1495,
63,
698,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
709,
9,
272,
2973,
63,
1560,
63,
698,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
709,
12,
4596,
29,
549,
12,
2973,
29,
549,
9,
272,
10029,
63,
12794,
63,
442,
63,
698,
275,
1709,
14,
25732,
20727,
3901,
8,
988,
63,
1267,
29,
1020,
9,
272,
1434,
63,
698,
275,
1709,
14,
14071,
342,
272,
1434,
63,
521,
63,
698,
275,
1709,
14,
4626,
342,
272,
6107,
63,
698,
275,
1709,
14,
15975,
8,
988,
63,
7022,
29,
22,
12,
6107,
63,
10696,
29,
17,
9,
272,
3031,
63,
698,
275,
1709,
14,
16577,
342,
272,
570,
63,
698,
275,
1709,
14,
23252,
8,
5064,
63,
475,
628,
8618,
531,
272,
570,
63,
515,
63,
698,
275,
1709,
14,
14225,
792,
342,
272,
2069,
63,
698,
275,
1709,
14,
13019,
342,
272,
1109,
63,
698,
275,
1709,
14,
3901,
342,
272,
3805,
63,
711,
63,
350,
753,
63,
698,
275,
1709,
14,
9417,
26969,
8,
3922,
628,
4774,
20,
531,
272,
2086,
63,
442,
63,
698,
275,
1709,
14,
8591,
342,
272,
2086,
63,
7241,
63,
442,
63,
698,
275,
1709,
14,
25197,
342,
272,
8889,
63,
698,
275,
1709,
14,
17315,
342,
272,
7425,
63,
442,
63,
698,
275,
1709,
14,
14640,
342,
272,
1318,
63,
698,
275,
1709,
14,
6254,
342,
272,
900,
63,
698,
275,
1709,
14,
27115,
342,
272,
1166,
63,
698,
275,
1709,
14,
17363,
342,
421,
199,
533,
18276,
1378,
4920,
8,
992,
14,
1685,
304,
272,
901,
17,
275,
1709,
14,
3901,
342,
272,
901,
18,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
709,
9,
339,
1021,
6288,
26,
267,
3747,
63,
6314,
275,
661,
698,
17,
297,
283,
698,
18,
358,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
dbertha/odoo
|
addons/decimal_precision/__init__.py
|
450
|
1128
|
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#import decimal_precision
from decimal_precision import get_precision
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
agpl-3.0
|
[
3,
1882,
2644,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
258,
199,
3,
259,
7653,
12,
3232,
5800,
8259,
9274,
199,
3,
259,
1898,
334,
35,
9,
8353,
13,
8664,
11947,
12361,
8642,
1014,
921,
9864,
14,
1235,
10121,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
420,
199,
3,
199,
4605,
199,
199,
3,
646,
6107,
63,
6833,
199,
504,
6107,
63,
6833,
492,
664,
63,
6833,
421,
199,
3,
6695,
26,
10379,
26,
10558,
26,
6492,
29,
20,
26,
10503,
29,
20,
26,
10425,
29,
20,
26,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1882,
2644,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
258,
199,
3,
259,
7653,
12,
3232,
5800,
8259,
9274,
199,
3,
259,
1898,
334,
35,
9,
8353,
13,
8664,
11947,
12361,
8642,
1014,
921,
9864,
14,
1235,
10121,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
420,
199,
3,
199,
4605,
199,
199,
3,
646,
6107,
63,
6833,
199,
504,
6107,
63,
6833,
492,
664,
63,
6833,
421,
199,
3,
6695,
26,
10379,
26,
10558,
26,
6492,
29,
20,
26,
10503,
29,
20,
26,
10425,
29,
20,
26,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
mateoqac/unqTip
|
gui/views/boardPrint/resources.py
|
4
|
554087
|
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Thu Mar 13 17:14:29 2014
# by: The Resource Compiler for PyQt (Qt v4.8.1)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x02\x18\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x45\x00\x00\x00\x45\x08\x06\x00\x00\x00\x1c\x8d\x2b\x29\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0c\x09\x02\x01\x33\x7f\xc3\x83\xe3\x00\x00\x01\xa5\x49\x44\
\x41\x54\x78\xda\xed\xdc\x3f\x6b\x93\x51\x14\xc7\xf1\xef\x79\x9e\
\x34\x6a\xac\x28\x31\x50\xdb\xf8\x87\x8a\x62\x6b\x8a\x83\x0e\x52\
\x28\x05\x07\x17\x71\x11\x97\xe2\xea\xe0\x6b\x10\x5f\x80\x6f\x23\
\xa3\xa3\xe0\x4b\x90\xa0\xd2\xa1\x6f\x40\x11\xb4\x8d\x01\x87\xda\
\x82\x90\x82\xe9\x71\x30\x91\x16\x8b\xb8\x9a\x7c\x7f\xcb\xbd\xdc\
\xf1\x03\x87\x73\xee\x70\x6f\x64\xe6\x3e\x10\x98\x51\xda\x85\x06\
\x7f\xa6\x32\xda\xf4\xba\xeb\x7c\xdb\x7e\x3f\xb1\x10\x97\xe6\xef\
\x72\xa2\xd6\x38\x8c\xb2\xb3\xfd\x81\xee\xe7\xce\xc4\xa2\xcc\x36\
\x6f\xff\x46\xb1\x7c\x8e\x88\x28\xa2\x88\x22\x8a\x28\xa2\x88\x22\
\x8a\x28\xa2\x88\x22\x8a\x28\xa2\x18\x51\x44\x11\x45\x14\x51\x44\
\x11\x45\x14\x51\x44\x11\x45\x14\x51\x44\x31\xa2\x88\x22\x8a\x28\
\xa2\x88\x22\x8a\x28\xa2\x88\x22\x8a\x28\xa2\x18\x51\x44\x11\x45\
\x14\x51\x44\x11\x45\x14\x51\xfe\x47\x94\x3e\x40\x51\x54\xd4\x38\
\x80\xd2\x05\xa8\x1e\x3f\xa3\xc6\x01\x94\x1e\x40\x6d\xf8\xd2\xd2\
\xfc\x42\x79\x0d\x50\x6f\x5c\xa7\x28\xa7\x14\x19\xa2\xbc\x02\x28\
\xcb\x2a\x67\x1b\x2d\x45\x86\x28\x6f\x81\x8f\x00\xf3\x57\xee\x11\
\xe1\xb7\x07\x45\x44\xec\x03\xcf\x00\xa6\x4f\xcd\xd1\xbc\xb8\x2a\
\xca\x70\x7d\x01\xbc\x03\xb8\xba\xf0\x90\x7a\x63\x51\x94\x88\x48\
\xe0\x01\xb0\x19\x51\x70\xe3\xe6\x13\x66\xcf\x2f\x3b\xd1\x46\xc4\
\x17\x60\x0d\xf8\x5e\x14\x15\x16\x97\x1e\x71\xad\xb5\xc6\x54\x75\
\x7a\xe2\x50\x0e\x8d\xb1\x11\xd1\xc9\xcc\x65\xe0\x25\xc4\xe5\xe6\
\x85\x15\x66\xce\xdd\x62\x6b\xb3\xc3\xd7\xde\x06\xbb\x3b\x9f\x80\
\x1c\x7b\x94\x23\x5b\x4d\x66\xd6\x81\xe7\xc0\x63\xa0\x1c\x9d\x0f\
\x7e\xf4\xd9\xdb\xdb\x65\x30\xe8\x8f\x1d\x44\xed\xe4\x0c\x65\x79\
\x0c\xa0\xfd\xd7\xfe\x9b\x99\x2d\xe0\x29\x70\x1f\x38\x3d\x21\xd5\
\xd3\xfe\xa7\xa1\x24\x33\xab\xc0\x1d\x60\x01\x98\x03\xc6\xf9\xa2\
\xf4\xe6\x27\x61\x38\x49\x56\xd7\xb7\xa2\x61\x00\x00\x00\x00\x49\
\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x0c\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x45\x00\x00\x00\x45\x08\x06\x00\x00\x00\x1c\x8d\x2b\x29\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0c\x09\x02\x00\x31\x88\xd6\xd3\x8e\x00\x00\x01\x99\x49\x44\
\x41\x54\x78\xda\xed\xdc\x5f\x2b\x43\x71\x1c\xc7\xf1\xf7\xd9\x16\
\x33\x94\x29\xad\x56\x4a\x4a\xc9\xb3\x70\xe7\x62\x49\xb9\xf3\x10\
\xe4\xd6\x95\x42\x1e\x85\x3f\x89\xc7\xc1\x03\xa0\x84\x26\x6e\xa4\
\x95\x95\xfc\x59\xf6\xc7\xb6\x73\xf6\x47\xfb\xba\xd8\xa1\x45\xe3\
\xda\xce\xe7\x7d\x73\xea\x5c\xbe\xfa\x5c\x7c\xaf\x7e\x0e\x7f\x64\
\x66\x71\x20\x05\x2c\x00\xd3\x40\x12\x18\xa1\x77\x3b\x8c\xfc\x82\
\x31\x0a\xac\x01\x2b\x40\x1f\x01\x2a\xd2\x05\x64\x11\xd8\x03\xe2\
\x9f\xff\xdc\xea\x0b\xc5\xc2\x1d\x35\x2f\x4f\xcd\xcb\xd3\x6a\x35\
\x7b\x0a\x62\x72\x2a\x45\x6c\x30\xf1\x13\xc5\xcc\x1c\x7f\x1d\x5b\
\x80\x63\x66\x3c\x3d\x9c\x72\x9f\x39\xc2\x75\x73\x3d\xbd\x8e\xf1\
\x89\xd9\xae\x4b\x59\x07\x36\x01\x3c\xef\x95\xeb\xcb\x7d\xca\x6f\
\x59\x82\x56\xa4\x63\x25\x4b\xc0\x06\x40\xa9\x98\xe1\xea\x62\x97\
\x66\xa3\x42\x10\x8b\xf8\x20\x09\x60\x07\x70\x5c\x37\x47\xfa\x7c\
\x9b\xf7\xa6\x4b\x50\x0b\xf9\xdf\x55\x60\xc8\xcc\xb8\x49\x1f\x04\
\x1a\x04\x20\x64\x66\xc3\xc0\x32\xc0\xf3\xe3\x19\xe5\x52\x96\xa0\
\x17\x02\xe6\x80\x01\x80\xfb\xcc\x31\xaa\x8d\x32\x0f\xe0\xba\x39\
\xaa\x95\x47\x89\xf8\x28\x33\x00\xc5\xd7\x5b\x69\x74\xa0\x24\x01\
\xea\xf5\xa2\x34\x3a\x50\xc6\x00\x1a\x01\xbd\x49\xba\xa1\x84\xfc\
\xeb\x4d\x1a\xdf\xee\x14\x25\x14\xa1\x08\x45\x28\x42\x11\x8a\x50\
\x84\x22\x14\xa1\x08\x45\x28\x42\x51\x42\x11\x8a\x50\x84\x22\x14\
\xa1\x08\x45\x28\x42\x11\x8a\x50\x84\x22\x14\xa1\x28\xa1\x08\x45\
\x28\x42\x11\x8a\x50\x84\x22\x14\xa1\x08\x45\x28\x42\x11\x8a\x50\
\x94\x50\x84\x22\x14\xa1\x08\x45\x28\x42\x11\x8a\x50\xfe\x71\x8e\
\x99\xb5\x00\xa7\x56\x2b\xd0\x6c\x94\x03\x0b\x11\x1b\x4c\x10\x0e\
\xf7\x43\xe7\x4b\x3b\xd1\x68\x9c\x68\x34\xae\x99\xd0\x7e\x15\x63\
\x17\x70\x44\xf1\xd5\xc9\x07\x7f\xc1\x7d\x28\x70\x91\x0b\x30\x00\
\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x5f\x4d\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\xc8\x00\x00\x00\xc8\x08\x06\x00\x00\x00\xad\x58\xae\x9e\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0e\xc4\x00\x00\x0e\xc4\
\x01\x95\x2b\x0e\x1b\x00\x00\x20\x00\x49\x44\x41\x54\x78\x9c\xec\
\xbd\x79\xbc\x5d\x47\x75\x26\xfa\xad\xbd\xcf\x1d\x24\x59\xb2\x64\
\xc9\x36\xc6\xd8\xe0\x60\x06\x33\xd8\x66\x48\x42\x48\x27\x74\x92\
\xce\x40\x77\x87\x47\x92\xce\x44\xe8\x00\x69\x5e\xf2\x32\xfc\xba\
\x3b\xaf\x43\x93\x17\xd2\x01\x67\x22\x09\x74\x82\xe1\x25\x81\x34\
\x69\xc8\xf0\x02\x0f\x78\xa4\x21\x4d\x5e\x08\x10\x12\x68\xd2\x26\
\xc1\xe0\xd9\xd8\x18\x0f\xb2\x6c\x49\xd6\xac\xab\x2b\xdd\x7b\xce\
\xde\xb5\xfa\x8f\x5d\xc3\x5a\xab\x6a\x9f\x73\xee\xd5\xbd\xd2\x95\
\xed\xd2\x6f\xeb\xd4\xae\xaa\x5d\x55\xbb\x6a\x7d\xf5\xad\xb5\xaa\
\xce\xb9\x84\xc7\xc3\xba\x84\x3d\xc7\x78\xe7\xc2\x10\x57\x34\xae\
\x79\x32\x88\x9e\xc4\x8e\x9f\x08\xe0\x62\xc7\x7c\x21\x40\x3b\x40\
\x38\x9f\x19\x5b\x01\x6c\x62\xe6\x59\x00\x03\x06\x08\x00\x08\x60\
\x00\x0d\x88\x86\x04\x9c\x02\xb0\x00\xe0\x18\x11\x1f\xae\x40\x07\
\x00\xec\x67\xf0\xde\x8a\xe8\xc1\x41\x35\x78\x80\x97\x8f\xdf\xff\
\xac\x27\x9d\x7f\xe8\xac\xbd\xec\xa3\x38\xd0\xd9\xee\xc0\xb9\x1e\
\x76\x1f\xe5\x0b\x8e\x8f\x9a\x6b\xd1\xf2\x35\x4c\xf4\x9c\xd6\xe1\
\x59\x00\x3f\xbd\x65\xec\x60\x26\x62\x30\x98\x3b\x89\x97\x9f\x40\
\x17\x87\x8c\x9b\x40\x22\x12\xe2\xe4\xe3\xe6\x93\xeb\x8a\x0e\x83\
\x71\x77\x55\xe1\x0e\x80\x6f\x9b\xad\x67\x6e\x1a\xcd\xe0\xe6\xab\
\xb7\xd3\x91\xf5\x7a\xf7\xc7\x42\x78\x1c\x20\x2b\x08\xcc\x5c\x7d\
\xf5\x30\x9e\xb5\xec\xda\x6f\x72\x8e\x5f\xec\x1c\xbf\xc8\x31\xbe\
\xc6\x81\x2a\xc7\x0c\xc7\x9d\xf0\x87\xcf\x00\x06\x17\xe2\x5d\x1d\
\x5d\x5d\x58\x39\x40\xc8\xdf\x90\xb8\xaf\x48\x83\x25\xdc\x57\xdd\
\xd5\x56\x44\x5f\xad\xc0\x9f\x27\xc2\xdf\xd7\xcc\x9f\xfd\xc0\x3b\
\x67\xef\xbc\xee\x3a\x72\xeb\x34\x44\x8f\xba\xf0\x38\x40\x26\x84\
\x07\x17\xf9\x49\x0b\x8b\xc3\xef\x72\x5c\x7d\xbb\x03\xfe\x69\xeb\
\x70\x51\xeb\x3a\x30\xc8\x2b\x00\xc1\xa1\x03\x81\x2b\xb0\x86\xfc\
\x04\x6b\x50\x48\xb0\x00\x50\xac\xe1\x6f\x13\x50\x7a\x3e\x3b\x70\
\x10\x2a\x64\x40\xf1\x17\xa1\xae\xb0\xbf\x26\x7c\x1a\x95\xfb\xc4\
\x5c\xd5\x7c\xfc\x19\xbb\xb6\x3c\xb4\x5e\x63\xf7\x68\x08\x8f\x03\
\xa4\x10\xee\xda\xbf\x7c\x6d\x53\x55\xdf\xe3\x18\x2f\x6b\x5b\xbe\
\xba\xe5\x8e\x21\x5a\x87\x0c\x18\xad\x64\x0e\x18\x06\x61\x80\x91\
\x83\x05\x26\x0e\x4c\x60\x10\x24\x20\xc8\x78\x04\x45\x60\x15\xc9\
\x20\x48\xf7\x35\x91\x01\x0a\x50\x57\x40\x4d\x70\x15\xd1\x4d\x15\
\xf1\x47\x67\x66\x67\x3e\x7c\xd5\x05\x74\xeb\x5a\x8f\xe5\xb9\x1e\
\x1e\x07\x88\x0f\x77\x1d\x5c\xba\xaa\xe5\xfa\x15\xce\xe1\x07\x1b\
\x87\xa7\xb5\x0c\x04\xa6\x08\xc0\x68\x05\x20\x72\xf6\x48\xe9\x0c\
\x68\x50\x8c\x61\x0f\x16\xc8\x30\x04\x92\xe2\x02\x18\x45\x16\x51\
\x60\xd1\x8c\x91\xb3\x48\x07\x98\x5a\x00\xa5\xfb\x24\xd4\x15\xee\
\xaa\xa9\x7a\xff\xa0\x1a\xbd\xef\xaa\x0b\xe7\xef\x5a\x8f\x71\x3e\
\xd7\xc2\x63\x1a\x20\xf7\x1d\xe1\xed\x23\x6e\x7f\x78\xd4\xf0\x6b\
\x1a\xc7\x2f\x6c\x1d\x51\xeb\x99\xa2\x75\x01\x10\x02\x14\x3e\xad\
\x8b\x33\x1c\x72\x46\x91\x80\xb0\xb6\x48\xb2\x43\x04\x40\x60\x23\
\x22\x90\xfa\xd0\xc0\x00\x72\xdb\x03\x50\x4c\xa2\x2e\x00\x55\x45\
\x1e\x20\x40\x55\x69\xb0\xd4\x81\x55\x3a\x66\xe1\x41\x4d\x9f\xaf\
\x2a\x7a\xcf\x2c\xd5\xef\x7f\xfa\x2e\x3a\xbe\xf6\xa3\x7f\x6e\x84\
\xc7\x24\x40\xee\x39\x3a\x7c\x41\x33\xa2\x9f\x6a\x18\x3f\xd8\xb4\
\xd8\xd2\x38\xee\x80\x20\x80\xd1\x30\x27\x40\xb8\x04\x92\x00\x90\
\x56\xda\x1d\x4e\xab\x57\x9a\x45\x58\x81\x06\xc8\xe3\x93\x82\x55\
\xad\x64\x9c\xbc\x8a\x25\x55\x2b\x15\xaf\xd2\x7d\x64\x0d\xa9\x7a\
\x55\x09\x30\x83\x00\x96\x04\x14\xd4\x15\x4e\x0c\x2a\x7a\xdf\xec\
\xec\xe0\xf7\x9e\xb1\x83\x6e\x5a\xbb\x59\x38\x37\xc2\x63\x06\x20\
\x1f\x60\xae\xaf\x3d\xd4\xbc\xbc\x61\xfc\x6c\xd3\xf2\x8b\x5b\x26\
\x6a\x1c\xa3\x71\x09\x18\x0d\x27\xa0\x04\x50\xc4\x7b\x96\xec\x21\
\x58\x03\x21\x6e\xbc\x58\x30\x4c\x12\xef\x59\xab\x58\xf1\xbf\x1e\
\x15\x8b\x34\x83\x40\xda\x1c\x30\xcc\x01\x01\x0e\xaf\x62\x55\x02\
\x34\x95\x62\x0e\x44\x70\xd4\x12\x2c\x3e\x6d\xd0\x19\xf4\xa8\x2b\
\x60\x10\x58\xa5\xa2\xcf\xd6\xc0\xef\x3c\xeb\xe2\xc1\x47\x89\x1e\
\x1b\x9e\xb0\x47\x3d\x40\x98\x79\xf6\x9e\xc3\xed\xab\x1a\xc7\xaf\
\x1b\xb5\x78\x5a\xe3\x80\xc6\x75\x6a\x54\xe3\x41\xd0\x04\x75\xca\
\x75\x76\x47\xc7\x20\x09\x18\x52\xb5\x4a\x9f\xac\x18\x43\xd9\x23\
\xe0\x22\x50\x20\xee\xfd\x6d\xe6\xcd\xb2\x41\xda\x1d\x40\x02\x82\
\xb5\x45\x12\x6b\x94\xed\x0e\x12\xc6\xba\x62\x92\x68\x83\x00\x83\
\xa8\x6a\x51\x02\x4a\xd5\x3d\x37\x88\x60\x21\x0c\x2a\xbe\xab\xae\
\xf8\xb7\x9e\x75\xe1\xec\x9f\x10\xd1\x68\x3d\xe6\x6d\xa3\x84\x47\
\x2d\x40\x98\x79\xf6\x2b\x47\xda\x7f\xd3\xb6\xf8\xf9\x51\xcb\x97\
\x07\x60\x04\xc6\x68\x1c\x47\x10\x34\x25\x60\x28\x1b\x44\xab\x59\
\xf9\xc5\xda\x06\x81\xb5\x3f\x38\xb3\x43\xfa\x58\x44\x85\x22\x7b\
\x58\xfb\x83\x8a\x76\x88\x34\xd4\x33\x7b\xc4\xa8\x57\xb5\x00\x8b\
\x05\xca\x40\xa4\x0d\x3c\x70\x06\x09\x28\x0f\xcc\xd4\xd5\xaf\x2f\
\xee\xaa\xdf\xf3\xc2\x47\x29\x50\x1e\x75\x00\xf9\xc0\x07\xb8\x7e\
\xe1\x3f\x6b\x5f\x39\x6c\xf9\x4d\x23\x87\xa7\x8c\xda\x04\x8c\xa6\
\x07\x18\x9a\x41\x04\x30\xa4\xed\xa1\xd4\xac\x31\x9e\x2c\x24\x43\
\xbd\x9f\x41\xf8\x34\x8c\x74\xca\x19\x84\x92\x5b\x37\xd9\x21\x65\
\x26\xa9\x4a\x1e\x2c\x4a\x8c\xa1\x6c\x90\x00\x96\x02\x50\x06\x02\
\x28\x33\x35\xdf\x3b\xa8\xaa\x5f\x7a\xe6\xae\xfa\x7d\x8f\x36\xd5\
\xeb\x51\x05\x90\x7b\x8f\x8e\xbe\x63\xd4\xe0\x2d\xa3\x16\x57\x8f\
\x02\x18\xda\x0e\x08\x23\x09\x8c\xb6\x8b\x4b\xfb\xa3\x0d\xf7\x9c\
\xd8\x24\x81\x82\x8b\xf6\x47\x6b\xec\x8e\xc4\x1a\xf9\xde\x87\x0b\
\x6a\x55\x0f\x8b\x8c\x0b\x25\xf6\x00\x7a\xec\x0f\x69\xb0\x17\xd4\
\x2b\x6b\x87\x44\xb5\xab\x12\xea\x55\x54\xad\xa0\xec\x90\x01\x11\
\x06\x75\x02\xca\x4c\x00\x4a\x1d\x41\xf3\xa5\x4d\xb3\x83\x9f\xbb\
\x72\x07\xfd\xcd\xda\xce\xec\xd9\x0b\x8f\x0a\x80\xec\x3e\xca\x57\
\x2e\x37\xed\xef\x0c\x1d\xff\x8b\xc6\x81\x46\x2d\x63\xe4\xe0\xc1\
\xc1\x18\x15\x80\xa1\x8d\xf3\x64\x97\x24\xf6\x48\xa0\x48\x1b\x84\
\x7e\xb3\x10\x1a\x28\x61\xe7\x3c\x18\xec\x72\xd3\xd0\xaa\x57\x90\
\x00\x11\xf7\x7d\x81\xe2\x7f\x09\x20\xf9\x5e\x08\x65\x9b\x83\xc9\
\x9b\x55\x06\x46\x45\xda\xe5\x5b\x62\x91\x41\x45\x9e\x41\x04\x48\
\x02\x8b\xd4\x94\xe2\x15\x61\xa6\x8e\xf9\x3c\x5b\x57\x1f\xa9\xdd\
\xe8\x3f\x3c\xe3\x09\x9b\xee\x5d\xe3\xa9\x3e\xe3\xe1\x9c\x06\xc8\
\x7d\xcc\xf3\xee\xa8\xfb\x85\x61\xe3\x5e\xd7\x38\xcc\x8f\x5a\xcf\
\x14\x2d\x30\x0a\xac\x21\x55\x2b\x01\x8c\x18\x67\xe1\xc9\x32\xec\
\xd1\x4a\x50\x08\x03\xbd\x6f\x0f\xc4\xb1\x76\xe9\xf6\x1e\x37\x01\
\xd6\xd0\x06\xd1\x46\x7a\xb2\x41\x0a\xb6\x07\xcc\x5e\x48\x54\xb3\
\x84\x7b\x57\xb0\x48\xf4\x60\x79\xa0\x0c\x2c\x50\x84\xaa\x35\x53\
\x11\x66\x3c\x9b\xcc\x54\x84\x41\xcd\xa7\x06\x84\xdf\x18\x5c\x38\
\xf3\x9b\x4f\x27\x5a\x5e\x1f\x09\x58\xff\x70\xce\x02\xe4\xc1\x23\
\xfc\x2d\xa7\x5c\xf3\xae\x51\x8b\xa7\x05\x60\x8c\x84\x3a\x25\x19\
\xa4\x4b\xd3\xc0\x68\x58\x78\xb2\xc4\xbd\xe3\x64\x7b\x44\x90\x38\
\x0f\x14\x36\x40\xb1\x9e\x2c\x98\xa3\x26\x28\xef\xa4\x97\x80\x31\
\xc6\x04\xc9\x80\x92\x01\xa4\x60\x9c\x07\xd0\x24\x75\xab\xe0\xc1\
\x92\x86\xba\x60\x91\x2a\xaa\x58\x24\x40\xe2\x55\x2c\x05\x10\x01\
\x94\x1a\x98\xa9\x92\xda\x35\xe3\x81\x32\x53\xe3\xcb\x03\xf0\x4f\
\x3c\xe3\xa2\xd9\xcf\xac\xbd\x14\xac\x7f\x38\xe7\x00\x72\x80\x79\
\xeb\xf1\x23\xee\x2d\xa3\xd6\xfd\xef\x43\x87\x6a\xd4\x02\xa3\xd6\
\x83\x20\xa8\x56\x82\x3d\x46\x0e\x68\x03\x70\x84\x2a\x95\xd8\x24\
\x31\x46\xdc\x30\xf4\xa0\x50\x6a\x56\x4c\x4f\xa0\x68\x91\x1f\x56\
\x2c\xef\x83\x70\xa6\x5e\x95\x8e\xbc\x17\x83\x04\x87\x60\x10\x44\
\x10\x50\x91\x49\xac\x1d\x52\x43\x00\xa6\x4a\xbb\xe7\xd1\x16\xa9\
\xb4\x57\x2b\x78\xac\x94\xba\x25\x5c\xbd\x33\x01\x44\x1e\x18\x81\
\x45\x06\x35\x30\x43\xc0\x4c\x1d\x80\x42\x98\xa9\xd8\xcd\x0c\xea\
\xdf\xdf\xbe\xb3\x7a\xfd\x25\x44\x8b\x6b\x2d\x13\xeb\x19\xce\x29\
\x80\xec\x3e\xcc\x2f\x59\xe6\xf6\x3d\xa3\x96\xaf\x18\x0a\xd6\x88\
\x0c\xe2\x59\x43\xab\x56\x40\x34\xd8\x85\xba\x15\x6c\x8f\xb0\xf7\
\xa1\xdd\xbb\x1c\x8d\xf6\xa0\x52\xe5\xec\x51\x3a\xc9\xcb\x1a\x28\
\x28\xef\x81\x04\x1f\x96\x02\x49\x4f\x90\xe0\xe8\xee\xd3\x26\xa1\
\xb4\x45\xa4\xfd\x11\xf6\x43\xca\x27\x7a\xed\x3e\x88\x51\xaf\xc4\
\x86\x61\xf0\x60\xa5\x78\xc1\x83\x65\xd8\xa4\x53\xb3\x28\xb2\xc9\
\x4c\xad\xd8\xe4\xab\x73\xf5\xe0\x55\x57\xee\xa4\xcf\xad\xb9\x70\
\xac\x53\x38\x27\x00\xf2\x05\xe6\x99\x0b\x8e\xba\x5f\x1e\xb5\xee\
\x75\xa3\x16\xb5\x06\x07\x7b\x7b\x43\x33\x48\xb0\x43\x1a\x03\x96\
\x86\xf5\x5e\x48\xf2\x62\x09\xd0\x70\xf9\xa0\xa2\xf4\x62\x75\xec\
\xc1\x65\x06\x81\x37\xce\xfb\x6c\x90\x02\x30\x4a\x47\x4e\x48\xcc\
\x4e\xc6\x22\xa5\x4f\x7f\xd4\xbd\xc4\x20\x15\x51\x62\x91\x0a\x05\
\x3b\x44\x78\xb0\x8c\xca\x15\x80\xa1\xbc\x59\xc6\x0e\x09\xf6\x47\
\x88\xcf\x44\x90\xf8\xb8\x07\xc9\x6c\x8d\x66\x50\xe1\x37\xf6\xee\
\x1a\x5c\xf7\x2d\x44\xcd\xda\x4a\xca\xda\x87\x0d\x0f\x90\xbd\x47\
\xf8\x29\x8b\xae\x79\x7f\xe3\xf0\xf5\xc3\x16\x18\x06\x40\xb4\xc0\
\x30\x18\xe4\x02\x24\xc9\x40\x2f\xec\x7f\x18\x06\x91\xb6\x87\x64\
\x93\xa8\x52\x09\x1b\x44\xda\x1d\x92\x45\xe4\x49\xde\x60\x98\x67\
\x36\x88\xf8\x84\x8d\x23\x45\x24\x46\x7a\xed\x0f\xd2\x71\xfb\x99\
\xdb\x20\x7a\x3f\xa4\xec\xc1\x4a\x0c\x12\x81\x22\x59\xc3\x00\xa5\
\xcf\x48\x97\x40\x91\xe0\x18\xd4\xc0\x6c\x60\x93\x0a\x98\xed\xd2\
\x3e\x37\x53\x0d\x7e\xf8\x69\x3b\xe9\xc1\xb5\x97\x9a\xb5\x0b\x1b\
\x1a\x20\x0f\x1c\x1e\x7d\xf7\x88\xf1\xde\xa1\xc3\x05\xc3\xa6\x63\
\x8d\xa1\x07\xc4\x30\x80\x21\xc4\x15\x38\x92\xfd\xd1\xb4\x85\x4d\
\xc2\xd6\x18\xe9\xc2\x20\x0f\x60\xd1\xc7\x4b\x4a\xdf\x05\x29\x6f\
\x16\x06\x90\xf4\x79\xb2\xe0\x55\x2c\xa9\x76\x4d\x0a\x4a\x9d\xf2\
\x91\xcc\xee\xc0\xb8\xdd\xf4\xf2\xae\x7a\x60\x09\x09\x96\x81\x00\
\x4b\x2d\x3c\x58\x11\x28\x75\x61\xb3\xb0\x26\x65\x87\x94\x40\x12\
\xc0\x31\x53\x13\x66\x13\x9b\x1c\x9c\xa9\xf1\xaf\x9f\xb6\x73\xe6\
\xaf\xd6\x41\x7c\xd6\x24\x6c\x48\x80\x30\x73\xb5\xfb\xa8\x7b\xd3\
\x72\xeb\xde\x30\x72\xa8\x22\x73\x18\x06\x91\xe0\x18\x49\x70\xc8\
\xcd\xc1\xcc\xc5\xeb\xe3\xd2\xfe\x70\x9a\x31\xd2\x7e\x08\x97\xd9\
\x43\xee\x81\xa0\x74\x16\x2b\xdf\x03\x49\xef\x06\x4c\x07\x8b\xbe\
\x40\x5a\xf5\x8a\x80\x28\xec\x85\x64\x6c\x92\x18\xa3\xb8\x0f\x62\
\xc1\x11\x0c\xf1\xcc\xd5\x5b\x52\xb1\x92\xf7\x2a\xd8\x26\x61\x6f\
\x64\xd6\x80\x64\xd6\xc7\x67\x3b\xb0\xb4\x75\xc5\xd7\x3d\x63\xe7\
\xcc\xaf\x12\xd1\xe9\x0c\xcc\xba\x84\x0d\x07\x90\x03\x07\x78\xeb\
\xe2\xa0\xfd\xd3\x61\xcb\x2f\xeb\x80\x21\xc0\xe1\x4a\x20\x49\xc0\
\x18\x65\xc0\xf0\x1b\x85\x2e\xb1\x86\xf2\x5e\x39\xa8\x1d\x75\xc7\
\x89\x59\x8a\xc7\xdc\x33\x16\x81\x3a\xcd\x1b\x5c\xba\x00\xe2\x77\
\xcf\xbb\x9b\xf0\x31\x85\x55\x3e\x29\x08\x63\x5d\xde\x4b\xe0\xa4\
\xef\x84\x14\x4e\xf3\x66\x40\x31\xe7\xb2\x3c\x53\x04\x86\x09\x9b\
\x81\xb5\x05\x86\xdf\x55\xef\x55\xb5\xea\xc4\x26\xc9\x50\x17\xe0\
\xa8\x14\x48\x78\x66\x40\x1f\xde\x36\xac\x5f\x75\xc9\x25\x1b\xcb\
\xcb\xb5\xa1\x00\xf2\xf0\x61\x7e\xf2\x90\xda\x8f\x2e\xb7\x7c\x75\
\x00\xc6\xb0\x05\x86\x4d\x02\x47\x60\x8d\x00\x86\xa1\xf0\x5a\x29\
\x37\x6f\xd8\x35\x2f\x9c\xc5\x0a\x1e\x2a\xb5\x41\x68\xbf\x28\x55\
\xdc\x49\xd7\x6c\xe2\x4a\x80\x90\x60\x50\xcc\x61\x50\x51\x04\x49\
\xd1\x0a\xe9\x4d\x22\x63\xc5\x5b\xd0\x84\x7c\x7b\xfc\xbd\x26\xad\
\x66\x49\x75\x4b\x7f\x1f\x44\x6f\x18\x86\xe3\x27\x99\x1d\xe2\xd5\
\xae\xe8\xda\xad\x64\xbc\x53\xa9\x02\x68\x24\x9b\xcc\x55\x84\x99\
\x01\x30\xeb\x81\x32\x53\xe1\x4b\x15\x0d\x5f\xf6\xf4\x5d\x5b\xf6\
\xf4\xc9\xc8\x99\x0e\x1b\x06\x20\x0f\x1f\xe5\x17\x2c\xb9\xe6\x2f\
\x86\x0e\x97\x0c\x1b\x01\x8e\xb6\x0c\x8e\x8e\x51\x7a\xf6\x40\x5a\
\xad\x5a\x05\x83\x5d\xef\x7f\x04\x8f\x95\xb6\x45\x5c\xd1\x06\xd1\
\x6c\x92\x98\x82\xa3\x4d\x51\x04\x83\xb0\xca\x15\x1e\xcc\xcd\x38\
\x42\x21\xf1\x7f\x31\x4a\x65\x50\x84\xb4\x60\xb3\x04\x86\x09\x60\
\x51\x5f\x96\x22\x64\xea\x55\x25\x8f\xb8\x93\x3e\xfe\xae\xf6\x43\
\xb2\xcd\xc2\x02\x48\x6a\xf2\xc0\xe8\x01\x49\x9d\x40\x32\x5b\x63\
\xcf\x6c\x3d\xf8\x97\x5f\x73\x01\xdd\x3c\x66\x58\xce\x58\xd8\x10\
\x00\xd9\x7d\x74\xf4\x9d\xad\xc3\x07\x97\x5b\x6c\x1d\xb6\xc0\xb2\
\xb0\x37\x02\x48\x24\x38\x94\x9b\x57\xa9\x57\xe6\x0c\x56\xc1\xcd\
\x1b\x41\x52\x32\xd2\x25\x28\x22\xb3\xf8\xa3\x25\x63\x40\x21\x01\
\x61\x55\xab\x7e\xb5\x8a\xa7\xfa\x36\x61\x08\x14\x2c\x75\x95\x18\
\x3e\x48\x03\x87\x28\x07\x4c\x01\x2c\x9d\xaa\xa5\xbf\x72\xab\xc0\
\xe2\x59\xc4\xee\xa4\xeb\xe3\x26\x12\x28\x69\x47\x3d\x9c\xcf\x52\
\x6a\x96\x67\x13\x09\x92\x59\x01\x8e\x99\x1a\x98\xeb\xd2\x8e\x0d\
\x80\xef\xbd\xf2\xc2\x99\xbf\x99\x7e\x84\xd6\x27\x9c\x75\x80\xec\
\x39\xda\xfc\xd0\xb0\xe5\x3f\x1a\x3a\xcc\x2e\x07\x50\x04\x06\x89\
\x80\x08\xde\xab\xc4\x1a\x23\xa9\x5e\xa9\x8d\x42\xcd\x1a\x6a\x0f\
\xc4\x18\xea\x41\x95\xca\x8c\xf4\xa8\x56\x71\x34\xb6\x8b\xa0\xf0\
\x16\x78\xb2\xbb\x65\xdc\xdf\x47\x16\x29\xa4\xad\x22\x28\xa0\x50\
\x39\x8d\x44\x24\xb2\x0c\x95\xc1\x12\x8d\xfb\xd2\x91\x77\x61\x94\
\xcb\x78\xdf\x71\x93\xc8\x26\x62\xa3\x70\x20\x6d\x0f\xc3\x26\x12\
\x18\xb3\xbe\xcc\xec\xa0\xfb\x9c\x1b\x60\x69\x00\xfc\xc8\x95\xbb\
\x66\x3e\xbc\xfa\xd1\x3a\xfd\x70\x56\x01\xf2\xd0\xf1\xe6\xb5\xcb\
\x0d\xbf\x73\xd8\xa2\xb6\xe0\x58\x76\xc0\xa8\xe9\x40\x12\xc1\x21\
\x98\x23\xa9\x5d\x92\x39\x38\xdb\x03\x49\x06\x7a\xfe\x85\xa9\x78\
\xc4\x5d\x01\x43\xaa\x51\xac\x58\xa1\x04\x8a\x3e\x26\x51\x6a\x95\
\x04\x87\x1c\x80\x95\x00\x25\xd3\xb2\x0c\x48\x80\xe4\xd2\x42\x0f\
\x18\x44\x99\x64\x9f\x58\xa0\xe8\xc3\x8a\xf2\xe8\x7b\xf6\x85\x29\
\xd2\x47\x4d\xa2\xf7\x4a\xb9\x7e\x49\xa8\x56\x94\x33\x49\x60\x93\
\x01\x61\xce\x82\xa4\x46\x53\x13\xfd\x9b\xa7\xed\x1a\xfc\xf1\x0a\
\x46\x6a\x4d\xc3\xe0\x6c\x35\xbc\xe7\x68\xf3\x53\xcb\x0d\xbf\x63\
\xd8\xa2\x92\xe0\x58\x0e\xcc\xd1\x78\x90\x44\x23\x5d\x32\x47\xf0\
\x62\xe9\xe3\x25\xe1\xc8\x49\x1b\x41\xe2\xd5\x2d\x2e\x1c\x33\x31\
\xfb\x1e\xc1\x28\x67\x07\x74\xab\xbc\x05\x83\x5f\xf9\x27\x31\x09\
\x6c\x5c\x44\x24\x20\x4e\xc3\x48\x67\x00\x20\xee\x12\xe4\x07\x73\
\xb2\x49\xc0\xc2\x07\xec\x9b\xa7\xf4\x18\xc8\xe7\x73\x2a\xc7\x04\
\x38\x10\x5a\xe6\x0e\x20\xdc\x81\xc0\x71\x07\x10\xc7\x8c\x9a\x01\
\xc7\xd4\x39\x29\x2a\x60\xc0\x04\xae\xcd\xb1\x7f\x26\x7f\xec\xc6\
\x7f\x02\x60\x90\x77\x7b\xcb\x4f\xf1\x3e\x0d\x03\x03\xf2\xa5\x7d\
\x87\x41\x83\xd9\xda\xbd\xe7\xab\x87\x9a\xd9\xa7\xee\x1c\xbc\xbb\
\x28\x48\xeb\x1c\xce\x0a\x40\xf6\x1c\x6d\x7e\x6a\xe4\xf0\x8e\xa1\
\xd8\xe3\x88\xe0\xc8\x6c\x0f\x78\x16\xb1\xcc\xa1\x59\x63\x98\xa9\
\x57\xc6\xcd\xab\xf6\x42\x20\x3c\x59\x9e\x31\x9c\xdf\xc0\x93\xac\
\x51\x62\x0f\xe4\x79\xb9\xa1\x1e\x40\x23\xca\xcb\x90\xa3\xa7\x10\
\x6c\x9e\x66\x8c\x50\x46\x32\x05\x53\x7a\x4c\x82\x81\x43\x39\x0b\
\x96\x00\x2c\x02\x98\x42\x19\x06\x1c\xa1\x41\x07\x82\x96\x3a\x10\
\x0c\x2a\x0f\x14\x0e\x1e\x3c\xea\xec\xb3\x8a\xe1\x40\xd1\xcb\x37\
\x13\x80\x12\x80\xc0\x00\xd7\x3e\x5e\x93\x1f\x63\x01\x84\xc6\xdb\
\x76\xb5\x1f\xc3\x41\x04\x47\xf7\x7e\xa0\xaa\x22\x7e\xe7\x57\x0f\
\x35\x38\x1b\x20\x39\xe3\x00\x79\xe8\x78\xf3\xda\x51\xc3\x1d\x38\
\x02\x28\x04\x73\x28\xef\x95\xda\xfb\x30\xcc\x61\x58\x43\x6e\x16\
\xb6\x85\xbd\x10\xeb\xbd\x0a\xb6\x48\xdc\xd0\x2b\x01\x43\x08\xfe\
\x78\xf5\x2a\x01\x42\x01\x45\x1a\x24\x46\xb7\xe2\x2c\x6d\x42\x20\
\xee\xb0\xc1\x5a\xd7\xea\xc0\x27\x8c\x74\xe2\xa8\x52\x31\x05\x24\
\x20\xc9\x9c\x65\x16\x99\xa7\x2e\x86\x73\x04\x26\x0f\x14\x0f\x92\
\x01\x27\x37\xf7\x80\xd1\xb1\x44\xf4\xee\x51\x3a\xf6\x1f\x18\x84\
\x53\xbc\x3b\x41\x90\x18\x04\xe1\x5e\xbd\x68\x0e\x12\x80\x6a\x0c\
\xf8\x9d\x5f\x39\xd8\x0c\xcf\xb4\xba\x75\x46\x01\xb2\x77\x81\x7f\
\x70\x79\xd4\xbc\x73\x59\x32\x47\x9b\x0c\xf2\x61\x63\xc0\x11\xed\
\x8e\x9c\x41\x9a\x68\xc4\x27\xd6\xe8\xdb\x28\xcc\xc1\xd1\xb9\x73\
\x83\xd0\x6f\xde\x4c\x78\xf6\xb3\xe7\x70\xe1\x45\x03\xb4\x0d\xe3\
\xa1\x3d\x23\xdc\x7e\xfb\x12\x46\xc3\x02\x70\x4a\xa0\xb0\x67\xd7\
\x05\x43\x94\x8c\x74\xab\x6d\xad\x28\x44\x1d\x49\x7c\x04\x20\xf8\
\x34\x56\x79\x50\x60\xd1\x6a\x96\xb8\x42\x1f\x33\xa0\x74\x55\xc7\
\x13\xcb\x15\x09\x90\x24\x36\x09\x2a\xd6\x80\xc9\xb3\x06\x12\x83\
\x18\x50\x24\xaa\xeb\xd2\x3b\x40\xc8\xd0\xa5\x91\x07\x33\x75\x0c\
\x58\xcf\xd6\xfc\x87\xf7\x1c\x1c\x9d\x38\x93\x86\xfb\x19\x33\xd2\
\x1f\x3a\x31\xfa\xce\x76\x84\x8f\x2e\xb5\xc9\x5b\xb5\x2c\xd5\xaa\
\x86\xb1\x9c\x81\x23\x81\x60\x28\xd4\xaa\x91\x05\x47\x9b\xd4\xaa\
\x74\xd4\x24\xed\x8b\x24\xd7\xae\x37\xc2\x1d\x3a\x26\x60\xc6\x13\
\x2f\x1d\xe0\xbb\xbe\x6b\x0b\xe6\xe6\x2a\xd5\xdf\x23\x47\x5a\x7c\
\xe4\xff\x3b\x8a\xe3\xc7\x5b\xc5\x1a\x90\x80\x81\xbf\xf7\x79\x2c\
\x40\x13\xf2\xb4\x36\xc5\x36\xba\xb2\x40\x72\xc2\x48\xe3\x44\x9d\
\x62\x34\xae\x5f\x63\x90\x47\x43\xdd\xe7\x49\x43\x3d\xf7\x70\xc9\
\xbc\x70\x14\x3e\xff\x86\xa1\x76\xf3\xca\xbd\x10\x98\xbd\x10\xe1\
\xcd\xaa\x53\xfa\xec\xc0\x7f\x7a\xc3\x7d\xae\xf6\x69\xde\xf5\x3b\
\x97\x0c\xf7\xa5\x99\x7a\xf0\xcf\xaf\xd8\x41\x9f\x5e\xc5\x08\xae\
\x66\xc8\xd7\x3f\x3c\x7c\x74\xf8\x82\x16\xd5\xa7\x97\x5a\x6c\x8d\
\x2a\x95\x07\x44\x07\x90\x0e\x00\xcb\x2d\x30\x6a\x80\xe5\xc0\x26\
\x82\x39\x22\x48\x9c\x55\xaf\x34\x73\xd8\x1f\x6b\x48\xdf\x41\x4f\
\xac\x11\xd8\x60\x6e\x0e\x78\xc5\x2b\xce\xc7\xfc\xa6\xaa\xd8\xef\
\xbd\x0f\x8f\xf0\xc1\xf7\x1d\xce\x58\x44\x32\x45\xd1\x73\xe5\xff\
\x4b\xa0\x32\xf7\x2a\x94\x54\x30\x1f\x28\x8b\x74\x77\x32\x9d\x20\
\xb0\x92\x7b\xab\xba\x68\x4c\x4c\xe5\x45\x1a\x79\xd0\x64\x40\xf1\
\x5f\xc6\x42\xa5\xf3\xc8\x03\x25\xee\xa8\x53\x70\xef\x4a\x4f\x96\
\x3c\x72\xa2\xbe\x13\x92\xbc\x59\x05\x90\xcc\x55\xc0\xcc\xc0\x03\
\xa4\xa6\x08\x96\x0e\x24\x1e\x28\x15\x8e\xcd\x57\x83\x6f\xbe\xec\
\x02\xba\xa5\x38\x71\x6b\x18\xd6\x5d\xc5\x7a\xf8\xf0\xc9\x27\x3b\
\x54\x7f\x31\x6c\xb1\x35\xd8\x0e\x51\xb5\x52\xf6\x45\x3f\x38\x86\
\xc2\xe6\x50\x4c\x62\x3c\x58\xb9\x7a\x85\x68\xa0\x4b\xd6\x08\x82\
\xfe\xf4\xa7\xcf\xf5\x82\x03\x00\x9e\x70\xc9\x00\x17\x5f\x3c\xc0\
\xde\x87\x86\x5d\x82\x55\xb3\x0c\x93\x48\x96\x51\x76\x79\x30\xf4\
\xe3\x7f\x31\x63\xfc\xe0\x29\xfa\x49\x20\xe1\x28\xfb\x1c\xd1\xc2\
\xf0\xaa\x16\x05\x35\x2a\xe5\x49\xbb\x82\x38\xd8\x27\x3e\x8b\x00\
\xae\x42\x05\xb9\x7d\xc2\x04\x90\x83\x4a\x03\x01\x2d\x93\xf7\x5a\
\x11\xb8\x4a\xeb\x40\x37\xb6\xc1\xde\xe8\x1a\x4f\x84\xaa\x6d\x0f\
\x63\x67\x74\x9e\x13\x6f\xb8\x87\xb7\x92\x5f\x10\x23\xef\x48\x20\
\xe0\x7c\xa2\xe6\x63\xbb\x0f\xf2\x8b\x2e\xdf\x45\xeb\xfa\xe7\x1b\
\xd6\x15\x20\x07\x98\xb7\x8e\x16\xdc\x47\x87\x0d\x5f\x32\x74\xc6\
\x43\xe5\x18\x23\x71\xa4\xc4\x6e\x02\x8e\x26\x81\xa3\xb4\x8b\xde\
\x6a\x60\x04\x97\xae\x35\xc2\xd9\x1f\xc3\xdd\xb9\xb3\x1e\xdb\x7f\
\x22\xc2\xae\x5d\x03\xec\xdd\xb3\x6c\x18\xc4\xb8\x7e\x4b\x71\x40\
\xab\x55\x05\xc0\xf4\xdc\x9a\x3e\xc4\x52\x29\x81\x03\x20\xc2\xc3\
\xd6\x10\x87\xb6\x2d\x28\xe8\xf2\x1e\x18\x24\x6c\x13\x2f\xd9\xbd\
\x40\xa9\x44\xbd\xe1\xde\xf7\xc7\x39\x8a\xc7\x6e\x1c\xa7\x78\x00\
\x87\x34\xcc\x93\xdd\x65\x40\x21\x3e\x09\xde\xde\x00\x81\xda\xf0\
\x1a\xfe\x7e\xc0\xa0\x96\x3a\x90\x74\xa0\x79\x12\x55\xcd\x47\x6f\
\xda\xcb\xdf\x7c\xed\x3a\x1e\x70\x5c\x37\x80\x30\x73\xb5\x77\xa1\
\xfd\xd3\x61\x8b\xab\x47\x25\x70\xf8\x4f\x79\x7c\x44\x1a\xed\xd1\
\x95\x5b\x00\xc7\xb0\xed\x98\x63\x68\x36\x08\x2d\x38\xa2\x4a\xe5\
\x77\xfe\xac\xc7\x6a\x34\x9a\x6c\x08\x8c\x46\x2e\x02\x2a\x33\xd4\
\xe3\xde\x88\x51\xad\x22\x50\xcc\x7d\x37\x30\x29\xaa\x06\xac\xd0\
\x38\xa5\xe2\x24\x0b\x2a\xd6\x10\x65\xe1\x59\x04\x9e\x45\x42\x59\
\xc9\x06\x52\xd8\x29\x3d\x9f\x01\x25\x34\xc0\x10\xa0\x40\xe7\xa2\
\xf2\xcf\xb1\x07\x4c\xeb\x84\x87\x0a\x71\x68\x12\x63\x44\x56\x91\
\x2f\x9b\x83\x23\xbf\xf7\xdd\x27\x0f\x0e\x04\x06\xe9\x3e\x2b\xc2\
\xf3\xb7\xcd\xb5\xef\x65\xe6\x1f\x58\xaf\xa3\xf2\xeb\x06\x90\x7d\
\x27\xdc\x9b\x1a\x87\x97\x0d\xa5\x81\xdd\x6a\x66\x08\xcc\x21\xbd\
\x54\x93\x98\x23\x3d\x63\x76\xcf\xdb\x1c\x1c\x4a\xa5\x0a\x2e\x5d\
\x30\xb6\x9e\x57\x61\xdb\xb6\x0a\xcd\x04\x80\xb4\x2d\xe3\xc1\xfb\
\x96\x14\xc0\x12\x53\xa4\x8d\xc3\x62\x1c\x48\xaa\x95\xb9\x8f\xa1\
\xcf\x1e\x01\x60\xed\x0e\x26\x53\x4e\x1d\x52\x2c\xa8\x53\x42\x06\
\x99\x12\x70\x12\x3b\xe8\xcf\x08\x14\x00\x68\x01\xaa\x44\x9b\x05\
\x15\x2b\xb2\x89\xcf\x0b\x2a\x17\x0b\x26\x49\x35\x0a\x26\x81\x4e\
\xb7\xe0\x88\x8c\x11\xc0\xd0\x86\xe6\x3c\x28\x5a\xf6\xdf\xb7\x67\
\xff\x83\x15\xfc\x7d\xf7\x1f\x69\x7f\x01\xc0\xaf\xd9\xd1\x5c\x8b\
\xb0\x2e\x00\xd9\x7b\x6c\xf4\xdd\x6d\xcb\x6f\x08\x2e\xda\xc8\x10\
\x8e\x8d\x1a\x95\xce\x5a\x75\x9b\x7d\x9c\xd4\x26\x7f\xdf\x0b\x8e\
\xcc\xf6\x90\xc6\xb8\x50\xa7\x3c\x83\x54\x15\xf0\x9c\x67\xcf\xe1\
\xb9\x57\xcf\x63\xfb\x8e\x5a\x9f\x7a\xed\x09\x5f\xfc\xfc\x09\x2c\
\x1c\x6b\x34\x30\xac\x7a\xa5\x00\x22\x01\xc1\x49\xde\x7b\x55\xad\
\x94\x9e\x07\x03\x16\xd1\x5d\xa9\x5a\x45\x21\x8e\x00\xf0\xcf\x0a\
\x23\x5d\x09\xb5\x61\x10\x7b\x45\xd5\xcb\x32\x45\xa6\x62\xa1\x03\
\x47\x95\x9a\x70\x0e\x68\xfc\x9d\x7c\x75\x0e\x28\x35\xb6\x94\x04\
\x45\x07\xd2\xb4\x59\xd9\x81\x23\x80\xc5\x1f\xac\x6c\x7d\xba\x67\
\x14\x7f\x64\x9f\x2a\xe2\xeb\x76\x1f\x1a\x7d\xe1\xf2\x9d\x33\x1f\
\xef\x19\xcc\x55\x87\x35\x07\xc8\x91\x53\xfc\x94\xa5\xc6\xbd\x77\
\x34\xe2\x2a\x9e\x9b\x8a\xec\x20\x5d\xb6\x48\xa0\xf0\x65\x9a\x02\
\xd3\x4c\x02\xc7\x48\xaa\x55\xad\x36\xc2\xd9\x75\xf1\xad\xe7\x55\
\x78\xe9\xbf\xd8\x8a\x0b\x2f\x9a\xee\x75\xdb\x96\x71\xe3\x0d\x0b\
\xf8\xdc\xa7\x8f\xf9\x3a\x50\x60\x8e\x82\x7a\x55\x72\xf9\x02\x41\
\x31\x37\x2a\xd5\x4a\x34\x82\xa0\x67\x09\xd5\x0a\x48\x2c\x90\xb2\
\x04\x60\x50\x54\xb3\xfa\x41\xa2\xcb\xa5\xfd\x13\xcf\x26\xa1\x2b\
\x81\x4d\x2a\x5f\x51\xbc\xf7\xd9\x0e\x18\x31\x22\x5b\xb0\xfa\x4f\
\xab\x4f\xe1\xdd\x48\xa4\x93\xfd\xa4\xc0\x1c\xbe\x6b\x24\x7f\x39\
\x92\xc3\x77\x5c\xea\xba\xa6\x3f\x79\x70\x91\x9f\x7f\xd9\x16\x5a\
\xd3\xef\x92\xac\x29\x40\x98\x79\x66\xff\x89\xf6\xfd\xc3\x06\x17\
\x0c\x2d\x38\x9c\x60\x0d\x07\x58\x1b\x23\xa8\x59\x8a\x61\xc4\x0e\
\xb9\x3d\x6f\x95\x8c\xf4\x74\xc4\x44\x32\x46\x60\x90\xcd\x9b\x09\
\x2f\xff\xbe\x6d\xd8\xb6\x6d\xbc\x41\x2e\xde\x01\x7f\xfd\x17\x87\
\x71\xc7\xcd\x8b\x65\x20\x38\xcb\x20\x01\x14\x46\xb5\x0a\x80\x90\
\x36\xc7\x18\x55\xab\xc7\x04\x31\x9a\x96\x51\xa5\xd8\xa6\x49\xc0\
\x74\x71\x0e\x65\x49\xd4\x65\x0d\xef\x02\x8b\x74\x76\x48\x27\xa4\
\x8a\x4d\xc2\xb3\xa1\xde\xc0\x28\x4e\xdb\x2f\x4d\x1b\xca\x95\xd5\
\x2a\x78\x58\x90\xef\x6b\xb0\x2d\x3c\x3d\x02\xd4\xa9\x51\xd4\x12\
\x2a\x70\xfa\xb3\x0e\xad\x07\x05\x18\x55\x4b\x02\x24\x7c\x21\x0d\
\xdb\x3f\x63\xe6\x6f\x21\x0a\x26\xfe\xe9\x87\x35\x05\xc8\xa1\x93\
\xee\x97\x9b\x16\x5f\x2f\x7f\x75\x44\xaa\x4c\x52\xb5\x1a\x3a\x28\
\x35\x2b\x1a\xda\xd6\x8b\x15\xca\xc9\xba\x04\x38\x46\xad\xf0\x54\
\xb9\xc0\x1e\x1c\xcf\x56\x7d\xdb\x3f\xdb\x3a\x35\x38\x00\x80\x88\
\xf0\x92\x6f\xdf\x8e\x7b\xef\x3e\x85\x93\x27\xba\x59\x66\xcf\x46\
\x4a\x95\xf2\xea\x15\x5b\x80\x94\xec\x10\x05\x80\x74\xa3\x19\x25\
\xef\x8b\x3c\x5b\x15\xc5\x2c\x18\xe1\x21\x2d\xac\xf4\x48\x38\xb1\
\x80\x48\x6a\x12\x83\x89\x40\xae\xb3\x07\x48\x1a\xe3\x05\xdb\x22\
\x3c\xa7\xd8\x24\xf4\xcb\xa5\xfa\x4b\x36\x09\x2a\xa0\x71\x3d\xb6\
\x87\x04\x43\xc4\x7b\xf0\x5e\x75\x9f\xc1\xd6\x08\x64\x45\x04\x50\
\x9b\x54\x2d\x0f\x0a\x54\x8e\x50\x3b\xff\x49\xf8\xa6\x3d\xc7\xdd\
\x7f\x02\xf0\xa6\x7c\x34\x57\x17\xd6\x0c\x20\x87\x4f\xf2\x4b\x96\
\x9a\xf6\x75\x43\x67\xd8\xa2\x4d\x82\x3c\x74\xfa\x5e\x31\x8b\x00\
\xc7\x50\xa5\x15\x0c\xf2\xa0\x56\x95\xc0\x21\xce\x57\x5d\x76\xf9\
\x0c\x2e\xbb\x7c\x66\xc5\xef\xb2\x79\x4b\x8d\xaf\x7d\xf1\x56\xfc\
\xed\xc7\x8f\xf4\x00\xc3\xaa\x59\xc8\xca\x78\x8b\x43\x30\x49\xba\
\x97\xb7\xfd\x36\x88\x0c\x24\xf6\x3e\x90\x40\x42\x21\x2a\x74\x7b\
\xd2\x82\x27\xd5\x27\x29\xe8\x9d\xd1\x60\x80\xe2\x7b\xc6\x2e\x6d\
\x1e\x82\x18\xa8\x52\x75\x2c\x98\x82\xfc\x7d\x62\x91\x4e\x25\xe2\
\x00\x14\xef\xe1\x52\x6a\x15\x25\x30\x84\x73\x63\xa1\xa9\x68\x7b\
\x40\x80\x82\x3a\xa6\x20\x78\x50\xb4\xd0\x4c\x12\x40\x43\x40\x4d\
\x8c\xaa\xe1\x37\xec\x39\x36\xfc\xeb\x27\x9d\x3f\xfb\xf7\x53\x0c\
\xec\xc4\xb0\x26\x00\x39\x78\x90\xb7\x8d\xda\xf6\xbd\xa3\x16\xb5\
\xfc\x41\xb7\xc6\xda\x0a\x12\x1c\x96\x59\xa2\x37\xcb\x97\xb3\x6a\
\x95\x38\xda\x3e\x0d\x38\xd8\x31\xae\xba\x6a\x6e\x2a\x63\xbc\x14\
\x9e\x7d\xcd\x79\xf8\xbb\xbf\x3a\x0c\x97\x9c\xfb\x05\x60\x14\x40\
\x61\x6c\x12\xad\x66\x19\x36\x59\x89\x1d\x42\x86\x35\x82\x8e\x1f\
\x76\xbb\xc3\x0a\x2f\xb0\x52\xda\xf8\xb3\xf6\x05\x24\x1b\x14\xec\
\x12\xaa\x92\x8a\x15\x80\xd2\xa9\x9a\x50\xea\x55\x52\xb7\xa8\x3b\
\xa4\x65\x40\x32\x32\x6a\x55\x52\xb3\x04\x48\x7c\x15\x04\xed\xd6\
\xad\x48\x78\xb0\x3c\x28\x46\x04\x0f\x0e\x46\xdd\x12\x46\xc4\xe1\
\x27\x8c\x06\x55\x4b\x7f\xb4\x77\x2f\x5f\xbb\x16\x3f\x00\xb1\x36\
\x0c\xb2\xc9\xbd\x65\xd4\xe0\x29\x51\xed\xc9\xd4\x21\x6d\xa4\xab\
\x0d\x3e\x03\x96\x46\xb0\x87\xfc\xf2\x93\xde\x1c\x44\xb2\x39\x9c\
\xb4\x3b\x92\x3a\xc4\xcc\xb8\xe4\xd2\x95\xb3\x47\x08\x9b\xcf\xab\
\xb0\xfd\x82\x01\x0e\x3d\x32\x4c\x40\x28\xd8\x1f\xd6\xb3\x95\xa9\
\x5d\x21\x1d\xc8\xd9\x64\x45\x41\xb0\x06\xe0\x91\x00\x61\x7f\x88\
\xcf\xa0\x4a\xf5\xd9\x19\x40\x90\x44\xaf\x46\x95\x81\xa4\x54\x37\
\xa1\x5e\x45\x80\x41\x30\x06\x10\x01\xd1\xd9\x2d\x1a\x24\x8d\x93\
\x14\x18\xba\x9a\x18\x23\xf4\x25\xa6\x19\x50\x10\x09\xc6\x40\x60\
\x8d\x8e\x5d\xea\x4c\xd5\xa2\x2b\x07\x9b\xdd\x9b\x01\xfc\xdb\x15\
\x0e\x72\x16\x4e\x1b\x20\x07\x16\x46\xdf\x36\x72\xfc\x5a\xf5\xa7\
\x07\x84\x6a\x25\x0f\x0d\x2a\xa1\x2f\xee\x65\xe8\xef\x73\xc8\x3f\
\x65\xa0\xbe\x36\xdb\x72\xc6\x1c\x16\x1c\x15\x01\x9b\x37\xf7\x1f\
\x23\x99\x14\x88\x08\x5b\xb7\xd5\x38\xb8\x8f\x73\x40\x14\x81\xe2\
\x95\x2a\xb9\x09\x10\xa3\x21\xcf\x57\x3e\x71\x3f\x44\x76\xc4\x14\
\x0c\x4c\x42\xa6\x8c\x04\x8c\x30\x74\xfb\x80\x61\x6d\x0c\xb6\xe0\
\x08\xee\x5b\x87\xb8\x21\x28\x99\x82\xd0\xdd\x47\xbb\x64\x1a\x90\
\xb4\x50\x2a\x55\xea\x5e\x00\x45\xf8\x1d\x2f\x0f\x0e\xaf\x56\x51\
\xdc\xfb\xf0\xa0\xa8\x08\xb5\x03\x2a\xd7\xa9\x55\x23\xd7\x01\x27\
\x7c\x5d\x78\x44\x8c\xba\xe1\x9f\x7e\xe8\xf8\xf0\x83\x97\x6e\x9b\
\xfd\xec\x98\xd1\x9d\x18\x4e\x0b\x20\xcc\x3c\x7f\x70\xb1\x7d\x67\
\xd3\xa0\x4a\x5f\x71\x2d\xb8\x61\x85\x8b\xb6\x11\x80\x50\xf1\x36\
\xf7\x58\xe9\xd3\xb9\x09\x70\xd1\x5b\xa5\xd4\x2a\x28\x36\xe1\x6a\
\x65\x1a\x4c\x29\xb8\x56\x33\x53\x07\x8c\x92\x7a\x25\x5c\xcb\x40\
\x6c\x58\x7b\xb9\xe2\xa0\xc5\xfb\x95\x74\x2f\x69\x55\x09\x24\xe1\
\x9e\xe5\x46\x9f\x17\x30\x29\x85\xec\x57\xe0\x60\xa0\x03\x94\x80\
\x62\x54\xaf\xe8\xd6\x75\xfe\xf9\xca\xf7\x32\x78\xb2\x62\x1e\x92\
\xca\xe5\x12\xbb\x48\x40\x90\x57\xb7\xa4\xe7\xab\x71\x5d\xc7\x73\
\x70\x78\xe3\x3c\x54\x1d\x40\x11\x0d\xf2\x2e\xad\xf6\xac\x52\x7b\
\xc0\x58\x55\xab\xae\x18\xb5\x23\x34\x44\xd5\xc0\xd1\xbb\x98\xf9\
\x5a\x22\x1a\xae\x60\xa8\x55\x38\x2d\x80\x1c\x5d\xc2\x1b\x46\x0e\
\x57\x26\x8f\x52\xd8\xd1\x4e\x3f\xbb\xa3\xf6\x29\x84\xfd\xd1\x08\
\x76\xb0\x65\xd2\x69\xdc\x74\xf0\x30\xed\x90\x0b\x95\xca\xd8\x1c\
\x69\x0f\x84\xe1\x46\x8c\x13\x0b\x2d\xb6\xef\x58\xdd\x2b\x32\x33\
\x8e\x1e\x1c\x0a\x80\x94\xec\x8f\x64\x9f\xb0\x05\x85\x00\xc7\x64\
\xe6\x98\x4c\x21\xd2\xa3\x15\xd9\x01\xe1\xa3\x13\x7e\x25\xf0\x1c\
\xd8\x81\x91\x58\x05\x80\xdf\x21\xb7\x07\x10\x33\xc3\x9b\xd0\x81\
\xc3\x89\x7a\x85\xf0\x03\x9e\x5d\xaa\xce\x56\x60\x27\xc0\xa3\xca\
\x11\xc8\x7b\x15\x51\xa5\xcd\x44\xfd\xc7\x47\x03\x38\x82\x3a\x95\
\x8c\xf4\x4a\x00\xa0\x12\x2a\xd7\x88\x3a\x20\x04\x16\xe9\x40\xc1\
\x18\xb5\xe1\x57\x5a\x18\xb5\xa3\xab\x1e\x3a\xd6\xbe\x1e\xc0\xaf\
\x8c\x19\xe0\xb1\x61\xd5\x00\x39\xb6\xb4\xf4\xf4\xa5\x51\xfb\x3a\
\xa9\x2a\xd9\xdf\xc4\x55\x86\xb9\xcb\xbf\xc4\x14\x9e\x6b\x0b\x6a\
\x98\x3c\x7c\xa8\x8f\x8f\xa4\xab\x08\x0e\x97\x56\xfd\xdd\xf7\x2f\
\xaf\x1a\x20\x47\x0e\x8d\x70\xe4\xd0\xb0\x9b\xd8\x0c\x20\x05\xb5\
\x4b\x82\xc2\x30\x49\xe6\xc1\x2a\x01\xa3\x84\x11\x92\x19\x12\x10\
\x80\xf4\x64\x85\xec\x60\x9b\x64\x60\x09\x2a\x18\x91\x10\x78\xa3\
\x82\x49\x15\x2a\x00\x06\x30\xf9\x24\x54\xb9\x2e\xad\x03\x89\x60\
\x12\xc9\xdc\x2e\x3d\x47\x82\x45\x9c\x03\x9a\x74\xe8\x30\x67\x12\
\x4a\xea\xd4\x48\xb8\x73\x2b\x6f\x88\xd7\xce\xab\x52\x0e\xd1\x60\
\xaf\x5b\xc6\xc8\xab\x5e\x23\xd7\x01\xa6\x76\x8c\x41\x45\x3f\xbf\
\xf7\x14\xff\xe9\x25\x9b\xe8\xbe\xde\xc9\x1e\x13\x56\x0d\x90\x91\
\x9b\xf9\x9d\xc6\xf1\xdc\xa8\x20\xf4\xf6\x7b\xe1\x23\x93\x17\x54\
\x2b\xcb\x32\xf6\x1b\x80\x32\x4d\x9d\xad\x72\x1a\x14\x25\x70\x30\
\x33\x6e\xfd\xe2\x22\x9e\x7b\xed\xe6\x55\x79\xb2\xbe\xf8\xb9\xa3\
\xe0\x56\x83\x62\x12\x30\xb4\x4a\x15\x98\x05\x30\xd6\xb9\xb2\x4b\
\xa6\xf4\xf2\xa6\x88\x8a\x77\x20\x09\x2e\x52\x0e\x52\x1d\x08\xa3\
\x64\x5b\x48\x46\x31\x8c\xa3\x0c\xf7\x0a\x20\x47\xdd\x77\xd5\x25\
\x33\x40\xd8\x25\x80\x07\x09\x81\x2b\xd6\xea\x96\xdc\x63\x01\x3a\
\xb0\x84\xf2\x00\x9c\x23\x34\x81\x31\x60\x18\x43\x5c\x14\x40\xe1\
\x99\xa3\x26\xa0\x72\x9e\x4d\x5c\x02\x4c\x07\x12\x44\x66\x89\xb2\
\xd7\x62\x73\x35\x74\xff\x19\xc0\xf7\x4e\x31\xd2\x59\x58\x15\x40\
\x8e\x2d\x8d\x5e\xba\x34\xe2\x97\x86\x1f\x60\x93\xb6\x83\x12\x72\
\x61\x83\x24\x95\x4a\xab\x56\x6d\x11\x1c\x1e\x34\x9c\xca\xc8\x5d\
\x72\x05\x0c\x57\x06\x07\x1c\xb0\x7f\xef\x10\xb7\x7e\x69\x11\x57\
\x3f\xff\xbc\x15\xbd\xdf\x81\x7d\xcb\xf8\xc2\x67\x8f\xe8\x8d\xc7\
\x12\x30\x9c\x05\x85\xc8\xf7\xe8\x88\x4c\x12\x71\x53\x00\xc6\xb4\
\x46\x3a\xb1\x37\xd0\xbd\x44\x07\x1d\x45\x58\xed\x0a\x18\x61\x53\
\x8e\x18\x5c\xd1\x18\xa0\x90\x07\x04\x72\x36\x91\xea\x92\xb0\x4b\
\xa2\x2a\x06\x8c\x07\x89\x00\x16\x58\xdc\xb3\x77\xff\x86\x2e\x38\
\x24\x4f\x55\x3a\x42\xe2\x8d\x6e\xa3\x6a\xb9\xce\x73\xd5\xb9\x77\
\x3b\x60\xd4\xd4\xc9\x4d\xed\xa8\x93\xaf\x8a\x31\x70\x84\xa6\x62\
\x0c\x1c\xbf\x7c\xef\x02\x7f\xeb\x25\x5b\x57\xfe\xd7\x77\x57\x0c\
\x10\x66\xae\x8f\x9c\x72\xbf\xd5\x38\xa6\xf4\x5d\x70\x0f\x12\xb6\
\x5e\x28\xcb\x08\xfa\x27\x41\x5b\xc5\x1e\x36\x0f\xb1\x4c\x11\x18\
\x9c\x00\xa1\x8c\x64\x3f\x09\x21\xff\xd3\xff\xff\x11\xec\xdc\x35\
\xc0\xa5\x97\xcf\x4f\xf5\x7e\x8b\x0b\x0d\x3e\xf4\x87\x0f\x61\xb8\
\xec\xba\x7a\x9d\x8b\x36\x46\x2f\x30\x9c\x01\x85\x60\x0d\xf9\x2d\
\x44\xcf\x1f\x19\x20\x8a\xa6\x88\x07\x46\x76\x88\x3b\x91\x84\x11\
\xf4\x40\x1d\x88\x28\x21\x2f\xe0\xec\xdb\x2f\x03\x05\x49\x55\xa2\
\xd4\x6e\x54\xb5\x80\x08\x9e\xdc\x08\x2f\x81\xc4\xa7\x33\xc7\xbe\
\xb3\x00\x45\x7c\x4f\x9f\xd6\x3a\xa0\xa1\xce\x38\x6f\x48\x9e\xaf\
\x12\xc6\x39\x31\x1a\x12\xee\x5c\xe1\xb1\xaa\x5d\xa7\x86\xd5\x5e\
\xde\x6a\xd7\x81\x23\xee\x8d\x54\x84\x01\x11\x0d\x5c\xfb\x56\x66\
\x7e\xe1\x4a\xff\x8e\xfb\x8a\x01\x72\x74\xa9\x7d\xf5\xc8\xd1\x73\
\x22\x20\x5a\xa3\x0e\xb5\x02\x10\xdc\xa3\x36\x71\x9f\x2a\x55\x52\
\xad\xac\xc7\x2a\x81\x22\x08\x23\x3b\xa4\xbf\x39\x20\x01\xe5\xba\
\xaf\xf3\x7e\xf0\x8f\x1f\xc1\xb7\xff\xcb\x0b\xf0\xac\x6b\xb6\x8c\
\x55\xb7\xf6\x3e\xb8\x84\x0f\xbf\xf7\x21\x1c\xda\xbf\x2c\xd4\x39\
\x68\x00\x46\x50\x22\xb6\x1f\x24\x30\xff\x65\x14\x2f\x0d\x7d\xec\
\xc1\x00\x4f\xd0\xb1\xbc\x12\xa5\x05\x37\x18\xe9\x1e\x13\x91\x40\
\x04\x58\x88\x08\xcc\x14\x8b\x46\x56\x61\xa4\xa3\xec\x64\xea\x0b\
\x3a\x8e\x61\x0f\x02\xb4\x77\xab\xa2\xb8\x19\x98\x83\x24\x3c\xe7\
\x3d\x6d\x55\x67\x5f\xc8\x45\x22\xd8\x2d\xe0\x60\x8f\x20\x9d\xb5\
\x2a\x5c\xb5\x07\x49\x5d\x69\xa3\x3c\x7e\x56\x9d\xbc\xd4\x5e\xfe\
\xea\x8a\xd0\x50\x90\xc7\xc8\x26\xcf\xdb\x7f\xa2\x7d\x05\x80\x3f\
\x1d\x3b\xe0\x26\xac\x48\x39\x67\xe6\xf9\x43\x27\xdb\xbb\x97\x1b\
\x5c\xb6\xd4\x00\xa7\x5a\xc6\xd2\x88\xb1\xd4\x00\x4b\x4d\xf7\x23\
\x0c\x4b\x6d\x77\xbf\x1c\xd2\xda\xf0\xfd\xf3\x2e\x7f\xd8\x32\x96\
\xda\xf4\x23\x0d\xa3\x36\xff\x3d\xac\x70\x3c\xbe\x91\xb6\x46\x4f\
\x1c\xe6\x33\xe6\x49\xef\x93\x5f\xe1\x9f\x74\xf9\x1c\x9e\xff\xa2\
\x6d\x78\xca\x95\x9b\x30\xef\xf7\x48\x9a\x11\xe3\xa1\x07\x96\x70\
\xf3\x0d\x47\x71\xdb\x17\x8e\xa3\x6d\x9d\xae\x8f\x21\xf6\x59\xfc\
\x0c\x0b\x06\x61\x68\x46\xc9\xd8\x23\xdc\x46\x35\x8b\x35\x9b\xc4\
\xc1\x9d\x34\x3b\x69\x43\x2d\x2c\xed\xd9\x6f\xf0\xfa\xbc\x70\x4c\
\x84\xbc\x72\x4f\xde\xb0\x08\xf7\xe9\xd9\x4e\x02\x29\xdc\xfb\xef\
\x9e\xab\x78\x85\x2c\xcd\x9f\x31\xef\x9e\x8b\xdf\x57\xf7\x69\x31\
\xcf\x94\x27\x9d\x67\xe3\x03\xfb\x6b\x8b\x75\xfa\xc1\x86\x19\xf1\
\x23\x0e\xf3\x75\xfc\x69\xd2\xf4\x3d\xf5\x1a\x98\xf7\xdf\x57\x9f\
\x1f\x00\xf3\x75\x88\x53\x77\x3f\x43\xd8\x54\x13\xe6\x67\x70\xef\
\x91\xdd\xf5\x55\xcf\x79\xce\xf4\x6e\xdf\x15\x31\xc8\xf1\x65\xfc\
\x78\xcb\x74\x59\xf7\x97\x9a\x0c\x7b\x08\x56\xd0\xbf\x4b\x55\xf8\
\x5b\x1d\x2e\xfd\xd1\x4c\xab\x7e\xc9\x1f\x97\xce\x54\x2a\x6b\x94\
\x73\x0e\x0e\xcd\x2e\x1d\x03\xb0\x5f\xf9\x1f\xbc\xf7\x14\x76\x7f\
\xf5\x24\x08\x8c\xb9\xf9\x0a\x04\xe0\xd4\x62\x83\xa6\x09\x75\x38\
\x7d\xbc\xdd\x69\xe1\x47\x60\x14\xe8\x76\x33\xd6\xf0\xc0\x50\x6e\
\x60\xa3\x5a\xb1\x04\xc4\x38\x12\x21\x51\x88\x90\x40\x26\x80\x02\
\x01\x94\x74\x52\x37\xb0\x0c\x27\x66\x08\x8c\x22\x18\x84\xd8\xab\
\x5d\xd1\xc6\xe0\x4e\xa0\x5d\xe5\x6d\x08\xaf\xbe\x49\x8f\x95\xf3\
\xdd\x30\x4c\x12\x59\x22\xa8\x60\xa1\xbc\x58\x1b\x94\x9a\x25\xe2\
\x0d\xc3\x7b\xaa\xb4\xaa\x15\x7e\x7d\xbe\xa9\x84\x3a\x45\x8c\xc6\
\x51\x54\xb1\x6a\x22\x8c\x1c\x30\xf0\x6a\xd6\x80\x18\x35\x27\x43\
\xbd\x69\x81\xa6\x62\x34\x2d\x7d\xcd\xae\xcb\xdb\xd7\x00\x78\xd7\
\x14\xe2\x0e\x60\x05\x00\xd9\xbd\x9b\x37\xb5\xec\x5e\xdf\xba\xb2\
\x4d\xd1\xb6\xf0\x7f\x66\x59\x18\xdf\xdc\x23\xfc\x06\x18\xf1\x97\
\xd5\xc3\x33\xd6\xe6\x28\xc4\x21\x00\xa1\x76\xd3\x15\xd3\x20\x01\
\x47\x30\x8d\x63\xc6\xc9\x85\x46\x95\x81\x73\x8a\x6d\x14\x6b\x28\
\x35\xab\x47\xf5\x52\x9f\xda\x46\x61\x29\x14\xf2\x73\x9a\x60\x49\
\x46\xa8\x5a\x0c\x56\xfb\x20\x14\x75\xa1\x82\x9d\xc1\xf0\xc6\x35\
\x89\xc3\x88\x42\xe0\x19\x69\xf3\x10\x48\xba\x92\xb5\x3b\x8a\x20\
\x81\xdf\x33\xf1\x8f\xfa\xf2\x11\x1c\x0e\xc9\xfd\x2b\xed\x11\x13\
\x6f\x08\xa8\xb8\x53\xa3\x5a\xea\xae\x26\xd8\x22\x2e\xfd\xa9\x86\
\x86\xa0\x55\xad\x0a\x18\xb8\x6e\x47\xbd\xb3\x41\x80\x41\xdb\x3d\
\xdb\x38\xf2\x8e\xa4\x4e\xed\x1a\xd4\xf8\xbf\x6e\x63\x7e\xcf\x73\
\xa6\xdc\x3c\x9c\x1a\x20\x3b\x2e\xc4\x8f\x9d\x6a\xf1\x44\xe9\xb9\
\x6a\x59\xff\x18\x5b\x14\x72\x61\x84\xcb\x3f\x48\x13\x7e\x97\x2a\
\x80\xa5\x65\xc3\x32\x1e\x50\x76\xbf\x43\x5f\x5a\x00\xe5\xca\x1d\
\xd9\x22\x5e\x39\x88\xf4\xf9\x2d\xf8\x7c\x27\x40\x08\xe5\x11\x83\
\x02\x83\x37\xd8\x8b\xcc\xc1\x71\xa7\x3d\x31\x89\x1f\xbc\x71\x6c\
\x11\xef\x4b\xda\x2e\xe7\x59\x0c\xc1\x24\xd0\xdf\x28\x0c\x76\x08\
\x28\xaa\x52\xca\x6b\xc5\x9e\x29\xc8\xd3\x48\x30\xc2\x95\x41\xee\
\x59\x81\x00\x82\x03\x93\x47\x4d\x00\x80\x65\x86\x28\xe4\x94\xfa\
\x17\xca\xf9\x71\x21\x00\xcc\xfe\x6c\x18\x38\x32\x59\x2c\xef\xe3\
\xd1\x1e\xf1\x00\x88\xc7\x4a\x98\xd1\x7a\x01\xaf\x89\xd1\x54\xdd\
\x1e\x47\x5b\x51\xfa\x33\x7a\xe4\xd3\x1c\x79\xc3\xbf\x63\x91\x24\
\x93\x1d\x8b\xb4\x8e\x9e\xbc\x6b\xa1\x7d\x15\x80\xff\x52\x18\xf0\
\x2c\x4c\x75\x58\x89\x99\x07\x2d\xbb\x9f\x93\xc2\x1d\xa9\x8b\xd9\
\xb0\x45\x99\x3d\x62\x1e\x43\x75\xba\x65\xfd\x27\x07\xa2\xd7\xca\
\x5e\x4a\x80\x11\x55\x97\xe8\xb1\xb2\xe5\x2c\xd3\x14\xc1\xe1\x84\
\x5a\x25\xca\x05\x70\xc4\xb8\xeb\xca\x3a\xee\xf6\x46\x9c\xb9\x5a\
\x9f\x1f\xeb\x0d\x7d\x14\x9f\x31\xee\x55\x1d\xe7\xaf\x70\xaf\x80\
\x1d\x9e\xe9\x29\x9b\xd5\xe9\xc7\x21\x5c\xec\xfb\xd4\xba\x42\x5f\
\x43\xdc\xc5\x85\x41\xb2\x6f\x78\xe7\x34\x56\xa1\x0e\xe8\x71\x2d\
\xda\x79\x86\xed\x23\xfb\x22\x8d\x27\xa3\x58\x2e\x5c\x6a\x51\x65\
\x21\x27\x71\x51\xcd\x35\x90\xb0\xb8\x2a\x0d\x25\x2e\xde\xc9\x14\
\x08\xf9\x4c\xf4\xba\x0f\x7c\xe0\x03\x53\x7d\x49\x68\x2a\x06\x39\
\x31\xc4\x0f\x34\x8c\xa7\x58\xf7\x6b\xe8\xac\x06\x4e\x62\x8a\x71\
\xec\x91\x7e\x71\x5d\xab\x6c\x49\x38\xca\x83\x98\xa9\x3a\x05\x35\
\x4c\xfe\xe1\x72\xad\x16\x69\xe6\xc8\xec\x17\x69\x6f\x18\xbb\x46\
\xb1\x86\x7c\xd6\x32\x46\xc6\x1c\x69\x65\x8d\x64\x31\x96\x35\x4c\
\x11\x99\x12\xd8\x03\xe2\xa4\x2e\x7c\x7f\x03\xab\x10\x90\x6d\x1f\
\xf6\x00\x00\x20\x00\x49\x44\x41\x54\x84\xbb\xd6\x8f\x85\x64\x14\
\xb9\xc7\x11\xba\x20\xbc\x4f\xf1\xfb\x1e\x80\x60\x0b\x07\xb8\x02\
\x93\xf8\xf7\x4e\x9e\x2b\xa4\x73\x57\xb2\x0d\x4e\x76\x48\x78\x26\
\xbe\xa4\x7c\xde\xff\xe0\x43\xe3\xb4\x8b\xb7\xfb\xdb\x25\x69\x03\
\x30\xb0\xc8\xc0\xb2\x48\xd5\xe5\x0f\x9c\x94\x4b\x42\x5b\x89\xb8\
\x03\x9a\x96\x9f\xf6\x92\xef\xfa\x9e\xef\x01\xf0\xa1\xde\x09\xf0\
\x61\x2a\x80\xb4\xce\xfd\x9f\xb9\x60\x27\xb5\xca\xda\x17\xad\x43\
\x26\xfc\x8a\xea\x02\xb0\xd8\xfc\x5d\xc0\xb0\xba\x30\xe7\x02\x17\
\x40\x23\x41\x22\x80\x20\x97\x5f\x65\xb0\xcb\x15\x91\x21\xc0\xe1\
\x0a\xe0\x60\xbf\x12\x87\x7a\xc2\x0a\x9b\xfa\xd5\x01\xc4\x29\xd5\
\xae\x17\x18\x01\x14\x06\x28\x59\x28\x02\x86\x4d\x92\x78\x3e\x08\
\xb0\x07\x06\x49\x49\x94\x65\xa4\x7a\xe5\x18\x71\x63\xc4\xd8\x25\
\x5d\x25\x15\xa2\x01\xaf\x6c\x8c\x12\x48\x7c\xdb\xce\xf7\x4a\xec\
\xb4\x93\x1c\x07\x09\x9c\xa0\xc2\x79\xb0\xc4\x97\x90\x63\xe4\xc7\
\xb4\xf5\xbf\x1c\xdf\x3a\x6f\x8b\x54\xd2\x28\x47\x12\xf8\x78\xec\
\xa4\x03\xcf\xc0\xab\x51\x4d\x88\x47\xb0\x78\x1b\xc4\x05\x8d\x87\
\xe0\xea\xea\x67\xb1\x16\x00\x39\x3e\xe4\x7f\x32\x6a\xdc\xf3\xa5\
\xe7\x29\xfe\x5d\x3f\xc5\x0e\x49\xc8\xa3\x3d\x12\x98\x44\x94\x73\
\x81\x7d\x0c\x30\x5a\x49\xe3\xe1\x42\x1f\x5d\xfb\x41\xe7\xfe\x2b\
\x78\x53\x62\x9a\x12\xf2\x49\xe0\x10\x06\xbb\x57\xe7\x32\xc6\xe9\
\x03\x46\xf8\xfd\xa7\x12\x28\x64\x9a\x4c\x2f\x06\xf3\xac\xc2\x0e\
\x27\x2f\x56\x28\xc2\x1d\x00\x48\x3e\x54\x02\x0a\x3b\xc3\x26\x1e\
\x29\x95\xf3\x06\x7c\xf7\x45\x57\xa6\xf4\xdb\x87\x89\x61\x1c\x38\
\xfc\x8c\xa2\x0b\x40\xe9\xe6\x22\x1a\xe1\xd9\x78\xf8\xee\x47\x96\
\xf0\x73\x57\x71\xca\x27\xe8\xb1\x74\x84\x96\x18\x2d\xe5\x40\x69\
\x23\x8b\x24\xa0\x04\x16\x69\x5c\xb7\x7b\xde\x86\x0d\x48\xd6\x9f\
\xad\x07\x47\x53\x01\x33\x8e\xbf\xe1\xc0\x22\x7f\xed\x85\x5b\xe8\
\x1f\xc7\xcd\xc2\x64\x06\x71\xee\xa7\x5b\x07\x92\x46\x75\x1b\x91\
\x08\x05\x0e\x05\x0c\x66\x91\x2e\x6c\x0c\x36\xf9\xe2\x8a\xcb\x89\
\x1a\x2c\xcd\x0c\xe3\x54\xab\xfc\x68\x88\x05\x40\x87\xd0\xcc\xe6\
\xb0\xe0\x30\xac\x93\x58\xc8\x45\xe0\xe5\x42\x40\x49\x40\xe2\x12\
\x2f\xee\x85\xdc\x02\x5e\x98\x56\xb2\x0d\xc5\xc1\x63\x65\x9e\xb3\
\x60\x29\x01\x25\x0c\x2d\xc1\xab\x48\x9e\x2a\x80\xa4\x72\x71\x17\
\xa7\xca\x75\x20\xa9\xba\xef\x73\x48\x90\x74\x8c\xd1\x49\x7a\x3c\
\x46\x12\xf2\x58\xa8\x4f\x06\x0c\x31\x1e\xca\x40\x30\x8d\x03\xd2\
\x59\x7d\xc4\xcc\xd6\x51\xf4\x64\x29\x70\x08\x16\x69\x5c\xf7\x9b\
\xc0\xad\xf3\xf9\x9c\x80\xd2\xa9\x60\xf0\x47\x4d\x28\x18\xe8\x42\
\x73\x21\x62\xe7\x7e\x1a\xc0\xab\xc7\x0d\xfb\x58\x23\x9d\x99\x2f\
\x72\x8c\xef\xc9\x58\xc2\xe5\x97\x05\x8e\xbc\x9c\x00\x4e\xc3\xd2\
\x8b\x95\xd2\x8a\x86\x39\x73\x62\xde\xc0\x0a\xe3\x68\x43\xa8\x54\
\x19\xb0\xac\x3d\x33\x0d\x38\x1c\x7c\x7d\xc1\x48\x17\xe0\x08\x93\
\xcb\xdd\x8e\x35\xfb\x78\xf4\xd0\xc4\x38\x09\x36\x0b\x65\x65\x39\
\x51\x57\x30\xc6\x9d\x31\xc4\x03\x33\x39\x12\x75\xa0\xd8\x4e\x88\
\x87\xf6\xac\x51\x1f\x0d\x79\xff\x4e\xb0\x06\xb8\x18\x87\x38\xde\
\x6a\xc1\x30\xea\xad\x1c\xf7\x52\xba\xb9\x94\xd7\x31\xac\x87\x3d\
\x73\xdf\x30\xe7\xc6\x7a\x48\x93\x72\x25\xe5\xb0\x20\x7f\xea\x12\
\xac\xe2\x80\xef\x3f\xca\x7c\xc1\xaa\x01\xb2\x38\xc2\xab\x1a\x87\
\xb9\x24\xc8\x42\x65\x92\x71\xd3\x71\xc9\x22\x8d\x7a\xd6\xbf\x98\
\x79\x89\xa2\x5b\x17\x9a\x11\xe4\x88\xf6\x8f\xbf\x9e\x88\xfc\x60\
\xa3\xdc\x08\x4c\xab\x5d\x19\x1c\xbe\x7c\x2b\x9e\x51\xfd\xf4\x82\
\xa8\x84\xd4\xc7\x9d\x01\x85\x04\x84\x02\x92\xf5\x50\x99\xfa\x33\
\x4f\x97\x14\x76\x01\x98\x90\xe6\x0a\x40\xc9\xfa\x87\xa4\x9e\x3a\
\x4e\x1e\x38\xf5\xde\x02\x24\x0e\x6a\xbc\xe2\xb8\x14\x58\x5c\xee\
\x1d\xf5\xcd\x91\x5a\xf1\xe4\x62\x65\xb5\x07\x04\x75\x5c\xca\x8d\
\x04\x82\x90\xab\x1e\xd9\xcb\xd4\x7c\x16\x26\x01\x03\x8d\xe3\xcd\
\xc3\x93\xed\x2b\x57\x0d\x90\xb6\x75\xaf\x49\x9d\xd2\xfb\x1c\x8a\
\x4d\xc4\xa7\xeb\xe9\x5c\xf8\x3b\xe3\x25\x55\xab\x93\x7b\x2b\xcc\
\x69\xb0\xd8\x0f\x2a\x43\x4c\x42\x49\xb5\x72\x85\x49\xf1\x00\x90\
\x93\xa6\x5c\x94\xbd\xe0\x48\xab\x62\xee\xb6\x15\x3f\xaf\xe9\xa4\
\xe0\x49\x77\x6d\x81\x4d\x2c\x50\xac\xf0\xf7\x5d\x4e\x03\xc3\xba\
\x87\x23\x8b\x99\x7e\x84\x78\x12\x4e\x52\xef\x91\x36\x49\xb9\xfc\
\xfe\x91\x49\xe4\x78\xa4\xc5\x28\xb9\x7f\x0d\x08\x24\x23\x49\x10\
\x84\xb6\x10\xc0\x21\xe6\x38\x3c\xa3\x2e\x21\x33\x46\xd0\x9d\x15\
\x7e\x2f\x5f\x8e\xcb\x72\xa9\xe4\x56\xc8\xb3\x73\xf8\xb1\x55\x01\
\x64\x71\xc8\x5f\xb7\xe7\x24\x9e\x59\x64\x0c\x79\x49\x61\x2f\xd8\
\x20\x2e\x2b\x23\x81\xe4\xbd\x90\xd9\xea\x11\xd4\x2b\x39\xf2\x50\
\x00\x80\xca\x13\x03\x2f\x26\xc2\xe6\xc7\x72\xaa\x8c\xd3\x93\x59\
\x02\x87\xec\x5b\x1f\x6b\x44\xd0\xc8\x95\x3e\xb1\x89\x64\x0e\x16\
\x02\x9d\x03\xba\x27\x9d\x29\xd5\xad\x04\x5d\xb7\xc7\x13\xfa\x67\
\x99\x6a\x2c\x48\xc2\x2a\x6f\x40\x32\x71\x7c\x51\xc8\x87\x5c\xa0\
\x42\xfb\xbe\x5e\x3f\xdf\x25\x39\x90\x72\x52\xd2\x56\x5c\x21\x4d\
\xcb\x2c\xc6\xca\x2c\x33\xae\xde\x7f\x62\xf9\xda\x15\x03\xe4\xc1\
\x45\xf7\xca\x1f\xf8\x1b\xa2\x93\x4d\x1f\x22\xfb\x80\xd3\x7d\xb9\
\xc9\xd9\xf2\xf1\x85\x12\x8a\x5d\x14\x78\x69\x73\xf4\xb0\x87\x1c\
\x4c\xb5\x92\xc5\xf1\x2f\xaf\x5c\x8a\x95\x0c\xa0\x0c\x03\xad\x0c\
\x1c\x13\x80\x91\xad\xee\x96\x75\x0a\x6a\x56\x04\x53\x9f\x7a\x25\
\xc1\x23\x01\xd3\xd7\x66\x29\x7d\xa5\x20\x71\x19\x20\xc6\x8d\xaf\
\xf4\x36\xe6\xe0\x97\xec\x11\x3e\x4d\x3f\x0a\x9a\x84\x73\x9c\xcb\
\x8f\x11\xf6\x24\x73\x3d\x72\x69\xcd\x81\x54\x07\x11\x0f\x7e\xa4\
\x0f\x07\x45\x2f\x16\x33\xd7\xbf\xfe\x25\xf7\xfd\xb7\x1f\x25\xbc\
\xf5\x36\xc2\xbf\xbb\xca\x29\x35\xa9\x2c\xfc\x22\xbd\xd4\x29\xc7\
\x11\xed\x71\x35\x88\x03\x65\x05\xb1\xc0\x1e\x6a\xf5\xc9\x47\x5f\
\xd2\xb2\x9a\x10\x4e\x6a\x40\x71\xe3\x50\xa8\x09\x10\x65\x2c\x38\
\x58\x0a\x22\x92\x90\x71\x21\x2d\xc4\xfd\x22\x98\xf2\xe4\x7d\x8c\
\x4f\xf0\x64\x85\x4a\x42\xb1\xb0\xa1\xe0\x33\xbb\xea\x84\xd7\x2a\
\xe6\x77\xf1\xe0\xae\x95\x3b\x89\xec\x3f\xd5\x1f\x24\x70\xe8\xce\
\x6a\x39\x00\x44\x69\xac\xc3\x00\x98\x8d\x41\x26\xbf\x18\x90\x07\
\x44\x25\x41\xd7\xcd\x19\x89\xf1\x8b\x4d\x85\xef\x8c\x98\xb2\x4c\
\x21\x4d\x8c\x13\x03\x4c\xc9\x3b\xe5\xc8\xcb\x4f\x70\xef\x12\x69\
\x57\x2f\x0b\xf5\xcb\xa1\xcb\xf3\x32\xb7\xf7\xe8\x12\x7e\xf7\xfd\
\x77\xc7\x93\xcb\xe1\xb3\x02\xf0\x43\x2f\xb9\xf8\x07\x98\xf9\x3f\
\x96\xfe\x84\x42\x11\x20\x4b\x0d\xbe\xe9\x43\xf7\xd3\x13\x00\xe0\
\x9d\x77\x11\xae\x38\x8f\xf0\x6d\x4f\xd0\xea\x95\x8b\x80\xf1\x71\
\xd1\xb9\x80\x78\x67\x2e\xa9\x23\x86\x05\x29\x02\x42\x50\x6d\x90\
\x89\xc8\x1e\x61\xd5\x11\xf9\x09\x08\xa5\xa5\x4a\x5c\x92\xfa\xfd\
\xa4\xb3\x04\x59\x88\x4b\xe3\x73\x1c\x38\x82\x50\xab\xf4\x94\xa6\
\x80\x21\xd3\x21\xee\x63\x5c\xe3\xa5\x2f\x50\xa8\x23\x82\x84\xd3\
\x21\x2a\xf2\x63\x44\xb1\x24\x52\xe1\x00\x88\xf4\xbf\xcc\xe3\x1e\
\x90\xc0\x39\x10\xaa\xb4\x4f\xe2\x7d\xb3\xec\xfc\xcf\x4c\x57\xe8\
\x7e\x1d\x45\x7e\x63\xb0\xb8\xd0\x99\x31\xf2\x7d\x05\xec\xce\x3a\
\xc5\xa3\x62\xe9\xdd\x12\x60\xc2\x34\x2a\x2d\x85\xc9\xc8\x56\x27\
\x77\xce\xef\x83\xa8\x3f\x55\xed\x80\x9d\x3b\xe6\xb1\x69\xb6\xc2\
\x57\xf7\x9c\x88\xa3\x11\xdc\xe3\x1f\xfe\xdc\xfe\xcb\x5f\xf5\x9d\
\x17\x7f\x03\x80\xec\xd7\x18\x8b\x2a\xd6\x5f\x3e\xe8\xbe\xef\x4b\
\x87\xc2\x04\x12\x7e\xe1\x8b\x15\xee\x5b\x10\xc2\xae\x8c\xa5\x44\
\x57\x8e\x8d\xaa\xc5\x9a\x65\x24\xa0\x02\x7b\x44\x40\x84\x79\xd5\
\xd2\x8f\xa4\x3a\xa1\x87\x3d\xfa\xb0\xa1\xa9\xda\x50\x4b\xd9\x63\
\x15\x40\x34\x0e\x1c\x4a\xa5\x0a\xe9\xe4\xfb\x28\x56\x5e\xeb\x39\
\x92\xea\x58\x2c\x5b\x50\xb1\xec\x25\x55\xb4\xc8\x74\xe5\xba\x93\
\x8d\x96\xab\x7a\x5a\xe5\x82\x4a\xd7\xef\x0b\x33\x1e\x42\xf5\x34\
\x16\x79\xc9\xa8\xb6\x57\x79\xd1\x92\xf3\x59\x98\x6f\xb1\x78\x84\
\xba\x83\x3c\xc9\x85\x59\xd9\x21\x42\xf6\xa2\x1c\x9a\xc5\xfa\x25\
\x2f\xbc\x18\xc1\xcf\x4d\xec\x40\xcc\x20\x76\xb8\x7b\xf7\x22\x3e\
\xf6\x3f\x0f\x15\xbf\xb3\xde\x03\x90\xea\x65\x92\xfa\x1b\x26\xfc\
\xd7\x7b\xaa\xcc\x8b\x60\x99\xa3\xf8\xe9\x3b\xac\xc1\x11\x8c\xf3\
\x04\x0c\x3b\xd0\x71\xc2\x12\x95\x4c\xcd\x1e\x76\xc2\x20\xca\xf6\
\xf9\xdc\x63\xbb\xca\xfe\x29\x83\xc3\x0a\x59\x5e\x56\xc4\x9d\x14\
\x6e\x69\x57\x20\x82\x7f\xbc\x07\x4b\x02\x76\x52\x7d\x1a\x10\x1a\
\x40\xfd\xfd\x67\xd3\x9f\xd2\x02\x63\x17\x9b\x6c\x3f\xa3\xb8\x10\
\xc9\x31\x17\xf2\x9f\x26\xc5\xcf\xaf\x00\xa7\x6a\x27\x89\x88\x35\
\xd6\x9d\x0b\x2c\x51\x90\x3b\x67\xe5\xaf\xbb\x7f\xc1\xb3\x2e\xc0\
\xe6\xd9\x3a\x82\x04\xce\xc5\xf8\x67\x6e\x39\xf2\xbf\x4d\x05\x90\
\x23\xcb\x7c\xed\xa7\x1e\xe6\xcb\x33\xd0\x3c\x4c\xf8\xc4\xbe\x2a\
\x13\xf4\x80\x58\x67\x3a\x2d\x5f\xc8\xb1\x4e\x77\x42\x68\xd5\x60\
\xc4\xd5\x83\xc5\x20\xa6\x45\xa6\x03\x93\x5e\x6d\x4a\xcc\x91\x4d\
\x90\xf3\x65\x3d\x03\xa5\x53\xaf\x10\x9e\x19\x98\xab\x07\x1c\x28\
\xa5\xe7\x80\xc9\xdc\xab\xc5\x15\xdf\xa6\x97\x2e\x6b\xac\xeb\x3a\
\x62\x1b\x2e\x07\x44\x6e\xc4\x8f\x03\x79\xa1\x1f\xc2\x3e\x4b\x9b\
\xa4\x49\x05\x55\x4e\x8f\x12\x18\xe2\xfb\x9b\x79\x0b\xb7\x28\xcf\
\x77\x02\x8c\x96\x0f\xad\xb2\x73\xb6\xe0\xe6\x72\x26\x59\x05\x18\
\xcc\xd4\xf8\xba\xe7\xec\x04\x39\x8e\xec\x41\x9e\x19\xff\xe1\xce\
\xc3\x57\xde\x77\x70\xe9\xaa\x89\x00\x79\xf7\x9d\x78\xe9\xfd\x27\
\x4a\x86\x23\x61\x53\xcd\x1a\xb5\x0a\x0c\x6c\x5e\x40\x53\xa1\x4e\
\x2f\x81\xc2\x0f\x7e\x18\x24\x88\xbc\x9e\xc1\x2f\xaf\x56\x50\xe5\
\xac\x5b\xd2\x7a\xb2\x62\xbd\x4e\xf4\x23\xe8\xa8\xc1\x60\x8c\x9a\
\xfa\x38\x61\xd3\x80\x29\xa5\xab\x15\x5e\xa8\x59\x61\x33\x31\xbb\
\x8c\x7a\x95\x03\xc6\x02\xa5\x9c\xae\xd2\xec\xfb\xf8\xf7\xd4\xf7\
\xa1\x7f\x3e\x22\x3d\x58\x66\xec\xb2\xbd\x91\xb1\xf3\x92\xca\x69\
\x4a\x49\xf3\x9d\x34\x06\x39\xff\xdd\x33\xce\xe5\x32\xa6\xb5\x19\
\x09\x9a\x1c\x28\x8e\x81\x17\x3f\xef\x22\x24\xf6\xe8\xde\x8f\x1c\
\x63\xff\xa1\x25\xbc\xfb\x63\x0f\xbe\x74\x22\x40\x3e\xbd\x0f\xdf\
\x59\x40\x07\xb6\xcd\x30\x9e\xb7\xa3\x00\x82\x52\x87\x99\xb5\x7a\
\xc5\x05\xf5\xca\x80\x42\x1a\xe7\x01\x14\x25\x55\xa9\x7f\xd0\xed\
\xc0\xa7\x32\x91\x69\x20\xeb\x2c\xab\x74\x4a\xa8\x02\x48\xac\x90\
\x65\xe0\xf0\xcf\xba\x55\xee\xac\xf7\x6d\x18\x9a\x0d\xc2\x04\x9a\
\xd4\x5e\x11\x10\x86\x4d\x12\x78\x7a\xfa\x8f\xf2\xfb\x24\xa1\x17\
\x97\x0b\xf3\x95\xca\x4c\xc7\x22\x1a\x14\x6c\xea\x97\x60\xe9\x8a\
\x27\xe7\x4c\x00\xcb\x44\x35\x6b\x8a\xeb\xa9\x97\x6f\xc3\x85\xdb\
\x67\x13\x83\x08\x75\xeb\x0b\x77\x1e\xfe\xae\xb1\x00\x61\xe6\x2d\
\x5f\x3e\x8a\x17\x95\x00\xf2\xe2\x5d\x8c\x0a\x79\x47\x2c\x52\xcb\
\x1d\x33\xea\x55\x6a\x2f\x03\x05\x02\xdd\xb2\x49\x8f\x79\xc8\x9f\
\x51\x03\x5f\x60\x0f\xb5\xea\x89\x67\x0b\xaa\x95\x05\x4b\x52\x55\
\xf4\x7d\x06\x8e\x1e\xc0\xa4\xf2\x05\x36\x59\xb5\x8a\x35\x66\xe7\
\xbc\xa7\x6f\xa5\xf7\xe8\x07\xbd\xb9\x8a\xe3\xa6\xc7\x55\x2f\x52\
\xf9\xbc\x40\x24\x6b\x84\xc8\xb1\x17\x93\xa0\x9e\xf1\x60\x81\x91\
\x2b\x4c\x96\xb7\x4c\xb3\x01\xf0\x75\xcf\xbd\x10\x92\x19\x83\xc1\
\xbe\x7b\xff\xa9\x6f\xbc\xef\x3e\x56\xbf\x0f\xa5\x00\xf2\x8b\x37\
\xe2\x1b\xef\x5d\xc0\x5c\x09\x20\xdf\x78\xa1\x9b\x0a\xa1\xb6\x33\
\x56\xa3\x71\x62\x35\x92\xf4\xaa\xc0\x92\x20\xa4\x40\x11\x16\x93\
\xc0\x3a\xe3\xa9\xdb\xb0\x47\x69\x25\xe4\x5c\xb5\xd2\x02\x33\x8d\
\x50\x95\x00\x63\xd5\x1e\x60\xdc\xce\x7a\x14\x78\xa3\x5e\x15\x8d\
\xf5\x29\x77\xce\x35\x6b\xf4\xf7\xdf\x7a\xb1\xba\xb1\xc8\x55\xad\
\xf2\xe6\x60\x1a\xdf\x71\x0c\x22\xe7\x0b\xa1\xa8\x04\x8b\x9c\x74\
\x01\x0a\x40\xf7\x8b\x39\xa9\xf8\x4a\xa6\x2c\x70\xfa\x2e\x8f\x89\
\x17\x3c\xf7\xc2\xc8\x20\xa9\x32\x87\x03\x47\x96\x36\xff\xe2\xfb\
\x6f\x52\x04\xa1\x00\xf2\x17\xf7\xe3\x25\x25\x70\xcc\xd7\x8c\x6b\
\x77\xb8\xcc\x00\x4a\x6a\xe8\x34\xe9\xa9\x2f\x1a\x02\x5c\x18\x0c\
\xa3\x5a\xc5\x51\x65\x31\xba\x7e\x58\x0b\xa0\x60\x51\x4f\xe9\xb9\
\xf4\x05\x28\xd9\xa6\x30\xc2\x21\xee\x4b\x65\xa6\x00\xd0\x4a\x76\
\xd6\xb9\xa4\x66\xb9\xe4\xd6\x0d\xc2\x5e\x66\xa1\x54\xe7\x64\x00\
\xf4\xec\xa4\x87\x34\x74\xef\x9f\xbf\x23\xf4\x82\x56\x72\xb7\x8b\
\xbe\x66\x73\x62\xe6\x56\x4e\xac\x5d\xdc\xe2\x98\x7b\x90\x04\xe6\
\x88\xf2\x52\x14\xfe\x3e\x2d\x86\xd5\xc2\x1c\x80\xf4\x94\x27\x6d\
\xc3\x05\xdb\x66\x90\xdc\xbd\xde\xe5\xeb\x1c\x6e\xfc\xf2\x91\x6f\
\x96\xed\x29\x80\x3c\x74\x12\xdf\x88\x42\x78\xde\x0e\xc6\x6c\x35\
\x1e\x9d\xa5\x8e\x73\x21\x3d\xad\x3a\xe3\xbc\x57\x61\x34\xd2\x08\
\xea\x15\x49\x8e\x6c\xb8\xd5\x6e\x46\x76\x62\x02\x50\x76\x55\xc6\
\xb1\x2f\x00\x21\x08\x8b\x16\x36\x5d\xae\xa8\xd7\x3b\x9b\x2e\xf3\
\x0a\xfb\x24\x63\xd5\x2c\xa3\x5e\x45\xbb\xb2\x00\x94\x08\x22\x60\
\x3c\x48\xe4\x7b\xf8\x74\xb1\x28\xe4\x6c\x92\xc6\x3b\xb2\x08\xe4\
\xa7\x90\x5c\xc5\x20\x12\x18\x62\xae\xd4\x3c\x9a\x79\x08\xf5\xc4\
\x49\xcd\x65\xa5\x24\x4f\x7d\x72\xd6\x2b\xab\x00\xae\x7e\x66\xf0\
\x66\x05\x16\xe9\x06\x77\x61\x61\x59\x61\x20\x02\xe4\xfb\x6f\xe3\
\xd9\x85\x21\x5e\x58\x02\xc8\xd7\xee\xe4\xb1\x42\xaf\x98\x03\xfd\
\xe9\x69\x3c\xd8\xb4\x50\xf2\x5e\x75\xa3\x63\xc7\x0f\x62\x62\x62\
\x9e\x64\x20\xf5\x29\x24\x42\x4d\xbc\x61\x0f\xe9\xb5\xb2\xc2\x1f\
\xf7\xa6\xad\x10\x8d\x31\x7a\x39\xaf\x2b\xe5\x19\x03\x3d\x53\xa5\
\xa8\x90\x06\x51\x67\x02\xeb\x4a\xf6\x3a\xd4\xa7\x7c\x9f\xd2\xa9\
\x00\xb6\x5e\x3b\x29\xd0\x7a\x1c\x43\x66\x04\x83\x19\xff\x6c\xde\
\xc5\x02\x18\xab\x90\x73\x14\x6e\x15\x42\x43\xb2\x9e\xf7\x92\x7d\
\x9b\xcb\x9f\xd6\x6a\x82\xec\x5e\xfd\xcc\x5d\x11\x14\xc1\xdd\x4b\
\xec\xd0\x8c\xda\xaf\xc3\x4b\x3e\x1d\x4f\x98\x44\x80\xdc\x78\x1b\
\xbe\x76\xc8\xd8\x82\x2c\x30\x5e\x70\x81\xcb\x1a\x67\x4e\x14\x16\
\x01\x83\xbc\xa3\xaa\xc3\x71\xb4\xd3\x20\x4b\x8f\x88\x4d\x4b\xab\
\x93\x18\x65\xc8\xb2\x69\xb4\xe4\x26\xa2\x1a\x45\x66\x7d\x94\xda\
\x09\xe6\x82\x6e\x37\x08\x0c\xdb\x74\x23\x5c\xb9\x1a\xd2\x2f\x94\
\x7a\x57\x5b\xd6\x27\xec\x14\x27\xae\xc0\x42\x62\xaf\x26\x03\x96\
\x62\x14\x9b\x5e\xee\x0f\x0b\xb0\x97\x40\x9c\xd6\xa7\x64\x7f\xa8\
\x71\x09\x63\x2c\x6d\x91\xa8\x6a\xa5\x31\x4f\xb7\x3a\x5d\xd7\xa5\
\x01\xa1\x01\x24\xfa\x13\xc1\x23\xfb\xc2\xca\x38\x2f\xcb\x59\x2e\
\x9b\x72\x51\x67\x00\xcf\x78\xea\x0e\xd4\x04\x90\xd8\x2c\xec\xbe\
\x6d\xea\xb6\x5f\xbe\x63\xf1\x9a\x20\x0d\x11\x20\x47\x96\xf1\x4d\
\x28\x84\x0b\xe7\x80\x27\x6e\x62\xdd\x10\x0a\x8d\x9a\xcb\xf5\x7c\
\xa6\x60\x58\xc3\xa7\xc0\xa4\x29\x26\x91\xc0\xf0\xe5\xd2\x64\xa4\
\x2b\x2d\x6c\xb9\x0b\x31\x03\x59\x81\x3d\xac\x8a\x35\x56\xd8\xec\
\x9e\x82\x58\x91\xb5\x70\xfb\xb8\x13\xa0\x28\x32\x06\xf4\xbd\xda\
\x39\x07\xc6\xef\x81\xe8\xbe\xdb\x7e\x95\x41\x2d\xca\x4c\x60\x91\
\x38\x1f\x62\x2c\xad\xfa\xa3\xe7\x41\x32\x4b\x9a\x87\xb4\xd6\x19\
\xa1\x60\x21\x17\xaa\x39\xd9\x81\xf1\xf2\x65\x65\x50\xc9\xa9\x78\
\x76\xf3\xe6\x19\x5c\xfe\xc4\xf3\x00\xe6\xc8\x1e\xe4\x27\x66\xd4\
\xb6\x11\x0b\x11\x20\xcb\x0e\x2f\x46\x21\x5c\xb3\xa3\xeb\x98\x53\
\x8d\x74\x5d\x76\xe2\x75\x02\x6a\x93\x3a\x95\x8c\x22\x2b\xd7\x51\
\x88\xc3\xa0\xc4\xc1\x82\xb9\x04\x2b\xc8\xc2\x42\xe6\xcb\x4c\x60\
\x41\x91\xfa\xa4\xf4\x66\xd5\x3e\xa0\xbe\x57\x1e\x54\x19\xb3\xa2\
\xf6\x31\x85\x7a\xa6\xb4\x42\x4f\xb3\xb3\x5e\xbc\x74\x99\x58\x47\
\xef\xce\xf9\xb8\xfe\xc9\x39\x08\xaf\x65\xfb\xde\x8d\x43\x3e\x36\
\x49\x58\x73\xf7\xbc\x98\x5c\x53\x7f\x1a\x7b\x31\x37\x3e\x33\xcd\
\x61\x61\xee\x65\x5d\xf1\x79\x3d\xf7\x0c\xc3\x18\xe1\xde\xcb\x5e\
\x57\x46\xc4\x85\x4c\x3a\xee\x58\x44\x7b\x42\x3a\x55\x8b\x05\x16\
\x3c\x40\x98\x1a\x87\xaf\x43\x21\x3c\x67\x7b\xd0\xdf\x92\xb0\x5a\
\x64\x2a\xe4\x86\x32\x30\xe9\x71\x42\xc4\xfa\x20\x23\x52\x68\xc3\
\xab\xa9\x81\x36\xc0\x88\x69\xdd\x95\xc6\x95\x45\x75\xc9\x98\xcc\
\xa8\xde\x0b\x45\x57\x4e\xae\x92\x05\x15\xc3\x30\x8a\x02\xde\x44\
\x70\x14\x5c\xb1\xca\xe5\xeb\x9f\x73\x30\x3b\xe9\xa2\x6d\xe3\xda\
\xcd\x59\xa3\xbf\xfd\xa2\x9d\xd2\x67\x94\x17\xc6\x82\x4b\xe5\xe2\
\x98\x07\xa7\x4a\x9c\xdc\xc2\x5c\x84\xc9\x97\x2a\x70\x88\x84\x31\
\x94\x03\x2e\x65\x43\xd4\x9b\xa4\x22\x4e\xbd\x92\x3d\x98\x4f\x23\
\x9f\x4a\xd3\xf1\x65\xae\xbc\x62\xbb\xf0\x62\x05\x06\x61\xc0\xb5\
\xd1\xd5\x5b\x01\xc0\x0b\x3e\x8a\xcb\x86\x0e\x17\xa1\x10\x9e\xb5\
\x8d\x8b\x0d\x67\x74\xe6\x5f\x40\xab\x5c\x92\x5d\xc4\xe0\xc8\x97\
\x36\xab\x51\x66\x7f\x84\xd1\x80\xb9\xe7\x34\x50\x7a\x32\xc4\x44\
\x15\x56\x26\xd5\x07\x35\x2f\xf6\x98\x3a\x50\x64\x8f\xa2\x1b\xb8\
\x7f\xe5\x2e\x97\x91\x6a\x98\xd9\x59\x17\xe5\xe5\x71\x13\xfb\xac\
\x06\xc0\x24\x46\xf3\x71\xf8\xf7\x34\xa0\xc8\x1c\x10\xbe\x9c\x95\
\x59\x35\x7e\x6a\x4c\xcb\x6a\x96\xc4\x81\xbe\xc9\xe7\x35\x11\x50\
\x9a\xb3\xee\x11\x0d\x92\xd0\x46\x60\x8c\x50\x46\x81\x00\x5a\xe6\
\x8a\x17\x80\xa7\x5c\xb6\x3d\x9e\xc5\x0a\x9e\xac\xce\xab\xe5\x9e\
\xf4\xe4\x7f\xfe\x81\x27\x00\x1e\x20\x0f\x1e\xc5\xf3\xd3\xcc\xa7\
\x30\x57\x31\x9e\x72\x5e\xa2\x2e\x09\x84\xc0\x04\x5d\x67\xb4\x77\
\x21\x8e\x11\x64\x87\xd4\x8c\xf8\x41\x31\x2f\x1f\x46\x45\xce\x08\
\x12\x40\xb3\x95\x47\xcd\x9a\x49\x4b\x8f\xa7\x41\xb4\x2b\x94\x12\
\x78\x28\x21\x92\x82\x3a\x5d\x9a\x10\x44\x05\x8e\xb2\x50\x73\xcf\
\x86\x61\x9f\x07\x2b\x6d\x1e\xa2\x50\x5f\xa9\xdd\xd2\x3b\x96\x98\
\x32\x07\x02\x4f\x00\x4a\x51\xcd\xb2\xe3\x8e\x30\x57\xd6\xc3\xc5\
\x62\x4e\x74\x05\xac\xff\x1b\x2b\x27\x5a\xb6\x0a\xf2\xc6\x05\x19\
\x05\x94\x1d\xb2\x73\xe7\x66\x6c\xda\x54\x9b\x4d\x43\x07\x38\xa6\
\x16\xf5\xb5\x80\x07\xc8\x52\x8b\xab\x51\x08\x57\x9c\xc7\x98\xa1\
\x32\x83\x14\xd1\x29\xca\x28\x07\x47\x1c\x0c\x3d\xc8\xea\xbe\xc8\
\x12\xe2\xb9\x30\x70\xa2\x4e\x09\x0c\x3b\x01\x91\x61\x54\x9a\x2c\
\x9b\x33\x86\xae\x6b\x1c\x7b\xc4\xb9\x8f\x69\x5c\x04\x8b\xbc\xec\
\x1e\x09\xa0\xc1\x03\x64\x5f\xbd\x2d\x94\xd1\x3f\x31\x94\x3e\x6d\
\x7b\xb9\x1b\x57\xbe\x67\xce\x22\x7d\x8c\x91\x16\x9d\x5c\xbd\x84\
\x5c\x74\xcc\xb8\xeb\x39\x11\x59\x62\x1e\x21\xd3\xcc\xfc\x5b\x79\
\x28\x6d\x18\xca\x47\x4b\xf2\x36\xf6\x42\xf7\x8d\xc2\x4b\x2f\x3e\
\x0f\xe1\xd8\xbb\xfc\x8e\x08\x37\xee\x1a\xc0\x03\xa4\x01\x9e\x83\
\x42\xb8\x72\xab\x60\x8c\x82\x8c\x65\x69\xa2\x71\x39\x28\x5a\xc8\
\xcd\xcb\xb3\xcc\xd0\x03\xab\x86\x44\x50\xaa\x6d\xa0\x04\x18\x8e\
\xed\x70\xde\x86\x6a\x1b\xd0\xdf\xf2\xa3\x14\x5d\x09\xa3\x28\x00\
\xf5\xa9\x5a\x65\x55\x29\x1e\x33\x91\x13\x28\x8f\x9b\x14\x77\xe3\
\xcb\xed\xe8\xbe\x4d\x62\x0c\xa1\x2e\xc6\x41\x31\xec\xd1\x3b\x66\
\x52\xc8\x73\x96\x50\x73\x22\xd0\x99\xcd\x95\xa9\x52\x83\x94\xd5\
\xbd\x65\x92\x71\xf2\x36\x56\x4e\x45\xda\x13\x2e\xde\xe2\x41\x11\
\x07\xbe\xeb\xbf\x6b\x9f\x03\x78\x80\x38\x46\x76\x0e\x1e\x0c\x5c\
\xb1\xc5\xa8\x4e\xa5\x4e\x70\xa9\x53\x9c\x77\x4c\x0c\x9e\x19\x29\
\x83\x84\x2e\x4d\x2d\x20\x99\x1e\x2a\x26\x27\xd6\x65\x06\x5c\x36\
\x2e\xfa\xa9\x0b\x25\xad\x32\xcb\x9b\x54\x56\x82\xc9\x82\x01\xa2\
\xfc\x18\x61\x4e\x3b\xeb\x7d\xea\x55\xdf\x31\x76\x53\xaf\x6f\x2f\
\x82\x5a\xe6\x87\xbe\xd8\xf7\x57\x40\xc8\xdf\x79\x5c\xd9\x6c\xd1\
\xf3\xe3\xaf\x05\x9d\xf5\xd4\xca\x39\xb2\xb2\x10\xa3\x46\x10\x64\
\x9a\x79\x26\x63\x0b\x08\xb9\x13\x7d\xec\x95\x59\xff\x79\xd1\x85\
\x5b\x10\x6c\x10\xf9\xfd\x10\x62\xbe\x0a\x00\xaa\xef\xff\x00\xd7\
\x2d\xe3\xa9\x59\xc7\x18\x78\xf2\x16\xd1\xa0\xe9\x0c\x6c\x7a\x10\
\xea\x9e\x8e\xa9\x77\x1e\x1b\x4c\xe1\x92\xea\x95\x45\xd3\xa0\xe9\
\xa5\x2c\x94\xb3\xb3\x6f\x4a\x48\x00\xd8\x78\x36\xc9\x36\x5f\x98\
\x6e\x2c\xd2\x4a\x60\x19\xbb\x47\xe2\x2f\xf5\x0d\xc2\x54\x26\x01\
\x45\xd7\x57\x04\x85\x12\xfc\x7e\x7b\x22\x0e\x95\xcd\xcf\xe2\xa5\
\x61\x0d\x1e\x2c\x9d\xa6\xc7\x96\x73\x60\xf6\xa8\xd2\xa9\x8d\xf1\
\x12\x62\xab\xca\xe4\x2c\xa6\x49\xd9\xe5\xf8\xac\x05\xd6\xce\x0b\
\x36\xa7\x23\xef\x1c\xc1\x01\x76\xfc\x34\x00\x34\xb8\x17\xb8\x74\
\xe4\x90\xff\x09\x58\x06\x2e\xdb\x92\x7a\xce\xa5\x86\x99\x33\xe1\
\x2f\x81\x29\x01\x2a\x1f\x1c\x29\x7c\xc1\x83\x91\x8d\xa1\xac\x5c\
\x0d\x94\x28\xac\x2b\x4a\xc2\x5d\x42\x73\x8f\x9f\x3f\x13\x76\xf8\
\xb2\x63\x80\xa1\xfb\x36\x61\x17\x5e\x0a\xb9\x55\x75\x54\x3f\x52\
\xd3\x60\x8e\x3f\x2e\xd0\x8d\x50\xf8\xa1\x05\xf2\x05\x09\xea\xe1\
\x50\x36\xac\xb4\xe4\x93\xd8\x97\x33\xf9\x08\x7f\x52\x3a\x54\x05\
\x98\x78\xe1\x39\x09\x32\x0e\x3f\xae\x20\x07\x43\xbe\x4f\x10\xd1\
\xf4\x1b\xf4\x72\xe1\x49\xa3\x48\x22\x81\xd5\xf8\x12\xcb\x0e\xe9\
\x51\xc8\x84\x5e\x8c\x86\x04\x8e\x04\x4b\x3c\x28\x0a\x60\xc7\xf9\
\xf3\x1d\x7b\x84\x5f\x8d\x20\x3f\x47\x44\x5b\xaf\xf8\xee\x3f\xbb\
\x68\xf0\xc0\x32\x9e\x6c\x5a\x07\x1c\x30\x43\x8c\x0b\xe7\xfd\x1f\
\x1c\xb1\x92\x29\x1a\x85\xe8\x44\xc8\xb6\x38\x08\x65\x54\x1d\xb2\
\x58\x26\xf8\xe5\x3b\xf5\x60\xa1\x8d\x38\xea\x62\xc5\x48\x69\x7d\
\x21\xd7\xb3\xd9\x82\x61\xa2\x2a\x56\x62\x94\x69\xdc\xc0\x5d\x3c\
\x75\x99\x4c\xe5\xf0\x62\xa5\x10\x93\x7d\x32\x90\xfe\x76\xba\x2c\
\xaa\x80\x90\xfa\xaf\x7e\x04\x5b\x00\x90\x39\xfc\x40\xb6\x4c\x1f\
\x13\x7c\xc7\x93\xf0\x07\xc1\xd6\x02\xad\xc7\x0a\xe5\x7c\x5d\x65\
\xc4\xad\x2a\x9d\xcd\x91\x78\x26\x34\x1f\x9a\x62\xfd\x7c\x9a\x0b\
\xdd\xda\xd6\x6d\x73\xe8\xbc\x1e\xa9\x3f\xfe\x5d\xc8\x9d\xe2\x2b\
\xaa\x83\x4b\xb8\x2c\x7b\x09\x06\x76\xcd\x02\x33\x61\xcc\x7b\x10\
\x6a\xdf\x3b\x52\x9c\x29\x1b\xf5\xcb\x6c\x90\x0a\x6f\x67\x5e\xbb\
\xa4\x36\x65\xc5\x38\xcf\xd0\x3a\xad\x6d\xab\x54\xb6\x54\xb9\x09\
\x63\x80\xa3\xba\x5f\x04\x4e\x78\x17\x63\x9c\x33\x50\x3e\xd1\xdb\
\x6f\x83\xe4\x93\xad\xd9\x88\xd1\x93\x9f\xc5\xfb\xde\xd1\x47\xfb\
\xc6\xc5\xce\x21\x0a\xa7\x13\xb2\x3e\x14\x9a\x65\xd9\x86\xcd\x2d\
\xc8\x87\xaa\x93\xf3\x45\xda\xb4\xd9\x27\xab\x52\x2e\x37\x6f\xb6\
\xdf\x2e\x64\x04\x9b\xc4\xb5\xb8\xbc\x02\xe1\x89\x59\xbf\x18\xb8\
\x78\xde\x9c\x80\xe1\x72\x43\xb6\x33\x99\xbc\x1b\xe1\x8e\xd9\xe3\
\x26\xa9\xfc\x88\xc1\x50\x6a\x8d\x8b\x15\xf6\x8c\x52\x0c\x34\x39\
\x6e\x85\xbe\x2f\xde\x07\x9c\x20\xe8\x00\xca\x47\x56\xa0\x04\x3f\
\xff\x45\xc5\x94\x6f\x41\x31\x76\x73\x4f\xbe\xc7\x04\x21\xcf\xa7\
\x67\x8a\x71\x91\xcf\xf5\x09\xb8\x54\x9f\xe5\x5c\x59\xc1\xe9\x79\
\xdc\x86\xb2\xbc\xb0\x01\x59\xbf\x1c\xca\x34\xd9\xfc\xa6\xf9\x19\
\xa8\x8d\x42\x97\x76\xd6\xe1\xda\x4b\x2b\x30\x2e\x89\x4f\xb9\x74\
\x5d\x28\xbe\x57\x68\x91\x27\x6f\x4a\xf2\xd7\xa5\x25\xe9\x9a\x84\
\x85\xd2\x7b\x03\x3d\x83\xd2\x37\xe1\x22\xad\x08\xea\x09\x82\x52\
\x8e\xf7\x08\xbd\x74\x05\x1b\x40\xf5\xb6\x27\xc0\x92\xbb\x61\x13\
\x53\xc8\x2f\x53\x65\x2a\xd9\xd8\xcd\xbd\x9e\xf7\xc0\x18\x17\x6e\
\x31\x5e\x1a\x87\xe9\xe2\x6c\xfb\x51\xec\x4f\x21\x5b\x49\xee\xf4\
\x41\x77\x21\xb3\x70\xcb\xf2\x6a\xd6\xcd\x7a\x50\xf9\xbf\x6b\x2a\
\x5d\xbd\xdd\xc5\x6d\x7b\x71\x05\xc6\x45\x19\x02\x18\xb8\x60\xae\
\xd0\xe7\xbe\xd5\xb8\x2f\xbd\x37\xb9\xf4\x2a\x2b\xb9\x4f\x49\x7d\
\x0b\x8b\x12\x9e\x72\xd7\x4e\x3f\xac\x10\x50\xe1\x5e\xdb\x38\xa5\
\x1f\x5a\x40\x54\xaf\x8a\x36\x4d\x0c\xab\x10\xf8\x35\x0c\xd3\xc8\
\x86\x5e\xac\x4e\x77\xde\xf3\x06\x7a\x5f\x6d\x8c\x4c\xca\x74\xaa\
\x08\x55\xf8\xcb\x5b\xea\x4c\x96\x03\x3b\xde\x55\x01\xd8\xa5\x2a\
\xf4\x0c\xb2\x7d\x96\xc7\xaa\x41\x7d\x5d\x2f\x8e\xc3\x84\x90\x0d\
\xf4\xc4\x72\xfd\x03\xc7\x13\xf2\x57\x1c\xa6\x18\xe4\x95\xd5\x55\
\x36\xe8\xe3\xbd\x54\xaf\x26\xaa\x51\x2b\xe8\xe3\x5a\xbe\x47\xef\
\xc3\xd3\x75\x6c\x6c\x93\x63\x16\xb6\xec\xb9\x42\x01\xb9\xc6\xc8\
\x62\xbd\x78\x61\xc4\x3d\x90\xf4\xcd\x42\x0f\x12\xc7\x3b\x2b\x00\
\xe7\x4b\xd5\x2a\xd4\xb4\x6d\xa6\xbf\xef\x7d\x8c\x38\x16\xcd\x1b\
\x3d\x4c\xd3\xc7\xa9\x04\x91\xa6\x88\x8b\x68\x9c\xb9\x82\x3a\x25\
\x54\x82\xb1\xed\xf4\xa8\x79\xbd\xa1\xb7\xcc\x0a\xeb\x59\xef\x70\
\x06\x98\x8f\x99\x01\xd7\x02\xcc\x49\xcd\xf2\x40\xa9\x98\x77\x0c\
\xc0\x38\xbf\xa4\x62\x9d\x57\x00\xc8\xe3\x41\x86\x49\x3e\xd0\x69\
\x9f\x2d\x80\x88\xc9\x6f\x2e\x84\xfc\x52\x7c\x35\x6d\x6e\x04\xa9\
\xdf\x58\xa1\x6d\xbb\xbf\x22\x96\xf6\x9a\xd2\x3e\x13\x83\xcf\x1f\
\x80\xb1\x45\xeb\xbe\xdd\xb5\x79\xaa\x3f\x10\xfd\x58\x0e\xdd\x20\
\x8e\x4f\x9f\x1c\x27\xea\x36\xae\xba\x1b\xce\xaa\xd5\xbf\xc8\x7f\
\x3a\x7a\xd2\x5a\x95\x79\x74\x85\xe5\xa5\x91\x57\xa9\xc2\xa2\x44\
\xe0\xb8\x0f\x44\x9b\x06\x60\x6c\x96\xc0\x08\x40\x99\xab\xf3\xc1\
\x12\x1a\x73\xbc\x6c\x7e\x71\x5d\x3d\x9d\xc5\xf6\x4c\x85\xbe\x05\
\xb6\x6f\x01\x5f\x93\xb8\x47\x03\xd9\x38\xba\xc9\x2a\x0d\x30\x44\
\x7e\x31\xfd\x34\xe2\x7d\x6d\x9d\xa5\x40\x93\xfa\x50\xc8\xef\x93\
\x41\x99\x2e\xf3\x4f\x9d\x1c\x76\x47\x4b\x42\x02\x87\x45\x89\x00\
\xc6\x96\x01\x18\x75\x7e\xfe\x07\x98\xa9\x08\x44\x3c\xf5\x38\xd1\
\x34\x83\xde\xf7\x6c\x47\x67\x13\x9f\x4d\x32\x66\xa5\xd9\xe6\x90\
\x12\x20\x55\xff\x99\x0e\x19\x30\x0c\x10\x00\x24\xda\x30\x42\x1f\
\x40\xa2\xc0\xc2\xd3\x09\xf8\x19\x08\x94\x35\x3e\xdd\xfd\xd8\x2e\
\x53\xef\xcd\xe4\x57\x55\xcc\x3b\xdd\x73\x27\x8e\x2f\x75\x0c\xe2\
\x21\xc4\x92\xc2\x89\xe7\x06\x70\x20\x0b\x0e\x38\xa0\xce\xff\xd8\
\x4e\x37\xaf\x86\x3e\xa2\xea\xd6\xd3\xd7\x72\xe7\x26\xe9\xc3\xfd\
\x00\x50\x49\xd4\x53\xd3\x7a\x0a\xcd\x58\x56\x10\xc2\xcf\x6a\xa0\
\x93\x7d\x11\xfb\x9c\x40\x11\x8f\x93\x10\xb4\xfd\x61\x40\x42\x62\
\xdc\x63\xbd\x31\x4c\x09\xa2\xf5\x1a\x1b\x31\x1f\x36\x79\x7a\xd5\
\x62\xe5\x94\x31\x09\x6c\x19\xde\x4c\x5f\x16\x8e\x9e\xec\x8c\x72\
\xcf\x1a\xe9\xd0\x0c\x83\x50\xa1\x2a\x81\xa3\x34\xbe\x96\xa2\x08\
\x09\xa5\x65\xd5\x8b\xb2\x7c\xd5\xd7\x71\x6f\x46\xfd\x65\xd4\x39\
\xa2\x1e\x64\xaa\x22\x21\x2d\x13\x12\xee\x89\x4f\x28\x83\x14\xef\
\x26\xbf\xac\xea\x24\x61\x66\x71\xcf\x31\x2d\x4c\x03\x42\x1d\x21\
\xaf\x92\xac\x11\xea\x16\xe5\x25\x58\x44\x5a\x2f\x83\x2b\x2d\x60\
\xa5\x80\xea\x2f\xa3\xc0\x3a\x61\xb1\x94\x89\x63\xe7\x74\x0a\x99\
\xd0\x49\x14\x9f\x4f\xa2\x5d\x58\x9c\x05\x78\xed\x75\xec\xc8\x89\
\xb4\xf7\x11\xbf\x51\x98\xf6\x42\x06\x25\x70\xc0\x9f\xd2\x8d\x63\
\xd0\xbb\x02\x20\x1f\x1c\x3b\x68\x6a\xd4\xd8\xf4\xba\xa0\x67\x9b\
\x6c\x95\x10\x8c\xd8\x52\x51\xb2\x0f\x4c\xa8\x5f\x96\x24\xe9\x4e\
\x95\x2b\xbf\x68\x52\x56\x5f\x6c\xca\xd8\x13\x2c\x07\x46\xa6\x31\
\xc2\x49\x3c\x02\x81\x25\xbb\x14\x59\x92\x13\x10\x15\x68\x19\xd9\
\xbc\x8c\x53\xc5\x60\xcb\x8a\x0f\x55\x4e\xa8\xa6\x53\x8c\x5d\xbe\
\x1a\xa5\x87\xa9\x5c\xb0\x8c\xa4\x09\x6d\x11\xec\x78\x26\x70\xc8\
\xf4\x00\x5c\x59\xac\x28\xbe\x3e\xf1\xf0\x81\x05\x04\x5f\x7b\x52\
\xb3\x80\x20\x07\x03\x30\x5a\x0d\x8e\xee\x6a\x9d\x6e\x6c\xd2\x05\
\x79\x6f\x3a\x15\xee\xd5\x41\x4f\x8e\x1f\x69\xc0\x28\x17\x70\x22\
\x68\x97\x3f\x44\x5d\xb2\x51\x35\x78\x5e\xe8\xd1\xd7\x20\x74\xdc\
\x56\x0e\x5b\xae\xa0\x3a\x15\x80\xd0\x65\xa7\x7c\xf2\x44\x1d\x9e\
\x21\x62\x68\xab\x2e\x1c\xdb\xb6\x83\x91\x84\x9b\x42\x3b\x1e\x2c\
\x20\x08\xcf\x96\xb8\x17\xc0\x28\xaa\x62\x45\xe0\xf4\xa8\x0a\xa5\
\x50\x00\x97\x1c\xf8\x22\x83\x99\xb9\x29\x09\x29\x65\x75\x85\xa8\
\x05\x44\x5e\x97\xd4\x50\x8a\x72\x97\x77\x21\xbb\x0e\xed\x3f\xd6\
\x6d\x12\x0a\x60\x04\xa0\x80\xd9\x0d\xe0\xd0\x68\x70\x30\xc0\x8c\
\x61\x2b\x2b\xed\xa6\x31\xfd\x85\x50\x56\xfd\x27\x4a\x9d\x53\xe3\
\x42\x3a\x9e\x09\xa4\x11\xd8\x30\xef\x09\x10\x1e\x24\x31\xad\x20\
\xe8\x76\x50\x49\xae\xd0\x9e\x59\xac\x1a\xd4\x27\xf0\x41\x90\x01\
\xbd\xb2\x8b\xf6\x3a\xe0\x89\xb2\xe4\xed\x89\x89\x8c\x21\xab\x92\
\x95\x89\xbf\x42\x1b\xc0\x00\x51\x47\x1c\x40\xa1\x4a\xa9\x99\x1f\
\xcf\x28\xab\x56\xc5\xa6\x06\x94\x60\x8a\x28\x04\x25\x34\xc8\xf6\
\xc8\x14\xd1\x8b\x4c\x9c\x6a\xb5\x48\xe4\x75\x15\xe5\x4c\x76\x45\
\xca\x64\xb8\x0f\x7f\xe1\x16\xdd\x4c\x1f\x7c\xf8\x48\x54\x1f\xd2\
\xfe\x87\x7f\x57\xd0\x62\x05\xc6\x42\x66\x87\x80\xb1\xd4\x68\x64\
\xda\x17\xee\xd2\x29\xef\x28\xd9\x32\xf2\xde\xbe\x69\x81\x86\xb3\
\xb1\x35\x15\x26\x71\x4a\x6f\x5d\x2a\x4f\x10\x75\x99\x11\x94\x6d\
\xf4\x09\x4c\xbc\x17\x76\x48\xd1\xde\xd0\xf9\x64\xd2\x92\x40\x1b\
\xfb\x41\xa6\x55\x21\x6e\xae\x4a\x97\x23\x53\x8f\xaa\xdf\xb7\xdb\
\x8d\x0b\x97\xfb\x17\xfb\x7e\x9a\xaa\x98\x98\x70\x2b\xcc\xb9\xa0\
\x90\x06\x51\x36\xc1\x06\x26\x54\x48\xcb\x24\x42\xcb\x44\x1f\x30\
\xa4\x4c\x66\x18\x23\xc0\x39\x87\x83\x7b\x8f\x98\x6f\x14\xa6\x43\
\x8b\xc4\xbc\x34\x80\xc3\x49\xcb\x1e\x60\xe0\xe4\x48\xcb\x9f\x04\
\x8b\xfa\x8c\x1d\xf1\x2c\x83\x80\x52\xf1\xbb\x1a\xf2\x7d\x48\xa8\
\x14\xf1\x0d\x7b\x6c\x07\xd5\x80\xc8\x26\x55\xd2\x77\x46\xaa\x63\
\x66\x40\x7d\x9a\x72\xf5\x12\x26\x32\x89\xec\x5e\xf4\x3a\xd9\xb2\
\x21\xc4\x34\xf1\x2c\x02\x23\x05\xd5\x2a\xa9\x7b\x61\xe2\x95\x7b\
\x5b\xea\x92\xd2\x4d\x1d\x80\x6a\x80\x45\x06\x2c\x1a\xc4\x66\x0c\
\x65\x9a\x8f\xe7\x43\x35\x25\x73\xf8\xb7\xca\x57\x76\xd2\xa0\x25\
\x23\xde\x7d\x73\xd9\x07\x30\xd9\x41\xca\x72\xb5\x0c\x66\xc0\x20\
\x51\x35\xe9\x72\x3e\x7e\xf4\xe0\x02\x96\x4f\x0e\xc5\xb4\x85\x79\
\x0a\x3a\x13\x1f\x1f\x00\x38\x6a\xd9\x03\x60\x2c\x0c\x59\x83\x41\
\x76\xa0\x2f\x3d\x8d\x51\x0e\xa2\x20\xbc\x99\xed\x11\x22\x1a\x34\
\x5a\x9c\x13\x00\xba\x1e\x86\x8a\x13\x08\x93\x00\x86\x09\xf2\x06\
\xb0\x98\x00\xd9\x07\xd9\x6c\x78\x86\x65\x3a\x90\x03\xc1\x8f\x4f\
\x07\x72\x9f\xc0\xbe\xaf\x45\x35\x2a\x81\x42\x83\x24\x35\xa8\x44\
\x88\x94\x17\x3e\x35\x1a\x07\x97\xc5\xbb\x58\x70\x48\x66\x0a\xdd\
\xd6\xea\x57\x04\x1a\x44\xb9\xac\x8d\xd4\x3d\xf5\x42\x30\x79\xb6\
\x2d\xb2\x80\x49\x42\x99\xc0\x42\xfa\x79\x51\xb1\x1e\x07\xdd\x9e\
\x4a\x0e\x5a\x4b\x51\xce\x28\x97\x3f\x7b\x89\xf4\xbd\x0f\x1c\xe8\
\x7e\xe2\x47\xf6\x43\x6a\xcb\x84\xe3\x03\x00\x87\x2c\x7b\x80\x81\
\x63\x4b\x12\x7d\xdd\x9f\x5f\x23\x02\x2a\xd9\x01\x14\x3a\x03\x5f\
\xc6\x74\x26\x1b\x61\xf9\x55\x50\x16\x69\x62\xf0\xc8\x4f\x1c\xcb\
\x82\x41\xd0\x43\x9a\x62\x0f\x29\xfd\xd0\x82\x2c\xf3\x08\xfd\xec\
\x11\x85\x5e\x2c\xe8\x1c\x3c\x4e\xe2\x1d\x26\x6c\xf8\x11\x8b\x4d\
\xa7\xe8\x63\x97\x46\xba\x6d\x5f\x08\x81\x1a\xab\xf0\x29\xd5\x36\
\x01\x0e\x5f\x17\x85\x32\x0a\x34\xb2\x42\xb3\x58\x98\xb4\x58\x6c\
\x92\x41\x1f\xfb\x13\x23\x9d\xaa\x2d\xfb\x1b\xc0\x52\x00\x86\x35\
\xca\x49\xc6\xb2\xfa\xcd\xf8\x1a\x41\x2a\x09\x7d\x16\x37\x97\x94\
\xcd\xbd\xf7\x3d\xe2\xe7\x36\xd8\x1e\xa1\x27\x7e\x6e\x18\x87\x07\
\x70\x38\x68\xd9\x83\xc0\x38\xb2\xc4\xc9\xa0\xb1\x8d\x11\x92\x1a\
\xe5\xf3\x2b\xd9\x01\xd3\xc9\x00\x2e\xf5\x72\x5e\x70\x0a\x8b\xb9\
\x1a\x68\x70\x49\x75\x2a\x7b\xb7\xf4\x72\x92\x80\x83\x00\x94\xf0\
\x02\x42\x6e\x59\x1a\xd1\x2b\x70\xd5\x2a\xf0\x81\xfc\x71\x05\x5d\
\x79\xe2\xc1\x94\xde\xb1\x0d\x34\x95\x29\x34\xca\xf7\x31\x2a\x21\
\x09\xb5\x48\xee\xa9\x18\xb0\x74\x45\x34\x58\x34\x7b\xe4\x8c\x51\
\x04\x86\x7c\xfd\x84\x87\x98\x10\x59\x43\x4e\x78\xb6\x68\x40\xb4\
\x2f\x2a\x10\xc5\x4b\x46\x82\xc5\x45\x66\xad\x0a\x99\x93\x32\x18\
\xe4\xaf\x93\x39\x21\xbf\x21\x8e\x94\xbf\xe7\xab\xfb\xbd\xed\xe1\
\xfb\x23\x81\xd2\x71\xc5\x81\x01\x18\xfb\xf3\x9f\x7e\x60\x1c\x3c\
\x99\x04\x3e\xa2\x2e\x74\xc4\xdc\x77\xfa\x28\xe7\xec\x22\x40\x54\
\x81\xd0\xda\xc9\x61\x21\x30\x71\xd0\xbd\xd8\xa9\x01\x15\x9e\x2c\
\xd2\x69\x9d\x2a\x55\x02\x4e\x98\x08\xa1\x76\x19\x50\x0a\xbc\xc5\
\x32\xdd\x3a\xe1\x85\x99\x84\xaa\xd4\xc7\x18\xc2\x53\x55\xb6\x35\
\x2c\x48\xc2\x64\x7b\x76\x94\x07\x15\x21\x1e\x55\xc2\x20\x80\x64\
\x6c\x11\xb2\x63\x4a\x48\x0c\x53\x02\x44\x06\x82\x49\x9e\x2e\x56\
\xfd\x49\xf3\x0d\x13\xc8\x3c\xdb\xdd\x10\x15\x0c\x74\x35\x8c\xa4\
\xb2\xe2\x7f\xaa\x9c\x11\x2c\x10\x2a\x18\xe1\x17\xd9\x45\x36\x29\
\x5c\x7b\xbe\xf2\xb0\xff\xc5\x14\xa9\x12\x47\xd1\x44\x05\x1c\x1c\
\xa0\xc5\xc3\x71\x70\x12\x95\xe0\x91\x45\x46\x25\x1a\x0e\xa0\x88\
\x4c\x21\x3f\x0b\x8d\x57\x06\xd1\x71\x81\x61\x6b\x2c\x87\xd5\x57\
\xf4\x8c\xa0\xd3\x28\x09\x3a\x0a\x69\x61\x4c\xa5\x8a\x15\x56\xa7\
\x78\x2e\x2b\x3c\x23\x7f\xad\x63\x12\x63\x58\x63\x3d\x0c\x64\x60\
\x11\x78\x3b\xc7\x4c\xb7\x62\x42\x05\x12\x5b\x22\x1c\xad\x16\x21\
\x13\x3c\xa4\xfe\x85\x3c\xcb\x0a\x64\xd2\xd4\x95\xef\xda\x0b\xad\
\x27\xf6\x11\x36\x6d\x0c\xa3\x68\x95\x42\x30\x09\x52\xbe\x22\x05\
\x12\xcf\xf4\xa4\x51\x78\x0e\x79\x9a\x1e\x0a\xad\xd5\x28\x39\x13\
\xb2\x17\xaa\x97\x72\x2a\x19\x67\xf1\xe8\x22\x8e\xec\x3f\x2a\x6b\
\x15\xa3\xc4\xbe\x9d\x6a\xef\xa0\xae\xb1\xa7\x6d\x13\x7b\x90\xdf\
\x55\xdc\xbf\x90\x04\x2d\xac\x1a\x55\x54\xa9\x04\x63\x84\x38\x52\
\x87\x35\xbb\x08\x70\xc4\xf1\x13\x9e\xac\x20\xdd\xea\xfc\x91\xef\
\xb4\xdf\xc6\x4e\xf6\x06\xd4\x6a\x9a\x8c\x75\x8a\x13\xcf\xb1\x51\
\xbf\xaa\x87\x7d\x11\x12\x0c\x14\x64\x34\x08\xbd\xdd\xdc\x53\xac\
\x20\x57\x17\x6f\x5b\x90\xb8\x87\x56\xb5\xfa\x00\x11\x27\xc0\xee\
\x9c\x47\xbc\x94\x90\xa1\x57\x6f\x25\xf0\xe1\x1d\x11\xde\x35\x80\
\xa3\x04\x18\xd6\xcf\x5a\xf6\x10\x40\x1b\xbb\xe9\x98\x81\x22\xa8\
\x58\x7a\xa2\x4b\x6a\x97\x2c\x22\x2b\x8d\xb7\x71\x2e\x45\x5b\x26\
\x4d\xda\x3a\x7d\x2c\x11\x55\xac\x98\x46\x59\xbc\x22\xe0\xfe\xbb\
\x1f\xee\x8e\x94\x90\x51\x95\x91\x54\x2c\x22\xf7\x60\x75\xf1\x16\
\xec\x91\xf6\x47\x28\x7b\x7c\x19\x38\x31\x4c\x2a\x96\x6c\x58\xaa\
\x5d\x95\xe9\x4c\x42\x35\x25\x26\x11\xe5\x4b\x2f\x9b\x06\xc3\xa4\
\x11\xc5\xe4\xf4\x6c\x2a\x97\x80\x27\x9e\xa5\x50\x8c\x52\xba\x8c\
\xca\x09\x54\xc2\x92\x0b\x9c\x14\xb4\x5e\x75\x45\x0a\x95\xf2\x28\
\xf9\xb8\x39\x5b\x45\xa1\x7c\xc5\xa9\xfc\x34\xfb\x20\x55\x57\x27\
\x91\x2c\x9b\xea\x27\x99\x96\xb9\x81\xe5\x25\xde\x87\xcc\xfb\xc4\
\xb1\x97\x69\x69\x41\xca\xc6\x4f\x0a\x7b\x50\xa5\xa2\x80\x0b\x60\
\x98\xb4\x6c\x4e\x33\x76\x49\xe5\x52\x92\x98\xdf\x82\x5c\x55\x20\
\xc1\x1c\x42\xf6\x50\x28\x0f\xe0\x81\x3b\x1e\x84\xdc\xf7\x48\x67\
\xb1\xd2\xfd\xcc\x0c\x3f\x50\x3d\xeb\x22\xdc\x47\x9d\xaf\x2b\xad\
\x2e\xe8\x7e\x56\xf2\xa1\x05\xed\xea\x55\xec\x00\x28\xf5\x2a\x00\
\x45\x51\x1d\x74\xd9\x4a\x0e\x42\x37\x7c\xd9\x8b\xc7\x41\x8d\x83\
\x9d\x66\x43\xdf\x1a\xc1\x0f\x03\x2b\x69\x5b\x4c\x2a\x20\x3b\xa7\
\x85\x26\xbd\xb7\xe8\x87\x10\x0e\xd3\x8d\x9e\x95\x3a\x17\xb8\x2c\
\x4d\x00\x81\x08\xa0\x4a\x08\x76\x55\xb8\x3c\xd0\xba\x72\xe9\xd9\
\x7c\x03\x31\x07\xf4\x74\x6e\xe0\x10\x7a\xd8\xc3\xbc\xb7\x14\x84\
\x30\x77\x1a\x00\x69\xd0\x23\x76\x54\xba\x6c\x57\x77\x24\x95\xd7\
\x0b\x58\xb7\xe8\x6a\xc1\x89\x82\x1f\xba\x23\xaa\x8f\x40\x10\xf3\
\x9f\x19\xf3\x04\xdc\x7f\xfb\x6e\xb1\x41\xe8\x34\x50\xba\xbf\xcb\
\xdd\x6e\xdd\xba\xe5\xfe\xea\x93\x3f\x40\xc7\x66\x08\x07\xba\x31\
\x49\xaa\x16\x18\x78\xe0\x28\xfb\x06\xa9\xc8\x1a\x31\x1d\x29\x1e\
\xf3\x4d\x99\xb4\xfa\x18\x01\x8d\x83\x20\x06\x53\xac\x48\xd9\x6a\
\x25\x07\x59\xb1\x84\x98\x2c\xc9\xb9\x92\x85\xc4\x80\x2b\x16\x99\
\xb8\xd1\x26\x57\xee\xf2\x7d\x2e\x94\x29\x2d\x5f\xf5\xc5\xbd\x60\
\x86\xfc\x92\x4c\x63\x81\x21\xd8\xa8\xd0\x66\x19\x1c\x7d\xf7\xfe\
\x7d\xfb\xc6\x22\x8e\x9f\x30\xba\xd5\x9c\x4c\x9e\x03\x3d\x97\x62\
\x1e\xb3\xb9\x94\x98\x92\x37\xa1\x7c\x02\x66\x90\x2f\x29\x93\x32\
\xbd\x24\xa7\x44\x80\x1b\xb5\xd8\x73\xd7\x43\x1d\x28\x9c\x00\x85\
\xf8\xc1\x06\x02\x3f\x74\xc3\x0d\xff\xe1\xd4\xa0\x1b\x13\xbe\x8b\
\xc0\x17\x07\xc1\x08\x5f\x10\xb9\xef\x08\xf7\x00\xc3\xd0\x9b\xea\
\x98\x61\x12\xe8\xbc\xee\x7d\xbb\x8c\xdc\x0e\xb1\x82\xe9\x85\x3b\
\x78\x7c\xfc\x40\x12\xbc\x2d\x2f\xf6\x4d\x58\x2e\x65\xd1\x1e\xf1\
\xe5\x89\x84\xfd\xc1\x5d\x47\x9c\x56\x2d\x08\xd2\x16\x29\xdb\x16\
\xea\x33\xec\x8d\x78\x5b\x25\xe9\xb0\x85\xbd\x8e\x98\xd2\xb3\x73\
\xde\x35\x8e\x2c\x90\x8c\xa7\x7c\xb2\xe3\x24\xe2\x19\x38\x62\xdb\
\x39\x68\x34\xb8\x65\x7b\x39\xdb\xc4\xe5\x59\x08\x3f\x99\x05\x48\
\x2e\x6e\x12\x2c\x1a\x00\x14\xdf\x21\xa6\xcb\x45\x53\x95\x15\xf3\
\x23\x98\xc4\xca\x97\x95\xbb\x49\x72\xf9\xf0\x57\x1e\xc6\xe8\xd4\
\x72\xaa\x80\xc5\x74\x84\x61\x76\x74\x17\xd0\xc9\x3c\xea\x0a\xb7\
\x17\x7e\x74\x09\xf7\x1c\x62\xc5\x1e\x9a\x49\x0a\xe9\xb0\x1d\xa4\
\x62\xc7\xfb\x99\x23\xac\x1a\x94\x06\x4b\x0c\x58\x1a\xd4\x70\xe9\
\x09\x4a\x97\x9e\x24\x10\x45\x35\x25\xae\x40\x96\x45\x14\x30\xc3\
\xa5\xed\x8f\xe4\x71\x32\x2b\x71\xe6\x49\x92\x2b\xbe\x8e\x53\x95\
\xd8\x42\xdb\x1b\x65\x15\x4b\x33\x03\x40\xd5\x98\xba\x4b\xe0\x98\
\xf2\x3d\xf4\x67\x2a\x9b\xb1\x47\x10\x7c\xbf\x1c\x4b\xb6\xb0\xfb\
\x66\x76\x8e\xa2\xcc\x4b\x20\xa9\xf9\xd7\x2a\x77\xaa\x82\x54\x5f\
\xb4\x86\x22\x58\x24\xc8\x1c\xb4\x5c\x86\x79\x8f\x06\xfa\x2d\xf7\
\x79\x95\x2a\xfc\xdc\xa8\x33\x6c\xc2\x00\xb7\x77\x00\xc0\x00\x00\
\x06\x15\xdd\x1a\xc7\x8b\x11\x8d\x97\xbb\x0e\x76\x6c\xa2\x84\x3c\
\x03\x81\xbd\x3a\x6f\x57\x06\x0c\xf1\x88\x40\xd9\x25\x00\x00\x1e\
\xd7\x49\x44\x41\x54\x52\xce\xaf\xd2\x61\xb4\xc2\x24\x4a\x2f\x13\
\x85\x9f\x25\xf7\xe5\x02\x1b\xe4\x2b\xa5\x9f\xf2\x38\xe8\x72\x35\
\x45\xdc\x23\x99\x9a\x45\xac\xc7\xaa\x97\x21\x44\x39\xa2\xc4\x3e\
\x51\x08\x43\x6d\x41\x08\x82\x50\x8a\x32\x31\x2a\x57\x03\x1b\x58\
\x67\x93\x49\x0b\x63\x01\xa8\x77\x1f\x0f\x5e\x51\x36\xda\x1a\x56\
\xfd\x32\x57\x89\x3d\x10\xe2\xa6\x2c\x48\xd8\x29\x09\x23\xfd\x8b\
\x9a\x70\xef\x8a\xb9\x93\x0c\x15\xea\x1d\x2f\x7b\xfd\xe9\x52\x7e\
\xef\xbd\xf9\x5e\xc8\x23\x26\x71\x86\x28\x0d\x57\x45\x1d\x26\x06\
\x00\x70\x5e\xe5\x6e\xd6\x47\x7a\xbb\xf0\xc8\x09\x87\x23\xa7\x80\
\x2d\xb3\x5e\xf0\xab\x24\xf8\x75\x11\x10\x22\x5e\x01\x95\x0b\x9f\
\xfe\x59\x17\xd0\xce\x50\xfb\x21\x24\x44\x4a\x4d\x2a\xc4\x60\x4a\
\x75\x2a\xa5\x07\xc1\x20\xd6\x83\x2f\xc1\x40\x15\xc0\x8e\xba\xd5\
\x97\xc5\xb3\x44\x09\x98\x5e\x18\xed\x11\x91\xde\xdd\x70\x0b\x12\
\x55\xce\x0b\x9c\xdf\x08\x05\x21\x6d\x08\x5a\xd7\x2e\xa1\xac\x5e\
\x85\x20\xfa\x96\x01\x85\x26\xb8\x7c\x27\x81\x43\xda\x22\xe1\xfd\
\x21\xf3\x85\x00\x97\xd8\xc3\x58\xbf\xaa\x9c\x98\x57\x89\x12\x0d\
\x18\x0b\x80\x30\x24\xa1\x71\xf9\xba\x81\x25\xca\x1a\x4d\x00\x47\
\xdd\x53\x26\xc8\x2b\xb7\x2d\x1e\xb8\xed\x7e\x84\x73\x70\x69\xab\
\x8b\x41\xfe\x0b\xb6\x00\x83\xab\x99\x9b\x00\xaf\x62\x3d\xfb\xa2\
\x99\x9b\x2b\xc2\x28\x61\xa3\x63\x0e\x76\xc0\x1d\x07\x9c\x6a\xa0\
\x26\x8d\x48\x7b\x3f\x0d\x8a\xd3\xe2\x53\x30\xfa\x00\xa5\x66\xa9\
\x81\x96\x2b\x96\x18\x7b\xc1\xa3\x6a\x75\x0a\x6d\x24\x15\x2d\xa8\
\x69\x0c\xf2\x5f\xc6\x27\x38\x10\x89\x9f\x74\x29\x7a\xa3\x44\xff\
\xb2\xb4\x82\xb0\xf5\x19\xeb\x7d\xae\x5d\xab\x56\x95\xd4\x2c\x61\
\xa0\x53\x9f\xcb\x57\xd9\x13\x52\x0d\x9b\xf4\x0e\xfa\x3d\x34\x08\
\x91\x26\x94\x08\x54\x19\xf6\x08\xf3\x24\xcb\x1a\x40\xa4\x79\x85\
\x6e\xd4\xcc\xaf\x52\xaf\xc3\x47\x60\x2b\x2b\x57\x95\xf9\x2c\xc8\
\x5f\x02\x8c\xb0\x3f\xee\xda\x83\xe1\x89\xa5\xe4\xe2\x05\xc7\x78\
\xf7\xe3\x0d\x0e\xc4\xbc\xd4\xd0\xd1\xdb\x00\xcf\x20\x9f\xf8\x51\
\x5a\x9c\xff\xd5\xa5\x3b\x86\xc0\x35\xca\x93\x05\xe0\xd6\x7d\x2d\
\xbe\xe1\xb2\x4a\x23\xd2\x33\x49\x6d\xd9\x43\xb0\x44\x0d\xcd\x2a\
\x16\x60\x4e\x4d\x02\x29\x81\x0b\xab\x7f\xb7\x29\xe7\xe7\x2c\xa8\
\x5a\x61\xe5\xad\x00\x6a\x0b\xc6\x7a\xdb\xc2\x0d\x87\xe0\xe1\x10\
\xdc\x8c\xc0\x4d\x03\x6a\x1a\xa0\x6d\x00\xd7\x22\xfd\xd4\x7d\x1a\
\x98\x18\x87\x7f\x77\x54\x60\x54\xe8\x7e\xf0\x65\x00\xa6\x01\x1c\
\x66\xe0\x68\x16\x8e\x66\xbc\x74\x07\x0e\x21\x8c\x35\xc6\x13\x5d\
\x78\x21\x40\x64\x0c\x8e\xf9\x22\x98\x5b\xf8\x92\x72\x51\x08\x69\
\x69\xd5\x65\x21\x6c\x5a\xcd\xea\x04\xd3\xa4\x91\x4c\xeb\x59\x08\
\xa2\xcd\x56\x79\x50\x68\x10\x04\x16\x89\xc0\xb1\x2c\x13\xcb\x07\
\x10\x25\xa4\xa4\x75\x4c\x83\xcc\x32\x96\xd2\x12\xd0\xb7\x30\x4b\
\x86\xf0\xf1\xca\xcb\x60\x2c\x4b\x11\x4c\xf7\x7e\xf1\x9e\x6e\x3c\
\x39\xa9\xd3\x81\xb1\xe2\xd2\x40\x74\xcb\x3d\xf7\xbc\x63\x19\xf0\
\x00\x01\x80\x1a\xee\x06\x00\xd7\xc4\xc1\xf7\xd7\x4d\x0f\xb7\xa8\
\xab\xd9\x4c\x75\xca\x98\x43\xa4\xd7\xf2\x1e\x50\x40\x91\x46\x55\
\xe0\xb8\xa8\x86\xc7\x15\x48\x4f\xa6\x4c\x97\xcf\x39\x30\xda\xa5\
\x25\x34\xa7\x96\xd0\x9e\x5a\x82\x5b\x1e\x02\xae\xc9\x05\x3f\xfb\
\x32\x4c\x90\x2f\x01\x12\xa4\x72\xc4\x4d\xf6\x3c\x31\x47\x3b\xa3\
\x03\xca\x1c\x5a\xda\x84\x96\x36\xa1\xa9\x36\x83\xa9\x4e\xd2\x4b\
\x9d\xaa\x06\xc0\xef\x9c\xfb\xfe\x2b\x55\x2a\x30\x21\x27\xfc\x94\
\x82\x02\x8c\xb6\x3d\xc2\x3d\xc5\xf1\x13\x2a\x6b\x04\xcd\x34\xe0\
\xc8\xdd\xbe\x9d\x2a\x95\x18\x83\x48\xc7\xe5\xa2\xd6\xc7\x1e\x72\
\x2e\x53\x52\x9e\xa7\x9e\x15\x60\x89\xaf\xe2\xdb\x94\x42\x1f\x81\
\x82\x24\x7f\x51\xf6\x82\xfc\x15\x00\xd5\x01\xa4\x1b\xbb\x30\x35\
\x61\x0d\xf3\x1f\xa8\x3a\x2c\x00\x10\x00\x99\xa9\xeb\xff\x71\xaa\
\x69\x7f\xc2\xce\xc9\xed\xfb\x1d\x86\x8d\x66\x8c\x5a\x74\xa8\xaa\
\x80\xba\x22\xd4\x2e\x67\x92\x98\xef\x34\x88\x02\xfd\x25\x37\xac\
\xef\x19\x25\xb0\x74\xf9\x9a\x59\x40\x40\xdb\x34\x58\x5e\x38\x89\
\xd1\x89\x93\x68\x4e\x2d\x01\xad\x33\x82\x0c\xc1\x80\x92\x15\xc4\
\x3d\x04\xb5\xca\xb8\xd7\x56\xe2\xb3\x91\x59\x20\xca\x39\x0c\xdc\
\x49\x80\x17\x15\xf3\x38\x9a\xc3\x88\xb6\xa0\xa9\xcf\x43\x53\x6d\
\x45\x5b\x6d\x42\x5a\x9d\xc2\x6a\x15\x5e\x0e\x1a\x2c\x72\xc0\xd9\
\xdc\xcb\x40\xa2\x90\x04\x86\x04\x41\xc8\x53\x80\x91\x82\x3f\x05\
\x38\x2a\x21\xc8\x52\x7d\xad\x62\x66\xbc\x28\xbb\x34\x18\x34\x20\
\xd2\x22\x67\x01\xa3\x34\x2f\xf2\x23\x67\x9e\xb1\xce\x20\x25\x87\
\x24\x17\xe2\x20\x7b\xc1\x16\x61\xec\xb9\xfd\x7e\xdc\xf4\xdf\x6f\
\xc0\xfd\xb7\xdc\x1f\x87\xb1\x13\x39\xc9\xe6\x7e\x6a\x2a\xfe\x5c\
\x18\xe9\x08\x90\x4b\xb6\xb6\x9f\x3d\xbe\xcc\xfe\x0f\xb8\x05\x39\
\x62\x2c\x8f\x18\xb7\xec\x6b\x71\xed\x13\xeb\x88\x50\x89\xd2\x28\
\xfc\x64\xed\x14\x42\x1d\x59\x87\x50\xb9\x92\x9a\x45\x6a\x62\xc0\
\x09\x2c\x2c\x56\x43\xd7\xb6\x38\x75\x74\x11\x4b\x47\x4f\x74\xa0\
\xb0\x6a\x91\x14\x7a\x05\x80\x20\x23\x81\x3d\x44\xf1\x00\x1c\x01\
\x1e\xf5\x3c\x9b\x78\x60\x1d\x05\xbc\xf0\xe9\x50\xbb\x93\xa8\x79\
\x11\x18\xee\xf7\xac\x58\xa3\xa9\xb7\x62\x54\x9f\x8f\xd1\xe0\x7c\
\x34\xf5\x79\x9d\x70\xa9\x83\x99\x16\x1d\x7d\xe0\x48\xcc\x41\xb2\
\x8c\x64\x0c\x01\x12\xc5\x1a\xc2\x50\xb7\x8b\x4d\x52\x09\x0d\x58\
\x09\x40\x64\x8f\xc0\x26\x88\x00\x88\x00\x34\x6a\xd6\x34\xec\x51\
\x02\x4c\x68\x37\x82\x42\xb2\x88\x7f\x61\x25\x5f\xd1\xfe\xd0\xea\
\x55\x48\x0f\xe5\x46\x0b\x8b\xb8\xfb\xb3\x37\xe1\xce\x8f\xff\x03\
\x0e\x3e\xb0\x3f\x1b\xd5\x38\x05\x9c\x14\x65\x80\x1d\x55\xf5\x67\
\x42\x99\x08\x90\x3b\x7f\x66\xf3\x03\xf3\xbf\xbc\x78\xef\xd0\xe1\
\xa9\x49\xc8\xba\xf0\xf9\xdd\x2d\x5e\x70\xe9\x40\x78\xb1\x3a\xe1\
\xef\xc0\x92\xe2\x5d\x27\x19\xb5\x61\x8f\x3a\xbc\x94\x93\xec\x42\
\x68\xbd\xa7\x27\x4c\x9a\x3e\x4c\x48\x18\x9e\x5c\xc2\xe2\xc1\xe3\
\x58\x3a\xb6\x28\x7e\xab\x48\xac\xf2\x4a\xe8\x39\xca\x52\x8a\x48\
\x04\xe4\xe0\xb1\xec\x31\x0e\x3c\x0a\x40\x2c\x00\x64\x80\x17\xca\
\x10\x8f\x30\x37\x3a\x84\xb9\xe1\x81\x08\x98\xd1\xe0\x7c\x8c\x06\
\xdb\x31\x9c\xb9\x00\xcd\x20\x01\x66\x62\x50\xa0\x61\x25\x54\xdd\
\x67\x57\x87\x66\x0d\x68\x20\x58\x70\x44\x0f\x98\x00\x53\x15\x80\
\x50\xf5\xab\x56\x95\xfe\x4c\xc0\x99\x8e\x3d\x24\x60\x82\xf0\x97\
\x40\x41\xf0\x75\xa0\xab\x57\xda\x11\x81\x3d\x6a\x40\xb1\x48\x4d\
\x00\xb9\x16\xfb\xbe\x74\x0f\x1e\xf8\xcc\x17\xf1\xe0\x3f\xde\x89\
\x76\xd4\x4c\x1c\xda\xc0\x21\xc4\x00\x11\x7d\xf9\xf6\x07\xde\xba\
\x2f\xe4\xab\x9f\xa8\xae\xc1\x9f\x24\xb0\xf8\x93\xd0\xdd\x64\x7f\
\xee\xfe\x06\x3f\xf3\xe2\xb9\x28\xe8\xb5\x50\xaf\x92\x0d\xd2\x81\
\x23\x1a\xe9\x21\x6e\x6c\x93\x08\x16\xee\xae\x36\x08\x97\x1f\x60\
\x06\xe3\xe4\xe1\x13\x58\x78\xe4\x18\x9a\x53\x43\x44\xbb\x40\xf4\
\xa7\x74\x85\xc5\x52\xae\xf8\x45\x20\xc9\x7a\x8a\x60\xea\x67\x8f\
\x71\xe0\x51\xc0\x53\xf6\x4b\x90\xc1\x06\x73\xc3\x03\x98\x5f\x7e\
\xc4\x03\x66\x80\xe1\xcc\x0e\x0c\x67\x2f\xc0\x70\x76\x67\x07\x98\
\xd2\xec\xf5\xa5\x09\x20\xc4\xb1\xc9\x58\x03\x65\x20\x64\x7b\x24\
\x10\x46\x79\xc1\xee\xb0\xaa\x55\x89\x31\x2a\x0d\xa6\xe0\x75\xb3\
\x80\xd1\x9b\xb8\x94\xb7\x2d\x80\x18\xde\x2f\x6a\x2b\x95\x91\xa1\
\x70\x01\x58\xb8\xef\x41\xdc\x7b\xc3\x2d\x78\xf8\x1f\x6e\xc1\xf2\
\xd1\x13\x85\x81\xeb\x0f\x12\x24\x60\x7c\x52\xe6\x29\x80\xcc\xcd\
\xd0\xc7\x97\x46\xfc\x13\x92\x71\x01\xe0\x9e\x83\x2d\xf6\x9f\x70\
\xd8\xb1\x99\x92\x1d\x12\xd8\x21\x74\xdc\x25\x8f\x41\x62\x11\xcd\
\x2e\x95\x4f\x0f\x34\x58\x13\xc1\xf9\x09\x72\xad\xc3\xf1\x47\x8e\
\xe3\xf8\xbe\xa3\x68\x97\xa5\x91\x8c\xc4\x10\x99\x4a\x84\x82\xa0\
\xda\x7b\xc3\x20\xca\x48\x07\x8a\xb6\x47\xa1\x5e\xc5\x1e\x8a\x49\
\x64\x33\xa2\x7e\xdb\x07\x53\xb6\xe2\x21\xe6\x97\xf6\x61\xfe\xd4\
\x5e\x00\x0c\x57\xcd\x76\x60\x99\xdb\x85\xe5\xb9\x9d\x68\x67\xb6\
\x40\x23\x84\xd5\x2d\x15\x80\x62\x41\x42\x54\x48\xb7\x7b\x1f\x52\
\x40\x2b\x02\x55\x95\x10\xf2\x04\x06\xaa\x52\x39\x48\xd5\xcb\x0a\
\x75\x00\x0b\xc8\x00\x49\xe3\x29\x67\x0f\xc1\x20\xa1\xab\xbe\xde\
\xba\x22\xad\x9e\x57\x40\xc5\x8c\x53\xf7\xed\xc1\x23\x37\xdf\x8e\
\xc3\x5f\xbc\x1d\x4b\x07\x8f\xe0\x74\x42\x00\x09\x81\x3e\x2e\xd3\
\x15\x40\x9e\x79\xe1\xe6\x4f\xfe\xe3\xee\x85\x65\xc7\x98\xb3\x6a\
\xc7\x67\xee\x1d\xe1\x7b\x9f\x3b\xa7\xd5\x29\xab\x66\x55\x41\x95\
\x32\xea\x96\x50\xb5\x2a\x6f\xd0\x87\x17\x06\x80\x63\x07\x16\x70\
\x64\xcf\x11\xb4\xc3\x11\xba\x1f\xf1\x2a\x08\xb6\x78\x91\x0c\x2c\
\x25\x1b\x21\x53\x7b\xc4\xf3\xe3\x98\x48\x08\xfb\xca\xd9\xc3\xc4\
\x2d\xf0\x0a\x76\x53\x68\xa7\x6e\x96\xb0\x79\xf4\x10\x36\x9f\xd8\
\x03\x80\xd1\xd6\xf3\x1d\x58\x36\xed\xc2\x70\x7e\x27\xda\xd9\x00\
\x18\x0d\x14\x05\x00\x7f\x9f\xed\xac\x8b\x78\x04\x47\x48\x2f\x80\
\x03\x9e\x01\xa4\xfa\x04\x01\x02\x55\x3e\x53\xad\x02\x88\x72\x36\
\x92\x05\xe4\xa1\x55\x05\x34\xc8\xb2\x89\xb0\x6a\x02\xaa\xd1\x10\
\x4b\x77\xdf\x87\xa3\x77\xdc\x85\xc5\xdb\xef\x42\x73\x6c\x01\x6b\
\x1a\x18\x27\xe7\xaa\xc5\xbf\x95\x49\x0a\x20\x7f\xff\x5a\x5a\xd8\
\xf2\xa6\xe3\x7f\xb7\xe4\xf8\x3b\x48\x3c\x05\x30\x3e\xf5\x95\x11\
\xbe\xff\x9a\x39\xd4\x15\x30\xa8\x04\x73\xc8\xcb\x09\xd0\x04\x56\
\x91\x4c\xe3\x12\x90\x2a\xc7\x38\x71\xe4\x24\x1e\xbe\xef\x30\x46\
\x27\x87\x30\x92\x27\xda\x2e\x09\xb5\xbe\xb7\x7d\x4d\xf2\x92\xee\
\x2d\x13\x51\x88\x23\x2d\xa6\xba\xde\x14\x27\x55\x6f\x0f\x7b\x58\
\xb6\x93\xcf\xa1\x5f\x6d\x53\x46\x7f\xac\xdb\x61\x30\x5a\xc4\x60\
\x78\x02\x9b\x8f\xdf\x07\x30\xc3\x0d\xe6\x31\x9c\xdf\x85\xe5\xcd\
\x3b\x31\xdc\xb4\x13\xa3\xf9\xed\x4a\x0d\x01\x24\x30\xc4\x4b\x05\
\xd6\x08\x2f\x1a\x99\xa4\xbb\x22\x08\x04\x38\xa8\xd2\x00\x50\xcc\
\x20\xd5\x2f\xa3\x5a\x59\x00\x94\x80\x13\xc0\x00\x58\xd0\x98\x7e\
\x11\x75\xe3\xb4\x6f\x1f\x46\xf7\xdd\x87\xa5\x7b\xee\xc1\xe8\xfe\
\x07\xc0\x13\x6c\x8a\xd3\x09\x55\x85\x4f\xdd\xb8\xf7\x0f\x4e\xca\
\xb4\xec\xcf\xe4\xcc\x0e\xf0\xe7\x4b\x0d\xbe\xc3\x0a\xec\x97\xf6\
\x34\x38\xbc\xe8\xb0\x75\x9e\x92\x1a\x45\x52\x27\xf4\x69\xc2\xed\
\x1b\xd9\x45\x32\x09\x03\x4b\x0b\x23\x7c\xe5\xee\xc3\x38\x76\xf8\
\x24\xa2\x7d\x61\x56\xeb\xa4\xcf\x23\x0a\xb2\x5c\xb9\xa7\x53\xaf\
\x64\x3c\x08\xac\xc9\x57\x2c\x24\x05\xb7\x87\x2d\xfa\xd8\xc3\xb6\
\x31\x01\x3c\x1a\x78\xd2\x66\x29\x1b\xfd\xf5\xe8\x24\x36\x0f\x1f\
\xc0\xe6\x63\xf7\x03\xcc\xe0\x6a\x80\xe1\xfc\x0e\x8c\xb6\xec\xc4\
\x70\xf3\x05\x18\x6e\xbe\x00\xed\xdc\xe6\xae\x6d\xa3\x5a\x65\xf6\
\x86\x07\x46\x97\x57\x09\x3b\x43\x80\x83\x34\x38\xa2\xda\x15\xd3\
\x2a\xc5\x2a\x59\x99\xb1\x97\xef\x87\xb5\x3d\xda\x16\x78\x64\x3f\
\xdc\x9e\x3d\x68\x77\x3f\x00\xde\xfd\x20\x70\x4a\xc9\xeb\xfa\x06\
\xae\xfe\xdc\x26\x65\x00\xb9\xf4\x3c\xfa\xf3\x13\x4b\xee\xff\xe6\
\xce\x49\x10\x83\x63\xc6\x27\xef\x1e\xe2\x5f\x5d\x33\x2f\x04\x5e\
\x80\xc2\x01\x03\x02\x1a\x92\xac\x42\x18\x30\xa3\xf5\xe0\xe0\x11\
\xe3\x9e\x7b\x8e\xe2\xfe\xfb\x8f\x81\x5d\xd8\x4b\x4f\x52\x98\xad\
\xfa\xf1\x1e\x89\x15\x56\xa4\x5e\x59\x20\xd9\x1b\xcd\x4a\x64\xee\
\x63\x19\xc9\x3a\xbe\xcd\x15\xb9\x8c\x2d\xdb\x29\xe0\xf4\x00\x31\
\x3c\xa7\x00\x9b\xc0\x44\xed\x10\xf3\x8b\xfb\xb1\x69\x71\x7f\x7c\
\xca\x0d\xe6\x30\xdc\xbc\x03\xa3\x4d\xdb\x31\xda\xbc\x1d\xcd\xe6\
\xf3\xd1\xcc\x9f\x07\xae\x6a\xad\x82\x05\x70\x04\x15\xa9\x00\x0e\
\x6d\x7f\x50\xbc\x8f\x02\x1d\x55\xb0\x82\x6a\x95\xa5\x1b\xd6\x21\
\xea\x4e\x37\x1c\x3c\x0c\x1c\x78\x04\xbc\x7f\x1f\x78\xff\x5e\xe0\
\x91\x47\x80\x66\xfd\x18\x62\x5c\x60\xc6\x88\x67\xf1\x11\x9b\x4e\
\xa5\xc2\x9b\xdf\x74\xec\x53\xc3\xa1\xfb\xd6\xe4\xce\xec\xfe\x02\
\xe8\xb3\x2f\xae\xf1\x47\x3f\xb2\x0d\x4b\x0d\x63\x69\x04\x9c\x6a\
\xbb\x7d\x92\x53\x2d\xb0\x3c\x02\x96\xda\xee\x27\x4b\x97\x1a\xc6\
\x72\x03\x2c\xb7\x8c\xe5\x86\xb1\xdc\x02\x0f\xec\x3b\x85\xcf\xdf\
\x72\x08\x8b\x8b\x23\xb1\x62\xda\x4d\x3e\x29\x04\x0e\x7a\x65\x9d\
\x3e\x3f\x7d\x01\xc6\xae\xcc\xae\x9c\x0f\xf1\xbc\xf3\xc2\x39\xb6\
\xfd\xf2\x51\x15\xca\x76\xec\x4d\x59\xd8\x3e\xf6\xd7\x95\xd5\x07\
\xdb\xe7\x9e\xc9\x93\x93\x0e\x00\x44\x68\x67\x37\x63\xb4\x69\x2b\
\xda\xf9\xad\x68\x36\x9d\x87\x76\x7e\x0b\xdc\xa6\xf3\xe0\xe6\xb7\
\x80\x67\x66\x41\xde\x15\x24\xc1\x41\x06\x1c\x99\xdd\x51\x89\x8b\
\x3a\x35\x42\xa5\x13\x81\xda\x11\xe8\xe4\x22\xaa\xc5\x05\xd0\xc2\
\x71\xd0\xb1\x23\xc0\xd1\x23\xc0\x91\xc3\xc0\xf1\x63\xa0\xb8\x48\
\x6e\x88\xf0\x57\xb7\xef\xbf\xfe\xa5\x36\xb1\xf8\x97\x08\xe7\x2a\
\xf7\xbe\x21\xf0\xad\xdd\x5d\x5a\xcd\xef\xd8\xd7\xe0\xde\x43\x2d\
\x2e\xdb\x5e\x75\xb6\x88\x03\x9a\x8a\x30\x70\x8c\x26\xd8\x18\x15\
\x63\x50\xa1\xbb\x67\xc0\xb5\x8c\xbf\xbf\xf9\x08\xee\xba\x7f\x21\
\xad\xc4\xa1\xde\xf8\x21\xe3\xd0\x6a\x8a\x8e\xe8\xfc\x98\x37\xf9\
\xbe\xa8\x5e\xc5\xf7\xd3\xab\xf8\x58\xe3\xdc\xb0\x12\x65\x75\xb2\
\xba\x64\xbe\xb6\x59\xa0\xdb\xe5\x71\xac\x93\xb3\xd8\x24\x70\xc4\
\x32\xcc\x18\x2c\x2f\x62\xb0\xbc\x08\x60\x9f\xca\x67\x00\x5c\x0d\
\xc0\xb3\x73\x70\xb3\xf3\xdd\xe7\xcc\x1c\x78\x66\x0e\x3c\x33\x03\
\x0c\x66\xc0\x83\x1a\xa8\x07\x5e\x95\xaa\xa2\xf7\x8c\xd8\x81\x9c\
\x03\xb5\x4d\x07\x84\xd1\x10\x34\x5c\x06\x2d\x2f\x01\x4b\xa7\x40\
\xa7\x4e\x02\xa3\x61\x04\xf3\x86\x0f\x44\x7f\x56\x4a\x2e\x02\xe4\
\xf2\xad\xf8\xd0\x9d\xcb\x78\xbb\x63\xde\x94\x52\xbb\xc9\xfa\xc8\
\xad\x4b\xf8\xf7\x2f\xd9\xe2\x55\x2b\x69\x77\x74\xc6\x7b\x04\x4d\
\xc5\x78\xe0\x91\x21\xfe\xfb\x0d\x87\x70\x6c\x61\xa4\x26\x37\xd3\
\x64\xfa\xe4\x0b\xc8\x04\x43\x09\x6b\x1f\x90\x2c\xd0\x60\xf2\x7d\
\x5c\x7b\xb7\xfa\x3a\xd5\x07\xea\xd0\x37\xd1\xbf\x52\x5f\xc5\x02\
\xd3\x2b\xfc\xb2\x5e\xee\xa9\xd7\x96\x5d\x83\x40\x00\xc8\x35\xc0\
\x52\x83\x7a\x69\x71\xcd\xea\x3d\x07\xc3\x09\x6e\x87\x99\xfd\x01\
\x74\x7b\x2c\x59\xb8\xf9\x67\x77\x1c\x9d\xad\xf0\xdf\x52\x4a\xf2\
\x14\x7d\xec\xf6\x25\x8c\xda\x8e\x25\x06\xde\xde\x18\x10\x09\xcf\
\x56\xf7\x8d\xae\xcf\xdc\x76\x1c\x7f\xf6\x37\x8f\xe0\xd8\x89\x91\
\x7a\xbe\xbc\xc2\xc3\xe4\x97\xe2\x48\x2b\x6e\xa1\xaa\xb0\x3a\x4b\
\x3b\x21\xd3\xed\xa5\x00\xc2\xe4\x15\xee\xcb\x7d\xb6\xec\xd0\xf3\
\x4e\xd2\x4e\xc1\x04\x56\x02\x90\xd9\x29\x16\xb0\xa2\xdf\xd3\xb0\
\xc7\xe3\x61\x05\x81\xe8\x43\x77\x1c\xf8\xbd\xe2\xee\x62\x11\x20\
\x00\xb0\x65\x33\xde\x5d\x9a\x88\x63\xa7\x1c\xfe\xfa\xcb\xcb\x18\
\x54\xe4\xc1\x91\x76\x38\x07\x15\xb0\x78\xaa\xc5\x7f\xf9\xc4\x01\
\x7c\xfa\x96\xe3\x70\x6c\x84\x66\xcc\x0a\x5e\xce\xef\xcf\x9b\x06\
\x74\xe9\x96\x85\x20\x9a\x22\x46\x0e\xc7\x0b\x32\x17\x84\x73\x9a\
\x77\x9a\xc0\x4a\xb6\xcd\x5e\x97\xf1\xe3\x61\xed\x03\xf3\x80\xf0\
\xee\xbe\xdc\x5e\x80\xec\xff\xf9\xed\x9f\x9e\xa9\x70\x77\xbe\xba\
\x02\xef\xbf\xf1\x24\x2a\x0f\x88\x41\x45\xfe\x13\xb8\x7b\xef\x32\
\xde\xfc\x91\xfd\xf8\xea\xbe\x65\x00\x2b\x59\xe9\xc6\xab\x42\xe3\
\xf3\x26\xdf\xaf\x0c\x68\xa6\x2d\x36\xa0\x2a\x08\x32\x59\xa1\x96\
\x75\xb1\x56\xcf\x26\xb3\x52\x4a\xcb\x5c\xc6\x78\x9c\x3d\xd6\x3c\
\x10\xdd\x7e\xf3\xde\xb7\x7d\xae\x2f\xbb\x17\x20\x20\xe2\x99\x9a\
\xdf\x09\x20\x53\x53\xee\xde\xdf\xe0\xc6\xdd\xc3\x08\x8e\xba\x02\
\xfe\xf2\x96\x45\xbc\xe5\x63\x87\x70\xfc\xa4\x74\xdf\x86\x8f\xb2\
\xb0\x94\x16\xc5\xdc\x40\xb7\xf9\xd3\x86\xf1\xc0\x9a\xcc\x5e\x2b\
\xcd\x97\xb7\xe6\xec\xd7\x04\x86\x98\xb4\xa7\xb3\xd6\xb6\xc7\x19\
\x0b\x71\xd3\xcf\xb8\x82\xe3\x3e\xcd\x46\x08\xfc\xfb\xe3\x72\xfb\
\x01\x02\x60\xfb\x8e\xfa\x3d\x15\x71\xda\xcf\x17\x73\xf4\x47\x9f\
\x5f\xec\xbc\x55\x8e\xf1\xdb\x1f\x3f\x8a\x3f\xfa\x1f\xc7\xd0\xb6\
\x9c\xaf\xb6\x36\x6e\xeb\xca\x56\x5e\x93\xa7\xda\xd5\xea\x4e\x48\
\x2a\x81\x4e\x8f\xff\x78\xd0\x95\x3b\x56\xba\x9f\x8e\xb1\xa6\xb9\
\xef\x37\xfa\xd1\xcb\x4a\x1b\x46\xa6\xc6\x85\xc2\x7e\x60\xb6\x4b\
\x1e\xa2\x12\x30\x67\x21\x30\x70\x84\xdb\xe6\x8f\xc7\x95\x19\x0b\
\x90\x07\x7e\x76\xc7\xd1\xb9\x9a\xde\x23\xd3\xc2\xbb\x7c\xfe\xbe\
\x21\x3e\x73\xcf\x12\xfe\xdd\xfb\x0f\xe1\x53\x77\x9e\x32\x72\x30\
\x46\x12\x0b\x60\x29\x82\x4a\xa4\x51\x29\xaf\x00\xc0\xa2\x81\xce\
\xb6\x9e\x7e\xd0\xd1\x04\xe3\xbd\x38\x8f\xa2\x6c\x11\x94\xa2\x83\
\x6b\x66\x53\x6d\xc4\x20\x40\x21\xa5\x3f\x9e\xaf\x92\xff\xcc\xae\
\xba\x02\xcb\x19\x0c\x15\xf0\x87\x7d\xc6\xb9\x28\x33\x3e\x6c\x9f\
\x1b\xbc\xad\x22\x8c\xec\x84\x31\x33\x7e\xee\x43\x47\x70\xe7\xde\
\xce\x4b\x25\xf3\x74\x98\x24\x38\xab\xc9\xeb\x61\x88\xbe\xd0\xcb\
\x5e\x93\xf3\xfa\x41\xc7\xd3\x81\x2e\x63\x2f\x0b\xba\xf1\x63\xb0\
\xe1\x8d\xf3\x02\x30\xfc\x59\x5e\xad\x4e\x59\x16\x89\x4c\x22\x2b\
\x38\x83\x8c\xc2\x58\xa6\x81\xbb\x7e\x52\xb1\x89\x00\xd9\xfd\x9f\
\x76\xdc\x37\x5b\xe3\x03\xb2\x66\xdb\x52\xff\xfb\xac\x16\x00\xe3\
\xc1\xb1\x32\x20\x4d\x0b\xde\x49\x6d\x9a\xbc\x69\x41\xb7\x22\xa6\
\x63\x91\x3f\x05\x7b\x9d\xed\x40\xa2\x5f\x02\x18\xd2\xc6\xb0\xea\
\x94\x92\x7f\xa5\x72\x25\x0a\x89\x75\xac\x67\xa8\xe8\xff\xb9\xf5\
\xa1\x77\xec\x99\x58\x6c\x9a\xba\xb6\xcf\xb7\x6f\x26\xa0\xcd\x73\
\x56\x28\x54\x22\x4c\x62\x80\xe9\x04\x77\xad\x80\xb4\xb2\x7a\xc6\
\xf7\x7d\x8d\x40\x57\x62\xb7\x8d\x14\x32\x70\x40\x03\x23\xda\x17\
\xc6\x32\x8f\xaa\x97\x50\xa9\x04\x50\xa4\xda\xb5\x5e\x20\x61\xe6\
\x66\xa6\x76\xbf\x31\x4d\xd9\xa9\x00\xf2\xe0\x2f\x5d\x72\xfb\xec\
\x80\x3e\xb4\x12\x00\xac\x4c\x00\xd7\x23\x6f\xf5\xe0\x58\xbd\x4a\
\xd8\x5f\x76\xfa\x3d\x9f\x49\x6d\x6e\x80\xd0\x07\x0e\x24\xb6\x90\
\x52\x5f\x3a\xd0\x1b\x79\x43\xd5\x15\xe2\xeb\xcb\x24\x15\x55\x7f\
\x76\xd3\x43\x6f\xff\xca\x54\x65\xa7\xad\xf4\x82\xf3\xaa\x37\x55\
\xc0\xd4\x47\x2d\xa7\x7f\xaf\x33\x01\x16\x9d\xb7\xf6\x2a\xe1\x24\
\x46\x5c\x2b\xd6\xdb\x18\xa1\x17\x1c\x91\x41\x48\xa9\x54\xf1\x21\
\x31\x48\x0a\x28\x86\x4d\x22\x93\x60\xed\xf1\xd1\x9d\xda\x1d\xfc\
\xf2\xb4\xe5\xa7\x06\xc8\x03\x6f\xb8\xf0\xcb\xf3\x33\xd5\x58\x97\
\xd8\x7a\x87\x0d\xa9\x87\x03\x58\x2f\xd6\xdb\x90\xef\x4b\xe6\x33\
\xbb\xa5\x5c\x75\x22\x08\x0f\x16\x14\x58\x48\x20\x8c\x6c\x65\x3d\
\x6d\x9d\x4e\xa8\x88\xde\x7d\xfb\x83\x6f\xfd\xea\xd4\xe5\x57\x52\
\xf9\xae\xf3\x07\x6f\xac\x88\x4e\x02\xeb\x23\xac\x6b\x55\xe7\x46\
\xee\xdb\x6a\xea\xdc\x90\x40\x81\x51\x81\x04\x1b\x40\x44\x95\x97\
\xca\xeb\x5f\xca\x98\x2f\x3d\x8b\xf5\x7a\x67\x5e\x70\xf3\xd3\xb3\
\x07\xb0\x42\x80\xdc\xf3\xf3\xbb\xf6\x6c\x9e\xa5\xdf\x5e\x59\xa7\
\x1e\xbb\x61\xa3\x0a\xf6\xe9\x04\x2a\xc4\xca\xf9\xfe\xce\x1a\xed\
\xb1\x50\xb9\xa6\xec\xf9\xde\x96\x56\x1e\x2a\xaa\x7f\xeb\x0e\xf1\
\x93\x3e\x53\x3d\xb3\xd2\x46\x2e\x9e\xa9\x7e\x73\x50\xd1\x44\xf7\
\xd8\xe3\xe1\xb1\x13\x26\x09\x70\x1f\x00\xce\xe8\x02\x42\x7c\xff\
\x96\x01\xfe\xf3\x4a\x1f\x5b\x31\x40\xee\xb8\xee\xe2\x13\x5b\xe6\
\xf0\x1f\xb1\x51\x2d\xc8\xc7\xc3\x19\x0f\xfd\x82\xc0\xf1\xff\xf8\
\xc5\x4d\x91\x57\x7a\x6e\x7d\x84\x8a\xb9\x06\xfd\x87\x1b\xf6\xfc\
\xce\xa9\x95\x3e\xb9\x62\x80\x00\xc0\x23\xbf\x76\xe9\xfb\x66\x67\
\xf0\x37\xab\x79\xf6\x5c\x0d\xab\x99\xb8\x47\xe3\x0a\xc2\x85\x98\
\xca\x17\x9b\xa2\x1c\x12\xe4\x9e\xa7\x47\x4b\x61\x2f\xb4\xb7\xb5\
\xd3\x1f\xc7\xea\xaf\x6e\xd9\x77\xfd\x87\x57\xf5\xe4\x6a\x9b\xdc\
\xb9\x89\x7e\x8a\x80\x15\x23\x72\x5c\x58\x2b\x81\x3a\x57\x04\x73\
\x7c\x3f\xfb\xb7\x1b\xcf\x6a\xc8\x00\xe0\x6f\xc5\x0d\x43\x97\x61\
\x30\xc2\xb7\x24\x19\x05\x70\xf8\xff\x72\x70\x99\x36\x57\xd3\x5d\
\xe6\xc5\x6a\x0e\x3f\xb3\xda\xe7\x57\x0d\x90\xfb\xae\x7b\xd2\xdd\
\x9b\xe6\xf0\xab\xab\x7d\x7e\x35\x61\xfd\x05\x65\x9c\x56\x3c\x3e\
\xaf\xbf\x6f\xf6\xb9\x71\x5a\xb8\xdd\x4d\xd9\x98\x66\x7e\xa6\x26\
\x59\x90\xb0\x66\x12\x81\x0f\xb5\x47\x1a\xef\x25\x38\x62\xf6\xda\
\xb0\x47\x55\xe1\x8d\xb7\xee\x7e\xdb\xbd\xab\x7e\xfe\x74\x1a\x7f\
\xee\xfc\xe5\xbf\x35\x33\xa8\x6e\x2c\xe5\x8d\xdb\x46\xc3\x19\xcf\
\xd3\x42\x39\xa9\x6f\x3c\x26\x6f\xda\x36\x6c\x5e\x7f\x9b\xe3\x41\
\xb2\x21\x7d\x61\x6a\x65\xd7\x6f\x96\x98\x84\xd3\x57\xeb\x39\xe1\
\x42\xa6\xc9\x72\xba\x6e\x36\x6d\xac\x32\x10\x6e\xb8\x6d\xdf\xde\
\xb7\x9d\x46\x0d\xa7\x07\x90\xbf\xbb\x8e\x9a\xf3\x67\xf1\x6a\x22\
\x5a\x5a\xd9\xc4\xae\x8f\xe0\xaf\x7f\x3d\x9d\x33\xbf\x1f\x40\x79\
\xd9\x69\xeb\xe5\xb1\x65\x37\x5e\xd0\xea\x10\x0b\x36\xc8\x01\x50\
\xa6\x10\x16\xe5\x44\x11\x01\x8e\xd3\xf9\x41\x14\x66\x9c\xac\x2a\
\xbc\x1a\xf8\x60\xe1\x0c\xe1\xf4\xe1\xb4\x00\x02\x00\x7b\xde\x7c\
\xf9\x6d\xe7\xcd\xf2\x2f\x76\x77\xd3\x0b\xe5\x78\x81\x98\x56\x08\
\xc7\xb7\xb1\xb2\x7a\x56\xbb\xaa\x4f\x62\x0b\x99\x45\xfd\x18\x12\
\x3b\xcc\x2c\xcb\x6e\x60\xac\x28\x35\x4a\xaa\x5b\x06\x28\x7d\x17\
\x44\xf9\xa8\x50\xad\x01\x38\x00\xa0\x22\x7e\xfd\xad\x0f\x5f\x7f\
\xd7\xe9\xd5\xb2\x06\x00\x01\x80\x47\x7e\xeb\x29\xbf\x3d\x3b\xa0\
\x4f\x74\x77\x67\x66\x55\xd7\x82\xbf\x12\x06\xe8\xab\xc7\x66\x51\
\x12\x56\xfb\xb8\x68\x92\x6d\x17\xc8\xde\x5b\x41\x17\x7f\x8e\x3a\
\xee\xa2\x99\x06\x0a\xc3\xb4\xa1\x0c\x75\x11\xa2\x93\x2a\x7a\xa7\
\x0c\x50\x4a\x1d\x97\xc4\x02\x69\xc4\x27\x35\xec\xb4\x02\xe1\x63\
\xb7\xed\x7f\xfb\xef\x9e\x66\x2d\x00\xd6\x08\x20\x20\xe2\xed\xdb\
\x36\xff\x68\x5d\xa1\xb0\x4b\x39\x59\xff\x5e\x9d\xce\x6f\xb2\xac\
\x30\x9b\xbc\xd8\xce\x8a\x84\xd9\xe4\xa9\x6e\xc8\xb2\xfd\x82\x3e\
\x69\xae\x73\x43\x5c\x77\x90\x37\x3a\x8d\x00\xca\x64\x88\x40\x11\
\x60\xc9\xd8\x03\x41\x2d\x33\xc0\x08\xcf\x9f\x5e\x67\x1e\x9a\x81\
\x7b\xcd\x5a\xd4\x04\xac\x15\x40\x00\x3c\x70\xdd\xc5\xfb\x36\xcf\
\xe2\x5f\x03\xdc\x66\xaa\x84\x0c\x25\x01\x2c\xac\xcc\xf2\x5e\x09\
\x76\xdf\x2a\x0e\x8c\x11\xf4\xd5\x0a\xb3\x2e\x3b\x7e\xc4\x27\x2d\
\x04\xd2\xce\x28\xbf\x4c\x51\xed\xdc\xe0\xd8\x88\xc1\x00\x20\xa4\
\xf5\xeb\x58\xba\x48\x2f\xdb\xac\xa4\x0b\x8c\x51\x45\xf4\x8a\x9b\
\xf6\xbd\xe3\xc0\xe9\xd5\x94\xc2\x9a\x01\x04\x00\x1e\x79\xeb\x53\
\x3f\x39\xa8\xf0\xc6\x98\x60\x05\x16\x05\x61\x2e\x09\xec\x54\x2a\
\xc8\x78\xf5\x64\xf2\xca\xdd\x17\xc6\xb1\x1a\x99\xfc\x3e\xb4\x53\
\x4f\xbe\x4f\x93\x60\xcc\x7e\xfa\xdf\xe7\x87\x38\x7c\x7c\x8a\x77\
\xda\x30\xa1\x07\x0f\x25\xbc\xac\xe5\x4b\x31\xbb\x5f\xb8\x75\xdf\
\xf5\x9f\x99\x5c\x72\xfa\xb0\xa6\x00\x01\x80\xe3\xef\xb8\xf2\xd7\
\x89\xf0\xe7\xc5\x15\x70\x0d\x74\xed\xfe\x55\xba\xd4\x58\xb1\xf1\
\x9e\xbc\xb2\xa0\x8f\xcd\x8f\x82\x6b\xde\x87\xf4\xc5\x16\x04\x6a\
\x11\xd0\x6a\x56\x0e\x2c\xdb\x97\x73\x34\xac\x31\x18\xb2\xea\x99\
\xff\xdf\x3b\x0f\xbc\xe3\xad\x6b\x5d\xef\x9a\x03\x04\x20\x9e\x3f\
\xd9\xbc\x0a\xc0\xad\xd3\x8f\xc7\x4a\x05\x7d\x65\xf7\xb9\x6a\xa3\
\xcb\x32\xc9\x7b\x64\xb2\x19\xf3\xc7\x09\x7a\xc9\x46\xc9\xde\xa9\
\xe4\x5c\x28\x00\x21\xb4\x0b\x82\x55\x17\xcf\x19\x16\x39\x83\x81\
\x99\xbf\x78\xa4\x5e\xfa\xb1\xf5\xa8\x7b\x1d\x00\x02\x1c\xfa\xaf\
\x57\x2d\xcc\xcc\xcc\xbc\x0c\x20\xf1\xb7\x77\xc7\x09\xee\x6a\xf3\
\xa1\xf3\xc9\x08\x50\x41\xf6\x32\x17\xaa\x11\x74\xee\x13\xf4\x29\
\x57\x7b\x69\x54\xb3\x6e\x44\xf4\x53\xaa\x51\x5d\x7f\xd8\xf6\x47\
\x30\x94\xad\xf7\xf1\x90\x02\x33\x3f\xbc\x3c\x1a\xbd\x7c\xaf\xf9\
\xcb\x50\x6b\x15\xd6\x05\x20\x00\x70\xec\xfa\x2b\xee\x9f\x1f\xd0\
\xcb\x41\x38\x59\x5e\x39\xe5\x7d\x41\x27\x87\x2e\x52\x36\xd4\xa5\
\x60\xfb\x02\x52\xe8\x00\x25\x64\x50\xf7\xe3\xd4\xb5\x15\xac\xf6\
\xb1\x2e\xcb\x3e\x64\xfa\x47\xe6\x91\xfe\x3a\x39\xbe\x07\x29\x16\
\x39\xe7\x6c\x91\xf5\x0e\xcc\x0b\xce\xe1\x65\x5f\x3d\xf2\xfb\x0f\
\xae\x57\x13\xeb\x06\x10\x00\x38\xfc\x8e\xa7\xdf\x30\x43\xf4\x0a\
\x00\xcd\x58\xf9\xca\xd4\x88\xf1\xaa\x8b\x16\xfc\x71\x41\xae\xe6\
\xfa\xde\x76\x62\xac\xd1\x4d\x63\xd4\x2c\xb2\x7d\x95\x2a\x5b\xb9\
\x4d\xce\xea\xa5\x31\x2c\x32\xae\xbf\x8f\xdd\xc0\xcc\x23\xe7\xf0\
\x43\x5f\x3e\xf8\xf6\xe2\x51\xa7\xb5\x0a\xeb\x0a\x10\x00\x38\xfa\
\x7b\xcf\xfc\xc8\x60\x40\x3f\x19\xf6\x8f\x92\x1a\x94\xaf\xe8\xfd\
\xa1\x40\x29\xbd\x6a\x4c\x8f\x5a\x33\x71\xb5\x4f\xc5\x8a\x46\xb5\
\xf8\xe0\x4c\x50\xc7\xb0\x81\xa8\xa3\x5c\x6f\x19\x04\x72\x91\x60\
\xf1\x73\x20\x51\x05\x7c\x0c\x07\x66\x76\xc4\xf4\xda\x3b\x0f\xbe\
\xfd\x2f\xd7\xbb\xad\x75\x07\x08\x00\x1c\xfb\xdd\x67\xbe\x7b\x50\
\x55\xaf\x87\xf9\x7b\xb2\x65\x35\x46\xdf\xf7\xef\x1d\xc0\xc4\xfd\
\xfd\x8a\x56\x7b\x18\x03\x7d\x7c\xfb\xb9\x1d\x40\xc8\xd4\x3c\x6b\
\x5f\xf4\x80\x20\x63\x91\x08\x80\xf4\x88\x06\xbf\x00\x69\xe8\x3b\
\x1e\x7b\x81\x99\x99\x89\x7e\xf6\xf6\x03\xd7\x9f\x91\x1f\x10\x39\
\x23\x00\x01\x80\x63\xef\xbc\xea\x2d\x83\x8a\xae\x83\xfa\x5b\xc4\
\x40\xae\x36\x24\xc1\x51\x81\xa4\x1d\x62\x04\x5d\x0a\x68\x71\xb5\
\x0f\x71\xdd\x9e\x41\x4f\x9e\xaf\x80\xa6\xdb\x64\x59\xcd\x58\x16\
\xeb\x67\x91\xd4\x5f\x73\x91\xf8\xcc\xf6\x45\xac\x23\xe0\xb1\x13\
\x98\x99\x41\xfc\x86\x3b\xf7\x5f\xff\xf6\x33\xd5\xe6\x19\x03\x08\
\x00\x1c\x7d\xe7\xb3\xae\x23\xa2\x5f\x01\xc0\x9c\xc9\x94\x5e\xed\
\xc7\xdb\x21\xf6\x88\x46\x79\xf5\x2f\x0a\xac\x04\xce\x18\x86\x61\
\x4a\xe5\xcb\xc6\xba\x04\x16\x99\x7e\x8f\x63\x91\x02\x18\x14\x73\
\x08\xc3\x1c\xd2\x48\xa7\x82\xaa\xf5\xd8\x01\x09\x33\x33\x81\x7e\
\xe9\x8e\xfd\xef\x78\xf3\x99\x6c\xf7\x8c\x02\x04\x00\x16\xfe\xe0\
\xd9\x6f\xac\x2a\xba\x0e\x00\xc7\x09\x56\x2b\xb1\x0c\xa5\x95\x3d\
\x07\x82\x12\x60\xe3\xf1\x19\xbb\x77\xe1\x9f\xc9\xbd\x59\xfd\xe0\
\x9a\xec\x9a\x2d\x3d\x67\x54\x27\x29\xe8\xa2\x5d\xee\x2b\x9f\x81\
\x91\x52\x3d\xd9\x98\x3d\xfa\x42\xc7\x1c\xf4\x86\xdb\x1f\xb9\xfe\
\x8c\x7e\x41\x0f\x38\x0b\x00\x01\x80\xe3\x7f\xf0\x9c\xeb\xea\x8a\
\x5e\x8f\x08\x12\xb9\x1a\xe6\xab\x7d\x8c\x84\xd5\xbc\xa0\xf2\x24\
\x61\xd2\xe5\x75\x9d\x13\x8c\xea\xa2\x20\x87\xf8\x98\xe7\x2c\x8b\
\x58\xd5\xc8\x97\xcd\x1c\x0a\xb1\xef\xe6\x32\xec\x92\xb1\x07\x08\
\xdd\x1f\x23\x7f\xf4\xbb\x7e\x99\xd9\x31\xd1\xbf\xbf\x63\xff\xf5\
\x67\x94\x39\x42\x38\x2b\x00\x01\x80\x63\x7f\xf0\xdc\xb7\x54\x75\
\xf5\xe3\x20\x6a\x92\xbc\xe9\xd5\x7e\x25\x6a\x56\xc9\x9b\xc5\x56\
\x18\x95\xd0\x15\x8c\xea\x58\x70\xcc\xa5\x9e\x9b\x64\x54\x17\x84\
\x5f\x82\x28\x63\x85\x82\xaa\xd5\x57\x8f\x02\xb5\x04\xff\xa3\x27\
\x30\x63\x44\x4c\xaf\x39\x93\x36\x87\x0d\x67\x0d\x20\x00\x70\xec\
\x0f\x9e\xfb\xee\x9a\xf0\xaf\xc0\x38\xb9\x72\x35\xcb\xae\xe2\xd0\
\xc2\x67\x8d\x6a\xc1\x48\xe5\xba\x84\xc0\x4e\xcd\x22\x7d\x60\xe8\
\x33\xaa\x0b\x76\x84\x64\x05\x14\xd2\x05\x20\x34\x33\x79\x16\x29\
\x80\xe4\xd1\x01\x14\x3e\xc1\x8e\x5f\x7e\xa6\xbc\x55\x7d\xe1\xac\
\x02\x04\x00\x8e\xbe\xfb\x9a\x8f\xa0\x6e\xbf\x8d\x80\xfd\x41\x82\
\x33\x35\x4b\xad\xfe\x7d\x76\x80\x04\x4d\x08\x3d\x60\x9a\xd6\x35\
\x3b\x06\x04\xba\x0f\x41\x88\x35\xf8\xfa\x0c\xf6\x1c\x30\xa2\x2f\
\xf2\x59\x0b\x98\x58\x5e\xa8\x57\x19\x48\xce\x7d\x36\x61\xe6\x87\
\xdb\x16\xff\xf4\x4c\xec\x73\x4c\x0a\x67\x1d\x20\x00\xb0\xf0\xee\
\x17\xde\x40\xb3\xf4\x22\x10\x6e\x2d\xaa\x59\x08\x71\xa4\x8c\x18\
\x84\xb0\x89\x7b\x1e\x07\x26\xf3\x5c\x09\x04\xbd\x2c\x22\xda\x55\
\xb6\x4d\x04\x9a\xb9\xfa\x54\xa4\x9e\xfc\xa2\xa7\x2a\xf6\xc7\x82\
\xa4\x8b\x33\x55\xea\xfe\x5c\x06\x09\x33\x7f\x89\x46\x83\x17\xad\
\xf7\x0e\xf9\xb4\x61\x43\x00\x04\x00\x8e\xbd\xeb\x79\xf7\xcf\xd0\
\xc9\x6f\x04\xe8\xcf\xd1\xbb\x57\x22\xc1\x52\x5e\xcd\x35\x7e\xfa\
\x41\x90\xad\xdc\x13\x8d\xea\x92\x80\x8b\x76\x8b\x6a\x54\x8f\xaa\
\x45\xb6\xfd\xfe\x36\x12\x48\xaa\x5e\x90\x68\xc3\xfd\xdc\x04\x09\
\x33\x33\x33\x3e\x78\x88\x0e\x7f\xd3\xed\x47\x7e\x7b\xdd\xce\x56\
\xad\x34\xd0\xe4\x22\x67\x3a\x30\x5d\xf0\x63\x5f\x7c\x43\xdb\xba\
\x37\x81\xb9\x0e\xdf\xac\x21\x76\xfe\x33\x7c\xdb\xc6\x89\x78\x4f\
\x3a\xa6\x7f\x8e\x7c\x5e\x8c\x43\xb7\xab\xeb\x08\x65\x6c\xdd\xe3\
\xea\x29\xf4\x15\x7d\xef\xe0\xff\x36\x61\xd6\x9e\x7d\x5e\x3f\x93\
\x3d\x17\xf2\x7d\xd8\x80\x93\x0d\x00\x60\xe6\x86\xa8\x7a\xc3\xed\
\xfb\xdf\xf6\x16\x6c\x30\x4c\x6f\xd4\x31\xc3\x25\x3f\xf1\x8f\xdf\
\x7e\x6a\x09\x7f\xc2\xce\x5d\x9c\x0b\x98\x33\x02\x61\x05\x2d\x17\
\xea\x7e\x00\x19\x81\xee\x13\x74\x03\xb8\xde\xf2\xe8\x01\x83\xe8\
\xeb\x38\x21\x5f\x0d\x48\xc6\xe7\x21\xe5\xf9\xb0\xb1\x26\x9d\xf7\
\x02\xf4\x8a\xdb\xf7\x5f\xff\xb7\x67\xbb\x27\xa5\xb0\x61\x54\x2c\
\x1b\xf6\xbe\xeb\x6b\x3f\xb1\x6d\xc7\x96\xe7\xd5\x75\xf5\x29\xab\
\x92\x94\x54\xa9\x6c\x33\xcd\xa8\x3b\xb9\x51\xdd\x3d\x99\x19\xd5\
\xfe\xb6\x68\x53\x48\x35\x48\xa9\x43\xa2\x5f\xe3\x54\xb2\x3e\xc3\
\xbb\x94\x1e\xd5\xa6\x3e\x9b\xa4\x90\x27\xe2\xd6\x2e\xd9\x88\x6a\
\x17\x01\x7f\x45\x8c\xe7\x6d\x54\x70\x00\x1b\x6d\x31\x29\x85\x37\
\x72\x75\xe1\xee\x2f\xfc\xdc\xa8\x69\x7f\x19\x8e\xe7\xa6\x67\x91\
\xf1\xcc\x20\x57\xe7\xb1\x65\x4f\x4b\xd5\x1a\xc3\x52\x7d\xaa\x57\
\x29\xdd\x32\x49\x49\x8d\x62\x8c\xc9\x13\x6c\x12\xf2\x7d\x38\x1b\
\x02\xc0\xcc\xa7\xea\xaa\x7a\xc3\xad\xfb\xde\xf6\x36\x6c\x1c\xbc\
\x16\xc3\xc6\x07\x88\x0f\x97\xfe\xc4\x17\xaf\x59\x3a\x35\x7c\x6f\
\xdb\xba\x6b\x27\x03\x40\x80\xc0\x69\x21\xed\x57\x67\x2c\x00\x26\
\x09\x7d\x0f\x60\x32\xe0\xf5\xd5\xbf\x02\x90\x4c\xb2\x3d\xc0\xdd\
\x39\xe9\xa2\xca\x05\xdd\xaf\x1e\xb5\x0b\x38\x63\xc2\x70\x63\x0d\
\x7e\xf5\x2d\xfb\xdf\x7e\xdb\x99\x69\xee\xf4\x42\x7d\xb6\x3b\x30\
\x6d\x58\xb8\xf1\x5d\xfb\xaf\x78\xfa\x77\xbc\x67\x69\xee\x7c\xe7\
\x18\xdf\x00\xc6\x40\x4e\x28\xc5\x9b\xb4\xbf\xae\xf2\x6d\x9c\x74\
\xd9\xfe\x32\x63\xea\xa1\x9e\xf4\xac\xfe\x4e\xbd\xe9\x2b\x0f\x9a\
\x50\xaf\xba\x97\x85\xfd\x1f\x33\x23\x2a\x94\x25\x10\xd9\x17\xb0\
\x69\x94\xb5\x9d\xf5\x6d\xad\x02\xf3\x52\x55\xd1\x9b\xe6\xf6\x9f\
\xfa\xb1\x9b\x16\x7f\x6f\x45\x7f\xe5\xe9\x6c\x86\x73\x86\x41\x64\
\xb8\xec\xb5\x9f\x7f\xf6\xa9\xa5\xf6\x9d\x6d\xeb\xfe\xc9\x38\xc3\
\xbc\x6f\xa5\x5f\x95\xc1\x3e\x4e\xd5\x2a\x79\x93\xe2\x33\x92\xb5\
\x30\x3d\x93\x58\x26\x82\xa8\x43\xdd\x97\xd4\x2a\xe8\x7a\x05\x93\
\xe4\xaa\x96\xcf\x0b\xcf\xad\x0f\xab\xfc\x1d\x55\xf5\xff\x71\xdb\
\xde\xdf\xfe\xf2\xda\x54\x77\xe6\xc2\x39\x09\x90\x2e\x30\x3d\xf1\
\xd5\x9f\x7f\xcd\xd2\x70\xf4\x66\x76\x7c\x51\xaf\xe0\x17\x05\x79\
\x25\xaa\x96\xad\x63\x1a\xd7\xac\x4b\x42\x5a\xf2\x6c\x95\xd4\xb0\
\xb1\x6a\x14\x90\xc0\x8e\x1e\x50\xa4\x72\x3a\xdf\xa6\xa1\x07\x28\
\x30\x69\xfe\x5e\x84\x55\x08\xcb\xbe\x9a\xf0\xfa\x5b\xf6\x5d\xff\
\x27\x59\x65\xe7\x48\x38\x87\x01\xd2\x85\xcb\x7f\xf2\xb3\x3b\x96\
\x17\xe8\x8d\xc3\xc6\xfd\x24\x1c\xcf\x52\x51\x88\xc7\x19\xd8\x93\
\x00\xd3\xc3\x2a\xbd\xb6\x86\x05\x29\x56\x09\x12\xc0\x82\x42\xd5\
\x11\xcb\x22\xc6\x73\xe0\x48\xb6\x49\xe5\xc8\xdc\x47\x50\x00\xa2\
\xee\x30\xc2\x65\x66\x09\xa1\x28\x40\x8c\x65\xaa\xf1\x8e\xb9\xa5\
\xf9\x5f\xbd\xf1\xc8\x6f\x1e\x3b\x9d\xf9\x3d\xdb\xe1\x9c\x07\x48\
\x08\x57\xbc\xf6\xf3\x4f\x5f\x5c\x5c\x7e\x73\xd3\xba\xef\x01\x33\
\x65\x8c\x52\x10\xc8\xbe\xfc\x1c\x48\x9d\x80\xf7\xb3\xca\x24\xe0\
\xa1\x00\x12\xab\x6e\xa5\x32\x45\xc1\xb7\x00\xb2\xc2\x6d\xd3\xe4\
\xbd\x14\x72\x05\x14\x18\x40\x94\xc0\x62\x9e\x03\x90\xbe\x38\x6d\
\x41\xc3\x8e\x88\x3e\x84\x99\x99\x5f\x58\xc9\xdf\x22\xdf\xc8\xe1\
\x51\x03\x90\x10\x2e\x7d\xe5\xff\xfc\xfa\x61\xb3\xfc\x6b\x6d\xcb\
\xdf\x0a\x76\xb4\x2a\x55\xab\xcf\x1e\x99\x08\x12\xa1\x02\x4d\x04\
\x09\xc4\x6a\x5e\x56\x9d\xfa\x6d\x0d\x88\x7a\x44\xbf\x00\xc1\x1e\
\xb9\xda\x55\x06\x8a\xaf\xab\x90\x56\x06\x8b\x2c\xe3\xe3\x00\x13\
\xe8\xaf\x2b\xf0\x2f\xde\xb6\xef\x6d\x5f\x58\xe3\x29\x3d\xab\xe1\
\x51\x07\x90\x10\x9e\xf0\x8a\xbf\xfb\xe6\xb6\x71\xbf\xe4\x9c\xfb\
\xd6\x9c\x51\x82\xf0\x8d\x73\x13\x4f\xb0\x47\x7a\x54\xa4\x7e\x90\
\x00\xb9\x4d\x02\x11\x2f\x01\x21\x17\x74\x0b\x8a\x92\x6d\xa1\xd8\
\xa7\x08\x14\xe4\x6a\x96\x8f\x76\x80\xb0\x60\x49\x71\xbd\xd5\xc8\
\x0c\xd0\x5f\x57\x03\xfa\x95\xdb\x77\xbf\xf5\x73\xeb\x31\x8f\x67\
\x3b\x3c\x6a\x01\x12\xc2\xa5\xaf\xfc\xcc\xd7\x0f\x87\xa3\xd7\xbb\
\x86\x5f\x06\x70\xbd\x32\x7b\xa4\xc7\xeb\x54\x52\x79\xa6\x00\x89\
\x56\x7d\x04\x68\x6c\x3d\x2b\xb2\x35\x90\xca\x17\xd3\x64\x1b\xc6\
\x28\xef\x63\x95\xf8\x21\xd5\x30\x55\xa6\x21\xa2\xff\x56\x13\x7e\
\xf3\xb6\x07\xdf\xf2\xa8\x62\x0c\x1b\x1e\xf5\x00\x09\xe1\xd2\x1f\
\xfe\xdb\xa7\x8d\x9a\xf6\xdf\x72\xeb\x7e\x94\xd9\x6d\xeb\x15\xfa\
\x71\xe7\xa9\x7a\x6d\x8d\x09\x20\x91\x8c\xd0\xf7\x5c\x54\x93\x64\
\x59\x8c\x65\x13\x5d\x17\x52\x7e\x06\x94\x54\x5e\x03\x45\xa6\x9b\
\xb2\xf1\x43\xb2\x0b\x8e\x81\xdc\x7b\x67\x50\xbd\xfd\xd6\xdd\xbf\
\xb1\xea\x3f\x8c\x79\x2e\x85\xc7\x0c\x40\x42\xb8\xf2\x47\xfe\x72\
\xdb\x89\xe5\x99\x57\x3a\xc7\x3f\xee\x5a\x77\x35\xc0\x94\xec\x11\
\x20\x57\x83\x0a\x40\xfa\x5f\xed\x9d\xcd\x6b\x13\x41\x18\xc6\x9f\
\x77\xf2\x51\x4c\x25\xc5\xaa\xf8\x55\x51\x41\x41\x2a\x2d\x82\x28\
\xa2\xc7\x52\x14\x41\x3c\x48\xed\xd5\x93\xfe\x0b\x7a\xcc\x9f\x61\
\x4f\x5e\x04\xed\xad\x08\x85\x2a\x14\x0a\x0a\x82\x44\xa9\xc1\x58\
\x04\x05\x3f\x50\xab\x42\x93\x56\x94\xa6\x9b\xf7\xf1\xd0\xa4\xd9\
\x64\x77\x76\x5b\x4b\x62\x34\xfb\xdc\x76\x3e\xde\x5d\x66\xe6\x37\
\xef\x3b\x33\xcb\xae\x65\x9d\xe0\x85\xc4\xbf\x8e\xc7\x46\x10\x14\
\xee\x7c\x3f\x6f\x62\x0b\xa1\x82\x40\xf1\x5b\x67\xd4\xc1\x50\xb1\
\xbb\x9a\x44\x08\x9f\x03\x18\x8b\xa5\x92\x77\xf2\xf9\xcc\x8f\x16\
\x74\x53\xdb\xa8\xe3\x00\x71\xab\xef\xca\xc3\x93\x2b\x4e\xf9\xaa\
\x96\x39\x0a\x72\xbb\x67\xd1\xee\x37\xf3\x87\x40\x12\xe4\x71\xea\
\xae\xad\x79\x58\xb3\x65\xdd\xad\xf2\x84\x46\xeb\x01\xc5\x65\x17\
\xa8\x79\x8d\x6a\x7e\x25\xbb\x06\x0b\xbe\x19\xe1\x5d\x48\xec\xf6\
\xdc\x9b\xcc\xb3\x66\xf7\x45\xbb\xaa\xa3\x01\xa9\xaa\x7f\x64\x3c\
\x59\x28\xf7\x9c\x2b\xab\x33\x4a\xe5\x45\x28\xd3\xa1\x83\xff\x4f\
\x20\xf1\x19\xf8\x1b\x87\xc2\x6d\x0b\xb5\x34\xa0\xe1\xb9\xe0\x53\
\xc6\x27\xbd\x5a\x6f\x55\x05\x03\xde\x17\xd1\x7b\xdd\xe9\xf9\x07\
\xd9\xec\xd8\x4a\xd3\x1b\xbf\xcd\x15\x01\xd2\xa0\xc3\xe7\x27\xbb\
\x7e\xa5\x30\xa4\x8e\x5e\x52\xd5\x0b\x54\xf6\x6d\x0a\x12\xdf\x81\
\x1f\x7c\xce\x11\xec\x4d\x50\x7f\xdf\xba\x30\xc9\x55\xc7\x63\xc3\
\x65\x0b\x70\xd5\xc3\x7b\x01\x27\x01\x99\x88\xc7\x9d\xe9\x7c\x3e\
\x53\x6a\x61\x73\xb7\xbd\x22\x40\x82\x25\x87\x2e\x4f\x0c\x2c\x97\
\xcc\x30\x55\x87\x48\x3d\xcb\x8a\x77\xb1\x2e\xdc\x6d\x33\x7e\xe3\
\xec\x6e\x2d\x0b\x84\x7a\x13\x6b\x1a\x6a\x76\x00\x1f\x80\x00\x80\
\x45\x01\x1e\x19\xc1\x74\x2c\x61\xa6\x5e\xcd\xde\xc8\x63\x2d\xc6\
\x8a\xd4\xa8\x08\x90\x0d\xe8\xc4\xb5\x5b\x89\xf9\x4f\x7b\x8e\x93\
\x7a\x46\x55\x4f\x43\x79\x8a\xaa\x07\x01\x1a\xfb\xeb\x22\xee\x83\
\xc2\xf0\x90\x0b\xb4\x9c\x82\xbb\xcb\x03\x75\x60\xd9\x40\x01\xa1\
\x22\x7c\x2b\xc4\x53\x03\x7d\x12\x93\xf8\xe3\x5d\xbd\x4b\xb3\x33\
\x33\x19\xa7\xd5\x6d\xf7\xaf\x2a\x02\x64\x93\xea\x1f\x19\xef\x2d\
\x2e\xca\xa0\x08\x07\xd4\xe1\x31\x08\x8f\x42\x71\x04\xd4\xdd\x20\
\xcc\xfa\x42\xae\xf0\xed\x5c\x5f\x0f\x53\xf3\x46\x2a\xe0\x17\x80\
\xaf\x41\x99\x33\xd0\x97\x22\xc8\x6d\x29\x97\x5e\xe4\x72\x37\x17\
\xfe\x5a\xe3\xfc\x07\x8a\x00\x69\x92\x06\x87\xa7\xba\x0b\xb1\xe2\
\x01\x75\x74\x3f\xa8\xfb\xa0\xba\x17\xe0\x4e\x2a\x76\x08\xb8\x0d\
\x64\x8f\x40\xb7\x82\x48\x81\xe8\x22\x35\x29\xac\x7c\x53\x85\x4a\
\x01\x4a\x02\x2e\x93\xfc\x29\x8a\x25\x01\x17\x01\x5d\x20\xf0\xdd\
\x10\x5f\x41\x7e\xa6\x91\x8f\x09\xc1\x87\xb4\x13\x7f\x97\xcd\x5e\
\x6f\xca\x2f\xc8\x3a\x5d\xbf\x01\x79\x1a\xfe\xb9\x57\x5f\x39\x39\
\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xb7\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x45\x00\x00\x00\x45\x08\x06\x00\x00\x00\x1c\x8d\x2b\x29\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0c\x09\x02\x36\x2a\x8b\xaf\x8b\x17\x00\x00\x01\x44\x49\x44\
\x41\x54\x78\xda\xed\xdc\xbf\x4a\xc3\x50\x18\x87\xe1\xdf\xc9\x3f\
\x5a\xb5\x69\xa4\x4d\x63\x05\xd1\x3a\x94\xd6\x60\x41\x10\xbc\x02\
\xaf\x40\x1c\x5c\xbc\x5b\x37\xef\x40\x9c\x04\xc5\xc5\x08\x2e\x45\
\x87\x74\x4a\x38\x49\xa8\x17\xd0\xf3\xbe\xd3\x81\x4c\x79\x48\xbe\
\x93\x2c\xc7\x94\x65\x29\x6a\xe6\x41\xd0\x2d\xa8\x16\x9f\x1f\xcf\
\x2a\xbe\x5e\x9c\x85\x38\x9d\xdd\xaa\xbf\x37\x6e\xa2\x7c\x17\xaf\
\x7a\x7f\x7b\x72\x16\x65\x7a\x7c\x53\xa3\xf0\xfa\x30\x53\x40\x01\
\x05\x14\x50\x40\x01\x05\x14\x50\x40\x01\x05\x14\x50\x08\x14\x50\
\x40\x01\x05\x14\x50\x40\x01\x05\x14\x50\x40\x01\x05\x14\x50\x08\
\x14\x50\x40\x01\x05\x14\x50\x40\x01\x05\x14\x50\x40\x01\x05\x14\
\x02\x05\x14\x50\x40\x01\x05\x14\x50\x40\x01\x05\x14\x50\x76\x08\
\xc2\x8f\x40\x69\xd7\xeb\x25\xa0\xd8\x05\x61\x5f\x41\xb8\x0f\x8a\
\xdd\x78\xb2\x92\x31\x06\x14\xbb\xec\xe8\xaa\x5e\x1b\x63\x40\x89\
\x93\x33\x8d\xd2\x9c\xdd\xa7\xbe\x79\x2f\xd0\x7c\x71\x27\xc9\x80\
\x52\xb5\xc8\x1f\x14\x27\xb3\xc6\xab\x23\x59\x67\x1d\xb8\xf5\x4d\
\x12\xea\xe2\xf2\x51\x93\xd6\x2c\xa9\x77\x23\xd7\x40\x06\xf1\x89\
\xe6\xcb\x7b\x0d\x0f\xcf\xb7\x6f\xd1\x2e\x40\xf8\x7e\xa4\x51\x9a\
\x2b\x9b\x5e\x2b\xcd\x56\x9d\x19\x62\x3f\x25\x92\x64\xaa\x93\x76\
\xd6\xeb\x42\x7f\xbf\x3f\x3b\xf7\x17\x13\x45\x07\x0a\xa3\x81\x3c\
\xcf\xef\x5c\x6d\x63\x74\x50\x5c\x6b\x1b\x88\x73\x33\xe5\x3f\x08\
\xbb\x0d\x57\x94\x22\x07\xea\x3c\x0a\x7e\x00\x00\x00\x00\x49\x45\
\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x2c\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x45\x00\x00\x00\x45\x08\x06\x00\x00\x00\x1c\x8d\x2b\x29\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0c\x09\x02\x00\x0d\xa7\xb9\xaf\x09\x00\x00\x01\xb9\x49\x44\
\x41\x54\x78\xda\xed\xdc\xcd\x2e\x03\x51\x18\xc6\xf1\xff\xd1\x92\
\x56\x89\x18\x12\xc2\x52\x08\x6e\x41\xdc\x81\x88\x95\x9d\xeb\x90\
\xb8\x02\x1b\x5b\x0b\x1b\xb6\x76\x22\xb1\xb3\xa4\x11\x24\x52\x21\
\x21\x41\x43\xa5\x3e\x5b\x9f\x09\xa6\xda\xd7\x42\xa7\x4a\xc4\x5e\
\xe7\x79\x56\xe7\xcd\x99\xb3\x98\x5f\xde\x99\x33\x9b\x39\xce\xcc\
\x8c\xda\xcd\x1d\x70\x01\x64\x81\x0d\x60\x05\xd8\x72\xce\x15\xff\
\x5a\xe4\x6a\x1c\xe5\xb7\xa4\x81\x29\x60\xd1\x39\x67\x7f\xa2\x64\
\x33\xeb\xe4\x73\x07\x35\x75\xf7\xf5\xf5\x09\x62\x71\x8f\xc6\x44\
\x07\xad\x6d\x7d\x44\xa3\xf1\xea\xe9\x75\x60\xdc\x39\x97\xfd\xb9\
\x2e\x1a\x0c\x1e\x1f\xcf\xb8\xbe\xdc\xa9\xd9\xf6\x70\x2e\x82\xd7\
\x3e\x40\x4f\xdf\x28\x4d\xcd\x5d\x00\x43\xc0\xa6\x99\x8d\x39\xe7\
\xb6\xab\xaf\xad\x0b\xcb\x33\x63\x56\x24\x77\xb3\xc7\x56\x72\x9a\
\xe3\xc3\x25\xcc\x4a\x00\xdd\xc0\xaa\x99\xf5\x87\x12\xe5\x0b\xa7\
\xc4\x69\x7a\x95\xd4\xf6\x2c\xc5\xa2\x0f\xd0\x02\x2c\x9b\x59\x6b\
\x68\x51\x82\xe4\x73\x07\xec\xa7\x16\x28\xbf\x52\x7b\x81\x99\xd0\
\xa3\x00\xdc\x5e\xef\x92\xcd\xac\x05\xe5\x84\x99\x0d\x86\x1e\x05\
\xe0\xe4\x68\x85\xf7\xf7\xd7\x60\xd3\x99\x14\x0a\x50\xf0\x9f\xb9\
\x38\x4f\x06\xe5\x88\x99\x45\x43\x8f\x02\x70\x73\x95\x0a\x86\x1e\
\x30\x2c\x14\xe0\xe1\x3e\x4d\xa9\x54\xf9\xf2\x1f\x10\x4a\x79\x9b\
\xf6\xdf\x1e\x82\xb2\x4b\x28\xe5\xf8\xfe\x53\x30\xec\x10\x4a\x55\
\xb7\x94\x13\x11\xca\x2f\x11\x8a\x50\x84\x22\x14\xa1\x08\x45\x28\
\x42\x11\x8a\x50\x84\x22\x14\xa1\x08\x45\x11\x8a\x50\x84\x22\x14\
\xa1\x08\x45\x28\x42\x11\x8a\x50\x84\x22\x14\xa1\x08\x45\x11\x8a\
\x50\x84\x22\x14\xa1\x08\x45\x28\x42\x11\x8a\x50\x84\x22\x14\xa1\
\x28\x42\x11\x8a\x50\x84\x22\x14\xa1\x08\x45\x28\x42\xf9\x6f\xa9\
\x9c\x9f\xf2\xfa\x92\xa7\x50\x78\x0e\x2d\x44\x63\xa2\x93\x48\xa4\
\x01\x60\xbe\x72\x7e\x4a\x2c\xee\x11\x8b\x7b\x6a\x13\x3e\xff\xef\
\x9f\x13\xc3\xb7\x24\x3f\x00\xd0\xf3\x89\xcf\xb7\x48\x86\x14\x00\
\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x3c\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x4b\x00\x00\x00\x4b\x08\x06\x00\x00\x00\x38\x4e\x7a\xea\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0b\x0e\x12\x2d\x3a\x0c\xff\x17\x30\x00\x00\x01\xc9\x49\x44\
\x41\x54\x78\xda\xed\xdc\x3f\x4e\xc3\x30\x14\xc7\x71\x3b\x69\x59\
\x59\x58\x11\x43\x17\xa4\x2e\xac\x48\xb0\x20\x06\x2e\xd0\x8a\x81\
\x1d\x86\x8e\x1c\x20\xbd\x43\x27\xe8\x09\xe0\x02\x0c\x88\x33\x70\
\x0a\x2e\xc0\x48\xd2\x30\xa0\x08\xbb\xb1\x13\xc7\x09\x34\x7f\xbe\
\xbf\x29\x5d\x1a\xe9\xa3\xf7\x9c\xe7\x54\xb5\x4c\xd3\x34\x15\xc4\
\x29\x01\x04\xee\x19\x65\x17\x6f\x2f\x0b\x34\x2c\xb9\xb8\x5a\x51\
\x59\xb4\x21\x58\x60\x81\x05\x16\x01\x0b\x2c\xb0\xc0\x02\x0b\x2c\
\x02\x16\x58\x60\x81\x05\x16\x58\x04\x2c\xb0\xc0\x02\x0b\x2c\xb0\
\x08\x58\x60\x81\x05\x16\x58\x60\x11\xb0\xc0\x02\x0b\x2c\xb0\xc0\
\x22\x60\x81\x05\x16\x58\x60\x81\x45\x74\xac\xec\x2f\x17\x84\xca\
\xf2\xce\xc7\xe7\xf5\x2f\x96\x94\xf3\x11\x24\xf6\xdc\xcc\xce\xd4\
\xca\x7a\x4e\x20\xf1\x68\x43\xd6\x2d\x7b\xa4\x94\x92\x35\xab\x20\
\xdb\xc5\x13\x64\x6a\xd0\x78\x3c\x0d\x69\x45\x73\x0b\x32\x3a\x54\
\x68\x41\x0d\x4b\x6d\x45\xaa\x2b\x5f\x55\x54\x56\x85\xaa\xca\x61\
\x51\x5d\x42\x8c\xf7\x17\x8a\x87\x3e\xb0\xe7\x2a\x2b\x49\x36\xeb\
\xec\xfa\xe9\xf5\x64\x70\x58\xe7\xa7\xc7\xca\x27\x7d\x60\x37\x8e\
\x0c\xea\x29\x22\x43\x3a\xef\x41\xed\x26\xd3\x38\x15\x94\x2d\x6a\
\x43\x69\xc7\xc9\x34\x6a\xe6\xad\xc3\x10\xc0\x8e\x0e\x0f\x0a\xab\
\xca\xda\x86\xa6\x76\xec\x73\x4b\x96\xb5\x9f\x53\x65\x0d\x61\x1b\
\xa4\x43\x2d\xc3\x42\x0f\x97\x2f\xec\xeb\x82\xaf\x43\xdd\xee\x09\
\xf1\xf0\x55\x1b\x6b\x1b\xec\xee\x7e\x2d\xe6\x97\xef\xbd\x1a\x3c\
\x5d\xba\xa8\x52\x9b\xf5\x65\x0d\xf3\x81\xaa\x8c\xd5\x75\xb0\x3c\
\xd2\x72\x2c\x44\x14\x3b\xef\x13\x7d\x6e\xda\x45\x30\x03\x54\x28\
\x44\xb4\xa9\xb4\xa9\xf6\xbd\xb9\xe9\xac\xc0\x36\xa2\x4d\xa6\x91\
\x36\x43\xd5\x79\xca\xd7\x1e\x0d\xda\x8c\x66\x1a\xa6\xeb\x8c\x43\
\x8d\xcc\x51\xb6\x13\x29\x77\x85\xd6\x34\x52\xa3\x58\x6d\x40\xb3\
\x6d\xc9\x7e\x5e\xb3\x34\xf3\x73\xdf\x9f\x4c\xe8\x65\x67\x9f\x36\
\x85\x57\xb4\x67\xf5\x59\xc0\x77\x9a\x38\x4e\x1e\xd3\x7f\x4e\x4f\
\x36\x17\xb3\xb0\xeb\x40\xdf\x30\x51\x4d\x33\xca\x5b\x02\x1f\x00\
\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x47\xbb\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\xc8\x00\x00\x00\xc8\x08\x06\x00\x00\x00\xad\x58\xae\x9e\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0e\xc4\x00\x00\x0e\xc4\
\x01\x95\x2b\x0e\x1b\x00\x00\x20\x00\x49\x44\x41\x54\x78\x9c\xed\
\xbd\x79\xb8\x1e\x47\x79\x27\xfa\xab\xee\xfe\xce\x91\x8e\x16\x4b\
\x96\xbc\xe1\x05\x83\xed\xb1\x8d\xc1\x36\xc6\x18\x63\x83\xcd\x1a\
\xe2\x10\x6c\x92\x30\x84\xcb\x40\x62\xc8\x85\x99\x30\x73\xf3\x3c\
\x64\x78\x80\x4b\x72\xa3\xb9\xf7\x12\x88\x13\xc8\xbd\xcc\x64\x86\
\x2c\xe4\x62\x0c\x98\xc0\x78\xd8\xc6\x66\xf1\x82\x6d\xbc\x49\x46\
\x5e\x64\x49\xc6\x92\x6d\xc9\xb2\x36\xcb\xda\x2c\x9d\x23\x9d\xf3\
\x7d\xdd\x55\xef\xfd\xa3\xb7\xaa\xea\xb7\xaa\xbb\xbf\xef\x3b\x8b\
\x64\xbf\xe7\xa9\xd3\xd5\x55\xd5\x55\xd5\xd5\xef\xaf\x7e\xef\x5b\
\xbd\x7c\x02\x2f\xc9\xb4\xc8\xfe\x3b\xef\x5c\x32\x36\x22\x5e\x11\
\x84\xea\x34\xa1\xc4\xa9\x44\xf2\x65\x44\x38\x01\x84\xe5\x02\xb4\
\x94\x80\xa5\x02\x58\x40\xc0\x42\x80\x3a\x20\x31\x02\x41\x01\x08\
\x00\x84\x12\x02\x5d\x02\x25\x02\x62\x02\xc0\x04\x80\x17\x04\xc4\
\x3e\x12\xb4\x07\x84\x5d\x22\x10\x3b\x28\x10\x5b\x23\x19\x3c\x8b\
\x79\xc9\x66\x71\xf1\x3b\x0f\xcc\xee\x19\x1f\x9d\x22\x66\xbb\x03\
\x47\xba\xd0\xea\xdb\x8e\x89\xbb\xc1\x05\x10\xc1\x05\x20\xf9\x1a\
\x01\x71\x2e\x11\x9d\x2d\x88\x96\x81\x28\x80\x52\x00\x11\x52\xc5\
\xa7\x2c\xae\xef\x17\x35\x31\xb5\x0b\x6d\x23\xd2\xad\x10\x69\xd0\
\xf6\x29\x08\x94\x80\xd8\x03\x81\x0d\x10\x78\x9c\x48\xac\x83\xc0\
\x9a\x4e\xd4\x5b\x23\x2e\xfd\xad\x83\xd3\x3b\x02\x47\xb7\xbc\x04\
\x90\x16\x42\x44\xa2\xbb\xf2\xee\x73\x22\xd0\x9b\x94\x52\x97\x83\
\xe8\x0d\x00\xce\x12\x4a\x85\x50\x0a\x50\x04\x50\x06\x08\x3d\x4e\
\x16\x30\x88\x50\x82\x83\x78\x6c\xe4\xa2\x83\x03\x19\x38\x74\xa0\
\x14\x21\x00\x82\x2c\x1e\x04\x39\x70\xa4\x08\xc4\x06\x40\xac\x52\
\xc0\xfd\x04\x71\xcf\xe8\xe5\x6f\xdb\x28\x84\xf0\xb5\xf8\x92\x68\
\xf2\x12\x40\x6a\x84\x56\xdf\x7d\x92\x94\xea\x5d\x4a\xd2\x6f\x08\
\xd0\x5b\x20\xd5\x49\x29\x18\xf4\x40\xe9\x96\x72\x90\xe4\xfb\x36\
\x38\x38\xf6\xc8\x74\x95\x00\xa1\x21\x85\x0a\x50\x00\x26\x40\xc0\
\x80\xc3\x04\x06\x82\x3c\x1e\x94\xf1\x2c\x90\x08\x76\x40\x88\x3b\
\x83\x50\xdc\x3a\xd5\x0d\x6e\x5d\xf8\xd6\xb7\x3e\x37\x73\xa3\x79\
\xe4\xc9\x4b\x00\x61\xa4\xfb\xe0\x9d\xaf\x16\x12\xbf\x03\xa2\x6b\
\xa0\xd4\x6b\x85\x52\x01\xa4\x02\x94\x34\x81\x21\x73\x50\xe8\x20\
\x29\xb7\xa2\x60\x12\x2b\x54\xd8\x43\x9b\xd0\x09\xd6\x55\x11\x0e\
\x16\xd1\x81\x21\x40\x15\x90\x54\xc1\x61\x86\x10\x14\x06\x52\x04\
\xe2\x21\x82\xf8\xb1\x52\xf8\xc1\xbc\x2b\xde\xf1\xf8\xcc\x8c\xf0\
\x91\x23\x2f\x01\x24\x13\x7a\xe0\xae\xb3\x62\x81\x0f\x42\xa9\x0f\
\x08\xa5\xce\x49\x01\x20\xb3\x90\x83\x40\x8f\x9b\x41\xe4\x26\x95\
\xb1\xb5\xe2\x39\x20\x0a\xa0\xa0\xdc\x96\x3d\x41\xe5\xb2\x08\x51\
\x6e\x85\x05\x94\x20\x33\xaf\xf4\x78\xb6\x25\x17\x40\xc2\x14\x20\
\xe9\x36\x00\xc2\x30\x0d\x41\xb0\x9e\x84\xf8\x6e\x87\x70\xa3\x78\
\xd3\xdb\x9f\x9e\xce\xf1\x3e\x52\xe4\x45\x0d\x90\x3d\x2b\x7f\xb2\
\x78\x31\xc6\x3e\x20\x88\xae\x25\x25\x2f\x15\x52\x09\x03\x14\x52\
\x9a\xa0\x90\x25\x83\x08\x1b\x28\xc4\xb3\x88\x33\x00\xda\xb6\xf8\
\x67\x89\x66\x66\x55\x40\xe2\x33\xb1\x02\xcb\xcc\xca\xcc\xab\x50\
\x07\x49\x68\x81\x25\x03\x4c\x18\x82\x82\x80\x44\x18\xde\xaf\x82\
\xe0\xeb\x23\x5d\xf1\x5d\xf1\xd6\xb7\x4e\x4c\xef\x95\x98\xbb\xf2\
\xa2\x04\x08\xad\xbc\xe7\x82\x44\xa8\x4f\x90\x94\x1f\x14\x4a\x2e\
\x44\x22\x35\xb6\xb0\x00\x92\x81\x42\xe4\xe0\x70\x30\x48\x09\x14\
\x1d\x24\x1a\x8b\x90\xcd\x1e\xd6\x0a\x96\x73\x11\xcb\x5e\xc9\x12\
\x26\x93\x18\xec\x61\x83\xc4\x11\xc2\x1c\x30\xa1\xc9\x20\xa1\x1e\
\x4f\x03\x85\xe1\x41\x11\x84\xdf\x56\x22\xf8\xea\xe8\x65\x6f\x59\
\x3b\xdd\xd7\x66\xae\xc9\x8b\x06\x20\xb4\x62\x45\x90\xfc\xf6\xdb\
\xde\x03\x49\x9f\x24\x29\xaf\x10\x52\xa6\x6c\x51\x80\x23\x29\x01\
\x91\x68\xa0\x28\x4c\x2c\x9f\xa9\x45\x3c\x8b\x90\x0d\x14\x8e\x3d\
\x74\x16\xc9\x23\x3a\x28\x60\xb2\x47\xbe\xd5\xfc\x0f\x73\x15\xcb\
\x66\x0f\x51\x35\xad\x0c\x06\x49\x81\x41\x2c\x48\xa2\x74\x1b\x85\
\xa0\x28\x52\x10\xe2\x2e\x21\xc2\xff\x27\xba\xec\x2d\xb7\xbc\x58\
\x56\xc2\x8e\x7a\x80\xd0\xea\xd5\x1d\xa9\x0e\x7f\x88\x94\xfa\x34\
\xa4\x3c\x27\x05\x40\x92\x01\x23\x81\xc1\x1e\x89\xd4\x40\x21\x4d\
\x13\xcb\x60\x10\xc9\xb0\x07\x59\x2c\x92\x02\x44\xb4\x59\xc9\xca\
\xa3\x3e\x27\x9d\x31\xad\x48\x67\x0e\x83\x3d\x38\x26\xb1\x7d\x0f\
\xdd\xc4\x2a\x58\x03\x88\xb4\xb4\x28\x03\x4b\x14\x02\x51\x04\x84\
\xc1\x7a\x25\xc4\x5f\x8f\x74\x83\x1b\xc5\x5b\xdf\x9a\xcc\xd4\xb5\
\x9c\x0d\x39\x6a\x01\x42\xab\x57\x77\x7a\xf2\xf0\xb5\x02\xea\x73\
\x22\x91\xa7\x9b\xa0\xd0\x80\x91\xa4\xcc\x21\x58\x33\x4b\x6a\xc0\
\xa8\x77\xd6\xdd\x8e\x7a\xce\x26\x70\x33\x49\xba\xa3\xc5\xb5\x4b\
\xc3\xfa\x1f\x28\xcd\xab\xa6\x0e\xba\xc1\x20\x36\x8b\x54\x03\xe5\
\x20\x89\x4a\x26\x49\xe3\x05\x58\x36\x89\x30\xfc\xcb\x70\x92\x6e\
\x38\x5a\x81\x72\xd4\x01\x84\x56\xac\x08\xe4\x7b\xde\xf9\xbf\x90\
\x94\xff\x27\x64\x72\x06\xe2\x0c\x0c\x49\x06\x0c\x59\xee\x8b\xc2\
\xc4\xb2\x98\x84\xf3\x47\x6c\x26\x51\x0a\x82\xf5\x43\x2c\x13\x8b\
\x5b\xe6\x2d\xd8\xa3\xad\x93\xee\x60\x11\x0b\x1c\x1c\x73\x10\xbb\
\x82\xc5\xfb\x1d\x36\x73\x18\x40\x31\x40\x12\xe5\xe6\xd7\x93\x84\
\xe0\x2f\x46\x2e\x7b\xcb\x77\x8f\x36\xd3\xeb\xa8\x02\x48\xbc\xfa\
\xbe\xb7\x91\x4c\xbe\x24\xa4\x7c\x6d\x01\x88\x3c\xc4\x49\xc1\x18\
\xc2\x36\xb1\x92\xc4\x04\x84\x0e\x16\x0d\x18\x42\xd9\xa6\x96\x03\
\x20\x3a\x8b\xb0\x3e\x88\xe6\xb0\x03\xe5\xbe\x2d\x86\x93\xee\xb8\
\x0f\xe2\xf3\x41\x1c\xce\x79\xb6\x52\x65\xfa\x1c\x81\x0e\x0a\xc6\
\xb4\x0a\x0b\x30\x98\x40\xd1\x43\x18\xae\x26\x21\x3e\x35\x72\xd9\
\xdb\xee\x9e\xfe\xab\x3d\x33\x72\x54\x00\x64\xf2\xc1\x7b\x5e\x19\
\x02\x5f\x86\x4c\xae\x11\x49\x22\x0a\x40\x58\x20\x11\x89\x66\x5e\
\x15\x8c\xa2\xb1\x88\x0d\x0e\x29\xd3\xe5\x5c\x63\xb9\xd7\x32\xaf\
\xa4\xb4\x9c\xf4\x01\x4c\x2c\x3d\x2e\x44\x35\xde\xd4\xc4\xb2\x96\
\x77\x11\xda\x71\x13\x18\x64\xb3\x48\x01\x92\x1c\x08\xa1\xc1\x18\
\x88\x22\x0d\x28\x5a\xe8\x44\xa0\x28\x22\x84\xe1\xff\x48\x88\x3e\
\x35\x76\xf9\xdb\xb7\x4c\xf7\xb5\x9f\x6e\x39\xa2\x01\x42\x3f\xf9\
\xc9\x68\x7c\xfc\xe2\xcf\x40\x26\x9f\x15\x89\x9c\x8f\x38\x2e\xd9\
\x22\x89\x0b\x90\xb0\xc0\xe0\x1c\xf5\xdc\x1f\xf1\x2c\xf7\xba\x9d\
\x75\xdb\x49\x67\xee\xaa\x3b\x9f\xc7\x02\x2a\x2c\xe2\x5c\xe2\x85\
\xe9\x9c\xdb\x4b\xbb\x4e\x27\xdd\x72\xce\x1d\xcb\xbb\xa4\x33\x87\
\xe1\x77\xd8\x8c\x61\x01\xa5\x13\x01\x51\x27\xdb\x46\xa0\x4e\xe7\
\x10\x84\xf8\x42\x67\xdb\x9e\x2f\x89\xf7\xbf\xbf\x37\x53\x3a\x31\
\x6c\x39\x62\x01\xd2\x7b\xe8\xee\x2b\x84\x14\xff\x00\x29\xcf\x41\
\x1c\xc3\x00\x47\x16\x17\x0e\x26\xa9\x80\xc3\x70\xd4\xab\xcb\xbd\
\xac\x2f\x62\xdd\x38\xcc\x41\x22\xbc\x2c\xe2\x33\xb3\x1c\xa2\xaf\
\x60\x39\x1e\x33\x31\xee\x85\xa4\xcf\x5b\x55\xcd\xac\xca\x8d\x41\
\xd7\xfd\x8f\xa8\xea\xa0\xdb\xab\x58\x56\xa0\x0e\x0f\x12\x74\x3a\
\x40\x14\xad\xa7\x28\xfc\xf8\xc8\x25\x57\xde\x3f\xdd\x3a\x31\x1d\
\x72\xc4\x01\x84\xee\xbc\x73\x61\xb2\xb8\xf3\x57\x94\xc8\x3f\x16\
\x71\x1c\xa4\xe0\xd0\x18\x23\x07\x47\x01\x8c\xd8\x02\x89\x6d\x5e\
\x25\x25\x30\x2c\x26\x31\xd9\xc3\x5e\xee\x95\x0e\x47\xdd\xba\x27\
\x92\x03\x42\xbf\xb3\x0e\xf8\x97\x7a\x0b\x61\x96\x78\xf5\x78\xc0\
\x99\x58\xcc\x03\x8a\x15\x90\x70\xcb\xbb\x41\x95\x39\x72\x07\xbd\
\xc2\x20\x5a\x3c\x05\x41\x09\x94\x7c\x5f\x8b\xd3\xc8\x88\x14\x61\
\xf0\x77\x51\x34\xfe\x39\x71\xf1\xd5\x87\x67\x42\x4f\x86\x25\x47\
\x14\x40\x7a\xab\xef\x79\x13\x80\xeb\x45\x9c\x9c\x51\xb0\x46\x6c\
\x03\x43\x03\x44\xce\x2a\xba\xa3\xae\x01\x45\x48\x0b\x34\x9c\x93\
\xce\xac\x66\x09\xdd\xbc\xe2\x9c\x75\xc6\xc4\xaa\xbd\x0f\xe2\x73\
\xd2\x6b\xee\x83\xb8\x4d\x2c\xdb\x07\xc9\xfc\x0d\xdf\xea\x55\x14\
\x1a\x00\x29\x4c\x29\x9b\x41\x3a\x16\x93\x68\xc0\xa0\x22\xde\x29\
\x81\x92\xa6\x6d\xa4\x40\xfc\xe1\xc8\xa5\x6f\x5d\x39\x43\x2a\x33\
\xb0\x1c\x11\x00\xa1\x3b\xef\x8c\x92\x63\x3a\x2b\x28\x51\x9f\x15\
\x71\x1c\x99\xe0\x28\x01\x22\x34\xa0\x98\xfe\x88\x09\x92\xc2\x27\
\xd1\x4d\xac\x9a\xe5\x5e\x21\x79\x06\x71\xae\x64\x35\x79\x26\x0b\
\x18\xc0\x49\x77\x00\xc4\xf7\x04\xaf\xf3\xee\xb9\xcf\x41\x37\x81\
\x41\x21\x07\x0e\x1b\x24\x9d\x92\x4d\x2c\x90\x50\xa7\x13\x23\x0c\
\x3f\xdf\x79\xf6\xf9\xbf\x14\xef\x7f\xbf\x9c\x7e\xed\x19\x4c\xe6\
\x3c\x40\x0e\xaf\xbe\xe7\xb4\x8e\x10\x37\x22\x4e\x2e\x37\x40\xd1\
\x2b\xc1\x21\xe2\xd8\x34\xb1\x6c\x70\xe8\x3e\x09\xb3\xec\x6b\x30\
\x88\xc6\x24\x42\x67\x13\xdd\xc4\xaa\x63\x10\x0e\x1c\xb9\x7f\x62\
\x38\xe8\x96\x93\x5e\x11\xd7\x12\x2f\x4a\x3f\x83\x05\x89\x9b\x41\
\x4a\xe6\xd0\x4c\xac\x28\x34\xc1\x62\x98\x54\x55\x90\x98\xce\x79\
\xa7\x0a\x92\x1c\x14\x51\x27\x65\x93\x4e\x04\x8c\x74\xb4\xbc\x0e\
\x10\x45\x77\xf7\x48\xfe\x9b\x05\x97\xbd\x63\xfb\x0c\xa8\x51\xdf\
\x32\xa7\x01\x12\x3f\xfc\xc0\x55\x20\x79\x03\x7a\xf1\x72\xf4\x7a\
\x0c\x38\x34\xd6\x30\x80\x61\x9a\x59\x7e\x67\xdd\xe3\xa8\x57\xd8\
\x44\x77\xd2\x1d\xcb\xbd\x94\xfb\x25\x9e\xfb\x21\xe0\xcc\x2c\x87\
\xb0\x3e\x88\xfb\xfe\x07\xe9\xcf\x60\xe5\x8c\xd1\xe4\x06\xa1\xc6\
\x1c\xa6\x83\xee\x76\xce\xb3\x65\x5d\xd6\xef\xd0\xc1\xc0\x83\x64\
\x04\x34\x12\x3d\x2f\xc2\xce\xbf\xe9\x5c\xf2\xe6\xdb\xa7\x5f\x9b\
\xfa\x93\x39\x09\x10\x22\x12\xf1\x9a\x95\x7f\x8e\x38\x59\x21\x7a\
\xbd\xd0\x06\x05\x7a\xbd\x2a\x30\x5c\xfe\x08\xb3\xec\xcb\x39\xec\
\xa6\xa3\xee\x32\xb5\x18\x13\x4b\x2a\x08\xcf\x72\x2f\xd9\x4f\xf2\
\xe6\xe7\x58\x3d\xe9\xea\x40\x08\xf3\xf2\x08\x3b\x2f\x03\x8d\x10\
\x36\x7b\x94\x71\x72\x2e\xef\x32\x3e\x88\xfe\x48\x89\xee\xa0\x73\
\x20\xa9\x2e\xeb\xf2\x7e\x87\x0d\x94\x1c\x24\xe5\x36\xa1\x30\xfa\
\x3f\x3a\x6f\xb8\xf2\x3a\xe1\x9f\x2a\x66\x45\xe6\x1c\x40\xe8\xd1\
\x47\x17\xc4\xea\xf0\x0d\x22\x49\x7e\xb7\x60\x8d\x62\x9b\xb1\x46\
\x8f\x03\x06\xe3\x8f\x58\x2b\x5b\x9c\x4f\x22\x0c\x06\xd1\x57\xb2\
\xac\x25\x5f\x7d\x45\xab\xb8\xab\x6e\x32\x09\x59\x2b\x55\x29\x41\
\x90\x71\xd5\x39\x0d\xa8\x25\x10\x4f\x5a\x4a\x30\x42\x7b\x3b\x37\
\x65\x16\xc1\x30\x07\xd5\x2d\xef\x56\x9e\xbd\xb2\xef\x9e\x33\x0e\
\xba\x61\x4e\xf9\x01\x82\x4e\x07\x64\x00\x64\x04\x18\xe9\x80\x3a\
\x1d\x12\x9d\xe8\x7b\x51\x78\xf0\xa3\x73\x6d\x95\x6b\x4e\x01\x84\
\xd6\xac\x3c\x25\x4e\xe4\xff\x14\x49\x72\xa1\x01\x8e\x9e\xce\x1c\
\x16\x9b\x70\x26\x57\x52\x65\x13\x03\x18\xb1\xe5\x8f\x58\xcb\xbe\
\x15\xf3\x2a\xd1\x7c\x12\x55\x02\x86\x74\xa6\x00\x0c\x30\xd8\x5b\
\x5f\xbc\xa9\x54\x80\x61\xc5\x8d\x6d\x0e\x9a\x8c\x59\x84\xb5\xbc\
\x4b\x15\xd3\x2a\x74\x00\xc4\xf2\x3b\x3a\x0e\x16\x61\x81\xd2\xa9\
\xfa\x1e\x23\x39\x93\x8c\x94\xf9\x59\x5c\x45\x9d\xd5\x23\x1d\x71\
\xb5\xb8\xf8\xca\x9d\x7d\x0c\xcf\xb4\xc8\x9c\x01\x48\xf7\x91\x55\
\x17\x0a\x95\xdc\x2c\xe2\xf8\xe4\x0a\x38\x6c\x60\x38\xfd\x11\xcb\
\x51\xb7\x4d\xab\xdc\x1f\x61\x96\x7c\x4d\x06\x29\x99\xc4\x7e\xca\
\x97\xa4\x2c\x1e\x1b\x21\x0b\x10\x2c\x38\x66\x98\x41\xf4\xad\x11\
\xd7\x1e\x4f\x11\xce\xa7\x76\xad\xd5\x2b\xc7\xd2\x6e\x33\xbf\xc3\
\x01\x12\x0d\x18\x94\x31\x88\x0e\x12\x1a\xe9\x3c\xdb\x09\x46\xde\
\x2d\x2e\xb9\x7c\x9d\x67\x58\x66\x4c\xe6\x04\x40\xe2\x35\xab\xde\
\x4e\x49\xfc\x7d\x11\x27\x8b\x53\x50\x94\xc0\x30\xc0\x61\x98\x5a\
\x65\x5c\xd8\xfe\x07\xe3\x8f\x38\x9d\xf5\x7c\xdf\x5a\xf2\x15\x9a\
\xa3\x4e\xb9\xbf\x41\x54\x80\x82\x05\x86\x87\x41\x06\x65\x8f\x5c\
\x6a\x99\x03\x1a\x20\xc0\x00\x25\xcf\xcb\x99\x45\x63\x0e\xe2\x96\
\x76\x1d\xcb\xba\x26\x48\x38\xb3\x2a\x5f\xee\xd5\xcc\x29\xc3\xf7\
\x18\xb1\x40\x62\x6c\xf7\x53\x67\xe4\xbd\x23\xaf\xbb\xfc\x97\x03\
\x0c\xd5\x50\x64\xd6\x01\x32\xb5\x66\xe5\xfb\x82\x44\x7e\x4b\xf4\
\x7a\xa3\x36\x30\x52\xe5\xef\x59\xe0\xe8\x99\xac\x51\xc4\x7b\x40\
\x4f\x5f\xe6\x75\xf8\x23\xdc\x0d\xc4\xfc\xf1\x77\x8b\x4d\x28\xf7\
\x2d\x34\x50\xd8\xc0\x20\xcd\xdf\x70\x82\xc3\xe3\x9c\x37\x01\x8b\
\x7d\x91\x0c\x90\x68\x40\xb0\xb7\x42\x2b\xc3\x02\x25\x3f\x3e\xd0\
\x58\xa5\xe2\x77\xd8\xce\x79\xc7\x30\xaf\xc8\x32\xaf\x38\xb3\x8a\
\x0c\x06\xd1\x59\x24\x03\x89\xb1\x9f\xa5\x8d\x8e\x4c\x8a\xa0\xf3\
\x81\xce\x25\x6f\xfa\x71\x83\x21\x9a\x36\x99\x55\x80\x74\x1f\x79\
\xe0\x5a\x41\xf4\x4f\xa2\xdb\x8d\x4a\x50\x68\x66\x95\x01\x98\x1c\
\x04\x1e\x7f\xa4\xe2\xbc\xdb\xf7\x48\x32\xa0\x38\x9d\xf5\xa4\x64\
\x0c\x8b\x2d\x8c\xc0\x98\x56\x36\x18\x66\x95\x41\x2c\xf6\xb0\x99\
\x45\x58\x79\x3a\xab\x88\x26\xce\xb9\x65\x5e\x51\xc4\x30\x88\x05\
\x0a\x97\xdf\x61\x80\xc4\x60\x91\x11\xd0\xc8\x48\x1c\x74\xa2\x6b\
\xa3\x8b\xdf\x7c\xe3\x00\x43\x36\x90\x44\xb3\xd5\x70\x77\xcd\xaa\
\x8f\x89\x24\xf9\x7b\xd1\xeb\x05\x06\x38\xba\x19\x73\xe8\x69\x96\
\x3f\x52\x32\x87\x0e\x18\x13\x1c\x15\x7f\xc4\xbe\x3f\x62\x39\xeb\
\x94\x39\xe7\xe4\x02\x86\xc5\x14\xad\x18\x04\x30\x57\xb6\x34\x19\
\x88\x41\x1c\xbe\x07\x88\x9c\x0c\x22\xb2\x3c\x36\x3d\x0f\x52\x02\
\x49\x08\x11\x49\x20\x92\xa0\x48\x02\x9d\xcc\x0f\x8b\xb2\x6d\xa7\
\x53\x2c\x56\x88\x4e\xba\x9a\x47\xae\x27\x0b\x28\x7d\xdb\x92\x3c\
\x4f\x16\x88\xe2\x16\x51\x39\x22\x02\xe8\x28\xe0\x86\xee\xaa\xbb\
\x47\x46\xdf\x70\xe5\xf5\x0d\x86\x6a\xe8\x32\x2b\x00\x49\xd6\xac\
\xfa\x98\x92\x16\x38\xba\x25\x20\x44\xc5\xd4\xb2\x9d\x75\x93\x49\
\x78\x67\x9d\x71\xd8\xb5\x15\x2d\xa1\x31\x09\xb9\x80\xd1\x82\x41\
\x8c\x78\x8b\xd5\x2c\x5b\x08\x7e\x5a\x37\x18\x24\x53\x26\x8e\x41\
\x0c\xd6\xd0\xca\x71\x60\x31\xd2\x35\xa0\xa4\x8b\x14\x09\x44\x27\
\x02\x64\x94\x31\x85\xb6\xec\xdd\xd1\xef\xff\xa4\x4b\xdf\x64\x01\
\x43\x7f\x47\x3f\x7f\xe4\x9f\xb8\x47\x6e\x00\x08\x10\x8a\x91\xa3\
\xa2\xff\x21\x46\x46\xbe\xd6\x5d\x75\x37\x66\x03\x24\x33\x0e\x90\
\x64\xdd\xaa\x3f\xa4\x58\x7e\x55\xf4\x62\x93\x39\x0c\x70\x94\x4c\
\x52\xf5\x47\x6c\x9f\xa4\x64\x10\x91\x3b\xee\x45\x7a\x0e\x0a\xde\
\x1f\xa1\x24\x01\x88\xa0\x9a\x00\xc3\x01\x16\x58\x79\x70\x6d\x1b\
\xac\x66\xd5\x49\xd3\xd5\x2b\x58\x8a\x9f\xa7\x3b\x41\xa1\xa7\x5b\
\x40\x09\x72\xa0\x44\x12\xa2\x23\x01\xd9\x01\x15\xc0\xc8\xef\x0f\
\x55\x9f\x6e\xa6\xe2\x13\xac\xd6\x36\xab\xb7\x60\xd5\x72\x80\x01\
\xa4\x7d\x28\xc6\x46\x14\x9b\x10\xa3\xa3\x5f\xeb\xae\xbe\xa7\x37\
\x3a\xc3\xe6\xd6\x8c\x02\x24\x5e\xfb\xe0\xef\xa9\x58\x7e\x4d\x74\
\x7b\xa1\xa1\xe8\x5d\x0d\x1c\x5d\x1b\x34\x9c\x3f\xa2\x81\xc3\x30\
\xb9\x5c\xbe\x48\x5c\xb2\x46\x1c\x83\xe2\xa4\x70\xbe\x15\x00\x2c\
\x3b\x06\xe2\x8a\x8b\x10\x9c\x7a\x22\x28\x49\xa0\x36\x6c\x41\x7c\
\xcf\x23\x50\xdd\x1e\x0b\x0c\xa0\x0a\x18\xe8\xf1\x96\x0c\xe2\x03\
\x8b\xd7\x41\xe7\x18\xc4\x76\xc8\x9b\x80\x25\x3b\x26\x60\xd2\x28\
\x07\x49\x1c\xa7\x40\xe9\x48\x08\xd5\x49\x17\x30\xa4\x4c\x8d\x20\
\xe3\x29\x82\x8c\x2d\x54\xf6\x14\x81\xd3\xa4\x22\x63\xf1\xa2\x18\
\x05\x82\x09\x92\xac\xc7\x42\x88\x10\x18\xb9\x3e\x7e\xf0\xde\x89\
\x99\x74\xdc\x67\xcc\x49\x8f\xd7\xaf\x7a\x3b\xf5\xd4\x2d\xa2\xd7\
\x1b\x45\xb7\x6b\x9a\x55\xdd\xae\xc5\x1c\xba\x4f\x62\xf9\x23\xba\
\xef\xa1\x83\xc3\x71\x6f\xc4\xf6\x47\x48\x26\x20\x95\x2a\xb0\x02\
\x20\xce\x7b\x25\xc2\x3f\x7a\x2f\xc4\xe8\x88\xd1\x5f\xb5\x7b\x3f\
\x0e\x7f\xe5\x46\xc8\xbd\x07\x9c\x2c\x02\x26\x1d\xbe\xad\xef\x51\
\x93\x06\xd2\x74\xf5\x2a\xdf\xea\x8a\x6e\xa4\x69\xe9\x5c\x5a\xe0\
\x4b\x0b\x04\x44\x58\xae\x5c\x91\x7d\xb7\xdc\xba\xe7\x41\xd6\xb2\
\x2e\x3a\x15\x47\x1c\x18\xd5\x57\xb0\x46\x80\xd1\x3c\x6f\xb4\x88\
\x17\x69\xa3\x23\x93\x88\xc4\x6f\x8e\xbc\xee\xca\x19\x59\x02\x9e\
\x11\x06\xe9\xae\x5b\x75\x21\xc5\xea\xfb\x22\x8e\x47\x4d\xa7\x3b\
\x67\x8e\x4c\xa9\x75\x70\x74\xf5\x3c\x9e\x55\x8c\x65\xe0\x1a\x7f\
\x24\x67\x0d\xc3\x9c\x5a\xbc\x00\xd1\x47\xae\xa9\x80\x03\x00\x82\
\xe3\x96\x62\xde\x47\xaf\xc1\xf8\xdf\xdc\xd0\xc8\xe4\x82\x1d\x77\
\xac\x66\xd9\x71\x6e\x5f\x17\x27\x83\xe8\xce\x76\xbe\xe5\xee\x7d\
\x34\x35\xa9\xb4\x34\xb2\x19\x45\xaf\x57\x11\x02\x4a\x32\x73\xaa\
\xc6\xef\xa0\xf4\x09\x66\xe2\x3e\x5a\xa1\xf5\x9d\x40\xcc\x20\x08\
\x08\x08\x90\xb9\x04\x07\x21\xc4\x7c\x88\x91\x1f\xd2\x23\xf7\xbc\
\x59\xbc\xf6\xcd\xeb\x3d\x43\x37\x14\x99\x76\x80\xd0\x9a\x95\xa7\
\xc4\x12\x37\x97\x37\x01\xf5\x15\x29\x86\x1d\x6c\x93\xab\x2f\x7f\
\xa4\x57\x3a\xea\xbd\x2a\x6b\x10\x00\x45\x84\xf0\xd2\xf3\x21\xe6\
\x8f\x3a\xfb\x1e\xbe\xe2\x64\x88\x97\x9f\x84\xe4\x99\x1d\x8d\x58\
\x04\x4c\x7a\x65\xeb\x58\xcd\x6a\x22\x83\xac\x5e\x01\x7e\x50\x08\
\x21\x4a\x96\xd0\x80\x92\x83\x84\x00\x04\x79\xbb\xf9\x4a\x17\xa5\
\xdf\x28\x2e\xfd\x0e\xeb\xa9\x65\xfd\x7d\x7c\x50\xb9\x4a\x55\xf1\
\x3b\x32\x93\xb4\x3c\x41\xe4\x0f\x6a\x0a\x91\x79\x26\xf9\xcd\xcd\
\x34\xbe\x34\xc1\xc8\x2d\x13\xab\xef\x7e\xe3\xc2\x69\x7e\x2c\x65\
\x5a\x01\x42\x3b\x1f\x5d\x90\xec\x89\x7f\x2c\xba\xdd\xf2\xf1\x11\
\xcd\x3c\x32\x6e\x02\xb2\x3e\x87\x6d\x72\xb5\xf1\x47\x7a\xa0\x38\
\x06\x64\xc9\x1a\x0a\xa5\x82\x2b\x00\xd1\xcb\x96\x7b\xfb\x2f\x84\
\x40\x70\xca\xf1\x50\x9b\xb7\x37\x5e\xcd\x6a\xcb\x20\x4d\x80\x52\
\x71\xce\x3d\xab\x57\xf9\x7e\x3f\xab\x57\x94\xa5\x05\x56\x9a\x01\
\x0c\x68\xc0\xc9\xd9\x84\x08\x42\xd5\x2d\xe5\xe6\xf5\xf1\x67\x9f\
\x32\x89\x66\xf0\x95\x27\x05\x21\x32\x26\x31\x3f\x75\xf4\xf2\xd1\
\x91\x91\x1f\xd1\xfd\xf7\x5f\x29\x2e\xbb\x6c\xb2\xc1\x30\xf6\x25\
\xd3\x06\x10\x22\x12\xf1\xfa\xd5\x37\x88\xb8\xf7\x5a\xfd\x31\xf5\
\xea\x72\x6d\x15\x24\xac\xc9\xd5\xc4\x1f\xd1\x4c\x2e\x8a\xe3\x62\
\xe9\x56\x67\x0d\x9d\x45\x28\x4e\x6a\xcf\x43\x75\x7b\x90\x30\x41\
\x01\x30\x60\x49\x4f\xba\x91\x2f\x62\xaf\x68\xc1\xce\x87\xdb\x39\
\xf4\xfa\x1e\x3a\x83\xd8\x3e\x86\xe3\xfe\x47\xc0\xb0\x0a\x11\x95\
\x20\xc9\xeb\x15\xe9\xcf\xfb\xe4\x8c\x02\x9b\x4d\x32\x80\xf0\x26\
\x15\x34\x93\x2b\x4f\x32\x4d\x2d\xd6\xa4\x2a\x98\x03\x19\x48\x34\
\x26\x49\x9f\x00\x78\x7d\x3c\x82\xff\x8f\x80\x0f\x8a\xfe\x48\xb9\
\x56\xa6\x0d\x20\xf1\xfa\x87\xfe\x5c\xc4\xc9\xef\xda\x26\x55\xe5\
\x5e\x46\xaf\x67\xb2\x0a\xeb\x6b\x70\xe0\x70\xfb\x23\x94\xc4\x20\
\xa5\x01\x03\x30\x80\x82\xe3\x8f\x45\x70\xdc\x12\x50\xe2\x7f\xe3\
\x93\x12\x89\xa9\x0d\x5b\x0c\xe6\xf1\x81\xa2\x02\x8e\x9a\xd5\x2c\
\x6e\xdf\x25\x5e\xdf\x03\xa8\x98\x5d\xa2\x01\x58\x72\xa5\xcf\xd3\
\x02\x68\x4e\xbd\x55\x26\x07\x92\x01\x8c\x1c\xac\xc5\x4a\x57\xaf\
\x58\x1e\xae\xdc\xeb\x30\xee\x77\xd8\xe7\x6d\x9b\x54\xd0\x80\x50\
\xc6\x85\xc8\x5f\x08\x13\xd0\xbe\x09\xf6\xfb\xf1\x43\xf7\x3d\x8a\
\xd7\x5d\x7e\x5d\xc3\xa1\x6c\x25\xd3\x02\x90\x78\xfd\x83\x57\x51\
\x22\x57\x98\xcb\xac\xd6\x2a\x93\xed\x3b\xe8\xcc\x61\x03\xa0\x00\
\x47\xb7\x00\x8b\x51\x26\x4e\xf3\xa9\x97\xde\xfc\xb3\x4d\x2a\x05\
\x80\x3a\x11\xa2\xb7\x5c\x8c\xe8\x8a\x8b\x20\x8e\x5d\x5c\x5c\x5c\
\x9f\x8c\xdf\xb6\x12\xf1\x0b\xe3\xb5\x0e\x7a\x6b\x06\xd1\xca\xc3\
\x4e\xcb\xa4\xd2\x3b\xfd\x9d\x0f\xa0\x0a\x12\xdd\x9c\xd2\xca\x3b\
\x4d\x2a\x3d\x3d\x5f\xd2\x45\x09\x04\xdd\xff\xf0\x01\x03\xd0\x58\
\x4d\x11\x82\x38\x2e\xfc\x8e\xc2\xf9\xce\xfd\x0e\xab\xff\x46\x8f\
\x75\x93\x0a\x0c\x5b\x98\xa0\xc8\x5e\x0a\x13\x10\x41\x20\x28\x08\
\x3e\x1f\x3f\x74\xdf\xea\xce\xeb\x2e\xbf\xc3\x1e\xb6\x41\x65\xe8\
\x00\x39\xbc\x6e\xf5\x69\x24\xd5\x37\x45\x1c\x87\x95\x77\x36\x7a\
\xda\x23\x22\x46\x7a\x4f\x7b\x74\xc4\x73\xf3\x90\x01\x47\xee\x8f\
\x50\xaf\x07\x48\x69\x80\x23\x8f\xe3\xf8\xa5\x98\xf7\x6f\xdf\x87\
\xe0\x24\xbf\xcf\x91\x0b\x25\x12\xe3\xb7\x3d\x80\x17\x7e\x78\x97\
\x01\x80\xca\x0d\x45\xa0\xc2\x20\xb0\xe3\x1e\x5f\x84\xdb\xe7\x44\
\xf7\x3b\x8a\x7d\x7d\x5b\xb3\x7a\xc5\x81\x25\x70\x00\x85\x33\xa3\
\x2a\x66\x96\xe6\x9b\x40\x2b\x1b\x64\x63\x14\x24\x09\x28\x33\xa7\
\x60\xfb\x1d\x5a\x34\x05\xa2\x7e\x32\x1e\x93\x2a\x7b\x53\x32\x4d\
\x37\xdf\x9a\x14\x41\x10\x21\x10\xdf\xa6\x87\xee\xbd\x48\xbc\xee\
\x4d\x3b\x1a\x0c\x69\x63\x19\x2a\x40\xe8\xce\x3b\xa3\x44\xe0\x46\
\x24\xc9\xb2\x0a\x5b\xe8\x8f\x80\x18\x66\x57\xcf\x7c\xae\xca\x36\
\xc7\xea\xc0\xd1\xed\x81\xe2\x5e\xe1\x8c\xeb\xfe\x86\x02\x80\x63\
\x17\x63\xde\x27\x3f\x84\xe0\x98\x85\x8d\xcf\x63\xdf\x37\x6f\xc6\
\xc4\x03\x8f\x39\x41\xe1\xbc\x79\xa8\xe5\x01\x55\x50\xb0\xee\xa9\
\x67\x55\xab\x60\x0c\xcb\xef\xd0\xe3\xba\x39\x94\xef\x73\x8f\x9a\
\xd8\x0c\x42\x5a\x9a\xee\x94\xeb\x80\x22\xcd\xec\x02\x93\x0f\xcb\
\x17\xd1\xe3\x81\x94\xa0\x5e\xb7\x5c\x11\x63\xce\x2f\x3f\xb5\xc2\
\xa4\xca\x99\x44\x37\xa9\x18\x16\x11\x41\xf6\xf5\x7a\x61\x7c\x62\
\xf5\x84\x78\xa4\xf3\x6d\xfa\xde\xf7\xde\x31\xcc\xaf\xa5\x0c\x15\
\x20\xc9\x09\x8b\x56\xa0\xa7\x7d\x7d\xa4\x72\x3f\x42\x63\x0e\xdb\
\xfc\xaa\x3c\xb5\xeb\xba\x07\x92\xe5\x65\x0e\x3c\xf5\x7a\x20\xed\
\xae\xb8\x6e\x56\x29\x00\xf3\xaf\xbd\xba\x15\x38\x00\x60\xc9\xfb\
\xde\x89\x89\xb5\x4f\x41\x8e\x1f\x6a\x64\x5a\x79\xdf\x11\x01\x1a\
\xf9\x22\x5e\x71\xad\x5a\x01\x55\xdf\x23\x2b\xcf\x9a\x54\xa8\x9a\
\x55\x05\x10\xec\x7d\x98\xfe\x47\x61\x72\xe5\xf5\xe7\x26\xaa\x1d\
\xcf\xfa\x94\x3a\xef\x0a\xa0\x5e\xd6\xae\x75\xce\x5a\xa7\x4b\x93\
\x0a\x55\xb3\xaa\x60\x8a\x92\x31\x52\xd3\x4a\x94\x1f\xc4\x2b\x99\
\xe4\x2d\xf1\x59\x27\xff\xef\x00\x3e\xdf\x66\x78\x7d\x32\x34\x80\
\xf4\xd6\xad\x7e\x13\x49\xf5\x59\xc1\x02\x80\x63\x0e\xce\xef\x28\
\xc1\x52\x32\x47\x15\x24\x4e\x70\x90\xe9\x98\x87\xaf\x39\x0b\xe1\
\x99\xa7\xb6\x3e\x97\x70\xd1\x18\x16\xbf\xeb\x8d\xd8\x73\xd3\xed\
\x05\x00\x8a\x95\x2f\x54\x81\x01\x26\x5d\x4f\x03\x4c\xe5\x70\x9a\
\x59\xba\x4f\xc2\xb0\x86\xbd\x6f\x83\x21\x3d\xcc\x04\x84\x13\x2c\
\x96\x53\x4e\xd6\x3e\xb2\x32\x4e\x7f\x23\x63\x8c\x4a\x3c\x3f\x0f\
\x21\x52\xc7\x5d\xa9\xf4\x9a\x41\xf7\x3b\x8c\x0e\xc3\x66\x0e\x3d\
\x08\x11\x68\x2c\x62\x7e\x62\x95\xff\x72\xbd\xf8\x8b\xde\xea\x07\
\x6e\x1b\xb9\xf8\x8d\xab\x30\x04\x09\x86\x51\x09\xad\x5b\xb7\x50\
\x08\x5c\xcf\x7f\xd4\x2d\xe6\xdf\x23\x77\xb1\x0a\xc3\x24\xc6\xdb\
\x85\x3d\x3f\x38\x8a\x38\x11\xa2\x4b\x5f\xd3\xf7\x39\x2d\xba\xf4\
\x7c\x28\x21\x20\x89\x20\xf3\x7a\xb5\xba\xf5\xf6\x24\x90\x96\xd3\
\xd2\xf5\x63\xa4\x76\x9c\xd4\x8e\x97\xd6\xbe\x62\xda\xb1\xcb\xb8\
\xca\x4b\xed\xb8\xfc\x18\xa3\xdf\x7a\xdf\xad\x7e\x1b\x7d\xce\xdb\
\x71\x1c\xe3\x8d\x33\x79\x44\x94\x5e\x27\xce\x9f\xd4\x56\x31\x85\
\x71\xdd\x4d\xeb\xc2\x9c\x74\x93\xaa\xc9\xae\xeb\x54\x2f\xe9\x40\
\xa8\x6f\x6c\x5f\xfd\xe3\xb1\xbe\x2f\xbe\x26\x43\x61\x90\x44\x74\
\xaf\x43\x92\xff\x58\x4d\xc2\x80\xc0\x3a\x41\x1d\x34\x46\xc8\x97\
\x6b\x75\xb3\xab\xca\x3a\x75\xe0\x28\x18\xe4\xcc\x53\xfa\x1f\x98\
\x63\x16\x22\x3a\x6e\x29\xa6\x76\xed\x75\x9b\x57\x43\x58\xcd\xe2\
\xf6\x75\x71\x31\x08\xeb\x7b\x00\xac\x43\xce\xb1\x87\xe1\x8f\x20\
\x5b\xbd\x72\xdd\xeb\xb0\xf7\x5d\x66\x95\x56\x2e\xcf\xab\x30\x89\
\x6e\x52\xc1\x62\x8b\x20\x73\xc0\x2b\xab\x56\xb9\xdf\x51\xfd\xac\
\x51\x91\xae\x7d\x08\x4f\x84\xe1\xd9\xc7\x77\x8e\xfb\x3c\x80\x3f\
\xf5\x0c\x6d\x23\x19\x18\x20\xbd\xc7\x1f\xbe\x92\xa4\xfc\x77\xa2\
\xf2\xee\x85\xf6\xce\xb7\x11\xaa\xfe\x89\xce\x22\xc2\x00\x86\xbe\
\x14\xdc\x2b\x96\x72\x9b\x80\x83\x3a\x11\xc4\x82\xf9\x03\x9d\x5b\
\xb0\x74\x31\xd4\x73\x7b\xcc\x95\x2c\xb8\xc1\x02\x2b\x0d\xfa\x96\
\x71\xc6\xdb\xf8\x21\xac\x83\x6e\x99\x61\x86\xa3\x0d\x37\x28\xec\
\x47\x4a\x7c\x4e\x78\x65\xdf\x32\xb9\xf4\xd5\x2b\x3b\x9e\x9d\xb8\
\x05\x92\x18\xc2\x69\x52\x05\xd9\xbd\x0e\xdd\xef\x60\xcc\xa9\xa0\
\x04\x43\xfa\x93\x72\x79\x3c\x2e\x4c\x2d\x0a\xc3\x3f\xe9\x3d\xb6\
\xea\xbf\x8f\x9c\xff\x86\x07\x5a\x0c\x73\x45\x06\x02\x08\x6d\xdc\
\x38\x9a\x24\xe3\xff\x80\x24\xfb\xca\xba\xf1\x91\x36\x9e\x02\xbd\
\xe9\x36\x28\x62\x1d\x1c\x71\xb6\x5a\x25\x6b\xc1\xa1\x32\x5a\x6f\
\xe7\x09\x57\x45\x29\x55\xb9\xd9\xd8\x78\x45\xcb\xe3\x98\xb7\x05\
\x09\x0b\x8e\xb4\x91\xca\xea\x55\x11\x07\xef\x90\x17\x8f\x94\x58\
\x40\x21\x94\xab\x59\xb9\x3f\x92\x3b\xe6\xbe\x7b\x1f\xdc\x4a\x96\
\x0f\x24\x42\x4a\x50\xdc\x33\x57\xa8\x72\x20\xe8\x7e\x07\xf3\x9d\
\x61\x11\x06\xa6\x63\x1e\x6a\xe9\x71\xb6\x1f\x67\x2c\x12\xc7\x21\
\x09\xf1\x4f\xb4\x7a\xf5\x6b\xc5\xc5\x17\xc7\x0d\x86\x99\x95\x81\
\x00\x12\xab\x89\xcf\x8a\x24\x39\xdb\xfc\x18\x42\xca\x20\xc2\x66\
\x0c\x1d\x34\xb6\x9d\x59\xdc\x1f\xb1\x7d\x11\xdd\x91\xef\x01\x89\
\x2c\x41\xe1\x01\x87\x02\xa0\x12\x09\xf5\xc2\x38\xc2\x65\xc7\xf4\
\x75\x6e\x44\x84\xa9\xdd\xfb\x8c\xfa\xfb\x5d\xcd\xb2\x59\x04\xa8\
\x02\x83\x03\x8a\xd7\x41\xb7\xc1\x90\x36\xe0\x37\xa9\xf4\x74\x0b\
\x14\x3a\x43\xd8\x66\x55\x6e\x82\x71\x26\x17\xb4\xe3\xf2\xb8\x0f\
\x24\x20\x42\x90\x48\x40\x58\x20\xa9\x7c\x1d\x92\xff\xd6\xb0\x61\
\x52\xc5\xe5\x17\x23\x45\xf1\xad\xaf\x38\x4d\x4f\x4d\xad\xf3\xe2\
\xa8\xf7\x29\x00\x5f\x64\x86\xb7\x91\xf4\xed\xa4\x4f\x6e\x5c\x7d\
\x86\x90\xf4\x99\xf2\xfd\xee\xd8\x34\xa9\xf2\x8f\xb7\x55\xcc\x2c\
\x06\x08\xec\x67\x44\x7b\x86\x23\x4f\xd9\x1d\xf2\x62\x29\x17\xa6\
\x52\xda\xa0\x21\x22\x74\x9f\xd8\xdc\xef\xe9\xa1\xbb\x6b\x2f\xba\
\xfb\x0e\xa6\x4e\xac\x56\x7f\xee\xfc\x16\xc1\xe1\x14\x1b\x0e\x70\
\xee\x5c\x6b\x79\x46\x39\x6d\xdf\x76\xbc\x2b\xce\x7e\x1e\xb7\x9d\
\x7d\xa6\x6d\xe9\xe8\xaf\xe1\xa8\x73\xce\x75\x03\x47\x9c\x98\xf1\
\xae\x38\xe8\x30\x27\x0d\x63\x42\x8b\x13\xcb\x01\x37\x17\x6b\x8c\
\x7b\x66\xac\x1f\xab\x9b\xf1\x31\xcc\x0f\x73\x68\xfa\x48\xf4\x67\
\xb4\x6e\xf5\x69\xfd\xea\x41\xdf\x0c\x12\xaa\xf0\x6f\x91\x74\xe7\
\xdb\x1f\x41\x28\xdf\xdc\x73\x39\xec\x55\xbf\x44\xb0\xcc\x51\x9a\
\x5c\x14\x27\xe6\xac\x6d\xad\xe0\x70\xe0\x50\x00\x0e\xfd\xf2\x61\
\xcc\xbf\xec\x82\x72\x76\x6b\x21\xbb\xef\x5a\x0d\xc9\xb4\xe9\x65\
\x11\x07\x83\x18\x71\xc6\x17\xe1\xf6\x01\x0f\x83\xe8\xb3\x3e\x18\
\xf6\x40\x73\xa7\x5c\xdf\x77\xdd\xeb\xd0\xfd\x0d\xdd\x94\xd2\xe3\
\xc8\xea\x50\x36\x63\x68\xf1\xbc\x8d\xc2\x67\x8b\x13\x08\x11\x68\
\x4b\xb9\xc6\x8d\xbf\x8c\x2d\xaa\xbe\x86\x08\xe2\xec\x77\x15\x83\
\x82\x2d\x10\x87\x10\x61\x0c\x8a\xb5\x8f\xe2\x25\x09\x44\x18\x2e\
\x90\x61\xf0\x25\x00\xef\x67\x86\xb8\x56\xfa\x62\x90\x78\xe3\xc3\
\xef\x44\x22\xdf\x63\xb0\x47\xf1\x7b\x80\x36\x38\xb2\x74\x83\x55\
\xea\xfd\x91\x7c\x56\xa1\x38\x75\xca\xbd\xcb\x8c\xd6\x8c\x95\xe7\
\x4f\x6d\xde\x8e\x43\x2b\xd7\xb6\x3e\xbf\xc9\x1d\xcf\x63\xd7\x2f\
\x7e\x65\x2e\xb7\x82\x9f\x61\x8d\x25\x5e\x54\x67\x71\x6e\x69\x76\
\x60\x06\xb1\xea\xb5\xdb\x56\x5a\x9f\xd8\x25\x6a\x98\x4b\xba\x8d\
\xd8\x83\x19\x7b\x17\x73\x73\xe9\xec\x44\xa6\x54\xfa\x4a\x82\xf3\
\x06\xb2\xa5\x1f\x9a\xfe\x08\xdb\x2a\xb1\x3f\xc6\xa1\xb1\x88\x4a\
\xe4\xfb\x7a\x6b\x56\x5d\xd1\x5a\x11\xd0\x07\x83\x10\x51\x90\x3c\
\xf1\xe8\xdf\x08\x99\x88\xca\x8f\x62\x1a\x6c\x62\x77\x34\x06\x6b\
\x66\x69\x60\xb1\xef\xbc\x53\x1c\x03\x4a\x79\xcd\x29\x83\xc2\x99\
\x8b\xbb\xf7\xc6\x9f\x22\x3a\x71\x19\xe6\xbd\xe2\xe4\x46\xe7\x17\
\x1f\x9c\xc0\x93\x7f\xf7\x5d\xc8\x38\x76\x3a\xe8\x9c\xf9\x60\xf7\
\x11\x5a\x1a\xf4\x2d\xc3\x20\x3e\x47\xbd\xcd\xea\x55\x11\x77\x38\
\xe5\x02\xe6\x7b\xe7\xfa\x03\x89\x79\xbd\x15\x7f\x83\xfc\xcb\xb8\
\xb6\xef\x91\xc7\x03\x8d\x29\x54\xe6\x7b\xe8\x8f\xb0\xe4\x4c\x22\
\x32\x90\x98\xcb\xb8\x96\x23\xae\xf9\x1a\xe5\xcf\xc6\x95\xbe\x06\
\x92\x30\xd5\x9b\x22\x9e\x98\x2c\x12\x85\x02\x51\xf8\x65\x22\xba\
\xa4\xed\xef\xb8\xb7\x66\x90\xde\xc6\xc7\x3e\x4c\x52\x5e\xe0\xfc\
\x99\xe5\x8a\xc9\xa5\x7d\xf2\x53\x07\x4a\xce\x2a\x0c\x58\x8a\x59\
\xc3\xe1\x94\xbb\xec\x5a\x2e\x2e\xa7\xba\xd8\xf1\xb7\xdf\xc4\xf8\
\xaf\xd6\x1b\x4e\x32\x27\x87\xb6\xec\xc0\xe3\x5f\xf8\x67\x1c\xde\
\xb9\xbb\x3a\xf3\xe6\xf5\xe5\xfb\xdc\xec\xca\xf9\x19\xba\x2f\xa0\
\xf9\x03\x75\xec\xc1\xb1\x08\xe7\xf7\x70\xac\xe4\xbd\xf1\x58\x77\
\x5e\xf9\x7e\x0d\x7b\xf8\x7c\x8f\x4a\x19\xa0\xc2\xee\xfa\x75\x45\
\x22\xbd\xd6\x84\xa8\xf8\x1a\xd9\x42\x50\xcd\xb7\xce\xcc\x2f\x67\
\xca\x8b\xe5\xba\x5f\xfd\xbe\x57\x01\x18\x69\x65\x9c\xd3\xba\x75\
\x23\x71\xd4\xdb\x20\xa6\x7a\xa7\xa3\x3b\x05\x4c\x75\x81\xa9\x72\
\x2b\x8a\xfd\x29\xa0\xdb\x35\xd3\x8b\xf2\xdd\xf4\x23\x0d\xf9\x71\
\xdd\x32\x2d\x4d\x4f\xcb\x52\xb7\x67\x98\x56\x92\xaa\x40\xa9\x33\
\xb7\xec\xfc\xf9\x67\x9f\x8e\x25\x6f\x7b\x3d\x16\x9e\xfb\x0a\x84\
\x63\xe9\x3d\x12\x15\xc7\x98\x78\x7a\x1b\xf6\xdc\xfb\x08\xf6\xac\
\x7c\x0c\x52\xaa\x0a\x6b\xe8\xf5\xd9\x6c\x61\x28\x40\x3e\x4e\x56\
\x39\x30\xf9\xc6\xb8\xb6\xb8\x40\xde\x6f\xee\x32\xf9\x05\x6b\x58\
\x8f\xa0\x04\x3a\xa3\xc0\x5c\xf6\xd5\xf3\x02\x7b\xdf\x8a\xbb\xca\
\x70\xf9\x76\x3c\xd4\xd2\x44\x10\xa4\xdf\x06\x18\x9d\x07\x9a\x37\
\x0a\x8c\x66\x61\x5e\x16\x46\x47\x41\xf3\xe6\x59\x69\x59\xd9\x79\
\xf3\x8a\x32\x69\xdc\x4a\x2f\x8e\x9b\xf7\x64\x94\x44\xe7\xb5\x59\
\xf6\x6d\x65\x62\xc5\x91\xfc\x18\xa4\x3a\xdd\xfc\xd0\xb3\xfd\xe9\
\xce\x2c\xcf\xfe\x8d\x72\x7b\x85\x81\x9d\x15\xd2\x90\x3b\xe5\xb6\
\xbd\x6b\x3b\xea\xb6\x69\x55\x67\x6e\x4d\x6c\x78\x06\x07\x9f\xd8\
\x0c\x25\x04\x82\x05\xf3\x41\x41\x80\x78\xe2\x10\xa4\xfd\x5a\xae\
\xd6\xa6\x3e\x4b\xfa\x80\xd1\xf4\x7e\x48\x53\xd3\xca\x96\x02\x28\
\x44\x55\x70\xe8\xa0\xa0\xea\x92\x2e\x65\xe9\xdc\xb3\x57\x86\x99\
\xe5\x30\xab\xf2\x87\x19\x8b\xf6\x5b\x98\x55\x42\x4b\x23\x2b\xae\
\x2f\x03\xa7\x2f\x5c\x25\x10\xda\xcd\x3e\xc3\x09\x0f\x32\xb3\x2a\
\x73\xc8\x53\x13\x2a\x81\x48\xc2\xf4\xfb\x66\x71\xf6\x65\xfa\x42\
\x1f\xb3\xf4\x24\x35\xb3\x10\x45\x80\x4c\xce\xea\x8d\xe2\x0f\x00\
\xfc\x73\xd3\x71\x6f\x6c\x62\xd1\xc6\x8d\xa3\x80\xfa\xac\xf1\x81\
\xe7\x4a\xdc\x32\xb9\xb8\x9f\x3d\xcb\x4d\x2e\x7b\x69\x38\xd1\xbe\
\xa3\x9b\x7f\xe9\x10\x30\x66\x71\x9f\xb3\x58\x67\x6e\x19\xa0\x21\
\x42\x6f\xfc\x10\xba\x07\xc6\x2b\xe0\x68\xe2\xa8\x36\x36\x67\xb4\
\xb2\xf9\xb6\xe2\xc7\x34\x0c\xf6\xb1\x86\xd9\x95\xf7\xa1\x89\xd9\
\x57\x67\x3a\x79\x18\xd8\x36\x71\x9b\x98\x55\xbe\xb1\x34\x26\x16\
\xa2\xec\x6b\xfa\xba\x49\x65\xea\x89\xd0\x75\x46\x37\xa9\x9a\xfc\
\xbc\x5e\x16\x0f\x24\x3e\x47\xab\x57\x77\x9a\xea\x7d\x63\x06\x89\
\x83\xa9\x6b\x11\xcb\x53\x38\x70\x54\x41\x53\x5d\xfa\xad\x3a\xf3\
\x71\x75\x10\xe2\xc4\x58\xd2\x35\x06\x93\x99\xa1\x7d\x26\x56\x9d\
\xb9\x65\xa7\x73\x71\x97\x79\xc5\x99\x5f\x36\x8b\x80\xd9\x0e\x2a\
\x76\x3d\x04\x94\x0c\x91\xa5\x71\x77\xcf\xf5\xf7\xce\xf5\x32\xbe\
\x47\x4a\xf4\x78\x20\x04\x94\x96\x8e\x9a\xf4\xfc\x86\xa0\xed\xcc\
\x57\xcc\x53\x6d\xf9\x3d\x67\x35\x83\x45\xb4\x3b\xe3\xa9\x95\x51\
\x3a\xde\x86\x33\xae\x33\x45\xb1\x8d\x20\xf2\x6f\x2e\x17\x69\x09\
\x10\x45\xaf\xec\x8d\x04\x1f\x02\xf0\xf5\x26\x63\xde\x88\x41\x88\
\x28\x44\x22\x3f\x9d\xfe\x14\x32\x8f\x4c\x1e\x34\xd5\x15\x2e\x97\
\xc9\x25\xb2\x4f\x81\xda\xef\x75\xf8\x9c\x3b\x9f\x79\x53\x67\x6e\
\x79\x67\x37\xcf\x2c\xab\xcf\xc2\xae\xa5\x5f\x1b\x38\x8d\xc6\x98\
\x09\x6d\x8e\xd3\xdb\xb5\xfb\x64\x2c\x18\x30\xe7\x25\x51\x33\x06\
\x1e\xc6\x68\x7d\x0d\x6a\xae\x2f\x11\x81\x12\xed\x49\x0c\x4b\x57\
\xf8\x1f\x40\x32\xbf\xce\x5f\xd5\x4b\x69\xa4\x07\xa4\x3e\x4d\x2b\
\x56\x34\xd2\xfd\x46\x85\xe4\xe6\xc7\x7f\x0f\x4a\xbd\xb2\x68\x28\
\x07\x4a\xfe\x0b\x4c\xde\xce\x55\x41\xe2\x34\xb9\x92\xc4\x69\x5a\
\x55\x06\xbc\xee\xa2\x7a\xf2\x6d\x70\x78\x57\x62\x1c\xfb\xdc\x6a\
\x56\x9d\x72\xfb\x4c\xa8\x61\x97\xaf\x98\x7b\x0d\xcf\xc1\x37\x2e\
\x75\x66\x55\xdd\x35\xb1\x81\xe3\x34\xb5\x74\xa5\xb7\x4d\x2a\x97\
\x1e\x39\x74\x4f\x58\xfa\x9a\x7d\x78\xfb\x9c\xe4\xf7\xae\xba\xda\
\x31\x8c\x86\x34\x63\x10\x29\xff\xb4\xca\x1e\xe5\x0f\xcd\x94\x0d\
\x6b\x9d\x62\x3b\xeb\xb0\x13\x35\xf6\xa8\xd8\xdd\x4c\x5a\x65\x35\
\xc9\x1e\xf4\x1a\x96\x69\xc4\x1c\x0c\x6b\xf8\x18\x83\x53\xdc\x7e\
\x18\xa1\xa9\xf8\xea\xf6\x01\x85\x03\x46\x9b\x31\x69\xc2\x0e\x2e\
\x46\x31\xf2\xb5\x72\x5c\x1a\xb1\xbf\x4a\x9c\x30\xcb\xb8\x16\x18\
\x1c\x3a\x59\xd1\x59\x04\x9f\x6c\x32\xce\xb5\x00\xe9\x6d\x7e\xfc\
\x52\x92\xf2\x12\xf3\x87\x2d\x93\xf2\x47\x2d\x6d\x30\x14\xf9\x0d\
\x18\x45\x07\x8d\x94\xce\x81\x34\x06\xbf\x29\x6d\x33\xc7\xb6\x31\
\x1d\x7c\x2c\x62\x3b\xdc\x2e\x05\xe5\xc4\xc7\x0a\x4d\x83\xaf\x5e\
\x57\x5b\xb6\x79\xd8\x74\x82\x68\x02\x1e\x4e\xe1\x7d\x13\x15\x77\
\xac\x5d\x0e\x52\xf1\x93\xaa\xcb\xc4\x97\x1a\x30\xac\xbc\x0a\x8b\
\xa4\x3f\x92\xf4\xe6\xee\x9a\xd5\x17\x39\x86\xb3\x90\x7a\x06\x91\
\xf2\xdf\x43\x4a\x51\xf9\xdd\x70\x03\x10\x65\x9a\xd0\xd1\xaa\x75\
\x5a\x54\x40\x53\x9e\x84\xce\x1e\x36\x15\x57\x40\xc1\x0c\xa6\x97\
\x19\x3c\xe6\x03\x07\x0e\xfd\x02\xdb\x0f\x2a\x72\x0a\xa1\xcb\x4c\
\xb1\x48\x13\xf6\x70\x95\xe7\x40\x2f\x1d\xe7\x6f\x33\x82\x17\x54\
\x2e\xa6\x41\xf5\xda\xd4\x5d\xdf\x92\x45\x1c\xa6\x94\x4c\xca\xdf\
\x90\x34\xf4\x4a\x1a\x13\xae\x4f\x5f\x85\x94\x22\x08\xd5\x27\xea\
\xc6\xda\x0b\x10\x7a\xe2\x89\xe5\x24\xe5\xfb\xec\x5f\x7a\xe5\x99\
\xc2\xee\x8c\xed\x1c\xd9\xc8\xd6\xc0\xa4\xaa\x37\xe7\x38\xea\x75\
\x99\x56\x3e\xfa\x67\xd3\x5a\x9a\x58\xdc\xc5\x35\xc6\xa9\x61\x9a\
\x9d\x37\x13\xec\xc1\xa5\xf5\x7d\xee\x2d\xc6\x98\x63\x7c\xd7\x75\
\x74\x5d\x77\x28\x65\x4d\xba\x2e\x7f\x43\xdb\xd7\x75\x54\x67\x9d\
\x8a\xee\x4a\x90\x52\x1f\xa0\x47\x1e\x59\xe2\x18\x56\x00\x35\x00\
\x89\x3b\xc9\x87\x85\x52\xf3\x38\x70\x94\xe6\x95\x74\x76\x20\x07\
\x4f\xd5\x27\xe1\xd9\xa3\x32\x68\xda\xc0\x71\x33\x0f\x37\xa3\x3b\
\xcd\x87\x06\x8a\x60\x33\x8a\x6b\xe6\xb3\x15\x0e\x35\x69\x7a\xfa\
\xa0\x2c\xe2\xab\xa7\x49\x7f\x9a\x80\xc4\xc9\xc6\x76\xdc\x91\xcf\
\x32\x16\x3c\x4c\x01\x73\x7c\x0d\xc0\x79\x80\x21\x5c\xfa\xc7\xa4\
\x09\x9b\x51\xa4\x84\x48\xd4\x02\x39\x2a\x3f\xe8\x1b\x6f\xbf\x89\
\xa5\xe8\x23\x15\xaa\x72\x05\x63\xc5\xc0\xee\xa8\x6e\x1f\xea\x0e\
\x15\xcf\x1e\x4d\x67\x18\x96\xbe\xb5\x72\xf6\x05\x6a\x6b\x6e\xd9\
\x00\xd4\xa5\xcd\x8c\xed\x03\x45\xbf\xac\xe1\xab\xbf\x4d\x7f\x87\
\x61\x56\x55\xd8\x03\x6e\xb0\x34\xb2\x10\x2a\x2c\xa2\x4f\xb2\x8c\
\x5e\x59\x16\x8c\xd0\x7e\xe7\xbe\x2e\x90\x54\x1f\xf5\x0c\xb1\x1b\
\x20\xbd\x67\x9f\x78\xfd\xe4\xf6\xed\xaf\x2e\x66\x79\x7d\x79\x2d\
\xbf\xa1\x97\xa7\xc5\x39\x1b\x64\x4f\xe0\x5a\x0f\x95\x51\x16\xcc\
\xc7\x49\xd2\xa0\xcf\x2e\xc6\x4c\x9e\xdb\xc9\xba\xbd\xac\x6f\x5d\
\xe5\xb5\x72\xb2\xc1\xb1\xb9\xd3\x5d\xf9\xc2\x08\x99\xce\xb8\xae\
\x54\x47\x43\xc8\xcf\x47\xc1\x5a\xd5\x22\xeb\x05\x30\x66\xbc\xec\
\xf1\xac\x3c\x27\x97\x95\x23\x26\x8d\xbd\x16\x4c\x79\x43\x1f\xf2\
\x27\xbb\x93\x24\xd5\xab\x24\xd6\x74\x2a\x29\xd3\x73\xbd\xb2\x96\
\x83\x29\xc9\xca\xda\xab\xa6\x49\x02\x95\xc8\x8b\xba\x6b\x1f\xbe\
\xc0\x85\x03\x27\x40\x26\xb7\xef\xf8\xf0\xfd\x1f\xfb\xf7\x42\x1e\
\x3a\x5c\xde\xef\xc8\x57\x10\x0a\xe4\x56\x99\xa1\x82\xe8\xca\x6a\
\x55\x49\x95\x94\x3f\xca\x6e\x51\xb0\x3e\xf3\x54\x66\x33\xce\x97\
\x70\xb0\x05\x57\x8e\x9d\x05\xb9\x7c\x4b\x91\xb8\x38\xb7\xef\x4a\
\xd3\xd3\x9b\xb0\x43\xdb\xe3\x9a\xb2\x06\x57\xde\x98\xf5\x61\x8d\
\x97\x67\xec\xea\x96\x7a\x5d\xe5\x74\xc6\xd1\x59\xa4\xc2\x20\xf9\
\xbe\x52\x95\xe5\x5a\x61\xeb\xa1\x6d\xbd\xd4\xc4\x45\xb9\x15\x20\
\xf9\x21\xd7\xd8\xb3\x8f\x9a\x10\x51\xf8\xf8\xe7\x3e\xf5\xaf\x0f\
\x3e\xf9\x34\x7e\xfd\xd5\x7f\xc2\xab\x3f\xf6\x11\x14\xbf\x6c\xaa\
\x14\xf2\x1f\x6e\x14\xfa\x0f\x38\x4a\x05\xe3\x07\x1d\x2b\xfe\x48\
\xd5\x3e\xb4\xa9\xd9\x1e\x30\xd6\x11\xd4\xf2\x94\x7d\x9c\x35\xc0\
\xae\x8b\xe9\x73\x30\x39\x70\x70\x0a\xd6\x64\xdf\x95\xd6\xa6\x8c\
\xeb\x71\x6b\x72\x94\x21\x2b\xad\xc9\x7e\xfe\xb8\x8a\xd2\xea\x31\
\xde\xfe\x83\x36\x46\x4d\xde\xf3\xc8\xf2\xf4\x7a\x85\x76\xac\xd2\
\xda\xb4\xeb\x55\x56\x7f\xf2\xe3\x0a\x93\xdc\xa5\xfc\x9e\x20\xa4\
\xc4\xfe\xe7\x76\xe1\xa6\xff\xf6\x8f\x69\x5d\xfa\xc7\x22\x44\x80\
\xf3\xff\xf5\x7b\xdf\x4f\x44\x9f\xe6\xde\x15\x61\x01\x92\x6c\x7b\
\xea\xcd\xdb\x6e\xfe\xd9\x89\x00\xf0\xe4\xb7\xbf\x8b\x25\xa7\xbf\
\x1c\xa7\x5e\xf6\x86\x66\x9d\x71\x75\xda\x4a\x27\xfd\x45\x28\xf0\
\x4a\x6b\xb3\x87\xcb\xc9\xab\x73\x00\xf5\xf4\xda\x25\x4a\x4d\x89\
\x9a\x82\xa3\x0d\x30\x9a\xb2\x86\xaf\xbc\x0d\x1a\x5b\xe9\xf3\xb4\
\xa6\xfb\x2e\x90\x94\x85\xa9\xf2\xac\x95\xad\xe0\xf9\x73\x55\xc2\
\x4a\xcb\x15\x5c\x35\xcd\xd3\xca\x18\x00\x55\x4a\x73\xb4\x13\x40\
\x46\x2c\x43\x08\x29\x41\x8c\xfe\x2d\x39\x76\x29\xe6\x2d\x58\x80\
\xed\x4f\x6f\xaa\x8c\xe3\xba\x1f\xdd\x72\xda\x6b\xaf\xfd\xf0\x1b\
\x01\xdc\x6f\x9f\x3a\x6b\x62\x3d\x77\xeb\x1d\xbf\xf7\xc2\xda\xf5\
\xc5\x80\xac\xfe\xe2\x97\x30\xb1\x6d\x47\xc9\x1e\x2a\x6b\x58\x31\
\x40\x60\xd2\x2a\x2b\x08\x89\x04\x5c\xec\x60\x51\x30\x17\x58\x13\
\x8c\xc9\xb3\x41\xe1\x02\xe4\x30\xc1\x41\x9e\xb4\xb6\xe0\x70\x89\
\xab\x3e\x3b\x8d\xdb\xb7\xcb\xdb\x71\xe7\xa4\xd5\x70\x5c\x59\xc7\
\xdc\x91\x57\x77\xdd\x8d\x73\x20\xaa\x4c\xb6\x15\xbd\x35\x41\xe1\
\x09\x00\x00\x20\x00\x49\x44\x41\x54\x62\xf5\x31\xd7\x59\x85\x0b\
\xaf\xb8\x9c\xad\x7b\xf7\x53\x9b\xf0\xeb\x1f\xdd\xf2\xbb\xdc\x58\
\xb3\x00\xd9\x79\xc7\x5d\xc6\x73\x2a\x24\x25\x36\x7c\xf7\xa6\x14\
\x99\xd9\x6f\x63\x0b\xad\x61\x03\x34\x75\x1d\xce\x3a\xdd\x14\x0c\
\x8d\xf2\x18\x7b\x96\x63\x16\x97\x2f\x62\x2b\x9c\x4b\xa9\xda\x28\
\x1c\x57\xde\x4e\x6f\x1b\x38\x71\x01\xc5\xb5\xdf\x24\x4f\x9f\x30\
\xea\x7c\x8f\x62\xdc\x7d\x0c\xee\x31\x69\xdb\x5c\xdf\x52\x87\x34\
\x53\x5e\x31\x26\xbe\xa1\x9b\xa9\x1e\x0a\x29\x71\xf6\x85\xe7\x63\
\xde\xd8\x98\x31\x6e\x79\x78\xe6\xbe\x95\xd7\x70\xe3\x5b\x01\x48\
\x77\xf3\x86\x0b\x77\xdd\x73\xef\x69\x76\xfa\x96\x3b\xee\xc2\xf6\
\xfb\x56\xf2\xa0\x70\x81\xc6\x01\x96\x8a\x79\xa5\x0d\x08\xd7\x79\
\xd7\x80\x3a\x7d\x10\x2b\x2f\x9f\xbd\x5c\x2c\x92\x2b\x80\x2d\x6d\
\x14\xcb\xb7\x6f\x9f\x53\xbf\xe2\x03\x4c\x5d\x1f\xda\x00\x1b\x30\
\x19\xd5\xfb\x3c\x9c\x6f\x72\xd2\xca\x37\x9a\xf0\x1c\x65\x8a\xf3\
\x51\x96\x4e\xe9\xfe\xaf\xa6\x5f\xa2\x52\x26\x0d\x9d\x28\xc2\x39\
\xaf\xbf\x88\x1d\xc7\x67\x57\x3f\x7c\xe6\xc1\x07\xee\x3a\xd7\x1e\
\x87\x0a\x40\x9e\xfe\xc6\x37\xaf\x3a\xbc\x75\x1b\x33\x64\x40\x67\
\xfe\x3c\x03\x95\x6e\xb0\x94\x9d\x13\x9a\x53\x5f\x04\xb4\x07\x43\
\x9b\x32\x75\x17\x4f\x07\x85\x6e\x56\x01\xe6\x05\xe1\xa4\x4e\xf1\
\xea\x14\xd7\x4e\x6f\x13\xea\xfa\xc2\xf5\xbb\x29\x48\x5c\x65\xec\
\x71\xf2\xde\xec\x1b\x02\x53\xc0\x55\x26\xef\x94\xae\x63\x8a\x01\
\x03\x67\xd9\xa8\x8c\x69\x94\xc2\xab\x2f\xbd\x84\x05\xdf\xf8\xee\
\xdd\x78\xe0\x9f\xfe\xf9\x2a\x7b\x3c\x2a\x00\xd9\x7d\xdf\xfd\xef\
\xe2\x06\x6e\x74\xf1\x62\x1c\x77\xce\xd9\x29\x42\x19\x0a\xb3\x57\
\xb8\x9c\x26\x97\x92\xec\xe0\xf8\x06\xa6\x9f\x59\xc7\xb8\x88\x8c\
\xbf\xe1\x9a\xa5\x38\x69\xaa\x4c\x76\x9e\x2b\xcd\x55\x5f\x9d\xb8\
\x8e\xe7\x40\xdb\x04\x18\x75\x71\x7b\x7c\x0d\xa0\x68\x69\xae\xeb\
\xe1\xcc\xd3\xca\x34\xbe\xae\xb9\x9e\x78\x4d\x2a\x5d\xcf\x54\x19\
\xb2\x3c\x21\x15\x4e\x7e\xc5\xe9\x58\x72\xdc\x72\xf6\x1c\xb7\x3e\
\xf4\xe8\x6f\x5a\x43\x6b\x02\x84\x76\xee\x5c\x30\xbe\xf1\xa9\x4b\
\xed\x42\x00\xf0\xb2\x8b\x5f\x8b\x40\x80\x69\x58\x55\xcd\xab\x0a\
\xbb\x94\x27\x93\xff\x5e\xb9\xad\x98\x75\x4e\x9a\x6f\x36\x62\x1d\
\xc1\x06\xcc\x92\x1f\xab\x2b\xc5\xa0\x71\xd7\xbe\x0f\x14\x3e\x05\
\xa9\x3b\xa6\xae\xdd\x41\xe3\x2c\xfb\xfa\x96\xc9\xfb\x60\x7d\x30\
\x65\x60\x4d\x9c\x45\x19\x97\xc5\x62\xe8\x5f\xb6\xe2\xc5\x58\x39\
\x82\x08\xe7\xbc\xfe\x75\x66\x9b\x59\x78\x61\xdb\xf6\xcb\x37\x7f\
\xfd\xeb\xf3\xf4\x31\x34\x00\xb2\xee\xcb\xd7\x5d\x7e\x68\xcb\xb3\
\xa3\x60\xe4\x65\x17\x5f\x54\x05\x86\x8e\x54\x83\x51\xb2\x4e\x2a\
\x3d\x2d\x3b\x11\x6e\x50\xac\x00\x66\x30\xd9\xf2\x35\xf4\xcd\x31\
\x85\x9e\xd7\xc6\xef\x68\x1a\xf7\xed\xdb\xe9\x75\x20\x68\x52\xb6\
\xae\xcd\x41\xc1\x0e\xa0\xca\x1c\x7a\xa8\x61\x11\xdf\xf5\xb1\xcb\
\x70\xe7\xcb\x9e\x3f\x3b\x39\x73\xba\xa8\x4d\xe6\x5a\x38\xe7\xa2\
\x0b\xd9\x31\x9d\xd8\xbb\x6f\xec\xde\xeb\xaf\x37\x08\xc2\x00\xc8\
\xf6\x5b\x6f\xbf\x92\x19\x1f\x44\xf3\xe7\x61\xf9\xb9\x67\x03\x8a\
\xd2\x46\x88\x6f\x98\xef\xa0\x49\x77\xdc\xc0\xe9\x17\xa6\x76\x20\
\xfb\x2c\xe3\x62\x16\xbd\x6d\x5d\x06\x55\x2c\x6e\xdf\x07\x08\xa7\
\x32\x34\xac\xc7\xb7\xdf\x2f\x30\xd8\x6b\xd2\x86\x29\x3c\xc1\xb9\
\xcc\xcf\xb4\x0d\x9b\x55\x94\xc5\x0e\x45\xe0\xd2\xaa\xba\x79\xd2\
\x69\xa7\x62\xe1\xb1\x4b\xab\xfe\x15\x80\x1d\x6b\xd7\x5e\xa1\x8f\
\x81\x01\x90\xc9\x6d\x3b\x2e\x67\xc6\x09\xc7\xbf\xfa\x3c\x84\x61\
\xe8\x6f\xd8\x66\x14\xc6\xd4\x72\x02\xc2\x63\x5e\xb9\x2e\x50\x3f\
\xa6\x58\x01\x16\xed\x38\x5d\x86\x05\x14\xdf\x7e\xa5\xaf\x8e\x76\
\x9b\x94\xab\x6b\x6b\x50\x60\xd8\x69\x6d\x99\x02\x2d\xca\x34\x29\
\x5b\x84\x7c\xa2\x56\x55\xd3\xaa\x36\x90\x82\x20\xc2\x19\xe7\xbf\
\x86\xfd\xac\xeb\xd4\xf8\xb8\x81\x81\x02\x20\xeb\x56\xac\x18\x89\
\xc7\xc7\x2f\x66\xc6\x06\x27\x5c\xf0\x1a\xcd\x6c\x22\xad\x41\x32\
\x4d\x29\x23\x8f\xeb\x1c\x55\x06\x84\xdd\x3a\x06\x06\xdc\xfe\x00\
\x2b\x5e\x7a\x9b\xba\xb8\x14\x96\xcb\xf7\x29\x5b\x9d\x42\xf7\x23\
\x2e\xa0\xb8\xf6\xeb\xc0\xe0\xab\x47\x4f\x6b\x33\x01\xd9\x65\xec\
\xe3\x2b\xf5\x69\xc7\xd8\x6d\x72\xdb\xf4\xa6\x61\x3d\x18\x44\x25\
\x8d\x8a\xb4\x33\x5f\x73\x5e\x05\x1c\x0a\x40\x9c\x24\x97\xac\xd0\
\x9e\x30\x29\x00\xb2\xe5\x9b\xdf\x7c\x3d\xc5\xf1\x02\x6e\xe0\x8e\
\x3b\xef\x5c\xcb\xbc\xaa\x82\x84\xef\x9c\x99\xe7\x1a\x4c\xe7\x60\
\x58\xd4\x5a\x3b\xc0\x4c\x59\x5f\x9b\xba\xd4\xa5\x71\x80\x6a\x0a\
\x0e\x5f\x9b\x4d\x83\xeb\xd8\xa6\xed\x73\xc7\x37\xcd\x6f\xd3\xdf\
\x26\xa6\x93\x5d\xd6\xe9\x90\x5b\xfb\x46\xbf\x6a\xc1\x60\xe9\x1f\
\x99\xf1\xd3\xcf\x3e\x0b\x08\x43\xee\x67\x23\x96\xa8\x4e\xa7\x78\
\xba\xb7\x00\x48\x77\xcf\x9e\x37\x33\x63\x82\x79\x4b\x97\x62\xc1\
\xf1\xc7\x55\x1b\x51\x84\xd2\x17\xb1\xe2\x2e\x54\x43\x9b\x25\x5a\
\x38\x65\xc5\xb6\xa5\x29\x06\xab\xac\xab\x5e\x5d\x9a\xa6\xf9\xf2\
\xeb\x14\xd7\xa5\xf4\x75\x6d\x70\xc7\x35\x05\x49\x93\xf2\x75\x69\
\xec\x35\x6a\x62\x5e\x31\x65\x9d\xf5\xb9\xea\xb0\xfd\xd6\xca\x44\
\xcd\x4c\xdc\xb6\x4e\x6a\xc7\xcc\x9b\x3f\x0f\x27\xbe\xfc\x54\x9e\
\x45\xa4\x2c\xb0\x50\x00\x44\x4a\x79\x19\x33\x36\x58\x7e\xee\xd9\
\xe9\x67\x29\x0b\x70\x64\x71\xe2\x1b\xe6\xd0\x0a\xe5\xf6\x3f\x9a\
\xce\x22\x5e\xc0\xf8\x06\xd6\x1e\x60\xe6\x1c\xfb\x49\x73\x29\xb8\
\xab\x8c\xaf\xed\x26\x8a\xe2\xeb\xdb\x20\xfd\xea\x27\xcd\x35\x49\
\x39\xaf\x05\x63\x3a\xb1\xd7\x53\xdf\xd6\xe8\x85\xa9\x6f\x96\x2e\
\x32\xfa\x67\x82\x86\x20\x14\xe1\xb4\xb3\xce\xe4\x3f\x20\x4e\x54\
\x60\x21\xc8\x1a\x14\x88\xe3\x4b\x98\xf1\xc0\xb2\xb3\xcf\xd2\x1a\
\xb7\x50\x59\x74\xc6\x93\xaf\x83\xaa\x6e\x50\x1c\x83\x59\x3b\xb8\
\x0e\x53\xcc\x05\x1a\xbd\x3e\x5d\x06\x05\x4a\x93\x38\x77\x0e\x75\
\xc2\x95\xe7\xf6\xdb\xf6\xa3\x9f\x34\x1f\x28\x8a\x72\x35\xd7\xc3\
\xae\xcf\xd8\xb6\xd1\x93\x02\x18\x96\xae\x29\x4e\x2f\xa9\x48\x13\
\x99\xde\x9e\x76\xe6\x19\x06\x30\x64\x19\x8a\xa5\xde\x00\x00\x6e\
\xbf\xfc\xf2\x53\x55\xaf\x77\x3c\x33\x2e\x38\xf6\xac\x33\x0a\x20\
\x08\xa5\x35\x64\x77\x4e\x67\x18\xc5\xe4\x37\x39\x69\xcf\x20\xeb\
\x17\x44\x8f\xb3\xa1\xc6\x8c\xd3\x65\xa6\x81\xe2\xaa\xc7\x07\x6c\
\xae\x6c\xbf\x7d\x18\x34\x8d\x55\xf6\x16\xe6\x6c\x91\x66\x5f\x5f\
\x17\x53\x78\xb6\xec\x24\xac\xeb\x22\x51\x66\xfd\xa8\x2a\x58\x94\
\xc2\xc9\xa7\x9f\x66\x00\xa3\x00\x0a\xd1\x29\x9f\x1a\x1b\x3b\x11\
\xc8\x00\x32\xf1\xe4\x93\x17\x81\x79\x37\x27\xe8\x74\xb0\xf8\xd4\
\x53\x19\x50\x94\x0d\x09\xd2\x3b\xc7\xa5\xa5\xf1\xb6\x27\xcf\xcd\
\x18\x6d\x06\xd2\x06\x0c\x77\xf1\x75\x99\x49\xa0\xd8\x7d\xac\xeb\
\x57\x1d\xb0\x67\x02\x18\x6c\xbf\x18\x40\xa0\x6e\xeb\xf1\x1f\xdb\
\x6c\x01\x54\x80\x21\xf2\x09\xd9\xb0\x66\xc8\x9c\xc4\x35\xdd\x3c\
\x76\xd9\x32\x8c\x8e\x8d\x99\xe6\x55\x1a\x84\xec\x76\x2f\x04\x72\
\x13\x6b\x6a\xea\x7c\x6e\x10\x16\x9f\x72\x32\xc2\x28\xac\x00\xa0\
\xa0\x2f\x32\x11\xe9\x4e\x2b\x67\x18\x63\xdb\xc7\xa0\x54\x66\xad\
\x16\x75\xb0\x83\x6c\xc9\x74\x03\xc5\xd7\x7e\x1d\x68\xfa\x01\xc9\
\x30\xd2\xec\xbc\xbe\x14\xdc\xba\x5e\xad\x8e\xad\x74\xa4\x9c\x2c\
\x0d\x33\x5f\xd7\x3d\x6f\x5a\x1a\x02\x01\x1c\xf7\xb2\x93\x2a\x26\
\x96\x02\x90\x10\x5d\x00\x64\x00\x51\x49\xf2\x6a\x6e\x40\x8e\x39\
\xfd\xb4\x2a\x30\x1c\x8d\x79\xd3\xa8\x3a\xec\xfa\x6c\xd2\x74\x90\
\x7c\x33\x52\x9b\xba\xe0\xd8\xaf\x93\x61\x00\x85\xdb\xe7\x40\xe1\
\xca\xe3\xf6\x07\xe9\x5f\x13\x71\x8d\x5b\xa3\xeb\xe1\x59\x7c\xa9\
\xad\x4b\xab\x33\xdd\x58\x20\xd3\x27\xe2\xa6\x7a\x68\x85\xe3\x4e\
\x3a\xd1\xe5\xa8\xbf\x1a\xc8\x19\x44\xa9\xca\x73\xf0\x04\x60\xd1\
\xa9\xa7\x66\x67\xd3\xac\x31\x17\x72\xb9\x15\x2c\xb3\x31\x7e\x00\
\xb8\x63\x6a\x07\xb4\xa6\xae\xa6\xe2\x3b\x6e\xd8\x40\x69\xd3\x9f\
\xba\xba\xfb\x4d\x1b\x74\x7c\x86\xc1\xe8\xae\x6b\xe8\xac\xa7\xed\
\x24\xcd\x84\x65\x27\x1c\x57\x31\xb1\x32\xb0\x9c\x0b\x00\x01\x7d\
\xef\x7b\x21\xa4\x3c\x83\x3b\xf9\x45\xa7\xbc\xac\x3c\x15\x17\x2b\
\x34\x05\x4d\x83\x41\x2b\x3b\x30\x84\x59\x47\x1b\xc4\xba\x8b\x3f\
\xa8\x92\xb4\x49\xe3\x14\xbd\x2e\xd8\x65\x07\x69\xbf\x89\x34\x19\
\x8f\xa2\x2f\x2d\xad\x00\xbb\xde\x26\xd7\xca\xd5\x9f\x02\x24\x15\
\x5d\x6b\x0a\x10\x60\xe9\xb2\x65\xac\x89\x25\x89\xce\x02\x20\x82\
\xdb\xaf\xbb\xee\x64\x15\xc7\xf3\xc0\x34\xbe\xe8\xa4\x13\x8b\x8a\
\xf8\xad\xbf\x71\x97\x79\xe5\x3b\x79\xa3\x34\x33\x93\xd4\x1d\xd7\
\x18\x84\x2d\xc5\x57\x4f\xbf\x69\x4d\xfb\xd4\xe4\xb8\xb6\x69\x83\
\x8e\x87\xab\xbe\x56\xe0\xd0\x27\xd9\x9a\x7a\xb9\x3c\x56\xd7\x9c\
\x7a\xa8\xb7\x53\xe6\x1f\xb3\x74\x89\xeb\xc7\x54\x17\xfd\xc9\x82\
\x05\xc7\x07\x93\xbb\x76\xbd\x02\xfa\x4f\xe0\x65\xdb\x20\x0c\x31\
\x7f\xf9\x72\x37\x42\xc1\x74\x00\xd5\x0e\xd4\xb1\x87\x6f\x50\x9c\
\x33\x4d\xc3\xe3\x7c\xf5\xf8\xa4\x5f\xe5\x69\xaa\xa4\x76\x3a\x79\
\x42\x9b\x7a\xea\xca\xd6\x49\xdb\xb1\x19\x64\x72\x6a\x52\x0f\x57\
\x9e\x85\x12\x3b\x29\x93\x95\x57\xd5\x49\x10\x61\xd1\xa2\x45\xdc\
\x2a\x16\x14\x20\x0e\x77\xbb\xaf\x08\xe4\xc4\xc4\x69\x5c\x27\xe6\
\x1d\xbb\x14\x41\x14\x16\x8d\x0a\xbd\x04\xcb\x10\x75\xa8\x6d\x73\
\xd2\xd5\x32\x69\xb3\x64\x6e\x1b\x1c\xe7\x6a\x63\x50\xa0\xb4\xcd\
\x73\x29\x7b\x5d\x3f\xda\x1c\x37\xcc\xfe\xd6\x95\x69\x03\x86\xe2\
\x18\x8f\x6f\xe1\x6b\xd3\x7b\xae\xfa\xc4\xcc\xe9\x1f\x34\xdd\xd5\
\xd2\xf3\xdf\x86\x5f\xb0\x60\xac\xe2\x7f\x14\x41\xa9\xd3\x22\x4a\
\x92\x93\xb9\x86\xe7\x2f\x5f\xee\x01\x85\xde\xb0\x9e\x97\x37\xec\
\x1f\xae\x7e\x07\xa5\x49\xf9\x61\xce\xa8\x6d\xda\x6f\x9a\xd7\x46\
\xe1\xed\xef\x56\xd9\x71\x78\xd2\x9a\xe4\x0d\x2a\x8d\xaf\x23\x11\
\x48\xf8\x7b\xd1\xf6\xba\x97\x07\xea\x13\x31\x65\xdf\xd7\x72\xeb\
\xac\xd1\x0a\x11\x46\xe7\xcd\x2b\x5e\x9c\x13\x56\x20\xa5\x4e\x0e\
\x94\x52\x27\xd9\x1d\x23\x00\xf3\x96\x2d\x35\xd9\xc1\x3e\x1d\x8e\
\x41\xf4\x0a\x18\x06\x19\xfa\x8c\xec\x60\xa7\xbe\x07\xbb\x45\xfb\
\x6d\xca\xb4\x01\x4a\x9b\x32\xc3\x66\x85\x41\xcb\x54\xc6\xdd\xe3\
\x5b\xd4\xd5\xcd\x5d\xc3\x5a\x5b\xc4\xa1\x77\x45\x26\x93\x1f\x85\
\x21\x10\x04\x2e\x33\xeb\xa4\x08\x44\xc7\x71\x9d\x99\xb7\x64\x89\
\xd6\x68\x5e\xc0\xd1\x45\xce\x09\xd2\xb6\x83\x5e\xc8\x6a\x8d\x4c\
\xfb\x2d\xea\xea\xa7\xfd\xa6\x65\x87\x05\x94\xb9\xc8\x18\x8d\x85\
\x08\xc8\xbe\x8a\xe8\x2c\xe2\x88\x37\xaa\xde\x6e\x8b\x05\x84\x9d\
\xcf\xd7\x14\x04\x02\x4a\xfb\xba\xa3\xfe\xfb\xf3\x81\x10\xc7\x47\
\x44\xb4\x5c\x6f\x34\xdf\x8e\x2e\x5e\x64\xa6\x54\x56\x1c\x1c\xdb\
\x21\xda\x33\x6d\xc1\x53\xb7\x62\x36\x57\xa4\x09\x1b\xb4\x05\x46\
\xdb\xf6\xeb\xea\x69\xda\xd6\xb0\x58\xa8\x4d\xb9\xfa\x1a\xfc\x13\
\xb6\xad\xab\xb9\xef\x61\x9b\x58\x00\x96\x45\x20\x2a\x7e\x61\x47\
\x3f\xbc\xb3\x70\x61\x7d\x3f\x5c\x99\x6c\xe7\x5a\x54\x31\x44\x99\
\xb9\x8b\xf3\xe2\x96\xd9\x18\xbf\x12\xc4\xfd\xb7\xae\x54\xf9\xf3\
\x0d\x0c\x40\x96\x44\xa4\xd4\x62\x8e\xee\x3a\x0b\xc6\xfa\x6e\xf4\
\x25\x79\x49\x38\x99\x31\x10\xb5\x68\x48\x4a\x89\x24\x9b\xcc\x6d\
\x80\x28\xa2\x63\x22\x08\xb1\xc0\xae\x93\x00\x44\xf3\x2a\xf7\x0e\
\x4b\x99\x75\x23\xf7\x25\x39\x12\x65\xc6\xd4\xa6\x45\x43\x53\xdd\
\x2e\x64\x76\x1b\xc3\x0e\x81\x10\x63\x11\x29\x35\x3f\x2f\xac\x83\
\x24\x1c\xb5\x3f\x8f\x95\xb5\x2a\x84\xb9\xcf\x6d\x05\x57\xae\xef\
\x73\x18\x48\x9a\xb6\x93\x7f\x7e\x7f\xae\xc8\x6c\xcf\x41\x6d\xdb\
\xf7\x95\x6f\x73\x0d\xfa\x6b\x93\x39\xd2\xd0\x41\x77\x05\x87\x0e\
\x4f\xb2\xfe\x47\xc6\x20\x63\x01\xc2\x70\x84\x33\xb1\x82\x4e\x54\
\xd6\x02\xed\x28\x5f\x6f\x2b\x65\x84\xf6\xdf\x7d\x58\x93\xbc\x26\
\xe5\x44\xdd\x80\x0c\x28\x4d\x6a\xef\xb7\x0c\x63\xff\x3a\x8f\x1b\
\x54\x19\x87\x39\x4a\x6c\x5d\xa2\xfe\xba\x4f\x4f\x07\x98\x11\x62\
\x27\xeb\x72\x3b\x3e\x31\xe1\x5a\xe2\x85\x02\xc2\x08\x44\xf9\x6b\
\xb7\x86\x04\x41\x98\x56\xec\x6b\xa0\x36\xdf\x3e\x81\x86\xe7\xe9\
\xc9\x73\x5e\x10\x6d\x05\xab\xcd\x85\x99\x49\xe6\xe0\xda\xf2\xb5\
\x3f\x88\x82\x0d\x4b\x39\xfb\xa9\xa7\x38\x86\x99\xb0\x38\x90\xb7\
\x05\xbc\xb0\xf7\x72\x1d\x14\x5c\x0b\x2e\x5d\x4c\x77\xf6\x1d\x3c\
\xc8\x3a\xe8\x79\x88\x8c\xdb\x1c\xfa\xb6\xd2\x33\xab\x23\x1c\x28\
\x04\xb2\x9f\xb8\xe2\xf2\x87\x37\x03\x16\xe5\xb2\x5f\x29\xaa\xab\
\x6b\x50\x65\x69\x02\xa2\x3a\x45\xf7\x01\x63\x10\xd6\x19\x44\x86\
\x75\x7c\xbf\xd7\x75\x28\xe5\x6d\x50\x38\x75\xd4\x9e\xd4\xd3\xb0\
\x77\xff\x0b\x5e\x80\x04\x36\xca\xcb\x7b\x82\xa4\x35\x26\x40\x4c\
\x47\x48\x58\x1d\x32\xf2\xb5\xd0\x62\x10\xec\x3c\x76\xa6\x69\x30\
\x33\x0d\x63\x06\xed\x57\x71\x7d\x79\x4d\x67\xce\x36\xc7\x0c\x63\
\xc2\x19\x54\x5c\xe3\x9f\x4f\x64\x5c\x59\xdf\x71\xae\xf2\x6c\xae\
\xa6\x83\x64\xeb\x62\xae\xbb\x9a\x2e\xeb\xad\xed\xda\xbb\xcf\x67\
\x62\x21\x20\xa5\x12\xa0\x3a\xc3\x29\xa9\xbb\x2e\x65\x07\x78\x30\
\xd8\xf9\xd6\x31\x0d\x07\xa0\x56\xb9\x2d\xdb\xb6\xcd\xe0\xda\x79\
\x83\x2a\xd5\xb0\x80\xa1\xcf\x56\x76\x79\x3b\x7d\xba\x80\xd2\x0f\
\x03\xb4\x39\xa6\xd8\xea\x7a\xd1\x67\x7f\x2a\x79\xc5\x44\x6c\xe5\
\xda\x3a\x69\xe9\x32\x65\xc7\xed\xd8\xb3\xd7\xf5\xb8\x3b\x14\x40\
\x01\x88\xa6\xf2\xb6\x74\x13\x4b\xc6\x09\x2a\x54\xa5\xb3\x82\xc1\
\x10\x76\x1a\xcc\xf4\x96\x83\x50\x29\x93\xfd\x68\x24\x77\x5c\x5b\
\xc0\x0d\x3a\xa3\x0e\x13\x18\x5c\x59\x1f\x58\xda\xd4\xd3\xa6\x8f\
\x6d\xa4\xc9\xec\xdf\xf4\x9a\x08\xc7\x84\x57\xd7\x6e\x25\x83\xd5\
\x41\x5d\x3f\x61\x4d\xe0\xe5\x76\xdb\xae\xe7\xd9\x17\xa6\xb2\xd0\
\x0d\x28\x08\x26\xb9\x55\xac\xa4\xdb\x35\x19\xa1\xe8\x84\xdd\x88\
\x0b\x24\xd5\x4e\x36\x1e\xc0\x1c\x10\x1a\x30\x5a\x1d\xef\xd9\xfa\
\x64\xd0\x19\xd8\x95\xe6\x8b\x73\x80\xb0\xf3\xdb\xd6\xeb\x4b\x1b\
\x34\xcf\x2e\xd3\xcf\xb8\x57\xd2\x98\xeb\xed\x9b\xdc\xf4\x89\x93\
\xd7\x37\xf0\x3a\x6a\xe9\xa3\x54\x84\xad\xcf\xef\x76\xbd\x72\x0b\
\x25\xc4\x64\x20\x80\x71\xa0\x6a\x62\x25\x93\x93\x8e\x8a\x6b\x80\
\xc0\x04\x9f\x02\x54\x4e\xb8\x66\x70\xbc\xc7\xeb\x5b\x07\xc8\x7c\
\xfd\x18\x46\x5e\x53\x60\x70\xc7\xd9\x61\x98\x75\xbb\x64\x10\xa0\
\xb8\xc6\xb9\x09\x58\xbc\x00\x6a\x3a\xa1\x3a\x75\x2e\x68\xa4\xaf\
\xcf\xef\xdf\x8f\x89\xa9\x29\xb7\x0f\x42\x34\x1e\x00\x38\x90\x37\
\xaa\x9b\x58\xbd\x89\x43\x0c\x22\x3d\x21\xf0\xa7\x35\x55\xe2\xa6\
\x8a\xe1\xdc\xd6\xf8\x29\xae\x7a\x07\xcd\xab\x53\x52\xae\x4c\x9d\
\x02\xba\xca\x36\xad\xdf\x97\xdf\x26\xcf\x57\xbe\xed\xf8\x37\xb9\
\x96\x65\x01\x3f\xa3\xa4\x09\x41\xa9\x6b\x9c\x0e\x7a\xc2\xd3\xdb\
\x77\x7a\x1d\x74\x02\x0e\x44\x10\x62\x1f\xb7\x3c\xd9\x1d\x9f\xe0\
\x11\xe9\x05\x42\xde\xd9\xa0\x9a\x66\x0f\x22\x51\x23\xe5\xd5\xb7\
\x4e\x90\x65\x8f\x57\x0b\xc7\x33\x35\x7a\x20\x6d\xcb\x49\xdb\x3c\
\x5f\x79\x2e\x9f\xdb\x6f\x23\x76\xf9\x7e\xc0\xda\x2f\xf8\xed\x6b\
\xe1\x05\x41\x0d\xb3\xd4\x4e\x74\x7a\xfb\xb9\xfe\x58\x5b\x53\x17\
\x35\xa0\xe8\x69\x2e\xe0\x04\x02\x4f\x6e\xdb\xe6\x5c\xe2\x05\x00\
\x02\xf6\x07\x10\x62\x8f\x3e\x18\xf9\xc5\x9b\x3a\x70\xa0\x0a\x82\
\x40\x07\x4b\xc0\xa4\x71\x60\x49\x01\xe3\x1b\x2c\xdf\x85\xa8\x0c\
\x6c\x56\x47\xb1\xf5\x9c\xa0\xaf\x2d\x5b\xfa\x55\x1a\x57\xfd\x76\
\x9c\xdb\x6f\x0a\x0e\xae\x3c\xb7\xdf\xa4\x8f\xae\xfc\x7e\xf2\x7c\
\xe3\x5f\xb9\x16\x9a\x72\x37\x05\x47\xad\x6e\x14\x3a\xa8\xe9\x9f\
\x08\x18\x40\xf0\x69\x4f\x6c\xd9\xea\x5a\xbd\xca\xc3\xee\x08\x42\
\xec\x02\xaa\x0f\x2b\x4e\xee\xdb\x6f\xa1\x32\x40\x05\x30\x22\xc8\
\x6e\x0c\x0a\x8d\x35\xb2\x34\xbb\xe3\x35\x03\xe1\xcc\xcb\xd9\xc6\
\xc1\x3a\xde\x6d\xc6\x2a\x22\xdf\xa2\x2a\x02\xd3\xc7\x18\x76\x59\
\x57\x7d\x6d\xc5\x3e\x66\xa6\x81\x52\x28\x7f\x43\xff\xc3\x0b\x18\
\xcf\x71\xb0\x8f\xb1\xfb\xa4\xeb\x65\x20\x40\xba\xbe\x69\xfa\xc8\
\xa5\x91\x10\x58\xbf\xe5\x59\xe7\xeb\xb6\x59\xda\xae\x00\x41\xb0\
\x23\x6f\x4f\xbf\x78\x87\xf7\xec\x2d\x2b\xcd\x1a\x20\x0e\xb1\xb6\
\x39\x55\xe4\xeb\xe6\x56\xf9\x4b\x6f\xb5\x03\x59\xc3\x10\xad\xea\
\xe0\xf2\xec\x41\x66\xa4\xa9\x12\xb9\x14\xcf\x8e\xfb\xf6\xdb\x48\
\x5d\x5d\x33\x01\x14\x2f\x00\x5a\x28\x7d\xb1\x6d\x00\x32\x36\xcd\
\x65\xc5\x18\xfa\x19\x80\x18\x2b\x87\x02\x81\x7d\x13\x13\xd8\x9e\
\xdd\x24\x74\xb1\x08\x01\x3b\x82\xa8\xd3\xd9\xca\x2d\xf3\x1e\xda\
\xbd\xbb\xb8\x99\x52\xe9\x48\xde\x89\xc0\x02\x41\x91\x6f\x01\x25\
\x10\x10\xb9\x99\x55\x37\x50\x0d\x2e\x46\x11\xb7\xc1\xc4\x5c\xa0\
\xd9\x04\x86\xaf\x1e\xae\x6f\x5c\x3b\xae\x32\xbe\xfd\x3a\x20\xf8\
\xea\xa9\x3b\x86\x9b\xb4\xea\x26\x39\x70\x65\x5c\xc1\x31\x41\x56\
\xea\xd0\xf5\xce\xa9\x93\xb6\xfe\x96\x13\xf7\xba\x67\x9e\x45\x42\
\xe4\x75\xd2\x13\x60\x6b\x40\x63\x63\x5b\x80\x2a\xf5\xf7\x26\x0e\
\xa1\x77\xe8\x90\x05\x0c\x9d\xb6\xaa\x20\x70\x82\x26\x4f\xd3\x4f\
\xd2\x76\xbc\x98\x41\x70\x6d\xdb\x0c\x3c\x3c\x03\x0e\xab\x0e\x57\
\x9a\x6f\x46\x6b\x1a\xd7\xfb\xc8\x89\x4b\xe9\x5c\xe5\xea\xfa\xda\
\x24\x5e\x07\x24\x2f\xa8\xad\x99\xdf\x0b\x9a\x1a\xc0\x78\xb7\x0e\
\x3d\x31\xd8\xc2\x35\x41\x57\x26\xeb\xf2\x98\x35\x9b\x36\x7b\xc1\
\x91\x99\x5e\x5b\x82\xa5\xaf\x7a\xd5\xe6\x72\x3f\x95\x1c\x2c\xe3\
\x3b\x9f\xb3\x1a\x14\x8d\x3b\x43\x46\xc7\x83\x46\x8e\xba\x53\xd9\
\xdb\x38\xe6\x7d\x38\xf1\xba\xb8\x14\x93\xcb\x6f\x1a\xf7\x2a\x5a\
\x83\xf6\x7c\xc0\x1e\x14\xb4\x5c\x7b\xae\x34\xdf\x78\xea\xe3\xed\
\xea\x37\x77\x3d\xed\xfa\x6b\xb7\xb9\xfe\x30\xfa\x55\x0d\x9a\xbe\
\x5a\xba\xfb\xd0\x53\x9b\x7c\xcb\xbb\x50\x80\x1c\x05\x9e\x09\xde\
\x79\xfb\xed\x07\x44\xa7\xb3\x1b\xa8\xb2\xc8\xc1\xed\x3b\xaa\x95\
\xdb\x6c\x91\x3b\x47\x4d\x82\xe3\xa4\xb9\xc1\x46\xcb\x01\xac\x03\
\x04\x77\x11\x75\xa9\x4b\x73\x29\x56\x53\x45\xf4\x81\xa1\x0e\xc8\
\xae\xf2\xbe\xfd\x7e\xe2\x75\xe7\xcb\x8d\x63\xdd\x04\x05\xae\x8c\
\xab\xbe\x1a\xb3\xca\xe8\x97\x05\x82\x8a\x0e\x0a\x2d\x4d\x98\x79\
\x3d\xa9\xb0\xe6\x99\x2d\x75\xf7\x40\xb6\xaf\x04\x26\x33\xad\x15\
\x1b\xec\xc1\x20\x00\x2f\x6c\xd9\x5a\xa1\x31\xb2\xc0\x51\x0b\x8a\
\x50\x63\x90\x3a\xc7\xdb\x31\xa8\x5e\x65\x67\xea\x44\x83\x32\x81\
\x56\xce\x96\x36\x8a\x54\x57\xde\x05\x14\x97\xf2\xbb\xc4\x75\x5c\
\xd3\xbe\xb4\x2d\x63\xe7\x07\x56\x1f\xea\xc6\xb7\x4d\x19\xd8\xdb\
\xba\xc9\x4e\x08\x4d\xaf\xc2\x1a\xbd\x33\xf5\x95\x44\x80\xc7\xb7\
\x6d\xc7\x44\xb7\x6b\x33\x86\x1d\x36\xe4\xe7\x0d\x11\x04\xeb\xb9\
\x6f\x90\xbc\xf0\xcc\x96\x86\x54\xe6\xe8\x5c\xa8\x9d\x40\x9e\xa6\
\x0f\x86\xb5\x36\xee\x1d\xb8\x86\xa6\x93\xaf\x4c\xc0\xe4\x71\xca\
\x60\xc7\x39\x69\x73\xac\x0b\x10\xb5\xe7\xd1\xe0\xd8\x36\x7d\xf0\
\x49\x93\xfe\xe7\x63\xcb\x82\x05\xed\xaf\x4d\xa5\x6e\xeb\xbc\x9c\
\xfe\x47\xa1\x6b\x96\x6e\x35\x98\xa4\x11\x08\xac\x7a\xf2\xe9\x3a\
\xf3\x0a\x0a\x78\x1c\xc8\x01\x12\x45\x6b\xf5\x01\xc9\x41\xb2\xef\
\xe9\x4d\x16\x75\x09\xab\xf1\x90\x01\x45\x99\x56\x1c\x1b\x86\x69\
\xd9\x30\x70\x0e\x24\xac\x6d\x5f\x80\xc8\xb6\xfa\x05\x0c\xec\x32\
\x9e\x76\xed\x38\x97\xd6\x54\x09\x5d\x0a\xec\x52\xf8\x26\xe2\x03\
\x76\x9b\x7e\xd9\xf1\x26\xf9\xae\xf1\xf4\x8e\x75\x0b\x53\xac\x09\
\x68\x0a\xb3\x4d\xd3\xa7\x42\xcf\x42\x0e\x0c\x3c\x58\x1e\xd8\xf8\
\x64\xad\x83\xae\x80\xb5\xc8\xce\x09\xc1\xfc\xf9\x6b\xc0\xc8\xe1\
\x3d\x7b\x31\xf9\xc2\x01\x1e\x10\x56\xa7\xc8\x06\x8e\xdd\xe1\x9c\
\x4d\x6a\x96\x62\x5d\xb6\x2b\x9b\xd6\x07\xb5\x07\x00\x02\x8f\xad\
\xab\x4b\x13\x60\x34\x51\x4e\x57\xdd\x6d\x83\xab\x8e\x36\xfb\xae\
\x7e\x72\x75\xdb\xfd\xb4\xc7\xad\x09\x18\x9a\x96\xe1\x56\x1b\xed\
\x7e\x20\x2b\x57\xd5\xab\x5c\xe7\x42\x53\x1f\xc3\xaa\xce\xc6\x44\
\x78\xf0\xa9\xa7\x59\xf3\x4a\x8f\x4b\xe0\x51\x20\x03\xc8\xb1\x17\
\x5e\xb8\x46\x08\x11\x73\xf7\x43\xf6\x6e\x7c\xd2\x44\x65\x68\x21\
\x36\x08\xab\x54\x17\xea\x1d\x36\x3b\x9e\xdf\x0f\xd1\x07\x0f\x75\
\x03\xdc\xcf\xc5\x70\x5c\x58\x02\x20\x89\x20\x01\x24\x59\xc8\xdf\
\x03\xb0\x95\xa3\x69\x9c\xcb\x73\x01\xa5\x4e\x31\xeb\xc4\x55\x4f\
\x9b\xfd\x36\xa0\xd1\x27\x16\x7b\x8c\xbd\x7e\x89\x2f\x34\x59\xf1\
\x72\x5d\xeb\xdc\x22\xb1\x43\x85\x29\x4c\x96\xc9\xf5\xf6\xb1\x67\
\xb7\xe1\xc0\xa4\xe7\x09\x5e\x00\x04\x4c\x09\x60\x1d\x00\x44\x00\
\xf0\xae\xdb\x6e\x3b\xf4\x8d\x28\x7a\x1c\x49\x72\x81\xbd\x92\xb5\
\xfb\xd7\x1b\x70\xea\xc5\x17\x59\x3e\x85\xcb\xb4\x0a\xd9\x8e\xa5\
\xa1\x3c\x11\x21\x25\xf4\xc7\x3f\x9c\x83\x95\x97\x61\xca\xba\xca\
\x4c\x11\x61\x9c\x08\x13\x44\x38\x9c\x85\x29\x00\x5d\x00\x3d\x94\
\x60\xb0\x1d\x33\xfd\xf1\x90\x28\x0b\x1d\x00\xa3\x00\xe6\x01\x98\
\x9f\x05\xfd\x6b\x61\x79\x9f\x7d\x8f\x96\x00\xf5\x8f\x97\xd4\x3d\
\xba\xe2\x13\x97\x52\xbb\xf2\xdb\x00\x25\xd0\x82\xae\xa8\x95\x34\
\xce\x2f\x19\x12\xb3\xd8\x65\x59\xf6\x08\x19\xd0\x38\x26\xec\x7b\
\x37\x3c\x69\x3c\xa0\x98\x9f\x6f\x80\xec\x15\xdb\x74\xfb\xd8\xe6\
\x54\x65\x90\x7f\xdb\x07\x22\x8a\x56\x22\x49\x2e\xd0\x07\x93\x00\
\xec\x5a\xf7\x38\xd3\x19\x9b\x21\x02\x26\xa4\xf9\x14\x86\x10\x81\
\xd5\xf9\x24\x29\x9e\xab\xf2\x2a\xbd\x2f\x4f\x08\x28\x22\xec\x55\
\x0a\x7b\x94\xc2\x3e\xa5\x70\x80\x08\x3d\x98\x8f\xed\xfb\xa8\x94\
\xb4\xa0\xe7\x4d\xa1\x0a\x9e\x3c\x1e\x02\x18\x03\xb0\x28\x0b\xc7\
\x64\x21\xb4\x94\xcb\xf5\xc4\x2e\x07\x86\xb6\xac\xe2\x2a\x3f\x4c\
\x16\xe1\x94\xd3\x30\x4f\x2d\xc0\x34\x66\x96\x96\xec\x6f\xf4\x49\
\x08\x0b\x04\xa9\x7e\xb9\x4d\xfa\x2a\x93\xfc\x72\xc3\xc6\x02\x20\
\x39\x28\x2a\xed\x00\x2b\xf3\xf1\x28\x00\x12\x75\x3a\xf7\xca\xa9\
\xa9\x7f\x0b\x98\x17\x71\xcf\x13\x1b\x91\xc4\x09\x22\xdb\xc6\x0b\
\x03\x08\x1d\x0c\x81\x05\x06\x1b\x14\x5a\x10\x39\x8b\x68\x27\xde\
\x94\x29\x0e\x2b\x85\x6d\x52\x62\x67\x06\x8c\x04\x26\x20\xa0\xc5\
\xed\x2f\xb6\x0c\x23\xf4\x90\x02\x68\x2f\x8c\x3b\xae\x58\x08\xe0\
\x58\x00\x4b\x00\x2c\x47\x0a\x1a\x9b\x51\xf4\x8b\xa0\xf7\xb3\x4e\
\x06\x65\x11\x7b\xbf\x09\x38\x02\x26\x34\xf1\xe7\x5c\xcc\xe2\x64\
\x18\x2e\xb8\x1c\x78\xdb\xbc\x8a\x78\xfd\x22\x5d\xff\x32\x27\xfe\
\x81\xcd\x5b\x70\xc3\x83\xab\x71\x5f\xc6\x20\x3a\x38\x2c\xf6\x40\
\x08\xdc\x97\x8f\x49\x01\x90\x91\x53\x4e\xb9\x67\xea\xd7\xbf\x2e\
\xbf\x07\x9c\x89\x8c\x63\xec\xde\xb0\x11\x27\x9d\x7b\xb6\xc3\x94\
\xd2\xc1\x10\x30\x5b\xde\x66\x74\x99\x59\x1c\x53\x74\x95\xc2\xa6\
\x24\xc1\x66\x29\xb1\x4f\xa9\x8a\xf2\xeb\xc2\xf9\x51\x9c\xa2\x73\
\xe9\xae\xb2\x75\x41\x01\xd8\x0f\x60\x1f\x4a\xd0\x74\x90\x02\xe5\
\x78\x00\x27\x64\xf1\x26\x8a\xdc\x46\xda\x02\xc3\xde\xf7\xc5\x5d\
\x8a\x9c\x83\x82\x53\x78\xce\x14\x73\xd5\x51\xc4\x5b\x30\x8b\x0f\
\x14\x3a\xab\xe4\xf1\x3d\xdd\x2e\xfe\x65\xcd\x5a\x7c\xe3\xe1\x47\
\xb1\xe1\xf9\xdd\x46\xbb\xd0\xfa\xa2\xcc\xad\x0a\x80\x5f\xe6\x63\
\x51\x00\xe4\x7d\xbf\xfe\xf5\x96\x6f\x74\x3a\x9b\x64\x1c\x9f\x01\
\x98\x8a\xb6\xe3\xa1\x47\x71\xd2\x79\xaf\xe2\x6d\x3b\x3d\x04\x1c\
\x48\xc2\x8c\x6d\x4c\xd4\x8b\x20\x80\x50\x8a\x05\x84\x20\x82\x20\
\xc2\x73\x52\xe2\xd7\x71\x8c\x67\xa5\x2c\x9c\xe8\x26\xc0\xb0\xd3\
\x07\x01\x42\x9b\xb2\x7a\x98\x02\xb0\x15\xc0\x16\x94\xa6\xd9\x09\
\x00\x4e\x02\x70\x32\xdc\x80\xf1\x89\xaf\xfc\xb0\x58\xc4\x60\x8d\
\x4c\xe9\x0d\x50\xe8\x8a\x9c\x9b\x54\x0c\x60\x02\x1f\x50\x5a\x9a\
\x59\x02\x48\x9d\x73\x0b\x1c\xc4\x00\x24\x16\x02\x3f\x7f\x76\x2b\
\xbe\xb5\xf1\x29\xfc\x64\xd3\x66\xc4\x99\xa5\xc2\x81\x82\x31\xad\
\x00\xe0\x89\x2d\xc0\x73\xf9\x78\x14\x00\x01\x00\x84\xe1\xed\x94\
\x01\x44\x97\xed\xbf\x5a\x8d\xd7\x7d\xe4\x43\x4e\x36\xb0\x3b\x2d\
\xec\x74\x1b\xf5\x51\x08\x24\x19\x40\x2c\x16\x51\x44\xd8\x10\xc7\
\x58\x1b\xc7\x05\x5b\xe4\x32\x08\x63\xd4\x29\x7c\xdd\x71\xc3\x30\
\xcd\xb6\x00\x78\x06\x25\xc3\xbc\x0c\x29\x58\x4e\x03\xb0\x0c\xfd\
\xb1\xc9\x30\x59\xc4\x06\x47\x13\x16\xa9\x5b\xdd\x62\x4d\x30\x47\
\xbd\x3e\x33\xab\xa2\x3f\x9a\x4e\xa9\x30\xc0\xca\xfd\xfb\xf1\x9d\
\xed\x3b\x70\xd3\x96\xad\x78\x7e\x6a\xaa\xd2\x1e\x07\x0a\x86\x3d\
\x40\xc0\xed\xfa\x58\x19\x00\x09\x46\x47\x7f\x8e\xcc\x0f\xd1\x65\
\xdf\xd3\x9b\x31\xb1\x67\x1f\x16\x2e\x5e\x54\x05\x43\xe0\x00\x42\
\x11\x8f\x80\x30\x02\x45\x09\x84\x01\x94\x08\x48\x64\x01\x0e\x49\
\x84\xb5\xbd\x1e\x1e\xe9\xf5\x30\x41\xe6\xef\x65\xbb\x40\xc0\xe5\
\xeb\x69\x9c\x29\x36\x0c\xd0\xb8\xd2\x39\xd3\xcb\xc7\x30\x4f\x01\
\x78\x32\x2b\x37\x1f\xc0\x29\x00\x4e\x05\xf0\x72\xa4\xfe\x4c\x5b\
\x93\x6c\x10\x16\x31\x94\xdd\x72\xca\x2b\x2c\x02\x1e\x14\xb6\xaf\
\x62\x83\xa1\xd6\x04\x73\xdd\x58\xcc\x9d\xf3\x28\x4a\x43\x18\x42\
\x06\x01\xee\x9f\x98\xc0\xf7\x9f\xdd\x8a\xef\x3f\xff\x3c\xb6\x4e\
\x16\x5f\xaf\x02\x50\x5e\xa7\x26\xa0\xd0\xb7\x00\x7e\xae\xd7\x63\
\x00\x64\xd1\x79\xe7\xdd\xbe\x6f\xe5\xca\x2e\x29\x35\xaa\x37\x42\
\x44\xd8\xba\xf2\x41\x9c\x7b\xd5\x6f\x54\x59\x83\xb1\x09\x0b\x16\
\x89\x22\x20\x4c\xac\xf2\xd9\x49\x46\x09\x44\x12\x80\xe2\x04\x6b\
\x7b\x3d\x3c\xd8\xed\x7a\x81\xd1\x54\xda\x02\xc3\x97\xd7\x86\x21\
\xda\x96\xb7\x41\x34\x81\xf4\xd9\x86\xf5\x59\xda\x42\xa4\x40\x79\
\x39\x80\xd3\xe1\x06\x0c\x1c\xe9\x75\x69\x2e\x70\x70\x80\x70\xc6\
\x75\x16\xe1\x9e\x66\xf0\x2c\x03\x37\x62\x96\x7c\x1b\xa6\xe6\xd5\
\xb8\x10\xf8\xc5\xa1\x43\xb8\x65\xf7\x1e\xdc\x7c\xf0\x20\x9e\x8b\
\x63\xc7\x88\xa4\x92\x8f\x71\x1d\x28\xb4\xed\xe1\x0e\x70\x97\x5e\
\x87\x01\x90\xf7\xde\x7f\xff\xf8\xd7\x47\x46\xee\x56\xbd\xde\x6f\
\xd8\x8d\x6d\xb9\xe7\x3e\x9c\xf3\xdb\x57\x65\x2b\x57\x1e\x93\xca\
\x60\x8e\xa4\xa4\xc3\x28\x04\x45\x11\x44\x06\x18\x0a\x23\x3c\x95\
\x48\xdc\x33\x31\x81\xfd\x2d\x4d\x29\x2e\xcd\x05\xa6\x7e\x80\xe1\
\xca\x6b\x0b\x84\x36\x65\x6d\xc0\x1c\x40\x7a\x2b\xf7\xe1\x6c\xdf\
\x06\xcc\x49\x40\xb1\xb4\xac\x4b\x1b\x16\x31\x4c\x26\x94\x8a\x5c\
\x61\x0b\x8f\xb9\x65\xa7\x71\x2c\xe2\x5d\x06\xf6\x2c\x1b\x13\x11\
\x1e\x51\x0a\x77\x24\x09\x7e\x3e\x71\x08\xf7\xf7\xba\xe8\xf6\x31\
\x6b\x72\xfe\x86\x03\x24\x77\xec\x04\x0e\xeb\xc7\x9a\x3e\x08\x80\
\x60\x64\xe4\x07\x52\x03\x48\xde\x9f\xe7\x1e\x5b\x8b\xa9\x03\x07\
\x30\x7f\x6c\x8c\x61\x05\x9b\x55\x52\x86\xb0\xcd\xac\x1c\x30\x7b\
\xa4\xc4\x5d\xbb\x9f\xc7\xb3\x93\x53\xb5\x2c\xd1\x0f\x30\x7c\x8a\
\x5f\x97\xdf\x8f\xc2\xd7\x1d\x37\x8c\x60\x03\xa6\x83\xd4\x24\x7b\
\x39\x52\x1f\xe6\x34\xa4\x2c\xa3\x4b\x9d\x79\xe5\x03\x87\x3e\xd3\
\x37\x65\x91\x40\xb8\xcd\x2d\x43\xf9\x39\xb6\x41\xea\xa7\x3d\x26\
\x25\x56\x49\x89\xfb\xa5\xc4\xbd\x52\x62\xff\x90\x7e\x77\x32\x9f\
\x7c\x34\x53\x8a\x5b\xde\xfd\x81\x7d\x5c\x05\x20\x4b\x4e\x3f\xfd\
\x07\xbb\xd7\xaf\xff\x3b\x10\x19\x13\x94\x92\x0a\x9b\x7f\x79\x1f\
\x5e\xf5\xee\xdf\xf4\x80\x22\x2a\xcc\xaa\x94\x59\x22\x03\x2c\xb1\
\x10\x58\xb5\xf3\x39\x3c\xfc\xdc\x73\x90\xcc\x79\xf7\x03\x16\x3b\
\xbf\x0d\x28\x9a\x32\x86\xaf\x4c\xdb\xf4\x36\x2c\xe2\xdb\x9f\x02\
\xb0\x11\xc0\x13\x5a\xda\x18\x4a\x3f\xe6\xe4\x2c\x7e\x12\xd2\xa7\
\x01\x6c\x70\xe8\xce\xab\xa1\xd8\x4d\xfc\x0f\x07\x8b\xb8\xcc\x2d\
\x1d\x68\x79\xda\x24\x80\x27\xa5\xc4\x7a\xa5\xf0\x98\x52\x78\x34\
\x8b\xf7\x30\x7d\xa2\x83\xc4\x06\x4c\x00\xc4\x04\xfc\xc8\x3e\xa6\
\x02\x90\x6b\xd6\xad\xdb\xf5\xf5\x91\x91\xbb\x93\x5e\xef\x6d\x7a\
\xc5\x00\xf0\xd4\x6d\xbf\xc0\xb9\x57\xbf\xdb\x5c\xb2\x8d\x52\x73\
\x49\xe8\xac\x12\x99\x2c\x42\x51\x84\xad\x2f\x1c\xc0\x2f\x1e\x5b\
\x87\x03\x53\x55\xd6\xe8\x97\x25\x7c\xf9\x79\xfa\x20\x6c\xd2\xa4\
\x8e\xb9\xc0\x34\x39\x80\xc6\x91\xfa\x30\xeb\x50\xde\x8f\x11\x48\
\x99\xe5\x24\x00\x27\x66\xe1\x04\xa4\xf7\x67\x96\x03\x58\x8c\xaa\
\xff\x61\x33\x07\xa7\xe8\x15\x00\xa1\x0a\x9e\x43\x44\xd8\x4d\x84\
\x1d\x00\xb6\x29\x85\x2d\x44\xd8\x44\x84\xa7\x94\xc2\xd6\xec\x7d\
\xf0\x99\x16\x7d\xcc\x74\x06\x01\x70\xc7\xc1\xf4\x56\x96\x21\x15\
\x80\x00\x80\x18\x19\xf9\x0e\x34\x80\xe4\xb2\xfb\x89\x0d\x78\x61\
\xeb\x36\x2c\x3d\xe9\x04\x73\x35\x2a\x37\xa7\x74\x16\x89\x12\x50\
\x14\x21\x26\xc2\xbd\x8f\x3e\x86\x75\x9b\x36\xb3\x0a\xc8\x9d\xc0\
\xa0\xf9\x2e\x65\x77\x95\x69\x0a\x8a\x26\xc0\xf0\xe5\x0d\x13\x34\
\x3e\x96\xd1\xe3\x12\xc0\xf3\x59\xe0\x1e\xd9\x1e\x01\xb0\x98\x08\
\x4b\xb2\xed\x22\x00\x8b\x84\xc0\x18\x51\xfa\xec\x99\x10\xe8\x10\
\x21\x82\xe6\x1b\x08\x51\x3c\xec\x39\x85\x94\x0d\x26\x88\x70\x10\
\xc0\x01\x22\xec\x03\xb0\x97\x08\x87\x98\xb1\x9d\x0b\xa2\xb3\x08\
\x50\x8c\xd5\x8d\x5c\x59\x16\x20\xc7\x9c\x71\xc6\x4d\x7b\xd7\xae\
\xfd\xcf\xfa\xef\x17\xe6\xb2\xf1\xa7\xb7\xe2\x0d\x1f\xbb\xd6\x00\
\x02\xcb\x22\x61\x84\x9d\xbb\xb7\xe1\xb6\xdb\xef\xc4\x81\xf1\x89\
\xbe\x4e\xa4\x0d\x8b\xf8\xea\xa8\x03\x84\xab\x5c\xd3\xfa\x06\xc9\
\x9b\x2e\xa6\xd1\x1f\xc0\xf4\x49\x0f\xc0\x9e\x2c\x94\x9d\x25\x3e\
\x7e\x14\x89\xce\x22\x04\x4c\x1c\x66\xfc\x0f\xa0\x60\x17\x53\x7e\
\x67\xcd\x9a\x17\x82\x4e\xe7\x87\xdc\xd0\x3c\x79\xeb\xed\x48\xa4\
\x34\x19\x24\x8c\x0c\x06\x51\x41\x88\x07\x57\xfd\x0a\x3f\xf8\xe1\
\xcd\x38\xe8\x01\x47\x1d\x00\xda\x48\x93\x59\xbf\xae\x7c\xbf\x75\
\xb6\x05\xc6\x74\x81\x83\xbb\xef\xf2\x92\xf0\x62\x8d\xdb\x4d\x48\
\x57\xda\x2b\xc2\x02\x04\x00\xa2\x85\x0b\xbf\x66\x57\x08\x00\x53\
\x07\x0e\x62\xd3\x5d\xf7\x68\x0c\x52\xfa\x1c\x14\x85\x98\x38\x7c\
\x18\x3f\xfa\xd6\x77\xf0\xab\xfb\x57\x42\x69\xb3\xcf\xb0\xc1\xd0\
\xa6\xae\x61\x82\xa6\x69\xd9\x7e\xf3\x87\x09\x9a\xd9\x16\xe7\x5d\
\x72\xf8\x6f\x78\xce\x94\x64\xe3\x44\x00\xbe\xe6\x2a\xe3\x04\xc8\
\x87\xf7\xee\xbd\x33\x88\xa2\x8d\x5c\xde\xfa\xef\xff\x18\x94\xdd\
\xbc\xd1\x81\xb2\xed\xe9\x4d\xf8\xef\x5f\xf9\x6f\xd8\xb1\xe5\xd9\
\x56\x9d\xb4\xe3\xfd\x82\xa9\x8d\x82\x0c\x02\x9a\x36\x8c\xd3\xa4\
\xae\xba\xe3\xfb\x01\xcd\x6c\x88\xbe\x94\x1b\xa2\x74\xde\x43\x2b\
\x04\x4c\x99\xd9\x02\x0c\x01\xeb\x13\xed\xe9\x5d\x5b\x9c\x00\x11\
\x00\x89\xd1\xd1\xbf\xe7\xf2\xf6\x3c\xf9\x14\x76\x3c\xb6\xae\x00\
\x06\x85\x21\x1e\xfd\xf9\x1d\xb8\xe5\xef\xfe\x01\x93\x13\x26\x53\
\x0d\xf3\x62\x4d\x17\x73\x4c\x67\xf9\x26\x0a\x3c\x1d\xa0\x99\x49\
\xb1\x97\x8d\x5d\x8c\x61\x03\xc6\x06\xc9\x6c\x00\x85\x80\xaf\xfa\
\xf2\x9d\x00\x01\x80\x60\xf9\xf2\xaf\x23\x08\xc6\xb9\xbc\xc7\xfe\
\xe5\xa6\x74\x95\x2a\x91\xb8\xe3\xbf\x7c\x15\x2b\xbf\xf7\x3f\xa0\
\x94\x7f\xe1\xae\xdf\x0b\xd7\x06\x0c\x4d\xcb\xf5\x5b\xbe\xee\xb8\
\x41\x98\xa9\x69\xfe\x5c\x01\x47\x1d\x20\xec\x7c\x30\x79\xae\x30\
\x43\x40\xd9\x0f\xe0\x06\x5f\x01\xee\x69\x85\x42\x7e\x74\xe0\xc0\
\xd4\x35\xa3\xa3\x27\x52\x92\xbc\xc1\xce\x3b\xb8\x7d\x07\x96\xfd\
\xab\x33\x71\xd7\x97\xbe\x82\xed\x6b\xd6\x56\x8e\x6d\x32\xfb\x0e\
\x92\xcf\x95\xed\xc7\x14\x19\xd6\x31\x6d\x8f\x6b\x5a\xb6\xae\x1c\
\x97\x3f\x13\x52\x07\x86\x0a\x28\x84\x28\x42\x90\xc7\x1d\xf5\xcc\
\xa0\x8f\xf2\x5f\x01\xdc\xe2\x2b\x50\xdb\x8f\x1b\x4e\x38\xe1\x15\
\x93\xcf\x3f\xbf\x81\x88\x3a\x00\x7f\x71\xc0\xa4\xb5\xc9\x1f\x46\
\x5d\x84\xda\xcf\xb8\xf8\x3e\x12\xd6\x38\xb4\x3d\xbe\x4d\xf9\x61\
\x9c\xc3\x4c\x00\x84\x03\x80\xbe\xe5\xca\x03\xe6\x4d\x44\xbb\xbc\
\x0d\x72\x05\x80\xb2\x9b\x89\xd3\x74\x4e\x5d\x00\x67\x02\xd8\xe6\
\x2b\xe4\x35\xb1\x00\xe0\x0f\x76\xed\xda\x1c\x74\x3a\xdf\x03\xfa\
\xef\xe8\x30\x4f\x70\xd0\xba\x06\x9d\x6d\xdb\x1e\xef\x33\x95\xfa\
\x2d\xeb\x63\x93\xe9\x16\xdf\x4c\xef\xea\x57\x01\x6a\x22\x50\x16\
\xec\xfa\x6c\xf3\xaa\x78\x3e\x2c\x7f\x1f\x64\xf8\xf2\x6d\xd4\x80\
\x03\x68\x00\x10\x00\xe8\x2c\x58\xf0\x45\x98\x5f\xc6\xe9\x5b\xa6\
\x0b\x2c\xc3\x50\xf8\x7e\xfb\xd0\xb6\x8e\x36\xc7\xb4\x05\xd8\x74\
\x4a\x9d\xf9\xd3\x8a\x2d\x39\x90\xe8\x26\x18\xcc\x47\x60\x86\x0c\
\x92\x04\xc0\x5f\x35\x29\xd8\x08\x20\xd7\xee\xdf\xbf\x3e\x88\xa2\
\x9b\x06\xea\x52\x1f\x32\xd3\x0a\x3f\x8c\x19\xb9\x9f\xe3\xdb\xb2\
\xc1\x6c\xb3\x07\x50\x65\x0e\xd7\xcb\x61\x5e\x93\x50\x07\x09\x07\
\x0a\xfb\xa3\x0d\xc3\x93\x1b\x91\xbe\xab\x56\x2b\x8d\x00\x02\x00\
\x9d\x63\x8e\xf9\x4f\x22\x45\x9e\x57\x86\x61\x02\x0d\x4b\x86\xcd\
\x0e\x6d\xeb\x19\xd6\xb1\x4d\xcb\x4f\xa7\xd8\x4f\x03\xeb\xed\xfa\
\x82\x5d\xc6\xe7\x33\x99\xce\xbc\xf5\xf0\xe3\xf0\x58\x24\x06\xf0\
\x7f\x35\x2d\xdc\x18\x20\x1f\xd9\xbb\xf7\x89\x20\x8a\xd8\x25\xb1\
\x99\x9a\xc1\x06\x91\x61\xf5\x71\xa6\xd9\xc5\x3e\x6e\x36\xc7\xda\
\x56\x50\x0e\x08\x75\xc2\x01\xc5\x3e\x2e\x65\x8c\x92\x41\xec\xcf\
\xd5\x0e\x28\x5f\x03\xf0\x74\xd3\xc2\x8d\x01\x02\x00\xf3\x17\x2f\
\x5e\x41\x42\x1c\xae\x2f\x39\x37\x65\x98\x0a\x36\x9b\x4c\x39\x1b\
\x40\xa9\x53\xce\x7e\x4c\xca\xdc\xcc\x2a\xce\xa7\x60\x0b\xad\x5d\
\x7d\xe5\x4b\x0c\x0c\x91\x71\xb4\x60\x0f\xa0\x25\x40\x3e\xbc\x6f\
\xdf\xb6\x30\x8a\xfe\xb6\x55\x97\xe6\xa0\xcc\x25\x90\x1c\x69\x40\
\xb1\xdb\x1e\xd4\xdf\xd3\x59\xc4\x30\xb7\x6c\x93\x6a\x70\x70\x00\
\xc0\x5f\x43\xfb\xa4\x4f\x13\x69\x05\x10\x00\x88\x97\x2c\xb9\x0e\
\x41\x50\xbb\x3c\x36\xd7\x65\xae\x80\x64\x18\x32\x17\xfa\xd0\x8f\
\x70\x00\xa1\x94\x2a\xd2\x02\xe5\x0d\x94\x61\x34\xf7\x0c\x80\x2f\
\xb7\x3d\xa8\x35\x40\xfe\xc3\xee\xdd\x13\xd1\xc8\xc8\xa7\x71\xe4\
\x5e\x17\x00\xc3\x5b\x15\x19\xb4\x9e\x61\xf4\x63\x16\x9e\x5f\x1a\
\x7a\x7d\x05\x83\x90\xce\x26\xd9\x99\x0d\xfe\x4e\x0a\x01\xf8\x8f\
\x48\xdf\xed\x6a\x25\xad\x01\x02\x00\x1f\x9f\x9a\xfa\x4e\x10\x45\
\xbf\xe8\xe7\xd8\xb9\x20\x47\x0b\x38\xe6\xca\x63\xe3\x83\x48\x69\
\x6a\x51\xc5\xcc\x1a\xa2\x09\xf9\x33\x00\xdf\xef\xe7\xc0\xbe\x00\
\x02\x00\xe1\xfc\xf9\x9f\x80\x10\xad\x11\x39\x9b\x32\x4c\x85\x1a\
\xa4\x9e\x41\xfa\x31\x5b\xef\x53\x4c\xbf\xbf\x23\x0a\x13\xcb\xb7\
\x4c\xdc\x87\x1c\x02\xf0\x1f\xfa\xed\x55\xdf\x00\xf9\xf8\xf8\xf8\
\x46\xd1\xe9\x7c\x1e\x70\xaf\x91\xcf\x15\x19\x54\x21\xed\x7a\xfa\
\xa9\xab\xdf\x63\x67\xe1\x01\x3e\x56\xa6\x03\x1c\xdc\x39\x51\x0e\
\x14\x00\xd0\x56\xb8\x88\xa8\x5f\x53\x6b\x05\x80\x4d\xfd\xf6\xb1\
\x6f\x80\x00\xc0\xb9\xbd\xde\x5f\x07\x41\xf0\xd0\x20\x75\xd8\x32\
\x4c\x25\x18\xc6\x4c\x3d\x48\x3d\xfd\x28\x76\x5b\x40\xcc\x24\x78\
\x2a\x2b\x4d\x43\x68\xdb\x5e\xad\x22\x22\xe4\x7f\xaa\xd8\xef\x9b\
\x41\x56\x02\xf8\x7f\x07\xe8\xde\x60\x00\x79\x2b\x90\x60\xfe\xfc\
\x6b\x91\x7e\xdc\x62\xe8\x72\xa4\xcd\xd4\xfd\xd4\x31\x08\x20\x66\
\xcb\xcc\xe2\x14\x75\xa0\xf1\x16\x02\x10\x25\x73\xa8\x8c\x2c\x28\
\xf7\x4b\xac\x07\x1c\x1b\xca\x61\x00\xd7\x62\xc0\x67\x08\x07\x02\
\x08\x00\x7c\xe2\xd0\xa1\x75\x9d\x05\x0b\xfe\xdc\x57\x66\xba\x4c\
\x30\xce\xfc\x69\x7b\xfc\x4c\x02\xc2\x2e\x5f\x77\x4c\xd3\xf2\xb3\
\x01\x18\x9b\x49\xf4\x7e\xd4\x89\x0e\x0c\x7d\x05\xd7\x7c\x24\x85\
\x40\x54\x3e\x01\xdc\x56\x82\x20\xf8\x0c\xb2\xdf\x3a\x1f\x44\x06\
\x06\x08\x00\x7c\xfc\xd0\xa1\xbf\x0d\x3a\x9d\xdb\x86\x51\x57\x9d\
\x0c\xc3\x39\x6e\x3b\xc3\x73\xc7\x0e\x7b\xb6\xef\x07\x0c\xb3\xed\
\xac\x73\xe6\x96\x1e\xf7\x86\xc2\xb4\x12\x59\x5d\xa6\xbf\xa1\x34\
\x70\xb4\x85\x87\x10\xe2\x16\xa5\xd4\x7f\x6d\x79\x18\x2b\x43\x01\
\x88\x00\x68\x6c\xc9\x92\x3f\x10\x41\xd0\xf8\x2e\xe5\x30\x59\xa5\
\xa9\x32\x35\xad\xcb\x3e\x66\xd8\xec\xd0\xa4\xac\x4b\xb1\xfa\x6d\
\x73\x98\x92\xdf\xe0\x73\x99\x5a\xb5\xc0\xd0\x1e\x40\xcc\xeb\x4b\
\x7d\x70\x82\xca\x42\x1e\xef\xc3\xef\xd8\x4e\x44\x1f\x71\x74\xaf\
\xb5\x0c\x05\x20\x00\xf0\x91\xdd\xbb\x9f\x1b\x59\xb4\xe8\xc3\x24\
\x84\x04\x86\xab\xf4\xd3\x61\xbe\xb8\x8e\xeb\xe7\x98\xe9\x00\x43\
\x5d\xfe\x20\xcc\x36\x2c\x71\xf9\x24\x46\xff\xb4\x57\x6d\xed\x37\
\x0a\x4b\x87\xbc\x34\xab\x54\xf6\x16\xa1\xea\x6f\xc5\x2a\x8e\xa2\
\xe8\x83\x00\x76\xf7\x73\x30\x27\xde\x77\xd2\xdb\xca\xcd\xdd\xee\
\xa6\x6b\xc6\xc6\xa4\x8c\xe3\xca\x67\x4b\x81\xe9\x07\x8d\xfd\x7c\
\x50\x93\xe7\x85\xda\x94\xed\xe7\x98\xb6\x65\x7c\xf9\x4d\xf3\xe6\
\xc4\x23\x0e\xb9\x73\xd1\xf0\x31\xf5\xf4\x3c\x68\xa0\x9b\xe6\x41\
\x10\x7c\x56\x4a\xf9\x9d\xfe\x6b\xa8\xca\x50\x01\x02\x00\x37\xc7\
\xf1\xbd\x0f\x75\x3a\xe7\x2b\xa5\xce\x05\x9a\xd9\xde\x5c\xbc\x1f\
\x19\x26\x18\xda\x02\x8d\x3b\x66\x90\x3e\xb6\xcd\x9b\xab\x22\x00\
\x38\x9f\xa5\xca\x4c\xa8\x61\xbc\x77\x2e\x84\xf8\x2e\x11\xfd\xe9\
\x80\xd5\x54\x64\x68\x26\x56\x2e\x02\xa0\xd1\xc5\x8b\xff\x50\x84\
\x61\xf5\x53\x27\xcd\xeb\x60\xe3\x4d\x8e\x1b\x86\xc9\xe3\x2b\x3b\
\x1d\xfe\x42\xdb\xbc\xa6\x61\xb6\xc4\x5c\x8d\x42\xe1\x57\x54\x02\
\x86\x03\x78\x21\xc4\xc3\x44\xf4\xd1\x21\x54\x55\x91\xa1\x03\x04\
\x00\xfe\xd7\xbd\x7b\xc7\x3b\x0b\x17\x5e\x1d\x04\xc1\xae\x3c\x6d\
\x98\x4c\xd1\xb4\xae\x61\xfb\x0a\x4d\xcb\x0d\x13\x0c\xae\xf4\xb9\
\x0c\x90\x19\x96\x1d\x44\xf4\x5e\x58\xbf\x0c\x35\x2c\x99\x16\x80\
\x00\xc0\x1f\x1f\x38\xf0\x4c\xb4\x60\xc1\x7b\xe1\x79\xc1\xaa\x0d\
\x68\x9a\xe4\xf7\xab\xe0\xc3\x64\x85\x41\x14\xde\x97\xd7\x26\xd8\
\x1f\x6b\x3b\x8a\x65\xbc\xd3\xe9\x5c\x8d\xf4\x17\xb7\xa7\x45\xa6\
\x0d\x20\x00\xf0\x89\xf1\xf1\x95\xa3\x0b\x16\x7c\x50\x08\x51\xfb\
\x2e\x3b\x27\x2e\xc5\xf5\xe5\xdb\x65\x44\x2f\xe5\xd9\x00\x00\x07\
\x45\x49\x44\x41\x54\x87\x01\x84\x26\x75\xb5\x51\xf8\xba\xb6\x07\
\x01\x84\xeb\xe3\x6d\x47\xa1\xc4\x61\x18\x7e\x20\x8e\xe3\xa1\x3e\
\xea\x64\xcb\xd0\x9d\x74\x5b\x6e\xe9\xf5\x36\x5c\xbd\x70\xe1\xce\
\xa4\xd7\x7b\x0f\xc0\xbb\x6b\x6d\x94\xbe\x8d\x0c\x6b\x95\x09\x0d\
\xf3\xfb\x39\x6e\x50\xf1\x8d\xd7\x51\x0c\x0e\x15\x04\xc1\x1f\x29\
\xa5\xa6\xfd\x4b\x3b\xd3\x0e\x10\x00\xb8\xa5\xd7\x7b\xf8\x3d\x63\
\x63\x87\x65\x1c\xbf\x03\x0d\xaf\x5b\x1d\x68\xb8\x7c\x81\xc1\x56\
\x90\x30\x60\xfe\x74\x80\x81\x63\xaa\xba\xb2\xd3\x35\xe1\xcc\x11\
\xa1\x20\x08\x3e\xa9\x94\xfa\xc7\x99\x68\x6c\x46\x00\x02\x00\x3f\
\x89\xe3\xfb\xdf\x33\x36\x06\x19\xc7\x57\x42\x63\x92\x61\xfa\x21\
\xba\x4c\xe7\x72\x6b\x93\x7c\xae\x7c\x93\x34\x9f\xf8\xc0\xe2\x1b\
\xcf\xa3\x08\x24\x14\x45\xd1\x9f\x49\x29\x5b\xbf\x3a\xdb\xaf\xcc\
\x18\x40\x00\xe0\x27\x71\x7c\xf7\xbb\x47\x47\x03\x25\xe5\x15\xe8\
\x83\x49\xb8\xb4\x26\x95\x0c\xe3\xde\x83\x2f\xbf\x49\x1a\x27\x75\
\xec\xd0\xd4\x7c\x6a\x02\x8e\xa3\x00\x24\x14\x45\xd1\x5f\x24\x49\
\xf2\x85\x99\x6c\x74\x46\x01\x02\x00\x3f\x95\xf2\xae\xdf\x1e\x1b\
\x83\xca\x98\x24\x4f\x6f\x7a\xc1\xe1\x48\x6b\x6b\x66\xb9\xf2\x7c\
\x32\x9b\x37\xe9\x5c\x63\xe1\x03\xc2\x51\x04\x12\x8a\xa2\xe8\xcf\
\x66\x1a\x1c\xc0\x2c\x00\x04\x00\x7e\x1a\xc7\x77\xff\xb6\xc3\x27\
\x99\x0e\x33\xcb\x95\xd7\xf6\x98\xe9\x94\x26\xe6\x93\x2b\x5e\x07\
\x12\x2e\x3f\x9f\x48\x8e\x00\x51\x41\x10\x7c\x72\x26\xcd\x2a\x5d\
\x66\x05\x20\x00\xf0\xd3\x38\xbe\xff\xdd\x63\x63\xdb\x29\x8e\x7f\
\x0b\x35\xcb\xcd\x83\x9a\x59\xc3\x04\x43\xbf\x26\xd5\xa0\xe6\x93\
\x1e\x6f\x03\x12\x17\x38\xea\xfa\x30\x47\x24\x06\xf0\x47\x44\x34\
\x23\x0e\x39\x27\xb3\x06\x10\x00\xf8\x59\x1c\x3f\xfc\xee\x85\x0b\
\x1f\x53\x71\x7c\x35\x80\xce\x30\xcd\x2c\x5b\x86\xe1\x54\xbb\xa4\
\xad\xa2\x0d\x83\x2d\xb8\xb4\xa6\xa0\xb0\xe3\x73\x94\x4d\x26\x00\
\xbc\x0f\xe9\x2f\xd0\xce\x9a\xcc\x2a\x40\x00\xe0\x67\xbd\xde\x86\
\x77\x2f\x5a\xf4\x0b\x95\x24\xef\x01\xd1\x42\xa0\x3f\x20\x0c\x32\
\x1b\xce\x85\xa5\xd9\x26\xf1\xb6\xe0\x70\xa5\xb9\xf6\xe7\x90\xec\
\x00\xf0\x2e\x00\xbf\x9c\xed\x8e\xcc\x3a\x40\x00\xe0\x67\xbd\xde\
\xb6\xdf\x59\xbc\xf8\xa6\x38\x49\xde\x4e\x44\x27\x0c\x52\x57\x9d\
\xf9\x30\xdb\x33\x65\x1b\x40\xe8\xf1\x7e\xfc\x0c\x2e\x8f\x03\xc7\
\x1c\x33\xbb\x1e\x01\xf0\x0e\x00\x4f\xcc\x76\x47\x80\x39\x02\x10\
\x00\xb8\xa5\xdb\x7d\xe1\xed\xc7\x1e\xfb\xad\x4e\x1c\x9f\xa3\x94\
\x3a\x07\x68\x7e\xaf\xa4\xed\xc5\x9d\xc9\xa5\xd9\x41\x01\xc1\xa5\
\x0d\x6a\x52\xe9\xf1\xba\x30\x83\x42\x48\xcd\xa9\x6b\x00\xec\x99\
\xd9\xa6\xdd\x32\x67\x00\x02\x00\xb7\x4f\x4e\xf6\x7e\xa6\xd4\xf7\
\x56\xcd\x9b\x27\x55\x92\x5c\x09\xcb\x79\x6f\xea\x6f\xcc\x81\x59\
\x10\xc0\xcc\x83\xa3\x09\x50\xda\x02\x64\x86\xd8\x25\x09\x82\xe0\
\x73\x44\xf4\x49\x00\xbd\xe9\x6b\xa6\xbd\xcc\x15\x5d\xaa\xc8\x97\
\x16\x2c\x78\xa7\x9a\x9c\xfc\x26\x29\x75\x42\x3e\xbb\xeb\x8e\xb6\
\x1d\xaf\x4b\x6b\xf2\x43\x98\x76\x5a\x5d\x19\x5f\xf9\x7e\xe3\xf6\
\xd6\x97\x47\x0d\xd2\xec\x38\xb7\x5f\x17\xe0\xd9\x1f\x82\xec\x04\
\xf0\x41\x00\x77\x0d\xa7\xba\xe1\xca\x9c\x62\x10\x5d\x6e\x8d\xe3\
\x4d\x57\x2d\x5b\xf6\x6d\xea\xf5\x2e\x24\xa5\x5e\x99\xa7\xb7\x9d\
\x71\xed\xf8\x20\x32\x2c\x67\xdb\x15\x1f\x64\xdb\xc6\x21\x6f\xc3\
\x22\xf6\xd3\xc1\xbe\x27\x87\xed\xbe\xd4\x89\x48\xbf\x99\x7b\x15\
\x80\xf5\x0d\x0f\x99\x71\x99\xb3\x00\x01\x80\x9f\x1f\x3e\x3c\x71\
\x99\x52\xdf\x1a\x1d\x19\x39\x4c\x52\x5e\x21\x80\x28\xcf\x6b\xea\
\x8b\xb4\xb8\x58\x7d\xef\xcf\x96\x9f\x91\x6f\xfb\x35\xa9\x5c\xe9\
\xdc\x23\xf3\x2e\x60\xf8\xe2\x81\xbb\xae\xc9\x30\x08\x3e\xa3\x88\
\xfe\x37\xa4\xcb\xb9\x73\x56\xe6\xac\x89\x65\xcb\x97\xc7\xc6\x2e\
\x88\x27\x27\xaf\x27\xa2\x0b\x81\x76\x26\x56\xbe\x6d\x63\x4e\xf5\
\x63\x3e\xd5\x99\x48\xfd\x98\x50\x4d\x4c\xab\x61\x9b\x54\x3e\x13\
\xcb\x35\xce\xbe\xb8\x2e\x02\x78\x88\x80\x6b\x63\x60\x9d\xa3\xc8\
\x9c\x92\x39\xcd\x20\xba\xdc\x1a\xc7\xbb\x2e\x07\xbe\x3e\x12\x86\
\x8a\x88\xde\x08\x20\x6a\xca\x22\xae\x32\xfd\xec\x37\xa9\xb7\xad\
\x29\xe5\xcb\x73\x99\x4f\x5c\xde\xa0\xe6\x54\x3f\xe6\x55\x13\x06\
\xc9\xc2\x54\x10\x04\xff\xa9\x4b\xf4\x51\xd5\xf2\x57\x9e\x66\x53\
\x8e\x18\x06\xd1\xe5\xaf\x3a\x9d\xf3\x20\xe5\xdf\x2b\xa5\xde\xe4\
\x63\x0c\x17\x8b\x34\x65\x87\x7e\x98\x64\x3a\xd8\x62\x10\xf6\xe8\
\x97\x41\xe0\xd9\xe7\xc6\xdb\x8e\x5b\xfb\x77\x07\xc0\xbf\x9b\x98\
\x23\xf7\x36\xda\xc8\x11\x09\x10\x00\x20\x40\xfc\x75\xa7\xf3\x11\
\x99\x24\x5f\x24\xa2\xe3\xb3\xb4\x3c\xcf\x0b\x98\x7e\x00\x30\xdb\
\xe0\x68\x02\x14\x1f\x18\x9a\x82\x04\x9e\x34\xd7\xd8\x7a\xe2\xcf\
\x21\x08\x3e\x33\xae\xd4\x37\xad\x22\x47\x8c\x1c\xb1\x00\xc9\xe5\
\x8b\xc7\x1c\xb3\x94\x26\x26\x56\x90\x94\x7f\x4c\xc0\x08\xd0\x0c\
\x28\x33\x09\x8e\x7e\x41\xd2\x96\x3d\xfa\x05\x08\x1a\xa4\xfb\xc6\
\x13\xd5\x78\x17\x42\xfc\x17\x41\xf4\xf9\xfd\xc0\x01\x1c\xc1\x72\
\xc4\x03\x24\x97\x2f\x8c\x8c\xfc\x2b\x24\xc9\x17\x95\x52\xbf\x03\
\x40\xf8\x2e\xa6\x4f\x71\x87\xed\x84\xb7\x05\x49\x5b\x50\x0c\xdb\
\x21\x1f\x10\x1c\x0a\x42\xdc\x14\x10\x7d\x6e\x77\x8b\xdf\x22\x9f\
\xcb\x72\xd4\x00\x24\x97\xbf\x99\x3f\xff\x0d\xdd\x6e\xf7\x2f\x49\
\xa9\xb7\x21\x03\x0a\xc0\x5f\xe0\x61\x82\xa3\x5f\x96\x18\xb6\x49\
\x35\x28\x40\xe0\xd9\x87\x7b\x4b\x10\xe2\xd6\x80\xe8\xcf\x9f\x03\
\x56\xe3\x28\x92\xa3\x0e\x20\xb9\x7c\x71\xde\xbc\x2b\x48\xca\xbf\
\x90\x71\xfc\x36\xca\xce\xd3\xa5\x04\xfd\x30\xc4\x6c\xf9\x19\x4d\
\x00\xd1\x16\x24\xf6\x78\x34\x65\x10\x00\x24\x82\xe0\x56\x15\x04\
\xff\xf7\xce\x24\xb9\xcf\x71\x29\x8e\x68\x39\x6a\x01\x92\xcb\xdf\
\x2c\x5a\xf4\x86\xde\xd4\xd4\x67\x64\x1c\x5f\x4d\xd9\xb2\xb6\x7d\
\xd1\xfb\x35\x9f\x86\x6d\x4a\x0d\xdb\xa4\x1a\xd4\xef\xe0\xd8\x22\
\x8b\x27\x41\x10\xfc\x30\x0c\x82\xeb\x36\x25\xc9\x51\xc5\x18\xb6\
\x1c\xf5\x00\xc9\xe5\xba\xe5\xcb\xcf\xea\x1d\x38\xf0\x27\x24\xe5\
\x1f\x90\x52\x8b\xf5\x8b\x3e\x6c\x70\x0c\xca\x1e\xc3\x02\x48\xdb\
\x80\xba\xb8\x10\x07\x44\x10\x5c\x1f\x45\xd1\x7f\x7e\xb2\xdb\xdd\
\xd4\x78\xf0\x8f\x60\x79\xd1\x00\x24\x97\xaf\x1c\x7b\xec\xe2\xf1\
\x43\x87\x3e\x44\x49\xf2\x71\x29\xe5\xf9\xc8\xfc\x94\x7e\x1c\xef\
\x23\xd5\xa4\x6a\xca\x1a\x94\x47\x85\x78\x24\x08\xc3\x7f\x0c\x93\
\xe4\xdb\x8f\xcf\xf1\x47\x43\x86\x2d\x2f\x3a\x80\xe8\xf2\x85\xc5\
\x8b\x5f\x9f\x4c\x4e\x5e\xab\xa4\xfc\x7d\x52\x6a\xd9\x4c\x38\xe3\
\x83\xb0\xc7\xb0\x01\x02\x4f\x1a\x84\xd8\x0d\xe0\x5f\x28\x8a\xae\
\x7f\x22\x8e\x1f\xee\x73\x88\x8f\x78\x79\x51\x03\x24\x97\x15\xaf\
\x7a\xd5\x48\x67\xf3\xe6\x77\xc9\x38\xfe\xfd\x44\xa9\xf7\xa8\xcc\
\x04\x6b\x0a\x84\x41\xfd\x8c\x36\x80\x70\x81\xa1\x0d\x48\xe0\x4e\
\x7b\x01\x42\xfc\x4f\x0a\x82\xef\x8e\x4a\x79\xeb\x43\xe9\x47\x13\
\x5e\xd4\xf2\x12\x40\x2c\xf9\xca\x99\x67\x8e\x1e\xd8\xb1\xe3\xed\
\x71\x1c\x5f\xa3\xa4\xfc\x2d\xa9\xd4\x29\xd3\xe1\x67\xf4\xc3\x1e\
\x4d\x80\xe0\xca\x87\x23\x5d\x08\xf1\x2c\x01\x3f\xa1\x20\xf8\x51\
\x57\xca\x5f\x3c\x3e\xc7\x5e\x58\x9a\x6d\x79\x09\x20\x7e\x11\x2b\
\x96\x2c\x79\x4d\x6f\x62\xe2\x9d\xa4\xd4\xdb\x15\xd1\xe5\x92\x68\
\x31\xa7\xe8\xfd\x82\xc2\xc7\x10\xd3\xe4\x6f\x1c\x20\x21\xee\x85\
\x10\xbf\x88\xc2\xf0\xe7\xf7\xc5\xf1\xe3\x65\xd6\x4b\x62\xcb\x4b\
\x00\x69\x21\x1f\x07\x3a\xc7\xce\x9f\x7f\xa1\x8c\xe3\xcb\x88\xe8\
\x52\x45\x74\x49\xa2\xd4\xe9\x04\x04\xfd\x82\x62\x9a\xfd\x0d\x05\
\x21\x36\x11\xf0\x2b\x12\x62\x25\xc2\xf0\xbe\x30\x8e\xd7\xdc\x0d\
\xf4\xf5\x73\x14\x2f\x46\x79\x09\x20\x03\xca\x8a\xc5\x8b\x8f\x9d\
\xe8\x76\xcf\x97\x52\xbe\x46\x12\x9d\x47\x44\xe7\x28\xe0\x2c\xa9\
\xd4\x89\x39\x70\xfa\x35\xa9\x5a\xf8\x1b\x0a\x42\x3c\x47\xc0\x46\
\x00\x4f\x90\x10\xeb\x11\x04\x6b\x47\x17\x2c\x78\xec\x96\x03\x07\
\xf6\xcf\xd4\x58\x1c\x8d\xf2\x12\x40\xa6\x49\xfe\xe3\x09\x27\x2c\
\xe8\x1d\x3a\xf4\xf2\x78\x72\xf2\x54\x04\xc1\xc9\x89\x94\x2f\x03\
\xd1\x71\x0a\x58\x0e\x60\xa9\x04\x8e\x51\x44\x0b\x45\x10\x8c\x29\
\xd0\xa8\x52\x34\xa2\xca\x25\x67\x82\x10\x3d\x08\xd1\x95\x4a\x1d\
\x26\x21\xc6\x01\x1c\x94\xc0\x7e\x01\xec\x21\x21\x9e\x07\xb0\x53\
\x09\xb1\x2d\x0a\xc3\xad\xc9\xb2\x65\x5b\x6e\xde\xb9\x73\x5a\x7e\
\x82\xec\xc5\x2e\xff\x3f\x60\x03\xee\xa6\xf7\x30\x87\x41\x00\x00\
\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xcc\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x45\x00\x00\x00\x45\x08\x06\x00\x00\x00\x1c\x8d\x2b\x29\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\
\xbb\x7f\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0c\x09\x02\x26\x35\x4c\x65\x94\xb3\x00\x00\x01\x59\x49\x44\
\x41\x54\x78\xda\xed\xdc\xbd\x4a\xc3\x50\x1c\x86\xf1\xf7\x9c\xa4\
\x51\x6b\x05\xa9\x81\x5a\xa3\x91\x82\xa2\xb5\xe2\xa0\x83\x08\xe2\
\xe6\xe2\xea\x22\xde\x80\x78\x47\xde\x50\x27\x07\x6f\x40\x97\xa8\
\xa5\xe0\xd0\x8f\xa9\x05\x4b\x5c\x62\x39\x8d\x8a\x7b\xf3\x3c\x4b\
\x3e\xc6\x1f\x27\x7f\x92\x21\xc7\xa4\x69\x2a\x9a\xcd\x42\xf0\x33\
\xff\xfb\xa4\xdb\x79\x54\xbf\xf7\x5c\x58\x88\xed\xc6\xa5\x96\xca\
\xe1\x2c\xca\xa0\xf7\xa2\xce\x6b\xbb\xb0\x28\xf5\xe8\x74\x8a\xc2\
\xe3\xc3\x4c\x01\x05\x14\x50\x40\x01\x05\x14\x50\x40\x01\x05\x14\
\x50\x40\x21\x50\x40\x01\x05\x14\x50\x40\x01\x05\x14\x50\x40\x01\
\x05\x14\x50\x40\x21\x50\x40\x01\x05\x14\x50\x40\x01\x05\x14\x50\
\x40\x01\x05\x14\x50\x08\x14\x50\x40\x01\x05\x14\x50\x40\x01\x05\
\x14\x50\xe6\x09\xc5\x5a\x1f\x8d\x3c\x4a\xb0\xb8\x8a\x46\x1e\xa5\
\x9c\xfd\x69\x49\x0e\x4a\x35\x3c\x90\xf5\x4a\x88\xb8\x28\x9e\x17\
\x68\x2d\x6c\x21\x92\xa1\x4c\x37\x3b\x68\xec\x5c\xc9\x18\x03\x8a\
\x7b\x51\x59\xd9\x50\x14\x5f\x80\x92\x1d\xa7\xab\x65\x77\xff\x5a\
\xd5\xb0\x09\x8a\x9b\x31\x56\x47\xc7\x77\xaa\x6f\x9e\x81\xe2\xae\
\x16\x6b\x7d\x35\x0f\x6f\xb5\xd7\xba\x51\x29\xa8\x14\x0e\x25\xff\
\x1a\x9b\x4a\xca\x26\xad\x51\xb4\x75\xae\xda\xfa\x89\xde\xdf\xda\
\xfa\xe8\x3e\x69\x38\x48\x5c\xbb\xb9\xcd\xa4\xbf\x6c\xb5\x13\xc7\
\xf1\x7d\x92\x24\x0f\xf9\xfb\x93\xcf\x91\xc6\xe3\xa1\x26\x93\xd1\
\xdc\x41\x94\x97\x6b\xf2\xbc\x85\xbf\x51\x5c\xb4\x22\xce\x94\xff\
\xbe\x02\xd3\x22\x02\x7d\x01\xd1\x7e\x39\x0e\x65\xd7\xf0\xdf\x00\
\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\x1f\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x4d\x00\x00\x00\x4d\x08\x06\x00\x00\x00\xe3\x09\xe9\xb0\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\x01\
\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xde\x03\x0d\
\x14\x0d\x2a\x24\x10\xc9\xc5\x00\x00\x00\x9f\x49\x44\x41\x54\x78\
\xda\xed\xdc\xa1\x0d\x80\x00\x0c\x00\xc1\x96\x30\x19\x8a\x61\x18\
\x87\x61\x50\xac\x56\x1c\xc1\x90\x50\x04\x41\xdc\xab\xd6\x5e\xaa\
\x1b\xa1\x76\x19\x11\x51\x55\x85\xe2\x21\x58\x66\x0e\x18\xfa\x8d\
\xd7\x65\xdf\x16\x22\x37\x4d\xf3\x7a\xce\x2e\xed\x45\xd0\xa0\x41\
\x83\x06\x0d\x9a\xa0\x41\x83\x06\x0d\x9a\xa0\x41\x83\x06\x0d\x9a\
\xa0\x41\x83\x06\x0d\x9a\xa0\x41\x83\x06\x0d\x9a\xa0\x41\x83\x06\
\x0d\x9a\xa0\x41\x83\x06\x0d\x9a\xa0\x41\x83\x06\x0d\x9a\xa0\x41\
\x83\x06\x0d\x9a\xa0\x41\x83\x06\x0d\x9a\xa0\x41\x83\x06\x0d\x9a\
\xa0\x41\x83\x06\x0d\x9a\xa0\x41\x83\x06\x0d\x9a\xa0\x41\xfb\x3e\
\x7f\x6e\xbb\x60\xfe\xdc\x4a\x7f\xee\x00\xf8\x83\x0b\x95\x79\xae\
\x71\xcc\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xcb\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x45\x00\x00\x00\x45\x08\x06\x00\x00\x00\x1c\x8d\x2b\x29\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\
\xbb\x7f\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0c\x09\x02\x1f\x0f\x84\xed\xc0\xbb\x00\x00\x01\x58\x49\x44\
\x41\x54\x78\xda\xed\xdb\xb1\x4a\xc3\x40\x1c\xc7\xf1\xdf\x35\xad\
\xd8\x56\x07\xab\xa0\x38\x88\x28\x04\x7c\x0d\x1f\xa0\x8f\xe7\xec\
\x4b\xb8\x39\xaa\x93\x20\x15\x95\x0e\x62\xd1\x4a\xd5\xb6\x09\xb6\
\x16\xac\x49\x93\x73\xb1\xd2\xc6\xa8\x7b\xf2\xfd\x42\x20\xeb\x7d\
\xb8\xfb\x1f\x04\x62\xac\xb5\xca\x59\xff\x2e\xb8\xa0\xfc\x65\xbe\
\x9e\x5f\x2b\x4e\x5f\x3a\xed\x53\xf9\x5e\x33\x53\xab\x2f\x95\xaa\
\x5a\x2c\xd7\x54\xa9\xae\x6b\x65\xd5\x55\xb1\x58\x4e\xe2\xa4\xee\
\x9c\x6f\x94\xe1\xf0\x41\xdd\xe7\x8b\xec\x6e\x0f\xe3\xa8\xb6\xb6\
\xa7\x5d\xb7\xae\xa5\xe5\xcd\x24\x8e\x4d\x45\xc9\xfc\x20\xb1\x91\
\xbc\xde\x95\xfc\xfe\x8d\xb6\xb6\xf7\xb5\xe3\xd6\x65\x4c\x21\x15\
\x26\x77\x33\xc5\xda\x58\xf7\xad\x63\x35\xce\x0f\x14\x45\x01\x83\
\x76\x36\xdf\x6b\xea\xba\x71\xa8\x99\xdb\xd7\xe4\x1e\x45\x92\xfa\
\xdd\x4b\x75\xda\x27\x3f\x86\x6f\xae\x51\x24\xe9\xee\xf6\x48\x93\
\xc9\x98\xe3\x33\x5b\x18\x8c\xf4\xf4\x78\x06\x4a\xb2\xde\x4b\x63\
\xee\x08\x81\x22\x69\xf0\xda\x52\x1c\x47\xec\x94\xe4\x35\x1d\x7c\
\x0c\x40\x49\x16\x04\x6f\xa0\xa4\xed\x16\x50\xf8\x74\x00\x0a\x28\
\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x80\x42\xa0\x80\x02\
\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x10\x28\xa0\
\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x10\
\x28\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x64\x28\x33\xfd\
\xd7\x7f\xfc\xee\x2b\x0c\x47\xb9\x85\xa8\x54\x37\xe4\x38\x0b\xf3\
\x28\xc4\xf1\xf9\xb3\x4f\x26\x8a\x60\x43\x1c\xda\xd4\xf1\x00\x00\
\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xae\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x4b\x00\x00\x00\x4b\x08\x06\x00\x00\x00\x38\x4e\x7a\xea\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0b\x0e\x12\x30\x0b\xa2\x4d\x7b\x16\x00\x00\x01\x3b\x49\x44\
\x41\x54\x78\xda\xed\xdb\xc1\x0d\x82\x40\x10\x85\xe1\x7d\x63\x68\
\xcc\x93\x0d\xd8\x82\x27\x8b\xc0\x1e\xbc\xd8\x89\x27\x0b\x33\x46\
\xbd\x2b\x90\x61\x65\x17\x61\xfe\x77\x87\xc0\x97\x37\x0b\x1b\x42\
\x4a\x95\xf3\x9a\x30\x29\xb5\x56\xf3\xda\x55\x03\xa7\xda\xcd\x48\
\x5a\x24\x96\x07\xe9\x76\x3d\x66\x9d\x7b\xbb\x3b\xcf\x02\xa7\x5a\
\x48\xb9\x30\xbf\xe2\x4d\x89\xa6\x25\x23\x79\xe1\xa4\x53\x93\x52\
\xfb\x98\x1d\xab\x0b\xa9\x36\x90\x1f\xed\xb7\x96\x69\x4a\xa8\x7f\
\x40\x2a\x89\xa6\x35\xb5\x69\x0c\x5a\x0e\x98\xd6\xd8\xa6\x52\x60\
\x8a\x02\x35\x05\x98\x22\x41\xf5\xa1\x79\xc1\x14\x11\x2a\x17\x4c\
\x51\xa1\x72\xc0\x14\x19\x6a\x2c\x98\x7b\xd7\xbe\x56\xa8\x31\x7b\
\x5a\xf3\x1c\xb4\x76\xa8\xef\xfb\xdb\x6f\xdc\x63\x18\x09\x6a\xcc\
\x38\x5a\x22\x9d\x0d\xeb\x1a\x47\xa3\x55\xfe\x58\xdf\x58\x46\x85\
\x1a\x6a\x97\x7d\xb4\xea\x49\x7f\x7c\xcd\x12\xe3\x37\xdc\x2e\xa3\
\x55\xf9\x6b\x16\x19\x68\x97\xf1\x04\xa4\x59\x45\xde\xec\x2d\xe2\
\xfe\x2f\x2f\x87\x86\x66\xb9\x37\xd8\x97\xbb\xd5\xfc\xbc\xce\x9a\
\x15\x68\xdd\x02\x2b\xa7\x59\x2c\xee\x8c\x21\x58\x60\x81\x05\x16\
\x58\x04\x2c\xb0\xc0\x02\x0b\x2c\xb0\x08\x58\x60\x81\x05\x16\x58\
\x60\x11\xb0\xc0\x02\x0b\x2c\xb0\xc0\x22\x60\x81\x05\x16\x58\x60\
\x81\x45\xc0\x02\x0b\x2c\xb0\xc0\x02\x8b\x80\x05\x16\x58\x60\x81\
\x15\x36\xe2\x47\x27\x9a\x55\x24\x6f\x48\x6b\xfe\x1e\x49\x1d\x31\
\x1f\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x05\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x4b\x00\x00\x00\x4b\x08\x06\x00\x00\x00\x38\x4e\x7a\xea\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0b\x0e\x12\x2b\x2c\xae\x71\x05\xe7\x00\x00\x01\x92\x49\x44\
\x41\x54\x78\xda\xed\xdc\x31\x4e\xc4\x30\x10\x85\x61\x7b\x93\x96\
\x03\x70\x8b\x3d\x03\x15\x17\x80\x13\x40\xc7\x51\x28\x29\x56\x82\
\x16\x09\xed\x5e\x80\x02\x51\x71\xac\x64\x4d\x65\x14\x45\xe0\xd8\
\xce\x38\xc2\x9e\x7f\x2a\xd7\x9f\xde\x8c\xed\x44\x89\x35\x1b\x97\
\x73\xce\x99\x4a\xcb\x82\xf3\x0f\xb0\x62\x90\x3e\xdf\x1f\xaa\x40\
\xba\xba\x7e\x32\xc6\x18\xd3\x6f\x85\x54\x0b\x4c\xa8\x7a\x90\x36\
\xc4\xfa\x0d\xa9\x25\x20\x31\xac\x39\x54\xab\x48\xab\xb0\x34\xa5\
\x69\x15\x96\xb6\x34\x4d\x6b\x07\x54\x01\x2c\xed\x50\xd1\x58\x40\
\x45\x62\x01\x15\x89\x05\x54\xe6\xcc\xd2\x0e\x15\xc4\x9a\xa6\x0a\
\xa8\x00\x16\x50\x02\xe7\x2c\xb0\x48\x55\x36\xd6\xcf\xc3\xc0\xd7\
\xd3\x17\x3a\x21\x2c\xe7\xdc\xd9\xaf\x2f\x2f\xde\xd0\x09\x60\x59\
\xda\x2f\x12\x6b\x9a\x2a\x8a\xdd\x50\x06\x8b\x1d\x90\x64\x95\xc5\
\x22\x55\x24\x4b\x0e\xab\xa5\xd7\xeb\x24\x0b\xac\xca\xb1\x18\xee\
\x24\x0b\x2c\xb0\xc0\x02\x0b\x2c\x0a\x2c\xb0\xc0\x02\x0b\x2c\xb0\
\x28\xb0\xca\x60\xf9\x4f\x2e\x28\x92\x25\x83\x65\xed\x6d\x0f\x43\
\x74\xb2\x4e\x23\x0c\x19\x6d\xc8\xdc\x62\x66\xc9\x62\x59\x6b\x2d\
\x14\x19\xc9\xa2\x15\x69\x43\x59\xac\x69\x2b\x92\x2e\x92\x25\x8b\
\x45\xba\x12\x93\x35\x8e\xe7\x17\xbf\x3e\x7e\xec\x11\x0a\x61\xf5\
\x7d\x77\xef\xd7\x87\xc7\x3b\x84\x96\x66\x16\xed\xb8\x62\xc0\x03\
\xb6\x80\x35\x3f\xd5\x03\xb6\x90\x2c\xae\x41\x89\x6d\xc8\xfc\x4a\
\x9c\x59\x73\x30\xad\x47\x8a\xa4\x36\xd3\xfa\xcd\xb4\xef\xa8\xa4\
\xeb\x8e\xf6\xa1\x9f\x7c\x37\xd4\x0c\x96\xbd\xdb\x69\xfa\x79\x8f\
\x0f\xc4\xea\xa3\x81\x06\x34\x31\xac\xbf\xc0\x5a\x42\x13\xc5\x6a\
\x1d\xad\x08\xd6\x12\x5a\xad\x78\x45\xb1\x7c\x0d\xc3\xf8\xdc\x75\
\xbb\x66\x9e\xf3\x6c\x78\xf7\xbb\xe9\x9c\x3b\x0e\x35\x63\x7d\x03\
\x22\x66\xc8\x18\xf4\x3d\x95\xb1\x00\x00\x00\x00\x49\x45\x4e\x44\
\xae\x42\x60\x82\
\x00\x00\x04\x39\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x37\x00\x00\x00\x37\x08\x06\x00\x00\x00\xa8\xdb\xd2\x46\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdd\x07\x16\
\x0f\x0e\x23\x92\x9e\x6a\xc3\x00\x00\x03\xb9\x49\x44\x41\x54\x68\
\xde\xed\x9a\x41\x6c\x14\x55\x18\xc7\x7f\xdf\x9b\x9d\x65\xa7\x94\
\x68\x09\xe0\x09\x0f\x26\x46\x4d\x4c\x14\x53\x49\x08\x81\x44\x88\
\xc5\x06\x2d\x9e\x88\xf1\x60\xa2\x37\x0f\x4a\x50\x43\x69\x43\x08\
\x08\x12\x52\x4c\xc0\x44\x0f\xde\xc4\x78\x83\x78\x40\x0c\x12\x0b\
\x46\x88\x3d\x54\x22\x1e\x0d\x11\xf0\x80\x40\x02\xc2\x56\x6d\xbb\
\xdd\xee\xbc\xcf\xc3\xbc\xdd\x4c\xd9\x5d\xdc\xd2\x76\x0e\x2f\xfb\
\x4f\x36\x93\x37\x3b\xb3\xdf\xfc\xde\xf7\xbe\xef\xbd\xf7\xed\xc0\
\xc2\xcb\x00\x05\x77\xac\x2a\x00\x16\xe1\x81\x5e\x00\x14\xf8\x2e\
\x75\x6e\x1b\xf0\x2f\x10\x2e\x74\xaf\x2e\xb4\xc4\x1d\x37\x01\x8f\
\xa7\xec\xe6\xb2\x18\x32\x59\x28\x06\x4e\x02\xdf\x66\x39\x64\x72\
\x19\xd9\x11\xe0\x15\xa0\x0c\xbc\xe6\x86\x29\xbe\x78\x0e\x20\x0f\
\x7c\x08\x7c\xe6\x20\xbd\xd0\x06\x37\x2c\xf3\xae\x7d\x09\x18\x07\
\x4a\x3e\x24\x94\x7b\xf5\x36\xd0\x91\x85\xa1\x20\x03\x1b\x65\xe0\
\x0a\x30\xea\x62\xed\xaa\x6b\x9f\x05\x2e\x64\x15\x7f\x6d\xb5\xd5\
\x96\x67\x5a\x35\xf8\x54\xa6\xc9\x23\xd3\xa9\x20\xd7\x99\xed\xcc\
\x93\x99\xb5\x4d\x43\x1b\x34\x34\xa1\x9f\x70\xb7\xc7\x6f\x61\xc4\
\x53\xcf\xe5\x23\x03\x2a\xf4\x7c\xbc\x5e\xbd\x82\xeb\xd9\xdb\xdb\
\x15\x48\x00\x02\xc5\xd2\x5d\xbf\x3c\x17\x77\xfc\x7d\xa7\xb6\xde\
\x0b\x8c\x5f\x70\x93\xd3\x93\xb5\x0d\xb9\x31\x81\x5f\x70\xe9\x3c\
\x22\x08\x1b\x0f\xad\xf5\x68\xb3\x2a\x33\x9b\xa5\xca\x94\x1f\x65\
\x86\xd5\xfb\x9f\x55\xa9\x83\xb5\xf3\xe9\x9c\x7c\x6a\xdb\x64\x81\
\xe9\xfb\x79\xee\x38\x50\x74\x37\xfc\x01\xec\x98\xd3\x14\x10\x9a\
\x3a\xd7\x89\x08\xdd\x03\xab\x2e\xcf\x03\xdc\x8b\xc0\xa4\xdb\xd9\
\x8f\x03\x47\x9b\x0d\x98\xc0\xc1\xac\x00\x3e\x05\x7e\x03\x5e\x06\
\xfa\x80\xed\xc0\x91\x96\xd2\xfe\xa1\xf5\x5a\xb2\x25\x2a\x76\x1a\
\x11\x49\xa2\xec\x1e\xd7\xa9\x82\x08\x28\x8a\x5a\x30\x18\x0a\x41\
\x07\xc3\x3b\xce\xc9\x2c\xe1\x5e\x22\xa9\xaa\x3d\xe9\x3c\x38\x06\
\xfc\xd9\x08\xee\x75\xe0\x4b\xe0\x11\xe0\xaf\xd4\xf9\xa3\xc0\x1b\
\xf5\x91\x93\xa8\xef\x93\x9e\xfe\x9b\x63\x37\x0f\x9a\x50\x08\x4c\
\x90\x5c\xa4\xd2\xe4\xea\xc6\x4a\x60\x15\x05\xe2\x38\xc6\x96\x85\
\xd1\x3d\xbf\x4a\x8b\x70\x27\x52\xf5\x99\xa6\xa1\xfe\x05\xb0\x19\
\x58\xde\xc8\x7e\xf5\xda\xe7\x07\xbb\xb5\x1c\x8e\x11\x45\x11\x81\
\xe4\x90\x56\x41\xaa\xbf\xa0\xb4\x0e\x2e\xca\x54\x65\x8a\xb1\xe2\
\xc4\xd2\x4b\x43\x57\xef\x36\x81\x3b\x95\x6a\xef\x06\xf6\x35\x4a\
\x28\x2d\x4d\x40\x3f\x1f\xb8\x50\x7b\xb4\xbe\xc3\xbd\x5d\x37\x8a\
\xd7\xef\x04\x05\x6a\x5e\x53\xad\x1f\x86\xf5\x5d\xd4\xf8\x4b\x05\
\xac\xb5\xc4\x71\xcc\xe2\xdc\x12\x7e\xe8\x1f\x69\xb5\xdb\xfa\xdd\
\xf3\x9f\x6b\xe6\xb9\x37\x81\xcf\x81\xc7\x80\x6b\xa9\xf3\x7b\x5d\
\x8f\xfc\xaf\xa1\x8d\x43\xeb\xb4\x54\x99\x40\xc5\x22\x46\x90\x26\
\xb7\xcc\x88\x39\x55\x44\x85\x42\x18\x11\x99\xce\xad\x27\xdf\x3b\
\x7d\x6c\x96\x31\xf7\x0d\x49\x89\xd0\x38\x50\x6d\x04\x17\xba\x80\
\x8c\x48\xaa\xc2\xe7\x81\x77\x5d\xaf\x7c\x04\xec\x9a\x6d\x2a\xeb\
\x1e\x7c\x46\x0b\x0f\xe5\x1a\x7a\xcc\x5a\x65\x64\xe0\x17\x99\x63\
\xb6\xac\x0e\xcb\x71\xd7\xfe\xda\xe5\x87\x46\xd3\x2b\x1d\xc0\x30\
\xb0\x26\x75\xae\x1f\x18\x7a\x50\xeb\x09\x60\x30\xc3\x94\xaa\xf2\
\xd3\xce\x39\x83\x01\x3c\x0a\x6c\x71\xf3\x1b\xc0\xef\xc0\xe9\x66\
\x70\x55\x2d\x03\xba\x5c\x5a\x9d\x98\xeb\x13\xac\x3d\xf8\x9c\x4a\
\x2a\x10\xad\xb5\x8c\x0c\x5c\x9c\x0f\xb8\x07\x5a\xa1\xdc\x76\x9f\
\x79\x91\xa2\xb5\xf8\x53\x05\x43\x36\x8b\x67\x93\x8d\x91\x20\xb5\
\x3a\x51\x16\xb1\xd8\x1f\xb8\x28\x8c\x5c\xa2\x4f\x72\xcb\x99\x81\
\x1f\xc5\x1b\xb8\xef\xdf\x3f\x5f\x83\xa9\xc4\x15\xff\x6a\x28\xb1\
\x8d\x13\xcf\x95\x03\xff\xe0\x6c\xc5\x02\xca\xe8\x9e\x8b\xe2\x1d\
\xdc\xf2\xce\x15\x57\xbc\xfe\xaf\x6a\xf5\x81\xa7\xfd\x2d\xa7\xff\
\x53\x9c\xde\x49\x5b\x6d\xb5\xd5\x56\x5b\xf7\x59\x5e\x92\x54\xd3\
\x14\xb8\x0e\x3c\xe1\x13\xdc\x3b\x6e\xb7\xbc\x95\xa4\xce\x78\x2a\
\x0b\xa3\x59\xbd\xd8\xf6\xb0\x83\x3a\xeb\xbc\x28\x3e\x79\x6e\xa5\
\x1b\x92\x96\xa4\x42\x95\xf7\x2d\xee\x96\x00\x6f\x39\xc0\x61\x9f\
\xc0\x5e\x25\x79\x53\x16\xe0\x03\x3c\x7b\xdf\xeb\x2b\x92\x42\x53\
\x2f\x70\x19\x18\xf1\x09\xae\x13\xb8\x05\x4c\x91\xbc\x67\xb9\x32\
\x0b\xa3\xff\x01\xef\x06\x0c\x5d\x6e\x99\xb2\x53\x00\x00\x00\x00\
\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x25\x7a\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x01\x86\x00\x00\x01\xbe\x08\x06\x00\x00\x00\x97\xa9\xa3\x25\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0b\x06\x00\x1c\x1d\xb5\xbe\xfa\x18\x00\x00\x20\x00\x49\x44\
\x41\x54\x78\xda\xed\xdd\x79\xd8\x1c\x45\x9d\xc0\xf1\xef\x9b\x8b\
\x24\x84\x2b\x90\x10\x20\x2c\x01\x04\x84\x88\x88\xdc\x84\x9b\x84\
\x43\x58\xd7\x93\xc5\x55\xd0\x95\x15\x57\x45\x51\x71\x57\x51\x44\
\x3c\xd0\xec\x7a\xe1\xca\xee\x12\x41\x44\x96\xd5\x15\x51\x14\x14\
\x0c\x01\xb9\x2f\x05\xa3\x42\x40\xae\x10\x20\x40\x80\x10\x20\x90\
\xfb\x78\xf7\x8f\xea\xd7\x4c\x42\xf2\x4e\xcd\x4c\xcd\x4c\x1f\xdf\
\xcf\xf3\xd4\x93\x88\x9d\x99\xee\x5f\x75\xf5\x6f\xba\xba\xba\x0a\
\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\
\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\
\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\
\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\
\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\xc5\xd4\x63\
\x08\x54\x50\x53\x80\x4d\x1b\xd8\x7e\x5a\xf6\x6f\x3a\xed\x24\xe0\
\xe8\x3a\xdb\x7c\x0d\xb8\xdb\x2a\x95\xa4\xd6\xcc\x06\x7a\x1b\x28\
\x2f\x03\xa3\xbb\xb0\x9f\xe7\x46\xec\xdb\xb1\x56\xa7\xf2\x64\x80\
\x21\x50\x45\x8c\x00\xce\x30\x0c\x92\x89\x41\xaa\xf5\x41\x60\x9c\
\x61\x90\x4c\x0c\x52\x9f\x21\xc0\x17\x0d\x83\x64\x62\x90\x6a\xbd\
\x07\x18\x6f\x18\x24\x13\x83\x54\x7b\xce\x7f\xd5\x30\x48\x26\x06\
\xa9\xd6\x9b\x81\x7d\x0d\x83\x64\x62\x90\x6a\x7d\xcd\x10\x48\x26\
\x06\xa9\xd6\x21\xc0\x51\x86\x41\x32\x31\x48\xb5\xbe\x8a\x6f\xff\
\x4b\x26\x06\x55\xc6\x4a\xe0\xd9\x3a\xdb\xec\x0e\x1c\x67\xa8\x24\
\x13\x83\xaa\xa1\x17\x38\x3b\x62\xbb\x2f\x03\x83\x0c\x97\x64\x62\
\x50\x35\x9c\x07\x3c\x56\x67\x9b\x1d\x80\xf7\x1b\x2a\xc9\xc4\xa0\
\x6a\x58\x0a\x7c\x21\x62\xbb\x33\x81\x61\x86\x4b\x32\x31\xa8\x1a\
\xfe\x07\x98\x51\x67\x9b\xad\x80\x8f\x1a\x2a\xc9\xc4\xa0\x6a\x58\
\x09\x7c\x2e\x62\xbb\x4f\x03\x1b\x19\x2e\xc9\xc4\xa0\x6a\xf8\x25\
\x70\x47\x9d\x6d\x46\x02\xff\x6a\xa8\x24\x13\x83\xaa\xe3\xf4\x88\
\x6d\x4e\x05\xc6\x18\x2a\x99\x18\xa4\x6a\xb8\x01\xb8\xa6\xce\x36\
\xeb\xe3\x62\x3e\x92\x89\x41\x95\xbb\x6b\xe8\xad\xb3\xcd\xc9\xc0\
\xb6\x86\x4a\x26\x06\xa9\x1a\xfe\x00\x5c\x56\x67\x9b\xc1\x84\x97\
\xde\x24\x13\x83\x54\x11\x67\x00\xcb\xeb\x6c\xf3\x2e\x60\x57\x43\
\x25\x13\x83\x54\x0d\x0f\x02\x3f\x88\x68\x17\x2e\xe6\x23\x13\x83\
\x54\x21\x5f\x04\x16\xd7\xd9\xe6\x58\x60\x82\xa1\x92\x89\x41\xaa\
\x86\x27\x81\x73\x23\xb6\x73\x31\x1f\x99\x18\xa4\x0a\x99\x0c\xcc\
\xaf\xb3\xcd\x81\xc0\x9b\x0c\x95\x4c\x0c\x52\x35\x3c\x0f\x7c\x3d\
\x62\x3b\x17\xf3\x91\x89\x41\xaa\x90\x6f\x53\x7f\x31\x9f\xdd\x80\
\xe3\x0d\x95\x4c\x0c\x52\x35\x2c\x00\xbe\x12\xb1\xdd\x97\x70\x31\
\x1f\x99\x18\xa4\xca\x98\x02\xcc\xaa\xb3\xcd\x6b\x80\x0f\x18\x2a\
\x99\x18\xa4\x6a\x88\x5d\xcc\xe7\xf3\xb8\x98\x8f\x4c\x0c\x52\x65\
\x5c\x02\xdc\x5b\x67\x9b\x2d\x08\xb3\xaf\x4a\x26\x06\xa9\x02\x1a\
\x59\xcc\x67\x13\xc3\x25\x13\x83\x54\x0d\x57\x00\xb7\xd7\xd9\x66\
\x63\x5c\xcc\x47\x26\x06\xa9\x52\x62\x16\xf3\xf9\x18\xa1\x5b\x49\
\x32\x31\x48\x15\x70\x23\x30\xb5\xce\x36\xc3\x81\x33\x0d\x95\x4c\
\x0c\x52\xb5\xee\x1a\xea\x2d\xe6\x73\x12\xb0\xbd\xa1\x92\x89\x41\
\xaa\x86\xe9\xc0\xa5\x75\xb6\x71\x31\x1f\x99\x18\xa4\x8a\xf9\x3c\
\xf5\x17\xf3\x39\x9e\x30\x5d\x86\x64\x62\x90\x2a\xe0\x21\xe0\xc2\
\x3a\xdb\xf4\xe0\x62\x3e\x32\x31\x48\x95\xf2\x25\x60\x51\x9d\x6d\
\xde\x04\x1c\x60\xa8\x64\x62\x90\xaa\x21\x76\x31\x9f\xc9\x86\x4a\
\x26\x06\xa9\x3a\x26\x03\x2f\xd5\xd9\x66\x02\x61\x19\x50\xc9\xc4\
\x20\x55\xc0\x3c\xe2\x16\xf3\x39\xdb\xb6\x24\x13\x83\x54\x1d\xe7\
\x00\xcf\xd4\xd9\xe6\xf5\xc0\x3f\x18\x2a\x99\x18\xa4\x6a\x88\x5d\
\xcc\xe7\x8b\x84\xf7\x1b\x24\x13\x83\x54\x01\x53\x80\x47\xeb\x6c\
\xb3\x1d\x70\xb2\xa1\x92\x89\x41\xaa\x86\x65\xc4\xcd\x8f\x74\x06\
\xb0\xbe\xe1\x92\x89\x41\xaa\x86\x1f\x01\xf7\xd4\xd9\x66\x0c\x2e\
\xe6\x23\x13\x83\x54\x19\xb1\x8b\xf9\xfc\x0b\x2e\xe6\x23\x13\x83\
\x54\x19\x57\x02\xb7\xd5\xd9\x66\x63\xe2\xd6\x75\x90\x4c\x0c\x52\
\x49\xc4\x5c\xf4\x4f\x01\xb6\x34\x54\x32\x31\x48\xd5\x70\x13\x70\
\x75\x9d\x6d\x86\x01\x5f\x30\x54\x32\x31\x48\xd5\xf1\x59\xea\x2f\
\xe6\xf3\x7e\x60\x07\x43\x25\x13\x83\x54\x0d\x7f\x04\x7e\x52\x67\
\x9b\x41\xb8\x98\x8f\x24\x75\xd4\xec\xec\x57\xfb\xba\xca\xf2\x36\
\x7f\xff\x6b\x08\xef\x37\xf4\xb7\x0f\x2b\x81\x5b\xeb\x6c\xd3\x8b\
\x93\xf0\xc9\x3b\x06\xa9\x14\x1e\x06\xbe\x5f\x67\x9b\x1e\x60\x7f\
\x43\x25\x13\x83\x54\x1d\x31\x8b\xf9\x48\x26\x06\xa9\x42\x9e\x02\
\xbe\x6b\x18\x64\x62\x90\x54\x6b\x32\xf0\xa2\x61\x90\x89\x41\x52\
\x9f\x17\x88\x5b\xcc\x47\x32\x31\x48\x15\x72\x0e\x30\xc7\x30\xc8\
\xc4\x20\xa9\xcf\x42\x7c\x67\x41\x26\x06\x49\x6b\x38\x1f\x98\x69\
\x18\x64\x62\x90\xd4\x27\x76\x31\x1f\xc9\xc4\x20\x55\xc8\x8f\xa9\
\xbf\x98\x8f\x64\x62\x90\x2a\x64\x25\x61\x82\x3d\x49\x92\x24\x49\
\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\
\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x75\x42\x8f\x21\x50\x05\
\x0d\x07\x46\x66\x65\x70\xf6\xdf\x36\xe2\xd5\xb3\x0d\x2f\x07\x5e\
\xce\xfe\xbe\x04\x98\x97\x95\xc5\x86\x50\x26\x06\xa9\x38\x46\x02\
\xdb\xad\xa5\x8c\xae\x49\x06\xc3\x5a\xfc\x8e\x05\x35\x49\x62\x0e\
\x61\xe5\xb6\x35\xcb\x7c\xab\x42\x26\x06\xa9\xb3\xd6\x07\x5e\x07\
\xec\x0a\x8c\xaf\xf9\xfb\xe6\x39\xd9\xbf\xc7\x81\x19\x84\x85\x7b\
\x66\x00\xf7\x66\x7f\x2e\xb1\xea\x64\x62\x90\x5a\x37\x00\xd8\x1d\
\x38\x00\xd8\x03\x98\x90\xdd\x05\x14\xcd\x0a\xe0\x01\xe0\x16\xe0\
\x56\xe0\x6e\xe0\x3e\xa0\xd7\x2a\x96\xa4\xb8\x3b\x82\x37\x03\x53\
\x80\x27\xb2\x8b\x67\x19\xcb\x83\xc0\x39\xc0\x24\x60\x88\xd5\x2e\
\x49\xab\xdb\x12\xf8\x08\xf0\x1b\x60\x51\x89\x93\xc1\xba\xca\x7c\
\xe0\x67\xc0\xfb\x09\xcf\x42\x24\xa9\x92\x46\x03\x1f\x02\x6e\xc8\
\xba\x5a\xba\x7d\x71\x7e\x96\xf0\x1c\xa0\xdb\xfb\xb1\x14\xf8\x35\
\x70\x22\x61\xc4\x94\x24\x95\xda\x30\xe0\xdd\xc0\x35\x84\x21\xa1\
\x79\xfa\xd5\xfe\x3f\x59\x92\xca\xd3\x3e\x2d\x06\x2e\x07\xfe\x0e\
\x18\xe4\xe9\x23\xa9\x2c\x7a\x80\x89\xc0\xa5\x39\xef\x26\x7a\x0f\
\x70\x7a\x8e\xf7\xef\x05\xc2\x73\x97\xdd\x3d\xa5\x24\x15\xd5\x10\
\xe0\xbd\x84\x11\x38\x79\xef\xe3\x5f\x49\x78\xce\xb1\x77\x41\xf6\
\xf5\x06\xe0\xad\xbc\xfa\xc5\x3c\x49\xca\xa5\x2d\x81\xc9\x84\x3e\
\xfb\xa2\x3c\xfc\xfd\x73\xb6\xef\x03\x80\xe7\x0a\xb4\xdf\x4f\x01\
\x67\x01\x1b\x7b\xda\x49\xca\xa3\x2d\x80\x6f\x13\x46\xd8\x14\x6d\
\x54\xd0\xb7\x6b\x8e\xe3\xb2\x02\xee\xff\xb3\xc0\x17\x4c\x10\x92\
\xf2\x62\x3b\xe0\x62\xc2\x68\x9a\xa2\x0e\x17\x3d\xaa\xe6\x78\x3e\
\x50\xe0\xe3\x78\x05\xf8\x0e\xf9\x79\x0b\x5c\x52\xc5\x6c\x06\xfc\
\x7b\x76\x31\x2a\xf2\x3b\x04\x4b\x80\x11\x35\xc7\xb5\x3d\xc5\x7f\
\x2f\xe2\x79\xc2\x83\xf4\x11\x9e\xa6\x92\x3a\x61\x28\xa1\x5f\x7b\
\x01\xe5\x78\xb9\xec\xb7\x6b\x39\xc6\x87\x4a\x72\x6c\xcf\x03\xa7\
\x02\x03\x3d\x6d\x25\xb5\xcb\x89\x84\x49\xe2\xca\xf4\xd6\xf1\xe9\
\x6b\x39\xce\xff\x2a\xd9\x31\x4e\x07\x0e\xf2\xf4\x95\x94\xd2\xb6\
\xc0\xaf\x28\xe7\x74\x14\xfb\xac\xe5\x78\xdf\x51\xc2\xe3\x5c\x09\
\x5c\x04\x8c\xf2\x74\x96\xd4\x8a\x21\x84\xa1\xa7\x45\x7e\xb0\x5c\
\xaf\xab\x65\x6d\xdd\x2c\x1b\x93\xbf\x37\xb3\x53\x95\x17\xb3\xee\
\x25\xdf\x81\x90\xd4\xb0\xbd\x09\xe3\xfb\xcb\x3c\x79\xdd\x4f\xfb\
\x39\xfe\x3b\x4a\x7e\xec\x37\x03\xaf\xf5\x34\x57\x2d\x7f\x2d\x68\
\x5d\x06\x11\x1e\x2e\xdf\x42\x58\x00\xa7\xcc\xae\x6b\xf2\xff\x2b\
\x83\x03\x80\xdf\x13\x26\x32\x74\x7d\x16\x49\xeb\xb4\x2b\x61\xe5\
\xb1\xaa\x4c\x77\x3d\xae\x9f\x58\x1c\x54\xa1\x38\x5c\x0b\x6c\xe5\
\xe9\x2f\xa9\x56\x0f\xa1\xdf\x79\x61\x85\x2e\x86\x0f\xd7\x89\xc9\
\x10\xe0\xe5\x0a\xc5\xe3\x39\xc2\x2c\xae\x92\xc4\x06\xc0\x8f\x2b\
\x74\x01\xec\x2b\x53\x22\x62\x73\x55\xc5\x62\xb2\x12\xf8\x16\x30\
\xd8\x66\x21\x55\xbb\xeb\xa8\x2c\x2f\x73\x35\x5a\xde\x16\x11\x9f\
\x53\x2b\x1a\x9b\xbb\xeb\x74\xb3\x49\x2a\xa9\xf7\x52\xcd\x65\x34\
\x7b\x09\x43\x51\x63\x26\x9c\xdb\xa5\xa2\xf1\xe9\xeb\x5a\x9a\x68\
\x33\x91\xaa\x61\x00\x70\x76\xd6\x6d\x50\xd5\x8b\xde\xef\x22\x63\
\xd5\x43\x98\xda\xba\xaa\x71\x5a\x02\x7c\xd8\x26\x23\x95\xdb\x46\
\xc0\xd4\x0a\x5f\xe8\xfa\xca\x97\x1b\x88\xd9\x45\xc6\x8b\x0b\x09\
\x0f\xe3\x25\x95\xcc\x36\x54\x6b\x28\x6a\x7f\xe5\xe0\x06\xe2\xf6\
\x1e\xe3\x45\x2f\xe1\xbd\x8e\x4d\x6c\x46\x52\x79\xec\x55\xf1\x2e\
\x91\xda\xf2\x72\x83\xbf\x7e\x37\xaf\x78\xb7\x5b\x6d\x79\x08\xd8\
\xd1\xe6\x24\x15\xdf\xc1\x14\x73\x55\xb5\x76\x95\xab\x9b\x88\xe1\
\xbd\xc6\xed\xaf\xe5\x49\xc2\x43\x79\x95\x90\x53\x62\x54\xc3\x5b\
\x80\x6b\x08\xef\x2a\x28\x98\xda\xa1\x7f\x53\x56\x5b\x02\xb7\x02\
\xfb\x1a\x0a\xa9\x78\xde\x41\x79\x67\x45\x6d\xa5\x8c\x6f\x22\x96\
\x47\x19\xb7\xb5\x76\xc9\x1d\x6a\x33\x93\x4c\x0a\x45\x2f\x4f\xd3\
\xdc\x84\x71\x23\x08\x43\x37\x8d\xe1\xea\xe5\x25\xe0\x40\x9b\x9b\
\x94\x7f\xef\xa2\xbc\x6b\x09\xb4\x5a\x7e\xd8\x42\x5c\x7f\x6b\xfc\
\xd6\x5a\x16\x02\x87\xd8\xec\xca\xc1\x67\x0c\xe5\xf4\xe6\xec\xe2\
\xe7\x1a\xbf\x6b\x37\xad\x4b\xff\xb6\xcc\x86\x01\xbf\x24\xac\xdf\
\x21\x29\x67\x8e\xb6\xbb\xa3\xee\x04\x71\x9b\xb7\x10\xdf\x3d\x8d\
\x61\xbf\xe5\x05\xe0\x8d\x36\x43\x29\x3f\xf6\xc6\x21\xa9\xf5\xca\
\xbd\x2d\xc6\x78\x20\x30\xcf\x38\xd6\x1d\xca\xba\xad\xcd\xd1\xae\
\x24\x75\xdf\x8e\x84\xb1\xf9\x0e\x49\xed\x5f\xab\x43\x4e\x57\x10\
\x16\xb4\xd1\xba\x6d\x49\x78\x43\x7a\xb4\xa1\x30\x31\xa8\x7b\x46\
\x67\x49\x61\xa4\xa1\xa8\xeb\xda\x9c\x7c\x46\xd9\x6d\x0b\xfc\x0a\
\x18\x6e\x28\xa4\xce\x1b\x4a\x58\xd0\xdd\x2e\x8c\xfa\x65\x71\xa2\
\x0b\xd5\x38\x63\x19\x5d\x2e\xf5\x07\xa8\xd4\x79\x17\x7a\xf1\x89\
\x2e\x37\x26\x8c\xfb\x4c\xe3\x19\x5d\xce\xb4\x99\xda\x95\xa4\xce\
\x39\x0d\xf8\x47\xc3\x10\x6d\x6a\x4e\x3f\xab\xec\xce\x02\x8e\x33\
\x0c\x52\xfb\x1d\x81\x2f\xb0\x35\x5a\xf6\x4a\x18\xff\xb7\x19\xcf\
\x86\xa7\xce\x18\x6f\xb3\x2d\x86\x1e\x43\x50\x48\xe3\x80\xbb\x80\
\x4d\x0d\x45\xb4\x79\x84\x87\xf4\x2b\x12\x7d\xde\xc6\xc0\x5c\x7c\
\x89\xb0\x11\x0f\x12\x86\x54\xbf\x64\x28\xf2\xcd\xae\xa4\xe2\x19\
\x0c\x5c\x62\x52\x68\xd8\x0d\x09\x93\x02\xc0\x8b\xc0\x1f\x0c\x6b\
\x43\x76\x04\xa6\x18\x06\x13\x83\xd2\xfb\x0a\x30\xc1\x30\x34\x6c\
\x6a\x41\x3e\xb3\xec\xfe\x1e\xd7\x8f\x96\x92\x3a\x2c\xfb\xd5\x6b\
\x9f\x75\xe3\x65\x5c\x1b\xea\xe3\x20\xe3\xda\x54\x59\x04\xec\x6a\
\x73\xce\x2f\x9f\x31\x14\xc7\x48\xe0\xcf\xc0\x56\x86\xa2\x61\x8f\
\x00\xaf\x69\xc3\xe7\x0e\x01\x9e\x27\x4c\xc7\xad\xc6\x4c\x27\x2c\
\xf2\xb3\xd4\x50\xe4\x8f\x5d\x49\xc5\xf1\x3d\x93\x42\xd3\xda\xf5\
\xa6\xf2\x52\xe0\x26\xc3\xdb\x94\xdd\x81\x2f\x19\x06\x13\x83\x9a\
\xf7\x56\xe0\xed\x86\xa1\x69\xd7\x15\xf4\xb3\xcb\xee\x53\xa4\x1d\
\x42\xac\x44\xec\x4a\xca\xbf\x51\xc0\x7d\xc0\x66\x86\xa2\x29\x2b\
\xb2\xd8\xbd\xd8\xa6\xcf\x1f\x4f\xeb\x33\xb6\x56\xd9\x03\xc0\x1b\
\x08\xd3\x95\xc8\x3b\x06\x45\xfa\xa6\x49\xa1\x25\x77\xb7\x31\x29\
\x00\xcc\x00\x66\x1b\xe6\xa6\xed\x04\x7c\xd6\x30\x98\x18\x14\xef\
\xcd\xc0\x09\x86\xa1\x25\x9d\x58\x71\xed\xb7\x86\xb9\x25\xa7\x13\
\x9e\x39\xc8\xc4\xa0\x3a\x86\x01\xe7\x18\x86\x42\x5c\xb4\x7d\xce\
\xd0\x9a\x41\xc0\xb9\xd8\xb5\x2d\xd5\xf5\x25\x1c\xef\x9e\x62\x7e\
\x9e\x21\x1d\xa8\xab\xcd\x09\x4b\x86\x1a\xf3\xd6\x8a\x13\x42\x4a\
\xfd\x18\x07\x2c\xf4\x42\xd1\x72\xf9\x75\x07\xeb\xec\xcf\xc6\xbb\
\xe5\x32\x07\xd8\xd0\xe6\x6f\x57\x92\xd6\x6e\x72\xd6\x95\xa4\xd6\
\x4c\x2b\xe9\x77\x95\xd5\xe6\x84\xe7\x0d\x92\xd6\xe0\x34\x0b\xe9\
\xca\xeb\x3a\x58\x6f\x47\x1b\xef\x24\x65\x09\xb0\x83\x97\x01\x69\
\x75\x37\x79\x71\x48\x52\x9e\xa6\xb3\x0f\x33\x47\x64\x17\x35\x63\
\xdf\x7a\xb9\xd8\xcb\x80\x5d\x49\x5a\xe5\x18\xe0\x40\xc3\x90\xac\
\x6b\xa7\xb7\x83\xdf\xf7\x0a\x70\x9b\x61\x4f\xe2\xdd\xc0\x6e\x86\
\xc1\xc4\xa0\xf0\xeb\xd6\xb9\x63\xd2\x26\x86\x2a\x7c\x67\x59\xaf\
\x4b\xae\x13\x2d\x11\xe6\x43\xb2\x1b\x21\x4d\x59\x09\x8c\xe9\x42\
\x1d\xee\x65\xec\x93\xd6\xa1\xf3\x28\xa9\xf2\x77\x0b\xd3\xbd\x18\
\x24\x2b\x33\xba\x54\x8f\x03\x81\x17\x8c\x7f\xb2\xf2\x73\x2f\x0d\
\x76\x25\x55\xd9\xb1\x84\x89\xc4\x94\x46\xb7\x56\x56\x5b\x41\xfb\
\xa6\xf8\xae\xea\x5d\xb4\xcf\x1a\x4c\x0c\x95\x75\x9a\x21\x48\x6a\
\x5a\x45\xbf\xbb\x8c\x3e\x6e\x08\xba\xd3\x85\xa1\xee\xda\x1b\xb8\
\xd3\x30\x24\xb3\x84\xb0\xda\xdd\xc2\x2e\x7d\xff\x38\xe0\x51\xab\
\x21\x99\xa5\xc0\xb6\xc0\x53\x86\xc2\x3b\x06\x7f\x11\xa9\x59\xb7\
\x77\x31\x29\x00\xcc\x22\x2c\x25\xaa\x34\x86\x00\xa7\x18\x06\x13\
\x43\x95\x6c\x05\xbc\xc3\x30\x24\xf5\x5b\xf7\xa1\x74\x4e\x06\x86\
\x1b\x06\x13\x43\x95\x4e\xf8\xc1\x86\x21\xa9\xa9\xee\x43\xe9\x6c\
\x0a\x1c\x6f\x18\x3a\xc7\x67\x0c\xdd\x33\x90\xd0\xed\x30\xd6\x50\
\x24\x33\x0f\x18\x4d\x18\x1d\xd4\x4d\x1b\x03\x73\xb3\x3a\x56\x1a\
\xb7\x03\xfb\x1b\x06\xef\x18\xca\xee\x28\x93\x42\x72\xd7\xe7\x20\
\x29\x40\x58\x4a\xf4\x6e\xab\x23\xa9\xfd\x08\xeb\x6b\xcb\xc4\x50\
\x6a\xff\x64\x08\x92\x9b\xe6\xbe\xd8\x66\xd4\x3a\xbb\x92\xba\x63\
\x34\x61\x01\x79\x9f\x2f\xa4\xb5\x23\xf0\x50\x4e\xf6\xe5\x30\x5c\
\xf2\x33\xb5\xe7\x08\x03\x36\x96\x19\x8a\xf6\x1a\x94\xf3\xfd\xdb\
\x02\x98\x90\xdd\x42\x6e\x0f\x6c\x97\xfd\xb7\xf5\xb3\x32\x8c\x30\
\x6e\xfd\x15\x60\x01\xf0\x2c\x61\xa8\xe0\x23\xc0\xfd\xc0\x2d\xc0\
\x13\x39\x3c\xae\xe3\x4d\x0a\xc9\xcd\xcc\x51\x52\x20\x3b\xf7\x5e\
\x21\x4c\xc7\xad\x34\x46\x11\xba\x60\xaf\x6c\xe3\x77\x5c\x04\x6c\
\x56\x80\x58\x3c\x03\x9c\x54\xa5\x3b\x98\x83\x81\xf3\xb2\x46\x9e\
\x62\xbe\x95\x59\xc0\x85\xc0\x11\xe4\xe7\x61\xe0\xad\x38\x0f\x4e\
\xea\x72\x5e\x0e\xcf\xe7\x5f\x5b\x2f\xc9\xcb\x25\x6d\xae\xb3\xd9\
\x05\x89\xc3\xac\x2a\x24\x84\x91\xc0\x17\x81\xc7\x69\xff\x9a\xb2\
\xff\x4e\x77\x66\xde\xec\xb3\x0d\x2e\x1c\xdf\x8e\xf2\xf6\x1c\x9e\
\xd7\x1f\xb7\x5e\x92\x97\xf9\xb4\x77\xd9\x5b\x13\x43\x4e\x12\xc2\
\xbf\x01\x2f\x77\x38\xa8\x8b\x80\xff\x20\xac\x31\xdb\x69\x9f\xb2\
\x71\x27\x2f\xcb\x09\x43\x44\xf3\x66\xbc\x75\x53\xb8\x1f\x01\x26\
\x86\x2e\xfb\x87\xac\x9f\xac\x9b\xc1\x9d\x47\x18\xe9\xd0\xc9\x87\
\xf0\xb7\xdb\xb0\x93\x97\xdf\xe7\xb8\x6b\xf4\x69\xeb\x27\x79\xf9\
\x91\x89\xa1\xbd\x89\xa1\x1b\xc3\x55\x47\x66\x7d\xaf\xff\x4b\x18\
\x9d\xd3\x4d\x9b\x00\xe7\x13\x46\x8f\x74\xe2\xee\x61\x0b\x60\x1f\
\x94\x5a\x5e\xdf\x34\xee\x05\xae\xb1\x7a\x92\x3b\x06\x07\x6f\xb4\
\x55\xa7\x13\xc3\xae\xd9\xaf\xbb\x37\xe5\x2c\x0e\x87\x02\x77\x01\
\x7b\xb6\xf9\x7b\x8e\xc0\x21\xc2\xed\x70\xad\xfb\x56\x29\x1b\x02\
\xfb\x1a\x86\xf6\xe9\xe4\x70\xd5\x49\xc0\xe5\x84\x61\xa6\xcd\x58\
\x44\x18\x82\xfa\x20\x61\x08\xea\xcb\x84\x59\x34\x87\x11\x86\x04\
\x6e\x09\xec\x04\xec\x0c\x6c\xd0\xc4\xe7\x8f\x05\x6e\x06\xfe\x1e\
\xb8\xa2\x4d\x31\x38\xd2\x53\x2e\xb9\x57\x80\xdb\x72\xbc\x7f\xd3\
\xb2\x3b\x07\x7f\x10\xa4\x6f\x4b\x37\x1b\x86\x62\x9b\x94\x5d\xd8\
\x1b\xed\x47\x7b\x16\xf8\x26\xe1\x65\xa1\xf5\x1a\x48\x76\xfb\x03\
\x5f\xa6\xb9\x51\x4e\x4b\x80\x37\xb7\x21\x06\x03\x09\xf3\xe7\xd8\
\x47\x9c\xb6\x5c\x55\x80\xf3\xff\x1e\xeb\x29\x79\xb9\xab\x4d\x75\
\x15\xf3\x8c\xe1\x10\x2f\xe9\xad\x3b\xb8\x89\xa4\x30\x13\x38\x81\
\x30\x17\x7b\xab\x5d\x65\x6f\x01\xee\x6d\x22\x39\x1c\x95\x38\x0e\
\x7b\xdb\x98\xdb\x52\x3e\x51\x80\x36\xf0\x2d\xeb\x29\x79\x59\x49\
\x7b\x9e\x0b\x9a\x18\x3a\x60\x1c\xe1\x35\xf6\xd8\xca\x5e\x0a\x7c\
\x2e\x41\x42\x58\xdb\xaf\xf5\x8f\x64\x5d\x4f\xb1\xfb\xf2\x02\xb0\
\x43\xc2\x7d\xf8\x57\x1b\x73\x5b\x4a\x11\xd6\x04\x3e\xd6\x7a\x6a\
\x4b\x79\x87\x89\xa1\x78\x86\x03\x7f\xa4\xb1\xe1\x57\xed\x7e\xf8\
\xbb\x33\x30\xa3\x81\x7d\x9a\x41\x73\xcf\x2b\xd6\xe6\x4a\x1b\x72\
\xf2\xf2\x54\x41\xfa\xee\x87\x03\x8b\xad\xaf\xe4\xe5\x3b\x26\x86\
\xe2\xf9\xcf\x06\x2a\xf8\x4f\x84\xa1\x9c\x9d\x30\x92\xf0\xb0\x32\
\x76\xdf\x2e\x48\xf0\x9d\x03\x08\xef\x4c\xd8\x98\xd3\x96\x8b\x0b\
\xd4\x1e\xae\xb7\xbe\x92\x97\xbb\x4d\x0c\xc5\x72\x00\xf1\xd3\x3e\
\xdc\x47\x78\x9f\xa0\x93\xd6\x27\x0c\x9b\x8d\x3d\x01\x0f\x4b\x70\
\xa7\x62\x43\x4e\x5f\x4e\x28\x50\x9b\xf8\xac\xf5\xd5\x96\x37\xde\
\x37\x30\x31\xa4\xd7\x8e\xf7\x18\x86\x64\xbf\xb2\x63\x6e\xf1\xe7\
\x00\x47\x67\xfd\xf9\x9d\xb4\x20\xeb\xf7\x7d\x34\x72\xfb\xef\x01\
\x43\x5b\x4c\x94\x4a\xab\x97\x62\xad\x79\xe0\xfa\x0c\xe9\x0d\x24\
\x2c\xe0\xa3\x02\x24\x86\x93\x08\xef\x13\xc4\x34\xec\x77\x03\x8f\
\x75\xe9\xd8\x9f\x21\x4c\x7f\xbd\x3c\x62\xdb\xed\x81\x0f\xb6\xf0\
\x5d\x7b\x7b\xaa\x25\xb3\x98\xf0\xa6\xfa\x69\xd9\x0f\x8b\xa2\xf8\
\x03\x70\x16\x61\x66\xdd\xe5\x56\x63\x32\xb6\xad\x02\x58\x8f\xf0\
\xf2\x59\xcc\x6d\xe0\xd7\x73\xb2\xcf\x67\x46\xee\xef\xd3\x34\x3f\
\xab\xe3\xef\xbc\xed\x6f\xba\x2c\xcd\x7e\x6d\x7f\x1a\xd8\x83\x72\
\xac\xa3\x3c\x0c\x98\x08\x4c\x26\x8c\xc7\x5f\x61\x3d\x37\x5d\x7e\
\x6a\x57\x52\xfe\x7d\x38\xb2\x32\x67\x13\x46\x6a\xe4\xc1\x10\xc2\
\xc2\x3e\x31\xfb\x7d\x6a\x93\xb7\xbb\x0b\x6d\xc0\x0d\xbf\xbc\x34\
\x39\xbb\x78\x56\x61\xa1\x9b\xcd\x80\x77\x02\x53\x08\xa3\xf3\x3c\
\x07\xe2\xcb\x5f\x4c\x0c\xf9\x17\xfb\x86\xe7\x89\x39\xdb\xef\xb7\
\x47\xee\xf7\xfd\x4d\x7c\xf6\x4e\x36\xde\xa8\x61\xa7\x53\xb2\x8b\
\xe3\x16\x36\x23\xb6\x03\x4e\x06\x2e\x25\x3c\x7f\xf3\x1c\xe9\xff\
\x01\xf4\x70\x13\x43\x7e\xed\x13\x59\x91\x8f\xd0\x9d\x59\x5d\xfb\
\xd3\x43\x18\x1d\x15\xb3\xff\x13\x1a\xfc\xec\x77\xda\x78\xd7\xba\
\x1e\x46\x6d\xf7\xd0\x00\x9b\x4f\xbf\x77\x9c\x7b\x64\xb1\x9a\x46\
\x78\x2b\xdf\x73\x68\xf5\xb2\xa7\x89\x21\xbf\xce\x6b\x63\x77\x4c\
\x27\x9c\x1c\xb9\xff\xdf\x6f\xf0\x73\xcf\xb2\xe1\xd2\x0b\x3c\x00\
\x9c\x4b\x98\xa2\x64\x23\x9b\x4b\xd3\x46\x11\x26\x7a\xbc\x80\x30\
\x70\xc3\x73\x0b\xde\x6b\x62\xc8\xaf\xa7\x22\x02\xba\x38\xc7\x17\
\x85\xe1\x84\x99\x3a\x63\x26\xf6\x6b\xe4\x6d\xdb\x4b\x2a\xda\x58\
\x1f\xab\xe9\x1e\x1a\x65\xf3\x68\x9b\x31\xac\x7a\x3e\x31\xbb\xa2\
\xe7\xda\x57\x4c\x0c\xf9\xf4\x86\xc8\x0a\xfc\x65\xce\x8f\xe3\xff\
\xda\x70\xeb\x7a\x6b\x45\x1a\xe7\x0b\x59\x9f\xf8\xc9\x59\x1f\xb9\
\xba\xa3\xf6\xf9\xc4\xfc\x8a\x9c\x7b\x97\x98\x18\xf2\xe9\x33\x91\
\x15\xf8\x9e\x9c\x1f\x47\xec\x43\xe8\x33\x1a\xf8\xcc\x27\x4b\xda\
\x18\x97\x50\xbe\x61\xa4\x65\x53\x95\x61\xb1\xb7\x9a\x18\xf2\xe9\
\x57\x91\x15\x98\xf7\x11\x27\x23\x89\x9b\xca\xe3\xea\xc8\xcf\x1b\
\x4a\xfc\xd4\x20\x45\x1b\x46\xba\xbe\xa7\x7d\xe1\x94\x75\x58\xec\
\x93\x26\x86\x7c\x8a\xf9\x55\xfc\x60\x41\x8e\x25\x66\xc8\x6d\xec\
\x1b\xb7\x3b\x96\xa0\xc1\x39\x8c\xb4\x1a\xdd\x4e\x45\x1e\x16\xbb\
\x92\xd6\xa6\xac\x31\x31\xb4\xc1\xe8\xc8\xca\xfb\x61\x41\x8e\xe7\
\xfc\x84\x77\x3f\x87\x16\xac\x81\x2d\xcb\x6e\xcb\xcf\x22\xcc\xef\
\x34\xc8\xd3\xbb\x32\x86\xd6\x74\x3b\xdd\x5d\xc0\x6e\xa7\x54\xcf\
\xb5\x4c\x0c\x89\x1a\xfe\xae\x91\xdb\xdd\x57\x90\x98\xdc\xd7\xc0\
\x71\x3f\x5d\x67\x9b\xbc\x8f\xc6\x59\x09\x4c\x27\x2c\x58\x7f\x6d\
\x96\x14\x16\x79\x8d\xac\xa4\xc5\x35\xe7\xc1\x67\x08\x5d\x85\xfb\
\x65\xc9\x62\x22\xf0\x46\xf2\xbd\xf6\xc5\x28\xc2\xca\x8f\xca\x49\
\x62\xd8\xa6\x64\x89\x61\x46\xe4\x76\x7f\x13\xb1\xcd\xa6\x39\x3c\
\xbe\xc7\x80\xa9\xd9\x05\xe0\x06\xc2\x0a\x7b\xd2\x9a\x16\xd4\x24\
\x0a\x08\xc3\x62\x0f\xcc\x92\xc4\x31\xc0\x56\x39\xdb\xdf\x4e\xb6\
\xb5\xeb\xbb\x7c\xac\xa7\x67\x77\x76\xb9\x4e\x0c\xb1\x27\xc8\xa3\
\x05\x69\x10\xb3\x12\x1e\xf7\x66\x39\x38\x9e\x17\x09\xa3\x87\xfa\
\x1a\xb9\xbf\xaa\xd4\x8c\x39\x84\x09\xeb\xfa\x26\xad\xdb\xae\xe6\
\x6e\xe2\x28\xd2\xaf\x8b\xd0\xa8\xcd\xac\xa2\x7c\x25\x86\xb1\x0d\
\x9c\x58\x45\x69\x00\xa9\x8e\xbb\x1b\x77\x0c\x4b\x81\x9b\x6a\x12\
\xc1\x1f\x09\xfd\xc5\x52\x4a\x33\x09\xeb\x94\x7c\x8f\x30\x2c\x76\
\x42\x4d\xa2\xd8\x9d\xce\x4f\x73\xb2\xa9\x55\x92\xaf\xc4\x10\x93\
\xa9\x97\x03\xcf\x17\x24\x26\xf3\x09\xfd\xec\xc3\x12\x1c\xf7\xc8\
\x0e\xed\xf3\x13\x59\x12\x98\x46\x58\xab\xe0\x59\x4f\x6d\x75\xd0\
\x22\x56\xef\x76\x1a\x0b\x4c\xaa\x49\x14\xa3\x3b\xb0\x0f\x23\xad\
\x86\x7c\x25\x86\x98\x35\x0a\x5e\x26\x3c\xcd\x2f\x8a\xf9\x11\xc7\
\x15\x73\xdc\xed\x1a\xeb\xff\x14\xe1\xdd\x91\x6b\x81\x9b\x29\xd6\
\x82\x35\x2a\xbf\xd9\xc0\x0f\xb2\x02\xab\x77\x3b\x4d\x02\x36\x6e\
\xc3\x77\xfa\x5e\x4d\x01\x13\xc3\x92\x82\xc5\x65\x71\xa2\xe3\x1e\
\x92\x70\x7f\x6e\xc9\x12\xc1\xaf\x88\x7f\x40\x2e\xe5\x41\x6d\xb7\
\xd3\x40\xc2\x14\x3a\x7d\x89\xe2\xa0\x44\xed\x64\x3d\xc3\x5c\xbc\
\xc4\xb0\xb8\x60\x71\xe9\x76\x62\x70\x18\xa9\xca\x6a\x05\xe1\x3d\
\x89\xbb\x81\x7f\x23\xdd\xb0\xd8\x21\x86\x36\x5f\x89\xa1\x8c\x62\
\xba\xbd\x62\x4e\xde\x46\x7e\xc5\x38\x8c\x54\x55\x94\x6a\x58\x6c\
\x27\xef\x18\xee\xa0\xbb\xcf\x4c\x1f\x2e\x42\xc5\x5e\x4f\xdc\x0a\
\x5d\x45\x32\x2b\xe2\x98\x6e\x8a\xf8\x9c\xdb\x70\x36\x52\xa9\x15\
\xb1\xb3\xc5\xfe\x24\xd1\xf7\xf9\xe6\x73\x22\x57\x47\x04\x72\x5e\
\xc1\x8e\xe9\xe9\x88\x63\x9a\x1a\xf1\x39\xbf\x5b\xcb\xbf\x5b\x01\
\x5c\x06\x8c\xf7\xd4\x91\x1a\xb2\x4f\x76\x67\xb1\xb6\xf6\xf8\x33\
\x13\x43\x3a\x29\xba\x92\x62\xfa\xbe\x47\x10\xba\x5e\x8a\x32\x32\
\x69\x83\x44\xc7\xbd\x6c\x2d\xff\x6d\x00\x61\x7a\xef\xb7\x13\x86\
\x95\xde\x98\x9d\xec\x57\x13\x86\x9d\x4a\x0a\xc6\x01\x47\x10\xba\
\x95\x0e\xa3\xff\x77\x15\x96\x1a\xae\x7c\x25\x86\x98\xbe\xb6\xc1\
\x84\x71\xc6\x45\x78\x97\x61\x03\xe2\x86\xbe\xcd\x8d\xd8\xa6\xde\
\x68\xac\xd1\x84\x99\x4b\xdf\x99\xfd\xef\x99\xac\xea\x6f\x9d\x9a\
\xdd\x3a\x4b\x55\xb1\x09\xab\x1e\x42\x4f\xa4\xb1\x2e\x56\x13\x43\
\xce\x12\xc3\xec\xc8\xed\xc6\x14\x24\x31\x8c\x89\xdc\xee\xc9\x36\
\x9c\xac\x7d\xfd\xa9\x27\x13\x5e\x0a\xfc\x53\x4d\xa2\xb8\x71\x1d\
\x77\x20\x52\x51\xad\xc7\xaa\x07\xcd\x13\x09\xc3\x58\x9b\x5d\xf0\
\x69\x89\xe1\x2c\x66\x62\x18\x47\x31\xc6\xdf\x6f\x93\xf0\xb8\x97\
\xb6\x58\x37\x7b\x64\xe5\xd3\x84\xf5\xa8\xef\x20\xbc\xc7\x70\x05\
\xc5\x99\x7b\x4a\xea\xd3\x43\x18\x8e\xda\x97\x08\xf6\x27\xac\xb5\
\x9e\x82\x89\x21\x67\x89\x21\xb6\x5f\x7c\x17\xe0\xd7\x05\x88\x49\
\xec\x43\xe1\xc7\x3b\x7c\xb2\x8e\xa8\x69\x50\xe7\xb0\x7a\xb7\xd3\
\x75\x14\xef\x01\xbf\xaa\x61\x2c\xf0\x26\x56\xbd\xcc\xb6\x79\x9b\
\xbe\xc7\xae\xa4\x9c\x25\x86\x7b\x1a\x48\x0c\x45\x10\xbb\x9f\xf7\
\x46\x6c\xb3\xa0\x8d\xfb\x59\xdb\xed\xb4\x14\xb8\x9d\x30\x57\xd2\
\x34\x56\x2d\xb4\x22\x75\xda\x60\xc2\x0b\x6b\x7d\x73\x25\xed\x45\
\x67\xd6\x03\x7f\xc5\xd0\xe7\xcf\x1c\xea\x0f\xf1\xba\xbf\x20\xc7\
\xf2\xa7\x88\x63\x89\x9d\xa4\xee\x1b\x74\x67\x35\xab\x05\x59\x82\
\xf8\x34\xa1\x2b\xaa\xc7\x53\x54\x6d\x32\x80\xb0\xda\xdf\x64\xc2\
\x9a\xe0\xcb\xba\x74\xce\x7f\x34\xd1\xf1\x38\x5c\x95\x74\x6f\x3e\
\x4f\x27\xcc\xc9\xde\x9f\xd7\x66\xb7\x91\xcf\xe4\x38\x1e\x1b\x03\
\xaf\x8b\x3c\xde\x18\xdd\x7a\xd8\x3e\x9c\x55\xdd\x4e\xe0\xb0\x58\
\xa5\xb5\x6d\xcd\x1d\x41\xbd\x61\xa4\x9d\xf2\xbc\xd5\x92\xbf\xc4\
\x70\x5b\x44\x62\x00\x38\x1c\xf8\x51\x8e\xe3\x71\x28\x71\xf3\xc8\
\xdf\x16\xf9\x79\x73\x73\x72\x5c\x0e\x8b\x55\x2b\x5a\x19\x46\xda\
\x29\x73\xad\xa6\xfc\xd9\x33\xf2\x76\xef\xe7\x39\x3f\x8e\x1f\x45\
\x1e\xc7\xde\x91\x9f\xf7\x36\xf2\xbf\x88\xfa\xb2\xac\x0b\x60\x72\
\xd6\xe8\x07\x7b\x3a\x57\xde\x7a\xd9\xb9\xd0\xd7\x3d\xb4\xbc\x00\
\xe7\xf1\x1e\x89\x8e\xdd\xae\xa4\x84\x7a\x08\x5d\x44\xf5\x02\xba\
\x88\xee\x2f\x01\xb8\x2e\xc3\x58\xb5\x6e\x44\x7f\xe5\x39\xe2\x57\
\xa7\x3a\xa8\x00\x0d\x6a\xcd\xf2\x34\x70\x31\x70\x22\xb0\x85\xa7\
\x76\xa5\xba\x87\xfa\xe6\x24\x9a\x5b\xc0\xf3\x76\x9b\x44\x71\x30\
\x31\x24\xf6\xfd\xc8\x0a\x3c\x25\xa7\xfb\x7f\x52\xe4\xfe\x5f\xd4\
\xc0\x67\x6e\x53\xc0\x06\xb6\x66\x79\x04\x98\x92\x75\x43\xb9\x4a\
\x56\x79\x8c\xad\x49\x04\x73\x0a\x7e\x8e\x2e\x25\x5d\xb7\xb8\x89\
\x21\xb1\x03\x22\x2b\xf1\x21\x3a\xbf\x1e\x6c\x8c\x7b\x22\xf7\xff\
\xa0\x06\x3e\x73\x60\x76\xd2\xf6\x96\xa4\x2c\x5f\xa3\xdb\xc9\xc5\
\x51\x8a\x63\xc3\x2c\xb9\x4f\xc9\x92\x7d\x6f\x89\xca\xcc\x84\x71\
\x32\x31\xb4\xc1\x5f\x22\x2b\xf2\xdd\x39\xdb\xef\xb7\x44\xee\xf7\
\x03\x4d\x7c\x76\xd9\x1a\xa1\xc3\x62\x8b\x21\x2f\xc3\x48\x3b\x51\
\xae\x33\x31\xe4\xdb\x27\x22\x2b\xf2\x71\xe2\x56\x40\xeb\x84\xc1\
\xc0\x83\x91\xfb\xfd\xc9\x26\x3e\xff\xba\x12\x37\xc8\x35\xcb\x33\
\xac\x5a\x63\x62\x6b\x9b\x43\xc7\x15\xfd\x39\x41\xb3\xe5\xfb\x26\
\x86\x7c\x1b\xde\x40\x7f\xe5\xe4\x9c\xec\xf3\xe7\x1a\xb8\xe8\x35\
\x33\xaf\xcb\x05\x15\x6a\xa0\xfd\x3d\x9f\xd8\xd0\xe6\x91\xdc\x26\
\x25\xee\x1e\x6a\xa4\x9c\x61\x62\xc8\xbf\x53\x23\x2b\x73\x05\x70\
\x70\x97\xf7\x75\x0f\xe2\x9f\x01\x7c\xb2\xc9\xef\xf8\x4c\x85\x1b\
\x6c\x6d\x79\x05\xb8\x2a\x8b\xe3\xae\x76\x3b\x35\xdd\x3d\xb4\x17\
\x70\x3a\xf0\x5b\xc2\xda\xe4\x9e\x5b\x70\xbc\x89\x21\xff\x86\x36\
\xf0\xeb\xe5\xc9\x2e\x76\x39\x8c\x22\xac\x9d\x1a\xb3\x9f\x8f\xb6\
\xd0\xf5\x75\xb4\x0d\x77\xad\xe5\x65\x56\x3d\x9f\xd8\xc5\x66\xb3\
\x56\x3d\xac\x9a\x5d\x77\x1a\xe1\x99\x8e\xe7\xce\xab\xcb\xce\x26\
\x86\x62\x38\xbc\x81\x4a\xbd\x87\x30\x15\x45\x27\x0d\x23\x4c\x61\
\x1d\xbb\x8f\x93\x5a\xf8\xae\xb1\x36\x5c\x87\xc5\x36\x78\xbe\x94\
\x65\x18\x69\x27\xca\x22\xd2\x0d\x55\x35\x31\x74\xc0\xf7\x1b\xa8\
\xdc\xe9\xb4\x6f\x3a\xde\x35\x6d\x0c\xdc\xdc\xc0\xbe\xfd\x20\xc1\
\x77\xce\xb5\x01\x37\x54\x56\x50\x9d\x61\xb1\x65\x1e\x46\xda\x89\
\x32\x3d\x71\x7d\x98\x18\xda\x6c\x03\xe0\xbe\x06\x2a\x78\x26\x61\
\x11\x8f\x76\xda\x89\xf8\xf7\x15\x7a\x09\xc3\x6f\x37\x4a\xf0\xbd\
\x37\xda\x80\x1d\x16\x9b\x19\xc4\xea\xd3\x4d\x2c\xb3\x7e\x5b\x2a\
\x17\x9b\x18\x8a\x67\x07\xe0\x85\x06\x2a\x79\x09\xe1\x61\x6d\xea\
\xf9\x7a\x06\x00\x1f\x6c\xb0\x8f\xf6\x25\xc2\x8c\xb0\x29\x9c\x6b\
\x03\x4e\xfe\x42\xd3\x77\x0b\xd6\x16\xd6\x03\x7e\x48\x78\xae\x66\
\x1d\xa6\x2b\xff\x62\x62\x48\xaf\x13\xbf\xbc\x26\x12\x56\x6e\x1b\
\xd2\xc0\xbf\x99\x09\x9c\x99\xf5\xb3\x2e\x6b\x31\x21\x1c\x0b\x7c\
\x85\x30\x12\x26\xd6\x32\xc2\x4b\x6f\x57\x25\x8a\xc1\xbb\xc8\xf7\
\xac\xb2\x45\xb5\x13\xe1\x1d\x94\x22\x38\x9c\x30\x9b\xad\xd2\x9a\
\x40\xfc\x6c\xc7\xb1\x89\x61\xab\x3a\xdb\xdc\x41\x3e\xa6\xf9\xbe\
\x1d\x38\xbb\xc8\x95\x77\x4c\x76\x37\xd0\xcc\x0b\x53\x5f\x27\x0c\
\x6b\x8d\x4d\x2c\x03\x81\x7d\x81\x2f\x02\x8f\x35\xf1\x9d\x4b\x81\
\xb7\x26\x3e\xfe\xbf\xf1\x97\x5d\x5b\xca\x47\x0a\xd4\x06\x26\x5b\
\x5f\x6d\x79\xf0\x9c\xfa\xf9\xd3\xec\x02\x1d\xff\x2f\x8a\x7c\xc7\
\x50\x9b\x1c\x2e\x23\x0c\x67\x6d\xc6\x22\x60\x46\xf6\x0b\xf1\x09\
\xc2\xb8\xf8\x85\x84\x11\x46\x23\x08\x33\x81\xee\x44\x18\xfa\xd8\
\xec\xcb\x54\x4b\xb2\x5f\xf7\x97\xb7\xe1\xf8\x1f\xc7\xb7\x81\x53\
\xfb\x65\x76\x67\x57\x04\x77\xd3\xfe\x67\x68\x55\x73\x13\xe9\xdf\
\x85\x8a\xb9\x63\xf0\xfc\x4f\x6c\x8f\x26\x7f\xc5\x77\xa2\x3c\x09\
\xec\xd3\xc6\x63\xff\xb1\xbf\xf0\x92\x97\xf9\x14\x63\xfd\x88\x51\
\x84\x91\x56\xd6\x59\xda\xd2\x8e\x6e\x14\xef\x18\xe8\xfc\x2c\xa7\
\x77\x13\x16\xf5\x99\x96\xc3\x5f\x1e\x7b\x02\x77\xb6\xb9\x3f\x50\
\x69\x6d\x40\xba\x05\x5a\xda\xe9\x10\xf2\x39\xa3\x70\xd1\xd9\xa6\
\x4a\x92\x18\x20\x2c\x74\x73\x04\xf0\x7e\x60\x5e\x97\x8f\xff\x25\
\xe0\x43\x59\xc3\x7d\xba\xcd\xdf\x35\xd5\xd3\xad\x2d\x8e\x74\x1f\
\x2b\x69\x09\x70\xbd\x61\x28\x4f\x62\xe8\xf3\x03\xc2\x70\xd0\x73\
\x08\xcf\x0a\x3a\x7d\x52\xfd\x37\xe1\x55\xfa\xf3\xb2\xdb\xb2\x76\
\x7b\x80\xf0\x02\x93\xd2\x9a\xe4\x3e\x56\xd2\x2d\x84\xe1\xe7\x2a\
\x59\x62\xe8\xbb\x7b\xf8\x04\x30\x8e\xd0\x5f\xf8\x64\x9b\xbf\xef\
\x59\xe0\x9b\x84\xe9\x89\x3f\xdc\x81\xbb\x04\xef\x1a\xda\x6f\x1f\
\xf2\x3d\x73\xeb\x8e\x84\x51\x69\x4a\xeb\x37\x86\xa0\x5a\x89\xea\
\x30\xe0\x7b\x84\x77\x19\x52\x3c\xa0\x79\x9c\xb0\x1c\xe7\x51\x84\
\xa1\xac\xdd\x74\x2c\x3e\x30\x6c\x47\xf9\xdb\x1c\x9f\xd3\x1f\xb6\
\x7e\xda\x52\xc6\x7b\xb9\x6c\x9f\xbc\x4f\x2d\xb0\x15\x61\x15\xaa\
\xf1\xc0\xf6\xc0\x76\xc0\x18\x60\xfd\xac\x0c\xcd\xba\x85\x16\x64\
\xe5\x99\x2c\xa1\x3c\x02\xdc\x9f\xdd\x6e\x3e\x96\xa3\xe3\x59\x9f\
\x30\x6f\xd2\x50\x4f\xbd\xa4\xbe\x0b\x7c\x2c\xa7\xfb\x76\x39\x25\
\x19\x52\x98\x23\x8f\x13\xd6\x53\x97\x4a\xe3\x6a\x7f\xed\x25\x2f\
\x33\x72\x5a\xd7\x03\x09\x03\x2c\xac\xa3\xb4\xe5\xbf\xbc\x8c\xb4\
\xbf\xeb\x46\x9d\xf5\x63\x43\x90\xdc\x2e\xe4\xf3\xe5\xc1\xbd\x09\
\xab\xac\xc9\x36\x64\x62\x50\xbf\x7e\x41\x58\x79\x4b\x69\x4d\xcc\
\xe1\x3e\x39\x1a\x29\xbd\x27\x81\x5b\x0d\x83\x89\xa1\x6c\xe6\x03\
\xd7\x18\x86\x4a\x5c\x84\x4d\x0c\xe9\x5d\x06\xac\x34\x0c\x26\x86\
\x32\xfa\xa9\x21\x68\xcb\x45\x38\x4f\xe7\xf3\x86\x84\xc9\x1c\x65\
\xdb\x31\x31\x28\xca\x15\xf8\x72\x4e\x6a\x9b\x01\xaf\xcb\xd1\xfe\
\x1c\x48\xda\x25\x27\x15\x46\x18\x3a\x0d\x86\x89\xa1\xb4\xe6\xe3\
\x03\xb4\x76\x38\xd2\x7d\x29\xb5\xf3\xb1\x1b\xc9\xc4\x50\x72\x17\
\x18\x82\xe4\x26\xba\x2f\xa5\xb5\x9c\xb0\x8e\xbc\x54\x7a\xd3\x71\
\x4c\x7a\xea\x85\x5b\x86\xe5\xa0\x5e\xb7\xb6\x2e\x92\x97\x2b\xbc\
\x5c\x78\xc7\x50\x15\x17\x1a\x82\xa4\x86\x02\xfb\xe7\x60\x3f\x0e\
\xb7\x2a\xbc\xc3\x36\x31\xa8\x59\xff\x8b\x0f\xa1\xcb\x78\x51\x36\
\x31\xa4\xf5\x04\x61\xc6\x00\x99\x18\x2a\x61\x1e\x30\xc5\x30\x24\
\xd5\xed\x87\xbe\x3d\x84\xf5\x46\x94\xce\x37\x80\x65\x86\xa1\xb3\
\x27\xb1\xba\x6b\x2c\x61\xd2\xbf\x21\x86\x22\x89\x95\x84\x89\x16\
\x9f\xeb\xd2\xf7\xef\x06\xfc\xd1\x6a\x48\x66\x2e\x61\xc2\xbc\x85\
\x86\xc2\x3b\x86\x2a\x99\x0d\x5c\x6a\x18\x92\x9e\xd3\x87\x75\xf1\
\xfb\x7d\xdb\x39\xad\xff\x36\x29\x98\x18\xaa\xea\x1c\x43\x90\xd4\
\x61\x15\xfd\xee\xb2\xe9\x5b\x69\x51\xaa\xac\x5f\xe2\x90\xc4\x54\
\xa5\x5b\x6b\x70\x0c\x23\x0c\x99\xb5\x0e\xd2\x14\x7f\x30\xa9\xf2\
\x76\x05\x56\x78\x31\x48\x56\x76\xec\x42\x1d\x1e\x6e\xdc\x93\x95\
\x05\x84\x67\x45\xb2\x2b\xa9\xd2\xee\x01\x7e\x6e\x18\x92\x99\x54\
\x91\xef\x2c\xab\xff\x04\xe6\x18\x06\x29\x2c\x38\xb3\xdc\x5f\x8b\
\x49\xca\xe5\x5d\xa8\xbf\xbb\x8c\x7b\x92\x32\x1f\xd8\xd4\xcb\x81\
\x77\x0c\x0a\xee\xc3\x69\x85\x53\x39\x98\xb0\xb4\x66\xa7\x8c\x04\
\xde\x60\xd8\x93\xdd\x2d\x3c\x6f\x18\xa4\x55\xc6\x02\xaf\xf8\xab\
\x31\x49\xd9\xaf\x83\xf5\x76\x9c\xf1\x4e\x52\x9e\x04\x46\x78\x19\
\xf0\x8e\x41\xab\x9b\x0d\x7c\xd3\x30\x24\x31\xa9\xa4\xdf\x55\x66\
\x9f\xcb\x7e\x18\x49\x5a\xc3\x30\xc2\x90\x4b\x7f\x41\xb6\x56\x6e\
\xee\x60\x9d\xcd\x32\xde\x2d\x97\x3b\xfd\xb1\x2a\xf5\xef\xdd\x5e\
\x28\x5a\x2e\xcb\x08\x4b\x6c\xb6\xdb\x0e\xc6\xba\xe5\xb2\xb2\xc3\
\x5d\x7f\xb2\x2b\xa9\x90\x7e\x8c\xcb\x18\xb6\x6a\x10\x61\x89\xcd\
\x76\x73\x36\xd5\xd6\xfd\xc4\xf3\xdd\xc4\xa0\xfa\x56\x02\xef\x03\
\x16\x1b\x8a\x96\x1c\x59\x92\xef\x28\xb3\x67\x81\x53\x0c\x83\x89\
\x41\x71\x1e\x04\xce\x36\x0c\x2d\x69\xf7\x43\xe1\x41\xc0\xa1\x86\
\xb9\x25\xa7\xe1\xf0\x54\xa9\xe1\x0b\x8f\x4b\x80\xb6\x56\xb6\x6e\
\x63\xfd\xec\x67\x7c\x5b\x2a\xbf\xb1\x89\x7b\xc7\xa0\xc6\x2d\x07\
\x3e\x4a\xe8\x5a\x52\x73\xda\xf9\x8b\xde\xd9\x54\x9b\xb7\x10\xbb\
\x90\x4c\x0c\x6a\xda\x2d\xc0\x57\x0d\x43\xd3\x8e\x2c\xe8\x67\x97\
\xdd\xa9\xc0\xc3\x86\x41\x6a\xde\x20\xe0\x0e\xbb\x1e\x9a\x2a\xcf\
\xd0\x9e\xd5\x0a\x37\x24\x0c\x89\x35\xc6\x8d\x17\x17\xa7\x92\x12\
\xd9\x9e\x30\xc1\x98\x17\x96\xc6\xcb\x6e\x6d\xa8\x8f\x63\x8d\x6b\
\x53\xe5\x29\x60\x33\x9b\xb3\x5d\x49\x4a\xe3\x11\xe0\x53\x86\xa1\
\x29\x93\x0a\xf2\x99\x65\xd7\x0b\xbc\x97\xb0\x96\xb3\xa4\x44\x7a\
\x80\x9f\xf9\xab\xb3\xe1\x72\x55\x1b\xea\xe2\x1e\xe3\xda\x70\xf9\
\x96\x4d\x58\x6a\x8f\x61\xc0\x1f\xbc\xc8\x34\x54\x16\x65\x71\x4b\
\x65\x6b\x63\xda\x70\xb9\xda\x5e\x0a\xbb\x92\xd4\x3e\x8b\x08\xd3\
\x3c\xbf\x68\x28\xa2\x0d\x05\xf6\x4f\xf8\x79\x4e\x83\xd1\x98\x47\
\x09\xf3\x7f\x39\xec\xda\xc4\xa0\x36\x7a\x18\x38\xc1\x86\xd6\x90\
\x49\x39\xfd\xac\xb2\x5b\x08\xbc\x0d\x98\x67\x28\xa4\xce\xf8\x92\
\x5d\x14\xd1\xe5\x77\x89\x62\xde\x43\x18\x59\x63\x4c\xe3\xca\xfb\
\x6d\xa6\x52\xe7\x9d\xe7\xc5\x27\xaa\xac\x00\x46\x25\x88\xf7\x6e\
\xc6\x32\xba\x9c\x69\xf3\x94\xba\x63\x30\x70\x8d\x17\xa1\xa8\x72\
\x5c\x82\x78\x9f\x66\x1c\xa3\xca\x45\xb4\xe7\xc5\x42\xb5\x99\xcf\
\x18\xca\x61\x19\xf0\x0e\xc2\xf0\x49\xf5\x6f\x52\x4e\x3e\xa3\xec\
\xae\x05\x3e\x90\x25\x08\x49\x5d\xb4\x3d\x61\x31\x75\x7f\xad\xae\
\xbb\xcc\x6c\x31\xc6\x43\x08\x6b\x12\x1b\xcb\x75\x97\x7b\x81\x4d\
\x6d\x8e\x52\x7e\xbc\xc6\xe4\x50\xb7\xec\xd0\x42\x7c\x0f\x33\x7e\
\x75\x93\x82\xd3\x5d\xd8\x95\xa4\x9c\x79\x38\xbb\x78\x3d\x63\x28\
\xda\xd2\x15\x64\x37\xd2\xba\x3d\x40\x78\xbf\xc3\xe9\x2e\x4c\x0c\
\xca\x69\x03\x3d\x12\xc7\x8d\x9b\x18\x3a\x67\x56\x16\x1b\x7f\x90\
\x48\x39\xb7\x1f\xf0\x82\xdd\x1b\xaf\x2a\xf3\x80\x81\x4d\xc4\x73\
\x24\x61\xe1\x24\x63\xb8\x7a\x79\x1c\xd8\xc9\xe6\x26\x15\xc7\xce\
\xc0\x6c\x2f\x5e\xaf\x2a\xfb\x35\x11\xcb\xe3\x8c\xdb\xab\xca\x9f\
\x81\x31\x36\x33\xbb\x92\x54\x2c\xf7\x03\x07\x10\xa6\xec\x56\x6b\
\x5d\x42\x76\x23\xad\xee\x4e\xe0\x10\x60\x8e\xa1\x90\x8a\x69\x5b\
\xe0\x21\x7f\xe1\xfe\xb5\xdc\xd0\x44\x0c\x1f\x31\x6e\x7f\x2d\xb7\
\x67\x5d\x6b\x92\x0a\x6e\x13\xe0\x7a\x2f\x6a\xf4\x12\x5e\x0a\xdc\
\xb0\x81\xd8\xbd\xc6\x98\xfd\xb5\x5c\x02\xac\x67\x73\x92\xca\x63\
\x08\x70\xb1\x17\x37\x7a\x09\x4b\x73\xc6\xfa\x90\xf1\xa2\x17\x38\
\x0b\xa7\xb9\x90\x4a\xa9\x27\x6b\xe0\x55\xbf\xc8\x7d\xa7\x81\x98\
\xfd\xbc\xe2\xb1\x5a\x8a\xb3\xa4\x4a\x95\x70\x12\x61\xd1\x9f\x2a\
\xbf\xa5\x1b\x63\x20\x61\x88\x6b\x95\x87\xf7\x1e\x63\x73\x91\xaa\
\xe3\xf5\x84\xb7\xa5\xab\x7a\xd1\xdb\x3a\x22\x46\xfb\x56\x38\x3e\
\x77\x00\x63\x6d\x26\xd5\xe2\x70\x55\xfd\x19\x78\x23\xf0\x8b\x8a\
\x1e\x7f\xcc\x12\x9d\x55\x1d\xa6\x7a\x3e\x70\x30\xe1\x3d\x18\x49\
\x15\x34\x10\x38\x9b\xea\xbd\xd9\x7b\x71\x44\x6c\xaa\x36\x92\x6b\
\x11\x70\x8a\x4d\x42\x52\x9f\xbd\x80\x07\x2b\x74\x11\x7c\x86\xfe\
\x47\xd9\x6c\x48\x18\xda\x5a\x95\x78\xdc\x46\x78\xe7\x45\x92\x56\
\xb3\x01\x30\xa5\x42\x17\xc3\xdd\xfa\x89\xc5\xb1\x15\x89\xc1\x72\
\xc2\x48\xb5\x41\x9e\xfe\x92\xfa\x73\x22\xd5\x18\x8d\xf3\x89\x7e\
\x62\xf0\xad\x0a\x1c\xff\xe3\xc0\x51\x9e\xee\x92\x62\x6d\x9c\xdd\
\x3d\xac\x2c\xf1\x85\xf1\x37\xfd\x1c\xff\x8c\x92\xdf\x25\x4c\x06\
\x86\x79\x9a\x4b\x6a\xc6\x91\xc0\xa3\x25\xbd\x40\x2e\x60\xed\x53\
\x3c\x8c\x2d\x71\x52\xb8\x0b\x78\x83\xa7\xb5\xa4\x56\x6d\x04\x9c\
\x43\x78\x0b\xb6\x6c\x17\xca\x43\xd6\x72\xbc\x27\x94\xf0\x38\x5f\
\x06\xce\xc0\xb9\x8e\x24\x25\xb6\x35\x61\x98\x67\x99\xba\x97\xbe\
\xb6\x96\xe3\xbc\xa4\x44\xc7\xb7\x8c\x30\x05\x88\x33\xa2\x4a\x6a\
\xab\xc3\x81\x3f\x96\xe4\xc2\x79\xe7\x1a\xc7\xd6\x03\x3c\x55\x92\
\x63\xbb\x81\xf0\x12\xa3\x24\x75\xcc\x44\x60\x7a\xc1\x2f\x9e\x2b\
\x80\x51\x35\xc7\xf4\xfa\x92\x24\x84\x09\x9e\x9e\x92\xba\x65\x00\
\xf0\x4e\x8a\xfd\x72\xdc\x71\x35\xc7\x73\x1a\xc5\x7e\xb0\x3c\xd1\
\x53\x52\x52\x5e\x0c\x25\x4c\xa7\x30\xb3\x80\x17\xd4\xf3\x6a\x8e\
\xe3\xd7\x05\xdc\xff\x3f\x01\xef\x21\x4c\x6f\x22\x49\xb9\xd3\x93\
\xfd\x6a\xbd\xb2\x40\x17\xd6\x59\xd9\xbe\xaf\x47\x18\xc2\x5a\x94\
\x77\x11\x2e\x25\xac\xeb\x2d\x49\x85\x71\x20\xf0\x53\x60\x49\x01\
\x2e\xb4\xdb\x13\x86\xae\xe6\x7d\x3f\x5f\x01\x2e\xa4\xff\xe9\x3c\
\x24\x29\xf7\x36\x02\x4e\x06\x6e\xc9\xf1\x05\xf7\xc3\xc0\x57\x73\
\xba\x6f\x2b\x81\x69\x84\x67\x39\x43\x3d\x9d\x24\x95\xcd\x7e\x84\
\x3e\xfd\xe7\x72\x76\xf1\xbd\x8c\x30\x74\x35\x4f\xfb\xf4\x04\xf0\
\x4d\x60\x57\x4f\x1b\x49\x55\x30\x88\x30\xdd\xc6\x85\xe4\x63\xc2\
\xbe\x97\xc8\xc7\x9a\x14\x4f\x03\xdf\x25\x3c\x3b\x70\x41\x2d\x75\
\x54\x8f\x21\x50\x8e\x0c\x01\x0e\x03\x8e\x26\xcc\xf6\xb9\x63\x85\
\x8e\xbd\x97\xb0\x9a\xde\x6f\x80\xab\x09\xdd\x6d\x2b\x3c\x25\x64\
\x62\x90\x56\xb7\x5d\x76\x37\x71\x24\xe1\x01\x76\xd9\xa6\x73\x98\
\x03\xdc\x08\x4c\xcd\x12\xc2\xd3\x56\xb9\x4c\x0c\x52\xbc\x01\xc0\
\x2e\xc0\x41\x84\xee\x95\x03\x29\xde\x22\xf5\x0f\x67\x77\x02\x37\
\x65\x7f\x3e\x64\xb5\xca\xc4\x20\xa5\x35\x8a\xf0\x40\x76\x3c\xf0\
\xba\xec\xef\x3b\x13\xd6\x90\xe8\xa6\xb9\xc0\xbd\x84\xb5\x1c\xee\
\xc9\xfe\xbc\x17\x78\xd1\x2a\x93\x89\x41\xea\x8e\x91\x84\x6e\xa8\
\xda\x32\x3a\xfb\xef\x23\x81\x4d\xb3\x3f\x87\x34\xf8\xb9\x8b\x09\
\x0f\xc8\x9f\xcf\xfe\x9c\x47\xe8\x0e\x9a\xb9\x46\x99\x6f\x15\xc8\
\xc4\x20\x15\xd3\x08\x60\x70\xf6\xf7\x8d\x78\xf5\xe8\x9f\xe5\x84\
\xf5\x0b\x20\xbc\x9c\xb7\xd0\x90\x49\x92\x24\x49\x92\x24\x49\x92\
\x24\x49\x92\x24\x49\x92\x24\x49\x52\x4b\x7c\x8f\x41\x5a\x65\x0b\
\xc2\x74\xe0\xe3\x09\x6f\x50\x8f\x05\xc6\x10\x5e\x88\x1b\x4a\x58\
\xd9\x6d\x39\x61\x91\x9c\x05\xd9\x9f\xaf\x10\xa6\xc5\xee\x7b\xb9\
\xed\x51\xc2\xd4\x17\x8f\x18\x4e\x99\x18\xa4\x62\xda\x1b\x38\x1e\
\x38\x86\xb4\xb3\xb9\xce\x03\x7e\x47\x58\xdb\xa1\xaf\xcc\x33\xdc\
\x92\x94\xdd\x08\xe2\x2e\x00\x00\x04\xfb\x49\x44\x41\x54\x4f\x83\
\x81\xf7\x11\xe6\x31\xea\xd4\xfa\x0a\x2b\x80\xdb\x81\xcf\xe1\x72\
\x9c\x92\x94\x2b\xc7\x00\x0f\xd2\xfd\x85\x78\x1e\x07\x3e\x62\x75\
\x48\x52\xf7\x8c\x00\x7e\x48\xbe\x96\xec\xfc\x3f\xab\x45\x79\x34\
\xc8\x10\xa8\x02\xb6\x26\x2c\x86\xb3\xb3\xa1\x90\x4c\x0c\xd2\xf6\
\xc0\xf5\x59\x72\x90\x64\x62\x50\xc5\x6d\x0a\x5c\xd5\x42\x52\x98\
\x4f\x58\x64\xe7\x01\xe0\x25\xc2\x14\xdc\xf3\x09\xa3\xf9\x86\x11\
\x16\x04\xda\x0a\xd8\x86\xb0\xba\xdc\x08\x43\x2e\x13\x83\x94\x6f\
\x17\xd1\xd8\x10\xd4\x5e\xe0\x56\xe0\x27\xc0\xaf\x80\x59\x0d\xfc\
\xdb\x1e\x60\x5b\x60\x02\x61\xe9\xd1\x23\x80\x71\x56\x81\x24\xe5\
\xc7\x89\x34\xf6\x20\xf8\x17\xa4\x7d\x8f\x01\xc2\x8b\x72\x9f\x65\
\xdd\xc3\x62\x7d\xf8\x2c\x49\x1d\xb2\x1e\x61\x38\x68\x4c\x42\x98\
\x07\x4c\xea\xc0\x3e\xed\x0a\xfc\x07\xf0\x82\x89\x41\x92\x3a\xef\
\xe4\xc8\xa4\x30\x3b\xfb\x55\xdf\x49\xc3\x80\x7f\x02\xee\x33\x31\
\x48\x52\xe7\xdc\x49\xdc\x9b\xc8\xfb\x76\x71\x1f\x7b\x08\x23\xa6\
\x24\x49\x6d\x36\x36\xf2\x6e\xe1\x1b\x86\x4a\x92\xaa\xe1\x84\xc8\
\xbb\x85\x2d\x0d\x95\xb4\x76\x03\x0c\x81\x4a\x66\xcf\x88\x6d\x6e\
\x06\x9e\x32\x54\x92\x89\x41\xd5\xb0\x43\xc4\x36\xb7\x18\x26\xc9\
\xc4\xa0\xea\xd8\x22\x62\x1b\xef\x16\x24\x13\x83\x2a\x64\x83\x88\
\x6d\x9e\x33\x4c\x92\x89\x41\xd5\x31\x38\x51\xf2\x90\x4c\x0c\x52\
\x49\x2c\x8a\xd8\x66\x8c\x61\x92\x4c\x0c\xaa\x8e\x98\x75\x95\x0f\
\x30\x4c\x92\x89\x41\xd5\xf1\x58\xc4\x36\x07\x13\xa6\xcc\x96\x64\
\x62\x50\x05\xdc\x13\xb1\xcd\x70\xe0\x33\x86\x4a\x92\xaa\xe1\x50\
\xe2\xa6\xc4\x58\x4a\x58\x33\x41\x92\x54\x72\x83\x09\xcf\x19\x62\
\x92\xc3\x2b\xc0\xdb\x0c\x99\x24\x95\xdf\xb9\x34\xb6\x48\xcf\x95\
\xc4\x4d\xa5\x21\x49\x2a\xa8\x1d\x80\x65\x0d\x26\x87\x5e\xe0\xf7\
\xc0\xc7\x09\x6b\x38\x4b\x92\x4a\xe6\x3b\x4d\x24\x86\xda\x72\x3f\
\x70\x1e\x61\xb6\xd6\xd7\xe2\x40\x0d\x55\x48\x8f\x21\x50\x49\x8d\
\x00\xee\x02\x76\x4a\xf4\x79\x2f\x03\xd3\xb3\xcf\xbc\x2b\xbb\xbb\
\x78\x24\x4b\x22\x92\xa4\x82\x78\x2d\x61\x5e\xa4\xde\x36\x95\x17\
\x80\x6b\x80\x2f\x03\x47\x12\x86\xc1\x4a\x92\x72\x6e\x37\xe0\xc9\
\x36\x26\x87\xda\xb2\x18\x98\x06\xfc\x33\x30\xca\xd0\x4b\x52\x7e\
\x8d\x05\x6e\xec\x50\x72\xe8\x2b\xcb\x80\x9f\x01\x87\x1b\x7e\x49\
\xca\xa7\x01\xc0\x47\x89\x7f\xc7\x21\x65\xb9\x1d\x38\xcc\x2a\x90\
\xa4\x7c\x1a\x09\x7c\x85\xf0\x7c\xa0\xd3\x09\xe2\x52\x9c\xd9\x55\
\x92\x72\x6b\x04\xf0\x01\xe0\x8e\x0e\x27\x87\x39\xc0\x44\xc3\x2f\
\x49\xf9\xb6\x0d\xf0\x49\xc2\x83\xe3\x45\x74\xe6\xf9\xc3\x7b\x0d\
\xbb\x24\x15\xc3\x30\xc2\xb4\xdc\x9f\x01\x2e\x27\x4c\xe3\xdd\x8e\
\xe4\xb0\x12\x78\x97\xe1\x56\x1e\xf9\x82\x9b\x54\xdf\x48\xe0\x0d\
\xc0\xee\x59\xd9\x9b\x30\xed\x46\xab\x96\x12\x16\x0d\xfa\xbd\x21\
\x96\xa4\xe2\xdb\x02\x38\x1e\xb8\x80\xd6\x46\x3a\x3d\x9c\xdd\xa5\
\x48\x92\x4a\x64\x08\xf0\x77\xc0\xd4\x26\x93\xc3\xe7\x0d\xa1\x24\
\x95\xd7\x04\xe0\xd6\x06\x13\xc3\x4b\xc0\x06\x86\x4e\x92\xca\x6b\
\x20\x70\x36\xb0\xa2\x81\xe4\xf0\x51\xc3\x26\x49\xe5\xf7\xb1\x06\
\x12\xc3\xad\x86\x4b\x92\xaa\xe1\xbc\xc8\xc4\xb0\x82\x30\xfa\x49\
\x92\x54\x72\x9b\x11\x9e\x21\xc4\x24\x87\xa3\x0c\x97\xf2\xc0\x55\
\xa9\xa4\xf6\x9a\x4b\x18\xd2\x1a\x63\x37\xc3\x25\x13\x83\x54\x0d\
\x57\x47\x6e\xe7\x5a\xd3\x32\x31\x48\x15\x71\x33\x71\x4b\x80\x8e\
\x36\x54\x32\x31\x48\xd5\xb0\x04\x78\x31\x62\x3b\x97\x06\x95\x89\
\x41\xaa\x90\xb9\x86\x40\x26\x06\x49\xb5\x06\x45\x6c\xb3\xc0\x30\
\xc9\xc4\x20\x55\x43\x0f\x71\xcf\x0f\x5e\x32\x54\x32\x31\x48\xd5\
\x30\x0e\x58\x3f\x62\xbb\x47\x0d\x95\x4c\x0c\x52\x35\x1c\x11\xb9\
\xdd\x43\x86\x4a\x92\xaa\xe1\x4e\xe2\xde\x7c\xde\xda\x50\x49\x52\
\x7a\xc7\x91\x66\x75\xb5\x54\xde\x12\x99\x14\x1e\xb1\xea\x24\xa9\
\x3d\x2e\x00\x96\x11\x26\xaf\x1b\xdb\xe5\x7d\xd9\x02\x98\x13\x99\
\x18\xbe\x66\xd5\x49\x52\xfb\x12\x43\xdf\xc5\x76\x29\x70\x11\x30\
\xbe\x0b\xfb\x31\x06\xb8\x37\x32\x29\xac\x04\x76\xb2\xea\x24\xa9\
\xfd\x89\xa1\xf6\xc2\x7b\x1d\xa1\x9b\x69\x48\x07\xf6\x61\x12\xf0\
\x04\xf1\x6b\x31\xfc\xc4\x6a\x93\xa4\xce\x26\x86\xda\x32\x17\x38\
\x9f\x30\x52\x68\x50\xe2\xef\xde\x05\xb8\x92\xc6\x96\xf5\x5c\x0c\
\xec\x68\xb5\x49\x52\xf7\x12\x43\x6d\x99\x9f\x5d\xc8\x3f\x01\xec\
\x47\xdc\xbb\x06\xb5\x06\x02\x3b\x03\x9f\x02\xee\x6a\x30\x21\xf4\
\x95\x4f\x5a\x65\xca\x9b\x41\x86\x40\x15\xb6\x01\x70\x6c\x56\x20\
\x74\x39\xcd\x24\xbc\x68\xf6\x04\xf0\x0c\xb0\x10\x58\x04\x0c\x06\
\x36\xcc\xfe\xcd\x26\x59\x42\xd8\x05\x18\xda\xc2\xf7\xff\x14\xf8\
\xb6\xd5\x20\x49\xf9\xb9\x63\xe8\x66\x99\x0a\xac\x67\x75\x29\x8f\
\x7c\xf3\x59\xea\xbc\x8b\xb2\xbb\x94\x25\x86\x42\x26\x06\xa9\xfd\
\x66\x01\x2b\x72\xba\x6f\x2f\x01\xff\x98\x95\x65\x56\x95\x24\x75\
\xce\x68\xe0\x14\xe0\xa6\x2c\x49\x74\xbb\xdb\x68\x19\xf0\x3d\x60\
\x4b\xab\x46\x92\xba\x6f\x33\xe0\x7d\xc0\xa5\x84\xa1\xaa\x9d\x4c\
\x08\x73\x81\xaf\x03\xdb\x59\x0d\x2a\x92\x1e\x43\xa0\x0a\x19\x00\
\xec\x0e\x1c\x08\xec\x0f\xec\x4b\xda\x89\xeb\x7a\x09\x33\xa4\x5e\
\x0b\x5c\x01\x5c\x4f\x78\xfb\x5a\x32\x31\x48\x05\x32\x12\x78\x3d\
\x61\xe8\xe9\xf6\xc0\xb6\x84\x2e\x9f\x51\xd9\xff\x37\x94\xf0\xb6\
\x74\x2f\xe1\x61\xf1\x12\xc2\xb3\x82\xe7\xb2\x32\x0b\x78\x10\xf8\
\x0b\xf0\x7b\x60\x9e\x21\x95\x24\x49\x92\x24\x49\x92\x24\x49\x92\
\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\
\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\
\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\
\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\x49\x92\x24\
\x49\x52\xc7\xfc\x3f\xa3\xff\x24\x87\x66\x78\xb5\x48\x00\x00\x00\
\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xbf\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x45\x00\x00\x00\x45\x08\x06\x00\x00\x00\x1c\x8d\x2b\x29\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\
\xbb\x7f\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0c\x09\x02\x22\x0f\xee\x05\x88\x05\x00\x00\x01\x4c\x49\x44\
\x41\x54\x78\xda\xed\xdc\x4d\x4a\xc3\x40\x1c\x86\xf1\x37\x6d\x40\
\x68\x0f\xd0\x95\x20\x82\x07\x71\xef\x2e\xb7\xe8\x89\x44\x50\xef\
\xa1\x17\x10\xfc\xa2\xa2\x1b\x91\x42\x0b\x52\xb5\xb4\x4d\x6d\x3b\
\x49\x1b\xe9\xdf\x55\x25\xa6\x1f\xae\xed\x3c\x0f\x0c\x64\x66\xf9\
\x23\xc3\x24\x9b\x91\xfd\x51\x14\x45\x37\x66\x26\x9f\x86\xd6\x61\
\xd4\xeb\xf5\x33\xdf\x30\x16\x23\x30\x33\xd3\x72\x41\x71\xc1\x4d\
\x3e\x14\x0f\x5e\x94\x26\x7d\xa5\x49\x5f\xf3\x79\xa6\x6d\x6a\xff\
\xe0\x48\x95\x6a\x4d\x92\x14\x6e\x02\x31\x33\xbd\xbd\x5e\xa9\xd5\
\xbc\x90\x73\x5d\x6d\x73\xbb\x7b\x87\x3f\xcf\xe1\x3a\x90\x24\xe9\
\xe9\xf1\xfe\x54\xa3\xcf\xb6\x7c\x2b\x5c\x05\x32\x8c\x9b\x7a\xb8\
\x3b\x51\x36\x1b\xcb\xc7\xc2\x22\x88\x73\x5d\x35\x6e\x8f\xf5\x95\
\x39\xf9\x5a\x29\x3f\x31\x33\x3d\x35\xce\xbd\x06\x59\x42\x79\xef\
\x5c\x6b\x34\x6c\xcb\xf7\x4a\xf9\xad\xd3\x6a\x5e\x8a\x72\x6f\x8a\
\x73\x5d\x4d\xc6\x1d\x44\xf2\x28\x71\xef\x19\x8d\x22\xca\x74\x1a\
\xa3\x51\x44\x99\x79\xfa\x4d\xb2\xf9\xf4\x59\xf9\x0b\xc4\x91\x4c\
\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\
\x80\x42\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\
\x28\xa0\x10\x28\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x80\
\x02\x0a\x28\xa0\x10\x28\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\
\xff\xb4\x60\x71\x7d\x4a\x9a\x0e\x94\xcd\x46\xde\x42\x54\xaa\x35\
\x95\xcb\x3b\xbf\x51\x88\xed\xb3\xb1\x6f\x38\x65\x0a\xef\x7d\x47\
\xcf\xc1\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x99\x60\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x02\x30\x00\x00\x02\x09\x08\x02\x00\x00\x00\x34\xe6\x90\x5d\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\
\x01\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdd\x07\
\x16\x0e\x2f\x2d\xf8\x7b\x38\x10\x00\x00\x20\x00\x49\x44\x41\x54\
\x78\xda\xec\x5d\x77\x7c\x15\xc5\xf6\xff\xee\xcd\x4d\x6f\x90\x40\
\x80\x10\x3a\x24\x74\x1e\x5d\x04\x94\x0e\x4a\x11\x14\xb0\x04\xa9\
\x82\x05\xc5\xae\x3c\x7b\x17\x14\xe4\x29\x8a\x22\xa0\xe2\x0f\x50\
\x69\x0a\x8a\x02\x22\x48\x95\x2e\x3d\x84\xde\x24\x10\x6a\x7a\xcf\
\xfe\xfe\x88\x84\x5b\xf7\xce\xec\xce\xee\xce\xee\xdd\x79\xf7\xf9\
\xe1\xde\xec\xce\xce\x9e\x39\xe7\x7c\xe7\x9c\x39\x73\x8e\x90\x9a\
\x9a\x9a\xb8\x33\x09\xda\x36\x21\x59\xd1\xed\xa2\xe8\xbd\x67\x01\
\x3a\x36\x51\xd4\x79\x00\x8a\x06\x3f\x9f\xe5\x1c\x29\x1f\x80\xf2\
\xc1\x88\xf3\xe9\x6e\x94\x18\x00\x73\xb2\xb8\xf3\xb0\x96\x9c\x53\
\xf6\x74\x79\x4f\x2c\x1f\xb9\xfb\xed\xb4\x04\x57\x38\x17\x3c\xa8\
\x29\xc7\x79\xf4\x46\x4f\x09\x7d\xa5\xe2\xe0\x8d\xa9\x88\xec\x3c\
\x4c\x33\x2b\x3d\xae\x3b\x1a\x59\x8d\x4a\x7f\xa9\x07\x2d\x7a\x61\
\x2a\x15\xaf\x1a\x94\x61\xca\x46\xee\x71\x36\x95\x10\x9c\x07\x04\
\xf2\x38\x24\xe9\x97\x2a\xa3\x03\x87\x53\x69\xd0\xc5\xb1\xd6\x80\
\xe4\x6d\x76\xa9\x96\x6c\x7c\x0a\xb3\x1a\xd3\xaf\x17\x57\x31\xb7\
\x03\x0c\x21\x1b\x42\xb2\x6f\xb5\xc8\xd0\x08\x70\x64\x63\x0f\xd6\
\x06\xc7\xa4\x63\x35\x24\x0e\x41\x48\x09\x2c\xf1\xb9\x16\x34\x16\
\x2c\xd9\x39\xa1\x1a\x2d\x05\xcb\xaf\x31\x96\xca\x93\x47\x13\x1e\
\x5e\x8d\x96\xce\x24\xae\x0c\x3e\x31\xc9\xa7\xa2\x54\x09\x93\x34\
\x5e\x75\xe9\x35\x29\x9c\x83\x90\x1a\x56\xb5\xbe\x0b\x68\x63\x99\
\x4a\x76\x7d\x27\x5b\xf9\x3c\x71\x6b\x32\x33\x41\x23\x4e\x0c\x14\
\x19\xfd\x94\x0b\xa1\xc7\x5b\x18\xea\x74\x35\xd6\x25\x24\xb0\xa4\
\x0d\x30\xa8\xa4\x4a\xb4\xd7\x50\x86\x30\x86\xd4\xf3\xf1\xd2\x12\
\x9c\xad\x42\x33\x10\x26\xd9\x75\x9c\x6c\x6f\x44\x97\x41\x3e\xe6\
\xe4\x36\x74\x78\x82\x4a\x08\xcd\x6a\x52\x54\xd5\x4d\x0c\xdd\x14\
\x12\x1e\x3c\xe6\x80\xca\x95\x11\xe3\x57\x20\xa4\x01\x1a\x19\x0e\
\xc0\xcc\x0f\x48\xb4\x93\xad\x2f\x1e\x94\xcd\xae\x2e\x1e\x58\x56\
\x8c\xe5\x73\xd8\x12\x2a\xd5\xe3\xef\x6c\xb7\x0d\x3c\xac\x4e\xe6\
\xeb\x26\xcc\xf2\x4c\x25\x6d\x30\xc9\xc2\x21\xab\x51\x39\x24\x2c\
\x40\x32\xd8\xd2\x83\x16\x12\x8c\xb8\x31\xc8\x56\x65\xf0\x60\x2c\
\x2a\x3d\x27\xa0\x0c\x3c\xb4\xf4\xe0\x71\x25\x05\x54\xf3\x6e\x68\
\xfa\x58\x6b\x0b\xff\xb2\x90\x64\xa0\xba\xb4\x1e\x24\x09\x7d\x61\
\x68\xa0\x68\x03\x4b\x1e\x9f\xce\xde\x1b\x39\x9f\x7a\x9a\x0c\x24\
\xf9\x1e\x0f\xc7\x30\x41\x59\xc7\x91\x97\xf5\x69\x7a\x23\x89\x8a\
\x4a\x24\x31\x8a\x16\x1a\x59\x4d\x67\x40\xf2\x19\x2e\xa9\xc4\xd2\
\x64\x08\x4b\x3c\x18\xbc\xfa\x1a\x22\xc6\x55\x28\x3e\xd1\xc8\x9d\
\x43\x14\x92\xba\xbc\x43\x8f\x98\x64\xd0\x08\x43\x77\xfa\x88\xa2\
\xf9\x31\x49\x2f\x34\x92\x26\x94\xdf\x62\xa4\x9d\xe7\xc9\x26\x14\
\x86\xf2\xa9\x95\xfd\x38\x69\x34\x32\x55\x40\xb9\xe5\xdf\x67\xba\
\xbe\x91\xd8\x6f\x73\xdc\x89\x34\x28\x2f\xc9\x18\xad\x09\x96\x35\
\x5a\x02\xa1\x44\xd4\x0c\x43\xed\x6a\x20\xae\xb3\xe9\x8e\x46\xd2\
\xc4\xa2\x32\x5c\xc4\xf9\x72\x84\x41\xe2\x20\x48\xd9\xc7\xaf\xd0\
\x48\x0d\x2f\x28\xc9\x24\x2a\x7f\x2e\xa1\xb3\xce\x27\x71\xca\xb8\
\x48\x1e\x2f\x79\xe4\x1f\xc7\x81\xa9\x64\x88\x4b\x0c\x95\x90\xfe\
\x26\xb0\x39\x8c\x38\x54\xdd\x07\xa0\x9c\x37\xd8\x72\x97\x8d\x8b\
\x59\x11\x18\x0b\xa7\x12\x6d\x62\x3e\x1c\xe2\xc1\x36\x22\x51\x8b\
\x42\xb2\x17\x83\x23\x59\xf5\xf7\x95\x58\xa8\x32\xa1\x9b\xaa\x4c\
\x25\x8d\x46\xfe\xa9\x67\x4d\x06\x9c\x3c\x60\x92\xc7\xcb\x3c\xba\
\x01\x94\x34\x3b\x27\x93\x2d\xb1\x99\x24\x3b\xca\x8b\xd0\x03\x63\
\x3e\xec\xe1\x0a\x8d\x1c\x67\x96\x24\x36\x44\x5e\x48\x9b\xaa\x93\
\xc8\x70\xab\x52\xbd\x71\x7a\xdc\xcd\xd2\x91\xb7\x75\xf7\xdd\x59\
\x78\x43\x8b\x49\x52\x41\x64\xa2\x54\x76\x2b\x86\xcd\xae\x06\xf7\
\xc8\x63\x05\x95\x42\xe9\x95\xef\x30\x59\x68\xc4\x10\x93\x08\x57\
\x18\x0a\x23\xad\x1d\x6f\xf4\x39\xef\x84\x4f\x51\x29\xb0\xd3\x40\
\x93\x4b\x1b\x55\xc8\x1c\x93\xcc\x27\xc2\x5c\xed\xb7\x49\x08\xa6\
\xef\x73\x8d\x8c\x0e\x87\xb0\xb7\x90\x14\x1d\xf8\x10\xbc\x1a\x86\
\x2e\x6f\x2b\x83\xd7\xf9\x54\x28\xfa\x0a\x83\x0b\x35\x54\x4d\x9d\
\x22\x63\xb5\xc1\xe1\x64\x71\xc5\x45\x1a\xa3\x91\x1a\x98\xe4\x0f\
\xf2\x68\x94\x28\x0f\xba\x63\x67\xa2\x2a\x98\x64\xe7\xc7\xc4\x76\
\x24\x8a\x4a\x6f\xeb\x87\x06\x93\xf6\x73\xaa\xbb\xca\xa6\x32\x8f\
\xb4\xb1\x15\x4c\xd0\x64\xbf\xaf\x29\x09\x65\xbe\x48\x42\x85\x68\
\xc4\x4a\x4b\xdb\x39\xe1\x5a\x26\x0b\x6a\x0b\x99\xf8\x11\x54\x0f\
\xe6\x97\xaf\x73\xd0\x60\xb1\xe7\xa1\x01\x1a\x69\x80\xbb\x56\x5e\
\x22\x0b\x63\xa8\x34\xad\x42\x6d\xc9\x04\x8d\x98\x60\x92\xdd\x9b\
\x7d\xed\x7e\x2e\xdd\x23\x39\xd4\x93\x7f\xcd\xd2\x78\xab\xbd\xa2\
\xd7\xf7\x98\xa4\x96\x86\xaf\xcb\x83\xc8\x31\x89\x2a\xea\x81\xab\
\x55\xb9\x1a\xcc\xc3\x70\xbe\xac\x55\x97\x1f\xda\x3a\xb4\x60\xc3\
\x55\x54\x97\x8d\x44\x9e\xcb\xe2\x71\xcb\x7f\x74\xfc\xab\xc7\x1f\
\xf5\x32\x24\x15\xf2\x25\xab\x18\x5f\x89\xd5\x84\x3e\xc5\x8c\x93\
\xf9\x12\x6c\x92\x0d\x52\x79\x84\xd2\xcb\x5b\xc8\x1c\x42\x48\xcf\
\xf0\x25\x7b\x8d\x95\x37\x2d\x7e\x88\x4e\x1f\x0b\x8d\x34\x56\xb0\
\x24\x34\x57\x32\x2f\x36\x2a\xe5\xa5\x0b\xf7\x6b\x7c\x2a\x88\x21\
\x2c\xb9\x4f\x8c\x5e\x8b\x11\x86\xe7\x7b\xa8\x04\xdb\x83\x6d\x2d\
\xf8\x9e\x6b\xc7\xbc\x35\x6a\xa3\x11\xb3\xb9\x66\xc1\x36\xf2\x0f\
\xcf\xf9\x0d\x26\x39\x1e\x37\x56\x5a\xe5\xcb\xca\x28\xa1\x58\xa1\
\x31\xc7\x24\x06\x7b\x48\xda\x08\x83\xd6\x65\x20\x58\xa7\x23\x62\
\x38\x7e\x79\x7e\xad\x72\xdf\x1d\xfb\x5c\x0c\x8c\xea\xab\x3a\xbe\
\x91\x8c\x4d\x44\x1e\x94\xb2\x6c\x0a\x2b\x57\x8e\x96\x53\xce\x6a\
\x9c\xa0\x51\xf9\xf5\x32\x94\x9e\xdd\xe2\x6c\x55\xd6\xdd\xea\xef\
\x1b\xc9\x80\x25\x35\x66\x56\xbd\x65\xa6\x3f\x1c\x58\xb6\x96\xea\
\x7a\x1a\x5b\xc9\xd6\x74\xa8\x8e\x61\xb4\x52\x6c\xb7\xa8\xa6\x9e\
\xc1\xa4\xaa\x4a\xe5\x41\x5f\x93\x1f\x29\x65\x93\x91\x9d\xfb\x2d\
\x7a\x26\xb6\x11\xc3\xb7\x93\x17\xd2\xa2\xcd\x56\x9c\xaa\x2f\xae\
\xea\x24\xfa\x21\x62\x69\xb6\xf9\x6d\x87\xf1\xcb\x75\x73\xa8\x6e\
\x2c\x28\x52\x09\x93\xcc\xc1\x1e\x86\x58\x7b\x69\x1f\x21\x62\x94\
\x98\x40\x8f\xc3\x33\x31\x4a\x29\xaa\x10\x44\x09\x2e\x36\xc0\x42\
\x23\xbf\x5e\x92\x68\x80\x46\xdc\x4a\x2c\xab\x21\x29\x09\xf6\xe1\
\x2a\x4c\xce\x9d\x20\xbc\xcd\x9a\x1a\xa1\xb0\xd6\x72\x84\x1f\x55\
\x66\xb3\xe8\xc5\xa7\x78\x94\xed\xea\x73\x08\x4b\xfa\x67\xc6\xe3\
\x49\xf2\x59\xc1\x89\xcf\x7e\x34\x20\xbb\x92\xda\x3c\x96\xde\xb7\
\xe0\x84\x49\x27\x76\xb6\xdc\xac\x25\xbb\xf0\xc0\x9a\x3d\xa7\xa2\
\x7a\x45\xbc\x34\x14\x8d\x6a\xa2\x65\x6d\x34\x7d\x5c\x2d\x86\xe0\
\xc4\x8a\x55\xa2\x9b\x34\x9e\x2f\x11\x10\x8c\xc6\x7e\x3a\x6e\xb3\
\xf3\x83\x3a\xbe\xd3\xf3\x5b\x98\x44\xb3\xae\xd5\x1d\x8d\xca\xbb\
\x22\x19\x8c\x5d\x0d\x4e\xf2\x9f\x34\xa6\x6b\x76\x3b\x7f\x0f\x40\
\x52\x7d\xf4\x6c\x8e\x4f\x17\x31\x33\x92\xc0\x28\xa1\x8e\xf2\xe9\
\x90\xa7\xb3\x58\xb1\x01\x15\x53\xa9\x6a\x58\xea\x58\xf4\x5a\xc6\
\xa3\x49\xe2\x1a\x0c\x97\xff\x94\xc3\x2d\x49\xf3\xed\x21\xe9\xe2\
\x9e\xb1\xab\xc1\x1f\x65\x32\xa0\x59\x56\x31\x8e\x5a\x09\x52\x53\
\x91\x9a\x0a\x00\x08\x02\x0a\x35\x5a\xe3\x94\x71\x8e\xda\x46\x14\
\x6d\xc8\x16\x55\x0c\x88\x36\x55\x65\x95\xbc\x91\x8e\x38\xa4\x63\
\xff\x7c\x4a\xae\x65\x24\x19\x14\xe1\x7c\x6a\x33\x15\x0b\xf4\x39\
\x32\xba\x3f\xe6\xd4\xba\x81\x46\xe1\xf1\xc8\x39\xaf\x85\xc5\x5d\
\xae\xd2\x05\xd5\x16\x95\x84\x3e\x25\x39\x0b\x79\xc1\xf5\x5d\x04\
\xb9\x3a\x48\xa4\x7f\x23\xb5\x95\xb2\x8e\x07\x66\x99\xa3\x91\xaa\
\xbe\x50\xe3\xea\x07\x89\x91\x1b\xd1\x78\x52\xc9\x3c\xf2\x89\x49\
\x42\x6a\x6a\x6a\x52\x52\x92\x4a\x16\xb4\x55\x0a\xe5\x66\x8b\x05\
\xae\xa8\x33\xc7\xee\x84\x35\x82\x8b\x43\x25\x9b\x4f\x94\xa4\x03\
\xad\x6a\x66\x7b\x7c\x0a\x2c\xca\xb1\x6b\x90\xf0\x49\x1a\x8d\x58\
\xd9\xe2\xca\x17\x31\x0a\x5f\x53\x77\x89\x60\xb8\x23\xeb\x11\x3f\
\x64\xbb\xfa\xd5\x76\xd6\x49\x0c\xcc\xce\xc9\x7c\x98\x1f\x9c\xae\
\x00\x40\x68\x1d\xcc\x7a\x14\xc3\x5e\x50\x5d\x9b\x0b\x9c\xc9\x9e\
\x99\x16\xbc\x4a\x94\x8e\xec\x7d\x20\x4e\x6c\x23\xc3\x59\x45\x12\
\xaf\x29\xf1\x27\x8d\xd2\xa1\xa9\x69\x54\x79\x54\xfa\x9c\x1c\x39\
\x95\x2a\x4d\xcb\xc4\x42\x62\xb8\x0a\xf8\xfe\x51\xdc\x9f\x69\xe9\
\x43\x45\x16\x12\xd4\xdf\x4f\xd2\xec\xa5\x04\x05\xa4\x90\x67\x21\
\x91\x28\x23\xc2\x60\x13\xf5\xac\x2e\x55\x05\xd3\x27\x1a\xb1\xb2\
\x90\x34\xae\x12\xc2\x39\x76\x2a\xe1\xd2\x72\x9b\x46\x9a\x27\x49\
\x00\x49\x9b\x58\x06\x6f\xc3\x50\xdd\x42\xa2\xdd\x09\xcf\x2d\xb6\
\x20\x46\x29\x1a\x41\xfd\xa0\x67\x2d\x5f\x50\x50\x46\x0a\x86\xca\
\x91\x2a\x45\xa1\xc4\xb1\x1e\x9e\x9d\x45\x9a\xd9\x46\xda\x1f\x11\
\x51\x6f\x2f\x47\x33\xcb\xc3\x47\x35\x06\x81\xc1\x8b\xe8\x6b\x24\
\xd9\xb5\x21\x22\x39\x2b\xe4\x95\x58\x28\xa3\x3a\x2b\x78\xe4\x5d\
\x79\x46\x89\x72\x20\xd1\xb2\x2b\x8f\x7a\x99\xe4\x70\xab\x8c\x42\
\x18\xde\x54\x49\x59\x00\xaa\x81\xa2\xd7\x44\xce\xf9\x99\xd8\x74\
\x53\x08\x4b\x12\x53\x26\x11\x26\xaa\x11\x50\x09\x0c\x2e\xd3\x38\
\xce\xdb\x23\x26\xd9\xb5\x64\x74\x12\x56\xc8\x2b\xb5\x20\x43\x45\
\x3d\xee\x58\x9b\xd5\x85\x1b\x84\x1b\x77\x29\xdc\xb8\xd6\x26\x06\
\x5d\xa1\xd2\x24\x0f\x7b\xa3\xce\xba\xef\xcb\x4d\xa7\x65\x0d\x5f\
\x35\x08\x2b\x70\x3c\x3c\x12\xde\x93\x07\x4b\xbe\x8f\xeb\x4a\x56\
\x43\xb6\xd2\xb3\x11\x62\x92\xa6\x41\x0d\x1e\x0b\x9f\x5b\x4d\x33\
\x2d\x4c\xb2\x56\x12\x6e\x74\x4b\x8b\x2b\x3e\x17\xaa\x4a\x24\x53\
\xda\x48\x12\x15\xb0\xa2\x3c\x28\xf2\xf6\x16\xe4\x8c\x2d\xcf\x48\
\xb2\x42\xae\x49\xe6\x5d\x3d\x58\x22\x97\x29\x1e\x93\x7e\x49\xfa\
\x15\xf5\x1a\xb0\xcb\xa8\xf4\xc9\x65\xe7\x87\xa5\x97\x0d\xd4\x04\
\xfa\x50\x02\x12\xb7\x89\x57\x25\x2e\x92\x3e\x45\x4b\x21\x51\x15\
\x8d\x64\x5c\x2f\x32\x45\x23\x77\xe9\x33\xa2\xb3\x4e\x90\xfc\x30\
\xc4\x60\x79\xe7\xea\x1c\x3f\x3c\xe0\x13\x87\x68\xe4\xde\x74\xae\
\x87\xe4\x38\xd3\x6e\xf2\x29\x54\xba\x6f\xe3\xa5\xef\x3a\xf2\x26\
\x06\xa5\x45\xf9\xf9\xf9\xf9\xd9\xd7\xd3\xd3\xfe\xf9\xe7\xfc\xf9\
\xf3\xe7\xff\x39\x7b\xfc\xf0\xfe\xbd\x7b\xfe\xde\xb3\xef\xe8\xf9\
\x6c\xa5\x21\x19\x54\x66\x84\xe0\x4b\x6b\x78\x53\x61\x24\xfd\x0b\
\x34\x7a\x41\x54\x26\x12\x4a\xf6\x84\x45\xc5\xe3\xa7\x92\x4c\x19\
\x68\xe4\x4d\x9d\xd1\xa6\x41\x12\xd4\x94\x3e\xc3\xa1\x91\x2e\x3a\
\x4a\x0d\x30\xb0\x9a\xa3\xf8\xab\x0b\x48\x54\x7e\x09\xa3\x18\x4c\
\xb6\xc0\x90\xb0\xc0\x90\xb0\xc8\x0a\x71\x35\x12\x5b\x38\xff\x29\
\xff\xdc\xae\x3f\x56\xfd\xf6\xdb\x6f\x2b\x57\xfe\xb1\xed\xf8\xf5\
\x62\x6d\x78\x57\xa0\xd1\x1d\x9e\x4f\x27\x28\x56\x76\x02\xa3\x7e\
\x38\x5c\x45\x92\x04\xd4\x32\xdf\x90\x70\x87\x04\xdd\xf7\xe4\x2c\
\x8d\x4a\xc5\x12\x3c\x8c\x90\x70\x78\x3c\x98\x47\xe5\x98\x64\x53\
\x2e\x5d\x26\xc0\x18\x56\x2d\x24\xa1\x75\xdf\x31\xaf\x7c\xba\x78\
\xd3\xb1\x6b\xd7\x0e\xad\xf8\xe4\xa9\x01\xcd\x62\x03\xb5\x58\x49\
\x09\x5a\xe9\x0b\xe9\x72\x1b\xf2\xc6\x50\xe6\xd3\x50\x88\x85\xaa\
\x42\x94\xc2\x11\xca\xc3\x03\x1d\xd1\x08\x72\x3d\x60\xc6\x83\x16\
\x5f\xba\xce\xa3\x06\xd3\x85\x25\x48\x04\x50\x0d\x97\x80\xc6\xcd\
\x2a\x61\xae\x52\x8b\x68\x74\xe7\x13\xd3\xee\x7c\x62\xda\xb5\x1d\
\x5f\xbf\xf5\xd2\x9b\x5f\xfc\x71\x3a\x5f\xd4\x40\x89\x88\x72\x6f\
\xa4\x12\x5d\x8a\x10\x35\x76\x79\xdf\x05\x15\x5e\x9c\xf9\xc2\x8b\
\x89\xb2\x50\x72\xbc\xd7\x6a\x0a\xd7\xd6\x3c\xac\xa1\x15\x72\x91\
\x68\x64\x67\xab\x6b\xa6\x06\x9e\x4e\x48\x70\xba\x87\x24\xa7\x5d\
\xdb\xf6\xe5\xc4\x27\xfe\x3b\x67\xc7\xd5\x12\x39\xdc\x49\x3b\x23\
\x2a\x2d\xae\xdd\xe5\x84\xaa\xa6\x1c\xd5\x5b\xd0\x2a\x65\x53\xba\
\x98\x44\xb3\xbc\x08\x63\xb2\x90\xed\x38\x72\x9e\x48\x53\xbd\xd2\
\x62\x32\x3c\x8a\xfc\xc4\x5c\xa8\x9e\x3a\xc8\x02\xa4\xf2\x96\xb1\
\x79\xea\x98\x51\xaf\x2d\x3d\x9a\x2b\x52\xb2\xac\xbc\xf8\x60\x35\
\xf4\xb2\x8c\x5c\x38\x32\x60\x49\x9e\x89\x40\x7e\x97\x3f\xe6\x9e\
\xe7\x09\x62\x95\x2c\x1d\x3c\xa2\x11\xcf\x05\xd8\xd4\x38\xe2\x22\
\x95\x04\x8f\x26\x99\x08\x3f\x98\xc4\x3e\xa8\xc1\x12\x72\x9f\x2d\
\xba\xe3\xb3\x8b\x8f\x0c\xfc\x76\x44\xdf\x47\xff\x2f\xd5\x27\x28\
\x29\xe4\x63\x9f\x01\x78\x4a\x24\x41\xa5\xaa\x48\xb4\xc2\xe3\x7e\
\xb0\x57\xd4\x6f\x48\x56\x23\x67\x4b\x86\x93\x6e\x02\x73\x47\x6d\
\x15\x4f\x75\xbd\xee\xa6\x92\xb5\x87\xa4\x71\xab\x37\x7c\xee\xbe\
\xc6\xcd\x06\x0e\x78\xe9\xb7\xb4\x22\x2f\x97\x04\x62\xd9\x0c\x7d\
\xe4\x9f\xd0\x3d\xe8\x98\x6b\x40\x6d\x5d\x20\xe8\xbd\x94\xd3\x37\
\xb8\x40\x47\x0b\x86\xb7\x97\xd5\x3d\xa4\xcd\x10\xc7\xf9\x15\x9e\
\x79\xd2\xfd\xc8\x94\x0d\x56\xd3\xba\x05\xb5\x79\xee\xd7\x3d\x0b\
\x46\xd6\x0f\xf1\xf2\xf7\x22\xbc\xbd\xdb\xc1\xe7\xc6\x71\xd2\x33\
\xed\xd1\xa8\x5c\x6c\x3c\xaf\x94\xd9\xe9\x65\x91\x2c\xd4\xad\xec\
\x08\xad\xf4\x41\x5a\x83\x5a\x30\xa2\xa7\x8f\x7f\x36\xe6\xb1\x6d\
\x6a\x63\x92\xa2\xb0\x55\x41\x4f\xec\xb7\x00\x49\x9f\x16\x37\xf8\
\xeb\x2d\xf3\x47\x37\xf0\x82\x49\xbb\x96\xe3\x82\x28\xa5\x2b\xd5\
\x83\x19\x77\xc1\x13\x25\x31\xc9\x9b\x2a\xd7\x6b\xa5\x2c\x3b\x4c\
\x59\x89\xda\xd5\x57\x86\xb5\x59\x04\x58\xcd\xaf\x9a\x5e\xfc\x6c\
\x01\x92\x6e\xad\xf2\xdd\x73\x36\x7d\x3d\x24\xde\x93\xd3\x54\x3c\
\x8f\xa5\xd7\x7d\x68\x4f\x95\x96\x72\xee\x30\x23\x10\xab\x69\x91\
\x29\x70\x6a\x20\x11\xe4\x20\x44\x6b\xab\xf9\x33\x26\x95\x31\xa1\
\x69\xf2\x55\xfa\x6d\xe2\x4d\x5d\x78\x9b\x19\x20\x29\xf7\xde\x94\
\x31\xf1\x87\x81\x7e\x34\xe5\x71\xf7\x2d\xf8\xf1\xb9\x16\x61\x9e\
\x34\xe5\xec\x14\x1f\x54\x15\xbd\xcc\x82\x8a\xa5\xa0\xe9\xff\x2a\
\xaa\x79\x34\x4a\x39\x0e\xa9\x8d\x76\xfe\x89\x49\x66\xca\x54\x69\
\xa5\x81\xd6\x18\x93\x18\x5b\x48\x4a\xb8\xd0\x2f\x63\x9f\xec\xed\
\xde\xff\xe5\x7f\xbd\x62\xdc\xa7\xe1\xe0\x46\xe4\xf9\xd2\x71\xca\
\x55\x1e\x69\x58\x1a\xc1\xf5\x6c\xb3\x71\x73\xa5\x6d\x05\x7a\xaa\
\x72\x9e\x45\x49\x89\x51\x68\x35\x1e\x27\x54\x4d\x19\xd3\x12\x93\
\xec\x8e\x0b\x01\x85\x90\xa0\x1c\x51\x84\x64\xf9\x16\x52\xda\x97\
\x7d\x3a\xbe\xb1\x2f\x9f\x39\x62\xdb\x83\x43\xc2\xc2\xc2\xc3\xc2\
\xcb\x5a\x58\x44\x54\xe5\x1a\x0d\x1a\x35\x6e\xd2\xa4\x49\x93\x26\
\x4d\x1a\xd7\x88\x56\x3e\x57\x09\x63\xbf\x99\xf4\x43\x93\x87\xff\
\xb8\xe6\xc4\x53\x45\x47\x70\x5c\x93\x5a\x85\x32\xca\x4c\x08\xde\
\x55\x98\xc8\xe2\x29\x5c\xa9\x42\x25\x35\xd4\xb9\x45\x23\x9f\x53\
\xe9\x73\x42\xfd\x42\xcb\x5b\x55\x72\x9c\x31\x49\x83\xc8\x1d\xee\
\xc2\xbe\x9f\x2f\x92\x79\x63\x71\xd6\xa5\xb4\xb4\xb4\x7c\x6d\xa7\
\x29\x28\xae\x45\x9f\x7b\x1f\x1c\x3e\x62\xd8\x3d\xad\xe3\xe4\x77\
\x53\x6d\xec\xd7\x6f\xcf\x6b\xf6\xc4\x86\x0c\xc7\xf9\xce\x47\xb3\
\xe1\x4a\x15\xa5\x4f\x18\x70\xac\x7e\xc4\x04\x2d\x04\x5f\xd9\xc7\
\xcd\xba\xf4\xd6\x45\x71\xcb\x58\x47\xd2\x8e\x53\x50\x33\xdd\xb8\
\xd5\x18\x9a\x47\x1a\x94\x51\xd7\x20\x28\xdc\x66\xad\x08\x94\x70\
\x42\x61\xfa\x9e\xe5\xd3\x9f\x1d\xdc\xa6\x5a\x78\xad\xce\x63\x67\
\x6c\xcd\x94\xdb\x51\x8d\xf1\x33\x1e\x6f\x14\x4c\xa8\x4a\xd8\x26\
\xbb\x24\x71\xc7\x95\x5f\x26\x90\x75\x28\xf8\x7a\x11\xb6\x5c\xad\
\xde\x9e\x90\x40\xfc\x74\x7d\x17\xf2\x84\x41\x04\xa2\x2c\x7c\x22\
\x9f\x7a\xab\xf9\x83\xa9\xa4\x2a\xec\xd9\x2c\x2b\x95\x45\x2b\xcd\
\x3d\xb3\x69\xf6\xf8\x8e\x35\xff\x33\x72\xc6\xf6\x2c\x59\x3d\x34\
\x79\xfe\xcd\x5e\x95\x6c\xbe\x55\x03\x15\x33\x90\x1b\x3d\x24\x99\
\x1d\x24\xea\xc0\xca\x78\xb4\x42\x25\xee\x31\x40\x8e\x15\x30\x08\
\xc4\xb0\xca\xb6\x1a\x93\x0c\xf3\xc8\x1d\x99\x68\x09\x2e\xb2\x63\
\x24\x4b\x7b\xf8\x0f\x2c\xa9\xd4\x9b\xcd\x9d\x8d\x94\x73\x95\xbf\
\xf2\x65\x69\xc6\xde\xb9\xe3\x3b\xd4\xba\xe5\xb9\x55\xd7\xe8\x6f\
\x8e\x1e\xfc\xde\xd8\xc4\x20\xe5\x4a\x41\xf6\x5d\x32\xb2\x0d\x95\
\xfb\x0a\xc8\x1f\x2d\xe8\x74\x54\x88\x0a\x8a\x38\x37\x89\xd8\x63\
\x1b\xbb\xbb\x2c\x4c\x52\x1d\x0c\x92\xb5\x00\x09\xbd\x4c\x25\x9b\
\x96\x24\xf3\x0f\x54\xba\xb6\x6d\xea\x80\xff\x0c\xfd\xe6\x2c\xf5\
\x9d\x4d\x1f\x19\xd3\x34\x44\x57\xed\x23\xd0\xec\x63\x3b\xe2\x90\
\x04\x26\x31\x29\xab\x43\x8e\x01\xb4\x71\x83\xc6\x85\x22\xcf\xa5\
\x7a\x92\xd9\x73\x05\xd5\x90\xac\x3c\x81\x5a\x2f\x26\x68\x6a\xf1\
\x71\x6e\x2a\x79\x05\x24\xe6\xcb\x1c\x93\x65\x58\xf1\xd5\x0a\xcf\
\x2c\x7a\xb8\xcb\x98\xe5\xb4\x76\x52\xcd\x61\x0f\xb5\x0a\xd7\x7f\
\x45\x4c\x72\x12\x56\xe3\x79\x54\x35\xd4\x4d\xa0\x89\x10\xe1\x79\
\xb1\xac\x10\x0c\x44\x4d\x6e\xb1\x9a\xd9\x2c\x36\xa6\xa6\x92\x57\
\x0b\x49\x03\xd3\xdb\xd4\xf8\x54\x78\xe2\xeb\x91\x83\x3f\xa7\x34\
\x93\xaa\x0e\xd1\x08\x91\xc8\x74\xb4\x48\x86\x46\xc6\xcd\x56\x20\
\xc8\xad\x6d\xc1\x10\x3e\x59\x29\x77\x9f\x68\xa4\x23\xe8\x1a\xd1\
\x8f\x67\xac\xe4\x75\xa6\x19\x83\x4d\xe3\x29\x71\x1c\x77\x79\x6c\
\x3b\x5b\xe3\x89\x97\x8c\x90\xe2\xb5\x75\x13\x93\x3f\x3d\x47\x75\
\x4f\xa5\xae\x77\xd6\x0f\xe6\x49\x5f\xfb\x5c\x13\xf1\x09\x45\x0c\
\x37\xea\x79\x57\x46\x34\x59\x6e\x75\x79\x65\x6b\x57\xc9\xf4\x68\
\xc4\x70\x61\xca\x72\x0f\xc9\x27\xa2\x48\x0c\x97\xe1\x2a\x5b\xf9\
\x8e\x05\x33\x82\x64\x6e\x79\xf7\xf9\x15\xb9\x34\xb7\xd4\xbe\xe3\
\xf6\x78\x95\xcf\x86\xb1\x2a\x95\x24\x31\x65\xaa\x2c\x65\xd8\xed\
\x48\x69\x6c\xbb\xa8\x6a\x57\x81\xd2\x53\xc7\x90\x74\xbe\x03\x11\
\xe7\x9b\x19\x8d\xcc\x94\x21\x89\x1f\x80\x94\x0f\x48\xee\xf0\x23\
\x71\x6c\xca\x6b\xbd\x00\x41\x5d\x87\x8f\xb4\xcc\x78\x1b\x2d\x3b\
\x29\x2a\xb9\xb0\xec\xf5\x19\x67\x68\xee\x68\x7c\x67\xf3\x48\x93\
\x2c\xdb\xb5\x51\xe2\x82\xca\x58\x65\x44\xa7\xb2\x6c\x03\x91\x59\
\xfd\x0e\x62\x28\xd2\x1e\xb1\x98\x3c\xd1\x91\xc3\x2d\x4c\x62\x68\
\x5d\xc8\x04\x24\x93\x54\x7f\x11\xd4\x97\x90\xbc\xfd\x5f\x7d\x79\
\x98\xe2\xfa\xc0\x3a\x2d\xaa\x05\x69\xb3\x18\xb7\x76\xa4\xb9\x32\
\x74\x58\xcd\x88\xa8\xc7\xc8\x75\xc4\x06\xbf\x5a\x81\x19\x48\x57\
\xcb\xc3\x24\x9b\x3c\x2a\x4b\xa4\x36\x32\x34\x56\x51\x49\x08\xd9\
\xbe\x57\xe1\xf1\xa5\x0b\x8e\x50\xf4\x9a\xd0\xb2\x46\x88\x16\xec\
\x62\x41\x07\x7f\xe6\x91\xc0\x68\xc0\x82\xde\xfc\xc0\xb3\x82\x26\
\x19\x9b\xb4\x1e\x60\x1b\x70\x6f\x6e\x4c\xf2\x09\x4b\x2e\x17\xd8\
\x94\x3c\x8c\x0a\xa8\x8c\xb2\xd2\x21\xf4\x0b\x4b\x87\xff\xd7\x72\
\x44\xa4\xd3\x6b\xd6\x5e\x24\x1f\x42\x58\xad\x7a\x15\x03\x0c\xa2\
\xfe\x34\x58\x1f\xe8\xbb\x88\x16\x4c\xf7\x46\x1e\xb1\x56\x50\xbe\
\x38\x33\xd3\x2a\x64\xbe\x7c\xed\x61\x61\x12\x95\xa9\xe4\xfe\x27\
\x9b\xf6\xef\x6f\x74\x3b\xbd\xdc\x30\x92\xd8\xd2\x3f\xed\xf8\x3d\
\xf7\xc8\x9a\x43\xa5\xe4\xfd\x87\xc7\x84\x05\x28\x18\x18\x55\xbc\
\xa2\x68\x04\xbd\xa0\x6f\xc1\x37\x86\xb9\x9a\x34\x78\x05\x81\x32\
\x5f\x94\xa0\x1a\x1a\xf9\x5c\xd8\x19\x54\x0f\x18\x77\xc7\x88\x37\
\x4c\xf2\xf8\xa3\x4d\x9b\xc7\x98\x06\x93\xca\x27\x55\x02\x8d\xdc\
\x58\x36\xf7\xf4\xbe\x34\xf2\x47\x84\x56\x08\xb5\x51\x0e\x49\x76\
\xd0\x3c\xb7\x46\x92\x47\x0e\xe1\x9c\x6d\x54\x45\x23\x2d\xdf\xbd\
\x8c\x87\xc9\x35\xaf\xa0\xc0\xe5\x60\xb2\x88\x00\xce\x5f\x87\x1f\
\xdf\x95\x37\xfd\x69\x57\x83\xb2\x12\x98\xa4\x97\x4e\x11\x19\xe9\
\x62\xdf\x2e\x51\x0f\x74\x2b\x4c\x4f\x4d\x07\xaa\x13\x3e\x22\x38\
\x32\xc4\xa6\x8c\xb7\x18\x46\x2d\xea\x55\x7a\xc0\x58\x7a\x4a\x20\
\x7e\x23\x79\xfc\xaf\xb1\xd4\xc8\x20\xbe\x20\xab\x26\x21\x9f\xb3\
\x2c\x24\x7b\x25\x38\xc9\x80\x25\x6e\xe7\x04\x93\x74\x3f\xba\x24\
\x31\x00\x9b\xf6\x93\xad\xc3\x8a\xcf\xcb\x8f\xcc\x4f\xce\x7a\x79\
\xa9\xd2\xbc\xeb\x14\x87\x91\x8a\x0b\x8a\x44\xa6\xf6\x90\xbe\xb1\
\x5b\xbc\x9b\xbc\xca\x5e\x8d\x3a\xff\xba\x79\x4f\xae\x98\x03\x8d\
\xfc\x70\x39\xa5\xb1\x65\x26\x0d\x87\x36\xed\xc9\x27\xfd\x38\xd9\
\x15\x63\x95\x68\x52\x56\xc8\xe4\xe5\xd5\xc4\xc2\x9c\x02\xf2\x4d\
\xa4\x82\xec\xc2\xb2\x8b\x03\xda\xc8\xb1\xb8\xd5\x30\x8f\x98\xe8\
\x6e\x3d\xe5\x41\x72\x0b\x4a\xfe\x89\x54\xad\x06\x6f\x35\x1e\x10\
\x85\xee\x00\xb2\x15\xe0\xe0\xb0\x80\x26\xd7\x4e\x36\x1d\xe7\xdb\
\x6f\x24\x4d\x08\x0c\x0b\x26\x27\x74\xc6\x3f\xd7\x8b\x01\x00\x25\
\x3b\x55\xb3\x0e\xe7\xcb\xbc\xd1\x10\xc1\xe2\x22\x8d\x82\x20\x2c\
\x39\xa8\xd0\x30\xb2\x16\xdd\x7e\x68\xe5\xf8\x33\x26\x79\x74\xe4\
\x90\xac\x95\x6d\x1e\x69\x67\x1a\xee\x67\xe5\xad\x52\x66\x1c\xd8\
\x42\x2b\x84\x12\x5f\x5c\x7c\xe9\x6c\x46\x09\x37\xeb\x6e\x81\xa7\
\x54\x4c\x84\x33\xa5\xaa\x6a\xd0\x85\x0e\xaa\xca\xa3\xfe\x59\x1f\
\x8d\x80\x49\xf2\xa6\x40\x77\x45\x2a\x15\xed\x2c\xaa\xf2\x38\x6f\
\x1b\x0a\x84\x9e\x1b\x1b\x0f\x93\xed\xd8\x9e\x2f\xe2\x0b\x8d\x58\
\x98\x05\x81\x71\x0d\x2a\x13\x5f\x7c\x7e\xef\xd9\x7c\xf9\x43\xa5\
\x19\xab\x8f\xd3\x7f\xfa\x21\x90\x63\xfc\x3a\xa1\xd8\x68\xa3\x4f\
\x05\xb9\x92\xaf\x24\x77\xb0\xda\x68\xe4\x0d\x9c\x2c\x7c\xb2\xec\
\x24\xe5\x38\x44\xab\x97\x6c\x3a\x12\x4e\x4b\x49\x53\x69\x5d\x4c\
\x26\xb7\x61\x35\x5b\xc4\x93\x3e\xa9\xf4\xe4\x8e\xb3\x05\x4c\xf0\
\x06\x06\xcd\xc3\xe6\x10\x58\xef\xf3\xa4\xb7\xa8\x21\x14\x49\xa3\
\x91\xd7\x63\x00\x22\x7b\xf9\xe7\x53\x46\x4c\x3c\x5a\x85\x9a\xca\
\xc4\x98\x44\xb2\xd2\xa2\xd2\x5a\x76\x17\xc2\x59\x3b\xa8\xec\x25\
\x24\xb4\x41\xf7\xc6\xc4\x47\x5d\x8f\xad\xd9\x9f\x29\xfa\x9c\x5d\
\x5a\x36\x72\x09\xc9\xe5\xdc\x25\x4b\x74\x94\x4d\xa5\x39\x9d\x4f\
\x47\x22\xed\x31\x46\x64\x64\xb9\xfa\x2c\xd2\xc8\x95\x7c\x11\xd5\
\xf3\x55\xa7\x76\xaa\x3b\x27\xf0\x10\x39\x6d\x14\x18\xa3\x25\x94\
\xcd\x58\x78\xce\xcf\x62\x8a\xfc\x80\x4e\x50\xad\xee\xdd\xab\x91\
\x76\x7b\x79\xd3\x9f\x67\x0a\x01\x20\xd4\xd7\x34\xbb\xcf\xb4\x39\
\x84\xc4\xe7\x5b\x88\x7c\xd4\x91\x23\x59\x1b\xaa\x01\x57\x6a\xa3\
\x91\x9e\xae\x5a\x37\x87\xa1\x40\x0c\x45\x1a\x57\xf2\x76\xf1\x2a\
\xbb\x7f\x54\x52\xaa\xcc\x95\x33\x9d\x93\x9f\xd2\xf9\x2c\x63\x3a\
\x6c\x16\x1a\x29\x51\x0d\x04\x04\x0f\xac\x33\x30\xb9\x21\x69\x97\
\x99\x6b\x7f\xd8\x9f\x03\x00\xe8\x44\xa0\x79\xa5\x3d\x5a\xa2\x0a\
\xf1\x08\xe5\x59\x7c\x98\x58\xd2\x22\xfd\xf5\xaa\x4e\x2e\x39\xf3\
\x1b\x37\x5b\xa3\x04\x0d\xb5\x87\x22\x89\x2d\x2b\xd2\xba\xf2\xa2\
\xef\xe4\x29\x9c\x2c\xaa\x78\x53\xad\xe4\x45\x22\xe4\x6d\x82\xca\
\x9b\x0e\xbb\xd6\xf2\x20\xf2\xc5\x3a\xaa\xbb\x4d\x42\x9a\x8c\x1c\
\xd7\x98\xb4\xdf\xec\xdf\xe7\x6e\xcf\x2c\xfb\xe7\xe3\xce\x5a\x5b\
\xa0\x9f\x78\x36\x4b\xe9\xf9\x52\x7f\x52\x22\x63\xa2\x6a\x17\xab\
\x8a\x49\xe4\x11\x44\x1e\x0b\x86\x71\xb8\x56\x13\xf4\x1e\x80\x92\
\xf1\x94\x7b\xb0\xb5\xa4\xad\x44\xe1\x37\xe9\x59\xe6\x61\x4f\x84\
\xd6\x24\xd2\xe0\x29\x52\x16\x12\x57\xe4\xe0\xb6\x91\xc7\x8c\xc4\
\xdd\xf9\xfa\xf8\x3a\xa4\x57\x5f\x5e\x38\x7d\xe3\x75\x11\x40\x10\
\x70\xbb\xb6\xc6\x01\xc7\x34\xbc\xb9\x5e\x26\xff\xa8\xe7\xa5\x31\
\xd9\x14\x70\x85\x46\x82\x6a\x09\xbd\xf8\xd1\x6f\x7a\xd9\x49\xf2\
\x4a\xa1\xca\x23\xac\x92\xe9\xb0\x73\x38\x67\xe6\x11\xf8\x88\xb6\
\xcf\x4f\x19\x48\x5c\x00\xf6\xf8\x97\x9f\x6c\xcb\x02\x00\xdc\x03\
\x44\x7b\x17\x69\x55\xe9\xe7\x62\xf7\xa8\x2a\x3f\x56\x4d\x26\xed\
\x11\x48\xe4\x8f\xf2\x46\x64\x03\x8f\x46\x12\xa1\x66\xd3\xd2\x4e\
\x52\xae\x6c\xa5\xcd\x41\xe6\x4f\xb4\x9b\x4f\xea\x7e\xe2\x85\x67\
\x23\xdb\xbf\x36\xef\x39\x62\xf3\x28\x7f\xf5\xeb\x9f\x1d\xf8\xf7\
\x04\xd2\x4b\x04\x2b\x4d\x95\xc4\xd8\xca\x08\xc0\xca\x9c\x52\x75\
\xd1\x20\x7b\xa6\x74\xd4\xfe\x82\xa7\x8d\x22\x03\xa3\xbb\x40\x97\
\x14\x47\x2f\x4c\x52\x09\x7d\x55\xc2\x3f\x13\x02\xd2\x20\x2e\x46\
\x61\x8f\x1f\xf4\xd9\xd2\xe7\xeb\x13\x5f\x7f\xf8\xc3\x17\x97\x9e\
\x2f\x01\x80\xae\x00\xc9\xa6\x93\x68\x7c\x91\x36\x89\xd9\x21\x68\
\x24\xab\xa0\x8f\x4a\xe7\xd9\x56\x33\xc7\xd4\xcb\xde\x14\x57\x98\
\x53\xbc\x7c\xdd\xa3\x8d\xc3\x89\x04\x93\x98\x8c\xc4\x0e\xab\xb1\
\x6f\x01\x95\x7b\x4c\x5e\xbd\xe4\x41\xe2\x60\x6f\x9c\xfb\xfc\x91\
\xa9\x7b\xf3\xca\xfe\xfd\x09\xcd\xce\x9e\x68\x61\x92\xdf\x98\x47\
\x86\x3b\x23\x28\x7a\x49\x03\xe8\x9f\x2b\x12\x95\xbc\x11\x9c\x1c\
\x8a\x62\x35\x06\x3b\x14\x87\x4b\xb9\x8b\x8d\x5f\xbb\x7d\x84\xb0\
\xa4\xe1\xb3\x56\x7f\xf3\x40\x4d\xf2\x5b\x0e\x4f\x1e\xf2\xe2\x86\
\x0c\x11\x00\xc6\x01\x4d\x2c\x8d\x4e\xa9\x88\x7d\x87\xc6\xcd\x67\
\x26\xff\x3c\x10\x41\xed\x17\xf1\x59\xdd\x9c\x90\xaa\xee\x45\x92\
\x2c\x34\x32\xee\xd3\x25\x8c\x24\x86\xc3\xb0\x33\x97\x58\x3f\x46\
\x23\x21\xa4\x56\x9f\x17\x3e\x9d\xf9\x66\xbf\x1a\x14\x37\x15\x6e\
\x7e\xe6\xee\x37\xb6\x66\x89\x00\x6a\x00\x1f\xf0\x77\x48\xde\xe7\
\xf2\x96\x64\x09\x42\x5b\xe8\x8f\xdc\x1a\xd0\x8c\xdf\x08\x3d\xe9\
\x46\x8c\xc4\x93\x31\x64\xf2\xe4\xbc\x3a\x5a\x63\x56\xd3\x40\x04\
\xd8\x82\xe2\xbf\xf5\x90\xd8\x4a\xb5\x1f\xe6\x1f\x0a\x88\x4a\xec\
\xf7\xca\x4f\x87\x4f\xfd\x4a\x87\x46\xb8\xba\x64\xe4\x7d\xd3\x53\
\xf2\xcb\x44\xf7\x17\x2f\xc1\x75\x6a\x08\xbc\x28\xf9\xa1\x42\x23\
\x9f\x33\x2e\xba\x3d\x97\x04\x66\x7c\xb2\x25\x5d\x99\xed\x64\xb5\
\x44\x54\xe3\x95\x2c\xa1\x39\x48\xc5\x06\x46\x17\x76\x91\xfb\x0e\
\xcd\x6a\x11\x32\x37\xd1\xd4\x4a\xae\xea\x27\x98\x24\x84\xc4\xb7\
\x1b\xfc\xdc\xf4\x9f\xf7\x5d\xce\x48\xfd\xf9\xed\x01\xb5\xe8\xee\
\xbe\xb2\xfc\xe1\x8e\x0f\x7e\x77\xae\xac\xfa\xd1\x4c\xa0\xb9\x72\
\xb2\xab\x26\x49\x82\xdc\x59\x16\x95\xe9\x41\x8f\xa8\x43\x05\x45\
\xfa\xfa\x90\x65\x1c\xfe\x50\x0e\xa8\x14\xf6\xa5\xf1\xa5\x5b\x0d\
\x34\xe2\xc2\x4b\xc1\xeb\xb9\xb7\x72\x7e\x56\xc3\x61\xa8\x4a\x50\
\x83\xa9\xbc\x76\xb6\xc0\x90\xb0\xf0\xf0\xf0\xb0\xf0\xb2\xff\x44\
\x44\x57\xae\xd9\xa0\x51\xe3\x26\x65\xad\x69\xa3\xf8\x70\x99\xfd\
\x5e\x5c\x34\xb2\xe3\x83\x73\x8f\x97\x65\xf6\x7e\x1a\x18\xcd\x8e\
\x8f\x49\x18\x45\x20\x90\x64\x11\xc8\x01\xb2\x00\x8f\xb9\xca\x4f\
\x7c\x82\x4b\x39\x88\x0c\x41\x48\x80\x4c\x65\x41\x1e\x28\x58\xce\
\x51\x3e\xd1\x45\x5f\x6d\x22\x3b\x0e\x98\xb9\x64\xf9\xc9\x56\x2e\
\x6f\xb6\x11\xa9\x27\x93\x2c\x21\x08\xcf\x47\x36\x55\x1a\x9b\x90\
\x9a\x9a\x9a\x94\x94\xa4\x0f\x33\xf9\xd8\xb8\x12\x2a\xdd\xb7\xf1\
\xd2\x77\x1d\x4d\x28\x46\xc5\xfb\x3f\xbf\xaf\xdf\x53\x4b\xca\xd2\
\xa8\xe2\x79\xe0\x7d\x20\x40\xc6\xe4\x29\xe3\x63\x47\xd9\xcb\x07\
\x8e\x00\x87\x81\x54\x20\xf5\xc6\x3f\xb2\xb5\x92\x6d\xb6\x09\x43\
\xd5\x93\x62\x9f\x0e\x74\xe5\x7a\x84\xc9\x6e\xae\xec\xe8\x70\x91\
\x84\xc7\xe6\xf3\xb2\x00\x65\x7e\xaa\x49\x39\x0b\x71\xb8\xf7\x69\
\xac\xa6\x5b\xd8\xb7\xdf\xd6\xb9\xc8\xdf\xf9\x71\xf2\xd0\x89\x4b\
\x4f\xfe\x7b\x06\x76\x02\x30\x89\x51\x06\xa7\x72\x75\x49\x68\x24\
\xe5\x01\x9b\x81\x35\xc0\x1a\x60\x17\xf3\x95\x0e\xd0\x05\xe8\x0e\
\xf4\x00\xda\x00\x81\x8c\x4c\x25\xe5\xab\x5a\x97\x67\x29\xb4\xa8\
\x1c\x49\xad\xd7\xaa\x56\xe2\x15\x68\xed\x24\xc1\x38\x62\x6b\xf4\
\x7d\x23\x7f\x8f\x46\xe6\x0d\x90\xfc\x72\x99\x70\x6d\xc3\xfb\xc3\
\x92\xdf\xf8\xf5\x5c\xe1\xcd\x9f\x3e\x01\x3e\x01\xf2\x81\x60\xc5\
\xe6\x11\x6d\x92\x8f\x30\x95\xf5\xc5\x7a\x60\x3d\xf0\x1a\x00\xa0\
\x13\xd0\x1f\x18\xe6\xc5\xfb\x27\x1b\x8d\x44\x05\xc3\x23\x51\xe8\
\x54\xeb\x00\x56\x7b\x45\xb4\x51\x09\xfa\x0a\xac\x72\x88\xf2\x51\
\xb9\x38\x59\xfe\x5b\x93\xcf\xac\xc8\x8e\x3e\xe4\x04\xb1\x30\xc9\
\xbd\xd9\x00\x66\xd5\x04\x68\x67\xce\x9f\x26\xa3\xf4\xf8\xb2\x37\
\x06\x26\xd5\xec\xfa\x92\x13\x1a\x95\xb7\x10\x46\x99\x43\xcb\x74\
\x22\x87\xae\xe7\x4d\xc0\x8b\x40\x75\xa0\x33\xf0\x15\x90\xe9\x0c\
\x45\x9a\xa1\x91\x42\xbd\xe3\x35\xb1\xba\xa0\x0f\xcd\x45\x02\x25\
\xae\xb6\x68\xab\x5a\xe4\x9b\x1c\x8d\x04\xb9\x68\xc4\x3c\x6d\xb1\
\x4a\xe1\x27\x7e\x04\x48\x6c\x2d\x15\x79\xc5\x33\xcc\xdc\x4e\x7f\
\x37\xbe\x43\xd5\x46\x03\xdf\x5c\x76\x24\xbb\x94\x09\xc7\xcb\x52\
\x9a\xfc\x20\xd3\x18\x20\x5a\x59\x66\x6e\xe6\x4a\x44\x76\x6f\xbe\
\x8b\xac\xcf\x97\xf3\x68\xda\xf0\x45\xd1\xe0\x5a\xcf\x5b\x2c\xa5\
\xda\x16\xa1\xa8\xda\xeb\x58\x98\xa4\x08\x90\x54\x59\xbe\x59\xc8\
\x54\xd6\x6a\xdd\xff\xc6\xb4\x0f\x9e\x19\xd8\xa4\x42\x00\x3b\x8e\
\xf7\x57\x5a\x8a\x8c\xdc\x74\x4c\x8c\x24\x9f\x50\xa4\x9e\x4f\xc6\
\x77\x29\x87\x64\xe3\x69\x3d\xc7\xc3\x67\x54\x68\x24\xc8\x92\x11\
\x7e\x34\x93\x85\x49\x2a\x02\x92\x60\x1d\x98\x76\x6b\x95\x6f\x19\
\x39\xe9\xc7\x03\xd7\x4e\xaf\xfb\xfc\xc9\xde\xf5\x23\x6c\x16\x41\
\x7c\xea\x71\x6f\x6e\x64\x4e\x98\xcb\x47\xad\xde\xf9\xea\x26\x2b\
\x12\xf9\x56\xaf\x2a\x59\x18\x54\x68\xa4\x97\x6d\x24\xcf\x48\xb2\
\x9a\xba\x16\x92\x85\x49\x9e\x5b\xf5\x2e\x8f\xfc\x6f\xe5\xd1\x4b\
\x7b\xe6\x3e\xde\xa9\x4a\xa0\x45\x0e\xd7\xd6\xa6\x3b\xf6\xce\xf6\
\xbd\x72\x94\xe7\xe8\x13\x15\x5f\x40\xc2\xde\x8e\x50\xc4\x9b\x4a\
\x62\xb8\x0c\x17\x35\xaf\x18\x69\x08\x4f\x9d\x12\x4c\xb2\x8c\xa4\
\x9b\x80\xa4\x86\xe4\xa8\x7a\x9a\xd7\xd8\x2d\xa4\xd9\xf0\xe9\x1b\
\xff\x39\xf0\xc3\xf3\xdd\x13\x82\x79\x95\x25\x5d\xda\xce\x3f\xd0\
\xe2\x49\xbc\xb0\x1d\xb9\xa2\x6f\x41\xe5\x8d\xad\x1c\x4d\x3a\x85\
\xa7\x7f\xa4\xc1\x8c\x02\x38\x55\x88\x88\x73\x5c\x13\x68\x9c\xa7\
\x4e\x60\x94\x3b\x5c\x4b\x09\xb2\x30\x89\xbd\x85\x24\x3b\x06\xcf\
\x23\x14\x59\x44\x2f\x6b\x01\x89\x43\x3f\x58\x73\x36\x75\xd9\x4b\
\x3d\xaa\x29\xb5\x95\x4c\x45\xd2\x1c\x7c\xf8\x31\x1a\x4c\xc1\xca\
\x2b\x2c\x31\x49\x94\x7b\x19\xe1\x0e\xa8\x23\x14\xe9\x68\x18\x89\
\xbc\x72\x4b\xf9\x76\xb2\x8c\x4d\x65\x89\x7c\xe1\x02\x3d\x7d\x38\
\x5f\xcf\x59\xea\xd1\x46\x48\x20\x86\x98\x64\xb5\xf2\x56\x6b\xc0\
\xbb\xbf\x1f\xfa\xed\xe5\xce\x95\x02\x64\x09\xe7\xbf\x3a\xfc\x9c\
\xd9\xc8\x72\x7e\x0f\xee\x78\x12\x23\x37\x20\x47\x64\x80\x49\xaa\
\xea\x20\x25\x86\x91\x5e\x2b\x74\xdd\xb5\x1e\x39\x32\x49\x54\x54\
\x92\x81\x46\xfc\x4c\x81\x85\x49\x72\x00\xc9\x85\x34\x4c\x4e\xc0\
\x59\x7b\x7d\xae\xad\x42\xf7\x77\x36\xec\x5f\x32\xa1\x75\xb4\x4d\
\x8e\x44\x1d\x7f\x02\x11\x2f\x9a\x91\x2c\x22\xe6\xce\x44\xfb\x6f\
\x71\xba\xc8\x87\xa5\x2e\x30\x7e\x2c\xdd\x8a\xaa\x3c\x24\x8c\x93\
\xdc\xc4\x1c\x5a\x00\xf2\xe2\x6c\x45\xc9\x83\x44\x82\xa1\xc8\x62\
\x61\x12\x79\xb3\x93\x13\xc5\xc2\x12\xd5\x5a\xd5\xbb\x3e\xde\xb9\
\xbb\x55\x72\x8f\x87\x17\x9c\x2c\xa0\xbb\xb3\xde\x74\x96\x82\x13\
\x18\x55\xad\x6e\x62\xd2\x8d\x96\x58\x2f\xa1\x52\x74\x64\x64\x64\
\x64\x54\x64\x64\x64\x64\x64\x44\x58\x50\x19\x66\x16\xe7\x67\x67\
\x67\x67\x67\x67\x67\x65\x65\x65\x67\x67\x65\x5c\x3a\x7b\xfc\xc8\
\x91\xd4\x23\x65\xff\x3f\x72\xe2\x9f\xeb\x05\xcc\xc4\xff\xe0\x6a\
\x34\x3a\x89\x65\x4f\xa3\x67\xb4\xd4\x9a\x46\xf0\x9e\x79\x41\xe4\
\x4f\xdd\x70\x01\x12\x7c\x2c\x0d\x25\x72\x5c\x31\x5c\x67\xd0\xf2\
\x80\xa0\x0e\x93\xd0\x25\xe0\xf0\xd7\xb5\xbb\x5d\x4b\x88\x56\x95\
\xc4\x69\x5f\xf4\x6c\xff\xda\xde\x7c\xad\x2c\xcb\xe0\xc8\x8a\x31\
\x31\x31\x31\xb1\xb1\xb1\xb1\x31\xb1\xb1\xf1\x0d\x5a\x77\xee\xd6\
\xad\x6b\xab\x1a\x21\xb2\x7b\xac\x3b\x62\xfe\x96\x60\xa1\xc3\x88\
\xf9\xa7\x0a\xbd\x0a\x15\x7b\x51\x09\x88\xac\xd5\xf2\xb6\x6e\x3d\
\xba\x77\xef\xde\xbd\xeb\xad\xcd\xe3\x89\xb2\x09\xd9\x43\x22\x2a\
\x84\x44\x54\xa8\x54\xf5\xc6\x0f\x5d\xee\x74\xfc\x73\x41\x7a\xca\
\xb6\x0d\x6b\xff\xf8\x63\xed\xda\xb5\xeb\xb7\x1f\xbd\x52\xa8\x0c\
\x13\xf2\x8e\xa2\xd7\xf3\x98\xfc\x3c\x9e\x6b\xf0\xaf\x39\xef\x0d\
\x93\x1c\x55\x8f\x51\x42\x3f\x8c\x88\x97\x54\xba\xd2\xa7\x79\xa4\
\x76\x05\x6e\xe3\x06\x01\xf9\x27\x26\x79\xc8\xf6\xed\xd9\x31\x92\
\xac\x3d\x7d\xe9\xb2\x7d\x9f\x9d\xda\x3a\xf1\xb9\xdd\xf9\xba\x12\
\x33\xa4\x4a\xe3\x0e\x5d\x7b\xdd\x35\xec\x91\x87\xfb\x26\xca\x83\
\xa6\xd3\x33\xef\x68\xfb\xd8\xca\x4b\xce\x19\x1d\xc6\x02\x5f\xb2\
\x04\x24\x21\x24\xbe\x6d\xff\x07\xee\xbf\xfb\xce\x9e\xdd\x6f\x6f\
\x52\x59\xd5\x63\x51\xd9\x27\xb7\xae\x5d\xb3\xfa\xe7\x85\xf3\x17\
\xad\x3b\x92\x51\xa2\xa4\xa7\xc7\x5f\xc0\xff\x5a\xdc\xcc\x89\xee\
\x8d\x97\xd8\x9c\x7e\xd5\x03\x90\x8c\xb2\xdf\x2a\x4f\x51\x4a\x23\
\x93\x7a\x98\x24\x6a\x3b\xfb\xd2\x09\x76\x65\x2c\xf4\xfd\x0d\x93\
\xb4\x3b\xa4\xe9\x07\x94\x15\xf3\x2f\x1e\x5c\xf7\xfd\xb4\xa7\xfa\
\x35\x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\x63\x0f\xaa\xda\x61\xcc\xb4\xd5\x67\x44\xee\x5a\xde\xc1\
\xc5\x6f\x0c\x69\xa6\x34\xbd\x9f\x04\x8b\x8a\xca\x3e\x6a\xf3\x8c\
\xc9\x00\x49\xe6\x8d\x0a\xce\x27\x91\x23\xa5\xc6\x53\x4f\xc8\xb4\
\xee\x1f\xab\x79\x06\x24\x47\x92\xd1\x6a\x01\x53\x02\x12\x15\xdf\
\x7b\x30\x42\x2b\x76\x7a\x7b\x67\x11\xa5\xbe\x2e\x58\xf7\x50\x4d\
\x65\x76\x4c\x70\xf5\xdb\xc7\x7f\xbe\xe1\xa2\xc8\x75\x2b\x3e\xb1\
\xe2\x83\xe1\x6d\x62\xed\xea\xcf\x0b\x5b\xad\x64\x44\x23\x49\x5f\
\x2d\x4c\x08\x4b\x3c\xcc\xbe\x16\xaf\x6c\xe1\x10\x15\x20\xf9\x58\
\x7b\x6a\x44\x4a\xe3\x01\x92\xb7\x16\x50\xa5\xff\xec\xb3\x94\xba\
\x3a\x7d\x4e\xd7\x28\x99\xde\x8d\xc0\xb8\xce\x4f\x7f\x7f\xb4\x54\
\x34\x4a\xcb\xdd\x3d\x73\x74\xcb\x0a\x36\x5d\x14\xb1\x3c\xc5\xa4\
\xaf\x12\xf7\xb6\xc4\x96\x5e\x71\x6b\xaf\x91\xa9\x3a\x64\x6e\x21\
\xa9\x0d\x48\x56\x1d\x03\x35\x9a\x4d\xda\x89\x69\x35\x26\xfe\x8a\
\x92\x8b\x3f\x3f\xd1\xf7\xd5\x3d\x54\x1c\x5c\xf9\xc1\x57\x06\x56\
\xa3\xf6\x68\x05\xc4\xb4\x19\xf7\xd5\xae\xb3\x1b\x3e\xba\xb7\xbe\
\x71\xf6\xc9\x43\x5b\x8e\x9b\xb3\xfb\xd4\xc6\x69\xf7\x35\x52\x23\
\x13\xba\x4a\x74\xd0\x86\xbc\x0c\x57\x7e\xcc\x33\x2d\xd1\x62\x83\
\x8f\xe1\x09\x2c\x81\x5f\x23\x43\x47\x34\x61\x91\x1d\x7d\xdf\xc5\
\x26\x43\x42\x3c\xfe\xdb\x6a\xd2\x02\x9f\xb7\xef\xc3\x07\x5e\xdc\
\x49\x53\xa0\x2f\xb0\xdb\xf3\xc3\xea\x51\x24\xba\x13\xc2\x1b\x3e\
\x30\x7d\xcb\xe9\x1d\x33\x47\x35\x0b\x32\x20\xf9\xa2\x6f\x7d\xea\
\xbb\x43\xc7\x57\xbd\xd3\xaf\x66\xb0\xc6\x53\x23\x43\xa9\x09\xbe\
\x44\x83\x15\x1a\x29\x11\x3a\x25\xe3\x51\x43\x29\xd1\xa2\x0b\xe7\
\xa7\xca\x5c\x10\xd4\x04\xc8\xc4\xc3\xf8\xad\xda\x3c\x9a\xa9\xbc\
\x82\x94\xcf\x1e\x9d\x7a\x92\xa6\xd3\xa6\x23\xfb\xc7\x13\xda\x48\
\x21\x75\x87\xce\xd8\x76\x70\xfe\xe3\xed\x22\x0c\x4d\xc6\xb8\x1e\
\x2f\xff\x9c\xb2\xee\xdd\x5e\x55\xed\x3a\x4c\x10\x03\xf0\xf0\x88\
\x01\xb2\x37\x0c\x5c\x2a\x91\x6b\xbc\xe5\x20\xaa\xd6\x2d\x21\x32\
\x09\x9a\x5b\x3c\x26\xb0\x30\x8c\x3e\x6c\x9b\x0c\xa9\x63\xbb\x2a\
\x34\xba\xb1\x4b\xa1\xe9\x72\x77\x7f\xf8\xdc\xf2\x1c\xe2\xcb\x4b\
\xaf\x9e\x3d\x91\x4e\x70\x98\x34\x28\xa1\xef\x94\x8d\x07\x7f\x78\
\xa4\x89\x39\x56\x17\x61\x1d\x5e\x5a\x75\xe8\xd7\x89\x1d\x63\xc8\
\xb0\x78\x22\x07\x98\xe4\x62\xc1\x30\x8c\x9e\x62\x1b\xfe\xcb\x95\
\x17\x97\xc8\x8f\x27\xf7\x9c\x96\xf6\x6f\x5a\x16\xd1\xae\x71\x5c\
\xbb\x69\x0c\x23\x99\x80\xc4\x67\xf2\x60\xdd\x7d\x0b\x02\x29\x4d\
\x4a\x2f\xad\x7a\xff\xeb\xf3\x84\x70\x74\x69\xc5\x63\x43\x7f\xcc\
\xf3\x71\x95\x3d\xae\xeb\x1b\xab\x0f\xfd\xf2\x6c\x9b\x10\x53\xcd\
\x40\xc5\x9e\xef\x6f\xda\xbf\x70\x7c\xcb\x28\xdf\xfc\x39\x09\xd8\
\xa6\x5a\x94\x01\x3f\x05\x1d\xe4\x21\x93\xc2\xb1\x29\x24\xa9\x3f\
\xe4\xfa\x37\x28\x08\x71\x6b\xcf\xd9\x65\x08\x06\x5b\xf3\x48\x97\
\xa9\x14\x25\x65\x46\xf9\x90\xbc\x2a\x8e\x9c\xbf\x67\xce\x3e\xf6\
\xf8\x6b\xf5\x7d\xc3\xd1\x2f\x8f\x26\xff\x90\xe1\xc3\x34\xaa\x75\
\xdf\x9c\x4d\xdf\x0d\x4b\x60\x4e\x9e\x9c\xb4\xd4\x43\x29\x29\x29\
\x87\x0e\xa5\xa4\x1c\x3e\x76\xf6\xd2\xf5\xcc\xac\xcc\xac\xcc\xac\
\xcc\xcc\xac\x9c\x22\x21\x34\x22\xaa\x2c\xdb\x6a\x54\x54\xc5\xb8\
\x9a\xf5\x1b\x36\x6c\x54\xf6\xbf\xc4\x6a\xe1\x6c\x07\x11\x7f\xf7\
\xa7\x3b\x1b\xd4\xe9\xdd\xfd\xc5\x35\x97\x7c\x98\x89\xf7\x00\x87\
\x81\x70\x5f\xd3\xaa\xb6\x6d\x24\x9f\x2b\x64\xb1\x96\xcc\x8a\x30\
\xf4\x1b\x39\xea\x11\x53\xd5\x69\x12\xd4\xcf\x1b\x64\xe8\xf2\x3a\
\x7c\xba\x16\xed\x4c\x64\x43\x97\xf5\x97\x2e\x18\xa6\x98\x03\x0b\
\x8e\x2e\x59\x78\xe2\xb5\x97\xea\x4a\x3f\xeb\xda\xda\x67\x47\x2e\
\xc9\x92\xbc\x26\xb8\xde\xf0\x6f\x37\xcd\x1d\x5a\x95\xd5\xfb\x65\
\x3c\xde\x8e\x8c\x00\x00\x20\x00\x49\x44\x41\x54\x1d\xdf\xbc\x7a\
\xd5\xaa\x55\x2b\x57\xae\x5a\xb7\xfb\x4c\x36\x7d\xda\xb9\x80\x88\
\x9a\x2d\xbb\xf4\xec\xdd\xab\x77\xef\xde\xbd\x3a\x27\x46\xb3\xb1\
\xdf\x9b\x3d\xfb\xfb\xfa\xc0\x3b\xba\x3c\xb3\x52\xd2\x75\x79\x0e\
\x98\x0c\xbc\xe5\x85\xb5\x14\x66\xfe\x96\xd0\xc8\xe4\x90\xa0\x4a\
\x51\x66\x32\x64\xe2\x36\x47\xa7\xe0\x5d\x4b\x9a\xa9\x8e\x9a\xe3\
\xec\xf8\x9c\x88\x72\x90\x50\x9b\x02\xdc\x6e\x74\x79\x48\xae\xca\
\x83\x8d\x52\xf6\x17\x55\x93\xab\x52\xad\xa6\x59\x2e\xbd\xc3\x6e\
\x9d\x79\x72\xf3\xb8\x38\x89\x87\x65\x6d\x1e\xdf\xa0\xd3\xe7\x17\
\x25\xfa\x08\x49\x1c\xb3\x60\xf3\xec\x41\x95\x18\xcc\xc3\xf9\xcd\
\xf3\xbe\xfc\xe2\x8b\xaf\x96\xfc\x75\x36\x8f\x15\x93\x0a\xc1\xd5\
\xda\xdc\x35\x62\xec\xb8\xb1\x23\xba\xd7\x65\x11\xf0\x77\x64\x46\
\xbf\xdb\x9f\x5c\x71\x41\x2a\x35\xa0\x0d\x48\x05\xea\xab\x24\x24\
\x0a\xd0\x48\x4e\x1e\x52\xb9\xcc\xe6\x35\x97\x52\xb2\xfc\x85\xa0\
\xc0\x48\xcc\x49\x7a\x76\xd4\x92\x4c\x34\xb2\xc6\x99\x55\x65\xcc\
\x05\x09\x5a\xb0\x05\x27\x12\x28\xd2\x71\x41\x60\x45\xd9\x69\xde\
\xf2\x52\x57\xef\x93\xd2\xad\x85\x87\xa7\x8d\x94\x44\xa3\xd0\x46\
\x8f\x2c\xda\xaa\x18\x8d\x8a\x8f\x2e\x9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e\xd8\x73\xad\x44\xb3\
\x09\xcf\x39\xb6\xe2\xfd\xfb\x5b\x54\x69\x32\x64\xf2\xba\x2b\xf2\
\x27\xab\xc5\x6b\x2b\x66\xde\x23\x69\x26\xe1\x61\xa0\x48\x47\x76\
\x4a\x56\x7d\x57\x95\x95\xcd\x24\xf0\x84\x46\x3e\xb5\x30\xcf\x68\
\xa4\xea\x5d\xe4\x04\x91\x19\xe1\xc2\x1f\x38\x69\x0d\x48\x1c\xee\
\xa5\x09\xc4\xf2\x29\x10\xbf\x97\xa4\xe2\x10\xf3\x2e\xa5\x65\x7b\
\xfc\x4b\xf1\xe9\x6f\xc6\x7f\x7b\xcd\xab\x71\x14\xd7\x6f\xfa\x6f\
\x1f\xde\x2a\x77\x57\xe6\xc2\x6f\xaf\xf6\xac\xd3\xf6\xa1\x99\x5b\
\xd3\x75\x51\xda\xa5\x59\x87\x16\x4f\xec\x51\xaf\xf5\xb8\xb9\x87\
\x8a\x65\x76\x51\xf9\xfe\xef\x96\x3e\xd7\x5c\xa2\xaa\xed\x01\x60\
\x83\x56\xe6\x91\xa3\x96\x27\xf2\xce\x49\xf6\x20\x7b\xf5\xa3\xb1\
\x2c\x28\x94\x62\x93\x05\x32\x68\x13\x2d\x42\x08\x18\xca\xfd\x84\
\x3c\x80\x93\x8d\xf9\x8b\xf1\xe3\x19\xd0\x5e\x50\x49\x75\x73\x7e\
\xa6\xc7\xe0\x8b\xec\xbf\x5e\x7f\x65\xbf\x37\x17\x5a\x68\x93\x27\
\x17\x2f\x1e\x5d\x5d\xd6\x03\x4b\x0e\xce\x1e\xd9\x2c\xb1\xdf\x3b\
\x6b\xce\x17\xca\x1d\xf3\xe9\xcf\x70\x6d\x0e\xf2\xbe\xc2\xe5\xcf\
\x70\x72\x2a\xf6\xbe\x8b\x0d\x2f\xca\x78\xf3\x8c\xdd\xb3\x46\xb6\
\xaa\x7b\xe7\xdb\xf4\x75\xa2\x00\x00\xf6\xf6\xef\xff\x3a\xbd\x5f\
\x9c\xc4\x91\xd9\xa7\x80\x62\x0d\x39\x93\x10\x8a\x88\xce\x33\xe9\
\x8d\x4c\x54\xc1\x84\x22\x7d\x9f\x46\x44\x23\x9f\xca\x50\xb3\x9c\
\x9f\x24\x50\xc1\x2c\xed\x21\x3f\x41\x0d\xaa\x06\x89\x6a\x6c\x1e\
\x69\x96\x52\x9e\xb6\x7f\xb1\xb4\xc4\xc3\x2d\x25\xe7\x17\x3c\xf5\
\x7f\x5e\x4e\x1e\x09\x11\xed\x5e\xff\x71\x6a\x67\x59\x59\xde\x2e\
\xfc\xf8\x58\xcb\x5b\xc6\xcd\x3d\x90\xe5\x63\xb7\xa8\x06\xf0\x30\
\xb0\x14\xf0\x88\x15\xb5\xc6\xa3\x42\x08\x42\x82\x11\x5b\x01\xb5\
\xab\xa2\x79\x6d\xdc\x36\xd9\xf5\x9a\x25\xc0\x38\xa0\x86\xaf\x01\
\x15\x9c\xfd\xed\xb5\xde\x4d\x07\x7c\xbc\x4f\x96\xd3\xb0\xfa\xe8\
\x1f\xe6\x0e\xf3\x5e\x9a\xe3\x00\xb0\x43\x43\x34\x62\x02\x45\x6c\
\xb9\x9d\x6a\x8d\x25\xf8\x5a\x6f\x49\xe8\x38\x06\x55\xa3\xe4\xa2\
\x91\xf6\xe5\x8b\x98\xc0\x92\xf2\xbc\x1b\x82\xe9\x0f\x1b\xbb\x94\
\x9f\x50\xcf\x3c\xa2\xcf\xf4\x2e\xbf\xfc\x84\x96\xf5\x4e\x64\x3c\
\x2b\xa2\xdb\xf7\x99\xee\x15\x90\xf6\xbd\x58\x0d\x5e\xe1\x68\xd2\
\x11\x79\x65\xf0\xb6\xbe\xdb\x23\xce\xee\x6b\x49\x32\x12\xf8\x0b\
\x28\xf5\x35\x72\xe9\xfd\xdb\xf2\x1b\x4b\x81\xad\xc0\x68\x9f\x67\
\xdc\x84\x88\x66\x8f\x2e\x4d\x93\xf5\x5a\xd9\x2b\x1e\x4c\xf0\xde\
\x7b\x17\xb7\x77\x51\x5e\x7d\x80\x2a\x74\x4a\x76\x3d\x0b\xb6\x1f\
\x95\x74\x31\x75\x99\x06\x75\x4a\x5a\xa8\x44\x55\x09\x9e\xa7\x4a\
\x6b\xab\x71\xf1\x3d\xf3\xa4\xcb\x71\x04\x24\x8d\xd1\x48\x25\x40\
\xd2\xb8\x06\x97\x8c\x07\xc5\x0e\x5e\x57\xe2\x3a\xfc\xcc\x35\xf7\
\x84\x31\x86\xa3\x2b\xcb\xc6\x26\x85\x4a\xaf\xa8\xa6\x01\x39\x34\
\x83\x27\x01\xa4\xf2\x4f\x2e\xf0\x19\x10\x23\xe9\x82\xab\xd2\xe7\
\xe3\x14\x39\xef\x96\xb9\xfc\x81\xea\x01\xde\xd7\xfe\xa7\x74\x42\
\x23\x85\x05\x96\x44\x6e\x90\x89\xa4\xae\x92\xc6\x7e\x11\x6d\xa8\
\x6a\x35\x5e\x00\x49\x3d\x24\x17\xb9\x01\x24\xcd\x3c\x84\x92\x4f\
\x0c\x6a\xfc\x6a\xaa\xcb\xe0\x4b\x2f\xcd\xeb\x10\xe0\x05\x8e\xda\
\x4f\x96\x03\x47\x99\x2b\xc7\x37\x0e\xf5\x36\xd4\x60\xe0\x7d\x20\
\x5b\xae\x76\xa6\x9a\xe2\x3c\xe0\x23\xc0\x7b\x12\x72\x7b\xd5\xfe\
\x5f\x9e\x90\xf1\x82\x19\x3f\xde\xeb\xbd\x5c\xd4\xb3\x9a\x2b\x23\
\x25\xfd\x8b\x5a\x7d\x74\xb1\x90\xa0\x32\x61\x2d\x40\x32\x21\x20\
\xa9\x6a\x5a\xca\x9d\x7b\x36\x80\xa4\x57\xf3\xfe\xf4\x0a\x7d\x97\
\xe7\xba\x54\xf2\x3e\x37\xbd\xa1\x67\x53\x26\xbc\xad\x1c\xeb\x28\
\xf7\xcf\xe7\x5a\x84\x7b\xb3\x8d\xee\x01\xd2\x15\xc8\xa7\xbc\x52\
\xa4\xd7\x80\x07\xbd\x92\x2a\xb0\xc6\xbd\xf3\xce\xd3\xbf\xe5\xb5\
\x45\xf7\x54\xf5\x02\x49\x51\x40\x9e\x56\x9a\x88\x55\xfd\x59\x3e\
\x31\x49\x6d\x17\x1c\x6f\x84\xb5\x1a\x47\x80\xa4\x86\xa7\x52\xc1\
\xc4\xcb\x07\x24\xe5\x92\xa0\x62\x0b\x6d\xf3\xbf\x73\xce\x43\x2f\
\x3a\xfa\xb6\xe7\x48\x80\xa0\xc4\x67\x76\xd2\x57\x22\x4f\x99\xdc\
\x31\xda\x23\x1a\x85\x03\x0b\xe9\xf7\x57\x58\x29\x0e\x11\xf8\xc5\
\xab\x07\x2f\xb8\xfe\xc3\xab\xb2\xa9\xdf\x34\xed\x8b\xdb\xbd\x96\
\x79\x5f\xa7\xb6\x53\x8b\x11\x19\x45\x43\x01\x92\x8e\xce\x06\xf7\
\x47\x33\x07\x24\xab\x71\x01\x48\x84\xe6\x91\x6c\x2b\x4a\xee\xac\
\xcb\x0f\x6a\xe0\x19\x90\x02\x93\x26\x1e\x72\x1e\x79\x61\xca\x44\
\x8f\x99\xed\x02\xaa\x0e\x5d\x9e\x45\x1d\xc6\xb0\xee\xf1\x44\x8f\
\xc1\x78\xcd\x81\x7f\x54\x50\x61\xb4\xbd\x5d\x06\x6e\xf5\xd8\x51\
\x40\x5c\xff\x6f\xe8\x43\x1c\xf6\xbc\xd8\xd0\xcb\xb9\xac\xde\xea\
\x39\xb2\x18\xee\x4e\xe9\xf1\xe1\xb6\xc9\x09\x3a\xb0\x00\xc9\x5c\
\xed\x66\xd8\xb7\x44\x30\xa2\x0b\x0e\x51\x17\xbe\x54\x50\x68\x4b\
\x97\x46\x92\xb8\x5e\xae\x87\x33\xb0\xce\x5d\xc3\x1a\x39\xfd\x52\
\x74\xfc\xeb\xaf\xd2\x3d\xd9\x33\x6d\x5e\x9c\xd2\x9f\xb2\x00\xec\
\xa5\x05\x0f\xdc\xff\xf9\x91\x02\x4f\x6e\xba\x2d\x40\xbc\x5c\x35\
\xc1\xb0\xc5\x02\x7f\x00\xa3\xdc\xff\x50\x92\xfe\xcb\x13\x83\xde\
\x4f\xa1\xec\xae\xc5\x2b\x93\xfa\xc5\x79\x3c\xdd\xbd\x16\xc8\x26\
\x9b\x6b\x0e\xbd\x55\x3a\xc2\x00\x67\xfe\x6d\xab\xe9\x34\x23\x3a\
\xcd\x87\xef\x4c\x0d\xee\x6a\x97\xcf\x6c\xf6\x1a\x63\x52\x19\x11\
\xa8\x23\x3b\x43\x1a\x8f\x7c\xb8\x89\x33\x1e\x9d\x98\xfb\xb5\x07\
\x3c\x0a\x48\x18\xf2\xde\x63\x35\xe8\x06\x7d\xfc\xa3\x41\x8f\xfe\
\x74\xc1\xed\x74\xcf\x33\xc0\x0f\x40\xb8\x32\x7d\xc1\x10\xab\x42\
\x80\xd9\xce\xd5\x22\xfe\xed\x2d\x6b\xeb\x9b\x83\x9e\xdc\x44\x77\
\x76\x37\xe2\xae\x77\x1f\x69\xec\xc9\x24\x2c\x02\xb6\xb1\x43\x23\
\x95\x0e\x0c\xe8\xa5\xfd\x25\xc6\xa0\x4b\xcc\x82\xd5\xa8\xe9\xa6\
\x5e\x44\xb4\xc8\x41\x72\x55\x6f\x18\xa3\x3d\x1a\x7d\x68\x20\xd0\
\x4a\x76\x12\xac\xf3\xef\xe3\xb3\x3e\xa8\x2f\x75\xfa\x46\xa8\x70\
\xfb\x0b\x8f\x38\x97\x42\x2a\x3e\x3d\xff\x9b\x4b\xee\x57\x86\xb5\
\x7e\xf6\xad\x6e\x74\x49\x82\xce\x4c\x1f\xf9\xe6\x96\x4c\x57\x56\
\x7a\x0c\xf8\x00\x08\x50\x47\x95\x28\x61\xbb\x97\x81\x57\xdd\x7e\
\x2f\x48\xfd\x62\xcc\x7f\xb7\xd3\xe5\x7b\x6d\xf8\xec\xeb\xbd\x62\
\x3d\x2e\xac\xa6\x2b\x46\x23\xd1\xec\x56\x91\x8e\x78\xc9\x84\xb0\
\x82\x7e\xe3\x37\x1f\x1a\x71\x51\xcb\xdc\xe5\x60\xac\xcb\x6b\x6b\
\x79\xbc\xab\x8c\x41\x1d\x00\x49\xb7\x3d\x24\xaa\x36\xe7\x01\x0c\
\x6f\x81\xea\x81\x04\x97\x06\x37\x79\x65\xbf\xcb\xa8\x4b\xce\x4e\
\xa9\xe9\x41\x5f\x57\xbe\x7b\x39\xe5\x16\xff\xc5\xaf\x7a\xc5\xb8\
\x69\xe5\x51\x40\x91\x6a\x7b\x0f\xca\x3b\x2c\x01\x9e\x72\x7f\xf9\
\xd0\x16\x6f\x1c\xa4\xdc\x49\xda\xf1\x44\x5d\x4f\xeb\x80\x70\x20\
\x5f\xfd\x48\x0d\xbd\xa8\x67\xe8\xad\x26\x91\x32\x72\x41\xc6\xa8\
\xb4\x7c\x65\xed\xcf\xa5\xb2\x7d\xa2\x63\x85\x0b\x8d\x4b\x5d\x90\
\x02\x92\x12\x34\x92\x73\xb6\xd9\xd3\xea\xc7\x10\x80\x44\xdc\x02\
\x6b\x8f\xfd\x23\xdf\xf5\xfc\xd1\xe5\xaf\x9a\xb8\x2f\xf2\x02\xeb\
\x3d\xb9\x93\x4e\x23\x5f\xfd\x61\xa0\xdb\x4e\x4a\x17\xa0\x40\x35\
\x25\xc5\xaa\xc3\x22\xe0\x6e\xb7\x79\x8f\xe8\xf0\xd1\x49\xba\xf7\
\x3f\x35\xd9\xcb\xe4\xa7\x72\x13\x84\x6d\x01\x92\x0c\x34\x72\xbf\
\x9e\x4f\x40\xe2\xc1\x48\x92\x81\x22\x1e\x71\x48\x67\x4c\xf2\x08\
\x48\xee\x68\xa4\x47\x6a\x0a\x53\x01\x52\x50\xfd\xf1\xeb\x0b\xdc\
\x8f\xaf\xfe\xdc\xd1\xdd\x9b\x16\xda\x7a\xca\x69\x2a\x75\x5c\xb8\
\xfe\x21\xd7\xe4\x6e\x95\x68\x0e\x1b\xe9\xfb\xb9\xe6\x9e\xfe\x4e\
\x88\xe9\xf3\x7f\x57\xe8\x10\x79\x7e\xaf\x0a\x9e\xdc\x37\x53\xc8\
\xcf\x57\x69\xa8\xe2\x45\x83\x03\x12\x73\x55\x45\x3e\x3b\x16\x20\
\x91\xa0\x8b\x72\x28\xd2\x0b\x90\x48\xb3\x7d\xfb\x43\x20\x83\x8a\
\x54\xae\xd0\xf9\x9d\x65\x9f\xde\xe6\xb6\x27\x54\x98\xb2\x60\x97\
\x5b\x0c\x42\x64\xdb\xc7\x86\xd7\xa4\xe9\xfd\xfc\x97\xff\xfd\xfe\
\x8c\x4b\x8a\xeb\x5f\x81\xca\x06\x21\x4e\x05\xe0\x57\x17\x46\x14\
\xaf\xae\x7d\x67\xf2\x3e\x9a\x4e\x2a\x0e\x9a\xd0\x2d\xd6\x03\x22\
\xcd\x27\xb0\xc8\xb5\x3f\xe9\xc9\x7f\xf3\x51\x7a\x43\x60\xff\x38\
\xe9\x40\x5c\x13\xe4\x14\xd5\x72\x95\xef\x13\x4b\xb8\x4d\xd2\x4a\
\x54\x0f\xc9\x42\x23\x45\xc2\x16\xde\x7c\xc2\x92\x95\xcf\x37\x76\
\xff\x4b\xe9\x85\x15\xbf\xbb\xd6\xa1\x10\x2a\x76\x9e\x30\x84\x06\
\x4b\x4a\x36\xbd\xf9\xe1\x76\xe7\x00\xe7\x77\x81\xb6\x86\x22\x51\
\x53\xb7\x00\x84\xc2\x23\x73\x5e\x59\x94\x41\xd1\x45\x68\xef\x27\
\xfa\x54\x75\xe7\xe6\x43\x40\x81\xf1\xe1\xc1\x6a\x90\x75\x68\x84\
\x93\xa3\x26\x12\xd8\xa3\x93\xf3\xe9\x5f\x4c\xe2\x10\x96\x7c\x03\
\x92\x85\x46\x8a\xe8\x1b\xdd\xee\x85\x15\x5b\xa6\x75\xf3\x98\x38\
\x35\x6b\xd3\xe2\x2b\x6e\xce\xaa\x2e\x8f\xf5\x8d\xa4\x78\x40\xda\
\xac\xff\x7e\x77\xda\xd1\x3c\xaa\x03\x3c\x6d\x40\x42\x3d\x04\x38\
\x85\xc3\x8b\x57\x56\xbf\xf5\xd1\x61\x8a\x0e\xec\x5d\xc6\xf7\x73\
\xcf\xb7\x5a\x00\x5c\xb0\xb8\xd0\x5f\x01\x8c\x13\x03\xcb\x77\x99\
\x12\xd6\xb0\x44\x8e\x34\xbc\x61\x92\x87\x7a\x48\x16\x1a\xb1\xa2\
\x6d\xd4\x7f\x1e\x59\xb0\x77\xdb\xa4\xdb\xbd\x1c\x01\x2a\x4c\xfd\
\xf1\xb8\xe8\x8a\x47\x9d\xc7\x74\xa3\xd9\x0a\xdb\x3b\x65\xea\xb6\
\x2c\xa7\x5f\x16\x00\xa1\x06\x24\x56\x10\x30\xcf\x05\x4b\x0e\xcd\
\x7c\x73\x75\x01\x45\x17\xed\x47\xf6\xf4\x94\xdb\x6e\x8b\xc5\x89\
\x0a\x54\xb9\xda\x26\x82\x39\x9a\x6f\x17\x59\x32\x29\x95\x94\x13\
\x8a\x16\x63\xfc\xba\x84\xb9\x9f\x34\x7b\x4c\xcb\xe1\x1f\x6f\x38\
\xf5\xf7\xe7\xf7\xd6\xf2\x7e\xd1\xb5\x0d\x1b\x0a\x5c\xf1\xa8\xd3\
\x98\x6e\x14\x70\x52\xba\x79\xfa\xc2\x93\x8e\x05\xc9\xef\x05\xda\
\x1b\x96\x68\x2d\x80\xd1\x4e\x6f\x97\xbe\xfa\x93\x15\x59\x14\x82\
\x75\xcb\xc8\xee\x55\xdc\x19\xfa\x37\x8b\x1d\x75\xd4\xd4\x37\x34\
\xac\xee\x4b\x5b\x55\x55\x2e\x89\x42\x27\xa7\x80\x3c\x58\x2a\x1b\
\x83\x6c\x68\xe1\x04\x96\x6c\x0c\xcd\x23\x73\x2f\x82\x88\x26\x35\
\xa4\x4a\x93\xae\xc9\xff\x9d\xb3\xf1\xcc\x95\xdd\x73\x27\x74\xac\
\x28\x79\x71\xfe\x81\x15\x57\x5d\x7e\x8a\x6a\x33\xec\x76\x0a\x3c\
\xca\x5f\xfd\xf1\xcf\xe7\x4b\x1c\x45\xee\x3d\x23\x6f\xff\x0a\xc0\
\x5b\x4e\x1c\x29\x5e\xdd\xf0\xe9\xd2\x2b\x14\xcc\xdc\x61\x44\xe7\
\x4a\x6e\xef\xbf\xde\x82\x05\x9d\x14\x77\xb9\x42\xf0\xa8\x49\x7c\
\x5a\x15\x7e\xbe\xbd\x27\x03\x96\x94\x23\x8a\xee\xb0\x64\x57\x8e\
\xe7\x8e\x9c\xa7\x6a\x05\x74\x9e\x9a\x2d\x28\x3c\xba\x62\x4c\x4c\
\x4c\x4c\x6c\x6c\x6c\x4c\x4c\xa5\x6a\x0d\x5a\x75\xee\xda\xad\x7b\
\xb7\xb6\x35\x89\xf1\x44\xbc\xba\x71\xaf\x4b\x68\x5c\x78\xb3\xc1\
\xb7\x53\xec\x1f\x65\x2e\xff\xe4\xf7\x4b\x0e\x59\x0d\x86\x00\x75\
\x0c\x4e\xd6\xea\xc0\x30\xe0\xdb\xf2\xef\x59\xdb\xbe\xf8\x3e\x6d\
\xc4\xf8\x6a\xa4\xdc\xdc\x6e\x68\xab\xa8\x1f\x56\x3a\x07\x43\xa4\
\x01\x45\x40\x20\xac\xa6\xa9\x0d\xe1\x13\x8d\xa4\x15\x9f\xe8\x8c\
\x49\x02\xa3\x17\x14\x75\x32\xa1\xca\x49\x41\x8b\x31\xba\xd8\x97\
\x65\x53\x53\x16\xf9\xad\x31\x3e\xd9\x19\xa2\x91\xbe\x50\x54\xe3\
\xd9\x5d\x79\xcf\x1a\x48\xfc\x0b\x0e\xaf\xcb\x74\xfe\x25\x24\x71\
\x40\x4f\x8a\xf8\xba\x2b\x4b\x67\x6c\xba\xee\x28\x60\xef\x99\x22\
\x3a\xf6\x4d\xe0\xff\x6e\x2a\x8e\xdc\x3d\xb3\xe7\x9e\x1a\x3f\xb1\
\x36\xe1\xcd\x11\x9d\x06\x35\x09\x5b\xb9\x25\xd7\xf1\xb7\x62\x20\
\xcb\x47\xe1\x5a\x0b\x87\xd4\x52\xbe\xac\x6c\x23\xd1\x14\xbc\x2d\
\x0f\x93\x74\x84\x25\xed\x8f\x22\xd9\x14\xe2\x4a\x19\xcf\x95\x7d\
\x48\x6f\xd1\x3d\x3b\x05\x17\x2d\x73\xc7\x41\xe7\x23\x48\xf6\x6a\
\x9d\x7b\xd7\x22\xbf\xff\xfa\xaa\x79\x7f\x3b\x6c\xb0\x74\x04\xea\
\x9a\x82\x2e\xb5\x80\x1e\x0e\x5f\xf3\x0f\x2f\x5e\x7a\x96\xfc\xee\
\xb8\x6e\xbd\xeb\x06\xbb\xe9\xb2\x7f\x2c\xd8\xf1\x02\x45\x32\xb4\
\x3c\xb9\xd8\x4a\xa0\x91\x8c\x75\xb7\xc8\xe8\x95\x79\xc0\x24\xd9\
\x46\xa7\xc6\xdb\x22\xda\xbb\xef\x6c\x0a\x89\x45\xbd\xcf\x24\xea\
\xf9\xb6\x1c\xb5\xe2\xd3\x9b\x9d\x3d\x4b\x42\x74\xcb\xbe\x8d\xc8\
\xef\xcf\x59\x37\x7f\x97\xa3\x85\xf5\xaa\x69\x96\x90\xc0\xcb\x8e\
\xdf\xf3\x53\x96\xfc\x96\x4e\x7e\x7b\xfd\x9e\xad\xdd\x73\xfa\xed\
\xb7\xc0\x47\x2e\x14\x31\xcf\x99\xe6\x53\xf0\x45\x95\x31\x89\x13\
\x3b\x49\x3e\x0d\x4d\xbd\x55\xaf\x5b\x94\x9d\x5f\xa3\x11\x80\xbc\
\x03\xfb\x9d\x0d\xa4\xb0\x86\x77\xb4\x24\xdf\xe8\x28\xd9\xb9\xc8\
\x01\x8f\xc2\x81\xdb\x4c\x44\x9b\xf6\x80\xc3\x56\x5a\xee\x81\x25\
\x1b\xb2\xc9\x6f\x6e\x72\x47\x63\xb7\x30\xfb\x9d\x16\x04\xc9\xb2\
\x8a\x3c\x27\x6d\x11\x14\x49\xbd\x96\x82\xef\xd1\x0d\x63\x8e\xa4\
\x0f\x26\x07\x24\x6d\x7c\x94\xe5\xcc\xe1\xef\x68\x04\x20\xf3\xc0\
\x45\x27\x51\xb1\x57\x69\xdb\x8e\x62\x03\xe9\xc0\xd2\xad\x57\x6e\
\xc6\x33\x24\x1b\xf3\xec\x91\xb7\x16\x02\x8c\x70\xf8\x9a\xbd\xf7\
\xa7\xdd\xe4\x15\x29\xa2\x5a\xdf\x56\xcb\xb5\x3e\xd2\x6e\x0b\x88\
\x14\xe8\x62\x12\xf5\xc7\xca\x09\x2f\x2a\xbe\xc0\x5d\xdb\x28\x54\
\x56\x1c\x1a\x49\x7e\x61\x21\x69\x80\x46\x65\xeb\x23\x0b\x8d\x00\
\x94\x5c\xd8\xef\x7c\x06\x29\xac\xc1\x6d\xf5\xc9\x6f\x3f\xb7\x76\
\xf3\x05\x87\x10\xbd\x87\x4d\x47\x9f\x71\x0e\xff\x2e\xbd\xba\x7d\
\x05\x45\xce\x86\xda\x1d\x13\x23\x5c\x58\xec\x98\xbf\x5a\x42\xe4\
\xc5\x9a\x45\x65\xa2\xcd\x46\x45\x30\xc5\x54\x09\x3d\x23\x90\x75\
\xcb\x10\x93\x3c\xdb\x6a\x96\xe3\xce\x23\x20\x69\x13\xab\x4d\x82\
\x43\xe2\x7c\x7c\xe8\x1f\xf1\xb9\x05\xc7\x8f\x39\xf1\x67\x50\x42\
\xbb\x26\x61\xc4\x77\xe7\xef\x5d\x7b\x3c\xef\xc6\x97\x60\xa0\x91\
\xe9\xe8\xd3\x00\xb8\x99\xb0\xa2\xe8\xfc\x5f\xdb\xc9\x8f\x23\xd9\
\x1b\x74\x70\x35\x91\xae\x5a\x96\x10\xfd\x2d\x8e\x2a\xcf\x6b\x2a\
\x36\x51\xd3\x5d\x61\xea\x5c\x76\x8a\xc7\xc3\xc0\xe6\x93\x34\x1c\
\x2d\x4c\x72\x95\x5e\x1e\x8c\x47\x47\xca\x3e\x5f\xe4\x17\x2a\xe3\
\xfa\xa6\x0b\x4e\x5c\x1a\x5a\xbb\x1d\x45\x84\xdd\xd1\x35\x87\x6e\
\xee\xaa\xb4\x33\x97\xbf\xae\xac\x85\x00\xb7\x00\x7f\xfe\xfb\x2d\
\xef\xc8\x9a\x14\x8c\xec\x44\x78\x6f\x8d\xf6\x89\x91\xc2\xee\x7c\
\x07\xfa\x16\x98\x28\x6e\x58\x3b\x54\xf3\x99\x81\x4d\x64\xa9\xfd\
\x7d\x6a\x7e\x79\xdd\x13\xe5\x50\x90\x7c\x35\x25\x67\x71\x5c\x48\
\xe4\xb1\x2b\x79\x81\xe0\x66\x6d\x3a\xa7\x0e\x72\x09\x64\xf4\x0b\
\xbf\x6a\xc1\xfe\xb9\x4f\x74\x6c\xfe\x59\x9e\xe3\x6f\x81\x95\x1b\
\xd7\x09\x26\xee\x21\x63\xff\xde\xf4\x9b\x0e\xbb\xb1\x26\xa5\xd3\
\x98\x9b\xff\x2c\xcd\x38\xbc\x9d\x3c\xf6\x5b\x48\x68\x1e\x1f\xe4\
\xaa\xec\x8a\x2d\x59\x57\xc1\xe7\xe1\xf8\x51\x0f\x8d\x04\x15\x4a\
\x95\x0b\x64\x68\x24\xdb\x4e\xf2\x66\x18\x89\x56\x7a\x79\x3e\x01\
\xc9\x3d\xa6\xde\xfc\x68\x54\x72\x72\xd5\xff\x1e\xba\x25\xa1\xd5\
\xc8\x4f\xb7\x5c\x71\xde\xa5\x0f\x4e\xf8\x4f\x75\xf2\x7e\x4e\x6e\
\x39\xe1\x50\xb5\xa2\xab\x49\xa9\xe5\xf8\x5e\x05\x67\xb6\x9f\x20\
\x8f\x6b\x88\x6f\x5e\x3d\xc4\x55\x67\x15\xfa\x93\x54\x9b\x49\xe9\
\x71\x62\xd7\x52\x01\x89\xf4\xc5\x0c\x37\x93\xcc\x67\x5a\x69\x0d\
\x48\xfa\xd5\x9f\xd5\xb3\xe5\x9f\x5c\xf7\xe5\x33\x77\x26\x55\xa8\
\xdf\xe7\xe9\x39\xdb\x2e\xbb\x2f\xd6\x6d\x11\x35\xeb\x55\x20\xee\
\x2d\xfb\x58\xea\xd5\x1b\x7d\xd8\x81\x38\x93\x12\xad\xb2\x43\xbe\
\x1f\x31\xfb\xc4\x9e\x34\xe2\x3b\x83\x6b\x35\xac\xe4\x9a\x82\x24\
\xcf\xcf\x56\x9a\xc6\xaa\xf6\xe4\x2d\xf2\x42\x50\xff\xa1\xe4\x58\
\x42\x5e\x89\x55\x06\x62\x59\x41\x77\xe5\x0a\x4d\x3b\x28\x92\x62\
\x0e\x13\xce\x47\x41\xda\xde\xb5\x2b\x96\x2e\xfa\x61\xe1\x4f\x7f\
\x1e\xbe\x26\xe9\x32\xb2\xc7\xd6\xad\x44\xde\x6f\xda\xfe\xf3\xe5\
\x11\x7a\x71\x40\x90\x49\x59\x33\x08\x88\x07\x4e\x97\x7d\x29\x4c\
\x3b\x98\x06\x90\x5a\x91\x95\xea\x57\x0e\xc2\x71\x27\x92\xe7\xfa\
\xab\x84\x8b\xfc\x59\x1b\xdc\x9a\x44\xfa\x46\x8a\x5b\x9b\x49\x5a\
\x00\x12\x09\x89\xcd\x80\x46\xf9\x57\xcf\x9d\x39\x73\xfa\xd4\xa9\
\x53\xa7\x4e\x1e\x3d\xb8\x6b\xfb\xd6\xad\xdb\xf6\x9c\xb8\x5a\x48\
\xc8\xa1\x81\x95\xea\xc6\x92\x3f\xea\x62\x6a\x7a\x79\xe4\x47\x1b\
\x53\x73\x67\x87\x72\x40\x2a\xc9\x38\x79\x2a\x1b\x6d\x22\xc8\xee\
\x8b\xa9\x1d\xeb\x1a\xac\x99\x6f\x2d\x3e\x59\xe7\x2a\xf5\x37\x00\
\xf3\x91\x60\x82\x12\x8d\xb4\xcf\x5b\xea\xef\x80\x44\x88\xf6\xde\
\xd1\x48\xbc\xf2\x63\xdf\xca\x71\x41\xdc\xce\x9a\x58\x5a\x54\x90\
\x97\x97\x97\x57\x50\xac\xd4\x33\x12\x14\x5b\x83\xdc\x63\x97\x79\
\x36\xfd\x66\x04\x59\x67\x53\x73\xe7\x6d\xc0\xf7\xff\xfe\xb3\xe8\
\xca\x89\x2b\x00\x21\x20\x05\xc5\x25\x44\x05\x20\xa3\xc4\xb2\x90\
\xd4\x34\x9b\x44\xce\xec\x1b\x26\x90\xe3\x11\x57\x88\x42\xf5\xc8\
\x52\x91\x96\x77\xe5\x31\x97\xb6\x65\x24\xb1\x07\x24\x2a\x82\x4a\
\xdb\x46\x62\x41\xc6\xe5\x4b\x7e\x30\x09\x01\xe1\xb1\x11\xe4\x82\
\x7c\xf5\x8c\x83\xff\xaf\xa5\xa9\x09\xf3\x9f\x9b\xff\x2c\xba\x7a\
\xe6\x1a\x40\x1a\x1a\x5f\xa1\x7a\xb4\x1d\x67\x1d\x01\x29\xc7\x42\
\x21\x35\x4d\x13\xd1\x2c\x46\x98\x3b\xae\x50\x95\x03\x97\xc6\x24\
\xc7\xae\xca\x2e\xb6\x30\x49\x45\x40\xa2\x2e\x27\x65\xed\xe3\x95\
\x35\x5b\x78\xa5\x08\xf2\xab\xb3\x2e\x66\xdd\x04\xa4\xba\xa6\x26\
\x8c\x03\xfe\x94\x64\xa6\x5d\x27\x3f\x4b\x14\x1e\x1b\xee\x12\xae\
\x93\x67\xb1\x99\x56\xe0\x64\xf8\x77\x11\xe4\xa7\x24\x97\xc0\x24\
\x0a\x60\xf3\x63\x4c\x62\x00\x48\xf2\x68\x67\xa1\x91\x93\x85\x14\
\x4e\x7e\x75\xee\xd5\x9c\x9b\x11\xd0\x15\x4c\x4d\x98\x28\x87\x7f\
\x17\x67\x5d\xcb\x03\x08\xb3\x59\x84\xc5\x86\x07\x38\xff\x52\x60\
\xb1\x99\xd5\x28\xa1\x85\x95\x8d\xe5\xad\x37\x6f\x46\x92\x3f\x63\
\x92\x22\x40\x92\x4d\x32\x0b\x8d\x9c\x2d\xa4\xc0\x50\xf2\x84\x49\
\x62\x5e\x46\xfe\x4d\x40\x0a\x33\x35\x61\x1c\x4f\x13\x95\xe6\x5e\
\xcd\x25\x07\xa4\x8a\x61\x16\x20\xf9\x49\x13\x55\x30\xd1\x14\x86\
\x1b\xb8\x60\x92\xcf\xde\xac\x00\x87\x9b\xba\x50\x1e\x0e\xa9\x77\
\x96\xe8\xa0\x5f\x2e\x0b\x82\xc9\x17\x06\x25\x05\x45\x0e\xbc\x1e\
\xe0\x37\xcb\xa5\xd2\xc2\x9c\x02\x0a\x82\x06\xda\x2c\xe1\xf6\xa6\
\x2e\x89\x33\xae\xea\x85\x2e\x54\x0b\x5f\x81\x4b\x87\xa1\x72\x80\
\xf1\xcf\x55\x3b\x9d\xd8\x32\xc1\x21\x6f\x84\x2e\x3b\xc7\x17\xe9\
\x1f\x74\x7f\xda\x89\x22\xf6\x20\x72\x60\x29\x29\x2a\x71\x90\xda\
\x12\xff\x59\x08\x17\x17\x52\xbc\xac\x3d\x38\x40\x70\x55\x5b\x56\
\xe3\x99\x0e\xa2\x97\x7c\x83\x3c\x7b\xae\x7c\x20\xa5\xe0\x1b\x99\
\xa4\xaf\xf1\x43\x4c\xb2\x91\x93\x9e\x09\x67\x48\xa0\x51\x59\x8b\
\xd2\xf2\xb0\xae\x7e\x82\x17\xcc\xa8\x37\x73\x47\x33\x3b\x26\xda\
\x15\x4b\x68\x00\x29\x20\xc8\xee\x2c\xe4\x81\xb0\x9a\xf1\x90\xd2\
\xe8\xfb\x28\xee\x48\xe3\xfe\x46\x3e\x10\xcb\xcf\x30\x89\x08\x90\
\x58\xb1\x85\x4f\x34\x02\x10\x0d\x14\x39\x24\x3e\xf1\xf8\x31\x41\
\x0b\x93\xbd\xf8\x0f\x08\x74\x5c\xfb\x67\x98\x9a\x3b\x1d\x43\xe3\
\x84\x00\x1a\x2f\x9c\x58\xea\xb2\xb1\x1c\x0c\xab\xb1\x5c\x51\xa9\
\x21\x92\xc6\xb2\x62\xcb\xb4\xa2\x06\x90\xe9\xe3\x6c\x8c\xb9\x62\
\x1f\xb4\xb3\x46\x48\xd0\xc8\x7c\x5c\xeb\x71\xfc\x22\x10\xed\xf4\
\x5b\x71\x01\x79\x32\xea\x80\xe0\x40\x07\x12\x9c\x00\x6a\x9b\x57\
\xf7\x5d\x77\xa4\x9b\x3d\x88\x82\x59\x8b\xf2\x8b\x9c\x19\x2b\xc4\
\x42\x92\x1b\xe2\x46\x28\x41\xe5\x9a\xce\x45\x72\x05\x37\x99\x15\
\x34\x57\x1a\xbc\x21\x13\xe1\x38\xcb\x31\xcc\x8a\xea\x92\x6f\x21\
\x69\xe3\xa9\x23\xd1\xe3\x82\x59\x76\x02\x04\xe0\x49\xc7\xef\xa5\
\x45\x79\xe4\x55\xa0\x84\xd0\xe8\x90\x9b\xb3\x66\xee\xe2\xdc\x47\
\x1c\xdf\x3b\x30\x8c\x3c\x6b\x5f\x69\x61\x41\x89\x84\x49\x6a\x99\
\x38\x64\x32\x4b\xa2\x37\x05\xd6\xcf\x35\x90\x79\xa4\xf6\x2d\xc6\
\x02\x66\x8d\x00\x49\x5f\x34\xd2\x12\x87\x74\x2b\x55\x52\x9a\x73\
\x85\x22\x91\x40\x58\x8c\xc3\xa1\xcf\x8d\xa6\xe6\xce\xbf\x1c\x2d\
\xc3\xf0\x58\x72\x50\x29\xcc\x75\x4d\x23\x18\x0e\xab\x79\x80\x07\
\x51\x96\xf0\x0a\xb2\xd0\xc8\xe5\xb9\x22\xa3\xf1\xf3\x80\x73\x3e\
\xc1\x46\xbd\x58\x30\x0b\x90\x18\xd0\x51\x24\x2b\xc9\xc5\x16\x87\
\x7c\xe2\x0d\x61\x36\x2a\xf6\xcb\xa2\x92\x9c\xcb\xd9\xe4\x5d\x46\
\xc6\x45\xdc\xf4\x5d\xed\x34\x35\x77\xae\x72\xf8\xb7\x3d\x22\x86\
\x1c\x90\x9c\xb2\x59\x58\x16\x92\x0a\x86\x0b\x13\xf1\x54\x02\x27\
\xfa\xba\x4c\x08\xcd\x47\x6f\x4a\xc0\x4a\x26\xe0\xad\xd9\x55\x9d\
\x33\x79\x86\x91\x4a\x4c\xe6\x21\xe2\xc5\xbd\xfe\x0a\xa3\x67\xd3\
\x31\x5c\x49\xce\x95\x6c\x72\xdf\x7e\xc5\x5a\x31\x37\x67\x2d\x1d\
\x28\x30\xe9\x8e\x7d\x29\xb0\xcf\x81\x51\xa3\xab\x57\x20\x9f\x9c\
\xcc\x0b\x99\x2e\x2e\xbb\x50\x58\x8d\xc8\x82\x11\xd4\xec\x5c\x0d\
\x61\xd7\xd1\x8d\x5f\xa6\xe2\xa4\x77\x86\xd8\x06\x1d\x98\x3e\x83\
\x83\x9d\x8a\xe8\x1a\xa0\x91\xb1\xa5\x7a\xbe\xe7\x1f\xcb\xa9\xe1\
\x85\x6b\x0b\xaf\x9c\xbd\x0e\x54\x24\x7b\x48\x74\x42\x5c\x88\x80\
\xec\x32\x4a\x16\x03\x17\x81\x9a\x66\x24\x66\x36\xe0\x60\x37\xda\
\x63\xeb\x50\x54\xe8\xc8\x48\xcb\x2c\xb6\x00\x49\x01\x78\x08\xac\
\x3b\xe4\x07\x45\x34\x5b\x79\xfb\xd4\x15\x56\x68\x83\x7b\xb3\xa9\
\x41\x74\x55\xd1\x88\xad\xe3\x98\x15\x40\x4a\x9f\xd3\x72\xcc\x6d\
\xe1\xe9\xb2\xe2\xcb\x27\xae\x90\x3f\xab\x4a\x52\x9c\xe3\xa9\x9a\
\xb5\x26\x65\xcd\x14\xa7\xd9\x09\xaa\x5c\x8f\xbc\x86\x61\x51\xfa\
\x59\xa7\xda\x13\x82\x15\xf6\x2d\x4b\xca\x98\xbb\x04\xcc\x14\x9a\
\x64\x2c\xfc\x33\x1b\x20\x91\x13\x42\x39\x1a\x89\xde\x11\x88\xc3\
\xf2\x97\x32\x8e\x0c\x8b\xf3\x91\xf7\x8c\x93\x02\xbd\x72\x92\x02\
\x90\xe2\x9b\xc5\x3b\xaa\xd7\xd9\x26\x65\xcd\x05\x4e\x96\x7c\x6c\
\x62\x6d\x72\x23\xe7\x62\x4a\x5a\xa1\x0b\x97\x9b\xfb\xb4\xb5\xaa\
\xb0\x24\x12\xf0\xb3\x4f\x7b\xcb\x6f\x71\x48\x0d\xfc\x30\x31\x26\
\xd9\xd8\x12\x82\x95\x6d\xa4\x4d\xfc\x8c\x72\x21\x91\xed\xcf\x0d\
\x8a\x73\x4c\x43\x57\x9a\x7d\xfa\xd8\x75\xe2\x7b\x23\xea\x27\xc5\
\x38\xdc\xbc\xc3\x8c\xb5\x15\x4a\x80\x1f\x1c\xbf\x07\xc7\x37\xaf\
\x4e\x7e\xf7\x85\x94\x8b\x4e\x80\x14\x6a\xad\xca\xd5\x37\x98\x3c\
\xca\x02\xad\x88\x11\x3d\x48\xbc\xf9\x31\x34\x26\x59\x81\xe0\x4a\
\x01\x89\x1f\x42\x18\x5d\xbf\xd8\xa2\x9c\x02\x91\x0b\xce\xed\xf9\
\x87\xfc\xe6\x3a\xb7\xd6\x75\xb0\x16\x0a\x81\x43\xa6\xe3\xcb\x8b\
\x40\xba\xc3\xd7\x80\x8a\x8d\x5b\x90\x7b\xec\xb2\x4e\x9e\x70\xf2\
\xd8\xa1\x9a\x05\x29\xea\xc3\x92\x72\xcd\x20\x12\xac\x5f\x5d\x40\
\x48\x47\x58\xa2\x72\x8d\x94\x45\xe5\xb1\x55\x9e\xa6\xc4\x24\x1b\
\xe8\xcf\xdf\xc8\x20\x84\xd1\x0d\x76\x19\x49\x88\x7d\xb4\x10\x24\
\x38\x7c\x2b\xba\x74\xe8\x24\x79\x2e\xeb\xe8\xa6\xcd\xe3\x9c\x5c\
\x50\x5f\x98\x8e\x2f\x97\x39\xd3\x3c\xa4\x6e\x27\x8a\x52\x84\xa7\
\xfe\x3a\xe5\x6c\x33\xb6\xb0\xc0\x44\x4d\x59\x60\xae\x6a\x61\x90\
\xe8\x27\x39\x9a\xd0\x19\x99\xfc\xbc\x60\xb9\x57\x0b\x49\x06\x26\
\xe9\x08\x4b\x82\x86\xb2\x27\xaa\x81\x46\x00\x02\xd1\xca\x11\x53\
\xf2\x4e\x6d\x3f\x4d\x7e\x73\x83\xee\x8d\x9c\x4a\xcc\x7e\x67\x2e\
\xaf\x5d\x31\xf0\xa1\x33\xb1\xaa\xb5\x6d\x15\x43\x7c\x7b\xe6\xc1\
\xbd\x17\x9d\x63\xec\xda\x59\x82\xce\x0d\x5a\x78\x2b\x5e\x23\x92\
\x3d\xc5\x34\x75\x83\x98\xd8\x4c\xf2\x42\xa0\x0d\x00\x48\x1e\x31\
\xc9\xe7\x7b\xba\x26\xb9\x22\x8c\x7a\x30\xa0\xb5\x24\xa8\x40\xf8\
\x8e\x8e\xf5\x50\x0b\xcf\x6d\x3f\x48\x9e\xb9\x3b\xf4\x3f\xdd\xea\
\x39\x26\x67\xcb\x01\xd6\x9b\x48\xdf\x1d\x01\x4e\x3a\x51\x3f\xaa\
\x79\xef\x24\xf2\xdb\x4f\x6e\x39\x91\xef\xfc\x4b\x6b\x15\x34\x72\
\x36\x90\x06\x1c\x01\x76\x01\xeb\x81\x15\xc0\x2a\x60\x0b\xb0\x1f\
\x38\x09\x5c\x02\xf2\x2d\xe0\xf2\x8e\x43\xa4\xc9\xdf\x08\x30\x49\
\x2f\x88\xe2\x65\xf3\xc2\x5c\x8e\x3b\xbb\xf4\xbc\xfa\x0c\x96\x2f\
\x3f\xa8\x45\x4b\x17\xc1\x40\x86\x39\x73\xf3\xa8\x4c\x4b\xd6\x01\
\xae\x96\x7f\xcb\x3d\xba\xe1\x18\x06\x35\x27\xbc\xb7\x46\xf7\x5b\
\xab\xd9\x77\x9d\x74\xb0\x03\xde\x06\x7a\x9b\x65\xeb\xfe\x43\x97\
\xef\x61\x0d\xef\xf8\x0f\x79\xf9\x88\xf4\xad\x3b\xd3\x5d\x0e\x21\
\x35\x52\x30\x98\x7c\xe0\x08\x70\x18\x48\x05\x52\x6f\xfc\x83\x3c\
\xb1\x46\x35\x20\x11\x48\x04\x92\x80\x24\x20\x11\xa8\x67\x8a\xb2\
\x8a\x32\x92\xb4\x4a\xe8\x50\x91\xf2\x41\x6a\x24\x55\x31\xb4\xb1\
\x65\x36\x40\x92\x58\x65\x90\x60\x92\x42\x5d\x2f\xd2\xdf\xa2\xd2\
\x22\xce\x67\x62\x63\x86\xad\x4e\x63\x60\x57\xf9\xb7\xe2\x8b\x3b\
\x76\x5c\x42\xf3\xca\x84\x37\x37\x1d\xd4\x3e\xe6\xd3\x93\xe9\x37\
\x47\xb7\x05\x38\x0e\xd4\x37\x3e\x47\x5e\x71\x09\xf8\x06\x82\xeb\
\xf6\xe9\x56\x99\xf8\xfe\xa2\x3d\xab\x8f\x38\xf9\x2f\x03\x80\x18\
\xca\x31\xe4\x01\x9b\x81\x35\xc0\x1a\xc7\x29\x92\xd5\xd2\x80\x34\
\x67\xfb\x55\x00\x6e\x03\xba\x03\x3d\x80\x36\xe6\x2d\xd4\xc4\xd0\
\x8f\x64\x61\x92\xff\x34\x1b\x38\x70\xcb\xf2\xe0\xc4\xf3\x76\x6a\
\x55\xbd\x12\x96\xd1\x0d\xe0\x98\xbe\x3a\xf7\xf0\xaf\x7f\x93\xe7\
\xfc\x0e\x68\x3b\xa4\x75\xb4\xcb\x6f\x2f\x99\x22\x11\xc6\x34\xa0\
\xd0\x79\xcd\x54\xbd\xdb\x00\x8a\x88\x86\xc3\x2b\xf7\x66\x38\x91\
\x21\x96\xf8\x54\xec\x09\xe0\x4d\xa0\x2d\x10\x06\xf4\x04\x26\x2b\
\x46\x23\x6f\xea\x75\x3d\xf0\x1a\x70\x2b\x10\x04\x74\x06\x3e\x00\
\xce\x9b\x08\x87\xa4\xc3\xcf\xa8\xcc\x23\xe9\x6b\x04\x2b\x96\xdf\
\x94\x80\xa4\xd9\x62\xc7\x47\xc5\x5f\x02\x58\x32\x13\x07\x06\x56\
\x45\x0d\x47\xe2\x64\xec\xf9\x35\x85\xfc\xee\x88\x6e\xc3\x5a\xbb\
\x94\x7b\x5f\x04\x9c\x30\x38\x4d\x2e\x03\x53\x5c\xa1\x37\xbe\xe7\
\x03\xcd\xc9\x7b\xf8\x67\xdd\xa6\xf3\xce\x0e\xbb\x8e\xbe\x6e\xb9\
\x06\xcc\x00\xda\x00\xf5\x80\x37\x34\xcf\x57\xbb\x09\x78\x11\xa8\
\x0e\x74\x06\xbe\x02\x32\x0d\x3e\x83\x6a\x44\xdc\x59\xcd\x02\x24\
\x57\xf0\x50\x8e\x49\xe5\x26\x88\x72\x58\x52\x49\x90\x48\xde\x94\
\x65\x40\x4b\x08\x7a\x39\x46\x26\x14\x9f\xdf\xb0\x8a\x22\xd2\xae\
\x42\xef\x07\x5d\x11\x09\x98\x68\x70\x23\xe9\x43\xc0\x25\xfa\x3d\
\xa0\x6a\x8f\xe1\x6d\xc9\x3b\xb8\xfe\xe7\x4f\x87\x5d\x02\x0e\xef\
\xf6\xbe\xe8\xfe\x03\xe8\x07\xc4\x00\xe3\xd5\x31\x86\x68\x91\x69\
\x0c\x10\x0d\x0c\x02\x36\x99\x14\x96\xe4\x99\x47\x46\x31\x92\xac\
\x18\x6e\x8d\x2c\x24\xe6\x53\x25\x0f\x96\x04\xf5\xa5\x48\x53\x86\
\x0b\xc0\x80\xda\x8e\xdf\xf3\x8f\x2c\x5f\x73\x89\xfc\xf6\xd8\x41\
\x8f\x76\x72\x4d\x80\xbd\xd8\xb9\x86\x90\xb1\xda\x51\xf7\x70\x06\
\xd8\x6b\x0e\x7c\xf4\x56\xf2\x89\xcf\xdf\xbc\x70\xaf\x6b\xc0\x41\
\x27\x4f\xaa\x6d\x25\xd0\x0e\xe8\x01\xac\xe0\x8f\x0e\x3f\x01\x9d\
\x81\x5b\x81\x3f\xf8\x5e\x5e\x90\xd4\x52\xf2\x51\x7e\x9b\xf5\x13\
\x75\x87\x61\x38\x38\x2d\x2d\x7c\x52\x17\x90\x64\xd3\xd7\xdb\x8d\
\x1c\x5a\x4b\x1a\xc7\xf5\xb7\xbe\xd5\xe9\x6b\xce\xfe\xc5\x1b\x28\
\x0a\x23\x45\x0d\x98\xd0\xb3\xb2\xdb\x04\x26\x1b\xf3\x4c\x52\x11\
\x30\xcc\x5d\xe3\x04\x25\x3e\x38\xa1\x0d\x79\x27\xa5\xdb\xbf\xdf\
\x7e\xdd\xa9\x8f\x60\xe7\x34\x0d\xa5\xc0\x72\xa0\x25\x70\x07\xf7\
\xa5\xa4\xfe\x02\x7a\x00\x6d\x81\x5f\x81\x52\x53\x58\x4b\x4c\x5c\
\x79\xa2\x11\xde\x17\x96\xeb\x52\x1b\x0b\x49\x46\x16\x51\x1f\x90\
\x43\x56\x23\x59\xd0\x9c\x9f\xb4\xb1\xc7\x2b\x36\x71\xae\x39\x91\
\xb9\x63\xde\x9f\x14\x68\x12\xd2\xeb\xc9\xfe\xf1\xae\x21\xc4\xa7\
\x80\xa9\x06\x64\xc4\x79\xc0\x76\xb7\x1f\x43\x5b\x8c\x1d\x9b\x48\
\x81\x47\x5b\xbe\x5e\x7b\xc9\x59\x79\xb7\x70\x88\x68\xf8\x1b\x68\
\x0d\xdc\x05\xec\x35\x0e\x59\x76\x01\x7d\x81\xf6\x4e\xa5\xa1\x8c\
\x64\x24\x49\x88\x95\xa8\xfe\x43\xf5\xc5\x24\xab\xa9\x0e\x48\xd0\
\xcf\x4f\x2a\x98\x91\x9f\xec\xb1\xe8\xe9\x18\xf6\x2b\x5e\xdd\x38\
\xe7\x0f\x0a\x44\xb2\x75\x9c\x30\xb4\x8e\x7b\xdc\xf0\xab\xc0\x56\
\x43\x71\x61\x2a\xf0\xb0\x27\x13\xb0\xc3\xe3\xc3\x13\x68\xf0\x68\
\xce\xea\x8b\x2e\x75\xf9\x1e\x2a\x33\x3d\x81\x67\x80\x56\xc0\x1e\
\x63\x4a\xe9\x4e\xa0\x05\xf0\x02\x90\x0b\xab\xe9\x8f\x49\x96\x3b\
\x8e\x23\x40\x62\x52\x18\x89\xb9\xde\x17\xd5\x4f\x10\xee\x6d\xb4\
\x8a\x52\x80\x04\x62\x74\x03\xb8\x20\xd2\x5a\x1a\x8f\x5b\xf3\xe7\
\x9e\xbd\x25\xd2\xc3\xef\x7d\x81\x8b\x06\x61\xc1\x0c\xa0\x0f\xe0\
\x1e\xf1\x1e\x90\x70\xf7\xcb\xf7\x51\x9c\x20\x2a\xdd\x32\xe7\x77\
\x57\x3c\x42\x2f\xe0\x57\xa0\x1e\x30\xcd\xf8\xb2\xfa\x21\xd0\x00\
\x58\x69\x16\x6c\x10\x74\x7a\x2e\x13\x55\x60\xd9\x40\x9a\x02\x92\
\x37\xfc\x97\x9d\x4c\x50\x6d\x34\xe2\xc1\x96\x92\xf7\x46\xed\xbb\
\x39\xcd\x81\x78\x75\xfd\x8c\x15\x59\x14\xf7\x57\x1b\xfb\xde\xfd\
\xb5\xdc\x8b\xfd\x5c\x05\x06\xbb\x45\xac\x71\xd8\x8a\x81\x11\xc0\
\x29\x0f\x7f\x09\x6f\xfb\xfc\xdb\xdd\x82\xc8\x7b\x2a\x58\xf3\xe9\
\x6f\x69\xce\x78\x14\x03\xbc\x6c\x28\x6c\xf6\xd9\xce\x03\x77\x00\
\x23\x81\x1c\xb3\x60\x92\xa0\xc7\x73\x39\x35\xfb\x44\xeb\xa8\xaf\
\x0a\x05\xfa\x18\xde\x4b\x32\x3d\x5a\xa2\x91\x0b\xfc\x30\xc1\xd4\
\xe8\xc6\x68\xe8\x38\x68\xf1\xda\x86\xe9\x0b\x29\x62\xed\x10\xd0\
\xe9\x8d\x17\xda\x47\x78\xf8\xc3\x26\xe0\x21\xa0\x98\x63\xe6\x2b\
\x01\x9e\x07\x96\x79\xfa\x93\xbd\xe6\x7d\x93\x1e\xa5\x70\xd7\x21\
\x63\xd9\xb4\x55\xe9\xa5\x6e\xbc\x61\x4a\xcf\xca\x5c\xa0\x3d\x70\
\xda\x08\x43\x25\x51\xb0\x4a\xca\xf7\x99\x43\x81\x5b\x50\x74\x93\
\x19\x52\x53\x53\x13\x13\x93\x5c\xc2\xf9\x49\xd2\x4f\x49\x40\x88\
\xb7\xc3\x01\xd4\xa9\x15\x25\x7b\x73\xe7\x4b\x6d\x6c\x23\x89\x5c\
\x4a\x72\x3c\xcb\x22\x66\xbe\x80\x47\x1c\x4f\xea\x87\xb6\x9e\x72\
\x78\xe7\xb3\x35\x29\xcc\x8c\x8d\xe3\xea\x77\x9b\x75\xda\x23\xf6\
\x8c\x05\x3e\xe7\x32\x79\x5a\x29\xf0\x12\x30\xd9\xf3\x1f\x23\x3a\
\x7e\x9a\xba\x69\x7c\x3c\x79\x6f\x17\x67\x76\xaa\xf7\xc8\x66\xd5\
\xec\x06\x21\x30\xaa\x5a\xdd\xc4\xa4\x1b\x2d\xb1\x5e\x42\xa5\xe8\
\xc8\xc8\xc8\xc8\xa8\xc8\xc8\xc8\xc8\xc8\x88\xb0\xa0\xb2\x85\x5d\
\x71\x7e\x76\x76\x76\x76\x76\x76\x56\x56\x56\x76\x76\x56\xc6\xa5\
\xb3\xc7\x8f\x1c\x49\x3d\x52\xf6\xff\x23\x27\xfe\xb9\x5e\xc0\x52\
\xeb\x84\x02\xcb\x80\x9e\xfc\xa8\x12\xfd\xec\x2d\x03\x9d\x97\xf7\
\xa8\x3d\x5c\xd0\xc8\x9f\x33\x50\x10\x01\x12\x95\x29\xe0\x13\x93\
\xc8\x7b\x23\x07\x24\x7e\xb8\x4d\x46\x4b\xfb\x03\xf1\x5f\x39\xfe\
\x10\x58\xef\xa9\xad\xc7\xa6\xb5\xa2\xe8\xe2\xfa\xa2\xbb\x1b\xde\
\xf7\xe3\x45\xcf\xe1\xc1\x13\x80\xa9\x9c\xd5\xf0\x2e\x05\x5e\x07\
\xde\xf1\xf2\xd7\x90\xa6\x2f\x6f\xdb\xff\x0e\x45\x7a\x06\x1c\x7e\
\xad\x49\x8b\xb7\x0f\x15\xb2\x1c\x62\x40\x64\xad\x96\xb7\x75\xeb\
\xd1\xbd\x7b\xf7\xee\x5d\x6f\x6d\x1e\x1f\xc6\xa0\xcb\x82\xf4\x94\
\x6d\x1b\xd6\xfe\xf1\xc7\xda\xb5\x6b\xd7\x6f\x3f\x7a\xa5\x90\x05\
\x3c\x4d\x06\x9e\xd3\xec\x38\x21\x0b\x54\x20\xd4\x00\xa2\x3a\x4f\
\xe7\x16\x93\x1c\x95\x9e\x05\x48\xec\x01\x49\x39\xd4\x1b\x71\x62\
\xe4\x01\x92\x3b\x79\x6d\x95\xef\xfe\xe9\xe4\x92\xfe\xe1\x14\x9d\
\xa4\x7f\xd3\xa7\xd1\x98\x55\x57\xbd\x9c\x58\x19\x00\xcc\x03\x22\
\xf9\xa0\x52\x2e\x30\xd6\x2d\x83\xea\xcd\x16\x9c\xf4\xec\xc6\x43\
\x53\xda\x52\xe8\xd8\x82\xdf\x87\xd5\xb9\x63\x7e\x5a\x09\x03\x71\
\x08\x89\x6f\xdb\xff\x81\xfb\xef\xbe\xb3\x67\xf7\xdb\x9b\x54\x56\
\x55\xcd\x67\x9f\xdc\xba\x76\xcd\xea\x9f\x17\xce\x5f\xb4\xee\x48\
\x86\xa2\xa1\x3f\x0e\xfc\x8f\x0f\x23\x58\xa0\x11\x10\x25\x15\x28\
\xcc\x8d\x49\xfe\xdc\x84\xd4\xd4\xd4\xa4\xa4\x24\x56\x68\x24\xc3\
\xb2\x31\xd3\x8a\x80\x15\x20\x01\x61\xed\xa6\x1d\xde\xf6\x54\x0d\
\x9a\x6e\xce\xcd\xb8\xbd\xe9\xe3\x1b\x32\xbc\x09\x70\x23\x60\x15\
\x50\x43\x6f\x12\xa5\x01\xfd\x80\xdd\x5e\xff\x1e\x58\xf7\xb1\x3f\
\x0e\x7f\xd6\x99\x26\x07\xf6\xc5\x2f\x6f\x6b\xf0\xf0\xc6\x2c\x25\
\xa3\xb2\x45\xd6\xbb\x7d\xf0\xf0\x51\xa3\x47\xdd\xdf\xa9\x86\xe6\
\xa6\x64\xc6\x81\x5f\xfe\xef\x9b\xaf\xbf\x59\xb0\x62\x77\x9a\x5c\
\x9f\xde\x63\xc0\xc7\x1c\x18\xc1\x02\xbd\x80\xb0\x85\x25\x2b\xdb\
\xaa\xd1\x9b\x8d\x5e\x57\xba\x72\x98\x07\x26\x13\x28\xd0\xc8\xdf\
\x57\x04\x9e\x29\x9c\xbb\x6b\xea\xab\x6b\xe9\x5c\x50\x09\x8f\x7d\
\xf3\x46\xe7\x68\xaf\x74\x4f\x01\x92\x80\x05\xfa\xed\x03\x8b\xc0\
\x52\x20\x49\x0a\x8d\x10\x58\x77\xd4\xac\xa9\x54\x68\x04\x71\xfb\
\x7b\x1f\x6c\x95\x8d\x46\xf6\xd8\x56\x0f\xbc\xb3\x68\x57\x7a\xe6\
\xb1\xb5\x5f\xbd\xf6\xa0\x0e\x68\x04\x20\xba\x69\xbf\xc7\xa7\x2c\
\xd9\x79\x3e\xfb\xd4\xfa\xaf\x5e\xe8\xdb\x20\x42\x86\x61\x36\x03\
\x78\x9c\xef\x00\x16\x85\x6b\x38\xc2\xa8\x07\x51\xee\x18\xe4\x1d\
\x2d\xb2\x0e\x24\x69\x0a\x48\x5a\xe7\x76\xd3\x4f\x51\x8a\x72\x6f\
\x54\xaf\x95\x9c\x5b\xfc\xd2\x8c\xb3\x74\xf7\xd4\x79\x6a\xe9\x97\
\x83\xe3\xbd\xeb\xd4\x3c\x20\x19\x18\x08\x5c\xd0\x9c\xc8\x97\x80\
\x7b\x81\x7b\x00\x09\xe8\x10\x22\xda\xbc\xf2\xe3\x17\xdd\x42\xa8\
\x3a\xbe\xf0\xe5\xf3\xdf\x9c\x28\x92\x31\xa2\xa0\xaa\x1d\xc6\x4c\
\x5b\x7d\xe2\xf2\xae\xf9\x2f\x0f\x6e\x15\xcb\x03\x23\xda\x6b\xde\
\x36\x6a\xf2\x2f\x47\x2e\xed\x5f\xfc\xc6\x90\x66\x15\x68\x5d\x70\
\x33\x81\xc7\x74\xc5\x24\x12\xc0\x50\x5a\xb1\x9b\xc4\x08\x93\x8b\
\x28\xb2\xc7\x66\x61\x92\x16\x80\x44\x85\x46\xb2\xa7\x84\xdc\x96\
\x62\x0b\x3f\x2e\xa7\x68\xf5\xb2\xf4\x25\x89\x9c\xb3\x73\xf2\xb3\
\xcb\xb3\xe9\x3a\x8c\x1d\x3a\x6f\xe1\x13\x8d\xa4\x55\xfa\x72\xa0\
\x26\xf0\x36\x4d\xd9\x53\x25\x2d\x07\x98\x0c\xd4\x00\x16\x49\x5f\
\x17\x10\xd7\xff\xd3\x9f\x5f\x6b\x4e\x37\x15\x45\xeb\x5f\x79\x6f\
\x4b\x26\xe5\xca\x20\xb8\xfa\xed\xe3\x3f\xdf\x70\x36\x6d\xcb\xec\
\xa7\x7a\xd6\xe0\x4f\x24\x43\x1a\xdf\xf3\xfa\xc2\x7d\x97\x8f\xae\
\xf8\x60\x78\x9b\x58\x2a\x8b\x6d\x16\xf0\xa2\x11\x32\x90\x2a\x3c\
\xbd\xe7\x33\x4c\x5c\x64\x2c\x89\x6a\xe1\xab\xd5\xe8\x2c\x24\xaa\
\x45\x81\xb5\x4c\x50\xde\x5c\xd2\x88\x96\x5c\xf8\xe9\xb9\xd7\x76\
\x52\x4a\x57\x50\xc7\x8f\x96\xbf\xdf\xa5\xa2\xf4\xbc\x16\x01\xaf\
\x01\x55\x80\x0f\x24\x4d\x16\xe5\x50\xf4\x11\x50\x15\x98\xe8\xfb\
\x88\x6e\x70\xd2\x23\xdf\x7f\x3f\xa2\x2a\xe5\x13\x0e\x4f\x7a\x72\
\xfe\x19\x1a\xa3\x20\x30\xae\xf3\xd3\xdf\x1f\x38\xfb\xe7\xa7\x8f\
\x74\x8e\xe3\x9b\x17\x02\xea\xdc\xf9\xfc\xdc\x1d\x67\xb7\xcf\x1c\
\xdd\xb2\x02\x85\x90\x7e\x04\xcc\x33\x02\xab\x33\x51\xe5\x12\xb0\
\x24\x6a\x3b\x18\x4b\xfb\x31\x6b\xa9\xa9\xa9\x12\x66\x2c\xa1\xcd\
\xab\x7b\xba\x75\xda\x01\xa8\x97\x67\xc8\x85\x20\x12\x1f\xf7\xb6\
\xce\xfd\xa7\xf0\x36\xef\xa7\x8a\xd4\x2d\x7f\xcb\x4b\x6d\x22\xc9\
\x6d\x8d\x64\x60\x03\x50\xe2\xc9\x7c\x94\xf1\x29\x05\x36\x03\xc3\
\x29\xec\xce\xa0\x5a\x0f\x7c\x97\x46\xff\x96\xe7\x67\x74\xa4\x88\
\x43\x0c\x88\x69\x33\xee\xab\x7d\x05\xa2\xf1\xda\xf5\xcd\xd3\xee\
\x6b\x44\xbe\xb3\x24\x00\x3b\x18\x4d\x25\xd5\x47\x5f\x3d\xce\x6a\
\x48\xb2\x45\x5e\xdf\x66\x1a\x44\x74\x8d\xb2\x93\xed\x51\x2d\xbb\
\x51\x47\x1b\x96\x36\x92\x52\x25\x67\x1d\x39\x67\xb8\x8c\x56\x04\
\x8a\x81\x66\xc0\x61\xe7\xab\x22\xda\xbd\xb7\x6b\xdb\xc4\x44\xda\
\x71\xe4\xae\x7b\xa6\x43\xff\xff\xed\xcb\x21\x17\xcb\x6a\x40\x3f\
\xa0\x37\xd0\x0d\xce\x39\xc8\xc9\x5a\x06\xb0\x0e\xb8\xf1\xe1\xce\
\x00\x00\x20\x00\x49\x44\x41\x54\x58\x05\xfc\x02\x9c\xa3\x31\x5a\
\x12\x86\xcc\xfe\x6b\x21\x4d\x12\xd5\x7f\x9f\xf7\x7d\xef\x1a\x0f\
\xac\xce\x22\x4a\x05\x10\xde\xf0\xfe\x49\x73\x67\x3e\xde\x2e\xc2\
\xb8\x82\x9a\xbe\xe6\xdd\x31\x63\xde\xfe\xe5\x0c\x51\x36\xa8\x18\
\xe0\x20\x50\x55\x63\x55\xc2\x48\x6c\x95\xe4\x2d\x13\x19\x8d\x4a\
\x6d\xe5\xa3\x86\xce\x31\x87\xff\xd0\x33\x20\xa9\xfa\x6e\x66\x22\
\x9f\x6c\x40\xf2\x96\x8d\x7f\x8d\xfb\xd9\x7b\x21\xbc\xed\x7b\xbb\
\xb7\xd3\x43\x12\x32\x56\x3e\xde\x69\xf0\x8c\x03\x39\x32\x96\x8a\
\xf5\x80\xa6\x40\x63\xa0\x21\x50\x0f\xa8\x00\x44\x01\x11\x40\x18\
\x90\x07\x64\x01\x59\x40\x06\x70\x1c\x48\x01\x52\x80\x83\xc0\x11\
\x39\xd4\x0a\xac\x3e\xe8\xf3\x4d\x4b\xc7\xd4\xa6\x7f\xb7\x05\x3d\
\x12\x92\xff\x20\xd9\x05\x0b\xa9\x3b\x74\xda\xf2\xef\x1e\x69\x62\
\x33\x3e\x6f\xe5\xfe\xf5\xde\xa0\xbb\x5f\x5f\x7d\x81\xc4\x49\xd9\
\x16\x58\x0f\x84\x72\x0f\x48\xb4\xab\x7b\xda\x30\x71\x41\xf1\x90\
\x48\x9f\xa8\x1f\x26\x79\xb3\x22\x8c\x98\x00\xc2\x03\x20\xa9\x4d\
\x56\x73\x1f\x0a\x93\x07\x48\xe5\x9c\x53\x0c\xb4\x71\x2b\xd8\x23\
\x1b\x92\x50\xb8\x7b\xca\xc0\x7e\x2f\xfd\x96\x56\xc4\x21\xa5\x6c\
\xd1\x6d\x9f\xfa\xee\xb7\xa9\x77\xc8\x88\x70\xbb\xfe\x7f\x5d\xe2\
\x87\xaf\xf7\x9d\x15\x3d\x28\xa1\xef\x7b\x3f\x2e\x7e\xb6\x4d\x88\
\x79\xf8\xeb\xda\xef\xff\xed\x7f\xdf\x87\x9b\xaf\x12\x1c\xa5\x9d\
\x08\xbc\x6f\x04\x40\x82\x2c\x8f\x13\xa1\xc1\x24\xb0\x18\x09\xcf\
\xfa\x4a\x02\x3b\x09\x0f\xd5\x70\x05\x54\x36\x8d\x49\x6f\x2c\x34\
\xd2\xb8\x92\x05\x00\x3b\x30\xcb\x7d\x18\x39\x3b\xdf\x19\xf6\x7e\
\xaa\x8c\x27\x05\xb5\x7a\xee\xd7\x7d\x3f\x3d\xd5\x3a\x8a\x37\xfb\
\x20\xa4\xfe\x03\xb3\x77\x6e\x97\x85\x46\xb8\x32\xa7\xdf\x38\xdf\
\x68\x64\x8f\xeb\xfa\xc6\xea\x43\xbf\x98\x0a\x8d\x00\x54\xec\xf9\
\xfe\xa6\xfd\x0b\xc7\xb7\x24\x98\xd1\x49\x9e\x6a\x1e\x72\xba\x2e\
\x4e\x96\xb3\x47\xe0\x13\xc6\x98\xa0\x11\x38\xde\xa1\x51\x18\xde\
\xac\x7d\x90\x33\xb5\x85\x64\x26\x4b\xc5\xe3\x7a\x81\x7c\x02\x44\
\xa6\x3c\x2d\x81\x46\x2e\xb0\x57\x0a\xdc\x03\xfc\xe4\xa6\xc2\x1b\
\x3f\xb5\x6a\xd7\xb4\xdb\xe4\xa9\xd7\xa3\xff\xf7\xf0\x7d\x4f\xcc\
\xde\x9d\xc1\x43\x2d\x6c\x21\xac\xfe\xdd\xef\x2c\xf8\xbf\xa7\xdb\
\xca\xf3\x27\x9d\x9c\xdc\x22\x69\xe2\x3e\x1f\x26\x5f\x50\xad\xfb\
\xe6\x6c\xfa\x6e\x58\x02\xf3\xc1\xe7\xa4\xa5\x1e\x4a\x49\x49\x39\
\x74\x28\x25\xe5\xf0\xb1\xb3\x97\xae\x67\x66\x65\x66\x65\x66\x65\
\x66\x66\xe5\x14\x09\xa1\x11\x51\x65\xd9\x56\xa3\xa2\x2a\xc6\xd5\
\xac\xdf\xb0\x61\xa3\xb2\xff\x25\x56\x0b\x67\x3e\x8e\xd2\xfd\x53\
\x7b\x77\x7f\x71\xcd\x25\x1f\x86\x52\x02\x70\x18\x08\xd7\x66\x5e\
\x55\x33\x50\x98\x58\x4b\x6a\x48\x2e\x6f\x68\x24\x9d\xb6\xd5\x90\
\x2e\x3b\x13\x37\xaa\xb9\x91\xed\x83\x56\x0e\x48\x00\xce\x01\xf5\
\x00\xd7\x44\x0d\x01\x95\xef\xf8\x7c\xd7\xaf\x63\xe5\x1e\x9d\xb9\
\xb2\xf6\xdd\x11\xa3\xde\x5e\x71\x46\xcf\x22\x49\xf6\xca\x9d\x26\
\xcc\xf8\x76\xea\xe0\x3a\x72\xe7\xf0\xef\x17\x13\xdb\x7d\x70\x4c\
\x7a\x13\x25\xb8\xde\xf0\x6f\x37\xcd\x1d\xca\x6c\x4f\x3f\xeb\xf8\
\xe6\xd5\xab\x56\xad\x5a\xb9\x72\xd5\xba\xdd\x67\xb2\xe9\xd3\xce\
\x05\x44\xd4\x6c\xd9\xa5\x67\xef\x5e\xbd\x7b\xf7\xee\xd5\x39\x31\
\x9a\x19\x31\x53\x3e\xb9\xa3\xcb\x33\x2b\xd3\x7d\x0c\xe8\x55\xe0\
\x2d\xfd\x00\x09\x2a\x63\x12\x2b\x90\x90\xbd\xf5\xcb\x56\x41\x51\
\x2c\x97\x8d\xe6\x5a\x34\x21\x20\x89\x0a\xfd\xd4\xf4\x8b\x05\xe6\
\x4b\x3c\x12\x34\x2a\x6b\xd3\x81\x09\xee\xbf\x86\x36\x7e\x6a\xa5\
\x6c\x33\x09\x40\x49\xea\xfc\xa7\xc7\x3e\x3f\x73\x63\x5a\xa1\xe6\
\xb3\x17\x10\xd3\x6a\xd8\x5b\x5f\x7c\x36\xbe\xad\xfc\xf5\xfa\xd5\
\xc5\xf7\x36\xbe\x77\xe1\x45\x49\x33\x2f\x24\x71\xcc\x82\xcd\xb3\
\x07\x55\x62\xc0\x6e\xe7\x37\xcf\xfb\xf2\x8b\x2f\xbe\x5a\xf2\xd7\
\xd9\x3c\x56\xbe\x5b\x21\xb8\x5a\x9b\xbb\x46\x8c\x1d\x37\x76\x44\
\xf7\xba\x41\x0c\xfa\x3b\x32\xa3\xdf\xed\x4f\xae\x90\x8c\x72\xb0\
\x01\xa9\x40\x7d\xcd\x01\x49\x49\x58\x81\xf6\xf0\xc0\x09\x20\x11\
\xaa\x26\x86\x05\x54\x79\x6b\x86\x89\x3d\x12\x6f\xfc\x57\xf6\x09\
\x83\x72\x87\x29\xf9\x32\x44\x47\x1b\x77\x1c\xe0\xa1\xfe\x42\xde\
\xa1\xe9\x83\xef\x9e\x75\x56\x76\xaf\x01\x49\xc9\x9f\x6c\x38\x7f\
\x7a\xed\xc7\x63\x6e\x89\x0b\xd4\xea\x55\x02\xa2\x9b\x0d\x7d\x67\
\x79\x6a\xfa\xae\x6f\x94\xa0\x51\xc9\xae\xd7\x7b\x8d\x5c\x24\x8d\
\x46\xa1\x8d\x1e\x59\xb4\x55\x31\x1a\x15\x1f\x5d\x3e\x69\x4c\x97\
\xba\x91\x35\x3a\x0d\x7f\x73\xde\x16\x76\x68\x04\x40\x2c\x48\xdb\
\xb1\x70\xd2\xb8\x1e\xf5\xa3\xab\xb7\xbf\xff\xd5\x79\xbb\x33\x15\
\xf6\x97\xf8\xd8\x2f\x9b\x3f\xbb\x2b\x5e\x2a\x9f\x43\x29\xf0\x08\
\x50\xaa\xb7\xe4\xd2\x89\x2a\xaf\x8a\x55\xd5\xcd\x24\x0a\xbd\x64\
\xde\xa0\x30\x3f\x72\xd9\xe9\xce\xb2\xe4\xe6\x51\x59\x3b\x0a\x34\
\xf6\x94\x9d\x2c\x24\xf1\xa1\xef\x36\xcf\x1a\xa8\xd4\x08\x38\xf7\
\xfb\x27\x93\x3e\xfa\x7c\xde\xef\x87\x33\x4a\x54\xa2\x85\x2d\xbc\
\x76\xa7\xa1\xe3\x9e\x9e\xf8\xdc\xc0\x44\xa5\xe8\x77\x7a\xce\xc0\
\x5b\x1e\x59\x26\x69\x0a\x04\x54\x19\x30\x7b\xf7\xb2\x91\xf1\x4a\
\x1e\x73\x66\xe5\x07\xff\xfd\xef\xa4\x1f\xf6\x5c\x2b\xd1\x46\xfa\
\xc2\xeb\xdf\x39\xe1\xed\x49\xaf\xde\xd7\x54\x49\x7c\xb6\xb8\xf7\
\xad\xf6\x9d\xdf\xd8\x41\x74\x24\x4b\xdd\xe3\xa2\x82\xe4\x53\xd4\
\x76\x36\x68\x06\x3c\xea\x3d\x5a\xa1\x91\x64\x06\xa0\x72\xcf\xd4\
\x60\x35\x85\xac\x4c\x98\x9a\x81\xe4\xf4\xfb\x97\x5e\x9e\x12\x5c\
\x6f\xc4\xc2\x0b\x6c\xf2\x00\x5c\xde\xb5\x68\xd2\xb8\x1e\xf5\x23\
\x19\xd6\xd3\x11\xc2\x6a\x74\x1c\xf6\xfa\xdc\x4d\xe7\x4a\xd9\x0c\
\xf1\x9f\x79\xf7\xd6\xf4\x85\x68\x61\xcd\x9e\xdb\xac\x24\x0d\x43\
\xc1\xde\xd9\x0f\x6b\x68\x35\x3a\xe1\x76\x64\xe3\xc1\x93\xd6\x5e\
\x56\x42\xa1\xf4\x05\x83\xe3\xe9\x13\x95\x8b\x3a\x7d\x98\x08\x94\
\xbe\x42\xad\x1e\x20\x91\x17\x40\xd0\x97\x26\x16\x20\x19\x1b\x90\
\xe4\xa9\x83\x62\xc0\xdb\xa2\x27\xa8\xf6\xfd\xf3\xce\x31\x4c\x50\
\x93\x7f\x76\xc7\x2f\xb3\xdf\x79\x62\x48\xe7\xc4\xd8\x20\x39\xae\
\x4a\x7b\x54\x9d\xf6\x03\xc6\xbd\xf6\xd9\x92\xcd\xc7\xb2\x58\x26\
\xce\x49\xfb\xe1\xc1\x3a\xc1\xbe\x9c\x82\x71\xfd\xe6\x28\xa0\x45\
\xda\xaf\xaf\xf4\x88\x0f\xd2\x97\x6f\x6c\xd1\xad\xc6\x7e\x73\xb0\
\x48\xf6\x3b\x14\x6d\x9d\xd8\x5c\x76\x55\x5b\xfe\x91\x49\x77\xe5\
\xab\x25\x26\xc9\x1e\x95\xe5\xb2\xb3\x1a\xa9\xb1\xef\xed\x24\xac\
\xcf\x96\x0b\x74\x02\xfe\xf6\xf4\xa7\xc0\x1a\x83\x67\x6e\x5c\x34\
\xaa\x16\xf3\x97\x28\xbc\x7c\x32\xe5\x70\x4a\x4a\x4a\x4a\xca\xa1\
\x94\xa3\xa7\x2f\x5e\xcd\xcc\xcc\xca\xca\xca\xca\xca\xce\xca\xce\
\x17\x83\xc2\x22\x22\x22\xa3\xa2\x22\x23\x23\xa3\x2a\xc4\xd5\xa8\
\xdf\xb0\x51\xa3\x46\x8d\x1b\x37\x6a\xd4\xb0\x41\x95\x30\xf6\xd4\
\x3c\xfc\xf9\xc0\x1e\x4f\x2e\xfb\x47\x3a\xc8\x3b\xb4\xc9\x33\xab\
\x76\x4d\xed\x1c\x2c\xe7\x01\x25\x07\x67\x8f\xb9\xef\x99\xff\x3b\
\x90\x45\xba\xc9\xd2\x00\x68\x02\x34\x06\x1a\x01\x75\x81\x68\x20\
\x12\x88\x02\x42\x80\x1c\x20\x0b\xc8\x04\x32\x80\x63\xc0\xe1\x1b\
\x39\x2c\x4e\x10\x8f\x26\xb8\xc6\x1d\x2f\xcf\x5d\xf0\x6a\xd7\x0a\
\xb2\x88\xf5\xcf\x57\xfd\x5b\x8d\xfb\x25\x5d\x89\xb7\x51\x97\x4c\
\xe1\x02\xbd\x7c\x69\xef\x9b\xe2\xd9\x45\x26\x91\xa9\xc1\x78\xb5\
\x4f\x2d\x0b\x49\x83\xf5\x94\xc2\x35\xe9\x79\x20\xc6\x9b\x6d\x50\
\xe9\xb6\x97\xd7\x5c\x13\xcd\xd8\xb2\x37\xbc\xda\x31\xc6\x67\xd0\
\x8d\x10\xd1\x6e\xd2\x11\xb9\x96\xd1\xd2\x47\x9b\x45\x10\x48\x6c\
\x0d\xe0\x61\x60\x29\x70\x5d\x96\x1d\x70\x15\x58\x02\x8c\x23\x2c\
\xd7\x1b\x58\xbd\xff\xff\xf6\x16\xcb\x7b\xa1\x9c\xdf\x46\xd4\x64\
\x53\x62\x50\x34\x48\x7a\x56\x0e\x3d\x1f\x3a\x0e\x4f\x89\x03\xd0\
\x02\x24\x3f\xc2\x24\xe5\xd2\xbe\x4b\x22\x20\x32\xb0\x5a\xef\xf7\
\xb6\xe4\x98\x0a\x8c\xf2\x76\x4c\xed\x5f\x83\xc0\x89\x26\x1f\x8e\
\xf2\xb6\xbe\xdb\x23\x4e\x5a\x79\xdb\x80\x91\xc0\x5f\x40\x29\xbb\
\x3c\xe8\x5b\x81\xd1\x3e\x6b\x8d\x0b\x11\xcd\x1e\x5d\x9a\x26\x0f\
\xc5\x57\x3c\x98\xc0\xb4\xea\xad\x85\x4c\x00\x75\xda\x7e\x7e\x7c\
\x33\xc6\xc3\x24\xff\x04\x24\xcd\xb8\x5f\xb9\x79\x54\xfe\x59\x28\
\xe9\xec\xa9\x35\xe8\xe3\x3d\x85\xa6\x00\xa3\xc2\xbf\x3f\xb9\xbb\
\x36\x91\xff\x4d\x36\x1c\x5d\x59\x36\x36\x29\x54\xc2\x34\x8a\x02\
\xa6\x01\x39\xaa\x29\xdc\x5c\xe0\x33\xef\x56\x2f\x00\xc0\x5e\xa5\
\xcf\xc7\x29\x72\xde\x2d\x73\xf9\x03\xd5\x03\x54\x16\x19\xbf\x82\
\x25\x19\x75\x64\x38\x52\x74\xa2\xd1\x30\xc9\x6f\x2d\x24\xdd\xaa\
\xa7\x28\xf8\x48\xd6\x5e\x13\x42\xeb\x0f\xf9\x68\xd3\x75\x63\xbb\
\xe9\x76\x7c\x32\xa4\x5e\x08\x99\xdf\x5b\x88\x68\x3f\x59\x0e\x1c\
\x65\xae\x1c\xdf\xd8\x6b\x94\x75\x30\xf0\x3e\x90\xad\x89\xc2\xcd\
\x03\x3e\x02\xbc\x97\xc4\xb0\x57\xed\xff\xe5\x09\x19\x2f\x98\xf1\
\xe3\xbd\xd5\x02\xc8\x55\xad\x85\x4c\xb2\xa1\x88\x7f\x4c\x2a\x07\
\x24\xc3\x60\x92\x3f\xbb\xec\xf4\x92\x01\x25\xc2\xf9\x9d\x74\xd7\
\xb6\x0a\x2d\x47\xcf\xdc\x9d\x6b\x44\xc3\xe8\xc0\xdc\x47\xdb\xc7\
\x92\xaf\xed\xc3\xdb\xca\xb1\x8e\x72\xff\x7c\xae\x45\xb8\x37\xc0\
\xbb\x07\x48\xd7\x5c\xdb\x5e\x03\x1e\xf4\xbe\xa1\x54\xe3\xde\x79\
\xe7\xe9\xdf\xf2\xda\xa2\x7b\xaa\x06\x50\xeb\x5c\x0b\x99\xe4\xa1\
\x11\xcf\x98\xe4\x08\x48\x86\xc0\x24\x8d\xa2\xec\x5c\x26\x8c\x9f\
\x03\x5c\xde\xe6\x48\xd0\xe9\xb9\x24\x6d\x11\x30\x54\xf2\x02\x7b\
\xa5\x0e\x8f\xfc\xef\xab\x69\xc9\x0d\xed\x30\x44\x13\x8f\x2f\x7e\
\x61\xcc\x13\x1f\xaf\xbf\x40\x5e\x25\x23\x28\xf1\x99\x2d\x87\xa7\
\xb6\xa6\x9c\xa6\xc3\x1f\x74\xba\x65\xe2\xe6\x0c\x77\xe2\x87\x03\
\x5f\x03\x83\xf5\xcb\xcd\xb1\x02\x18\x0e\x5c\xf5\x64\xb3\xd5\x7f\
\x78\xf9\x9e\x2f\x7a\x51\xa6\xb8\xb8\x30\xb3\x4b\xd2\xa3\xeb\x33\
\x45\x7a\xd9\x94\x21\x9e\x1a\x2b\x3a\xe5\x73\x54\xae\x9a\xbd\x05\
\xa1\xe9\x98\xe3\x55\x25\x58\xba\x39\x48\xbe\xe3\xee\x74\x48\x1d\
\xc4\x26\x35\x2f\x37\xcc\xad\x7d\x1b\x02\xfc\x28\x79\x41\xf1\xe5\
\xbf\x3e\x1d\xd6\xa2\x46\xe7\x47\x3e\x5d\x77\x9e\xf3\x77\x49\x5b\
\x37\x7d\xdc\xad\xd5\x1a\x0f\x99\x42\x83\x46\x08\xa8\x3a\x70\xca\
\x9b\xb4\x68\x94\xff\xe7\x13\x77\xbd\xe6\x09\x8d\x9a\x03\x47\x80\
\x21\xba\x32\x43\x5f\xe0\x08\x70\xab\x87\xbf\x14\x1c\x9b\xfd\xe0\
\xfd\x73\x2f\x50\xf6\x57\xf5\xe1\x8f\x1f\x4d\x0a\x22\x95\x47\xf7\
\x9a\xad\x54\xab\x7e\xe1\xc6\x47\x4b\xc7\x86\x22\xa9\x97\xac\xbc\
\x20\xdb\xdc\x61\x65\x27\x31\xb7\xb7\x1c\xdf\x94\x73\x3b\x49\x6b\
\x40\x62\xb5\x88\x10\xc8\xf8\x92\xe4\x1a\x41\x0f\x94\x52\xf8\x88\
\x81\xc0\x76\xa0\xb2\xd4\x25\x85\x17\x36\xcd\x7c\xa2\x5b\xed\xb8\
\xb6\x23\x3e\xf8\xf5\x44\x09\x7f\x9c\x97\xb6\x6e\xfa\xb8\x5b\xab\
\xd6\xee\x36\x61\xd6\x5f\x17\x29\x53\xbd\x86\xb7\x79\x71\x4a\x7f\
\xca\x72\xe4\x97\x16\x3c\x70\xff\xe7\x47\xdc\x33\x9d\xdf\x03\x6c\
\x01\xe2\x39\x20\x48\x2c\xf0\x07\x30\xca\xfd\x0f\x25\xe9\xbf\x3c\
\x31\xe8\xfd\x14\xca\xee\x5a\xbc\x32\xa9\x5f\x9c\x8d\x46\x30\x3d\
\xa4\xb6\xe2\x12\x99\xd4\x7b\x84\x72\xe7\x9b\x72\x2c\x51\xc9\xfb\
\x67\x14\x4c\xd2\x14\x90\xd4\x30\x69\x45\x02\xbd\x2f\x03\x93\x34\
\xe0\x1e\x85\x42\xd5\x16\x38\x04\xdc\xee\xe3\xaa\xa2\x4b\x3b\xbf\
\x7d\xb1\x6f\x62\xa5\x66\x43\x5e\x5f\xb0\xed\x02\x0f\x1c\x57\x72\
\xe6\xcf\x39\x2f\x0d\x6d\x1d\x57\x4b\x0e\x14\x01\x40\x40\xc2\x90\
\xf7\x1e\xa3\xac\xc1\x71\xfc\xa3\x41\x8f\xfe\x74\xc1\x0d\x96\x9f\
\x01\x7e\xd0\xaa\x5c\x10\x49\x0b\x01\x66\x7b\xaa\x16\x21\x66\x6d\
\x7d\x73\xd0\x93\x9b\xe8\x88\x15\x71\xd7\xbb\x8f\x34\x0e\x66\x23\
\xa1\x9c\x20\x93\xda\x68\xa7\x4d\x5d\x25\xed\xd1\xc8\xd1\x2e\xe4\
\x1c\x93\xb4\xdb\x43\x62\x8e\x46\x54\xb5\x21\x48\x2e\x96\x5d\xbe\
\x45\xf6\xab\x29\xe7\x8a\x22\xe0\x25\x60\x0a\xe1\xea\x23\xac\xd6\
\xad\x77\x0f\x1f\x35\x7a\x64\x72\xd7\xba\xc1\x9a\xb3\xda\xc5\xed\
\xdf\xcd\xfa\xfc\xf3\x59\x0b\x37\x9d\xc9\x25\x7d\xef\x50\xc0\xad\
\x32\x6c\x58\xbb\x69\x87\xb7\x3d\x45\x05\x48\x67\xa6\x77\x6e\xf6\
\xe4\x26\xd7\x0d\x95\xc7\x80\x4f\x80\x00\xfe\x64\xb2\x14\x78\x03\
\x78\xdb\xf5\xe7\xa0\xc4\x67\x36\xa6\x4c\x6d\x47\xb3\x84\xcc\x5c\
\x3c\xa0\xee\xbd\x3f\x5f\x29\x55\x26\xb0\x4c\x92\x14\x28\x75\xb2\
\x69\x3e\x0b\x8a\xd6\x9a\xc9\x4a\x9f\xa8\x41\x9d\x0b\x70\xb9\x9f\
\x24\xa4\xa6\xa6\x26\x26\x26\x01\x06\x4c\x32\xa1\x02\x80\x89\x2c\
\x00\x89\x16\x29\x95\xb7\x25\xc0\x28\x20\x8b\xf8\xfa\xa0\xb8\x96\
\x77\xde\x9f\x3c\xa4\x7f\xaf\xee\xb7\x37\xab\xa2\x6a\xe4\x43\xf1\
\x3f\x3b\x56\x2c\x5b\xf6\xd3\xb2\x65\x2b\xd6\x1f\xbc\x54\x40\xfe\
\xb2\x01\xc0\x14\xe0\x69\x77\x4c\xad\x7c\xf7\x4f\x27\x97\xf4\xa7\
\x31\x6a\xd2\xbf\xee\xdd\xe8\xa1\xd5\x57\x9d\xb5\xf2\x28\xe0\x4b\
\x9f\x07\x54\x75\xc5\xa4\x67\x81\xff\xb9\xe2\x73\x8b\x37\x76\xee\
\x79\xbd\x31\x4d\x47\x3b\x27\xd4\xeb\x30\xfd\x44\xb1\x8a\x3a\x5a\
\x86\xea\xa4\xe2\x79\x6e\xd5\x12\xdb\x8c\xe0\x1a\x87\x7d\xf1\x8b\
\x49\xa9\xa9\xa9\xc6\x8b\x55\xd7\x92\xed\x44\x6a\xbe\xa4\xda\x74\
\x65\x15\x11\x7b\x15\x18\x2d\xe3\xf5\x02\x22\x12\x5a\xf5\x19\xfe\
\xdc\x07\xdf\xfc\xba\xf3\x34\xa3\x9c\xa8\x39\x67\xf7\xae\x5d\xfc\
\xe5\xa4\xe7\xc7\x0c\xec\xd8\xa0\x82\x2c\x95\x3f\x00\x38\x07\x7c\
\xe5\xe1\x2f\x81\xf5\x9e\xdc\x49\x37\x9a\xab\x3f\x0c\x74\xdb\x49\
\xe9\x02\x14\xe8\x97\x51\x94\xf0\x53\x04\xdc\xed\xa6\xe5\x22\x3a\
\x7c\x74\x92\xee\xfd\x4f\x4d\x6e\x15\xa2\x86\x2e\x66\x12\xf7\x6c\
\xe8\x64\x42\x3e\x29\xa3\x84\x9e\x9a\x29\x37\xde\x74\xfe\x4d\x0b\
\xe9\xe6\x4f\x82\x6f\xf2\x99\xb8\x42\x94\x3b\x1a\xd1\x2e\x22\x68\
\x6b\x65\x32\x64\x89\x8d\xc0\x48\x9a\x6c\x9e\x2e\xcd\x1e\x59\xb5\
\x4e\x83\xa4\xa4\x86\x0d\x93\x12\x13\x93\x92\x92\x1a\xd4\xaa\x52\
\x21\x32\x22\x22\x32\x32\x32\x22\x22\x22\x22\x22\x3c\xf8\x5f\xff\
\x96\x58\x9c\x9f\x9b\x93\x9b\x93\x9b\x9b\x9b\x7d\xed\xe2\xb9\xd3\
\xa7\x4e\x9e\x3c\x55\xd6\x4e\x1c\x3d\xb8\x3f\xe5\x6c\xa6\xfc\x05\
\x79\x2c\x30\x07\x18\x00\x08\x40\x27\x60\xb3\xab\x89\xd0\x7a\xca\
\xe1\x9d\xcf\xd6\x24\xef\xaf\x68\xc3\xd8\xfa\xdd\x67\x9f\x71\x1c\
\x50\x25\xe0\x90\x8f\x78\x10\x5e\xda\x75\xa0\x39\xe0\x54\x8e\x51\
\x88\xe9\xf3\xed\xd1\xdf\x86\xc5\x90\x77\x72\x6d\x41\xef\xba\xc3\
\x56\x5f\x57\x41\xef\x50\x95\xfe\xa2\x15\x01\xe3\xfa\x6b\x68\x3d\
\x6f\xfa\xa6\x6d\x95\xa7\xe2\x78\x01\x24\xbd\x52\xed\x12\x4e\x2a\
\x2f\xc9\x77\xe9\xe5\x8a\xa1\xba\x28\x00\xa6\x00\x6f\x02\x45\x86\
\x12\x63\x01\x78\x11\x78\x09\x88\x04\x00\x14\x02\xd1\x40\xbe\xf3\
\x35\x91\xb7\xcd\x39\xbe\x7e\x34\x05\x96\x9c\xff\xac\x63\xd2\xe3\
\x5b\xb2\x9d\x7e\xdb\x0e\xb4\x35\x0e\x59\x0e\x00\x2d\x9c\xeb\xbd\
\x06\x25\xbd\xb0\xe3\xf0\xe4\xe6\xe4\x5d\xe4\xad\xb8\xa7\x66\xff\
\xa5\x97\x5d\x59\xac\xa5\x97\x14\xf2\xba\x23\x93\xa0\xb2\x42\x10\
\x55\x46\x3b\x2a\xe7\x1b\x0f\xc5\xc8\xb9\xc2\x24\x57\x6f\x86\x71\
\xd1\x08\xe0\xf1\xbc\xb4\xf6\x06\x71\x30\xf0\x32\x70\x19\x78\x0b\
\x08\x83\x31\xda\x73\xc0\x25\xe0\xfd\x1b\x68\x04\xe0\x82\x1b\x1a\
\x41\xa8\xd8\x79\xc2\x10\x1a\xcb\xa6\x64\xd3\x9b\x1f\x6e\x77\x46\
\xa3\x77\x0d\x85\x46\x00\x9a\x02\xd3\x9d\x7f\x29\x3c\x32\xe7\x95\
\x45\x19\x14\x5d\x84\xf6\x7e\xa2\x4f\x55\xf7\x50\x88\x43\x0c\x17\
\x13\xc9\x9e\xa3\xc6\x21\x2b\x3c\x8f\xe1\x90\x24\xa4\x52\xbb\x54\
\x61\xf3\xe5\xfc\x49\xd3\xb5\xa0\xc0\x91\x85\x64\x23\x41\x23\xae\
\x73\x63\xcc\xe7\x71\x8e\x69\x31\x89\x39\x3f\x44\x01\xaf\x02\xe9\
\xc0\x07\x40\x34\xaf\xda\x36\x18\x78\x16\xb8\x04\x7c\x08\xc4\x3a\
\xff\x69\x93\x3b\x89\x62\xba\x3c\xd6\x37\x92\xa2\xf7\xb4\x59\xff\
\xfd\xee\xb4\xa3\xb3\xae\x8e\xa7\x28\x09\xfe\xdb\x43\x40\x13\x27\
\x7e\xba\xb2\xfa\xad\x8f\x0e\x53\x74\x60\xef\x32\xbe\x9f\x7b\xbe\
\xd5\x02\xe0\x14\x73\xd5\xc6\x0e\x99\xb4\x11\x4c\xe6\xc8\x44\xfe\
\x82\x26\x29\xf0\xaa\x12\x20\x11\x9e\x5b\x36\xc4\xd6\x91\x65\x27\
\x95\xb7\x70\xe0\x79\xe0\x02\x30\x17\xb8\x8d\x27\x82\xdc\x0a\xcc\
\x03\xae\x03\x53\x80\x4a\x9e\x2e\xf8\xd1\x1d\x8f\x3a\x8f\xe9\x46\
\xb3\x3d\xbf\x77\xca\xd4\x6d\xce\x71\x87\x0b\x80\x50\x03\x8a\x68\
\x90\x5b\x52\xdd\x82\x43\x33\xdf\x5c\x5d\x40\xd1\x45\xfb\x91\x3d\
\x3d\xe5\xb6\xdb\xa2\xde\xa2\x3b\x99\xd9\x91\x26\x63\x21\x93\x04\
\x24\xbb\x5f\x49\x31\x42\xbf\x09\x37\xb3\x91\x1b\x46\x06\x0a\x64\
\x30\x22\x26\xa9\x67\x34\x87\x00\xc3\x81\xf5\xc0\x3f\xc0\x24\x20\
\x51\x3f\x22\xd4\x01\x5e\x00\x8e\x02\x9b\x81\x64\x40\x02\x5f\x36\
\xb8\xe1\x51\xa7\x31\xdd\x28\xe0\xa4\x74\xf3\xf4\x85\x27\x1d\x77\
\xd1\xee\x05\xda\x1b\x56\x4a\x5b\xb8\x84\x50\x96\xa6\xaf\xfe\x64\
\x05\x79\x94\x3f\x84\x5b\x46\x76\xaf\xe2\xee\xb5\xfb\x8d\x2c\xd7\
\x89\x06\xda\xd9\x28\x5a\x85\xc2\xf7\x78\xe3\xc5\x25\x5e\xdf\xc2\
\x24\x0f\x34\xf1\x76\x30\x56\x79\xca\x45\x1e\xe0\x47\x97\x31\x8b\
\x0a\x50\x47\x1b\xae\x3b\x00\xfc\x02\xac\x01\xfe\x04\x34\xc8\x2a\
\x74\x3b\x30\x08\x18\x00\xd4\x21\xbb\x3e\x1f\x88\x04\x9c\x62\xf5\
\xa2\x7b\x2f\x3a\xbb\x72\x30\xb1\xc7\x2e\x7f\xe5\xd0\x5a\x7d\x17\
\xa5\x97\xde\x24\xfb\x31\xa0\xae\x91\x05\xf5\x1f\xa0\xa6\x63\x74\
\x43\x64\xd7\x6f\x4e\xae\x1d\x11\x4b\x7a\x7b\xf1\xda\xfb\xaa\xf7\
\xf8\x21\xdd\x99\xbd\x6a\x02\xa7\xd5\x39\x9c\xe7\x53\x54\x75\x54\
\x26\xf2\xf2\x29\xab\x77\x4e\x88\x24\xca\x8e\xe7\xa3\xac\xec\x2d\
\x24\x03\xa1\x91\x48\x89\x3a\xbc\x99\x4a\x9c\xac\x72\x9a\x02\x13\
\x81\x35\x40\x01\xb0\x13\x98\x0c\xf4\xf2\xe2\x3a\x93\xd7\x12\x80\
\xc1\xc0\x87\xc0\x46\x20\x17\xf8\x13\x78\x92\x18\x8d\x00\x5c\x75\
\x41\x23\x20\xbc\xd9\xe0\xdb\x29\xf6\x8f\x32\x97\x7f\xf2\xfb\x25\
\x87\xd0\xb4\x21\x34\x4f\xe7\xb3\x55\x07\x86\x39\x7e\xcf\xda\xf6\
\xc5\xf7\x69\xe4\xb7\xdb\xdb\x0d\x6d\x15\xe5\xfa\x63\x1a\x50\x44\
\x66\xbb\x6b\xef\xd1\xd2\x7a\x61\x4e\x8c\xa3\xcc\xc7\x6f\xd9\x49\
\x52\x16\x92\xbe\x41\xf1\x84\x0a\x5d\xe0\xde\x4e\x12\x95\x70\xbf\
\x7e\xe4\x2d\x04\x8e\x03\x87\x81\x54\x20\x15\x38\x05\x64\x01\xd9\
\x40\xd6\x8d\x4f\x79\x0b\x05\xc2\x81\x30\x20\x12\xa8\x01\xd4\x06\
\xea\xdc\xf8\x6f\x43\x87\x60\x39\x79\x6d\x2d\xd0\xdd\xe9\x87\x90\
\x96\x1f\x1c\xde\xfd\x7c\x2d\xd2\xfb\xaf\x7c\xd3\xa5\xce\xa8\xf5\
\x0e\xc3\x3d\x06\xd4\x33\xbe\xac\x9e\x02\xea\x3a\xb0\x47\xc8\x7f\
\xde\x4f\xf9\x7b\x62\x6d\xd2\xbb\xd3\xbf\xec\x58\xe7\xe1\x2d\xb9\
\x2e\x7c\x78\x19\x88\x21\x33\x80\x48\x4e\xd7\xb1\x0d\x20\x56\x29\
\x3e\x5b\xa4\x74\x5a\xe8\xe2\xe6\xf1\x66\x21\x99\xde\x48\xb2\xf3\
\x6c\x4f\xb0\xd2\xd4\xee\x89\xb9\xf4\x85\x58\x69\x49\x13\xf4\xc3\
\xa4\x20\xa0\x11\xd0\x48\xef\x89\xde\xe1\xca\xa4\xd5\x3a\xf7\xae\
\x45\x7e\xfb\xf5\x55\xf3\xfe\x76\x40\xa3\x8e\x06\x77\xd6\x95\xb7\
\x5a\x40\x0f\xe0\xf7\x1b\x5f\xf3\x0f\x2f\x5e\x7a\x76\xe2\x33\xa4\
\x59\xfd\xe2\xba\xf5\xae\x1b\xbc\xe5\x40\x81\x33\x1f\xfe\x03\xc4\
\x90\xa9\xfe\x72\xb6\x94\xb8\xb8\x4c\x57\x2a\x87\x25\x91\x06\x05\
\x25\xf4\xbb\xb4\x98\x1b\x54\xb1\x8b\xa2\x99\x31\xc9\x56\x3e\x7f\
\xe4\x47\xb4\xf8\x34\x1b\x7d\x1e\x40\x73\x7c\x47\xdd\xe3\x7c\xac\
\x24\x4d\x12\xcd\x25\x41\x83\x10\xdd\xb2\x2f\x05\x48\xe6\xac\x9b\
\xbf\x2b\xd3\xe1\xfb\xab\x46\x3e\xf6\xef\xa2\x40\x5f\x76\xfc\x9e\
\x9f\xb2\xe4\xb7\x74\xf2\xdb\xeb\xf7\x6c\x1d\xe3\xe6\xa1\xdf\x4f\
\xc3\x90\x82\xc3\xc5\x52\x1b\xa5\x02\x04\x41\x7e\x5a\x1a\xd1\xcb\
\x8f\x54\x6e\x43\x9f\x8e\x35\xde\x58\xc2\x72\xdc\xdd\x04\x24\x5a\
\x67\x17\xb7\xf8\x4c\x35\xa9\xba\xfb\x21\x45\xe3\x48\x8b\xc6\x6d\
\xbf\xf3\xd7\xb0\x86\x77\xb4\x0c\x24\xbe\xb9\x64\xe7\x22\x07\x3c\
\x0a\xe7\x2c\xde\x5d\x61\x6b\xef\xe4\x0e\xcd\x3d\xb0\x64\x43\x36\
\xf9\xcd\x4d\xee\x68\xec\x96\x94\x76\x27\x3d\x28\x82\x06\x96\x68\
\x25\xc2\xd1\x24\xf2\x58\x6c\x42\x79\x88\xb6\xc0\xab\x7c\x49\xc5\
\xe3\x09\xfe\x82\x49\x36\x3e\x87\x25\xdb\x82\x31\x56\x8c\xa9\x65\
\x27\x79\x6c\x17\x9d\xbe\xd9\xab\xb4\x6d\x47\x91\xa0\xe1\xc0\xd2\
\xad\x0e\xf5\x16\x92\x8d\x79\xf6\xc8\x5b\x0b\x01\x46\x38\x7c\xcd\
\xde\xfb\xd3\x6e\xf2\xda\x12\x51\xad\x6f\xab\xe5\x5a\x75\x64\xb7\
\x24\x37\x7a\xde\x51\x56\x81\x87\x45\xef\x09\xb7\x04\xc9\x5b\x44\
\x5d\xe5\x91\x79\x46\x54\xcb\x4e\xb2\x19\x51\xb9\x8b\x8a\x27\x95\
\x7f\xdc\xf2\x5b\x23\xa9\x04\x70\x3e\xf3\x19\xd6\xe0\xb6\xfa\xe4\
\xb7\x9f\x5b\xbb\xf9\x82\x43\x88\xde\xc3\xa6\xa3\xcf\x38\x87\x7f\
\x97\x5e\xdd\xbe\x82\x22\x67\x43\xed\x8e\x89\x11\x2e\x7c\x75\xcc\
\x97\x98\x10\x62\x92\xc8\x48\x9c\x05\xfa\x0a\xce\xac\x90\x49\x06\
\x1a\xa9\xa1\x52\xbc\xf5\x23\xf8\x87\x46\xb0\x71\xa8\xb2\x3d\x6e\
\x48\x8a\x2c\x26\xd5\xdb\x5f\xf5\x4a\x77\x2f\x58\x98\xe4\xd6\x0a\
\x5c\x26\x22\x28\xa1\x5d\x13\xf2\x9c\x7c\xf9\x7b\xd7\x1e\x2f\xaf\
\xe9\x17\xcc\x41\x80\x06\xf3\xd6\xc0\xf1\x40\x71\xd1\xf9\xbf\xb6\
\x5f\x21\xbe\xd5\xde\xa0\x83\xab\x89\x74\x95\x40\x29\x93\x60\x92\
\x42\x29\xf0\x59\x61\x56\x20\xf8\x28\x47\x23\xd9\x9d\x78\xce\x96\
\x24\xb2\xec\x0d\xfe\xe1\xb8\xe3\xce\x65\x67\xa5\x78\xf2\xf3\x96\
\xeb\xa2\x16\x43\x6b\xb7\xa3\x88\xb0\x3b\xba\xe6\xd0\xcd\x5d\x95\
\x76\xe6\xf2\xd7\x95\xb5\x10\xe0\x96\x9b\xdf\xf2\x8e\xac\x49\x21\
\xbf\xb7\x46\xfb\xc4\x48\x41\x12\xfe\x3d\x29\x47\x12\x3b\xc9\xd0\
\x8b\x27\x6f\x14\x90\x88\xcb\xf0\x99\xc2\x46\x33\xa8\x30\x19\x26\
\xd9\xf4\x32\x8f\xd4\x06\x1e\xaf\xab\x8c\x64\x29\x76\xd4\x72\x72\
\x05\x46\xd7\x98\xac\xe5\x38\x7f\x0d\xac\xdc\xb8\x0e\x79\xb9\xf5\
\x8c\xfd\x7b\xd3\x6f\x3a\xec\xc6\x9a\x94\x44\x63\x6e\xfe\xb3\x34\
\xe3\xf0\xf6\xb3\xe4\x2c\x97\xd0\x3c\x3e\xc8\x95\xf9\x8b\x09\xb4\
\xb3\x57\x69\x32\x3e\x31\x65\x88\xbc\x8e\x68\x54\x16\x2a\xe2\x62\
\x2a\x99\x09\x93\x74\xb0\x90\xca\x36\x00\xbd\xa5\x04\x96\xcd\x46\
\xee\xb3\xc2\xf3\x46\x91\xb7\xf0\x21\xab\x65\x3a\x7f\x0d\x4e\xf8\
\x4f\x75\xf2\x9b\x4f\x6e\x39\xe1\x50\xb5\xa2\xab\x49\x49\xe4\xf8\
\x5e\x05\x67\xb6\x9f\x20\x8f\x6b\x88\x6f\x5e\x3d\xc4\x95\xeb\x0a\
\x2d\x9e\x93\x0b\xae\xd2\x68\xa4\xea\xae\x8f\xbc\xce\xf9\x87\x2e\
\xad\x01\x49\xe3\xea\x20\x2e\x1c\x23\x6d\x1e\x69\x6f\x24\x81\xb3\
\xa7\xf3\xd0\x9c\x4b\xfd\xd8\x22\x6a\xd6\xab\x40\x7c\x6f\xf6\xb1\
\xd4\xab\x37\x16\xfc\x76\x20\xce\xa4\x24\xaa\x0c\x94\x87\xc1\x8b\
\xd9\x27\xf6\x90\xa7\x10\x0a\xae\xd5\xb0\x92\x6b\x55\xf9\x3c\x65\
\x4c\x68\x56\x23\xde\xdb\xf1\x5e\x9f\xe9\xf8\x34\x2e\x2f\x44\xf2\
\xb8\x32\xdf\xa3\x21\x0c\x29\xd2\x5c\x76\x1e\xdf\x50\x86\x61\x24\
\x0f\x48\x14\xa6\x1c\xa6\xd5\xfe\x6a\x4f\x9c\x20\xf9\x44\xbd\x5c\
\x88\x9c\x34\xe7\x6d\x76\x7b\x6c\x5d\x8a\x1c\x7b\x69\xfb\xcf\x97\
\x47\xe8\xc5\x01\x41\x26\x25\x51\x10\x10\x5f\xfe\xa5\x30\xed\x20\
\x45\x4e\xbb\x4a\xf5\x2b\xbb\x52\x25\x57\x7d\xdb\x82\x5b\x36\x96\
\xce\x04\x21\x81\x46\x2a\x59\x30\xcc\xa1\x08\x46\x4b\x3b\x64\x93\
\x81\x1f\x32\x90\xd6\x67\x88\xa4\x72\xf3\x48\x82\xd6\x3e\xf3\xc0\
\x6b\x69\xfe\x0b\x04\xe2\x2a\xfa\xb1\x07\xcf\x39\x68\x2c\xb0\x52\
\xdd\x58\xf2\x7b\x2f\xa6\xa6\x97\x97\x9c\x68\x63\x6a\x2a\x75\x28\
\xff\x57\x49\xc6\xc9\x53\xe4\xa7\x63\x63\x6a\xc7\xba\x9e\x31\xce\
\x57\x13\x42\x44\x87\x84\x43\x5c\xb1\xb4\xcf\xc1\x48\xeb\x6e\x19\
\xca\x44\x2f\x03\xc5\x58\xf1\xe2\xd4\xe7\x90\xd4\x20\xab\x3c\x34\
\x52\x18\x08\x2e\x4a\x06\x8c\x2a\x7f\x4b\xc1\xef\x13\x2e\xb0\xb0\
\x90\x82\x62\x6b\x90\x7b\xec\x32\xcf\xa6\xe7\x97\x4f\x5c\x67\x53\
\x53\xc9\x21\xfd\x44\xd1\x95\x13\xe4\x91\xdf\x41\x71\x09\x51\x01\
\x04\x16\x92\x72\xd6\x15\x3d\xa5\x31\x15\xf4\x56\xd6\x4a\x70\x91\
\x87\xda\x19\xa6\x47\x26\xaf\x51\x76\xfa\xc6\x32\x6a\x6c\xc4\x08\
\x6a\x3e\x45\xa0\x34\x8f\xfc\xbc\x39\x05\x35\x04\x84\xc7\x46\x90\
\x4f\xce\xd5\x33\xd7\x6e\x86\x8c\xb5\x34\x35\x95\xfe\xe3\x00\x48\
\x57\xcf\x5c\x23\xbf\xb1\x42\xf5\x68\x97\x4d\xa4\x1c\x1a\x34\x22\
\x5c\x3b\x8a\x54\x7d\x6a\x88\x46\xb4\xfe\x0c\x86\x68\xa4\x23\x1e\
\x18\xc8\x48\xb2\x91\x5b\xa3\x0c\xf9\xc6\x91\xad\x8d\x55\x7b\x49\
\x09\x2c\x59\x68\x44\xd2\x9c\x3c\x48\xb6\xf0\x4a\x11\xe4\xb7\x66\
\x5d\xcc\xba\x09\x48\x75\x4d\x4d\x25\x87\xa3\x59\x25\x99\x69\xd7\
\xc9\x19\x29\x3c\x36\xdc\x45\xe6\xf3\x94\x79\x1a\x7c\x0a\x8e\xb4\
\x61\xc4\xb6\x62\x85\xda\xe2\x6c\xdc\xea\xb7\x46\xc1\x24\xbb\x6c\
\x34\x52\xf8\x86\x4a\x22\xbc\xad\x66\xe2\x56\xe8\x62\x21\x85\x93\
\xdf\x9a\x7b\x35\xe7\x66\x04\x74\x05\x53\x53\xc9\xb1\xd8\x5e\x71\
\xd6\xb5\x3c\x80\x30\x9b\x45\x58\x6c\xb8\x8b\xcb\xae\x40\x05\xaf\
\x00\x79\xf1\x24\x0b\x8d\xac\xe6\xd5\x42\x22\x44\x23\x8d\xe3\x1a\
\x8d\x65\x0c\x71\xfe\x50\xfe\x9b\xd3\xa1\x1a\x5b\x60\x28\x79\x9e\
\x6f\x31\x2f\x23\xff\xe6\xdd\x61\xa6\xa6\x92\xe3\x69\xa2\xd2\xdc\
\xab\xe4\x91\x72\x61\x15\xc3\x7c\x02\x12\x93\x0d\x54\xf8\xcc\x8c\
\x25\x70\x81\x46\x84\xcf\xb7\xd0\x48\x6b\x40\xf2\xb6\x69\xe4\x8e\
\x46\x16\x90\xb0\x5a\x48\x5a\x51\x0f\xbe\x14\x84\x3d\xd8\x4e\x7c\
\x67\x49\x41\x91\xc3\xdc\x04\x98\x9a\x4a\x8e\x54\x29\x2d\xcc\x21\
\xb7\x72\xec\xc1\x81\x36\xa6\x4c\xee\x2d\x1c\x97\x28\x11\x89\x60\
\x60\x15\xa1\xd7\x86\xba\xb9\xab\x98\xdb\xc8\xf1\xdf\x7c\x86\x91\
\x3c\x96\x15\x54\xd8\x5e\xb2\x9a\x17\x9b\xdd\x1e\x44\x0e\x2c\x25\
\x45\x25\x0e\x13\x53\xe2\x37\x14\x13\x8b\x0b\x29\x5e\xd6\x1e\x1c\
\x20\xc8\x31\x11\xa4\xa1\x88\xcf\x14\x94\xaa\xaa\x6e\xc1\x92\x5b\
\x95\xc4\x9f\xa4\x30\x94\x66\xd4\x37\x84\x69\xcc\xbc\xca\xb8\x05\
\x4b\xe5\x2d\x98\x51\x3f\xb9\xa6\xa6\x52\x91\xa3\xda\x2d\xa1\x01\
\xa4\x80\x20\xbb\x33\xab\x05\xca\xe5\x46\xd7\xd3\xeb\x9c\x61\x12\
\x55\x0d\x5c\x23\xb9\x10\x04\xb3\x57\x8c\xe5\xd9\x30\x12\x39\xee\
\x9f\xf9\xd8\x2c\x58\x82\xcb\xde\x0f\xd5\xe2\x3f\x20\xd0\x71\xed\
\x9f\x61\x6a\x2a\x39\x86\xc6\x09\x01\x81\x14\x19\xc0\xc4\x52\x17\
\x75\x16\xac\x80\x03\x1d\x31\x49\xcb\xa5\xa4\xa8\xb7\xde\x50\x34\
\x78\x16\x05\xfd\xcc\x8a\x49\x76\xa3\xbf\x80\xe8\x5e\x2e\x6c\xbe\
\x16\xb2\x21\xdc\x38\x61\x27\xd0\xb3\xa3\x8f\x72\x4d\xfe\x1d\xef\
\x10\xed\xf4\xad\xb8\xa0\x98\x1c\x90\x82\x03\x1d\x26\xe3\x04\x50\
\xdb\xbc\x54\xba\xee\xc8\x30\xf6\x20\x0a\x31\x2e\xca\x2f\x72\x66\
\xaf\x10\x65\xe6\x82\xc6\x2e\x0d\x92\xc2\x45\x3c\x88\x8f\x4f\xbc\
\xb1\xa2\x24\xcc\x09\x48\xf2\x94\xbe\x8e\x8c\x6b\x31\xa2\x74\x73\
\xca\x14\x54\x5a\x94\x57\x44\x4e\xd9\xd0\xe8\x10\x5b\x79\x98\xde\
\x6e\xa0\x9b\x79\xa9\x74\xc4\xf1\xbd\x03\xc3\xc8\xb3\xf6\x95\x16\
\x16\x94\xb8\x99\xa4\x02\x99\x6e\x55\xc8\xba\x0a\x57\x8a\xe4\xd2\
\x2a\x68\xeb\xaf\x93\x61\xeb\x30\x51\x02\xa2\x68\xc2\x7d\x2c\x9b\
\xcb\x1b\xfa\xcc\x9a\x6a\x88\x02\x7a\xda\x28\x7d\x81\x7b\xe7\x80\
\x11\x5b\x8c\x93\xfa\xcc\xb9\x92\x43\x7e\x6b\x58\x8c\xc3\xa1\xcf\
\x8d\xa6\xa6\xd2\x5f\x8e\x96\x61\x78\x2c\x79\x8c\x7b\x61\x6e\xa1\
\x0b\xc7\xb6\x91\x14\x76\xe9\x33\xec\x54\xe0\x51\x56\xe8\x4f\x86\
\x02\x11\xdd\xca\x9c\xeb\xb0\xc6\xf5\xae\x18\x69\xb5\x8d\x72\xed\
\x54\x8e\x43\x54\x8e\x3b\x83\x65\xfb\x26\x39\xa7\xa6\x57\x55\x3d\
\xf5\x6c\x7f\x85\x4b\x21\x35\x30\xc9\xcf\x11\xae\xa2\xe3\x97\x92\
\x9c\xcb\xe4\x89\x43\x11\x19\x17\x71\xd3\xe2\xdf\x69\x6a\x2a\xad\
\x72\xf4\x72\x44\xc4\x90\x03\x92\x53\x36\x0b\x62\x28\xa2\xd2\x00\
\xa2\x24\x1b\xd3\xca\xb8\x28\xcb\xac\x61\x0e\x5a\x65\x5a\x51\x21\
\x26\x49\xa4\x64\xd3\x06\x2d\xf8\xc7\x24\xbb\xe3\x40\x49\xa0\x88\
\x43\xcc\x70\xd9\xc8\xd1\xc5\x27\x26\x2a\x96\x01\xcb\xd2\x2a\x6b\
\xd1\xce\x80\x74\x25\x9b\x9c\xb4\x15\x6b\xc5\xdc\x04\xa4\x74\xa0\
\x80\x5d\xcc\x1e\x27\xad\x2b\xf0\xa7\xdb\x8f\xd7\x7e\xec\x6a\x23\
\x66\xbe\x2a\xb7\xd4\xf3\x19\x26\xa2\x70\xdd\x29\x38\x60\x92\xa0\
\x00\x8d\x14\x4a\x84\x1a\x98\x24\x91\xeb\xc8\x5b\xa1\x77\x9f\xef\
\x5e\x0e\x12\x54\x2e\xb8\xf2\x58\x3b\xc2\xbb\x8c\x12\x04\x61\xe3\
\x16\x8d\x78\x33\x8f\xa4\x8d\x24\xd9\x7d\x8a\x56\xad\x58\x17\x33\
\xc7\xe9\x5b\xe1\x95\xb3\xd7\xc9\xb1\x2c\x21\x2e\xa4\x7c\x3a\x8a\
\x81\x8b\xa6\x23\xce\x1e\xc5\x3d\x5c\xdc\x95\x56\x44\x6f\x18\x51\
\x9b\x02\x8a\xc5\x53\xd4\x04\x63\x64\x60\x92\x84\xa9\x24\x75\x7e\
\x86\x2c\x09\x0e\x15\x6c\xc8\x8b\x7f\xe6\x1c\x99\xec\x20\xf6\xd1\
\x19\x14\x8d\x98\x07\xdd\x79\xec\xd0\x0a\xd7\x66\xd5\x9c\x73\xd7\
\x15\x5f\x3e\x71\xc5\xc5\x8d\x27\xb5\xfc\x4f\x8a\x0b\xc4\xe5\xf2\
\x6c\x78\x6b\x81\x91\xe6\x22\x4e\xb6\xf2\x2e\x8a\x72\x4b\x65\x59\
\x45\xd4\x3b\x25\xac\x17\x8b\xfc\x88\x58\x39\x26\x79\xb4\x93\xc8\
\xd5\x26\x13\x6c\x90\x61\x1e\xf1\x1c\x0d\x61\x53\xcf\x72\xe7\x16\
\x8d\x44\xd6\x12\xc5\x5c\xf6\xfc\xb9\x85\x3a\xab\xcf\x2b\x27\xc9\
\x8b\xfd\x20\xbe\x59\xbc\xa3\x8f\x6e\xb6\xe9\x88\x53\xa2\x9a\x98\
\xb0\x45\x23\xb6\x86\x91\x5e\x68\x24\x6d\x2f\xfa\xac\x08\x2a\x6d\
\x18\x79\x43\x23\xe6\x16\x8c\xc7\x0e\xb9\xb5\x93\xec\x84\x0c\xaa\
\xc5\xc9\x1e\xbe\x2d\x30\x13\xc0\xb3\x21\x5a\x10\x10\x70\x53\xf3\
\x96\x66\x9f\x3e\x76\x1d\xed\x09\x53\x77\x47\xd4\x4f\x8a\x09\x58\
\x93\x75\xe3\xe6\x1d\x40\x9e\x2b\xc2\x19\x7c\x81\xc5\xba\xc3\x88\
\xbb\x90\x35\x94\x0b\x28\x52\x63\xc1\xc7\x44\xde\xe5\xb9\x58\x94\
\x18\x46\xda\x58\x30\x7c\xda\x49\x36\x4e\xd0\x48\x89\xec\x09\x34\
\xe6\x91\x12\xfe\x2e\x0b\x92\x61\x45\x0d\xcb\x3c\xf2\xc6\x91\x8e\
\x5e\xbb\x82\x73\x7b\xfe\x21\xbf\xb9\xce\xad\x75\x1d\xf0\xa7\x10\
\x38\x64\x11\x54\xb2\x55\xab\x21\x57\xab\xea\x8d\x46\x5a\x8a\x8f\
\xf2\xc4\x0a\xb4\xa6\x09\x2b\xb3\xc6\xc7\x19\x1e\x91\x47\xf1\x57\
\x85\xee\x9c\x1b\x34\x32\x30\xc9\x3a\xd0\xaa\x59\x4b\x70\xf8\x77\
\xd1\xa5\x43\x27\xc9\x73\x59\x47\x37\x6d\x1e\xe7\x64\xf4\x7f\x61\
\x51\x53\xb2\xb5\xa8\x4e\xcd\xf0\x5a\xc6\xe0\xf0\x80\x46\xac\xd4\
\x23\x6d\x6c\x37\x93\x12\x74\x86\x3b\x39\x6b\xf3\xa9\xc1\x0d\x5c\
\x24\x51\xd7\x91\x4b\xf3\xae\x65\x1e\x49\xb4\x56\x8e\x5f\xf2\x4e\
\x6d\x3f\x4d\x7e\x6b\x83\xee\x8d\x9c\x4a\xcc\x7e\x47\x59\x11\xd5\
\xdf\x5a\xbb\x0a\x5e\x3d\x01\x12\x7c\xcb\x36\xe9\xa2\x20\x0b\x8d\
\x04\xfd\xe4\x5a\xce\xd9\x5e\xfd\x04\x5e\x1a\x93\x78\x33\x92\x6c\
\xd2\x24\x36\x6e\x64\x9d\x12\x31\x60\x22\x6f\xda\xb8\x3b\x4c\xd9\
\x3a\x3a\x7e\x29\x3c\xb7\xfd\x20\x79\xe6\xee\xd0\xff\x74\xab\xe7\
\x58\xbc\x2e\x07\x58\x6f\x11\xd4\xbb\xf4\xb7\x0e\xa1\x30\x8c\xa0\
\x5a\xfe\x5f\x81\xc6\x87\xc1\x43\x0e\x62\x5a\x58\x92\x67\xa9\xb0\
\x42\x0b\xe9\x00\x71\xae\x30\xc9\xc6\xc9\x38\x18\x22\x5f\x19\xa3\
\x10\x55\x78\x52\x80\x43\xd2\xe7\x87\xac\x08\x08\x25\xad\xb5\xd3\
\xb7\xdc\xa3\x1b\x8e\x91\xdf\x5b\xa3\xfb\xad\xd5\x9c\x23\x75\xde\
\xb6\x56\x00\x5e\xe1\x1b\x8d\x02\x89\x0c\x23\x0d\x2c\x12\x41\xc3\
\x67\xb1\xd2\x48\x1a\x60\x12\x5b\x53\xc9\xdb\x18\xf8\xc1\x24\x1b\
\xd5\x94\x68\x36\x6e\xd9\x11\x0d\xde\x58\x44\xe2\xa8\x1d\x43\x1c\
\x2a\x1f\x83\x65\x1e\x29\x69\x75\x9c\xbe\x15\x5f\xdc\xb1\xe3\x12\
\xf9\xcd\x4d\x07\xb5\x8f\x71\x9a\xcf\x2d\xc0\x71\x53\x90\xe5\x0a\
\xf3\x1e\x73\x10\x3f\x8c\x71\xa8\x8e\x72\x4c\x32\xd6\xae\x87\xb1\
\x30\x49\x02\x96\x38\xc1\x24\x1b\x2d\x1a\x19\x22\x05\x85\xb4\xdb\
\x41\x36\x46\x8a\x64\xcb\x46\x2b\xfc\x41\x61\x8b\x06\x1c\xd3\x57\
\xe7\x1e\xfe\xf5\x6f\xf2\x9c\xdf\x01\x6d\x87\xb4\x8e\x76\xf9\xed\
\x25\x53\xac\x03\xa6\xf9\xc1\xd4\x73\x85\x46\x44\x5e\x16\xda\xf3\
\xc2\x9a\xbc\xa1\x4f\x2d\xcd\x6d\xf9\x6f\x1b\x2d\x35\x39\x0f\xdb\
\xf0\xb8\xd6\x13\xb9\x61\x77\xcb\x3c\x22\x69\x81\x80\x63\x34\xb2\
\x98\xb1\xe7\xd7\x14\xf2\xbb\x23\xba\x0d\x6b\xed\x9c\x7f\x08\x8b\
\x80\x13\x06\xa7\xc9\x65\x60\x8a\x2b\x6e\xdf\xb5\x4e\x54\xd0\x8e\
\xbe\xd1\xc4\x2c\x99\xfe\x02\xaa\x8f\xda\x54\xa2\x80\x14\xfb\x9e\
\xaa\x6b\xa7\xd0\x27\x0a\x97\x9e\x54\x2a\x54\xb6\x01\x40\x72\x63\
\x99\x3e\x97\x97\x3b\x5c\x53\x40\xf2\x68\x1e\x19\xb7\xf6\x86\xa0\
\xce\x46\xa8\xa0\xc9\x2d\xfe\xd9\x7a\x39\x7e\x29\x3e\xbf\x61\x15\
\x45\xa4\x5d\x85\xde\x0f\xba\x22\x12\x30\xd1\xe0\xab\x81\x0f\x81\
\x02\xb6\x3d\xd6\x1f\x76\x6f\xa2\x8a\x88\xa4\x61\x74\x78\x40\xd5\
\xde\x0f\xdd\xaa\xe6\x6e\xb8\x87\x54\x61\xca\x9c\x9c\x2e\xba\xd4\
\x05\x18\xd4\x36\x8f\x24\x2c\x0d\xdd\x31\xc9\xa6\x31\x1a\x95\x3b\
\xac\x5d\x3e\x86\x33\x23\x2c\x68\x51\xb5\x0d\x70\xfa\x96\x7f\x64\
\xf9\x1a\x8a\x6d\xa4\xd8\x41\x8f\x76\xaa\xe0\x32\x41\x8b\x9d\x6b\
\x08\x19\xab\x1d\x05\x3e\x64\xdf\x6b\xbd\x61\xf7\x25\xa9\x81\x48\
\x8e\x50\xa4\x85\x2c\x07\x54\xeb\x33\xa6\x83\xea\x31\x17\xc9\x44\
\x09\x81\x64\x60\x80\xa3\x6a\x65\xbb\xe8\xa7\x45\x97\xb2\x21\xe9\
\x8b\x49\x36\x17\xfa\x7a\x4e\x6d\x20\xb0\x99\x4e\x6b\x73\xc5\x6a\
\x84\xcd\x39\xd0\x0e\x39\xfb\x17\x6f\xa0\x48\x2c\x1a\x35\x60\x42\
\xcf\xca\x6e\x6b\xad\x64\x63\x9e\x49\x2a\x02\x86\xa9\xa3\xd9\xeb\
\x3c\x70\x7f\xa3\x10\xf6\x68\xe4\xf3\x17\x26\x80\xf7\xd0\x4d\x3c\
\xea\x3d\xba\x83\x46\xeb\x43\xa9\x13\x5a\x37\xb6\xd8\xa9\x0e\xc0\
\x7a\x48\xcf\xaa\xec\x55\x94\xa4\x0f\x57\x03\x14\x65\x5a\x48\x06\
\x45\x0b\xe6\xa4\x23\x8c\x99\x11\x78\x1a\xb3\x29\x5b\x45\x97\x14\
\xdf\x99\x3b\xe6\xfd\x49\x81\x26\x21\xbd\x9e\xec\x1f\x1f\xe0\xf2\
\xe3\x29\x60\xaa\x01\x49\x31\x0f\xd8\xae\x52\xd7\xb5\xef\x7f\xc0\
\x3b\x22\x29\xf4\xb9\x09\xea\xb8\xca\xcb\x86\x54\x00\x2c\xbc\x89\
\x47\x63\x3a\xf0\x11\xbd\xe6\x82\x04\x8e\x1f\xab\xd1\x01\x92\xb4\
\x29\xea\x3f\xcd\x5b\x95\x2d\xdd\x2b\x28\xfb\x5b\xb3\x03\x3d\x9d\
\x26\xe0\xea\xc6\x39\x7f\x50\x20\x92\xad\xe3\x84\xa1\x75\x02\xdd\
\x7e\x7e\x15\xd8\x6a\x28\x3a\xa4\x02\x0f\xab\xd8\x7d\xad\xfb\x86\
\x35\x09\xf5\x02\x45\xd2\x58\x52\x76\x32\xd4\x63\x79\x30\xf5\x0e\
\xae\x96\x8b\xe1\x01\x20\xf3\x06\x1e\xf5\x19\x73\x0b\x27\x22\x29\
\x7d\xd0\x47\xb6\xd9\x44\x7e\xa3\xb1\x12\x7b\xfb\x06\x24\x63\xd9\
\x46\x54\x5c\x48\xc1\x0d\xc9\xd6\xb1\x56\x2e\xda\x68\xb8\x22\xd2\
\x5a\x1a\x8f\x5b\xf3\xe7\x9e\xbd\x25\xd2\xc3\xef\x7d\x8d\x53\xb8\
\x2f\x03\xe8\x03\x14\xa9\xf9\x88\x1a\x43\x9d\x10\x89\x1c\x8a\x68\
\x9d\x0a\xca\xa1\xc8\x51\x82\x3f\x47\xb9\x7d\xd4\x67\xf4\x2d\x7c\
\x2d\x11\x99\x9c\x3f\xd5\x77\x33\xc9\x02\x24\xcf\xb6\x88\x84\x1f\
\x80\x7c\x26\xca\xd7\x26\xe4\x8b\x14\xb5\xcf\xab\x5b\x36\x16\x49\
\x6b\xef\xcc\x9d\xe2\xd5\xf5\x33\x56\x64\x51\xdc\x5f\x6d\xec\x7b\
\xf7\xd7\x72\x8f\xe6\xbd\x0a\x0c\x66\x1e\xb1\xa6\x42\x2b\x06\x46\
\x00\xa7\xd4\x7e\x4c\xc2\xd0\xe1\xcd\x42\x09\xd7\x79\x2e\x50\xa4\
\xf1\xc6\xb0\xa3\x0f\x70\xce\x0d\x3c\x8a\xef\xc3\x85\xbf\x8e\x1c\
\x96\x54\xf5\xe0\x09\xc6\xd7\x2c\xc6\xb0\x90\x04\x3e\x12\x58\xc9\
\x2f\xc4\x67\x99\x5c\xf4\x2d\x1a\x68\xe8\x44\xc4\x6b\x1b\xa6\x2f\
\xa4\x88\xb5\x43\x40\xa7\x37\x5e\x68\x1f\xe1\xe1\x0f\x9b\x80\x87\
\x80\x62\x8e\xdf\xbd\x04\x78\x1e\x58\xa6\xc5\xa3\xe2\x07\x0f\x6f\
\x11\x46\xcc\xc3\xde\x22\x63\x49\x6e\xf7\xe6\xe5\x93\x2f\x7a\x01\
\xf1\x7d\xc6\xdc\xc2\xb5\xe2\x12\xe4\x87\x2d\xf8\xa7\x91\xc4\x35\
\x20\x31\xc7\x21\xf7\x39\x66\x0b\x15\x16\xf0\xb0\x9d\xfd\x09\xce\
\xbf\x64\xef\xf8\xfc\xdb\x33\x34\x5d\x54\x1b\xf7\xbe\x27\x23\x09\
\xc0\x3c\xe0\x31\xd5\x0a\xb0\x2a\x6c\xa5\xc0\xcb\xc0\xff\xb4\x7a\
\x5c\xb5\x7b\x46\x48\x23\x92\x23\x14\x29\x07\x21\x86\x16\x95\x2e\
\x78\x24\x43\xc6\x1d\x61\x89\x0a\x66\xfc\xa1\xde\x04\x2f\x80\x24\
\x55\x1b\x58\x5b\x7b\x88\x55\x64\x9d\x44\x0a\x3b\x0f\x07\xeb\x2c\
\xc0\x21\x68\x03\x5c\x08\x95\xb7\xef\xf3\x69\xbb\x69\x3a\xb0\x77\
\xfe\xe0\xc3\xfe\x55\x3c\x33\xf9\x2c\xe0\x19\xfe\xec\xa4\x52\xe0\
\x75\x60\xb2\x96\x8f\xac\x7a\xf7\xc8\x96\xe1\x52\x9c\x9f\x2c\x47\
\xa6\x3c\x8a\x15\x53\xff\x5e\x40\xfc\x1d\x63\xda\x6b\xbf\x4e\x92\
\xfb\x0a\x4a\x8e\xbe\xd2\x9e\x70\x32\xae\x91\x44\x54\x31\x56\xe3\
\x75\xb1\x4a\x56\xaa\x84\x79\xe4\xf3\x95\x2d\xfc\xd0\xa5\x55\x01\
\x9a\x3a\xfd\x50\x74\x72\xfe\xbb\x3f\xe7\xd0\x74\x51\x61\xc8\x17\
\x93\x7a\xc6\x78\x59\x77\x7d\x02\xdc\x03\x64\x71\xf3\xbe\xb9\xc0\
\x83\xc0\x3b\xde\xfe\x1c\xac\x12\x1b\xc6\x0d\x92\x46\x24\x65\xea\
\x5b\xb6\x97\xcf\x37\x1e\x8d\x6e\x6f\x7a\x11\x90\x87\x61\xc6\xc5\
\x24\x9b\x47\x1d\xad\xc4\xdb\xab\x92\xd9\xcb\x7c\x5e\x99\x3b\xeb\
\xac\xa0\x79\x35\xb8\xf3\x25\x17\x03\xe2\xd2\xca\x77\x66\x9d\xa5\
\x53\xb7\x23\x67\xbf\xdd\x29\xda\x9b\x5c\x2f\x07\xda\x03\x67\x39\
\x78\xd9\x34\xa0\x33\xb0\xc0\xeb\xdf\x03\xeb\xb6\xb2\xab\xf4\xe8\
\xca\x03\x47\xb7\x89\xa0\xe7\x79\xef\xc9\xef\x35\x88\x77\x08\xa8\
\xae\x87\x7d\x64\x7c\x4c\x32\x9e\x85\x44\x62\x7a\x33\x41\x23\xaa\
\x9e\xd5\xc6\x30\xf6\xaf\xa9\xa1\x2d\x68\xe2\x76\xa7\x73\xe6\x6f\
\x20\x77\xd7\xd4\x57\xd7\x16\x52\xf5\x91\xf0\xd8\x37\x6f\x74\xf6\
\x0a\x49\x48\x01\x92\x80\x05\xfa\xe5\xac\x12\x81\xa5\x40\x12\x20\
\xe1\x8e\x0c\xac\x3b\x6a\xd6\x00\xd5\x58\xa6\xd2\x5d\xa3\xda\x44\
\xd2\xe2\x90\xa0\x67\xb4\x51\x40\xf5\x3b\xc6\xb4\xb3\xc4\x43\x06\
\xb3\xf1\x6d\x24\xd9\x48\x94\x32\x5b\x58\x92\xb7\x35\xaa\xb6\x79\
\xa4\x70\x35\xe7\xf1\x76\xeb\x80\x20\xd0\x76\x67\x00\x00\x20\x00\
\x49\x44\x41\x54\xb6\xf2\x16\x05\x0c\x71\xfe\xa5\xe4\xdc\xe2\x97\
\x66\x50\x9a\x34\x75\x9e\x5a\xfa\xe5\xe0\x78\xef\x06\x46\x1e\x90\
\x0c\x0c\x04\x2e\x68\xfe\x82\x97\x80\x7b\x7d\x79\x0e\x85\x88\x36\
\xaf\xfc\xf8\x45\x37\xbb\x7a\xa3\x88\x19\x30\xa6\x6d\x14\xd9\xea\
\x8a\x8b\x90\xd7\x80\xea\x77\x8c\xf6\x23\x3c\xf2\x96\x62\x4e\x1a\
\x5d\x8c\xe8\xb8\xb3\x91\x9b\x08\x0c\x61\x49\xcb\x13\x0c\x3e\xd1\
\x48\x8d\x91\x58\x50\xc4\xb0\xbd\xe2\xfa\x43\xce\xce\xc9\xcf\x2e\
\xcf\xa6\xeb\x24\x76\xe8\xbc\x85\x4f\xf8\xc8\xdc\xb6\x1c\xa8\x09\
\xbc\x0d\x64\x6b\xf2\x5e\x39\xc0\x64\xa0\x06\xb0\xc8\x87\xf2\x8d\
\xeb\xff\xe9\xcf\xaf\x35\x57\x17\x02\x2a\xf6\x1b\xd3\x2e\xca\x30\
\xd6\x7c\x40\xf5\x3b\xb5\xc7\x23\xb5\x37\x32\x68\xf5\x98\x7a\x77\
\xe9\x0c\x48\x54\x54\xd6\x78\x4a\x64\x3f\x4b\xf9\x19\x58\x0d\x90\
\xc9\xf2\xda\x91\xb4\x44\xa0\x8d\x8b\x91\x74\xe1\xa7\xe7\x5e\xdb\
\x49\x89\xfa\x41\x1d\x3f\x5a\xfe\x7e\x97\x8a\xd2\x4e\xea\x22\xe0\
\x35\xa0\x0a\xf0\x81\x9a\xc1\x0e\x39\xc0\x47\x40\x55\x60\xa2\xef\
\x23\xba\xc1\x49\x8f\x7c\xff\xfd\x88\xaa\xaa\x53\xb9\x42\xdf\x31\
\xb7\x44\xeb\x38\xcb\x34\x92\x1e\x90\xa0\x03\x1e\x71\x97\x21\x9a\
\x54\xc5\x71\x5c\x1f\x56\xca\x42\x92\xb1\x58\x30\x84\xa9\x2b\xc1\
\xf7\x2a\xf1\x96\x65\x1e\x31\xe7\x51\xb7\xe2\x0b\x45\x47\xbf\x7c\
\x74\xf2\x11\xda\x9e\xea\x3f\xb5\x72\xc5\xc4\x36\x91\x3e\xd7\x01\
\xb9\xc0\x8b\x40\x14\x30\x0c\xd8\x08\x94\xb2\x63\x8c\x2d\xc0\x08\
\x20\x12\x78\x96\xc8\x0e\x0b\xaa\xf5\xc0\x37\x7f\x7e\xda\x35\x54\
\x0b\x32\x47\xdf\xf9\x50\x87\x0a\xfa\x6a\x58\x42\x95\x12\x90\x70\
\xc7\xe8\xb6\x96\x5c\x90\x43\x8b\x81\x30\xc9\xa6\x90\x81\x08\x79\
\x48\x1e\x80\xa9\xb7\x75\xa4\x7c\xa5\x43\xf1\xee\x96\xd0\x28\x6e\
\x9d\x5c\xb2\x36\x00\xc8\xd9\xf5\xee\x83\x93\xa8\x21\x29\xb8\xc3\
\xbb\xeb\x97\x3d\xd5\x3c\x9c\xd0\x36\x9d\x0f\xdc\x06\x24\x00\xe3\
\x80\x25\xc0\x35\x59\x83\xcf\x00\x7e\x02\x1e\x05\x6a\x02\x1d\x81\
\x6f\x49\x59\x22\x30\x61\xc8\xac\x4d\xf3\xef\xab\xaa\x15\x91\xa3\
\xfa\x3c\xd4\xa1\x82\x40\x2b\x02\x4c\x1c\x59\x54\x81\x4e\xf6\x84\
\x3b\x2d\x3c\x32\x6b\x06\x71\x06\xfb\xa4\x8e\x5a\x5e\xc2\xda\x2d\
\xbf\x98\x1c\x09\xca\xae\x94\x99\x6b\x44\xf0\x3d\x18\xf7\x39\x26\
\x77\xb9\x96\x8f\x4d\x61\x75\x41\xc1\x42\x2c\x32\x36\x9d\xee\x92\
\xff\x1b\x62\xf6\x8e\x77\x86\x4d\xba\x7b\xfb\xc4\x44\xba\xbe\xc2\
\xba\x7e\xb4\x61\x71\x61\xa7\xc1\x33\x0e\xe4\x10\x52\x3e\x0d\x98\
\x05\xcc\x02\x00\xd4\x03\x9a\x02\x8d\x81\x86\x40\x3d\xa0\x02\x10\
\x05\x44\x00\x61\x40\x1e\x90\x05\x64\x01\x19\xc0\x71\x20\x05\x48\
\x01\x0e\x02\x47\xe4\xbc\x71\x60\xf5\x41\x9f\x6f\x5c\x38\x3c\x81\
\x0d\xfd\x2e\x6e\x3b\x5d\xa5\x7d\x2d\x5f\x57\x45\xf6\x1e\xdb\xb1\
\xc2\xca\x15\xd7\x44\x15\x56\x87\xe4\xeb\x4e\x5f\x2a\xc2\x5e\xbd\
\x2f\x11\x1e\x5d\xd8\x7a\xa6\xea\x2d\x35\xf9\xc7\x15\xda\x6d\x1e\
\x79\x50\xe4\x31\x2c\x82\xc3\x3a\xe0\x36\xb6\x8c\xe5\xfb\x84\x29\
\x3d\xc6\xc8\x70\xdd\x7a\x8e\x48\x99\xef\x03\x8d\xe4\x4c\x33\xd9\
\xa8\x2c\xc8\x51\xde\xba\x00\x2d\x5c\xc9\x9a\xb3\xf3\x9d\x61\x93\
\x64\xe8\xfb\xe8\x3e\x9f\xee\xda\xf0\xc1\x1d\xd5\x02\xe9\x6f\x3d\
\x0e\x2c\x03\xde\x07\x46\x00\x9d\x80\xa6\x40\x4d\x20\x06\x08\x01\
\x2a\x02\x35\x81\x26\xc0\xad\xc0\x83\xc0\x7b\xc0\x8f\xf2\xd0\xc8\
\x16\xdd\xf6\x99\x65\x7b\x97\x8e\xa9\xcd\x8c\x78\x17\x56\xcf\xda\
\x44\x90\x93\x22\xa2\xd7\xd8\x4e\x15\x05\x6a\x56\xd7\x74\x67\xc5\
\x5e\xbd\xef\xa8\x36\x04\xd7\x1d\xfe\x76\xc9\xf1\x62\xee\xb9\x5a\
\x46\xe1\x70\xd9\x10\x62\x08\xc7\x9d\x8d\x2d\x3f\x11\xf6\xa3\xc4\
\xf4\x91\x47\x7a\x35\xd0\x88\x0a\x78\x2c\x4c\x52\x6e\x24\xcd\x72\
\xa7\x6a\xce\xce\x77\x86\xbd\x9f\x2a\xa3\xbb\xa0\x56\xcf\xfd\xba\
\xef\xa7\xa7\x5a\x47\xf1\x96\xcd\x31\xa4\xfe\x03\xb3\x77\x6e\x9f\
\x7a\x47\x2c\xcb\x4e\x4b\xd3\xd7\xcc\xda\x48\xa0\x9e\xc3\x7b\x8d\
\xed\x1c\x23\x50\x49\xb7\x72\xd7\x37\x55\x87\xf6\x84\xbe\xa3\x49\
\xf0\x28\xe5\xdb\x25\xc7\x0b\x8d\xc2\xdb\x65\xe6\x8b\x06\x05\x93\
\xf8\x0f\xba\xb3\x31\x5c\xe6\xd0\xde\xae\x36\x2c\xb9\x38\x01\x3c\
\x1f\x15\x62\x9a\x0d\x5e\xde\xf9\x0c\x2b\xd6\x8e\xb0\xb5\x06\x06\
\xba\x43\xd2\x8e\xb7\xee\x7e\x7a\x43\xbe\x9c\xfe\x2a\xdd\x39\x6d\
\xe7\xce\x6f\xc6\xb5\x8a\xe6\x04\x94\x84\xb0\xfa\xf7\x7c\xb4\x61\
\xdf\xfc\x51\xf5\x99\x77\x5d\x92\xfe\xc7\x97\xeb\x09\x2a\x2b\x85\
\xf6\x18\x7b\x5b\xac\x00\x20\x80\x8d\x8c\x13\xfa\x3f\xc8\x97\x25\
\x09\x7d\x47\xb7\x26\xc2\xa3\xa5\x27\xe4\xe2\x51\x85\xc7\x74\x08\
\xda\x2a\xcb\x74\xa7\x41\x79\x59\x0f\x8b\x75\x9e\x16\xcb\x36\x3d\
\xad\x6f\x75\x58\x9c\xfc\x11\x3e\x93\xdd\xb1\x85\x25\xcb\x48\x52\
\xce\xac\xd3\x5d\x13\x37\x00\xc8\x3f\x34\x7d\xf0\xdd\xb3\x64\x66\
\xff\x69\xf0\xe0\xcc\x5d\xc7\x7f\x7f\xa7\x6f\xcd\x60\x9d\x0d\xc0\
\xca\x9d\x9e\x59\x78\xe0\xe8\xe2\xa7\xdb\xaa\x13\x52\x57\x92\xbe\
\x76\xd6\x9f\x04\x2a\x3a\xb4\xc7\xb8\xdb\x2b\x09\xa4\x89\xd0\x19\
\x7a\x56\x88\x3c\xf3\xf6\x84\xbe\xa3\x48\xf0\xe8\xd0\xdc\xa5\x27\
\x64\x17\x36\xbc\x3e\xe3\xe6\x48\x94\xc3\x12\xad\xe9\x43\x08\x4b\
\x66\x2d\x4e\x61\x63\xb1\x6c\xd1\x08\x57\x18\x9b\x4d\xa2\x8a\x13\
\x0c\x3e\x0a\x38\x99\xaf\x25\x00\x53\x3c\x68\xdb\x4b\xbf\x3d\xd9\
\x47\xa6\x99\x04\x20\xb6\xdb\xcb\xbf\x9c\xd8\x3b\xef\x89\xce\xd5\
\x82\xf4\x78\xa7\x80\x98\x56\x23\x3e\xdd\x72\x72\xe3\xd4\xc1\x75\
\x54\x7c\x4a\xe9\xe5\xb5\xb3\xd6\x11\xd4\x25\x0c\xee\x36\xae\x4b\
\x25\x1b\x00\x7b\x43\x1f\x92\xae\xbd\xc8\x93\xda\x47\x07\xe7\xfe\
\x78\x92\x4d\xa1\x5d\xa5\x0e\x49\x51\x26\x2c\x91\xdc\xe2\x98\x3e\
\x5c\x9b\x5d\x28\xdd\x00\xc9\x65\xd9\x62\x62\x34\x2a\x9b\x54\xf5\
\x66\x48\x20\x33\x92\x2c\xe8\x22\x6f\xe3\x80\xe6\xee\xbf\xe6\x29\
\x31\x93\x00\x04\x24\x25\x7f\xb2\xe1\xfc\xe9\xb5\x1f\x8f\xb9\x25\
\x2e\x50\xab\x57\x09\x88\x6e\x36\xf4\x9d\xe5\xa9\xe9\xbb\xbe\x19\
\xdf\x36\x5c\xed\x87\x95\x5e\xfe\x93\x08\x91\x82\xba\x8c\xed\x56\
\xc9\x06\x14\x1f\xf1\xa1\x19\xb4\xb7\x22\x13\xfa\x8d\x6e\x45\x70\
\xdd\x01\x66\x78\xc4\xd8\xec\x70\x2c\x60\x4d\x62\x2a\xd1\xc2\x92\
\x12\x4c\xe2\xc4\x48\x22\xf2\x9e\x4b\xf3\x9f\x41\xd1\x88\x21\x0e\
\x49\xdb\xf5\x84\x98\x64\x35\xc2\x16\x0c\x2c\xf6\x74\x5e\xa1\xe4\
\xd2\x6f\x13\x7a\x8c\xfd\xe9\xb2\x92\xbe\xab\x76\x9d\x30\xfb\xaf\
\x8b\x27\x56\x7f\x3c\xbe\x4f\xc3\xe8\x00\x15\xc5\x2e\xbc\xf6\x6d\
\xa3\xde\xfb\xf1\xd0\xa5\x7d\x3f\xbc\xdc\xbf\x5e\x80\x46\x7c\x7f\
\x79\xfd\xac\x3f\x08\xac\xc8\xa0\x2e\x63\xbb\x57\xb6\x01\xa5\xe8\
\xf0\x24\x4f\x13\x6f\xaf\xd1\x7f\x14\x19\x1e\xfd\x74\x8a\x03\x3c\
\x92\x52\x2f\xe4\xb0\x44\x78\xbd\x69\x30\x89\x62\x3b\x97\xab\xb4\
\x19\x0a\x19\x85\x6a\xfe\x48\xa6\x49\xdf\x3c\x57\xfe\xd6\x1a\x00\
\x33\x3c\xfd\x9e\x7f\x64\xf6\x7d\xb7\x8c\x5c\x74\x51\x61\xf7\x09\
\x3d\x27\x7c\xfa\x5b\xca\xf5\x8b\xbb\x16\x4d\x1a\xd7\xa3\x7e\x24\
\x43\xbc\x10\xc2\x6a\x74\x1c\xf6\xfa\xdc\x4d\x67\xb2\x4e\xae\xff\
\xea\xbf\x03\x13\x03\x35\x25\x9b\x78\x65\xfd\xac\x35\x79\xbe\xaf\
\x0b\xbc\x7d\x5c\x8f\x38\x1b\x80\xed\x2b\x70\x65\x1e\x9d\xa4\x88\
\xc4\x97\x89\xc4\xd7\xdf\xc0\xa3\x7e\x23\x49\xf0\x68\xff\x37\x7c\
\xe0\x91\x93\x03\xc6\xf1\x43\x05\x4b\x2e\x7e\x39\xb6\x98\xe1\xa2\
\x06\xb9\x70\xe5\xa5\xa6\xa6\xca\x00\x49\xff\xd1\xbf\x84\x62\xe3\
\xf3\xd4\x3a\x89\x10\x8a\xd6\x87\xf8\x53\x0c\x78\x5b\x1d\x05\xd5\
\xbe\x7f\xde\x39\x91\x5d\xcb\x3f\xbb\xe3\x97\xd9\xef\x3c\x31\xa4\
\x73\x62\x6c\x90\x1c\x91\xb5\x47\xd5\x69\x3f\x60\xdc\x6b\x9f\x2d\
\xd9\x7c\x2c\x4b\xd1\x40\x3e\x74\xde\xe2\x8a\xbe\x6b\x1d\xe9\x9d\
\xbb\x1f\xad\x19\x00\x00\x42\xcc\x80\x65\x39\x04\xd7\x17\xff\xf9\
\x60\x35\x1b\x00\x01\x0b\x66\x52\x4b\x8a\x48\x83\x46\xde\x3e\xee\
\x54\xac\xf3\xc4\x6e\x92\x57\xdd\xf7\x4c\xfd\x32\x98\x8f\xee\xbb\
\xb2\x88\x90\x3c\xfb\x9e\xaa\x6b\xe7\x5e\x11\x89\x14\x1e\x3f\x19\
\xdd\xf2\x62\x06\x4b\x78\xb4\xa4\xad\x25\x7f\x6b\x22\xcd\x4e\x8f\
\xfb\x69\x73\x2b\x23\x03\xdb\x16\x00\x7c\x09\x1c\x02\xfe\x76\xfb\
\x53\xe1\xa9\xef\x46\x75\x28\x2a\xdc\xb8\x68\x54\x2d\x26\x8f\x0a\
\x4e\x68\xd3\x77\x4c\x9b\xbe\x63\x5e\x06\x50\x78\xf9\x64\xca\xe1\
\x94\x94\x94\x94\x94\x43\x29\x47\x4f\x5f\xbc\x9a\x99\x99\x95\x95\
\x95\x95\x95\x9d\x95\x9d\x2f\x06\x85\x45\x44\x44\x46\x45\x45\x46\
\x46\x46\x55\x88\xab\x51\xbf\x61\xa3\x46\x8d\x1a\x37\x6e\xd4\xa8\
\x61\x83\x2a\x61\xdc\x30\xf1\xb5\x4d\xb3\x57\xe7\x0c\x18\xe8\x6b\
\xc3\x2a\xa0\xf3\xd8\x5e\x55\x17\xcc\x3d\x5f\x82\x07\x1e\x66\xe6\
\x45\x50\x24\x6e\xf6\x9a\xfd\x47\xb7\x24\xb8\x6f\xdf\xd7\xcb\x4e\
\x33\xb7\x8f\x34\x48\x80\xc9\xa1\x5f\x91\x0b\x40\x2a\xcf\x30\x41\
\x02\x4b\xfe\x00\x42\xa4\xf3\x9a\x4c\x6a\x2f\x5a\xf1\x0b\xac\x5a\
\x18\xb0\x02\x68\x0a\x5c\x75\xfb\x53\xd1\xd9\xc5\x63\xdb\xdc\x7e\
\xfc\xfb\x65\xef\x74\x67\x9b\x2f\x34\xa8\x52\x9d\x16\xff\xdf\xde\
\x79\x47\xdb\x59\x1c\x09\xbe\xbf\xab\xab\x80\x91\x08\x1e\x4c\x1a\
\x50\x40\x88\x07\xc2\x04\x9b\x60\xb0\xc1\x83\x35\xbb\xc6\x69\xc8\
\x48\x42\x0f\x10\x02\x89\x99\xe5\xcc\xcc\x8e\xbd\xf6\x78\xc6\x9e\
\xdd\xb1\x8d\x39\x0c\x83\x39\x3e\xb6\xe7\xb0\x67\x47\xef\x49\x20\
\x78\x88\x1c\x84\xc9\x20\x72\x10\x28\x10\x4c\xd0\x90\x44\x10\x92\
\x40\xc0\x03\x49\x4f\x59\xdf\xfe\xf1\xc4\xe5\xea\xde\x2f\x54\x77\
\x57\x75\x57\xf7\x57\x75\x74\x8e\xb1\x74\xef\x77\xfb\xeb\xae\xae\
\x5f\x55\x87\xaa\x63\x46\x1d\x72\xcc\xf7\x42\xd5\xe8\x8f\x1f\xeb\
\xba\x77\xf5\x49\x27\x97\xd5\x87\xad\x1d\x33\xed\x3b\xbb\x5f\x3d\
\x63\xe9\x66\x5f\x13\xaa\xd5\x4e\x0d\xff\xc1\x94\x43\x01\x9f\x7b\
\x6e\xe6\x1c\x3c\x1e\x65\x2f\x75\xf4\xf8\xf7\xd1\x19\xa6\xfc\xc1\
\x92\x5a\x01\x33\xa3\xa7\x51\x8a\x3a\x79\x5a\x93\xda\xf5\x64\xa0\
\x48\x68\x84\x2b\x7b\x28\x75\x5f\xce\x46\xe8\xe6\x95\x8f\x5c\xf4\
\xdd\xb1\xdf\xb9\xf8\xc9\x3e\xe9\xa6\x66\xb5\xec\x7d\xbc\xeb\x1e\
\x40\x9e\xf1\xe4\xeb\x53\xbf\xbb\xe7\x00\x87\xd3\xad\x5d\xd6\x6e\
\x13\x1f\x81\x78\xf4\xec\xcc\x39\x6f\x21\xe5\x0b\xd2\xdd\x8f\x68\
\x59\xb4\x47\x48\x38\x9b\x66\xff\x77\xde\xdf\x44\x0b\x24\x5f\x34\
\x32\x1b\xbf\xd4\xe8\x2b\x69\xd9\x12\x9c\xd9\x70\x97\x32\x49\x82\
\x27\x74\xf9\xaa\x52\xd7\xe6\xfd\xdb\xc6\x65\xf7\xfc\xec\x5b\x63\
\x4f\xf9\xfd\x73\x1b\xa3\x78\xd5\xcd\x18\x46\x28\xed\x7d\xa2\xeb\
\xae\x4f\x01\xca\x78\xb4\x0e\x91\x12\x82\x8a\xe6\xcf\x35\xf3\xe8\
\x1c\x18\x8f\x6e\x7f\x9b\x55\xfe\x3a\x4b\x4a\x71\xdb\xe0\xf1\x06\
\x24\x5f\xb1\x11\xf5\x29\x89\xe6\xfd\x52\xdd\x57\x14\x5a\x24\x5c\
\x83\xbc\xd3\x95\xca\x3f\x0b\xb6\xfe\xad\x5b\xfe\xe1\xe8\xb1\xe3\
\x7f\xfb\xf8\x27\x41\x77\xfe\x9a\xf9\x7f\x18\xff\x1b\x1c\x63\xdb\
\xfb\x64\x37\x84\x48\xea\x6b\x53\xbf\xbf\xd7\x00\x8f\xaf\xfc\x1f\
\x9f\xf3\xe8\x04\x50\x7c\xb4\x68\x06\x33\x1e\xd1\x5a\xb9\x28\x41\
\x55\x0b\xfd\x05\x12\x82\x0f\xdb\x0c\x74\xf3\x3d\x76\xd2\x65\xe5\
\xc4\x2d\x21\x12\xde\x64\xea\x54\x6a\x76\xfe\x78\xae\x7d\xed\x86\
\x1f\x7d\x73\xe4\x57\xcf\xfb\xcf\x45\x6b\x03\x54\xf1\x8d\x2f\xce\
\xba\xe0\xa8\x11\x47\xfd\xfd\x0d\x2b\x91\x2c\xd0\x27\x4f\x75\xdf\
\x09\xc1\xf3\x11\x53\x7f\xb0\xb7\xaf\xd3\x67\xeb\x94\xba\xe5\x73\
\x1e\x9d\x73\x08\xe0\x2b\x0b\x67\xfe\xf1\x1d\x3c\x1e\x35\x67\x33\
\x6a\x99\xcb\x96\xa5\x63\xb3\x93\x6a\xb6\x05\x4f\x90\xa8\x20\x3e\
\x26\x71\x01\x92\xb3\x13\xe4\xa5\xc6\x34\xb5\xc7\x9e\xa9\xb2\xa6\
\xb0\x96\xb7\xb7\xdf\x17\x1b\xd0\xb1\x64\x83\xba\x33\x8a\xff\x79\
\x4b\xef\xa2\x19\x7f\x7d\xe4\xf0\xaf\xff\x5d\xcf\x2b\x9b\x82\x99\
\x9e\xe9\xeb\x37\xfe\xe4\xb8\xe1\x5f\x99\xfc\x7f\xe7\x7d\x88\x79\
\xbc\xe0\x93\x79\xdd\x77\xf4\x02\x3e\x77\xd8\x79\x7f\x85\x45\x24\
\x5d\xcb\xf9\x9c\x52\x6b\xb6\xf2\x68\x04\x90\x47\x33\x6e\x7f\x87\
\x74\x64\x0b\xc8\x04\xcd\xc5\x97\x4f\x23\x91\xad\xd2\x72\x0f\xc9\
\x00\x24\x28\xbd\xc9\xe7\x62\x13\xe0\x4a\x04\x72\x3b\x75\x6e\x63\
\x98\x3c\x04\xe5\x8f\x83\x06\x58\x3e\x10\x2c\x83\x76\x3f\xe6\xaf\
\xff\x30\x77\x69\xca\x5b\xde\x9b\xfb\xfb\x69\x47\xef\x56\x94\x5c\
\xcf\xe0\x1e\x52\x43\x86\x8d\x9b\xf5\x11\xe4\x8b\x8b\xfe\x27\xc6\
\x0d\x1d\x03\x65\x68\xd8\xed\xfa\xe8\x1f\x3e\x0b\x69\xe9\xfc\x0b\
\x46\x6e\xdb\xd2\x50\xee\x21\x15\x6c\x2f\x35\xdf\x3d\x2a\xf8\x43\
\xd8\x36\xe7\x11\x58\x0d\xb1\x4f\x51\xc2\x23\xbf\x4c\x02\xf6\x3f\
\xe2\x5a\x5c\x0a\x0e\x83\xfc\x46\x90\xa9\xe9\x17\x51\x16\x09\x51\
\x65\xc3\xf2\xc7\xfe\xdf\xdf\x8d\x1b\xb9\xeb\x11\x93\xff\xfd\xce\
\x37\x36\x2b\x76\xb2\xec\xc1\x3f\x9c\xff\xf5\xdd\x47\x8e\xfb\xfb\
\xe9\x4f\xae\xa0\x2a\xe9\xb3\xea\x99\x19\x73\x3e\x02\x7c\xee\xd0\
\x73\x4f\x1c\x31\xd0\xce\x02\x18\xd8\xb4\x75\x4a\xdd\xba\xf5\x3f\
\x07\x02\xe3\xa3\xf9\xdd\x77\xbc\x1b\x4e\xe4\x9b\xb7\x36\xd8\xfa\
\x4f\xb0\x39\x40\x84\x8d\xe6\xfb\x3f\x61\x00\xa9\xbd\xf6\x70\xd0\
\xb1\xa7\xfd\x62\x5d\xb1\x7b\x08\x59\x8b\x73\xb3\x1e\x02\x61\x40\
\x92\x95\x85\x2f\x85\x3d\x24\x21\x68\x0f\x76\x27\x6c\xfc\x60\xfe\
\xac\x9f\x7e\x7f\xbf\x5d\x0e\x3a\xfd\x5f\xaf\x99\xb7\x9c\x83\xfe\
\x6d\x7e\xfb\xa1\xee\x9f\x8d\x3f\x6c\xd7\x11\xa4\x28\xfa\x8c\x48\
\xf3\x67\xce\xf9\x10\xf0\xb9\x83\xcf\x3d\x79\x24\x2c\xc1\x11\xa2\
\x97\xf6\x6c\x63\xbd\x6e\xe0\xf0\x13\xcf\x39\x18\xf0\x8d\x67\xba\
\xef\x0c\x94\x47\x65\xbd\x9a\xe4\xe6\x1f\xca\x4c\x47\x14\x6e\x6c\
\x64\x0b\xa4\x5c\x87\x48\xf7\x68\x23\x1b\x86\x51\xb8\xe4\xa9\x93\
\x1f\xa5\x0b\xa7\x12\xd3\xe4\xb0\x09\xde\xab\xe9\xb2\x5f\x0b\x02\
\xbd\x7f\xba\xf1\x57\x9d\x47\xfd\xf9\xf6\x23\x8f\x3d\xeb\xff\xcc\
\x78\xf0\x8d\xf5\x3e\x14\x6f\xc5\xd3\xb3\x7f\x3d\xe5\x9b\x23\x76\
\x18\xf9\xad\xa9\x17\xdf\xb0\xf0\x03\x37\x67\xd4\x57\x2f\x98\x79\
\x1b\x24\x11\xed\x97\xa7\x9c\x32\xaa\x9c\x48\xb8\xe7\x77\xfe\xa0\
\x1a\xf1\x11\x8c\x47\x4f\xcf\xb8\xf3\x5d\xaa\x58\x97\xe7\xc1\x01\
\xea\x83\xd0\x2d\x39\xf7\x9c\x02\xc9\xe0\xf7\x4a\x29\x62\x1c\x2d\
\xf9\xcd\xcc\x91\xb4\x45\x09\x58\xf6\x34\x71\xd2\x78\x37\xdd\x92\
\x6a\x62\x29\x71\xfb\x5e\x06\xd3\x67\x4b\xdf\x5b\x8f\x5d\x7d\xe1\
\x79\xe3\x46\xef\xb0\xdb\x57\x4f\xfe\x87\xcb\xae\x79\xe0\x85\x15\
\xd4\xfe\xf6\xa6\xa5\xcf\xdc\x76\xf9\xbf\x4c\x39\xfe\xa0\x5d\x87\
\xec\xf1\xb5\x49\xff\xfb\x8a\x47\xdf\xee\x73\x6b\xf9\x56\x2f\x98\
\x79\xeb\x07\x80\xcf\x8d\x9d\x7c\xea\x3e\x2e\xeb\x44\xad\x53\xea\
\xb6\x26\x1e\x1d\x04\xe1\x51\xf7\x9d\x4b\xc9\xd6\x5e\x2b\x9b\xad\
\xc6\x0b\x93\xea\xa4\x3d\xde\xcf\xa4\x62\xc6\x30\xcc\x0d\x95\xb0\
\x79\x5a\x03\xea\x6e\x7a\xa9\xf8\xb2\x70\xb2\xad\xb9\x4f\x75\xde\
\x2e\x31\x45\x45\xe3\xeb\x6e\x66\xc4\x86\xf7\x17\xdd\xfa\xbb\x45\
\xb7\xfe\x4e\xa9\x01\x43\xf7\x3a\xe4\x98\x71\xe3\xc6\x8d\x1b\x37\
\xee\x5b\xc7\x1e\x36\x7c\x28\xc2\xc3\xfb\xde\x7d\x7e\xde\xbc\x79\
\x4f\xcf\x9b\xf7\xd4\x13\x8f\x3c\x34\xef\xd5\x5e\xcf\x6b\x4c\x6b\
\x16\x5d\x71\xcb\xfb\x53\xcf\xdf\xb5\xec\x73\x07\x4c\x3e\x6d\xf4\
\x65\x17\xbd\xbc\xc1\x51\xb3\x9a\xd6\xeb\x46\x9c\x38\x19\xc2\xa3\
\x79\x5d\x77\x2d\x65\xb8\x17\x18\x0d\x93\x5c\x46\x48\x26\x87\x4b\
\x0c\x92\x6a\xa8\x4a\xe6\x63\xb5\x84\x90\x17\x66\x97\xe6\x90\x6d\
\x61\x03\x22\x96\x20\x38\x74\x27\x9b\x57\xbf\xbb\xf0\xee\x59\x0b\
\xef\x9e\xf5\x1b\xa5\x94\xaa\x0f\xdb\x7d\xd4\x98\x8e\x8e\xfd\xf7\
\xef\xd8\x6f\xbf\x8e\x8e\x8e\x31\x23\x76\xdb\x69\xd8\xd0\xa1\xc3\
\x86\x0d\x1b\x3a\x74\xe8\xd0\xa1\xdb\x0f\xde\x7a\x86\x2d\xdd\xb4\
\xae\x6f\x4d\xdf\x9a\xbe\xbe\xbe\xd5\x1f\xaf\x78\xf7\xad\x25\x6f\
\xbe\xb9\xa4\x5f\xde\x78\xf5\xc5\x17\x5e\x7e\xe7\x53\x73\x04\xfd\
\x99\x52\xdd\x4a\x9d\x84\x4d\xa4\x9b\x97\x9f\xff\x37\xbb\x97\x7d\
\xae\x63\xf2\xe9\xfb\x5e\xfa\xab\x97\x1c\x11\xe9\xf7\x9f\xfd\xc7\
\xc0\x91\x27\x81\xe2\xa3\xa7\xba\xef\x7e\x4f\x78\xe4\x02\x4b\x0e\
\x82\x45\x6d\x20\x19\x6f\xf9\xb4\x27\xc0\x16\x29\xed\x55\xad\x1e\
\xc3\xf2\x63\x4a\x19\xd3\xce\x15\xad\x54\xe8\x09\x76\x83\x1d\xc8\
\xa6\x55\xcb\x5f\x5d\xb8\xfc\xd5\x85\x0f\xff\xd1\xc7\xaf\xff\x93\
\x52\x3f\x53\x6a\x18\xfa\x73\xfb\x9e\xbb\xf2\xe6\x65\x7f\x73\xc1\
\x1e\x65\x9f\x1b\x73\xd6\xf8\x31\x97\xfc\xe2\xc5\xf5\xa6\xba\x04\
\x97\xe6\xf5\xba\x91\x27\x4e\xfe\x32\xe0\x17\x9e\xec\xbe\x4b\x78\
\xe4\x0c\x4b\xd4\xc2\x37\x53\x43\x79\x61\x95\x34\xfb\x2b\x66\xf7\
\x78\x3c\x0f\x76\xa7\x2d\x8d\x28\xfa\x1f\xc8\x15\xe0\x78\x65\x3e\
\x41\x12\x32\x41\xe4\xdf\x28\x68\xa4\x94\x52\x7d\xcf\xcf\xba\xe9\
\x3d\xc0\xe7\xf6\x3d\x73\xe2\x7e\x83\x5d\xbc\xe9\x22\xa5\xfa\xf4\
\x78\xf4\x54\xf7\xdd\xcb\x84\x47\xd1\x88\x1e\x90\x6c\x4e\xc4\xc1\
\xcd\xab\x31\x4b\x0c\x6e\xcf\xb0\x65\x92\x2e\x8d\x28\xde\x34\x85\
\x25\x8f\x10\x2c\xb9\x50\x0f\x9a\xc7\xf6\x3d\x7f\xd5\x8d\x4b\x01\
\x9f\x1b\xdd\x39\xb1\xc3\x05\x91\x9a\xd7\xeb\x60\xf1\x51\x97\xf0\
\x28\x72\x20\x15\x5c\x00\x36\xf3\xd9\x75\x53\xe9\x00\xef\xe5\x64\
\x86\x90\x09\x83\xbb\xa5\xf6\x64\x62\xb5\xb6\x09\xbc\x12\xcb\x0d\
\x4b\xf1\x15\x35\x26\x51\xe6\xb5\x2f\x5c\x75\xfd\xbb\x80\xcf\x8d\
\x9a\x34\xe9\x80\x21\x46\x6d\x86\xcf\xc7\xb5\x4a\xcd\xd1\xe3\xd1\
\x96\x27\xba\xee\x59\x2e\x3c\x8a\x48\xea\xed\x34\x6a\xfe\xef\x76\
\xa3\x0f\xaf\x44\x67\xc3\xb0\x8a\x7a\xc1\x80\xbe\xca\xdc\x8a\xa3\
\x0e\x04\x21\x27\x17\x32\x37\x96\x14\xa5\x4f\x20\x19\xc0\x50\x88\
\xf4\x62\xcf\xf5\xef\xfc\xf0\x47\x7b\x97\x7d\x6e\xe4\x19\x9d\x63\
\x7f\xf1\xec\xc2\x75\x4e\xb0\x3a\x70\xd4\xc9\x93\x0f\x04\xf1\xe8\
\x5e\xe1\x51\xec\x11\x52\x1e\x9f\x84\x31\x9e\x23\x95\x1c\x7f\xdf\
\xd9\xb2\x24\x30\x4d\x03\x7a\xf3\xf2\xe2\x2d\x88\x1e\x9a\xe9\xea\
\x5f\xee\xad\x06\x44\xac\x48\xdb\xf6\xe7\xda\x17\x7b\xae\x7b\x1b\
\xf0\xb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f2\x3b\xa0\x2b\x94\xda\x4d\x29\xa5\xd4\xfa\x57\xae\xbd\
\xe6\x8d\x7f\xfe\xf9\x3e\x65\x5f\xd8\xf3\xb4\xc9\x07\xff\xd3\xd3\
\x4f\xd1\x12\x69\xe0\x3e\xa7\x4c\x86\xf0\xe8\xb1\xae\xfb\x56\x08\
\x8f\x62\x93\x5a\x69\xa8\xd8\xc8\x26\x6b\xb6\x76\x97\x7d\xc3\xa6\
\x8c\x46\x4a\x67\xcb\x9a\x70\xdb\xdc\xeb\x7d\xa6\xd2\xda\x5f\x7e\
\x17\x96\xb5\x32\xda\x51\xb7\xdc\xde\xb2\xa7\x48\x0f\x0f\x62\x3d\
\xa0\x7f\x59\x75\xb7\xc6\xff\x5f\xbf\xf8\xda\x9e\xd7\x01\xdf\xdb\
\xe3\x94\xc9\x87\x7c\x81\x38\x3e\xda\xe7\xe4\xb3\x0f\x28\xff\xd8\
\xa6\x47\xbb\xee\x17\x1e\x55\x0e\x48\x2d\x64\xb2\x9f\x81\x05\xf9\
\x27\x32\xea\x53\xf5\x80\xe6\x15\x9d\xc1\x8d\x38\xfc\x42\xef\x25\
\xdd\x91\x42\x27\x7d\xe9\x45\xae\xb4\x8c\x94\x05\x4d\x02\x16\x03\
\xcd\xae\x07\xca\xe9\x3e\x5c\x6f\xb6\x3e\xaf\xff\xaf\xeb\xae\x7e\
\x0d\xf0\xf5\xdd\x4f\x39\xe7\x2b\xdb\x67\x4f\x5e\xbd\x1c\xff\x79\
\x7d\x32\x70\x9f\x53\x84\x47\x02\x24\x67\xfe\x29\x9c\x46\xc5\x7f\
\xef\xe0\x8e\x11\xff\x9b\x4c\x4c\x6e\x5c\xa5\x9a\x0d\xa6\x0b\x6d\
\x0b\xf4\x30\xc5\x88\xde\x0a\x9e\x9f\xf7\x4f\x69\x20\xf7\xe1\x36\
\xbc\x7a\xfd\x55\xaf\x02\x3e\xb7\xeb\xc9\x99\x44\x32\xbb\x6b\xd8\
\x58\x81\x18\xdf\xc4\xa3\xb3\x60\x3c\x7a\xe0\xfd\x18\x78\x14\xd9\
\x55\x39\x7b\xa9\xe3\xda\x82\x96\xce\x05\x5e\xac\x11\xc1\xe2\x93\
\x31\x2a\x50\x98\xe4\x26\xf3\x77\xa9\x1e\xda\x6b\x14\x64\x57\x09\
\xa8\xe4\xc1\x84\xd7\x1b\x5e\xbb\x61\xd6\xe2\x5f\x5e\xd8\x51\xf6\
\xb9\x2f\x9d\x74\xee\xe1\x3f\x7c\xec\xe1\xd5\xa8\x1a\xfb\xd9\x32\
\xe0\x20\x18\x8f\x36\x3e\x32\x3d\x78\x1e\xe5\x6d\x4f\x64\x07\xd9\
\x3d\x08\xc1\x40\xb5\x80\x64\x6c\x0e\xe4\x0c\x9e\x33\x44\x39\xb8\
\x3f\x9b\x98\xb6\x0d\x38\x87\x29\xee\x1e\xe5\xd5\xb6\x48\x0b\x8f\
\x51\xa8\xd8\x4e\x90\x6e\x78\xfd\xc6\x59\xaf\x5c\x78\xd1\xfe\x65\
\x9f\xdb\xe5\xc4\x29\x87\x0f\x7b\xf8\xa1\x55\x98\xbf\xdd\xf7\x19\
\x8f\x4e\x3d\x1b\xc6\xa3\xb9\x1f\x84\xcb\x23\x03\x87\x29\xd3\xae\
\x46\x69\x39\xeb\xe8\x4f\x14\xc0\x54\x39\x84\x22\xcd\xce\x60\x8c\
\x01\x48\xf6\xa3\x54\xff\x75\x6c\x54\x1d\x25\xbf\xbb\xbd\x59\x6c\
\xfe\xb9\x0d\xaf\xdf\x74\xe5\x4b\x17\x5d\x5c\x7a\xc2\xed\x8b\x27\
\x9c\x77\xc4\x0e\x0f\xcd\xfd\x14\xbd\x49\x83\xf6\x39\xe5\xac\xfd\
\xcb\x3f\xb6\xe1\xe1\x50\x79\x84\xb5\x1a\x14\xb1\x8d\xad\x2b\x11\
\x7e\x96\x57\xd7\x94\x70\x43\x54\x4a\x5a\xbe\xb6\xd3\xbc\x13\xcc\
\x1a\x86\xf8\x3a\x90\x52\xcb\xd4\x46\x27\xf7\x27\x36\xbe\x71\xf3\
\x95\x2f\x5e\x7c\x49\xe9\x9d\xd4\x9d\x7f\x70\xde\x91\x3b\xcc\xbd\
\xff\x53\xac\xdf\x55\x9f\xc7\x47\x20\x1e\x75\x3d\xb8\x32\x34\x1e\
\x01\x51\x44\x97\x7c\x44\x80\x14\x3f\x8d\xfc\x6a\x36\x51\x08\x8f\
\xb5\xca\x47\x0d\x6c\x2d\x2c\xd9\xef\x5a\x59\xbe\x8e\xc9\x75\x3d\
\x9a\x3b\xb3\x3b\x5d\x50\xf0\x8f\x1b\xdf\xbc\xe5\x8a\x3f\x5d\x72\
\x69\x69\x56\xd3\x9d\xbe\x7f\xde\x51\x3b\xde\x7f\xef\x27\x7a\xcc\
\xee\x5f\x77\xca\x7d\xa3\x41\xa3\x4f\x3d\xab\xa3\xfc\x05\x36\x3c\
\x14\x16\x8f\x10\xf7\xc8\xab\xb0\xf8\x54\x09\x20\xe9\x5a\x93\xe2\
\x3d\x46\x8f\xb1\x91\x96\xea\x7b\x0f\xa1\x1c\x74\x51\xbf\x8d\xd3\
\xc2\x92\xb1\x87\x91\x58\x8f\x08\x2b\xc9\xec\xae\x8d\x4b\x6e\x9d\
\xf9\xc2\xa5\x97\x95\xd6\x69\xdd\xf1\x7b\x53\x8f\xde\xe9\xde\xbb\
\x7b\x11\x4d\x6a\x7c\x3c\xc2\x1d\xfd\x8a\x6c\x85\x54\x28\x42\x82\
\xdf\x2b\x62\x7b\x6e\xca\x26\x1f\x01\xda\xc4\x00\x98\xf2\x84\x60\
\xec\x4a\xcf\x17\x10\x85\x14\x09\xc6\x18\xf1\xa7\xd1\x61\x4a\x2d\
\x50\x4a\x6d\x5c\x72\xdb\x8c\xe7\x2e\xfb\xed\x21\x65\x0f\xd8\xe1\
\x3b\x53\x8f\xde\xe9\x9e\xbb\x7a\x53\xac\x11\x1f\x34\xfa\xd4\x33\
\x01\x3c\x5a\x3f\x77\xfa\x43\xfc\x79\x24\x27\x87\x8d\xa5\xa6\x9a\
\x0a\x20\xe5\x95\x41\xfa\xbc\xa3\x53\xd7\x79\x67\xd3\x9c\x3f\x28\
\x64\x0a\x4e\xda\x73\x37\x78\xf7\x9b\x12\x27\x35\xa8\x92\xb2\x71\
\xb7\xe9\x8a\x14\xd5\xf9\xc0\x1d\x14\x67\xa6\xed\x7f\x6d\xfd\xdf\
\x4d\x6f\xcd\x99\xf1\x2c\xe0\xf3\xc3\x8e\x9f\xf6\x8d\x9d\x12\xb4\
\x66\x03\xe3\xa3\xf5\x0f\x76\x3d\xbc\x92\xf3\xfc\x95\x7b\x45\x08\
\x40\x82\x53\x07\x3d\xe9\x6c\x5a\xf6\x27\xcf\x02\x92\x3a\xb9\xd1\
\xfb\x50\x21\xce\x99\xa4\x49\x61\x70\x97\x35\x48\x08\xda\x69\xf5\
\x5d\x3a\x57\xa3\xf7\xf2\xec\x27\x1f\xaf\xb6\x56\xdc\xd8\xf4\xf6\
\xed\xdd\x0b\x01\x0f\x1a\xfa\xed\x69\xc7\xec\x9c\x20\xe9\xd8\xa0\
\xd1\xa7\x9d\xb5\x5f\xf9\xc7\xd6\xcd\x9d\xce\x96\x47\x82\x22\x2a\
\x20\x35\xb0\x64\xcf\x24\x03\xde\x94\x3a\xe3\x74\xa1\x98\xdf\x35\
\x13\xc7\x34\x0a\xb1\xa0\x6a\x42\x76\xa9\x36\x33\xb6\x4b\xc0\x8a\
\x8d\x18\x2a\x35\x7f\xc5\xdd\x11\x70\xa5\x76\x56\xea\xf0\xad\x31\
\xd2\x3b\x7f\xec\x5e\x00\xf8\xd2\xf6\xdf\x9e\x76\xec\x17\x13\x94\
\x77\x1f\xb4\xef\x69\x67\x82\x78\xd4\xf5\xc8\x87\xfc\x78\x14\x28\
\x8a\x78\xd6\x58\xaa\x11\xb5\x18\x37\x7f\x97\x3d\x8a\x12\xe7\x6d\
\x0e\xc5\x89\x0b\x11\x4b\x74\x83\xd5\xd0\x34\xad\x13\x10\xe8\x41\
\x9b\x97\x5e\x9d\xa7\x3e\x23\xd2\x1d\x5d\xcf\x00\xbe\xb2\xdd\x7f\
\x9b\xf6\xcd\x3f\xc3\x70\x11\x81\x3c\x5a\xfb\x00\x43\x1e\x21\x5e\
\x2d\x72\xbd\x19\x9c\x70\x64\x52\xbd\x94\xa2\x66\xcb\x74\x09\x92\
\xbd\x20\xda\x90\x70\xf9\x73\x0e\xdc\xdb\xd2\x96\x73\xb8\xfe\x82\
\x3b\x82\x29\xf8\xdd\x71\x35\x24\xd5\x1f\x85\xcc\xac\x5a\x40\x68\
\x79\x19\x8e\xcd\xef\xde\xd9\xf5\xb4\x3a\xe2\xc8\x72\x22\x9d\xff\
\x17\xbb\xdc\x7a\xd3\x07\x96\x33\x1d\xca\x23\x7e\xf1\x51\xf3\x29\
\x76\x63\x32\x79\x9c\x71\x0c\xeb\xfe\x95\x9f\xb2\x33\x66\x12\x37\
\x14\x25\xd8\xdb\xd7\xde\x21\x04\x69\xb9\xee\x3c\x09\x85\x4c\xcd\
\xa3\xe9\xf2\x20\x7e\xb1\x16\xa5\x34\x69\x1d\x5c\x4f\xb7\xcd\x4b\
\xef\xea\x7a\x4a\x1d\x79\x54\xd9\x97\x06\x8f\x3b\xff\xb8\x5d\x6e\
\xb9\xa1\x34\x6d\x42\xe1\x2d\xa5\x41\x63\x4e\x3f\x73\x4c\x79\x03\
\xfb\xee\x9f\xfe\xe8\x47\x9c\x78\xd4\x72\xa7\xca\x80\x4c\xa5\x2a\
\x51\xc1\xea\xa6\xa0\x6c\xdf\x8e\x23\x3b\xd2\xbd\xa2\x38\x6a\x49\
\x24\xb0\x8e\xb2\x2a\xa5\x6a\xb1\xc9\x94\x3a\x29\x25\xd5\xfc\xfa\
\x2e\xaf\xac\x42\xde\x3d\x50\xe7\xa6\x41\xa4\xf7\xee\x9a\xfe\x04\
\xe0\x35\x06\x1d\x37\x6d\xdc\x2e\xb5\xd2\xde\x28\x1a\x9d\x41\x63\
\x4e\xeb\x04\xf1\xa8\x8b\x13\x8f\x8a\xe3\xdd\xd2\xf5\x37\x0e\xe7\
\x63\x03\x06\x92\x19\x93\x4c\x8e\xcc\x12\x03\x23\xe1\x31\xff\x51\
\x0e\xb2\x97\xa2\x08\xcb\xd4\x6a\x91\xa9\xfd\x5d\xa8\x8d\x48\x42\
\x69\x5c\x8c\x7f\x31\x14\x26\xe5\xb5\x73\xf3\xb2\x7b\xba\x9e\x00\
\xdc\xf7\x19\x74\xdc\xb4\xbf\xfc\x52\xad\x50\x13\x8a\xbb\x0b\x1c\
\x1f\x75\x3f\xf6\x71\x60\x3b\xbc\x79\x64\x42\x41\x11\xe4\x96\x4e\
\x88\x52\xd7\xea\x82\x82\xb5\xbb\xcc\x6b\x89\x52\xda\xce\xbd\x9d\
\xa2\x3b\xa1\x50\xba\x9a\xe7\xad\xb4\xae\xc5\x5a\x87\xf1\x49\xf1\
\x14\x36\xd6\x41\x4c\x81\x8c\x46\x6e\x5e\x7e\xcf\xf4\xc7\xb7\x7c\
\xe3\xd8\x32\x8f\x75\xe0\x5f\x9c\xff\xdf\x77\xbd\xee\xea\xe5\x5b\
\xb2\xd5\xa0\xec\xf5\x07\x8f\x39\xbd\x73\xdf\xf2\x06\xae\xb9\xaf\
\x8b\x11\x8f\xbc\x17\x34\x68\xe6\x50\x3b\x93\x92\x90\xcd\x6e\xcd\
\xcb\x08\x45\x42\x17\xd4\x19\x92\x62\x8c\x82\x83\x81\xe0\x46\x23\
\x5f\xbd\x91\xa0\x86\x4a\x7c\x58\xfe\x39\x91\xee\xed\x7a\x6c\x33\
\xc0\xa5\x3d\x76\xda\xb7\x77\xab\x19\x86\x92\x83\xc7\x8c\x07\xf2\
\xe8\x71\x2e\x3c\xf2\x6e\xeb\x4a\xcd\x4e\xd0\x61\x13\x42\x09\x73\
\x15\x6f\x9e\xa5\x82\xf5\xb4\xfe\x51\xd7\x1a\xfb\x54\xd7\xcd\x47\
\x42\x05\xee\x12\x84\xc1\xab\xa5\xa1\x99\x0f\xf8\x3a\x2a\x04\x4b\
\x44\x89\xf2\xa8\x99\xb4\x65\xc5\x7d\xd3\x1f\xdd\x54\xfe\xfd\x01\
\xc7\x4c\x3b\x7e\x8f\x01\x46\x6f\x34\x78\xcc\xe9\x93\x00\x3c\x5a\
\x7d\x2f\x17\x1e\xb9\xa7\x91\x76\x34\x96\x84\x1d\x21\xd5\x81\x2f\
\x09\xb1\x56\xfd\x3e\x69\x1c\x70\x4a\x75\x42\x66\x22\x0d\xb0\xbd\
\x7a\xd5\x89\x39\xaf\x42\x09\x8c\x9a\xb5\x51\x29\xdb\xca\x49\xc0\
\xfc\x87\x49\x94\x37\xd8\xb6\xac\xb8\x7f\xfa\xa3\x9b\x8e\xfb\x56\
\x99\x8d\xa8\x7d\x63\xda\xf1\xbb\x5f\x35\x63\xe9\xe6\xcf\x7b\x0c\
\xa6\xba\x60\x1e\x75\x3f\xd1\x9b\x16\x69\xb2\x1c\x10\x48\x62\xd9\
\x1d\xa9\x21\xbe\x6a\x34\x6a\x91\x3a\xf1\x5e\x29\xf2\xbf\x01\x73\
\xdc\x69\xd7\x54\xb5\xa3\x91\x76\x7e\xd2\x14\x81\x7c\x06\x07\x99\
\x52\x22\xcf\xc0\x5e\x21\xfd\x6c\x5f\x6f\x79\xff\x81\xff\x7c\x78\
\x23\xe0\x05\xbf\x3e\xed\xbb\x7b\x0e\x80\x87\x8c\x0d\x1e\x81\xd6\
\xeb\x56\xdf\xd3\xfd\x78\x36\x8f\x1c\xd3\x88\x22\x9b\x3e\x0a\x8a\
\x92\x88\xf6\xea\x6b\x66\x34\xca\x5b\xa0\x8f\x80\x49\xa5\x34\x6a\
\x31\x0d\x1a\xc0\x26\xce\x40\x4a\x17\x6d\xb8\x8f\x8d\x50\x98\x64\
\x49\x0e\xa2\x91\x62\xbe\xc4\xdf\xdc\xbc\x2d\x1f\xcc\x9d\xfe\xd0\
\x06\xc0\x97\x8e\x9a\xf6\xdd\x3f\x1f\xa0\xf9\x43\x83\xf7\x1b\x3f\
\x69\x74\xf9\xc7\x56\xdd\xdd\xfd\xc4\x27\xfe\xbb\xac\xa5\x24\x0d\
\x07\x43\x17\x19\x8a\x4a\x80\x94\xf7\xb6\xcd\x28\x92\x64\x82\x49\
\xd4\xe7\x08\xf3\x26\x5e\x4a\x5c\x15\xa9\x60\xa6\xb9\xb9\xdb\xa4\
\xcb\xa1\x94\x58\x67\x5c\xaa\xd9\x36\xbf\xb5\x65\xe5\xdc\xe9\x0f\
\xae\x07\x7c\xeb\xc8\xa9\xdf\xdb\x4b\xaf\x94\x0d\x90\x47\x9f\xde\
\xdd\xfd\x64\x6f\x8a\x16\xeb\x1b\xd3\x08\x25\xbf\x3e\x96\x2f\x12\
\x25\x8a\x8a\x80\x54\x10\x18\x95\xfe\x0d\x62\xa4\xe2\xde\x2f\xd2\
\x0a\x8f\xc2\xd5\x09\xc8\xa8\xd9\x07\x46\x74\x81\x20\xa3\x0b\x92\
\x91\xe7\x3f\xdc\xb2\xf2\x21\x18\x91\x8e\x98\xfa\x03\x2d\x22\xe9\
\xf0\x88\xed\x22\x01\x9c\x43\x88\x8b\xae\x71\x3b\xc1\x35\x1b\x1a\
\x11\x79\x28\xe9\xb6\x59\x61\x52\x57\x37\xff\xd3\xe8\xd4\x22\xf5\
\x44\xa3\x44\xae\xa0\xc5\x22\xe9\xca\x87\xa7\x3f\xb0\x0e\xf0\xc1\
\xc3\xce\xfb\xab\xbd\xe1\x44\x1a\xbc\xdf\x84\x49\xfb\x00\x78\x74\
\xd7\x8c\xa7\x3e\xf1\x1c\x1e\x61\x05\x34\xc6\x61\x4d\xa5\x16\xa2\
\x6a\xcd\x01\x60\xd1\x52\x89\x43\x1a\x41\x70\x45\x81\xa8\xd2\xea\
\x03\x0d\x1f\x87\x15\x8d\x0a\x32\x29\x98\x35\xd3\x86\x46\x6e\x50\
\x94\xb0\xe9\xe4\xc4\x5a\xdb\xa1\xe7\xcb\x7d\xa9\x5c\xfa\xe1\xc3\
\xd3\xef\x5f\x0b\xf8\xe0\x57\xce\x3d\x61\x38\x94\x48\x83\x3b\x26\
\x9c\x01\xe0\xd1\x27\x85\x3c\x12\x89\x3a\x42\xd2\x3d\xbf\xc0\x67\
\xf5\x03\x11\x51\x05\xf6\xd4\x17\x8d\x4a\x33\xf7\x68\x65\x75\x6c\
\x1c\x4c\xca\x4b\x6a\x62\xbc\x69\x84\x75\x23\x87\x21\xe9\x9b\x3b\
\x56\x6b\x2e\x24\xe0\xc4\xe1\xce\x96\xfe\x76\xba\x5a\x77\xed\x28\
\xfd\xe8\x91\xe9\xf7\xf5\x01\x3e\x78\xe8\xb9\x27\x8e\x18\x88\xcb\
\xa3\xee\x79\xc2\xa3\xaa\x02\xc9\x6f\xb4\x98\x62\x3f\x8d\x08\x4b\
\x06\x34\x42\xe1\x25\xf0\x18\x77\xf1\x78\xb5\x1f\x93\x85\x94\x83\
\x4b\x01\x7d\x85\x9b\xde\xad\x38\xda\x73\xe3\x0f\xd8\x6b\x7e\xa2\
\xaf\x9f\x3c\x81\x9d\x7e\xfc\x58\xd7\xbd\x6b\x00\x1f\x3c\xf8\xdc\
\x93\x47\x42\x88\x04\xe4\x51\xef\x9d\xc2\x23\x01\x92\x8e\x1d\x44\
\xc1\x15\x5d\xa5\x35\xcc\x39\x99\xe2\xa0\x34\xd1\xb7\x53\xc0\x83\
\x3d\xc6\x75\x59\xfa\xbf\x68\x40\x23\xa2\xd5\xb9\xe6\x82\xb6\x1e\
\xb5\xa8\xf9\x54\x55\x89\x37\x60\x11\x18\x39\x9b\x0e\x9f\x5b\xf9\
\x33\xf5\x9d\xaa\xf4\xe3\xc7\xba\xee\x5d\x0d\xf8\xe0\x97\xa7\x9c\
\x32\xaa\x9c\x48\x83\x3b\x26\x9c\x31\x0a\xc2\xa3\x19\x4f\x7f\xca\
\x81\xc7\x71\x57\xed\x0c\x0b\x48\x2a\x67\x79\xc7\xfe\x04\x24\x67\
\x97\x30\x2f\x30\x6a\x9f\xc9\x88\x47\xce\xb4\x72\x71\xa6\xfa\xde\
\x43\x01\xdb\x74\x69\x64\x80\xa2\x14\x69\xc4\x13\xb7\x74\xcc\xe4\
\x53\x31\x29\x13\x0c\x85\x67\x76\x78\x2f\xed\x7d\xbc\xeb\x1e\x08\
\x91\xc6\x4e\x3e\x75\x9f\x41\x65\x3c\xda\x7f\x22\x84\x47\x1f\xdf\
\xc1\x83\x47\xde\x76\xef\x8c\x17\x8a\x23\x07\x52\xe6\x9c\x64\x1b\
\x18\x51\x84\x47\x79\x7a\x99\xc2\x5e\x13\xb8\xb9\x92\x68\xd2\xc8\
\x8c\x49\x96\xa3\x63\x6c\xf7\x63\x3a\x77\x97\xb1\xf7\x46\xf3\x8e\
\x8c\x4e\xb7\xf7\x3e\xd1\x75\x17\x04\x0f\x07\x4c\x3e\x6d\xf4\xa0\
\x12\x1e\x4d\x98\x18\x12\x8f\x98\x4a\xe3\x28\x79\xc1\x9f\xc8\x81\
\x84\xce\x0c\xef\x46\x2a\x75\xf2\x9a\xb8\x04\x4d\xad\xe3\x24\xc3\
\xf0\x0b\x63\xb0\x2c\x1f\x92\x30\xd6\x04\xba\x1b\x57\xd4\x5a\x0a\
\x33\x5e\xbd\x4f\x76\x83\x88\xd4\x31\xf9\xf4\x7d\xb3\x88\x34\x44\
\x2f\x3e\xfa\xe8\x8f\x33\x9e\x59\xc5\x99\x07\x21\x84\x2c\x10\x68\
\x71\x43\x57\xcd\x7b\x0b\x92\xac\x3f\x0e\x4c\x43\x88\x0e\x44\xaa\
\xff\x16\xa9\xf5\x4f\x54\xe4\x52\x91\xb3\xeb\x6e\x3c\x3d\xa7\x52\
\xab\xf4\xc9\x53\xdd\x77\x42\x8e\x18\x8c\x39\x6b\xfc\x98\xc1\xed\
\x7f\xbd\xf5\x2a\xd3\x90\xfd\x27\x4e\x1c\x09\xe2\xd1\x7c\xa6\x3c\
\x72\x76\xea\xb8\x9a\x52\xe3\xd9\x2c\x63\x4a\x25\xa8\x53\x1d\x72\
\xc0\xcc\xbb\x55\xc2\x62\x52\x9a\x95\xa8\x22\x31\xb5\x62\x96\xf3\
\xd6\x7b\xba\x30\x6e\x70\x72\x13\x2a\x15\x12\x69\x5e\xf7\x1d\x90\
\xa4\x09\xfb\x9e\x39\x71\xbf\xc1\x39\xff\x36\x64\xff\x33\x20\x3c\
\xfa\xf0\xf6\x99\x0b\xf8\xf1\xa8\x59\xa5\x25\xbf\x78\xb5\x80\x44\
\x1d\x4b\x21\xa6\xa9\x4e\x74\x14\xda\xf8\x63\x66\xe0\x84\x1f\x25\
\xd0\x45\xd1\xd6\x8f\x95\x5d\xa3\x36\xc0\x12\xd6\x61\x19\x2d\x9c\
\x24\xa8\x4f\x43\x74\x98\xbc\x07\x46\x4d\xf2\xe9\xbc\xee\xdb\x3f\
\x06\x7c\x6e\x74\xe7\xc4\x8e\xc1\x39\x3c\x9a\x38\x01\xc6\x23\x76\
\xf1\x51\x33\x8a\x4a\xf5\xd3\x60\x11\x4c\xf7\x2b\xd5\xca\x65\x17\
\x2e\xa5\x98\x2c\x80\x18\x87\x0b\x74\x05\xa5\x52\xc0\x3f\xd9\x2f\
\x99\x66\xbe\xa9\xcb\x55\x8e\x34\xbf\xa6\x11\x44\x91\x1c\x28\x0f\
\xe7\xa4\xef\xc5\x66\x71\xd5\x33\x33\xe6\x7c\x04\x78\xca\xa8\x49\
\x93\x0e\x18\x92\xc5\xa3\x03\x40\xf1\xd1\xca\x39\x33\x17\xac\xd6\
\x1d\x71\xf2\x4c\xf0\xe0\xf3\x5c\x5a\xa5\x3b\xe1\xbb\x38\xa4\x33\
\x88\x74\x1b\x49\xeb\xe1\xc1\x03\x89\x28\x36\x2a\xd0\x1e\xa2\x30\
\xdf\xa6\xbc\x61\x02\xf8\xfb\x04\x60\x22\xb1\xbc\x48\x4b\x2a\xdb\
\x84\x44\x96\x83\x5e\x5a\x88\x0f\x1d\x21\x1e\xe1\xa4\x6d\x86\x56\
\xcd\x9f\x39\xe7\x43\xc0\xe7\x46\x9e\xd1\x39\x76\x48\x06\x8f\x26\
\x4e\x18\x01\xe1\xd1\x15\x0b\x57\xdb\x8e\xb8\x2f\x9c\xf7\x77\x29\
\x93\x6c\xdc\xa5\x09\xf4\x6c\x32\xec\xc1\xfb\x44\xeb\xf9\x95\x03\
\x92\xb1\x7f\xda\x98\xbd\x70\x2c\xb5\xd4\x50\x29\xfd\x64\xc1\x67\
\x12\x3b\x1b\x6a\x9b\x72\xad\x07\xe7\x33\xd4\xa9\x78\x51\x1c\x91\
\xc4\xa8\x9f\x51\xac\xa4\x63\x38\x35\x27\xfd\x84\xd9\xa6\xd5\x0b\
\x66\xde\xb6\x12\xf0\xe4\xe1\x13\x3a\x0f\xdc\xae\x3d\x3e\x82\xf0\
\xe8\x83\xdb\x0a\x79\x94\x72\xcd\xb0\xde\x6f\x79\xf9\x14\x86\x68\
\x6e\x46\x4b\x93\xda\xdb\x49\xd1\xe6\x7e\x3b\xa9\xfb\xe4\xba\xaa\
\xb6\x24\xe0\xce\xcd\x1b\xec\x52\xfb\x5b\x1c\xf7\x58\x6e\x93\x52\
\x2b\x3f\xb0\x28\x27\x24\xd5\x9e\xf7\x78\x37\xd5\x39\x1a\x93\x1a\
\x75\x72\xb2\xed\x2d\x31\xc4\x33\xee\x4c\x4c\xf0\xea\x05\x33\x6f\
\xfd\xe0\xdc\xa9\x5f\x2a\xfb\xdc\xde\xe3\xcf\x3c\xf0\x5f\x16\xcc\
\x5f\xbb\x0d\x8f\xc6\x5b\xf1\x88\xf9\xb1\xd8\x20\x36\x75\x9c\x35\
\xd2\x78\x0d\xb0\x72\x11\x92\xe5\x40\x1a\x78\x40\xa5\x69\xe8\x70\
\x4f\x94\xb9\x3f\x93\x9a\x97\x09\x9e\xfa\xa4\x5c\x4a\xff\x95\x92\
\x24\x40\x0e\xf7\xc6\xb8\x6c\x38\xad\x59\x74\xc5\x2d\xef\x03\x3e\
\xb7\xd7\xf8\xb3\x0f\xfa\x42\x73\x7c\x34\x76\x12\x24\x3e\x7a\xff\
\xd6\x2b\x16\xad\xa9\xa2\x61\xa1\x7e\x6c\xa9\xe1\x42\xdc\x46\xb2\
\xc9\x43\x6d\x0b\x24\xef\x47\xf2\xdd\x59\x04\x7e\x55\x1a\x93\x9c\
\xde\x40\xec\x93\x62\xa8\xb4\x58\x64\xdc\x5c\x1e\xde\x31\xc6\x04\
\x45\xcc\x64\xcd\xa2\x2b\x6e\x5e\x0e\xf8\xdc\x9e\xa7\x4d\x3e\xf8\
\x0b\x4d\x3c\x3a\x63\xfc\x70\x08\x8f\xae\x7c\x36\x56\x1e\xe5\x59\
\x7c\xb8\x55\x69\x51\x39\x86\x31\x59\xf3\x76\x86\x59\xf3\xcc\x81\
\x64\xb3\x09\x8f\x69\x94\xab\x7a\x21\x20\xc9\xd7\x57\x67\x75\x9d\
\x6d\x20\x64\x69\xd0\x53\xe2\xef\x26\xa6\x2d\x4f\x8c\xe6\x51\x40\
\x78\xeb\x7b\xee\xca\x9b\x97\x01\x3e\xb7\xc7\xa9\x93\x0f\xdd\xfe\
\xf3\xf8\x08\xc2\xa3\x15\xb7\xe4\xf1\x28\xf4\x04\xa7\xc5\xf1\x07\
\xc4\x76\x53\xfb\x79\xf6\x78\x43\xa9\xa6\x6d\xb2\x87\x04\xdc\x57\
\xe0\xab\x1c\x61\xde\x6e\x4b\xb6\x3d\x9f\x8d\x48\xe8\xd4\x68\x39\
\xc8\xac\xf7\xb0\x2c\x6f\x62\xcd\xa4\x04\xa9\xf1\x28\x6e\x59\x48\
\xaa\xd8\xf7\xfc\xac\x9b\xde\xbb\xe0\x6f\xf7\x2c\xfb\xdc\x6e\xa7\
\x4c\x3e\xf4\xc7\x4f\x3c\xbe\x46\xa9\x21\x07\x82\x78\xb4\x3c\x87\
\x47\x71\xd3\xa8\xc0\x82\xeb\x6a\x85\xc7\x98\x09\x6b\xc5\xaf\x16\
\xff\xfc\x71\xee\x6b\x20\x22\x93\xda\x4b\x48\x0b\x53\xb5\x22\xbe\
\x0e\x45\x1c\xe0\x72\x5b\x45\xab\xf1\x49\x5c\xda\x98\x41\xa4\xab\
\x6e\x5c\x0a\xf8\xdc\xae\x27\x4f\xf9\xea\x50\xa5\xd4\x76\x07\x4e\
\x1a\xbf\x37\x84\x47\xb3\x9e\xeb\xab\x24\x8d\xec\x6d\x2c\xca\x86\
\x82\x59\x53\xdb\x4f\x1d\xdb\xb4\xa4\x46\xdd\x53\x9c\xb1\xc4\x90\
\x43\x10\xc3\x97\xe4\x38\xe9\x5a\x6f\x64\x7c\x81\xd4\x2f\x84\xbc\
\x60\xa9\xf4\x15\xa8\xdf\x71\xeb\xf5\xc9\x4b\xb9\x28\xea\xda\x17\
\xae\xba\xfe\x5d\xc0\xe7\xbe\x74\xe2\x94\xc3\x86\xaa\xed\xc6\x4e\
\x3a\x1d\xc0\xa3\x65\x37\x67\xf1\xa8\xa2\x34\xd2\xe2\x10\xab\xc0\
\xc8\xb2\x31\x55\x3f\xf6\x1d\x1c\x2c\xf3\x68\x84\xa3\x5e\x4e\x6e\
\x2c\x11\x61\x89\xc2\x9b\xb6\x4a\xc7\x17\xb1\x82\xae\x7d\xb1\xe7\
\xfa\x77\x7e\xf8\xa3\x52\xcc\xec\x72\xe2\x94\xc3\x77\x5d\x73\x02\
\x90\x47\xcf\xc7\xc5\xa3\xe0\x0a\x40\x68\xb1\x84\xe8\xed\x04\x48\
\x41\x69\x0c\x5e\xa8\x97\xe4\x24\xf6\x0e\x08\x42\xce\xb0\x24\x34\
\xca\x22\xd2\x75\x6f\xff\xe8\xc7\xa5\x1b\x43\x5f\x3c\xe1\x6f\xcf\
\xd9\xf4\x35\x00\x8f\xde\xbb\xe9\xaa\x17\xd8\xae\xd7\x99\xad\x87\
\xf7\xdb\xf7\x28\x0b\xce\xda\x9f\x18\x14\x20\x61\x0f\x49\xd9\x41\
\x2c\xfe\x0b\x9b\xc6\xd7\x3f\x15\xef\x7a\x30\x88\x30\x00\x0e\x22\
\x93\x13\xa7\x2e\x65\xdd\x4b\x3d\xb3\x97\xfc\xf8\xa7\x23\xcb\x3e\
\xb7\xf3\xa9\x97\x9c\x07\x78\xdc\x7b\x37\x5d\xc5\x32\x3e\x6a\x29\
\xdb\x6a\x30\xc4\x96\x58\x6a\xe4\x22\x72\x46\x9a\xd2\xdf\xa2\xa3\
\x91\x92\x8b\xb1\x44\x56\xaf\x5d\x71\x4b\xf3\x9d\x50\x9f\xfd\xcb\
\x54\x23\x8f\x8e\x7c\x4c\xe6\x1b\x21\x3d\x79\xd9\xb1\xe0\x24\x51\
\xc9\x4f\x58\x11\xe9\xe5\xd9\xb3\xdf\xc4\x7a\xd8\xd2\x1b\xaf\x7e\
\x61\x2d\x6b\x1a\xd0\x38\xa8\x16\x00\x00\x18\xcf\x49\x44\x41\x54\
\x59\xfa\x61\xc6\x3b\x3d\xac\xae\x3f\x16\x64\x4d\xc3\x6a\xa4\x00\
\xc9\x51\x38\x95\x67\xfd\x5d\x5e\x43\x41\x64\x92\xd4\x83\x41\xec\
\x10\x83\x94\x5f\x44\xf6\x57\x47\x15\xd7\xbf\x72\xed\x35\x6f\x70\
\xe2\x11\xfa\xa9\x9c\xe0\xd6\x06\xe0\xfc\x28\x8e\xe7\x0c\x7c\x26\
\x2c\x89\x16\x48\x69\xfe\x1f\x3e\x11\x15\x85\x72\x17\xdb\x94\xa2\
\x92\x7a\x39\x1d\x28\x42\xae\x1b\x0e\x69\xb4\xd3\x05\x68\x4c\x5d\
\xbf\xf8\xda\x9e\xd7\x31\xda\xf4\xee\xf5\x57\xff\x69\x2d\x35\x60\
\x50\x68\x44\xea\x0a\x30\x67\x9b\x1b\x05\x8e\x0d\x48\x10\x33\xea\
\x5e\xd1\xe1\x34\xb2\x72\xb4\x7b\x4c\x77\x5f\xb3\x28\x5e\xda\x5d\
\x96\x41\x92\xd4\x81\xf6\x22\xbd\x97\x97\xc4\x79\xa5\xc3\xba\xee\
\xd7\x6a\x87\xad\x44\xfa\xaf\xeb\xae\x7e\xcd\xbe\x49\xef\xdc\xd0\
\xf3\xe2\xda\x2a\x8e\x05\xe9\xea\x08\x45\x6e\x3a\x07\xee\x54\xdd\
\xf1\x00\x28\x1e\xab\x3d\xc6\x9b\xf9\x98\x94\xea\x04\x5c\x70\x01\
\x56\x3d\x80\xdf\xd9\x4c\x72\x99\x54\x5a\xc1\x2f\x31\x7a\x85\xe2\
\x66\xeb\xde\x9d\xb2\xf1\x00\x0a\x3a\x4d\x56\x20\x35\xba\x6b\xa3\
\x9a\xb0\x9d\x9a\xbe\x56\x29\xb5\xe1\xd5\xeb\xaf\x7a\xf5\x5f\x7f\
\x39\xc6\x96\x47\x2f\xad\xd5\xd7\xc9\xe0\xbb\x11\xd5\xbd\x8b\x26\
\xb8\xaf\xbb\x1f\x86\xd6\x14\x81\x88\x89\xae\x91\xbe\xe5\x0c\x51\
\x2d\xef\xde\xae\xac\x49\x99\x1d\xc7\xcc\xa3\x0a\x88\x2c\xd1\x99\
\x44\x34\xb8\x90\xea\x0f\xc6\x8a\x57\xc0\x51\x94\xdd\xa0\x4c\xbf\
\x2d\x4d\x95\xfa\x8d\xcf\x73\x0d\x9f\x0f\xf4\x40\xf5\x3f\x8e\x56\
\xd3\xe7\x2a\xa5\xd4\x86\xd7\x6e\x98\xb5\xf8\x97\x17\x76\x58\x3c\
\xf7\xed\xeb\x0a\xe2\xa3\x44\x16\x8d\x31\xe2\x9b\x80\xea\x9d\xbb\
\x00\x52\x69\x21\x51\x14\x26\x21\x2a\xae\x7d\x31\x1b\x14\x3e\x99\
\x75\x69\xd1\xa5\xda\xb2\x57\x62\xce\x24\x26\xe3\x68\xd3\xc3\x41\
\x4b\xc6\x8b\x6f\x78\xfd\xc6\x59\xaf\x5c\x78\xd1\xfe\xe6\x3c\xba\
\x7e\xf6\x4b\xeb\xac\x74\x92\xe7\x0c\x2d\x7e\x02\xa8\xe2\xa5\x05\
\x48\x70\x0f\x20\x24\x49\xce\x79\x28\x02\x6d\xa7\x05\x52\xb8\xf1\
\x69\x7c\x86\x05\x5a\x54\xd0\x94\x49\x4a\x45\x88\x25\xf7\xae\x49\
\x68\x5b\x6b\x1b\x5e\xbf\xe9\xca\x97\x2e\xba\x78\xac\xe1\xd7\xdf\
\xba\xee\x9a\x62\x1e\xb1\x60\x12\xba\xbd\x2a\xf5\xe1\xfa\x01\xc0\
\x39\xb8\x21\x6a\x58\xcd\xcd\xd4\x6a\x2e\x52\x40\x44\x23\xac\x9c\
\x66\x06\xcf\x49\xd9\x4c\x0f\xed\xe4\xaa\x46\x07\xc1\x11\x8f\x39\
\x00\xed\xaf\x7d\x51\x70\xdd\x01\x4d\x51\x95\x2a\x62\xd9\xf8\xc6\
\xcd\x57\xbe\x68\xfa\xe5\x25\xd7\x5e\xf3\xf2\x3a\x6e\x6f\xd4\x7f\
\x10\x91\xdc\x5e\x75\x82\xcc\xbd\xc1\xd1\xed\xa0\x85\x24\x42\xf2\
\x78\x78\xc1\x26\x79\x4c\x40\xa6\xa7\x74\xf3\x49\x8b\x49\x19\xf5\
\x25\x8d\xe2\x24\xc5\x63\xf9\x2e\x61\xf0\x84\xe2\xd9\x91\xbb\x05\
\x15\xe2\xc9\xc3\x8d\x6f\xde\x72\xc5\x9f\x2e\xb9\xf4\xcb\x46\x3c\
\xba\xf6\x95\x75\xd0\x11\x71\x66\x96\x7b\x2f\x57\xc9\xe5\xe6\x9e\
\xb7\xee\x2c\xce\x5d\x46\x4a\xcc\x43\x25\xea\xb8\x8a\xee\xf9\x24\
\x11\x92\xa5\x5b\x61\xef\x11\x18\x38\xb6\xc6\x3d\xcc\x22\x73\x9a\
\x59\x89\xbc\x94\x4b\x9c\x84\xd2\xc3\x49\x38\x01\x8d\x47\xf0\xfc\
\xe4\x77\x1a\x31\x22\xec\x02\xdf\xc6\x25\xb7\xce\x7c\xc1\xa4\x2d\
\x6f\xce\xbe\x56\x23\x3e\x4a\x42\x18\x4a\x83\x91\x2d\x0d\x95\xbc\
\xe7\xc4\x43\xac\x2e\x61\x18\x21\x39\x5e\xbb\x24\x7a\x61\x60\xb4\
\xe4\xc0\xa1\x46\xbf\x72\xc4\xc4\xdf\x21\x3a\x0e\x1e\x65\x50\xcb\
\x82\x52\x35\x35\x66\x30\x68\x01\x23\x33\x22\xc9\x0b\x8b\x37\x2e\
\xb9\x6d\xc6\x73\x97\xfd\xf6\x10\x7d\x1e\xbd\xb2\x5e\x77\xb8\xd3\
\x40\xc6\xd1\x20\x54\xf2\x18\xf1\xc0\xa3\x02\xea\x96\xd4\xf2\x7e\
\x95\x14\xc8\x5b\xeb\xbb\xa4\x2e\x56\x48\x8b\x1d\x67\x5f\x34\x52\
\x0e\x2b\x06\x15\x3b\x5f\x05\x1a\x06\xec\x9c\xd4\x49\x9c\x14\x68\
\x30\xc4\x24\x36\xda\x71\x47\xb5\xe7\xce\x6a\xf8\x28\xf5\x95\xc1\
\xd0\x96\x24\xf0\x55\x87\x4d\x6f\xcd\x99\xf1\xac\x6e\x93\xde\xb8\
\xe6\xba\xc5\xeb\xf1\xa7\x9b\x04\xc1\x41\x8b\xbb\x4c\x0d\x40\x02\
\xd1\x11\xb8\x65\x46\xb9\xb1\x68\xa1\xeb\x25\x2b\x26\x19\x9e\x50\
\x08\x64\x4f\xb8\xbc\xbb\x86\x98\x3f\xfc\xe2\x0b\xd5\xd2\xff\x50\
\x6f\xfd\x4a\x1d\x3e\x48\x63\x74\x1a\xbd\x5d\xd6\xe7\x9b\xde\xbe\
\xbd\x7b\x21\x1e\x8f\x52\x61\x12\x4f\x15\xa5\xef\xfa\x7a\xf1\x4c\
\x76\x5c\x16\xd7\xc1\x0b\x07\x74\x84\x37\xe3\x9e\xac\xa7\x73\x22\
\x90\x31\xa4\xbb\xa2\x94\xb8\x9d\x45\x29\xbd\x92\x18\x8e\xe3\x76\
\xdb\xfe\xdf\xbe\x67\x7e\x71\xfa\xa4\x3d\x07\xe6\x7f\x7e\x7b\x75\
\xcd\x39\xfd\xaf\xf4\x81\x5a\xbf\xc5\xb8\x01\x90\xde\xd8\xf4\x56\
\xcf\x94\xef\xbf\x7f\xe0\x8e\x03\xa0\x9d\xdc\xf7\xc6\xdc\x97\xd7\
\x17\xab\x5c\x62\xa7\x93\x6b\x16\xfe\x7a\xc2\x19\x57\x0e\x06\xb4\
\x7e\xd3\xca\xf9\x2b\x36\x53\x59\x80\x68\x92\x80\xb8\x59\x36\x4c\
\x16\x2f\x5e\xdc\xd1\xd1\x51\xc0\x12\x94\x76\x40\xb0\xa4\x6d\x38\
\x72\x78\x69\x7c\xc6\x0f\x77\x2b\x4b\x23\x9d\x8f\xc5\x99\x2b\x67\
\xea\x0e\x3f\x59\xa0\xfb\x22\x98\xa9\x3a\x2c\xe6\xbf\xb3\x84\x1d\
\xc5\x8d\x2c\xa8\x42\x92\x5e\xa3\x92\x49\x3a\xbf\xb4\xab\x4a\x7f\
\xab\xd7\xe1\x7c\x2e\xbe\x94\xde\x00\x4b\x79\xc4\x4f\xac\x26\x29\
\xe6\x7b\x61\xd7\x26\x47\x88\x90\x74\xc7\xa3\xf4\x06\x7b\x01\x96\
\xb0\x68\x64\x3c\xfc\xed\x6d\x6b\xfe\x1b\x0f\x9b\x8a\x3d\x98\xfd\
\xef\x3d\x4e\xa2\x5b\xc1\x68\xf6\x3f\xb4\xcf\x19\xda\xd9\x44\xa7\
\xe1\x91\xd2\xa4\x91\x52\x6a\x30\x95\xa9\x72\xb3\x92\x91\x16\xc6\
\x49\x01\x65\x15\x0a\x31\x4e\x6a\x39\x46\xe0\xcc\x00\xd6\x0d\xf4\
\xaf\xb8\x52\x88\x01\x96\x38\xd4\x72\x67\x75\x23\xba\xf8\x54\x9e\
\xb7\x43\x10\x60\x3b\xae\x75\x45\xc9\x6c\xba\x36\xbe\x65\xf2\x5d\
\x54\x57\x1d\x1d\x57\x58\xe3\x9b\x6c\x87\xef\xad\x37\xae\xc5\x38\
\x9b\x32\xc2\x24\xc4\x88\xc7\xb8\x48\xa0\x33\xa9\x53\x74\xbd\x16\
\x96\xf8\xf7\x91\x63\x47\xb8\x74\xeb\x08\xd7\xb2\x53\x44\x4b\x44\
\xd7\x66\xe9\x82\x21\x6e\x58\x42\x91\x01\xc3\x30\x69\x94\xb9\x84\
\x40\x3a\x0d\x1b\x6a\x26\x4c\x42\xa1\x51\x10\x9e\x7a\x0d\xd2\x94\
\xd6\xcd\x95\x4e\x50\xef\x97\xec\x1c\x24\x26\xd5\x79\xd3\x8a\xe5\
\xfe\xd5\xbd\xee\xca\xe7\x60\x0f\xc5\xb5\x59\x93\xcb\xbf\xa8\x65\
\x06\xdd\x54\x2c\xc4\x32\x5b\x9b\x16\x10\xd2\xa8\xf1\xf7\xe9\x06\
\x9f\xea\x14\x96\x97\xe0\x7e\x7a\x06\x97\x79\xa8\x46\x3d\x00\x88\
\x63\x60\x19\x54\x05\xa7\xb2\xa1\x9f\xcf\x49\x7d\x5c\x51\x52\xf4\
\xd5\x81\x1d\xd4\xd2\xa5\xc8\xe6\x49\xe5\x0e\x0f\x54\x8b\x7f\x4e\
\x18\x24\xc5\xc7\x24\x33\x93\xe8\xec\xe2\xa6\xc7\xf0\x48\xb9\xb9\
\x87\x84\x82\xa5\x4a\xc5\x46\xc5\xa1\x40\x69\x39\x0f\x6e\x58\xd2\
\xb5\x8f\x06\xe6\xde\x4b\x89\xfa\xd0\x4b\xbc\x63\xa9\xca\x3e\x53\
\xd4\x81\x74\x73\x41\x87\x49\x49\xd6\x3b\xae\xbc\x80\x5d\x07\x42\
\x8f\x2c\x59\x43\xa8\x65\x15\x8a\xdb\x25\x9c\x76\xa9\x97\xb6\x09\
\x8b\x04\x8c\xca\xc5\x9a\xae\x7d\x53\x6f\x24\x40\x56\x99\xcb\x2f\
\xd8\x77\xe2\x4f\xb9\xf6\x67\x6a\xad\xdd\x3b\xa8\xa2\x94\xc0\x40\
\x48\x47\xdc\x84\xf1\x8c\xc8\xfc\x89\xfe\x5f\x47\xd9\xd8\x18\xb8\
\x2f\x4e\x37\x26\x76\x1f\xcb\xfb\xfb\x9d\x0f\x53\xaf\xfe\x46\xf5\
\xdf\xc3\xea\xf8\x31\x23\x6f\xc0\x99\x31\xa4\xce\xbc\x83\xd9\xd4\
\x82\x7b\x48\xcd\x50\x6d\xb7\xe0\x36\xd6\xc4\xa6\x4a\x42\x40\xeb\
\x75\xe8\x57\x25\xcc\xea\xf2\x19\xdb\xc1\xd2\xf5\x43\x2d\x25\x4f\
\xc0\x8d\x21\x05\x3f\xed\x52\x9b\xc5\x50\x52\x98\xa7\x3c\xab\xa7\
\xbb\x32\xec\xe0\x56\x4a\xf1\xa0\x1b\xdf\x12\x2b\xb8\xd7\x55\xfc\
\x8e\x90\x17\x44\xb8\xf4\xed\xb6\xf3\xf9\x57\x8f\xad\x7b\x79\x13\
\x2d\xdf\x50\x97\xed\x31\xdd\x8e\xc6\x45\xbb\xd6\xfc\x69\x4f\x63\
\xec\x38\x4e\x22\xca\x98\x90\x50\x52\x2a\xc5\x70\x3b\xdc\xc4\x46\
\x66\x8e\x36\x96\x1d\xcc\x25\xa5\x4e\xb6\xaa\x04\xcf\xce\xf8\x0a\
\x20\x40\x89\x6e\x31\x8e\x25\x87\xe2\xcd\xd7\x3c\xfe\x36\x70\x6f\
\xa9\xb9\x13\x4b\x3b\xb4\xb1\x10\xc1\x17\x21\x48\xe1\x11\x5d\xe9\
\xb0\xbc\x0e\xcc\xbe\x1d\x65\x1d\x9d\x14\xed\x96\x39\x1c\x94\xf6\
\x3f\x74\xa1\x18\xbc\x7b\xdd\x8c\x2c\x64\x0e\x1a\xae\x72\xa7\x39\
\x05\xb7\x3a\x73\xfb\x2a\xc5\x98\x35\x0d\xdb\xc2\x99\x46\x5a\x96\
\xd0\xec\x58\x72\x70\x52\x87\xe8\x22\x6d\xe6\xef\x1e\x68\xf6\xf5\
\xd2\x66\x34\x0f\xaa\x65\x9c\x44\x14\xdb\xda\xd3\xc8\xf2\xd8\x74\
\xe9\x2c\x2d\x3d\x31\x41\x11\x27\x69\x7d\xbe\x1d\xcc\x8e\x5d\x07\
\xfb\x97\xf5\x55\xc6\xd0\xe5\x8f\xf6\xcf\x20\xe3\xcd\xda\xc4\x62\
\x1e\xd9\x2f\xc0\x78\xb1\xfb\x28\x7b\x8a\xfc\x17\xe5\x6c\x81\x54\
\x6a\xdd\xdc\xc5\x16\x89\x8b\xc9\x66\x33\x91\xe8\x68\x84\x65\x76\
\x8b\x47\xad\x60\x63\xa3\xf1\x4f\x0e\x98\xa4\xf7\x34\x57\x7c\x2a\
\x1e\xc7\xb4\x90\x5e\xc0\xb5\x4a\xc9\xc5\x59\xaa\x15\x09\x4c\xc9\
\xe1\x93\xdd\x3b\x87\xd0\x5d\x4f\x97\x79\x34\xd0\xa5\xa6\xfb\x9e\
\xf8\x8a\xdb\x89\x39\x8a\x36\x88\xca\x5b\x5e\xf0\xe2\x60\xd2\x19\
\x59\x60\x2e\xd7\x96\x25\xc1\xe6\xff\x46\x38\xc4\xef\xaa\x37\x9c\
\x55\xde\x4a\x0a\xd7\xfd\xbc\xdc\xc7\xa2\xd6\x5e\xd2\xe9\x80\xb2\
\x70\x07\x34\xdc\x3c\x57\xc3\x2c\x6f\xcb\x04\x77\x25\x56\x23\x42\
\x62\x7e\x6a\xb0\xd8\xe5\x87\x4f\x7b\x48\x04\x66\x1c\x56\x33\xf7\
\x57\xb4\x8f\x5d\xb5\x75\x6c\x42\x96\x23\x0e\xf1\x74\x83\x7b\xe7\
\x31\xd1\x0c\x58\xdd\x04\x49\x28\x79\xad\xb0\xda\x99\xd2\x8f\xbb\
\x9b\x18\x8e\x6e\x62\x56\x27\x5a\xaa\xfb\xfd\xf9\x52\x6f\xdd\x5e\
\xe9\x29\x66\xb8\xae\x96\x24\xec\x35\x1e\xa5\xb7\x13\xa3\x0b\xad\
\x09\x99\x3a\xc1\xb7\x07\x3c\xae\x95\xb9\x2b\xf7\xde\x89\xa3\x24\
\x2e\xc3\xbb\x34\xae\x2a\xf5\x0e\x0c\x4e\x66\xf0\x10\xd0\xc6\x52\
\xcd\x97\x8a\x2b\xd8\xda\x11\xe8\xfc\x49\x27\x7d\x36\x1a\x8b\x25\
\xc1\x58\x69\x64\x7f\xe8\xae\xd8\x41\xa6\x50\x3c\xe3\x92\x25\xa4\
\x8b\x7e\xad\x1c\x65\x5f\x69\xd4\xdd\x8d\x4e\x61\x91\xd2\x33\x86\
\xc5\x0a\x1c\x0f\x90\x72\x2b\x47\x74\x22\xf3\xc0\xd8\x17\x73\x80\
\x25\xc4\x19\x85\x9b\xe5\xcf\xde\xbe\x98\x65\x88\x70\xc6\x24\x94\
\xa9\x84\x72\x81\xa3\x65\x53\xca\x65\x7a\x31\x26\x0a\x83\x9c\x0a\
\x24\x7f\xe2\x08\x8d\xd0\xd5\x80\x3f\x96\xea\x14\x6a\x8a\x58\x45\
\x51\x57\xfb\x29\x6a\xc1\x99\xed\x51\xa5\xd6\xd1\xb7\x03\xcd\x26\
\x5a\x11\xb5\x5c\xbb\xa3\x98\x32\x7a\x35\xb7\xbc\x57\xaf\xe1\x7a\
\xdc\xce\xd7\x21\x46\x11\x4c\xed\x62\xbc\x82\x57\x23\xd2\x5a\xb3\
\x78\x05\xeb\x08\xaf\xc7\x68\xa9\x39\xc5\x67\x92\x63\x68\x98\xd8\
\x1a\xb4\x4d\x69\xbc\x38\x09\x9e\xae\x54\xab\xf1\x06\xd3\x2f\x23\
\x52\x4f\x6c\x9f\xdf\x1f\x16\x67\x9e\xf6\x0e\x42\x84\x46\x1c\x46\
\xad\x7d\xa3\xb4\x39\xe8\x01\x06\x40\x6c\xe3\x24\xed\x08\x49\x8b\
\xae\x79\x61\x13\x4a\x7e\x2d\x37\xd1\x92\x79\x9e\x15\x4f\x53\x9a\
\xc2\x81\x2a\xed\x04\xac\x38\x09\x18\x42\xd1\xc5\x46\xc5\x2f\x95\
\xb9\x63\x8c\x42\xbb\x6a\xa2\x88\x5b\xa6\xa5\xa0\x83\x9e\x38\xa4\
\xae\x35\xb1\x9b\x0b\x18\xeb\x4e\xc5\x92\x8a\x03\x64\x75\x80\xbc\
\x30\x20\xa9\x9e\x5a\xf3\x5c\x65\xa2\xa6\x85\xee\x14\x80\x3f\x3c\
\x03\x87\x91\x66\x68\x14\x14\x89\x34\xc4\x6a\xc9\x8e\x02\xcb\xac\
\x66\x9d\x41\xad\x87\xc4\xee\xe7\xfc\xfa\xce\x96\xd7\x03\x33\x96\
\xb9\xbc\xba\xed\xf6\x0b\xe5\x5a\x0b\x77\xcc\xf5\x96\xe7\x86\xb6\
\xd0\x48\xc2\x2c\xc3\x08\x89\x62\xc2\xb7\x38\x8f\x1c\x5d\xec\xce\
\xec\x49\x5e\xd0\x54\xcb\x5e\xf1\x7e\xea\xc1\x92\x49\x96\x17\x66\
\x8b\x1e\x4e\x6f\xbf\x20\xe9\x7c\x1a\x4b\x05\x06\x1d\x55\x1a\x24\
\x61\xdd\x16\xca\x4d\xa7\xcd\x69\x43\x5b\x68\xe4\xcb\x5f\xcf\xd3\
\x01\xef\x17\x69\xeb\x28\xaf\x11\x5f\x6c\xd4\x3e\xa5\x21\x99\x49\
\x11\x4d\x21\x1f\x3c\x23\x14\x7d\x71\xee\x2e\x70\x66\x36\x29\x87\
\x8a\xdb\xdc\xbc\xe4\xee\xc6\xe8\xa0\xab\x31\xe2\x95\xf9\xca\xc6\
\x34\xe5\x35\x13\xfc\x79\x2d\x75\x19\x54\x0e\xc8\x2c\xb8\xe5\x13\
\xdc\xc4\xf3\x82\x52\xd2\x5f\xc4\x7d\x23\x6a\xcf\x06\x6e\xcb\xa8\
\x8d\x0e\xe9\xed\x8b\x4a\x95\x3d\x73\xef\x4b\xf9\x62\x52\xbd\x80\
\xba\x49\x85\x23\x6a\xa7\x89\xfa\xf5\x2b\x3e\x30\x67\x46\xa0\xc6\
\x02\x2b\x29\xa2\x63\x7c\xfa\x2a\x66\xe1\xfe\x35\x45\xa8\x59\xe5\
\x7d\x1b\xa9\xbc\x84\xb9\x08\x07\xf2\x51\xe4\xc2\xd0\xad\x62\x1e\
\xbd\x05\xa1\xdb\xdd\xf1\xd5\xf2\xf6\x36\x37\x5b\x9c\x44\xf6\x70\
\x42\xb7\x1e\x9a\xfc\x80\x8f\xb8\xaf\x08\xa9\x26\x83\xea\x91\x34\
\x5a\x87\x80\xc3\x2a\x1f\xa0\x02\xbc\x6d\x53\xa9\xd7\x11\x1a\x09\
\x8d\x18\xaa\x87\xec\x21\x91\x4d\x78\x02\x87\x3a\xb8\xa5\x30\xbd\
\x3b\x3d\x9d\x86\x73\x12\x65\xf2\x00\x1d\x08\xb6\x19\x7d\x74\x8f\
\x36\x88\x88\x98\x51\x90\x94\x55\x02\xa4\x30\xa0\x45\xe4\x9e\xf3\
\xb1\xb0\xe8\x09\xbc\xe9\x10\x1b\x90\x4f\x90\xd7\x5a\x09\x8f\x2a\
\x67\x6a\x12\xb4\xe7\x90\x9e\xd2\x8c\x1c\x48\xd9\x69\xd6\x02\xdc\
\x1d\xf5\xd2\xe6\x00\xea\x20\x24\x55\x79\xd3\xea\x44\xd5\x99\x41\
\xb0\x40\x34\xaf\x5b\xdc\x3b\x6d\xcd\x99\xef\xd1\x07\x25\x72\x20\
\xc9\xc9\x9c\x82\x3e\x69\xd4\xc0\x95\x5e\xa2\x56\x27\x56\x27\xf8\
\x49\x2d\x3b\xdd\x3d\x21\x74\xf3\x47\xbd\x9e\xec\x9d\x43\xd4\xc3\
\x4d\xf1\x64\x39\x65\x87\xa0\xd3\xb1\x1a\x74\x67\x71\x03\xe9\x05\
\x2f\xe0\xc3\xe1\x07\xd5\xd8\x46\xe7\x05\xe3\xe5\xa8\xc0\x2b\x01\
\x8d\x5a\x4c\xb0\x2f\x26\x59\xbe\x11\x56\x9c\xc7\x0a\x48\x14\x52\
\xa7\x0b\xbe\x2a\xe2\x32\xc7\xba\xda\x13\xc1\x7b\x35\x42\x40\x88\
\x41\x69\x0e\x1c\x6d\xad\x4f\x4f\xd5\x27\x05\xae\x1b\xde\x52\x5e\
\x81\x83\xa5\xd2\x6a\x86\xc7\x53\x24\xc1\x59\xf5\x1a\xa4\x73\xe5\
\x58\x0e\xff\x58\x5e\xde\xab\x98\x0a\x79\xb5\x88\xf0\x7d\xe1\x1e\
\xf3\x7f\xad\xc2\x6a\x01\xab\x1e\xa0\x56\x72\xbf\x09\x6d\x43\x8c\
\x31\xea\x90\x76\xe3\x1c\xab\x4d\x83\xef\x2c\xad\xc9\xe9\x26\xe5\
\x5d\x04\x20\x29\xb8\xbc\x69\x53\xca\x28\x4a\xdd\x28\xfe\x6e\x41\
\xbc\xee\x60\xa7\x10\x8e\x22\xdd\x85\xee\x7e\x35\x20\x8a\x8d\xcc\
\x16\x39\x20\x2d\x41\x47\x91\xfb\x83\x0c\xee\xe3\xd1\x9a\x9b\xde\
\xa9\x8e\xf4\xbb\xe1\xbe\x68\x04\x74\xd9\x80\x8e\x9b\x9f\xa3\x7d\
\x69\x76\x6b\x43\xd1\x37\xea\xfc\x17\xe1\x4e\x8a\x4a\xf9\xfb\x11\
\x98\x47\x2f\xaf\x50\xb7\xd1\x0f\x2d\x4f\x56\xf7\xf3\x74\x16\xdc\
\xbb\xab\xe8\x91\x46\xa5\x0a\xd7\x32\x34\x4c\x36\xc9\xd0\x6e\x51\
\xb0\x09\x1f\x8d\xbd\x96\xe0\x2e\x42\x41\x5e\xc4\xd9\xe1\xa0\xcc\
\x3b\x34\xb8\x4a\x5e\x6c\xc7\xdd\xc4\x1c\xe1\xae\x3f\x59\x9d\xb2\
\x63\xb8\x0a\xe7\x3e\x35\x1c\x9f\x97\x2a\x7d\x2f\x50\x54\x94\x38\
\x75\xe7\x8b\x93\xad\x19\xeb\x15\xfa\x91\x39\x26\x7a\x08\x31\xdc\
\xde\xcf\xda\xd9\xab\x0d\xe9\x91\xb6\xbc\x7b\x9d\x28\x99\x0c\x4b\
\xa7\x98\x55\xb1\x31\x58\xc8\x82\xbe\xc3\xe2\xd2\xb0\x63\xe6\xb2\
\xf3\xb5\xb4\xd2\xd8\xaf\xae\x38\x8d\x88\xfc\x3b\xa7\x56\x2c\xc5\
\x99\x5d\x49\xa7\xe7\x51\xb6\x3c\x6b\x5e\xfc\x58\xfe\x2b\x7e\x96\
\x2d\xd4\x9a\xce\xba\x16\x9c\xce\xbc\x16\x9b\x3e\xdb\x72\xcc\xa9\
\xcf\x69\x18\x06\x90\x0a\xca\x0e\x52\xbf\x92\x2e\x84\x02\x15\x2f\
\x6f\xe7\x97\x49\x06\xb6\x03\x18\x0f\xc9\xfd\xdf\xe0\x94\xd6\x6c\
\x8e\x43\x4e\x69\xa1\x2b\x79\x29\x8d\x58\x4d\x19\x9e\x34\x52\x61\
\x65\xfb\x46\x81\x50\x1c\xeb\xef\x11\x44\x7e\xa5\x0d\x46\x99\xc3\
\x3e\x2b\xc1\xd3\x04\x49\xa5\xdf\x2a\xf8\x5d\x07\xfe\x0d\x5d\xd2\
\x45\xad\x89\xdf\x08\x47\x0a\xcc\xab\x33\xc7\x4b\x68\xc4\x02\x48\
\x28\xef\xe6\x2b\x12\xf2\x7b\xac\x0b\x67\xbd\xa2\x07\x73\xec\x9c\
\x6d\x38\x1b\x4c\xad\x12\xb0\x45\xca\xa4\x6a\x06\xf4\x7a\x8b\xf3\
\x49\x39\xb1\xb0\xc6\x31\xef\x69\x01\xd1\x88\x83\xd4\x19\xf6\x0b\
\x9d\x5a\xc3\x77\x26\x3d\x8e\xae\xd9\xeb\xb7\xbf\x5a\xcb\xdf\x04\
\x74\x0e\x95\xe8\xba\x09\x73\x53\x6e\x70\xc0\xc1\xa4\x60\x07\xe3\
\x3b\x09\x44\x63\xa7\x35\x9d\x71\x4f\xdc\xa1\x25\xff\x75\x32\x79\
\xf3\x7e\xc5\xa5\x3d\xac\x43\x9a\x58\xec\x68\xd8\x37\x97\x95\x87\
\x18\x22\x8d\xdc\xf4\x03\xf2\x5c\xed\x34\x9f\xc3\x01\x65\xba\x82\
\x77\x1a\x22\x2a\xdc\x1f\xd6\xc7\xfa\x39\x74\x58\x7a\xac\xff\xe4\
\x52\x45\x23\x58\xac\x2b\x07\x52\xa3\x89\xc5\xf3\xdf\xac\x2f\xdc\
\x5b\x5e\xa0\xae\x87\x48\xa3\x8c\xc3\xd3\x18\xd6\x8d\x9a\x49\x5a\
\xae\x8f\xf1\xcc\xf1\x7e\x71\x87\x8e\x49\x4c\xee\x24\x61\xc5\xf4\
\xc1\xf9\x10\x42\x23\x77\x40\xa2\x68\x62\xc5\x93\x4e\x4a\xe7\xd8\
\xcf\x2b\xad\xe2\x60\x7c\xba\xd4\x4b\x9c\xe4\xe0\x27\x82\xb8\x68\
\x61\xb0\x8a\x53\x3a\x5e\x05\x7a\x18\xdc\x5e\x0e\xab\xc5\xfc\x7a\
\x69\x13\xe3\x58\x8e\x23\xca\x1e\x86\xde\x42\x93\xb4\x5a\x9d\x84\
\x7d\x4e\x14\x24\x65\xec\x78\xa1\xae\xd4\x31\xa4\x3b\x7c\x98\x42\
\xc9\xc5\x10\x50\xf5\x4b\xe4\xa2\x15\xa9\xd3\xc0\x88\xc3\x81\x72\
\x67\x8b\xe4\x75\x8a\x97\x94\x53\x43\xed\x0f\x81\x2e\x18\x22\xdd\
\x7c\xc4\x2d\x48\xc3\xc4\xe9\x33\xa3\x11\xe7\xa5\xa1\xbc\x96\x6b\
\x95\x71\xca\x2e\x52\xde\x49\x9b\xae\x22\xfa\xba\x8e\x06\x8e\x97\
\xfb\x69\x12\xd3\x62\x5d\x11\x90\x22\x83\x90\xd9\x61\x24\xac\xb9\
\x67\xf0\xdd\x96\x1c\x5f\x28\x03\x51\x7a\x2d\x83\x74\xae\x8a\x60\
\xa9\x0a\x97\xec\x82\x9d\x95\x18\x0e\xd6\x66\x2d\x3a\x1a\xd9\x02\
\x49\x6a\xd3\x39\x9b\xf6\x58\xde\xae\xd9\xa1\x23\xdc\x85\x3b\xc9\
\x98\x80\x6b\x28\xb5\x1c\x26\xe9\x7c\x0e\x24\x60\x61\xe5\x58\xde\
\x03\xd1\x03\x52\xf4\x7e\x31\xdb\x17\x04\x2e\xe5\x81\x0a\xd0\x25\
\x7c\xd5\x51\x6b\xa4\x80\xf1\x04\x87\x99\x8f\x6e\xc2\x9a\xdf\xab\
\xc0\x59\x09\x65\xf5\x52\x82\x24\x5d\x6c\xb8\x2f\x85\xce\x11\x48\
\x36\x4b\x49\xfc\xd7\x16\xf8\xbf\x14\x62\xba\x7e\xdd\x50\xc9\xe5\
\x11\x70\xe0\x30\x85\xb2\x8d\xd1\xe8\x37\xa2\x0c\xca\xa1\x80\x39\
\x5c\x26\x49\x88\xa6\x5c\xed\x25\xd7\x71\x07\x29\xdc\x10\xaa\xb4\
\xf2\x34\x2b\xbd\xcc\x6c\x8c\xd9\x1e\xac\x8d\xaf\x64\xb2\xf1\xdb\
\x49\x35\x46\xfc\x4d\x49\x33\x99\x1c\xd5\xc5\x11\x0e\x21\x85\xda\
\x31\xd1\x88\xf3\xea\x48\xdd\xc1\x04\xf0\x48\x29\xea\xf2\x9d\x3c\
\xb5\x59\xab\x49\x05\x29\xdb\xbd\x3b\x65\x06\x63\x54\x7a\x7d\x84\
\xc3\x06\x40\x1c\x9b\x10\xd1\x04\x40\xd1\x9f\x18\x0c\x85\x46\x8a\
\x22\x97\x1d\x7f\x4a\xc5\x11\xd2\xa1\xc4\x2b\xf6\x46\x53\x2b\xb7\
\xb4\x59\x3d\xba\xb0\xd6\x1c\xd0\x0d\x87\xd0\x4b\x04\xcb\x95\xe1\
\xbf\x73\x5c\x54\x31\x56\xeb\x56\x3c\x43\x3c\x18\x17\xd6\x84\x3f\
\xca\x59\xe9\xe5\x50\xdd\xb1\x1e\x43\x1a\x19\x17\xc9\x6d\x7c\x31\
\xf4\x41\x71\x50\xb2\x33\x2c\x42\x53\x2b\x2a\x43\x85\xc1\x5d\xa5\
\xb0\xa7\x91\xe7\x3d\xa4\xfe\x7d\x6f\x97\x55\x17\x9d\xc5\x52\x28\
\x34\xb2\xd1\xe6\xaa\x91\x2c\xa6\xa3\x25\xee\x2d\x11\x9d\xf5\x14\
\x26\x31\x67\x92\x1b\x8d\xe2\xa3\x2d\x75\x9b\xd7\x73\xa3\xca\x66\
\x94\xc2\x3a\x76\x61\x79\x61\x9e\x28\x80\x88\x8f\x46\x2e\x83\x63\
\x6e\x1a\x6e\x60\x3b\xec\xad\x27\x30\x75\x32\x43\xab\x4a\x54\x9d\
\xa4\xbf\xcc\x12\xdf\xbc\x1e\xd5\xf0\x1b\xea\xa5\xbd\x50\x5c\x72\
\xd1\x57\x37\x99\x51\x0a\x9d\x46\xcd\xdb\x36\xba\xf7\x13\x5b\x1a\
\xe3\x60\xad\xc9\x71\xf2\x31\x60\x14\xc8\x39\x24\xf2\xb0\x6a\x9d\
\x22\x77\xaf\x58\x3a\xba\x38\xc9\x99\x01\x8c\x7e\xeb\xc8\x36\x42\
\x0a\xce\x13\xe7\x99\x6d\x33\xb3\x55\x74\x61\x93\x8b\xaa\xaf\x3d\
\xb4\x9f\x2f\xb6\x20\xde\x4b\x63\x30\x0c\x3d\xa3\xa1\x11\x62\x48\
\x97\xf9\x84\xc6\x7c\x04\x32\x89\xda\xca\x63\x9d\x6a\x09\xeb\x0a\
\x7c\x1d\xa2\xb2\x44\xb7\x85\xfd\x4e\x5d\x83\x45\xbf\x52\x4d\xd5\
\x0d\xf9\xcb\xb3\xdc\x87\xb3\xa6\x87\x98\x76\xcf\xf2\x39\x54\x15\
\x51\xe9\xdd\x61\xb8\xed\x70\x50\x44\xd5\xe3\xfa\x15\x5d\x57\x63\
\x51\x2d\x14\x2b\x1f\x5c\x42\x16\x50\x84\x44\x7d\xd5\xdc\x8b\x67\
\x5a\xbc\xe8\x67\x5c\xd3\x81\xba\x44\x34\x93\x5c\x38\x2a\xea\x94\
\xf0\x05\xb5\x9c\x95\x22\xb7\x95\xa5\x6e\x5f\xdc\x81\x51\x1e\x2a\
\x9a\x3d\x63\x33\x9c\x68\x2d\x87\x32\xf1\xff\xb8\x51\x93\xda\x2d\
\xab\xe9\xf6\x4e\xe3\x0f\xb5\x52\x36\x2b\x5f\xf3\x1f\xea\x40\xaa\
\xff\x8f\x33\x53\xab\x1b\x51\xb1\x35\xd6\x19\x25\x8e\x3a\x23\xcc\
\xe8\xd1\xa2\x9c\x9c\xed\x51\x88\xee\x02\x51\xc7\x02\x87\x0c\x92\
\x21\xd0\xe5\xb8\x54\x70\x7b\xaf\xce\x6d\xaa\xb3\x95\x3c\xdb\x6a\
\x7f\x1d\xb5\xf8\x09\xac\x56\xea\x9a\x07\xa8\xa4\xb0\x7d\x27\xaf\
\x61\x62\x1e\xbe\xbb\xbc\x5c\x01\xa7\x51\x1c\x27\xa1\x8d\xfb\xd6\
\xef\xa2\x65\xc4\xb6\x34\x00\x20\xe1\x76\x9f\xe3\xe3\x7f\xed\x9b\
\xea\x66\xaa\xcc\x7d\x97\x28\x8d\xe4\x45\x10\x55\x11\x45\xd3\x58\
\xd1\xc8\x7b\xcf\x43\xcb\x30\xa6\x1a\x35\xef\x8d\xbd\xc3\x82\x89\
\x6c\x56\xc9\xc5\x4d\x78\x14\x6e\x2e\xff\x7a\x58\xf3\xbf\x60\x90\
\x9a\x0f\xa5\xb0\x3a\x8c\x1e\x87\x05\x07\xae\x78\x40\x48\x4c\xb7\
\x1c\xe4\xa5\x1b\x29\x36\x96\x3c\xd2\x88\xf3\x62\x9d\x16\x03\xb0\
\x6a\x51\x7a\x19\x26\xce\x34\x22\x75\xf7\xeb\xca\x79\x89\x78\xa2\
\x90\xa8\xb2\x7e\xa5\x9b\x1e\xc8\x4c\x0d\x9e\x59\x93\xa2\xca\xfd\
\x8f\xb2\xd3\xee\x5e\x87\x19\x55\xa4\xa4\x5c\x02\x05\xfe\x4a\xd0\
\x05\x91\x43\xaf\x73\x56\xb7\x81\xa1\xd9\xa1\x3b\xf4\x2e\x13\x1a\
\x39\xeb\x81\x16\x2c\xc9\x9d\x4a\x4b\xe7\xd1\x17\x8d\xb8\x19\x5c\
\x03\x9b\x00\xb4\x4b\x22\x51\x01\x09\x97\x46\x56\xa5\x77\x12\x64\
\xcf\x34\x26\xa1\x5e\xce\xc6\x5c\x4f\xe0\xbd\x5e\x87\xb5\x99\x6c\
\xd0\x45\x2e\xee\x51\xb0\x74\xfc\xb5\xfc\x9b\x7e\x55\xa7\xa6\x51\
\xa0\x41\x52\x04\x24\xae\x15\x0c\x3c\xe2\x86\x8d\xe5\x49\x59\xa1\
\x11\x07\x73\x26\xa2\x65\x1a\x4a\x15\xde\xfd\xae\x67\x1c\x0b\xaa\
\xa2\xea\x11\xc7\x85\x35\xe3\x21\x77\x37\x8b\x12\xff\x6d\x10\x11\
\x41\xb7\x11\x6e\xae\xf4\x85\xd2\x45\x58\xfd\x50\xfa\x9c\x28\x4f\
\xaf\x39\x6e\x18\xdd\xcf\xd5\xcc\x4c\xbc\xee\xa0\x1a\x2b\x81\xf0\
\x26\xa6\xbe\x8a\xec\x7c\x1d\x56\xa8\x54\x59\x37\x3c\xc4\x7b\x87\
\x0c\xdb\x1c\x93\x82\xd5\x39\x5b\x34\xa1\x91\x48\x04\x13\x9b\x95\
\x1a\x97\xee\x8e\x94\x9f\xda\x27\x38\xf5\x8b\x7e\x68\x5e\xce\x35\
\x04\x0f\x24\x07\x07\xb4\xb0\xae\x1c\x89\x88\x04\x11\x1e\x05\xa1\
\xc6\x26\x75\xbc\xc8\xae\x03\x87\x12\x24\xf1\x19\xd6\xc8\xd0\x5b\
\x77\x39\x67\xe0\x4c\x12\x1a\x45\x18\x7f\x54\xaf\x14\x2c\x5b\x35\
\x46\x29\x60\x88\xb5\x19\x43\x52\x70\x2f\x21\xc9\x7f\xd1\x78\x2c\
\x13\x26\xc5\x17\x08\xd6\x64\x1a\x8b\x08\x6c\x54\x95\x2e\xaf\x18\
\xd3\xa8\xfd\x5a\x74\x40\x9d\x86\x75\x7e\x24\xb3\xf4\x41\x05\x35\
\x96\xe8\xd7\x6b\xee\xd5\x42\x68\x24\x34\x62\xe5\xec\x8b\x5f\x65\
\x63\x80\x0c\x0c\x93\xe3\x2a\x36\xca\x79\xc5\x10\xf1\x9f\x8c\xa5\
\x6e\xd0\x0b\x58\x61\xaf\xd0\xa8\x52\x1e\x77\xcb\xc7\xe2\x5e\xc1\
\xab\x94\x26\x6b\xad\x5f\xb9\xac\xdc\xe1\xe0\x9e\x22\xab\xfd\xa4\
\x0a\x01\x09\x5e\x77\x40\xe6\xb0\x48\xd0\x91\x8d\x2f\x57\x37\x68\
\xfd\x37\xb3\x09\x5a\x19\x5e\x98\x24\xbf\xe0\x10\x9a\x44\xbc\xbc\
\x5c\x83\xbc\x3c\xfa\xfb\xb7\xac\xe7\xca\xf5\x40\x91\x98\x66\xb8\
\x59\xb8\x10\xfa\x8d\x25\x48\xe3\x6d\xd6\xf7\x38\xec\xd9\x08\x8d\
\xa8\x5b\x52\x37\xfb\x31\x94\x20\x49\x20\x24\x12\x61\xe4\x67\xb7\
\x78\x15\xf4\x12\x90\x56\x96\x39\x8a\x6a\x46\xe2\x39\x45\x18\x21\
\x01\x1d\x01\x78\xaa\x2e\x11\x11\x11\xf8\x14\x33\xf0\xc4\xe3\xf3\
\x9a\x7d\x85\x23\xfd\xbf\xab\x5b\xa4\x51\x68\x44\x15\x21\xf1\x2c\
\x53\x24\x3b\x87\xf1\xb9\x75\x51\x5e\x2d\x44\xf4\xfa\xe1\x1b\x27\
\x6e\x66\x07\xfc\x12\x21\xa4\x3d\xc5\x1f\x28\x38\xd1\x17\xeb\xb6\
\x90\x48\x06\x90\x0c\xfc\xb2\xe2\x3c\xdc\x06\xb3\x4b\x04\x77\xa6\
\x71\xe8\xf3\x4c\x5b\xa6\x5d\x5b\x9a\x7f\xca\x03\x82\x35\x28\xc8\
\xc4\x09\x25\xe3\x17\x10\x69\x4c\x02\x0e\x6e\x4e\x70\x45\xa8\x59\
\xb7\x7c\x61\xdd\x13\x9f\x66\x63\x2c\x24\xf3\x12\x98\x22\xfe\x68\
\x66\xc1\xd9\xaa\x29\x40\xdc\x36\x05\x3e\x46\x40\x2f\x56\xc6\x82\
\x7f\x6b\xd1\xb1\x5d\x0f\xfd\x05\x44\xf2\x54\xd6\x51\xed\xd1\x54\
\x63\x88\xcd\xb2\x5e\x06\xa1\x30\xa5\x8d\x8c\x12\xc6\x88\x6d\x2b\
\xe8\x1f\x5f\x3d\xd0\xac\xc9\x72\x07\xd6\x75\x84\xe4\x86\x31\x42\
\x23\x37\xca\x4a\xdd\xcf\xc6\xe6\x83\x5b\x26\x66\x9c\x02\xa3\x34\
\x34\xe2\x9b\x0a\x2f\xc1\xec\x6a\xf7\x5b\x8c\xf0\xe1\xa8\x78\x7e\
\xa0\x20\x81\x14\x99\xab\x1b\x41\x08\x4f\xd7\xcf\x58\xe6\x1b\xfe\
\x9c\x08\x74\x26\x1a\x1a\x61\x71\xa8\x20\xf2\xc0\x7a\x6b\xf7\xd9\
\x89\x84\x46\xc8\x40\x32\x76\x5d\xf3\xf6\x0c\x88\x54\x4d\x38\xe4\
\xde\x90\x51\xdc\x8c\x86\x3c\x36\x82\xc5\x3a\xfe\x34\xa2\x5b\x45\
\x2f\x3e\xda\x4e\xf7\xb2\x71\xd0\xa8\x9a\x52\x27\x9d\xa8\x71\xa4\
\x45\x09\xc8\x51\xc2\xed\x67\x6a\x07\xad\xd8\x07\x0a\x9d\x46\x41\
\x6c\x1a\xd1\x15\x53\x60\x1b\xc4\x87\x12\x76\x04\xd4\x4e\xc4\xd1\
\xac\xfb\x9d\xb4\xdc\x7c\xba\xa0\x35\x92\x62\xb9\xc3\x81\x6e\x44\
\xb9\x5d\xec\xe6\xa5\x10\x8b\x12\x85\x68\x07\x4a\xdf\x48\x16\xeb\
\xc2\x8e\x90\x0c\xac\x83\xfb\x1b\x12\x0d\x9f\x2e\xca\xd8\xcb\xa3\
\x5b\xed\x66\x7b\x1f\xc8\xa4\xa0\xc3\xa3\x80\x68\x44\xbd\x58\x47\
\x11\xb2\x67\x3e\x33\x26\x0b\x5e\xe5\x8b\xba\x75\xbf\x9d\x8e\x68\
\x46\x43\x4f\x96\xec\xcb\xf7\xe4\xa0\xfd\x2d\x5b\x4a\x42\x23\x9e\
\xae\x83\x97\x87\x1b\x07\x3d\x81\x1a\x84\x8a\xa7\x8d\xa8\xfb\xed\
\x74\x44\x1b\x14\x22\x99\x3c\x5a\x16\x86\x7a\xdf\x1f\x2a\x39\x1b\
\x3e\x9b\x1e\x60\x4e\xa3\xd0\xd7\xb4\xe9\x0e\x82\x4b\x96\x20\x86\
\xc1\xba\x67\x20\xe5\x25\x39\x46\x27\x13\x5b\x38\x39\x4e\x9e\x16\
\xd0\x84\x94\xd8\x08\x37\x5b\x76\x34\x91\x81\xee\xcb\x4a\x78\x14\
\xe8\x54\xad\x67\x7a\xa9\x1e\xad\x21\x6e\xa0\xc3\x27\x6c\xa2\x50\
\x35\x86\x65\x3a\xa3\x17\x26\x34\x8a\xcc\x1c\xdb\xd3\xc8\xfb\xe9\
\x18\x26\x9b\xb8\xa1\x3b\x8b\x75\x26\x3a\x07\x64\x89\xf1\x98\xf9\
\x22\x93\x5f\x25\x13\x0e\x85\x42\x23\x8a\xcb\x4c\x11\x74\x6c\x15\
\xa2\x22\x9e\x43\xec\xab\x33\xeb\xce\x9a\x62\xec\xc2\x10\x55\xc4\
\x70\xd3\xe9\x96\x49\x45\xc3\x52\xee\xb8\x77\xef\x7c\xd1\x28\x3e\
\xe3\xcb\xd6\xce\xfa\x9a\x38\x7c\x0e\x16\x79\x17\xff\xa9\x83\x38\
\x5c\x43\xa1\x1e\x8c\x96\xe7\x23\x16\x31\xe3\x90\xfc\x51\x62\x23\
\x97\x86\x40\x50\x44\x3a\xca\xd5\x99\x47\x3c\x15\xa9\x1e\x7a\xbf\
\xa0\x28\x90\xe3\x05\xbd\xf6\x5f\xb1\x5f\x8a\x14\x09\x8e\x46\x92\
\x92\x58\xc4\xe5\x14\x0e\x42\x8b\xea\xa1\x0f\x27\xee\x15\x1c\x5f\
\x27\xf4\x88\x42\x28\x11\x7b\x13\x40\xb7\x82\x2d\x22\x42\x3a\xd3\
\x43\xd4\xb1\xba\xaa\x70\x8d\xa2\x50\xd2\xfb\x57\x8a\x4f\x7c\xb4\
\x91\x68\xbf\x41\x50\x24\xc1\x0a\xd1\xcf\x45\xa0\x5a\x75\x6e\x56\
\x40\x04\xa2\x67\x3c\xaf\xb5\x62\x4d\x51\x0e\xda\x28\x34\x12\xd8\
\xf0\x6f\x4f\x7c\xea\x54\x77\xd3\xb9\x32\x0f\x25\x84\x0a\x28\x4e\
\xa2\xf8\x69\x99\x02\x22\xa2\x45\x8e\x80\x24\x22\x7c\x42\x77\x6b\
\x88\xb2\x7f\xda\x3b\x4f\xb1\x56\x61\x97\xf0\x88\x61\x7b\xaa\xa6\
\x39\x75\x37\x9d\x2b\x4b\x82\xc2\x27\x33\x2d\x72\xac\x39\xe8\x34\
\x12\xb5\x17\xd1\x52\xa1\x8a\x2b\x4c\xdd\xd9\xcc\x17\x26\xf1\x09\
\xf3\xc3\x72\x18\x9d\x69\x0e\xee\xaf\x18\x3f\x8d\xb4\x30\x84\x08\
\x37\x55\x97\x81\x46\x8e\x90\x44\x24\x84\xa2\x9e\x54\x0e\x98\x04\
\x79\x3e\xdd\x5e\xa9\x1c\xf4\xaf\x0e\x8d\x84\x40\x84\x40\xd2\x9a\
\x48\x12\x24\x55\x84\x4f\x14\x2a\x84\x32\x99\xf3\x7e\xcb\x92\x46\
\x14\x15\x40\x64\xb2\x38\x56\x30\x07\x3e\x93\x0c\x28\x08\x48\x8d\
\x7c\x6b\x0e\xe6\x80\x4c\xb3\xe0\xf8\xa4\x38\x95\xfa\x46\xd7\x1f\
\xe3\xa7\x49\x30\x24\x22\x42\x18\x21\x09\x27\x44\x1c\x87\x50\xc6\
\xc9\x76\xb1\x74\x55\xb7\x7e\x87\x40\x48\x44\xe2\x1e\x47\x40\x0a\
\xd1\xa0\x88\x84\xcb\x27\x1b\x1b\x6d\xa6\x42\x36\x05\xee\x1c\xa3\
\x48\x26\x88\x10\x48\x80\x24\x22\x12\xcc\xfc\xb4\x0c\x59\xdc\xb4\
\x39\xee\xaa\x7a\x41\x88\x24\x44\x10\x20\x49\x90\x24\xe2\xc2\x4c\
\x18\x2b\x92\x03\xdd\x03\xbe\xa0\xcc\x02\xf1\xb1\x44\x70\x80\x64\
\x69\x53\x84\x49\x42\x23\x2f\x4c\xe2\x40\x23\xd1\x7c\x21\x90\x08\
\xa3\x08\x49\x44\x26\xbf\x63\xe7\xc6\xd9\xb1\x02\x9b\x93\xe5\x22\
\xce\x3c\x03\x19\x0e\x01\x92\x04\x49\x22\x20\xeb\x60\x00\x0f\x0e\
\x57\x0e\xe5\x12\xbe\xc4\x40\x22\xde\x80\xd4\xb8\xbd\x24\x4c\x12\
\x61\xc2\x27\x8f\xea\xe4\xb8\xe8\xb0\x88\x40\x48\x80\x44\x85\x25\
\x91\x68\x84\xc2\x2e\x6b\xf1\x29\x8f\x49\x49\x42\x55\x6c\x49\xf2\
\xc1\x88\x88\x70\x01\x92\x3d\x96\x24\x48\x12\xcf\xd4\xf2\xe1\xed\
\x75\x2b\x8a\x99\x24\x6e\xb8\x88\x48\xcc\x40\xb2\xc4\x92\x30\x49\
\x68\xe4\x26\x84\x12\x35\x13\x11\xe1\x2c\x35\x0a\xeb\x20\xd3\x5e\
\x68\x54\xf1\x36\x88\x88\x88\xb0\x00\x52\x33\x96\x74\x73\x85\x89\
\x88\x88\x88\x88\x08\x90\x08\xdd\x55\x20\x96\x84\x49\x22\x22\x22\
\x22\x02\x24\x72\x91\x75\x3c\x11\x11\x11\x11\x11\x16\x40\x02\x62\
\x49\x82\x24\x11\x11\x11\x11\x01\x12\x23\x2c\x89\x88\x88\x88\x88\
\x08\x90\x5c\x63\xc9\x65\x71\x52\x11\x11\x11\x11\x11\x01\x92\x5e\
\xc0\x24\x4c\x12\x11\x11\x11\x11\x20\x31\xc2\x92\x88\x88\x88\x88\
\x88\x00\xc9\x3f\x96\x24\x48\x12\x11\x11\x11\x11\x20\x71\xc1\x92\
\x30\x49\x44\x44\x44\x44\x80\xc4\x05\x4b\x22\x22\x22\x22\x22\x02\
\x24\x11\x11\x11\x11\x11\x11\xa7\xf2\xff\x01\xcd\xc5\x0c\xbb\xd2\
\x75\xc9\x2b\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x0d\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x45\x00\x00\x00\x45\x08\x06\x00\x00\x00\x1c\x8d\x2b\x29\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0c\x09\x02\x02\x23\x49\x59\xc0\x44\x00\x00\x01\x9a\x49\x44\
\x41\x54\x78\xda\xed\xdc\xcf\x2a\x44\x61\x18\xc7\xf1\xef\x73\xe6\
\xcc\x69\x06\x33\x46\xe6\x0f\x4a\xfe\x2c\x34\x4c\x94\x52\xae\xc0\
\x15\xc8\xc2\xc6\xd6\xce\x0d\x58\xb9\x02\x0b\x1b\x45\x49\xb8\x0e\
\x0b\x29\x0b\x5b\x16\xa4\x94\x18\x2c\x8c\xa2\xc8\x9f\xc6\xc6\x3b\
\x66\x32\x0b\x5b\xf3\xfe\x7e\xab\xe7\x3d\x9d\xb3\xf9\x74\xce\xfb\
\xbc\x67\xf3\x58\xb5\x5a\xfd\x00\x62\x28\x2e\xdb\x81\x0c\x7e\x27\
\x74\xc5\x5d\xf9\x98\xca\xc3\xb9\xb7\x10\x03\x43\x33\x24\xdb\xb2\
\x8d\x28\x8f\x95\x0b\x6e\xae\x0e\xbd\x45\xe9\xed\x9b\xae\xa1\xe8\
\xf3\x69\x12\xa1\x08\x45\x28\x42\x11\x8a\x50\x84\x22\x14\xa1\x08\
\x45\x28\x42\x11\x8a\x50\x14\xa1\x08\x45\x28\x42\x11\x8a\x50\x84\
\x22\x14\xa1\x08\x45\x28\x42\x11\x8a\x50\x14\xa1\x08\x45\x28\x42\
\x11\x8a\x50\x84\x22\x14\xa1\x08\x45\x28\x42\x11\x8a\x22\x14\xa1\
\x08\x45\x28\x42\x11\x8a\x50\x84\x22\x14\xa1\xfc\x57\x88\x58\xe4\
\xca\x17\xa1\x7c\x27\x91\xc8\xb8\xf2\x5a\x28\x40\x18\x4f\x12\xc6\
\xdb\x85\x52\x9f\x6c\x7e\x02\x33\x73\xcb\x7d\xa1\x00\x85\x9e\x49\
\x57\x9e\x98\xd9\xa5\xf7\x28\xe9\xcc\x20\xdd\xb9\x92\x5b\xee\x79\
\xdf\x7d\x82\x20\x64\xa4\x38\x0b\x18\xc0\x2d\xb0\xe6\x3d\x4a\xb1\
\x34\x4f\x3a\x33\xe4\x96\x2b\x66\xf6\x0c\x75\xb3\x0e\xfc\x3a\x93\
\xc4\x19\x1b\x5f\x20\xff\xb3\x97\x6c\x9a\xd9\x7a\xad\x1b\xf9\x06\
\x92\x4a\xf7\x33\x32\x3a\x47\x67\xd7\xb0\xbb\x74\x04\x2c\x35\xb4\
\x68\x1f\x20\x62\xb1\x88\xee\x5c\x89\x42\xef\x14\xb9\xc2\x84\xdb\
\x43\x00\x76\x80\x45\x33\x7b\xa9\xbf\xdf\xdc\xa4\x9d\xd7\xd7\x0a\
\xef\x6f\x4f\x2d\xf7\x17\x13\x45\x1d\xc4\xa3\x14\x41\xd0\x30\x4c\
\xa8\x0c\x2c\x9b\xd9\x56\xb3\xa7\xcc\xb3\xf1\x43\x67\xc0\x2e\xb0\
\xea\x36\xd5\xa6\x27\x5c\x60\xa3\x85\xbb\xd0\x27\x70\xff\xfd\x66\
\x1c\x98\xd9\xe9\x5f\x1e\xfa\x02\x62\x3f\x3c\xe0\x68\x10\xaa\x3b\
\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xb2\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x45\x00\x00\x00\x45\x08\x06\x00\x00\x00\x1c\x8d\x2b\x29\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\
\xbb\x7f\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0c\x09\x02\x26\x1a\xe7\xb4\xa9\xea\x00\x00\x01\x3f\x49\x44\
\x41\x54\x78\xda\xed\xdc\xb1\x4a\xc3\x40\x1c\xc7\xf1\xdf\x25\x97\
\xd0\xaa\x4d\x23\x6d\x1a\x2b\x88\xd6\xa1\xb4\x06\x0b\x82\xe0\x13\
\xf8\x04\xe2\xe0\xe2\xdb\xba\xf9\x06\xe2\x24\x28\x2e\x46\x70\x29\
\x3a\x5c\xa7\x86\xb4\x09\x3e\x40\xef\xfb\x9d\x12\xc8\x72\x1f\xb8\
\x7f\x92\xe5\x8c\x73\x4e\xb4\x59\x00\x41\x33\xbb\xbe\xf8\xfc\x78\
\x56\xf9\xf5\xe2\x2d\xc4\xe9\xe4\x56\xdd\xbd\xe1\x26\xca\x77\xf9\
\xaa\xf7\xb7\x27\x6f\x51\xc6\xc7\x37\x15\x0a\xdb\x87\x99\x02\x0a\
\x28\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x80\x42\xa0\x80\
\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x80\x42\
\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\
\x10\x28\xa0\x80\x02\x0a\x28\xa0\x80\x02\x0a\x28\xa0\x80\xb2\x43\
\x10\x61\x0c\xca\x76\x9d\x4e\x0a\x4a\x3d\x1b\x75\x65\xa3\x7d\x50\
\xea\x0d\x47\x0b\x19\x63\x40\xa9\x97\x1f\x5d\xd5\x6f\x9d\xf7\x28\
\x49\x7a\xa6\x41\x56\xf0\xf6\xa9\x16\x1f\x58\x4d\x67\x77\x92\xaa\
\xad\xe3\xbc\x47\x99\x15\x0f\x4a\xd2\x49\x73\xf0\xfa\xf9\x4d\x12\
\xe9\xe2\xf2\x51\xa3\xad\x59\xe2\x2d\x4a\x2f\x39\xd1\x74\x7e\xaf\
\xfe\xe1\x79\x2b\x88\x37\x28\x61\x18\x6b\x90\x15\xca\xc7\xd7\xca\
\xf2\x45\x7d\x86\x34\x40\x24\xc9\xac\x4f\xda\x59\x2e\x4b\xfd\xfd\
\xfe\xec\xdc\x5f\x4c\x1c\x1f\x28\x8a\x7b\x0a\x82\xb0\xed\x81\xd6\
\x63\x86\x8c\xa7\xc7\x0f\xfd\xbb\x68\x0b\x46\xb3\x15\xf0\x97\x29\
\xea\xb9\x37\x10\xe6\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\
\x82\
\x00\x00\x0b\xc4\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x01\x86\x00\x00\x01\xbe\x08\x06\x00\x00\x00\x97\xa9\xa3\x25\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\x01\
\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdd\x0b\x06\
\x10\x03\x06\xee\xa7\x9e\x1a\x00\x00\x0b\x44\x49\x44\x41\x54\x78\
\xda\xed\xdd\x41\x56\xdc\x3a\x10\x40\x51\xba\x8f\x77\xc6\x88\xb5\
\xb0\x1e\xd6\xc2\x88\xb5\x91\x09\xe4\xd0\x84\x0e\x96\x2d\xcb\x55\
\xaa\x7b\xc7\xff\x27\xc4\x96\xf4\x5c\x6e\x42\x1e\x1e\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\xc8\xe9\xe2\x12\x90\xd1\xdb\xeb\xf3\x7b\xeb\xff\xf3\xf8\xf4\x72\
\x89\xfa\x75\x9e\xf1\xb5\xc1\x3d\x57\x97\x00\x31\x01\x84\x01\x00\
\x61\x00\x53\x03\x08\x03\x00\xc2\x00\xa6\x06\x10\x06\x00\x84\x01\
\x4c\x0d\x20\x0c\x00\x08\x03\x98\x1a\x40\x18\x40\x1c\x40\x18\x00\
\x10\x06\x30\x35\x80\x30\x00\x20\x0c\x70\xb2\x96\x9f\x58\x6a\x6a\
\x00\x61\x00\x40\x18\x30\x35\x98\x1a\x40\x18\xe0\xc1\x3f\x82\x03\
\xc2\x00\x3b\x98\x1a\x40\x18\x30\x35\x00\xc2\x00\xa6\x06\x10\x06\
\x30\x35\x80\x30\x80\xa9\x01\x84\x01\x4c\x0d\x20\x0c\x60\x6a\x00\
\x61\x00\x53\x03\x08\x03\x98\x1a\x40\x18\x20\xcc\xd4\x20\x0e\x08\
\x03\x00\xc2\x00\xa6\x06\x53\x03\x08\x03\x00\xc2\x00\xa6\x06\x10\
\x06\x00\x84\x01\x4c\x0d\x20\x0c\x30\x30\x0e\x20\x0c\x80\xa9\x01\
\x61\x00\x53\x03\x08\x03\x60\x6a\x00\x61\x00\x53\x03\x08\x03\x98\
\x1a\x40\x18\xc0\xd4\x00\xc2\x00\xa6\x06\x10\x06\x30\x35\x80\x30\
\x80\xa9\x01\x84\x01\x62\x4e\x0d\xe2\x80\x30\x00\x20\x0c\x60\x6a\
\x30\x35\x20\x0c\x00\x08\x03\x60\x6a\x40\x18\x00\x40\x18\xc0\xd4\
\x00\xc2\x00\x03\xe3\x00\xc2\x00\x98\x1a\x10\x06\x30\x35\x80\x30\
\x00\xa6\x06\x84\x01\x30\x35\x20\x0c\x00\x08\x03\x60\x6a\x00\x61\
\x00\x40\x18\xc0\xd4\x00\xc2\x00\x80\x30\x80\xa9\x01\x84\x01\x00\
\x61\x00\x53\x03\x08\x03\x00\xc2\x00\xa6\x06\x10\x06\x00\x84\x01\
\x4c\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x34\xf3\xd3\x20\x29\xe7\xed\xf5\xf9\x7d\
\xcf\xff\xef\xa7\xa8\x22\x0c\x50\xe8\xd0\xef\x45\x3c\x10\x06\x28\
\x1a\x00\xc1\x40\x18\x40\x04\xc4\x02\x61\x00\x31\x10\x09\x84\x01\
\xc4\x40\x24\x10\x06\x10\x03\x91\x00\x61\x40\x0c\x44\x02\x84\x01\
\x31\x10\x08\x10\x06\x04\x41\x24\x40\x18\x10\x84\x3d\x07\x6c\xe6\
\x98\x09\x04\xc2\x80\x20\x1c\x74\xb0\xce\xf2\xe7\x80\x2d\x16\x97\
\x00\x41\x98\xf7\x7e\x08\x04\xc2\x80\x20\x20\x10\xec\x66\xb1\x20\
\x08\x1f\xbe\x1f\x9e\x15\xfe\x8c\xf0\x93\xab\x4b\x80\x28\xb8\x77\
\xf0\x95\x57\x49\x38\x54\x8a\xde\x47\xd3\x03\xc2\x80\x20\x20\x10\
\xac\x62\x41\x20\x0a\xff\x39\x1c\xab\xff\xf9\x31\x31\x80\x29\xc1\
\xf4\x20\x10\xf8\xf0\x19\x51\xc0\xbd\xe7\x96\xa7\x03\xca\x1f\x0a\
\xff\x7b\x4a\x76\x4d\x10\x06\x44\xc1\x21\xe8\xda\x08\x44\x79\x5e\
\x25\xe1\xf5\x01\xd6\x06\xc2\x80\x8d\x8f\x35\xc2\x7d\xc6\x44\x9b\
\xbd\xb4\x35\xaf\x4a\x5c\xab\xf5\xd7\x0a\x61\x40\x14\xca\x1c\x76\
\xae\x99\x40\x54\xe2\x55\x92\x28\x80\x35\x84\x30\xd8\xd0\x60\x2d\
\x71\x9f\x91\xd0\x46\x2e\xab\xf5\x95\x88\x6b\xb8\xff\x1a\x62\x62\
\x40\x14\xb0\xb6\x10\x06\x6c\x5c\xac\x31\x84\x01\x1b\x16\x6b\xcd\
\x5a\x9b\x8a\xf7\x83\x36\x6a\x49\x5b\xdf\x8d\xbb\xae\xc7\x5c\x57\
\x4c\x0c\x88\x02\xd6\x1e\xc2\x80\x8d\x89\x35\x88\x30\x60\x43\x06\
\xe5\x75\x87\xb5\x88\x30\xd8\x88\x88\x8a\x35\x89\x30\xd8\x80\x60\
\x6d\x22\x0c\x36\x1e\x58\xa3\x08\x03\xb4\xea\xf1\x2a\xc8\xeb\x24\
\x84\x01\x4f\x62\x60\xad\x0a\x03\x36\x1a\x58\xb3\xc2\x80\x0d\x06\
\xd6\x2e\xc2\x60\x63\xd5\xd2\xf3\xb3\x01\x9f\x33\x20\x0c\x00\x1e\
\x6e\x84\x01\x1b\x0a\xac\x65\x61\xc0\x46\x9a\x96\x57\x3f\xd6\x34\
\xc2\x00\x62\x03\xc2\xe0\xc9\x0a\xac\x6d\x84\xc1\xc6\x01\x6b\x1c\
\x61\x80\x56\x47\xbe\xf2\xf1\x3a\x09\x61\xc0\x93\x14\x58\xeb\xc2\
\x80\x8d\x02\xd6\xbc\x30\x00\x50\x98\xf7\xa3\x9e\x9c\xa6\x36\xea\
\x33\x00\xf7\x2c\xdf\x3d\xc3\xc4\x00\x80\x30\x98\x16\xc0\x1e\x40\
\x18\x00\xd8\xcd\xbb\x3c\x4f\x4a\xd3\x1a\xfd\xae\xda\xfd\xcb\x7d\
\xff\x30\x31\x88\x02\x80\x30\x00\x1e\x96\x10\x06\x1b\xa0\x2c\xaf\
\x21\x40\x18\x40\x8c\x3c\x34\x21\x0c\x00\x08\x83\x27\x22\xb0\x47\
\x10\x06\x68\x75\xe6\x2b\x1d\xaf\x93\x10\x06\x3c\x09\x81\xbd\x22\
\x0c\x00\x08\x03\x9e\x80\x00\x61\x80\x9c\x22\xbc\xe3\xf7\x39\x83\
\x87\x29\x61\x00\x40\x18\xf0\xe4\x03\xf6\xce\xbc\x96\xd9\x17\x81\
\xb1\xbe\x0e\xf7\x9a\x4a\xe1\x39\x72\xbd\x2f\xb3\xdf\x94\xef\xbf\
\xa6\xc3\x83\x51\x9b\xd6\xd3\x2d\x59\x85\x78\x95\xf4\xf6\xfa\xfc\
\x3e\x6a\x13\x8d\xfc\xbd\x8c\xc2\x60\x0f\x65\xb4\x54\xbd\xc1\x9f\
\xbf\xb7\x09\x02\x20\xc8\xc4\x10\xa5\xfa\x67\x4f\x10\xf4\x21\xf0\
\x90\x38\x0c\x51\x0f\xe2\x11\x5f\x93\x00\x89\x15\xf6\x92\x30\x24\
\xbb\x99\x16\x1b\xc0\xc0\x30\x64\x39\x74\xc5\x01\xa8\x6e\xc8\xa8\
\xdb\xeb\xb0\x5d\x33\x9a\x8f\xfc\xbd\x04\x27\x86\xe8\xaf\x6c\xdc\
\xfb\x3c\xf7\x7d\xed\xbd\x9a\xfd\x35\xe1\x12\x7d\x53\xb4\xde\x80\
\xaf\xff\xfd\x9e\xdf\xfb\xed\xf5\xf9\xdd\x3b\x62\x88\x1d\x5c\x7b\
\xf4\x18\xd7\xa3\x6f\xdc\x9e\x20\xec\xbd\xe9\x7b\x7f\x0d\x4f\x7a\
\x80\x30\x04\x88\x42\x8f\x20\xf4\xfc\x35\xc5\x01\x10\x86\x13\x1d\
\x3d\x16\x9e\x35\x76\x8a\xcb\x7c\xf7\x74\xb6\xaf\x11\x0e\x0f\xc3\
\x96\x83\x70\xd4\xe6\xd9\xf2\xfb\x38\xd8\x21\x26\x7b\x33\x49\x18\
\x22\x47\x41\x1c\x00\x4e\x9a\x18\x32\x8c\xd9\xc6\xfb\xfc\xdc\x43\
\x48\x10\x86\xd6\xa7\xea\xb3\x37\x76\xeb\xef\x6f\x6a\x88\x13\x84\
\x6c\x51\xf8\xfc\x9a\xc5\x8c\x0c\x16\x97\xe0\x58\x62\x62\x32\xf8\
\xed\xcf\x63\x8d\x20\x0c\xc1\x36\xbb\x7f\x50\x45\x08\x84\x22\xff\
\xc3\x97\x49\x2c\x68\x18\xaa\x2c\x66\x8b\x50\x0c\x46\x5e\x0b\x91\
\xa0\xcc\xc4\x10\xed\x10\x30\x35\x58\x03\xa6\x09\x38\x39\x0c\xa6\
\x06\x07\x1c\x42\xc1\xe4\x61\x68\x59\x9c\x51\x0f\x08\x53\x83\x10\
\x08\x05\x98\x18\x10\x83\xa9\xef\x81\x48\x20\x0c\x01\xcd\xbe\x31\
\x85\xc0\x34\x81\x30\x4c\x7f\x90\x78\x9d\x24\x04\x42\x91\xf7\x21\
\xcc\xfa\x0c\x14\x86\xaa\x07\x69\x95\x85\x68\xb3\xd5\xb8\xb7\x1e\
\x88\x38\x6d\x62\x40\x08\x30\x4d\x20\x0c\x08\x01\x42\x31\xe5\x1b\
\x83\x99\xf7\xad\x30\x08\x01\x08\x05\xc2\x20\x06\xd0\x6f\x4d\x89\
\x84\x30\x94\x58\xf0\xd9\x17\xba\x10\x60\x9a\x20\x45\x18\x1c\x56\
\xae\x2d\x42\x81\x30\x20\x04\xe0\xb5\x93\x30\x20\x06\x60\x9a\x10\
\x06\x84\x00\x84\x42\x18\x10\x02\xa8\x1c\x8a\xd9\xf7\xab\x30\x58\
\x5c\x90\x62\x8f\x98\x26\x26\x0c\x83\x1f\x72\xf5\xf3\x35\x11\x0a\
\x58\xb7\x3f\x30\x31\x94\x5c\x8c\x42\x81\xbd\x87\x30\x20\x14\x58\
\xdf\x08\x03\x7d\x36\x92\x48\x20\x04\x08\x03\xa6\x09\xc4\x00\x61\
\x40\x28\x10\x02\x12\x86\xa1\xea\x3f\x87\x19\xfd\xe0\x15\x0a\x84\
\x80\x14\x13\x43\xf4\x6f\x59\x9d\x79\x91\xfb\x7c\x02\xfb\x84\x90\
\x61\xc0\x34\x81\x10\x20\x0c\x08\x05\x42\x80\x30\xfc\xbe\xe8\x22\
\x1e\x3c\x36\xc3\xcf\xd7\x42\x24\xc4\x00\x61\xd8\xa4\xda\x07\xd0\
\x95\x0e\x4b\xd3\x84\x10\x20\x0c\xa5\xa7\x06\x84\x42\x08\x3c\xac\
\xd1\x31\x0c\x99\xa7\x86\x96\xaf\xbb\x65\x01\x56\x98\xa4\x84\x42\
\x08\x10\x86\xe9\xa6\x06\x1b\xe8\xb8\xeb\x29\x12\xd6\x32\xc2\x00\
\xa6\x09\x21\x40\x18\x6e\xb5\xbe\x3a\x39\x7b\x6a\x68\xdd\x58\x0e\
\x36\xa1\x10\x02\x84\x61\xd0\x62\x3f\xe3\x80\xb0\xc9\x62\x1d\x74\
\x22\x61\x8d\x32\x71\x18\xb6\x7c\xe0\x3a\x3a\x0e\x5b\x36\x9c\x83\
\xcb\x34\x21\x06\x54\x71\x89\xb4\xc0\x47\x1c\x06\x67\x7c\x5d\x36\
\x7b\x9f\x07\x0e\x21\xe0\xe8\xb5\xb1\xf6\x7e\xcc\xfe\xe0\xb2\x44\
\xdb\x24\x47\x5e\x70\x9b\xd0\x44\x21\x04\xf0\xbb\x6b\xb4\x8a\xbf\
\xbd\x3e\xbf\xf7\xde\x3c\x7b\x7e\x4d\xaf\x90\x1c\xb0\x67\xaf\x41\
\x18\xed\x12\x7d\x03\xef\x39\x98\xcf\xfc\xbd\x3d\x25\xe6\x7b\x8d\
\x20\x64\xd6\x40\xb6\xfb\x74\xd4\xfa\x5f\x46\x7c\xe1\x7b\x2e\x76\
\xeb\x77\xae\xf4\xba\xb1\x26\x05\xa0\xaa\x21\x9f\x31\xf4\xfa\xd1\
\x10\xa3\x6a\xde\x3b\x0a\x55\xff\x95\x3b\x30\x31\xe6\x74\x75\x03\
\x2d\xb4\xcc\x32\x04\xd7\x43\x01\xc2\x90\xf8\xd0\x15\x05\x80\xc1\
\x61\xf8\x3c\x7c\x23\x1e\xc0\xa2\x00\x70\x52\x18\xa2\x1d\xc4\xa3\
\x42\x25\x3c\x60\x4f\x09\x43\xf0\xe9\x21\xea\xe4\x42\xbb\xc8\xef\
\xf0\x7d\xbe\x40\x46\x21\xfe\xe6\xf3\xe7\x01\x3d\x62\x13\x89\x01\
\xe0\x7c\x48\x10\x86\x7b\x37\xa5\x47\x28\xdc\x68\x70\x80\xd3\xc6\
\xc5\x1d\xcc\xab\x85\x3a\x07\x85\x7b\x2d\x0c\x59\x5d\x5d\x02\x04\
\x17\x10\x06\x00\x84\xc1\x08\x0c\xf6\x10\xc2\x40\x31\x91\x5e\x27\
\x79\xb5\x85\x30\x00\x20\x0c\x18\x85\xc1\xde\x11\x06\x00\x0a\x50\
\xdf\x13\x79\x0f\x3d\xe7\x53\xa5\xfb\x6a\x5a\x30\x31\x00\x20\x0c\
\x00\x08\x03\x46\x63\x56\xf0\x1a\xc9\x5e\x11\x06\x70\x38\x83\x30\
\xe0\x49\x08\xec\x11\x61\x00\x40\x18\xf0\x44\x44\x2b\xaf\xb0\xec\
\x0d\x61\x00\x87\x34\x08\x03\x9e\x8c\xc0\x9e\x10\x06\x00\x8a\x51\
\xe4\x60\xbc\x02\xc9\xf9\xd4\xe9\xbe\x99\x16\x4c\x0c\x00\x08\x03\
\x9e\x94\xc0\x1e\x10\x06\x00\x0a\x52\xe6\xa0\xbc\xb3\xce\xf3\x04\
\xea\x5e\x99\x16\x4c\x0c\x00\xa2\x20\x0c\xd8\x24\x80\x30\x20\x0e\
\xac\xe0\x35\x92\xb5\x2e\x0c\xe0\xf0\x46\x14\x84\x01\x9b\x06\x10\
\x06\xc4\x01\xac\x6d\x61\x80\xb9\x1d\xf1\x3a\xc9\x2b\x2a\x51\x10\
\x06\x6c\x22\x40\x18\x10\x07\xb0\x96\x85\x01\x40\x14\x84\x01\x9b\
\xaa\x86\x9e\x9f\x09\xf8\x7c\x01\x61\x40\x1c\xc0\xda\x15\x06\x6c\
\x30\xb0\x66\x85\x01\x1b\x8d\x15\xbc\x46\xb2\x56\x85\x01\x1b\xce\
\xa1\x8e\x35\x2a\x0c\x00\x08\x03\x9e\xc8\xc0\xda\x44\x18\x6c\x40\
\x5a\x79\x15\x65\x4d\x0a\x03\x36\xa2\xc3\x1d\x6b\x51\x18\xb0\x21\
\xc1\x1a\x14\x06\x6c\x4c\xb0\xf6\xf8\xcb\x4d\x9c\x98\x57\x26\x7d\
\x0f\x31\xd7\x53\x14\x4c\x0c\xd8\xa8\x60\xad\x09\x03\x36\x2c\x58\
\x63\x08\x83\x8d\x0b\xd6\x16\x37\xdc\xd4\x42\xbc\x23\xdf\x7e\xb0\
\xb9\x76\xa2\x60\x62\xc0\x46\x06\x6b\x49\x18\xb0\xa1\x61\xcd\xfa\
\xb1\x86\xe6\xe7\x06\x17\xe6\xf5\xc8\xba\x50\xba\x4e\x1e\x2a\x4c\
\x0c\xd8\xe8\xe2\x88\xb5\x22\x0c\xd8\xf0\x60\x8d\x20\x0c\xd8\xf8\
\xfc\xba\x2e\xac\x8d\x9a\xdc\x74\x6e\x54\x7d\xb5\x72\xef\x00\x74\
\x3d\x30\x31\xe0\x29\xd1\x81\x60\x0d\x58\x03\xe5\x2d\x2e\x01\xf7\
\x0e\x06\x1f\xcc\x0a\x02\x26\x06\x70\x50\xb8\xd7\xe0\x33\x06\xd6\
\xa9\x30\x3d\x7c\x3f\x1c\x2b\xfe\x99\xc1\xc4\x80\x03\xc4\x3d\x85\
\x7f\xf8\x8c\x81\xe6\x83\xc4\x67\x0f\x82\xc0\xdc\x2c\x10\x36\x9b\
\x2d\x10\x5f\x0f\xcc\x19\xe3\x27\x08\x08\x03\x02\x61\x2a\x12\x04\
\x36\xf1\x19\x03\x0e\x9e\x89\xef\x8b\x7b\x83\x30\xe0\x10\x42\xac\
\xd9\xcd\xe2\xe1\x10\x59\x5f\xc5\x3c\x3e\xbd\x5c\x32\x7f\xed\x56\
\x1e\xc2\x80\x48\x20\x08\x08\x03\x02\x81\x20\x20\x0c\x88\x04\x62\
\x80\x30\x20\x10\x08\x02\xc2\x80\x48\x88\x84\x18\x20\x0c\x20\x14\
\x42\x80\x30\x80\x48\x08\x01\xc2\x00\x62\x21\x04\x08\x03\x14\x0e\
\x86\x00\x20\x0c\x50\x24\x20\x0e\x7c\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x80\xdd\x7c\x5f\x36\x7c\xe8\xf9\x17\xe3\xfc\x9d\x07\
\x84\x01\xc4\x40\x2c\x10\x06\x10\x03\x91\x40\x18\x40\x14\x04\x82\
\x02\x16\x97\x00\x41\x00\xbe\xba\xba\x04\x88\x02\x20\x0c\x88\x02\
\x20\x0c\x88\x02\xb0\x8e\xcf\x18\xe0\x8e\x96\x0f\x86\x45\x88\x99\
\xf8\x8e\x08\x4c\x0b\x1b\x63\xd0\xe3\x6b\xf0\x5d\x49\x08\x03\x04\
\x8d\xc2\xd1\x07\xf4\xbd\xaf\x49\x18\x88\xc8\x67\x0c\x94\x37\xe2\
\x70\x7e\x7c\x7a\xb9\x88\x00\xc2\x00\xa2\x20\x10\xa4\x64\x81\x32\
\x95\x96\xd7\x48\x0e\x68\x30\x31\x00\x20\x0c\x60\x5a\x00\x61\x00\
\x40\x18\x00\x10\x06\x00\x84\x01\x00\x61\x00\x40\x18\x00\x10\x06\
\x18\xce\x4f\x43\x05\x61\x00\x40\x18\xc0\xd4\x00\xc2\x00\xe2\x00\
\xbb\xf9\xb1\x00\x38\xec\x3f\xf8\x31\x19\x20\x0c\x08\x83\x48\x80\
\x30\x20\x0e\x62\x01\xc2\x80\x30\x1c\x48\x2c\x10\x06\x10\x07\xa1\
\x40\x18\x40\x1c\x44\x02\x61\x00\x71\x10\x08\x84\x01\xc4\x41\x20\
\x40\x18\x10\x08\x81\x00\x61\x80\x18\x81\x10\x07\x84\x01\x44\x42\
\x1c\x10\x06\x10\x09\x71\x40\x18\x40\x2c\xc4\x01\x61\x00\xb1\x10\
\x07\x84\x01\xe8\x1e\x09\x61\x40\x18\x40\x24\xc4\x81\xb0\xfc\x43\
\x3d\xd0\x91\xc3\x1d\x13\x03\xd0\x6d\x7a\x10\x15\x84\x01\xc4\x41\
\x1c\x08\xc9\xab\x24\x00\x84\x01\x46\x31\x01\x20\x0c\x00\x08\x03\
\x00\xc2\x00\x34\xf0\x3a\x09\x61\x00\x40\x18\x00\x10\x06\x60\xa5\
\x08\xff\x6a\x1c\x08\x03\x00\xc2\x00\x80\x30\x00\x70\x00\xdf\x46\
\xc7\x54\x3e\xdf\xe7\x47\xf9\x16\xd1\x96\xcf\x17\x7c\x5b\x2b\x26\
\x06\x38\xf8\x40\x3e\xfb\x43\x5f\x1f\x3a\x23\x0c\x20\x10\xa2\xc0\
\x14\x8c\xae\x4c\x17\x82\xdf\xfe\x9b\xa3\x5f\xd9\x6c\x89\x82\xd7\
\x48\x44\xb2\xb8\x04\x54\x8e\x47\xcf\x03\xd9\x94\x80\x89\x01\x92\
\x4e\x0c\xbd\x9e\xdc\x7b\x85\xc0\xb4\x80\x89\x01\x26\x0e\x0b\xcc\
\xc0\x87\xcf\x70\x22\xd3\x02\xc2\x00\x88\x02\xe1\x79\x95\x04\x82\
\x00\x37\x2c\x50\xa6\x13\xf9\x73\x02\x51\x40\x18\x40\x24\x04\x01\
\x61\x00\x91\x10\x04\x84\x01\xc4\x42\x08\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\xc3\x1f\x5d\
\xe5\xb0\xeb\xe6\x25\x52\xe9\x00\x00\x00\x00\x49\x45\x4e\x44\xae\
\x42\x60\x82\
\x00\x00\x41\x5c\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\xc8\x00\x00\x00\xc8\x08\x06\x00\x00\x00\xad\x58\xae\x9e\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0e\xc4\x00\x00\x0e\xc4\
\x01\x95\x2b\x0e\x1b\x00\x00\x20\x00\x49\x44\x41\x54\x78\x9c\xed\
\xbd\x79\xbc\x24\x47\x75\xe7\xfb\x8d\xac\xdb\xad\x56\x6f\x5a\x2c\
\x81\x10\x8b\x10\x20\x2c\x01\x16\x1a\xb0\x41\x66\x11\x1e\x18\x83\
\xc1\x0f\x0c\xe3\x67\xb1\x48\xac\xc6\xc3\x3c\xfb\xbd\x99\x0f\x1e\
\x33\xf8\x83\xe7\xd9\xc8\xe3\xf1\xc6\x9b\x67\x7f\x66\x79\x86\x19\
\xfc\x11\xc6\x02\xc9\x0d\x06\x2c\x7f\x60\x58\x8c\xb0\x10\x12\xc2\
\xa0\x5d\x02\x49\x68\x6f\x49\xad\xde\xbb\xd5\xcb\xbd\x7d\xef\xad\
\x8c\xf7\x47\x55\x56\x9d\x38\x79\x22\x32\x32\xab\xee\xa2\x96\xce\
\xe7\x93\x37\x23\x4e\x6c\x27\x4e\x9c\x5f\x9c\x13\x99\x75\xab\x1c\
\x4f\xd0\x92\xd0\x5f\xed\xe7\x27\x98\xe1\x74\xd7\xe7\x34\xe7\x78\
\x1a\x25\xa7\x7a\xcf\x93\x81\x93\x81\x13\x80\xe3\x80\x4d\xc0\x7a\
\x0f\xeb\x80\x35\x0e\x1c\x80\x07\x0f\x2c\x38\xcf\x1c\x8e\xc3\xc0\
\x01\x60\x3f\xb0\xc7\x15\xec\xc4\xb3\x1d\xd8\xe6\x1c\x5b\x5d\x8f\
\xfb\x17\x17\xb9\xef\xdd\xc7\xb1\x7b\x45\x26\x7a\x94\x93\x5b\x69\
\x01\x1e\xeb\xb4\x65\x1f\x27\xce\x79\xce\xa1\xe0\x85\x85\xe3\x05\
\x65\xc9\xf3\x70\x3c\xd7\x97\x9c\xc0\xd8\xe0\x87\x7f\xc2\xb4\x4a\
\x46\xc9\xa9\x8c\xab\xa7\xbd\x73\xec\xc1\x73\xa7\x77\xfc\x10\xc7\
\xad\x45\xc1\x8d\x45\x9f\x9b\x2e\x38\x9e\xbd\xdd\x67\xf7\x04\x3d\
\x01\x90\x16\xf4\x7b\x9e\xe2\xac\x83\x3c\x6f\xde\xf3\xca\x02\x5e\
\xe6\x3d\xe7\xfa\x92\x67\x79\x47\x81\x07\xef\xc7\x00\x08\xee\xa9\
\xb4\xe0\x55\x37\x09\x00\x49\x4e\xf0\xac\xb4\xbc\x3b\x07\x38\xfa\
\x0e\xee\x06\xbe\xe7\xe1\x1a\xdf\xe3\xaa\x7b\xff\x1f\x7e\x74\xd1\
\x45\x94\xdd\xb5\xf0\xf8\xa2\x27\x00\xd2\x40\x7f\x7d\x88\xa7\xd1\
\xe7\x17\x9c\xe7\xe7\x3d\xfc\x9c\xf7\x3c\xc9\x6b\x30\x28\x40\xf8\
\xca\xd8\xf5\x7d\xf4\x47\xe4\x15\xaf\x46\x2e\xb8\x8d\x32\x55\xde\
\xb9\xfa\xdd\x00\xca\x88\xef\x1c\xdb\x9d\xe3\x5b\xc0\x37\xfa\x0b\
\x7c\xed\x3d\x27\xf1\x50\xa6\x2a\x1e\x97\xf4\x04\x40\x0c\xba\x64\
\x2f\xe7\x50\xf0\x16\x0f\x6f\xc2\x73\xb6\x87\x62\x04\x0a\x79\x31\
\x4e\x43\x1d\x28\xd6\x5d\xdc\xea\x79\x83\xb4\x37\xa9\x85\x57\x91\
\x7b\x00\x98\x10\x20\x32\x5f\x52\x70\x23\x9e\xcb\x8b\x1e\x5f\xb8\
\x70\x13\xb7\xb4\xd7\xd6\xd1\x4d\x4f\x00\x64\x48\x7f\xf5\x28\x67\
\x15\x9e\x77\xe0\x78\x2b\x9e\x33\xca\xd2\x06\x82\x06\x08\xaa\x4e\
\x14\x1c\x8c\x81\x34\x64\xe7\x1d\x40\x2a\x72\xe1\x62\x39\x09\x18\
\x0b\x24\xda\x83\xa0\xc0\xa1\x41\x53\x80\x83\x3b\x5c\x8f\xcb\x28\
\xb9\xf4\x9d\xc7\x71\x47\x0b\xe9\x8e\x5a\x7a\x5c\x03\xe4\xe2\xbd\
\x1c\xbf\xb6\xc7\xdb\x3d\xbc\xd7\x97\xfc\xb4\x07\x57\x7a\xf0\x1a\
\x1c\x65\x1a\x24\x12\x18\x29\x6f\x22\x6e\x59\xde\xa3\xa2\x5c\x2f\
\x62\x86\x59\x31\xef\x61\x01\xa5\x18\xa5\xbd\x73\x7c\xaf\x57\x70\
\x71\xb9\x89\xcb\xde\xe9\x78\xb4\x85\x5a\x8f\x2a\x7a\x5c\x02\xe4\
\x33\x87\x78\xb1\xef\xf3\xeb\xc0\x5b\xcb\x92\x0d\x95\xb1\x97\xd2\
\xf0\x4b\x91\x27\x02\x0e\x09\x86\xcc\x73\x88\x4e\x4b\x92\xec\xd8\
\xc2\x38\x57\x4f\xa7\xce\x1f\xb9\x1e\xa4\x70\x02\x20\x55\x7e\x70\
\x1d\x74\x8e\x4b\x5d\x8f\xff\xef\xc2\x8d\xdc\xd8\xa8\xdc\xa3\x8c\
\x1e\x37\x00\xd9\xe2\xe9\xcd\x1d\xe0\xcd\xce\xf3\x41\x06\x4f\xa0\
\x02\x6f\x21\xc1\x51\x0a\x90\xe4\x84\x59\xda\x83\xc4\x0e\xe7\x8d\
\xde\x23\x81\x10\xe3\xd1\x6e\xf4\xb0\x5e\xf3\x20\xa4\xc1\x11\x01\
\xc6\x38\x5d\x8c\xbc\xca\x55\x14\xfc\xd9\xdd\x9b\xb8\xfc\x22\xf7\
\xf8\x78\x12\x76\xd4\x03\x64\x8b\x67\xed\xfc\x01\xde\x0d\x7c\xc8\
\x7b\xce\xf0\x1e\xca\x32\x04\x41\x0a\x1c\xa5\x01\x86\x46\x0f\x92\
\x38\x87\xd4\x1e\xf1\xea\xbc\x22\x37\xfa\x53\xcf\x47\x0f\xe7\xda\
\x83\x10\x01\x48\x05\x02\x42\xa0\xd4\x40\x22\xf8\x45\x01\xc0\x1d\
\xce\xf1\xa7\x87\x37\xf3\xd7\x1f\x70\x2c\xb4\x5b\x91\xc7\x16\x1d\
\xb5\x00\xd9\xe2\x59\xbb\x70\x80\x5f\x05\x7e\xbb\xf4\x3c\xa3\x94\
\x60\x10\xa0\x90\x87\xf1\x1a\x50\x5a\x78\x90\xd8\x39\x24\xb8\x8f\
\xfe\x84\xe9\x2c\xca\xf0\x1c\xd5\x3d\xfb\xfc\x21\xf9\x45\xc4\x7b\
\x0c\x41\x21\xc1\x32\x02\x8a\xe3\xfe\x9e\xe3\x0f\x0f\x6e\xe2\xe2\
\xa3\x15\x28\x47\x1d\x40\x7e\x65\x0b\xbd\xb7\xbc\x81\x0b\xcb\x92\
\x8f\x7a\xcf\x33\x03\x8f\x31\xbc\x97\xca\x3b\x98\x20\xc9\xf5\x20\
\x9a\xcf\x98\x57\x79\x93\x61\x32\x2f\xcc\x32\xc8\xa9\x84\xe5\x39\
\xa2\x8f\x77\xab\xb2\xcc\xb3\x87\x04\x87\x04\x84\x04\x8b\x01\x94\
\x7b\x7a\x05\xbf\x7b\xe7\x46\x2e\x3d\xda\x42\xaf\xa3\x0a\x20\x97\
\x1e\xe4\xb5\xfd\x92\x8f\xe1\x39\xbb\x02\x42\x14\x18\x86\x17\x09\
\x3c\x48\x59\x07\x43\x14\x28\x08\xb0\x28\x90\x58\x87\x73\xcb\x7b\
\x58\x40\xa9\x2d\x8e\xe1\x39\xaa\xb4\x3e\x73\x24\xcf\x1f\x06\xaf\
\x88\x81\xc4\xf0\x1e\x31\xa0\x38\xc7\x0d\xbd\x82\xdf\x7a\xc7\x26\
\xae\x68\xbb\x76\xab\x95\x8e\x0a\x80\x6c\x99\xe5\x39\x0b\x8b\xfc\
\x99\x2f\xf9\xc5\x52\x1c\xbe\x47\x20\x11\x00\x18\xa5\x23\x60\x89\
\x1d\xd2\x63\x4f\xb4\xf4\x7b\x90\xac\xc7\xbc\x2d\xbc\x47\x45\x56\
\x78\x95\xe3\x3d\x46\x67\x92\x98\xf7\x50\x1e\xc4\x3a\x7f\xc4\x40\
\x31\xe2\x85\x7c\xef\x1c\x7f\x57\x78\xfe\xdd\x05\xc7\x73\x4f\xbb\
\x95\x5c\x7d\xf4\x98\x06\xc8\xc5\x9e\x75\xc7\x1c\xe4\x23\xde\xf3\
\xa1\xd2\xb3\xae\x02\x43\x0d\x20\x96\x17\x31\x40\xd3\x18\x62\x25\
\x42\x2d\x19\x52\x59\x1e\x24\xf6\x98\x57\x87\x5c\x01\xb9\xe0\x36\
\x48\xbb\x7a\xda\x7a\xbc\x1b\x7d\xb4\x6b\xf0\x34\x50\x4c\xef\x21\
\xf3\x86\xf7\x30\xbc\xc9\xac\x83\x3f\xde\x73\x1c\x7f\xf2\x6f\x1d\
\x47\xda\xaf\xee\xea\xa0\xc7\x2c\x40\x2e\x9b\xe5\x9f\x97\x8b\x7c\
\xa2\x1c\xbe\xf5\x96\xe0\x08\x40\x61\x00\xc3\x0c\xad\x2c\x2f\x12\
\x39\xc0\xa7\x0e\xe7\xfa\xc9\x16\x24\x3c\x49\x90\x48\x90\x06\x8a\
\x02\x04\x8c\x8d\x5d\xa6\x83\x50\x4b\x81\x43\x7a\x8a\xe8\x21\xbd\
\xb0\xc1\xa2\x81\x52\x14\x75\xb0\x54\x9e\xc5\x39\x6e\x77\x7d\x3e\
\x70\xe1\x89\x7c\xbb\xed\x1a\xaf\x06\x7a\xcc\x01\xe4\x4b\x9e\x4d\
\x87\x0f\xf1\x31\x5f\xf2\x6b\xa5\xa7\x30\xc1\x61\x81\xc2\x02\x46\
\xe4\x71\x6f\xec\x11\x70\x93\x17\x81\xb0\xbc\xe9\xe3\x26\x56\xde\
\x22\xe7\xec\x7c\x00\x12\x1d\x56\x61\x78\x8f\x94\x07\xd1\xde\x42\
\xf1\x24\x28\x6a\xe0\x30\x80\x51\x84\x80\x29\x8b\x82\xbf\xe8\x6f\
\xe2\xc3\xef\x72\x1c\x6a\xb7\xe2\x2b\x4b\x8f\x29\x80\x7c\xe6\x30\
\xaf\x72\x25\x17\x97\x25\xa7\x47\x81\x61\x00\xc5\x0a\xaf\xba\x1e\
\xd4\xf5\x59\x04\x5f\x07\x4d\x9b\xc7\xbd\x15\x25\x22\xac\x20\x23\
\x3d\x86\xbe\x5b\x40\x09\xce\x20\x44\xbc\x87\x30\x74\xd3\x7b\xd4\
\xc3\x27\x3b\xcc\x4a\x81\x64\xe0\x65\xee\x76\x33\xbc\xfb\xc2\xf5\
\x5c\xdd\x7e\xf5\x57\x86\x1e\x13\x00\xf9\x84\x67\xcd\x71\x87\xf9\
\xfd\x7e\x9f\x0f\x95\x9e\x5e\x1b\x70\x04\x87\x74\x0d\x98\x08\x48\
\xba\x7a\x11\x08\xcb\x52\x1f\x5c\x6c\x7a\x41\xa8\xc9\x8d\xfe\x18\
\x9e\x43\xdc\xcd\x50\x2b\xe2\x39\x62\xde\x23\xf6\xf4\x6a\x94\x6e\
\xf2\x1e\x1a\x24\x21\x6f\x11\xf8\xe3\xbb\x36\x73\xd1\x45\x8e\xc5\
\x4e\x06\xb1\x8c\xb4\xea\x01\x72\xe9\x2c\xcf\x2c\x17\xb9\x0c\xcf\
\x4b\xfb\x31\x50\x34\x80\x23\x75\x68\x4f\x79\x91\xd8\xa3\xde\x52\
\x83\xc0\xf2\x22\xd5\xbd\xe2\xc1\x08\x11\xb5\x30\x2b\x31\x7f\xbd\
\x40\xa3\x70\xab\x32\xfa\x2a\xad\x3c\x89\x15\x5a\x91\xeb\x3d\x22\
\x00\x49\x1d\xca\xb3\x40\x12\x02\xeb\xea\x99\x35\xbc\xfd\xed\xeb\
\xd9\xda\xde\x2a\x96\x8f\x56\x35\x40\x3e\x73\x88\x37\x3a\xcf\xa7\
\xca\x92\x13\xcb\x12\xfa\x16\x28\x26\xf5\x22\x99\x07\xf5\x2e\x5e\
\x64\x94\x86\xb4\xf7\xf0\x61\xd2\x0a\xad\x46\x49\xc3\x8b\x68\x8f\
\x21\xd3\xb9\x4f\xaf\xa2\xde\x23\x06\x08\xc3\x9b\x34\x85\x58\xf2\
\xea\x0d\xc6\xd8\xd5\xeb\xf1\xce\x77\x6c\xe4\xab\xdd\xad\x64\x69\
\x69\x55\x02\xe4\xf7\x3c\xc5\x4f\x1e\xe6\xa3\x94\xfc\x4e\xbf\x0c\
\x0f\xe2\xad\xbc\x48\xce\x53\x2d\x23\xe4\xca\x0d\xb1\x4a\xcb\x8b\
\x90\x3e\x87\xe8\x74\x5b\x6a\x7c\xcc\x6b\x80\x01\x6c\xcf\x11\xf3\
\x1e\xb5\x90\x4a\x01\x25\xf5\xd4\x2a\xc7\x7b\xf4\x42\x7e\xbf\x70\
\x5c\x74\xc1\x26\xfe\x00\xd7\x2a\xea\x5c\x16\x5a\x75\x00\xf9\xe4\
\x4e\x36\x6d\x38\x96\x4b\x4a\xcf\x9b\x6a\xa0\x88\xe4\xa3\x80\x31\
\x3c\x89\xf4\x22\x4d\x2f\x0d\x1b\x1f\xf5\xe6\x78\x90\xd1\x1f\x3b\
\x2f\x49\xb2\xa3\x0b\xe3\xa8\x79\x98\x51\xd4\x15\xf3\x20\x3a\x1f\
\x39\x6f\x24\x1f\xef\x4e\x76\xee\x08\x3c\x87\x91\xf7\xae\xe0\x0b\
\xe5\x46\xde\xbd\xda\x9e\x72\xad\x2a\x80\x5c\x72\x98\xd3\x7a\x9e\
\xcb\xcb\x92\xb3\xcb\x7e\x08\x84\x58\x7a\xd2\xf3\x48\xf2\xdd\x48\
\xc3\x59\xa4\x06\x12\xa8\x9d\x33\x9a\xc2\xaa\x9c\x2d\xd3\xd5\x12\
\x46\xb8\x85\x71\x3e\x49\x00\x24\x17\x1c\xc9\x30\xab\xe5\xb9\x23\
\x02\x8e\x41\xba\x07\xce\x71\x83\x9f\xe7\x4d\xef\x3c\x89\x07\x33\
\xd4\xb2\x2c\xb4\x6a\x00\xb2\xe5\x10\x2f\xee\xc3\xdf\x97\x7d\x9e\
\xd2\x6f\x02\xc5\xa4\xe7\x91\x08\x48\xda\x7a\x11\x30\xce\x18\xb1\
\xb3\x86\x06\x08\xed\x42\x2d\xa7\x56\xca\x3a\x8f\xc8\x74\xea\x8c\
\x12\x84\x5b\x91\xc7\xb9\x96\xf7\x88\x86\x55\x2d\xce\x1d\x51\x80\
\x8c\xef\x0f\xf6\x0a\xfe\xb7\xb7\x6d\xe4\xa6\x7c\xed\x2c\x1d\xad\
\x0a\x80\x5c\x76\x90\xd7\x79\xf8\x5c\xbf\x64\x53\x0d\x18\xfd\x06\
\x2f\x12\xf1\x20\x7d\xe9\x1d\x1a\xbc\x48\xe3\x3b\x11\x51\x06\x0a\
\x14\x06\x30\x46\x86\x6f\xf1\xc6\x45\x79\xee\xa3\x22\x1d\x5a\x21\
\x0c\x7f\xf4\xa7\xce\x1b\x01\x44\xa5\x0b\xc6\x00\x69\x7a\x7a\x35\
\x91\xf7\x88\x78\x10\xed\x3d\x14\x6f\x7f\xe1\xf8\x97\xab\xe1\x43\
\x8f\x2b\x0e\x90\xcb\x0e\xf3\xb6\xb2\xe4\xaf\xca\x92\xb5\x23\xc3\
\x8f\x84\x57\x6d\xbc\x48\x55\xa6\x0f\xe6\xd1\xa7\x5a\x91\x90\x4b\
\x87\x52\xfa\xc3\x89\xa4\xee\xa3\x3f\x46\xba\xa2\x56\x31\x56\x18\
\x6e\x59\xe9\xe4\x0b\x44\xea\x60\xd1\xe1\x56\xf4\xa3\x25\x09\xef\
\xe1\xa4\x71\xb7\xf4\x1e\x31\xa0\xf4\x0a\xe6\x7c\x8f\x0b\x2e\xdc\
\xc0\x17\x32\x34\xb4\x64\xb4\xa2\x00\xb9\xec\x20\xef\x2f\xe1\xe3\
\x65\x39\x78\xf9\x57\x79\x0b\x0d\x88\x0a\x34\x8d\x20\xf1\x36\xcf\
\x1b\x75\x1a\xdf\xac\x57\x1e\xc3\x38\x6b\x34\xbe\x29\x57\xa0\x90\
\x61\x96\xb8\x8d\x29\x05\x12\x2b\xb4\x1a\x26\x72\x01\x52\xdd\x63\
\x4f\xbb\xaa\x7c\xec\xcd\x79\xca\x7b\x54\x7c\x0d\x00\x59\x37\x1a\
\x5a\xf5\xea\x40\xe9\x85\x60\x59\x74\x05\xbf\x7a\xc1\x46\x3e\x9d\
\xd0\xd0\x92\xd2\x8a\x01\xe4\xb2\x43\xfc\xba\xf7\xfc\xd7\xea\x31\
\xae\x09\x8e\xbe\xed\x3d\x52\x67\x93\x80\x3f\x34\xfa\x54\xb8\x15\
\x03\x48\xe0\x2d\xe4\x41\x3c\x12\x66\x55\xbc\x21\xab\xf9\x4c\x22\
\xc9\x87\xc9\x60\x51\x8c\x15\x6a\x3a\x73\x80\x02\x48\xe4\x2c\x22\
\xbd\x88\xac\x13\xfd\x68\x89\x32\x7c\x37\x04\x46\x14\x24\x89\xb3\
\x46\x0d\x14\x16\x58\x7a\x50\x38\x4a\xd7\xe3\x03\x17\x6c\xe4\x93\
\xb6\x25\x2d\x2d\xad\x08\x40\x52\xe0\x68\x04\x46\x3f\xe1\x45\x7c\
\x9a\x1f\x0b\xb7\x82\x27\x55\x84\x61\x95\xfe\xa4\x6e\xec\xec\x11\
\xf3\x22\xa9\xf4\xb0\x79\x23\xc5\xce\x1e\xb1\x74\xab\xf0\xaa\x2a\
\x77\x75\xe0\x98\x8f\x74\x85\xe7\xe8\x09\x90\xb4\x3a\x77\xf4\xe2\
\x40\xd1\xe7\x91\x61\xbe\xef\x0a\xfe\xf5\x4a\x80\x64\xd9\x01\x72\
\xd9\x2c\xef\xf7\x7d\x3e\xd1\x06\x1c\xda\xbb\xe4\x7a\x91\xb2\x84\
\xbe\x02\x4d\xcd\x93\x0c\x3d\x87\x06\x86\x09\x8e\x0e\x00\x31\xcf\
\x1e\xca\x63\x34\x91\xf6\x28\xb1\x7c\xe7\xf3\x47\x55\xc7\x02\x4a\
\x65\xec\xca\x73\xd4\x3c\x44\xc6\xd9\xc3\x04\x85\x06\x84\x00\x90\
\xf2\x2c\x7d\x57\xf0\xbe\xe5\x0e\xb7\x96\x15\x20\x5b\x8e\xf0\xd6\
\xfe\x02\x9f\x29\x4b\x7a\x1a\x10\x16\x38\xac\x27\x58\xb1\xf3\x48\
\xe3\x59\x44\x7b\x12\x71\xce\xd8\xb8\x1e\x9e\xfb\x2c\x38\xf1\xf8\
\xc1\x98\xdb\x76\xc0\x8f\xee\x82\x85\x85\x3a\x38\x6a\x67\x90\x18\
\x40\x18\x97\xc5\x00\x92\x03\x8e\x8a\x9c\x4a\xe4\x86\x59\x6d\xde\
\xb6\xc7\xde\x95\x8c\x0e\xeb\x55\xe8\x95\x3a\x63\x44\xf8\xc9\x73\
\x87\x01\x92\x80\x37\x6e\xb3\x08\xbc\xf5\xc2\xcd\xcb\x77\x70\x5f\
\x36\x80\x5c\x36\xcb\xeb\x7c\xc9\xe5\x65\xc9\xda\xc0\x6b\x54\xe9\
\x08\x38\xb4\x17\x69\xfb\x54\xab\x2f\x80\x21\xbd\x48\x75\x9d\x7a\
\x0a\x9c\xf7\x52\x58\x33\x13\xca\xfb\xe8\x01\xf8\xf2\x15\x70\xe0\
\x60\xe2\x0c\xa2\xcf\x19\xb1\x3b\x46\x68\xd5\x06\x1d\x43\xaa\xbd\
\x0b\x49\x01\xc4\xf0\x1e\x8d\x67\x10\x03\x38\xb1\x0f\x37\x4a\x40\
\x58\x21\x56\xd3\x53\xab\x0a\x00\x9a\x67\x82\xa4\x17\xd4\x99\xeb\
\xcd\xf0\x86\xb7\x1d\xcb\xb7\xda\x6b\xb0\x3d\x2d\x0b\x40\xb6\x1c\
\xe2\xc5\x25\x7c\x6b\xf4\x9e\xa3\x5f\x07\x41\x2c\x9d\x7a\xba\x95\
\x7a\xdb\x6e\x79\x11\xfd\x56\x7c\xdd\x3a\x78\xf3\xeb\x60\xed\x1a\
\x5b\xee\xed\x3b\xe1\x8b\x5f\x33\x42\x2f\x6c\x8f\x92\xfb\xf9\x2b\
\x2b\xd4\x6a\x24\x17\xdc\x06\xe9\xc8\xf9\xa3\x06\x10\x19\x62\xa1\
\x0c\x9e\x3a\x48\x0a\xa3\xcc\x7a\xfb\xde\xca\x7b\x58\xa1\x54\xe4\
\xcc\xa1\xd3\x41\xd8\x35\xa8\xbf\xdf\xc1\x79\xef\xd8\xc4\xcd\x2d\
\x34\xd8\x89\x66\x9a\xab\x4c\x46\x97\x1c\xe6\xb4\x72\xf0\x86\x7c\
\x93\xf6\x04\x66\xc8\xd4\x04\x8e\x96\xe7\x91\x7e\x19\x82\x42\xbe\
\xdf\x78\xf6\x69\x71\x70\x00\x3c\xe9\x24\x38\xf9\x44\x78\x64\x67\
\xfc\x0c\xa2\x3d\x0a\x92\x37\xfa\xd3\x7c\x16\xd1\xd9\xda\xce\xa5\
\x01\xe2\xc0\xf9\x7a\x5a\x83\x00\xaf\x00\x32\xac\x1b\x18\xbd\x0f\
\x41\x52\x6a\x00\xa9\x8b\x72\xdc\x77\xf0\xa4\xaf\x08\xe7\x50\x4b\
\xfb\xfa\x9c\x75\xc5\xd8\x03\x08\x09\x78\xe0\xb8\x5e\xc1\x97\xb7\
\x1c\xe2\xdc\xf3\x37\x2c\xed\xcf\x37\x2c\x29\x40\xbe\xe4\xd9\x74\
\x64\x96\xcb\xfb\x25\x4f\xd1\x46\xab\x8d\xba\x6f\xa5\x33\x3d\x49\
\xea\x3d\x89\x7c\x52\xa5\x41\x72\xfc\xe6\xb4\xfc\xce\xc1\x09\xc7\
\xc3\xc3\xdb\xe3\x67\x90\xc6\x8f\x9c\x88\x30\xcb\x7c\xcc\x6b\xf1\
\xa4\x0c\xd5\x1f\x6f\xf0\x44\x7a\x74\xf7\x04\x20\xa8\xe6\xe1\x64\
\x99\x05\x12\x0c\x5e\xe4\x2c\x52\x01\xc8\x3b\xa1\x07\xa9\x0f\xb9\
\x99\x90\x9e\x5f\x38\x29\x3b\x2b\xe7\x3b\x0a\x19\xe1\x69\x8b\x70\
\xf9\xa7\xb7\x71\xde\xbb\x9e\xb2\x74\x1f\x70\x5c\x32\x80\xfc\x9e\
\xa7\x98\x9b\xe5\x12\x5f\x72\xb6\x05\x0a\x73\xb7\xef\xd7\xd3\x66\
\xc8\xd5\x10\x5e\xe9\xb0\x4a\x7b\x8e\x2a\xbf\x98\xf1\xff\x6c\xf3\
\xf3\xc3\x7e\x68\x17\x66\xc5\xce\x1f\xad\x3f\x72\x22\x3d\x45\xc5\
\x12\x80\x19\x79\x89\xaa\xae\xb8\x6b\x8f\x51\xd5\xb7\x3c\x47\xd4\
\x63\x78\xaa\xef\xe6\xa5\x00\x4a\x51\x56\x30\xd4\x4d\x05\x94\x42\
\xcd\xab\xd2\x83\xd4\x4f\xf3\x74\xeb\x73\x95\x73\x0a\x2b\xbf\x68\
\xcd\x26\x3e\x85\xe7\x7c\x96\xe8\xa3\xf2\x4b\x06\x90\xb3\xe6\xf8\
\x28\xe2\x23\xeb\x35\xe3\x35\x0e\xe7\x39\x4f\xa9\xa2\x8f\x82\x55\
\xbf\xf2\x29\x95\xfe\x1f\x8f\xcd\x9b\x60\xd3\x86\x41\x9b\x14\xf5\
\xfb\xb0\x75\x5b\x1d\x5c\xa9\x30\x2b\x79\x1f\xfd\x11\x79\x49\x56\
\x8c\xe5\xc3\x6c\x95\x19\xd9\x8d\x30\xfc\x2a\x9c\xd2\xf7\x64\x78\
\x45\x86\xe7\x28\x43\xcf\x11\x78\x92\x62\x1c\x76\x8d\x42\xae\xc8\
\x94\x9a\xc8\x0c\xaf\x84\xa7\x1c\x15\x8b\x39\x39\xf8\xe5\x4b\x0f\
\xf1\x91\xb7\xc3\x7f\x6a\x31\x54\xbe\x4c\x4b\xd1\xe9\x65\x87\x78\
\x23\xf0\xa5\xb2\xa4\xe8\x0b\x10\xf4\xfb\xf1\x03\x7a\xf4\x89\x96\
\x06\x43\x53\x7e\x08\x0e\x0d\x8a\xa2\x80\xe7\x3d\x07\xce\x3c\x63\
\xf0\x58\x57\x3f\x11\xb2\xe8\x9f\x6e\x84\xef\x7c\xbf\x0e\x8e\x54\
\x98\x55\xdd\x25\x18\xb2\x42\x2d\x51\x1f\x30\x57\x26\x1a\x5a\x89\
\xb4\xf9\x2e\x44\x7a\x16\x69\x5c\x96\xf7\x88\x84\x55\xa3\x7c\x51\
\xe7\xd5\xfe\xd1\x2a\xf2\x5e\x23\x96\x0f\x3e\x83\xd5\xab\x1f\xca\
\xad\x7c\x2f\x3c\xb4\xf7\x71\xfc\xe2\x05\x1b\xf9\x5a\xf3\xaa\xb6\
\xa3\xa9\x03\xe4\x8b\xb3\x3c\x73\x01\xae\x5b\xec\x73\xe2\xc8\xb8\
\x15\x30\x52\xa0\x08\xde\x8d\xa4\x5e\x22\x46\xde\xb6\x97\x0a\x18\
\xde\x0f\xbc\xc5\x6b\x5e\x01\x27\x1c\x97\x37\x87\x7e\x1f\x7e\x70\
\x33\x5c\xfd\x03\x75\x7e\xc1\x08\xb1\x94\x47\x19\xf1\x2b\x5e\xd5\
\x69\x0e\x40\x1a\xc8\x02\x88\x4c\xd7\x00\xa2\x8c\x1e\x9a\xc1\x90\
\x04\x87\xc1\xab\x9e\x68\x49\x7e\xf4\xf1\xae\xf5\x54\x4a\x3f\xbd\
\xd2\xc0\x88\x80\x42\x01\x84\x5e\x8f\x9d\xc7\x38\x5e\xf4\xcb\x1b\
\xa6\xfb\xbf\x24\x53\x0d\xb1\x3e\xe1\x59\x33\x3f\xc7\x65\xe5\xf0\
\x7f\xc8\x83\x43\xb8\x57\x87\xe7\xd8\x59\x44\x02\x65\x12\x70\x0c\
\x3d\xc9\x86\xf5\xf0\x86\x57\xc3\xfa\x63\xf3\xe7\xf1\x8d\xab\xe0\
\xd6\x3b\x6c\x60\x34\xbd\x0b\xa9\xc5\xdb\xca\xbb\x0c\xab\x9a\x08\
\x69\x70\x20\xa3\x10\x69\x94\x4d\x84\x57\xa3\x03\x39\xa1\x71\x7b\
\x19\x4e\x91\x0e\xaf\x74\x58\x35\xe2\xc9\x33\x49\x19\xf2\x2b\x5e\
\x6b\x12\x21\x55\x10\x4e\x21\x64\xad\xe4\x28\xc7\xf5\x46\x9b\x84\
\xe3\xe4\x23\x05\x9f\xdd\xe2\xf9\xe7\xe7\x3b\xfa\x1d\x24\x30\x69\
\xaa\x00\x39\x61\x8e\xdf\x2f\x4b\x5e\x9a\x02\x42\x0c\x28\x23\x20\
\x78\x03\x38\x19\x21\x97\x06\x46\x65\xbc\xaf\x3a\xb7\x1d\x38\x60\
\xf0\xe2\xf0\xae\xfb\xe0\xd0\x6c\x1d\x18\xd1\x33\x48\xd3\x79\x64\
\xf4\x27\xe3\x2c\x22\xc8\xa9\x4c\x10\x52\x55\xe7\x13\x2b\xac\xaa\
\xea\xb8\x31\x08\x2c\xc0\xd4\x0e\xe6\xde\x00\x87\x3e\xa4\xcb\x33\
\x49\x11\xf2\x19\xf2\x28\xe3\x1b\x81\xb3\xd2\xca\x03\x6a\x9e\x04\
\x46\x55\xd6\xaf\xd7\x79\x65\x7f\x8e\xff\x1b\xf8\x68\x42\xa5\xad\
\x68\x6a\x21\xd6\x17\xe6\x79\xd5\xe2\x22\xdf\x5c\x2c\xe9\xe9\xb3\
\x86\x19\x5e\xf5\xa9\x85\x53\xf2\x2e\x3d\x49\xf4\x89\x56\x02\x1c\
\xa5\x87\x67\x9c\x0a\xaf\x3d\xaf\xdb\x7c\xbe\x77\x03\x5c\x71\x8d\
\x7d\xfe\xd0\x8f\x32\xdb\x9c\x43\xc4\x2d\x3b\xd4\x92\x3b\xa5\xcc\
\xc7\x8c\x2b\x16\x52\x8d\x00\xd3\x10\x62\x35\x86\x55\x15\x68\x24\
\xbf\x10\x21\x96\xca\xd7\xce\x1d\x91\xf0\x49\x9f\x43\xcc\xb0\x2b\
\x96\x1e\xdf\x17\x5d\x8f\x57\xbd\x7d\x3d\xd7\xe4\xad\x74\x9a\x8a\
\xe6\x2a\xcd\xf4\xd7\xbb\xd8\xbc\xb8\xc8\xa7\xfa\xf2\x4b\xdd\xa4\
\xa7\xb0\xbc\x86\xb7\x43\xa4\xe4\x0b\xbf\x5c\x70\x94\x83\xfc\x19\
\xa7\x77\x9f\xd3\xf3\x7f\x12\xf0\x42\xd6\xc4\x1c\x82\xb4\x71\x97\
\x0f\x0f\xac\xb7\xfd\x8d\x97\xae\x27\x75\x17\x19\x37\xa6\xd7\xa0\
\x0f\x63\x7c\x6f\xd4\x95\x9f\x5d\x93\xed\x6a\x5f\xc0\x17\x59\x8f\
\xda\x63\x79\xeb\x13\xd9\x7d\x5b\x4e\xa9\xbb\x2c\x1d\x79\x66\x7c\
\xc9\x5f\x7d\xda\xb3\x61\x1a\xb6\x3d\x95\x10\x6b\xdd\x46\x3e\xd6\
\x2f\x79\x66\xeb\x85\x16\x46\x13\x7b\x4f\x62\xbe\x50\x6c\x02\xc7\
\x90\x7f\xca\xc9\xdd\xe7\xb4\x71\x3d\x1c\xb7\x19\x76\xed\xb5\xc3\
\x2c\xa8\x7b\x96\xa6\x30\xab\x96\x1e\xfd\x69\x20\xe9\x2d\x08\xc3\
\x90\xdc\xf0\x2a\x38\x9f\x44\x42\x2c\xfd\x9e\x43\x87\x55\xfa\x0c\
\x02\x22\xdc\x12\xe7\x8f\xa2\x18\xb4\x29\xca\x31\xbf\xef\x87\x1d\
\xe9\x39\xa9\xb9\x04\xbc\x2a\x2c\x2c\x0d\xaf\x67\xf1\xc6\xe9\xe7\
\xac\x99\xe5\x8f\x80\x7f\x93\xa1\xdd\x24\x4d\x0c\x90\xcf\xcd\xf2\
\x1a\x5f\xf2\xfe\xc6\x9d\x35\xf3\xaa\xed\x7c\x7d\x03\x3c\xbe\x0e\
\x8e\x60\xf7\xf2\x83\x45\x5b\x77\xcc\x64\x73\xdb\xb8\x01\x76\xec\
\xb6\xc3\xac\x54\x88\x15\x3b\x7f\x98\x61\x56\x2d\xa3\xc8\x8d\xcb\
\x75\x48\x15\x3b\x87\xd4\xc0\x20\xd2\x1e\x6a\x07\xf3\x62\x68\x88\
\xfa\x40\x3e\x3a\xb7\x54\xf5\x0a\x6a\x67\x10\xc9\x43\xbc\x13\xa9\
\x81\xa4\x1c\xe3\xc3\x0a\x19\x83\xf3\x47\xcc\xf0\x2d\x9e\x04\x4b\
\x08\x9c\xdf\xb8\xf4\x51\x3e\xf7\xf6\xcd\x5c\x95\xd0\x6e\x23\x4d\
\x04\x90\x6f\x79\xd6\xed\x3a\xc2\xc7\xcb\x92\x22\x70\xc3\x4d\x40\
\x69\x08\x57\x2c\x6f\x52\x03\x4f\x0c\x1c\x43\x1e\x6e\xfc\xc4\xa6\
\x2b\xf5\xfb\xc2\x3b\x61\x9c\x3f\x62\x00\x81\x00\x10\xc1\x5d\xa7\
\x05\xaf\xba\x49\x20\xc8\x8a\x4e\xf0\x46\x00\xa9\xee\x7e\x7c\xb7\
\xce\x1f\x35\x83\x67\x50\xd7\x7a\x52\x55\x81\x01\xc6\x1e\x25\x78\
\x62\x55\x19\x7f\xc5\x33\xbc\x87\x05\x12\xcb\x83\x68\x60\x04\x72\
\xa7\x3c\x47\x2a\xed\xa1\xf0\x14\x45\x8f\x4f\x6c\xf1\x9c\x73\xbe\
\x63\x3e\xb1\xcc\x49\x9a\x08\x20\x7b\xe6\xf9\x9d\xb2\xe4\x39\x81\
\xc1\x76\xf4\x1c\x31\x6f\x52\x7b\x43\x3e\x04\x43\xec\x6b\x42\x2b\
\xde\x42\x1f\x0e\x1e\x86\xcd\x1b\xbb\xcd\xcd\x7b\xd8\xb3\x2f\xf4\
\x56\x31\x60\x58\x4f\xb6\x72\x3f\x7a\x32\x1a\xcf\x90\x41\x7f\xc4\
\x04\x84\xf1\x0f\xff\x58\xf7\x11\x10\xa4\xa7\x80\xe0\x69\x96\x1f\
\x7a\x0e\x1d\x52\x55\x17\xc2\xe0\x6a\x4f\xac\x86\x65\x95\xc7\x28\
\x4a\xe1\x4d\x12\x20\xf1\xc3\x72\xe4\x38\x8c\x13\x51\x2f\x61\xf1\
\x22\x20\x29\x86\x73\x2b\x07\xf9\xb3\xfc\x21\x3e\x0c\xfc\x47\x43\
\xbd\x59\xd4\xf9\x90\x7e\xe9\x1c\xcf\x1d\x7e\xdb\x7a\xf8\x3f\xde\
\x16\x38\x3a\x7a\x12\xeb\xa0\x56\x19\xab\x3e\x73\x78\x83\xb7\xf5\
\xe1\xae\xb3\x83\xdd\x7b\x61\xef\x7e\x35\xaf\x98\x8c\x89\x39\x8d\
\x1e\x49\x67\xd4\x69\x0c\x37\xa5\x97\xf5\xcd\x75\x52\x72\x5a\x87\
\xf1\x5a\x99\xd6\xb7\xe6\x8b\xf5\x0e\xce\x7f\x72\x4d\x4a\x63\xcd\
\x62\xb2\xe7\xd8\x44\x6a\xe3\x35\xe6\x8b\xe3\xb7\xb7\xcc\x72\x7a\
\x57\x3b\xe8\xec\x41\x66\x3c\x7f\x56\xc2\x31\x35\x01\x95\x22\x73\
\xc0\x91\xa5\x28\xe9\x21\x4a\x43\xf9\x06\xef\x96\xdb\xe1\x79\x67\
\x74\x0b\xb3\xfe\xe9\xa6\xf1\x82\x36\x5e\x88\xd0\x8b\xfc\x30\x4b\
\xdc\x92\x54\xdb\x69\x87\x7f\x62\xe1\xd5\x88\x6f\xed\xb8\x32\xb4\
\x31\xae\xe0\xa0\x5e\x8e\xfb\x19\x9d\x35\x50\x1e\x03\x82\xc3\xf8\
\xc8\x83\x94\x83\xce\x24\xcf\x57\xf5\x86\x77\xca\x48\xf8\x44\x44\
\xf6\x32\x92\xf6\x84\xef\x66\x7c\x50\xbe\xde\x39\xfe\x33\xf0\x2f\
\xf3\x56\x3e\xa4\x4e\x1e\xe4\x73\x73\xbc\xde\xc3\xeb\x03\x8f\xa1\
\x0c\xda\xfb\x06\x83\x8f\xed\x8c\x89\x3a\xda\x53\xc8\xd0\x2a\xf0\
\x20\x43\xde\xc3\xdb\xe1\x87\x3f\x6e\x3f\xbf\x1d\xbb\xe0\xda\xeb\
\x13\xf2\xe6\x6c\x00\x19\x6d\x1b\x1f\xc5\x4a\x9d\xb4\xec\x3b\x2a\
\x63\xe2\xd2\x5e\xc5\x5a\x5b\xcb\x53\x5b\xef\xa0\xa2\x61\xb0\xf2\
\x22\xc9\xb9\xb6\xf0\x16\xa6\xbd\x8d\xe5\x78\xf3\x96\x59\x5e\xdd\
\xc5\xd6\x7b\x6d\x1b\x6c\xf1\xf4\x5c\x9f\xbf\x2d\x3d\x4f\xce\x59\
\x48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
\x8e\x5d\x37\x98\xd3\xc2\xe2\xe0\x30\x7f\xdd\xcd\x70\xc3\x6d\xc3\
\x71\x35\x08\x53\xbb\x3b\xcd\x3b\x7d\xb0\xcb\xcb\x1d\xde\xca\x5b\
\x0b\xa3\x77\xf5\xd4\xae\xac\xd2\xd1\x73\x48\xb5\xd3\x5a\x79\xeb\
\x23\xed\x45\x58\x1e\xfb\x06\xf8\x80\x27\x3e\xfe\x2e\xf9\xe6\xf7\
\x6d\x19\x9f\xd6\x9d\x49\x7d\xc4\xa4\x07\x33\x2a\x6f\xb5\x99\xe9\
\x05\xed\xef\x29\xd6\x73\x56\x9b\xc7\xbe\xad\x0e\xe9\x9b\x17\xf8\
\x57\x7d\xcf\xd3\xbd\xdc\x65\x52\x3b\x90\xdc\xa5\x1a\x76\x36\xeb\
\x4b\xdd\xb4\x31\xca\x50\x4a\xef\x46\x56\xac\xab\x77\xb7\x7b\x1f\
\x80\xbb\xef\x1f\x58\xe3\xba\x21\x40\x0e\x1d\x1e\x80\x33\x1a\x2f\
\x5b\x9e\x8b\x38\x58\x62\x1f\x62\x6c\xfb\x71\x77\x6f\x64\x46\x21\
\x89\x57\x61\x8f\x3c\xac\x56\x61\x89\x8f\x1c\xcc\x7d\x08\x06\xf9\
\x4f\x4f\xb5\x0f\x23\xaa\x4f\xed\xc6\x0e\xe5\xa3\xc3\xb8\x1f\xdc\
\xbd\xa7\xf6\x68\xb7\x3a\xa4\xfb\x22\xac\x57\xe9\xa9\xf4\xe2\x60\
\x5d\x0a\xd9\xb0\x0f\xea\xc1\x81\xdc\x53\xfb\xa7\xae\xc2\x87\xfd\
\x0e\x1f\xff\x3e\xab\x9c\xe3\xbd\xc0\x27\x72\x6d\x3e\xdb\x83\x6c\
\x79\x80\x63\x8b\x27\x73\x57\xbf\xcf\xa9\x8b\x99\xde\xc3\xf2\x0a\
\x16\xcf\xf2\x32\xa6\xa7\x68\xe1\x3d\x02\xbe\x02\x51\x10\x12\x68\
\x60\x58\x80\x68\xe1\x49\x6a\x00\x11\x77\x69\xec\x2a\xd9\x6e\xa1\
\xac\xf8\x5f\x7a\x93\x0e\x9e\x43\xf2\x6a\xff\xe3\x61\x79\x09\xe9\
\x21\x12\xde\xa2\xe9\x3b\x7e\xb5\x27\x89\x7a\x07\xcb\x2b\x44\x3c\
\x45\x83\x17\xb9\xbf\x58\xcf\x73\x73\xbd\x48\xb6\x07\xe9\x9d\xc2\
\xfb\xfa\x7d\x4e\xd5\x1e\x43\x1a\x8f\xf6\x04\xba\xcc\x8a\x0f\xf5\
\x79\x64\xe4\x15\x0c\xa3\x8d\x5d\xb5\x98\xd8\xf0\x02\x8d\x4f\x5e\
\x0c\x60\xc8\xd8\x39\x09\x12\xc6\x69\xfd\x79\xac\x58\x48\xd5\x96\
\xac\x66\xae\x1a\xc7\x0d\xee\x95\x17\x41\x1a\xbe\xf6\x24\x2e\xdc\
\x69\x5d\x65\xb4\x30\x7a\x8c\x5b\xbd\x24\x4c\x3e\xc6\x45\x78\x08\
\x06\x3b\x76\x39\x14\x34\xf0\x22\xd2\x4b\xe8\x7c\xe5\x59\x34\xaf\
\x92\xaf\x54\xb2\xfb\xf1\x23\xe6\xd1\x5c\x0c\x4f\x61\x7a\x11\x3f\
\x1a\xfb\x34\x7f\x88\x77\x03\xff\x33\x47\xef\x59\x87\xf4\x6f\x79\
\x66\xbc\xe7\xb7\x46\xc6\x36\x3e\xf8\x98\x87\x25\x7d\xf8\xd2\x9f\
\x06\xb5\x0e\xf8\xc1\x81\x3c\x63\xf7\x96\x7d\x59\x06\x1d\x93\xa9\
\x11\x1c\x09\xb9\xa3\x07\x77\x55\xdf\x97\x8c\x3d\x89\x00\x4e\x60\
\xe5\xbe\xc3\xa5\xda\xea\xfe\x83\xa7\x78\x46\x98\x1b\x93\xdf\x9a\
\x73\xae\xbe\x34\x4f\x7b\x73\xfd\x2d\x96\x39\xde\xd8\x7c\x20\xd0\
\x64\x47\x09\x1b\x94\xb6\xea\x07\x21\xe1\x87\xb6\x6c\xc9\x7b\x82\
\x9b\xe5\x41\x76\xf7\x39\xdf\x7b\x9e\x29\x27\x56\x53\x78\xca\x7b\
\x78\x4c\x40\x69\x20\x59\x8a\x8c\x2a\x35\x12\x0a\xc5\x3c\x80\xb5\
\xd8\x35\xaf\x51\x86\x73\x8a\x8d\x61\xf1\x2a\xc3\x1d\xd9\xb1\x36\
\x68\x2b\xab\xf8\x49\xaa\xbc\x83\xc1\x1f\x8d\xeb\xc2\x3e\x47\x5e\
\x25\xe6\x39\xd4\x39\xa4\xf2\x22\x95\xc7\xa8\xbc\x49\xca\x93\x78\
\xc1\x4b\x7a\x8d\xa1\xb7\xb1\xea\x04\x1e\xc4\x87\xe7\x8a\x91\x8c\
\x3e\xf4\x28\xf2\x0c\xd2\xe4\x45\xa4\x07\x29\x07\xf7\x33\xdc\x2f\
\xf2\x16\xe0\xf3\x4d\x6a\xcf\x7b\xcc\x5b\xf2\x9b\x66\xe8\x12\x4b\
\xeb\x1d\x49\x19\x7f\x2a\xe4\xca\xd9\x5d\x1a\xbd\x8b\xda\xbd\x34\
\x60\x4c\x9e\xb1\x63\xc5\x3c\xa2\xdc\x95\x46\xbb\xb7\x1f\xa7\xf5\
\x15\x18\x82\x2c\x1b\x59\x72\xe2\x12\x75\x6a\xfa\x88\xb4\x0d\xbc\
\x4a\x65\x9c\xa5\x31\x07\x2f\xe6\x98\xd2\x41\xc4\x93\xc4\x36\xa1\
\x94\x97\xc8\x89\x12\xac\xb0\x3b\x16\xb6\x6b\x5b\xcb\xb1\xcf\xd2\
\x83\x2f\xf8\x60\x8e\xe9\x37\x02\xe4\x0b\xf3\xbc\x82\x92\x17\x69\
\x37\xa5\x77\xdb\xa6\x74\x2c\x1c\x93\x4a\xc8\x76\xc1\x9a\x27\x94\
\x69\x2a\x46\x2a\xbb\x81\x57\x3b\xd8\x47\x64\xae\x79\x90\xca\x98\
\x0d\x50\xe8\xb2\x28\x08\x2c\x4a\xb5\x89\x81\x45\x97\x45\x64\xb7\
\x36\x29\xcb\x8b\xc6\x40\x52\x46\xf4\x6d\xad\x47\xdb\x35\x35\x43\
\x73\x25\x73\xae\xed\xe9\x08\x66\x98\xfe\xd9\xbf\x9d\xe7\x67\x26\
\x06\x08\xf0\x1b\xa5\xc7\x99\x68\xb4\x62\x3c\xa5\x64\x53\xf0\x88\
\x67\x69\x04\x42\xa4\xcf\x18\xcf\xca\x07\xbb\x98\x06\x87\x9a\x57\
\x60\x54\x5a\xc1\x11\xe3\xf7\x24\x40\x41\x7c\x3e\x6d\x2e\xab\x5f\
\xf9\xf4\xac\xc6\xaf\xc6\x8d\x78\x75\xed\x31\xe4\x5a\x46\xc3\xd4\
\x4c\x9d\x77\xda\xf0\x54\x5f\x56\xf8\x6e\xae\xad\x94\x53\xad\x97\
\x61\x07\xae\xdf\xe7\x37\x26\x02\xc8\xdf\x7a\x9e\x54\x7a\xde\x12\
\x9b\x50\xcc\xf8\x6a\xbb\x6f\x62\x72\xc1\x99\xc4\x30\xa0\x94\x62\
\x63\xe5\xa9\xdd\xac\xd5\xe1\xdd\x53\x33\x26\xf9\x5e\x23\x0a\x0c\
\x5f\xe7\x47\x8d\xbb\xed\xa5\x75\x64\xf4\x17\xe5\x0f\x79\x26\x28\
\xac\xf9\x27\x74\xd5\xe4\xb5\x9b\x00\x93\x5c\x5f\x94\xa1\x6b\x19\
\xa4\xec\x1a\x04\x89\x30\xcb\x18\xeb\x57\xb6\x78\x4e\xec\x0c\x10\
\xb7\xc0\xbb\xbd\xe7\x98\x86\x41\x92\x80\x09\xd2\x91\x10\xcd\xbc\
\x0c\xb0\x64\x29\x39\x23\x1e\xb6\x14\x99\x0a\xb7\xf4\x78\xd6\xee\
\x1c\x33\xe2\x98\x27\x19\xb5\xcf\xb8\xa2\xe7\x15\xd5\x87\x2e\x0f\
\x80\x12\x19\x2f\xe6\x31\x6a\x6b\x6a\xef\xc2\xe3\xbc\x00\x4e\xd2\
\xf8\x5b\xae\xb7\x0c\xfd\xb4\x07\x8f\x81\xa0\x85\xad\xae\xf7\x47\
\xb8\xb0\x33\x40\x4a\x78\x6f\x1b\x50\xa4\xc0\x61\xc6\x87\x0d\xde\
\x63\xd4\x87\x2c\x4b\x28\xb2\x89\x17\x05\xad\x36\x8a\xb2\xbe\x30\
\x96\xb1\xd7\x78\x12\x18\xda\x98\x23\x46\x61\xd5\xab\x81\xcd\x98\
\x73\xca\xb3\x48\x79\xd0\xf5\x25\x50\x74\x9c\x6f\x81\x24\x61\x8c\
\x6d\x74\x6f\xad\x5f\x69\xcc\x4b\xd7\x33\x1f\x98\xa8\x74\x8e\x1c\
\x31\x79\x28\x79\x5f\x27\x80\x7c\x61\x9e\x97\xec\x38\xc4\x99\x59\
\x93\x6e\x10\xb8\xd1\xb3\x24\x94\x98\x33\x76\xf6\x42\xe9\x03\x67\
\x02\x1c\x5e\xd4\xf3\xda\xe0\x50\x86\x28\x15\x2e\x0d\x5e\xce\x23\
\x05\x84\x14\x45\xda\x48\x1d\xc5\xc6\xac\xf1\x22\xf3\x08\x42\xa9\
\xc4\x61\xbc\x54\xa0\x69\x0d\x8e\xa6\x3a\xc6\xba\xe7\xd8\x4f\x66\
\x38\x55\x2b\x2b\x07\x63\x9e\xbd\xe5\x20\xe7\xc4\xd4\x1f\x05\xc8\
\x23\xb3\x5c\xf8\x07\xd7\xe1\xe6\x16\x33\x06\x92\xee\x55\x1f\x8e\
\x8c\x43\xbc\x7e\x64\x17\x53\x4c\x97\xcb\x54\x4c\x43\x38\x17\x03\
\x87\x75\xde\x88\x19\x59\xd4\x48\x15\x3f\xea\x4d\x32\x2e\xab\x9f\
\xd4\x58\x31\x50\x58\xf9\x28\x48\x12\x3a\xb3\xc2\xd8\xd6\xe0\x48\
\xad\x3d\xf6\x78\xe6\x21\x5c\xf0\x52\x0f\x15\x0c\x9d\x3a\x7a\x5c\
\x10\xc3\x81\xf9\xa2\x70\x8b\xa7\xf7\xc5\xdb\xf9\x95\x87\x0f\xc3\
\xdf\xdc\x0d\x6f\x7f\x56\xc6\xc4\xad\xb8\x35\x62\x84\x23\x30\x59\
\x0a\x4a\xe4\x73\x63\xda\x58\x3d\xbd\xd3\x44\x77\xa6\x18\x38\xa4\
\x11\x6a\x60\x10\xe7\x8d\xfa\xc2\x28\x6b\x41\x1e\x82\x97\x81\xfa\
\x83\x74\x55\xb7\x4e\xbf\x30\x54\x75\x47\xf9\xea\x25\xe3\xf0\x85\
\xdb\xe8\xe5\x1f\x03\x7d\xc8\x97\x7f\xf8\xf8\xcb\x40\x09\x44\xcd\
\xb3\xd2\x23\x9d\x58\xf5\x9c\x5a\xb7\x2a\x5f\x0e\xd2\x65\x39\x7e\
\x71\x58\x78\x6a\xeb\x3b\x7a\x19\x58\x86\x6d\x1f\xd8\x0e\x7f\xf9\
\xb9\xf0\xc3\x9d\xd5\x87\x3d\xdf\xf8\x2f\x38\xdf\x7b\xfe\xbd\x33\
\x7e\x42\xc1\x04\xc8\x9a\x45\x5e\x79\xf5\x36\x4e\x01\xf8\xca\x56\
\x78\xea\xb1\xf0\xb3\x27\x2b\x43\xd7\x06\x9f\x02\x45\xa4\xac\xf4\
\x09\x45\x49\xa5\xfb\xf1\x82\x67\xed\x3c\x39\x20\xd1\x87\x79\x11\
\x3e\x74\x01\x47\x23\x30\x2c\x50\xb4\x01\x4a\x65\xe1\xd2\xf0\x87\
\x06\x2e\x8d\x5d\x56\x19\x01\x45\x7c\x56\x2b\xc8\x8b\x76\x15\x48\
\x46\x6f\xc6\x4b\xb2\x3f\x89\x9b\x02\x8d\x65\xf8\x4e\x1b\x78\x0c\
\x14\xc3\x75\x2f\x7d\xf8\xc6\xdc\x04\x44\x6c\xbd\x87\xf2\x3f\xf5\
\xc9\xb0\x76\x06\x1e\xd9\xa1\xf4\xe9\xe0\xdb\xdf\xe3\x19\x9f\x7f\
\x39\x3f\x0b\xf5\x6f\x63\x34\x43\xac\xab\x1e\xe6\x97\x1f\x38\x38\
\xce\xff\xe5\x9d\xf0\xf0\xe1\x3c\x83\x6c\x73\x4e\xd1\xc6\x5f\x8b\
\xcb\x65\x3d\x12\xe3\x47\x16\xc5\x04\xaf\x11\x6e\xd5\x42\x03\x0c\
\x19\x04\xaf\x11\x1c\xba\x1f\x35\xbf\x5c\x90\x5b\xf5\xcc\xfe\x10\
\x65\x2d\xe4\xd4\x6d\x02\xdd\x19\x6b\xa9\xcf\x1f\xa6\x9e\x23\x6b\
\xa1\x2f\x6b\xbd\xad\xf9\x49\x3b\x69\x7d\xbe\x50\x3a\x7c\xf9\x8b\
\x60\xf4\x3b\x26\xe2\x7e\xd7\xbd\x70\xdd\x0f\xed\xff\x59\x37\x01\
\x72\xc3\x6e\xde\x24\xf3\x25\xf0\xf7\x5b\x33\x8c\xb3\x8d\xc0\x6d\
\x0c\x45\x97\xb7\x30\xac\x94\x27\xd1\xde\xa4\x09\x1c\x81\x21\x8a\
\x85\xd3\xf9\x51\x1f\xaa\x1f\xab\xfd\x88\x34\x3f\x52\x56\xeb\x47\
\x94\xe7\xca\x37\x6a\x63\xf4\x13\xe8\xd6\x78\x07\x61\xea\xb0\xc5\
\x7a\xa4\xf2\x34\xd5\x57\x63\x37\xda\x95\xba\x7e\xfa\x6c\x58\xd3\
\x1b\x1a\xb4\xba\x7e\x70\x13\xbf\x54\x47\x82\x01\x90\x4b\x8e\x70\
\xce\x4d\xbb\x78\x86\xe6\x7f\x6f\x17\x7c\x77\x67\xbe\x30\x4d\x13\
\x1b\x29\xc0\x52\x1a\x2a\xdf\x46\xe9\xa9\x85\x6c\x92\x47\x1b\x8b\
\x32\x1c\xbd\xdb\x8d\x78\x91\x3a\xe8\x7e\x05\xdf\x34\x7a\x7d\x59\
\x4c\x54\x3b\x8b\x6f\xc8\xe5\x95\x4c\x88\x3a\xd6\xbc\x63\xfa\x69\
\xe2\xb7\x5e\x1f\xbd\xd6\x0d\xf6\xd0\x06\x10\xba\xff\xf5\xc7\xc2\
\x4f\x9d\x89\xe9\x45\x6e\xf9\x11\xcf\xb9\x74\x8e\xb3\xb4\xdd\xd7\
\x00\xf2\x95\xfb\x78\xfd\x9e\x39\xcd\x1d\xd0\x86\x99\x96\xc2\x25\
\xae\x6a\x61\x1a\x95\xd3\x46\xe1\x0d\x8b\x51\x53\xae\xd8\x21\xf5\
\x8e\xed\x45\x5a\x1a\xdf\xc8\xa0\x94\x81\xd5\x8c\xb2\x9a\xa7\x6a\
\x6f\xc9\x69\xa3\xa3\x6e\xac\x55\xbb\x24\x08\x85\xfc\x26\x10\x64\
\x1b\x59\x26\xe5\x1f\xa6\x4d\x0f\x9b\x63\xa4\x6d\xd7\x28\xc3\x16\
\x6a\xf6\xd2\xf1\x7a\xc9\x39\x98\x1e\x64\xfb\x0e\xf8\xda\x37\x79\
\x3d\x8a\x6a\x00\xb9\x75\x17\xaf\xd3\x3c\x18\x80\xe3\xcc\x4d\x89\
\x49\x27\x26\x10\x7d\x49\x23\x16\xa4\xb3\x22\x5b\x2e\x92\x25\x4b\
\x60\x20\x3e\x4c\x8f\x0c\xcb\x30\xb2\xa0\xcc\x1b\xed\x55\x9f\x96\
\x71\x67\x5f\xb2\x2f\x43\x46\x73\x0c\x31\x3f\x53\x7e\x43\xc6\x20\
\x6d\xe8\xb0\xcd\xbb\xab\x56\xeb\x66\xf0\xc6\xc6\x91\xbf\x96\x4d\
\x7d\x56\x3f\xc1\x67\x81\xe4\x86\x5b\xf9\x05\x14\x05\x00\xf9\xb4\
\x67\xc3\x43\x87\x38\x57\x57\x02\x38\xe7\xf8\xe1\xff\xf5\xb6\x10\
\x28\xf9\xc6\x95\xb0\x7e\xb0\x60\x5a\x29\x18\x93\xcd\x51\x7a\xa6\
\x5c\x1a\xac\x1a\xb8\xb5\xb4\x34\xb6\x26\x03\x35\xea\xe9\xb2\xc6\
\x4b\xb5\x0b\xf4\xa3\xcb\x24\x4f\xd4\xab\xc9\x6d\xcc\x2f\xaa\xff\
\x98\xde\x5a\xe8\xdc\xcc\x0b\x5e\x4d\xff\x89\xba\x31\xbb\x2a\x23\
\xf5\xe5\xe5\x1c\x9c\xf3\x02\xcc\x30\x6b\xdb\x36\x5e\x7e\xb1\x67\
\x9d\x90\x24\x04\xc8\x67\x6f\xe4\xe5\xbb\xe7\x30\xbf\x13\xfd\x9c\
\x13\xc6\xca\x6c\xa5\x18\xcb\x18\xf5\x02\x60\x4f\xca\x5c\x2c\x6b\
\xfc\xa6\x7c\x62\xb1\x2d\xa3\xb0\xd2\x81\x81\xa3\xda\x5a\x46\x29\
\xeb\x88\x2b\x09\x4a\x7d\x59\xf3\x8f\xf5\x69\x8c\x9f\x02\x89\x1c\
\xc3\x47\xd2\xb2\x6d\x56\xec\x9f\xb3\x2e\x82\xa7\x37\xa2\x94\x3d\
\x48\xf9\x5a\xc9\xa0\xca\x60\x08\x10\x4f\xcd\x83\xec\xd8\xce\xfa\
\x2f\x5d\x12\x3a\x88\x00\x20\x37\xee\xe2\x55\x18\xb4\xb6\x80\x9f\
\xdc\x5c\x37\xde\xa8\x30\x72\x1d\x12\x93\xd1\x8b\x90\x02\x81\xac\
\xab\x0d\xa3\xf5\x22\x69\x39\xab\xfe\xa4\x3c\x72\x3c\x59\x0f\xb5\
\xb8\x19\xc6\x29\xf5\xa0\xe7\x50\x03\x83\xa4\x48\xbd\x5a\x5f\x99\
\x72\x78\x5d\x16\x9b\x9f\x18\xbb\xb6\x16\x32\xdd\x22\x5f\x9b\x6b\
\xce\x9a\x0b\xbd\x34\xd9\x51\xd2\xde\x54\xd9\x73\x9e\x0d\xc7\x1e\
\x83\xe9\x45\xbe\x7f\x3d\xe7\xc9\x25\x08\x00\xb2\x77\x9e\x97\x63\
\xd0\x99\x9b\x61\xa6\x7a\xa1\x64\x09\x97\x10\xbe\x52\x76\x6a\x77\
\x08\x00\x10\xab\x1f\x99\x74\xcc\x78\x9a\x76\x93\xd8\x4e\x8d\xee\
\x97\x70\xb1\xa2\xe0\xa8\x0c\xca\xd7\xf3\x35\x60\x34\xe9\x2c\x61\
\x08\x26\x50\x52\xe3\xcb\x79\xa9\x7e\xac\x3e\xa3\x7a\x68\x58\x63\
\x6b\xcd\x03\x59\xad\xb5\x51\x7c\xbd\x51\x34\xd5\x6f\x5a\xe3\x98\
\x7d\xf6\x0a\x38\xeb\x27\x19\x7b\x0f\x3f\xbe\xef\xd9\x13\x62\x60\
\x0c\x90\x2d\xac\x3d\xb2\xc8\x4f\x63\xd0\xf3\x8f\x0b\x85\xb4\xd0\
\x6f\x09\xa2\x27\x67\xee\x86\xd6\xa4\xd5\x02\x35\xed\x34\x92\xa7\
\x77\x29\x6b\x91\xe4\xce\x38\x1a\x43\x8d\x27\x17\x49\xca\x82\x6e\
\xa3\x0c\x56\xd6\x4b\x1a\xb5\xa5\x8f\xd4\x15\x6b\x9b\x31\xae\x17\
\x65\x7a\x1e\xb5\xb9\x0a\x5d\x45\xd7\x48\xd7\x37\xe6\xd3\xb4\x4e\
\x16\x28\xa2\x76\x63\xe8\xaa\xc9\xe6\x88\x8c\x55\x75\xf1\xbc\x33\
\x87\x09\x15\x66\xcd\x1d\xe6\x25\xbc\x6a\xfc\x09\x93\x31\x40\x8e\
\xe1\x67\x70\xf6\xef\xba\x9d\xb9\x99\xd0\x50\x85\x02\x4d\xa0\x58\
\x65\x52\x41\x42\x78\x6d\x04\xe6\xc4\x24\x79\xd1\xb7\xb5\x08\xde\
\xe0\xa9\xb1\x6a\x0b\x4b\x24\xaf\xc7\xb4\xd2\x55\x15\x31\x79\xaf\
\xf2\x55\xb9\x39\x5f\x25\x57\x9b\x7a\xb5\xfe\x55\x5e\xca\x6f\xca\
\xde\x30\xdf\x5a\x5e\xeb\x10\xd2\x7a\x37\xd6\x28\xe8\xd7\x6a\x6f\
\x8c\x19\xb3\x1d\x6b\x2c\x8c\x72\x0b\xb0\x67\x3e\x57\x74\x26\xbd\
\x48\xc9\xf1\x9c\xc0\x0b\x2b\x31\xc6\x00\xf1\xbc\x12\x83\x8e\x5f\
\x0b\x4f\x5a\x27\x84\xb7\x26\x24\x05\x89\x94\xd5\x16\xde\xd2\xbd\
\xa1\xc4\x98\xd2\x65\xe3\x46\xef\x12\x59\xb4\xaa\x8f\xc0\x16\xbc\
\x4a\xfb\x51\x35\x33\x2d\x8d\xa5\x66\x7c\x72\xde\x46\x1b\x2d\x9f\
\x09\x16\x4b\x2f\xca\x38\x83\x76\xaa\x3c\x18\xd3\x9a\xb3\x94\x4f\
\xcf\x5f\xcd\x39\xaa\xcb\xc4\x1a\xd4\xd6\xbb\x61\x2d\x2c\x40\x60\
\x95\x2b\x9b\xd3\xfa\x88\x01\xa3\xe2\x1d\x7f\x02\x9c\xfc\x13\x98\
\x8f\x7b\x71\x63\x2c\x8c\x01\xe2\x78\x19\x06\x9d\xb1\xa9\x3e\x60\
\xa0\x58\x35\x99\x14\x50\x82\x79\xea\x45\xa7\xde\x8f\xb9\xe3\x68\
\x25\xc7\x14\x18\xa9\xab\x65\x09\x06\x4e\xe5\xad\x32\x69\x5c\xd2\
\x38\xa5\x81\xaa\x89\x79\x5d\xcf\xea\x3b\xc2\x93\xfa\x4d\x8d\x13\
\x18\xb6\x92\x37\x6b\x5e\x56\x5e\xcc\x31\xe5\x25\x6a\x80\xd0\xf5\
\x75\xb7\xd6\x9a\x59\x65\xc6\x5a\x47\xed\x4e\xf6\x63\xd8\x69\xc5\
\x7b\xf6\xb3\x30\x0f\xea\x94\x63\x2c\x54\x00\x71\x38\x5e\x82\x41\
\xcf\xd9\x28\xf4\x6b\x08\x6b\x22\x59\x09\x1c\x28\xb6\xae\xf3\x66\
\xef\x22\xc6\x8d\xb5\x4d\xee\x46\x7a\x61\x65\xb9\xec\x4f\x8d\x3d\
\x32\x32\xab\xbe\x95\x8e\x19\x2d\xf5\x71\x47\xed\x2c\x43\xd3\x73\
\x56\x06\xee\x23\xfd\xeb\x3a\x35\xf9\x73\xe6\x12\xd3\x83\x5a\xc3\
\xd8\xba\xd5\xd6\x24\x67\x5d\xc4\xd8\x16\x60\x6a\xc5\xbe\x3e\xbe\
\xb6\x49\x39\x86\x9c\x87\xe4\x9d\x7e\x3a\x75\xef\xe1\x81\x72\xfc\
\xa8\x77\x00\x90\xcb\x79\x3a\x9e\x27\x61\xd0\xe9\x1b\xc7\x1d\x6b\
\xa5\x05\x42\x19\x02\xd4\x14\x69\x28\x48\x53\x4d\xf1\x91\x32\xb3\
\xdc\x58\x98\xb0\xb1\x31\x41\x6b\x05\x72\xf3\x91\xb4\x69\xbc\x11\
\x60\x90\x71\x45\x81\x12\x03\x49\xa6\x9c\x9d\xf2\x62\xfc\x20\xdb\
\xd2\xe8\x75\xb9\xb9\x66\x55\xb1\x05\xc4\x08\x30\x6a\x1b\xb8\xac\
\xab\x78\xa7\x9d\x46\x05\x88\xf1\x7d\x90\x7e\x1a\x6f\x18\xfc\xbb\
\xc7\x00\x20\x7d\x5e\x84\xab\x7f\x91\xf5\x1a\x07\x4f\x5d\x5f\x17\
\xa0\xb6\xfb\x08\x9e\xac\xab\x77\xaa\x49\x94\xa3\x01\x5a\xe4\xcd\
\x7d\x00\x00\x20\x00\x49\x44\x41\x54\xa1\xc1\x97\xed\x5d\x2c\xa0\
\xa8\xb1\xe5\x58\xb2\x4d\x6d\xce\x0d\x69\xdd\x57\xca\xd8\x93\x57\
\xa2\x6d\xcc\x70\x92\xe9\xa6\x39\xc9\x3a\x4a\x4f\xa3\x75\xf6\xd4\
\xf4\x5b\xab\xa7\x75\x9f\x28\xaf\x15\xa7\xd6\x5c\xca\x28\xeb\xca\
\xea\x96\x5d\xaa\x3e\x4f\x79\x0a\xf4\x1c\xd6\xe3\x5e\x07\x83\x7f\
\xc3\x1d\x00\xa4\xc7\xd9\x18\x74\xea\xfa\x61\x07\x11\xe5\x45\x91\
\x2a\x84\xad\x09\x66\x4c\x58\x33\x1a\xdd\xab\x51\xa8\x17\x4d\x53\
\x8d\x1f\x59\xd4\x5a\xa7\xb9\x79\x23\x5d\x33\x66\xc2\x7c\xd4\xd8\
\xb4\xf1\x34\xf4\x23\x8d\xa2\x51\xb6\xdc\x7c\x02\x2c\xe6\x66\x96\
\x02\x84\x51\x6e\x14\xb7\xb6\x91\x9a\x5d\x2a\xfb\x09\x64\x57\xe3\
\x7a\x0f\x6b\xd6\xc0\x49\x27\x31\x06\x46\x78\xbd\x10\xc6\x67\x90\
\x17\x18\x32\xf3\xb4\xf5\x61\xc7\x01\x08\xd4\x60\xc1\xee\x44\x68\
\xc8\x35\xfd\xa7\x8c\x5c\x67\x62\x0a\x17\xfd\xe4\x84\x5b\xb2\x5b\
\x3b\x53\xe7\x49\xc3\x90\x72\xd5\x16\x45\xa6\x33\xc1\xe1\x75\x9d\
\xaa\xdc\xe0\xf9\x48\xfb\x20\x6f\xa5\x53\xf2\xc9\xfe\xc5\x70\x59\
\x3a\x11\xfd\x45\x8d\x3e\xa2\x7f\xd9\x4f\x2d\xc4\x0c\x93\x66\x5f\
\x96\x58\x49\x0f\x22\xfb\x34\xc0\x73\xca\x29\xd8\x07\x75\x3f\xc0\
\x44\x31\xac\x59\xfb\x1c\x3c\x1e\x4e\x3d\x56\x09\x13\x03\x81\x21\
\x84\xd5\x4e\x25\xc3\xc9\xd7\xd9\x41\x9f\x72\xe7\xb0\x94\x58\x29\
\x3c\xe5\xb2\x4d\xb2\x94\x1e\x13\x26\xd6\x4e\x2f\x9e\x2e\x13\x7d\
\xa4\x42\xac\xd8\x9c\xe5\x18\xb5\xd0\x35\x32\xae\x09\xbe\x8c\x39\
\x59\xeb\x63\x51\x53\x68\x14\x5d\xcf\x08\x20\x52\x7d\x45\xc5\x56\
\xe3\xd4\x42\x2a\x39\x9e\x6e\x37\xcc\x9c\x74\x32\xe6\x1b\xf5\x0a\
\x13\x33\x6c\xa1\x87\xe3\xd9\x96\x12\x9e\x72\xac\x5a\x5c\x2d\x8c\
\x10\x3a\x4c\xd4\xdb\x45\x95\xa0\x33\xd6\x22\x59\xe3\x34\x80\xce\
\xdc\x75\x2c\x21\xd4\x5c\xe2\x9d\xd6\x65\xab\xb5\x93\x0b\xa1\x8d\
\x58\x1b\x74\x55\x37\x66\x80\x22\xed\x64\xc2\x33\xfa\xff\x71\x30\
\xd2\x55\x63\x71\xa2\xf4\x7e\xfc\x43\x3b\x9e\xf1\x6f\x88\x04\xd5\
\x54\x1b\xdd\xae\x26\x98\x1b\xd7\x09\x80\xeb\xc2\xaa\x35\xb0\xbb\
\xe8\x32\xd4\x3d\x8a\x90\xd9\xaa\x5b\xf5\x9d\x1b\x52\xe9\x29\xe0\
\xe1\xc4\x13\xeb\xe3\x0d\xef\x67\x00\xae\x60\x1d\x4f\x45\x7d\xc4\
\xb7\x6a\xf0\xe4\x75\x91\x81\x12\x88\x8c\xa1\xbb\xd1\xa8\x65\x95\
\xc8\x2e\x53\xab\xef\xa9\xef\x94\x56\x7d\xcd\xb0\x40\x68\xf4\x51\
\x9b\xa7\x25\xb8\xd1\x77\x0d\x28\xba\x6d\xb5\x69\x78\xd5\xc6\xba\
\x08\x8d\xa1\x26\x83\x9c\x4b\xce\x86\x90\x01\x7c\xab\x9e\x39\x17\
\xab\x8e\x2e\xb7\xfa\xd6\xf5\x73\xd6\x3a\x32\x6e\xcc\xde\xcc\xf5\
\x53\xfa\xf1\xc0\x71\xc7\x13\x0b\xb1\x36\xf1\x6a\x9e\x54\x00\xa7\
\x07\x4f\xb0\x86\x02\xf4\x1c\x9c\x78\x4c\xd8\x59\xce\x80\x31\x1e\
\xba\x4d\x4a\xb9\x52\x14\x65\x2c\xd4\xb3\x41\xbf\x31\x97\xdc\x64\
\x00\x6d\x79\x39\x8b\xa1\x65\x0b\xda\x5a\x20\x50\x97\x9e\x40\x30\
\x8e\x05\xcc\x4c\x19\x73\xe6\xd7\xc4\x8b\xe9\xb5\x29\xc4\xd2\x8c\
\xd4\xa1\x5d\x33\x62\x1e\x7b\x94\x34\x00\xd9\x74\xee\xda\xb4\x19\
\xfb\x5d\x88\xc7\xd1\xe7\xf4\x02\xea\xff\x7f\x0e\x70\xfc\x9a\xe1\
\x13\x2c\xa3\xd3\xe8\x64\x72\x91\x2d\x33\xb9\x0a\xaa\xfa\x32\x0a\
\x2c\xe5\xa7\x0e\x75\x31\x8a\x96\x6b\x05\xc7\x2a\x47\x36\x86\x9a\
\x2e\x0c\x60\x20\xf9\x89\xb2\x64\xbf\x6d\x64\x4b\xd4\x6b\xab\xa7\
\x94\x27\xaf\xb5\x4d\xac\xa1\xc9\x53\xfd\x5a\xa0\x6f\xdc\xac\x20\
\xba\x69\xaf\xdf\x30\x4c\x8f\x81\x21\x81\xf2\x8c\x02\x78\x6a\xd0\
\x72\x78\x9d\xb8\xb6\xde\x59\x20\x7c\x04\xcd\x31\xa1\x22\xdd\x98\
\xfd\xc7\xea\x79\x23\xd3\xb4\x98\xe6\x36\xd7\x28\x50\xb7\xba\xa6\
\xae\xf4\xf8\x72\xa1\x34\x30\x22\xed\xa2\xf5\x22\xed\x6a\xa2\xb6\
\x99\xa7\x45\x29\x9d\x44\x8c\xb7\xc6\x6b\x53\x57\x30\x72\xeb\x35\
\x57\xb2\xeb\x1c\xb3\x8e\xd8\xdb\x74\x70\x3c\x75\x06\xcf\x53\x46\
\x5f\x3a\x26\xae\xe3\xd7\xda\x63\xe5\xec\x60\x56\x9d\xc6\x39\x54\
\x3b\x64\x8b\x85\xcb\xf2\x26\x5d\x28\xb6\x90\x39\x1b\x45\xa4\x5e\
\xa0\xa3\x98\x67\x50\x24\x0f\xe7\xb1\x83\x76\x6d\xcc\xdc\x83\xb6\
\xab\x25\x55\xa6\x99\xb2\x8d\xbc\x45\xbf\x41\x48\x9d\x3a\xa4\xeb\
\xf1\x72\x3c\x89\x51\x67\xcd\x5a\x2a\x30\x8c\xc7\xac\xae\x92\xa7\
\x14\x38\x4e\xae\x8d\xec\x61\xf3\x1a\x2d\xc1\xca\x51\x52\x84\x0c\
\x6f\x92\x6a\xdf\x06\x90\x49\x19\x22\xbc\x24\xc0\x64\x1d\x5f\xbf\
\x7c\x43\xbb\xd8\xd0\x79\x85\x79\xd4\xf4\x78\xbc\xd1\x6b\x24\x44\
\xc9\xf2\x04\x6d\x28\xd3\x6b\x48\x9a\xe9\x31\xf6\x18\x5e\xa4\x07\
\xd7\x93\x0a\xe0\xa4\x60\x61\x86\x9d\x6c\x5a\x83\x4d\x1d\x84\x68\
\x5d\x25\xc3\x0d\xe4\x2a\x37\x6a\x64\xcb\x41\x4d\x9e\x04\xc2\xd8\
\xdd\x58\x87\xd8\x8b\xbe\xc6\x71\x56\x9a\xda\xca\xd4\x76\xbd\x33\
\xcb\x63\x2f\x89\x47\xe9\xea\xa3\x26\x12\x18\x55\x1a\x7e\xa2\xc0\
\x73\xfc\xa8\x85\x58\x80\x0d\xd9\xbf\xa0\x7e\x94\x52\x5b\x77\xd4\
\x86\x9f\x00\x4e\xed\x91\xee\x72\xc8\x93\xe2\x67\x50\x8b\x29\x2e\
\x0b\xb5\x19\xa7\xbf\x48\x1d\x18\xe3\xf4\xf1\x33\xc0\x66\x6b\x07\
\x3b\x76\x66\x75\x6e\x4c\x47\x35\xc9\x75\x68\x71\x16\x78\x82\xba\
\xd3\xc2\x3c\xe1\x99\x47\x9e\x45\xe0\xb8\x19\x3c\x1b\xac\xf8\xf7\
\x98\xde\x13\x6b\x34\x15\x52\x3f\x45\xd0\x58\xb7\x6d\xd9\x2a\x58\
\xa4\x5c\x11\x96\x4b\xd4\x36\xe3\x1c\x99\xc5\x3e\xa4\x0f\x68\x7d\
\x01\x1c\xab\xe3\x5e\xfc\xe0\xab\x7e\x56\x8c\xba\x68\x72\xda\xda\
\x6f\x6b\x90\x2d\xc6\xaf\x3d\x55\x12\xbf\x55\x31\x5a\x9f\x70\xa1\
\xec\x76\xc9\x41\xa6\xc4\xef\x48\xab\x00\xb7\x59\x34\x7b\x08\xfd\
\x82\x50\xe6\xd7\xcf\x50\xb2\xd6\x3a\x1c\xce\x84\x9f\x4b\x19\x53\
\xce\xcc\x33\xea\x34\x56\x49\xfc\x50\x4c\x27\x5e\x9b\x9d\xbc\x2d\
\xc5\xfa\xb6\xf8\x8a\xe7\x86\x8f\x70\x63\x7a\x36\xc1\x64\x8d\x13\
\x93\x6b\xa9\xc8\x05\xb7\x7a\x91\x06\x77\x4e\x7f\x89\x4a\x4d\xed\
\xa3\x2a\x70\xaa\x8e\x92\xfb\xe0\xa3\xd4\x43\xdb\xf1\x1a\xad\x29\
\x08\xbf\xb8\x61\x74\x15\xba\xe3\x54\xda\x52\x46\x86\x82\x6a\x3c\
\xd7\x6e\x97\xac\x7e\x25\x88\x88\xac\x29\x5e\xd0\x47\xaa\xbc\x49\
\x86\x86\x02\x67\xf0\x46\x69\x0d\x02\xd7\xc0\x37\xfa\x89\xad\x41\
\xa3\x7c\xb9\xe5\x2d\x8d\xb6\x36\xdf\x09\x8c\xbe\x35\x75\xe8\xf0\
\xc0\x1e\xe2\x87\x74\xe8\xcd\x58\xe7\x8f\xc6\x81\x0d\x41\x62\x8a\
\xcc\x5e\xa0\xb6\x1e\x23\xe1\x11\xb2\xeb\x4e\x83\x9f\xc3\xab\x0c\
\xbe\x7a\x42\xe5\xc2\x34\x3e\x61\x88\x12\x68\x3a\xdd\xd5\xbb\x2c\
\x91\xc7\x49\xee\xe2\x99\x1e\xa5\xed\xa6\x27\xed\xa7\xb6\x87\xe8\
\x4d\xca\xa8\xb3\x6f\x17\xe3\x33\x88\x1c\x77\xe8\x4d\x66\x6a\xc0\
\x50\x20\x89\x7a\x8f\xc8\x2e\x56\xab\xd3\x30\xd1\x51\x3d\x65\x64\
\xa6\x52\xe4\x24\x04\x98\x92\x6e\x3e\x01\x24\x5b\x98\x48\x7d\x69\
\xd4\x91\xba\x0e\x82\x9f\x45\xb3\xc0\xe0\x18\x87\x54\x59\xa2\x39\
\x31\x17\x0c\x20\x35\x18\x41\x58\x28\xb2\x6d\xc0\x90\x02\x94\xe5\
\x29\x63\x4d\x5d\x44\xbe\xb0\xab\x80\x99\x83\x6f\x33\x8c\xb2\x6c\
\xd1\xe8\x68\xef\x0e\xec\x10\x6b\x58\xbf\x00\x16\x47\x85\xa2\xe2\
\x62\x99\xe1\x2e\x73\x50\x6b\x4d\x40\xf6\x97\x50\x70\xad\x6e\xa4\
\x5e\xac\x5f\x2d\x72\x93\x4d\x44\xcb\x8d\x82\xd8\x41\x3b\xda\xce\
\x4a\x57\x32\xba\x7a\x7f\x15\xcf\xa9\xfa\x72\xac\x60\xce\x6d\x64\
\x69\xe0\xb5\xd1\x53\x25\xbf\xb5\x9e\x8d\x1b\x57\xc3\x18\x41\xdd\
\x98\x5d\x59\xfc\x94\xc0\xb2\x5f\x60\xd7\xc3\xc4\x0f\xe9\x7d\xe6\
\x0b\x3c\x73\x96\xf7\x58\x2c\x09\x3a\x1e\xad\x8d\x50\x60\x2b\x40\
\x54\x19\xc3\x18\x52\x13\x93\xe3\xa9\x6e\xcc\x7e\xb3\x76\xa7\xe4\
\xea\xa9\x64\x86\x61\x35\xee\x60\xae\xce\xb7\xce\x17\x23\x50\xc4\
\xca\xc4\xd8\x66\x5a\x6f\x58\x96\x5c\x91\xb9\xd4\xf4\x13\xa9\x27\
\xb3\x51\x5d\xbb\x7a\x05\xb3\xbe\x9e\x6f\x62\x78\x64\xbf\x91\xba\
\x66\x79\x64\x4d\xab\xf4\xce\x07\xb1\x9e\x5e\x55\x38\x38\x52\xe0\
\x99\xb5\x42\xac\x23\xfd\xf1\x00\x7a\x03\x33\x17\x42\x2b\x5a\x4f\
\x3c\x57\xc1\x2e\xae\x08\xbd\x88\xc1\x2e\x6b\xd4\xb5\x76\x36\xd3\
\x20\x4c\x86\x51\xd7\x12\x3a\x95\x57\xe3\xea\x7e\x9c\x96\x2b\x22\
\xaf\xd3\xb2\x5b\xed\x72\xe4\x51\xf9\x56\x9b\x80\xe6\x09\x39\xab\
\x35\x98\x74\x3d\x63\x9b\x67\xac\xae\x1c\x43\xaf\x55\x8e\x4d\x1e\
\x99\x85\xfd\x3b\x89\x7b\x90\x92\xd9\x19\xe0\x00\x50\x0b\xb1\xe6\
\x16\xe3\x1d\x27\x77\x2c\x43\xd0\xa4\x02\x65\x3b\x47\x70\xb6\xb0\
\x2a\x3b\x55\x2f\xe8\x47\x26\x86\x75\x82\xac\xd1\xae\x92\x31\xf8\
\x50\x5e\x35\xb8\xe6\xe9\xb3\x05\xe3\x76\xce\x8d\x3f\x22\x22\xc7\
\x0a\xc6\x75\xa2\x7d\x95\xcf\x79\x6b\xae\x41\x16\x01\x5d\x74\xbd\
\xf4\xba\xc4\x80\xae\x8d\x38\xba\x60\x46\x13\x97\x28\x53\x72\x35\
\x74\x1b\xd8\x56\xaa\x6e\x34\xc4\xd2\x32\x44\xec\x77\xc7\x03\xe0\
\xfb\xa2\xa1\x7e\x51\x58\x72\x60\x06\xd8\x6f\x85\x58\x87\x17\x8c\
\xc1\x33\x80\x22\x05\x4f\x2a\x22\x62\xc8\xb5\xba\x06\x28\x64\x53\
\xed\x25\x9c\xd5\x57\x04\x54\xa3\x32\xeb\xbd\x44\xa2\x4e\x32\x5f\
\xe9\xcc\x0f\x81\x21\xd3\x0a\x14\xd9\xcf\x0e\xb4\x71\x0f\xef\x35\
\x63\xd7\x13\xb7\x14\x9a\xca\x63\x80\x22\x02\x5e\xeb\x01\x8c\xb9\
\x26\xaa\x4c\x33\x52\x80\xa9\x37\x4c\xe3\x5a\x86\x6b\xd6\xc6\xa1\
\x6d\xf3\xe1\x7b\x19\x83\x42\x2e\xc6\x78\xd3\xda\x5f\x50\xb2\xc7\
\x0a\xb1\x0e\xce\xd7\x15\x61\x01\xa5\x86\x52\xb5\x98\x41\x5c\x2d\
\x15\x63\x4c\x56\x4f\xc2\x5a\x00\x8b\x11\x5b\x00\xed\xbd\x74\x9d\
\x26\x63\x88\xce\x3d\xd2\x87\x19\x52\x8a\xf9\x5a\xbc\x5a\x18\xa8\
\xf5\xa4\xeb\xa1\xfa\xab\xe4\x8b\xc8\x61\x7a\x8f\xd8\x7c\xb4\xec\
\x32\x6f\xe8\xba\x92\x2b\x15\x42\xa5\xd6\xb2\x06\x98\x7a\xd5\x60\
\x1e\x29\x1d\x58\x73\x6e\x7a\x49\xf8\xd0\x5d\xc3\x84\xf5\x14\x77\
\x10\x6a\xed\x9d\xc1\xb3\xcb\xaa\x74\xe0\x48\x04\x79\x42\xa1\x26\
\x4f\xf2\xf5\x24\xad\x89\x13\x4e\xb4\x42\x73\x0c\x10\x23\xa3\xf7\
\x89\x72\x19\x5a\xe9\x15\xb5\x76\x8c\x61\xbd\x5a\x98\x95\x0a\xbb\
\x1c\x35\xaf\x51\xbd\xcf\xf0\x32\x2d\x42\xa8\xa0\x0b\xcd\xcf\x7c\
\xff\x54\x03\x5a\x35\xc7\xaa\x5c\x81\xd0\xec\xcb\x2a\xd3\x06\xae\
\x8d\x4b\x8f\x6b\x81\x46\xac\x8f\x09\x88\x36\x60\x72\x06\x90\x84\
\x6c\x95\x1e\x02\xcc\x88\xf9\xd7\x78\xd2\x1e\x87\xbc\x07\x7f\x4c\
\xb0\x0e\xb5\x34\xec\x2c\x80\xed\x35\xf7\x02\xec\x9b\x1b\x77\xa4\
\x17\x38\xea\xca\xd4\xc4\x02\x83\x56\xca\x08\x35\x13\x51\x86\x6a\
\x6f\xb5\x35\xcf\x38\x89\x05\x8c\xa2\x54\x66\xb5\x71\x58\x73\x8d\
\xa4\x75\x9f\xfa\x80\x3d\x9a\xab\x9e\x90\x33\x2e\xc5\x6f\x02\x47\
\x6d\xec\x54\x5a\xcb\x2e\xfb\xb2\xe6\xa3\xda\xc4\x8c\x5a\x36\x4d\
\x02\x42\xac\x5d\xad\x4c\xca\x6b\xac\xa3\xd5\x7f\xce\xc6\x2d\x79\
\xbe\x84\xad\x77\x0e\x0b\x63\xef\x01\x3d\xdb\x67\x28\x79\x78\xd0\
\x22\xac\xb4\x77\xb6\x2e\x0c\x6a\x42\x8d\x82\xe8\xc5\x91\x8b\xed\
\x48\x7b\x81\x61\xb9\xa5\x3d\xed\x25\x52\x65\xc1\x42\x88\xf1\xac\
\x83\xb6\xda\x3d\xd2\x79\xd9\x36\x91\x1e\xbd\x25\x17\x67\x12\x29\
\xb2\xdc\xb5\x2c\x87\x55\xcb\x18\x06\x1f\x80\xa5\x21\x5d\xdb\x85\
\xac\xbc\xcc\x2a\x03\xad\x12\x52\xaf\x1a\x30\xba\x4d\x6d\x1d\x8c\
\x31\x5a\x87\x6a\xca\xe6\xb4\x7d\x4a\x90\x59\x1b\xf7\x8e\xad\x30\
\x77\x50\x0d\xa4\xa3\x83\x92\x87\x67\x28\xd8\x3a\xfc\xef\xa9\x00\
\x24\xbb\x0f\x87\x0a\x0a\x64\x53\x8a\x91\x3c\x4b\xf0\xa8\x17\xd0\
\xca\x36\x00\xe3\x1a\xca\x73\x40\x21\xfb\x0a\x8c\x54\x59\xa4\x7c\
\x53\x2e\x43\x2e\x47\xe4\xa9\x94\x52\xac\x0c\xa9\x34\xb6\xaa\xaa\
\x01\x50\xd4\x13\x2c\x65\x1b\x21\x35\x01\xc3\xca\xeb\x4e\x85\x5c\
\x41\x5a\xb5\x31\x3d\xad\xd4\xb5\x01\xaa\x18\x58\xea\x0b\x6e\xac\
\x51\x66\x99\x2e\x8f\x6d\xc4\xa6\x2d\x2a\xde\xfd\x3f\x24\x1d\x5e\
\x0d\xd6\x75\x6b\x41\x9f\xfb\x2d\x17\x33\xbb\x00\x87\x16\xea\x48\
\x6c\x12\xc6\x9a\xc0\x48\x50\xb1\x90\x3a\xf4\x4a\x29\x3b\xd4\x8e\
\xb1\x18\xd6\xc2\x59\x75\x23\x4a\x37\x8d\x41\x8d\x19\xf4\x29\x65\
\x55\x75\xa2\xc6\xaa\xe7\x2e\xdb\x65\x5c\x81\xc1\x25\xfa\x77\x96\
\xac\x6a\xcd\xcc\xb9\x35\xe9\xa1\x62\x65\xe8\xdd\xdc\x14\xad\xba\
\x0d\x65\xa8\x32\xa7\xdb\x09\x9d\xa4\x36\x6d\x1d\xe1\x38\x07\xf7\
\xde\x36\x64\xc4\xc3\x2b\x80\xfb\x0b\xd6\x72\x2f\xd5\x7f\xe0\xaa\
\xb3\xc8\x8e\x43\xe1\xe0\xb1\x09\x59\x4a\x30\x5d\x2f\xa1\xb0\xa6\
\x12\xb4\x8e\x52\xfd\x69\x83\x6f\x58\x18\x2d\x8b\x69\xf0\x72\x11\
\x22\xe9\xa0\x9e\x36\x76\xc2\xb2\xd1\xfc\x54\x9d\xa8\x21\xc5\xe6\
\x18\xac\xb0\x30\x0e\x35\x8e\xae\xa3\xdb\x65\xcd\x53\xac\xb5\x1e\
\x2f\xb9\xce\x5a\x56\xd9\x3e\xb2\x7e\x35\x40\xe8\x79\x47\xca\x6a\
\x7d\x0a\x5e\xb0\x09\xa9\xb2\xaa\xcf\x7b\x6e\xa6\xfe\x68\x57\xa6\
\x3d\x7d\xfa\xdc\x57\x70\x3e\xfb\xf1\xec\xb4\x50\xb4\xed\xc0\xb8\
\x43\x53\x88\x88\xd0\x81\x42\x75\x19\xa1\xb0\x35\xc0\xa8\xc9\x24\
\x8d\x45\xf7\x65\xd4\x35\x17\xd4\x58\x98\xd8\xce\x2a\x8d\x2c\x69\
\x70\xba\x9d\xae\xe7\x6c\x5e\xad\xbf\x26\x7e\xd5\xb7\xc5\x93\xfa\
\x53\xb2\xd6\x00\x6d\xa4\x6b\x3a\x20\xcc\x9b\xba\xcd\xe4\x49\x39\
\x92\x9b\x9d\x0b\x86\x34\xcb\x2c\xbb\x8a\xf5\x65\x81\x68\xf6\x00\
\x3c\x72\xef\x70\x90\xb8\x07\x79\x88\x07\x99\xad\xbe\xdd\xfd\x0e\
\xab\xe2\xc3\x07\xc2\x8e\x6b\xbb\x7c\x4c\x10\x0c\x21\xad\xf6\x99\
\x8a\x8b\x02\xc2\x5a\xb4\xd8\x42\x5a\x79\x61\x18\x8d\x46\x63\x18\
\x5e\xcd\x08\x65\x1b\xb9\x50\xd4\x79\xda\x70\xa2\x97\xd2\x85\xd3\
\x65\x9a\xa7\x64\x34\xe7\x66\xcc\x4b\xcf\x47\xeb\xc6\xda\x64\xb2\
\xf4\xae\x65\x37\xe6\xdc\xda\xbb\x18\xf2\xb4\x01\xca\x3d\xb7\x0c\
\x9e\x62\x35\x84\x57\x77\x40\xf5\xcf\x52\x8e\xdb\x6a\x95\x80\x07\
\xf7\x8b\xce\x23\x83\x37\xed\xd4\x56\x9d\x9a\xb1\x34\x28\xa7\xeb\
\xae\xd5\x24\x9f\x05\x3c\x39\xa6\x95\x4e\x01\xc6\xca\x4b\xf9\x65\
\x3b\x39\x66\xd3\x65\x1a\xb3\xee\x33\x32\xbe\x53\xed\xb4\x5e\xa3\
\x69\x43\x37\x9d\x36\xa1\x8c\x75\x0b\xf4\x19\xb1\x07\x29\x53\xca\
\xde\x72\x80\x72\xf7\x0d\xa4\xc3\xab\xc1\xfd\x87\xc0\xf0\x07\xd3\
\x3d\xb7\x18\x31\x18\x0f\xec\x0d\x85\x45\x0b\x61\x08\x12\x5d\x74\
\xb1\x08\x5a\x01\x01\x43\x3c\x11\x1a\x5d\x9e\xba\x42\xbc\x31\xa6\
\x8f\xd7\xa9\x29\xb5\x7a\xfc\x5a\x0d\x19\x79\x94\x5b\xa5\x9d\x4b\
\xbc\x00\xac\x9e\x4c\x55\x4f\xb0\x86\xf7\xe0\x29\xb5\x1c\x4f\x3d\
\xbd\x6a\x43\x31\xb0\xba\x18\x4f\x19\xd6\xa8\x4c\x02\xc6\x4a\x8b\
\x3e\x9a\x36\xc0\xa0\x4f\x39\x56\x0c\x2c\x09\x5e\x20\x47\xc4\x5e\
\x92\xa0\xb3\x80\xa2\xca\x7e\x7c\xc3\x70\x9c\xd8\x4b\xdf\x41\xfa\
\x16\xa8\x3c\xc8\x22\x37\x8d\x94\x22\x56\x75\xdf\xec\xe0\x85\x61\
\x74\x77\x4b\x29\x2d\x51\x2f\xaa\x80\xa6\xc9\xa3\xda\x57\x73\xd2\
\x3c\x3d\xbe\x25\x47\x31\x5e\x5c\xb9\x30\xb1\x74\x30\x0e\xe3\xb6\
\x7a\x2c\x39\x37\x67\xd4\x8b\x6d\x20\xa6\x71\xa6\xea\x09\x39\x5c\
\xa4\xff\x2c\x70\x20\xda\x47\xd2\x29\x3d\xea\xf1\xe4\x1a\xc5\xe6\
\x0e\x46\x7f\x09\x5e\x93\xee\x6a\x6d\x2d\x99\x86\x75\xe6\x0e\xc1\
\x83\xb7\x63\x85\x54\x3a\x7d\x23\x54\x00\x99\xe1\x26\x60\xc1\x8a\
\xc7\xee\xdd\x63\x08\x66\x4d\x28\x22\x78\x61\xd5\x8b\xb5\x8f\x28\
\xca\x04\x54\x83\x82\x0a\xb5\x60\xd5\xc2\xf8\x12\xca\x3e\x94\x0b\
\x83\xcb\x2f\x42\xb9\x38\xe0\xfb\xa1\x27\xc8\x36\x26\x17\xe6\x31\
\xf2\x35\x83\xd5\xf3\x71\x8a\x25\xe7\x1d\xa9\x1b\x03\x81\x35\xfe\
\xc8\xc8\x64\xb9\x9a\x83\x95\x4e\x1a\xa4\xd4\xb3\x92\x39\xb9\x2e\
\xa8\x71\x8c\xf9\xb4\xb2\x8d\x06\x1b\xb0\xea\xdc\x7d\xe3\x60\xfd\
\x47\x64\x9d\x41\x4a\xe6\x78\x80\x5b\xa1\x0a\xb1\xde\xc5\x21\x2e\
\xe6\x87\xc0\x0b\x35\x9a\xee\xda\x0d\xe7\x9c\x9a\x2f\x48\xe1\xa0\
\x34\xea\x55\xfc\x51\xb9\xc3\x0c\x9d\x70\x8c\xc3\x9b\x6a\x91\x74\
\xa8\x94\x50\xfe\xfc\x11\x98\x9d\x85\x23\x73\x83\xf4\xc2\x3c\xf4\
\xe7\xa1\xbf\x30\x3c\x98\xe9\xcf\xfd\x7b\xf4\x3f\xc9\xe0\x0a\x28\
\x0a\x70\x3d\x70\x33\x50\xcc\x40\xb1\x16\xdc\x9a\xe1\xdd\x89\xb0\
\x6c\x28\x9f\xfe\x48\xfb\x48\xf7\x2a\x14\xab\xd2\x66\x58\x97\x22\
\xa7\xaa\xb9\x48\x59\x03\x58\x4c\xaf\x12\xe9\xaf\x5a\xb7\x46\xc3\
\xcb\x31\x58\x2b\x2f\x78\xd6\xe6\xd1\x6a\x33\xce\xbc\xee\xfc\x01\
\xe3\x05\x70\x91\xb4\xe7\x66\xe0\x08\x54\x00\x01\x28\xb9\x16\x06\
\xbf\xec\x39\xaa\x08\xdc\xb9\x33\x1f\x1c\x26\x50\x1a\xae\x11\x20\
\xaa\x85\x91\xe0\xd1\x79\xc2\x7c\xbf\x0f\x8f\x1e\x18\x5c\x87\x0e\
\xc1\xdc\x2c\x83\xcf\xf7\x6b\xa3\x97\x69\xeb\x22\xcc\xfb\x3e\xf4\
\x63\xed\x81\x62\x0d\x14\xc7\x40\xb1\x0e\x8a\x63\x07\x97\xeb\xd5\
\x15\x1e\x9c\x45\xf4\x5b\xf3\x2e\xe7\x10\x5d\x3f\x02\x0c\x10\xc6\
\x9f\x93\x57\xe0\xa9\xd2\x72\x2d\x8b\x22\xbd\xd6\x13\x81\x27\x02\
\x20\x29\x1f\x6a\x2c\x7d\xaf\xda\x34\xc9\x72\xe7\xf7\xc5\x5a\xc4\
\x40\xe2\xb8\xb6\x1a\x5e\x7e\x03\xef\x77\x80\x0f\x8c\x2a\x0f\xef\
\xf7\xed\x86\xf9\xc5\xc1\xf7\x64\xb5\x52\x42\x01\xae\xb4\x41\x53\
\xdd\x6b\x2e\xbc\xe9\x90\xed\x06\xde\x61\xd7\x5e\xd8\xbb\x1f\x0e\
\x5a\x5f\xfa\x95\x7a\x74\xd7\x94\x96\xf9\x04\x80\xca\x39\x28\x0f\
\x87\x3c\xb7\x06\x7a\xeb\xa1\xd8\x00\xbd\x0d\x50\xac\x17\xc6\xa8\
\x0f\xed\x13\x1c\xd2\x65\x48\x16\x24\x24\xbf\x2b\x38\x44\x9f\x96\
\xa1\xa5\x8c\x2f\x69\x98\x34\x94\xe9\x72\xab\x7e\xaa\x8f\x04\x50\
\x0a\x37\x88\x1c\x6e\xbb\x16\xae\xf9\x22\x3c\x2c\x3f\xe2\x5e\x81\
\x04\x95\xf6\x5c\x5d\xa9\x62\x0c\x10\xcf\x55\x80\xc7\x0f\x55\x35\
\xac\xbc\x58\x0e\xbc\xc8\xf3\x9f\xdc\x12\x20\x02\x28\x45\x59\xf7\
\x26\x45\x25\x63\x06\x48\x8e\xcc\xc3\xb6\x5d\xb0\x7d\x37\x1c\x96\
\x86\x59\xd2\x0e\x00\x4d\x69\x0d\x8a\x9c\x7a\x95\xd7\x99\x83\xc5\
\x59\x60\xd7\x58\xf9\xc5\x06\xe8\x6d\x82\xde\x66\x28\x36\x0d\x74\
\x21\xc1\x21\x87\x69\x22\x17\xcb\x58\xc0\x90\xfc\x36\xe0\xd0\xeb\
\x36\xbc\x67\x01\x01\x51\x46\x47\xb0\x58\xe5\x8c\x79\x49\xef\xa1\
\x64\x77\x0e\xf6\xef\x80\x1b\xbe\x0a\x3f\xf8\x0a\xec\xdb\x6e\xe8\
\xc7\xf6\x20\x25\x0b\x7c\xbb\xaa\x36\x06\xc8\xfb\xb9\x9f\x4f\x72\
\x0f\xf0\x6c\x6d\x20\xb7\x3d\x02\x2f\x38\xa5\x19\x0c\xda\x43\x14\
\x05\x94\x7e\xa8\x6c\x3f\x48\x57\x77\x27\x2f\xad\x94\xe1\xf8\x3b\
\xf7\xc1\x03\xdb\x61\xf7\x3e\xc6\x80\x10\x72\xd5\xd2\x96\x71\x4f\
\xc2\x6f\x03\x2c\x9d\xef\x43\xb9\x0f\xca\xbd\xb0\x50\x85\x66\x9b\
\xa0\x77\x1c\xf4\x8e\x87\x62\xf3\x10\x30\xd6\x7c\x2a\x72\x06\x4f\
\x95\x35\x02\xc3\xe2\x35\x80\xa3\x50\x69\x6d\x88\xad\x42\x2a\x1a\
\x8c\x3f\x33\x6f\x81\x35\x00\xf2\xd0\xde\x16\x8f\xc0\x8f\xbe\x0b\
\x37\x7d\x03\xee\xb9\x9e\xf0\x93\xda\x16\x20\x34\x0f\x6e\x67\x27\
\x8f\x54\xaa\xd3\x3f\x72\xf0\x0f\xf8\xe1\x4f\x42\x8b\x85\xbf\xe9\
\x21\x78\xdb\x3f\x33\x00\xe0\x8c\x83\x77\x04\x34\x4d\xbc\xca\x73\
\xf4\x4b\xb8\x6f\x3b\xdc\xbb\x6d\x10\x4e\xb5\x32\x56\x96\x98\x9f\
\xeb\x7d\x22\x65\xe5\x5e\x28\xf7\x0c\x01\xd3\x1b\x80\xa5\x38\x01\
\x7a\x27\x0c\x3d\x4c\x06\x20\x82\xac\x01\x02\x50\x40\x30\xf2\x49\
\xcf\xa1\x8c\xce\x34\x50\xa3\xbc\x2a\x5b\xb2\x43\x7d\x21\xce\x42\
\xc5\xf8\xee\x1c\x94\x25\x3c\x70\x13\xdc\x7e\x25\xdc\xf9\x5d\x98\
\x3f\x1c\xce\x6d\xb4\x16\x15\x20\x10\x69\x0d\x12\xf8\x07\xa9\xe7\
\x10\x20\x25\x5f\x03\x3e\xa0\x8d\x64\xdb\x7e\xd8\x71\x10\x4e\x5a\
\xdf\x3c\x51\x0b\x34\x29\x5e\xd5\x6e\xa1\x84\xbb\x1e\x82\xbb\x1e\
\x86\x85\x05\x08\x3e\x82\x4f\x87\xf4\x34\x42\xae\x2e\xe9\x58\x99\
\xae\xd3\x87\xfe\xee\xc1\xb5\xe0\x81\x99\x01\x50\x7a\x27\x40\xef\
\x44\x28\x36\x32\x36\xf0\xaa\x8d\x05\x20\x59\x47\x1b\x05\xed\xc1\
\x21\x3d\x46\xa1\xc2\xac\x5c\x4f\x62\x79\x9d\xae\x9e\x45\x1f\xce\
\x47\xb6\xb3\x08\x0f\xdd\x04\x77\x5f\x0b\xf7\xfc\x13\xcc\x3e\xaa\
\xe6\x99\x02\x84\x2e\x97\xf5\x3c\x5f\x93\xea\x0d\x01\x52\xf0\x0f\
\xf4\x39\x02\x1c\x33\xea\x64\x48\x37\x6c\x85\xd7\x9e\x19\x07\x42\
\x2e\x20\x0a\x07\x5e\xa4\x17\x4a\xb8\xe3\x21\xb8\x63\x2b\xcc\x57\
\xc0\x88\xed\xe6\xd5\x3d\x07\x10\x16\x6f\x39\xd2\x29\x4f\xa2\x65\
\x93\xf7\x05\xe8\xef\x80\xfe\xf6\x41\xd6\xad\x1d\x7a\x97\x13\x87\
\x80\xd9\x64\x78\x0d\x04\x00\x54\x99\xc5\x37\xc1\xa2\x0d\xbe\x02\
\x43\xa1\xf8\x11\x50\xa4\xc0\xd0\xc5\x9b\x8c\xe4\x1c\x5e\xb2\xff\
\x23\x07\x60\xdb\x2d\xf0\xc0\xf5\xf0\xe0\x4d\xca\x53\x54\xf3\x6a\
\x1b\x52\x85\x20\x39\x8c\xe3\x1f\xa5\x7e\x43\x80\xbc\x9f\x03\x7c\
\x82\x2b\x81\xd7\x6a\x23\xfc\xc1\x03\xf0\xba\xb3\xd2\x21\x53\x53\
\x38\x35\x3a\x93\x78\x70\x25\xdc\xb3\x03\x6e\xbc\x07\x66\xe7\x68\
\x67\xf8\x31\x7e\xaa\x6e\x97\x74\x57\xef\x11\x93\xd1\x92\x2d\x42\
\xfe\x08\xf4\x1f\x81\xfe\xb6\x21\x63\xcd\xc0\xbb\xcc\x54\x80\x39\
\x8e\xc1\xa3\x65\x68\x04\x86\xe9\x35\xaa\xbb\x34\xe4\x22\x34\x48\
\x13\x30\x32\xd4\x91\xe5\x6d\x80\x40\xc2\x7b\xb8\xb1\x5c\x7e\x11\
\x76\xdc\x03\x3b\x7e\x04\xdb\x6e\x85\x3d\xf7\x12\xff\xde\x80\x94\
\xf1\xeb\xf2\x78\xbd\x6f\xb2\x8d\xc3\x72\x1d\xea\x3f\xb4\xe6\xf9\
\x22\x9e\xd7\x8a\x3c\x00\x77\xed\x80\xbd\x87\xe1\xb8\x75\x09\x40\
\x54\x4f\xac\x86\x77\x5f\x8c\x0f\xe6\xde\x0f\xd3\x0e\xb6\x3f\x0a\
\x57\xdf\x0e\xbb\xf6\x93\x0e\xa5\xda\x1a\xb3\xc5\x9b\xc4\xf0\xdb\
\xd4\x6d\xba\x2c\x6a\xf2\x2a\xf2\x3e\x3f\xf0\x2e\xfd\xea\xf8\xe8\
\x06\x20\x19\x85\x65\x27\x0c\xc3\xb2\x61\x59\x45\xa9\x10\x4b\x82\
\x40\x83\x42\xf3\x73\x42\xac\xec\x47\xc3\x91\x77\x2a\x0b\x87\x61\
\xdf\x7d\xb0\xe7\x6e\xd8\xfd\x63\xd8\x7d\x2f\x94\xf3\xe1\x7c\x82\
\xb9\xe4\x02\x42\x97\xc7\xcb\xbe\xa8\x97\xa8\x0e\x90\x1e\x5f\x64\
\x81\xff\x06\xf4\xe4\xc2\x7a\x0f\xd7\xde\x07\xbf\xf0\x3c\x82\x27\
\x50\xb5\xa7\x53\xd5\x13\xab\x62\x58\x2e\x40\x34\xbf\x38\x00\xc6\
\x0f\xb7\xd2\x1c\x4a\x11\xe1\xb5\x01\x87\xe4\xe5\x02\x69\xda\x5e\
\x28\xd5\x67\x5b\x52\x32\x96\x7b\x86\x87\xfe\x8a\x37\x23\x9e\x92\
\x1d\x37\x7c\x08\xb0\x19\x8a\x63\x86\xed\xf4\xae\xad\x76\xff\x42\
\xe7\x05\x3f\xf6\x68\x35\x79\x98\x97\x3c\x04\x0f\x58\x38\x08\x87\
\xb6\xc1\x81\x87\xe1\xd1\xad\xb0\xff\x7e\x38\x28\xbf\x48\x7a\x28\
\x6f\x30\xef\x18\x30\xaa\xb2\x14\x20\x2c\x5e\x58\xb6\xc0\x2c\x7f\
\xa7\x55\x5e\x07\xc8\xaf\xb1\x9d\xbf\xe0\x4a\x3c\xaf\xd6\x0b\x73\
\xcd\x5d\xf0\xfa\xe7\x8f\x27\xdd\x74\xbe\x90\xe9\x3b\xb7\xc3\x37\
\x6f\x86\xc3\x3a\x9c\xca\x31\xd8\x2e\xe5\x9a\xd7\xb5\xee\xa4\x5e\
\x68\x1a\xde\x43\xcb\x16\xeb\x6b\x01\xfa\xbb\xa0\xbf\x33\xe4\xbb\
\x75\xc3\x47\xcc\x9b\x86\xf7\x8d\x30\xb3\x71\x70\x2f\xd6\x43\x31\
\xa3\xc0\x52\xd4\x41\x13\x00\x48\x1f\xde\x8d\x70\x0b\x0f\x0b\x07\
\x60\x61\x3f\x1c\xd9\x07\x47\xf6\xc0\xdc\x6e\x38\xbc\x13\x0e\x6d\
\x1f\x00\x24\x30\x50\x4d\xd2\x1b\xe8\xbc\x4e\x57\x73\x9d\x04\x24\
\x9e\x6f\xf2\x28\x7b\xb4\x18\xf6\x6f\xd9\x7a\x2e\x0d\x00\x32\xa4\
\xad\x7b\xe0\x81\xdd\xf0\xf4\x13\xd2\x4f\xa5\x64\x7a\x6e\x01\xbe\
\x7a\x23\xdc\xfe\x20\x76\x38\x85\xe2\x4d\xc3\xa0\x9b\xca\xbb\x82\
\x6f\x52\x2f\x64\xc9\xd5\x96\x3a\x00\xc9\xcf\x42\x7f\x76\xfc\x00\
\x40\xd7\x71\x6b\xa1\x77\x2c\x14\xeb\xa0\x77\xcc\xc0\xe3\x14\x6b\
\x19\x7c\xa4\x66\x0d\x14\xbd\x21\x68\xaa\xdf\x14\xf7\x54\xdf\x7e\
\x3e\xf8\xc0\xe7\x3c\xf4\x8f\x40\x7f\x0e\xfa\x87\x07\xc6\xbf\x78\
\x98\xf0\x6b\x3d\x9b\xe6\x33\x12\x46\xf1\x63\x9e\x42\xa6\x73\xc2\
\x2c\x0b\x8c\xb2\xcc\xf3\x59\x4b\x3c\x1b\x20\x47\xf8\x3c\x6b\xf9\
\x2f\x54\xbf\x5f\x28\x04\xbc\xf2\x4e\x78\xe7\xb9\x11\xaf\x51\x30\
\x3e\x6b\x78\xb8\x73\x1b\x5c\xfe\x7d\x38\x38\x8b\xbd\x80\xb9\x46\
\x34\xad\xf2\x49\xc1\xa5\xeb\xb6\xed\x57\xcb\xd9\xd5\x8b\xe4\x00\
\x2c\xa7\xed\x30\xed\xe7\x60\x71\xae\xb9\x5e\x32\x9d\xe2\xe5\x90\
\x06\x42\xc5\x8b\x79\x0a\x99\xb6\x78\x5a\xa6\x34\x58\x0e\x42\xfd\
\xfc\x01\x88\x9f\x5f\x93\xf4\x41\xf6\x01\x5f\xb2\x26\x7b\xcd\x5d\
\x70\x64\x91\xf0\x65\x4d\x11\xba\xe2\xd2\xc3\xff\xba\x11\x3e\xfb\
\x1d\x38\x58\x85\x54\x7a\xf2\x4d\x0b\x61\xd5\xcb\x2d\x9f\x16\x38\
\xf4\x98\x5d\x3c\xc8\x52\xd2\x24\x40\x6a\xab\xab\xd4\xfc\x7c\x03\
\x2f\x75\xe5\xf4\x61\xa5\x27\x99\x87\xbe\x97\x7c\x9e\x9d\xc8\x6f\
\xc9\x1a\x51\xfc\xb7\x6c\x1d\x9f\xac\x75\x0e\xcc\xce\xc3\x35\x77\
\x87\x87\x36\x99\xde\x73\x08\x3e\xfe\x0d\xf8\xee\x9d\x46\x9f\x46\
\x7f\x26\xaf\x69\x61\xa7\xed\x79\x72\x78\x5d\xc1\x37\xa9\x97\xd0\
\x73\xe8\x02\xbc\x16\xde\x64\xa2\xf9\x59\x46\x6e\xd5\xb5\xf8\x4d\
\x00\xb4\x64\x6a\x3b\x1f\x9b\x7c\x60\xeb\x8a\xe2\x00\xf9\x3f\xf8\
\x16\x9e\xd0\xcc\x87\x83\x7d\xe3\x56\x08\x5e\xe2\x0c\x3d\xc8\xad\
\x0f\xc2\x9f\x7f\x05\x1e\xda\x53\x6f\xd3\x68\xac\x16\x6f\x25\x80\
\x90\x3b\x4e\x8e\xf1\x4c\x93\x62\x40\x99\x14\x70\xb1\x32\xab\x5d\
\x53\x5a\xe6\x73\x3c\x45\x5b\xaf\xd1\xc6\x33\xa4\xca\xc2\x3e\x6f\
\x63\xe7\xf8\xd3\xbb\x9a\x52\x1e\xc4\x03\x1f\xb7\x14\xfa\xf0\x5e\
\xb8\x65\xeb\x38\xbc\x02\xb8\xfc\x3a\xf8\xcb\x6f\x0d\x0e\xe5\x35\
\x01\x59\x26\xde\xb4\x81\x90\xbb\x73\xc5\xca\xbb\x52\xfe\xee\x37\
\xbd\x31\xba\x18\x5d\xcc\xb0\x65\xbe\xe9\xb2\xea\xeb\xfe\xda\xae\
\x71\x8e\xde\xc6\x75\xff\x22\x55\x2d\x0e\x10\x80\x3e\x17\x23\x7f\
\x60\x47\xd0\x97\x6f\x1a\x78\x8f\xb9\x05\xf8\xef\x5f\x87\xaf\xdf\
\x9c\x10\xae\xed\xae\xb5\x1c\x6d\xa7\xd9\x77\x57\xb9\x73\x17\xb6\
\xab\x97\x68\x3b\x4e\x53\xdd\x18\x4f\x1b\x75\x17\x8f\x11\xd3\x67\
\x0a\x30\x5d\xe6\x11\xf6\xbd\x97\x82\x4f\x27\x7a\xa1\x97\x2a\xe4\
\x6b\xcc\xf1\x7a\x4e\x01\x5e\xaa\x07\xd8\x75\x00\x4e\xde\x04\x9f\
\xfc\x16\xdc\xb3\x5d\xb4\xe9\x8a\xfa\xd5\xc0\xb3\xca\x73\xeb\xa5\
\xda\xe6\xec\x68\x2b\x41\x6d\x80\xd4\x56\x2f\x6d\xc9\x35\xa4\x53\
\xbc\xae\x77\xcf\x7f\x67\x37\x5f\xce\x15\xcb\xa6\x8f\x71\x3a\x33\
\xdc\x81\x67\x0d\x1e\xfb\xff\xb8\xdb\xf2\xac\xf2\xb6\x65\xd3\x92\
\x65\xda\xf3\xd0\x69\x3a\xde\x73\x81\xd7\x75\x8c\xae\x72\xc5\xfa\
\x48\xa5\x53\xa4\x2d\x70\x12\x40\xb4\xab\x7b\x04\x78\x0e\x7b\x78\
\x30\x25\x5e\x3a\xc4\x02\xf8\x10\xf7\x02\x5b\x80\xc9\x76\xc2\xa6\
\xdd\xd7\xaa\x97\xdb\x5f\x0e\xaf\x69\xf1\xba\xf0\x72\xfb\xce\xa1\
\x98\x4e\x96\xca\x2b\x4d\x13\x1c\x1a\xa8\xd6\x1c\x7c\x43\x59\x4c\
\xae\xb6\x32\xe5\x92\xe7\x33\x4d\xe0\x80\x1c\x80\x0c\x3a\xfb\x23\
\xc0\x7e\x2f\x3a\x89\x91\xb7\xa5\x49\x0c\x7b\xa5\xfa\x6b\xaa\xbb\
\x54\xba\x5a\x6a\xca\xf1\x7a\x16\x20\x62\x65\x29\x6f\x98\x33\x7e\
\x1b\x79\x3d\x8b\x2c\xf2\xc7\x39\xcd\xf2\x00\xf2\x9b\xdc\x06\x7c\
\x3e\x53\x94\x34\x4d\xb2\xcb\x2f\xf5\xf8\x6d\xda\xb6\xf5\x82\xcb\
\x09\x88\x49\xbd\xc3\xa4\x5e\x45\x83\x26\x76\xe9\xfa\x6d\xc7\x92\
\xd4\xae\xfe\x67\x39\xc0\x8f\x23\x3d\x05\x94\x07\x10\x80\x92\x8f\
\x02\x8b\xd1\x41\x97\xca\x93\x4c\x2b\x1c\x9a\xc6\xb8\x5d\xc6\x5a\
\x09\x40\xac\x14\xc5\x36\xb8\x58\x88\x65\x79\x8d\xa5\xa7\x05\xfa\
\xfc\x7e\x6e\xe5\x7c\x80\xfc\x16\xb7\xe3\xd3\x8f\xc4\x80\xe5\x05\
\xcf\xb4\xc7\x9f\xa6\x4c\xcb\x09\x8c\xe5\xa0\x36\x3b\x74\xea\x3c\
\x92\xe2\xe7\x8e\x35\x19\xa8\x3e\xc9\xa3\xdc\x9d\x5b\x39\x1f\x20\
\x00\x7d\x7e\x0f\xc2\xff\xb8\x3a\x2a\x69\x39\x42\xbd\x49\x68\x35\
\x7a\xa5\x94\x11\xa7\xc2\xab\x2e\x63\x35\x8d\x1d\xaf\x77\x80\x23\
\xf9\xde\x03\xda\x02\xe4\xb7\x79\x10\xcf\xff\xdb\xaa\x4d\x17\x7a\
\xac\x18\xe5\x6a\x94\x73\xb5\x52\x93\xd7\x58\x1e\xfa\x53\x0e\x8f\
\xbf\xd2\x27\x87\xda\x01\x04\xe0\x10\x7f\x82\x6b\x7e\x3c\xf6\x04\
\x3d\x41\xab\x8c\xee\x63\x1f\xff\xb9\x6d\xa3\xf6\x00\xb9\x88\x83\
\x78\xfe\x3d\xab\x61\x3f\x78\x82\x1e\x3b\xe4\xc8\x79\x2d\xbd\x34\
\xe4\xf1\x78\xfe\x1d\x30\xdb\xb6\x69\x7b\x80\x00\x7c\x98\x4b\xf1\
\x5c\xd1\xa9\x6d\x0e\xad\x94\x22\x53\x64\xc9\xb4\x1a\xe5\x5c\x6d\
\xb4\x1c\x7a\xb3\xde\xa8\x87\xf4\x55\xf6\xf3\x85\x2e\x5d\x77\x03\
\x08\x80\xe7\xd7\xf1\xed\x11\xb9\xaa\x29\xf5\xd1\x85\xae\x7d\x2d\
\x05\x35\x1b\xc4\xf4\xc7\x68\x1a\xab\xe9\xe3\x1f\xf2\xea\x3a\x46\
\xac\x5d\x8a\x3c\x87\x80\xff\x33\xb3\xe7\x1a\xa5\x3f\xac\x98\xa2\
\x6f\xb2\x9b\x57\xe3\x81\xd7\x0c\x05\x91\x42\xd1\x89\x37\x8d\x3e\
\x96\x63\x8c\xdc\xb1\x96\x8b\x96\xd3\x93\xb5\xfd\x1c\x54\xea\xca\
\x69\x3f\xe9\xdd\xf1\x11\xf6\xf3\x95\xe4\x9c\x12\xd4\xdd\x83\x00\
\xcc\xf3\xa7\xc0\x75\x81\x50\x92\xa6\xb1\x70\xb9\xfd\x2e\x95\xdb\
\x6e\x5b\x16\xab\xbb\x1c\x46\xdc\x75\xb7\x9f\xe6\x78\x1a\x1c\xa9\
\xb6\x56\xdd\x69\xea\xcb\x73\x2d\xfb\xf9\xf3\x49\xba\x98\x0c\x20\
\x17\xb1\x08\xbc\x07\x98\x6b\xa8\x39\xa6\x94\x71\x4f\x23\xb4\x69\
\x6a\xdb\x05\x5c\x39\xbb\x5d\xdb\xf1\x57\x02\x30\xb1\x31\xbb\xee\
\xd0\x56\x1f\x55\xba\xc9\x8b\xe8\x7a\x4d\xfd\xb6\x97\xed\x30\x9e\
\xf7\x10\xfb\x0c\x61\x26\x75\x0f\xb1\x2a\xba\x82\x1d\xfc\x1c\x73\
\xb8\xfa\xd7\x95\x9a\xf7\xd5\xc0\x9b\x44\xbe\xdc\xb6\xb9\xf4\x58\
\x39\xe8\xa7\xc3\x98\x7a\x5a\xe6\x53\x20\x49\xf5\xd1\x36\x9c\x0b\
\xeb\xfc\x26\x07\xf8\x5f\xe9\x49\x35\xd3\xe4\x00\x01\xb8\x82\x6b\
\xb9\x92\x97\xc1\xf0\xa7\x13\x60\xe5\xcf\x1f\x2b\x05\x34\x9d\xce\
\xa5\x49\xe3\xed\xa5\x1e\x2f\xd5\xd6\x4a\xe7\xc8\x95\xf2\x20\x5d\
\x40\x31\xae\xfb\x65\x1e\xe5\x83\x19\x12\x34\xd2\x64\x21\x56\x45\
\x0e\x4f\x9f\x77\xe1\xda\xbd\xa5\x54\x7d\x2c\x2f\x6f\x92\xb0\xa9\
\x4b\xf9\x52\xd3\x34\x01\xd5\x76\x07\x5f\x6a\x0f\xd2\x6e\x1e\x0f\
\x51\xf2\x5e\xa6\xf4\xa8\x64\x3a\x00\x01\xb8\x88\x47\xe8\xf3\x4e\
\xaa\x98\x6f\x35\x18\x7c\xaa\x5e\x6e\xdf\xb1\x05\xcb\xe9\x7b\xd2\
\x5d\x7e\xa9\xa9\x8b\xb7\x48\x19\xb0\xae\x93\x7b\xe9\xf6\x4d\xe3\
\xc5\xd7\x7d\x81\x92\x77\x70\x90\x9d\x4c\x89\xa6\x13\x62\x55\x74\
\x25\xf7\xf0\x73\xf4\x61\xf8\xb5\xa5\xab\xe9\x3c\x31\xad\xbe\xdb\
\x96\x4b\xea\xba\xcb\xb7\x6d\xd7\xa6\xff\x2e\x75\x34\x2f\xe5\x35\
\x62\x94\xeb\x4d\x72\x65\x00\xf0\xfc\x36\x07\xb9\x34\x31\x6a\x6b\
\x9a\x2e\x40\x00\xfe\x91\xef\xf0\x73\x9c\x0d\x9c\x05\xac\x5c\xfc\
\xbf\x5c\xc0\xc8\xa9\xdb\x95\xa6\xe9\x79\xba\x7a\x0b\xab\x2c\x95\
\xb6\xc0\x9d\x0a\xaf\xac\xb6\x5d\x42\x2e\xcf\xdf\x70\x80\xdf\x34\
\x66\x35\x11\x4d\x2f\xc4\x1a\x93\xe7\x30\xef\x06\x6e\x01\xda\x87\
\x27\xb9\xbc\x58\x3f\xd3\xea\x3b\xb7\xbc\x69\xcc\x54\xfd\x36\x34\
\x0d\x6f\xd1\xd4\x67\xac\x7d\xac\x5e\x0c\x1c\x31\x50\xa4\xc0\x92\
\x02\x49\xb3\x3c\xd7\x73\x80\xf7\x25\x66\xda\x99\x96\x02\x20\xf0\
\x31\x0e\xe0\x78\x13\xb0\xdd\x2c\x5f\x6d\x06\x9f\xb3\x4b\x75\x2d\
\x8f\x01\x65\x1a\x06\xde\x44\x6d\xfa\xec\xa2\xab\x54\x3e\xe6\x2d\
\x9a\xea\xa4\xf2\xf6\xda\x3e\xcc\x3c\x6f\x66\x89\xfe\x4f\x69\x69\
\x00\x02\x70\x11\xf7\xd1\xe7\xcd\x0c\x7e\xf7\x6d\x40\x5d\x76\xe0\
\xe5\x6a\x93\xd3\xbe\x0b\x60\xa6\x49\x4b\xe1\x35\xda\xce\xb5\x09\
\x28\x39\x80\x48\x95\x6b\x5e\x7a\xdc\xc1\x46\x3c\xc7\x56\xa3\xd7\
\xa9\xd0\xd2\x01\x04\xe0\x0f\xb9\x16\xcf\x3b\xf0\xc3\xff\x65\x87\
\xa5\x07\x41\x1b\xef\x32\x89\x27\xd2\x75\x53\xe9\xae\x5e\xa3\x8d\
\x17\x69\xd3\x47\x5b\x90\x58\xe9\xd8\x1c\x35\x2f\xe7\xb2\xda\xe9\
\x71\xb4\x0c\xb0\x80\xe7\x6d\xec\x1f\x7e\xd4\x69\x89\x68\xfa\x87\
\x74\x4d\x57\x71\x07\xaf\x64\x1b\xf0\x46\xe4\x14\x73\x9f\x42\x35\
\x95\x2f\xc7\x21\x3b\xe7\x03\x89\x4d\xfc\x69\xd1\xb4\xbd\x45\x1b\
\x4f\x91\x6b\xd0\x5d\x2f\xdd\xaf\x95\x1f\xa4\x4b\x3c\xbf\xca\x81\
\x29\x7d\xd3\x4e\x82\x96\x1e\x20\x00\x57\x71\x3d\xe7\x71\x18\xf8\
\x17\x78\x03\x24\x4b\xf5\x88\xb5\x8b\xe1\x4f\xa3\x9d\x95\x5e\x0a\
\x2f\x32\x2d\x6f\xd1\xc6\x53\xc8\x74\xca\x6b\xe4\x52\x0c\x28\x71\
\x6f\xe2\x29\xf9\x20\x07\xf8\x1f\x2d\x46\xe9\x4c\xcb\x03\x10\x80\
\xab\xb8\x86\x57\x00\x8e\x57\x2d\x09\x48\xba\xf6\xd5\x75\x8c\x2e\
\xe9\xae\x34\x09\x58\xda\x94\xe5\x84\x36\x4d\x5e\xc4\xe2\xe7\x78\
\x8d\x58\x5f\x61\xde\xe3\xf9\x1d\x0e\xb4\xff\xd7\xd9\xae\xb4\x7c\
\x00\x01\xf8\x0e\x57\xf2\x0a\x0a\xe0\x3c\x13\x24\x32\xbd\x5a\x3d\
\xc1\x24\xe9\x69\x78\x0d\x12\x75\x26\x09\xa9\x74\x3d\x2b\xdd\xd6\
\x8b\x4c\x1a\x62\x85\xf3\xf7\x78\x7e\x97\x47\xf9\x43\x96\x91\x96\
\x17\x20\x00\xdf\xe1\x1f\x79\x39\x71\x4f\x22\xd3\x4b\xb5\xfb\x4f\
\xd3\x23\x4c\xdb\x73\xb4\x01\x4d\x1b\x8f\x92\xc3\x6b\x1b\x4e\xe9\
\x7c\xdb\x30\x2b\x1f\x28\x03\xcf\xb1\xcc\xe0\x80\x95\x00\x08\xc0\
\xd5\x5c\xc9\xcb\x86\x67\x12\x87\x5b\x12\xaf\xb1\x14\xfd\x69\xea\
\x02\xa2\x8a\x26\xf1\x16\x5d\xbd\x86\xe6\xb5\x49\xa7\xf2\x5d\xc3\
\xac\xa6\xba\x03\x2a\x81\x0f\xb2\x7f\xf9\xc2\x2a\x49\x2b\x03\x10\
\x80\x6b\xb8\x86\x97\xf3\x10\x9e\x37\xe0\x28\x96\xfc\xc0\xbd\x54\
\x69\x2b\x9f\xe2\x4b\x5e\x97\x10\x6b\x12\x90\x74\x09\xa9\x64\x3a\
\xe5\x55\x74\xbb\xae\xe1\x55\x28\xcb\x02\xf0\xab\xec\x5b\x9e\x03\
\xb9\x45\x2b\x07\x10\x80\x6b\xb8\x9e\x97\x73\x33\xf0\x26\x18\xfe\
\xfe\x48\x45\xd3\x04\x44\x97\xb0\x68\x52\x2f\xd2\x54\x37\x46\x5d\
\x43\x2b\xab\xfe\xa4\x1e\xa4\x4d\xbe\x6d\x78\xd5\xdc\xfe\x20\x8e\
\xff\x9d\x7d\x4b\xff\x28\x37\x45\x2b\x0b\x10\x80\x6b\xb8\x83\x73\
\xb9\x02\xc7\x1b\x81\x8d\x4b\xfe\xf4\x68\x39\xce\x1f\x39\xf9\x8a\
\xda\x78\x8b\xb6\x20\xd1\xbc\x1c\x0f\xd2\x04\x14\xcb\x8b\x74\x09\
\xaf\x52\x6d\xe0\x61\x4a\x5e\xc7\x3e\xbe\xcd\x0a\xd3\xd2\xbe\x49\
\xcf\xa5\x3f\xe3\x5a\xfa\x9c\x8b\xe7\x96\xe4\x42\x2e\x27\x3f\x65\
\x08\x6d\xcb\xac\xba\x64\xdc\x25\x4d\x03\x24\xba\x3c\xc7\x6b\x58\
\xc6\x3c\x29\x28\xd2\x60\xb9\x01\x38\x77\xa9\xdf\x90\xe7\xd2\xca\
\x7b\x90\x8a\xbe\xc7\x3e\x9e\xc7\x25\x1c\xc3\x99\xc0\x99\x80\x5b\
\x12\x6f\xd2\x35\x5c\xea\x72\x06\x69\x43\x39\x60\x99\xd4\x6b\xb4\
\x49\xa7\xf2\x31\x5e\x93\x87\x20\xd9\xce\x03\x9f\x67\x0f\xbf\xc4\
\x1c\xbb\x12\x2d\x97\x95\x56\x0f\x40\x00\x6e\x60\x9e\x6b\xd9\xc2\
\xb9\xf4\x81\x57\x51\x79\xb8\xa5\x08\xaf\x72\xdb\xb4\x2d\xcb\x01\
\x4b\x53\x9d\x69\x81\x24\xd7\x9b\x58\xf5\xdb\x78\x91\x14\x20\xf2\
\xea\x2d\x02\x1f\x61\x0f\x1f\x04\xe6\x8d\x5e\x56\x8c\x56\x17\x40\
\x2a\xfa\x1e\xdf\xe6\xa5\x7c\x17\x78\x2d\xb0\x71\xc4\x5f\x89\xf7\
\x17\x4b\xe1\x2d\x62\x94\x32\xfa\x2e\x5e\x23\xc6\x9f\xc4\x6b\x74\
\x05\x44\x1c\x28\xdb\x80\x37\xb3\x9b\xcf\x18\xbd\xad\x38\xad\x4e\
\x80\x00\x7c\x8f\x7b\x78\x19\x9f\xa1\xe4\x1c\xe0\x59\x23\xfe\xa4\
\x2f\xea\xda\x18\xfc\x34\xc0\x92\x7a\x07\x62\x51\x13\x48\x72\x78\
\x56\x3a\x17\x28\xb9\x5e\xc3\xe2\xb5\x07\xc7\x57\x99\xe3\xf5\xec\
\xe7\x36\x56\x29\xad\x5e\x80\x00\x5c\xcb\x41\x5e\xcf\x25\xcc\x72\
\x18\xcf\x79\x38\x66\x82\xf2\x69\x9e\x39\x9a\xea\x4e\x93\x72\x43\
\x2c\x99\xee\xe2\x41\x62\xde\x24\xa7\x5e\x57\x60\xe4\xd1\x2c\x9e\
\x0f\xb3\x8b\xff\x8b\x05\x0e\x66\xb7\x5a\x01\xca\x9f\xd2\x4a\xd3\
\x07\x78\x21\x05\x9f\x02\xce\x09\x7e\x87\xdc\xd3\xfc\x1b\xe6\x39\
\xf9\x36\x75\x27\x69\x93\x53\x66\xbd\xbf\x49\xf1\xda\x94\x4f\x2b\
\x9f\x5b\x56\xaf\x7b\x1d\x8b\xbc\x87\xbd\xdc\xda\xa2\xd5\x8a\xd1\
\xea\xf6\x20\x92\xae\x63\x3b\xa7\x73\x31\xeb\x29\x81\x9f\x85\xa1\
\x37\x59\x29\x6f\x91\xd3\x7e\xd2\xed\x27\xc7\x43\x34\x95\xb7\xf5\
\x12\x3a\x1f\x3b\x7b\xb4\x0d\xb3\x06\x5f\x4f\xfb\x51\x76\xf2\x3e\
\xe6\x26\xf8\xfe\xb4\x65\xa6\xc7\x8e\x07\x91\xf4\x7e\x9e\x4f\x8f\
\x8f\xe3\x79\xc5\xb2\x78\x8b\x2e\xde\x63\x1a\x5e\xa4\xab\x87\xe8\
\x1a\x7a\xe6\x6c\x22\xb9\x1b\x4b\x38\xd6\x95\xf4\xf9\xd7\xec\xe6\
\xf6\xcc\xd6\xab\x86\x1e\x9b\x00\x19\x90\xe3\xd7\x78\x2f\xf0\x47\
\x78\x9e\x94\x0d\x86\xb6\x60\x99\x14\x20\xd3\x0c\xb5\xa6\x01\x98\
\xa6\xb2\x36\xbc\xe6\xb2\x47\xe8\xf3\x61\x76\xf2\xd7\x0d\x3d\xac\
\x5a\x7a\xec\x84\x58\x16\x5d\xcf\x0d\x9c\xc9\x5f\xb2\x86\x75\x38\
\x5e\x04\xf4\x1a\x97\xa1\xed\x32\xe5\x1a\x4b\xee\x93\x29\xab\xcc\
\x0a\x99\xac\xf6\x5d\x43\xaa\x54\x38\x35\xc9\xd3\xaa\x58\x19\x1c\
\xc1\xf3\xe7\xcc\x73\x3e\xbb\xf9\xa7\xc8\xac\x1e\x13\xf4\x58\xf6\
\x20\x21\xbd\x9f\xe7\x52\xf2\x47\xc0\x5b\xf0\xb8\xa9\x84\x56\x6d\
\x78\x39\xde\x20\x27\xa4\x6a\x1b\x72\x4d\x9a\xb6\xf2\x31\x5e\x8a\
\x3f\x28\x2b\x81\xcf\xb3\xc8\x47\xd8\x99\xff\x5b\xe4\xab\x99\x8e\
\x1e\x80\x54\xf4\x5e\x5e\x0a\xfc\x27\x3c\xaf\x8e\x02\x65\xa9\x00\
\xb2\x1c\x20\xc1\xb8\xe7\xa6\xbb\xe4\x63\xbc\xb0\xdc\x03\x5f\xa7\
\xe4\x3f\xf0\x08\x3f\x68\xa8\xfd\x98\xa2\xa3\x0f\x20\x15\xbd\x8b\
\xf3\x28\xf8\xdd\x11\x50\xba\x3e\x92\x9d\x16\x7f\xa9\x40\x92\x9b\
\x6e\x2a\x6b\xaa\x6f\xd7\xf5\x78\xbe\x8e\xe7\x3f\xb2\x8d\xab\x13\
\xb5\x1f\xb3\x74\xf4\x02\xa4\xa2\x0b\x79\x29\x8e\x0f\x03\x6f\xc2\
\x0f\xcf\x28\x4b\x09\x90\xae\x00\x28\x87\xf2\xea\x3e\x48\xb4\xc1\
\xb8\x63\xe4\xa7\xe1\x45\x42\xfe\x22\x25\x5f\xa2\xe4\x4f\x8e\x36\
\x8f\xa1\xe9\xe8\x07\x48\x45\x6f\xe7\x0c\x0a\xfe\x0d\x8e\x77\x51\
\xb2\x39\xdb\xb0\x57\x32\x9c\xca\xf5\x24\x5d\xbd\x46\x8e\x17\x91\
\x3c\xcf\x7e\xe0\x53\xcc\xf3\x5f\xd8\xc1\x3d\x46\xcd\xa3\x8e\x1e\
\x3f\x00\xa9\xe8\x02\x36\x03\x17\xe2\xf9\x57\x78\xce\xa6\xe9\x9c\
\x92\x02\x0e\x89\x36\x4b\x01\x12\x32\xca\x30\xd2\x5d\xf2\x63\x9e\
\xc7\x73\x03\xf0\x3f\x98\xe3\x33\xec\x5c\xdd\x1f\x0d\x99\x36\x3d\
\xfe\x00\x22\xe9\x7c\x7e\x86\x82\xf7\xe0\x79\x2b\xf0\x13\x9d\x3c\
\x08\x0d\x75\x52\xf5\xad\xb6\x64\xf6\x15\xab\x8f\xb8\xeb\x74\x4e\
\x7e\xcc\xdb\x49\xc9\x65\x38\x3e\xc5\x03\x5c\x6f\xd4\x7a\x5c\xd0\
\xe3\x1b\x20\x15\xfd\x0a\x6b\x71\xbc\x0e\xc7\x5b\x29\x79\x23\x5e\
\x85\x60\xcb\x71\xf0\x9e\xd4\x93\x68\x1e\xe2\x4e\x66\x1e\xf6\x51\
\xf2\xf7\x78\xfe\x86\x07\xf8\x3a\x83\x2f\x4d\x78\x5c\xd3\x13\x00\
\xd1\xf4\x0b\x1c\xc3\x66\x5e\x43\x9f\x5f\x02\xde\x80\xe7\x69\xad\
\x00\x30\x6d\xa0\xd0\xb2\x3c\x96\x97\x14\xe6\x1f\xc0\xf3\x15\x4a\
\xfe\x8e\xfb\xb9\x82\x55\xf6\x0f\x4b\xdd\xf1\x3b\x17\x00\x00\x00\
\xe6\x49\x44\x41\x54\x2b\x4d\x4f\x00\x24\x4d\x8e\x37\xf2\x53\xac\
\xe1\xe7\xe9\xf3\x1a\xe0\xe5\x35\xef\xd2\x04\x14\xc8\x07\x0d\x13\
\xd4\xd1\x7c\x8c\xf4\xe0\xbe\x1f\xf8\x0e\x25\x57\x50\xf0\x35\xee\
\xe6\x87\xa2\xf4\x09\x52\xf4\x04\x40\xda\xd0\x8b\x59\xc3\x53\x38\
\x87\x82\x97\x51\x72\x2e\xf0\x12\x4a\x9e\x09\xc3\xef\xf5\x5a\xe9\
\xb0\xaa\xce\x2b\xf1\xdc\x03\x7c\x1f\xcf\xb5\x94\x5c\xcd\xdd\xdc\
\x04\xe2\xe7\x28\x9e\xa0\x24\x3d\x01\x90\x49\xe9\xb5\x9c\x88\xe3\
\x6c\x1c\x3f\x05\x3c\x1f\xcf\x99\xc0\x19\x78\x4e\xc1\x4f\x00\x1c\
\x5a\xf1\x4b\x3c\x8f\x00\x77\x52\x72\x3b\x70\x1b\x25\xb7\x70\x98\
\x9b\x79\x80\xbd\x4b\xac\x81\xa3\x9a\x9e\x00\xc8\x52\xd1\xcf\xb3\
\x81\x3e\xa7\x51\xf0\x74\x3c\x4f\xa5\xe4\x54\x1c\x27\x53\x72\x12\
\x70\x02\x9e\xe3\xf0\x6c\xc4\xb3\x1e\xcf\x31\x78\xd6\xc2\xe8\x91\
\xb3\xc7\x33\x4f\xc9\x11\xe0\x30\x9e\x03\x94\x3c\x0a\xec\x05\x76\
\x51\xb2\x03\xd8\x46\xc9\x83\x2c\xb2\x95\x75\xdc\xcf\x75\x4b\xf3\
\x13\x64\x8f\x77\xfa\xff\x01\x61\xe8\xe4\xf7\x36\x7f\x50\xee\x00\
\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x1b\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x4b\x00\x00\x00\x4b\x08\x06\x00\x00\x00\x38\x4e\x7a\xea\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0b\x0e\x12\x29\x08\xa0\x44\x83\xb4\x00\x00\x01\xa8\x49\x44\
\x41\x54\x78\xda\xed\xdc\x31\x4e\xc3\x40\x10\x85\xe1\x1d\x6c\xd3\
\xd2\xd0\x22\x8a\x34\x48\x39\x01\x05\x0d\x15\x17\x80\x23\x40\x93\
\x43\xd8\x77\xa0\x21\x47\x80\x0b\xa4\xca\xc1\x42\x88\x29\x20\x92\
\x43\x16\x33\x1b\xef\x06\x79\xe7\x7f\x5d\xa4\x48\x91\x3e\xbd\x59\
\x6d\x2c\x79\xa4\x6d\xdb\xd6\x8d\x34\x22\x4d\xe1\x5c\xbd\x39\xda\
\xef\x8d\x19\x6b\x1f\x4f\xe4\x28\x58\xcb\xc5\x6c\x34\x28\xb7\x77\
\xcf\xff\x02\x37\x4a\xac\x10\xbc\x98\x68\x59\x60\xfd\x05\x27\xd2\
\x54\xce\xd5\x6b\xb0\x82\xd0\x86\xb5\x2c\x5b\xac\x14\x68\x27\x2e\
\xf3\x2c\x17\xb3\xbd\x22\x1c\x7a\x03\xc8\x1e\xab\x8b\x36\x14\xcc\
\x0c\x56\x0c\x30\x53\x58\xbe\xb1\x0c\x01\x33\x87\xe5\x6b\x99\x16\
\xcc\x2c\xd6\x21\x60\xa6\xb1\x42\xc1\xcc\x63\xfd\x4c\x1f\x18\x58\
\xde\x0b\xf9\x7d\x01\x96\x7a\x1c\x5f\xd7\x60\x0d\x3c\xbf\xc0\xe2\
\x52\x9a\xa6\x5d\x60\xd1\xac\x34\xed\x02\x8b\x66\xa5\x69\x17\x58\
\x34\x2b\xcd\xcd\x1e\x2c\x75\x1e\x2b\xb0\xd4\x7f\xb0\x5f\x56\x60\
\x71\x66\xa5\x39\xb7\xc0\xa2\x59\x60\x81\x05\x16\x58\x04\x2c\xb0\
\xc0\x02\x0b\x2c\xb0\x08\x58\x60\x81\x05\x16\x58\x60\xd9\x4c\xf7\
\xa5\x03\xb0\x68\x56\xfc\x88\x88\x80\xa5\x1c\x41\x9a\xc5\x18\xa6\
\x19\x41\xb0\x02\x46\x10\xac\x80\x56\x81\x15\xd0\x2a\xb0\x3c\xa9\
\xce\x66\x9d\x56\x3d\x94\x60\xf5\xe4\xe6\xfa\xaa\xf3\xe9\xed\x03\
\x2c\xc5\xf8\xf9\xde\xa3\x06\xeb\x3b\x93\x69\xcd\x3d\x4b\x9b\xcb\
\x8b\xf3\xde\x56\x81\xa5\x1c\x3f\xb0\xbc\x50\x4d\xd1\xf7\xdd\x12\
\xa8\x2d\xd4\xd3\xa9\x73\xf3\x0d\x67\x96\xea\xe2\x39\x7f\xe7\x80\
\x57\x40\x69\xd7\xad\x94\xb6\x91\xc2\xb6\x1f\x95\x86\xa1\x82\x57\
\xe0\x65\x8f\x35\x99\xd6\x3b\x77\xa8\x90\xb1\x33\x85\x15\x7b\x87\
\x56\x09\x92\x41\xac\xdf\x9e\x41\x7d\x3d\x66\xd9\x7d\x7a\x60\x12\
\xab\x7f\x31\x62\xfc\x1d\xa6\x59\xed\x29\x8d\x35\x6e\x59\x8f\x61\
\xea\x65\xae\xdb\x7c\x02\x90\xdc\xaf\x07\x36\x6c\xc3\x8c\x00\x00\
\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x32\xfd\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\xc8\x00\x00\x00\xc8\x08\x06\x00\x00\x00\xad\x58\xae\x9e\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0e\xc4\x00\x00\x0e\xc4\
\x01\x95\x2b\x0e\x1b\x00\x00\x20\x00\x49\x44\x41\x54\x78\x9c\xed\
\x7d\x7b\x98\x1d\xc5\x75\xe7\xaf\xfa\xde\xd1\xe8\x81\xd0\x6b\xb0\
\xac\x37\x16\x20\x40\xc8\x36\x20\xdb\xc8\x26\x76\xec\x64\x1d\x12\
\x0b\xc9\xd8\xf1\x3a\x04\x27\x40\xb2\x32\x63\x39\x24\xd9\xe4\x73\
\x1c\x6f\xbe\x64\xb5\x6c\x9c\x64\x49\x9c\x65\xb5\xcb\x07\x1e\x79\
\x24\x30\x6b\x88\x51\xd6\x59\x02\xe3\x35\xc1\x06\x1b\x63\x04\xb1\
\x91\x2d\x03\x01\x01\x02\x21\xcd\x8c\xde\x8f\x79\xdc\x79\xdc\x47\
\xd7\xd9\x3f\x34\x3d\xd4\xd4\xd4\xbb\xbb\xef\xdc\x91\xf4\xfb\xbe\
\xfe\xba\xea\xd4\xa3\x4f\x55\x9f\x5f\x9d\x53\xdd\xf7\xc1\x70\x16\
\xb9\xe0\x8e\x3b\xee\x98\xdd\xdc\xdc\xfc\x8e\x62\xb1\xb8\x94\x88\
\x96\x10\xd1\x42\x00\xf3\x01\xb4\x00\x98\x33\x72\xcc\x20\xa2\x73\
\x00\x34\x01\x98\x02\x20\x1a\x69\xce\x19\x63\x65\x22\xaa\x01\x28\
\x01\x28\x31\xc6\x7a\x00\x9c\x00\x70\x8c\x31\x76\x98\x88\x0e\x30\
\xc6\x3a\x19\x63\xfb\x89\x68\x6f\x6b\x6b\x6b\x6f\xdd\x07\x79\x06\
\x80\x4d\xb4\x02\x93\x1d\x6d\x6d\x6d\xb3\x88\xe8\xdd\x51\x14\xbd\
\x9b\x73\xfe\x4e\xc6\xd8\xa5\x44\x74\x31\x80\x79\x44\x14\x11\x11\
\x00\x20\x39\xcb\x69\x93\x8c\xb1\xf1\xb7\x47\x94\x25\x69\xc6\x18\
\x67\x8c\x1d\x03\xf0\x0a\x80\x97\x18\x63\x2f\xc6\x71\xfc\xf3\x6a\
\xb5\xfa\xf3\x3f\xfc\xc3\x3f\xec\x4b\x37\xc2\x33\x1b\x67\x09\xe2\
\x01\x22\x62\x77\xdd\x75\xd7\x25\x4d\x4d\x4d\xbf\x40\x44\x57\x03\
\xb8\x8a\x73\x7e\x11\x80\x02\x11\x41\x24\x83\x4c\x8c\x9c\x09\xa2\
\x4c\x03\x88\xa3\x28\x7a\x85\x31\xf6\xaf\x00\x76\xc4\x71\xfc\xd4\
\xe7\x3f\xff\xf9\x57\x01\x8c\xbf\xd8\x59\x28\x71\x96\x20\x16\xb4\
\xb5\xb5\x2d\x60\x8c\x5d\x43\x44\xbf\x02\xe0\xc3\x44\xb4\x20\x21\
\x80\xea\x00\xa0\x24\x8a\x2c\x57\x41\x94\xab\xc8\x21\xca\x65\xa2\
\x98\xc8\x22\x1e\x00\x0e\x30\xc6\xbe\x4f\x44\x8f\xc5\x71\xfc\xd8\
\xad\xb7\xde\x7a\xc8\x7f\x56\xce\x1c\x9c\x25\x88\x02\x77\xdd\x75\
\xd7\xaa\x42\xa1\xf0\x09\x22\xfa\x38\x80\x2b\x92\x50\xc9\x76\x00\
\x66\xef\x61\x22\x88\xaf\x07\x31\x9d\x4d\x04\x91\x8e\x98\x31\xb6\
\x93\x88\x1e\x06\xf0\x7f\x37\x6e\xdc\xf8\x52\xd0\x84\x9d\xc6\x38\
\x4b\x90\x11\xdc\x7d\xf7\xdd\x17\x15\x0a\x85\x1b\x88\xe8\x7a\x22\
\xba\x84\x88\xc0\x39\xb7\x92\xc2\x46\x10\x17\x0f\xa2\xf3\x28\x75\
\x20\xc8\xe8\x11\x45\x11\x18\x63\xff\xc6\x18\x7b\x10\xc0\x03\xad\
\xad\xad\xaf\x07\x4d\xe4\x69\x86\x33\x9a\x20\x9b\x37\x6f\x3e\xb7\
\xb9\xb9\xf9\x7a\xc6\xd8\xcd\x44\xb4\x86\x88\x98\x48\x8a\x2c\x09\
\x32\x11\x7b\x10\x4f\x72\x88\x07\x45\x51\xb4\x83\x88\xee\x89\xe3\
\xf8\xc1\x5b\x6f\xbd\xb5\x14\x34\xc1\xa7\x01\xce\x48\x82\x6c\xdd\
\xba\xf5\xdd\xb5\x5a\xed\xf3\x00\x6e\xe0\x9c\x9f\x23\x93\x41\x26\
\x86\x2b\x51\x80\x49\x17\x62\x8d\x23\x87\x98\x1f\x49\xf7\x45\x51\
\x74\x3f\x80\xbb\x5b\x5b\x5b\x5f\x08\x9a\xf0\x49\x8c\x33\x86\x20\
\x9b\x36\x6d\x8a\x16\x2d\x5a\xb4\x0e\xc0\x1f\x71\xce\x3f\x24\x7a\
\x0b\xf9\x6c\x23\x8c\x8d\x1c\xbe\x04\xd1\x85\x58\xc0\x78\x92\xb8\
\x12\xc4\x85\x24\x0e\xe4\x10\xcf\x9c\x31\xf6\x03\xce\xf9\x1d\x1b\
\x37\x6e\xfc\x36\x63\xec\x8c\x78\x12\x76\xda\x13\xa4\xad\xad\xad\
\x29\x8a\xa2\xdf\x22\xa2\x2f\x72\xce\x2f\x11\xc9\x60\x22\x86\x8f\
\x17\x01\xa0\x95\x99\xce\x09\xf2\x22\x88\x8d\x24\x3a\x82\x38\x9c\
\xff\x8d\x88\xfe\xf6\xd0\xa1\x43\x0f\xdc\x76\xdb\x6d\xb5\xc0\x5b\
\x33\x29\x70\xda\x12\xa4\xad\xad\xad\x69\x64\x6f\xf1\x67\x44\x74\
\xbe\x4c\x08\x9d\xf7\xb0\x79\x0e\x95\x0c\x48\x47\x10\x9d\x2c\x4d\
\x88\xa5\x23\x88\x62\xbf\xe1\xe2\x3d\x46\xcf\x52\xfa\x0d\xc6\xd8\
\x5f\x1d\x38\x70\xe0\xbe\xd3\x95\x28\xa7\x1d\x41\x46\x42\xa9\xdf\
\x04\x70\x1b\xe7\xfc\x82\x84\x0c\x36\x72\xf8\x78\x0e\x59\x06\x34\
\x86\x07\xb1\x91\x24\x63\x72\x88\xe9\xd7\x38\xe7\xff\x79\xe3\xc6\
\x8d\x0f\x9e\x6e\xa1\xd7\x69\x45\x90\x2d\x5b\xb6\xfc\x12\x11\x7d\
\x85\x88\xae\x50\x91\x22\x2b\x2f\x92\xc8\x81\xf1\xc4\xf0\xd9\xac\
\x27\xc8\x9b\x20\xae\x1b\x75\x1b\x51\x54\x24\x11\x0f\x00\xcf\x45\
\x51\xf4\x85\xd6\xd6\xd6\x27\x43\xef\x61\xa3\xe1\xb4\x20\xc8\x5d\
\x77\xdd\xb5\xbc\x58\x2c\xfe\x3d\x11\x7d\x9c\x73\xce\x64\x42\xe8\
\xc8\x62\x22\x47\xd6\x8f\x7b\x55\xe7\x04\x13\x49\x10\x57\xef\xa1\
\x22\x85\x86\x28\xc4\x18\xfb\x56\xad\x56\xfb\xc2\xad\xb7\xde\xba\
\x2f\xd5\x8d\x6d\x00\x4c\x6a\x82\x6c\xde\xbc\xb9\x79\xea\xd4\xa9\
\x7f\x0a\xe0\x4b\x9c\xf3\x69\x2e\xa4\x70\x0d\xb1\x42\x1f\xf5\x4e\
\x26\x82\xb8\x6c\xd2\x4d\x69\x1d\x59\x0a\x85\x02\x18\x63\x03\x8c\
\xb1\xbf\x3e\x78\xf0\xe0\x57\x6e\xbb\xed\xb6\x4a\x9a\xfb\x3c\x91\
\x98\xb4\x04\xf9\xea\x57\xbf\xfa\xa1\x28\x8a\xda\x92\x27\x53\xae\
\x87\xcd\x8b\xa4\x79\xd4\x3b\x99\x08\xe2\xf3\x04\xcb\x95\x24\x9a\
\xe3\xdf\x18\x63\xb7\xb4\xb6\xb6\xee\x48\x75\xc3\x27\x08\x93\x8e\
\x20\x77\xde\x79\xe7\x39\xcd\xcd\xcd\xff\x8d\x73\xbe\x91\x73\x1e\
\xa9\x48\x10\xc7\xb1\x33\x31\x6c\xde\x23\xcf\xf7\x21\x09\xb2\x24\
\x88\x2b\x49\x4c\xa1\x55\x46\xc4\x10\x8f\x98\x31\x76\x27\x63\xec\
\xcf\x5a\x5b\x5b\x07\x53\x19\x40\x9d\x31\xa9\x08\xd2\xd6\xd6\xf6\
\x0b\x8c\xb1\x7b\xe5\xa7\x53\x2a\x42\xa4\xf1\x22\x69\xf6\x22\x80\
\x1f\x41\x4c\xe4\x00\xf2\x21\x48\xc8\xfb\x8f\x50\x92\x14\x0a\x05\
\x31\xff\x6a\x14\x45\x37\xdd\x72\xcb\x2d\xcf\xa6\x32\x84\x3a\x62\
\x52\x10\x64\xd3\xa6\x4d\xc5\xc5\x8b\x17\x6f\x22\xa2\x2f\xc5\x71\
\x5c\xb4\x11\x43\x96\xdb\xf6\x21\xa6\xbd\x88\xef\x7e\x04\x68\x6c\
\x0f\xa2\x23\x47\xda\xb0\x8a\x31\x26\x93\x41\x47\x92\x6a\x14\x45\
\x5f\x9e\x33\x67\xce\x5f\x7d\xfa\xd3\x9f\x8e\x53\x19\x46\x1d\xd0\
\xf0\x04\x69\x6b\x6b\x5b\xca\x18\x7b\x80\x88\xae\x16\x0d\x5f\x26\
\x41\x9e\x5e\xc4\x87\x24\x80\xfd\x03\x8b\x59\x13\xc4\x75\x1f\xe2\
\x4a\x0e\x13\x31\x5c\x3d\x88\x4c\x16\x31\x3f\xb2\x89\x7f\x92\x88\
\x3e\xb3\x71\xe3\xc6\xee\x54\x06\x92\x33\x1a\x9a\x20\x6d\x6d\x6d\
\xbf\x16\x45\xd1\x7d\x71\x1c\xb7\xc8\x24\x30\x91\x25\x0b\x4f\x22\
\x13\xc1\x46\x10\x40\xff\xb2\x30\x4d\x88\x05\xe8\x3f\xc1\x9b\x9c\
\x75\xa4\x10\x65\x32\x39\xb2\xd8\x7b\x98\xbc\x86\x8e\x18\x52\xfa\
\x08\x63\xec\x33\xad\xad\xad\xdf\x4b\x65\x28\x39\xa2\x51\x09\xc2\
\xb6\x6e\xdd\xfa\xe7\x71\x1c\x6f\x8a\xe3\xb8\xe0\x43\x0e\x1f\x4f\
\x92\xd6\x8b\xf8\xec\x47\x92\xb4\x78\x96\xd3\xda\xc9\x08\x24\x48\
\xe8\x26\x3d\x8d\xf7\x50\x11\x46\x45\x12\xe1\x5c\x63\x8c\xfd\x45\
\x6b\x6b\xeb\xed\x68\xc0\xaf\x02\x37\x1c\x41\xee\xbb\xef\xbe\x19\
\x95\x4a\xe5\xbe\x38\x8e\x3f\x29\x1a\xbc\x7c\x76\xf5\x22\x62\x79\
\xda\xbd\x48\x1a\x92\x24\x70\x21\x84\x0d\x32\x61\x7c\x09\xa2\x22\
\x47\xe8\xde\xc3\x37\xc4\xd2\x90\x85\xa2\x28\xda\x0e\xe0\x77\x1b\
\xed\x29\x57\x43\x11\x64\xcb\x96\x2d\x8b\x19\x63\x8f\x70\xce\x2f\
\xd7\x11\xc3\x46\x94\x46\xf0\x22\x80\x1f\x29\x7c\xf6\x20\xa6\x72\
\x57\xa2\xd4\x6b\xef\x61\x23\x89\x7c\x66\x8c\x3d\x17\x45\xd1\xfa\
\xd6\xd6\xd6\x83\x56\x63\xa9\x13\x1a\x86\x20\x5b\xb6\x6c\xb9\x9c\
\x31\xd6\xc1\x39\x5f\x14\xc7\xb1\x95\x18\x2e\x44\xd1\x91\xc6\xe6\
\x49\x42\x48\x92\xc0\x75\x03\x1e\xe2\x49\x74\x64\xd1\x6d\xe4\x93\
\xb4\x0f\x39\xb2\xd8\x7b\x58\xf6\x1d\xc6\x73\xa1\x50\xd8\x5f\x28\
\x14\xd6\x6e\xd8\xb0\xe1\x45\xef\x09\xca\x01\x0d\x41\x90\xf6\xf6\
\xf6\x5f\xe6\x9c\xff\x13\xe7\xfc\xdc\xc4\x98\x45\x02\xb8\x90\x22\
\x2b\x2f\xa2\x0b\xb1\x74\xa4\xf0\x25\x47\xd6\x21\x96\x4e\xe6\xe2\
\x59\x5c\x88\x91\xd5\x53\x2b\x95\x4c\x43\x10\x14\x0a\x85\x93\x85\
\x42\xe1\xba\x0d\x1b\x36\xfc\x30\xf5\x64\xa5\x44\x61\xa2\x15\xd8\
\xb2\x65\xcb\xa7\x00\x7c\x8b\x73\x3e\x43\x47\x0a\x5f\xef\xe1\xfb\
\xc8\xd7\x74\x3d\xd5\x93\x30\x15\x29\xea\x45\x0e\xd7\xbe\x4d\x75\
\x74\x24\xd7\x3d\x5c\x70\xd5\x49\xb7\x58\xf8\xcc\xd1\x88\x7c\x1a\
\x80\xeb\xd7\xad\x5b\xf7\x42\x47\x47\xc7\x2b\xce\x4a\xe4\x80\x09\
\x25\x48\x7b\x7b\xfb\xcd\x00\xbe\x1e\xc7\xf1\x14\x17\x23\x0d\xdd\
\x8f\xb8\x1c\x72\x5d\xb1\x2f\x17\x8f\x61\xf3\x24\x26\x63\xb3\xed\
\x67\x4c\x6d\x64\x99\xae\xae\x9c\x4e\xce\xaa\xf1\xc9\xf5\x7d\xf4\
\xcb\xf0\x81\x44\x53\x14\x45\x9f\x5a\xb7\x6e\xdd\xeb\x1d\x1d\x1d\
\x13\xf6\x5d\xf8\x09\x23\x48\x7b\x7b\xfb\x67\x89\xe8\x6b\x71\x1c\
\x17\x74\x86\xea\x42\x16\x13\x51\x54\x9e\xc4\xf4\xce\x44\x6e\x03\
\xb8\x7d\xe9\x29\x64\x0f\x92\x94\xb9\x6c\xe0\x6d\x7d\xe8\xf2\xbe\
\x0f\x0a\x74\x1e\xc6\x57\xbf\xb4\xde\x53\x08\x0f\x0b\x8c\xb1\xeb\
\xd6\xaf\x5f\xbf\xff\x91\x47\x1e\xd9\xe5\xdc\x41\x86\x98\x10\x82\
\x8c\x90\xe3\xab\x71\x1c\x47\x2e\xab\x78\x9a\x70\xcb\xd4\xa7\xca\
\x8b\xe8\x42\x0f\xf1\xac\x93\xe9\xea\xc8\xf0\x0d\x5f\x42\xdb\xb8\
\xf4\x29\x9f\x75\x44\xb1\x79\x10\xdd\x3c\xf8\x2c\x18\x1a\x44\x8c\
\xb1\x75\x13\x45\x92\xba\x13\x64\xdb\xb6\x6d\x37\x71\xce\xb7\x98\
\x3c\x87\x4b\xd8\xe3\x4a\x14\xd7\xfd\x88\x0b\x31\xd2\x7a\x8f\x2c\
\x8c\xdc\x65\xc5\xf6\xdd\x0b\xe8\xae\xe1\xea\x41\x74\x7a\xa4\x81\
\xf4\xd0\x21\x02\xb0\x6e\xfd\xfa\xf5\x7b\xea\x1d\x6e\xd5\xf5\x29\
\x56\x7b\x7b\xfb\xaf\x13\xd1\x37\xe3\x38\x2e\xba\xac\xea\x36\x82\
\xf8\x3c\xd5\xd2\xc9\x88\x08\x73\xe6\xcc\xc1\x9a\x35\x6b\xb0\x70\
\xe1\x42\xd4\x6a\x35\xec\xd9\xb3\x07\xcf\x3e\xfb\x2c\xca\xe5\x32\
\x80\xf4\x9e\x44\x95\x77\x2d\x33\xbd\x07\x31\x3d\xb9\x12\xf3\xb6\
\x37\xf1\xb6\xb3\xea\x49\x96\xcb\x53\x2b\xdb\xd3\x2a\xe9\xc9\xd5\
\xb8\xbc\x2c\x2f\x16\x8b\x55\x00\x9f\x6a\x6d\x6d\x7d\x58\x3b\x29\
\x19\xa3\x6e\x04\x69\x6f\x6f\xff\x65\x00\xdf\x8e\xe3\xb8\xb9\x56\
\xab\x39\x85\x3b\x59\x84\x5b\xa6\x7d\x07\x00\xac\x58\xb1\x02\x37\
\xdc\x70\x03\xa6\x4c\x99\x32\x46\xdf\x63\xc7\x8e\x61\xcb\x96\x2d\
\x38\x71\xe2\x04\x00\x3b\x29\x7c\xf7\x21\x21\xab\x6d\xe8\xe3\x5d\
\x31\xed\xf3\xb1\x15\x59\x96\xf6\x9d\x87\x8d\x20\x26\x92\x08\xc7\
\x10\x11\xfd\xea\xe7\x3e\xf7\xb9\xba\x3c\x02\xae\x4b\x88\xb5\x65\
\xcb\x96\xcb\x01\x3c\x2a\x3e\xca\xb5\x3d\x61\xb2\xed\x1d\x42\x9e\
\x6a\xc9\xfb\x8c\x99\x33\x67\xe2\xb3\x9f\xfd\x2c\x9a\x9b\x9b\xc7\
\xe9\x3c\x7d\xfa\x74\x2c\x59\xb2\x04\x3f\xfe\xf1\x8f\x95\xe1\x97\
\x98\xae\x57\x98\x95\x26\xbc\x32\xc9\x6c\xe5\xae\xe3\xcb\x22\xc4\
\xb2\x7d\x72\x00\xa7\x9e\x6e\x5d\xb7\x7e\xfd\xfa\x8e\x47\x1e\x79\
\xe4\x68\xea\x0b\x5a\x90\x3b\x41\xb6\x6c\xd9\xb2\x38\x8a\xa2\x27\
\x38\xe7\xe7\x99\x08\x21\xef\x17\x42\xc3\x2d\x13\x51\x64\x43\x7f\
\xff\xfb\xdf\x8f\x4b\x2e\xb9\x44\xab\xfb\xac\x59\xb3\xb0\x7b\xf7\
\x6e\xf4\xf4\xf4\xe4\x1e\x66\xf9\x20\xe4\x3a\x21\x0f\x05\x74\xf2\
\xd0\x71\xc9\xf5\x5c\x3f\x19\xa0\xc0\x34\xc6\xd8\xda\x75\xeb\xd6\
\x3d\xd8\xd1\xd1\x91\xeb\xef\x06\xe7\x4a\x90\xfb\xee\xbb\x6f\x06\
\x11\x7d\x97\x73\xbe\xc2\xf5\xd1\xaa\xaf\x47\xb1\x85\x5b\xf2\x26\
\x5c\x26\xc8\xdb\xdf\xfe\x76\xad\xfe\x8c\x31\xec\xdb\xb7\x0f\x5d\
\x5d\x5d\x99\x6f\xd8\x45\xb9\xeb\x93\x22\x53\x7f\xae\xf5\xb2\x84\
\x89\x88\xaa\x32\x07\xc3\x1f\x53\xd7\x72\xcc\x8e\xa2\xe8\x43\x1f\
\xfe\xf0\x87\xbf\xf1\xd8\x63\x8f\xe5\xf6\xa3\x75\xc5\xbc\x3a\x06\
\xc0\xaa\xd5\xea\x7d\x9c\xf3\x2b\x6c\xde\xc2\x16\x6e\x99\xf6\x20\
\x2e\x61\x96\xfc\xd8\x32\x49\x57\x2a\xf6\x1f\xdb\x28\x97\xcb\xda\
\x77\x22\x36\x99\x2e\xaf\x93\xe9\x90\xd4\x95\x0d\x8c\x88\xc6\xc8\
\xc4\xbc\x5c\x26\xca\x74\x67\x5f\xc8\x44\x2e\x14\x0a\x99\x2d\x1c\
\x8e\x78\xef\xcc\x99\x33\xb7\x01\xb8\x01\xc8\xe7\xa3\xf2\xb9\x11\
\x64\xeb\xd6\xad\x7f\xce\x39\xff\xa4\x2f\x11\xb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42\x44\x17\xeb\
\x42\xab\xac\xc3\x2d\x39\xc4\x92\x43\xaa\xd9\xb3\x67\x63\xe3\xc6\
\x8d\x98\x37\x6f\x9e\xf3\x38\x1e\x78\xe0\x01\x3c\xfe\xf8\xe3\xca\
\xf0\xcc\x97\x28\xba\xbc\x6f\xa8\xa5\x6a\x63\xca\xdb\x56\x72\x55\
\xff\xf5\x40\x88\x47\x93\xbd\x88\x46\x7e\x0e\x80\xd5\xd3\xa6\x4d\
\xfb\xc6\x4b\x2f\xbd\x94\xd9\x60\x32\x25\xc8\x8d\x37\xde\x78\x1b\
\xe7\xfc\xb7\x54\x4f\xa5\x42\xc3\x2d\x1b\x39\x74\x61\x55\x82\x9b\
\x6f\xbe\xd9\xf8\xa4\x4a\x85\xe5\xcb\x97\xe3\x99\x67\x9e\x41\xa5\
\x52\xd1\x6e\xf0\x13\xd4\x79\x53\x9a\xaa\xbf\xbc\x49\xe0\x6a\xfc\
\x3a\x83\x57\x95\xe9\x3c\xa7\x86\x28\xe7\x5f\x78\xe1\x85\xd5\x47\
\x1e\x79\x24\xb3\x97\x88\x99\x11\x64\xeb\xd6\xad\xbf\x00\xa0\x3d\
\x8e\xe3\xc8\x44\x0c\x1b\x19\x54\xa4\x71\xa9\xaf\xda\x90\xaf\x5c\
\xb9\x12\x1f\xf9\xc8\x47\xbc\xc7\x92\xbc\x55\x7f\xf9\xe5\x97\xbd\
\xbc\x88\x29\xad\xca\x8b\x72\xdd\xa1\xab\xaf\xcb\xfb\x3c\x38\xb0\
\x85\x7d\xf5\xf4\x2a\x3a\x32\x98\xea\xa8\x42\xbd\x28\x8a\x3e\x78\
\xed\xb5\xd7\x3e\xd6\xd1\xd1\x91\xc9\xcf\x09\x45\x59\x74\x72\xe7\
\x9d\x77\x9e\x03\xe0\xde\x58\xf8\x51\x37\xd9\xb0\xf3\x0a\xb7\x54\
\x1b\xf2\xe4\x58\xbd\x7a\x75\xf0\x98\xae\xba\xea\x2a\x00\x6e\xef\
\x29\x92\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xb1\x8d\x08\x0e\x83\x71\x0e\xb7\x4c\x37\x4a\xbc\x31\xd5\
\x6a\x15\xbd\xbd\xbd\x98\x3b\x77\x6e\xd0\xd8\x88\x08\x47\x8f\x1e\
\x1d\x0d\x0f\xc4\xfe\xc5\xeb\x88\xf5\x55\x67\xb9\x5c\x97\x37\xe9\
\x91\xc0\xf7\x0d\x7a\x9a\x32\x53\x1b\x51\x1f\xdd\x38\x74\x65\x62\
\xb8\x15\x12\x56\xb9\xa4\x39\xe7\xc9\x86\xfd\x32\x00\x5f\x00\xf0\
\x37\xc6\x81\x18\x10\xfc\x14\xeb\xde\x7b\xef\xbd\x80\x73\x7e\x3f\
\xe7\xbc\x49\x34\x76\xdd\xd9\x96\x76\x0d\xb7\x74\xc4\x00\xc6\xaf\
\x5a\x0b\x16\x2c\xc0\xe2\xc5\x8b\x83\xc6\x77\xf8\xf0\x61\x74\x74\
\x74\x28\x09\x61\x3b\x9b\xd2\xaa\xbc\x2b\x5c\xfb\x71\x25\x69\xde\
\xb0\x3d\x95\xd2\xc9\x6d\x4f\xaa\xc4\xb4\xed\x88\xa2\x68\xcd\xb5\
\xd7\x5e\xfb\x8d\x8e\x8e\x8e\xde\x90\x31\x04\x7b\x10\xce\xf9\x7f\
\x27\xa2\x69\x26\x0f\xe1\xe2\x51\x4c\x44\x91\x65\xae\xc4\x48\x8e\
\xa7\x9f\x7e\x1a\x57\x5d\x75\x55\xd0\x06\xf4\x07\x3f\xf8\x81\xd2\
\x33\x25\x69\x97\xb3\x9c\x56\xe5\x7d\x61\xf2\x1c\x2e\xab\xbe\x4f\
\xbd\x2c\x20\xeb\x9a\x20\xf1\x24\x2a\x2f\xe2\xe2\x3d\x12\x2f\xa1\
\x92\x49\xe7\x19\xc5\x62\xf1\x2b\x00\x3e\x1d\xa2\x7f\x90\x07\xd9\
\xb6\x6d\xdb\x47\x89\xe8\x2f\x39\xe7\x4c\x17\x27\xba\x78\x12\xdb\
\xc6\x4b\x7e\x5a\x25\xc3\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xac\x4a\x87\x12\x03\x18\x1b\xb6\x54\
\xab\x55\xec\xdc\xb9\x13\xaf\xbd\xf6\x1a\xa6\x4c\x99\x82\xd9\xb3\
\x67\xa3\xa9\xe9\xd4\xd3\xbf\x6a\xb5\x8a\xd7\x5e\x7b\x0d\x0f\x3d\
\xf4\x10\xee\xbf\xff\x7e\xf4\xf7\xf7\x1b\x49\xe1\x4a\x10\xdf\x30\
\xcb\x15\x79\xf5\x9b\x05\x74\xe1\x93\x4b\x3b\xb9\x7d\x86\xc4\x48\
\xbc\x08\x18\x63\xef\xbe\xf6\xda\x6b\xbf\xda\xd1\xd1\x61\x7f\x73\
\x39\x02\xaf\x10\x6b\x60\x60\xe0\xb3\x44\x74\xbe\x1c\xfe\xd8\x42\
\x26\xdf\x43\xf4\x1c\x09\x5c\x62\x73\x55\x3d\xf1\xd8\xbd\x7b\x37\
\x5e\x7e\xf9\x65\x30\xc6\x30\x7d\xfa\x74\x44\x51\x84\xfe\xfe\x7e\
\xd4\x6a\xb5\x71\x24\x30\xe5\x45\xb9\x2c\x13\xf5\xd0\xc9\x64\x7d\
\x6d\xf0\x0d\xaf\x12\x99\x29\xac\x4a\x1b\x72\xf9\xe8\x2b\x5e\x53\
\x55\x2f\xb1\x21\x55\xf8\xe4\x13\x4a\xa9\xce\x51\x14\x8d\xda\x15\
\x63\xec\xa2\x62\xb1\x78\x23\x80\xad\xae\x63\x71\xf6\x20\x9b\x37\
\x6f\x6e\x9e\x32\x65\xca\x76\xae\xf9\x05\x76\x17\x8f\xe2\xb3\x99\
\xb7\x11\x22\xc4\xbb\x88\x47\xb9\x5c\xc6\xf0\xf0\xf0\x98\x6b\xa9\
\xfa\x15\x65\xe2\x4d\x76\xf1\x26\x3a\x99\x0a\xaa\x72\x93\x01\xfb\
\x90\x2d\xab\xb0\x2b\xab\x30\xca\xe4\x69\xb2\xf2\x1c\xe2\xdf\x3c\
\x48\xb2\x55\xd7\x5e\x7b\xed\xdd\xae\x5e\xc4\xd9\x83\xcc\x9a\x35\
\xeb\xe6\x38\x8e\x17\x8b\x1e\x43\xe5\x3d\xb2\xf2\x28\x69\x09\x60\
\x0a\xc1\x7c\xca\x44\x99\x2a\xed\x72\x4e\xe0\x1b\x06\x99\xea\x8b\
\x1b\x63\x57\x6f\x90\x85\xd7\x48\xb3\x21\xb7\x81\x88\x82\x36\xe1\
\x06\x8f\x31\x4e\x16\x45\xd1\xf2\x28\x8a\x7e\x0b\xc0\x3d\x2e\x3a\
\x39\x79\x90\xed\xdb\xb7\x17\x2a\x95\xca\x37\x39\xe7\x73\xe4\x17\
\x78\x3a\xef\x91\x66\xf3\x2e\x4e\x58\xbd\xc8\x91\x96\x20\x26\xef\
\x61\x82\x4b\x1d\x1f\xa3\x76\xf5\x58\x69\x90\x47\x68\x26\xf6\x99\
\xb1\xc7\x50\xa5\x2f\xbe\xf2\xca\x2b\xef\x7e\xf2\xc9\x27\xad\x93\
\xe4\xe4\x41\x06\x07\x07\x7f\x9d\x88\x96\xcb\xab\xbb\xec\x31\x54\
\x69\x93\x47\xd1\x79\x20\xd1\xe0\x74\xf0\x25\x86\x4b\x1b\xb9\x8e\
\x29\xaf\x4a\x8b\xd7\x51\xe9\x1b\x0a\x5d\x5b\xd1\xa8\x92\x3a\xf2\
\x0a\xef\xe2\x35\x42\xbc\x82\xb8\x7f\xf0\x6d\xa3\x82\xd8\x4f\xc6\
\x1e\x63\x5c\x3a\x8a\xa2\x4b\x96\x2c\x59\xb2\x1e\xc0\x43\x36\x9d\
\x9d\x08\x42\x44\x7f\x6c\x22\xc1\x44\x84\x56\x3e\x48\xe3\x61\x44\
\x99\x5c\x2e\xde\x58\x5f\x52\x84\x10\x46\xb5\x19\x97\xcb\xf2\xf4\
\x1c\x2e\x3a\x99\xe0\xaa\x9b\x0f\x41\x7c\x88\x21\xa6\x19\x63\x7f\
\x04\x07\x82\x58\x3f\xcd\x7b\xcf\x3d\xf7\xac\x21\xa2\xf7\x89\x5e\
\xc3\x46\x0e\x9b\x77\x31\x91\x43\x9e\xd0\x7a\x1d\x2e\xd7\x33\x11\
\x58\xa5\xb3\x69\x2c\x21\xf0\xbd\xae\x4e\x77\x97\x85\x68\x22\xe6\
\x5f\xd4\xdb\xc5\x56\xd2\xa4\x89\xe8\x83\xdb\xb6\x6d\xbb\xd2\x36\
\xe7\x2e\x1e\xe4\xf7\x88\x88\xb9\x2a\xa7\x22\x87\x2d\xac\xd2\xdd\
\x30\x57\x23\xc9\x8b\x1c\x2a\x79\x22\x13\xcf\x72\xda\x57\xe6\x0b\
\x5d\x68\xa5\x93\x11\x51\x50\x18\x95\x17\x54\x5e\x47\x47\x12\xd9\
\x3b\xa8\x42\x2a\x1f\xef\x91\xf4\x1b\x45\x11\xe3\x9c\x7f\x1e\xc0\
\x06\x93\xae\x46\x0f\xd2\xd6\xd6\xd6\x42\x44\x9f\x92\x0d\x58\x26\
\x83\xab\x47\x31\xc9\x74\x2b\x9f\x8d\x34\x79\x91\xc3\xb7\xad\x4a\
\x1f\x93\xcc\x65\x1c\x2e\x75\x5d\x64\xa1\x63\xcc\x6a\x7e\x7d\xee\
\x99\x58\xc7\xe6\x3d\x4c\x76\x26\xa7\x55\x79\x22\xba\xfe\x9e\x7b\
\xee\x99\xad\x9d\x68\x58\x08\xd2\xdc\xdc\xfc\xdb\x00\xa6\xba\x5c\
\xcc\x25\xdc\x52\x0d\x2c\x2d\x09\x74\x70\xbd\x71\x21\x06\x23\xb6\
\x95\xfb\x51\xf5\xeb\xa2\x97\xcf\x18\x74\x75\x4c\xba\xc8\xe9\x10\
\x03\xcf\x9a\x0c\xae\xf7\xda\x44\x00\x5b\x1d\x4b\x7e\x46\x1c\xc7\
\x37\x28\x15\x1f\x81\x2d\xc4\xfa\x1d\x95\xf7\x70\x25\x8a\x8e\xe9\
\xba\xbd\x47\x16\x37\xc9\x46\x1c\x9f\x7e\xe4\x7a\x62\x5b\x55\xda\
\x25\xaf\xd2\xc3\x06\xd3\xe6\x5c\x2c\x4f\xe4\xaa\xb7\xec\x62\x99\
\xcb\x35\x5d\xf4\x90\xe1\xda\xaf\x2a\x1c\x54\xd5\x49\xec\x46\xb5\
\x21\x77\x0d\xa5\x4c\xf9\x91\x6b\xff\x2e\x80\xbb\x74\xba\x6a\x3d\
\xc8\xbd\xf7\xde\xbb\xba\x54\x2a\xad\x52\x19\xbd\x2f\x51\x4c\x6e\
\xd0\x77\x35\x71\xa9\x93\xc5\x21\xf7\xad\xba\xa1\x72\xda\x94\x77\
\x1d\x8f\x0a\xae\x8b\x86\x2a\x6f\xd3\x5f\x37\xde\xac\xe7\xd2\x77\
\x1e\xe4\x72\x17\xfb\x72\xb5\x4d\x49\x76\x65\x7b\x7b\xfb\x2a\xdd\
\xdc\x6b\x09\x32\x30\x30\xf0\x99\xa7\x9f\x7e\x9a\x25\x9f\x53\x4a\
\x3a\xf5\x51\x5c\x97\x97\xd3\xba\x49\xb1\x4d\x6a\xbd\x08\x23\x1b\
\x97\xcd\x00\x4d\x46\x98\x46\x4f\x5d\x7b\xdb\xb5\x55\x69\x5d\x3f\
\xf5\x22\x84\x6d\x3e\x44\x79\x28\x31\x4c\x36\x2b\xe4\x19\x80\xcf\
\x8c\x53\x7a\x04\xca\x10\x6b\xd3\xa6\x4d\xd1\xfe\xfd\xfb\x3f\x5d\
\x2a\x95\xf0\xf2\xcb\x2f\xe3\xe2\x8b\x2f\x1e\xa7\x84\x4d\x11\x1f\
\xc6\xfb\x4c\x98\xed\x26\xba\xde\x1c\x17\x32\xe8\xc8\x21\xcb\xe4\
\xb4\x4b\x3e\x04\x72\x1f\xa6\xd0\x4a\xce\xeb\x9e\x68\xc9\x21\x57\
\x9a\x97\x86\x3a\x3d\x5d\xeb\xe9\x42\x2f\xd1\x66\x5c\x42\x29\x95\
\xac\xa7\xa7\x07\x3f\xfb\xd9\xcf\x94\x9f\xf5\x5a\xb5\x6a\xd5\xf5\
\x00\xfe\x0c\x18\xff\x17\x0a\x4a\x0f\xb2\x6c\xd9\xb2\xab\xbb\xba\
\xba\x16\x01\xc0\xde\xbd\x7b\x47\xff\x40\xc6\xc2\xc4\xa0\x50\x4c\
\x9c\x84\x10\xb2\xa8\xca\x4d\x75\x6d\x90\xdb\xca\x69\xb1\x9e\x2e\
\x6d\xca\xbb\xe8\xec\x4b\x7e\x53\xde\x35\x9d\xd5\x9c\xf9\x2e\x6c\
\xa6\x72\x59\xee\x19\x3a\x8d\x39\x66\xce\x9c\x89\x42\xa1\x80\x81\
\x81\x01\x94\x4a\xa5\xd1\xa3\xbf\xbf\x1f\x7b\xf6\xec\x39\xff\x6b\
\x5f\xfb\xda\x7b\x55\x63\x53\x12\xa4\xbb\xbb\xfb\x93\x7d\x7d\x7d\
\xa3\xf9\x17\x5f\x7c\x11\xa5\x52\x49\x4b\x12\x57\xa2\xc8\x79\x71\
\xf0\xa6\x49\x4f\x33\xc9\xa1\x47\xd2\x97\xd8\xaf\xac\xaf\x2e\x6d\
\xca\x87\x1a\xa1\xa9\x0f\x53\xde\x85\xec\x79\xcc\x9d\xa9\x4f\x5d\
\xb9\x4e\x1f\x00\x4e\xf6\xa4\x93\x25\xf2\x25\x4b\x96\x28\xf5\x39\
\x72\xe4\x08\xba\xba\xba\x3e\xa9\x9a\x73\x25\x41\x0e\x1d\x3a\xf4\
\x71\x59\xb6\x77\xef\x5e\x2d\x3b\x55\x0a\xab\x94\x56\x85\x67\xba\
\x89\x74\x99\x44\xdb\xe4\xeb\xea\xf8\xdc\xe0\xa4\x0f\xf1\x6c\x4b\
\x9b\xf2\xa1\x3a\x99\xfa\x31\xe5\x4d\x69\xdd\xb8\xb2\x98\xaf\x2c\
\xee\xa7\x2c\x57\xd9\x8f\xc9\x26\xe5\x63\xe1\xc2\x85\x63\xc2\x30\
\xf1\x78\xf3\xcd\x37\xaf\x1b\x37\x10\x28\x08\xd2\xde\xde\xbe\xea\
\xe8\xd1\xa3\xe3\x7e\xb3\xf3\xc8\x91\x23\xa3\x3f\xc3\x69\x22\x89\
\xc3\xa6\xc8\x6a\x40\xae\x93\x68\xbb\x29\xaa\x7e\x5d\xeb\xda\x8c\
\x48\x55\xcf\x85\x28\xae\x06\xe5\x33\x2f\xa6\x7c\x08\x49\x5c\xe7\
\xc8\xa7\xae\xaf\xdc\x34\x2e\x93\x5d\xe9\xf6\xc8\x44\x84\xa6\xa6\
\x26\xcc\x9f\x3f\x5f\xd9\xbe\xbb\xbb\xfb\xe2\x6d\xdb\xb6\x5d\x24\
\xeb\x30\x8e\x20\xaf\xbe\xfa\xea\xc7\x86\x86\x86\x94\x13\x51\x2c\
\x16\x9d\x98\xea\xe2\x4d\xb2\x98\x44\x5f\xb2\x98\x6e\x72\xd2\xce\
\x74\x96\x65\xba\x72\x57\xa2\xd8\xf4\xb1\xd5\x77\xc9\xdb\x74\xb5\
\x8d\xd7\x45\x1f\x1f\x32\xa7\x95\x9b\x6c\xc9\xe6\x49\x38\xe7\x58\
\xbc\x78\xb1\xb2\xac\xb7\xb7\x17\xbb\x76\xed\xfa\x98\x3c\x86\x71\
\x04\x39\x76\xec\xd8\x35\xaa\x89\x29\x16\x8b\x98\x35\x6b\x96\x97\
\x32\x26\xb9\x6a\x02\xf2\x98\x5c\xd5\x04\x9b\x6e\xb0\xc9\x48\x4c\
\x46\xa6\x4a\x9b\xf2\x3e\xba\xe9\xda\x98\xf2\xa6\xb4\xcb\xd8\x7c\
\xe6\x4c\x37\x16\x5d\x99\x8f\x5c\x96\xf9\x84\xf8\xaa\xf2\xf3\xce\
\x3b\x0f\x53\xa6\x4c\x51\xd6\xe9\xec\xec\x1c\x67\xfb\x63\x08\xb2\
\x7d\xfb\xf6\x69\xfd\xfd\xfd\x1f\x18\x37\x7b\xc0\xe8\x3f\x34\xf9\
\x2a\xe5\x1b\x5e\xb9\x4e\x62\xe8\x8d\x52\x95\xfb\x1a\x8e\xaa\x4c\
\x95\x36\xe5\x75\xba\xa9\xe0\x3a\x7f\xba\xb1\x98\x48\x62\x1b\xb3\
\xef\x5c\xfa\xe8\xed\x73\xef\x75\x7d\xba\xec\x41\xe4\x3d\xef\x82\
\x05\x0b\x94\xf5\x7a\x7a\x7a\x3e\xb8\x7d\xfb\xf6\x29\xe2\xf5\xc7\
\x10\xe4\x47\x3f\xfa\xd1\x07\x86\x87\x87\xa7\x8e\x9b\x05\x00\x73\
\xe7\xce\x35\x2a\x11\x72\xf8\x4e\x8e\x4d\x66\x9b\x4c\x57\xa3\xd4\
\x19\x91\xc9\xd0\x54\x69\x53\xde\xa4\x9f\xef\x5c\xa9\xf2\xb2\xdc\
\x85\x24\xae\x73\x63\xd2\x2f\xcb\x7b\xec\x72\x2f\x43\x8e\x85\x0b\
\x17\x2a\xe5\x7d\x7d\x7d\xe7\x7c\xe7\x3b\xdf\x79\x9f\xa8\xcb\x18\
\x82\x1c\x3a\x74\xe8\x43\xaa\x49\x89\xa2\x68\x4c\x78\xe5\x7b\xc8\
\x0c\x4f\x33\x69\x21\x93\x6b\x9b\xe4\xa4\xcc\x74\x96\xfb\x91\xcb\
\x7c\x89\xe2\x62\x8c\xb6\x71\xe9\x88\xa1\x4b\xbb\x8c\x45\x75\xb6\
\x11\xd6\x34\xae\x34\x32\x95\xce\x26\xbb\x72\x3d\x5a\x5a\x5a\xd0\
\xd4\xd4\xa4\xb4\xd3\xbd\x7b\xf7\x8e\xe1\xc0\x18\x82\x54\x2a\x95\
\xab\xc7\x69\x88\x53\xff\x93\x91\xbc\x61\x4d\x4b\x92\x2c\x26\xce\
\x77\x82\x43\x0c\x52\xd5\x8f\xea\x2c\xcb\x54\x69\x53\xde\xe7\xd0\
\x8d\xc9\x94\x76\xd1\xdf\x67\xfc\x3a\xfd\x55\x65\x79\xc9\x7c\x1e\
\xed\xaa\x0e\xc6\xd8\x98\xa7\x59\xe2\x31\x30\x30\x30\x86\x03\xa3\
\x04\x59\xbd\x7a\x75\x53\xad\x56\x1b\xe3\x5e\x12\xcc\x99\x33\xc7\
\xc9\x00\x5d\x6f\x72\x56\x13\x65\x33\x1e\xdb\x4d\xd5\x19\x8d\xed\
\x2c\xf7\x29\x97\xb9\x10\x43\xd5\x8f\x49\x77\xd3\x9c\x98\xd2\x2e\
\x3a\xfb\x9c\x5d\xf4\x77\x91\xb9\x8c\xcb\x36\x56\x1f\x9b\x93\xfb\
\xd1\x11\xa4\x5a\xad\xae\x81\xc0\x8b\xd1\xc4\xfc\xf9\xf3\xaf\x64\
\x8c\xcd\x1c\xd7\x1b\x80\x59\xb3\x66\x05\x29\xe6\xa2\xb0\xe9\x06\
\xea\x26\xcb\x75\x42\x65\x7d\x5d\x10\x42\x0a\x9b\x91\x9a\xc6\x60\
\xd2\x4d\x57\x47\x95\x37\xa5\x4d\x63\xd1\xd5\xb5\x21\x84\xc8\xa1\
\x44\xd1\x5d\x37\x8d\xfd\xcd\x9f\x3f\x5f\xd7\xdf\xdc\x95\x2b\x57\
\xbe\x2b\xb9\xde\x5b\x4c\x89\xa2\x0f\xaa\x26\x62\xca\x94\x29\x98\
\x36\x6d\x5a\xe6\x64\x48\x33\x89\x2e\x93\x6a\x93\xfb\x18\x8f\xaa\
\x9e\x89\x1c\x72\xff\x72\xda\x44\x14\xd3\x1c\xaa\x74\xd7\xa5\x43\
\xf4\xb7\xd5\x77\x99\x57\x95\x5c\xd5\x6f\x9a\x3a\x59\x90\x66\xda\
\xb4\x69\x98\x31\x63\x86\xb2\x4c\xe4\x82\xb8\x07\x51\x3e\xde\xf5\
\xdd\x9c\xcb\x83\x30\x95\xd9\x26\x25\xed\x44\xea\xae\xaf\x83\xcd\
\x88\x7c\x0c\xd0\x96\x76\xd5\x49\x57\xdf\x96\x4e\x43\x16\xd7\xb9\
\xca\x9b\x14\x3a\xbd\x55\xd7\x0f\x21\xc9\x79\xe7\x9d\xa7\xb3\xe1\
\x51\x2e\x88\x04\xb9\x4a\x35\x11\xe7\x9e\x7b\x6e\xd0\xcd\x54\x29\
\xad\x9b\x08\xdf\xc9\x52\x19\x4b\x08\x59\x7c\x0c\x42\x05\x53\x3f\
\xf2\x1c\xb8\xe8\x64\x5b\x74\x4c\xfd\xb9\x90\xc4\x77\x9c\xaa\xf6\
\xbe\x73\x6d\xab\x63\xcb\xeb\xea\x98\xe6\x48\x37\x16\x59\x9f\x79\
\xf3\xe6\xe9\xe6\x7c\x4d\x52\x2f\x02\x80\xb5\x6b\xd7\x2e\x02\xb0\
\x40\xd5\xf1\xcc\x99\x6f\x6d\x4b\x42\x58\x6a\xbb\xd9\xaa\x81\xa4\
\xcd\xbb\xc8\x74\xb0\x19\x97\x8b\xd1\x99\x8c\x56\xd4\xc7\x77\xd1\
\x31\xf5\xe7\xaa\x4b\xc8\x78\x4c\x3a\xb9\xc8\xd2\xe4\x75\x75\x42\
\xed\x4e\xcc\xcb\xef\xf6\x84\x6b\x2d\x5d\xb1\x62\x45\x0b\x30\x42\
\x90\x28\x8a\xae\x60\x8a\x2f\x1c\x47\x51\xa4\x8d\xd3\xd2\x10\xc3\
\x67\x22\xd2\xe4\x75\x32\x55\xb9\xab\x61\xb8\xf6\x63\x33\xe6\x24\
\x1d\x72\x83\x4d\xe9\xbc\xc6\x63\xab\x67\x92\xe5\x75\x1f\xd3\xda\
\xe4\xac\x59\xb3\x74\xaf\x2f\xa2\x28\x8a\xae\x00\x46\x08\x42\x44\
\xef\x56\x0d\x7e\xfa\xf4\xe9\x99\xfd\x0e\xab\xee\xc6\xea\x64\x59\
\xe4\x4d\x32\x17\x03\xca\x62\xf5\x15\xcb\x54\x69\x59\x37\xdd\xa2\
\xa2\x6b\x6f\xbb\x66\xa8\xde\x2e\xe3\x50\xe9\x26\xd7\xcf\x2a\x2f\
\xcb\xd2\x2e\x00\x00\x50\x28\x14\x70\xce\x39\xe7\x28\xe7\x9e\x31\
\xf6\x6e\xe0\xad\x3d\x88\xf2\x4b\xeb\x59\x79\x0f\xdf\x55\xa8\x1e\
\x64\x31\xe9\x91\xf5\xea\x6b\x5a\xf5\x4d\xba\xa9\xca\x55\xe9\xbc\
\xf4\xb6\xd5\xf5\x9d\xf7\x2c\x48\xa2\xea\x3f\xcd\x21\xee\xb1\xc5\
\x83\x73\xbe\x0a\x78\x8b\x20\x97\xaa\x14\x98\x31\x63\x86\x51\xc1\
\x10\xd4\x83\x0c\xa6\xbc\x8b\x4e\xa6\x3a\x69\x56\x67\xdd\x2a\xec\
\xb2\xb0\x88\x79\x17\x92\xf8\xe8\xe5\x3a\x66\x53\x1d\x95\x9e\xae\
\xf5\xd3\xe4\xd3\x42\xe7\x41\x30\xc2\x89\x08\x00\x03\x70\xa1\xaa\
\xf1\xf4\xe9\xd3\x33\xf5\x20\x8d\x42\x0e\x9f\x1b\x9f\xd5\x0d\xd1\
\x19\xb7\xeb\x2a\x59\x4f\xbd\x6c\x75\x5d\xe5\xba\xf2\xac\xf2\x59\
\xd8\xa5\x21\x4a\x5a\x01\x00\xd1\xda\xb5\x6b\x17\x02\x98\xae\x1a\
\xd8\xb4\x69\xd3\x8c\x03\xaf\x27\xea\xb5\xf2\xf8\x18\x5e\x16\xde\
\x24\x49\xbb\x78\x90\x2c\xae\xeb\x3a\x26\xdf\x7a\x79\xdf\x9f\xac\
\x3d\x47\x02\x83\x13\x98\xb5\x62\xc5\x8a\x96\x88\x73\x7e\xbe\xea\
\x09\x16\x63\x0c\xcd\xcd\xcd\x4e\x17\xd1\xad\x8a\xba\x9b\x2d\xb7\
\x71\xc9\xa7\x69\xeb\xe3\x31\x4c\x08\x59\x6d\x55\x75\xe5\xf9\xb1\
\xf5\xe3\xda\x57\x1a\x9d\x74\x75\x7d\xfa\xc9\x6a\x91\x72\xa9\x6b\
\xf3\x0c\x62\x1d\x53\x9f\x53\xa7\x4e\xd5\xb5\x67\xb5\x5a\xed\xfc\
\xa8\x50\x28\x2c\x53\x29\x30\x65\xca\x14\xf9\x27\x1a\x53\x2b\xe3\
\x8a\x34\x13\x9b\xf6\x5a\x69\xeb\xe8\xea\xda\xbc\x89\xab\x07\xf1\
\xbd\x8e\x8b\xce\x69\xea\x34\xea\x7d\x76\x5d\xb4\x75\xdf\x2e\x1c\
\xa9\xbf\x34\x02\xb0\x50\x75\x81\x84\x59\x79\x2b\xef\xdb\x77\x9e\
\xab\x96\xed\x5a\x69\xeb\xe8\xc8\x21\xa6\x4d\x0b\x8d\x2b\x49\x42\
\xf5\xcb\x02\x79\x7a\x91\x3c\x16\xca\xe4\x7b\x21\x49\xff\xd2\x3d\
\x58\x1c\x11\x91\xf2\x0d\xfa\x94\x29\x53\x54\xe2\xba\x23\x2f\xef\
\x91\xb6\xdf\x90\x10\xc4\x54\x4f\x65\x0c\x21\xfd\x84\xe8\xeb\x82\
\xbc\xfa\xce\x53\x2f\x17\x14\x0a\x05\x93\x07\x59\x10\x31\xc6\xde\
\xa6\x6a\x18\x4a\x10\x9d\x6b\xcb\x03\x79\x79\x8f\x50\x63\xc8\xc2\
\x9b\x84\x86\x56\x59\xe8\x98\xd5\xbd\xaa\x67\x88\x9c\xf4\xaf\x0b\
\xfb\x6d\x50\xfd\x4e\x56\xd2\x96\x73\x7e\x5e\x11\x40\x8b\xaa\x61\
\x53\x53\x93\x97\x82\xf2\x39\x0f\xe3\x9c\xcc\xf0\x8d\xe5\x89\xcc\
\x7f\xbe\x69\x2b\x9f\xac\xc8\x6a\x5c\x19\x2d\x28\xf3\x8a\x44\x34\
\x4b\xa5\x90\x2b\x41\x7c\x14\x49\x8b\xd3\x9d\x3c\xe2\xf8\x92\xcf\
\x08\x9d\x25\x41\xfa\xb6\x26\xbb\x51\xfd\x0c\x95\xd0\x6e\x4e\x91\
\x31\x36\x4b\x55\x58\x2c\x3a\xfd\x01\xee\x59\x9c\xc5\xa4\x46\xf2\
\xf7\x1e\x1a\xcc\x2a\x02\x50\x7e\x9e\xa4\x50\x28\x78\x5d\xa8\x1e\
\x2b\x5d\x23\xfd\x11\x65\x96\x10\xbd\xc5\xe9\xea\x35\xb2\x42\xd6\
\x73\x53\xad\x56\x01\x68\xbd\xcc\xb4\x22\x34\x6f\xd1\xa3\xc8\xfa\
\x0f\xd1\x00\xea\x43\x8c\xd3\x01\xae\xe4\x16\xe7\xd3\x34\xb7\x93\
\x79\xde\xeb\xb5\x98\xba\x5c\xaf\x52\xa9\x28\x43\xdb\x11\xcc\x28\
\x02\x50\xba\x0a\x57\x82\x88\x0a\x24\x7f\x48\x22\x1e\xbe\xf0\xf1\
\x12\x13\xe1\x51\xd2\x5e\x53\xe5\x2d\x4c\x5e\x43\x96\xa7\x35\xae\
\x46\x27\x56\x16\xfa\xc9\xf6\x68\xc2\xd0\xd0\x90\xe9\x7e\x36\x47\
\xaa\x8f\x99\x88\x17\x49\x8b\x7a\xde\x50\x1f\x63\xca\x63\x75\x16\
\x6f\x4c\x48\x3b\x93\xdc\xa5\xcf\xd0\xeb\xbb\x5c\xc3\xa7\x2c\x6b\
\x52\x9b\x90\x76\x51\x1e\x1c\x1c\x34\x3e\x6a\x77\x77\x13\x19\x22\
\xcd\x04\x36\xca\x0a\x18\x62\xb0\xba\x73\x92\xd6\xdd\x68\x9f\x7e\
\xd2\xe8\x5b\x0f\xd4\x93\x3c\x2e\x18\x18\x18\x00\xa0\x7f\x07\x65\
\x24\x88\xea\xff\xdc\xc4\xb2\xbc\x90\xa5\xd7\xb0\xf5\x95\xd6\x93\
\xa4\xf5\x1a\xa6\x55\x2f\x34\x4c\xf5\xd5\x2b\xcd\xbd\xcc\xd2\x7b\
\xd4\xd3\x13\x25\x7d\xf5\xf7\xf7\x8f\x2b\x13\xc9\x12\x01\x88\x55\
\x1d\xc8\x1b\x17\x31\x6d\xda\x73\x98\x8e\xb4\x83\xd1\xe5\xd3\xd6\
\x77\xbd\x7e\x1e\x5e\x43\x4c\x9b\x3c\x88\x6b\xbf\x59\x93\x3a\x4b\
\xef\x9e\xe7\x7e\xca\x36\x97\xaa\xb9\x65\x8c\xa1\xb7\xb7\x57\xe9\
\x3d\x46\xc0\x23\x22\xaa\xa9\x2e\x9e\xfc\x87\x60\x5e\xf0\x5d\x2d\
\xd2\xae\xf4\xae\x7d\xd4\xcb\x6b\x88\x32\x57\x0f\x92\xe5\x75\x5d\
\xdb\xa4\xe9\x2f\x4f\xef\xa1\xf2\xc0\x21\x0b\x71\x6f\x6f\xef\x98\
\xbc\xf4\x71\x93\x81\x08\xc0\x78\x1f\x03\x20\x8e\x63\x2b\xfb\x4c\
\x83\x50\x29\x3a\x91\xee\xd8\xa6\x9b\xad\x7f\x97\xba\x3e\x5e\x43\
\xe7\x25\x5c\x3d\x88\xef\x75\x7d\xc7\x60\xaa\xa3\xaa\x97\xe5\x82\
\x67\xba\xae\x6f\x5b\x13\xaa\xd5\xea\xe8\x9f\xd3\xca\x18\x21\xca\
\x70\x04\x60\x50\xd5\x38\x8e\x95\x91\xd7\x38\x05\x4d\xc4\x51\xdd\
\x6c\x53\x5f\xb6\xb2\xac\x6f\x42\x88\xb7\xc8\xca\x6b\x88\x69\x97\
\x70\x40\xd7\x47\xa8\xb1\x84\x78\x4c\xd7\xf2\x7a\x91\xc7\x65\xee\
\x4c\xc7\xc9\x93\x27\x95\x1f\x75\x17\xd0\x17\x31\xc6\x7a\x54\x17\
\xaf\xd5\x6a\xb9\x0c\xb4\x1e\x93\xad\x5b\x7d\x5d\xaf\xe9\x82\x50\
\xaf\xe1\xa3\x97\xae\xae\x69\x5e\xf3\xf0\x2a\xae\x7a\xa9\xda\x4c\
\x14\x79\x5c\x70\xfc\xf8\x71\x93\xf7\x00\x80\xbe\x88\x88\x8e\xab\
\x1a\x27\xaf\xe0\x75\x1e\x22\x34\xaf\x1a\x64\x3d\x88\xe8\x62\x20\
\x69\x8d\xca\x95\x24\x69\x3c\x88\xaa\x9f\x34\x24\xf0\x6d\xaf\xab\
\x33\x51\x64\x49\x73\x1c\x3b\x76\x0c\x80\xd6\x7b\x80\x88\x4e\x44\
\x00\x8e\xa9\x26\xa2\x52\xa9\x18\x8d\xdd\xf7\x90\x31\x91\x24\x11\
\xd3\x21\x2b\xaa\x8b\x41\x99\x48\x92\xa4\x7d\x88\x67\xea\xc7\x55\
\x87\x10\x22\xd9\xc6\x61\xbb\x76\x56\x79\x55\xff\x2a\x1b\x73\x21\
\x6a\x82\xa3\x47\x8f\x8e\x93\x49\x44\x39\x1a\x01\x38\xac\x6a\x5c\
\xa9\x54\xbc\x14\xb6\x21\xaf\x15\xc6\x66\x74\xae\x86\x68\x33\x1e\
\x5d\xde\xd4\x4e\x27\x53\xe5\x5d\x16\x17\x1d\x51\x4c\x32\x57\x32\
\x84\x92\xc7\x65\xbe\xf3\x5e\xec\x54\x32\xdb\xe2\x0e\x00\x47\x8e\
\x1c\xd1\x7e\x77\x69\x44\x76\x38\x02\x70\x60\x5c\x29\x80\x72\xb9\
\x9c\xca\x63\x98\x6e\xb2\xcf\xc0\x43\x6f\x80\x49\xe6\x43\x76\x9f\
\x95\xcd\x66\xb0\xa6\x1b\x68\xea\xd3\x44\x14\x1b\x61\x6c\x3a\x86\
\xcc\x85\x0f\x31\x5c\x16\x30\x5b\xde\xb4\x38\x85\x1e\x3d\x3d\x3d\
\x63\x9c\x80\xe6\x4d\xfa\x81\x88\x73\xde\xa9\x9a\x8c\xe1\xe1\x61\
\xe5\x04\xd5\x8b\x24\x21\x13\xeb\x4b\x26\x9d\xb1\x84\x9e\x6d\x32\
\x9b\x9e\xa6\x39\x53\xb5\x75\xbd\x6e\x1e\xe3\x73\x19\x8f\x2c\x0b\
\xa9\xa3\x6b\x13\x6a\x7b\x09\x0e\x1d\x3a\x64\xf4\x1e\x23\x1f\x20\
\xed\x2a\x12\xd1\xfe\x71\x35\x70\xea\x29\x56\xf2\x24\x4b\x77\x11\
\x79\x10\x2e\x8a\x26\x0a\x89\x69\xb1\x1f\xc3\x47\x8f\x9d\xdb\xe8\
\x64\xb2\x3c\x0d\x12\x5d\xe4\xb3\x5c\x96\x5c\x53\xd6\x4b\x35\x9f\
\x3a\x9d\x55\xd7\x76\x4d\x9b\xfa\x09\x85\x2b\x81\x4d\x32\x53\x1d\
\x9f\x36\x2e\x64\x50\xd5\x3f\x78\xf0\xe0\x68\x99\xee\x9e\x70\xce\
\xdf\x8c\x06\x07\x07\xf7\x12\xd1\xb8\xd7\xe6\x44\x84\xc1\xc1\x41\
\x27\x66\xba\x32\x5b\xa5\xb4\x4d\xe6\x3a\x79\xa6\x09\x34\xc9\xd3\
\xac\xa6\xb2\xce\xae\x86\x6b\x9a\x0f\x9f\x32\x1f\x72\xa4\x1d\xaf\
\xeb\x7c\xca\x72\x17\x99\x29\xaf\xab\x63\xb2\x2d\x9b\xcd\x26\x04\
\x51\xfd\x0e\x80\xf0\x5e\xa4\x76\xec\xd8\xb1\xfd\xd1\x93\x4f\x3e\
\x59\x02\x70\x48\xae\x08\xc0\x89\x20\x26\xc2\xb8\x10\x25\xcd\x44\
\x86\x92\x22\x14\x26\xb2\xb8\x90\x24\xe4\x46\xba\xcc\x4f\x28\x39\
\x42\xe1\x42\x64\x5f\x99\x6f\x3b\x5f\x9b\x13\x8f\x72\xb9\x3c\xee\
\x11\xaf\x88\x91\x7c\x27\x80\x72\xf2\x69\xde\xdd\xf2\x40\x89\x08\
\xa5\x52\xc9\x9b\x20\x3e\x04\xca\x72\x12\x43\xe4\x3a\xc3\x71\x31\
\x28\x9b\x21\xea\xc6\x1a\x4a\x56\x55\x3b\xdd\x75\x6c\x84\xd1\x95\
\x99\xce\x3e\xf3\xa9\xd2\xcf\x26\xf3\x69\x97\xd6\x06\xc5\xf0\x2a\
\x81\x62\x83\xbe\x1b\x78\xeb\xfb\x20\x2f\x89\x15\x13\x94\x4a\xa5\
\x4c\x14\xd2\x4d\x62\x5a\xa2\xa4\x21\x85\x0e\x3e\x64\x31\xc9\x54\
\x69\xd3\x38\x7c\xe7\xcc\xf5\x9a\x36\x99\x89\x40\x2a\xd8\xe6\xd2\
\x55\x67\x51\xae\xcb\xeb\xc6\x94\xf6\xe8\xea\xea\xb2\x3d\xde\x05\
\x63\xec\x25\x00\x28\x8e\x08\x5f\x10\x95\x48\x2a\xf5\xf5\xf5\x65\
\xae\x5c\x72\xa4\xd9\x6c\xbb\x6c\xc0\xe5\x89\xb6\x95\xc9\x3a\x89\
\x48\xca\xe4\xb3\x5c\x26\xf6\xa5\x4a\xbb\xe8\xa6\xba\xb6\x4b\x99\
\xca\xf8\x74\x75\x5c\xfa\x14\xcf\xae\x0b\x8f\x8d\x00\x72\x1b\x53\
\x3d\x17\x79\x72\x44\x51\xe4\xb5\xd0\x74\x75\x75\x8d\xf6\xa5\xda\
\xa0\x8f\x90\xe7\x05\x60\x84\x20\x00\x76\x89\x95\x93\x74\xb9\x5c\
\x46\xa5\x52\x41\xa1\x50\xc8\x94\x1c\xa2\x42\x79\x91\x42\x36\x3a\
\x9d\x51\xe8\xbe\x1f\xae\x23\x8d\x89\x24\xb6\xb4\xaf\x6e\x2a\xe8\
\x0c\xc6\x35\x6d\x92\xe9\xce\x49\xda\x44\x06\x55\x1d\xdc\x42\xd7\
\x88\x00\x00\x12\x93\x49\x44\x41\x54\x55\x99\xab\xcc\x85\x8c\x32\
\x49\x5c\x88\x52\xad\x56\x47\x5f\x10\xaa\xee\x49\x22\xe3\x9c\xef\
\x02\x46\x42\xac\xe3\xc7\x8f\xbf\x40\x44\x15\xb1\x62\x92\xee\xed\
\xed\x75\x66\xa9\x49\x49\xb9\x2c\x8f\x89\x73\x9d\xd0\x44\x97\x28\
\x8a\xc6\x90\x5f\x9c\x20\x9b\xb1\xe8\x64\xb2\xfe\x2a\xfd\x5c\x16\
\x0f\x53\xb9\xaa\x5f\x55\xb9\x8b\xbe\xaa\x32\xd5\x3c\xba\xcc\xad\
\xa9\x8e\x4e\x6f\xd3\x75\x54\x72\x57\x22\xe8\x8e\xee\xee\xee\xd1\
\xef\x3a\xe9\x36\xe8\x44\x34\xd8\xd3\xd3\xf3\x56\x88\xf5\xec\xb3\
\xcf\x0e\xad\x5d\xbb\xf6\x45\xc6\xd8\x95\x49\xa5\x04\x3d\x3d\x3d\
\x68\x69\x69\x71\x22\x07\xe7\xdc\xa9\x2c\x19\xb8\x6d\xf5\x57\xc9\
\x6c\x72\xb9\x2c\xc9\xcb\xc4\x17\x3f\xe6\x2c\xca\x92\x83\x73\x3e\
\xfa\xab\x7b\x49\x3a\xc9\xcb\x5e\x46\x77\x2d\xdd\x18\x43\x43\x2a\
\x5d\xb9\x8d\x18\xba\xb4\xa9\x2f\x17\x92\xca\xed\x5c\xc8\x92\x95\
\xdc\x75\x21\x96\x8f\xce\xce\x4e\xab\xf7\x00\xf0\x73\x00\x55\xe0\
\xad\x10\x0b\x00\x9e\x21\xa2\x2b\xe5\x46\x27\x4e\x9c\x08\x26\x47\
\xa2\xac\x58\x96\xc8\x92\x2f\x64\x89\xd7\x92\x6f\x52\x28\x29\x92\
\xb3\x4c\x02\x5d\x5a\x5e\x49\xc4\x1b\xa0\xea\x4b\x24\x4c\x72\x88\
\x64\x50\x91\x46\x73\x23\x82\x91\x96\x28\x26\x59\xc8\xca\x2c\xeb\
\x51\x0f\x52\xd8\x22\x16\x95\x7c\xdf\xbe\x7d\x00\xf4\x8b\xf0\x48\
\xfe\x99\x44\x56\x14\x0a\x9f\x66\x8c\xfd\x9e\x3c\xe9\xbd\xbd\xbd\
\x46\xcf\x60\x22\x87\x2c\x97\x65\x69\x3c\x85\x98\x56\x3c\xa2\x33\
\xa6\x7d\x08\xa3\x2a\x67\x8c\xa1\x50\x28\x8c\xfe\x76\x98\xe8\x75\
\x44\x02\xc9\x44\xd7\x8d\xc7\x15\x36\x52\xd8\xf2\xae\xe4\xf0\xd1\
\x27\x0f\xb2\x88\x65\x72\x5e\x45\x0a\x1b\x49\x00\x60\xef\xde\xbd\
\x78\xf1\xc5\x17\x47\xdf\x7f\x24\x50\x2d\x62\x9c\xf3\xa7\x93\xfc\
\x28\x41\x38\xe7\x4f\x15\x0a\x05\x22\x22\x26\x56\x26\x22\x9c\x3c\
\x79\x12\x73\xe7\xce\x75\x22\x80\xc9\x6b\x24\x32\x31\x9d\x5c\x47\
\x9c\x08\xf1\xfa\xb2\x2e\xe2\xa1\xaa\xe3\x9a\xf6\xf5\x30\x26\x59\
\xa2\x77\xf2\x5f\x13\xe2\x7f\x4e\xc8\xa1\x99\x6a\x9c\x21\x08\x21\
\x86\x2e\x1d\xea\x41\x54\x3a\x65\x41\x16\x5b\x99\xab\x37\x29\x95\
\x4a\xd8\xb3\x67\x0f\x76\xef\xde\x3d\xfa\xca\x42\x35\x0f\x52\x48\
\x1c\xc7\x71\xfc\x54\x52\x36\x4a\x90\x47\x1f\x7d\xb4\xeb\x63\x1f\
\xfb\xd8\xab\x00\x2e\x96\x0d\xe2\xd8\xb1\x63\x98\x37\x6f\x9e\xd1\
\x6b\x98\x08\x23\x12\x43\x26\x87\x4e\xd9\x24\x1d\xc7\xb1\x92\x18\
\x62\xdd\x50\x92\xf8\xf4\xe1\x4b\xca\x64\x4c\x85\x42\x61\x1c\x61\
\x74\x7d\xe9\x60\x22\x53\x56\x1e\x44\xcc\x87\x1e\xb6\x7e\x4c\xe5\
\xaa\x71\x89\x65\x2a\x12\x88\x0b\x72\x22\xe3\x9c\x63\xef\xde\xbd\
\x78\xfd\xf5\xd7\x71\xe0\xc0\x81\x71\x7d\x26\x90\x3d\x87\x20\x7b\
\xa9\x54\x2a\x8d\x7e\x51\x44\xfe\x09\xf7\xef\x01\xb8\x38\xa9\x9c\
\xe0\xc8\x91\x23\xb8\xe4\x92\x4b\x9c\x48\xe0\x42\x0c\x31\x2f\x5f\
\x8b\x31\x86\x38\x8e\x51\xab\xd5\xb4\x4f\x1b\x26\x8a\x24\xa6\xb4\
\x0c\x55\x99\xe8\x65\x00\x28\x3d\x8b\x0b\x74\x06\xe5\x92\x37\x79\
\x93\x2c\x0f\x95\x7e\xa1\xe5\xb2\xc7\x90\x49\x41\x44\x38\x7c\xf8\
\x30\xf6\xef\xdf\x8f\xae\xae\x2e\xd4\x6a\x35\xe5\x1c\xb8\xec\x09\
\x89\xe8\x7b\x62\x9b\x31\x04\xe1\x9c\xff\x4b\x14\x45\xe3\xf6\x21\
\xfd\xfd\xfd\x18\x1a\x1a\x42\x73\x73\xb3\xd1\x6b\xe8\xc8\xa2\x22\
\x86\xbc\x59\x27\xa2\xd1\x4f\x10\x8b\x3f\x39\xe4\x63\x9c\x59\x91\
\xc4\x46\x18\x15\x4c\x75\x75\x6d\xe5\x3d\x8c\xac\x07\xe0\xff\x54\
\xcb\xc5\x83\x88\x69\xf1\xec\x62\xe8\x26\x3d\xf2\xf2\x2e\x09\x19\
\x44\x62\x10\x11\x8e\x1e\x3d\x8a\x43\x87\x0e\xe1\xe0\xc1\x83\xa3\
\xdf\xed\x70\x20\x80\x52\x96\xe4\x39\xe7\x8f\x8a\xba\x8c\x21\x48\
\x1c\xc7\x4f\x30\xc6\x86\x00\x4c\x13\x3b\x03\x4e\x7d\x7e\xfe\xfc\
\xf3\xcf\x57\xee\x33\x74\x79\x99\x0c\xaa\x34\xe7\x1c\x95\x4a\x05\
\xd5\x6a\x55\xfb\x5b\x5c\xa1\xc6\x39\x11\x5e\xc5\xa6\xbb\x2e\x9f\
\xdc\x74\x17\xa3\xf4\xf5\x20\x36\x6f\x62\x32\xd8\x50\x8f\x61\x6a\
\x6b\xab\xa3\x2a\x8f\xa2\x08\xb5\x5a\x0d\xc7\x8e\x1d\x1b\x3d\x54\
\x9e\x22\x84\x14\x42\x9d\x52\x5f\x5f\xdf\x0f\xc5\xeb\x8f\xf9\x65\
\xf7\x37\xde\x78\xa3\x7a\xd1\x45\x17\x7d\x80\x88\x2e\x92\x3b\xaf\
\xd5\x6a\x58\xb6\x6c\x99\x76\xa3\xac\xca\xdb\xd2\xe5\x72\x19\x43\
\x43\x43\xa3\xfb\x0c\x11\x3a\xa3\xcb\x93\x0c\xba\xb4\x29\xc4\x33\
\xe9\x67\x2b\x0b\xf1\x50\x3a\xe3\x4e\xa0\xca\xab\xca\x6c\xe4\x70\
\x25\x86\xeb\xe1\xfa\x72\x4f\x0e\x9d\x4a\xa5\x12\x8e\x1e\x3d\x8a\
\xbd\x7b\xf7\x62\xcf\x9e\x3d\x38\x7c\xf8\x30\x06\x06\x06\x94\x8b\
\xa9\xef\xc2\x21\xcb\x88\xe8\xdb\xe5\x72\xf9\x7e\xb1\x6c\xdc\xdf\
\x48\xc5\x71\xfc\x50\x14\x45\x1f\x93\xe5\x27\x4e\x9c\xc0\xf0\xf0\
\x30\x9a\x9a\x9a\xb4\x1e\x42\xe5\x25\x92\x41\x8b\xf2\x72\xb9\x8c\
\xde\xde\x5e\x54\xab\x55\xa7\xfd\x45\xa3\xa4\x55\x70\x0d\xad\x5c\
\x17\x00\x97\x7e\xc4\xbc\x6c\x58\xa2\x5c\x84\xaa\xac\x5e\xe4\xd0\
\x19\xa5\x7c\x70\xce\xd1\xdf\xdf\x8f\x52\xa9\x34\x7a\xc8\x0f\x74\
\xc4\xf9\x50\xc9\x6d\x32\x93\x37\x21\xa2\x87\x64\x3d\xc7\x11\x24\
\x8a\xa2\x87\x00\xdc\x45\x44\xe2\x3b\x12\x00\x40\x77\x77\x37\x96\
\x2f\x5f\xee\xb4\xf9\x16\x49\x43\x44\xa3\x2e\xb2\xa7\xa7\x67\xf4\
\xd7\xec\x1a\xc1\xe8\xb3\x26\x8c\x6f\x3d\x5b\x5d\x1b\xb1\x92\x95\
\x34\xf9\xa1\x3f\x79\x35\x16\x89\xa3\xf2\x3a\x69\x08\x22\xc2\x97\
\x30\xb5\x5a\x0d\xc3\xc3\xc3\x18\x1e\x1e\xc6\xe0\xe0\x20\x06\x07\
\x07\x51\x2e\x97\xad\x73\xe0\x62\xec\xae\x32\x29\x5f\xee\xef\xef\
\x7f\x58\xbe\xf6\x38\x82\x3c\xfa\xe8\xa3\x47\xaf\xb9\xe6\x9a\xef\
\x03\xf8\xa8\x5c\xd6\xd9\xd9\x89\x0b\x2e\xb8\xc0\x89\x18\x72\x7a\
\x70\x70\x10\x87\x0f\x1f\x1e\x8d\x1b\x7d\xd0\xa8\x64\xc8\x62\x1f\
\x92\xc6\xeb\xa8\xf2\x62\x58\x98\x40\xf6\x32\xc9\x4b\x4e\x39\xec\
\x11\xeb\xfa\x7a\x01\x15\x92\x87\x2e\xb5\x5a\x0d\x95\x4a\x65\xf4\
\x28\x97\xcb\xce\x76\xe0\xe2\x3d\x5c\x08\xa0\x92\x49\xf9\xef\x02\
\x18\xf7\x23\x8a\xba\x7f\xea\x7c\x00\xc0\x47\xe5\x9b\xd5\xd7\xd7\
\x87\xde\xde\x5e\xcc\x9c\x39\xd3\x99\x18\x9c\x73\x1c\x38\x70\x00\
\x7d\x7d\x7d\xca\x9b\x97\x76\xa5\xf6\xc5\x44\x7b\x8f\x3c\xf6\x2f\
\x72\xde\xe6\x65\xe4\x72\x99\x40\xa6\x8f\x70\xc8\xd7\x20\x7a\xeb\
\xdd\x4e\x1c\xc7\x63\x0e\xdf\x7b\xa8\x22\x5a\x1a\xef\xe1\xe8\x39\
\xc0\x18\x43\x1c\xc7\x0f\xa8\x74\x52\x12\xa4\xbf\xbf\xff\x5b\x33\
\x67\xce\xbc\x13\xc0\x0c\x79\xe2\xf7\xed\xdb\x87\x77\xbd\xeb\x5d\
\x4e\x4f\xa8\x4a\xa5\x12\xde\x7c\xf3\xcd\xd1\xbd\x86\x0e\x13\xed\
\x09\x42\x10\xea\x3d\x5c\xfb\x08\xf5\x24\x69\xbc\x8e\x8e\x40\xba\
\x31\x64\x3d\xaf\x2a\xe2\xaa\xca\x03\xc2\x27\x5b\xbe\x6f\x60\x60\
\xe0\x9f\x55\x3a\x29\xff\x40\x67\xc7\x8e\x1d\xfd\x44\xf4\x4f\xaa\
\xb2\xce\xce\x4e\xc4\x71\x3c\x66\x95\x91\xd3\x8c\x9d\xfa\xd4\xe4\
\x9e\x3d\x7b\x46\x7f\xc2\x54\x9e\x80\xb4\x93\x5b\x6f\x52\xe5\xed\
\x3d\x42\xea\xf9\x5e\xcf\x87\x2c\xa6\xfe\x55\xf5\x54\xe5\xae\x87\
\xad\x1f\xdb\xb8\x5c\xc7\x66\xc8\x6f\x87\xe6\x47\xdc\xb5\xff\x30\
\x45\x44\xed\x2a\x79\xb5\x5a\x45\x67\x67\xa7\x92\x18\xc9\x13\xaa\
\x17\x5e\x78\x01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e\x3c\x69\x54\x44\xa5\xb0\x0b\xea\x41\xa4\x34\
\x06\x1f\x62\xdc\x79\x7b\x0f\x53\xbd\x2c\x3d\x89\x8b\x11\xfb\x42\
\xf7\xae\xc5\xa7\x8e\xa9\xbe\xa2\xed\xe6\x6a\xb5\xfa\x1d\x93\x4e\
\x2e\xff\x93\xfe\x3f\x68\xe4\x07\x1d\x64\x3c\xf7\xdc\x73\xe8\xef\
\xef\xaf\xcb\xca\x1d\xd2\xd7\x44\x21\x0b\x12\x84\x5c\x2b\x8f\x90\
\xcc\x35\xef\xeb\x45\x4c\x75\x4d\x32\xdb\x9c\x79\x8c\x73\x98\x88\
\xfe\xa7\xb1\x33\x38\x10\xe4\x7b\xdf\xfb\xde\x7e\x22\xfa\x07\x1f\
\x45\x5c\x30\xd1\xa4\x72\xf5\x28\xf5\x22\x5c\xd6\x1e\x28\x8b\x6b\
\x85\xe6\x5d\xf6\x22\xa6\x7a\xb6\x7d\x47\x48\x38\xa5\xb8\xfe\x7d\
\x83\x83\x83\xe3\x7f\x62\x51\x82\x8b\x07\x01\x11\xfd\x0d\x11\xc5\
\x8d\x14\x26\xd5\xab\xbd\xae\xaf\x46\x68\x93\x75\x18\xe6\x6b\x78\
\xa6\xbc\xdc\x2e\xd4\x7b\xb8\xe8\x6d\xab\xab\xb8\x4e\x35\x8e\xe3\
\xdb\x5d\xea\x3b\x11\xe4\xfb\xdf\xff\xfe\x2b\x00\x1e\x74\xd2\xa0\
\x01\x30\xd1\xde\x6d\x22\x90\xb7\x07\xf2\x25\x92\x89\x10\x36\xef\
\x11\x7a\x5d\x17\xdd\x47\xf2\xff\xbb\x5c\x2e\xbf\xe1\xd2\xd6\x89\
\x20\x00\x50\xab\xd5\xfe\x0b\x46\x7e\x2b\xc8\x57\x21\xdf\x36\xf5\
\x5a\xa9\xd3\xb4\x6f\x34\x6f\x12\x82\x2c\x48\x95\x45\x48\x9a\xc6\
\x73\xe8\xca\x0c\xf5\xca\x9c\xf3\xbf\x74\xd5\xcd\x99\x20\x3f\xfc\
\xe1\x0f\x5f\x03\x70\x8f\x8b\x72\x93\x05\x59\xe9\xdc\x68\x63\x6f\
\x94\xb0\x4e\xb7\x41\x4f\x1b\x4e\xa5\x01\xe7\xfc\x6b\xe5\x72\xf9\
\x4d\xd7\xfa\xce\x04\x01\x80\xe1\xe1\xe1\xdb\x00\x94\xac\x15\xeb\
\x84\x46\x33\x4c\x1f\x34\x9a\x37\x09\x41\x5a\xa3\x0e\xd9\x5c\xa7\
\x01\x11\xf5\x0e\x0f\x0f\x3b\x7b\x0f\xc0\x93\x20\x3b\x76\xec\x38\
\x00\xe0\x2b\x5e\x5a\x35\x18\x1a\xcd\xc8\xf2\x46\xa3\x3c\x85\x73\
\x79\xb2\x95\xf5\x75\x15\x75\x6f\x07\x70\xc4\xa7\x7f\x2f\x82\x00\
\x40\x6f\x6f\xef\xdf\x91\xe6\x7f\x0d\xcf\xe2\x2c\x1a\x15\x44\xf4\
\xfa\xf0\xf0\xf0\x1d\xbe\xed\xbc\x09\xb2\x73\xe7\xce\x41\x22\xfa\
\x02\x80\x33\x6b\x29\x3e\x8b\xc9\x0c\x02\xf0\xc7\x00\xc6\xff\x75\
\xb3\x05\xde\x04\x01\x80\x27\x9f\x7c\xf2\x1f\x89\xe8\xbb\x21\x6d\
\x27\x1a\xba\xaf\x87\x4e\x06\x84\xe8\x5e\xaf\xf1\xda\x3e\xe2\x61\
\xfb\x7a\xae\xaa\x8f\x90\xeb\xaa\x40\x44\x1d\x43\x43\x43\xe3\xbe\
\x6f\xee\x82\x20\x82\x00\x40\xb5\x5a\xfd\x3c\x11\x29\xbf\x64\x52\
\x2f\x9c\x69\xc6\xde\x08\x7d\xfb\x5c\xc7\x46\x86\xac\xc9\xa2\x02\
\x11\x95\x00\xfc\x7e\x68\x7b\xe3\x87\x15\x4d\xe8\xec\xec\x3c\xb9\
\x6c\xd9\xb2\x1a\x63\xec\xa3\xc0\xe4\x34\xd6\xac\x74\x3e\xdd\x8d\
\x3d\xc5\x87\x01\xbd\x7e\x00\xc2\xa5\x5f\x9f\xeb\x33\xc6\xc0\x39\
\xff\x62\xb9\x5c\xfe\x17\xe5\xc0\x1c\x10\x4c\x10\x00\xd8\xb7\x6f\
\xdf\xb3\xcb\x96\x2d\xfb\x55\x00\x8b\x64\xc5\x7c\x61\x9b\x68\x9f\
\xf6\x21\xf0\x6d\xdf\xc8\xe1\x8e\x2b\x42\x57\x70\x97\x70\xca\x47\
\x07\x53\x7b\x5f\x42\x88\x69\xce\xf9\x8f\x2a\x95\xca\x46\xa4\xd8\
\x2f\x07\x87\x58\x23\x88\x01\xdc\x0c\x60\x28\x65\x3f\x99\xa2\xde\
\x64\xa9\x57\x5f\xa1\xd7\x71\x5d\x7c\x42\x49\xa1\xcb\xbb\x1c\x69\
\xae\x61\x2a\x23\xa2\x01\x22\xfa\x5d\x00\xea\xdf\xb3\x75\x44\x2a\
\x0f\x02\x00\xfb\xf6\xed\x3b\xb6\x6c\xd9\xb2\x12\x80\x5f\x55\x95\
\x67\xe9\x19\x26\xa2\xbd\xae\xaf\x3c\x91\xb7\xb1\x87\x5c\xcb\x35\
\x1f\x7a\x8f\xd2\x92\x45\x9e\x17\x22\xfa\x83\x4a\xa5\xf2\x98\xb7\
\x32\x12\x52\x13\x04\x00\xf6\xed\xdb\xf7\xe3\xa5\x4b\x97\xbe\x0f\
\xc0\x45\xd6\xca\x23\x98\x68\x63\x0d\x89\x71\xb3\xc6\x44\x19\x7b\
\xde\xa4\x70\xf5\x1e\xa6\xb6\x69\x74\x02\xf0\xcf\xe5\x72\xf9\x4f\
\xb4\x83\xf4\x40\xda\x10\x2b\x01\xd5\x6a\xb5\x9b\x01\x1c\xb0\x55\
\x54\x21\x2f\x2f\x31\x51\x31\x7f\x16\xc6\x9e\xf7\xb5\x7c\x16\x05\
\x1f\x52\x84\x22\x2b\xb2\x10\x51\xe7\xf0\xf0\xf0\x7f\x08\x56\x44\
\x42\x56\x04\xc1\x33\xcf\x3c\x73\x84\x73\xfe\x19\x00\xa3\xbf\x29\
\xd9\xa8\xe1\x51\x56\xfd\xe6\xe9\x01\xb2\xda\x2b\x84\x96\x85\x92\
\xc2\xd7\x7b\xe8\x88\x15\x42\x16\x00\x15\xc6\xd8\x6f\x02\x38\xae\
\x1d\xa8\x27\x32\x09\xb1\x12\x74\x76\x76\xbe\xb9\x74\xe9\xd2\x32\
\x14\xbf\xeb\x2b\xa2\x1e\x1e\x23\x2f\x42\xd6\xd3\x03\xb8\xd6\x0b\
\x35\xfc\x80\xd0\x45\x2b\xcb\x62\x5e\x4c\x61\x97\x4d\x0f\xc6\x18\
\x38\xe7\x5f\x28\x97\xcb\xff\x98\x5a\x11\x01\x99\x12\x04\x00\xf6\
\xef\xdf\xff\xf4\x92\x25\x4b\x56\x01\x58\xe9\xdb\x36\xaf\xf0\xc8\
\x97\x50\x59\xec\x43\xea\xb9\xa7\xb0\x95\xd5\xc3\x73\x88\xf2\x2c\
\xbd\x88\xab\x3e\x9c\xf3\x6f\x54\x2a\x95\x3f\xd5\x0e\x34\x10\x99\
\x85\x58\x22\xfa\xfb\xfb\x6f\x06\xb0\x2b\xc9\xa7\x5d\xe5\xd3\x1a\
\x78\x9e\xc8\x3a\x2c\xaa\x87\x37\x90\x8d\x2c\x8b\x70\x2a\x2b\x98\
\xbc\x88\x4e\x46\x44\x3f\x29\x97\xcb\xb7\x64\xa6\x84\x80\x5c\x08\
\xf2\xfc\xf3\xcf\x0f\x00\xf8\x38\x11\x59\xbf\x14\x9f\xa0\xde\x61\
\x53\x9a\xeb\xe5\xed\x01\x4c\xf5\xd2\xf4\xe9\x43\x1a\x5d\x7f\xbe\
\xde\xc3\xa4\x4b\xa8\x17\x91\x74\xeb\x1c\x1e\x1e\xbe\x0e\x39\xbd\
\x8b\xcb\x85\x20\x00\xf0\xf4\xd3\x4f\xef\x07\xb0\x1e\xc2\x17\xac\
\x1a\x25\x6c\xca\x33\xcc\xca\xc3\x8b\x64\xe5\x55\x5c\xfa\xf6\x0d\
\xa7\x6c\xf0\x25\x8e\xdc\xc6\x72\xdd\xbe\x5a\xad\xb6\x1e\x81\x4f\
\x4f\x5d\x90\x1b\x41\x00\x60\xc7\x8e\x1d\xcf\x11\xd1\xf5\x50\x7c\
\x97\xbd\x9e\x06\xee\xeb\x09\x5c\x6f\xbc\x4b\xfd\x7a\x94\xa5\xf5\
\x0c\x69\xc2\x29\x5f\xe3\x57\xc1\xd5\x8b\x48\x65\x15\xce\xf9\xbf\
\xaf\x56\xab\xbb\xc6\x35\xc8\x10\x99\x6f\xd2\x65\x74\x75\x75\xbd\
\xb6\x64\xc9\x92\x4e\x9c\xf2\x26\x0c\x98\xd8\x7d\x44\x1a\xb2\xd4\
\xd3\x8b\xd8\xca\xf2\xc8\xfb\x7a\x0f\xd3\x9c\xf9\x1c\xb6\x3e\x14\
\xe0\x44\x74\x53\xb9\x5c\x1e\xf7\x9f\x82\x59\x23\x77\x82\x00\x40\
\x67\x67\xe7\xae\xc5\x8b\x17\xf7\x31\xc6\xae\xc1\x08\x49\x7c\x30\
\x51\xde\x26\x49\xa7\x25\x8f\x4f\x18\xe4\x13\x6a\xd5\x8b\x14\x3e\
\x64\x08\x85\xab\x17\xc1\xa9\x0f\x1e\xde\x3a\x3c\x3c\xac\xfd\x01\
\x91\x2c\x51\x17\x82\x00\x40\x57\x57\xd7\xb3\x8b\x17\x2f\xae\x02\
\xf8\x25\x04\x7a\x92\x46\x0e\xcb\x6c\xed\x1b\xd5\x73\x98\x64\xae\
\x61\x96\xae\x4e\x5a\x2f\xa2\xd0\x83\x88\xe8\x8b\xc3\xc3\xc3\xd6\
\x9f\x0c\xcd\x0a\x75\x23\x08\x00\x74\x75\x75\x3d\xb5\x68\xd1\xa2\
\x98\x31\xf6\x11\x26\x8c\xba\x11\x48\x90\x85\x17\x49\x53\xd6\x88\
\x9e\xc3\x45\x9e\x85\xf7\x70\xec\x93\x00\xfc\xa7\xa1\xa1\xa1\xbf\
\x4b\x7d\x21\x0f\xd4\x95\x20\x00\xd0\xdd\xdd\xfd\x43\xd1\x93\xf8\
\x1a\x5e\x23\x90\xa3\x1e\xde\x60\xa2\x48\xa1\x33\xf8\x3c\xbd\x87\
\xa9\xdf\x11\x39\x01\xf8\xd3\xc1\xc1\xc1\xbf\xd5\x5e\x3c\x27\xd4\
\x9d\x20\xc0\x29\x4f\xb2\x70\xe1\xc2\x3e\x76\xea\xdb\x88\x4a\x4f\
\x22\xc2\xb6\x3a\xe5\x49\x08\xdf\xb4\x4f\x99\x2a\xef\x53\xd7\x66\
\xf0\xbe\xa4\x50\x5d\xbf\x5e\xde\x43\xd7\x37\x11\x71\x22\xfa\xfd\
\xa1\xa1\xa1\xcd\x99\x5d\xc4\x03\x13\x42\x10\x00\xe8\xee\xee\x7e\
\x76\xf1\xe2\xc5\xfb\x01\xac\x05\x50\x98\x08\x63\x0e\xed\x4f\x85\
\x46\xf1\x1c\xba\x3a\xae\xed\x5c\x08\xa1\x42\x5a\xef\xa1\xe9\xbb\
\xc2\x18\xbb\x69\x70\x70\x70\x9b\xf2\xa2\x75\xc0\x84\x11\x04\x00\
\xba\xbb\xbb\x77\x2d\x5a\xb4\xe8\xa7\x38\xf5\x08\x78\x0a\x10\xb6\
\x62\xcb\xc8\x8b\x1c\x59\xae\xfe\x26\xe4\x41\x12\x5d\x3b\x1f\xa2\
\xc8\xe5\x59\x7b\x0f\x49\xcf\x7e\x22\xfa\xc4\xe0\xe0\x60\xee\x8f\
\x72\x8d\xba\x4c\xe4\xc5\x13\xbc\xf7\xbd\xef\x7d\x0f\x63\xec\x61\
\x00\x0b\xc4\x5f\xdf\x73\x4d\xfb\xd4\x0d\x6d\xa7\x93\x99\xd2\xb6\
\xbc\xee\x97\xcf\x5d\xfb\x0a\xad\xa3\x93\x99\xe4\xb6\xb2\x2c\x41\
\x44\x5d\x44\xb4\x6e\x70\x70\x30\xd7\x97\x80\x2e\xc8\xf5\x4d\xba\
\x2b\x7e\xf2\x93\x9f\x3c\x17\xc7\xf1\x1a\x8c\x7c\xc0\xb1\x1e\x21\
\x96\x4b\xb9\xa9\xae\x29\xd4\x70\xcd\xdb\x56\x79\xd7\x3d\x85\x9c\
\xcf\x63\xdf\x21\x96\xe5\xe5\x39\x46\xf0\x1c\xe7\x7c\x4d\x23\x90\
\x03\x98\xe0\x10\x4b\xc4\xc1\x83\x07\x7b\xe7\xcd\x9b\xf7\x8d\xa6\
\xa6\xa6\x8b\x70\xea\xa3\xf2\x6c\x22\xc9\xe1\x5a\x9e\x36\xef\x1a\
\x0a\xd9\xf2\xa1\x7b\x0c\x9d\xc1\x67\xb5\xef\x70\x6d\x87\x53\x4f\
\xaa\xbe\x59\x2a\x95\x3e\x51\xab\xd5\x4e\x28\x1b\x4e\x00\x1a\x86\
\x20\x00\x70\xf8\xf0\xe1\x6a\x77\x77\xf7\xff\x59\xb4\x68\xd1\x30\
\x80\x0f\x63\xc4\xc3\xa5\x25\x47\x1e\xe5\x59\x93\x24\x0f\x52\xf8\
\x7a\x09\x93\x61\x87\x7a\x0f\x17\xd2\x10\x51\x95\x88\xbe\x38\x30\
\x30\xf0\x05\x08\xdf\x48\x6d\x04\x34\xc4\x1e\x44\x85\xd5\xab\x57\
\x7f\x84\x31\x76\x3f\x14\xfb\x92\xe4\x9c\xc5\x3e\x23\x8d\xcc\xb6\
\x1f\xa9\x47\x3e\xad\xcc\x24\x77\x2d\x4f\x59\xbf\x9b\x88\x7e\xb3\
\x54\x2a\x3d\xe5\x75\x91\x3a\xa1\x61\x09\x02\x00\xab\x56\xad\x9a\
\x3f\x75\xea\xd4\xaf\x03\xb8\x26\x4f\x42\x64\x45\x98\x04\xf5\x20\
\x41\x1e\x44\xb1\x95\xf9\xd4\x71\x01\xe7\xfc\xdb\x00\x7e\xa7\x54\
\x2a\x1d\xcd\xa4\xc3\x1c\xd0\xd0\x04\x19\x01\x5b\xbd\x7a\xf5\x7f\
\x04\xf0\xd7\x00\xa6\x4e\xa4\xf1\x37\x1a\x49\xd2\xca\x4c\x72\xd7\
\xf2\xc0\xfa\x83\x00\xbe\xd4\xd7\xd7\x77\x27\x1a\xfc\x5f\x02\x26\
\x03\x41\x00\x00\xef\x79\xcf\x7b\x56\x11\xd1\xbd\x44\xb4\x1a\x68\
\x0c\x6f\x91\x37\x49\x5c\x65\x3e\xc6\x3f\xd1\xde\x83\x73\xfe\x63\
\x22\xba\xb9\x54\x2a\xbd\x9c\xaa\xa3\x3a\xa1\xa1\x36\xe9\x26\x1c\
\x38\x70\xe0\xc8\x8a\x15\x2b\xb6\x95\xcb\xe5\x0a\x63\xec\x03\x8c\
\xb1\x62\x52\x96\xd5\x66\x3b\x54\xe6\xf2\xc0\xc0\x35\xef\xfa\x34\
\xca\xd6\xce\xd4\x5f\xc8\x26\x5d\x55\xc7\xf5\xa9\xd5\x08\x86\x00\
\xfc\x45\x5f\x5f\xdf\x86\x4a\xa5\xe2\xf5\x2f\x4f\x13\x89\x49\xe3\
\x41\x44\xac\x5e\xbd\xfa\x12\x22\xfa\x2a\x11\xfd\x22\x90\x6e\x63\
\xed\xeb\x19\x6c\xf5\xe5\x3a\x09\x26\x3a\xc4\x32\xc9\x6d\x65\x2e\
\xe5\x26\x70\xce\x1f\x27\xa2\x8d\xfd\xfd\xfd\xaf\x05\x77\x32\x41\
\x98\x94\x04\x19\x01\xbb\xfc\xf2\xcb\x7f\x9b\x31\x76\x3b\x80\xb7\
\xd7\x6b\xbf\xe1\x52\x26\xd7\x49\x90\x05\x29\xb2\x08\xa7\xb2\x24\
\x83\x85\x74\x07\x88\xe8\x4f\xfa\xfa\xfa\x1e\x70\xee\xb0\xc1\x30\
\x69\x42\x2c\x15\x0e\x1d\x3a\xf4\xf3\xe9\xd3\xa7\xb7\x4f\x9d\x3a\
\xb5\x09\xc0\xea\x24\xec\xaa\x57\x48\x15\x5a\xc7\x94\xcf\xf2\xdd\
\x86\x2e\xf4\xb1\x85\x45\x3e\xef\x3c\x34\x61\xd6\x10\x63\xec\xef\
\x7b\x7a\x7a\x7e\xa3\x5c\x2e\xef\x34\x76\xd0\xe0\x98\xcc\x1e\x64\
\x0c\x2e\xbb\xec\xb2\x0b\x9a\x9a\x9a\xfe\x9a\x88\x3e\x85\x91\x17\
\x8c\x13\xe1\x2d\x6c\x67\x39\xad\x93\x4d\x54\x38\x95\xd2\x7b\x70\
\x00\xdf\xe4\x9c\xff\x79\x6f\x6f\xef\x5e\xe7\x8e\x1a\x18\xa7\x0d\
\x41\x12\xac\x5a\xb5\xea\x3d\x85\x42\xe1\xcb\x00\x7e\x05\x00\xcb\
\x8a\x24\x3e\x75\x6c\x6d\x12\xd4\x63\xdf\x91\xa6\xcc\xb5\x0e\x9d\
\xaa\xf0\xff\x38\xe7\x7f\xd1\xdb\xdb\xfb\x33\x6b\x87\x93\x08\xa7\
\x1d\x41\x12\x5c\x7e\xf9\xe5\x1f\x20\xa2\xff\x4c\x44\xa3\x44\x01\
\x26\xc6\x6b\xa4\xf5\x26\x3e\x32\x93\x3c\x4d\x99\xa6\x3e\x01\xf8\
\x4e\xb5\x5a\xfd\xaf\xfd\xfd\xfd\xff\xea\xd5\x78\x92\xe0\xb4\x25\
\x48\x82\x55\xab\x56\xbd\x27\x8a\xa2\x2f\x12\xd1\x27\x00\x14\x81\
\x6c\x49\x12\x52\x57\x3c\x27\x68\x24\xa2\x38\xf4\x5b\x05\xf0\xad\
\x38\x8e\x6f\xef\xed\xed\x6d\x88\x4f\xdd\xe6\x85\xd3\x9e\x20\x09\
\xde\xf9\xce\x77\x2e\x27\xa2\xdf\x67\x8c\xdd\x0c\x60\x76\xbd\xbd\
\x45\x28\x51\x7c\x8c\x3f\x0d\x21\x1c\x09\x73\x92\x31\xb6\xad\x56\
\xab\xfd\xaf\x9e\x9e\x9e\x7d\xd6\x06\xa7\x01\xce\x18\x82\x24\x58\
\xb9\x72\xe5\x39\x85\x42\xe1\x06\x22\x6a\x05\x70\x05\x0c\xfb\x14\
\xdd\x39\x0f\x72\x84\x84\x5d\x21\x72\x5b\x99\xa2\x0e\xe1\xd4\x77\
\x34\xda\x4e\x9c\x38\xf1\x0f\x38\xf5\x31\x91\x33\x06\x67\x1c\x41\
\x44\x5c\x7a\xe9\xa5\x57\x44\x51\x74\x33\x80\xeb\x01\xbc\x0d\xa8\
\x8f\xb7\xc8\x3a\xec\x32\xc9\x43\xcb\x88\xe8\x30\x11\xfd\x43\x1c\
\xc7\xf7\xf6\xf4\xf4\xfc\x5c\xdb\xc1\x69\x8e\x33\x9a\x20\x02\x9a\
\x2e\xbd\xf4\xd2\x7f\xc7\x18\xbb\x1e\xa7\xbe\x1f\x3f\x1b\xa8\x5f\
\x68\x15\x42\x94\x10\xb9\x43\xd9\x09\x22\xfa\x67\xc6\xd8\x83\x47\
\x8f\x1e\x7d\x1c\x0d\xf6\xdd\x8c\x89\xc0\x59\x82\x8c\x47\xd3\x65\
\x97\x5d\xf6\x4b\x9c\xf3\xf5\x44\xb4\x96\x31\xb6\x0c\xf0\x0b\xb5\
\x74\xf5\x5d\xce\x3a\x99\x2a\x1f\x2a\x17\xcb\x89\x68\x2f\x11\x7d\
\x9b\x73\xfe\xf0\x89\x13\x27\x7e\x00\xc5\x0f\x8d\x9f\xc9\x38\x4b\
\x10\x0b\x2e\xbc\xf0\xc2\x95\xc5\x62\xf1\x57\x70\xea\x87\xee\x3e\
\x08\x69\x83\x9f\xe6\xec\x5b\x26\xcb\x55\x70\x28\x3b\x09\xe0\xa9\
\x38\x8e\x1f\x27\xa2\xc7\x8e\x1f\x3f\xbe\x5b\xdb\xe0\x2c\xce\x12\
\xc4\x13\x85\x0b\x2f\xbc\xf0\x5d\xc5\x62\xf1\x6a\xce\xf9\x1a\x00\
\xef\x05\x70\x01\x80\x42\x1a\x2f\xe2\x5b\x26\xc2\x42\x88\x98\x88\
\xf6\x00\xf8\x31\x63\xec\xd9\x38\x8e\x77\x1c\x3d\x7a\xf4\x05\x00\
\xb1\xfb\x90\xcf\x6c\x9c\x25\x48\x4a\x2c\x5f\xbe\x7c\x56\xb1\x58\
\x7c\x27\xe7\xfc\x5d\x8c\xb1\x95\x44\x74\x29\x80\x0b\x01\x2c\x42\
\x20\x71\x6c\x32\x45\x3a\x26\xa2\x6e\xc6\xd8\xab\x44\xb4\x1b\xc0\
\x4b\x71\x1c\x3f\x1f\xc7\xf1\x0b\x27\x4e\x9c\xe8\xcb\x72\xbc\x67\
\x1a\xce\x12\x24\x27\x2c\x5b\xb6\x6c\x6a\x14\x45\x4b\x01\x2c\x65\
\x8c\x2d\x02\xb0\x00\xa7\x9e\x94\xb5\x70\xce\xe7\x30\xc6\xce\x05\
\x70\x2e\x11\x4d\x05\xd0\x0c\x60\x1a\x11\x45\x44\x04\xc6\x58\xcc\
\x39\x1f\x06\x50\x06\x30\x0c\xa0\x8f\x88\x7a\x01\x9c\xe4\x9c\x1f\
\x67\x8c\x1d\x06\x70\x90\x88\x0e\x54\x2a\x95\x7d\xc7\x8e\x1d\xeb\
\x1c\xa9\x77\x16\x19\xe3\xff\x03\xbf\x68\x9a\xf3\xf2\x5e\xbd\x31\
\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\xe6\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x4b\x00\x00\x00\x4b\x08\x06\x00\x00\x00\x38\x4e\x7a\xea\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\
\x0d\xd7\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdd\x0b\x0e\x12\x34\x30\x77\x2a\x57\x36\x00\x00\x02\x73\x49\x44\
\x41\x54\x78\xda\xed\xdc\x31\x4e\xc3\x30\x14\x06\xe0\xf7\xdc\x96\
\x15\x21\xb1\x22\x06\x16\x24\x16\x56\x06\x16\x26\x2e\x40\x8f\xd0\
\xa9\x77\x20\xbd\x03\x4b\x39\x42\xb9\x00\x03\x62\xe3\x02\x48\x0c\
\x0c\x08\x21\x56\x24\xc4\x48\x69\x6b\x86\xaa\xc2\x2d\x49\xec\x24\
\xb6\x9b\xe6\xfd\x6f\x6c\x51\xa1\x1f\xff\xb3\x63\x2b\x0e\x51\xe4\
\xd2\x1e\x8b\x28\x51\x31\xff\x76\x8e\x81\x13\xed\xcb\x30\xf3\x26\
\x62\xb1\xd6\x7a\xe6\xfa\xc3\x0f\xcf\x8f\xf4\xfd\x7a\x9d\xfa\xde\
\xd9\xf9\x55\x6d\xe0\x3c\x7f\x60\xa2\xb4\xbe\x9c\xa6\xbd\x73\x7f\
\xdb\x0f\xf2\x5f\xb1\x61\xfa\x44\xe3\x90\xed\x16\x0a\xa8\x0c\x9c\
\x0f\x34\x0e\x81\xb4\x0e\x28\x17\xb4\xaa\x60\xbc\xe9\x69\x8a\x89\
\xc6\x4d\x44\x72\x41\x2b\x03\xc6\x55\xa1\xea\x8c\x64\x43\x2b\x0a\
\xc6\x52\xa0\x7c\x80\xb1\x24\xa8\xaa\x60\x2c\x0d\xaa\x0a\x18\x4b\
\x84\x2a\x0b\xc6\x52\xa1\xca\x80\x39\x63\x35\x11\x6a\x51\x9d\xed\
\x3e\x9d\x9e\x1c\x5a\xc1\x94\x74\x28\x22\xa2\x9f\xaf\xd5\xeb\xb0\
\x5e\xc7\x19\x2b\xe6\xb6\x4a\x5d\xca\x0c\x84\xd6\xc3\x71\xa1\x64\
\x49\x49\x55\x91\x55\x8a\x92\xdc\x7e\x45\x83\xb1\x82\x15\x77\x9b\
\xb6\xfe\xed\xb8\x9c\x2e\xb5\x9c\xaa\xbf\x8d\x3b\xa9\xed\xe7\x9a\
\x2c\x06\x54\x7e\xba\x94\xf1\xe2\x0c\xd9\x71\x4f\x16\xca\x32\x33\
\x2a\xe9\x33\x60\x91\x99\x11\xc9\x42\x1b\x86\x48\x57\xaf\xa3\x70\
\xb5\xee\x3a\x6e\x0d\xc7\x4a\xe2\x3a\x10\x6d\x18\xa1\x15\x81\x85\
\x64\x05\xc6\xc2\xe0\x8e\x64\x55\xae\xcf\xd9\x18\x58\xae\xb5\xa3\
\xb6\x80\x85\x36\x04\x16\xb0\x80\x05\x2c\x14\xb0\x80\x15\x0b\xab\
\xec\xcd\xf9\x48\x16\x0a\x58\xc0\x8a\x89\xc5\xdc\x6d\x83\x21\xbb\
\xcc\xb1\x5c\x11\xdd\x4c\x31\xc8\xa3\x0d\xbd\xa6\x8a\x99\x19\x58\
\x19\x35\x25\x9d\x9e\x2c\xf3\x86\x53\xb4\xe2\xbc\x5a\x29\xf7\x26\
\x23\x59\x8e\x2d\x98\x89\x85\x74\x59\x06\xf8\xd0\x87\xb1\x37\x37\
\x55\x83\x96\xb5\x0d\x91\xae\x45\x25\xb3\x54\x2c\xa4\x8b\x68\x74\
\x77\x6c\xa6\x6a\xe9\xf0\xc0\x3f\x1c\x09\xe7\x75\x8a\x0e\xec\x99\
\x6d\x28\x39\x5d\x79\x50\x99\x63\x96\xc4\xeb\x2e\xb3\xfd\xb2\x2a\
\x33\x45\xd2\xda\xd1\x96\xaa\xdc\xd9\x50\x52\x3b\xba\x40\xe5\x26\
\x4b\x4a\xc2\x96\xa1\xba\x6d\x73\x17\xa6\x30\x56\x93\xc1\xbc\x1e\
\xfb\x6d\x32\x58\x99\x03\xe5\xce\x0b\xe9\xd5\x0f\x73\x99\x3d\x9a\
\x04\x55\x28\x59\x4d\x48\xd8\xc1\x51\x42\xfb\x7b\xbb\xa5\x27\x32\
\x11\xcf\xa2\x49\x4f\x53\xfe\x60\xee\x0d\x6b\x93\xc0\x7c\x3d\xb4\
\xa7\x12\xd6\xbc\x2e\x5a\x5a\x8f\x26\xe6\x2b\x6f\xef\x1f\xf4\xf2\
\x94\x34\x0e\xca\x03\x56\x76\xca\xd6\x95\xb4\x50\x0f\x1a\xf3\x86\
\x65\x43\x0b\x0d\x97\xff\xf8\xba\x41\x87\x28\x99\xf8\xf8\x3d\x41\
\x96\x34\xb6\xf3\x40\x3e\xe0\xec\x0f\x46\x1c\xb4\xcc\x8d\xbb\xda\
\x62\xb9\xa2\x85\xa8\x90\x6b\xda\x68\x8b\xe5\x90\x70\xb1\x16\xfd\
\xbf\x83\xff\x85\x50\xd4\xf1\xfd\xa2\x00\x00\x00\x00\x49\x45\x4e\
\x44\xae\x42\x60\x82\
"
qt_resource_name = "\
\x00\x0d\
\x0d\x0b\xda\xa7\
\x00\x64\
\x00\x6f\x00\x77\x00\x6e\x00\x5f\x00\x6c\x00\x65\x00\x66\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0b\
\x0b\x2f\x9b\x07\
\x00\x75\
\x00\x70\x00\x5f\x00\x6c\x00\x65\x00\x66\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x08\
\x03\xb8\x5a\x67\
\x00\x62\
\x00\x6c\x00\x75\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x14\
\x0c\x2a\xbb\x67\
\x00\x63\
\x00\x65\x00\x6c\x00\x6c\x00\x5f\x00\x74\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x6c\x00\x75\x00\x63\x00\x65\x00\x6e\x00\x74\x00\x2e\
\x00\x70\x00\x6e\x00\x67\
\x00\x0c\
\x02\x7b\x86\xa7\
\x00\x75\
\x00\x70\x00\x5f\x00\x72\x00\x69\x00\x67\x00\x68\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x08\
\x06\xe1\x5a\x27\
\x00\x64\
\x00\x6f\x00\x77\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x07\
\x08\xb7\x57\xa7\
\x00\x72\
\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x19\
\x08\xf8\xb9\x87\
\x00\x64\
\x00\x6f\x00\x77\x00\x6e\x00\x5f\x00\x6c\x00\x65\x00\x66\x00\x74\x00\x5f\x00\x74\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x6c\x00\x75\
\x00\x63\x00\x65\x00\x6e\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x08\
\x0c\x2f\x5a\x67\
\x00\x63\
\x00\x65\x00\x6c\x00\x6c\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x18\
\x05\x39\xc9\xe7\
\x00\x75\
\x00\x70\x00\x5f\x00\x72\x00\x69\x00\x67\x00\x68\x00\x74\x00\x5f\x00\x74\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x6c\x00\x75\x00\x63\
\x00\x65\x00\x6e\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x06\
\x07\xc3\x57\x47\
\x00\x75\
\x00\x70\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x08\
\x0b\xd7\x59\x07\
\x00\x6c\
\x00\x65\x00\x66\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x08\
\x06\x94\x58\x67\
\x00\x72\
\x00\x6f\x00\x73\x00\x61\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x10\
\x05\xa5\xe5\xa7\
\x00\x72\
\x00\x6f\x00\x73\x00\x61\x00\x5f\x00\x76\x00\x69\x00\x65\x00\x6e\x00\x74\x00\x6f\x00\x73\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x17\
\x00\x69\xbf\xc7\
\x00\x75\
\x00\x70\x00\x5f\x00\x6c\x00\x65\x00\x66\x00\x74\x00\x5f\x00\x74\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x6c\x00\x75\x00\x63\x00\x65\
\x00\x6e\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x08\
\x06\x60\x5a\x67\
\x00\x62\
\x00\x6f\x00\x6f\x00\x6d\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0e\
\x00\x3f\x9c\x67\
\x00\x64\
\x00\x6f\x00\x77\x00\x6e\x00\x5f\x00\x72\x00\x69\x00\x67\x00\x68\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x1a\
\x0c\x29\xa2\xc7\
\x00\x64\
\x00\x6f\x00\x77\x00\x6e\x00\x5f\x00\x72\x00\x69\x00\x67\x00\x68\x00\x74\x00\x5f\x00\x74\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x6c\
\x00\x75\x00\x63\x00\x65\x00\x6e\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x17\
\x0d\x2b\xc1\x07\
\x00\x72\
\x00\x6f\x00\x73\x00\x61\x00\x5f\x00\x76\x00\x69\x00\x65\x00\x6e\x00\x74\x00\x6f\x00\x73\x00\x5f\x00\x73\x00\x6f\x00\x62\x00\x72\
\x00\x69\x00\x61\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x09\
\x0b\xc1\x8a\x47\
\x00\x67\
\x00\x72\x00\x65\x00\x65\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x09\
\x0d\xf7\xa6\xa7\
\x00\x72\
\x00\x69\x00\x67\x00\x68\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x09\
\x07\x9e\x85\x07\
\x00\x62\
\x00\x6c\x00\x61\x00\x63\x00\x6b\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0a\
\x0a\x2d\x16\x47\
\x00\x63\
\x00\x69\x00\x72\x00\x63\x00\x6c\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct = "\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x17\x00\x00\x00\x01\
\x00\x00\x01\xfa\x00\x00\x00\x00\x00\x01\x00\x01\x7e\xc6\
\x00\x00\x01\xb0\x00\x00\x00\x00\x00\x01\x00\x00\xe3\x9f\
\x00\x00\x00\x80\x00\x00\x00\x00\x00\x01\x00\x00\x65\x38\
\x00\x00\x00\x3c\x00\x00\x00\x00\x00\x01\x00\x00\x04\x2c\
\x00\x00\x01\x16\x00\x00\x00\x00\x00\x01\x00\x00\xb4\x5a\
\x00\x00\x01\x8a\x00\x00\x00\x00\x00\x01\x00\x00\xbe\x21\
\x00\x00\x01\xe4\x00\x00\x00\x00\x00\x01\x00\x00\xe5\x62\
\x00\x00\x01\x74\x00\x00\x00\x00\x00\x01\x00\x00\xb9\xe4\
\x00\x00\x00\x9e\x00\x00\x00\x00\x00\x01\x00\x00\x67\x68\
\x00\x00\x02\xba\x00\x00\x00\x00\x00\x01\x00\x01\xd1\xd4\
\x00\x00\x01\x4c\x00\x00\x00\x00\x00\x01\x00\x00\xb6\x29\
\x00\x00\x00\xb4\x00\x00\x00\x00\x00\x01\x00\x00\x69\xa8\
\x00\x00\x00\xc8\x00\x00\x00\x00\x00\x01\x00\x00\xb1\x67\
\x00\x00\x02\xd2\x00\x00\x00\x00\x00\x01\x00\x02\x04\xd5\
\x00\x00\x00\x20\x00\x00\x00\x00\x00\x01\x00\x00\x02\x1c\
\x00\x00\x02\x8a\x00\x00\x00\x00\x00\x01\x00\x01\x8e\x55\
\x00\x00\x01\x5e\x00\x00\x00\x00\x00\x01\x00\x00\xb7\xdb\
\x00\x00\x02\x1c\x00\x00\x00\x00\x00\x01\x00\x01\x80\xd7\
\x00\x00\x00\x52\x00\x00\x00\x00\x00\x01\x00\x00\x63\x7d\
\x00\x00\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00\xb3\x37\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x02\x56\x00\x00\x00\x00\x00\x01\x00\x01\x82\x8d\
\x00\x00\x02\xa2\x00\x00\x00\x00\x00\x01\x00\x01\xcf\xb5\
"
def qInitResources():
QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
|
gpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
7337,
909,
1233,
199,
3,
199,
3,
18208,
26,
3868,
85,
16794,
4944,
5557,
26,
1079,
26,
1398,
6927,
199,
3,
420,
701,
26,
710,
7337,
27154,
367,
14084,
334,
4238,
373,
20,
14,
24,
14,
17,
9,
199,
3,
199,
3,
14750,
1,
2900,
4493,
6326,
315,
642,
570,
911,
506,
14669,
1,
199,
199,
504,
14084,
20,
492,
10565,
199,
199,
8440,
63,
1927,
63,
576,
275,
1867,
199,
60,
88,
383,
60,
88,
383,
60,
88,
996,
60,
88,
1085,
60,
199,
60,
88,
1407,
60,
199,
60,
88,
1400,
60,
88,
20,
69,
60,
88,
2417,
60,
88,
16,
68,
60,
88,
16,
65,
60,
88,
17,
65,
60,
88,
16,
65,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
16,
68,
60,
88,
1887,
60,
88,
2006,
60,
88,
1602,
60,
88,
2528,
60,
88,
383,
60,
199,
60,
88,
383,
60,
88,
383,
60,
88,
2322,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
2322,
60,
88,
2036,
60,
88,
1690,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
17,
67,
60,
88,
24,
68,
60,
88,
18,
66,
60,
88,
1398,
60,
199,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
1690,
60,
88,
2789,
60,
88,
20,
66,
60,
88,
2417,
60,
88,
1602,
60,
88,
383,
60,
3581,
60,
88,
383,
60,
3581,
60,
88,
383,
60,
3581,
60,
1800,
16,
60,
9826,
60,
199,
60,
1800,
23,
60,
88,
3129,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
1643,
60,
88,
2760,
60,
88,
2006,
60,
88,
1427,
60,
88,
2898,
60,
88,
383,
60,
88,
383,
60,
88,
16,
68,
60,
2207,
23,
60,
88,
383,
60,
88,
383,
60,
199,
60,
88,
16,
68,
60,
2207,
23,
60,
88,
614,
60,
88,
2260,
60,
88,
1651,
60,
88,
25,
66,
60,
88,
2277,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
1780,
60,
88,
1342,
60,
88,
1887,
60,
88,
20,
68,
60,
88,
2322,
60,
88,
1780,
60,
199,
60,
11110,
60,
88,
16,
67,
60,
88,
1643,
60,
88,
996,
60,
88,
614,
60,
88,
1153,
60,
88,
23,
70,
60,
1812,
19,
60,
88,
2658,
60,
1845,
19,
60,
88,
383,
60,
88,
383,
60,
88,
614,
60,
1800,
21,
60,
88,
1887,
60,
88,
1602,
60,
199,
60,
88,
2953,
60,
88,
1477,
60,
88,
2277,
60,
11078,
60,
7887,
60,
10550,
60,
88,
19,
70,
60,
88,
22,
66,
60,
88,
3129,
60,
88,
2869,
60,
88,
1079,
60,
1812,
23,
60,
1949,
17,
60,
9532,
60,
88,
1965,
60,
88,
25,
69,
60,
199,
60,
88,
1082,
60,
88,
22,
65,
60,
10104,
60,
88,
1651,
60,
88,
2192,
60,
88,
1400,
60,
10719,
60,
1949,
24,
60,
88,
1555,
60,
88,
24,
65,
60,
88,
2789,
60,
88,
22,
66,
60,
88,
24,
65,
60,
88,
2658,
60,
88,
16,
69,
60,
88,
2528,
60,
199,
60,
88,
1651,
60,
88,
1717,
60,
88,
1780,
60,
88,
1196,
60,
88,
3172,
60,
88,
845,
60,
88,
2576,
60,
1845,
18,
60,
10656,
60,
1845,
16,
60,
88,
22,
66,
60,
88,
709,
60,
88,
21,
70,
60,
88,
1257,
60,
88,
22,
70,
60,
88,
1789,
60,
199,
60,
1800,
19,
60,
1800,
19,
60,
1845,
16,
60,
88,
20,
66,
60,
88,
2710,
60,
1800,
16,
60,
2207,
18,
60,
1800,
17,
60,
88,
22,
70,
60,
88,
2167,
60,
88,
845,
60,
1774,
20,
60,
88,
24,
68,
60,
88,
614,
60,
88,
1555,
60,
11078,
60,
199,
60,
88,
2564,
60,
88,
2710,
60,
88,
2564,
60,
1845,
25,
60,
88,
3172,
60,
88,
1216,
60,
88,
3328,
60,
88,
975,
60,
88,
24,
66,
60,
1774,
24,
60,
88,
25,
65,
60,
88,
23,
67,
60,
88,
23,
70,
60,
10351,
60,
9826,
60,
10550,
60,
199,
60,
1949,
17,
60,
88,
1644,
60,
88,
1555,
60,
88,
2898,
60,
11127,
60,
88,
2760,
60,
88,
22,
70,
60,
88,
772,
60,
1845,
22,
60,
88,
19,
69,
60,
88,
709,
60,
88,
2905,
60,
88,
2869,
60,
11078,
60,
88,
2426,
60,
88,
1690,
60,
199,
60,
88,
23,
70,
60,
1800,
22,
60,
88,
708,
60,
11078,
60,
1949,
20,
60,
10539,
60,
10145,
60,
88,
23,
67,
60,
10719,
60,
88,
23,
69,
60,
88,
19,
70,
60,
1774,
17,
60,
88,
709,
60,
88,
2576,
60,
1845,
22,
60,
9532,
60,
199,
60,
88,
2819,
60,
1800,
18,
60,
2207,
22,
60,
88,
1703,
60,
88,
24,
67,
60,
1774,
18,
60,
1774,
19,
60,
11208,
60,
88,
2835,
60,
11127,
60,
1845,
23,
60,
10489,
60,
1812,
20,
60,
1800,
18,
60,
11022,
60,
88,
1344,
60,
199,
60,
88,
22,
70,
60,
3581,
60,
88,
2466,
60,
1774,
17,
60,
88,
23,
67,
60,
88,
24,
69,
60,
88,
1299,
60,
88,
1651,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
88,
24,
65,
60,
88,
1651,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
199,
60,
88,
24,
65,
60,
88,
1651,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
88,
24,
65,
60,
88,
1651,
60,
1800,
18,
60,
88,
1085,
60,
88,
2869,
60,
88,
1602,
60,
88,
845,
60,
88,
2322,
60,
88,
1079,
60,
88,
2869,
60,
88,
1602,
60,
199,
60,
88,
845,
60,
88,
2322,
60,
88,
1079,
60,
88,
2869,
60,
88,
1602,
60,
88,
845,
60,
88,
2322,
60,
88,
1079,
60,
88,
2869,
60,
88,
1602,
60,
88,
2192,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
88,
24,
65,
60,
88,
1651,
60,
199,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
88,
24,
65,
60,
88,
1651,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
88,
24,
65,
60,
88,
1651,
60,
1800,
18,
60,
88,
1085,
60,
88,
2869,
60,
88,
1602,
60,
88,
845,
60,
88,
2322,
60,
199,
60
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
7337,
909,
1233,
199,
3,
199,
3,
18208,
26,
3868,
85,
16794,
4944,
5557,
26,
1079,
26,
1398,
6927,
199,
3,
420,
701,
26,
710,
7337,
27154,
367,
14084,
334,
4238,
373,
20,
14,
24,
14,
17,
9,
199,
3,
199,
3,
14750,
1,
2900,
4493,
6326,
315,
642,
570,
911,
506,
14669,
1,
199,
199,
504,
14084,
20,
492,
10565,
199,
199,
8440,
63,
1927,
63,
576,
275,
1867,
199,
60,
88,
383,
60,
88,
383,
60,
88,
996,
60,
88,
1085,
60,
199,
60,
88,
1407,
60,
199,
60,
88,
1400,
60,
88,
20,
69,
60,
88,
2417,
60,
88,
16,
68,
60,
88,
16,
65,
60,
88,
17,
65,
60,
88,
16,
65,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
16,
68,
60,
88,
1887,
60,
88,
2006,
60,
88,
1602,
60,
88,
2528,
60,
88,
383,
60,
199,
60,
88,
383,
60,
88,
383,
60,
88,
2322,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
2322,
60,
88,
2036,
60,
88,
1690,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
17,
67,
60,
88,
24,
68,
60,
88,
18,
66,
60,
88,
1398,
60,
199,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
1690,
60,
88,
2789,
60,
88,
20,
66,
60,
88,
2417,
60,
88,
1602,
60,
88,
383,
60,
3581,
60,
88,
383,
60,
3581,
60,
88,
383,
60,
3581,
60,
1800,
16,
60,
9826,
60,
199,
60,
1800,
23,
60,
88,
3129,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
1643,
60,
88,
2760,
60,
88,
2006,
60,
88,
1427,
60,
88,
2898,
60,
88,
383,
60,
88,
383,
60,
88,
16,
68,
60,
2207,
23,
60,
88,
383,
60,
88,
383,
60,
199,
60,
88,
16,
68,
60,
2207,
23,
60,
88,
614,
60,
88,
2260,
60,
88,
1651,
60,
88,
25,
66,
60,
88,
2277,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
1780,
60,
88,
1342,
60,
88,
1887,
60,
88,
20,
68,
60,
88,
2322,
60,
88,
1780,
60,
199,
60,
11110,
60,
88,
16,
67,
60,
88,
1643,
60,
88,
996,
60,
88,
614,
60,
88,
1153,
60,
88,
23,
70,
60,
1812,
19,
60,
88,
2658,
60,
1845,
19,
60,
88,
383,
60,
88,
383,
60,
88,
614,
60,
1800,
21,
60,
88,
1887,
60,
88,
1602,
60,
199,
60,
88,
2953,
60,
88,
1477,
60,
88,
2277,
60,
11078,
60,
7887,
60,
10550,
60,
88,
19,
70,
60,
88,
22,
66,
60,
88,
3129,
60,
88,
2869,
60,
88,
1079,
60,
1812,
23,
60,
1949,
17,
60,
9532,
60,
88,
1965,
60,
88,
25,
69,
60,
199,
60,
88,
1082,
60,
88,
22,
65,
60,
10104,
60,
88,
1651,
60,
88,
2192,
60,
88,
1400,
60,
10719,
60,
1949,
24,
60,
88,
1555,
60,
88,
24,
65,
60,
88,
2789,
60,
88,
22,
66,
60,
88,
24,
65,
60,
88,
2658,
60,
88,
16,
69,
60,
88,
2528,
60,
199,
60,
88,
1651,
60,
88,
1717,
60,
88,
1780,
60,
88,
1196,
60,
88,
3172,
60,
88,
845,
60,
88,
2576,
60,
1845,
18,
60,
10656,
60,
1845,
16,
60,
88,
22,
66,
60,
88,
709,
60,
88,
21,
70,
60,
88,
1257,
60,
88,
22,
70,
60,
88,
1789,
60,
199,
60,
1800,
19,
60,
1800,
19,
60,
1845,
16,
60,
88,
20,
66,
60,
88,
2710,
60,
1800,
16,
60,
2207,
18,
60,
1800,
17,
60,
88,
22,
70,
60,
88,
2167,
60,
88,
845,
60,
1774,
20,
60,
88,
24,
68,
60,
88,
614,
60,
88,
1555,
60,
11078,
60,
199,
60,
88,
2564,
60,
88,
2710,
60,
88,
2564,
60,
1845,
25,
60,
88,
3172,
60,
88,
1216,
60,
88,
3328,
60,
88,
975,
60,
88,
24,
66,
60,
1774,
24,
60,
88,
25,
65,
60,
88,
23,
67,
60,
88,
23,
70,
60,
10351,
60,
9826,
60,
10550,
60,
199,
60,
1949,
17,
60,
88,
1644,
60,
88,
1555,
60,
88,
2898,
60,
11127,
60,
88,
2760,
60,
88,
22,
70,
60,
88,
772,
60,
1845,
22,
60,
88,
19,
69,
60,
88,
709,
60,
88,
2905,
60,
88,
2869,
60,
11078,
60,
88,
2426,
60,
88,
1690,
60,
199,
60,
88,
23,
70,
60,
1800,
22,
60,
88,
708,
60,
11078,
60,
1949,
20,
60,
10539,
60,
10145,
60,
88,
23,
67,
60,
10719,
60,
88,
23,
69,
60,
88,
19,
70,
60,
1774,
17,
60,
88,
709,
60,
88,
2576,
60,
1845,
22,
60,
9532,
60,
199,
60,
88,
2819,
60,
1800,
18,
60,
2207,
22,
60,
88,
1703,
60,
88,
24,
67,
60,
1774,
18,
60,
1774,
19,
60,
11208,
60,
88,
2835,
60,
11127,
60,
1845,
23,
60,
10489,
60,
1812,
20,
60,
1800,
18,
60,
11022,
60,
88,
1344,
60,
199,
60,
88,
22,
70,
60,
3581,
60,
88,
2466,
60,
1774,
17,
60,
88,
23,
67,
60,
88,
24,
69,
60,
88,
1299,
60,
88,
1651,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
88,
24,
65,
60,
88,
1651,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
199,
60,
88,
24,
65,
60,
88,
1651,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
88,
24,
65,
60,
88,
1651,
60,
1800,
18,
60,
88,
1085,
60,
88,
2869,
60,
88,
1602,
60,
88,
845,
60,
88,
2322,
60,
88,
1079,
60,
88,
2869,
60,
88,
1602,
60,
199,
60,
88,
845,
60,
88,
2322,
60,
88,
1079,
60,
88,
2869,
60,
88,
1602,
60,
88,
845,
60,
88,
2322,
60,
88,
1079,
60,
88,
2869,
60,
88,
1602,
60,
88,
2192,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
88,
24,
65,
60,
88,
1651,
60,
199,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
88,
24,
65,
60,
88,
1651,
60,
1800,
18,
60,
88,
1299,
60,
88,
1081,
60,
88,
24,
65,
60,
88,
1651,
60,
1800,
18,
60,
88,
1085,
60,
88,
2869,
60,
88,
1602,
60,
88,
845,
60,
88,
2322,
60,
199,
60,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
rchlin/ShadowsocksFork
|
utils/autoban.py
|
1033
|
2156
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from __future__ import absolute_import, division, print_function, \
with_statement
import os
import sys
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='See README')
parser.add_argument('-c', '--count', default=3, type=int,
help='with how many failure times it should be '
'considered as an attack')
config = parser.parse_args()
ips = {}
banned = set()
for line in sys.stdin:
if 'can not parse header when' in line:
ip = line.split()[-1].split(':')[0]
if ip not in ips:
ips[ip] = 1
print(ip)
sys.stdout.flush()
else:
ips[ip] += 1
if ip not in banned and ips[ip] >= config.count:
banned.add(ip)
cmd = 'iptables -A INPUT -s %s -j DROP' % ip
print(cmd, file=sys.stderr)
sys.stderr.flush()
os.system(cmd)
|
apache-2.0
|
[
3381,
2647,
15,
1393,
15,
1548,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
1898,
334,
67,
9,
6900,
286,
674,
11530,
89,
199,
3,
199,
3,
8779,
365,
11882,
10009,
12,
2867,
402,
11204,
12,
370,
1263,
4954,
12408,
282,
1331,
199,
3,
402,
642,
2032,
436,
4568,
3794,
1584,
334,
1589,
298,
10337,
1288,
370,
7962,
199,
3,
315,
314,
2290,
1928,
10588,
12,
5893,
1928,
12305,
314,
4481,
199,
3,
370,
675,
12,
1331,
12,
2811,
12,
5389,
12,
2780,
12,
11207,
12,
13473,
12,
436,
15,
269,
12743,
199,
3,
6866,
402,
314,
2290,
12,
436,
370,
11291,
12103,
370,
12676,
314,
2290,
365,
199,
3,
13985,
370,
886,
880,
12,
5420,
370,
314,
2569,
3704,
26,
199,
3,
199,
3,
710,
3432,
4248,
4245,
436,
642,
4983,
4245,
10989,
506,
5120,
315,
199,
3,
1006,
6866,
503,
13393,
12468,
402,
314,
2290,
14,
199,
3,
199,
3,
2334,
4141,
2281,
7049,
298,
1179,
2281,
401,
2428,
3408,
1634,
1821,
3826,
12,
7168,
1549,
199,
3,
5292,
12,
6931,
5400,
2845,
5471,
2296,
2334,
2990,
1634,
3169,
12,
199,
3,
3092,
2381,
437,
3115,
3104,
2401,
13229,
14,
1621,
4825,
6461,
7000,
2334,
199,
3,
10610,
1549,
5877,
8164,
6262,
7024,
2381,
1821,
13140,
12,
6736,
1549,
5010,
199,
3,
5603,
12,
7061,
1621,
1261,
9612,
1634,
7066,
12,
7056,
1549,
7334,
12,
7043,
4442,
12,
199,
3,
5738,
1634,
1549,
1621,
11287,
1663,
2334,
4141,
1549,
2334,
4815,
1549,
5010,
13198,
1621,
2334,
199,
3,
4141,
14,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
12,
4629,
12,
870,
63,
1593,
12,
971,
272,
543,
63,
6242,
199,
199,
646,
747,
199,
646,
984,
199,
646,
7534,
199,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
1798,
275,
7534,
14,
10730,
8,
1802,
534,
9295,
27781,
358,
272,
1798,
14,
525,
63,
2094,
3654,
67,
297,
2850,
835,
297,
849,
29,
19,
12,
730,
29,
442,
12,
717,
1720,
534,
1045,
4212,
5002,
5988,
5431,
652,
1077,
506,
283,
2490,
283,
388,
2441,
581,
465,
376,
23326,
358,
272,
1101,
275,
1798,
14,
1122,
63,
589,
342,
272,
15017,
275,
1052,
272,
330,
9386,
275,
663,
342,
272,
367,
1004,
315,
984,
14,
6626,
26,
267,
340,
283,
2425,
440,
2198,
1406,
1380,
7,
315,
1004,
26,
288,
3384,
275,
1004,
14,
1294,
19105,
17,
1055,
1294,
24050,
16,
61,
288,
340,
3384,
440,
315,
15017,
26,
355,
15017,
59,
711,
61,
275,
413,
355,
870,
8,
711,
9,
355,
984,
14,
2703,
14,
4939,
342,
288,
587,
26,
355,
15017,
59,
711,
61,
847,
413,
288,
340,
3384,
440,
315,
330,
9386,
436,
15017,
59,
711,
61,
2356,
1101,
14,
835,
26,
355,
330,
9386,
14,
525,
8,
711,
9,
355,
2088,
275,
283,
23232,
446,
33,
21955,
446,
83,
450,
83,
446,
74,
26704,
7,
450,
3384,
355,
870,
8,
1760,
12,
570,
29,
1274,
14,
3083,
9,
355,
984,
14,
3083,
14,
4939,
342,
355,
747,
14,
2253,
8,
1760,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2647,
15,
1393,
15,
1548,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
1898,
334,
67,
9,
6900,
286,
674,
11530,
89,
199,
3,
199,
3,
8779,
365,
11882,
10009,
12,
2867,
402,
11204,
12,
370,
1263,
4954,
12408,
282,
1331,
199,
3,
402,
642,
2032,
436,
4568,
3794,
1584,
334,
1589,
298,
10337,
1288,
370,
7962,
199,
3,
315,
314,
2290,
1928,
10588,
12,
5893,
1928,
12305,
314,
4481,
199,
3,
370,
675,
12,
1331,
12,
2811,
12,
5389,
12,
2780,
12,
11207,
12,
13473,
12,
436,
15,
269,
12743,
199,
3,
6866,
402,
314,
2290,
12,
436,
370,
11291,
12103,
370,
12676,
314,
2290,
365,
199,
3,
13985,
370,
886,
880,
12,
5420,
370,
314,
2569,
3704,
26,
199,
3,
199,
3,
710,
3432,
4248,
4245,
436,
642,
4983,
4245,
10989,
506,
5120,
315,
199,
3,
1006,
6866,
503,
13393,
12468,
402,
314,
2290,
14,
199,
3,
199,
3,
2334,
4141,
2281,
7049,
298,
1179,
2281,
401,
2428,
3408,
1634,
1821,
3826,
12,
7168,
1549,
199,
3,
5292,
12,
6931,
5400,
2845,
5471,
2296,
2334,
2990,
1634,
3169,
12,
199,
3,
3092,
2381,
437,
3115,
3104,
2401,
13229,
14,
1621,
4825,
6461,
7000,
2334,
199,
3,
10610,
1549,
5877,
8164,
6262,
7024,
2381,
1821,
13140,
12,
6736,
1549,
5010,
199,
3,
5603,
12,
7061,
1621,
1261,
9612,
1634,
7066,
12,
7056,
1549,
7334,
12,
7043,
4442,
12,
199,
3,
5738,
1634,
1549,
1621,
11287,
1663,
2334,
4141,
1549,
2334,
4815,
1549,
5010,
13198,
1621,
2334,
199,
3,
4141,
14,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
12,
4629,
12,
870,
63,
1593,
12,
971,
272,
543,
63,
6242,
199,
199,
646,
747,
199,
646,
984,
199,
646,
7534,
199,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
1798,
275,
7534,
14,
10730,
8,
1802,
534,
9295,
27781,
358,
272,
1798,
14,
525,
63,
2094,
3654,
67,
297,
2850,
835,
297,
849,
29,
19,
12,
730,
29,
442,
12,
717,
1720,
534,
1045,
4212,
5002,
5988,
5431,
652,
1077,
506,
283,
2490,
283,
388,
2441,
581,
465,
376,
23326,
358,
272,
1101,
275,
1798,
14,
1122,
63,
589,
342,
272,
15017,
275,
1052,
272,
330,
9386,
275,
663,
342,
272,
367,
1004,
315,
984,
14,
6626,
26,
267,
340,
283,
2425,
440,
2198,
1406,
1380,
7,
315,
1004,
26,
288,
3384,
275,
1004,
14,
1294,
19105,
17,
1055,
1294,
24050,
16,
61,
288,
340,
3384,
440,
315,
15017,
26,
355,
15017,
59,
711,
61,
275,
413,
355,
870,
8,
711,
9,
355,
984,
14,
2703,
14,
4939,
342,
288,
587,
26,
355,
15017,
59,
711,
61,
847,
413,
288,
340,
3384,
440,
315,
330,
9386,
436,
15017,
59,
711,
61,
2356,
1101,
14,
835,
26,
355,
330,
9386,
14,
525,
8,
711,
9,
355,
2088,
275,
283,
23232,
446,
33,
21955,
446,
83,
450,
83,
446,
74,
26704,
7,
450,
3384,
355,
870,
8,
1760,
12,
570,
29,
1274,
14,
3083,
9,
355,
984,
14,
3083,
14,
4939,
342,
355,
747,
14,
2253,
8,
1760,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
hlt-mt/tensorflow
|
tensorflow/python/lib/io/tf_record.py
|
11
|
2450
|
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""For reading and writing TFRecords files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.util import compat
def tf_record_iterator(path):
"""An iterator that read the records from a TFRecords file.
Args:
path: The path to the TFRecords file.
Yields:
Strings.
Raises:
IOError: If `path` cannot be opened for reading.
"""
reader = pywrap_tensorflow.PyRecordReader_New(compat.as_bytes(path), 0)
if reader is None:
raise IOError("Could not open %s." % path)
while reader.GetNext():
yield reader.record()
reader.Close()
class TFRecordWriter(object):
"""A class to write records to a TFRecords file.
This class implements `__enter__` and `__exit__`, and can be used
in `with` blocks like a normal file.
@@__init__
@@write
@@close
"""
# TODO(josh11b): Support appending?
def __init__(self, path):
"""Opens file `path` and creates a `TFRecordWriter` writing to it.
Args:
path: The path to the TFRecords file.
Raises:
IOError: If `path` cannot be opened for writing.
"""
self._writer = pywrap_tensorflow.PyRecordWriter_New(compat.as_bytes(path))
if self._writer is None:
raise IOError("Could not write to %s." % path)
def __enter__(self):
"""Enter a `with` block."""
pass
def __exit__(self, unused_type, unused_value, unused_traceback):
"""Exit a `with` block, closing the file."""
self.close()
def write(self, record):
"""Write a string record to the file.
Args:
record: str
"""
self._writer.WriteRecord(record)
def close(self):
"""Close the file."""
self._writer.Close()
|
apache-2.0
|
[
3,
1898,
6900,
4475,
3277,
14,
2900,
5924,
5702,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
3,
11148,
199,
199,
624,
1858,
7664,
436,
3575,
21721,
14941,
1584,
1041,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
4629,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
199,
504,
3228,
14,
1548,
492,
1134,
3823,
63,
16008,
199,
504,
3228,
14,
1548,
14,
1974,
492,
8434,
421,
199,
318,
2833,
63,
3059,
63,
5778,
8,
515,
304,
523,
408,
2493,
6122,
626,
1586,
314,
5767,
687,
282,
21721,
14941,
570,
14,
819,
3033,
26,
272,
931,
26,
710,
931,
370,
314,
21721,
14941,
570,
14,
819,
23771,
83,
26,
272,
24361,
14,
819,
6218,
26,
272,
5925,
26,
982,
658,
515,
64,
3913,
506,
12123,
367,
7664,
14,
523,
408,
523,
7002,
275,
1134,
3823,
63,
16008,
14,
2713,
5433,
5929,
63,
4665,
8,
5819,
14,
305,
63,
2394,
8,
515,
395,
378,
9,
523,
340,
7002,
365,
488,
26,
272,
746,
5925,
480,
6531,
440,
1551,
450,
83,
2122,
450,
931,
9,
523,
1830,
7002,
14,
20079,
837,
272,
1995,
7002,
14,
3059,
342,
523,
7002,
14,
4724,
342,
421,
199,
533,
21721,
5433,
6261,
8,
785,
304,
523,
408,
33,
1021,
370,
2218,
5767,
370,
282,
21721,
14941,
570,
14,
819,
961,
1021,
9031,
26856,
4200,
29341,
436,
26856,
2224,
363,
3559,
436,
883,
506,
1202,
523,
315,
658,
1045,
64,
5664,
2839,
282,
3293,
570,
14,
819,
13365,
363,
826,
363,
523,
13365,
952,
523,
13365,
1600,
523,
408,
523,
327,
3254,
8,
743,
609,
845,
66,
304,
12502,
24373,
31,
523,
347,
636,
826,
721,
277,
12,
931,
304,
272,
408,
4299,
83,
570,
658,
515,
64,
436,
8491,
282,
658,
6145,
5433,
6261,
64,
3575,
370,
652,
14,
339,
3033,
26,
489,
931,
26,
710,
931,
370,
314,
21721,
14941,
570,
14,
339,
6218,
26,
489,
5925,
26,
982,
658,
515,
64,
3913,
506,
12123,
367,
3575,
14,
272,
408,
272,
291,
423,
5491,
275,
1134,
3823,
63,
16008,
14,
2713,
5433,
6261,
63,
4665,
8,
5819,
14,
305,
63,
2394,
8,
515,
430,
272,
340,
291,
423,
5491,
365,
488,
26,
489,
746,
5925,
480,
6531,
440,
2218,
370,
450,
83,
2122,
450,
931,
9,
819,
347,
636,
4200,
721,
277,
304,
272,
408,
8468,
282,
658,
1045,
64,
1853,
1041,
272,
986,
819,
347,
636,
2224,
721,
277,
12,
9563,
63,
466,
12,
9563,
63,
585,
12,
9563,
63,
6894,
304,
272,
408,
6699,
282,
658,
1045,
64,
1853,
12,
11261,
314,
570,
1041,
272,
291,
14,
1600,
342,
819,
347,
2218,
8,
277,
12,
2777,
304,
272,
408,
3534,
282,
1059,
2777,
370,
314,
570,
14,
339,
3033,
26,
489,
2777,
26,
620,
272,
408,
272,
291,
423,
5491,
14,
3534,
5433,
8,
3059,
9,
819,
347,
4002,
8,
277,
304,
272,
408,
4724,
314,
570,
1041,
272,
291,
423,
5491,
14,
4724,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1898,
6900,
4475,
3277,
14,
2900,
5924,
5702,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
3,
11148,
199,
199,
624,
1858,
7664,
436,
3575,
21721,
14941,
1584,
1041,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
4629,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
199,
504,
3228,
14,
1548,
492,
1134,
3823,
63,
16008,
199,
504,
3228,
14,
1548,
14,
1974,
492,
8434,
421,
199,
318,
2833,
63,
3059,
63,
5778,
8,
515,
304,
523,
408,
2493,
6122,
626,
1586,
314,
5767,
687,
282,
21721,
14941,
570,
14,
819,
3033,
26,
272,
931,
26,
710,
931,
370,
314,
21721,
14941,
570,
14,
819,
23771,
83,
26,
272,
24361,
14,
819,
6218,
26,
272,
5925,
26,
982,
658,
515,
64,
3913,
506,
12123,
367,
7664,
14,
523,
408,
523,
7002,
275,
1134,
3823,
63,
16008,
14,
2713,
5433,
5929,
63,
4665,
8,
5819,
14,
305,
63,
2394,
8,
515,
395,
378,
9,
523,
340,
7002,
365,
488,
26,
272,
746,
5925,
480,
6531,
440,
1551,
450,
83,
2122,
450,
931,
9,
523,
1830,
7002,
14,
20079,
837,
272,
1995,
7002,
14,
3059,
342,
523,
7002,
14,
4724,
342,
421,
199,
533,
21721,
5433,
6261,
8,
785,
304,
523,
408,
33,
1021,
370,
2218,
5767,
370,
282,
21721,
14941,
570,
14,
819,
961,
1021,
9031,
26856,
4200,
29341,
436,
26856,
2224,
363,
3559,
436,
883,
506,
1202,
523,
315,
658,
1045,
64,
5664,
2839,
282,
3293,
570,
14,
819,
13365,
363,
826,
363,
523,
13365,
952,
523,
13365,
1600,
523,
408,
523,
327,
3254,
8,
743,
609,
845,
66,
304,
12502,
24373,
31,
523,
347,
636,
826,
721,
277,
12,
931,
304,
272,
408,
4299,
83,
570,
658,
515,
64,
436,
8491,
282,
658,
6145,
5433,
6261,
64,
3575,
370,
652,
14,
339,
3033,
26,
489,
931,
26,
710,
931,
370,
314,
21721,
14941,
570,
14,
339,
6218,
26,
489,
5925,
26,
982,
658,
515,
64,
3913,
506,
12123,
367,
3575,
14,
272,
408,
272,
291,
423,
5491,
275,
1134,
3823,
63,
16008,
14,
2713,
5433,
6261,
63,
4665,
8,
5819,
14,
305,
63,
2394,
8,
515,
430,
272,
340,
291,
423,
5491,
365,
488,
26,
489,
746,
5925,
480,
6531,
440,
2218,
370,
450,
83,
2122,
450,
931,
9,
819,
347,
636,
4200,
721,
277,
304,
272,
408,
8468,
282,
658,
1045,
64,
1853,
1041,
272,
986,
819,
347,
636,
2224,
721,
277,
12,
9563,
63,
466,
12,
9563,
63,
585,
12,
9563,
63,
6894,
304,
272,
408,
6699,
282,
658,
1045,
64,
1853,
12,
11261,
314,
570,
1041,
272,
291,
14,
1600,
342,
819,
347,
2218,
8,
277,
12,
2777,
304,
272,
408,
3534,
282,
1059,
2777,
370,
314,
570,
14,
339,
3033,
26,
489,
2777,
26,
620,
272,
408,
272,
291,
423,
5491,
14,
3534,
5433,
8,
3059,
9,
819,
347,
4002,
8,
277,
304,
272,
408,
4724,
314,
570,
1041,
272,
291,
423,
5491,
14,
4724,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
unreal666/outwiker
|
plugins/source/source/pygments/lexers/testing.py
|
6
|
10752
|
# -*- coding: utf-8 -*-
"""
pygments.lexers.testing
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for testing languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups
from pygments.token import Comment, Keyword, Name, String, Number, Generic, Text
__all__ = ['GherkinLexer', 'TAPLexer']
class GherkinLexer(RegexLexer):
"""
For `Gherkin <http://github.com/aslakhellesoy/gherkin/>` syntax.
.. versionadded:: 1.2
"""
name = 'Gherkin'
aliases = ['cucumber', 'gherkin']
filenames = ['*.feature']
mimetypes = ['text/x-gherkin']
feature_keywords = u'^(기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Фича|Особина|Могућност|Özellik|Właściwość|Tính năng|Trajto|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd)(:)(.*)$'
feature_element_keywords = u'^(\\s*)(시나리오 개요|시나리오|배경|背景|場景大綱|場景|场景大纲|场景|劇本大綱|劇本|剧本大纲|剧本|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|シナリオ|سيناريو مخطط|سيناريو|الخلفية|תרחיש|תבנית תרחיש|רקע|Тарих|Сценарій|Сценарио|Сценарий структураси|Сценарий|Структура сценарію|Структура сценарија|Структура сценария|Скица|Рамка на сценарий|Пример|Предыстория|Предистория|Позадина|Передумова|Основа|Концепт|Контекст|Założenia|Wharrimean is|Tình huống|The thing of it is|Tausta|Taust|Tapausaihio|Tapaus|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situācija|Senaryo taslağı|Senaryo|Scénář|Scénario|Schema dello scenario|Scenārijs pēc parauga|Scenārijs|Scenár|Scenaro|Scenariusz|Scenariul de şablon|Scenariul de sablon|Scenariu|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenarijaus šablonas|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Primer|Pozadí|Pozadina|Pozadie|Plan du scénario|Plan du Scénario|Osnova scénáře|Osnova|Náčrt Scénáře|Náčrt Scenáru|Mate|MISHUN SRSLY|MISHUN|Kịch bản|Konturo de la scenaro|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung tình huống|Khung kịch bản|Háttér|Grundlage|Geçmiş|Forgatókönyv vázlat|Forgatókönyv|Fono|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l\'escenari|Escenario|Escenari|Dis is what went down|Dasar|Contexto|Contexte|Contesto|Condiţii|Conditii|Cenário|Cenario|Cefndir|Bối cảnh|Blokes|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y\'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)(:)(.*)$'
examples_keywords = u'^(\\s*)(예|例子|例|サンプル|امثلة|דוגמאות|Сценарији|Примери|Приклади|Мисоллар|Значения|Örnekler|Voorbeelden|Variantai|Tapaukset|Scenarios|Scenariji|Scenarijai|Příklady|Példák|Príklady|Przykłady|Primjeri|Primeri|Piemēri|Pavyzdžiai|Paraugs|Juhtumid|Exemplos|Exemples|Exemplele|Exempel|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|EXAMPLZ|Dữ liệu|Contoh|Cobber|Beispiele)(:)(.*)$'
step_keywords = u'^(\\s*)(하지만|조건|먼저|만일|만약|단|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假设|假如|假定|但是|但し|並且|并且|同時|同时|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Унда |То |Припустимо, що |Припустимо |Онда |Но |Нехай |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Але |Агар |А |І |Și |És |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Youse know when youse got |Youse know like when |Yna |Ya know how |Ya gotta |Y |Wun |Wtedy |When y\'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y\'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Sed |Se |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kaj |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Dengan |Den youse gotta |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |Cal |But y\'all |But |Buh |Biết |Bet |BUT |Atès |Atunci |Atesa |Anrhegedig a |Angenommen |And y\'all |And |An |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\\* )'
tokens = {
'comments': [
(r'^\s*#.*$', Comment),
],
'feature_elements': [
(step_keywords, Keyword, "step_content_stack"),
include('comments'),
(r"(\s|.)", Name.Function),
],
'feature_elements_on_stack': [
(step_keywords, Keyword, "#pop:2"),
include('comments'),
(r"(\s|.)", Name.Function),
],
'examples_table': [
(r"\s+\|", Keyword, 'examples_table_header'),
include('comments'),
(r"(\s|.)", Name.Function),
],
'examples_table_header': [
(r"\s+\|\s*$", Keyword, "#pop:2"),
include('comments'),
(r"\\\|", Name.Variable),
(r"\s*\|", Keyword),
(r"[^|]", Name.Variable),
],
'scenario_sections_on_stack': [
(feature_element_keywords,
bygroups(Name.Function, Keyword, Keyword, Name.Function),
"feature_elements_on_stack"),
],
'narrative': [
include('scenario_sections_on_stack'),
include('comments'),
(r"(\s|.)", Name.Function),
],
'table_vars': [
(r'(<[^>]+>)', Name.Variable),
],
'numbers': [
(r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', String),
],
'string': [
include('table_vars'),
(r'(\s|.)', String),
],
'py_string': [
(r'"""', Keyword, "#pop"),
include('string'),
],
'step_content_root': [
(r"$", Keyword, "#pop"),
include('step_content'),
],
'step_content_stack': [
(r"$", Keyword, "#pop:2"),
include('step_content'),
],
'step_content': [
(r'"', Name.Function, "double_string"),
include('table_vars'),
include('numbers'),
include('comments'),
(r'(\s|.)', Name.Function),
],
'table_content': [
(r"\s+\|\s*$", Keyword, "#pop"),
include('comments'),
(r"\\\|", String),
(r"\s*\|", Keyword),
include('string'),
],
'double_string': [
(r'"', Name.Function, "#pop"),
include('string'),
],
'root': [
(r'\n', Name.Function),
include('comments'),
(r'"""', Keyword, "py_string"),
(r'\s+\|', Keyword, 'table_content'),
(r'"', Name.Function, "double_string"),
include('table_vars'),
include('numbers'),
(r'(\s*)(@[^@\r\n\t ]+)', bygroups(Name.Function, Name.Tag)),
(step_keywords, bygroups(Name.Function, Keyword),
'step_content_root'),
(feature_keywords, bygroups(Keyword, Keyword, Name.Function),
'narrative'),
(feature_element_keywords,
bygroups(Name.Function, Keyword, Keyword, Name.Function),
'feature_elements'),
(examples_keywords,
bygroups(Name.Function, Keyword, Keyword, Name.Function),
'examples_table'),
(r'(\s|.)', Name.Function),
]
}
class TAPLexer(RegexLexer):
"""
For Test Anything Protocol (TAP) output.
.. versionadded:: 2.1
"""
name = 'TAP'
aliases = ['tap']
filenames = ['*.tap']
tokens = {
'root': [
# A TAP version may be specified.
(r'^TAP version \d+\n', Name.Namespace),
# Specify a plan with a plan line.
(r'^1\.\.\d+', Keyword.Declaration, 'plan'),
# A test failure
(r'^(not ok)([^\S\n]*)(\d*)',
bygroups(Generic.Error, Text, Number.Integer), 'test'),
# A test success
(r'^(ok)([^\S\n]*)(\d*)',
bygroups(Keyword.Reserved, Text, Number.Integer), 'test'),
# Diagnostics start with a hash.
(r'^#.*\n', Comment),
# TAP's version of an abort statement.
(r'^Bail out!.*\n', Generic.Error),
# TAP ignores any unrecognized lines.
(r'^.*\n', Text),
],
'plan': [
# Consume whitespace (but not newline).
(r'[^\S\n]+', Text),
# A plan may have a directive with it.
(r'#', Comment, 'directive'),
# Or it could just end.
(r'\n', Comment, '#pop'),
# Anything else is wrong.
(r'.*\n', Generic.Error, '#pop'),
],
'test': [
# Consume whitespace (but not newline).
(r'[^\S\n]+', Text),
# A test may have a directive with it.
(r'#', Comment, 'directive'),
(r'\S+', Text),
(r'\n', Text, '#pop'),
],
'directive': [
# Consume whitespace (but not newline).
(r'[^\S\n]+', Comment),
# Extract todo items.
(r'(?i)\bTODO\b', Comment.Preproc),
# Extract skip items.
(r'(?i)\bSKIP\S*', Comment.Preproc),
(r'\S+', Comment),
(r'\n', Comment, '#pop:2'),
],
}
|
gpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
624,
272,
13277,
14,
12245,
14,
4776,
272,
18294,
2878,
23597,
339,
491,
476,
1192,
367,
5343,
10815,
14,
339,
520,
7307,
26,
1898,
8315,
13,
10680,
701,
314,
14493,
8099,
12,
1937,
10610,
14,
272,
520,
1682,
26,
6289,
12,
1937,
5113,
367,
2436,
14,
199,
624,
199,
199,
504,
13277,
14,
11729,
492,
12939,
5838,
12,
2387,
12,
10259,
199,
504,
13277,
14,
1418,
492,
6819,
12,
6431,
12,
2812,
12,
2624,
12,
4860,
12,
8307,
12,
4516,
199,
199,
363,
452,
363,
275,
788,
39,
2523,
19269,
5838,
297,
283,
52,
1282,
5838,
418,
421,
199,
533,
598,
2523,
19269,
5838,
8,
19856,
304,
272,
408,
272,
2104,
658,
39,
2523,
19269,
665,
1014,
921,
5031,
14,
957,
15,
305,
416,
21889,
352,
274,
1152,
89,
15,
71,
2523,
19269,
3133,
64,
6302,
14,
339,
2508,
7445,
447,
413,
14,
18,
272,
408,
272,
536,
275,
283,
39,
2523,
19269,
7,
272,
5481,
275,
788,
67,
947,
884,
297,
283,
71,
2523,
19269,
418,
272,
6203,
275,
17855,
4445,
418,
272,
13290,
275,
788,
505,
15,
88,
13,
71,
2523,
19269,
418,
339,
3878,
63,
7511,
275,
399,
31996,
167,
117,
109,
168,
233,
99,
92,
163,
103,
254,
28371,
92,
12163,
254,
28371,
92,
5692,
244,
5573,
97,
17670,
5692,
224,
5692,
97,
92,
26321,
11321,
114,
15441,
22863,
92,
148,
104,
148,
250,
148,
244,
148,
255,
148,
243,
92,
141,
98,
12195,
7592,
11487,
25827,
21874,
5806,
7592,
30638,
92,
141,
98,
12195,
7592,
11487,
25827,
6500,
5806,
7592,
30638,
7592,
5806,
18261,
92,
141,
98,
12195,
7592,
11487,
25827,
6500,
5806,
7592,
30638,
92,
141,
98,
6500,
19277,
5657,
92,
141,
253,
8474,
8381,
110,
27859,
5657,
92,
141,
251,
8381,
112,
12195,
142,
250,
7592,
5806,
18261,
92,
128,
245,
90,
352,
317,
75,
92,
55,
130,
225,
65,
130,
250,
559,
2027,
130,
250,
129,
230,
92,
52,
13676,
29199,
302,
129,
226,
2753,
92,
2437,
74,
475,
92,
51,
22421,
66,
129,
246,
92,
1575,
29529,
73,
350,
1214,
7351,
92,
1575,
29529,
350,
811,
75,
92,
47,
1152,
1393,
65,
92,
47,
827,
65,
374,
85,
527,
92,
29197,
350,
527,
92,
30454,
869,
7730,
92,
45,
974,
85,
129,
230,
889,
270,
92,
45,
974,
947,
889,
270,
92,
42,
352,
3701,
90,
130,
240,
92,
38,
129,
105,
31493,
65,
92,
19941,
90,
1636,
279,
390,
26482,
92,
38,
1778,
25219,
390,
13733,
84,
92,
38,
1778,
559,
8125,
889,
270,
92,
38,
1778,
559,
8125,
390,
129,
224,
266,
92,
7465,
133,
250,
1636,
279,
390,
323,
92,
3481,
279,
1175,
390,
92,
3481,
279,
390,
323,
92,
19941,
559,
8125,
390,
292,
92,
19941,
9718,
2555,
9587,
92,
38,
265,
414,
78,
279,
390,
5741,
92,
13776,
300,
92,
5968,
92,
37,
2268,
1339,
439,
92,
37,
2268,
1339,
371,
92,
35,
322,
498,
92,
16034,
6747,
13676,
11108,
65,
92,
1596,
24084,
68,
5130,
26,
5130,
12432,
12913,
272,
3878,
63,
2108,
63,
7511,
275,
399,
4289,
27910,
83,
28304,
25408,
251,
168,
225,
247,
168,
100,
106,
169,
247,
98,
221,
22247,
251,
32072,
243,
92,
25408,
251,
168,
225,
247,
168,
100,
106,
169,
247,
98,
92,
168,
109,
109,
167,
111,
122,
92,
165,
226,
235,
163,
248,
108,
92,
162,
255,
113,
163,
248,
108,
28232,
164,
115,
110,
92,
162,
255,
113,
163,
248,
108,
92,
11987,
119,
163,
248,
108,
28232,
13389,
111,
92,
11987,
119,
163,
248,
108,
92,
12163,
230,
26304,
28232,
164,
115,
110,
92,
12163,
230,
26304,
92,
19642,
101,
26304,
28232,
13389,
111,
92,
19642,
101,
26304,
92,
5692,
229,
23488,
5692,
246,
5692,
106,
92,
5573,
116,
5692,
233,
5692,
104,
5573,
104,
5692,
229,
23488,
5692,
246,
5692,
106,
17670,
23869,
92,
5573,
116,
5692,
233,
5692,
104,
5573,
104,
5692,
229,
23488,
5692,
246,
5692,
106,
92,
5573,
116,
5692,
233,
5692,
104,
5573,
104,
5573,
96,
5573,
100,
23869,
5692,
103,
26873,
23488,
92,
5573,
116,
5692,
233,
5692,
104,
5573,
104,
92,
18438,
15441,
11056,
26837,
15441,
9012,
21216,
26321,
149,
116,
149,
116,
92,
18438,
15441,
11056,
26837,
15441,
9012,
92,
15305,
26321,
8403,
18570,
15441,
22863,
92,
148,
104,
148,
102,
148,
246,
148,
248,
148,
103,
92,
148,
104,
148,
240,
148,
255,
148,
248,
148,
104,
30988,
104,
148,
102,
148,
246,
148,
248,
148,
103,
92,
148,
102,
148,
101,
148,
96,
92,
141,
96,
27559,
6500,
25969,
92,
141,
95,
25827,
18624,
27559,
21874,
141,
118,
92,
141,
95,
25827,
18624,
27559,
6500,
5806,
92,
141,
95,
25827,
18624,
27559,
16863,
118,
221,
18261,
7753,
12195,
11487,
7413,
12195,
7753,
5657,
8474,
6500,
92,
141,
95,
25827,
18624,
27559,
16863,
118,
92,
141,
95,
7413,
7753,
12195,
11487,
7413,
12195,
7753,
5657,
24071,
25827,
18624,
27559,
21874,
31235,
92,
141,
95,
7413,
7753,
12195,
11487,
7413,
12195,
7753,
5657,
24071,
25827,
18624,
27559,
6500,
142,
247,
5657,
92,
141,
95,
7413,
7753,
12195,
11487,
7413,
12195,
7753,
5657,
24071,
25827,
18624,
27559,
6500,
14978,
92,
141,
95,
11487,
6500,
25827,
5657,
92,
141,
255,
13111,
121,
29352,
24917,
5657,
24071,
25827,
18624,
27559,
16863,
118,
92,
141,
254,
7753,
16863,
121,
21273,
92,
141,
254,
7753,
15578,
113,
17445,
18261,
26438,
6500,
14978,
92,
141,
254,
7753,
15578,
113,
6500,
18261,
26438,
6500,
14978,
92,
141,
254,
8381,
116,
13111,
113,
27859,
5657,
92,
141,
254,
21273,
15578,
113,
12195,
23000,
21267,
5657,
92,
141,
253,
8474,
7592,
21267,
5657,
92,
141,
249,
5806,
7592,
25827,
15578,
124,
7413,
92,
141,
249,
5806,
7592,
7413,
6286,
11487,
18261,
92,
13163,
130,
225,
79,
130,
121,
287,
4674,
92,
5879,
285,
322,
3670,
365,
92,
52,
128,
106,
29199,
394,
85,
158,
120,
240,
2753,
92,
1918,
8377,
402,
652,
365,
92,
22620,
833,
65,
92,
22620,
833,
92,
22620,
387,
527,
5789,
72,
2308,
92,
22620,
387,
527,
92,
51,
5193,
759,
14945,
725,
322,
385,
92,
51,
5193,
6936,
92,
51,
90,
371,
5298,
8482,
759,
527,
8076,
92,
933,
2464,
65,
759,
453,
92,
2848
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
624,
272,
13277,
14,
12245,
14,
4776,
272,
18294,
2878,
23597,
339,
491,
476,
1192,
367,
5343,
10815,
14,
339,
520,
7307,
26,
1898,
8315,
13,
10680,
701,
314,
14493,
8099,
12,
1937,
10610,
14,
272,
520,
1682,
26,
6289,
12,
1937,
5113,
367,
2436,
14,
199,
624,
199,
199,
504,
13277,
14,
11729,
492,
12939,
5838,
12,
2387,
12,
10259,
199,
504,
13277,
14,
1418,
492,
6819,
12,
6431,
12,
2812,
12,
2624,
12,
4860,
12,
8307,
12,
4516,
199,
199,
363,
452,
363,
275,
788,
39,
2523,
19269,
5838,
297,
283,
52,
1282,
5838,
418,
421,
199,
533,
598,
2523,
19269,
5838,
8,
19856,
304,
272,
408,
272,
2104,
658,
39,
2523,
19269,
665,
1014,
921,
5031,
14,
957,
15,
305,
416,
21889,
352,
274,
1152,
89,
15,
71,
2523,
19269,
3133,
64,
6302,
14,
339,
2508,
7445,
447,
413,
14,
18,
272,
408,
272,
536,
275,
283,
39,
2523,
19269,
7,
272,
5481,
275,
788,
67,
947,
884,
297,
283,
71,
2523,
19269,
418,
272,
6203,
275,
17855,
4445,
418,
272,
13290,
275,
788,
505,
15,
88,
13,
71,
2523,
19269,
418,
339,
3878,
63,
7511,
275,
399,
31996,
167,
117,
109,
168,
233,
99,
92,
163,
103,
254,
28371,
92,
12163,
254,
28371,
92,
5692,
244,
5573,
97,
17670,
5692,
224,
5692,
97,
92,
26321,
11321,
114,
15441,
22863,
92,
148,
104,
148,
250,
148,
244,
148,
255,
148,
243,
92,
141,
98,
12195,
7592,
11487,
25827,
21874,
5806,
7592,
30638,
92,
141,
98,
12195,
7592,
11487,
25827,
6500,
5806,
7592,
30638,
7592,
5806,
18261,
92,
141,
98,
12195,
7592,
11487,
25827,
6500,
5806,
7592,
30638,
92,
141,
98,
6500,
19277,
5657,
92,
141,
253,
8474,
8381,
110,
27859,
5657,
92,
141,
251,
8381,
112,
12195,
142,
250,
7592,
5806,
18261,
92,
128,
245,
90,
352,
317,
75,
92,
55,
130,
225,
65,
130,
250,
559,
2027,
130,
250,
129,
230,
92,
52,
13676,
29199,
302,
129,
226,
2753,
92,
2437,
74,
475,
92,
51,
22421,
66,
129,
246,
92,
1575,
29529,
73,
350,
1214,
7351,
92,
1575,
29529,
350,
811,
75,
92,
47,
1152,
1393,
65,
92,
47,
827,
65,
374,
85,
527,
92,
29197,
350,
527,
92,
30454,
869,
7730,
92,
45,
974,
85,
129,
230,
889,
270,
92,
45,
974,
947,
889,
270,
92,
42,
352,
3701,
90,
130,
240,
92,
38,
129,
105,
31493,
65,
92,
19941,
90,
1636,
279,
390,
26482,
92,
38,
1778,
25219,
390,
13733,
84,
92,
38,
1778,
559,
8125,
889,
270,
92,
38,
1778,
559,
8125,
390,
129,
224,
266,
92,
7465,
133,
250,
1636,
279,
390,
323,
92,
3481,
279,
1175,
390,
92,
3481,
279,
390,
323,
92,
19941,
559,
8125,
390,
292,
92,
19941,
9718,
2555,
9587,
92,
38,
265,
414,
78,
279,
390,
5741,
92,
13776,
300,
92,
5968,
92,
37,
2268,
1339,
439,
92,
37,
2268,
1339,
371,
92,
35,
322,
498,
92,
16034,
6747,
13676,
11108,
65,
92,
1596,
24084,
68,
5130,
26,
5130,
12432,
12913,
272,
3878,
63,
2108,
63,
7511,
275,
399,
4289,
27910,
83,
28304,
25408,
251,
168,
225,
247,
168,
100,
106,
169,
247,
98,
221,
22247,
251,
32072,
243,
92,
25408,
251,
168,
225,
247,
168,
100,
106,
169,
247,
98,
92,
168,
109,
109,
167,
111,
122,
92,
165,
226,
235,
163,
248,
108,
92,
162,
255,
113,
163,
248,
108,
28232,
164,
115,
110,
92,
162,
255,
113,
163,
248,
108,
92,
11987,
119,
163,
248,
108,
28232,
13389,
111,
92,
11987,
119,
163,
248,
108,
92,
12163,
230,
26304,
28232,
164,
115,
110,
92,
12163,
230,
26304,
92,
19642,
101,
26304,
28232,
13389,
111,
92,
19642,
101,
26304,
92,
5692,
229,
23488,
5692,
246,
5692,
106,
92,
5573,
116,
5692,
233,
5692,
104,
5573,
104,
5692,
229,
23488,
5692,
246,
5692,
106,
17670,
23869,
92,
5573,
116,
5692,
233,
5692,
104,
5573,
104,
5692,
229,
23488,
5692,
246,
5692,
106,
92,
5573,
116,
5692,
233,
5692,
104,
5573,
104,
5573,
96,
5573,
100,
23869,
5692,
103,
26873,
23488,
92,
5573,
116,
5692,
233,
5692,
104,
5573,
104,
92,
18438,
15441,
11056,
26837,
15441,
9012,
21216,
26321,
149,
116,
149,
116,
92,
18438,
15441,
11056,
26837,
15441,
9012,
92,
15305,
26321,
8403,
18570,
15441,
22863,
92,
148,
104,
148,
102,
148,
246,
148,
248,
148,
103,
92,
148,
104,
148,
240,
148,
255,
148,
248,
148,
104,
30988,
104,
148,
102,
148,
246,
148,
248,
148,
103,
92,
148,
102,
148,
101,
148,
96,
92,
141,
96,
27559,
6500,
25969,
92,
141,
95,
25827,
18624,
27559,
21874,
141,
118,
92,
141,
95,
25827,
18624,
27559,
6500,
5806,
92,
141,
95,
25827,
18624,
27559,
16863,
118,
221,
18261,
7753,
12195,
11487,
7413,
12195,
7753,
5657,
8474,
6500,
92,
141,
95,
25827,
18624,
27559,
16863,
118,
92,
141,
95,
7413,
7753,
12195,
11487,
7413,
12195,
7753,
5657,
24071,
25827,
18624,
27559,
21874,
31235,
92,
141,
95,
7413,
7753,
12195,
11487,
7413,
12195,
7753,
5657,
24071,
25827,
18624,
27559,
6500,
142,
247,
5657,
92,
141,
95,
7413,
7753,
12195,
11487,
7413,
12195,
7753,
5657,
24071,
25827,
18624,
27559,
6500,
14978,
92,
141,
95,
11487,
6500,
25827,
5657,
92,
141,
255,
13111,
121,
29352,
24917,
5657,
24071,
25827,
18624,
27559,
16863,
118,
92,
141,
254,
7753,
16863,
121,
21273,
92,
141,
254,
7753,
15578,
113,
17445,
18261,
26438,
6500,
14978,
92,
141,
254,
7753,
15578,
113,
6500,
18261,
26438,
6500,
14978,
92,
141,
254,
8381,
116,
13111,
113,
27859,
5657,
92,
141,
254,
21273,
15578,
113,
12195,
23000,
21267,
5657,
92,
141,
253,
8474,
7592,
21267,
5657,
92,
141,
249,
5806,
7592,
25827,
15578,
124,
7413,
92,
141,
249,
5806,
7592,
7413,
6286,
11487,
18261,
92,
13163,
130,
225,
79,
130,
121,
287,
4674,
92,
5879,
285,
322,
3670,
365,
92,
52,
128,
106,
29199,
394,
85,
158,
120,
240,
2753,
92,
1918,
8377,
402,
652,
365,
92,
22620,
833,
65,
92,
22620,
833,
92,
22620,
387,
527,
5789,
72,
2308,
92,
22620,
387,
527,
92,
51,
5193,
759,
14945,
725,
322,
385,
92,
51,
5193,
6936,
92,
51,
90,
371,
5298,
8482,
759,
527,
8076,
92,
933,
2464,
65,
759,
453,
92,
2848,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
gundalow/ansible-modules-core
|
utilities/logic/debug.py
|
50
|
2304
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
ANSIBLE_METADATA = {'status': ['stableinterface'],
'supported_by': 'core',
'version': '1.0'}
DOCUMENTATION = '''
---
module: debug
short_description: Print statements during execution
description:
- This module prints statements during execution and can be useful
for debugging variables or expressions without necessarily halting
the playbook. Useful for debugging together with the 'when:' directive.
version_added: "0.8"
options:
msg:
description:
- The customized message that is printed. If omitted, prints a generic
message.
required: false
default: "Hello world!"
var:
description:
- A variable name to debug. Mutually exclusive with the 'msg' option.
verbosity:
description:
- A number that controls when the debug is run, if you set to 3 it will only run debug when -vvv or above
required: False
default: 0
version_added: "2.1"
author:
- "Dag Wieers (@dagwieers)"
- "Michael DeHaan"
'''
EXAMPLES = '''
# Example that prints the loopback address and gateway for each host
- debug:
msg: "System {{ inventory_hostname }} has uuid {{ ansible_product_uuid }}"
- debug:
msg: "System {{ inventory_hostname }} has gateway {{ ansible_default_ipv4.gateway }}"
when: ansible_default_ipv4.gateway is defined
- shell: /usr/bin/uptime
register: result
- debug:
var: result
verbosity: 2
- name: Display all variables/facts known for a host
debug:
var: hostvars[inventory_hostname]
verbosity: 4
'''
|
gpl-3.0
|
[
3381,
2647,
15,
1393,
15,
1548,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
1898,
6029,
26110,
644,
1873,
1192,
665,
7406,
32,
87,
1873,
1192,
14,
957,
30,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
2622,
199,
3,
199,
3,
2622,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
199,
3,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
2622,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
3,
3180,
543,
2622,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
199,
8490,
63,
8314,
275,
791,
1205,
356,
788,
11989,
3266,
995,
490,
283,
4946,
63,
991,
356,
283,
1018,
297,
490,
283,
1023,
356,
283,
17,
14,
16,
936,
199,
199,
8948,
275,
1449,
199,
2595,
199,
578,
26,
3105,
199,
3612,
63,
1802,
26,
9101,
9834,
5309,
6451,
199,
1802,
26,
1362,
446,
961,
859,
14767,
9834,
5309,
6451,
436,
883,
506,
2997,
2126,
367,
10201,
2860,
503,
8455,
1928,
20513,
22939,
1337,
2126,
314,
15695,
14,
18491,
367,
10201,
10451,
543,
314,
283,
6526,
4881,
13613,
14,
199,
199,
1023,
63,
3270,
26,
298,
16,
14,
24,
2,
199,
1419,
26,
523,
1499,
26,
272,
1369,
26,
489,
446,
710,
26707,
1245,
626,
365,
12487,
14,
982,
11684,
12,
14767,
282,
7809,
267,
1245,
14,
272,
1415,
26,
3055,
272,
849,
26,
298,
6257,
6701,
9539,
523,
2729,
26,
272,
1369,
26,
489,
446,
437,
1750,
536,
370,
3105,
14,
221,
26550,
3163,
13914,
543,
314,
283,
1328,
7,
945,
14,
523,
8661,
26,
272,
1369,
26,
489,
446,
437,
1329,
626,
13467,
1380,
314,
3105,
365,
1255,
12,
340,
1265,
663,
370,
650,
652,
911,
1454,
1255,
3105,
1380,
446,
24622,
503,
3432,
272,
1415,
26,
756,
272,
849,
26,
378,
272,
1015,
63,
3270,
26,
298,
18,
14,
17,
2,
199,
2502,
26,
272,
446,
298,
27234,
644,
1873,
1192,
8593,
7406,
87,
1873,
1192,
2924,
272,
446,
298,
45,
11781,
22453,
2,
199,
2344,
199,
199,
8918,
275,
1449,
199,
3,
5679,
626,
14767,
314,
4438,
894,
2287,
436,
10391,
367,
1924,
1591,
199,
13,
3105,
26,
272,
1499,
26,
298,
3989,
8448,
8200,
63,
4269,
3586,
965,
5377,
8448,
3242,
63,
2558,
63,
2580,
7820,
199,
199,
13,
3105,
26,
272,
1499,
26,
298,
3989,
8448,
8200,
63,
4269,
3586,
965,
10391,
8448,
3242,
63,
885,
63,
4774,
20,
14,
7019,
7820,
523,
1380,
26,
3242,
63,
885,
63,
4774,
20,
14,
7019,
365,
3247,
199,
199,
13,
5218,
26,
1182,
2647,
15,
1393,
15,
24853,
523,
2274,
26,
754,
199,
199,
13,
3105,
26,
272,
2729,
26,
754,
272,
8661,
26,
499,
199,
199,
13,
536,
26,
12175,
1006,
2860,
15,
5047,
6040,
367,
282,
1591,
523,
3105,
26,
272,
2729,
26,
21835,
59,
7212,
63,
4269,
61,
272,
8661,
26,
841,
199,
2344,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2647,
15,
1393,
15,
1548,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
1898,
6029,
26110,
644,
1873,
1192,
665,
7406,
32,
87,
1873,
1192,
14,
957,
30,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
2622,
199,
3,
199,
3,
2622,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
199,
3,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
2622,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
3,
3180,
543,
2622,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
199,
8490,
63,
8314,
275,
791,
1205,
356,
788,
11989,
3266,
995,
490,
283,
4946,
63,
991,
356,
283,
1018,
297,
490,
283,
1023,
356,
283,
17,
14,
16,
936,
199,
199,
8948,
275,
1449,
199,
2595,
199,
578,
26,
3105,
199,
3612,
63,
1802,
26,
9101,
9834,
5309,
6451,
199,
1802,
26,
1362,
446,
961,
859,
14767,
9834,
5309,
6451,
436,
883,
506,
2997,
2126,
367,
10201,
2860,
503,
8455,
1928,
20513,
22939,
1337,
2126,
314,
15695,
14,
18491,
367,
10201,
10451,
543,
314,
283,
6526,
4881,
13613,
14,
199,
199,
1023,
63,
3270,
26,
298,
16,
14,
24,
2,
199,
1419,
26,
523,
1499,
26,
272,
1369,
26,
489,
446,
710,
26707,
1245,
626,
365,
12487,
14,
982,
11684,
12,
14767,
282,
7809,
267,
1245,
14,
272,
1415,
26,
3055,
272,
849,
26,
298,
6257,
6701,
9539,
523,
2729,
26,
272,
1369,
26,
489,
446,
437,
1750,
536,
370,
3105,
14,
221,
26550,
3163,
13914,
543,
314,
283,
1328,
7,
945,
14,
523,
8661,
26,
272,
1369,
26,
489,
446,
437,
1329,
626,
13467,
1380,
314,
3105,
365,
1255,
12,
340,
1265,
663,
370,
650,
652,
911,
1454,
1255,
3105,
1380,
446,
24622,
503,
3432,
272,
1415,
26,
756,
272,
849,
26,
378,
272,
1015,
63,
3270,
26,
298,
18,
14,
17,
2,
199,
2502,
26,
272,
446,
298,
27234,
644,
1873,
1192,
8593,
7406,
87,
1873,
1192,
2924,
272,
446,
298,
45,
11781,
22453,
2,
199,
2344,
199,
199,
8918,
275,
1449,
199,
3,
5679,
626,
14767,
314,
4438,
894,
2287,
436,
10391,
367,
1924,
1591,
199,
13,
3105,
26,
272,
1499,
26,
298,
3989,
8448,
8200,
63,
4269,
3586,
965,
5377,
8448,
3242,
63,
2558,
63,
2580,
7820,
199,
199,
13,
3105,
26,
272,
1499,
26,
298,
3989,
8448,
8200,
63,
4269,
3586,
965,
10391,
8448,
3242,
63,
885,
63,
4774,
20,
14,
7019,
7820,
523,
1380,
26,
3242,
63,
885,
63,
4774,
20,
14,
7019,
365,
3247,
199,
199,
13,
5218,
26,
1182,
2647,
15,
1393,
15,
24853,
523,
2274,
26,
754,
199,
199,
13,
3105,
26,
272,
2729,
26,
754,
272,
8661,
26,
499,
199,
199,
13,
536,
26,
12175,
1006,
2860,
15,
5047,
6040,
367,
282,
1591,
523,
3105,
26,
272,
2729,
26,
21835,
59,
7212,
63,
4269,
61,
272,
8661,
26,
841,
199,
2344,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
bvisness/the-blue-alliance
|
tests/test_validation_helper.py
|
4
|
1304
|
import unittest2
from helpers.validation_helper import ValidationHelper
class TestValidationHelper(unittest2.TestCase):
def testTeamValidation(self):
errors = ValidationHelper.validate([("team_id_validator", "frc01")])
self.assertEqual(errors, {"Errors": [{"team_id": "frc01 is not a valid team id"}]})
def testEventValidation(self):
errors = ValidationHelper.validate([("event_id_validator", "1cmp")])
self.assertEqual(errors, {"Errors": [{"event_id": "1cmp is not a valid event id"}]})
def testMatchValidation(self):
errors = ValidationHelper.validate([("match_id_validator", "0010c1_0m2")])
self.assertEqual(errors, {"Errors": [{"match_id": "0010c1_0m2 is not a valid match id"}]})
def testComboValidation(self):
errors = ValidationHelper.validate([("match_id_validator", "0010c1_0m2"),
("team_id_validator", "frc01"),
("event_id_validator", "1cmp")])
self.assertEqual(errors, {"Errors": [{"match_id": "0010c1_0m2 is not a valid match id"}, {"team_id": "frc01 is not a valid team id"},{"event_id": "1cmp is not a valid event id"}]})
def testValidValidation(self):
errors = ValidationHelper.validate([("team_id_validator", "frc101")])
self.assertEqual(None, errors)
|
mit
|
[
646,
2882,
18,
199,
199,
504,
10897,
14,
6136,
63,
3676,
492,
19381,
4433,
199,
199,
533,
1379,
13816,
4433,
8,
2796,
18,
14,
1746,
304,
339,
347,
511,
13126,
13816,
8,
277,
304,
267,
2552,
275,
19381,
4433,
14,
3502,
27187,
5969,
63,
344,
63,
11034,
401,
298,
32309,
614,
13403,
267,
291,
14,
629,
8,
2550,
12,
2420,
9298,
582,
16870,
5969,
63,
344,
582,
298,
32309,
614,
365,
440,
282,
1686,
8099,
1305,
3570,
13412,
339,
347,
511,
2390,
13816,
8,
277,
304,
267,
2552,
275,
19381,
4433,
14,
3502,
27187,
1430,
63,
344,
63,
11034,
401,
298,
17,
5730,
13403,
267,
291,
14,
629,
8,
2550,
12,
2420,
9298,
582,
16870,
1430,
63,
344,
582,
298,
17,
5730,
365,
440,
282,
1686,
1566,
1305,
3570,
13412,
339,
347,
511,
4486,
13816,
8,
277,
304,
267,
2552,
275,
19381,
4433,
14,
3502,
27187,
1431,
63,
344,
63,
11034,
401,
298,
17657,
67,
17,
63,
16,
77,
18,
13403,
267,
291,
14,
629,
8,
2550,
12,
2420,
9298,
582,
16870,
1431,
63,
344,
582,
298,
17657,
67,
17,
63,
16,
77,
18,
365,
440,
282,
1686,
1336,
1305,
3570,
13412,
339,
347,
511,
12413,
13816,
8,
277,
304,
267,
2552,
275,
19381,
4433,
14,
3502,
27187,
1431,
63,
344,
63,
11034,
401,
298,
17657,
67,
17,
63,
16,
77,
18,
1288,
288,
1689,
5969,
63,
344,
63,
11034,
401,
298,
32309,
614,
1288,
288,
1689,
1430,
63,
344,
63,
11034,
401,
298,
17,
5730,
13403,
267,
291,
14,
629,
8,
2550,
12,
2420,
9298,
582,
16870,
1431,
63,
344,
582,
298,
17657,
67,
17,
63,
16,
77,
18,
365,
440,
282,
1686,
1336,
1305,
6018,
2420,
5969,
63,
344,
582,
298,
32309,
614,
365,
440,
282,
1686,
8099,
1305,
6018,
6641,
1430,
63,
344,
582,
298,
17,
5730,
365,
440,
282,
1686,
1566,
1305,
3570,
13412,
339,
347,
511,
3490,
13816,
8,
277,
304,
267,
2552,
275,
19381,
4433,
14,
3502,
27187,
5969,
63,
344,
63,
11034,
401,
298,
32309,
4893,
13403,
267,
291,
14,
629,
8,
403,
12,
2552,
9,
6905,
421,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2882,
18,
199,
199,
504,
10897,
14,
6136,
63,
3676,
492,
19381,
4433,
199,
199,
533,
1379,
13816,
4433,
8,
2796,
18,
14,
1746,
304,
339,
347,
511,
13126,
13816,
8,
277,
304,
267,
2552,
275,
19381,
4433,
14,
3502,
27187,
5969,
63,
344,
63,
11034,
401,
298,
32309,
614,
13403,
267,
291,
14,
629,
8,
2550,
12,
2420,
9298,
582,
16870,
5969,
63,
344,
582,
298,
32309,
614,
365,
440,
282,
1686,
8099,
1305,
3570,
13412,
339,
347,
511,
2390,
13816,
8,
277,
304,
267,
2552,
275,
19381,
4433,
14,
3502,
27187,
1430,
63,
344,
63,
11034,
401,
298,
17,
5730,
13403,
267,
291,
14,
629,
8,
2550,
12,
2420,
9298,
582,
16870,
1430,
63,
344,
582,
298,
17,
5730,
365,
440,
282,
1686,
1566,
1305,
3570,
13412,
339,
347,
511,
4486,
13816,
8,
277,
304,
267,
2552,
275,
19381,
4433,
14,
3502,
27187,
1431,
63,
344,
63,
11034,
401,
298,
17657,
67,
17,
63,
16,
77,
18,
13403,
267,
291,
14,
629,
8,
2550,
12,
2420,
9298,
582,
16870,
1431,
63,
344,
582,
298,
17657,
67,
17,
63,
16,
77,
18,
365,
440,
282,
1686,
1336,
1305,
3570,
13412,
339,
347,
511,
12413,
13816,
8,
277,
304,
267,
2552,
275,
19381,
4433,
14,
3502,
27187,
1431,
63,
344,
63,
11034,
401,
298,
17657,
67,
17,
63,
16,
77,
18,
1288,
288,
1689,
5969,
63,
344,
63,
11034,
401,
298,
32309,
614,
1288,
288,
1689,
1430,
63,
344,
63,
11034,
401,
298,
17,
5730,
13403,
267,
291,
14,
629,
8,
2550,
12,
2420,
9298,
582,
16870,
1431,
63,
344,
582,
298,
17657,
67,
17,
63,
16,
77,
18,
365,
440,
282,
1686,
1336,
1305,
6018,
2420,
5969,
63,
344,
582,
298,
32309,
614,
365,
440,
282,
1686,
8099,
1305,
6018,
6641,
1430,
63,
344,
582,
298,
17,
5730,
365,
440,
282,
1686,
1566,
1305,
3570,
13412,
339,
347,
511,
3490,
13816,
8,
277,
304,
267,
2552,
275,
19381,
4433,
14,
3502,
27187,
5969,
63,
344,
63,
11034,
401,
298,
32309,
4893,
13403,
267,
291,
14,
629,
8,
403,
12,
2552,
9,
6905,
421,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
sonali0901/zulip
|
bots/zephyr_mirror_backend.py
|
2
|
48331
|
#!/usr/bin/env python
# Copyright (C) 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from __future__ import absolute_import
from typing import IO, Any, Text, Union, Set, Tuple
from types import FrameType
import sys
from six.moves import map
from six.moves import range
try:
import simplejson
except ImportError:
import json as simplejson # type: ignore
import re
import time
import subprocess
import optparse
import os
import datetime
import textwrap
import signal
import logging
import hashlib
import tempfile
import select
DEFAULT_SITE = "https://api.zulip.com"
class States(object):
Startup, ZulipToZephyr, ZephyrToZulip, ChildSending = list(range(4))
CURRENT_STATE = States.Startup
logger = None # type: logging.Logger
def to_zulip_username(zephyr_username):
# type: (str) -> str
if "@" in zephyr_username:
(user, realm) = zephyr_username.split("@")
else:
(user, realm) = (zephyr_username, "ATHENA.MIT.EDU")
if realm.upper() == "ATHENA.MIT.EDU":
# Hack to make ctl's fake username setup work :)
if user.lower() == 'golem':
user = 'ctl'
return user.lower() + "@mit.edu"
return user.lower() + "|" + realm.upper() + "@mit.edu"
def to_zephyr_username(zulip_username):
# type: (str) -> str
(user, realm) = zulip_username.split("@")
if "|" not in user:
# Hack to make ctl's fake username setup work :)
if user.lower() == 'ctl':
user = 'golem'
return user.lower() + "@ATHENA.MIT.EDU"
match_user = re.match(r'([a-zA-Z0-9_]+)\|(.+)', user)
if not match_user:
raise Exception("Could not parse Zephyr realm for cross-realm user %s" % (zulip_username,))
return match_user.group(1).lower() + "@" + match_user.group(2).upper()
# Checks whether the pair of adjacent lines would have been
# linewrapped together, had they been intended to be parts of the same
# paragraph. Our check is whether if you move the first word on the
# 2nd line onto the first line, the resulting line is either (1)
# significantly shorter than the following line (which, if they were
# in the same paragraph, should have been wrapped in a way consistent
# with how the previous line was wrapped) or (2) shorter than 60
# characters (our assumed minimum linewrapping threshold for Zephyr)
# or (3) the first word of the next line is longer than this entire
# line.
def different_paragraph(line, next_line):
# type: (str, str) -> bool
words = next_line.split()
return (len(line + " " + words[0]) < len(next_line) * 0.8 or
len(line + " " + words[0]) < 50 or
len(line) < len(words[0]))
# Linewrapping algorithm based on:
# http://gcbenison.wordpress.com/2011/07/03/a-program-to-intelligently-remove-carriage-returns-so-you-can-paste-text-without-having-it-look-awful/ #ignorelongline
def unwrap_lines(body):
# type: (str) -> str
lines = body.split("\n")
result = ""
previous_line = lines[0]
for line in lines[1:]:
line = line.rstrip()
if (re.match(r'^\W', line, flags=re.UNICODE) and
re.match(r'^\W', previous_line, flags=re.UNICODE)):
result += previous_line + "\n"
elif (line == "" or
previous_line == "" or
re.match(r'^\W', line, flags=re.UNICODE) or
different_paragraph(previous_line, line)):
# Use 2 newlines to separate sections so that we
# trigger proper Markdown processing on things like
# bulleted lists
result += previous_line + "\n\n"
else:
result += previous_line + " "
previous_line = line
result += previous_line
return result
def send_zulip(zeph):
# type: (Dict[str, str]) -> Dict[str, str]
message = {}
if options.forward_class_messages:
message["forged"] = "yes"
message['type'] = zeph['type']
message['time'] = zeph['time']
message['sender'] = to_zulip_username(zeph['sender'])
if "subject" in zeph:
# Truncate the subject to the current limit in Zulip. No
# need to do this for stream names, since we're only
# subscribed to valid stream names.
message["subject"] = zeph["subject"][:60]
if zeph['type'] == 'stream':
# Forward messages sent to -c foo -i bar to stream bar subject "instance"
if zeph["stream"] == "message":
message['to'] = zeph['subject'].lower()
message['subject'] = "instance %s" % (zeph['subject'],)
elif zeph["stream"] == "tabbott-test5":
message['to'] = zeph['subject'].lower()
message['subject'] = "test instance %s" % (zeph['subject'],)
else:
message["to"] = zeph["stream"]
else:
message["to"] = zeph["recipient"]
message['content'] = unwrap_lines(zeph['content'])
if options.test_mode and options.site == DEFAULT_SITE:
logger.debug("Message is: %s" % (str(message),))
return {'result': "success"}
return zulip_client.send_message(message)
def send_error_zulip(error_msg):
# type: (str) -> None
message = {"type": "private",
"sender": zulip_account_email,
"to": zulip_account_email,
"content": error_msg,
}
zulip_client.send_message(message)
current_zephyr_subs = set()
def zephyr_bulk_subscribe(subs):
# type: (List[Tuple[str, str, str]]) -> None
try:
zephyr._z.subAll(subs)
except IOError:
# Since we haven't added the subscription to
# current_zephyr_subs yet, we can just return (so that we'll
# continue processing normal messages) and we'll end up
# retrying the next time the bot checks its subscriptions are
# up to date.
logger.exception("Error subscribing to streams (will retry automatically):")
logger.warning("Streams were: %s" % ([cls for cls, instance, recipient in subs],))
return
try:
actual_zephyr_subs = [cls for (cls, _, _) in zephyr._z.getSubscriptions()]
except IOError:
logger.exception("Error getting current Zephyr subscriptions")
# Don't add anything to current_zephyr_subs so that we'll
# retry the next time we check for streams to subscribe to
# (within 15 seconds).
return
for (cls, instance, recipient) in subs:
if cls not in actual_zephyr_subs:
logger.error("Zephyr failed to subscribe us to %s; will retry" % (cls,))
try:
# We'll retry automatically when we next check for
# streams to subscribe to (within 15 seconds), but
# it's worth doing 1 retry immediately to avoid
# missing 15 seconds of messages on the affected
# classes
zephyr._z.sub(cls, instance, recipient)
except IOError:
pass
else:
current_zephyr_subs.add(cls)
def update_subscriptions():
# type: () -> None
try:
f = open(options.stream_file_path, "r")
public_streams = simplejson.loads(f.read())
f.close()
except Exception:
logger.exception("Error reading public streams:")
return
classes_to_subscribe = set()
for stream in public_streams:
zephyr_class = stream.encode("utf-8")
if (options.shard is not None and
not hashlib.sha1(zephyr_class).hexdigest().startswith(options.shard)):
# This stream is being handled by a different zephyr_mirror job.
continue
if zephyr_class in current_zephyr_subs:
continue
classes_to_subscribe.add((zephyr_class, "*", "*"))
if len(classes_to_subscribe) > 0:
zephyr_bulk_subscribe(list(classes_to_subscribe))
def maybe_kill_child():
# type: () -> None
try:
if child_pid is not None:
os.kill(child_pid, signal.SIGTERM)
except OSError:
# We don't care if the child process no longer exists, so just log the error
logger.exception("")
def maybe_restart_mirroring_script():
# type: () -> None
if os.stat(os.path.join(options.root_path, "stamps", "restart_stamp")).st_mtime > start_time or \
((options.user == "tabbott" or options.user == "tabbott/extra") and
os.stat(os.path.join(options.root_path, "stamps", "tabbott_stamp")).st_mtime > start_time):
logger.warning("")
logger.warning("zephyr mirroring script has been updated; restarting...")
maybe_kill_child()
try:
zephyr._z.cancelSubs()
except IOError:
# We don't care whether we failed to cancel subs properly, but we should log it
logger.exception("")
while True:
try:
os.execvp(os.path.join(options.root_path, "user_root", "zephyr_mirror_backend.py"), sys.argv)
except Exception:
logger.exception("Error restarting mirroring script; trying again... Traceback:")
time.sleep(1)
def process_loop(log):
# type: (IO) -> None
restart_check_count = 0
last_check_time = time.time()
while True:
select.select([zephyr._z.getFD()], [], [], 15)
try:
# Fetch notices from the queue until its empty
while True:
notice = zephyr.receive(block=False)
if notice is None:
break
try:
process_notice(notice, log)
except Exception:
logger.exception("Error relaying zephyr:")
time.sleep(2)
except Exception:
logger.exception("Error checking for new zephyrs:")
time.sleep(1)
continue
if time.time() - last_check_time > 15:
last_check_time = time.time()
try:
maybe_restart_mirroring_script()
if restart_check_count > 0:
logger.info("Stopped getting errors checking whether restart is required.")
restart_check_count = 0
except Exception:
if restart_check_count < 5:
logger.exception("Error checking whether restart is required:")
restart_check_count += 1
if options.forward_class_messages:
try:
update_subscriptions()
except Exception:
logger.exception("Error updating subscriptions from Zulip:")
def parse_zephyr_body(zephyr_data):
# type: (str) -> Tuple[str, str]
try:
(zsig, body) = zephyr_data.split("\x00", 1)
except ValueError:
(zsig, body) = ("", zephyr_data)
return (zsig, body)
def parse_crypt_table(zephyr_class, instance):
# type: (Text, str) -> str
try:
crypt_table = open(os.path.join(os.environ["HOME"], ".crypt-table"))
except IOError:
return None
for line in crypt_table.readlines():
if line.strip() == "":
# Ignore blank lines
continue
match = re.match("^crypt-(?P<class>[^:]+):\s+((?P<algorithm>(AES|DES)):\s+)?(?P<keypath>\S+)$", line)
if match is None:
# Malformed crypt_table line
logger.debug("Invalid crypt_table line!")
continue
groups = match.groupdict()
if groups['class'].lower() == zephyr_class and 'keypath' in groups and \
groups.get("algorithm") == "AES":
return groups["keypath"]
return None
def decrypt_zephyr(zephyr_class, instance, body):
# type: (Text, str, str) -> str
keypath = parse_crypt_table(zephyr_class, instance)
if keypath is None:
# We can't decrypt it, so we just return the original body
return body
# Enable handling SIGCHLD briefly while we call into
# subprocess to avoid http://bugs.python.org/issue9127
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
# decrypt the message!
p = subprocess.Popen(["gpg",
"--decrypt",
"--no-options",
"--no-default-keyring",
"--keyring=/dev/null",
"--secret-keyring=/dev/null",
"--batch",
"--quiet",
"--no-use-agent",
"--passphrase-file",
keypath],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
decrypted, _ = p.communicate(input=body)
# Restore our ignoring signals
signal.signal(signal.SIGCHLD, signal.SIG_IGN)
return decrypted
def process_notice(notice, log):
# type: (zulip, IO) -> None
(zsig, body) = parse_zephyr_body(notice.message)
is_personal = False
is_huddle = False
if notice.opcode == "PING":
# skip PING messages
return
zephyr_class = notice.cls.lower()
if zephyr_class == options.nagios_class:
# Mark that we got the message and proceed
with open(options.nagios_path, "w") as f:
f.write("0\n")
return
if notice.recipient != "":
is_personal = True
# Drop messages not to the listed subscriptions
if is_personal and not options.forward_personals:
return
if (zephyr_class not in current_zephyr_subs) and not is_personal:
logger.debug("Skipping ... %s/%s/%s" %
(zephyr_class, notice.instance, is_personal))
return
if notice.format.startswith("Zephyr error: See") or notice.format.endswith("@(@color(blue))"):
logger.debug("Skipping message we got from Zulip!")
return
if (zephyr_class == "mail" and notice.instance.lower() == "inbox" and is_personal and
not options.forward_mail_zephyrs):
# Only forward mail zephyrs if forwarding them is enabled.
return
if is_personal:
if body.startswith("CC:"):
is_huddle = True
# Map "CC: user1 user2" => "user1@mit.edu, user2@mit.edu"
huddle_recipients = [to_zulip_username(x.strip()) for x in
body.split("\n")[0][4:].split()]
if notice.sender not in huddle_recipients:
huddle_recipients.append(to_zulip_username(notice.sender))
body = body.split("\n", 1)[1]
if options.forward_class_messages and notice.opcode.lower() == "crypt":
body = decrypt_zephyr(zephyr_class, notice.instance.lower(), body)
zeph = {'time': str(notice.time),
'sender': notice.sender,
'zsig': zsig, # logged here but not used by app
'content': body}
if is_huddle:
zeph['type'] = 'private'
zeph['recipient'] = huddle_recipients
elif is_personal:
zeph['type'] = 'private'
zeph['recipient'] = to_zulip_username(notice.recipient)
else:
zeph['type'] = 'stream'
zeph['stream'] = zephyr_class
if notice.instance.strip() != "":
zeph['subject'] = notice.instance
else:
zeph["subject"] = '(instance "%s")' % (notice.instance,)
# Add instances in for instanced personals
if is_personal:
if notice.cls.lower() != "message" and notice.instance.lower != "personal":
heading = "[-c %s -i %s]\n" % (notice.cls, notice.instance)
elif notice.cls.lower() != "message":
heading = "[-c %s]\n" % (notice.cls,)
elif notice.instance.lower() != "personal":
heading = "[-i %s]\n" % (notice.instance,)
else:
heading = ""
zeph["content"] = heading + zeph["content"]
zeph = decode_unicode_byte_strings(zeph)
logger.info("Received a message on %s/%s from %s..." %
(zephyr_class, notice.instance, notice.sender))
if log is not None:
log.write(simplejson.dumps(zeph) + '\n')
log.flush()
if os.fork() == 0:
global CURRENT_STATE
CURRENT_STATE = States.ChildSending
# Actually send the message in a child process, to avoid blocking.
try:
res = send_zulip(zeph)
if res.get("result") != "success":
logger.error("Error relaying zephyr:\n%s\n%s" % (zeph, res))
except Exception:
logger.exception("Error relaying zephyr:")
finally:
os._exit(0)
def decode_unicode_byte_strings(zeph):
# type: (Dict[str, Any]) -> Dict[str, str]
# 'Any' can be of any type of text that is converted to str.
for field in zeph.keys():
if isinstance(zeph[field], str):
try:
decoded = zeph[field].decode("utf-8")
except Exception:
decoded = zeph[field].decode("iso-8859-1")
zeph[field] = decoded
return zeph
def quit_failed_initialization(message):
# type: (str) -> str
logger.error(message)
maybe_kill_child()
sys.exit(1)
def zephyr_init_autoretry():
# type: () -> None
backoff = zulip.RandomExponentialBackoff()
while backoff.keep_going():
try:
# zephyr.init() tries to clear old subscriptions, and thus
# sometimes gets a SERVNAK from the server
zephyr.init()
backoff.succeed()
return
except IOError:
logger.exception("Error initializing Zephyr library (retrying). Traceback:")
backoff.fail()
quit_failed_initialization("Could not initialize Zephyr library, quitting!")
def zephyr_load_session_autoretry(session_path):
# type: (str) -> None
backoff = zulip.RandomExponentialBackoff()
while backoff.keep_going():
try:
session = open(session_path, "r").read()
zephyr._z.initialize()
zephyr._z.load_session(session)
zephyr.__inited = True
return
except IOError:
logger.exception("Error loading saved Zephyr session (retrying). Traceback:")
backoff.fail()
quit_failed_initialization("Could not load saved Zephyr session, quitting!")
def zephyr_subscribe_autoretry(sub):
# type: (Tuple[str, str, str]) -> None
backoff = zulip.RandomExponentialBackoff()
while backoff.keep_going():
try:
zephyr.Subscriptions().add(sub)
backoff.succeed()
return
except IOError:
# Probably a SERVNAK from the zephyr server, but log the
# traceback just in case it's something else
logger.exception("Error subscribing to personals (retrying). Traceback:")
backoff.fail()
quit_failed_initialization("Could not subscribe to personals, quitting!")
def zephyr_to_zulip(options):
# type: (Any) -> None
if options.use_sessions and os.path.exists(options.session_path):
logger.info("Loading old session")
zephyr_load_session_autoretry(options.session_path)
else:
zephyr_init_autoretry()
if options.forward_class_messages:
update_subscriptions()
if options.forward_personals:
# Subscribe to personals; we really can't operate without
# those subscriptions, so just retry until it works.
zephyr_subscribe_autoretry(("message", "*", "%me%"))
zephyr_subscribe_autoretry(("mail", "inbox", "%me%"))
if options.nagios_class:
zephyr_subscribe_autoretry((options.nagios_class, "*", "*"))
if options.use_sessions:
open(options.session_path, "w").write(zephyr._z.dump_session())
if options.logs_to_resend is not None:
with open(options.logs_to_resend, 'r') as log:
for ln in log:
try:
zeph = simplejson.loads(ln)
# New messages added to the log shouldn't have any
# elements of type str (they should already all be
# unicode), but older messages in the log are
# still of type str, so convert them before we
# send the message
zeph = decode_unicode_byte_strings(zeph)
# Handle importing older zephyrs in the logs
# where it isn't called a "stream" yet
if "class" in zeph:
zeph["stream"] = zeph["class"]
if "instance" in zeph:
zeph["subject"] = zeph["instance"]
logger.info("sending saved message to %s from %s..." %
(zeph.get('stream', zeph.get('recipient')),
zeph['sender']))
send_zulip(zeph)
except Exception:
logger.exception("Could not send saved zephyr:")
time.sleep(2)
logger.info("Successfully initialized; Starting receive loop.")
if options.resend_log_path is not None:
with open(options.resend_log_path, 'a') as log:
process_loop(log)
else:
process_loop(None)
def send_zephyr(zwrite_args, content):
# type: (list, str) -> Tuple[int, str]
p = subprocess.Popen(zwrite_args, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate(input=content.encode("utf-8"))
if p.returncode:
logger.error("zwrite command '%s' failed with return code %d:" % (
" ".join(zwrite_args), p.returncode,))
if stdout:
logger.info("stdout: " + stdout)
elif stderr:
logger.warning("zwrite command '%s' printed the following warning:" % (
" ".join(zwrite_args),))
if stderr:
logger.warning("stderr: " + stderr)
return (p.returncode, stderr)
def send_authed_zephyr(zwrite_args, content):
# type: (list[str], str) -> Tuple[int, str]
return send_zephyr(zwrite_args, content)
def send_unauthed_zephyr(zwrite_args, content):
# type: (list[str], str) -> Tuple[int, str]
return send_zephyr(zwrite_args + ["-d"], content)
def zcrypt_encrypt_content(zephyr_class, instance, content):
# type: (str, str, str) -> str
keypath = parse_crypt_table(zephyr_class, instance)
if keypath is None:
return None
# encrypt the message!
p = subprocess.Popen(["gpg",
"--symmetric",
"--no-options",
"--no-default-keyring",
"--keyring=/dev/null",
"--secret-keyring=/dev/null",
"--batch",
"--quiet",
"--no-use-agent",
"--armor",
"--cipher-algo", "AES",
"--passphrase-file",
keypath],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
encrypted, _ = p.communicate(input=content)
return encrypted
def forward_to_zephyr(message):
# type: (Dict[str, Any]) -> None
# 'Any' can be of any type of text
support_heading = "Hi there! This is an automated message from Zulip."
support_closing = """If you have any questions, please be in touch through the \
Feedback button or at support@zulipchat.com."""
wrapper = textwrap.TextWrapper(break_long_words=False, break_on_hyphens=False)
wrapped_content = "\n".join("\n".join(wrapper.wrap(line))
for line in message["content"].replace("@", "@@").split("\n"))
zwrite_args = ["zwrite", "-n", "-s", message["sender_full_name"],
"-F", "Zephyr error: See http://zephyr.1ts.org/wiki/df",
"-x", "UTF-8"]
# Hack to make ctl's fake username setup work :)
if message['type'] == "stream" and zulip_account_email == "ctl@mit.edu":
zwrite_args.extend(["-S", "ctl"])
if message['type'] == "stream":
zephyr_class = message["display_recipient"]
instance = message["subject"]
match_whitespace_instance = re.match(r'^\(instance "(\s*)"\)$', instance)
if match_whitespace_instance:
# Forward messages sent to '(instance "WHITESPACE")' back to the
# appropriate WHITESPACE instance for bidirectional mirroring
instance = match_whitespace_instance.group(1)
elif (instance == "instance %s" % (zephyr_class,) or
instance == "test instance %s" % (zephyr_class,)):
# Forward messages to e.g. -c -i white-magic back from the
# place we forward them to
if instance.startswith("test"):
instance = zephyr_class
zephyr_class = "tabbott-test5"
else:
instance = zephyr_class
zephyr_class = "message"
zwrite_args.extend(["-c", zephyr_class, "-i", instance])
logger.info("Forwarding message to class %s, instance %s" % (zephyr_class, instance))
elif message['type'] == "private":
if len(message['display_recipient']) == 1:
recipient = to_zephyr_username(message["display_recipient"][0]["email"])
recipients = [recipient]
elif len(message['display_recipient']) == 2:
recipient = ""
for r in message["display_recipient"]:
if r["email"].lower() != zulip_account_email.lower():
recipient = to_zephyr_username(r["email"])
break
recipients = [recipient]
else:
zwrite_args.extend(["-C"])
# We drop the @ATHENA.MIT.EDU here because otherwise the
# "CC: user1 user2 ..." output will be unnecessarily verbose.
recipients = [to_zephyr_username(user["email"]).replace("@ATHENA.MIT.EDU", "")
for user in message["display_recipient"]]
logger.info("Forwarding message to %s" % (recipients,))
zwrite_args.extend(recipients)
if message.get("invite_only_stream"):
result = zcrypt_encrypt_content(zephyr_class, instance, wrapped_content)
if result is None:
send_error_zulip("""%s
Your Zulip-Zephyr mirror bot was unable to forward that last message \
from Zulip to Zephyr because you were sending to a zcrypted Zephyr \
class and your mirroring bot does not have access to the relevant \
key (perhaps because your AFS tokens expired). That means that while \
Zulip users (like you) received it, Zephyr users did not.
%s""" % (support_heading, support_closing))
return
# Proceed with sending a zcrypted message
wrapped_content = result
zwrite_args.extend(["-O", "crypt"])
if options.test_mode:
logger.debug("Would have forwarded: %s\n%s" %
(zwrite_args, wrapped_content.encode("utf-8")))
return
(code, stderr) = send_authed_zephyr(zwrite_args, wrapped_content)
if code == 0 and stderr == "":
return
elif code == 0:
send_error_zulip("""%s
Your last message was successfully mirrored to zephyr, but zwrite \
returned the following warning:
%s
%s""" % (support_heading, stderr, support_closing))
return
elif code != 0 and (stderr.startswith("zwrite: Ticket expired while sending notice to ") or
stderr.startswith("zwrite: No credentials cache found while sending notice to ")):
# Retry sending the message unauthenticated; if that works,
# just notify the user that they need to renew their tickets
(code, stderr) = send_unauthed_zephyr(zwrite_args, wrapped_content)
if code == 0:
if options.ignore_expired_tickets:
return
send_error_zulip("""%s
Your last message was forwarded from Zulip to Zephyr unauthenticated, \
because your Kerberos tickets have expired. It was sent successfully, \
but please renew your Kerberos tickets in the screen session where you \
are running the Zulip-Zephyr mirroring bot, so we can send \
authenticated Zephyr messages for you again.
%s""" % (support_heading, support_closing))
return
# zwrite failed and it wasn't because of expired tickets: This is
# probably because the recipient isn't subscribed to personals,
# but regardless, we should just notify the user.
send_error_zulip("""%s
Your Zulip-Zephyr mirror bot was unable to forward that last message \
from Zulip to Zephyr. That means that while Zulip users (like you) \
received it, Zephyr users did not. The error message from zwrite was:
%s
%s""" % (support_heading, stderr, support_closing))
return
def maybe_forward_to_zephyr(message):
# type: (Dict[str, Any]) -> None
# The key string can be used to direct any type of text.
if (message["sender_email"] == zulip_account_email):
if not ((message["type"] == "stream") or
(message["type"] == "private" and
False not in [u["email"].lower().endswith("mit.edu") for u in
message["display_recipient"]])):
# Don't try forward private messages with non-MIT users
# to MIT Zephyr.
return
timestamp_now = datetime.datetime.now().strftime("%s")
if float(message["timestamp"]) < float(timestamp_now) - 15:
logger.warning("Skipping out of order message: %s < %s" %
(message["timestamp"], timestamp_now))
return
try:
forward_to_zephyr(message)
except Exception:
# Don't let an exception forwarding one message crash the
# whole process
logger.exception("Error forwarding message:")
def zulip_to_zephyr(options):
# type: (int) -> None
# Sync messages from zulip to zephyr
logger.info("Starting syncing messages.")
while True:
try:
zulip_client.call_on_each_message(maybe_forward_to_zephyr)
except Exception:
logger.exception("Error syncing messages:")
time.sleep(1)
def subscribed_to_mail_messages():
# type: () -> bool
# In case we have lost our AFS tokens and those won't be able to
# parse the Zephyr subs file, first try reading in result of this
# query from the environment so we can avoid the filesystem read.
stored_result = os.environ.get("HUMBUG_FORWARD_MAIL_ZEPHYRS")
if stored_result is not None:
return stored_result == "True"
for (cls, instance, recipient) in parse_zephyr_subs(verbose=False):
if (cls.lower() == "mail" and instance.lower() == "inbox"):
os.environ["HUMBUG_FORWARD_MAIL_ZEPHYRS"] = "True"
return True
os.environ["HUMBUG_FORWARD_MAIL_ZEPHYRS"] = "False"
return False
def add_zulip_subscriptions(verbose):
# type: (bool) -> None
zephyr_subscriptions = set()
skipped = set()
for (cls, instance, recipient) in parse_zephyr_subs(verbose=verbose):
if cls.lower() == "message":
if recipient != "*":
# We already have a (message, *, you) subscription, so
# these are redundant
continue
# We don't support subscribing to (message, *)
if instance == "*":
if recipient == "*":
skipped.add((cls, instance, recipient, "subscribing to all of class message is not supported."))
continue
# If you're on -i white-magic on zephyr, get on stream white-magic on zulip
# instead of subscribing to stream "message" on zulip
zephyr_subscriptions.add(instance)
continue
elif cls.lower() == "mail" and instance.lower() == "inbox":
# We forward mail zephyrs, so no need to log a warning.
continue
elif len(cls) > 60:
skipped.add((cls, instance, recipient, "Class longer than 60 characters"))
continue
elif instance != "*":
skipped.add((cls, instance, recipient, "Unsupported non-* instance"))
continue
elif recipient != "*":
skipped.add((cls, instance, recipient, "Unsupported non-* recipient."))
continue
zephyr_subscriptions.add(cls)
if len(zephyr_subscriptions) != 0:
res = zulip_client.add_subscriptions(list({"name": stream} for stream in zephyr_subscriptions),
authorization_errors_fatal=False)
if res.get("result") != "success":
logger.error("Error subscribing to streams:\n%s" % (res["msg"],))
return
already = res.get("already_subscribed")
new = res.get("subscribed")
unauthorized = res.get("unauthorized")
if verbose:
if already is not None and len(already) > 0:
logger.info("\nAlready subscribed to: %s" % (", ".join(list(already.values())[0]),))
if new is not None and len(new) > 0:
logger.info("\nSuccessfully subscribed to: %s" % (", ".join(list(new.values())[0]),))
if unauthorized is not None and len(unauthorized) > 0:
logger.info("\n" + "\n".join(textwrap.wrap("""\
The following streams you have NOT been subscribed to,
because they have been configured in Zulip as invitation-only streams.
This was done at the request of users of these Zephyr classes, usually
because traffic to those streams is sent within the Zephyr world encrypted
via zcrypt (in Zulip, we achieve the same privacy goals through invitation-only streams).
If you wish to read these streams in Zulip, you need to contact the people who are
on these streams and already use Zulip. They can subscribe you to them via the
"streams" page in the Zulip web interface:
""")) + "\n\n %s" % (", ".join(unauthorized),))
if len(skipped) > 0:
if verbose:
logger.info("\n" + "\n".join(textwrap.wrap("""\
You have some lines in ~/.zephyr.subs that could not be
synced to your Zulip subscriptions because they do not
use "*" as both the instance and recipient and not one of
the special cases (e.g. personals and mail zephyrs) that
Zulip has a mechanism for forwarding. Zulip does not
allow subscribing to only some subjects on a Zulip
stream, so this tool has not created a corresponding
Zulip subscription to these lines in ~/.zephyr.subs:
""")) + "\n")
for (cls, instance, recipient, reason) in skipped:
if verbose:
if reason != "":
logger.info(" [%s,%s,%s] (%s)" % (cls, instance, recipient, reason))
else:
logger.info(" [%s,%s,%s]" % (cls, instance, recipient))
if len(skipped) > 0:
if verbose:
logger.info("\n" + "\n".join(textwrap.wrap("""\
If you wish to be subscribed to any Zulip streams related
to these .zephyrs.subs lines, please do so via the Zulip
web interface.
""")) + "\n")
def valid_stream_name(name):
# type: (str) -> bool
return name != ""
def parse_zephyr_subs(verbose=False):
# type: (bool) -> Union[List, Tuple, Set[Tuple[str, str, str]]]
zephyr_subscriptions = set()
subs_file = os.path.join(os.environ["HOME"], ".zephyr.subs")
if not os.path.exists(subs_file):
if verbose:
logger.error("Couldn't find ~/.zephyr.subs!")
return []
for line in open(subs_file, "r").readlines():
line = line.strip()
if len(line) == 0:
continue
try:
(cls, instance, recipient) = line.split(",")
cls = cls.replace("%me%", options.user)
instance = instance.replace("%me%", options.user)
recipient = recipient.replace("%me%", options.user)
if not valid_stream_name(cls):
if verbose:
logger.error("Skipping subscription to unsupported class name: [%s]" % (line,))
continue
except Exception:
if verbose:
logger.error("Couldn't parse ~/.zephyr.subs line: [%s]" % (line,))
continue
zephyr_subscriptions.add((cls.strip(), instance.strip(), recipient.strip()))
return zephyr_subscriptions
def open_logger():
# type: () -> logging.Logger
if options.log_path is not None:
log_file = options.log_path
elif options.forward_class_messages:
if options.test_mode:
log_file = "/var/log/zulip/test-mirror-log"
else:
log_file = "/var/log/zulip/mirror-log"
else:
f = tempfile.NamedTemporaryFile(prefix="zulip-log.%s." % (options.user,),
delete=False)
log_file = f.name
# Close the file descriptor, since the logging system will
# reopen it anyway.
f.close()
logger = logging.getLogger(__name__)
log_format = "%(asctime)s <initial>: %(message)s"
formatter = logging.Formatter(log_format)
logging.basicConfig(format=log_format)
logger.setLevel(logging.DEBUG)
file_handler = logging.FileHandler(log_file)
file_handler.setFormatter(formatter)
logger.addHandler(file_handler)
return logger
def configure_logger(logger, direction_name):
# type: (logging.Logger, str) -> None
if direction_name is None:
log_format = "%(message)s"
else:
log_format = "%(asctime)s [" + direction_name + "] %(message)s"
formatter = logging.Formatter(log_format)
# Replace the formatters for the file and stdout loggers
for handler in logger.handlers:
handler.setFormatter(formatter)
root_logger = logging.getLogger()
for handler in root_logger.handlers:
handler.setFormatter(formatter)
def parse_args():
# type: () -> Tuple
parser = optparse.OptionParser()
parser.add_option('--forward-class-messages',
default=False,
help=optparse.SUPPRESS_HELP,
action='store_true')
parser.add_option('--shard',
help=optparse.SUPPRESS_HELP)
parser.add_option('--noshard',
default=False,
help=optparse.SUPPRESS_HELP,
action='store_true')
parser.add_option('--resend-log',
dest='logs_to_resend',
help=optparse.SUPPRESS_HELP)
parser.add_option('--enable-resend-log',
dest='resend_log_path',
help=optparse.SUPPRESS_HELP)
parser.add_option('--log-path',
dest='log_path',
help=optparse.SUPPRESS_HELP)
parser.add_option('--stream-file-path',
dest='stream_file_path',
default="/home/zulip/public_streams",
help=optparse.SUPPRESS_HELP)
parser.add_option('--no-forward-personals',
dest='forward_personals',
help=optparse.SUPPRESS_HELP,
default=True,
action='store_false')
parser.add_option('--forward-mail-zephyrs',
dest='forward_mail_zephyrs',
help=optparse.SUPPRESS_HELP,
default=False,
action='store_true')
parser.add_option('--no-forward-from-zulip',
default=True,
dest='forward_from_zulip',
help=optparse.SUPPRESS_HELP,
action='store_false')
parser.add_option('--verbose',
default=False,
help=optparse.SUPPRESS_HELP,
action='store_true')
parser.add_option('--sync-subscriptions',
default=False,
action='store_true')
parser.add_option('--ignore-expired-tickets',
default=False,
action='store_true')
parser.add_option('--site',
default=DEFAULT_SITE,
help=optparse.SUPPRESS_HELP)
parser.add_option('--on-startup-command',
default=None,
help=optparse.SUPPRESS_HELP)
parser.add_option('--user',
default=os.environ["USER"],
help=optparse.SUPPRESS_HELP)
parser.add_option('--root-path',
default="/afs/athena.mit.edu/user/t/a/tabbott/for_friends",
help=optparse.SUPPRESS_HELP)
parser.add_option('--session-path',
default=None,
help=optparse.SUPPRESS_HELP)
parser.add_option('--nagios-class',
default=None,
help=optparse.SUPPRESS_HELP)
parser.add_option('--nagios-path',
default=None,
help=optparse.SUPPRESS_HELP)
parser.add_option('--use-sessions',
default=False,
action='store_true',
help=optparse.SUPPRESS_HELP)
parser.add_option('--test-mode',
default=False,
help=optparse.SUPPRESS_HELP,
action='store_true')
parser.add_option('--api-key-file',
default=os.path.join(os.environ["HOME"], "Private", ".humbug-api-key"))
return parser.parse_args()
def die_gracefully(signal, frame):
# type: (int, FrameType) -> None
if CURRENT_STATE == States.ZulipToZephyr or CURRENT_STATE == States.ChildSending:
# this is a child process, so we want os._exit (no clean-up necessary)
os._exit(1)
if CURRENT_STATE == States.ZephyrToZulip and not options.use_sessions:
try:
# zephyr=>zulip processes may have added subs, so run cancelSubs
zephyr._z.cancelSubs()
except IOError:
# We don't care whether we failed to cancel subs properly, but we should log it
logger.exception("")
sys.exit(1)
if __name__ == "__main__":
# Set the SIGCHLD handler back to SIG_DFL to prevent these errors
# when importing the "requests" module after being restarted using
# the restart_stamp functionality:
#
# close failed in file object destructor:
# IOError: [Errno 10] No child processes
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
signal.signal(signal.SIGINT, die_gracefully)
# The properties available on 'options' are dynamically
# determined, so we have to treat it as an Any for type
# annotations.
(options, args) = parse_args() # type: Any, List[str]
logger = open_logger()
configure_logger(logger, "parent")
# The 'api' directory needs to go first, so that 'import zulip' won't pick
# up some other directory named 'humbug'.
pyzephyr_lib_path = "python-zephyr/build/lib.linux-%s-%s/" % (os.uname()[4], sys.version[0:3])
sys.path[:0] = [os.path.join(options.root_path, 'api'),
options.root_path,
os.path.join(options.root_path, "python-zephyr"),
os.path.join(options.root_path, pyzephyr_lib_path)]
# In case this is an automated restart of the mirroring script,
# and we have lost AFS tokens, first try reading the API key from
# the environment so that we can skip doing a filesystem read.
if os.environ.get("HUMBUG_API_KEY") is not None:
api_key = os.environ.get("HUMBUG_API_KEY")
else:
if not os.path.exists(options.api_key_file):
logger.error("\n" + "\n".join(textwrap.wrap("""\
Could not find API key file.
You need to either place your api key file at %s,
or specify the --api-key-file option.""" % (options.api_key_file,))))
sys.exit(1)
api_key = open(options.api_key_file).read().strip()
# Store the API key in the environment so that our children
# don't need to read it in
os.environ["HUMBUG_API_KEY"] = api_key
if options.nagios_path is None and options.nagios_class is not None:
logger.error("\n" + "nagios_path is required with nagios_class\n")
sys.exit(1)
zulip_account_email = options.user + "@mit.edu"
import zulip
zulip_client = zulip.Client(
email=zulip_account_email,
api_key=api_key,
verbose=True,
client="zephyr_mirror",
site=options.site)
start_time = time.time()
if options.sync_subscriptions:
configure_logger(logger, None) # make the output cleaner
logger.info("Syncing your ~/.zephyr.subs to your Zulip Subscriptions!")
add_zulip_subscriptions(True)
sys.exit(0)
# Kill all zephyr_mirror processes other than this one and its parent.
if not options.test_mode:
pgrep_query = "python.*zephyr_mirror"
if options.shard is not None:
# sharded class mirror
pgrep_query = "%s.*--shard=%s" % (pgrep_query, options.shard)
elif options.user is not None:
# Personals mirror on behalf of another user.
pgrep_query = "%s.*--user=%s" % (pgrep_query, options.user)
proc = subprocess.Popen(['pgrep', '-U', os.environ["USER"], "-f", pgrep_query],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, _err_unused = proc.communicate()
for pid in map(int, out.split()):
if pid == os.getpid() or pid == os.getppid():
continue
# Another copy of zephyr_mirror.py! Kill it.
logger.info("Killing duplicate zephyr_mirror process %s" % (pid,))
try:
os.kill(pid, signal.SIGINT)
except OSError:
# We don't care if the target process no longer exists, so just log the error
logger.exception("")
if options.shard is not None and set(options.shard) != set("a"):
# The shard that is all "a"s is the one that handles personals
# forwarding and zulip => zephyr forwarding
options.forward_personals = False
options.forward_from_zulip = False
if options.forward_mail_zephyrs is None:
options.forward_mail_zephyrs = subscribed_to_mail_messages()
if options.session_path is None:
options.session_path = "/var/tmp/%s" % (options.user,)
if options.forward_from_zulip:
child_pid = os.fork() # type: int
if child_pid == 0:
CURRENT_STATE = States.ZulipToZephyr
# Run the zulip => zephyr mirror in the child
configure_logger(logger, "zulip=>zephyr")
zulip_to_zephyr(options)
sys.exit(0)
else:
child_pid = None
CURRENT_STATE = States.ZephyrToZulip
import zephyr
logger_name = "zephyr=>zulip"
if options.shard is not None:
logger_name += "(%s)" % (options.shard,)
configure_logger(logger, logger_name)
# Have the kernel reap children for when we fork off processes to send Zulips
signal.signal(signal.SIGCHLD, signal.SIG_IGN)
zephyr_to_zulip(options)
|
apache-2.0
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
3,
1898,
334,
35,
9,
6029,
3107,
11294,
12,
3277,
14,
199,
3,
199,
3,
8779,
365,
11882,
10009,
12,
2867,
402,
11204,
12,
370,
1263,
4954,
199,
3,
12408,
282,
1331,
402,
642,
2032,
436,
4568,
3794,
1584,
199,
3,
334,
1589,
298,
10337,
1288,
370,
7962,
315,
314,
2290,
1928,
10588,
12,
199,
3,
5893,
1928,
12305,
314,
4481,
370,
675,
12,
1331,
12,
2811,
12,
5389,
12,
199,
3,
2780,
12,
11207,
12,
13473,
12,
436,
15,
269,
12743,
6866,
402,
314,
2290,
12,
199,
3,
436,
370,
11291,
12103,
370,
12676,
314,
2290,
365,
13985,
370,
886,
880,
12,
199,
3,
5420,
370,
314,
2569,
3704,
26,
199,
3,
199,
3,
710,
3432,
4248,
4245,
436,
642,
4983,
4245,
10989,
506,
199,
3,
5120,
315,
1006,
6866,
503,
13393,
12468,
402,
314,
2290,
14,
199,
3,
199,
3,
2334,
4141,
2281,
7049,
298,
1179,
2281,
401,
2428,
3408,
1634,
1821,
3826,
12,
199,
3,
7168,
1549,
5292,
12,
6931,
5400,
2845,
5471,
2296,
2334,
2990,
1634,
199,
3,
3169,
12,
3092,
2381,
437,
3115,
3104,
2401,
199,
3,
13229,
14,
1621,
4825,
6461,
7000,
2334,
10610,
1549,
5877,
8164,
199,
3,
6262,
7024,
2381,
1821,
13140,
12,
6736,
1549,
5010,
5603,
12,
7061,
1621,
1261,
199,
3,
9612,
1634,
7066,
12,
7056,
1549,
7334,
12,
7043,
4442,
12,
5738,
1634,
1549,
1621,
199,
3,
11287,
1663,
2334,
4141,
1549,
2334,
4815,
1549,
5010,
13198,
1621,
2334,
199,
3,
4141,
14,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
14090,
492,
5004,
12,
6184,
12,
4516,
12,
15961,
12,
2494,
12,
11634,
199,
504,
2943,
492,
11726,
804,
199,
199,
646,
984,
199,
504,
3816,
14,
4912,
492,
2341,
199,
504,
3816,
14,
4912,
492,
1425,
199,
893,
26,
272,
492,
13804,
199,
2590,
3545,
26,
272,
492,
2022,
465,
13804,
327,
730,
26,
3686,
199,
646,
295,
199,
646,
900,
199,
646,
3873,
199,
646,
8691,
199,
646,
747,
199,
646,
2197,
199,
646,
13390,
199,
646,
4673,
199,
646,
2050,
199,
646,
8337,
199,
646,
5549,
199,
646,
3504,
199,
199,
3472,
63,
7917,
275,
298,
2859,
921,
1246,
14,
14548,
14,
957,
2,
199,
199,
533,
24230,
8,
785,
304,
272,
7707,
384,
12,
3107,
11294,
1378,
58,
69,
32248,
12,
3107,
69,
32248,
1378,
58,
11294,
12,
12988,
27219,
275,
769,
8,
1842,
8,
20,
430,
199,
14211,
63,
6689,
275,
24230,
14,
18515,
199,
199,
2921,
275,
488,
327,
730,
26,
2050,
14,
4455,
199,
199,
318,
370,
63,
14548,
63,
2473,
8,
806,
32248,
63,
2473,
304,
272,
327,
730,
26,
334,
495,
9,
1035,
620,
272,
340,
9244,
2,
315,
29986,
32248,
63,
2473,
26,
267,
334,
751,
12,
10482,
9,
275,
29986,
32248,
63,
2473,
14,
1294,
25915,
531,
272,
587,
26,
267,
334,
751,
12,
10482,
9,
275,
334,
806,
32248,
63,
2473,
12,
298,
11695,
742,
33,
14,
13965,
14,
1149,
53,
531,
272,
340,
10482,
14,
4142,
342,
508,
298,
11695,
742,
33,
14,
13965,
14,
1149,
53,
582,
267,
327,
30802,
370,
1852,
286,
5019,
1159,
4026,
3434,
3272,
1736,
32428,
267,
340,
922,
14,
2325,
342,
508,
283,
1939,
3701,
356,
288,
922,
275,
283,
8077,
7,
267,
372,
922,
14,
2325,
342,
435,
9244,
1147,
14,
8654,
2,
272,
372,
922,
14,
2325,
342,
435,
15733,
2,
435,
10482,
14,
4142,
342,
435,
9244,
1147,
14,
8654,
2,
199,
199,
318,
370,
63,
806,
32248,
63,
2473,
8,
14548,
63,
2473,
304,
272,
327,
730,
26,
334,
495,
9,
1035,
620,
272,
334,
751,
12,
10482,
9,
275,
1315,
11294,
63,
2473,
14,
1294,
25915,
531,
272,
340,
15733,
2,
440,
315,
922,
26,
267,
327,
30802,
370,
1852,
286,
5019,
1159,
4026,
3434,
3272,
1736,
32428,
267,
340,
922,
14,
2325,
342,
508,
283,
8077,
356,
288,
922,
275,
283,
1939,
3701,
7,
267,
372,
922,
14,
2325,
342,
435,
9244,
11695,
742,
33,
14,
13965,
14,
1149,
53,
2,
272,
1336,
63,
751,
275,
295,
14,
1431,
8,
82,
21731,
65,
13,
6353,
13,
58,
16,
13,
25,
63,
18096,
92,
8,
6977,
3196,
922,
9,
272,
340,
440,
1336,
63,
751,
26,
267,
746,
2186,
480,
6531,
440,
2198,
3107,
69,
32248,
10482,
367,
8059,
13,
7728,
922,
450,
83,
2,
450,
334,
14548,
63,
2473,
4641,
272,
372,
1336,
63,
751,
14,
923,
8,
17,
680,
2325,
342,
435,
9244,
2,
435,
1336,
63,
751,
14,
923,
8,
18,
680,
4142,
342,
199,
199,
3,
13813,
3775,
314,
4092,
402,
24113,
2385,
3955,
1172,
2757,
199,
3,
7403,
546,
1330,
1915,
10451,
12,
10530,
2985,
2757,
11619,
370,
506,
4184,
402,
314,
2011,
199,
3,
13168,
14,
221,
25119,
1104,
365,
3775,
340,
1265,
4057,
314,
1642,
4349,
641,
314,
199,
3,
499,
977,
1004,
14602,
314,
1642,
1004,
12,
314,
9183,
1004,
365,
1902,
334,
17,
9,
199,
3,
16474,
590,
18299,
2419,
314,
2569,
1004,
334,
6777,
12,
340,
2985,
4898,
199,
3,
315,
314,
2011,
13168,
12,
1077,
1172,
2757,
8072,
315,
282,
4340,
12137,
199,
3,
543,
4212,
314,
4136,
1004,
1990,
8072,
9,
503,
334,
18,
9,
18299,
2419,
5212,
199,
3,
4110,
334,
567,
10826,
7481,
7403,
546,
15521,
8765,
367,
3107,
69,
32248,
9,
199,
3,
503,
334,
19,
9,
314,
1642,
4349,
402,
314,
2163,
1004,
365,
8088,
2419,
642,
8039,
199,
3,
1004,
14,
199,
318,
3365,
63,
12400,
8,
604,
12,
2163,
63,
604,
304,
272,
327,
730,
26,
334,
495,
12,
620,
9,
1035,
2155,
272,
5932,
275,
2163,
63,
604,
14,
1294,
342,
272,
372,
334,
552,
8,
604,
435,
298,
298,
435,
5932,
59,
16,
566,
665,
822,
8,
2184,
63,
604,
9,
627,
378,
14,
24,
503,
288,
822,
8,
604,
435,
298,
298,
435,
5932,
59,
16,
566,
665,
5238,
503,
288,
822,
8,
604,
9,
665,
822,
8,
3148,
59,
16,
2459,
199,
199,
3,
29730,
546,
15521,
5563,
4079,
641,
26,
199,
3,
1455,
921,
71,
2894,
287,
28287,
14,
1027,
2915,
14,
957,
15,
8128,
15,
1780,
15,
1644,
15,
65,
13,
6815,
13
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
3,
1898,
334,
35,
9,
6029,
3107,
11294,
12,
3277,
14,
199,
3,
199,
3,
8779,
365,
11882,
10009,
12,
2867,
402,
11204,
12,
370,
1263,
4954,
199,
3,
12408,
282,
1331,
402,
642,
2032,
436,
4568,
3794,
1584,
199,
3,
334,
1589,
298,
10337,
1288,
370,
7962,
315,
314,
2290,
1928,
10588,
12,
199,
3,
5893,
1928,
12305,
314,
4481,
370,
675,
12,
1331,
12,
2811,
12,
5389,
12,
199,
3,
2780,
12,
11207,
12,
13473,
12,
436,
15,
269,
12743,
6866,
402,
314,
2290,
12,
199,
3,
436,
370,
11291,
12103,
370,
12676,
314,
2290,
365,
13985,
370,
886,
880,
12,
199,
3,
5420,
370,
314,
2569,
3704,
26,
199,
3,
199,
3,
710,
3432,
4248,
4245,
436,
642,
4983,
4245,
10989,
506,
199,
3,
5120,
315,
1006,
6866,
503,
13393,
12468,
402,
314,
2290,
14,
199,
3,
199,
3,
2334,
4141,
2281,
7049,
298,
1179,
2281,
401,
2428,
3408,
1634,
1821,
3826,
12,
199,
3,
7168,
1549,
5292,
12,
6931,
5400,
2845,
5471,
2296,
2334,
2990,
1634,
199,
3,
3169,
12,
3092,
2381,
437,
3115,
3104,
2401,
199,
3,
13229,
14,
1621,
4825,
6461,
7000,
2334,
10610,
1549,
5877,
8164,
199,
3,
6262,
7024,
2381,
1821,
13140,
12,
6736,
1549,
5010,
5603,
12,
7061,
1621,
1261,
199,
3,
9612,
1634,
7066,
12,
7056,
1549,
7334,
12,
7043,
4442,
12,
5738,
1634,
1549,
1621,
199,
3,
11287,
1663,
2334,
4141,
1549,
2334,
4815,
1549,
5010,
13198,
1621,
2334,
199,
3,
4141,
14,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
14090,
492,
5004,
12,
6184,
12,
4516,
12,
15961,
12,
2494,
12,
11634,
199,
504,
2943,
492,
11726,
804,
199,
199,
646,
984,
199,
504,
3816,
14,
4912,
492,
2341,
199,
504,
3816,
14,
4912,
492,
1425,
199,
893,
26,
272,
492,
13804,
199,
2590,
3545,
26,
272,
492,
2022,
465,
13804,
327,
730,
26,
3686,
199,
646,
295,
199,
646,
900,
199,
646,
3873,
199,
646,
8691,
199,
646,
747,
199,
646,
2197,
199,
646,
13390,
199,
646,
4673,
199,
646,
2050,
199,
646,
8337,
199,
646,
5549,
199,
646,
3504,
199,
199,
3472,
63,
7917,
275,
298,
2859,
921,
1246,
14,
14548,
14,
957,
2,
199,
199,
533,
24230,
8,
785,
304,
272,
7707,
384,
12,
3107,
11294,
1378,
58,
69,
32248,
12,
3107,
69,
32248,
1378,
58,
11294,
12,
12988,
27219,
275,
769,
8,
1842,
8,
20,
430,
199,
14211,
63,
6689,
275,
24230,
14,
18515,
199,
199,
2921,
275,
488,
327,
730,
26,
2050,
14,
4455,
199,
199,
318,
370,
63,
14548,
63,
2473,
8,
806,
32248,
63,
2473,
304,
272,
327,
730,
26,
334,
495,
9,
1035,
620,
272,
340,
9244,
2,
315,
29986,
32248,
63,
2473,
26,
267,
334,
751,
12,
10482,
9,
275,
29986,
32248,
63,
2473,
14,
1294,
25915,
531,
272,
587,
26,
267,
334,
751,
12,
10482,
9,
275,
334,
806,
32248,
63,
2473,
12,
298,
11695,
742,
33,
14,
13965,
14,
1149,
53,
531,
272,
340,
10482,
14,
4142,
342,
508,
298,
11695,
742,
33,
14,
13965,
14,
1149,
53,
582,
267,
327,
30802,
370,
1852,
286,
5019,
1159,
4026,
3434,
3272,
1736,
32428,
267,
340,
922,
14,
2325,
342,
508,
283,
1939,
3701,
356,
288,
922,
275,
283,
8077,
7,
267,
372,
922,
14,
2325,
342,
435,
9244,
1147,
14,
8654,
2,
272,
372,
922,
14,
2325,
342,
435,
15733,
2,
435,
10482,
14,
4142,
342,
435,
9244,
1147,
14,
8654,
2,
199,
199,
318,
370,
63,
806,
32248,
63,
2473,
8,
14548,
63,
2473,
304,
272,
327,
730,
26,
334,
495,
9,
1035,
620,
272,
334,
751,
12,
10482,
9,
275,
1315,
11294,
63,
2473,
14,
1294,
25915,
531,
272,
340,
15733,
2,
440,
315,
922,
26,
267,
327,
30802,
370,
1852,
286,
5019,
1159,
4026,
3434,
3272,
1736,
32428,
267,
340,
922,
14,
2325,
342,
508,
283,
8077,
356,
288,
922,
275,
283,
1939,
3701,
7,
267,
372,
922,
14,
2325,
342,
435,
9244,
11695,
742,
33,
14,
13965,
14,
1149,
53,
2,
272,
1336,
63,
751,
275,
295,
14,
1431,
8,
82,
21731,
65,
13,
6353,
13,
58,
16,
13,
25,
63,
18096,
92,
8,
6977,
3196,
922,
9,
272,
340,
440,
1336,
63,
751,
26,
267,
746,
2186,
480,
6531,
440,
2198,
3107,
69,
32248,
10482,
367,
8059,
13,
7728,
922,
450,
83,
2,
450,
334,
14548,
63,
2473,
4641,
272,
372,
1336,
63,
751,
14,
923,
8,
17,
680,
2325,
342,
435,
9244,
2,
435,
1336,
63,
751,
14,
923,
8,
18,
680,
4142,
342,
199,
199,
3,
13813,
3775,
314,
4092,
402,
24113,
2385,
3955,
1172,
2757,
199,
3,
7403,
546,
1330,
1915,
10451,
12,
10530,
2985,
2757,
11619,
370,
506,
4184,
402,
314,
2011,
199,
3,
13168,
14,
221,
25119,
1104,
365,
3775,
340,
1265,
4057,
314,
1642,
4349,
641,
314,
199,
3,
499,
977,
1004,
14602,
314,
1642,
1004,
12,
314,
9183,
1004,
365,
1902,
334,
17,
9,
199,
3,
16474,
590,
18299,
2419,
314,
2569,
1004,
334,
6777,
12,
340,
2985,
4898,
199,
3,
315,
314,
2011,
13168,
12,
1077,
1172,
2757,
8072,
315,
282,
4340,
12137,
199,
3,
543,
4212,
314,
4136,
1004,
1990,
8072,
9,
503,
334,
18,
9,
18299,
2419,
5212,
199,
3,
4110,
334,
567,
10826,
7481,
7403,
546,
15521,
8765,
367,
3107,
69,
32248,
9,
199,
3,
503,
334,
19,
9,
314,
1642,
4349,
402,
314,
2163,
1004,
365,
8088,
2419,
642,
8039,
199,
3,
1004,
14,
199,
318,
3365,
63,
12400,
8,
604,
12,
2163,
63,
604,
304,
272,
327,
730,
26,
334,
495,
12,
620,
9,
1035,
2155,
272,
5932,
275,
2163,
63,
604,
14,
1294,
342,
272,
372,
334,
552,
8,
604,
435,
298,
298,
435,
5932,
59,
16,
566,
665,
822,
8,
2184,
63,
604,
9,
627,
378,
14,
24,
503,
288,
822,
8,
604,
435,
298,
298,
435,
5932,
59,
16,
566,
665,
5238,
503,
288,
822,
8,
604,
9,
665,
822,
8,
3148,
59,
16,
2459,
199,
199,
3,
29730,
546,
15521,
5563,
4079,
641,
26,
199,
3,
1455,
921,
71,
2894,
287,
28287,
14,
1027,
2915,
14,
957,
15,
8128,
15,
1780,
15,
1644,
15,
65,
13,
6815,
13,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
anirudhSK/chromium
|
tools/telemetry/telemetry/page/actions/play_unittest.py
|
2
|
5037
|
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core import util
from telemetry.page.actions import play
from telemetry.unittest import tab_test_case
AUDIO_1_PLAYING_CHECK = 'window.__hasEventCompleted("#audio_1", "playing");'
VIDEO_1_PLAYING_CHECK = 'window.__hasEventCompleted("#video_1", "playing");'
VIDEO_1_ENDED_CHECK = 'window.__hasEventCompleted("#video_1", "ended");'
class PlayActionTest(tab_test_case.TabTestCase):
def setUp(self):
tab_test_case.TabTestCase.setUp(self)
self.Navigate('video_test.html')
def testPlayWithNoSelector(self):
"""Tests that with no selector Play action plays first video element."""
data = {'wait_for_playing': True}
action = play.PlayAction(data)
action.WillRunAction(None, self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
self.assertFalse(self._tab.EvaluateJavaScript(AUDIO_1_PLAYING_CHECK))
action.RunAction(None, self._tab)
# Assert only first video has played.
self.assertTrue(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
self.assertFalse(self._tab.EvaluateJavaScript(AUDIO_1_PLAYING_CHECK))
def testPlayWithVideoSelector(self):
"""Tests that Play action plays video element matching selector."""
data = {'selector': '#video_1', 'wait_for_playing': True}
action = play.PlayAction(data)
action.WillRunAction(None, self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
self.assertFalse(self._tab.EvaluateJavaScript(AUDIO_1_PLAYING_CHECK))
action.RunAction(None, self._tab)
# Assert only video matching selector has played.
self.assertTrue(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
self.assertFalse(self._tab.EvaluateJavaScript(AUDIO_1_PLAYING_CHECK))
def testPlayWithAllSelector(self):
"""Tests that Play action plays all video elements with selector='all'."""
data = {'selector': 'all', 'wait_for_playing': True}
action = play.PlayAction(data)
action.WillRunAction(None, self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
self.assertFalse(self._tab.EvaluateJavaScript(AUDIO_1_PLAYING_CHECK))
action.RunAction(None, self._tab)
# Assert all media elements played.
self.assertTrue(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
self.assertTrue(self._tab.EvaluateJavaScript(AUDIO_1_PLAYING_CHECK))
# http://crbug.com/273887
def testPlayWaitForPlayTimeout(self):
"""Tests that wait_for_playing timeouts if video does not play."""
data = {'selector': '#video_1',
'wait_for_playing': True,
'wait_timeout': 1}
action = play.PlayAction(data)
action.WillRunAction(None, self._tab)
self._tab.EvaluateJavaScript('document.getElementById("video_1").src = ""')
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
self.assertRaises(util.TimeoutException, action.RunAction, None, self._tab)
def testPlayWaitForEnded(self):
"""Tests that wait_for_ended waits for video to end."""
data = {'selector': '#video_1', 'wait_for_ended': True}
action = play.PlayAction(data)
action.WillRunAction(None, self._tab)
# Assert video not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_ENDED_CHECK))
action.RunAction(None, self._tab)
# Assert video ended.
self.assertTrue(self._tab.EvaluateJavaScript(VIDEO_1_ENDED_CHECK))
def testPlayWithoutWaitForEnded(self):
"""Tests that wait_for_ended waits for video to end."""
data = {'selector': '#video_1', 'wait_for_ended': False}
action = play.PlayAction(data)
action.WillRunAction(None, self._tab)
# Assert video not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_ENDED_CHECK))
action.RunAction(None, self._tab)
# Assert video did not end.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_ENDED_CHECK))
def testPlayWaitForEndedTimeout(self):
"""Tests that action raises exception if timeout is reached."""
data = {'selector': '#video_1', 'wait_for_ended': True, 'wait_timeout': 1}
action = play.PlayAction(data)
action.WillRunAction(None, self._tab)
# Assert video not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_ENDED_CHECK))
self.assertRaises(util.TimeoutException, action.RunAction, None, self._tab)
# Assert video did not end.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_ENDED_CHECK))
|
bsd-3-clause
|
[
3,
1898,
6171,
710,
12051,
6642,
14,
2900,
4481,
4644,
14,
199,
3,
3645,
402,
642,
1350,
1233,
365,
10413,
701,
282,
6289,
13,
2487,
4190,
626,
883,
506,
199,
3,
1911,
315,
314,
5113,
570,
14,
199,
199,
504,
17298,
14,
1018,
492,
4884,
199,
504,
17298,
14,
1606,
14,
3723,
492,
5232,
199,
504,
17298,
14,
2796,
492,
5174,
63,
396,
63,
2546,
199,
199,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
275,
283,
3806,
855,
1989,
2390,
19908,
10064,
8130,
63,
17,
401,
298,
22224,
3547,
7,
199,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
275,
283,
3806,
855,
1989,
2390,
19908,
10064,
3722,
63,
17,
401,
298,
22224,
3547,
7,
199,
20142,
63,
17,
63,
25518,
63,
8936,
275,
283,
3806,
855,
1989,
2390,
19908,
10064,
3722,
63,
17,
401,
298,
8960,
3547,
7,
421,
199,
533,
16527,
3310,
774,
8,
2902,
63,
396,
63,
2546,
14,
7690,
1746,
304,
819,
347,
3613,
8,
277,
304,
272,
5174,
63,
396,
63,
2546,
14,
7690,
1746,
14,
5996,
8,
277,
9,
272,
291,
14,
31914,
360,
3722,
63,
396,
14,
1360,
358,
819,
347,
511,
9651,
3007,
1944,
11212,
8,
277,
304,
272,
408,
2925,
626,
543,
949,
9759,
16527,
1595,
299,
9316,
1642,
3991,
1819,
1041,
272,
666,
275,
791,
2573,
63,
509,
63,
22224,
356,
715,
93,
272,
1595,
275,
5232,
14,
9651,
3310,
8,
576,
9,
272,
1595,
14,
20326,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
17650,
22010,
440,
25692,
2544,
3879,
1595,
14,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
1595,
14,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
10716,
1454,
1642,
3991,
965,
5232,
379,
14,
272,
291,
14,
1815,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
819,
347,
511,
9651,
3007,
9166,
11212,
8,
277,
304,
272,
408,
2925,
626,
16527,
1595,
299,
9316,
3991,
1819,
4877,
9759,
1041,
272,
666,
275,
791,
6662,
356,
3943,
3722,
63,
17,
297,
283,
2573,
63,
509,
63,
22224,
356,
715,
93,
272,
1595,
275,
5232,
14,
9651,
3310,
8,
576,
9,
272,
1595,
14,
20326,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
17650,
22010,
440,
25692,
2544,
3879,
1595,
14,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
1595,
14,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
10716,
1454,
3991,
4877,
9759,
965,
5232,
379,
14,
272,
291,
14,
1815,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
819,
347,
511,
9651,
3007,
2422,
11212,
8,
277,
304,
272,
408,
2925,
626,
16527,
1595,
299,
9316,
1006,
3991,
4008,
543,
9759,
534,
452,
23690,
272,
666,
275,
791,
6662,
356,
283,
452,
297,
283,
2573,
63,
509,
63,
22224,
356,
715,
93,
272,
1595,
275,
5232,
14,
9651,
3310,
8,
576,
9,
272,
1595,
14,
20326,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
17650,
22010,
440,
25692,
2544,
3879,
1595,
14,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
1595,
14,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
10716,
1006,
5898,
4008,
5232,
379,
14,
272,
291,
14,
1815,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
1815,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
819,
327,
1455,
921,
1556,
1266,
14,
957,
15,
1465,
11403,
23,
523,
347,
511,
9651,
21433,
9651,
6372,
8,
277,
304,
272,
408,
2925,
626,
3618,
63,
509,
63,
22224,
25870,
340,
3991,
1630,
440,
5232,
1041,
272,
666,
275,
791,
6662,
356,
3943,
3722,
63,
17,
297,
288,
283,
2573,
63,
509,
63,
22224,
356,
715,
12,
288,
283,
2573,
63,
2593,
356,
413,
93,
272,
1595,
275,
5232,
14,
9651,
3310,
8,
576,
9,
272,
1595,
14,
20326,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
291,
423,
2902,
14,
25002,
21986,
360,
3554,
14,
26215,
480,
3722,
63,
17,
3471,
2164,
275,
3087,
358,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
1855,
8,
1974,
14,
6372,
1726,
12,
1595,
14,
2540,
3310,
12,
488,
12,
291,
423,
2902,
9,
819,
347,
511,
9651,
21433,
32615,
8,
277,
304,
272,
408,
2925,
626,
3618,
63,
509,
63,
8960,
14442,
1405,
367,
3991,
370,
1284,
1041,
272,
666,
275,
791,
6662,
356,
3943,
3722,
63,
17,
297,
283,
2573,
63,
509,
63,
8960,
356,
715,
93,
272,
1595,
275,
5232,
14,
9651,
3310,
8,
576,
9,
272,
1595,
14,
20326,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
10716,
3991,
440,
25692,
2544,
3879,
1595,
14,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
25518,
63,
8936,
430,
272,
1595,
14,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
10716,
3991,
22480,
14,
272,
291,
14,
1815,
8,
277,
423
] |
[
1898,
6171,
710,
12051,
6642,
14,
2900,
4481,
4644,
14,
199,
3,
3645,
402,
642,
1350,
1233,
365,
10413,
701,
282,
6289,
13,
2487,
4190,
626,
883,
506,
199,
3,
1911,
315,
314,
5113,
570,
14,
199,
199,
504,
17298,
14,
1018,
492,
4884,
199,
504,
17298,
14,
1606,
14,
3723,
492,
5232,
199,
504,
17298,
14,
2796,
492,
5174,
63,
396,
63,
2546,
199,
199,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
275,
283,
3806,
855,
1989,
2390,
19908,
10064,
8130,
63,
17,
401,
298,
22224,
3547,
7,
199,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
275,
283,
3806,
855,
1989,
2390,
19908,
10064,
3722,
63,
17,
401,
298,
22224,
3547,
7,
199,
20142,
63,
17,
63,
25518,
63,
8936,
275,
283,
3806,
855,
1989,
2390,
19908,
10064,
3722,
63,
17,
401,
298,
8960,
3547,
7,
421,
199,
533,
16527,
3310,
774,
8,
2902,
63,
396,
63,
2546,
14,
7690,
1746,
304,
819,
347,
3613,
8,
277,
304,
272,
5174,
63,
396,
63,
2546,
14,
7690,
1746,
14,
5996,
8,
277,
9,
272,
291,
14,
31914,
360,
3722,
63,
396,
14,
1360,
358,
819,
347,
511,
9651,
3007,
1944,
11212,
8,
277,
304,
272,
408,
2925,
626,
543,
949,
9759,
16527,
1595,
299,
9316,
1642,
3991,
1819,
1041,
272,
666,
275,
791,
2573,
63,
509,
63,
22224,
356,
715,
93,
272,
1595,
275,
5232,
14,
9651,
3310,
8,
576,
9,
272,
1595,
14,
20326,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
17650,
22010,
440,
25692,
2544,
3879,
1595,
14,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
1595,
14,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
10716,
1454,
1642,
3991,
965,
5232,
379,
14,
272,
291,
14,
1815,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
819,
347,
511,
9651,
3007,
9166,
11212,
8,
277,
304,
272,
408,
2925,
626,
16527,
1595,
299,
9316,
3991,
1819,
4877,
9759,
1041,
272,
666,
275,
791,
6662,
356,
3943,
3722,
63,
17,
297,
283,
2573,
63,
509,
63,
22224,
356,
715,
93,
272,
1595,
275,
5232,
14,
9651,
3310,
8,
576,
9,
272,
1595,
14,
20326,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
17650,
22010,
440,
25692,
2544,
3879,
1595,
14,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
1595,
14,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
10716,
1454,
3991,
4877,
9759,
965,
5232,
379,
14,
272,
291,
14,
1815,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
819,
347,
511,
9651,
3007,
2422,
11212,
8,
277,
304,
272,
408,
2925,
626,
16527,
1595,
299,
9316,
1006,
3991,
4008,
543,
9759,
534,
452,
23690,
272,
666,
275,
791,
6662,
356,
283,
452,
297,
283,
2573,
63,
509,
63,
22224,
356,
715,
93,
272,
1595,
275,
5232,
14,
9651,
3310,
8,
576,
9,
272,
1595,
14,
20326,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
17650,
22010,
440,
25692,
2544,
3879,
1595,
14,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
1595,
14,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
10716,
1006,
5898,
4008,
5232,
379,
14,
272,
291,
14,
1815,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
1815,
8,
277,
423,
2902,
14,
25002,
21986,
8,
27743,
63,
17,
63,
11625,
1206,
63,
8936,
430,
819,
327,
1455,
921,
1556,
1266,
14,
957,
15,
1465,
11403,
23,
523,
347,
511,
9651,
21433,
9651,
6372,
8,
277,
304,
272,
408,
2925,
626,
3618,
63,
509,
63,
22224,
25870,
340,
3991,
1630,
440,
5232,
1041,
272,
666,
275,
791,
6662,
356,
3943,
3722,
63,
17,
297,
288,
283,
2573,
63,
509,
63,
22224,
356,
715,
12,
288,
283,
2573,
63,
2593,
356,
413,
93,
272,
1595,
275,
5232,
14,
9651,
3310,
8,
576,
9,
272,
1595,
14,
20326,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
291,
423,
2902,
14,
25002,
21986,
360,
3554,
14,
26215,
480,
3722,
63,
17,
3471,
2164,
275,
3087,
358,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
1855,
8,
1974,
14,
6372,
1726,
12,
1595,
14,
2540,
3310,
12,
488,
12,
291,
423,
2902,
9,
819,
347,
511,
9651,
21433,
32615,
8,
277,
304,
272,
408,
2925,
626,
3618,
63,
509,
63,
8960,
14442,
1405,
367,
3991,
370,
1284,
1041,
272,
666,
275,
791,
6662,
356,
3943,
3722,
63,
17,
297,
283,
2573,
63,
509,
63,
8960,
356,
715,
93,
272,
1595,
275,
5232,
14,
9651,
3310,
8,
576,
9,
272,
1595,
14,
20326,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
10716,
3991,
440,
25692,
2544,
3879,
1595,
14,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
11625,
1206,
63,
8936,
430,
272,
291,
14,
3334,
8,
277,
423,
2902,
14,
25002,
21986,
8,
20142,
63,
17,
63,
25518,
63,
8936,
430,
272,
1595,
14,
2540,
3310,
8,
403,
12,
291,
423,
2902,
9,
272,
327,
10716,
3991,
22480,
14,
272,
291,
14,
1815,
8,
277,
423,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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from __future__ import unicode_literals, division, absolute_import, print_function
import imp
import sys
import os
from . import build_root, package_name, package_root
if sys.version_info < (3,):
getcwd = os.getcwdu
else:
getcwd = os.getcwd
def _import_from(mod, path, mod_dir=None, allow_error=False):
"""
Imports a module from a specific path
:param mod:
A unicode string of the module name
:param path:
A unicode string to the directory containing the module
:param mod_dir:
If the sub directory of "path" is different than the "mod" name,
pass the sub directory as a unicode string
:param allow_error:
If an ImportError should be raised when the module can't be imported
:return:
None if not loaded, otherwise the module
"""
if mod_dir is None:
mod_dir = mod.replace('.', os.sep)
if not os.path.exists(path):
return None
if not os.path.exists(os.path.join(path, mod_dir)) \
and not os.path.exists(os.path.join(path, mod_dir + '.py')):
return None
if os.sep in mod_dir:
append, mod_dir = mod_dir.rsplit(os.sep, 1)
path = os.path.join(path, append)
try:
mod_info = imp.find_module(mod_dir, [path])
return imp.load_module(mod, *mod_info)
except ImportError:
if allow_error:
raise
return None
def _preload(require_oscrypto, print_info):
"""
Preloads asn1crypto and optionally oscrypto from a local source checkout,
or from a normal install
:param require_oscrypto:
A bool if oscrypto needs to be preloaded
:param print_info:
A bool if info about asn1crypto and oscrypto should be printed
"""
if print_info:
print('Working dir: ' + getcwd())
print('Python ' + sys.version.replace('\n', ''))
asn1crypto = None
oscrypto = None
if require_oscrypto:
# Some CI services don't use the package name for the dir
if package_name == 'oscrypto':
oscrypto_dir = package_root
else:
oscrypto_dir = os.path.join(build_root, 'oscrypto')
oscrypto_tests = None
if os.path.exists(oscrypto_dir):
oscrypto_tests = _import_from('oscrypto_tests', oscrypto_dir, 'tests')
if oscrypto_tests is None:
import oscrypto_tests
asn1crypto, oscrypto = oscrypto_tests.local_oscrypto()
else:
if package_name == 'asn1crypto':
asn1crypto_dir = package_root
else:
asn1crypto_dir = os.path.join(build_root, 'asn1crypto')
if os.path.exists(asn1crypto_dir):
asn1crypto = _import_from('asn1crypto', asn1crypto_dir)
if asn1crypto is None:
import asn1crypto
if print_info:
print(
'\nasn1crypto: %s, %s' % (
asn1crypto.__version__,
os.path.dirname(asn1crypto.__file__)
)
)
if require_oscrypto:
print(
'oscrypto: %s backend, %s, %s' % (
oscrypto.backend(),
oscrypto.__version__,
os.path.dirname(oscrypto.__file__)
)
)
|
mit
|
[
3,
2803,
26,
2774,
13,
24,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
12,
4629,
12,
3679,
63,
646,
12,
870,
63,
1593,
199,
199,
646,
1742,
199,
646,
984,
199,
646,
747,
199,
199,
504,
1275,
492,
1900,
63,
1231,
12,
2559,
63,
354,
12,
2559,
63,
1231,
199,
199,
692,
984,
14,
1023,
63,
815,
665,
334,
19,
16095,
272,
664,
6525,
275,
747,
14,
362,
15346,
2033,
199,
2836,
26,
272,
664,
6525,
275,
747,
14,
9458,
421,
199,
318,
485,
646,
63,
504,
8,
1494,
12,
931,
12,
3413,
63,
694,
29,
403,
12,
2040,
63,
705,
29,
797,
304,
272,
408,
272,
24339,
282,
859,
687,
282,
2488,
931,
339,
520,
635,
3413,
26,
267,
437,
2649,
1059,
402,
314,
859,
536,
339,
520,
635,
931,
26,
267,
437,
2649,
1059,
370,
314,
2082,
3035,
314,
859,
339,
520,
635,
3413,
63,
694,
26,
267,
982,
314,
1007,
2082,
402,
298,
515,
2,
365,
3365,
2419,
314,
298,
1494,
2,
536,
12,
267,
986,
314,
1007,
2082,
465,
282,
2649,
1059,
339,
520,
635,
2040,
63,
705,
26,
267,
982,
376,
3545,
1077,
506,
4915,
1380,
314,
859,
883,
1133,
506,
8439,
339,
520,
1107,
26,
267,
488,
340,
440,
6511,
12,
4257,
314,
859,
272,
408,
339,
340,
3413,
63,
694,
365,
488,
26,
267,
3413,
63,
694,
275,
3413,
14,
1814,
14078,
747,
14,
4127,
9,
339,
340,
440,
747,
14,
515,
14,
2444,
8,
515,
304,
267,
372,
488,
339,
340,
440,
747,
14,
515,
14,
2444,
8,
736,
14,
515,
14,
904,
8,
515,
12,
3413,
63,
694,
430,
971,
288,
436,
440,
747,
14,
515,
14,
2444,
8,
736,
14,
515,
14,
904,
8,
515,
12,
3413,
63,
694,
435,
1987,
647,
8109,
267,
372,
488,
339,
340,
747,
14,
4127,
315,
3413,
63,
694,
26,
267,
5666,
12,
3413,
63,
694,
275,
3413,
63,
694,
14,
13490,
8,
736,
14,
4127,
12,
413,
9,
267,
931,
275,
747,
14,
515,
14,
904,
8,
515,
12,
5666,
9,
339,
862,
26,
267,
3413,
63,
815,
275,
1742,
14,
1623,
63,
578,
8,
1494,
63,
694,
12,
359,
515,
566,
267,
372,
1742,
14,
912,
63,
578,
8,
1494,
12,
627,
1494,
63,
815,
9,
272,
871,
3545,
26,
267,
340,
2040,
63,
705,
26,
288,
746,
267,
372,
488,
421,
199,
318,
485,
28795,
8,
4365,
63,
26737,
8131,
12,
870,
63,
815,
304,
272,
408,
272,
5543,
3640,
16723,
17,
10316,
436,
14190,
31920,
8131,
687,
282,
2257,
1350,
15243,
12,
272,
503,
687,
282,
3293,
3907,
339,
520,
635,
4409,
63,
26737,
8131,
26,
267,
437,
2155,
340,
31920,
8131,
4839,
370,
506,
876,
4591,
339,
520,
635,
870,
63,
815,
26,
267,
437,
2155,
340,
2256,
3595,
16723,
17,
10316,
436,
31920,
8131,
1077,
506,
12487,
272,
408,
339,
340,
870,
63,
815,
26,
267,
870,
360,
18356,
2935,
26,
283,
435,
664,
6525,
1012,
267,
870,
360,
4718,
283,
435,
984,
14,
1023,
14,
1814,
2258,
78,
297,
12381,
339,
16723,
17,
10316,
275,
488,
272,
31920,
8131,
275,
488,
339,
340,
4409,
63,
26737,
8131,
26,
267,
327,
6601,
445,
41,
8500,
2793,
1133,
675,
314,
2559,
536,
367,
314,
2935,
267,
340,
2559,
63,
354,
508,
283,
26737,
8131,
356,
288,
31920,
8131,
63,
694,
275,
2559,
63,
1231,
267,
587,
26,
288,
31920,
8131,
63,
694,
275,
747,
14,
515,
14,
904,
8,
1506,
63,
1231,
12,
283,
26737,
8131,
358,
267,
31920,
8131,
63,
2219,
275,
488,
267,
340,
747,
14,
515,
14,
2444,
8,
26737,
8131,
63,
694,
304,
288,
31920,
8131,
63,
2219,
275,
485,
646,
63,
504,
360,
26737,
8131,
63,
2219,
297,
31920,
8131,
63,
694,
12,
283,
2219,
358,
267,
340,
31920,
8131,
63,
2219,
365,
488,
26,
288,
492,
31920,
8131,
63,
2219,
267,
16723,
17,
10316,
12,
31920,
8131,
275,
31920,
8131,
63,
2219,
14,
1832,
63,
26737,
8131,
342,
339,
587,
26,
267,
340,
2559,
63,
354,
508,
283,
6228,
17,
10316,
356,
288,
16723,
17,
10316,
63,
694,
275,
2559,
63,
1231,
267,
587,
26,
288,
16723,
17,
10316,
63,
694,
275,
747,
14,
515,
14,
904,
8,
1506,
63,
1231,
12,
283,
6228,
17,
10316,
358,
267,
340,
747,
14,
515,
14,
2444,
8,
6228,
17,
10316,
63,
694,
304,
288,
16723,
17,
10316,
275,
485,
646,
63,
504,
360,
6228,
17,
10316,
297,
16723,
17,
10316,
63,
694,
9,
267,
340,
16723,
17,
10316,
365,
488,
26,
288,
492,
16723,
17,
10316,
339,
340,
870,
63,
815,
26,
267,
870,
8,
288,
1557,
78,
6228,
17,
10316,
26,
450,
83,
12,
450,
83,
7,
450,
334,
355,
16723,
17,
10316,
855,
1023,
3108,
355,
747,
14,
515,
14,
3475,
8,
6228,
17,
10316,
855,
493,
3368,
288,
776,
267,
776,
267,
340,
4409,
63,
26737,
8131,
26,
288,
870,
8,
355,
283,
26737,
8131,
26,
450,
83,
4865,
12,
450,
83,
12,
450,
83,
7,
450,
334,
490,
31920,
8131,
14,
4620,
1062,
490,
31920,
8131,
855,
1023,
3108,
490,
747,
14,
515,
14,
3475,
8,
26737,
8131,
855,
493,
3368,
355,
776,
288,
776,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2803,
26,
2774,
13,
24,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
12,
4629,
12,
3679,
63,
646,
12,
870,
63,
1593,
199,
199,
646,
1742,
199,
646,
984,
199,
646,
747,
199,
199,
504,
1275,
492,
1900,
63,
1231,
12,
2559,
63,
354,
12,
2559,
63,
1231,
199,
199,
692,
984,
14,
1023,
63,
815,
665,
334,
19,
16095,
272,
664,
6525,
275,
747,
14,
362,
15346,
2033,
199,
2836,
26,
272,
664,
6525,
275,
747,
14,
9458,
421,
199,
318,
485,
646,
63,
504,
8,
1494,
12,
931,
12,
3413,
63,
694,
29,
403,
12,
2040,
63,
705,
29,
797,
304,
272,
408,
272,
24339,
282,
859,
687,
282,
2488,
931,
339,
520,
635,
3413,
26,
267,
437,
2649,
1059,
402,
314,
859,
536,
339,
520,
635,
931,
26,
267,
437,
2649,
1059,
370,
314,
2082,
3035,
314,
859,
339,
520,
635,
3413,
63,
694,
26,
267,
982,
314,
1007,
2082,
402,
298,
515,
2,
365,
3365,
2419,
314,
298,
1494,
2,
536,
12,
267,
986,
314,
1007,
2082,
465,
282,
2649,
1059,
339,
520,
635,
2040,
63,
705,
26,
267,
982,
376,
3545,
1077,
506,
4915,
1380,
314,
859,
883,
1133,
506,
8439,
339,
520,
1107,
26,
267,
488,
340,
440,
6511,
12,
4257,
314,
859,
272,
408,
339,
340,
3413,
63,
694,
365,
488,
26,
267,
3413,
63,
694,
275,
3413,
14,
1814,
14078,
747,
14,
4127,
9,
339,
340,
440,
747,
14,
515,
14,
2444,
8,
515,
304,
267,
372,
488,
339,
340,
440,
747,
14,
515,
14,
2444,
8,
736,
14,
515,
14,
904,
8,
515,
12,
3413,
63,
694,
430,
971,
288,
436,
440,
747,
14,
515,
14,
2444,
8,
736,
14,
515,
14,
904,
8,
515,
12,
3413,
63,
694,
435,
1987,
647,
8109,
267,
372,
488,
339,
340,
747,
14,
4127,
315,
3413,
63,
694,
26,
267,
5666,
12,
3413,
63,
694,
275,
3413,
63,
694,
14,
13490,
8,
736,
14,
4127,
12,
413,
9,
267,
931,
275,
747,
14,
515,
14,
904,
8,
515,
12,
5666,
9,
339,
862,
26,
267,
3413,
63,
815,
275,
1742,
14,
1623,
63,
578,
8,
1494,
63,
694,
12,
359,
515,
566,
267,
372,
1742,
14,
912,
63,
578,
8,
1494,
12,
627,
1494,
63,
815,
9,
272,
871,
3545,
26,
267,
340,
2040,
63,
705,
26,
288,
746,
267,
372,
488,
421,
199,
318,
485,
28795,
8,
4365,
63,
26737,
8131,
12,
870,
63,
815,
304,
272,
408,
272,
5543,
3640,
16723,
17,
10316,
436,
14190,
31920,
8131,
687,
282,
2257,
1350,
15243,
12,
272,
503,
687,
282,
3293,
3907,
339,
520,
635,
4409,
63,
26737,
8131,
26,
267,
437,
2155,
340,
31920,
8131,
4839,
370,
506,
876,
4591,
339,
520,
635,
870,
63,
815,
26,
267,
437,
2155,
340,
2256,
3595,
16723,
17,
10316,
436,
31920,
8131,
1077,
506,
12487,
272,
408,
339,
340,
870,
63,
815,
26,
267,
870,
360,
18356,
2935,
26,
283,
435,
664,
6525,
1012,
267,
870,
360,
4718,
283,
435,
984,
14,
1023,
14,
1814,
2258,
78,
297,
12381,
339,
16723,
17,
10316,
275,
488,
272,
31920,
8131,
275,
488,
339,
340,
4409,
63,
26737,
8131,
26,
267,
327,
6601,
445,
41,
8500,
2793,
1133,
675,
314,
2559,
536,
367,
314,
2935,
267,
340,
2559,
63,
354,
508,
283,
26737,
8131,
356,
288,
31920,
8131,
63,
694,
275,
2559,
63,
1231,
267,
587,
26,
288,
31920,
8131,
63,
694,
275,
747,
14,
515,
14,
904,
8,
1506,
63,
1231,
12,
283,
26737,
8131,
358,
267,
31920,
8131,
63,
2219,
275,
488,
267,
340,
747,
14,
515,
14,
2444,
8,
26737,
8131,
63,
694,
304,
288,
31920,
8131,
63,
2219,
275,
485,
646,
63,
504,
360,
26737,
8131,
63,
2219,
297,
31920,
8131,
63,
694,
12,
283,
2219,
358,
267,
340,
31920,
8131,
63,
2219,
365,
488,
26,
288,
492,
31920,
8131,
63,
2219,
267,
16723,
17,
10316,
12,
31920,
8131,
275,
31920,
8131,
63,
2219,
14,
1832,
63,
26737,
8131,
342,
339,
587,
26,
267,
340,
2559,
63,
354,
508,
283,
6228,
17,
10316,
356,
288,
16723,
17,
10316,
63,
694,
275,
2559,
63,
1231,
267,
587,
26,
288,
16723,
17,
10316,
63,
694,
275,
747,
14,
515,
14,
904,
8,
1506,
63,
1231,
12,
283,
6228,
17,
10316,
358,
267,
340,
747,
14,
515,
14,
2444,
8,
6228,
17,
10316,
63,
694,
304,
288,
16723,
17,
10316,
275,
485,
646,
63,
504,
360,
6228,
17,
10316,
297,
16723,
17,
10316,
63,
694,
9,
267,
340,
16723,
17,
10316,
365,
488,
26,
288,
492,
16723,
17,
10316,
339,
340,
870,
63,
815,
26,
267,
870,
8,
288,
1557,
78,
6228,
17,
10316,
26,
450,
83,
12,
450,
83,
7,
450,
334,
355,
16723,
17,
10316,
855,
1023,
3108,
355,
747,
14,
515,
14,
3475,
8,
6228,
17,
10316,
855,
493,
3368,
288,
776,
267,
776,
267,
340,
4409,
63,
26737,
8131,
26,
288,
870,
8,
355,
283,
26737,
8131,
26,
450,
83,
4865,
12,
450,
83,
12,
450,
83,
7,
450,
334,
490,
31920,
8131,
14,
4620,
1062,
490,
31920,
8131,
855,
1023,
3108,
490,
747,
14,
515,
14,
3475,
8,
26737,
8131,
855,
493,
3368,
355,
776,
288,
776,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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API at https://wordsapi.com"""
pretty_print_error = ValueError('You must enter \'on\' or \'off\' to toggle the pretty print setting. Please enter a valid input.')
detail_error = ValueError('You must choose a valid detail. See https://www.wordsapi.com/docs#details for valid details.')
entry_error = ValueError('You must enter a valid string')
_details = {
'definitions': '{}/definitions',
'synonyms': '{}/synonyms',
'antonyms': '{}/antonyms',
'examples': '{}/examples',
'typeOf': '{}/typeOf',
'hasTypes': '{}/hasTypes',
'partOf': '{}/partOf',
'hasParts': '{}/hasParts',
'instanceOf': '{}/instanceOf',
'hasInstances': '{}/hasInstances',
'similarTo': '{}/similarTo',
'also': '{}/also',
'entails': '{}/entails',
'memberOf': '{}/memberOf',
'hasMembers': '{}/hasMembers',
'substanceOf': '{}/substanceOf',
'hasSubstances': '{}/hasSubstances',
'inCategory': '{}/inCategory',
'hasCategories': '{}/hasCategories',
'usageOf': '{}/usageOf',
'hasUsages': '{}/hasUsages',
'inRegion': '{}/inRegion',
'regionOf': '{}/regionOf',
'pertainsTo': '{}/pertainsTo',
'rhymes': '{}/rhymes',
'frequency': '{}/frequency'
}
def __init__(self, api_key, pretty=None):
self._base_url = 'https://wordsapiv1.p.mashape.com/words/'
self._auth_headers = {'X-Mashape-Key': api_key} #auth against Mashape APIs
self.pretty_print = pretty # pretty print set to False by default for functionality, can be set to True for pretty one-offs
def setPrettyPrint(self, toggle):
if toggle == 'on':
self.pretty_print = True
elif toggle == 'off':
self.pretty_print = False
else:
raise Words.pretty_print_error
def isPrettyPrint(self):
if self.pretty_print:
return True
else:
return False
def _get(self, word, detail):
if word is not type(str):
raise Words.entry_error
if detail not in Words._details:
raise Words.detail_error
url = self._base_url + Words._details[detail].format(word)
query = requests.get(url, headers=self._auth_headers)
if self.isPrettyPrint():
return pprint(query.json())
else:
return query.json()
def random(self):
'''
Returns a random word. No arguments needed.
'''
query = requests.get(self._base_url, params={'random':'true'}, headers=self._auth_headers)
if self.isPrettyPrint():
return pprint(query.json())
else:
return query.json()
def word(self, word):
'''
Retrieves everything that the Words API has on a word.
'''
url = self._base_url + word
query = requests.get(url, headers=self._auth_headers)
if self.isPrettyPrint():
return pprint(query.json())
else:
return query.json()
def definitions(self, word):
'''
The meaning of the word, including its part of speech.
See https://www.wordsapi.com/docs#words for more info.
'''
return self._get(word, 'definitions')
def synonyms(self, word):
'''
Words that can be interchanged for the original word in the same context.
'''
return self._get(word, 'synonyms')
def antonyms(self, word):
'''
Words that have the opposite context of the original word.
'''
return self._get(word, 'antonyms')
def examples(self, word):
'''
Example sentences using the word.
'''
return self._get(word, 'examples')
def typeOf(self, word):
'''
Words that are more generic than the original word. Also known as hypernyms.
For example, a hatchback is a type of car.
'''
return self._get(word, 'typeOf')
def hasTypes(self, word):
'''
Words that are more specific than the original word. Also known as hyponyms.
For example, purple has types violet, lavender, mauve, etc.
'''
return self._get(word, 'hasTypes')
def partOf(self, word):
'''
The larger whole to which this word belongs. Also known as holonyms.
For example, a finger is part of a hand, a glove, a paw, etc.
'''
return self._get(word, 'partOf')
def hasParts(self, word):
'''
Words that are part of the original word. Also known as meronyms.
For example, a building has parts such as roofing, plumbing etc.
'''
return self._get(word, 'hasParts')
def instanceOf(self, word):
'''
Words that the original word is an example of.
For example, Einstein is an instance of a physicist.
'''
return self._get(word, 'instanceOf')
def hasInstances(self, word):
'''
Words that are examples of the original word.
For example, president has instances such as theodore roosevelt, van buren, etc.
'''
return self._get(word, 'hasInstances')
def similarTo(self, word):
'''
Words that similar to the original word, but are not synonyms.
For example, red is similar to bloody.
'''
return self._get(word, 'similarTo')
def also(self, word):
'''
Phrases to which the original word belongs.
For example, bump is used in the phrase bump off.
'''
return self._get(word, 'also')
def entails(self, word):
'''
Words that are implied by the original word. Usually used for verbs.
For example, rub entails touch.
'''
return self._get(word, 'entails')
def memberOf(self, word):
'''
A group to which the original word belongs.
For example, dory is a member of the family zeidae.
'''
return self._get(word, 'memberOf')
def hasMembers(self, word):
'''
Words that belong to the group defined by the original word.
For example, a cult has members called cultists.
'''
return self._get(word, 'hasMembers')
def substanceOf(self, word):
'''
Substances to which the original word is a part of.
For example, water is a substance of sweat.
'''
return self._get(word, 'substanceOf')
def hasSubstance(self, word):
'''
Substances that are part of the original word.
For example, wood has a substance called lignin.
'''
return self._get(word, 'hasSubstance')
def inCategory(self, word):
'''
The domain category to which the original word belongs.
For example, chaotic is in category physics.
'''
return self._get(word, 'inCategory')
def hasCategories(self, word):
'''
Categories of the original word.
For example, math has categories such as algebra, imaginary, numerical analysis, etc.
'''
return self._get(word, 'hasCategories')
def usageOf(self, word):
'''
Words that the original word is a domain usage of.
For example, advil is a useage of the trademark, etc.
'''
return self._get(word, 'usageOf')
def hasUsages(self, word):
'''
Words that are examples of the domain the original word defines.
For example, colloquialism is a domain that includes examples like big deal, blue moon, etc.
'''
return self._get(word, 'hasUsages')
def inRegion(self, word):
'''
Regions where the word is used.
For example, chips is used in region Britain.
'''
return self._get(word, 'inRegion')
def regionOf(self, word):
'''
A region where words are used.
For example, Canada is the region of pogey.
'''
return self._get(word, 'regionOf')
def pertainsTo(self, word):
'''
Words to which the original word is relevant
For example, .22-caliber pertains to caliber.
'''
return self._get(word, 'pertainsTo')
def rhymes(self, word):
'''
See https://www.wordsapi.com/docs#rhymes
'''
return self._get(word, 'rhymes')
def frequency(self, word):
'''
See https://www.wordsapi.com/docs#frequency
'''
return self._get(word, 'frequency')
def search(self, **kwargs):
'''
See https://www.wordsapi.com/docs#search
'''
query = requests.get(self._base_url, params=kwargs, headers=self._auth_headers)
if self.isPrettyPrint():
return pprint(query.json())
else:
return query.json()
|
mit
|
[
3168,
1182,
2647,
15,
1393,
15,
1813,
2366,
199,
199,
646,
4145,
199,
504,
10933,
492,
10933,
199,
199,
533,
644,
5630,
8,
785,
304,
339,
408,
33,
1021,
626,
8386,
543,
314,
644,
5630,
3261,
737,
4178,
921,
3148,
1246,
14,
957,
624,
339,
7268,
63,
1361,
63,
705,
275,
1722,
360,
5556,
1471,
9509,
8891,
265,
3985,
503,
8891,
1997,
3985,
370,
19420,
314,
7268,
870,
4260,
14,
7754,
9509,
282,
1686,
1324,
2659,
272,
10093,
63,
705,
275,
1722,
360,
5556,
1471,
11496,
282,
1686,
10093,
14,
1666,
4178,
921,
1544,
14,
3148,
1246,
14,
957,
15,
4757,
3,
5087,
367,
1686,
2436,
2659,
272,
2397,
63,
705,
275,
1722,
360,
5556,
1471,
9509,
282,
1686,
1059,
358,
339,
485,
5087,
275,
469,
288,
283,
15388,
356,
221,
9005,
15,
15388,
297,
288,
283,
9466,
5220,
706,
356,
258,
9005,
15,
9466,
5220,
706,
297,
288,
283,
867,
5220,
706,
356,
258,
9005,
15,
867,
5220,
706,
297,
288,
283,
8589,
356,
258,
9005,
15,
8589,
297,
288,
283,
466,
3466,
356,
755,
9005,
15,
466,
3466,
297,
288,
283,
1989,
4100,
356,
258,
9005,
15,
1989,
4100,
297,
288,
283,
2064,
3466,
356,
755,
9005,
15,
2064,
3466,
297,
288,
283,
1989,
28662,
356,
258,
9005,
15,
1989,
28662,
297,
288,
283,
842,
3466,
356,
257,
9005,
15,
842,
3466,
297,
288,
283,
1989,
18194,
356,
9005,
15,
1989,
18194,
297,
288,
283,
23079,
1378,
356,
259,
9005,
15,
23079,
1378,
297,
288,
283,
12344,
356,
260,
9005,
15,
12344,
297,
288,
283,
484,
1054,
83,
356,
420,
9005,
15,
484,
1054,
83,
297,
288,
283,
1114,
3466,
356,
258,
9005,
15,
1114,
3466,
297,
288,
283,
1989,
23056,
356,
257,
9005,
15,
1989,
23056,
297,
288,
283,
954,
611,
3466,
356,
221,
9005,
15,
954,
611,
3466,
297,
288,
283,
1989,
2610,
611,
83,
356,
9005,
15,
1989,
2610,
611,
83,
297,
288,
283,
262,
7841,
356,
257,
9005,
15,
262,
7841,
297,
288,
283,
1989,
28731,
356,
259,
9005,
15,
1989,
28731,
297,
288,
283,
3807,
3466,
356,
420,
9005,
15,
3807,
3466,
297,
288,
283,
1989,
7692,
83,
356,
259,
9005,
15,
1989,
7692,
83,
297,
288,
283,
262,
10708,
356,
258,
9005,
15,
262,
10708,
297,
288,
283,
4551,
3466,
356,
258,
9005,
15,
4551,
3466,
297,
288,
283,
529,
3953,
1378,
356,
257,
9005,
15,
529,
3953,
1378,
297,
288,
283,
82,
3577,
6415,
356,
755,
9005,
15,
82,
3577,
6415,
297,
288,
283,
11132,
356,
259,
9005,
15,
11132,
7,
267,
789,
2378,
347,
636,
826,
721,
277,
12,
2986,
63,
498,
12,
7268,
29,
403,
304,
267,
291,
423,
1095,
63,
633,
275,
283,
2859,
921,
3148,
439,
1003,
17,
14,
80,
14,
77,
1119,
924,
14,
957,
15,
3148,
4805,
267,
291,
423,
1178,
63,
2139,
275,
791,
56,
13,
45,
1119,
924,
13,
1197,
356,
2986,
63,
498,
93,
327,
1178,
6169,
603,
1119,
924,
15913,
267,
291,
14,
9118,
63,
1361,
275,
7268,
327,
7268,
870,
663,
370,
756,
701,
849,
367,
9330,
12,
883,
506,
663,
370,
715,
367,
7268,
1373,
13,
1997,
83,
2378,
347,
663,
27153,
5375,
8,
277,
12,
19420,
304,
267,
340,
19420,
508,
283,
265,
356,
288,
291,
14,
9118,
63,
1361,
275,
715,
267,
916,
19420,
508,
283,
1997,
356,
288,
291,
14,
9118,
63,
1361,
275,
756,
267,
587,
26,
288,
746,
644,
5630,
14,
9118,
63,
1361,
63,
705,
339,
347,
365,
27153,
5375,
8,
277,
304,
267,
340,
291,
14,
9118,
63,
1361,
26,
288,
372,
715,
267,
587,
26,
288,
372,
756,
339,
347,
485,
362,
8,
277,
12,
4349,
12,
10093,
304,
398,
340,
4349,
365,
440,
730,
8,
495,
304,
288,
746,
644,
5630,
14,
2373,
63,
705,
398,
340,
10093,
440,
315,
644,
5630,
423,
5087,
26,
288,
746,
644,
5630,
14,
5506,
63,
705,
398,
1166,
275,
291,
423,
1095,
63,
633,
435,
644,
5630,
423,
5087,
59,
5506,
1055,
908,
8,
1027,
9,
267,
1827,
275,
4145,
14,
362,
8,
633,
12,
2323,
29,
277,
423,
1178,
63,
2139,
9,
398,
340,
291,
14,
374,
27153,
5375,
837,
288,
372,
10933,
8,
1131,
14,
1001,
1012,
267,
587,
26,
288,
372,
1827,
14,
1001,
342,
339,
347,
2196,
8,
277,
304,
267,
1449,
267,
1803,
282,
2196,
4349,
14,
3091,
2368,
4346,
14,
267,
1449,
267,
1827,
275,
4145,
14,
362,
8,
277,
423,
1095,
63,
633,
12,
1862,
3713,
2355,
5242,
2052,
2267,
2323,
29,
277,
423,
1178,
63,
2139,
9,
398,
340,
291,
14,
374,
27153,
5375,
837,
288,
372,
10933,
8,
1131,
14,
1001,
1012,
267,
587,
26,
288,
372,
1827,
14,
1001,
342,
339,
347,
4349,
8,
277,
12,
4349,
304,
267,
1449,
267,
27940,
8137,
626,
314,
644,
5630,
3261,
965,
641,
282,
4349,
14,
267,
1449,
267,
1166,
275,
291,
423,
1095,
63,
633,
435,
4349,
267,
1827,
275,
4145,
14,
362,
8,
633,
12,
2323,
29,
277,
423,
1178,
63,
2139,
9,
398,
340,
291,
14,
374,
27153,
5375,
837,
288,
372,
10933,
8,
1131,
14,
1001,
1012,
267,
587,
26,
288,
372,
1827,
14,
1001,
342,
339,
347,
10269,
8,
277,
12,
4349,
304,
267,
1449,
267,
710,
11150,
402,
314,
4349,
12,
5893,
2399,
1777,
402,
32093,
14,
267,
1666,
4178,
921,
1544,
14,
3148,
1246,
14,
957,
15,
4757,
3,
3148,
367,
1655,
2256,
14,
267,
1449,
267,
372,
291,
423,
362,
8,
1027,
12,
283,
15388,
358,
339,
347,
9560,
5220,
706,
8,
277,
12,
4349,
304,
267,
1449,
267,
644,
5630,
626,
883,
506,
1640,
2489,
367,
314,
3379,
4349,
315,
314,
2011,
1067,
14,
267,
1449,
267,
372,
291,
423,
362,
8,
1027,
12,
283,
9466,
5220,
706,
358,
339,
347,
27384,
5220,
706,
8,
277,
12,
4349,
304,
267,
1449,
267,
644,
5630,
626,
1172,
314,
26912,
1067,
402,
314,
3379,
4349,
14,
267,
1449,
267,
372,
291,
423,
362,
8,
1027,
12,
283,
867,
5220,
706,
358,
339,
347,
7251,
8,
277,
12,
4349,
304,
267,
1449,
267,
5679,
24256,
1808,
314,
4349,
14,
267,
1449,
267,
372,
291,
423,
362,
8,
1027,
12,
283,
8589,
358,
339,
347
] |
[
1182,
2647,
15,
1393,
15,
1813,
2366,
199,
199,
646,
4145,
199,
504,
10933,
492,
10933,
199,
199,
533,
644,
5630,
8,
785,
304,
339,
408,
33,
1021,
626,
8386,
543,
314,
644,
5630,
3261,
737,
4178,
921,
3148,
1246,
14,
957,
624,
339,
7268,
63,
1361,
63,
705,
275,
1722,
360,
5556,
1471,
9509,
8891,
265,
3985,
503,
8891,
1997,
3985,
370,
19420,
314,
7268,
870,
4260,
14,
7754,
9509,
282,
1686,
1324,
2659,
272,
10093,
63,
705,
275,
1722,
360,
5556,
1471,
11496,
282,
1686,
10093,
14,
1666,
4178,
921,
1544,
14,
3148,
1246,
14,
957,
15,
4757,
3,
5087,
367,
1686,
2436,
2659,
272,
2397,
63,
705,
275,
1722,
360,
5556,
1471,
9509,
282,
1686,
1059,
358,
339,
485,
5087,
275,
469,
288,
283,
15388,
356,
221,
9005,
15,
15388,
297,
288,
283,
9466,
5220,
706,
356,
258,
9005,
15,
9466,
5220,
706,
297,
288,
283,
867,
5220,
706,
356,
258,
9005,
15,
867,
5220,
706,
297,
288,
283,
8589,
356,
258,
9005,
15,
8589,
297,
288,
283,
466,
3466,
356,
755,
9005,
15,
466,
3466,
297,
288,
283,
1989,
4100,
356,
258,
9005,
15,
1989,
4100,
297,
288,
283,
2064,
3466,
356,
755,
9005,
15,
2064,
3466,
297,
288,
283,
1989,
28662,
356,
258,
9005,
15,
1989,
28662,
297,
288,
283,
842,
3466,
356,
257,
9005,
15,
842,
3466,
297,
288,
283,
1989,
18194,
356,
9005,
15,
1989,
18194,
297,
288,
283,
23079,
1378,
356,
259,
9005,
15,
23079,
1378,
297,
288,
283,
12344,
356,
260,
9005,
15,
12344,
297,
288,
283,
484,
1054,
83,
356,
420,
9005,
15,
484,
1054,
83,
297,
288,
283,
1114,
3466,
356,
258,
9005,
15,
1114,
3466,
297,
288,
283,
1989,
23056,
356,
257,
9005,
15,
1989,
23056,
297,
288,
283,
954,
611,
3466,
356,
221,
9005,
15,
954,
611,
3466,
297,
288,
283,
1989,
2610,
611,
83,
356,
9005,
15,
1989,
2610,
611,
83,
297,
288,
283,
262,
7841,
356,
257,
9005,
15,
262,
7841,
297,
288,
283,
1989,
28731,
356,
259,
9005,
15,
1989,
28731,
297,
288,
283,
3807,
3466,
356,
420,
9005,
15,
3807,
3466,
297,
288,
283,
1989,
7692,
83,
356,
259,
9005,
15,
1989,
7692,
83,
297,
288,
283,
262,
10708,
356,
258,
9005,
15,
262,
10708,
297,
288,
283,
4551,
3466,
356,
258,
9005,
15,
4551,
3466,
297,
288,
283,
529,
3953,
1378,
356,
257,
9005,
15,
529,
3953,
1378,
297,
288,
283,
82,
3577,
6415,
356,
755,
9005,
15,
82,
3577,
6415,
297,
288,
283,
11132,
356,
259,
9005,
15,
11132,
7,
267,
789,
2378,
347,
636,
826,
721,
277,
12,
2986,
63,
498,
12,
7268,
29,
403,
304,
267,
291,
423,
1095,
63,
633,
275,
283,
2859,
921,
3148,
439,
1003,
17,
14,
80,
14,
77,
1119,
924,
14,
957,
15,
3148,
4805,
267,
291,
423,
1178,
63,
2139,
275,
791,
56,
13,
45,
1119,
924,
13,
1197,
356,
2986,
63,
498,
93,
327,
1178,
6169,
603,
1119,
924,
15913,
267,
291,
14,
9118,
63,
1361,
275,
7268,
327,
7268,
870,
663,
370,
756,
701,
849,
367,
9330,
12,
883,
506,
663,
370,
715,
367,
7268,
1373,
13,
1997,
83,
2378,
347,
663,
27153,
5375,
8,
277,
12,
19420,
304,
267,
340,
19420,
508,
283,
265,
356,
288,
291,
14,
9118,
63,
1361,
275,
715,
267,
916,
19420,
508,
283,
1997,
356,
288,
291,
14,
9118,
63,
1361,
275,
756,
267,
587,
26,
288,
746,
644,
5630,
14,
9118,
63,
1361,
63,
705,
339,
347,
365,
27153,
5375,
8,
277,
304,
267,
340,
291,
14,
9118,
63,
1361,
26,
288,
372,
715,
267,
587,
26,
288,
372,
756,
339,
347,
485,
362,
8,
277,
12,
4349,
12,
10093,
304,
398,
340,
4349,
365,
440,
730,
8,
495,
304,
288,
746,
644,
5630,
14,
2373,
63,
705,
398,
340,
10093,
440,
315,
644,
5630,
423,
5087,
26,
288,
746,
644,
5630,
14,
5506,
63,
705,
398,
1166,
275,
291,
423,
1095,
63,
633,
435,
644,
5630,
423,
5087,
59,
5506,
1055,
908,
8,
1027,
9,
267,
1827,
275,
4145,
14,
362,
8,
633,
12,
2323,
29,
277,
423,
1178,
63,
2139,
9,
398,
340,
291,
14,
374,
27153,
5375,
837,
288,
372,
10933,
8,
1131,
14,
1001,
1012,
267,
587,
26,
288,
372,
1827,
14,
1001,
342,
339,
347,
2196,
8,
277,
304,
267,
1449,
267,
1803,
282,
2196,
4349,
14,
3091,
2368,
4346,
14,
267,
1449,
267,
1827,
275,
4145,
14,
362,
8,
277,
423,
1095,
63,
633,
12,
1862,
3713,
2355,
5242,
2052,
2267,
2323,
29,
277,
423,
1178,
63,
2139,
9,
398,
340,
291,
14,
374,
27153,
5375,
837,
288,
372,
10933,
8,
1131,
14,
1001,
1012,
267,
587,
26,
288,
372,
1827,
14,
1001,
342,
339,
347,
4349,
8,
277,
12,
4349,
304,
267,
1449,
267,
27940,
8137,
626,
314,
644,
5630,
3261,
965,
641,
282,
4349,
14,
267,
1449,
267,
1166,
275,
291,
423,
1095,
63,
633,
435,
4349,
267,
1827,
275,
4145,
14,
362,
8,
633,
12,
2323,
29,
277,
423,
1178,
63,
2139,
9,
398,
340,
291,
14,
374,
27153,
5375,
837,
288,
372,
10933,
8,
1131,
14,
1001,
1012,
267,
587,
26,
288,
372,
1827,
14,
1001,
342,
339,
347,
10269,
8,
277,
12,
4349,
304,
267,
1449,
267,
710,
11150,
402,
314,
4349,
12,
5893,
2399,
1777,
402,
32093,
14,
267,
1666,
4178,
921,
1544,
14,
3148,
1246,
14,
957,
15,
4757,
3,
3148,
367,
1655,
2256,
14,
267,
1449,
267,
372,
291,
423,
362,
8,
1027,
12,
283,
15388,
358,
339,
347,
9560,
5220,
706,
8,
277,
12,
4349,
304,
267,
1449,
267,
644,
5630,
626,
883,
506,
1640,
2489,
367,
314,
3379,
4349,
315,
314,
2011,
1067,
14,
267,
1449,
267,
372,
291,
423,
362,
8,
1027,
12,
283,
9466,
5220,
706,
358,
339,
347,
27384,
5220,
706,
8,
277,
12,
4349,
304,
267,
1449,
267,
644,
5630,
626,
1172,
314,
26912,
1067,
402,
314,
3379,
4349,
14,
267,
1449,
267,
372,
291,
423,
362,
8,
1027,
12,
283,
867,
5220,
706,
358,
339,
347,
7251,
8,
277,
12,
4349,
304,
267,
1449,
267,
5679,
24256,
1808,
314,
4349,
14,
267,
1449,
267,
372,
291,
423,
362,
8,
1027,
12,
283,
8589,
358,
339,
347,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Observer-Wu/phantomjs
|
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/path_unittest.py
|
124
|
3544
|
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import unittest2 as unittest
import sys
from webkitpy.common.system.systemhost import SystemHost
from webkitpy.common.system.platforminfo import PlatformInfo
from webkitpy.common.system.platforminfo_mock import MockPlatformInfo
from webkitpy.common.system import path
class AbspathTest(unittest.TestCase):
def platforminfo(self):
return SystemHost().platform
def test_abspath_to_uri_cygwin(self):
if sys.platform != 'cygwin':
return
self.assertEqual(path.abspath_to_uri(self.platforminfo(), '/cygdrive/c/foo/bar.html'),
'file:///C:/foo/bar.html')
def test_abspath_to_uri_unixy(self):
self.assertEqual(path.abspath_to_uri(MockPlatformInfo(), "/foo/bar.html"),
'file:///foo/bar.html')
def test_abspath_to_uri_win(self):
if sys.platform != 'win32':
return
self.assertEqual(path.abspath_to_uri(self.platforminfo(), 'c:\\foo\\bar.html'),
'file:///c:/foo/bar.html')
def test_abspath_to_uri_escaping_unixy(self):
self.assertEqual(path.abspath_to_uri(MockPlatformInfo(), '/foo/bar + baz%?.html'),
'file:///foo/bar%20+%20baz%25%3F.html')
# Note that you can't have '?' in a filename on windows.
def test_abspath_to_uri_escaping_cygwin(self):
if sys.platform != 'cygwin':
return
self.assertEqual(path.abspath_to_uri(self.platforminfo(), '/cygdrive/c/foo/bar + baz%.html'),
'file:///C:/foo/bar%20+%20baz%25.html')
def test_stop_cygpath_subprocess(self):
if sys.platform != 'cygwin':
return
# Call cygpath to ensure the subprocess is running.
path.cygpath("/cygdrive/c/foo.txt")
self.assertTrue(path._CygPath._singleton.is_running())
# Stop it.
path._CygPath.stop_cygpath_subprocess()
# Ensure that it is stopped.
self.assertFalse(path._CygPath._singleton.is_running())
|
bsd-3-clause
|
[
3,
1898,
334,
35,
9,
7129,
4475,
3277,
14,
2900,
4481,
4644,
14,
199,
3,
199,
3,
10114,
436,
675,
315,
1350,
436,
3366,
4513,
12,
543,
503,
1928,
199,
3,
7100,
12,
787,
8211,
2741,
626,
314,
2569,
3704,
787,
199,
3,
7647,
26,
199,
3,
199,
3,
259,
627,
6823,
402,
1350,
1233,
1471,
8074,
314,
3432,
4248,
199,
3,
4245,
12,
642,
769,
402,
3704,
436,
314,
2569,
6450,
14,
199,
3,
259,
627,
6823,
315,
3366,
1824,
1471,
9172,
314,
3432,
199,
3,
4248,
4245,
12,
642,
769,
402,
3704,
436,
314,
2569,
6450,
199,
3,
315,
314,
3794,
436,
15,
269,
1163,
8418,
2741,
543,
314,
199,
3,
4084,
14,
199,
3,
259,
627,
11443,
314,
536,
402,
4475,
3277,
14,
6590,
314,
1561,
402,
2399,
199,
3,
8417,
1443,
506,
1202,
370,
10692,
503,
10016,
7585,
7131,
687,
199,
3,
642,
2032,
1928,
2488,
6791,
5313,
4983,
14,
199,
3,
199,
3,
5749,
4141,
2281,
7049,
6515,
2334,
5877,
8164,
2401,
6483,
199,
3,
298,
1179,
2281,
2,
2401,
1821,
7168,
1549,
5292,
2990,
12,
6931,
12,
5400,
2845,
199,
3,
5471,
2296,
12,
2334,
5292,
2990,
1634,
3169,
2401,
3092,
2381,
199,
3,
437,
3115,
3104,
9315,
9706,
14,
1621,
4825,
6461,
7000,
2334,
5877,
199,
3,
11489,
1549,
6483,
6262,
7024,
2381,
1821,
8703,
12,
9168,
12,
9716,
12,
199,
3,
8820,
12,
9836,
12,
1549,
9110,
6736,
334,
6446,
12,
5400,
2845,
199,
3,
5471,
2296,
12,
9838,
1634,
9103,
9764,
1549,
9714,
27,
9102,
1634,
4815,
12,
199,
3,
7126,
12,
1549,
9206,
27,
1549,
9748,
9831,
9,
9802,
9817,
2401,
5258,
1821,
199,
3,
9815,
1634,
5603,
12,
7061,
1621,
7066,
12,
9644,
5603,
12,
1549,
7056,
199,
3,
334,
6446,
9254,
1549,
7334,
9,
7043,
1621,
1821,
9683,
5738,
1634,
2334,
4815,
199,
3,
1634,
5749,
4141,
12,
9704,
8036,
9691,
1634,
2334,
9726,
1634,
9712,
9784,
14,
199,
199,
646,
2882,
18,
465,
2882,
199,
646,
984,
199,
199,
504,
18007,
14,
2330,
14,
2253,
14,
2253,
1102,
492,
6187,
4965,
199,
504,
18007,
14,
2330,
14,
2253,
14,
3246,
815,
492,
16078,
2354,
199,
504,
18007,
14,
2330,
14,
2253,
14,
3246,
815,
63,
1805,
492,
4420,
10397,
2354,
199,
504,
18007,
14,
2330,
14,
2253,
492,
931,
199,
199,
533,
20319,
515,
774,
8,
2796,
14,
1746,
304,
272,
347,
4298,
815,
8,
277,
304,
267,
372,
6187,
4965,
1252,
3246,
339,
347,
511,
63,
4832,
63,
475,
63,
2302,
63,
16680,
8,
277,
304,
267,
340,
984,
14,
3246,
1137,
283,
16680,
356,
288,
372,
267,
291,
14,
629,
8,
515,
14,
4832,
63,
475,
63,
2302,
8,
277,
14,
3246,
815,
1062,
1994,
1480,
7136,
6053,
15,
67,
15,
1421,
15,
1700,
14,
1360,
659,
2079,
283,
493,
24436,
35,
11254,
1421,
15,
1700,
14,
1360,
358,
339,
347,
511,
63,
4832,
63,
475,
63,
2302,
63,
11864,
89,
8,
277,
304,
267,
291,
14,
629,
8,
515,
14,
4832,
63,
475,
63,
2302,
8,
3346,
10397,
2354,
1062,
3286,
1421,
15,
1700,
14,
1360,
1288,
2079,
283,
493,
24436,
1421,
15,
1700,
14,
1360,
358,
339,
347,
511,
63,
4832,
63,
475,
63,
2302,
63,
2676,
8,
277,
304,
267,
340,
984,
14,
3246,
1137,
283,
2676,
708,
356,
288,
372,
267,
291,
14,
629,
8,
515,
14,
4832,
63,
475,
63,
2302,
8,
277,
14,
3246,
815,
1062,
283,
67,
18589,
1421,
1103,
1700,
14,
1360,
659,
586,
283,
493,
24436,
67,
11254,
1421,
15,
1700,
14,
1360,
358,
339,
347,
511,
63,
4832,
63,
475,
63,
2302,
63,
26306,
63,
11864,
89,
8,
277,
304,
267,
291,
14,
629,
8,
515,
14,
4832,
63,
475,
63,
2302,
8,
3346,
10397,
2354,
1062,
1994,
1421,
15,
1700,
435,
15507,
5,
31,
14,
1360,
659,
586,
283,
493,
24436,
1421,
15,
1700,
5,
1165,
25389,
1165,
6185,
5,
821,
5,
19,
38,
14,
1360,
358,
398,
327,
3390,
626,
1265,
883,
1133,
1172,
15539,
315,
282,
1788,
641,
10061,
14,
272,
347,
511,
63,
4832,
63,
475,
63,
2302,
63,
26306,
63,
16680,
8,
277,
304,
267,
340,
984,
14,
3246,
1137,
283,
16680,
356,
288,
372,
267,
291,
14,
629,
8,
515,
14,
4832,
63,
475,
63,
2302,
8,
277,
14,
3246,
815,
1062,
1994,
1480,
7136,
6053,
15,
67,
15,
1421,
15,
1700,
435,
15507,
17229,
1360,
659,
2079,
283,
493,
24436,
35,
11254,
1421,
15,
1700,
5,
1165,
25389,
1165,
6185,
5,
821,
14,
1360,
358,
339,
347,
511,
63,
2379,
63,
15076,
515,
63,
5781,
8,
277,
304,
267,
340,
984,
14,
3246,
1137,
283,
16680,
356,
288,
372,
398,
327,
6523,
286,
5016,
515,
370,
4868,
314,
3873,
365,
3879,
14,
267,
931,
14,
15076,
515,
4769,
1480,
7136,
6053,
15,
67,
15,
1421,
14,
2424,
531,
267,
291,
14,
1815,
8,
515,
423,
35,
5016,
2042,
423,
24675,
14,
374,
63,
5720,
1012,
398,
327,
8015,
652,
14,
267,
931,
423,
35,
5016,
2042,
14,
2379,
63,
15076,
515,
63,
5781,
342,
398,
327,
7523,
626,
652,
365,
15248,
14,
267,
291,
14,
3334,
8,
515,
423,
35,
5016,
2042,
423,
24675,
14,
374,
63,
5720,
1012,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1898,
334,
35,
9,
7129,
4475,
3277,
14,
2900,
4481,
4644,
14,
199,
3,
199,
3,
10114,
436,
675,
315,
1350,
436,
3366,
4513,
12,
543,
503,
1928,
199,
3,
7100,
12,
787,
8211,
2741,
626,
314,
2569,
3704,
787,
199,
3,
7647,
26,
199,
3,
199,
3,
259,
627,
6823,
402,
1350,
1233,
1471,
8074,
314,
3432,
4248,
199,
3,
4245,
12,
642,
769,
402,
3704,
436,
314,
2569,
6450,
14,
199,
3,
259,
627,
6823,
315,
3366,
1824,
1471,
9172,
314,
3432,
199,
3,
4248,
4245,
12,
642,
769,
402,
3704,
436,
314,
2569,
6450,
199,
3,
315,
314,
3794,
436,
15,
269,
1163,
8418,
2741,
543,
314,
199,
3,
4084,
14,
199,
3,
259,
627,
11443,
314,
536,
402,
4475,
3277,
14,
6590,
314,
1561,
402,
2399,
199,
3,
8417,
1443,
506,
1202,
370,
10692,
503,
10016,
7585,
7131,
687,
199,
3,
642,
2032,
1928,
2488,
6791,
5313,
4983,
14,
199,
3,
199,
3,
5749,
4141,
2281,
7049,
6515,
2334,
5877,
8164,
2401,
6483,
199,
3,
298,
1179,
2281,
2,
2401,
1821,
7168,
1549,
5292,
2990,
12,
6931,
12,
5400,
2845,
199,
3,
5471,
2296,
12,
2334,
5292,
2990,
1634,
3169,
2401,
3092,
2381,
199,
3,
437,
3115,
3104,
9315,
9706,
14,
1621,
4825,
6461,
7000,
2334,
5877,
199,
3,
11489,
1549,
6483,
6262,
7024,
2381,
1821,
8703,
12,
9168,
12,
9716,
12,
199,
3,
8820,
12,
9836,
12,
1549,
9110,
6736,
334,
6446,
12,
5400,
2845,
199,
3,
5471,
2296,
12,
9838,
1634,
9103,
9764,
1549,
9714,
27,
9102,
1634,
4815,
12,
199,
3,
7126,
12,
1549,
9206,
27,
1549,
9748,
9831,
9,
9802,
9817,
2401,
5258,
1821,
199,
3,
9815,
1634,
5603,
12,
7061,
1621,
7066,
12,
9644,
5603,
12,
1549,
7056,
199,
3,
334,
6446,
9254,
1549,
7334,
9,
7043,
1621,
1821,
9683,
5738,
1634,
2334,
4815,
199,
3,
1634,
5749,
4141,
12,
9704,
8036,
9691,
1634,
2334,
9726,
1634,
9712,
9784,
14,
199,
199,
646,
2882,
18,
465,
2882,
199,
646,
984,
199,
199,
504,
18007,
14,
2330,
14,
2253,
14,
2253,
1102,
492,
6187,
4965,
199,
504,
18007,
14,
2330,
14,
2253,
14,
3246,
815,
492,
16078,
2354,
199,
504,
18007,
14,
2330,
14,
2253,
14,
3246,
815,
63,
1805,
492,
4420,
10397,
2354,
199,
504,
18007,
14,
2330,
14,
2253,
492,
931,
199,
199,
533,
20319,
515,
774,
8,
2796,
14,
1746,
304,
272,
347,
4298,
815,
8,
277,
304,
267,
372,
6187,
4965,
1252,
3246,
339,
347,
511,
63,
4832,
63,
475,
63,
2302,
63,
16680,
8,
277,
304,
267,
340,
984,
14,
3246,
1137,
283,
16680,
356,
288,
372,
267,
291,
14,
629,
8,
515,
14,
4832,
63,
475,
63,
2302,
8,
277,
14,
3246,
815,
1062,
1994,
1480,
7136,
6053,
15,
67,
15,
1421,
15,
1700,
14,
1360,
659,
2079,
283,
493,
24436,
35,
11254,
1421,
15,
1700,
14,
1360,
358,
339,
347,
511,
63,
4832,
63,
475,
63,
2302,
63,
11864,
89,
8,
277,
304,
267,
291,
14,
629,
8,
515,
14,
4832,
63,
475,
63,
2302,
8,
3346,
10397,
2354,
1062,
3286,
1421,
15,
1700,
14,
1360,
1288,
2079,
283,
493,
24436,
1421,
15,
1700,
14,
1360,
358,
339,
347,
511,
63,
4832,
63,
475,
63,
2302,
63,
2676,
8,
277,
304,
267,
340,
984,
14,
3246,
1137,
283,
2676,
708,
356,
288,
372,
267,
291,
14,
629,
8,
515,
14,
4832,
63,
475,
63,
2302,
8,
277,
14,
3246,
815,
1062,
283,
67,
18589,
1421,
1103,
1700,
14,
1360,
659,
586,
283,
493,
24436,
67,
11254,
1421,
15,
1700,
14,
1360,
358,
339,
347,
511,
63,
4832,
63,
475,
63,
2302,
63,
26306,
63,
11864,
89,
8,
277,
304,
267,
291,
14,
629,
8,
515,
14,
4832,
63,
475,
63,
2302,
8,
3346,
10397,
2354,
1062,
1994,
1421,
15,
1700,
435,
15507,
5,
31,
14,
1360,
659,
586,
283,
493,
24436,
1421,
15,
1700,
5,
1165,
25389,
1165,
6185,
5,
821,
5,
19,
38,
14,
1360,
358,
398,
327,
3390,
626,
1265,
883,
1133,
1172,
15539,
315,
282,
1788,
641,
10061,
14,
272,
347,
511,
63,
4832,
63,
475,
63,
2302,
63,
26306,
63,
16680,
8,
277,
304,
267,
340,
984,
14,
3246,
1137,
283,
16680,
356,
288,
372,
267,
291,
14,
629,
8,
515,
14,
4832,
63,
475,
63,
2302,
8,
277,
14,
3246,
815,
1062,
1994,
1480,
7136,
6053,
15,
67,
15,
1421,
15,
1700,
435,
15507,
17229,
1360,
659,
2079,
283,
493,
24436,
35,
11254,
1421,
15,
1700,
5,
1165,
25389,
1165,
6185,
5,
821,
14,
1360,
358,
339,
347,
511,
63,
2379,
63,
15076,
515,
63,
5781,
8,
277,
304,
267,
340,
984,
14,
3246,
1137,
283,
16680,
356,
288,
372,
398,
327,
6523,
286,
5016,
515,
370,
4868,
314,
3873,
365,
3879,
14,
267,
931,
14,
15076,
515,
4769,
1480,
7136,
6053,
15,
67,
15,
1421,
14,
2424,
531,
267,
291,
14,
1815,
8,
515,
423,
35,
5016,
2042,
423,
24675,
14,
374,
63,
5720,
1012,
398,
327,
8015,
652,
14,
267,
931,
423,
35,
5016,
2042,
14,
2379,
63,
15076,
515,
63,
5781,
342,
398,
327,
7523,
626,
652,
365,
15248,
14,
267,
291,
14,
3334,
8,
515,
423,
35,
5016,
2042,
423,
24675,
14,
374,
63,
5720,
1012,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
provaleks/o8
|
addons/website_certification/certification.py
|
385
|
1789
|
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import osv, fields
class certification_type(osv.Model):
_name = 'certification.type'
_order = 'name ASC'
_columns = {
'name': fields.char("Certification Type", required=True)
}
class certification_certification(osv.Model):
_name = 'certification.certification'
_order = 'certification_date DESC'
_columns = {
'partner_id': fields.many2one('res.partner', string="Partner", required=True),
'type_id': fields.many2one('certification.type', string="Certification", required=True),
'certification_date': fields.date("Certification Date", required=True),
'certification_score': fields.char("Certification Score", required=True),
'certification_hidden_score': fields.boolean("Hide score on website?")
}
|
agpl-3.0
|
[
3,
1882,
2644,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
199,
3,
259,
7653,
12,
3232,
5800,
8259,
9274,
199,
3,
259,
1898,
334,
35,
9,
8353,
13,
2566,
11655,
7653,
428,
14,
33,
14,
665,
1014,
921,
1544,
14,
11267,
14,
957,
30,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
4605,
421,
199,
504,
5166,
14,
4795,
492,
9506,
12,
1504,
421,
199,
533,
3361,
3793,
63,
466,
8,
4795,
14,
1685,
304,
272,
485,
354,
275,
283,
2247,
3793,
14,
466,
7,
272,
485,
1648,
275,
283,
354,
20955,
7,
272,
485,
3406,
275,
469,
267,
283,
354,
356,
1504,
14,
1560,
480,
7851,
3793,
2434,
401,
1415,
29,
549,
9,
272,
789,
421,
199,
533,
3361,
3793,
63,
2247,
3793,
8,
4795,
14,
1685,
304,
272,
485,
354,
275,
283,
2247,
3793,
14,
2247,
3793,
7,
272,
485,
1648,
275,
221,
283,
2247,
3793,
63,
602,
23915,
7,
272,
485,
3406,
275,
469,
267,
283,
3899,
63,
344,
356,
1504,
14,
3479,
18,
368,
360,
470,
14,
3899,
297,
1059,
628,
24120,
401,
1415,
29,
549,
395,
267,
283,
466,
63,
344,
356,
1504,
14,
3479,
18,
368,
360,
2247,
3793,
14,
466,
297,
1059,
628,
7851,
3793,
401,
1415,
29,
549,
395,
267,
283,
2247,
3793,
63,
602,
356,
1504,
14,
602,
480,
7851,
3793,
6148,
401,
1415,
29,
549,
395,
267,
283,
2247,
3793,
63,
3397,
356,
1504,
14,
1560,
480,
7851,
3793,
25318,
401,
1415,
29,
549,
395,
267,
283,
2247,
3793,
63,
5642,
63,
3397,
356,
1504,
14,
4871,
480,
18224,
5396,
641,
10691,
18582,
272,
789,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1882,
2644,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
199,
3,
259,
7653,
12,
3232,
5800,
8259,
9274,
199,
3,
259,
1898,
334,
35,
9,
8353,
13,
2566,
11655,
7653,
428,
14,
33,
14,
665,
1014,
921,
1544,
14,
11267,
14,
957,
30,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
4605,
421,
199,
504,
5166,
14,
4795,
492,
9506,
12,
1504,
421,
199,
533,
3361,
3793,
63,
466,
8,
4795,
14,
1685,
304,
272,
485,
354,
275,
283,
2247,
3793,
14,
466,
7,
272,
485,
1648,
275,
283,
354,
20955,
7,
272,
485,
3406,
275,
469,
267,
283,
354,
356,
1504,
14,
1560,
480,
7851,
3793,
2434,
401,
1415,
29,
549,
9,
272,
789,
421,
199,
533,
3361,
3793,
63,
2247,
3793,
8,
4795,
14,
1685,
304,
272,
485,
354,
275,
283,
2247,
3793,
14,
2247,
3793,
7,
272,
485,
1648,
275,
221,
283,
2247,
3793,
63,
602,
23915,
7,
272,
485,
3406,
275,
469,
267,
283,
3899,
63,
344,
356,
1504,
14,
3479,
18,
368,
360,
470,
14,
3899,
297,
1059,
628,
24120,
401,
1415,
29,
549,
395,
267,
283,
466,
63,
344,
356,
1504,
14,
3479,
18,
368,
360,
2247,
3793,
14,
466,
297,
1059,
628,
7851,
3793,
401,
1415,
29,
549,
395,
267,
283,
2247,
3793,
63,
602,
356,
1504,
14,
602,
480,
7851,
3793,
6148,
401,
1415,
29,
549,
395,
267,
283,
2247,
3793,
63,
3397,
356,
1504,
14,
1560,
480,
7851,
3793,
25318,
401,
1415,
29,
549,
395,
267,
283,
2247,
3793,
63,
5642,
63,
3397,
356,
1504,
14,
4871,
480,
18224,
5396,
641,
10691,
18582,
272,
789,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
Raphux/passhport
|
passhportd/app/views_mod/target/target.py
|
1
|
26601
|
# -*-coding:Utf-8 -*-
from flask import request
from sqlalchemy import exc, and_
from sqlalchemy.orm import sessionmaker
from app import app, db
from app.models_mod import user, target, usergroup, exttargetaccess, passentry
from . import api
from subprocess import Popen, PIPE
from datetime import datetime, timedelta
import os
import config
from .. import utilities as utils
@app.route("/target/list")
def target_list():
"""Return the target list of database"""
result = []
query = db.session.query(
target.Target.name).order_by(
target.Target.name).all()
for row in query:
result.append(row[0])
if not result:
return utils.response("No target in database.", 200)
return utils.response("\n".join(result), 200)
@app.route("/target/search/<pattern>")
def target_search(pattern):
"""Return a list of targets that match the given pattern"""
result = []
query = db.session.query(target.Target.name)\
.filter(target.Target.name.like("%" + pattern + "%"))\
.order_by(target.Target.name).all()
for row in query:
result.append(row[0])
if not result:
return utils.response('No target matching the pattern "' + pattern + \
'" found.', 200)
return utils.response("\n".join(result), 200)
@app.route("/target/memberof/<obj>/<name>")
def target_memberof(obj, name):
"""Return the list of obj this target is member of (obj shoud be tg)"""
# Check for required fields
if not name:
return utils.response("ERROR: The name is required ", 417)
target_data = target.Target.query.filter_by(name=name).first()
if target_data is None:
return utils.response('ERROR: No target with the name "' + name + \
'" in the database.', 417)
return utils.response(str(target_data.memberof(obj)), 200)
@app.route("/target/checkaccess/<pattern>")
def target_checkaccess(pattern):
"""Check SSH connection for each target with a name or hostname that
match the pattern. And return the result for each target"""
result = []
query = db.session.query(target.Target) \
.filter(target.Target.hostname.like("%" + pattern + "%") | \
target.Target.name.like("%" + pattern + "%")) \
.order_by(target.Target.name).all()
for targetobj in query:
hostname = targetobj.hostname
login = targetobj.login
port = targetobj.port
sshoptions = targetobj.sshoptions
#Check minimal infos
if hostname:
if not login:
login = "root"
if not port:
port = 22
if not sshoptions:
sshoptions = ""
# Need to trick ssh: we don't want to check fingerprints
# neither to interfer with the local fingerprints file
sshcommand = "ssh -p" + str(port) + \
" " + login + "@" + hostname + \
" " + sshoptions + " " \
"-o PasswordAuthentication=no " + \
"-o UserKnownHostsFile=/dev/null " + \
"-o StrictHostKeyChecking=no " + \
"-o ConnectTimeout=10 " + \
"echo OK"
# Try to connect and get the result
r = os.system(sshcommand)
if r == 0:
result.append("OK: " + hostname + "\t" + \
targetobj.name)
else:
result.append("ERROR:" + hostname + "\t" + \
targetobj.name + "\tError with this ssh command " + \
"(return code -> " + str(r) + "): " + sshcommand)
if not result:
return utils.response('No target hostname matching the pattern "' + \
pattern + '" found.', 200)
return utils.response("\n".join(result), 200)
@app.route("/target/show/<name>")
def target_show(name):
"""Return all data about a target"""
# Check for required fields
if not name:
return utils.response("ERROR: The name is required ", 417)
target_data = target.Target.query.filter_by(name=name).first()
if target_data is None:
return utils.response('ERROR: No target with the name "' + name + \
'" in the database.', 417)
return utils.response(str(target_data), 200)
@app.route("/target/port/<name>")
def target_port(name):
"""Return port related to a target"""
# Check for required fields
if not name:
return utils.response("ERROR: The name is required ", 417)
target_data = target.Target.query.filter_by(name=name).first()
if target_data is None:
return utils.response('ERROR: No target with the name "' + name + \
'" in the database.', 417)
port = target_data.port
# If there is no port declared, we assume it's 22
if port is None:
app.logger.warning("No port set on " + name + ", 22 is used")
port = "22"
else:
port = str(port).replace(" ","")
return utils.response(port, 200)
@app.route("/target/login/<name>")
def target_login(name):
"""Return login related to a target"""
# Check for required fields
if not name:
return utils.response("ERROR: The name is required ", 417)
target_data = target.Target.query.filter_by(name=name).first()
if target_data is None:
return utils.response('ERROR: No target with the name "' + name + \
'" in the database.', 417)
login = target_data.login
# If there is no user declared, we assume it's root
if login is None:
app.logger.warning("No login set on " + name + ", root is used")
login = "root"
else:
login = str(login).replace(" ","")
return utils.response(login, 200)
@app.route("/target/sshoptions/<name>")
def target_options(name):
"""Return options related to a target"""
# Check for required fields
if not name:
return utils.response("ERROR: The name is required ", 417)
target_data = target.Target.query.filter_by(name=name).first()
if target_data is None:
return utils.response('ERROR: No target with the name "' + name + \
'" in the database.', 417)
return utils.response(str(target_data.sshoptions), 200)
@app.route("/target/create", methods=["POST"])
def target_create():
"""Add a target in the database"""
# Only POST data are handled
if request.method != "POST":
return utils.response("ERROR: POST method is required ", 405)
# Simplification for the reading
name = request.form["name"].replace(" ", "")
hostname = request.form["hostname"].replace(" ", "")
targettype = request.form["targettype"].replace(" ", "")
login = request.form["login"].replace(" ", "")
port = request.form["port"].replace(" ", "")
sshoptions = request.form["sshoptions"]
comment = request.form["comment"]
changepwd = request.form["changepwd"].replace(" ", "")
sessiondur = ""
if "sessiondur" in request.form:
if utils.is_number(request.form["sessiondur"]):
app.logger.error(request.form["sessiondur"])
sessiondur = int(request.form["sessiondur"].replace(" ", ""))*60
# Check for required fields
if not name or not hostname:
return utils.response("ERROR: The name and hostname are" + \
" required", 417)
if not targettype:
targettype = "ssh"
if not login:
login = "root"
if not port:
if targettype == "ssh":
port = 22
elif targettype == "mysql":
port = 3306
elif targettype == "postgresql":
port = 5432
elif targettype == "oracle" :
port = 1521
if not changepwd:
changepwd = False
elif changepwd == "True":
changepwd = True
else:
changepwd=False
if not sessiondur:
sessiondur = 60*int(config.DB_SESSIONS_TO)
# Check unicity for name
query = db.session.query(target.Target.name)\
.filter_by(name=name).first()
if query is not None:
return utils.response('ERROR: The name "' + name + \
'" is already used by another target ', 417)
t = target.Target(
name = name,
hostname = hostname,
targettype = targettype,
login = login,
port = port,
sshoptions = sshoptions,
comment = comment,
changepwd = changepwd,
sessiondur = sessiondur)
db.session.add(t)
# Try to add the target on the database
try:
db.session.commit()
except exc.SQLAlchemyError as e:
return utils.response('ERROR: "' + name + '" -> ' + e.message, 409)
return utils.response('OK: "' + name + '" -> created', 200)
@app.route("/target/edit", methods=["POST"])
def target_edit():
"""Edit a target in the database"""
# Only POST data are handled
if request.method != "POST":
return utils.response("ERROR: POST method is required ", 405)
# Simplification for the reading
name = request.form["name"]
new_name = request.form["new_name"].replace(" ", "")
new_hostname = request.form["new_hostname"].replace(" ", "")
new_targettype = request.form["new_targettype"].replace(" ", "")
new_login = request.form["new_login"].replace(" ", "")
new_port = request.form["new_port"].replace(" ", "")
new_sshoptions = request.form["new_sshoptions"]
new_comment = request.form["new_comment"]
new_changepwd = request.form["new_changepwd"].replace(" ", "")
new_sessiondur = ""
if "new_sessiondur" in request.form:
# session duration is stored in minutes, but created in hours
new_sessiondur = int(request.form["new_sessiondur"].replace(" ", ""))*60
# Check required fields
if not name:
return utils.response("ERROR: The name is required ", 417)
# Check if the name exists in the database
query = db.session.query(target.Target.name)\
.filter_by(name=name).first()
if query is None:
return utils.response('ERROR: No target with the name "' + name + \
'" in the database.', 417)
to_update = db.session.query(target.Target.name).filter_by(name=name)
# Let's modify only relevent fields
if new_login:
to_update.update({"login": new_login})
if new_sshoptions:
to_update.update({"sshoptions": new_sshoptions})
if new_comment:
# This specific string allows admins to remove old comments
if new_comment == "PASSHPORTREMOVECOMMENT":
new_comment = ""
to_update.update({"comment": new_comment})
if new_port:
to_update.update({"port": new_port})
if new_hostname:
to_update.update({"hostname": new_hostname})
if new_name:
if name != new_name:
# Check unicity for name
query = db.session.query(target.Target.name)\
.filter_by(name=new_name).first()
if query is not None and new_name == query.name:
return utils.response('ERROR: The name "' + new_name + \
'" is already used by another target ', 417)
to_update.update({"name": new_name})
if new_targettype:
if new_targettype not in ["ssh", "mysql", "oracle", "postgresql"]:
new_targettype = "ssh"
to_update.update({"targettype": new_targettype})
if new_changepwd:
# changepwd is a boolean so we give him the boolean result of this test
to_update.update({"changepwd": new_changepwd == "True"})
if new_sessiondur:
to_update.update({"sessiondur": new_sessiondur})
try:
db.session.commit()
except exc.SQLAlchemyError as e:
return utils.response('ERROR: "' + name + '" -> ' + e.message, 409)
return utils.response('OK: "' + name + '" -> edited', 200)
@app.route("/target/delete/<name>")
def target_delete(name):
"""Delete a target in the database"""
if not name:
return utils.response("ERROR: The name is required ", 417)
# Check if the name exists
query = db.session.query(target.Target.name)\
.filter_by(name=name).first()
if query is None:
return utils.response('ERROR: No target with the name "' + name + \
'" in the database.', 417)
target_data = target.Target.query.filter_by(name=name).first()
# Delete the target from the associated targetgroups
targetgroup_list = target_data.direct_targetgroups()
for each_targetgroup in targetgroup_list:
each_targetgroup.rmtarget(target_data)
# We can now delete the target from the db
#TODO change the deletion and add deactivate field to True instead
t = db.session.query(
target.Target).filter(
target.Target.name == name)
t[0].prepare_delete()
t.delete()
try:
db.session.commit()
except exc.SQLAlchemyError as e:
return utils.response('ERROR: "' + name + '" -> ' + e.message, 409)
return utils.response('OK: "' + name + '" -> deleted', 200)
@app.route("/target/adduser", methods=["POST"])
def target_adduser():
"""Add a user in the target in the database"""
# Only POST data are handled
if request.method != "POST":
return utils.errormsg("ERROR: POST method is required ", 405)
# Simplification for the reading
username = request.form["username"]
targetname = request.form["targetname"]
# Check for required fields
if not username or not targetname:
return utils.response("ERROR: The username and targetname are" + \
" required ", 417)
# User and target have to exist in database
u = utils.get_user(username)
if not u:
return utils.response('ERROR: no user "' + username + \
'" in the database ', 417)
t = utils.get_target(targetname)
if not t:
return utils.response('ERROR: no target "' + targetname + \
'" in the database ', 417)
# Now we can add the user
t.adduser(u)
try:
db.session.commit()
except exc.SQLAlchemyError as e:
return utils.response('ERROR: "' + targetname + '" -> ' + \
e.message, 409)
utils.notif("User " + username + " has now access to " + targetname + ".",
"[PaSSHport] " + username + " can access " + targetname )
return utils.response('OK: "' + username + '" added to "' + \
targetname + '"', 200)
@app.route("/target/rmuser", methods=["POST"])
def target_rmuser():
"""Remove a user from the target in the database"""
# Only POST data are handled
if request.method != "POST":
return utils.response("ERROR: POST method is required ", 405)
# Simplification for the reading
username = request.form["username"]
targetname = request.form["targetname"]
# Check for required fields
if not username or not targetname:
return utils.response("ERROR: The username and targetname are" + \
" required ", 417)
# User and target have to exist in database
u = utils.get_user(username)
if not u:
return utils.response('ERROR: No user "' + username + \
'" in the database ', 417)
t = utils.get_target(targetname)
if not t:
return utils.response('ERROR: No target "' + targetname + \
'" in the database ', 417)
# Check if the given user is a member of the given target
if not t.username_in_target(username):
return utils.response('ERROR: The user "' + username + \
'" is not a member of the target "' + \
targetname + '" ', 417)
# Now we can remove the user
t.rmuser(u)
try:
db.session.commit()
except exc.SQLAlchemyError as e:
return utils.response('ERROR: "' + targetname + '" -> ' + \
e.message, 409)
utils.notif("User " + username + " lost access to " + targetname + ".",
"[PaSSHport] " + username + " removed from " + targetname )
return utils.response('OK: "' + username + '" removed from "' + \
targetname + '"', 200)
@app.route("/target/addusergroup", methods=["POST"])
def target_addusergroup():
"""Add a usergroup in the target in the database"""
# Only POST data are handled
if request.method != "POST":
return utils.response("ERROR: POST method is required ", 405)
# Simplification for the reading
usergroupname = request.form["usergroupname"]
targetname = request.form["targetname"]
# Check for required fields
if not usergroupname or not targetname:
return utils.response("ERROR: The usergroupname and targetname are" + \
" required ", 417)
# Usergroup and target have to exist in database
ug = utils.get_usergroup(usergroupname)
if not ug:
return utils.response('ERROR: no usergroup "' + usergroupname + \
'" in the database ', 417)
t = utils.get_target(targetname)
if not t:
return utils.response('ERROR: no target "' + targetname + \
'" in the database ', 417)
# Now we can add the user
t.addusergroup(ug)
try:
db.session.commit()
except exc.SQLAlchemyError as e:
return utils.response('ERROR: "' + targetname + '" -> ' + \
e.message, 409)
utils.notif("Users from group" + usergroupname + " can now access " + \
targetname + ".\n\nAffected users:\n" + \
str(ug.all_username_list()), "[PaSSHport] " + usergroupname + \
" can now access " + targetname)
return utils.response('OK: "' + usergroupname + '" added to "' + \
targetname + '"', 200)
@app.route("/target/rmusergroup", methods=["POST"])
def target_rmusergroup():
"""Remove a usergroup from the target in the database"""
# Only POST data are handled
if request.method != "POST":
return utils.response("ERROR: POST method is required ", 405)
# Simplification for the reading
usergroupname = request.form["usergroupname"]
targetname = request.form["targetname"]
# Check for required fields
if not usergroupname or not targetname:
return utils.response("ERROR: The usergroupname and targetname are" + \
" required ", 417)
# Usergroup and target have to exist in database
ug = utils.get_usergroup(usergroupname)
if not ug:
return utils.response('ERROR: No usergroup "' + usergroupname + \
'" in the database ', 417)
t = utils.get_target(targetname)
if not t:
return utils.response('ERROR: No target "' + targetname + \
'" in the database ', 417)
# Check if the given usergroup is a member of the given target
if not t.usergroupname_in_target(usergroupname):
return utils.response('ERROR: The usergroup "' + usergroupname + \
'" is not a member of the target "' + \
targetname + '" ', 417)
# Now we can remove the usergroup
t.rmusergroup(ug)
try:
db.session.commit()
except exc.SQLAlchemyError as e:
return utils.response('ERROR: "' + targetname + '" -> ' + \
e.message, 409)
utils.notif("Users from group" + usergroupname + " lost access to " + \
targetname + ".\n\nAffected users:\n" + \
str(ug.all_username_list()), "[PaSSHport] " + usergroupname + \
" removed from " + targetname)
return utils.response('OK: "' + usergroupname + '" removed from "' + \
targetname + '"', 200)
@app.route("/target/lastlog/<name>")
def target_lastlog(name):
"""Return the 500 last logs as json"""
#TODO pagination for ajax call on all logs
t = utils.get_target(name)
if not t:
return "{}"
return t.get_lastlog()
@app.route("/exttargetaccess/open/<ip>/<targetname>/<username>")
def extgetaccess(ip, targetname, username):
"""Create an external request to open a connection to a target"""
t = utils.get_target(targetname)
if not t:
msg = 'ERROR: No target "' + targetname + '" in the database '
app.logger.error(msg)
return utils.response(msg, 417)
#Date to stop access:
startdate = datetime.now()
stopdate = startdate + timedelta(hours=int(t.show_sessionduration())/60)
formatedstop = format(stopdate, '%Y%m%dT%H%M')
#Call the external script
process = Popen([config.OPEN_ACCESS_PATH,
t.show_targettype(),
formatedstop,
ip,
t.show_hostname(),
str(t.show_port()),
username,
t.show_name()], stdout=PIPE)
(output, err) = process.communicate()
exit_code = process.wait()
if exit_code != 0:
app.logger.error('External script return ' + str(exit_code))
app.logger.error('Output message was' + str(output))
return utils.response('ERROR: external script return ' + \
str(exit_code), 500)
if output:
# Transform the ouput on Dict
try:
output = eval(output)
except:
app.logger.error("Error on openaccess return: " + str(output))
return utils.response('Openaccess script is broken', 400)
if output["execution_status"] != "OK":
app.logger.error("Error on openaccess return: " + str(output))
return utils.response('ERROR: target seems unreachable.',
200)
# Create a exttarget object to log the connection
u = utils.get_user(username)
if not u:
return utils.response('ERROR: No user "' + username + \
'" in the database ', 417)
ta = exttargetaccess.Exttargetaccess(
startdate = startdate,
stopdate = stopdate,
userip = ip,
proxy_ip = output["proxy_ip"],
proxy_pid = output["pid"],
proxy_port = output["proxy_port"])
ta.addtarget(t)
ta.adduser(u)
db.session.add(ta)
# Try to add the targetaccess on the database
try:
db.session.commit()
except exc.SQLAlchemyError as e:
app.logger.error('ERROR registering connection demand: ' + \
'exttargetaccess "' + str(output) + '" -> ' +
str(e))
# Create the output to print
response = "Connect via " + output["proxy_ip"] + " on port " + \
output["proxy_port"] + " until " + \
format(stopdate, '%H:%M')
else:
return utils.response("Openaccess script is broken", 400)
app.logger.info(response)
return utils.response(response, 200)
@app.route("/exttargetaccess/closebyname/<targetname>/<username>")
def extcloseaccessbyname(targetname, username):
"""Close a connection determined by target name and user name"""
# Determine associated pid
et = exttargetaccess.Exttargetaccess
pidlist = et.query.filter(and_(et.target.any(name = targetname),
et.user.any(name = username),
et.proxy_pid != 0))
if not pidlist:
return utils.response("Error: this connection is not registered", 400)
return extcloseaccess(pidlist[0].proxy_pid, pidlist[0])
@app.route("/exttargetaccess/close/<pid>/<extaccess>")
def extcloseaccess(pid, extaccess):
"""Close a connection determined by the PID"""
#Call the external script
process = Popen([config.OPEN_ACCESS_PATH,
"db-close",
str(pid)], stdout=PIPE)
(output, err) = process.communicate()
exit_code = process.wait()
if exit_code != 0:
app.logger.error('External script return ' + str(exit_code))
app.logger.error('Output message was' + str(output))
return utils.response('ERROR: external script return ' + \
str(exit_code), 500)
if output:
# Transform the ouput on Dict
try:
output = eval(output)
except:
app.logger.error("Error on openaccess return: " + str(output))
return utils.response('Openaccess script is broken', 400)
if output["execution_status"] != "OK":
app.logger.error("Error on openaccess return: " + str(output))
return utils.response('ERROR: connection can not be closed.',
200)
# Set the exttargetaccess proxy_pid to 0
extaccess.set_proxy_pid(0)
try:
db.session.commit()
except exc.SQLAlchemyError as e:
return utils.response('ERROR: impossible to change the pid ' + \
'on extarget with pid: "' + pid + '" -> ' + e.message, 409)
response = "Connection closed. Click to reopen."
return utils.response(response, 200)
@app.route("/target/getpassword/<targetname>/<number>")
@app.route("/target/getpassword/<targetname>")
def getpassword(targetname, number = 20):
"""Get stored passwords associated to a target, used on automatic
root password change by passhport script"""
t = target.Target.query.filter_by(name=targetname).first()
if t is None:
return utils.response('ERROR: No target with the name "' + \
targetname + '" in the database.', 417)
# Response for datatable
output = '[\n'
i = 1
tlen = len(t.passentries)
# We decrypt only 20 first passwords to avoid long waits
while i < tlen +1 and i < int(number)+1:
output = output + t.passentries[tlen-i].notargetjson() + ",\n"
i = i+1
if output == '[\n':
return utils.response('[]', 200)
output = output[:-2] + '\n]'
return utils.response(output, 200)
|
agpl-3.0
|
[
3,
1882,
1523,
26,
11561,
13,
24,
1882,
199,
504,
7209,
492,
1056,
199,
504,
8335,
492,
3178,
12,
436,
63,
199,
504,
8335,
14,
1025,
492,
2351,
14367,
199,
504,
1145,
492,
1145,
12,
1592,
199,
504,
1145,
14,
992,
63,
1494,
492,
922,
12,
1347,
12,
922,
923,
12,
1599,
1375,
2732,
12,
19099,
3870,
199,
504,
1275,
492,
2986,
199,
504,
3873,
492,
13995,
12,
22773,
199,
504,
2197,
492,
2197,
12,
6871,
199,
646,
747,
199,
646,
1101,
199,
199,
504,
2508,
492,
15841,
465,
3778,
199,
199,
32,
571,
14,
4449,
4769,
1375,
15,
513,
531,
199,
318,
1347,
63,
513,
837,
272,
408,
1767,
314,
1347,
769,
402,
3050,
624,
272,
754,
275,
942,
272,
1827,
275,
1592,
14,
1730,
14,
1131,
8,
267,
1347,
14,
4277,
14,
354,
680,
1648,
63,
991,
8,
267,
1347,
14,
4277,
14,
354,
680,
452,
342,
339,
367,
1962,
315,
1827,
26,
267,
754,
14,
740,
8,
1143,
59,
16,
566,
339,
340,
440,
754,
26,
267,
372,
3778,
14,
1310,
480,
1944,
1347,
315,
3050,
4765,
1926,
9,
339,
372,
3778,
14,
1310,
4582,
78,
1674,
904,
8,
1099,
395,
1926,
9,
421,
199,
32,
571,
14,
4449,
4769,
1375,
15,
1733,
8316,
3401,
9579,
199,
318,
1347,
63,
1733,
8,
3401,
304,
272,
408,
1767,
282,
769,
402,
4545,
626,
1336,
314,
1627,
3851,
624,
272,
754,
275,
942,
272,
1827,
221,
275,
1592,
14,
1730,
14,
1131,
8,
1375,
14,
4277,
14,
354,
2862,
267,
1275,
1541,
8,
1375,
14,
4277,
14,
354,
14,
2930,
3647,
2,
435,
3851,
435,
2071,
2237,
60,
267,
1275,
1648,
63,
991,
8,
1375,
14,
4277,
14,
354,
680,
452,
342,
339,
367,
1962,
315,
1827,
26,
267,
754,
14,
740,
8,
1143,
59,
16,
566,
339,
340,
440,
754,
26,
267,
372,
3778,
14,
1310,
360,
1944,
1347,
4877,
314,
3851,
3546,
435,
3851,
435,
971,
2892,
5522,
1911,
3130,
1926,
9,
339,
372,
3778,
14,
1310,
4582,
78,
1674,
904,
8,
1099,
395,
1926,
9,
421,
199,
32,
571,
14,
4449,
4769,
1375,
15,
1114,
1618,
8316,
1113,
23220,
354,
9579,
199,
318,
1347,
63,
1114,
1618,
8,
1113,
12,
536,
304,
272,
408,
1767,
314,
769,
402,
1559,
642,
1347,
365,
3653,
402,
334,
1113,
930,
1181,
506,
22387,
9471,
272,
327,
2670,
367,
1415,
1504,
272,
340,
440,
536,
26,
267,
372,
3778,
14,
1310,
480,
3170,
26,
710,
536,
365,
1415,
3872,
841,
1196,
9,
339,
1347,
63,
576,
275,
1347,
14,
4277,
14,
1131,
14,
1541,
63,
991,
8,
354,
29,
354,
680,
2246,
342,
339,
340,
1347,
63,
576,
365,
488,
26,
267,
372,
3778,
14,
1310,
360,
3170,
26,
3091,
1347,
543,
314,
536,
3546,
435,
536,
435,
971,
2892,
5522,
315,
314,
3050,
3130,
841,
1196,
9,
339,
372,
3778,
14,
1310,
8,
495,
8,
1375,
63,
576,
14,
1114,
1618,
8,
1113,
1826,
1926,
9,
421,
199,
32,
571,
14,
4449,
4769,
1375,
15,
1074,
2732,
8316,
3401,
9579,
199,
318,
1347,
63,
1074,
2732,
8,
3401,
304,
272,
408,
1799,
12027,
1950,
367,
1924,
1347,
543,
282,
536,
503,
6246,
626,
28872,
1336,
314,
3851,
14,
6061,
372,
314,
754,
367,
1924,
1347,
624,
272,
754,
275,
942,
272,
1827,
221,
275,
1592,
14,
1730,
14,
1131,
8,
1375,
14,
4277,
9,
971,
267,
1275,
1541,
8,
1375,
14,
4277,
14,
4269,
14,
2930,
3647,
2,
435,
3851,
435,
2071,
531,
1204,
971,
267,
1347,
14,
4277,
14,
354,
14,
2930,
3647,
2,
435,
3851,
435,
2071,
2237,
971,
267,
1275,
1648,
63,
991,
8,
1375,
14,
4277,
14,
354,
680,
452,
342,
339,
367,
1347,
1113,
315,
1827,
26,
267,
6246,
275,
1347,
1113,
14,
4269,
267,
4676,
275,
1347,
1113,
14,
2886,
267,
1844,
275,
1347,
1113,
14,
719,
267,
8635,
1419,
275,
1347,
1113,
14,
5510,
1419,
267,
327,
1799,
13460,
24485,
267,
340,
6246,
26,
288,
340,
440,
4676,
26,
355,
4676,
275,
298,
1231,
2,
288,
340,
440,
1844,
26,
355,
1844,
275,
6928,
288,
340,
440,
8635,
1419,
26,
355,
8635,
1419,
275,
3087,
288,
327,
14012,
370,
20907,
8635,
26,
781,
2793,
1133,
2934,
370,
1104,
18020,
83,
288,
327,
15564,
370,
1640,
2412,
543,
314,
2257,
18020,
83,
570,
288,
8635,
1531,
275,
298,
5510,
446,
80,
2,
435,
620,
8,
719,
9,
435,
971,
490,
298,
298,
435,
4676,
435,
9244,
2,
435,
6246,
435,
971,
490,
298,
298,
435,
8635,
1419,
435,
298,
298,
971,
490,
3905,
79,
13635,
10348,
29,
889,
298,
435,
971,
490,
3905,
79,
2876,
24574,
19620,
1173,
13043,
2374,
15,
2307,
298,
435,
971,
490,
3905,
79,
23052,
4965,
1197,
14740,
29,
889,
298,
435,
971,
490,
3905,
79,
15175,
6372,
29,
709,
298,
435,
971,
490,
298,
7878,
9949,
2,
953,
327,
7649,
370,
4907,
436,
664,
314,
754,
288,
519,
275,
747,
14,
2253,
8,
5510,
1531,
9,
288,
340,
519,
508,
378,
26,
355,
754,
14,
740,
480,
3593,
26,
257,
298,
435,
6246,
435,
1867,
84,
2,
435,
971,
717,
1347,
1113,
14,
354,
9,
288,
587,
26,
355,
754,
14,
740,
480,
3170,
5424,
435,
6246,
435,
1867,
84,
2,
435,
971,
717,
1347,
1113,
14,
354,
435,
1867,
84,
547,
543,
642,
8635,
1414,
298,
435,
971,
717,
7340,
1107,
1233,
1035,
298,
435,
620,
8,
82,
9,
435,
26699,
298,
435,
8635,
1531,
9,
339,
340,
440,
754,
26,
267,
372,
3778,
14,
1310,
360,
1944,
1347,
6246,
4877,
314,
3851,
3546,
435,
971,
2892,
3851,
435,
5522,
1911,
3130,
1926,
9,
339,
372,
3778,
14,
1310,
4582,
78,
1674,
904,
8,
1099,
395,
1926,
9,
421,
199,
32,
571,
14,
4449,
4769,
1375,
15,
2384,
8316,
354,
9579,
199,
318,
1347,
63,
2384,
8,
354,
304,
272,
408,
1767,
1006,
666,
3595,
282,
1347,
624,
272,
327,
2670,
367,
1415,
1504,
272,
340,
440,
536,
26,
267,
372,
3778,
14,
1310,
480,
3170,
26,
710,
536,
365,
1415,
3872,
841,
1196,
9,
339,
1347,
63,
576,
275,
1347,
14,
4277,
14,
1131,
14,
1541,
63,
991,
8,
354,
29,
354,
680,
2246,
342,
339,
340,
1347,
63,
576
] |
[
1882,
1523,
26,
11561,
13,
24,
1882,
199,
504,
7209,
492,
1056,
199,
504,
8335,
492,
3178,
12,
436,
63,
199,
504,
8335,
14,
1025,
492,
2351,
14367,
199,
504,
1145,
492,
1145,
12,
1592,
199,
504,
1145,
14,
992,
63,
1494,
492,
922,
12,
1347,
12,
922,
923,
12,
1599,
1375,
2732,
12,
19099,
3870,
199,
504,
1275,
492,
2986,
199,
504,
3873,
492,
13995,
12,
22773,
199,
504,
2197,
492,
2197,
12,
6871,
199,
646,
747,
199,
646,
1101,
199,
199,
504,
2508,
492,
15841,
465,
3778,
199,
199,
32,
571,
14,
4449,
4769,
1375,
15,
513,
531,
199,
318,
1347,
63,
513,
837,
272,
408,
1767,
314,
1347,
769,
402,
3050,
624,
272,
754,
275,
942,
272,
1827,
275,
1592,
14,
1730,
14,
1131,
8,
267,
1347,
14,
4277,
14,
354,
680,
1648,
63,
991,
8,
267,
1347,
14,
4277,
14,
354,
680,
452,
342,
339,
367,
1962,
315,
1827,
26,
267,
754,
14,
740,
8,
1143,
59,
16,
566,
339,
340,
440,
754,
26,
267,
372,
3778,
14,
1310,
480,
1944,
1347,
315,
3050,
4765,
1926,
9,
339,
372,
3778,
14,
1310,
4582,
78,
1674,
904,
8,
1099,
395,
1926,
9,
421,
199,
32,
571,
14,
4449,
4769,
1375,
15,
1733,
8316,
3401,
9579,
199,
318,
1347,
63,
1733,
8,
3401,
304,
272,
408,
1767,
282,
769,
402,
4545,
626,
1336,
314,
1627,
3851,
624,
272,
754,
275,
942,
272,
1827,
221,
275,
1592,
14,
1730,
14,
1131,
8,
1375,
14,
4277,
14,
354,
2862,
267,
1275,
1541,
8,
1375,
14,
4277,
14,
354,
14,
2930,
3647,
2,
435,
3851,
435,
2071,
2237,
60,
267,
1275,
1648,
63,
991,
8,
1375,
14,
4277,
14,
354,
680,
452,
342,
339,
367,
1962,
315,
1827,
26,
267,
754,
14,
740,
8,
1143,
59,
16,
566,
339,
340,
440,
754,
26,
267,
372,
3778,
14,
1310,
360,
1944,
1347,
4877,
314,
3851,
3546,
435,
3851,
435,
971,
2892,
5522,
1911,
3130,
1926,
9,
339,
372,
3778,
14,
1310,
4582,
78,
1674,
904,
8,
1099,
395,
1926,
9,
421,
199,
32,
571,
14,
4449,
4769,
1375,
15,
1114,
1618,
8316,
1113,
23220,
354,
9579,
199,
318,
1347,
63,
1114,
1618,
8,
1113,
12,
536,
304,
272,
408,
1767,
314,
769,
402,
1559,
642,
1347,
365,
3653,
402,
334,
1113,
930,
1181,
506,
22387,
9471,
272,
327,
2670,
367,
1415,
1504,
272,
340,
440,
536,
26,
267,
372,
3778,
14,
1310,
480,
3170,
26,
710,
536,
365,
1415,
3872,
841,
1196,
9,
339,
1347,
63,
576,
275,
1347,
14,
4277,
14,
1131,
14,
1541,
63,
991,
8,
354,
29,
354,
680,
2246,
342,
339,
340,
1347,
63,
576,
365,
488,
26,
267,
372,
3778,
14,
1310,
360,
3170,
26,
3091,
1347,
543,
314,
536,
3546,
435,
536,
435,
971,
2892,
5522,
315,
314,
3050,
3130,
841,
1196,
9,
339,
372,
3778,
14,
1310,
8,
495,
8,
1375,
63,
576,
14,
1114,
1618,
8,
1113,
1826,
1926,
9,
421,
199,
32,
571,
14,
4449,
4769,
1375,
15,
1074,
2732,
8316,
3401,
9579,
199,
318,
1347,
63,
1074,
2732,
8,
3401,
304,
272,
408,
1799,
12027,
1950,
367,
1924,
1347,
543,
282,
536,
503,
6246,
626,
28872,
1336,
314,
3851,
14,
6061,
372,
314,
754,
367,
1924,
1347,
624,
272,
754,
275,
942,
272,
1827,
221,
275,
1592,
14,
1730,
14,
1131,
8,
1375,
14,
4277,
9,
971,
267,
1275,
1541,
8,
1375,
14,
4277,
14,
4269,
14,
2930,
3647,
2,
435,
3851,
435,
2071,
531,
1204,
971,
267,
1347,
14,
4277,
14,
354,
14,
2930,
3647,
2,
435,
3851,
435,
2071,
2237,
971,
267,
1275,
1648,
63,
991,
8,
1375,
14,
4277,
14,
354,
680,
452,
342,
339,
367,
1347,
1113,
315,
1827,
26,
267,
6246,
275,
1347,
1113,
14,
4269,
267,
4676,
275,
1347,
1113,
14,
2886,
267,
1844,
275,
1347,
1113,
14,
719,
267,
8635,
1419,
275,
1347,
1113,
14,
5510,
1419,
267,
327,
1799,
13460,
24485,
267,
340,
6246,
26,
288,
340,
440,
4676,
26,
355,
4676,
275,
298,
1231,
2,
288,
340,
440,
1844,
26,
355,
1844,
275,
6928,
288,
340,
440,
8635,
1419,
26,
355,
8635,
1419,
275,
3087,
288,
327,
14012,
370,
20907,
8635,
26,
781,
2793,
1133,
2934,
370,
1104,
18020,
83,
288,
327,
15564,
370,
1640,
2412,
543,
314,
2257,
18020,
83,
570,
288,
8635,
1531,
275,
298,
5510,
446,
80,
2,
435,
620,
8,
719,
9,
435,
971,
490,
298,
298,
435,
4676,
435,
9244,
2,
435,
6246,
435,
971,
490,
298,
298,
435,
8635,
1419,
435,
298,
298,
971,
490,
3905,
79,
13635,
10348,
29,
889,
298,
435,
971,
490,
3905,
79,
2876,
24574,
19620,
1173,
13043,
2374,
15,
2307,
298,
435,
971,
490,
3905,
79,
23052,
4965,
1197,
14740,
29,
889,
298,
435,
971,
490,
3905,
79,
15175,
6372,
29,
709,
298,
435,
971,
490,
298,
7878,
9949,
2,
953,
327,
7649,
370,
4907,
436,
664,
314,
754,
288,
519,
275,
747,
14,
2253,
8,
5510,
1531,
9,
288,
340,
519,
508,
378,
26,
355,
754,
14,
740,
480,
3593,
26,
257,
298,
435,
6246,
435,
1867,
84,
2,
435,
971,
717,
1347,
1113,
14,
354,
9,
288,
587,
26,
355,
754,
14,
740,
480,
3170,
5424,
435,
6246,
435,
1867,
84,
2,
435,
971,
717,
1347,
1113,
14,
354,
435,
1867,
84,
547,
543,
642,
8635,
1414,
298,
435,
971,
717,
7340,
1107,
1233,
1035,
298,
435,
620,
8,
82,
9,
435,
26699,
298,
435,
8635,
1531,
9,
339,
340,
440,
754,
26,
267,
372,
3778,
14,
1310,
360,
1944,
1347,
6246,
4877,
314,
3851,
3546,
435,
971,
2892,
3851,
435,
5522,
1911,
3130,
1926,
9,
339,
372,
3778,
14,
1310,
4582,
78,
1674,
904,
8,
1099,
395,
1926,
9,
421,
199,
32,
571,
14,
4449,
4769,
1375,
15,
2384,
8316,
354,
9579,
199,
318,
1347,
63,
2384,
8,
354,
304,
272,
408,
1767,
1006,
666,
3595,
282,
1347,
624,
272,
327,
2670,
367,
1415,
1504,
272,
340,
440,
536,
26,
267,
372,
3778,
14,
1310,
480,
3170,
26,
710,
536,
365,
1415,
3872,
841,
1196,
9,
339,
1347,
63,
576,
275,
1347,
14,
4277,
14,
1131,
14,
1541,
63,
991,
8,
354,
29,
354,
680,
2246,
342,
339,
340,
1347,
63,
576,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Elandril/SickRage
|
lib/github/tests/NamedUser.py
|
39
|
9973
|
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# #
# This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
# #
# ##############################################################################
import Framework
import github
import datetime
class NamedUser(Framework.TestCase):
def setUp(self):
Framework.TestCase.setUp(self)
self.user = self.g.get_user("jacquev6")
def testAttributesOfOtherUser(self):
self.user = self.g.get_user("nvie")
self.assertEqual(self.user.avatar_url, "https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png")
self.assertEqual(self.user.bio, None)
self.assertEqual(self.user.blog, "http://nvie.com")
self.assertEqual(self.user.collaborators, None)
self.assertEqual(self.user.company, "3rd Cloud")
self.assertEqual(self.user.created_at, datetime.datetime(2009, 5, 12, 21, 19, 38))
self.assertEqual(self.user.disk_usage, None)
self.assertEqual(self.user.email, "vincent@3rdcloud.com")
self.assertEqual(self.user.followers, 296)
self.assertEqual(self.user.following, 41)
self.assertEqual(self.user.gravatar_id, "c5a7f21b46df698f3db31c37ed0cf55a")
self.assertFalse(self.user.hireable)
self.assertEqual(self.user.html_url, "https://github.com/nvie")
self.assertEqual(self.user.id, 83844)
self.assertEqual(self.user.location, "Netherlands")
self.assertEqual(self.user.login, "nvie")
self.assertEqual(self.user.name, "Vincent Driessen")
self.assertEqual(self.user.owned_private_repos, None)
self.assertEqual(self.user.plan, None)
self.assertEqual(self.user.private_gists, None)
self.assertEqual(self.user.public_gists, 16)
self.assertEqual(self.user.public_repos, 61)
self.assertEqual(self.user.total_private_repos, None)
self.assertEqual(self.user.type, "User")
self.assertEqual(self.user.url, "https://api.github.com/users/nvie")
def testAttributesOfSelf(self):
self.assertEqual(self.user.avatar_url, "https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png")
self.assertEqual(self.user.bio, "")
self.assertEqual(self.user.blog, "http://vincent-jacques.net")
self.assertEqual(self.user.collaborators, 0)
self.assertEqual(self.user.company, "Criteo")
self.assertEqual(self.user.created_at, datetime.datetime(2010, 7, 9, 6, 10, 6))
self.assertEqual(self.user.disk_usage, 17080)
self.assertEqual(self.user.email, "vincent@vincent-jacques.net")
self.assertEqual(self.user.followers, 13)
self.assertEqual(self.user.following, 24)
self.assertEqual(self.user.gravatar_id, "b68de5ae38616c296fa345d2b9df2225")
self.assertFalse(self.user.hireable)
self.assertEqual(self.user.html_url, "https://github.com/jacquev6")
self.assertEqual(self.user.id, 327146)
self.assertEqual(self.user.location, "Paris, France")
self.assertEqual(self.user.login, "jacquev6")
self.assertEqual(self.user.name, "Vincent Jacques")
self.assertEqual(self.user.owned_private_repos, 5)
self.assertEqual(self.user.plan.name, "micro")
self.assertEqual(self.user.plan.collaborators, 1)
self.assertEqual(self.user.plan.space, 614400)
self.assertEqual(self.user.plan.private_repos, 5)
self.assertEqual(self.user.private_gists, 5)
self.assertEqual(self.user.public_gists, 2)
self.assertEqual(self.user.public_repos, 11)
self.assertEqual(self.user.total_private_repos, 5)
self.assertEqual(self.user.type, "User")
self.assertEqual(self.user.url, "https://api.github.com/users/jacquev6")
def testGetGists(self):
self.assertListKeyEqual(self.user.get_gists(), lambda g: g.description, ["Gist created by PyGithub", "FairThreadPoolPool.cpp", "How to error 500 Github API v3, as requested by Rick (GitHub Staff)", "Cadfael: order of episodes in French DVD edition"])
def testGetFollowers(self):
self.assertListKeyEqual(self.user.get_followers(), lambda f: f.login, ["jnorthrup", "brugidou", "regisb", "walidk", "afzalkhan", "sdanzan", "vineus", "gturri", "fjardon", "cjuniet", "jardon-u", "kamaradclimber", "L42y"])
def testGetFollowing(self):
self.assertListKeyEqual(self.user.get_following(), lambda f: f.login, ["nvie", "schacon", "jamis", "chad", "unclebob", "dabrahams", "jnorthrup", "brugidou", "regisb", "walidk", "tanzilli", "fjardon", "r3c", "sdanzan", "vineus", "cjuniet", "gturri", "ant9000", "asquini", "claudyus", "jardon-u", "s-bernard", "kamaradclimber", "Lyloa"])
def testHasInFollowing(self):
nvie = self.g.get_user("nvie")
self.assertTrue(self.user.has_in_following(nvie))
def testGetOrgs(self):
self.assertListKeyEqual(self.user.get_orgs(), lambda o: o.login, ["BeaverSoftware"])
def testGetRepo(self):
self.assertEqual(self.user.get_repo("PyGithub").description, "Python library implementing the full Github API v3")
def testGetRepos(self):
self.assertListKeyEqual(self.user.get_repos(), lambda r: r.name, ["TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE"])
def testGetReposWithType(self):
self.assertListKeyEqual(self.user.get_repos("owner"), lambda r: r.name, ["django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE"])
def testGetWatched(self):
self.assertListKeyEqual(self.user.get_watched(), lambda r: r.name, ["git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "PyGithub", "django", "django", "TestPyGithub"])
def testGetStarred(self):
self.assertListKeyEqual(self.user.get_starred(), lambda r: r.name, ["git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "amaunet", "django", "django", "moviePlanning", "folly"])
def testGetSubscriptions(self):
self.assertListKeyEqual(self.user.get_subscriptions(), lambda r: r.name, ["ViDE", "Boost.HierarchicalEnum", "QuadProgMm", "DrawSyntax", "DrawTurksHead", "PrivateStuff", "vincent-jacques.net", "Hacking", "C4Planner", "developer.github.com", "PyGithub", "PyGithub", "django", "CinePlanning", "PyGithub", "PyGithub", "PyGithub", "IpMap", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub"])
def testGetEvents(self):
self.assertListKeyBegin(self.user.get_events(), lambda e: e.type, ["GistEvent", "IssueCommentEvent", "PushEvent", "IssuesEvent"])
def testGetPublicEvents(self):
self.assertListKeyBegin(self.user.get_public_events(), lambda e: e.type, ["PushEvent", "CreateEvent", "GistEvent", "IssuesEvent"])
def testGetPublicReceivedEvents(self):
self.assertListKeyBegin(self.user.get_public_received_events(), lambda e: e.type, ["IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent"])
def testGetReceivedEvents(self):
self.assertListKeyBegin(self.user.get_received_events(), lambda e: e.type, ["IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent"])
def testGetKeys(self):
self.assertListKeyEqual(self.user.get_keys(), lambda k: k.id, [3557894, 3791954, 3937333, 4051357, 4051492])
|
gpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
11945,
309,
1898,
83,
436,
4190,
11945,
381,
199,
3,
26209,
327,
199,
3,
1898,
6029,
28882,
2946,
1603,
645,
19658,
665,
11908,
2946,
32,
11908,
2946,
13,
9299,
19658,
14,
846,
30,
463,
327,
199,
3,
1898,
6029,
3107,
2210,
262,
665,
806,
285,
262,
32,
27719,
75,
14,
846,
30,
32543,
327,
199,
3,
1898,
6171,
28882,
2946,
1603,
645,
19658,
665,
11908,
2946,
32,
11908,
2946,
13,
9299,
19658,
14,
846,
30,
463,
327,
199,
3,
26209,
327,
199,
3,
961,
570,
365,
1777,
402,
1611,
14772,
14,
1455,
921,
9299,
544,
86,
22,
14,
5031,
14,
957,
15,
2713,
14772,
15,
3515,
327,
199,
3,
26209,
327,
199,
3,
1611,
14772,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
652,
1334,
259,
327,
199,
3,
314,
2895,
402,
314,
1664,
6401,
1696,
1684,
844,
465,
3267,
701,
314,
2868,
221,
327,
199,
3,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
334,
292,
2195,
945,
9,
259,
327,
199,
3,
1263,
2945,
1015,
14,
2476,
13235,
327,
199,
3,
26209,
327,
199,
3,
1611,
14772,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
1325,
2428,
1821,
221,
327,
199,
3,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
3169,
503,
3092,
259,
327,
199,
3,
2381,
437,
3115,
3104,
14,
1666,
314,
1664,
6401,
1696,
1684,
844,
367,
1655,
327,
199,
3,
2436,
14,
6208,
258,
327,
199,
3,
26209,
327,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
844,
258,
327,
199,
3,
3180,
543,
1611,
14772,
14,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
3777,
327,
199,
3,
26209,
327,
199,
3,
221,
4605,
199,
199,
646,
22545,
199,
199,
646,
12869,
199,
646,
2197,
421,
199,
533,
16198,
1899,
8,
16442,
14,
1746,
304,
272,
347,
3613,
8,
277,
304,
267,
22545,
14,
1746,
14,
5996,
8,
277,
9,
267,
291,
14,
751,
275,
291,
14,
71,
14,
362,
63,
751,
480,
9299,
544,
86,
22,
531,
339,
347,
511,
5379,
3466,
8632,
1899,
8,
277,
304,
267,
291,
14,
751,
275,
291,
14,
71,
14,
362,
63,
751,
480,
78,
6620,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
14584,
63,
633,
12,
298,
2859,
921,
7817,
14,
926,
28694,
14,
957,
15,
14584,
15,
67,
21,
65,
23,
70,
2025,
66,
2466,
1587,
20983,
70,
19,
697,
2192,
67,
1401,
379,
16,
2177,
1229,
65,
31,
68,
29,
2859,
921,
65,
11242,
14,
69,
14,
1151,
14541,
73,
14,
846,
15,
12186,
14,
5031,
14,
957,
5,
18,
38,
4782,
5,
18,
38,
926,
16305,
4291,
5,
18,
38,
926,
28694,
13,
10037,
14,
4524,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
17614,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
11486,
12,
298,
1014,
921,
78,
6620,
14,
957,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
761,
5561,
269,
2750,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
4627,
12,
298,
19,
6883,
8142,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
3966,
63,
292,
12,
2197,
14,
2083,
8,
8664,
12,
959,
12,
3144,
12,
7829,
12,
5851,
12,
10448,
430,
267,
291,
14,
629,
8,
277,
14,
751,
14,
4032,
63,
3807,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
2123,
12,
298,
11908,
2946,
32,
19,
6883,
4091,
14,
957,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
22648,
12,
499,
2534,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
21589,
12,
13385,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
926,
28694,
63,
344,
12,
298,
67,
21,
65,
23,
70,
2025,
66,
2466,
1587,
20983,
70,
19,
697,
2192,
67,
1401,
379,
16,
2177,
1229,
65,
531,
267,
291,
14,
3334,
8,
277,
14,
751,
14,
72,
3621,
461,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
1360,
63,
633,
12,
298,
2859,
921,
5031,
14,
957,
15,
78,
6620,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
344,
12,
1695,
8188,
20,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
1985,
12,
298,
4698,
728,
31813,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
2886,
12,
298,
78,
6620,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
354,
12,
298,
54,
262,
2946,
577,
1996,
2464,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
24346,
63,
4239,
63,
11857,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
5140,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
4239,
63,
71,
1670,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
3455,
63,
71,
1670,
12,
3193,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
3455,
63,
11857,
12,
17017,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
2923,
63,
4239,
63,
11857,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
466,
12,
298,
1899,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
633,
12,
298,
2859,
921,
1246,
14,
5031,
14,
957,
15,
3707,
15,
78,
6620,
531,
339,
347,
511,
5379,
3466,
12887,
8,
277,
304,
267,
291,
14,
629,
8,
277,
14,
751,
14,
14584,
63,
633,
12,
298,
2859,
921,
7817,
14,
926,
28694,
14,
957,
15,
14584,
15,
66,
2333,
271,
21,
3624,
8040,
975,
67,
11700,
667,
9908,
68,
18,
66,
25,
1587,
1081,
821,
31,
68,
29,
2859,
921,
65,
11242,
14,
69,
14,
1151,
14541,
73,
14,
846,
15,
12186,
14,
5031,
14,
957,
5,
18,
38,
4782,
5,
18,
38,
926,
16305,
4291,
5,
18,
38,
926,
28694,
13,
10037,
14,
4524,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
17614,
12,
6899,
267,
291,
14,
629,
8,
277,
14,
751,
14,
11486,
12,
298,
1014,
921,
11908,
2946,
13,
9299,
19658,
14
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
11945,
309,
1898,
83,
436,
4190,
11945,
381,
199,
3,
26209,
327,
199,
3,
1898,
6029,
28882,
2946,
1603,
645,
19658,
665,
11908,
2946,
32,
11908,
2946,
13,
9299,
19658,
14,
846,
30,
463,
327,
199,
3,
1898,
6029,
3107,
2210,
262,
665,
806,
285,
262,
32,
27719,
75,
14,
846,
30,
32543,
327,
199,
3,
1898,
6171,
28882,
2946,
1603,
645,
19658,
665,
11908,
2946,
32,
11908,
2946,
13,
9299,
19658,
14,
846,
30,
463,
327,
199,
3,
26209,
327,
199,
3,
961,
570,
365,
1777,
402,
1611,
14772,
14,
1455,
921,
9299,
544,
86,
22,
14,
5031,
14,
957,
15,
2713,
14772,
15,
3515,
327,
199,
3,
26209,
327,
199,
3,
1611,
14772,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
652,
1334,
259,
327,
199,
3,
314,
2895,
402,
314,
1664,
6401,
1696,
1684,
844,
465,
3267,
701,
314,
2868,
221,
327,
199,
3,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
334,
292,
2195,
945,
9,
259,
327,
199,
3,
1263,
2945,
1015,
14,
2476,
13235,
327,
199,
3,
26209,
327,
199,
3,
1611,
14772,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
1325,
2428,
1821,
221,
327,
199,
3,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
3169,
503,
3092,
259,
327,
199,
3,
2381,
437,
3115,
3104,
14,
1666,
314,
1664,
6401,
1696,
1684,
844,
367,
1655,
327,
199,
3,
2436,
14,
6208,
258,
327,
199,
3,
26209,
327,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
844,
258,
327,
199,
3,
3180,
543,
1611,
14772,
14,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
3777,
327,
199,
3,
26209,
327,
199,
3,
221,
4605,
199,
199,
646,
22545,
199,
199,
646,
12869,
199,
646,
2197,
421,
199,
533,
16198,
1899,
8,
16442,
14,
1746,
304,
272,
347,
3613,
8,
277,
304,
267,
22545,
14,
1746,
14,
5996,
8,
277,
9,
267,
291,
14,
751,
275,
291,
14,
71,
14,
362,
63,
751,
480,
9299,
544,
86,
22,
531,
339,
347,
511,
5379,
3466,
8632,
1899,
8,
277,
304,
267,
291,
14,
751,
275,
291,
14,
71,
14,
362,
63,
751,
480,
78,
6620,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
14584,
63,
633,
12,
298,
2859,
921,
7817,
14,
926,
28694,
14,
957,
15,
14584,
15,
67,
21,
65,
23,
70,
2025,
66,
2466,
1587,
20983,
70,
19,
697,
2192,
67,
1401,
379,
16,
2177,
1229,
65,
31,
68,
29,
2859,
921,
65,
11242,
14,
69,
14,
1151,
14541,
73,
14,
846,
15,
12186,
14,
5031,
14,
957,
5,
18,
38,
4782,
5,
18,
38,
926,
16305,
4291,
5,
18,
38,
926,
28694,
13,
10037,
14,
4524,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
17614,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
11486,
12,
298,
1014,
921,
78,
6620,
14,
957,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
761,
5561,
269,
2750,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
4627,
12,
298,
19,
6883,
8142,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
3966,
63,
292,
12,
2197,
14,
2083,
8,
8664,
12,
959,
12,
3144,
12,
7829,
12,
5851,
12,
10448,
430,
267,
291,
14,
629,
8,
277,
14,
751,
14,
4032,
63,
3807,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
2123,
12,
298,
11908,
2946,
32,
19,
6883,
4091,
14,
957,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
22648,
12,
499,
2534,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
21589,
12,
13385,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
926,
28694,
63,
344,
12,
298,
67,
21,
65,
23,
70,
2025,
66,
2466,
1587,
20983,
70,
19,
697,
2192,
67,
1401,
379,
16,
2177,
1229,
65,
531,
267,
291,
14,
3334,
8,
277,
14,
751,
14,
72,
3621,
461,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
1360,
63,
633,
12,
298,
2859,
921,
5031,
14,
957,
15,
78,
6620,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
344,
12,
1695,
8188,
20,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
1985,
12,
298,
4698,
728,
31813,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
2886,
12,
298,
78,
6620,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
354,
12,
298,
54,
262,
2946,
577,
1996,
2464,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
24346,
63,
4239,
63,
11857,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
5140,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
4239,
63,
71,
1670,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
3455,
63,
71,
1670,
12,
3193,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
3455,
63,
11857,
12,
17017,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
2923,
63,
4239,
63,
11857,
12,
488,
9,
267,
291,
14,
629,
8,
277,
14,
751,
14,
466,
12,
298,
1899,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
633,
12,
298,
2859,
921,
1246,
14,
5031,
14,
957,
15,
3707,
15,
78,
6620,
531,
339,
347,
511,
5379,
3466,
12887,
8,
277,
304,
267,
291,
14,
629,
8,
277,
14,
751,
14,
14584,
63,
633,
12,
298,
2859,
921,
7817,
14,
926,
28694,
14,
957,
15,
14584,
15,
66,
2333,
271,
21,
3624,
8040,
975,
67,
11700,
667,
9908,
68,
18,
66,
25,
1587,
1081,
821,
31,
68,
29,
2859,
921,
65,
11242,
14,
69,
14,
1151,
14541,
73,
14,
846,
15,
12186,
14,
5031,
14,
957,
5,
18,
38,
4782,
5,
18,
38,
926,
16305,
4291,
5,
18,
38,
926,
28694,
13,
10037,
14,
4524,
531,
267,
291,
14,
629,
8,
277,
14,
751,
14,
17614,
12,
6899,
267,
291,
14,
629,
8,
277,
14,
751,
14,
11486,
12,
298,
1014,
921,
11908,
2946,
13,
9299,
19658,
14,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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wave
import alsaaudio as aa
import decoder
import signal
import sys
import curses
stdscr = curses.initscr()
curses.cbreak()
curses.noecho()
curses.curs_set(0)
stdscr.keypad(1)
height = 16
def drawData(data, x, y):
for i in range(len(data)):
v = data[i]
for j in range(height):
c = ' '
if (j <= v - 1):
c = '#'
stdscr.addstr(y + height - 1 - j, x + i, c)
# Initialize matrix
matrix = [0, 0, 0, 0, 0, 0, 0, 0]
power = []
weighting = [2, 2, 8, 8, 16, 32, 64, 64] # Change these according to taste
# Set up audio
wavfile = wave.open('data/rebel-theme.wav','r')
sampleRate = wavfile.getframerate()
numChannels = wavfile.getnchannels()
chunk = 4096 # Use a multiple of 8
def signal_handler(signal, frame):
print('hi')
curses.nocbreak()
stdscr.keypad(0)
curses.echo()
curses.endwin()
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
output = aa.PCM(aa.PCM_PLAYBACK, aa.PCM_NORMAL)
output.setchannels(numChannels)
output.setrate(sampleRate)
output.setformat(aa.PCM_FORMAT_S16_LE)
output.setperiodsize(chunk)
# Return power array index corresponding to a particular frequency
def piff(val):
return int(2 * chunk * val / sampleRate)
def calculateLevels(sampleData, chunk):
global matrix
# Convert raw data (ASCII string) to numpy array
data = struct.unpack("%dh" % (len(sampleData) / 2), sampleData)
data = np.array(data, dtype='h')
# Apply FFT - real data
fourier = np.fft.rfft(data)
# Remove last element in array to make it the same size as chunk
fourier = np.delete(fourier, len(fourier) - 1)
# Find average 'amplitude' for specific frequency ranges in Hz
power = np.abs(fourier)
low = 0
high = 156.25
for i in range(8):
matrix[i] = int(np.mean(power[piff(low) : piff(high) : 1]))
low = high
high *= 2
# Tidy up column values for the LED matrix
matrix = np.divide(np.multiply(matrix, weighting), 8000000 / height)
# Set floor at 0 and ceiling at 8 for LED matrix
matrix = matrix.clip(0, height)
return matrix
lastTime = time.clock()
frameTime = chunk / sampleRate
data = wavfile.readframes(chunk)
while data != '' and len(data) > 0:
output.write(data)
matrix = calculateLevels(data, chunk)
drawData(matrix, 0, 0)
data = wavfile.readframes(chunk)
stdscr.refresh()
#key = curses.getch()
now = time.clock()
time.sleep(max(frameTime - (now - lastTime), 0))
lastTime = now
|
mit
|
[
646,
2680,
465,
980,
199,
646,
3473,
199,
646,
12204,
199,
646,
2702,
199,
646,
900,
199,
646,
12204,
199,
646,
741,
83,
2158,
5208,
465,
18319,
199,
646,
10334,
199,
646,
4673,
199,
646,
984,
199,
646,
15429,
199,
199,
1516,
11047,
275,
15429,
14,
826,
11047,
342,
199,
12026,
14,
2894,
1693,
342,
199,
12026,
14,
889,
7878,
342,
199,
12026,
14,
17255,
63,
409,
8,
16,
9,
199,
1516,
11047,
14,
498,
6226,
8,
17,
9,
199,
199,
3333,
275,
3193,
199,
199,
318,
5954,
1451,
8,
576,
12,
671,
12,
612,
304,
272,
367,
284,
315,
1425,
8,
552,
8,
576,
2298,
267,
373,
275,
666,
59,
73,
61,
267,
367,
1335,
315,
1425,
8,
3333,
304,
288,
286,
275,
283,
283,
288,
340,
334,
74,
2695,
373,
446,
413,
304,
355,
286,
275,
19619,
288,
2418,
11047,
14,
525,
495,
8,
89,
435,
4569,
446,
413,
446,
1335,
12,
671,
435,
284,
12,
286,
9,
199,
199,
3,
11578,
3634,
199,
3642,
275,
359,
16,
12,
378,
12,
378,
12,
378,
12,
378,
12,
378,
12,
378,
12,
378,
61,
199,
5652,
275,
942,
199,
3463,
316,
275,
359,
18,
12,
499,
12,
1695,
12,
1695,
12,
3193,
12,
4337,
12,
5049,
12,
5049,
61,
327,
7743,
3520,
7182,
370,
307,
9209,
199,
199,
3,
2494,
1536,
10491,
199,
19118,
493,
275,
12204,
14,
1490,
360,
576,
15,
264,
20621,
13,
7915,
14,
19118,
1673,
82,
358,
199,
3271,
6621,
275,
336,
1214,
493,
14,
20912,
1866,
342,
199,
1507,
27138,
275,
336,
1214,
493,
14,
362,
78,
6324,
342,
199,
4604,
275,
17125,
327,
3645,
282,
3663,
402,
1695,
199,
199,
318,
4673,
63,
2232,
8,
4653,
12,
2787,
304,
272,
870,
360,
5812,
358,
272,
15429,
14,
23507,
4785,
342,
272,
2418,
11047,
14,
498,
6226,
8,
16,
9,
272,
15429,
14,
7878,
342,
272,
15429,
14,
500,
2676,
342,
272,
984,
14,
2224,
8,
16,
9,
199,
4653,
14,
4653,
8,
4653,
14,
21223,
12,
4673,
63,
2232,
9,
199,
199,
1199,
275,
18319,
14,
4222,
45,
8,
2158,
14,
4222,
45,
63,
11625,
7111,
12,
18319,
14,
4222,
45,
63,
10765,
9,
199,
1199,
14,
409,
6324,
8,
1507,
27138,
9,
199,
1199,
14,
409,
1866,
8,
3271,
6621,
9,
199,
1199,
14,
409,
908,
8,
2158,
14,
4222,
45,
63,
4807,
63,
51,
975,
63,
906,
9,
199,
1199,
14,
409,
5191,
890,
8,
4604,
9,
199,
199,
3,
1432,
7074,
1625,
1478,
5226,
370,
282,
6770,
9857,
199,
318,
6682,
556,
8,
637,
304,
272,
372,
1109,
8,
18,
627,
3728,
627,
1139,
1182,
2690,
6621,
9,
272,
199,
318,
8671,
4670,
83,
8,
3271,
1451,
12,
3728,
304,
272,
2288,
3634,
272,
327,
7905,
3066,
666,
334,
12292,
1059,
9,
370,
2680,
1625,
272,
666,
275,
2702,
14,
5301,
3647,
7821,
2,
450,
334,
552,
8,
3271,
1451,
9,
1182,
499,
395,
2690,
1451,
9,
272,
666,
275,
980,
14,
1144,
8,
576,
12,
2152,
534,
72,
358,
272,
327,
14618,
29484,
446,
3363,
666,
272,
11648,
4446,
275,
980,
14,
9996,
14,
82,
9996,
8,
576,
9,
272,
327,
5852,
2061,
1819,
315,
1625,
370,
1852,
652,
314,
2011,
1568,
465,
3728,
272,
11648,
4446,
275,
980,
14,
1807,
8,
545,
2302,
281,
12,
822,
8,
545,
2302,
281,
9,
446,
413,
9,
272,
327,
6668,
8095,
283,
31928,
7,
367,
2488,
9857,
12271,
315,
30152,
272,
7074,
275,
980,
14,
2101,
8,
545,
2302,
281,
9,
272,
6465,
275,
378,
272,
4721,
275,
32609,
14,
821,
272,
367,
284,
315,
1425,
8,
24,
304,
267,
3634,
59,
73,
61,
275,
1109,
8,
1590,
14,
3670,
8,
5652,
59,
1038,
556,
8,
674,
9,
520,
6682,
556,
8,
6260,
9,
520,
413,
2459,
267,
6465,
275,
4721,
267,
4721,
9000,
499,
272,
327,
377,
344,
89,
1536,
2763,
1338,
367,
314,
491,
1149,
3634,
272,
3634,
275,
980,
14,
16081,
8,
1590,
14,
13710,
8,
3642,
12,
5401,
316,
395,
1695,
3273,
1182,
4569,
9,
272,
327,
2494,
19841,
737,
378,
436,
10142,
5662,
737,
1695,
367,
491,
1149,
3634,
272,
3634,
275,
3634,
14,
7548,
8,
16,
12,
4569,
9,
272,
372,
3634,
199,
199,
2019,
1366,
275,
900,
14,
9597,
342,
199,
1943,
1366,
275,
3728,
1182,
2690,
6621,
199,
199,
576,
275,
336,
1214,
493,
14,
739,
8444,
8,
4604,
9,
199,
6710,
666,
1137,
2125,
436,
822,
8,
576,
9,
690,
378,
26,
272,
1072,
14,
952,
8,
576,
9,
272,
3634,
275,
8671,
4670,
83,
8,
576,
12,
3728,
9,
272,
5954,
1451,
8,
3642,
12,
378,
12,
378,
9,
272,
666,
275,
336,
1214,
493,
14,
739,
8444,
8,
4604,
9,
339,
2418,
11047,
14,
6635,
342,
272,
327,
498,
275,
15429,
14,
362,
335,
342,
339,
3063,
275,
900,
14,
9597,
342,
272,
900,
14,
4532,
8,
988,
8,
1943,
1366,
446,
334,
2131,
446,
2061,
1366,
395,
378,
430,
272,
2061,
1366,
275,
3063,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2680,
465,
980,
199,
646,
3473,
199,
646,
12204,
199,
646,
2702,
199,
646,
900,
199,
646,
12204,
199,
646,
741,
83,
2158,
5208,
465,
18319,
199,
646,
10334,
199,
646,
4673,
199,
646,
984,
199,
646,
15429,
199,
199,
1516,
11047,
275,
15429,
14,
826,
11047,
342,
199,
12026,
14,
2894,
1693,
342,
199,
12026,
14,
889,
7878,
342,
199,
12026,
14,
17255,
63,
409,
8,
16,
9,
199,
1516,
11047,
14,
498,
6226,
8,
17,
9,
199,
199,
3333,
275,
3193,
199,
199,
318,
5954,
1451,
8,
576,
12,
671,
12,
612,
304,
272,
367,
284,
315,
1425,
8,
552,
8,
576,
2298,
267,
373,
275,
666,
59,
73,
61,
267,
367,
1335,
315,
1425,
8,
3333,
304,
288,
286,
275,
283,
283,
288,
340,
334,
74,
2695,
373,
446,
413,
304,
355,
286,
275,
19619,
288,
2418,
11047,
14,
525,
495,
8,
89,
435,
4569,
446,
413,
446,
1335,
12,
671,
435,
284,
12,
286,
9,
199,
199,
3,
11578,
3634,
199,
3642,
275,
359,
16,
12,
378,
12,
378,
12,
378,
12,
378,
12,
378,
12,
378,
12,
378,
61,
199,
5652,
275,
942,
199,
3463,
316,
275,
359,
18,
12,
499,
12,
1695,
12,
1695,
12,
3193,
12,
4337,
12,
5049,
12,
5049,
61,
327,
7743,
3520,
7182,
370,
307,
9209,
199,
199,
3,
2494,
1536,
10491,
199,
19118,
493,
275,
12204,
14,
1490,
360,
576,
15,
264,
20621,
13,
7915,
14,
19118,
1673,
82,
358,
199,
3271,
6621,
275,
336,
1214,
493,
14,
20912,
1866,
342,
199,
1507,
27138,
275,
336,
1214,
493,
14,
362,
78,
6324,
342,
199,
4604,
275,
17125,
327,
3645,
282,
3663,
402,
1695,
199,
199,
318,
4673,
63,
2232,
8,
4653,
12,
2787,
304,
272,
870,
360,
5812,
358,
272,
15429,
14,
23507,
4785,
342,
272,
2418,
11047,
14,
498,
6226,
8,
16,
9,
272,
15429,
14,
7878,
342,
272,
15429,
14,
500,
2676,
342,
272,
984,
14,
2224,
8,
16,
9,
199,
4653,
14,
4653,
8,
4653,
14,
21223,
12,
4673,
63,
2232,
9,
199,
199,
1199,
275,
18319,
14,
4222,
45,
8,
2158,
14,
4222,
45,
63,
11625,
7111,
12,
18319,
14,
4222,
45,
63,
10765,
9,
199,
1199,
14,
409,
6324,
8,
1507,
27138,
9,
199,
1199,
14,
409,
1866,
8,
3271,
6621,
9,
199,
1199,
14,
409,
908,
8,
2158,
14,
4222,
45,
63,
4807,
63,
51,
975,
63,
906,
9,
199,
1199,
14,
409,
5191,
890,
8,
4604,
9,
199,
199,
3,
1432,
7074,
1625,
1478,
5226,
370,
282,
6770,
9857,
199,
318,
6682,
556,
8,
637,
304,
272,
372,
1109,
8,
18,
627,
3728,
627,
1139,
1182,
2690,
6621,
9,
272,
199,
318,
8671,
4670,
83,
8,
3271,
1451,
12,
3728,
304,
272,
2288,
3634,
272,
327,
7905,
3066,
666,
334,
12292,
1059,
9,
370,
2680,
1625,
272,
666,
275,
2702,
14,
5301,
3647,
7821,
2,
450,
334,
552,
8,
3271,
1451,
9,
1182,
499,
395,
2690,
1451,
9,
272,
666,
275,
980,
14,
1144,
8,
576,
12,
2152,
534,
72,
358,
272,
327,
14618,
29484,
446,
3363,
666,
272,
11648,
4446,
275,
980,
14,
9996,
14,
82,
9996,
8,
576,
9,
272,
327,
5852,
2061,
1819,
315,
1625,
370,
1852,
652,
314,
2011,
1568,
465,
3728,
272,
11648,
4446,
275,
980,
14,
1807,
8,
545,
2302,
281,
12,
822,
8,
545,
2302,
281,
9,
446,
413,
9,
272,
327,
6668,
8095,
283,
31928,
7,
367,
2488,
9857,
12271,
315,
30152,
272,
7074,
275,
980,
14,
2101,
8,
545,
2302,
281,
9,
272,
6465,
275,
378,
272,
4721,
275,
32609,
14,
821,
272,
367,
284,
315,
1425,
8,
24,
304,
267,
3634,
59,
73,
61,
275,
1109,
8,
1590,
14,
3670,
8,
5652,
59,
1038,
556,
8,
674,
9,
520,
6682,
556,
8,
6260,
9,
520,
413,
2459,
267,
6465,
275,
4721,
267,
4721,
9000,
499,
272,
327,
377,
344,
89,
1536,
2763,
1338,
367,
314,
491,
1149,
3634,
272,
3634,
275,
980,
14,
16081,
8,
1590,
14,
13710,
8,
3642,
12,
5401,
316,
395,
1695,
3273,
1182,
4569,
9,
272,
327,
2494,
19841,
737,
378,
436,
10142,
5662,
737,
1695,
367,
491,
1149,
3634,
272,
3634,
275,
3634,
14,
7548,
8,
16,
12,
4569,
9,
272,
372,
3634,
199,
199,
2019,
1366,
275,
900,
14,
9597,
342,
199,
1943,
1366,
275,
3728,
1182,
2690,
6621,
199,
199,
576,
275,
336,
1214,
493,
14,
739,
8444,
8,
4604,
9,
199,
6710,
666,
1137,
2125,
436,
822,
8,
576,
9,
690,
378,
26,
272,
1072,
14,
952,
8,
576,
9,
272,
3634,
275,
8671,
4670,
83,
8,
576,
12,
3728,
9,
272,
5954,
1451,
8,
3642,
12,
378,
12,
378,
9,
272,
666,
275,
336,
1214,
493,
14,
739,
8444,
8,
4604,
9,
339,
2418,
11047,
14,
6635,
342,
272,
327,
498,
275,
15429,
14,
362,
335,
342,
339,
3063,
275,
900,
14,
9597,
342,
272,
900,
14,
4532,
8,
988,
8,
1943,
1366,
446,
334,
2131,
446,
2061,
1366,
395,
378,
430,
272,
2061,
1366,
275,
3063,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32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,
0,
0,
0,
0,
0,
0,
0,
0
] |
dtroyer/python-openstacksdk
|
openstack/tests/functional/object_store/v1/test_obj.py
|
4
|
5971
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from openstack.tests.functional import base
class TestObject(base.BaseFunctionalTest):
DATA = b'abc'
def setUp(self):
super(TestObject, self).setUp()
self.require_service('object-store')
self.FOLDER = self.getUniqueString()
self.FILE = self.getUniqueString()
self.conn.object_store.create_container(name=self.FOLDER)
self.addCleanup(self.conn.object_store.delete_container, self.FOLDER)
self.sot = self.conn.object_store.upload_object(
container=self.FOLDER, name=self.FILE, data=self.DATA)
self.addEmptyCleanup(
self.conn.object_store.delete_object, self.sot,
ignore_missing=False)
def test_list(self):
names = [o.name for o
in self.conn.object_store.objects(container=self.FOLDER)]
self.assertIn(self.FILE, names)
def test_download_object(self):
result = self.conn.object_store.download_object(
self.FILE, container=self.FOLDER)
self.assertEqual(self.DATA, result)
result = self.conn.object_store.download_object(self.sot)
self.assertEqual(self.DATA, result)
def test_system_metadata(self):
# get system metadata
obj = self.conn.object_store.get_object_metadata(
self.FILE, container=self.FOLDER)
# TODO(shade) obj.bytes is coming up None on python3 but not python2
# self.assertGreaterEqual(0, obj.bytes)
self.assertIsNotNone(obj.etag)
# set system metadata
obj = self.conn.object_store.get_object_metadata(
self.FILE, container=self.FOLDER)
self.assertIsNone(obj.content_disposition)
self.assertIsNone(obj.content_encoding)
self.conn.object_store.set_object_metadata(
obj, content_disposition='attachment', content_encoding='gzip')
obj = self.conn.object_store.get_object_metadata(obj)
self.assertEqual('attachment', obj.content_disposition)
self.assertEqual('gzip', obj.content_encoding)
# update system metadata
self.conn.object_store.set_object_metadata(
obj, content_encoding='deflate')
obj = self.conn.object_store.get_object_metadata(obj)
self.assertEqual('attachment', obj.content_disposition)
self.assertEqual('deflate', obj.content_encoding)
# set custom metadata
self.conn.object_store.set_object_metadata(obj, k0='v0')
obj = self.conn.object_store.get_object_metadata(obj)
self.assertIn('k0', obj.metadata)
self.assertEqual('v0', obj.metadata['k0'])
self.assertEqual('attachment', obj.content_disposition)
self.assertEqual('deflate', obj.content_encoding)
# unset more system metadata
self.conn.object_store.delete_object_metadata(
obj, keys=['content_disposition'])
obj = self.conn.object_store.get_object_metadata(obj)
self.assertIn('k0', obj.metadata)
self.assertEqual('v0', obj.metadata['k0'])
self.assertIsNone(obj.content_disposition)
self.assertEqual('deflate', obj.content_encoding)
self.assertIsNone(obj.delete_at)
def test_custom_metadata(self):
# get custom metadata
obj = self.conn.object_store.get_object_metadata(
self.FILE, container=self.FOLDER)
self.assertFalse(obj.metadata)
# set no custom metadata
self.conn.object_store.set_object_metadata(obj)
obj = self.conn.object_store.get_object_metadata(obj)
self.assertFalse(obj.metadata)
# set empty custom metadata
self.conn.object_store.set_object_metadata(obj, k0='')
obj = self.conn.object_store.get_object_metadata(obj)
self.assertFalse(obj.metadata)
# set custom metadata
self.conn.object_store.set_object_metadata(obj, k1='v1')
obj = self.conn.object_store.get_object_metadata(obj)
self.assertTrue(obj.metadata)
self.assertEqual(1, len(obj.metadata))
self.assertIn('k1', obj.metadata)
self.assertEqual('v1', obj.metadata['k1'])
# set more custom metadata by named object and container
self.conn.object_store.set_object_metadata(self.FILE, self.FOLDER,
k2='v2')
obj = self.conn.object_store.get_object_metadata(obj)
self.assertTrue(obj.metadata)
self.assertEqual(2, len(obj.metadata))
self.assertIn('k1', obj.metadata)
self.assertEqual('v1', obj.metadata['k1'])
self.assertIn('k2', obj.metadata)
self.assertEqual('v2', obj.metadata['k2'])
# update custom metadata
self.conn.object_store.set_object_metadata(obj, k1='v1.1')
obj = self.conn.object_store.get_object_metadata(obj)
self.assertTrue(obj.metadata)
self.assertEqual(2, len(obj.metadata))
self.assertIn('k1', obj.metadata)
self.assertEqual('v1.1', obj.metadata['k1'])
self.assertIn('k2', obj.metadata)
self.assertEqual('v2', obj.metadata['k2'])
# unset custom metadata
self.conn.object_store.delete_object_metadata(obj, keys=['k1'])
obj = self.conn.object_store.get_object_metadata(obj)
self.assertTrue(obj.metadata)
self.assertEqual(1, len(obj.metadata))
self.assertIn('k2', obj.metadata)
self.assertEqual('v2', obj.metadata['k2'])
|
apache-2.0
|
[
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
1265,
1443,
199,
3,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
2047,
1443,
3332,
199,
3,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
420,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
2428,
199,
3,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
1666,
314,
199,
3,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
4204,
199,
3,
1334,
314,
844,
14,
199,
199,
504,
13869,
14,
2219,
14,
15481,
492,
1300,
421,
199,
533,
1379,
1692,
8,
1095,
14,
1563,
3481,
279,
774,
304,
339,
7126,
275,
330,
7,
3175,
7,
339,
347,
3613,
8,
277,
304,
267,
1613,
8,
774,
1692,
12,
291,
680,
5996,
342,
267,
291,
14,
4365,
63,
1364,
360,
785,
13,
1617,
358,
398,
291,
14,
19041,
275,
291,
14,
362,
11427,
1558,
342,
267,
291,
14,
3817,
275,
291,
14,
362,
11427,
1558,
342,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
981,
63,
3600,
8,
354,
29,
277,
14,
19041,
9,
267,
291,
14,
12808,
8,
277,
14,
1631,
14,
785,
63,
1617,
14,
1807,
63,
3600,
12,
291,
14,
19041,
9,
267,
291,
14,
83,
357,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
5064,
63,
785,
8,
288,
3970,
29,
277,
14,
19041,
12,
536,
29,
277,
14,
3817,
12,
666,
29,
277,
14,
3998,
9,
267,
291,
14,
525,
4699,
7891,
8,
288,
291,
14,
1631,
14,
785,
63,
1617,
14,
1807,
63,
785,
12,
291,
14,
83,
357,
12,
288,
3686,
63,
4752,
29,
797,
9,
339,
347,
511,
63,
513,
8,
277,
304,
267,
1561,
275,
359,
79,
14,
354,
367,
312,
326,
315,
291,
14,
1631,
14,
785,
63,
1617,
14,
1462,
8,
3600,
29,
277,
14,
19041,
1874,
267,
291,
14,
4080,
8,
277,
14,
3817,
12,
1561,
9,
339,
347,
511,
63,
4249,
63,
785,
8,
277,
304,
267,
754,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
4249,
63,
785,
8,
288,
291,
14,
3817,
12,
3970,
29,
277,
14,
19041,
9,
267,
291,
14,
629,
8,
277,
14,
3998,
12,
754,
9,
267,
754,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
4249,
63,
785,
8,
277,
14,
83,
357,
9,
267,
291,
14,
629,
8,
277,
14,
3998,
12,
754,
9,
339,
347,
511,
63,
2253,
63,
2343,
8,
277,
304,
267,
327,
664,
2656,
3341,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
288,
291,
14,
3817,
12,
3970,
29,
277,
14,
19041,
9,
267,
327,
3254,
8,
31170,
9,
1559,
14,
2394,
365,
17262,
1536,
488,
641,
2366,
19,
1325,
440,
2366,
18,
267,
327,
291,
14,
26875,
8,
16,
12,
1559,
14,
2394,
9,
267,
291,
14,
10389,
8,
1113,
14,
11304,
9,
398,
327,
663,
2656,
3341,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
288,
291,
14,
3817,
12,
3970,
29,
277,
14,
19041,
9,
267,
291,
14,
7702,
8,
1113,
14,
1317,
63,
20173,
9,
267,
291,
14,
7702,
8,
1113,
14,
1317,
63,
2991,
9,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
409,
63,
785,
63,
2343,
8,
288,
1559,
12,
1564,
63,
20173,
534,
8905,
297,
1564,
63,
2991,
534,
12256,
358,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
1113,
9,
267,
291,
14,
629,
360,
8905,
297,
1559,
14,
1317,
63,
20173,
9,
267,
291,
14,
629,
360,
12256,
297,
1559,
14,
1317,
63,
2991,
9,
398,
327,
1678,
2656,
3341,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
409,
63,
785,
63,
2343,
8,
288,
1559,
12,
1564,
63,
2991,
534,
20902,
358,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
1113,
9,
267,
291,
14,
629,
360,
8905,
297,
1559,
14,
1317,
63,
20173,
9,
267,
291,
14,
629,
360,
20902,
297,
1559,
14,
1317,
63,
2991,
9,
398,
327,
663,
3537,
3341,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
409,
63,
785,
63,
2343,
8,
1113,
12,
1022,
16,
534,
86,
16,
358,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
1113,
9,
267,
291,
14,
4080,
360,
75,
16,
297,
1559,
14,
2343,
9,
267,
291,
14,
629,
360,
86,
16,
297,
1559,
14,
2343,
459,
75,
16,
1105,
267,
291,
14,
629,
360,
8905,
297,
1559,
14,
1317,
63,
20173,
9,
267,
291,
14,
629,
360,
20902,
297,
1559,
14,
1317,
63,
2991,
9,
398,
327,
15376,
1655,
2656,
3341,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
1807,
63,
785,
63,
2343,
8,
288,
1559,
12,
2883,
2968,
1317,
63,
20173,
1105,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
1113,
9,
267,
291,
14,
4080,
360,
75,
16,
297,
1559,
14,
2343,
9,
267,
291,
14,
629,
360,
86,
16,
297,
1559,
14,
2343,
459,
75,
16,
1105,
267,
291,
14,
7702,
8,
1113,
14,
1317,
63,
20173,
9,
267,
291,
14,
629,
360,
20902,
297,
1559,
14,
1317,
63,
2991,
9,
267,
291,
14,
7702,
8,
1113,
14,
1807,
63,
292,
9,
339,
347,
511,
63,
4229,
63,
2343,
8,
277,
304,
267,
327,
664,
3537,
3341,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
288,
291,
14,
3817,
12,
3970,
29,
277,
14,
19041,
9,
267,
291,
14,
3334,
8,
1113,
14,
2343,
9,
398,
327,
663,
949,
3537,
3341,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
409,
63,
785,
63,
2343,
8,
1113,
9,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617
] |
[
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
1265,
1443,
199,
3,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
2047,
1443,
3332,
199,
3,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
420,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
2428,
199,
3,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
1666,
314,
199,
3,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
4204,
199,
3,
1334,
314,
844,
14,
199,
199,
504,
13869,
14,
2219,
14,
15481,
492,
1300,
421,
199,
533,
1379,
1692,
8,
1095,
14,
1563,
3481,
279,
774,
304,
339,
7126,
275,
330,
7,
3175,
7,
339,
347,
3613,
8,
277,
304,
267,
1613,
8,
774,
1692,
12,
291,
680,
5996,
342,
267,
291,
14,
4365,
63,
1364,
360,
785,
13,
1617,
358,
398,
291,
14,
19041,
275,
291,
14,
362,
11427,
1558,
342,
267,
291,
14,
3817,
275,
291,
14,
362,
11427,
1558,
342,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
981,
63,
3600,
8,
354,
29,
277,
14,
19041,
9,
267,
291,
14,
12808,
8,
277,
14,
1631,
14,
785,
63,
1617,
14,
1807,
63,
3600,
12,
291,
14,
19041,
9,
267,
291,
14,
83,
357,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
5064,
63,
785,
8,
288,
3970,
29,
277,
14,
19041,
12,
536,
29,
277,
14,
3817,
12,
666,
29,
277,
14,
3998,
9,
267,
291,
14,
525,
4699,
7891,
8,
288,
291,
14,
1631,
14,
785,
63,
1617,
14,
1807,
63,
785,
12,
291,
14,
83,
357,
12,
288,
3686,
63,
4752,
29,
797,
9,
339,
347,
511,
63,
513,
8,
277,
304,
267,
1561,
275,
359,
79,
14,
354,
367,
312,
326,
315,
291,
14,
1631,
14,
785,
63,
1617,
14,
1462,
8,
3600,
29,
277,
14,
19041,
1874,
267,
291,
14,
4080,
8,
277,
14,
3817,
12,
1561,
9,
339,
347,
511,
63,
4249,
63,
785,
8,
277,
304,
267,
754,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
4249,
63,
785,
8,
288,
291,
14,
3817,
12,
3970,
29,
277,
14,
19041,
9,
267,
291,
14,
629,
8,
277,
14,
3998,
12,
754,
9,
267,
754,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
4249,
63,
785,
8,
277,
14,
83,
357,
9,
267,
291,
14,
629,
8,
277,
14,
3998,
12,
754,
9,
339,
347,
511,
63,
2253,
63,
2343,
8,
277,
304,
267,
327,
664,
2656,
3341,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
288,
291,
14,
3817,
12,
3970,
29,
277,
14,
19041,
9,
267,
327,
3254,
8,
31170,
9,
1559,
14,
2394,
365,
17262,
1536,
488,
641,
2366,
19,
1325,
440,
2366,
18,
267,
327,
291,
14,
26875,
8,
16,
12,
1559,
14,
2394,
9,
267,
291,
14,
10389,
8,
1113,
14,
11304,
9,
398,
327,
663,
2656,
3341,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
288,
291,
14,
3817,
12,
3970,
29,
277,
14,
19041,
9,
267,
291,
14,
7702,
8,
1113,
14,
1317,
63,
20173,
9,
267,
291,
14,
7702,
8,
1113,
14,
1317,
63,
2991,
9,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
409,
63,
785,
63,
2343,
8,
288,
1559,
12,
1564,
63,
20173,
534,
8905,
297,
1564,
63,
2991,
534,
12256,
358,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
1113,
9,
267,
291,
14,
629,
360,
8905,
297,
1559,
14,
1317,
63,
20173,
9,
267,
291,
14,
629,
360,
12256,
297,
1559,
14,
1317,
63,
2991,
9,
398,
327,
1678,
2656,
3341,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
409,
63,
785,
63,
2343,
8,
288,
1559,
12,
1564,
63,
2991,
534,
20902,
358,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
1113,
9,
267,
291,
14,
629,
360,
8905,
297,
1559,
14,
1317,
63,
20173,
9,
267,
291,
14,
629,
360,
20902,
297,
1559,
14,
1317,
63,
2991,
9,
398,
327,
663,
3537,
3341,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
409,
63,
785,
63,
2343,
8,
1113,
12,
1022,
16,
534,
86,
16,
358,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
1113,
9,
267,
291,
14,
4080,
360,
75,
16,
297,
1559,
14,
2343,
9,
267,
291,
14,
629,
360,
86,
16,
297,
1559,
14,
2343,
459,
75,
16,
1105,
267,
291,
14,
629,
360,
8905,
297,
1559,
14,
1317,
63,
20173,
9,
267,
291,
14,
629,
360,
20902,
297,
1559,
14,
1317,
63,
2991,
9,
398,
327,
15376,
1655,
2656,
3341,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
1807,
63,
785,
63,
2343,
8,
288,
1559,
12,
2883,
2968,
1317,
63,
20173,
1105,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
1113,
9,
267,
291,
14,
4080,
360,
75,
16,
297,
1559,
14,
2343,
9,
267,
291,
14,
629,
360,
86,
16,
297,
1559,
14,
2343,
459,
75,
16,
1105,
267,
291,
14,
7702,
8,
1113,
14,
1317,
63,
20173,
9,
267,
291,
14,
629,
360,
20902,
297,
1559,
14,
1317,
63,
2991,
9,
267,
291,
14,
7702,
8,
1113,
14,
1807,
63,
292,
9,
339,
347,
511,
63,
4229,
63,
2343,
8,
277,
304,
267,
327,
664,
3537,
3341,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
14,
362,
63,
785,
63,
2343,
8,
288,
291,
14,
3817,
12,
3970,
29,
277,
14,
19041,
9,
267,
291,
14,
3334,
8,
1113,
14,
2343,
9,
398,
327,
663,
949,
3537,
3341,
267,
291,
14,
1631,
14,
785,
63,
1617,
14,
409,
63,
785,
63,
2343,
8,
1113,
9,
267,
1559,
275,
291,
14,
1631,
14,
785,
63,
1617,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
allspark2020/S-Duos-Odin-Kernel
|
tools/perf/scripts/python/syscall-counts-by-pid.py
|
11180
|
1927
|
# system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import syscall_name
usage = "perf script -s syscall-counts-by-pid.py [comm]\n";
for_comm = None
for_pid = None
if len(sys.argv) > 2:
sys.exit(usage)
if len(sys.argv) > 1:
try:
for_pid = int(sys.argv[1])
except:
for_comm = sys.argv[1]
syscalls = autodict()
def trace_begin():
print "Press control+C to stop and show the summary"
def trace_end():
print_syscall_totals()
def raw_syscalls__sys_enter(event_name, context, common_cpu,
common_secs, common_nsecs, common_pid, common_comm,
id, args):
if (for_comm and common_comm != for_comm) or \
(for_pid and common_pid != for_pid ):
return
try:
syscalls[common_comm][common_pid][id] += 1
except TypeError:
syscalls[common_comm][common_pid][id] = 1
def print_syscall_totals():
if for_comm is not None:
print "\nsyscall events for %s:\n\n" % (for_comm),
else:
print "\nsyscall events by comm/pid:\n\n",
print "%-40s %10s\n" % ("comm [pid]/syscalls", "count"),
print "%-40s %10s\n" % ("----------------------------------------", \
"----------"),
comm_keys = syscalls.keys()
for comm in comm_keys:
pid_keys = syscalls[comm].keys()
for pid in pid_keys:
print "\n%s [%d]\n" % (comm, pid),
id_keys = syscalls[comm][pid].keys()
for id, val in sorted(syscalls[comm][pid].iteritems(), \
key = lambda(k, v): (v, k), reverse = True):
print " %-38s %10d\n" % (syscall_name(id), val),
|
gpl-2.0
|
[
3,
2656,
1240,
8242,
12,
701,
4422,
199,
3,
334,
67,
9,
7129,
12,
21644,
29385,
665,
29453,
32,
6799,
14,
957,
30,
199,
3,
3909,
1334,
314,
2895,
402,
314,
1664,
14629,
844,
1015,
499,
199,
3,
199,
3,
28750,
2656,
13,
13062,
2656,
1240,
23576,
12,
10529,
3224,
701,
18901,
14,
199,
3,
982,
282,
359,
1404,
61,
1680,
365,
2013,
12,
1454,
19473,
2797,
701,
359,
1404,
61,
787,
9080,
14,
199,
199,
646,
747,
12,
984,
199,
199,
1274,
14,
515,
14,
740,
8,
736,
14,
2314,
459,
17038,
63,
10276,
63,
3243,
418,
435,
971,
199,
198,
9807,
6429,
15,
1548,
15,
12387,
13,
3921,
13,
9562,
15,
773,
15,
12387,
15,
3921,
358,
199,
199,
504,
8582,
63,
3446,
63,
1100,
492,
627,
199,
504,
11672,
492,
627,
199,
504,
21248,
492,
18901,
63,
354,
199,
199,
3807,
275,
298,
9452,
2884,
446,
83,
18901,
13,
6851,
13,
991,
13,
3150,
14,
647,
359,
1404,
7272,
78,
11436,
199,
199,
509,
63,
1404,
275,
488,
199,
509,
63,
3150,
275,
488,
199,
199,
692,
822,
8,
1274,
14,
3020,
9,
690,
499,
26,
199,
198,
1274,
14,
2224,
8,
3807,
9,
199,
199,
692,
822,
8,
1274,
14,
3020,
9,
690,
413,
26,
199,
198,
893,
26,
507,
198,
509,
63,
3150,
275,
1109,
8,
1274,
14,
3020,
59,
17,
566,
199,
198,
2590,
26,
507,
198,
509,
63,
1404,
275,
984,
14,
3020,
59,
17,
61,
199,
199,
14507,
275,
27477,
342,
199,
199,
318,
3307,
63,
5037,
837,
199,
198,
1361,
298,
14414,
3304,
11,
35,
370,
3631,
436,
2498,
314,
6212,
2,
199,
199,
318,
3307,
63,
500,
837,
199,
198,
1361,
63,
19444,
63,
17552,
342,
199,
199,
318,
3066,
63,
14507,
363,
1274,
63,
4200,
8,
1430,
63,
354,
12,
1067,
12,
2863,
63,
3541,
12,
199,
198,
2330,
63,
4855,
12,
2863,
63,
9618,
12,
2863,
63,
3150,
12,
2863,
63,
1404,
12,
199,
198,
344,
12,
1249,
304,
421,
198,
692,
334,
509,
63,
1404,
436,
2863,
63,
1404,
1137,
367,
63,
1404,
9,
503,
971,
21979,
334,
509,
63,
3150,
221,
436,
2863,
63,
3150,
221,
1137,
367,
63,
3150,
3461,
507,
198,
1107,
199,
198,
893,
26,
507,
198,
14507,
59,
2330,
63,
1404,
1527,
2330,
63,
3150,
1527,
344,
61,
847,
413,
199,
198,
2590,
3146,
26,
507,
198,
14507,
59,
2330,
63,
1404,
1527,
2330,
63,
3150,
1527,
344,
61,
275,
413,
199,
199,
318,
870,
63,
19444,
63,
17552,
837,
272,
340,
367,
63,
1404,
365,
440,
488,
26,
6722,
870,
1867,
26605,
4474,
367,
450,
83,
3427,
78,
60,
78,
2,
450,
334,
509,
63,
1404,
395,
272,
587,
26,
6722,
870,
1867,
26605,
4474,
701,
1923,
15,
3150,
3427,
78,
60,
78,
401,
339,
870,
18301,
2167,
83,
221,
450,
709,
83,
60,
78,
2,
450,
1689,
1404,
359,
3150,
12978,
14507,
401,
298,
835,
1288,
272,
870,
18301,
2167,
83,
221,
450,
709,
83,
60,
78,
2,
450,
1689,
32111,
401,
971,
639,
298,
9460,
1288,
339,
1923,
63,
1612,
275,
19473,
14,
1612,
342,
272,
367,
1923,
315,
1923,
63,
1612,
26,
6722,
4422,
63,
1612,
275,
19473,
59,
1404,
1055,
1612,
342,
6722,
367,
4422,
315,
4422,
63,
1612,
26,
15075,
870,
1867,
78,
5,
83,
8978,
68,
7272,
78,
2,
450,
334,
1404,
12,
4422,
395,
15075,
1305,
63,
1612,
275,
19473,
59,
1404,
1527,
3150,
1055,
1612,
342,
15075,
367,
1305,
12,
1139,
315,
3355,
8,
14507,
59,
1404,
1527,
3150,
1055,
4611,
1062,
971,
1871,
221,
790,
275,
2400,
8,
75,
12,
373,
304,
334,
86,
12,
1022,
395,
221,
3837,
275,
715,
304,
24449,
870,
298,
221,
19752,
1703,
83,
221,
450,
709,
68,
60,
78,
2,
450,
334,
19444,
63,
354,
8,
344,
395,
1139,
395,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2656,
1240,
8242,
12,
701,
4422,
199,
3,
334,
67,
9,
7129,
12,
21644,
29385,
665,
29453,
32,
6799,
14,
957,
30,
199,
3,
3909,
1334,
314,
2895,
402,
314,
1664,
14629,
844,
1015,
499,
199,
3,
199,
3,
28750,
2656,
13,
13062,
2656,
1240,
23576,
12,
10529,
3224,
701,
18901,
14,
199,
3,
982,
282,
359,
1404,
61,
1680,
365,
2013,
12,
1454,
19473,
2797,
701,
359,
1404,
61,
787,
9080,
14,
199,
199,
646,
747,
12,
984,
199,
199,
1274,
14,
515,
14,
740,
8,
736,
14,
2314,
459,
17038,
63,
10276,
63,
3243,
418,
435,
971,
199,
198,
9807,
6429,
15,
1548,
15,
12387,
13,
3921,
13,
9562,
15,
773,
15,
12387,
15,
3921,
358,
199,
199,
504,
8582,
63,
3446,
63,
1100,
492,
627,
199,
504,
11672,
492,
627,
199,
504,
21248,
492,
18901,
63,
354,
199,
199,
3807,
275,
298,
9452,
2884,
446,
83,
18901,
13,
6851,
13,
991,
13,
3150,
14,
647,
359,
1404,
7272,
78,
11436,
199,
199,
509,
63,
1404,
275,
488,
199,
509,
63,
3150,
275,
488,
199,
199,
692,
822,
8,
1274,
14,
3020,
9,
690,
499,
26,
199,
198,
1274,
14,
2224,
8,
3807,
9,
199,
199,
692,
822,
8,
1274,
14,
3020,
9,
690,
413,
26,
199,
198,
893,
26,
507,
198,
509,
63,
3150,
275,
1109,
8,
1274,
14,
3020,
59,
17,
566,
199,
198,
2590,
26,
507,
198,
509,
63,
1404,
275,
984,
14,
3020,
59,
17,
61,
199,
199,
14507,
275,
27477,
342,
199,
199,
318,
3307,
63,
5037,
837,
199,
198,
1361,
298,
14414,
3304,
11,
35,
370,
3631,
436,
2498,
314,
6212,
2,
199,
199,
318,
3307,
63,
500,
837,
199,
198,
1361,
63,
19444,
63,
17552,
342,
199,
199,
318,
3066,
63,
14507,
363,
1274,
63,
4200,
8,
1430,
63,
354,
12,
1067,
12,
2863,
63,
3541,
12,
199,
198,
2330,
63,
4855,
12,
2863,
63,
9618,
12,
2863,
63,
3150,
12,
2863,
63,
1404,
12,
199,
198,
344,
12,
1249,
304,
421,
198,
692,
334,
509,
63,
1404,
436,
2863,
63,
1404,
1137,
367,
63,
1404,
9,
503,
971,
21979,
334,
509,
63,
3150,
221,
436,
2863,
63,
3150,
221,
1137,
367,
63,
3150,
3461,
507,
198,
1107,
199,
198,
893,
26,
507,
198,
14507,
59,
2330,
63,
1404,
1527,
2330,
63,
3150,
1527,
344,
61,
847,
413,
199,
198,
2590,
3146,
26,
507,
198,
14507,
59,
2330,
63,
1404,
1527,
2330,
63,
3150,
1527,
344,
61,
275,
413,
199,
199,
318,
870,
63,
19444,
63,
17552,
837,
272,
340,
367,
63,
1404,
365,
440,
488,
26,
6722,
870,
1867,
26605,
4474,
367,
450,
83,
3427,
78,
60,
78,
2,
450,
334,
509,
63,
1404,
395,
272,
587,
26,
6722,
870,
1867,
26605,
4474,
701,
1923,
15,
3150,
3427,
78,
60,
78,
401,
339,
870,
18301,
2167,
83,
221,
450,
709,
83,
60,
78,
2,
450,
1689,
1404,
359,
3150,
12978,
14507,
401,
298,
835,
1288,
272,
870,
18301,
2167,
83,
221,
450,
709,
83,
60,
78,
2,
450,
1689,
32111,
401,
971,
639,
298,
9460,
1288,
339,
1923,
63,
1612,
275,
19473,
14,
1612,
342,
272,
367,
1923,
315,
1923,
63,
1612,
26,
6722,
4422,
63,
1612,
275,
19473,
59,
1404,
1055,
1612,
342,
6722,
367,
4422,
315,
4422,
63,
1612,
26,
15075,
870,
1867,
78,
5,
83,
8978,
68,
7272,
78,
2,
450,
334,
1404,
12,
4422,
395,
15075,
1305,
63,
1612,
275,
19473,
59,
1404,
1527,
3150,
1055,
1612,
342,
15075,
367,
1305,
12,
1139,
315,
3355,
8,
14507,
59,
1404,
1527,
3150,
1055,
4611,
1062,
971,
1871,
221,
790,
275,
2400,
8,
75,
12,
373,
304,
334,
86,
12,
1022,
395,
221,
3837,
275,
715,
304,
24449,
870,
298,
221,
19752,
1703,
83,
221,
450,
709,
68,
60,
78,
2,
450,
334,
19444,
63,
354,
8,
344,
395,
1139,
395,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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ible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
from ansible.compat.tests.mock import patch, Mock, MagicMock, call
from .netscaler_module import TestModule, nitro_base_patcher, set_module_args
import sys
if sys.version_info[:2] != (2, 6):
import requests
class TestNetscalerServerModule(TestModule):
@classmethod
def setUpClass(cls):
class MockException(Exception):
pass
cls.MockException = MockException
m = MagicMock()
cls.server_mock = MagicMock()
cls.server_mock.__class__ = MagicMock(add=Mock())
nssrc_modules_mock = {
'nssrc.com.citrix.netscaler.nitro.resource.config.basic': m,
'nssrc.com.citrix.netscaler.nitro.resource.config.basic.server': m,
'nssrc.com.citrix.netscaler.nitro.resource.config.basic.server.server': cls.server_mock,
}
cls.nitro_specific_patcher = patch.dict(sys.modules, nssrc_modules_mock)
cls.nitro_base_patcher = nitro_base_patcher
@classmethod
def tearDownClass(cls):
cls.nitro_base_patcher.stop()
cls.nitro_specific_patcher.stop()
def setUp(self):
self.nitro_base_patcher.start()
self.nitro_specific_patcher.start()
# Setup minimal required arguments to pass AnsibleModule argument parsing
def tearDown(self):
self.nitro_base_patcher.stop()
self.nitro_specific_patcher.stop()
def test_graceful_nitro_api_import_error(self):
# Stop nitro api patching to cause ImportError
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
self.nitro_base_patcher.stop()
self.nitro_specific_patcher.stop()
from ansible.modules.network.netscaler import netscaler_server
self.module = netscaler_server
result = self.failed()
self.assertEqual(result['msg'], 'Could not load nitro python sdk')
def test_graceful_nitro_error_on_login(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
class MockException(Exception):
def __init__(self, *args, **kwargs):
self.errorcode = 0
self.message = ''
client_mock = Mock()
client_mock.login = Mock(side_effect=MockException)
m = Mock(return_value=client_mock)
with patch('ansible.modules.network.netscaler.netscaler_server.get_nitro_client', m):
with patch('ansible.modules.network.netscaler.netscaler_server.nitro_exception', MockException):
self.module = netscaler_server
result = self.failed()
self.assertTrue(result['msg'].startswith('nitro exception'), msg='nitro exception during login not handled properly')
def test_graceful_no_connection_error(self):
if sys.version_info[:2] == (2, 6):
self.skipTest('requests library not available under python2.6')
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
class MockException(Exception):
pass
client_mock = Mock()
attrs = {'login.side_effect': requests.exceptions.ConnectionError}
client_mock.configure_mock(**attrs)
m = Mock(return_value=client_mock)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
get_nitro_client=m,
nitro_exception=MockException,
):
self.module = netscaler_server
result = self.failed()
self.assertTrue(result['msg'].startswith('Connection error'), msg='Connection error was not handled gracefully')
def test_graceful_login_error(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
if sys.version_info[:2] == (2, 6):
self.skipTest('requests library not available under python2.6')
class MockException(Exception):
pass
client_mock = Mock()
attrs = {'login.side_effect': requests.exceptions.SSLError}
client_mock.configure_mock(**attrs)
m = Mock(return_value=client_mock)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
get_nitro_client=m,
nitro_exception=MockException,
):
self.module = netscaler_server
result = self.failed()
self.assertTrue(result['msg'].startswith('SSL Error'), msg='SSL Error was not handled gracefully')
def test_save_config_called_on_state_present(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_mock = Mock()
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
get_nitro_client=m,
server_exists=Mock(side_effect=[False, True]),
ConfigProxy=Mock(return_value=server_proxy_mock),
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
self.exited()
self.assertIn(call.save_config(), client_mock.mock_calls)
def test_save_config_called_on_state_absent(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='absent',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_mock = Mock()
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
get_nitro_client=m,
server_exists=Mock(side_effect=[True, False]),
ConfigProxy=Mock(return_value=server_proxy_mock),
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
self.exited()
self.assertIn(call.save_config(), client_mock.mock_calls)
def test_save_config_not_called_on_state_present(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
save_config=False,
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_mock = Mock()
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
get_nitro_client=m,
server_exists=Mock(side_effect=[False, True]),
ConfigProxy=Mock(return_value=server_proxy_mock),
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
self.exited()
self.assertNotIn(call.save_config(), client_mock.mock_calls)
def test_save_config_not_called_on_state_absent(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='absent',
save_config=False,
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_mock = Mock()
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
get_nitro_client=m,
server_exists=Mock(side_effect=[True, False]),
ConfigProxy=Mock(return_value=server_proxy_mock),
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
self.exited()
self.assertNotIn(call.save_config(), client_mock.mock_calls)
def test_do_state_change_fail(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_mock = Mock()
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
nitro_exception=self.MockException,
get_nitro_client=m,
server_exists=Mock(side_effect=[True, False]),
ConfigProxy=Mock(return_value=server_proxy_mock),
do_state_change=Mock(return_value=Mock(errorcode=1, message='Failed on purpose'))
):
self.module = netscaler_server
result = self.failed()
self.assertEqual(result['msg'], 'Error when setting disabled state. errorcode: 1 message: Failed on purpose')
def test_new_server_execution_flow(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_attrs = {
'diff_object.return_value': {},
}
server_proxy_mock = Mock()
server_proxy_mock.configure_mock(**server_proxy_attrs)
config_proxy_mock = Mock(return_value=server_proxy_mock)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
get_nitro_client=m,
server_exists=Mock(side_effect=[False, True]),
server_identical=Mock(side_effect=[True]),
ConfigProxy=config_proxy_mock,
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
self.exited()
server_proxy_mock.assert_has_calls([call.add()])
def test_modified_server_execution_flow(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_attrs = {
'diff_object.return_value': {},
}
server_proxy_mock = Mock()
server_proxy_mock.configure_mock(**server_proxy_attrs)
config_proxy_mock = Mock(return_value=server_proxy_mock)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
get_nitro_client=m,
diff_list=Mock(return_value={}),
get_immutables_intersection=Mock(return_value=[]),
server_exists=Mock(side_effect=[True, True]),
server_identical=Mock(side_effect=[False, True]),
ConfigProxy=config_proxy_mock,
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
self.exited()
server_proxy_mock.assert_has_calls([call.update()])
def test_absent_server_execution_flow(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='absent',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_attrs = {
'diff_object.return_value': {},
}
server_proxy_mock = Mock()
server_proxy_mock.configure_mock(**server_proxy_attrs)
config_proxy_mock = Mock(return_value=server_proxy_mock)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
get_nitro_client=m,
diff_list=Mock(return_value={}),
get_immutables_intersection=Mock(return_value=[]),
server_exists=Mock(side_effect=[True, False]),
server_identical=Mock(side_effect=[False, True]),
ConfigProxy=config_proxy_mock,
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
self.exited()
server_proxy_mock.assert_has_calls([call.delete()])
def test_present_server_identical_flow(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_attrs = {
'diff_object.return_value': {},
}
server_proxy_mock = Mock()
server_proxy_mock.configure_mock(**server_proxy_attrs)
config_proxy_mock = Mock(return_value=server_proxy_mock)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
get_nitro_client=m,
diff_list=Mock(return_value={}),
get_immutables_intersection=Mock(return_value=[]),
server_exists=Mock(side_effect=[True, True]),
server_identical=Mock(side_effect=[True, True]),
ConfigProxy=config_proxy_mock,
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
self.exited()
server_proxy_mock.assert_not_called()
def test_absent_server_noop_flow(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='absent',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_attrs = {
'diff_object.return_value': {},
}
server_proxy_mock = Mock()
server_proxy_mock.configure_mock(**server_proxy_attrs)
config_proxy_mock = Mock(return_value=server_proxy_mock)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
get_nitro_client=m,
diff_list=Mock(return_value={}),
get_immutables_intersection=Mock(return_value=[]),
server_exists=Mock(side_effect=[False, False]),
server_identical=Mock(side_effect=[False, False]),
ConfigProxy=config_proxy_mock,
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
self.exited()
server_proxy_mock.assert_not_called()
def test_present_server_failed_update(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_attrs = {
'diff_object.return_value': {},
}
server_proxy_mock = Mock()
server_proxy_mock.configure_mock(**server_proxy_attrs)
config_proxy_mock = Mock(return_value=server_proxy_mock)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
nitro_exception=self.MockException,
get_nitro_client=m,
diff_list=Mock(return_value={}),
get_immutables_intersection=Mock(return_value=[]),
server_exists=Mock(side_effect=[True, True]),
server_identical=Mock(side_effect=[False, False]),
ConfigProxy=config_proxy_mock,
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
result = self.failed()
self.assertEqual(result['msg'], 'Server is not configured according to parameters given')
self.assertTrue(result['failed'])
def test_present_server_failed_create(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_attrs = {
'diff_object.return_value': {},
}
server_proxy_mock = Mock()
server_proxy_mock.configure_mock(**server_proxy_attrs)
config_proxy_mock = Mock(return_value=server_proxy_mock)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
nitro_exception=self.MockException,
get_nitro_client=m,
diff_list=Mock(return_value={}),
get_immutables_intersection=Mock(return_value=[]),
server_exists=Mock(side_effect=[False, False]),
server_identical=Mock(side_effect=[False, False]),
ConfigProxy=config_proxy_mock,
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
result = self.failed()
self.assertEqual(result['msg'], 'Server does not seem to exist')
self.assertTrue(result['failed'])
def test_present_server_update_immutable_attribute(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_attrs = {
'diff_object.return_value': {},
}
server_proxy_mock = Mock()
server_proxy_mock.configure_mock(**server_proxy_attrs)
config_proxy_mock = Mock(return_value=server_proxy_mock)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
nitro_exception=self.MockException,
get_nitro_client=m,
diff_list=Mock(return_value={}),
get_immutables_intersection=Mock(return_value=['domain']),
server_exists=Mock(side_effect=[True, True]),
server_identical=Mock(side_effect=[False, False]),
ConfigProxy=config_proxy_mock,
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
result = self.failed()
self.assertEqual(result['msg'], 'Cannot update immutable attributes [\'domain\']')
self.assertTrue(result['failed'])
def test_absent_server_failed_delete(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='absent',
))
from ansible.modules.network.netscaler import netscaler_server
client_mock = Mock()
m = Mock(return_value=client_mock)
server_proxy_attrs = {
'diff_object.return_value': {},
}
server_proxy_mock = Mock()
server_proxy_mock.configure_mock(**server_proxy_attrs)
config_proxy_mock = Mock(return_value=server_proxy_mock)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
nitro_exception=self.MockException,
get_nitro_client=m,
diff_list=Mock(return_value={}),
get_immutables_intersection=Mock(return_value=[]),
server_exists=Mock(side_effect=[True, True]),
server_identical=Mock(side_effect=[False, False]),
ConfigProxy=config_proxy_mock,
do_state_change=Mock(return_value=Mock(errorcode=0))
):
self.module = netscaler_server
result = self.failed()
self.assertEqual(result['msg'], 'Server seems to be present')
self.assertTrue(result['failed'])
def test_graceful_nitro_exception_state_present(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='present',
))
from ansible.modules.network.netscaler import netscaler_server
class MockException(Exception):
def __init__(self, *args, **kwargs):
self.errorcode = 0
self.message = ''
m = Mock(side_effect=MockException)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
server_exists=m,
nitro_exception=MockException
):
self.module = netscaler_server
result = self.failed()
self.assertTrue(
result['msg'].startswith('nitro exception'),
msg='Nitro exception not caught on operation absent'
)
def test_graceful_nitro_exception_state_absent(self):
set_module_args(dict(
nitro_user='user',
nitro_pass='pass',
nsip='1.1.1.1',
state='absent',
))
from ansible.modules.network.netscaler import netscaler_server
class MockException(Exception):
def __init__(self, *args, **kwargs):
self.errorcode = 0
self.message = ''
m = Mock(side_effect=MockException)
with patch.multiple(
'ansible.modules.network.netscaler.netscaler_server',
server_exists=m,
nitro_exception=MockException
):
self.module = netscaler_server
result = self.failed()
self.assertTrue(
result['msg'].startswith('nitro exception'),
msg='Nitro exception not caught on operation absent'
)
|
gpl-3.0
|
[
199,
3,
221,
1898,
334,
67,
9,
9708,
445,
390,
1904,
15285,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
2622,
199,
3,
199,
3,
2622,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
199,
3,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
2622,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
3,
3180,
543,
2622,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
199,
504,
3242,
14,
5819,
14,
2219,
14,
1805,
492,
3371,
12,
4420,
12,
10079,
12,
1240,
199,
504,
1275,
18860,
63,
578,
492,
1379,
2377,
12,
20107,
63,
1095,
63,
11238,
12,
663,
63,
578,
63,
589,
199,
199,
646,
984,
199,
199,
692,
984,
14,
1023,
63,
815,
1491,
18,
61,
1137,
334,
18,
12,
1227,
304,
272,
492,
4145,
421,
199,
533,
1379,
2480,
11494,
3120,
2377,
8,
774,
2377,
304,
339,
768,
3744,
272,
347,
18561,
8,
1886,
304,
267,
1021,
4420,
1726,
8,
1726,
304,
288,
986,
398,
843,
14,
3346,
1726,
275,
4420,
1726,
398,
333,
275,
10079,
342,
267,
843,
14,
1000,
63,
1805,
275,
10079,
342,
267,
843,
14,
1000,
63,
1805,
855,
533,
363,
275,
10079,
8,
525,
29,
3346,
1012,
267,
302,
32231,
63,
3112,
63,
1805,
275,
469,
288,
283,
78,
32231,
14,
957,
14,
14422,
1904,
14,
18860,
14,
18893,
14,
1927,
14,
888,
14,
4316,
356,
333,
12,
288,
283,
78,
32231,
14,
957,
14,
14422,
1904,
14,
18860,
14,
18893,
14,
1927,
14,
888,
14,
4316,
14,
1000,
356,
333,
12,
288,
283,
78,
32231,
14,
957,
14,
14422,
1904,
14,
18860,
14,
18893,
14,
1927,
14,
888,
14,
4316,
14,
1000,
14,
1000,
356,
843,
14,
1000,
63,
1805,
12,
267,
789,
398,
843,
14,
18893,
63,
6100,
63,
11238,
275,
3371,
14,
807,
8,
1274,
14,
3112,
12,
302,
32231,
63,
3112,
63,
1805,
9,
267,
843,
14,
18893,
63,
1095,
63,
11238,
275,
20107,
63,
1095,
63,
11238,
339,
768,
3744,
272,
347,
24468,
8,
1886,
304,
267,
843,
14,
18893,
63,
1095,
63,
11238,
14,
2379,
342,
267,
843,
14,
18893,
63,
6100,
63,
11238,
14,
2379,
342,
339,
347,
3613,
8,
277,
304,
267,
291,
14,
18893,
63,
1095,
63,
11238,
14,
928,
342,
267,
291,
14,
18893,
63,
6100,
63,
11238,
14,
928,
342,
398,
327,
12439,
13460,
1415,
2368,
370,
986,
6953,
1423,
6057,
339,
347,
6766,
8,
277,
304,
267,
291,
14,
18893,
63,
1095,
63,
11238,
14,
2379,
342,
267,
291,
14,
18893,
63,
6100,
63,
11238,
14,
2379,
342,
339,
347,
511,
63,
20631,
1893,
63,
18893,
63,
1246,
63,
646,
63,
705,
8,
277,
304,
267,
327,
8015,
20107,
2986,
3371,
316,
370,
7675,
3545,
267,
663,
63,
578,
63,
589,
8,
807,
8,
288,
20107,
63,
751,
534,
751,
297,
288,
20107,
63,
1529,
534,
1529,
297,
288,
302,
17839,
534,
17,
14,
17,
14,
17,
14,
17,
297,
288,
1174,
534,
1881,
297,
267,
5082,
267,
291,
14,
18893,
63,
1095,
63,
11238,
14,
2379,
342,
267,
291,
14,
18893,
63,
6100,
63,
11238,
14,
2379,
342,
267,
687,
3242,
14,
3112,
14,
1200,
14,
18860,
492,
26067,
63,
1000,
267,
291,
14,
578,
275,
26067,
63,
1000,
267,
754,
275,
291,
14,
4892,
342,
267,
291,
14,
629,
8,
1099,
459,
1328,
995,
283,
6531,
440,
2248,
20107,
2366,
13628,
358,
339,
347,
511,
63,
20631,
1893,
63,
18893,
63,
705,
63,
265,
63,
2886,
8,
277,
304,
267,
663,
63,
578,
63,
589,
8,
807,
8,
288,
20107,
63,
751,
534,
751,
297,
288,
20107,
63,
1529,
534,
1529,
297,
288,
302,
17839,
534,
17,
14,
17,
14,
17,
14,
17,
297,
288,
1174,
534,
1881,
297,
267,
5082,
267,
687,
3242,
14,
3112,
14,
1200,
14,
18860,
492,
26067,
63,
1000,
398,
1021,
4420,
1726,
8,
1726,
304,
288,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
355,
291,
14,
28857,
275,
378,
355,
291,
14,
1188,
275,
2125,
398,
1890,
63,
1805,
275,
4420,
342,
267,
1890,
63,
1805,
14,
2886,
275,
4420,
8,
2441,
63,
5881,
29,
3346,
1726,
9,
267,
333,
275,
4420,
8,
1107,
63,
585,
29,
1258,
63,
1805,
9,
267,
543,
3371,
360,
4853,
14,
3112,
14,
1200,
14,
18860,
14,
18860,
63,
1000,
14,
362,
63,
18893,
63,
1258,
297,
333,
304,
288,
543,
3371,
360,
4853,
14,
3112,
14,
1200,
14,
18860,
14,
18860,
63,
1000,
14,
18893,
63,
1971,
297,
4420,
1726,
304,
355,
291,
14,
578,
275,
26067,
63,
1000,
355,
754,
275,
291,
14,
4892,
342,
355,
291,
14,
1815,
8,
1099,
459,
1328,
2278,
2460,
360,
18893,
1919,
659,
1499,
534,
18893,
1919,
5309,
4676,
440,
8860,
7684,
358,
339,
347,
511,
63,
20631,
1893,
63,
889,
63,
2105,
63,
705,
8,
277,
304,
398,
340,
984,
14,
1023,
63,
815,
1491,
18,
61,
508,
334,
18,
12,
1227,
304,
288,
291,
14,
23809,
360,
6615,
3555,
440,
2808,
1334,
2366,
18,
14,
22,
358,
267,
663,
63,
578,
63,
589,
8,
807,
8,
288,
20107,
63,
751,
534,
751,
297,
288,
20107,
63,
1529,
534,
1529,
297,
288,
302,
17839,
534,
17,
14,
17,
14,
17,
14,
17,
297,
288,
1174,
534,
1881,
297,
267,
5082,
267,
687,
3242,
14,
3112,
14,
1200,
14,
18860,
492,
26067,
63,
1000,
398,
1021,
4420,
1726,
8,
1726,
304,
288,
986,
267,
1890,
63,
1805,
275,
4420,
342,
267,
3290,
275,
791,
2886,
14,
2441,
63,
5881,
356,
4145,
14,
3924,
14,
20349,
93,
267,
1890,
63
] |
[
3,
221,
1898,
334,
67,
9,
9708,
445,
390,
1904,
15285,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
2622,
199,
3,
199,
3,
2622,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
199,
3,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
2622,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
3,
3180,
543,
2622,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
199,
504,
3242,
14,
5819,
14,
2219,
14,
1805,
492,
3371,
12,
4420,
12,
10079,
12,
1240,
199,
504,
1275,
18860,
63,
578,
492,
1379,
2377,
12,
20107,
63,
1095,
63,
11238,
12,
663,
63,
578,
63,
589,
199,
199,
646,
984,
199,
199,
692,
984,
14,
1023,
63,
815,
1491,
18,
61,
1137,
334,
18,
12,
1227,
304,
272,
492,
4145,
421,
199,
533,
1379,
2480,
11494,
3120,
2377,
8,
774,
2377,
304,
339,
768,
3744,
272,
347,
18561,
8,
1886,
304,
267,
1021,
4420,
1726,
8,
1726,
304,
288,
986,
398,
843,
14,
3346,
1726,
275,
4420,
1726,
398,
333,
275,
10079,
342,
267,
843,
14,
1000,
63,
1805,
275,
10079,
342,
267,
843,
14,
1000,
63,
1805,
855,
533,
363,
275,
10079,
8,
525,
29,
3346,
1012,
267,
302,
32231,
63,
3112,
63,
1805,
275,
469,
288,
283,
78,
32231,
14,
957,
14,
14422,
1904,
14,
18860,
14,
18893,
14,
1927,
14,
888,
14,
4316,
356,
333,
12,
288,
283,
78,
32231,
14,
957,
14,
14422,
1904,
14,
18860,
14,
18893,
14,
1927,
14,
888,
14,
4316,
14,
1000,
356,
333,
12,
288,
283,
78,
32231,
14,
957,
14,
14422,
1904,
14,
18860,
14,
18893,
14,
1927,
14,
888,
14,
4316,
14,
1000,
14,
1000,
356,
843,
14,
1000,
63,
1805,
12,
267,
789,
398,
843,
14,
18893,
63,
6100,
63,
11238,
275,
3371,
14,
807,
8,
1274,
14,
3112,
12,
302,
32231,
63,
3112,
63,
1805,
9,
267,
843,
14,
18893,
63,
1095,
63,
11238,
275,
20107,
63,
1095,
63,
11238,
339,
768,
3744,
272,
347,
24468,
8,
1886,
304,
267,
843,
14,
18893,
63,
1095,
63,
11238,
14,
2379,
342,
267,
843,
14,
18893,
63,
6100,
63,
11238,
14,
2379,
342,
339,
347,
3613,
8,
277,
304,
267,
291,
14,
18893,
63,
1095,
63,
11238,
14,
928,
342,
267,
291,
14,
18893,
63,
6100,
63,
11238,
14,
928,
342,
398,
327,
12439,
13460,
1415,
2368,
370,
986,
6953,
1423,
6057,
339,
347,
6766,
8,
277,
304,
267,
291,
14,
18893,
63,
1095,
63,
11238,
14,
2379,
342,
267,
291,
14,
18893,
63,
6100,
63,
11238,
14,
2379,
342,
339,
347,
511,
63,
20631,
1893,
63,
18893,
63,
1246,
63,
646,
63,
705,
8,
277,
304,
267,
327,
8015,
20107,
2986,
3371,
316,
370,
7675,
3545,
267,
663,
63,
578,
63,
589,
8,
807,
8,
288,
20107,
63,
751,
534,
751,
297,
288,
20107,
63,
1529,
534,
1529,
297,
288,
302,
17839,
534,
17,
14,
17,
14,
17,
14,
17,
297,
288,
1174,
534,
1881,
297,
267,
5082,
267,
291,
14,
18893,
63,
1095,
63,
11238,
14,
2379,
342,
267,
291,
14,
18893,
63,
6100,
63,
11238,
14,
2379,
342,
267,
687,
3242,
14,
3112,
14,
1200,
14,
18860,
492,
26067,
63,
1000,
267,
291,
14,
578,
275,
26067,
63,
1000,
267,
754,
275,
291,
14,
4892,
342,
267,
291,
14,
629,
8,
1099,
459,
1328,
995,
283,
6531,
440,
2248,
20107,
2366,
13628,
358,
339,
347,
511,
63,
20631,
1893,
63,
18893,
63,
705,
63,
265,
63,
2886,
8,
277,
304,
267,
663,
63,
578,
63,
589,
8,
807,
8,
288,
20107,
63,
751,
534,
751,
297,
288,
20107,
63,
1529,
534,
1529,
297,
288,
302,
17839,
534,
17,
14,
17,
14,
17,
14,
17,
297,
288,
1174,
534,
1881,
297,
267,
5082,
267,
687,
3242,
14,
3112,
14,
1200,
14,
18860,
492,
26067,
63,
1000,
398,
1021,
4420,
1726,
8,
1726,
304,
288,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
355,
291,
14,
28857,
275,
378,
355,
291,
14,
1188,
275,
2125,
398,
1890,
63,
1805,
275,
4420,
342,
267,
1890,
63,
1805,
14,
2886,
275,
4420,
8,
2441,
63,
5881,
29,
3346,
1726,
9,
267,
333,
275,
4420,
8,
1107,
63,
585,
29,
1258,
63,
1805,
9,
267,
543,
3371,
360,
4853,
14,
3112,
14,
1200,
14,
18860,
14,
18860,
63,
1000,
14,
362,
63,
18893,
63,
1258,
297,
333,
304,
288,
543,
3371,
360,
4853,
14,
3112,
14,
1200,
14,
18860,
14,
18860,
63,
1000,
14,
18893,
63,
1971,
297,
4420,
1726,
304,
355,
291,
14,
578,
275,
26067,
63,
1000,
355,
754,
275,
291,
14,
4892,
342,
355,
291,
14,
1815,
8,
1099,
459,
1328,
2278,
2460,
360,
18893,
1919,
659,
1499,
534,
18893,
1919,
5309,
4676,
440,
8860,
7684,
358,
339,
347,
511,
63,
20631,
1893,
63,
889,
63,
2105,
63,
705,
8,
277,
304,
398,
340,
984,
14,
1023,
63,
815,
1491,
18,
61,
508,
334,
18,
12,
1227,
304,
288,
291,
14,
23809,
360,
6615,
3555,
440,
2808,
1334,
2366,
18,
14,
22,
358,
267,
663,
63,
578,
63,
589,
8,
807,
8,
288,
20107,
63,
751,
534,
751,
297,
288,
20107,
63,
1529,
534,
1529,
297,
288,
302,
17839,
534,
17,
14,
17,
14,
17,
14,
17,
297,
288,
1174,
534,
1881,
297,
267,
5082,
267,
687,
3242,
14,
3112,
14,
1200,
14,
18860,
492,
26067,
63,
1000,
398,
1021,
4420,
1726,
8,
1726,
304,
288,
986,
267,
1890,
63,
1805,
275,
4420,
342,
267,
3290,
275,
791,
2886,
14,
2441,
63,
5881,
356,
4145,
14,
3924,
14,
20349,
93,
267,
1890,
63,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
quangounet/TOPP
|
src/python/Errors.py
|
1
|
1850
|
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Stéphane Caron <caron@ynl.t.u-tokyo.ac.jp>
#
# This file is part of the Time-Optimal Path Parameterization (TOPP) library.
# TOPP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# at your option, any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TOPP_UNSPEC = 0
TOPP_OK = 1
TOPP_CANNOT_PREPROCESS = 2
TOPP_SHORT_TRAJ = 3
TOPP_MVC_HIT_ZERO = 4
TOPP_CLC_ERROR = 5
TOPP_SDBEGMIN_TOO_HIGH = 6
TOPP_SDENDMIN_TOO_HIGH = 7
TOPP_FWD_HIT_ZERO = 8
TOPP_BWD_HIT_ZERO = 9
TOPP_FWD_FAIL = 10
TOPP_BWD_FAIL = 11
MESSAGES = {
TOPP_UNSPEC: "unspecified error",
TOPP_OK: "everything OK",
TOPP_CANNOT_PREPROCESS: "cannot preprocess trajectory",
TOPP_SHORT_TRAJ: "trajectory too short",
TOPP_MVC_HIT_ZERO: "MVC hit the sd=0 axis",
TOPP_CLC_ERROR: "some CLC error",
TOPP_SDBEGMIN_TOO_HIGH: "sdbegmin is too high",
TOPP_SDENDMIN_TOO_HIGH: "sdendmin is too high",
TOPP_FWD_HIT_ZERO: "forward integration hit the sd=0 axis",
TOPP_BWD_HIT_ZERO: "backward integration hit the sd=0 axis",
TOPP_FWD_FAIL: "forward integration failed",
TOPP_BWD_FAIL: "backward integration failed"
}
class NoTrajectoryFound(Exception):
def __init__(self, error_code):
self.error_code = error_code
def __str__(self):
return MESSAGES[self.error_code]
|
lgpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
1898,
334,
35,
9,
6171,
1933,
5741,
838,
5865,
14243,
265,
665,
27627,
32,
1236,
76,
14,
84,
14,
85,
13,
9305,
16540,
14,
645,
14,
11538,
30,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
314,
4703,
13,
4619,
16757,
6912,
2235,
313,
6236,
13362,
334,
11422,
48,
9,
3555,
14,
199,
3,
32582,
48,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
1664,
6401,
1696,
1684,
844,
465,
3267,
701,
199,
3,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
199,
3,
737,
2195,
945,
12,
1263,
2945,
1015,
14,
199,
3,
199,
3,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
1664,
6401,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
844,
199,
3,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
199,
11422,
48,
63,
1734,
24147,
275,
378,
199,
11422,
48,
63,
3593,
275,
413,
199,
11422,
48,
63,
18988,
4609,
63,
4225,
10494,
275,
499,
199,
11422,
48,
63,
13003,
63,
13954,
42,
275,
650,
199,
11422,
48,
63,
45,
9454,
63,
40,
649,
63,
24655,
275,
841,
199,
11422,
48,
63,
1981,
35,
63,
3170,
275,
959,
199,
11422,
48,
63,
51,
2846,
4680,
4896,
63,
30947,
63,
17624,
275,
1227,
199,
11422,
48,
63,
3693,
3902,
4896,
63,
30947,
63,
17624,
275,
1520,
199,
11422,
48,
63,
38,
16698,
63,
40,
649,
63,
24655,
275,
1695,
199,
11422,
48,
63,
34,
16698,
63,
40,
649,
63,
24655,
275,
1749,
199,
11422,
48,
63,
38,
16698,
63,
8784,
275,
1616,
199,
11422,
48,
63,
34,
16698,
63,
8784,
275,
4119,
199,
199,
23229,
275,
469,
272,
32582,
48,
63,
1734,
24147,
26,
298,
324,
10085,
1125,
401,
272,
32582,
48,
63,
3593,
26,
298,
14287,
2127,
9949,
401,
272,
32582,
48,
63,
18988,
4609,
63,
4225,
10494,
26,
298,
11250,
23351,
30595,
401,
272,
32582,
48,
63,
13003,
63,
13954,
42,
26,
298,
30575,
4634,
3974,
401,
272,
32582,
48,
63,
45,
9454,
63,
40,
649,
63,
24655,
26,
298,
45,
9454,
9793,
314,
14613,
29,
16,
3114,
401,
272,
32582,
48,
63,
1981,
35,
63,
3170,
26,
298,
3972,
21458,
1125,
401,
272,
32582,
48,
63,
51,
2846,
4680,
4896,
63,
30947,
63,
17624,
26,
298,
21624,
5902,
827,
365,
4634,
4721,
401,
272,
32582,
48,
63,
3693,
3902,
4896,
63,
30947,
63,
17624,
26,
298,
83,
32588,
827,
365,
4634,
4721,
401,
272,
32582,
48,
63,
38,
16698,
63,
40,
649,
63,
24655,
26,
298,
6688,
13150,
9793,
314,
14613,
29,
16,
3114,
401,
272,
32582,
48,
63,
34,
16698,
63,
40,
649,
63,
24655,
26,
298,
15457,
13150,
9793,
314,
14613,
29,
16,
3114,
401,
272,
32582,
48,
63,
38,
16698,
63,
8784,
26,
298,
6688,
13150,
3405,
401,
272,
32582,
48,
63,
34,
16698,
63,
8784,
26,
298,
15457,
13150,
3405,
2,
199,
93,
421,
199,
533,
3091,
2437,
17928,
3601,
8,
1726,
304,
272,
347,
636,
826,
721,
277,
12,
1125,
63,
600,
304,
267,
291,
14,
705,
63,
600,
275,
1125,
63,
600,
339,
347,
636,
495,
721,
277,
304,
267,
372,
603,
1608,
5383,
59,
277,
14,
705,
63,
600,
61,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
1898,
334,
35,
9,
6171,
1933,
5741,
838,
5865,
14243,
265,
665,
27627,
32,
1236,
76,
14,
84,
14,
85,
13,
9305,
16540,
14,
645,
14,
11538,
30,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
314,
4703,
13,
4619,
16757,
6912,
2235,
313,
6236,
13362,
334,
11422,
48,
9,
3555,
14,
199,
3,
32582,
48,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
1664,
6401,
1696,
1684,
844,
465,
3267,
701,
199,
3,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
199,
3,
737,
2195,
945,
12,
1263,
2945,
1015,
14,
199,
3,
199,
3,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
1664,
6401,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
844,
199,
3,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
199,
11422,
48,
63,
1734,
24147,
275,
378,
199,
11422,
48,
63,
3593,
275,
413,
199,
11422,
48,
63,
18988,
4609,
63,
4225,
10494,
275,
499,
199,
11422,
48,
63,
13003,
63,
13954,
42,
275,
650,
199,
11422,
48,
63,
45,
9454,
63,
40,
649,
63,
24655,
275,
841,
199,
11422,
48,
63,
1981,
35,
63,
3170,
275,
959,
199,
11422,
48,
63,
51,
2846,
4680,
4896,
63,
30947,
63,
17624,
275,
1227,
199,
11422,
48,
63,
3693,
3902,
4896,
63,
30947,
63,
17624,
275,
1520,
199,
11422,
48,
63,
38,
16698,
63,
40,
649,
63,
24655,
275,
1695,
199,
11422,
48,
63,
34,
16698,
63,
40,
649,
63,
24655,
275,
1749,
199,
11422,
48,
63,
38,
16698,
63,
8784,
275,
1616,
199,
11422,
48,
63,
34,
16698,
63,
8784,
275,
4119,
199,
199,
23229,
275,
469,
272,
32582,
48,
63,
1734,
24147,
26,
298,
324,
10085,
1125,
401,
272,
32582,
48,
63,
3593,
26,
298,
14287,
2127,
9949,
401,
272,
32582,
48,
63,
18988,
4609,
63,
4225,
10494,
26,
298,
11250,
23351,
30595,
401,
272,
32582,
48,
63,
13003,
63,
13954,
42,
26,
298,
30575,
4634,
3974,
401,
272,
32582,
48,
63,
45,
9454,
63,
40,
649,
63,
24655,
26,
298,
45,
9454,
9793,
314,
14613,
29,
16,
3114,
401,
272,
32582,
48,
63,
1981,
35,
63,
3170,
26,
298,
3972,
21458,
1125,
401,
272,
32582,
48,
63,
51,
2846,
4680,
4896,
63,
30947,
63,
17624,
26,
298,
21624,
5902,
827,
365,
4634,
4721,
401,
272,
32582,
48,
63,
3693,
3902,
4896,
63,
30947,
63,
17624,
26,
298,
83,
32588,
827,
365,
4634,
4721,
401,
272,
32582,
48,
63,
38,
16698,
63,
40,
649,
63,
24655,
26,
298,
6688,
13150,
9793,
314,
14613,
29,
16,
3114,
401,
272,
32582,
48,
63,
34,
16698,
63,
40,
649,
63,
24655,
26,
298,
15457,
13150,
9793,
314,
14613,
29,
16,
3114,
401,
272,
32582,
48,
63,
38,
16698,
63,
8784,
26,
298,
6688,
13150,
3405,
401,
272,
32582,
48,
63,
34,
16698,
63,
8784,
26,
298,
15457,
13150,
3405,
2,
199,
93,
421,
199,
533,
3091,
2437,
17928,
3601,
8,
1726,
304,
272,
347,
636,
826,
721,
277,
12,
1125,
63,
600,
304,
267,
291,
14,
705,
63,
600,
275,
1125,
63,
600,
339,
347,
636,
495,
721,
277,
304,
267,
372,
603,
1608,
5383,
59,
277,
14,
705,
63,
600,
61,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
indashnet/InDashNet.Open.UN2000
|
android/bionic/libc/kernel/tools/cpp.py
|
5
|
74831
|
# a glorified C pre-processor parser
import sys, re, string
from utils import *
from defaults import *
debugTokens = False
debugDirectiveTokenizer = False
debugLineParsing = False
debugCppExpr = False
debugOptimIf01 = False
#####################################################################################
#####################################################################################
##### #####
##### C P P T O K E N S #####
##### #####
#####################################################################################
#####################################################################################
# the list of supported C-preprocessor tokens
# plus a couple of C tokens as well
tokEOF = "\0"
tokLN = "\n"
tokSTRINGIFY = "#"
tokCONCAT = "##"
tokLOGICAND = "&&"
tokLOGICOR = "||"
tokSHL = "<<"
tokSHR = ">>"
tokEQUAL = "=="
tokNEQUAL = "!="
tokLT = "<"
tokLTE = "<="
tokGT = ">"
tokGTE = ">="
tokELLIPSIS = "..."
tokSPACE = " "
tokDEFINED = "defined"
tokLPAREN = "("
tokRPAREN = ")"
tokNOT = "!"
tokPLUS = "+"
tokMINUS = "-"
tokMULTIPLY = "*"
tokDIVIDE = "/"
tokMODULUS = "%"
tokBINAND = "&"
tokBINOR = "|"
tokBINXOR = "^"
tokCOMMA = ","
tokLBRACE = "{"
tokRBRACE = "}"
tokARROW = "->"
tokINCREMENT = "++"
tokDECREMENT = "--"
tokNUMBER = "<number>"
tokIDENT = "<ident>"
tokSTRING = "<string>"
class Token:
"""a simple class to hold information about a given token.
each token has a position in the source code, as well as
an 'id' and a 'value'. the id is a string that identifies
the token's class, while the value is the string of the
original token itself.
for example, the tokenizer concatenates a series of spaces
and tabs as a single tokSPACE id, whose value if the original
spaces+tabs sequence."""
def __init__(self):
self.id = None
self.value = None
self.lineno = 0
self.colno = 0
def set(self,id,val=None):
self.id = id
if val:
self.value = val
else:
self.value = id
return None
def copyFrom(self,src):
self.id = src.id
self.value = src.value
self.lineno = src.lineno
self.colno = src.colno
def __repr__(self):
if self.id == tokIDENT:
return "(ident %s)" % self.value
if self.id == tokNUMBER:
return "(number %s)" % self.value
if self.id == tokSTRING:
return "(string '%s')" % self.value
if self.id == tokLN:
return "<LN>"
if self.id == tokEOF:
return "<EOF>"
if self.id == tokSPACE and self.value == "\\":
# this corresponds to a trailing \ that was transformed into a tokSPACE
return "<\\>"
return self.id
def __str__(self):
if self.id == tokIDENT:
return self.value
if self.id == tokNUMBER:
return self.value
if self.id == tokSTRING:
return self.value
if self.id == tokEOF:
return "<EOF>"
if self.id == tokSPACE:
if self.value == "\\": # trailing \
return "\\\n"
else:
return self.value
return self.id
class BadExpectedToken(Exception):
def __init__(self,msg):
print msg
#####################################################################################
#####################################################################################
##### #####
##### C P P T O K E N C U R S O R #####
##### #####
#####################################################################################
#####################################################################################
class TokenCursor:
"""a small class to iterate over a list of Token objects"""
def __init__(self,tokens):
self.tokens = tokens
self.n = 0
self.count = len(tokens)
def set(self,n):
"""set the current position"""
if n < 0:
n = 0
if n > self.count:
n = self.count
self.n = n
def peekId(self):
"""retrieve the id of the current token"""
if (self.n >= self.count):
return None
return self.tokens[self.n].id
def peek(self):
"""retrieve the current token. does not change position"""
if (self.n >= self.count):
return None
return self.tokens[self.n]
def skip(self):
"""increase current token position"""
if (self.n < self.count):
self.n += 1
def skipSpaces(self):
"""skip over all space tokens, this includes tokSPACE and tokLN"""
while 1:
tok = self.peekId()
if tok != tokSPACE and tok != tokLN:
break
self.skip()
def skipIfId(self,id):
"""skip an optional token"""
if self.peekId() == id:
self.skip()
def expectId(self,id):
"""raise an exception if the current token hasn't a given id.
otherwise skip over it"""
tok = self.peek()
if tok.id != id:
raise BadExpectedToken, "%d:%d: '%s' expected, received '%s'" % (tok.lineno, tok.colno, id, tok.id)
self.skip()
def remain(self):
"""return the list of remaining tokens"""
return self.tokens[self.n:]
#####################################################################################
#####################################################################################
##### #####
##### C P P T O K E N I Z E R #####
##### #####
#####################################################################################
#####################################################################################
# list of long symbols, i.e. those that take more than one characters
cppLongSymbols = [ tokCONCAT, tokLOGICAND, tokLOGICOR, tokSHL, tokSHR, tokELLIPSIS, tokEQUAL,\
tokNEQUAL, tokLTE, tokGTE, tokARROW, tokINCREMENT, tokDECREMENT ]
class CppTokenizer:
"""an abstract class used to convert some input text into a list
of tokens. real implementations follow and differ in the format
of the input text only"""
def __init__(self):
"""initialize a new CppTokenizer object"""
self.eof = False # end of file reached ?
self.text = None # content of current line, with final \n stripped
self.line = 0 # number of current line
self.pos = 0 # current character position in current line
self.len = 0 # length of current line text
self.held = Token()
def setLineText(self,line):
"""set the content of the (next) current line. should be called
by fillLineText() in derived classes"""
self.text = line
self.len = len(line)
self.pos = 0
def fillLineText(self):
"""refresh the content of 'line' with a new line of input"""
# to be overriden
self.eof = True
def markPos(self,tok):
"""mark the position of the current token in the source file"""
if self.eof or self.pos > self.len:
tok.lineno = self.line + 1
tok.colno = 0
else:
tok.lineno = self.line
tok.colno = self.pos
def peekChar(self):
"""return the current token under the cursor without moving it"""
if self.eof:
return tokEOF
if self.pos > self.len:
self.pos = 0
self.line += 1
self.fillLineText()
if self.eof:
return tokEOF
if self.pos == self.len:
return tokLN
else:
return self.text[self.pos]
def peekNChar(self,n):
"""try to peek the next n chars on the same line"""
if self.pos + n > self.len:
return None
return self.text[self.pos:self.pos+n]
def skipChar(self):
"""increment the token cursor position"""
if not self.eof:
self.pos += 1
def skipNChars(self,n):
if self.pos + n <= self.len:
self.pos += n
else:
while n > 0:
self.skipChar()
n -= 1
def nextChar(self):
"""retrieve the token at the current cursor position, then skip it"""
result = self.peekChar()
self.skipChar()
return result
def getEscape(self):
# try to get all characters after a backslash (\)
result = self.nextChar()
if result == "0":
# octal number ?
num = self.peekNChar(3)
if num != None:
isOctal = True
for d in num:
if not d in "01234567":
isOctal = False
break
if isOctal:
result += num
self.skipNChars(3)
elif result == "x" or result == "X":
# hex number ?
num = self.peekNChar(2)
if num != None:
isHex = True
for d in num:
if not d in "012345678abcdefABCDEF":
isHex = False
break
if isHex:
result += num
self.skipNChars(2)
elif result == "u" or result == "U":
# unicode char ?
num = self.peekNChar(4)
if num != None:
isHex = True
for d in num:
if not d in "012345678abcdefABCDEF":
isHex = False
break
if isHex:
result += num
self.skipNChars(4)
return result
def nextRealToken(self,tok):
"""return next CPP token, used internally by nextToken()"""
c = self.nextChar()
if c == tokEOF or c == tokLN:
return tok.set(c)
if c == '/':
c = self.peekChar()
if c == '/': # C++ comment line
self.skipChar()
while 1:
c = self.nextChar()
if c == tokEOF or c == tokLN:
break
return tok.set(tokLN)
if c == '*': # C comment start
self.skipChar()
value = "/*"
prev_c = None
while 1:
c = self.nextChar()
if c == tokEOF:
#print "## EOF after '%s'" % value
return tok.set(tokEOF,value)
if c == '/' and prev_c == '*':
break
prev_c = c
value += c
value += "/"
#print "## COMMENT: '%s'" % value
return tok.set(tokSPACE,value)
c = '/'
if c.isspace():
while 1:
c2 = self.peekChar()
if c2 == tokLN or not c2.isspace():
break
c += c2
self.skipChar()
return tok.set(tokSPACE,c)
if c == '\\':
if debugTokens:
print "nextRealToken: \\ found, next token is '%s'" % repr(self.peekChar())
if self.peekChar() == tokLN: # trailing \
# eat the tokLN
self.skipChar()
# we replace a trailing \ by a tokSPACE whose value is
# simply "\\". this allows us to detect them later when
# needed.
return tok.set(tokSPACE,"\\")
else:
# treat as a single token here ?
c +=self.getEscape()
return tok.set(c)
if c == "'": # chars
c2 = self.nextChar()
c += c2
if c2 == '\\':
c += self.getEscape()
while 1:
c2 = self.nextChar()
if c2 == tokEOF:
break
c += c2
if c2 == "'":
break
return tok.set(tokSTRING, c)
if c == '"': # strings
quote = 0
while 1:
c2 = self.nextChar()
if c2 == tokEOF:
return tok.set(tokSTRING,c)
c += c2
if not quote:
if c2 == '"':
return tok.set(tokSTRING,c)
if c2 == "\\":
quote = 1
else:
quote = 0
if c >= "0" and c <= "9": # integers ?
while 1:
c2 = self.peekChar()
if c2 == tokLN or (not c2.isalnum() and c2 != "_"):
break
c += c2
self.skipChar()
return tok.set(tokNUMBER,c)
if c.isalnum() or c == "_": # identifiers ?
while 1:
c2 = self.peekChar()
if c2 == tokLN or (not c2.isalnum() and c2 != "_"):
break
c += c2
self.skipChar()
if c == tokDEFINED:
return tok.set(tokDEFINED)
else:
return tok.set(tokIDENT,c)
# check special symbols
for sk in cppLongSymbols:
if c == sk[0]:
sklen = len(sk[1:])
if self.pos + sklen <= self.len and \
self.text[self.pos:self.pos+sklen] == sk[1:]:
self.pos += sklen
return tok.set(sk)
return tok.set(c)
def nextToken(self,tok):
"""return the next token from the input text. this function
really updates 'tok', and does not return a new one"""
self.markPos(tok)
self.nextRealToken(tok)
def getToken(self):
tok = Token()
self.nextToken(tok)
if debugTokens:
print "getTokens: %s" % repr(tok)
return tok
def toTokenList(self):
"""convert the input text of a CppTokenizer into a direct
list of token objects. tokEOF is stripped from the result"""
result = []
while 1:
tok = Token()
self.nextToken(tok)
if tok.id == tokEOF:
break
result.append(tok)
return result
class CppLineTokenizer(CppTokenizer):
"""a CppTokenizer derived class that accepts a single line of text as input"""
def __init__(self,line,lineno=1):
CppTokenizer.__init__(self)
self.line = lineno
self.setLineText(line)
class CppLinesTokenizer(CppTokenizer):
"""a CppTokenizer derived class that accepts a list of texdt lines as input.
the lines must not have a trailing \n"""
def __init__(self,lines=[],lineno=1):
"""initialize a CppLinesTokenizer. you can later add lines using addLines()"""
CppTokenizer.__init__(self)
self.line = lineno
self.lines = lines
self.index = 0
self.count = len(lines)
if self.count > 0:
self.fillLineText()
else:
self.eof = True
def addLine(self,line):
"""add a line to a CppLinesTokenizer. this can be done after tokenization
happens"""
if self.count == 0:
self.setLineText(line)
self.index = 1
self.lines.append(line)
self.count += 1
self.eof = False
def fillLineText(self):
if self.index < self.count:
self.setLineText(self.lines[self.index])
self.index += 1
else:
self.eof = True
class CppFileTokenizer(CppTokenizer):
def __init__(self,file,lineno=1):
CppTokenizer.__init__(self)
self.file = file
self.line = lineno
def fillLineText(self):
line = self.file.readline()
if len(line) > 0:
if line[-1] == '\n':
line = line[:-1]
if len(line) > 0 and line[-1] == "\r":
line = line[:-1]
self.setLineText(line)
else:
self.eof = True
# Unit testing
#
class CppTokenizerTester:
"""a class used to test CppTokenizer classes"""
def __init__(self,tokenizer=None):
self.tokenizer = tokenizer
self.token = Token()
def setTokenizer(self,tokenizer):
self.tokenizer = tokenizer
def expect(self,id):
self.tokenizer.nextToken(self.token)
tokid = self.token.id
if tokid == id:
return
if self.token.value == id and (tokid == tokIDENT or tokid == tokNUMBER):
return
raise BadExpectedToken, "### BAD TOKEN: '%s' expecting '%s'" % (self.token.id,id)
def expectToken(self,id,line,col):
self.expect(id)
if self.token.lineno != line:
raise BadExpectedToken, "### BAD LINENO: token '%s' got '%d' expecting '%d'" % (id,self.token.lineno,line)
if self.token.colno != col:
raise BadExpectedToken, "### BAD COLNO: '%d' expecting '%d'" % (self.token.colno,col)
def expectTokenVal(self,id,value,line,col):
self.expectToken(id,line,col)
if self.token.value != value:
raise BadExpectedToken, "### BAD VALUE: '%s' expecting '%s'" % (self.token.value,value)
def expectList(self,list):
for item in list:
self.expect(item)
def test_CppTokenizer():
print "running CppTokenizer tests"
tester = CppTokenizerTester()
tester.setTokenizer( CppLineTokenizer("#an/example && (01923_xy)") )
tester.expectList( ["#", "an", "/", "example", tokSPACE, tokLOGICAND, tokSPACE, tokLPAREN, "01923_xy", \
tokRPAREN, tokLN, tokEOF] )
tester.setTokenizer( CppLineTokenizer("FOO(BAR) && defined(BAZ)") )
tester.expectList( ["FOO", tokLPAREN, "BAR", tokRPAREN, tokSPACE, tokLOGICAND, tokSPACE,
tokDEFINED, tokLPAREN, "BAZ", tokRPAREN, tokLN, tokEOF] )
tester.setTokenizer( CppLinesTokenizer( ["/*", "#", "*/"] ) )
tester.expectList( [ tokSPACE, tokLN, tokEOF ] )
tester.setTokenizer( CppLinesTokenizer( ["first", "second"] ) )
tester.expectList( [ "first", tokLN, "second", tokLN, tokEOF ] )
tester.setTokenizer( CppLinesTokenizer( ["first second", " third"] ) )
tester.expectToken( "first", 1, 0 )
tester.expectToken( tokSPACE, 1, 5 )
tester.expectToken( "second", 1, 6 )
tester.expectToken( tokLN, 1, 12 )
tester.expectToken( tokSPACE, 2, 0 )
tester.expectToken( "third", 2, 2 )
tester.setTokenizer( CppLinesTokenizer( [ "boo /* what the", "hell */" ] ) )
tester.expectList( [ "boo", tokSPACE ] )
tester.expectTokenVal( tokSPACE, "/* what the\nhell */", 1, 4 )
tester.expectList( [ tokLN, tokEOF ] )
tester.setTokenizer( CppLinesTokenizer( [ "an \\", " example" ] ) )
tester.expectToken( "an", 1, 0 )
tester.expectToken( tokSPACE, 1, 2 )
tester.expectTokenVal( tokSPACE, "\\", 1, 3 )
tester.expectToken( tokSPACE, 2, 0 )
tester.expectToken( "example", 2, 1 )
tester.expectToken( tokLN, 2, 8 )
return True
#####################################################################################
#####################################################################################
##### #####
##### C P P E X P R E S S I O N S #####
##### #####
#####################################################################################
#####################################################################################
# Cpp expressions are modeled by tuples of the form (op,arg) or (op,arg1,arg2), etc..
# op is an "operator" string
class Expr:
"""a class used to model a CPP expression"""
opInteger = "int"
opIdent = "ident"
opCall = "call"
opDefined = "defined"
opTest = "?"
opLogicNot = "!"
opNot = "~"
opNeg = "[-]"
opUnaryPlus = "[+]"
opAdd = "+"
opSub = "-"
opMul = "*"
opDiv = "/"
opMod = "%"
opAnd = "&"
opOr = "|"
opXor = "^"
opLogicAnd = "&&"
opLogicOr = "||"
opEqual = "=="
opNotEqual = "!="
opLess = "<"
opLessEq = "<="
opGreater = ">"
opGreaterEq = ">="
opShl = "<<"
opShr = ">>"
unaries = [ opLogicNot, opNot, opNeg, opUnaryPlus ]
binaries = [ opAdd, opSub, opMul, opDiv, opMod, opAnd, opOr, opXor, opLogicAnd, opLogicOr,
opEqual, opNotEqual, opLess, opLessEq, opGreater, opGreaterEq ]
precedences = {
opTest: 0,
opLogicOr: 1,
opLogicNot: 2,
opOr : 3,
opXor: 4,
opAnd: 5,
opEqual: 6, opNotEqual: 6,
opLess:7, opLessEq:7, opGreater:7, opGreaterEq:7,
opShl:8, opShr:8,
opAdd:9, opSub:9,
opMul:10, opDiv:10, opMod:10,
opLogicNot:11,
opNot: 12,
}
def __init__(self,op):
self.op = op
def __repr__(self):
return "(%s)" % self.op
def __str__(self):
return "operator(%s)" % self.op
def precedence(self):
"""return the precedence of a given operator"""
return Expr.precedences.get(self.op, 1000)
def isUnary(self):
return self.op in Expr.unaries
def isBinary(self):
return self.op in Expr.binaries
def isDefined(self):
return self.op is opDefined
def toInt(self):
"""return the integer value of a given expression. only valid for integer expressions
will return None otherwise"""
return None
class IntExpr(Expr):
def __init__(self,value):
Expr.__init__(self,opInteger)
self.arg = value
def __repr__(self):
return "(int %s)" % self.arg
def __str__(self):
return self.arg
def toInt(self):
s = self.arg # string value
# get rid of U or L suffixes
while len(s) > 0 and s[-1] in "LUlu":
s = s[:-1]
return string.atoi(s)
class IdentExpr(Expr):
def __init__(self,name):
Expr.__init__(self,opIdent)
self.name = name
def __repr__(self):
return "(ident %s)" % self.name
def __str__(self):
return self.name
class CallExpr(Expr):
def __init__(self,funcname,params):
Expr.__init__(self,opCall)
self.funcname = funcname
self.params = params
def __repr__(self):
result = "(call %s [" % self.funcname
comma = ""
for param in self.params:
result += "%s%s" % (comma, repr(param))
comma = ","
result += "])"
return result
def __str__(self):
result = "%s(" % self.funcname
comma = ""
for param in self.params:
result += "%s%s" % (comma, str(param))
comma = ","
result += ")"
return result
class TestExpr(Expr):
def __init__(self,cond,iftrue,iffalse):
Expr.__init__(self,opTest)
self.cond = cond
self.iftrue = iftrue
self.iffalse = iffalse
def __repr__(self):
return "(?: %s %s %s)" % (repr(self.cond),repr(self.iftrue),repr(self.iffalse))
def __str__(self):
return "(%s) ? (%s) : (%s)" % (self.cond, self.iftrue, self.iffalse)
class SingleArgExpr(Expr):
def __init__(self,op,arg):
Expr.__init__(self,op)
self.arg = arg
def __repr__(self):
return "(%s %s)" % (self.op, repr(self.arg))
class DefinedExpr(SingleArgExpr):
def __init__(self,op,macroname):
SingleArgExpr.__init__(self.opDefined,macroname)
def __str__(self):
return "defined(%s)" % self.arg
class UnaryExpr(SingleArgExpr):
def __init__(self,op,arg,opstr=None):
SingleArgExpr.__init__(self,op,arg)
if not opstr:
opstr = op
self.opstr = opstr
def __str__(self):
arg_s = str(self.arg)
arg_prec = self.arg.precedence()
self_prec = self.precedence()
if arg_prec < self_prec:
return "%s(%s)" % (self.opstr,arg_s)
else:
return "%s%s" % (self.opstr, arg_s)
class TwoArgExpr(Expr):
def __init__(self,op,arg1,arg2):
Expr.__init__(self,op)
self.arg1 = arg1
self.arg2 = arg2
def __repr__(self):
return "(%s %s %s)" % (self.op, repr(self.arg1), repr(self.arg2))
class BinaryExpr(TwoArgExpr):
def __init__(self,op,arg1,arg2,opstr=None):
TwoArgExpr.__init__(self,op,arg1,arg2)
if not opstr:
opstr = op
self.opstr = opstr
def __str__(self):
arg1_s = str(self.arg1)
arg2_s = str(self.arg2)
arg1_prec = self.arg1.precedence()
arg2_prec = self.arg2.precedence()
self_prec = self.precedence()
result = ""
if arg1_prec < self_prec:
result += "(%s)" % arg1_s
else:
result += arg1_s
result += " %s " % self.opstr
if arg2_prec < self_prec:
result += "(%s)" % arg2_s
else:
result += arg2_s
return result
#####################################################################################
#####################################################################################
##### #####
##### C P P E X P R E S S I O N P A R S E R #####
##### #####
#####################################################################################
#####################################################################################
class ExprParser:
"""a class used to convert a list of tokens into a cpp Expr object"""
re_octal = re.compile(r"\s*\(0[0-7]+\).*")
re_decimal = re.compile(r"\s*\(\d+[ulUL]*\).*")
re_hexadecimal = re.compile(r"\s*\(0[xX][0-9a-fA-F]*\).*")
def __init__(self,tokens):
self.tok = tokens
self.n = len(self.tok)
self.i = 0
def mark(self):
return self.i
def release(self,pos):
self.i = pos
def peekId(self):
if self.i < self.n:
return self.tok[self.i].id
return None
def peek(self):
if self.i < self.n:
return self.tok[self.i]
return None
def skip(self):
if self.i < self.n:
self.i += 1
def skipOptional(self,id):
if self.i < self.n and self.tok[self.i].id == id:
self.i += 1
def skipSpaces(self):
i = self.i
n = self.n
tok = self.tok
while i < n and (tok[i] == tokSPACE or tok[i] == tokLN):
i += 1
self.i = i
# all the isXXX functions returns a (expr,nextpos) pair if a match is found
# or None if not
def is_integer(self):
id = self.tok[self.i].id
c = id[0]
if c < '0' or c > '9':
return None
m = ExprParser.re_octal.match(id)
if m:
return (IntExpr(id), m.end(1))
m = ExprParser.re_decimal.match(id)
if m:
return (IntExpr(id), m.end(1))
m = ExprParser.re_hexadecimal(id)
if m:
return (IntExpr(id), m.end(1))
return None
def is_defined(self):
id = self.tok[self.i].id
if id != "defined":
return None
pos = self.mark()
use_paren = 0
if self.peekId() == tokLPAREN:
self.skip()
use_paren = 1
if self.peekId() != tokIDENT:
self.throw( BadExpectedToken, "identifier expected")
macroname = self.peek().value
self.skip()
if use_paren:
self.skipSpaces()
if self.peekId() != tokRPAREN:
self.throw( BadExpectedToken, "missing right-paren after 'defined' directive")
self.skip()
i = self.i
return (DefinedExpr(macroname),i+1)
def is_call_or_ident(self):
pass
def parse(self, i):
return None
#####################################################################################
#####################################################################################
##### #####
##### C P P E X P R E S S I O N S #####
##### #####
#####################################################################################
#####################################################################################
class CppInvalidExpression(Exception):
"""an exception raised when an invalid/unsupported cpp expression is detected"""
pass
class CppExpr:
"""a class that models the condition of #if directives into
an expression tree. each node in the tree is of the form (op,arg) or (op,arg1,arg2)
where "op" is a string describing the operation"""
unaries = [ "!", "~" ]
binaries = [ "+", "-", "<", "<=", ">=", ">", "&&", "||", "*", "/", "%", "&", "|", "^", "<<", ">>", "==", "!=" ]
precedences = { "||": 1,
"&&": 2,
"|": 3,
"^": 4,
"&": 5,
"==":6, "!=":6,
"<":7, "<=":7, ">":7, ">=":7,
"<<":8, ">>":8,
"+":9, "-":9,
"*":10, "/":10, "%":10,
"!":11, "~":12
}
def __init__(self, tokens):
"""initialize a CppExpr. 'tokens' must be a CppToken list"""
self.tok = tokens
self.n = len(tokens)
if debugCppExpr:
print "CppExpr: trying to parse %s" % repr(tokens)
expr = self.is_expr(0)
if debugCppExpr:
print "CppExpr: got " + repr(expr)
self.expr = expr[0]
re_cpp_constant = re.compile(r"((\d|\w|_)+)")
def throw(self,exception,i,msg):
if i < self.n:
tok = self.tok[i]
print "%d:%d: %s" % (tok.lineno,tok.colno,msg)
else:
print "EOF: %s" % msg
raise exception
def skip_spaces(self,i):
"""skip spaces in input token list"""
while i < self.n:
t = self.tok[i]
if t.id != tokSPACE and t.id != tokLN:
break
i += 1
return i
def expectId(self,i,id):
"""check that a given token id is at the current position, then skip over it"""
i = self.skip_spaces(i)
if i >= self.n or self.tok[i].id != id:
self.throw(BadExpectedToken,i,"### expecting '%s' in expression, got '%s'" % (id, self.tok[i].id))
return i+1
def expectIdent(self,i):
i = self.skip_spaces(i)
if i >= self.n or self.tok[i].id != tokIDENT:
self.throw(BadExpectedToken,i,"### expecting identifier in expression, got '%s'" % (id, self.tok[i].id))
return i+1
# the is_xxxxx function returns either None or a pair (e,nextpos)
# where 'e' is an expression tuple (e.g. (op,arg)) and 'nextpos' is
# the corresponding next position in the input token list
#
def is_decimal(self,i):
v = self.tok[i].value[:]
while len(v) > 0 and v[-1] in "ULul":
v = v[:-1]
for digit in v:
if not digit.isdigit():
return None
# for an integer expression tuple, the argument
# is simply the value as an integer
val = string.atoi(v)
return ("int", val), i+1
def is_hexadecimal(self,i):
v = self.tok[i].value[:]
while len(v) > 0 and v[-1] in "ULul":
v = v[:-1]
if len(v) > 2 and (v[0:2] == "0x" or v[0:2] == "0X"):
for digit in v[2:]:
if not digit in "0123456789abcdefABCDEF":
return None
# for an hex expression tuple, the argument
# is the value as an integer
val = int(v[2:], 16)
return ("hex", val), i+1
return None
def is_integer(self,i):
if self.tok[i].id != tokNUMBER:
return None
c = self.is_decimal(i)
if c: return c
c = self.is_hexadecimal(i)
if c: return c
return None
def is_number(self,i):
t = self.tok[i]
if t.id == tokMINUS and i+1 < self.n:
c = self.is_integer(i+1)
if c:
e, i2 = c
op, val = e
return (op, -val), i2
if t.id == tokPLUS and i+1 < self.n:
c = self.is_integer(i+1)
if c: return c
return self.is_integer(i)
def is_alnum(self,i):
"""test wether a given token is alpha-numeric"""
i = self.skip_spaces(i)
if i >= self.n:
return None
t = self.tok[i]
m = CppExpr.re_cpp_constant.match(t.id)
if m:
#print "... alnum '%s'" % m.group(1)
r = m.group(1)
return ("ident", r), i+1
return None
def is_defined(self,i):
t = self.tok[i]
if t.id != tokDEFINED:
return None
# we have the defined keyword, check the rest
i = self.skip_spaces(i+1)
use_parens = 0
if i < self.n and self.tok[i].id == tokLPAREN:
use_parens = 1
i = self.skip_spaces(i+1)
if i >= self.n:
self.throw(CppConstantExpected,i,"### 'defined' must be followed by macro name or left paren")
t = self.tok[i]
if t.id != tokIDENT:
self.throw(CppConstantExpected,i,"### 'defined' must be followed by macro name")
i += 1
if use_parens:
i = self.expectId(i,tokRPAREN)
return ("defined",t.value), i
def is_call_or_ident(self,i):
i = self.skip_spaces(i)
if i >= self.n:
return None
t = self.tok[i]
if t.id != tokIDENT:
return None
name = t.value
i = self.skip_spaces(i+1)
if i >= self.n or self.tok[i].id != tokLPAREN:
return ("ident", name), i
params = []
depth = 1
i += 1
j = i
while i < self.n:
id = self.tok[i].id
if id == tokLPAREN:
depth += 1
elif depth == 1 and (id == tokCOMMA or id == tokRPAREN):
while j < i and self.tok[j].id == tokSPACE:
j += 1
k = i
while k > j and self.tok[k-1].id == tokSPACE:
k -= 1
param = self.tok[j:k]
params.append( param )
if id == tokRPAREN:
break
j = i+1
elif id == tokRPAREN:
depth -= 1
i += 1
if i >= self.n:
return None
return ("call", (name, params)), i+1
def is_token(self,i,token):
i = self.skip_spaces(i)
if i >= self.n or self.tok[i].id != token:
return None
return token, i+1
def is_value(self,i):
t = self.tok[i]
if t.id == tokSTRING:
return ("string", t.value), i+1
c = self.is_number(i)
if c: return c
c = self.is_defined(i)
if c: return c
c = self.is_call_or_ident(i)
if c: return c
i = self.skip_spaces(i)
if i >= self.n or self.tok[i].id != tokLPAREN:
return None
popcount = 1
i2 = i+1
while i2 < self.n:
t = self.tok[i2]
if t.id == tokLPAREN:
popcount += 1
elif t.id == tokRPAREN:
popcount -= 1
if popcount == 0:
break
i2 += 1
if popcount != 0:
self.throw(CppInvalidExpression, i, "expression missing closing parenthesis")
if debugCppExpr:
print "CppExpr: trying to parse sub-expression %s" % repr(self.tok[i+1:i2])
oldcount = self.n
self.n = i2
c = self.is_expr(i+1)
self.n = oldcount
if not c:
self.throw(CppInvalidExpression, i, "invalid expression within parenthesis")
e, i = c
return e, i2+1
def is_unary(self,i):
i = self.skip_spaces(i)
if i >= self.n:
return None
t = self.tok[i]
if t.id in CppExpr.unaries:
c = self.is_unary(i+1)
if not c:
self.throw(CppInvalidExpression, i, "%s operator must be followed by value" % t.id)
e, i = c
return (t.id, e), i
return self.is_value(i)
def is_binary(self,i):
i = self.skip_spaces(i)
if i >= self.n:
return None
c = self.is_unary(i)
if not c:
return None
e1, i2 = c
i2 = self.skip_spaces(i2)
if i2 >= self.n:
return c
t = self.tok[i2]
if t.id in CppExpr.binaries:
c = self.is_binary(i2+1)
if not c:
self.throw(CppInvalidExpression, i,"### %s operator must be followed by value" % t.id )
e2, i3 = c
return (t.id, e1, e2), i3
return None
def is_expr(self,i):
return self.is_binary(i)
def dump_node(self,e):
op = e[0]
line = "(" + op
if op == "int":
line += " %d)" % e[1]
elif op == "hex":
line += " 0x%x)" % e[1]
elif op == "ident":
line += " %s)" % e[1]
elif op == "defined":
line += " %s)" % e[1]
elif op == "call":
arg = e[1]
line += " %s [" % arg[0]
prefix = ""
for param in arg[1]:
par = ""
for tok in param:
par += str(tok)
line += "%s%s" % (prefix, par)
prefix = ","
line += "])"
elif op in CppExpr.unaries:
line += " %s)" % self.dump_node(e[1])
elif op in CppExpr.binaries:
line += " %s %s)" % (self.dump_node(e[1]), self.dump_node(e[2]))
else:
line += " ?%s)" % repr(e[1])
return line
def __repr__(self):
return self.dump_node(self.expr)
def source_node(self,e):
op = e[0]
if op == "int":
return "%d" % e[1]
if op == "hex":
return "0x%x" % e[1]
if op == "ident":
# XXX: should try to expand
return e[1]
if op == "defined":
return "defined(%s)" % e[1]
prec = CppExpr.precedences.get(op,1000)
arg = e[1]
if op in CppExpr.unaries:
arg_src = self.source_node(arg)
arg_op = arg[0]
arg_prec = CppExpr.precedences.get(arg[0],1000)
if arg_prec < prec:
return "!(" + arg_src + ")"
else:
return "!" + arg_src
if op in CppExpr.binaries:
arg2 = e[2]
arg1_op = arg[0]
arg2_op = arg2[0]
arg1_src = self.source_node(arg)
arg2_src = self.source_node(arg2)
if CppExpr.precedences.get(arg1_op,1000) < prec:
arg1_src = "(%s)" % arg1_src
if CppExpr.precedences.get(arg2_op,1000) < prec:
arg2_src = "(%s)" % arg2_src
return "%s %s %s" % (arg1_src, op, arg2_src)
return "???"
def __str__(self):
return self.source_node(self.expr)
def int_node(self,e):
if e[0] == "int":
return e[1]
elif e[1] == "hex":
return int(e[1],16)
else:
return None
def toInt(self):
return self.int_node(self.expr)
def optimize_node(self,e,macros={}):
op = e[0]
if op == "defined":
name = e[1]
if macros.has_key(name):
if macros[name] == kCppUndefinedMacro:
return ("int", 0)
else:
return ("int", 1)
if kernel_remove_config_macros and name.startswith("CONFIG_"):
return ("int", 0)
elif op == "!":
op, v = e
v = self.optimize_node(v, macros)
if v[0] == "int":
if v[1] == 0:
return ("int", 1)
else:
return ("int", 0)
elif op == "&&":
op, l, r = e
l = self.optimize_node(l, macros)
r = self.optimize_node(r, macros)
li = self.int_node(l)
ri = self.int_node(r)
if li != None:
if li == 0:
return ("int", 0)
else:
return r
elif op == "||":
op, l, r = e
l = self.optimize_node(l, macros)
r = self.optimize_node(r, macros)
li = self.int_node(l)
ri = self.int_node(r)
if li != None:
if li == 0:
return r
else:
return ("int", 1)
elif ri != None:
if ri == 0:
return l
else:
return ("int", 1)
return e
def optimize(self,macros={}):
self.expr = self.optimize_node(self.expr,macros)
def removePrefixedNode(self,e,prefix,names):
op = e[0]
if op == "defined":
name = e[1]
if name.startswith(prefix):
if names.has_key[name] and names[name] == "y":
return ("int", 1)
else:
return ("int", 0)
elif op in CppExpr.unaries:
op, v = e
v = self.removePrefixedNode(v,prefix,names)
return (op, v)
elif op in CppExpr.binaries:
op, v1, v2 = e
v1 = self.removePrefixedNode(v1,prefix,names)
v2 = self.removePrefixedNode(v2,prefix,names)
return (op, v1, v2)
elif op == "call":
func, params = e[1]
params2 = []
for param in params:
params2.append( self.removePrefixedNode(param,prefix,names) )
return (op, (func, params2))
return e
def removePrefixed(self,prefix,names={}):
self.expr = self.removePrefixedNode(self.expr,prefix,names)
def is_equal_node(self,e1,e2):
if e1[0] != e2[0] or len(e1) != len(e2):
return False
op = e1[0]
if op == "int" or op == "hex" or op == "!" or op == "defined":
return e1[0] == e2[0]
return self.is_equal_node(e1[1],e2[1]) and self.is_equal_node(e1[2],e2[2])
def is_equal(self,other):
return self.is_equal_node(self.expr,other.expr)
def test_cpp_expr(expr, expected):
e = CppExpr( CppLineTokenizer( expr ).toTokenList() )
#print repr(e.expr)
s1 = repr(e)
if s1 != expected:
print "KO: expression '%s' generates '%s', should be '%s'" % (expr, s1, expected)
else:
#print "OK: expression '%s'" % expr
pass
def test_cpp_expr_optim(expr, expected, macros={}):
e = CppExpr( CppLineTokenizer( expr ).toTokenList() )
e.optimize(macros)
s1 = repr(e)
if s1 != expected:
print "KO: optimized expression '%s' generates '%s', should be '%s'" % (expr, s1, expected)
else:
#print "OK: optmized expression '%s'" % expr
pass
def test_cpp_expr_source(expr, expected):
e = CppExpr( CppLineTokenizer( expr ).toTokenList() )
s1 = str(e)
if s1 != expected:
print "KO: source expression '%s' generates '%s', should be '%s'" % (expr, s1, expected)
else:
#print "OK: source expression '%s'" % expr
pass
def test_CppExpr():
print "testing CppExpr"
test_cpp_expr( "0", "(int 0)" )
test_cpp_expr( "1", "(int 1)" )
test_cpp_expr( "1 && 1", "(&& (int 1) (int 1))" )
test_cpp_expr( "1 && 0", "(&& (int 1) (int 0))" )
test_cpp_expr( "EXAMPLE", "(ident EXAMPLE)" )
test_cpp_expr( "EXAMPLE - 3", "(- (ident EXAMPLE) (int 3))" )
test_cpp_expr( "defined(EXAMPLE)", "(defined EXAMPLE)" )
test_cpp_expr( "!defined(EXAMPLE)", "(! (defined EXAMPLE))" )
test_cpp_expr( "defined(ABC) || defined(BINGO)", "(|| (defined ABC) (defined BINGO))" )
test_cpp_expr( "FOO(BAR)", "(call FOO [BAR])" )
test_cpp_expr_optim( "0", "(int 0)" )
test_cpp_expr_optim( "1", "(int 1)" )
test_cpp_expr_optim( "1 && 1", "(int 1)" )
test_cpp_expr_optim( "1 && 0", "(int 0)" )
test_cpp_expr_optim( "0 && 1", "(int 0)" )
test_cpp_expr_optim( "0 && 0", "(int 0)" )
test_cpp_expr_optim( "1 || 1", "(int 1)" )
test_cpp_expr_optim( "1 || 0", "(int 1)" )
test_cpp_expr_optim( "0 || 1", "(int 1)" )
test_cpp_expr_optim( "0 || 0", "(int 0)" )
test_cpp_expr_optim( "EXAMPLE", "(ident EXAMPLE)" )
test_cpp_expr_optim( "EXAMPLE - 3", "(- (ident EXAMPLE) (int 3))" )
test_cpp_expr_optim( "defined(EXAMPLE)", "(defined EXAMPLE)" )
test_cpp_expr_optim( "defined(EXAMPLE)", "(int 1)", { "EXAMPLE": "XOWOE" } )
test_cpp_expr_optim( "defined(EXAMPLE)", "(int 0)", { "EXAMPLE": kCppUndefinedMacro} )
test_cpp_expr_optim( "!defined(EXAMPLE)", "(! (defined EXAMPLE))" )
test_cpp_expr_optim( "!defined(EXAMPLE)", "(int 0)", { "EXAMPLE" : "XOWOE" } )
test_cpp_expr_optim( "!defined(EXAMPLE)", "(int 1)", { "EXAMPLE" : kCppUndefinedMacro } )
test_cpp_expr_optim( "defined(ABC) || defined(BINGO)", "(|| (defined ABC) (defined BINGO))" )
test_cpp_expr_optim( "defined(ABC) || defined(BINGO)", "(int 1)", { "ABC" : "1" } )
test_cpp_expr_optim( "defined(ABC) || defined(BINGO)", "(int 1)", { "BINGO" : "1" } )
test_cpp_expr_optim( "defined(ABC) || defined(BINGO)", "(defined ABC)", { "BINGO" : kCppUndefinedMacro } )
test_cpp_expr_optim( "defined(ABC) || defined(BINGO)", "(int 0)", { "ABC" : kCppUndefinedMacro, "BINGO" : kCppUndefinedMacro } )
test_cpp_expr_source( "0", "0" )
test_cpp_expr_source( "1", "1" )
test_cpp_expr_source( "1 && 1", "1 && 1" )
test_cpp_expr_source( "1 && 0", "1 && 0" )
test_cpp_expr_source( "0 && 1", "0 && 1" )
test_cpp_expr_source( "0 && 0", "0 && 0" )
test_cpp_expr_source( "1 || 1", "1 || 1" )
test_cpp_expr_source( "1 || 0", "1 || 0" )
test_cpp_expr_source( "0 || 1", "0 || 1" )
test_cpp_expr_source( "0 || 0", "0 || 0" )
test_cpp_expr_source( "EXAMPLE", "EXAMPLE" )
test_cpp_expr_source( "EXAMPLE - 3", "EXAMPLE - 3" )
test_cpp_expr_source( "defined(EXAMPLE)", "defined(EXAMPLE)" )
test_cpp_expr_source( "defined EXAMPLE", "defined(EXAMPLE)" )
#####################################################################################
#####################################################################################
##### #####
##### C P P B L O C K #####
##### #####
#####################################################################################
#####################################################################################
class Block:
"""a class used to model a block of input source text. there are two block types:
- directive blocks: contain the tokens of a single pre-processor directive (e.g. #if)
- text blocks, contain the tokens of non-directive blocks
the cpp parser class below will transform an input source file into a list of Block
objects (grouped in a BlockList object for convenience)"""
def __init__(self,tokens,directive=None,lineno=0):
"""initialize a new block, if 'directive' is None, this is a text block
NOTE: this automatically converts '#ifdef MACRO' into '#if defined(MACRO)'
and '#ifndef MACRO' into '#if !defined(MACRO)'"""
if directive == "ifdef":
tok = Token()
tok.set(tokDEFINED)
tokens = [ tok ] + tokens
directive = "if"
elif directive == "ifndef":
tok1 = Token()
tok2 = Token()
tok1.set(tokNOT)
tok2.set(tokDEFINED)
tokens = [ tok1, tok2 ] + tokens
directive = "if"
self.tokens = tokens
self.directive = directive
if lineno > 0:
self.lineno = lineno
else:
self.lineno = self.tokens[0].lineno
if self.isIf():
self.expr = CppExpr( self.tokens )
def isDirective(self):
"""returns True iff this is a directive block"""
return self.directive != None
def isConditional(self):
"""returns True iff this is a conditional directive block"""
return self.directive in ["if","ifdef","ifndef","else","elif","endif"]
def isDefine(self):
"""returns the macro name in a #define directive, or None otherwise"""
if self.directive != "define":
return None
return self.tokens[0].value
def isIf(self):
"""returns True iff this is an #if-like directive block"""
return self.directive in ["if","ifdef","ifndef","elif"]
def isInclude(self):
"""checks wether this is a #include directive. if true, then returns the
corresponding file name (with brackets or double-qoutes). None otherwise"""
if self.directive != "include":
return None
#print "iii " + repr(self.tokens)
if self.tokens[0].id == tokSTRING:
# a double-quote include, that's easy
return self.tokens[0].value
# we only want the bracket part, not any comments or junk after it
if self.tokens[0].id == "<":
i = 0
tok = self.tokens
n = len(tok)
while i < n and tok[i].id != ">":
i += 1
if i >= n:
return None
return string.join([ str(x) for x in tok[:i+1] ],"")
else:
return None
def removeWhiteSpace(self):
# Remove trailing whitespace and empty lines
# All whitespace is also contracted to a single space
if self.directive != None:
return
tokens = []
line = 0 # index of line start
space = -1 # index of first space, or -1
ii = 0
nn = len(self.tokens)
while ii < nn:
tok = self.tokens[ii]
# If we find a space, record its position if this is the first
# one the line start or the previous character. Don't append
# anything to tokens array yet though.
if tok.id == tokSPACE:
if space < 0:
space = ii
ii += 1
continue
# If this is a line space, ignore the spaces we found previously
# on the line, and remove empty lines.
if tok.id == tokLN:
old_line = line
old_space = space
#print "N line=%d space=%d ii=%d" % (line, space, ii)
ii += 1
line = ii
space = -1
if old_space == old_line: # line only contains spaces
#print "-s"
continue
if ii-1 == old_line: # line is empty
#print "-e"
continue
tokens.append(tok)
continue
# Other token, append any space range if any, converting each
# one to a single space character, then append the token.
if space >= 0:
jj = space
space = -1
while jj < ii:
tok2 = self.tokens[jj]
tok2.value = " "
tokens.append(tok2)
jj += 1
tokens.append(tok)
ii += 1
self.tokens = tokens
def writeWithWarning(self,out,warning,left_count,repeat_count):
# removeWhiteSpace() will sometimes creates non-directive blocks
# without any tokens. These come from blocks that only contained
# empty lines and spaces. They should not be printed in the final
# output, and then should not be counted for this operation.
#
if not self.directive and self.tokens == []:
return left_count
if self.directive:
out.write(str(self).rstrip() + "\n")
left_count -= 1
if left_count == 0:
out.write(warning)
left_count = repeat_count
else:
for tok in self.tokens:
out.write(str(tok))
if tok.id == tokLN:
left_count -= 1
if left_count == 0:
out.write(warning)
left_count = repeat_count
return left_count
def __repr__(self):
"""generate the representation of a given block"""
if self.directive:
result = "#%s " % self.directive
if self.isIf():
result += repr(self.expr)
else:
for tok in self.tokens:
result += repr(tok)
else:
result = ""
for tok in self.tokens:
result += repr(tok)
return result
def __str__(self):
"""generate the string representation of a given block"""
if self.directive:
if self.directive == "if":
# small optimization to re-generate #ifdef and #ifndef
e = self.expr.expr
op = e[0]
if op == "defined":
result = "#ifdef %s" % e[1]
elif op == "!" and e[1][0] == "defined":
result = "#ifndef %s" % e[1][1]
else:
result = "#if " + str(self.expr)
else:
result = "#%s" % self.directive
if len(self.tokens):
result += " "
for tok in self.tokens:
result += str(tok)
else:
result = ""
for tok in self.tokens:
result += str(tok)
return result
class BlockList:
"""a convenience class used to hold and process a list of blocks returned by
the cpp parser"""
def __init__(self,blocks):
self.blocks = blocks
def __len__(self):
return len(self.blocks)
def __getitem__(self,n):
return self.blocks[n]
def __repr__(self):
return repr(self.blocks)
def __str__(self):
result = ""
for b in self.blocks:
result += str(b)
if b.isDirective():
result = result.rstrip() + '\n'
return result
def optimizeIf01(self):
"""remove the code between #if 0 .. #endif in a BlockList"""
self.blocks = optimize_if01(self.blocks)
def optimizeMacros(self, macros):
"""remove known defined and undefined macros from a BlockList"""
for b in self.blocks:
if b.isIf():
b.expr.optimize(macros)
def removeMacroDefines(self,macros):
"""remove known macro definitions from a BlockList"""
self.blocks = remove_macro_defines(self.blocks,macros)
def removePrefixed(self,prefix,names):
for b in self.blocks:
if b.isIf():
b.expr.removePrefixed(prefix,names)
def removeWhiteSpace(self):
for b in self.blocks:
b.removeWhiteSpace()
def optimizeAll(self,macros):
self.optimizeMacros(macros)
self.optimizeIf01()
return
def findIncludes(self):
"""return the list of included files in a BlockList"""
result = []
for b in self.blocks:
i = b.isInclude()
if i:
result.append(i)
return result
def write(self,out):
out.write(str(self))
def writeWithWarning(self,out,warning,repeat_count):
left_count = repeat_count
for b in self.blocks:
left_count = b.writeWithWarning(out,warning,left_count,repeat_count)
def removeComments(self):
for b in self.blocks:
for tok in b.tokens:
if tok.id == tokSPACE:
tok.value = " "
def removeVarsAndFuncs(self,knownStatics=set()):
"""remove all extern and static declarations corresponding
to variable and function declarations. we only accept typedefs
and enum/structs/union declarations.
however, we keep the definitions corresponding to the set
of known static inline functions in the set 'knownStatics',
which is useful for optimized byteorder swap functions and
stuff like that.
"""
# state = 0 => normal (i.e. LN + spaces)
# state = 1 => typedef/struct encountered, ends with ";"
# state = 2 => var declaration encountered, ends with ";"
# state = 3 => func declaration encountered, ends with "}"
state = 0
depth = 0
blocks2 = []
skipTokens = False
for b in self.blocks:
if b.isDirective():
blocks2.append(b)
else:
n = len(b.tokens)
i = 0
if skipTokens:
first = n
else:
first = 0
while i < n:
tok = b.tokens[i]
tokid = tok.id
# If we are not looking for the start of a new
# type/var/func, then skip over tokens until
# we find our terminator, managing the depth of
# accolades as we go.
if state > 0:
terminator = False
if tokid == '{':
depth += 1
elif tokid == '}':
if depth > 0:
depth -= 1
if (depth == 0) and (state == 3):
terminator = True
elif tokid == ';' and depth == 0:
terminator = True
if terminator:
# we found the terminator
state = 0
if skipTokens:
skipTokens = False
first = i+1
i = i+1
continue
# We are looking for the start of a new type/func/var
# ignore whitespace
if tokid in [tokLN, tokSPACE]:
i = i+1
continue
# Is it a new type definition, then start recording it
if tok.value in [ 'struct', 'typedef', 'enum', 'union', '__extension__' ]:
#print "$$$ keep type declr" + repr(b.tokens[i:])
state = 1
i = i+1
continue
# Is it a variable or function definition. If so, first
# try to determine which type it is, and also extract
# its name.
#
# We're going to parse the next tokens of the same block
# until we find a semi-column or a left parenthesis.
#
# The semi-column corresponds to a variable definition,
# the left-parenthesis to a function definition.
#
# We also assume that the var/func name is the last
# identifier before the terminator.
#
j = i+1
ident = ""
while j < n:
tokid = b.tokens[j].id
if tokid == '(': # a function declaration
state = 3
break
elif tokid == ';': # a variable declaration
state = 2
break
if tokid == tokIDENT:
ident = b.tokens[j].value
j += 1
if j >= n:
# This can only happen when the declaration
# does not end on the current block (e.g. with
# a directive mixed inside it.
#
# We will treat it as malformed because
# it's very hard to recover from this case
# without making our parser much more
# complex.
#
#print "### skip unterminated static '%s'" % ident
break
if ident in knownStatics:
#print "### keep var/func '%s': %s" % (ident,repr(b.tokens[i:j]))
pass
else:
# We're going to skip the tokens for this declaration
#print "### skip variable /func'%s': %s" % (ident,repr(b.tokens[i:j]))
if i > first:
blocks2.append( Block(b.tokens[first:i]))
skipTokens = True
first = n
i = i+1
if i > first:
#print "### final '%s'" % repr(b.tokens[first:i])
blocks2.append( Block(b.tokens[first:i]) )
self.blocks = blocks2
def insertDisclaimer(self,disclaimer="/* auto-generated file, DO NOT EDIT */"):
"""insert your standard issue disclaimer that this is an
auto-generated file, etc.."""
tokens = CppLineTokenizer( disclaimer ).toTokenList()
tokens = tokens[:-1] # remove trailing tokLN
self.blocks = [ Block(tokens) ] + self.blocks
def replaceTokens(self,replacements=dict()):
"""replace tokens according to the given dict
"""
for b in self.blocks:
if not b.isDirective():
for tok in b.tokens:
if tok.id == tokIDENT:
if tok.value in replacements:
tok.value = replacements[tok.value]
class BlockParser:
"""a class used to convert an input source file into a BlockList object"""
def __init__(self,tokzer=None):
"""initialize a block parser. the input source is provided through a Tokenizer
object"""
self.reset(tokzer)
def reset(self,tokzer):
self.state = 1
self.tokzer = tokzer
def getBlocks(self,tokzer=None):
"""tokenize and parse the input source, return a BlockList object
NOTE: empty and line-numbering directives are ignored and removed
from the result. as a consequence, it is possible to have
two successive text blocks in the result"""
# state 0 => in source code
# state 1 => in source code, after a LN
# state 2 => in source code, after LN then some space
state = 1
lastLN = 0
current = []
blocks = []
if tokzer == None:
tokzer = self.tokzer
while 1:
tok = tokzer.getToken()
if tok.id == tokEOF:
break
if tok.id == tokLN:
state = 1
current.append(tok)
lastLN = len(current)
elif tok.id == tokSPACE:
if state == 1:
state = 2
current.append(tok)
elif tok.id == "#":
if state > 0:
# this is the start of a directive
if lastLN > 0:
# record previous tokens as text block
block = Block(current[:lastLN])
blocks.append(block)
lastLN = 0
current = []
# skip spaces after the #
while 1:
tok = tokzer.getToken()
if tok.id != tokSPACE:
break
if tok.id != tokIDENT:
# empty or line-numbering, ignore it
if tok.id != tokLN and tok.id != tokEOF:
while 1:
tok = tokzer.getToken()
if tok.id == tokLN or tok.id == tokEOF:
break
continue
directive = tok.value
lineno = tok.lineno
# skip spaces
tok = tokzer.getToken()
while tok.id == tokSPACE:
tok = tokzer.getToken()
# then record tokens until LN
dirtokens = []
while tok.id != tokLN and tok.id != tokEOF:
dirtokens.append(tok)
tok = tokzer.getToken()
block = Block(dirtokens,directive,lineno)
blocks.append(block)
state = 1
else:
state = 0
current.append(tok)
if len(current) > 0:
block = Block(current)
blocks.append(block)
return BlockList(blocks)
def parse(self,tokzer):
return self.getBlocks( tokzer )
def parseLines(self,lines):
"""parse a list of text lines into a BlockList object"""
return self.getBlocks( CppLinesTokenizer(lines) )
def parseFile(self,path):
"""parse a file into a BlockList object"""
file = open(path, "rt")
result = self.getBlocks( CppFileTokenizer(file) )
file.close()
return result
def test_block_parsing(lines,expected):
blocks = BlockParser().parse( CppLinesTokenizer(lines) )
if len(blocks) != len(expected):
raise BadExpectedToken, "parser.buildBlocks returned '%s' expecting '%s'" \
% (str(blocks), repr(expected))
for n in range(len(blocks)):
if str(blocks[n]) != expected[n]:
raise BadExpectedToken, "parser.buildBlocks()[%d] is '%s', expecting '%s'" \
% (n, str(blocks[n]), expected[n])
#for block in blocks:
# print block
def test_BlockParser():
test_block_parsing(["#error hello"],["#error hello"])
test_block_parsing([ "foo", "", "bar" ], [ "foo\n\nbar\n" ])
test_block_parsing([ "foo", " # ", "bar" ], [ "foo\n","bar\n" ])
test_block_parsing(\
[ "foo", " # ", " # /* ahah */ if defined(__KERNEL__) ", "bar", "#endif" ],
[ "foo\n", "#ifdef __KERNEL__", "bar\n", "#endif" ] )
#####################################################################################
#####################################################################################
##### #####
##### B L O C K L I S T O P T I M I Z A T I O N #####
##### #####
#####################################################################################
#####################################################################################
def remove_macro_defines( blocks, excludedMacros=set() ):
"""remove macro definitions like #define <macroName> ...."""
result = []
for b in blocks:
macroName = b.isDefine()
if macroName == None or not macroName in excludedMacros:
result.append(b)
return result
def find_matching_endif( blocks, i ):
n = len(blocks)
depth = 1
while i < n:
if blocks[i].isDirective():
dir = blocks[i].directive
if dir in [ "if", "ifndef", "ifdef" ]:
depth += 1
elif depth == 1 and dir in [ "else", "elif" ]:
return i
elif dir == "endif":
depth -= 1
if depth == 0:
return i
i += 1
return i
def optimize_if01( blocks ):
"""remove the code between #if 0 .. #endif in a list of CppBlocks"""
i = 0
n = len(blocks)
result = []
while i < n:
j = i
while j < n and not blocks[j].isIf():
j += 1
if j > i:
D2("appending lines %d to %d" % (blocks[i].lineno, blocks[j-1].lineno))
result += blocks[i:j]
if j >= n:
break
expr = blocks[j].expr
r = expr.toInt()
if r == None:
result.append(blocks[j])
i = j + 1
continue
if r == 0:
# if 0 => skip everything until the corresponding #endif
j = find_matching_endif( blocks, j+1 )
if j >= n:
# unterminated #if 0, finish here
break
dir = blocks[j].directive
if dir == "endif":
D2("remove 'if 0' .. 'endif' (lines %d to %d)" % (blocks[i].lineno, blocks[j].lineno))
i = j + 1
elif dir == "else":
# convert 'else' into 'if 1'
D2("convert 'if 0' .. 'else' into 'if 1' (lines %d to %d)" % (blocks[i].lineno, blocks[j-1].lineno))
blocks[j].directive = "if"
blocks[j].expr = CppExpr( CppLineTokenizer("1").toTokenList() )
i = j
elif dir == "elif":
# convert 'elif' into 'if'
D2("convert 'if 0' .. 'elif' into 'if'")
blocks[j].directive = "if"
i = j
continue
# if 1 => find corresponding endif and remove/transform them
k = find_matching_endif( blocks, j+1 )
if k >= n:
# unterminated #if 1, finish here
D2("unterminated 'if 1'")
result += blocks[j+1:k]
break
dir = blocks[k].directive
if dir == "endif":
D2("convert 'if 1' .. 'endif' (lines %d to %d)" % (blocks[j].lineno, blocks[k].lineno))
result += optimize_if01(blocks[j+1:k])
i = k+1
elif dir == "else":
# convert 'else' into 'if 0'
D2("convert 'if 1' .. 'else' (lines %d to %d)" % (blocks[j].lineno, blocks[k].lineno))
result += optimize_if01(blocks[j+1:k])
blocks[k].directive = "if"
blocks[k].expr = CppExpr( CppLineTokenizer("0").toTokenList() )
i = k
elif dir == "elif":
# convert 'elif' into 'if 0'
D2("convert 'if 1' .. 'elif' (lines %d to %d)" % (blocks[j].lineno, blocks[k].lineno))
result += optimize_if01(blocks[j+1:k])
blocks[k].expr = CppExpr( CppLineTokenizer("0").toTokenList() )
i = k
return result
def test_optimizeAll():
text = """\
#if 1
#define GOOD_1
#endif
#if 0
#define BAD_2
#define BAD_3
#endif
#if 1
#define GOOD_2
#else
#define BAD_4
#endif
#if 0
#define BAD_5
#else
#define GOOD_3
#endif
#if 0
#if 1
#define BAD_6
#endif
#endif\
"""
expected = """\
#define GOOD_1
#define GOOD_2
#define GOOD_3
"""
print "running test_BlockList.optimizeAll"
out = StringOutput()
lines = string.split(text, '\n')
list = BlockParser().parse( CppLinesTokenizer(lines) )
#D_setlevel(2)
list.optimizeAll( {"__KERNEL__":kCppUndefinedMacro} )
#print repr(list)
list.write(out)
if out.get() != expected:
print "KO: macro optimization failed\n"
print "<<<< expecting '",
print expected,
print "'\n>>>> result '"
print out.get(),
print "'\n----"
#####################################################################################
#####################################################################################
##### #####
##### #####
##### #####
#####################################################################################
#####################################################################################
def runUnitTests():
"""run all unit tests for this program"""
print "running unit tests"
test_CppTokenizer()
test_CppExpr()
test_optimizeAll()
test_BlockParser()
print "OK"
if __name__ == "__main__":
runUnitTests()
|
apache-2.0
|
[
3,
282,
6482,
269,
4541,
445,
876,
13,
6459,
1798,
199,
199,
646,
984,
12,
295,
12,
1059,
199,
504,
3778,
492,
627,
199,
504,
4243,
492,
627,
199,
199,
1757,
16419,
3777,
275,
756,
199,
1757,
29489,
21782,
275,
756,
199,
1757,
3049,
17412,
263,
275,
756,
199,
1757,
19705,
8561,
3322,
275,
756,
199,
1757,
9867,
3917,
614,
3515,
275,
756,
199,
199,
13289,
8776,
199,
13289,
8776,
199,
8776,
6208,
3698,
22906,
199,
8776,
3698,
445,
510,
510,
257,
377,
593,
1804,
662,
653,
428,
2476,
3777,
22906,
199,
8776,
6208,
3698,
22906,
199,
13289,
8776,
199,
13289,
8776,
199,
199,
3,
314,
769,
402,
3748,
445,
13,
657,
6459,
4645,
199,
3,
12254,
282,
17535,
402,
445,
4645,
465,
5521,
199,
9305,
13178,
755,
275,
1867,
16,
2,
199,
9305,
44,
46,
263,
275,
1867,
78,
2,
199,
9305,
5353,
13367,
275,
5426,
2,
199,
9305,
1864,
11206,
259,
275,
298,
309,
2,
199,
9305,
4947,
948,
3649,
221,
275,
11746,
6,
2,
199,
9305,
4947,
948,
726,
257,
275,
298,
10644,
2,
199,
9305,
3234,
44,
755,
275,
3886,
28,
2,
199,
9305,
3234,
50,
755,
275,
298,
1140,
2,
199,
9305,
16352,
258,
275,
298,
11800,
199,
9305,
6388,
9283,
259,
275,
19724,
628,
199,
9305,
17090,
263,
275,
3886,
2,
199,
9305,
44,
3727,
755,
275,
3886,
628,
199,
9305,
8391,
263,
275,
28192,
199,
9305,
39,
3727,
755,
275,
15281,
628,
199,
9305,
21677,
221,
275,
298,
11500,
199,
9305,
11658,
258,
275,
298,
298,
199,
9305,
12857,
257,
275,
298,
4037,
2,
199,
9305,
44,
22169,
259,
275,
26054,
199,
9305,
50,
22169,
259,
275,
19607,
199,
9305,
4609,
755,
275,
298,
9539,
199,
9305,
27280,
420,
275,
298,
5207,
199,
9305,
18004,
258,
275,
17155,
199,
9305,
21894,
6084,
221,
275,
22423,
199,
9305,
1914,
5437,
37,
259,
275,
10609,
199,
9305,
14671,
1668,
257,
275,
2071,
2,
199,
9305,
9431,
3649,
259,
275,
11746,
2,
199,
9305,
9431,
726,
258,
275,
15733,
2,
199,
9305,
9431,
56,
726,
259,
275,
18129,
2,
199,
9305,
11265,
2054,
258,
275,
21147,
199,
9305,
44,
29246,
259,
275,
5310,
2,
199,
9305,
50,
29246,
259,
275,
298,
7063,
199,
9305,
689,
11415,
258,
275,
25707,
199,
9305,
568,
31431,
275,
298,
4176,
2,
199,
9305,
1093,
31431,
275,
4320,
2,
199,
9305,
9190,
259,
275,
3886,
1955,
4335,
199,
9305,
7466,
258,
275,
3886,
5425,
4335,
199,
9305,
5353,
259,
275,
3886,
875,
4335,
199,
199,
533,
8767,
26,
272,
408,
65,
3486,
1021,
370,
10266,
2556,
3595,
282,
1627,
1526,
14,
2126,
1924,
1526,
965,
282,
3421,
315,
314,
1350,
1233,
12,
465,
5521,
465,
2126,
376,
283,
344,
7,
436,
282,
283,
585,
1370,
314,
1305,
365,
282,
1059,
626,
22975,
2126,
314,
1526,
1159,
1021,
12,
1830,
314,
574,
365,
314,
1059,
402,
314,
2126,
3379,
1526,
6337,
14,
10817,
367,
2893,
12,
314,
14803,
16758,
2335,
282,
6779,
402,
7883,
2126,
436,
12187,
465,
282,
2849,
8431,
11658,
1305,
12,
7447,
574,
340,
314,
3379,
2126,
7883,
11,
8741,
3414,
1041,
339,
347,
636,
826,
721,
277,
304,
267,
291,
14,
344,
258,
275,
488,
267,
291,
14,
585,
221,
275,
488,
267,
291,
14,
3469,
275,
378,
267,
291,
14,
761,
889,
221,
275,
378,
339,
347,
663,
8,
277,
12,
344,
12,
637,
29,
403,
304,
267,
291,
14,
344,
275,
1305,
267,
340,
1139,
26,
288,
291,
14,
585,
275,
1139,
267,
587,
26,
288,
291,
14,
585,
275,
1305,
267,
372,
488,
339,
347,
1331,
2532,
8,
277,
12,
2164,
304,
267,
291,
14,
344,
258,
275,
2928,
14,
344,
267,
291,
14,
585,
221,
275,
2928,
14,
585,
267,
291,
14,
3469,
275,
2928,
14,
3469,
267,
291,
14,
761,
889,
221,
275,
2928,
14,
761,
889,
339,
347,
636,
2722,
721,
277,
304,
267,
340,
291,
14,
344,
508,
8431,
7466,
26,
288,
372,
7340,
5425,
450,
83,
2924,
450,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
9190,
26,
288,
372,
7340,
1955,
450,
83,
2924,
450,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
5353,
26,
288,
372,
7340,
875,
1543,
83,
19124,
450,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
44,
46,
26,
288,
372,
3886,
44,
46,
4335,
267,
340,
291,
14,
344,
508,
8431,
13178,
26,
288,
372,
3886,
13178,
4335,
267,
340,
291,
14,
344,
508,
8431,
11658,
436,
291,
14,
585,
508,
9926,
582,
288,
327,
642,
13718,
370,
282,
8520,
971,
626,
1990,
14834,
1901,
282,
8431,
11658,
288,
372,
3886,
1103,
4335,
398,
372,
291,
14,
344,
339,
347,
636,
495,
721,
277,
304,
267,
340,
291,
14,
344,
508,
8431,
7466,
26,
288,
372,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
9190,
26,
288,
372,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
5353,
26,
288,
372,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
13178,
26,
288,
372,
3886,
13178,
4335,
267,
340,
291,
14,
344,
508,
8431,
11658,
26,
288,
340,
291,
14,
585,
508,
9926,
582,
221,
327,
8520,
971,
355,
372,
298,
9780,
78,
2,
288,
587,
26,
355,
372,
291,
14,
585,
398,
372,
291,
14,
344,
199,
199,
533,
8857,
6964,
3264,
8,
1726,
304,
272,
347,
636,
826,
721,
277,
12,
1328,
304,
267,
870,
1499,
199,
199,
13289,
8776,
199,
13289,
8776,
199,
8776,
6208,
3698,
22906,
199,
8776,
3515,
445,
510,
510,
257,
377,
593,
1804,
662,
653,
257,
445,
738,
820,
428,
593,
820,
22456,
22906,
199,
8776,
6208,
3698,
22906,
199,
13289,
8776,
199,
13289,
8776,
199,
199,
533,
8767,
8993,
26,
272,
408,
65,
7425,
1021,
370,
13974,
1806,
282,
769,
402,
8767,
2251,
624,
272,
347,
636,
826,
721,
277,
12,
4504,
304,
267,
291,
14,
4504,
275,
4645,
267,
291,
14,
78,
420,
275,
378,
267,
291,
14,
835,
221,
275,
822,
8,
4504,
9,
339,
347,
663,
8,
277,
12,
78,
304,
267,
408,
409,
314,
1453,
3421,
624,
267,
340,
302,
665,
378,
26,
288,
302,
275,
378,
267,
340,
302,
690,
291,
14,
835,
26
] |
[
282,
6482,
269,
4541,
445,
876,
13,
6459,
1798,
199,
199,
646,
984,
12,
295,
12,
1059,
199,
504,
3778,
492,
627,
199,
504,
4243,
492,
627,
199,
199,
1757,
16419,
3777,
275,
756,
199,
1757,
29489,
21782,
275,
756,
199,
1757,
3049,
17412,
263,
275,
756,
199,
1757,
19705,
8561,
3322,
275,
756,
199,
1757,
9867,
3917,
614,
3515,
275,
756,
199,
199,
13289,
8776,
199,
13289,
8776,
199,
8776,
6208,
3698,
22906,
199,
8776,
3698,
445,
510,
510,
257,
377,
593,
1804,
662,
653,
428,
2476,
3777,
22906,
199,
8776,
6208,
3698,
22906,
199,
13289,
8776,
199,
13289,
8776,
199,
199,
3,
314,
769,
402,
3748,
445,
13,
657,
6459,
4645,
199,
3,
12254,
282,
17535,
402,
445,
4645,
465,
5521,
199,
9305,
13178,
755,
275,
1867,
16,
2,
199,
9305,
44,
46,
263,
275,
1867,
78,
2,
199,
9305,
5353,
13367,
275,
5426,
2,
199,
9305,
1864,
11206,
259,
275,
298,
309,
2,
199,
9305,
4947,
948,
3649,
221,
275,
11746,
6,
2,
199,
9305,
4947,
948,
726,
257,
275,
298,
10644,
2,
199,
9305,
3234,
44,
755,
275,
3886,
28,
2,
199,
9305,
3234,
50,
755,
275,
298,
1140,
2,
199,
9305,
16352,
258,
275,
298,
11800,
199,
9305,
6388,
9283,
259,
275,
19724,
628,
199,
9305,
17090,
263,
275,
3886,
2,
199,
9305,
44,
3727,
755,
275,
3886,
628,
199,
9305,
8391,
263,
275,
28192,
199,
9305,
39,
3727,
755,
275,
15281,
628,
199,
9305,
21677,
221,
275,
298,
11500,
199,
9305,
11658,
258,
275,
298,
298,
199,
9305,
12857,
257,
275,
298,
4037,
2,
199,
9305,
44,
22169,
259,
275,
26054,
199,
9305,
50,
22169,
259,
275,
19607,
199,
9305,
4609,
755,
275,
298,
9539,
199,
9305,
27280,
420,
275,
298,
5207,
199,
9305,
18004,
258,
275,
17155,
199,
9305,
21894,
6084,
221,
275,
22423,
199,
9305,
1914,
5437,
37,
259,
275,
10609,
199,
9305,
14671,
1668,
257,
275,
2071,
2,
199,
9305,
9431,
3649,
259,
275,
11746,
2,
199,
9305,
9431,
726,
258,
275,
15733,
2,
199,
9305,
9431,
56,
726,
259,
275,
18129,
2,
199,
9305,
11265,
2054,
258,
275,
21147,
199,
9305,
44,
29246,
259,
275,
5310,
2,
199,
9305,
50,
29246,
259,
275,
298,
7063,
199,
9305,
689,
11415,
258,
275,
25707,
199,
9305,
568,
31431,
275,
298,
4176,
2,
199,
9305,
1093,
31431,
275,
4320,
2,
199,
9305,
9190,
259,
275,
3886,
1955,
4335,
199,
9305,
7466,
258,
275,
3886,
5425,
4335,
199,
9305,
5353,
259,
275,
3886,
875,
4335,
199,
199,
533,
8767,
26,
272,
408,
65,
3486,
1021,
370,
10266,
2556,
3595,
282,
1627,
1526,
14,
2126,
1924,
1526,
965,
282,
3421,
315,
314,
1350,
1233,
12,
465,
5521,
465,
2126,
376,
283,
344,
7,
436,
282,
283,
585,
1370,
314,
1305,
365,
282,
1059,
626,
22975,
2126,
314,
1526,
1159,
1021,
12,
1830,
314,
574,
365,
314,
1059,
402,
314,
2126,
3379,
1526,
6337,
14,
10817,
367,
2893,
12,
314,
14803,
16758,
2335,
282,
6779,
402,
7883,
2126,
436,
12187,
465,
282,
2849,
8431,
11658,
1305,
12,
7447,
574,
340,
314,
3379,
2126,
7883,
11,
8741,
3414,
1041,
339,
347,
636,
826,
721,
277,
304,
267,
291,
14,
344,
258,
275,
488,
267,
291,
14,
585,
221,
275,
488,
267,
291,
14,
3469,
275,
378,
267,
291,
14,
761,
889,
221,
275,
378,
339,
347,
663,
8,
277,
12,
344,
12,
637,
29,
403,
304,
267,
291,
14,
344,
275,
1305,
267,
340,
1139,
26,
288,
291,
14,
585,
275,
1139,
267,
587,
26,
288,
291,
14,
585,
275,
1305,
267,
372,
488,
339,
347,
1331,
2532,
8,
277,
12,
2164,
304,
267,
291,
14,
344,
258,
275,
2928,
14,
344,
267,
291,
14,
585,
221,
275,
2928,
14,
585,
267,
291,
14,
3469,
275,
2928,
14,
3469,
267,
291,
14,
761,
889,
221,
275,
2928,
14,
761,
889,
339,
347,
636,
2722,
721,
277,
304,
267,
340,
291,
14,
344,
508,
8431,
7466,
26,
288,
372,
7340,
5425,
450,
83,
2924,
450,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
9190,
26,
288,
372,
7340,
1955,
450,
83,
2924,
450,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
5353,
26,
288,
372,
7340,
875,
1543,
83,
19124,
450,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
44,
46,
26,
288,
372,
3886,
44,
46,
4335,
267,
340,
291,
14,
344,
508,
8431,
13178,
26,
288,
372,
3886,
13178,
4335,
267,
340,
291,
14,
344,
508,
8431,
11658,
436,
291,
14,
585,
508,
9926,
582,
288,
327,
642,
13718,
370,
282,
8520,
971,
626,
1990,
14834,
1901,
282,
8431,
11658,
288,
372,
3886,
1103,
4335,
398,
372,
291,
14,
344,
339,
347,
636,
495,
721,
277,
304,
267,
340,
291,
14,
344,
508,
8431,
7466,
26,
288,
372,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
9190,
26,
288,
372,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
5353,
26,
288,
372,
291,
14,
585,
267,
340,
291,
14,
344,
508,
8431,
13178,
26,
288,
372,
3886,
13178,
4335,
267,
340,
291,
14,
344,
508,
8431,
11658,
26,
288,
340,
291,
14,
585,
508,
9926,
582,
221,
327,
8520,
971,
355,
372,
298,
9780,
78,
2,
288,
587,
26,
355,
372,
291,
14,
585,
398,
372,
291,
14,
344,
199,
199,
533,
8857,
6964,
3264,
8,
1726,
304,
272,
347,
636,
826,
721,
277,
12,
1328,
304,
267,
870,
1499,
199,
199,
13289,
8776,
199,
13289,
8776,
199,
8776,
6208,
3698,
22906,
199,
8776,
3515,
445,
510,
510,
257,
377,
593,
1804,
662,
653,
257,
445,
738,
820,
428,
593,
820,
22456,
22906,
199,
8776,
6208,
3698,
22906,
199,
13289,
8776,
199,
13289,
8776,
199,
199,
533,
8767,
8993,
26,
272,
408,
65,
7425,
1021,
370,
13974,
1806,
282,
769,
402,
8767,
2251,
624,
272,
347,
636,
826,
721,
277,
12,
4504,
304,
267,
291,
14,
4504,
275,
4645,
267,
291,
14,
78,
420,
275,
378,
267,
291,
14,
835,
221,
275,
822,
8,
4504,
9,
339,
347,
663,
8,
277,
12,
78,
304,
267,
408,
409,
314,
1453,
3421,
624,
267,
340,
302,
665,
378,
26,
288,
302,
275,
378,
267,
340,
302,
690,
291,
14,
835,
26,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
etraiger/PCWG
|
plots.py
|
2
|
15226
|
import os
import pandas as pd
from Analysis import chckMake
np = pd.np
class MatplotlibPlotter(object):
def __init__(self,path, analysis):
self.path = path
self.analysis = analysis
def plot_multiple(self, windSpeedCol, powerCol, meanPowerCurveObj):
try:
from matplotlib import pyplot as plt
plt.ioff()
plotTitle = "Power Curve"
meanPowerCurve = meanPowerCurveObj.powerCurveLevels[[windSpeedCol,powerCol,'Data Count']][meanPowerCurveObj.powerCurveLevels['Data Count'] > 0 ].reset_index().set_index(windSpeedCol)
ax = meanPowerCurve[powerCol].plot(color='#00FF00',alpha=0.95,linestyle='--',label='Mean Power Curve')
colourmap = plt.cm.gist_ncar
colours = [colourmap(i) for i in np.linspace(0, 0.9, len(self.analysis.dataFrame[self.analysis.nameColumn].unique()))]
for i,name in enumerate(self.analysis.dataFrame[self.analysis.nameColumn].unique()):
ax = self.analysis.dataFrame[self.analysis.dataFrame[self.analysis.nameColumn] == name].plot(ax = ax, kind='scatter', x=windSpeedCol, y=powerCol, title=plotTitle, alpha=0.2, label=name, color = colours[i])
ax.legend(loc=4, scatterpoints = 1)
ax.set_xlim([min(self.analysis.dataFrame[windSpeedCol].min(),meanPowerCurve.index.min()), max(self.analysis.dataFrame[windSpeedCol].max(),meanPowerCurve.index.max()+2.0)])
ax.set_xlabel(windSpeedCol + ' (m/s)')
ax.set_ylabel(powerCol + ' (kW)')
file_out = self.path + "/Multiple Dataset PowerCurve - " + powerCol + " vs " + windSpeedCol + ".png"
chckMake(self.path)
plt.savefig(file_out)
plt.close()
return file_out
except:
print "Tried to make a power curve scatter chart for multiple data source (%s). Couldn't." % meanPowerCurveObj.name
def plotPowerCurveSensitivityVariationMetrics(self):
try:
from matplotlib import pyplot as plt
plt.ioff()
(self.analysis.powerCurveSensitivityVariationMetrics*100.).plot(kind = 'bar', title = 'Summary of Power Curve Variation by Variable. Significance Threshold = %.2f%%' % (self.analysis.sensitivityAnalysisThreshold * 100), figsize = (12,8))
plt.ylabel('Variation Metric (%)')
file_out = self.path + os.sep + 'Power Curve Sensitivity Analysis Variation Metric Summary.png'
plt.savefig(file_out)
plt.close('all')
except:
print "Tried to plot summary of Power Curve Sensitivity Analysis Variation Metric. Couldn't."
self.analysis.powerCurveSensitivityVariationMetrics.to_csv(self.path + os.sep + 'Power Curve Sensitivity Analysis Variation Metric.csv')
def plotPowerCurveSensitivity(self, sensCol):
try:
df = self.analysis.powerCurveSensitivityResults[sensCol].reset_index()
from matplotlib import pyplot as plt
plt.ioff()
fig = plt.figure(figsize = (12,5))
fig.suptitle('Power Curve Sensitivity to %s' % sensCol)
ax1 = fig.add_subplot(121)
ax1.hold(True)
ax2 = fig.add_subplot(122)
ax2.hold(True)
power_column = self.analysis.measuredTurbulencePower if self.analysis.turbRenormActive else self.analysis.actualPower
for label in self.analysis.sensitivityLabels.keys():
filt = df['Bin'] == label
ax1.plot(df['Wind Speed Bin'][filt], df[power_column][filt], label = label, color = self.analysis.sensitivityLabels[label])
ax2.plot(df['Wind Speed Bin'][filt], df['Energy Delta MWh'][filt], label = label, color = self.analysis.sensitivityLabels[label])
ax1.set_xlabel('Wind Speed (m/s)')
ax1.set_ylabel('Power (kW)')
ax2.set_xlabel('Wind Speed (m/s)')
ax2.set_ylabel('Energy Difference from Mean (MWh)')
box1 = ax1.get_position()
box2 = ax2.get_position()
ax1.set_position([box1.x0 - 0.05 * box1.width, box1.y0 + box1.height * 0.17,
box1.width * 0.95, box1.height * 0.8])
ax2.set_position([box2.x0 + 0.05 * box2.width, box2.y0 + box2.height * 0.17,
box2.width * 1.05, box2.height * 0.8])
handles, labels = ax1.get_legend_handles_labels()
fig.legend(handles, labels, loc='lower center', ncol = len(self.analysis.sensitivityLabels.keys()), fancybox = True, shadow = True)
file_out = self.path + os.sep + 'Power Curve Sensitivity to %s.png' % sensCol
chckMake(self.path)
fig.savefig(file_out)
plt.close()
except:
print "Tried to make a plot of power curve sensitivity to %s. Couldn't." % sensCol
def plotBy(self,by,variable,df):
import turbine
if not isinstance(df,turbine.PowerCurve):
kind = 'scatter'
else:
kind = 'line'
df=df.powerCurveLevels[df.powerCurveLevels['Input Hub Wind Speed'] <= self.analysis.allMeasuredPowerCurve.cutOutWindSpeed]
try:
from matplotlib import pyplot as plt
plt.ioff()
ax = df.plot(kind=kind,x=by ,y=variable,title=variable+" By " +by,alpha=0.6,legend=None)
ax.set_xlim([df[by].min()-1,df[by].max()+1])
ax.set_xlabel(by)
ax.set_ylabel(variable)
file_out = self.path + "/"+variable.replace(" ","_")+"_By_"+by.replace(" ","_")+".png"
chckMake(self.path)
plt.savefig(file_out)
plt.close()
return file_out
except:
print "Tried to make a " + variable.replace(" ","_") + "_By_"+by.replace(" ","_")+" chart. Couldn't."
def plotPowerCurve(self, windSpeedCol, powerCol, meanPowerCurveObj, anon = False, row_filt = None, fname = None, show_analysis_pc = True, mean_title = 'Mean Power Curve', mean_pc_color = '#00FF00'):
try:
from matplotlib import pyplot as plt
plt.ioff()
df = self.analysis.dataFrame.loc[row_filt, :] if row_filt is not None else self.analysis.dataFrame
if (windSpeedCol == self.analysis.densityCorrectedHubWindSpeed) or ((windSpeedCol == self.analysis.inputHubWindSpeed) and (self.analysis.densityCorrectionActive)):
plotTitle = "Power Curve (corrected to {dens} kg/m^3)".format(dens=self.analysis.referenceDensity)
else:
plotTitle = "Power Curve"
ax = df.plot(kind='scatter', x=windSpeedCol, y=powerCol, title=plotTitle, alpha=0.15, label='Filtered Data')
if self.analysis.specifiedPowerCurve is not None:
has_spec_pc = len(self.analysis.specifiedPowerCurve.powerCurveLevels.index) != 0
else:
has_spec_pc = False
if has_spec_pc:
ax = self.analysis.specifiedPowerCurve.powerCurveLevels.sort_index()['Specified Power'].plot(ax = ax, color='#FF0000',alpha=0.9,label='Specified')
if self.analysis.specifiedPowerCurve != self.analysis.powerCurve:
if ((self.analysis.powerCurve.name != 'All Measured') and show_analysis_pc):
ax = self.analysis.powerCurve.powerCurveLevels.sort_index()['Actual Power'].plot(ax = ax, color='#A37ACC',alpha=0.9,label=self.analysis.powerCurve.name)
meanPowerCurve = meanPowerCurveObj.powerCurveLevels[[windSpeedCol,powerCol,'Data Count']][self.analysis.allMeasuredPowerCurve.powerCurveLevels.loc[meanPowerCurveObj.powerCurveLevels.index, 'Data Count'] > 0].reset_index().set_index(windSpeedCol)
ax = meanPowerCurve[powerCol].plot(ax = ax,color=mean_pc_color,alpha=0.95,linestyle='--',
label=mean_title)
ax.legend(loc=4, scatterpoints = 1)
if has_spec_pc:
ax.set_xlim([self.analysis.specifiedPowerCurve.powerCurveLevels.index.min(), self.analysis.specifiedPowerCurve.powerCurveLevels.index.max()+2.0])
else:
ax.set_xlim([min(df[windSpeedCol].min(),meanPowerCurve.index.min()), max(df[windSpeedCol].max(),meanPowerCurve.index.max()+2.0)])
ax.set_xlabel(self.analysis.inputHubWindSpeedSource + ' (m/s)')
ax.set_ylabel(powerCol + ' (kW)')
if anon:
ax.xaxis.set_ticklabels([])
ax.yaxis.set_ticklabels([])
fname = ("PowerCurve - " + powerCol + " vs " + windSpeedCol + ".png") if fname is None else fname
file_out = self.path + os.sep + fname
chckMake(self.path)
plt.savefig(file_out)
plt.close()
return file_out
except:
raise
print "Tried to make a power curve scatter chart for %s. Couldn't." % meanPowerCurveObj.name
def plotTurbCorrectedPowerCurve(self, windSpeedCol, powerCol, meanPowerCurveObj):
try:
from matplotlib import pyplot as plt
plt.ioff()
if (windSpeedCol == self.analysis.densityCorrectedHubWindSpeed) or ((windSpeedCol == self.analysis.inputHubWindSpeed) and (self.analysis.densityCorrectionActive)):
plotTitle = "Power Curve (corrected to {dens} kg/m^3)".format(dens=self.analysis.referenceDensity)
else:
plotTitle = "Power Curve"
ax = self.analysis.dataFrame.plot(kind='scatter', x=windSpeedCol, y=powerCol, title=plotTitle, alpha=0.15, label='Filtered Data')
if self.analysis.specifiedPowerCurve is not None:
has_spec_pc = len(self.analysis.specifiedPowerCurve.powerCurveLevels.index) != 0
else:
has_spec_pc = False
if has_spec_pc:
ax = self.analysis.specifiedPowerCurve.powerCurveLevels.sort_index()['Specified Power'].plot(ax = ax, color='#FF0000',alpha=0.9,label='Specified')
meanPowerCurve = meanPowerCurveObj.powerCurveLevels[[windSpeedCol,powerCol,'Data Count']][self.analysis.allMeasuredPowerCurve.powerCurveLevels['Data Count'] > 0 ].reset_index().set_index(windSpeedCol)
ax = meanPowerCurve[powerCol].plot(ax = ax,color='#00FF00',alpha=0.95,linestyle='--',
label='Mean Power Curve')
ax2 = ax.twinx()
if has_spec_pc:
ax.set_xlim([self.analysis.specifiedPowerCurve.powerCurveLevels.index.min(), self.analysis.specifiedPowerCurve.powerCurveLevels.index.max()+2.0])
ax2.set_xlim([self.analysis.specifiedPowerCurve.powerCurveLevels.index.min(), self.analysis.specifiedPowerCurve.powerCurveLevels.index.max()+2.0])
else:
ax.set_xlim([min(self.analysis.dataFrame[windSpeedCol].min(),meanPowerCurve.index.min()), max(self.analysis.dataFrame[windSpeedCol].max(),meanPowerCurve.index.max()+2.0)])
ax2.set_xlim([min(self.analysis.dataFrame[windSpeedCol].min(),meanPowerCurve.index.min()), max(self.analysis.dataFrame[windSpeedCol].max(),meanPowerCurve.index.max()+2.0)])
ax.set_xlabel(self.analysis.inputHubWindSpeedSource + ' (m/s)')
ax.set_ylabel(powerCol + ' (kW)')
refTurbCol = 'Specified Turbulence' if self.analysis.powerCurveMode == 'Specified' else self.analysis.hubTurbulence
ax2.plot(self.analysis.powerCurve.powerCurveLevels.sort_index().index, self.analysis.powerCurve.powerCurveLevels.sort_index()[refTurbCol] * 100., 'm--', label = 'Reference TI')
ax2.set_ylabel('Reference TI (%)')
h1, l1 = ax.get_legend_handles_labels()
h2, l2 = ax2.get_legend_handles_labels()
ax.legend(h1+h2, l1+l2, loc=4, scatterpoints = 1)
file_out = self.path + "/PowerCurve TI Corrected - " + powerCol + " vs " + windSpeedCol + ".png"
chckMake(self.path)
plt.savefig(file_out)
plt.close()
return file_out
except:
print "Tried to make a TI corrected power curve scatter chart for %s. Couldn't." % meanPowerCurveObj.name
def plotPowerLimits(self):
try:
from matplotlib import pyplot as plt
plt.ioff()
windSpeedCol = self.analysis.densityCorrectedHubWindSpeed
ax = self.analysis.dataFrame.plot(kind='scatter',x=windSpeedCol,y=self.analysis.actualPower ,title="Power Values Corrected to {dens} kg/m^3".format(dens=self.analysis.referenceDensity),alpha=0.5,label='Power Mean')
ax = self.analysis.dataFrame.plot(ax=ax,kind='scatter',x=windSpeedCol,y="Power Min",alpha=0.2,label='Power Min',color = 'orange')
ax = self.analysis.dataFrame.plot(ax=ax,kind='scatter',x=windSpeedCol,y="Power Max",alpha=0.2,label='Power Max',color = 'green')
ax = self.analysis.dataFrame.plot(ax=ax,kind='scatter',x=windSpeedCol,y="Power SD",alpha=0.2,label='Power SD',color = 'purple')
ax = self.analysis.specifiedPowerCurve.powerCurveLevels.sort_index()['Specified Power'].plot(ax = ax, color='#FF0000',alpha=0.9,label='Specified')
ax.set_xlim([self.analysis.specifiedPowerCurve.powerCurveLevels.index.min(), self.analysis.specifiedPowerCurve.powerCurveLevels.index.max()+2.0])
ax.legend(loc=4, scatterpoints = 1)
ax.set_xlabel(windSpeedCol)
ax.set_ylabel("Power [kW]")
file_out = self.path + "/PowerValues.png"
chckMake(self.path)
plt.savefig(file_out)
plt.close()
return file_out
except:
print "Tried to make a full power scatter chart. Couldn't."
def plotCalibrationSectors(self):
for datasetConf in self.analysis.datasetConfigs:
try:
from matplotlib import pyplot as plt
plt.ioff()
df = datasetConf.data.calibrationCalculator.calibrationSectorDataframe[['pctSpeedUp','LowerLimit','UpperLimit']].rename(columns={'pctSpeedUp':'% Speed Up','LowerLimit':"IEC Lower",'UpperLimit':"IEC Upper"})
df.plot(kind = 'line', title = 'Variation of wind speed ratio with direction', figsize = (12,8))
plt.ylabel('Wind Speed Ratio (Vturb/Vref) as %')
file_out = self.path + os.sep + 'Wind Speed Ratio with Direction - All Sectors {nm}.png'.format(nm=datasetConf.name)
plt.savefig(file_out)
df = df.loc[np.logical_and(df.index > datasetConf.data.fullDataFrame[datasetConf.data.referenceDirectionBin].min()-5.0 , df.index < datasetConf.data.fullDataFrame[datasetConf.data.referenceDirectionBin].max()+5.0),:]
df.plot(kind = 'line', title = 'Variation of wind speed ratio with direction', figsize = (12,8))
plt.ylabel('Wind Speed Ratio (Vturb/Vref) as %')
file_out = self.path + os.sep + 'Wind Speed Ratio with Direction - Selected Sectors {nm}.png'.format(nm=datasetConf.name)
chckMake(self.path)
plt.savefig(file_out)
plt.close('all')
except:
print "Tried to plot variation of wind speed ratio with direction. Couldn't."
|
mit
|
[
646,
747,
199,
646,
10634,
465,
6454,
199,
504,
21916,
492,
682,
346,
5483,
199,
1590,
275,
6454,
14,
1590,
199,
199,
533,
18619,
6711,
10711,
351,
8,
785,
304,
272,
347,
636,
826,
721,
277,
12,
515,
12,
11284,
304,
267,
291,
14,
515,
275,
931,
267,
291,
14,
10466,
275,
11284,
339,
347,
5137,
63,
6048,
8,
277,
12,
15417,
15146,
2001,
12,
7074,
2001,
12,
4615,
6921,
20966,
5665,
304,
267,
862,
26,
288,
687,
8027,
492,
1134,
2798,
465,
4488,
288,
4488,
14,
73,
1997,
342,
288,
5137,
6888,
275,
298,
6921,
7319,
432,
2,
953,
4615,
6921,
20966,
275,
4615,
6921,
20966,
5665,
14,
5652,
20966,
4670,
83,
9046,
11530,
15146,
2001,
12,
5652,
2001,
2584,
1451,
14826,
418,
1527,
3670,
6921,
20966,
5665,
14,
5652,
20966,
4670,
83,
459,
1451,
14826,
418,
690,
378,
221,
1055,
3958,
63,
1080,
1252,
409,
63,
1080,
8,
11530,
15146,
2001,
9,
288,
2185,
275,
4615,
6921,
20966,
59,
5652,
2001,
1055,
2798,
8,
2326,
26431,
383,
1665,
383,
297,
4468,
29,
16,
14,
2720,
12,
472,
20953,
23791,
297,
1302,
534,
14825,
18879,
7319,
432,
358,
953,
15706,
1130,
275,
4488,
14,
4400,
14,
71,
631,
63,
78,
7007,
288,
15706,
83,
275,
359,
14476,
1130,
8,
73,
9,
367,
284,
315,
980,
14,
11649,
8,
16,
12,
378,
14,
25,
12,
822,
8,
277,
14,
10466,
14,
576,
3160,
59,
277,
14,
10466,
14,
354,
4547,
1055,
3235,
4059,
61,
953,
367,
284,
12,
354,
315,
3874,
8,
277,
14,
10466,
14,
576,
3160,
59,
277,
14,
10466,
14,
354,
4547,
1055,
3235,
5109,
355,
2185,
275,
291,
14,
10466,
14,
576,
3160,
59,
277,
14,
10466,
14,
576,
3160,
59,
277,
14,
10466,
14,
354,
4547,
61,
508,
536,
1055,
2798,
8,
1219,
275,
2185,
12,
4928,
534,
13512,
297,
671,
29,
11530,
15146,
2001,
12,
612,
29,
5652,
2001,
12,
2538,
29,
2798,
6888,
12,
5131,
29,
16,
14,
18,
12,
1768,
29,
354,
12,
3164,
275,
15706,
83,
59,
73,
566,
953,
2185,
14,
10231,
8,
2102,
29,
20,
12,
28618,
3438,
275,
413,
9,
288,
2185,
14,
409,
63,
18512,
779,
827,
8,
277,
14,
10466,
14,
576,
3160,
59,
11530,
15146,
2001,
1055,
827,
1062,
3670,
6921,
20966,
14,
1080,
14,
827,
4000,
1390,
8,
277,
14,
10466,
14,
576,
3160,
59,
11530,
15146,
2001,
1055,
988,
1062,
3670,
6921,
20966,
14,
1080,
14,
988,
24543,
18,
14,
16,
3948,
288,
2185,
14,
409,
63,
14168,
8,
11530,
15146,
2001,
435,
283,
334,
77,
15,
83,
5942,
288,
2185,
14,
409,
63,
13849,
8,
5652,
2001,
435,
283,
334,
75,
55,
5942,
288,
570,
63,
548,
275,
291,
14,
515,
435,
3286,
8433,
20284,
18879,
20966,
446,
298,
435,
7074,
2001,
435,
298,
8118,
298,
435,
15417,
15146,
2001,
435,
3680,
4524,
2,
288,
682,
346,
5483,
8,
277,
14,
515,
9,
288,
4488,
14,
19556,
8,
493,
63,
548,
9,
288,
4488,
14,
1600,
342,
288,
372,
570,
63,
548,
267,
871,
26,
288,
870,
298,
6948,
379,
370,
1852,
282,
7074,
15318,
28618,
10943,
367,
3663,
666,
1350,
4366,
83,
680,
18615,
78,
1133,
2122,
450,
4615,
6921,
20966,
5665,
14,
354,
339,
347,
5137,
6921,
20966,
18569,
20635,
9958,
425,
17213,
8,
277,
304,
267,
862,
26,
288,
687,
8027,
492,
1134,
2798,
465,
4488,
288,
4488,
14,
73,
1997,
342,
288,
334,
277,
14,
10466,
14,
5652,
20966,
18569,
20635,
9958,
425,
17213,
10,
1960,
25860,
2798,
8,
5091,
275,
283,
1700,
297,
2538,
275,
283,
10407,
402,
18879,
7319,
432,
21107,
425,
701,
4905,
14,
6632,
12061,
554,
3868,
4480,
275,
10536,
18,
70,
8530,
7,
450,
334,
277,
14,
10466,
14,
2464,
20635,
13182,
12109,
627,
2948,
395,
6085,
890,
275,
334,
713,
12,
24,
430,
288,
4488,
14,
13849,
360,
9958,
425,
22465,
4366,
5942,
288,
570,
63,
548,
275,
291,
14,
515,
435,
747,
14,
4127,
435,
283,
6921,
7319,
432,
428,
287,
20635,
21916,
21107,
425,
22465,
22486,
14,
4524,
7,
288,
4488,
14,
19556,
8,
493,
63,
548,
9,
288,
4488,
14,
1600,
360,
452,
358,
267,
871,
26,
288,
870,
298,
6948,
379,
370,
5137,
6212,
402,
18879,
7319,
432,
428,
287,
20635,
21916,
21107,
425,
22465,
14,
18615,
78,
1133,
2122,
267,
291,
14,
10466,
14,
5652,
20966,
18569,
20635,
9958,
425,
17213,
14,
475,
63,
4737,
8,
277,
14,
515,
435,
747,
14,
4127,
435,
283,
6921,
7319,
432,
428,
287,
20635,
21916,
21107,
425,
22465,
14,
4737,
358,
339,
347,
5137,
6921,
20966,
18569,
20635,
8,
277,
12,
542,
561,
2001,
304,
267,
862,
26,
288,
4051,
275,
291,
14,
10466,
14,
5652,
20966,
18569,
20635,
6579,
59,
22891,
2001,
1055,
3958,
63,
1080,
342,
288,
687,
8027,
492,
1134,
2798,
465,
4488,
288,
4488,
14,
73,
1997,
342,
288,
6085,
275,
4488,
14,
8941,
8,
23899,
275,
334,
713,
12,
21,
430,
288,
6085,
14,
1961,
1213,
360,
6921,
7319,
432,
428,
287,
20635,
370,
450,
83,
7,
450,
542,
561,
2001,
9,
288,
2185,
17,
275,
6085,
14,
525,
63,
13334,
8,
10753,
9,
288,
2185,
17,
14,
12239,
8,
549,
9,
288,
2185,
18,
275,
6085,
14,
525,
63,
13334,
8,
7507,
9,
288,
2185,
18,
14,
12239,
8,
549,
9,
288,
7074,
63,
2301,
275,
291,
14,
10466,
14,
19116,
3297,
27438,
66,
443,
21225,
6921,
340,
291,
14,
10466,
14,
28081,
5349,
1025,
7472,
587,
291,
14,
10466,
14,
6514,
6921,
288,
367,
1768,
315,
291,
14,
10466,
14,
2464,
20635,
14016,
14,
1612,
837,
355,
26964,
275,
4051,
459,
13394,
418,
508,
1768,
355,
2185,
17,
14,
2798,
8,
1587,
459,
55,
688,
428,
4536,
32613,
3488,
18872,
467,
4051,
59,
5652,
63,
2301,
1527,
18872,
467,
1768,
275,
1768,
12,
3164,
275,
291,
14,
10466,
14,
2464,
20635,
14016,
59,
1302,
566,
355,
2185,
18,
14,
2798,
8,
1587,
459,
55,
688,
428,
4536,
32613,
3488,
18872,
467,
4051,
459,
9900,
18464,
502,
603,
5879,
3488,
18872,
467,
1768,
275,
1768,
12,
3164,
275,
291,
14,
10466,
14,
2464,
20635,
14016,
59,
1302,
566,
288,
2185,
17,
14,
409,
63,
14168,
360,
55,
688
] |
[
747,
199,
646,
10634,
465,
6454,
199,
504,
21916,
492,
682,
346,
5483,
199,
1590,
275,
6454,
14,
1590,
199,
199,
533,
18619,
6711,
10711,
351,
8,
785,
304,
272,
347,
636,
826,
721,
277,
12,
515,
12,
11284,
304,
267,
291,
14,
515,
275,
931,
267,
291,
14,
10466,
275,
11284,
339,
347,
5137,
63,
6048,
8,
277,
12,
15417,
15146,
2001,
12,
7074,
2001,
12,
4615,
6921,
20966,
5665,
304,
267,
862,
26,
288,
687,
8027,
492,
1134,
2798,
465,
4488,
288,
4488,
14,
73,
1997,
342,
288,
5137,
6888,
275,
298,
6921,
7319,
432,
2,
953,
4615,
6921,
20966,
275,
4615,
6921,
20966,
5665,
14,
5652,
20966,
4670,
83,
9046,
11530,
15146,
2001,
12,
5652,
2001,
2584,
1451,
14826,
418,
1527,
3670,
6921,
20966,
5665,
14,
5652,
20966,
4670,
83,
459,
1451,
14826,
418,
690,
378,
221,
1055,
3958,
63,
1080,
1252,
409,
63,
1080,
8,
11530,
15146,
2001,
9,
288,
2185,
275,
4615,
6921,
20966,
59,
5652,
2001,
1055,
2798,
8,
2326,
26431,
383,
1665,
383,
297,
4468,
29,
16,
14,
2720,
12,
472,
20953,
23791,
297,
1302,
534,
14825,
18879,
7319,
432,
358,
953,
15706,
1130,
275,
4488,
14,
4400,
14,
71,
631,
63,
78,
7007,
288,
15706,
83,
275,
359,
14476,
1130,
8,
73,
9,
367,
284,
315,
980,
14,
11649,
8,
16,
12,
378,
14,
25,
12,
822,
8,
277,
14,
10466,
14,
576,
3160,
59,
277,
14,
10466,
14,
354,
4547,
1055,
3235,
4059,
61,
953,
367,
284,
12,
354,
315,
3874,
8,
277,
14,
10466,
14,
576,
3160,
59,
277,
14,
10466,
14,
354,
4547,
1055,
3235,
5109,
355,
2185,
275,
291,
14,
10466,
14,
576,
3160,
59,
277,
14,
10466,
14,
576,
3160,
59,
277,
14,
10466,
14,
354,
4547,
61,
508,
536,
1055,
2798,
8,
1219,
275,
2185,
12,
4928,
534,
13512,
297,
671,
29,
11530,
15146,
2001,
12,
612,
29,
5652,
2001,
12,
2538,
29,
2798,
6888,
12,
5131,
29,
16,
14,
18,
12,
1768,
29,
354,
12,
3164,
275,
15706,
83,
59,
73,
566,
953,
2185,
14,
10231,
8,
2102,
29,
20,
12,
28618,
3438,
275,
413,
9,
288,
2185,
14,
409,
63,
18512,
779,
827,
8,
277,
14,
10466,
14,
576,
3160,
59,
11530,
15146,
2001,
1055,
827,
1062,
3670,
6921,
20966,
14,
1080,
14,
827,
4000,
1390,
8,
277,
14,
10466,
14,
576,
3160,
59,
11530,
15146,
2001,
1055,
988,
1062,
3670,
6921,
20966,
14,
1080,
14,
988,
24543,
18,
14,
16,
3948,
288,
2185,
14,
409,
63,
14168,
8,
11530,
15146,
2001,
435,
283,
334,
77,
15,
83,
5942,
288,
2185,
14,
409,
63,
13849,
8,
5652,
2001,
435,
283,
334,
75,
55,
5942,
288,
570,
63,
548,
275,
291,
14,
515,
435,
3286,
8433,
20284,
18879,
20966,
446,
298,
435,
7074,
2001,
435,
298,
8118,
298,
435,
15417,
15146,
2001,
435,
3680,
4524,
2,
288,
682,
346,
5483,
8,
277,
14,
515,
9,
288,
4488,
14,
19556,
8,
493,
63,
548,
9,
288,
4488,
14,
1600,
342,
288,
372,
570,
63,
548,
267,
871,
26,
288,
870,
298,
6948,
379,
370,
1852,
282,
7074,
15318,
28618,
10943,
367,
3663,
666,
1350,
4366,
83,
680,
18615,
78,
1133,
2122,
450,
4615,
6921,
20966,
5665,
14,
354,
339,
347,
5137,
6921,
20966,
18569,
20635,
9958,
425,
17213,
8,
277,
304,
267,
862,
26,
288,
687,
8027,
492,
1134,
2798,
465,
4488,
288,
4488,
14,
73,
1997,
342,
288,
334,
277,
14,
10466,
14,
5652,
20966,
18569,
20635,
9958,
425,
17213,
10,
1960,
25860,
2798,
8,
5091,
275,
283,
1700,
297,
2538,
275,
283,
10407,
402,
18879,
7319,
432,
21107,
425,
701,
4905,
14,
6632,
12061,
554,
3868,
4480,
275,
10536,
18,
70,
8530,
7,
450,
334,
277,
14,
10466,
14,
2464,
20635,
13182,
12109,
627,
2948,
395,
6085,
890,
275,
334,
713,
12,
24,
430,
288,
4488,
14,
13849,
360,
9958,
425,
22465,
4366,
5942,
288,
570,
63,
548,
275,
291,
14,
515,
435,
747,
14,
4127,
435,
283,
6921,
7319,
432,
428,
287,
20635,
21916,
21107,
425,
22465,
22486,
14,
4524,
7,
288,
4488,
14,
19556,
8,
493,
63,
548,
9,
288,
4488,
14,
1600,
360,
452,
358,
267,
871,
26,
288,
870,
298,
6948,
379,
370,
5137,
6212,
402,
18879,
7319,
432,
428,
287,
20635,
21916,
21107,
425,
22465,
14,
18615,
78,
1133,
2122,
267,
291,
14,
10466,
14,
5652,
20966,
18569,
20635,
9958,
425,
17213,
14,
475,
63,
4737,
8,
277,
14,
515,
435,
747,
14,
4127,
435,
283,
6921,
7319,
432,
428,
287,
20635,
21916,
21107,
425,
22465,
14,
4737,
358,
339,
347,
5137,
6921,
20966,
18569,
20635,
8,
277,
12,
542,
561,
2001,
304,
267,
862,
26,
288,
4051,
275,
291,
14,
10466,
14,
5652,
20966,
18569,
20635,
6579,
59,
22891,
2001,
1055,
3958,
63,
1080,
342,
288,
687,
8027,
492,
1134,
2798,
465,
4488,
288,
4488,
14,
73,
1997,
342,
288,
6085,
275,
4488,
14,
8941,
8,
23899,
275,
334,
713,
12,
21,
430,
288,
6085,
14,
1961,
1213,
360,
6921,
7319,
432,
428,
287,
20635,
370,
450,
83,
7,
450,
542,
561,
2001,
9,
288,
2185,
17,
275,
6085,
14,
525,
63,
13334,
8,
10753,
9,
288,
2185,
17,
14,
12239,
8,
549,
9,
288,
2185,
18,
275,
6085,
14,
525,
63,
13334,
8,
7507,
9,
288,
2185,
18,
14,
12239,
8,
549,
9,
288,
7074,
63,
2301,
275,
291,
14,
10466,
14,
19116,
3297,
27438,
66,
443,
21225,
6921,
340,
291,
14,
10466,
14,
28081,
5349,
1025,
7472,
587,
291,
14,
10466,
14,
6514,
6921,
288,
367,
1768,
315,
291,
14,
10466,
14,
2464,
20635,
14016,
14,
1612,
837,
355,
26964,
275,
4051,
459,
13394,
418,
508,
1768,
355,
2185,
17,
14,
2798,
8,
1587,
459,
55,
688,
428,
4536,
32613,
3488,
18872,
467,
4051,
59,
5652,
63,
2301,
1527,
18872,
467,
1768,
275,
1768,
12,
3164,
275,
291,
14,
10466,
14,
2464,
20635,
14016,
59,
1302,
566,
355,
2185,
18,
14,
2798,
8,
1587,
459,
55,
688,
428,
4536,
32613,
3488,
18872,
467,
4051,
459,
9900,
18464,
502,
603,
5879,
3488,
18872,
467,
1768,
275,
1768,
12,
3164,
275,
291,
14,
10466,
14,
2464,
20635,
14016,
59,
1302,
566,
288,
2185,
17,
14,
409,
63,
14168,
360,
55,
688,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
putcn/Paddle
|
python/paddle/utils/make_model_diagram.py
|
9
|
4346
|
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Generate dot diagram file for the given paddle model config
# The generated file can be viewed using Graphviz (http://graphviz.org)
import sys
import traceback
from paddle.trainer.config_parser import parse_config
def make_layer_label(layer_config):
label = '%s type=%s' % (layer_config.name, layer_config.type)
if layer_config.reversed:
label += ' <=='
label2 = ''
if layer_config.active_type:
label2 += 'act=%s ' % layer_config.active_type
if layer_config.bias_parameter_name:
label2 += 'bias=%s ' % layer_config.bias_parameter_name
if label2:
label += '\l' + label2
return label
def make_diagram(config_file, dot_file, config_arg_str):
config = parse_config(config_file, config_arg_str)
make_diagram_from_proto(config.model_config, dot_file)
def make_diagram_from_proto(model_config, dot_file):
# print >> sys.stderr, config
name2id = {}
f = open(dot_file, 'w')
submodel_layers = set()
def make_link(link):
return 'l%s -> l%s;' % (name2id[link.layer_name],
name2id[link.link_name])
def make_mem(mem):
s = ''
if mem.boot_layer_name:
s += 'l%s -> l%s;\n' % (name2id[mem.boot_layer_name],
name2id[mem.layer_name])
s += 'l%s -> l%s [style=dashed];' % (name2id[mem.layer_name],
name2id[mem.link_name])
return s
print >> f, 'digraph graphname {'
print >> f, 'node [width=0.375,height=0.25];'
for i in xrange(len(model_config.layers)):
l = model_config.layers[i]
name2id[l.name] = i
i = 0
for sub_model in model_config.sub_models:
if sub_model.name == 'root':
continue
print >> f, 'subgraph cluster_%s {' % i
print >> f, 'style=dashed;'
label = '%s ' % sub_model.name
if sub_model.reversed:
label += '<=='
print >> f, 'label = "%s";' % label
i += 1
submodel_layers.add(sub_model.name)
for layer_name in sub_model.layer_names:
submodel_layers.add(layer_name)
lid = name2id[layer_name]
layer_config = model_config.layers[lid]
label = make_layer_label(layer_config)
print >> f, 'l%s [label="%s", shape=box];' % (lid, label)
print >> f, '}'
for i in xrange(len(model_config.layers)):
l = model_config.layers[i]
if l.name not in submodel_layers:
label = make_layer_label(l)
print >> f, 'l%s [label="%s", shape=box];' % (i, label)
for sub_model in model_config.sub_models:
if sub_model.name == 'root':
continue
for link in sub_model.in_links:
print >> f, make_link(link)
for link in sub_model.out_links:
print >> f, make_link(link)
for mem in sub_model.memories:
print >> f, make_mem(mem)
for i in xrange(len(model_config.layers)):
for l in model_config.layers[i].inputs:
print >> f, 'l%s -> l%s [label="%s"];' % (
name2id[l.input_layer_name], i, l.input_parameter_name)
print >> f, '}'
f.close()
def usage():
print >> sys.stderr, ("Usage: python show_model_diagram.py" +
" CONFIG_FILE DOT_FILE [config_str]")
exit(1)
if __name__ == '__main__':
if len(sys.argv) < 3 or len(sys.argv) > 4:
usage()
config_file = sys.argv[1]
dot_file = sys.argv[2]
config_arg_str = sys.argv[3] if len(sys.argv) == 4 else ''
try:
make_diagram(config_file, dot_file, config_arg_str)
except:
traceback.print_exc()
raise
|
apache-2.0
|
[
3,
1898,
334,
67,
9,
7800,
510,
20101,
48,
20101,
6642,
14,
2900,
5924,
5702,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
199,
3,
7958,
6308,
8348,
5975,
570,
367,
314,
1627,
28525,
1402,
1101,
199,
3,
710,
4046,
570,
883,
506,
2455,
379,
1808,
11513,
17249,
334,
1014,
921,
2180,
17249,
14,
1308,
9,
199,
199,
646,
984,
199,
646,
5190,
199,
199,
504,
28525,
14,
2834,
281,
14,
888,
63,
2087,
492,
2198,
63,
888,
421,
199,
318,
1852,
63,
1897,
63,
1302,
8,
1897,
63,
888,
304,
272,
1768,
275,
1543,
83,
730,
2458,
83,
7,
450,
334,
1897,
63,
888,
14,
354,
12,
4045,
63,
888,
14,
466,
9,
272,
340,
4045,
63,
888,
14,
13501,
26,
267,
1768,
847,
283,
665,
6803,
339,
1768,
18,
275,
2125,
272,
340,
4045,
63,
888,
14,
2682,
63,
466,
26,
267,
1768,
18,
847,
283,
2442,
2458,
83,
283,
450,
4045,
63,
888,
14,
2682,
63,
466,
272,
340,
4045,
63,
888,
14,
8160,
63,
5329,
63,
354,
26,
267,
1768,
18,
847,
283,
8160,
2458,
83,
283,
450,
4045,
63,
888,
14,
8160,
63,
5329,
63,
354,
339,
340,
1768,
18,
26,
267,
1768,
847,
1557,
76,
7,
435,
1768,
18,
272,
372,
1768,
421,
199,
318,
1852,
63,
32189,
8,
888,
63,
493,
12,
6308,
63,
493,
12,
1101,
63,
1273,
63,
495,
304,
272,
1101,
275,
2198,
63,
888,
8,
888,
63,
493,
12,
1101,
63,
1273,
63,
495,
9,
272,
1852,
63,
32189,
63,
504,
63,
2625,
8,
888,
14,
1238,
63,
888,
12,
6308,
63,
493,
9,
421,
199,
318,
1852,
63,
32189,
63,
504,
63,
2625,
8,
1238,
63,
888,
12,
6308,
63,
493,
304,
272,
327,
870,
4331,
984,
14,
3083,
12,
1101,
272,
536,
18,
344,
275,
1052,
272,
289,
275,
1551,
8,
3287,
63,
493,
12,
283,
87,
358,
272,
1007,
1238,
63,
4359,
275,
663,
342,
339,
347,
1852,
63,
1073,
8,
1073,
304,
267,
372,
283,
76,
5,
83,
1035,
634,
5,
83,
8942,
450,
334,
354,
18,
344,
59,
1073,
14,
1897,
63,
354,
467,
1816,
536,
18,
344,
59,
1073,
14,
1073,
63,
354,
566,
339,
347,
1852,
63,
5286,
8,
5286,
304,
267,
308,
275,
2125,
267,
340,
7573,
14,
4930,
63,
1897,
63,
354,
26,
288,
308,
847,
283,
76,
5,
83,
1035,
634,
5,
83,
3779,
78,
7,
450,
334,
354,
18,
344,
59,
5286,
14,
4930,
63,
1897,
63,
354,
467,
2511,
536,
18,
344,
59,
5286,
14,
1897,
63,
354,
566,
267,
308,
847,
283,
76,
5,
83,
1035,
634,
5,
83,
359,
2487,
29,
6760,
379,
61,
8942,
450,
334,
354,
18,
344,
59,
5286,
14,
1897,
63,
354,
467,
6163,
536,
18,
344,
59,
5286,
14,
1073,
63,
354,
566,
267,
372,
308,
339,
870,
4331,
289,
12,
283,
328,
2180,
3343,
354,
791,
272,
870,
4331,
289,
12,
283,
932,
359,
2063,
29,
16,
14,
9946,
12,
3333,
29,
16,
14,
821,
61,
8942,
272,
367,
284,
315,
4945,
8,
552,
8,
1238,
63,
888,
14,
4359,
2298,
267,
634,
275,
1402,
63,
888,
14,
4359,
59,
73,
61,
267,
536,
18,
344,
59,
76,
14,
354,
61,
275,
284,
339,
284,
275,
378,
272,
367,
1007,
63,
1238,
315,
1402,
63,
888,
14,
954,
63,
992,
26,
267,
340,
1007,
63,
1238,
14,
354,
508,
283,
1231,
356,
288,
1980,
267,
870,
4331,
289,
12,
283,
954,
2180,
4350,
4970,
83,
791,
450,
284,
267,
870,
4331,
289,
12,
283,
2487,
29,
6760,
379,
8942,
267,
1768,
275,
1543,
83,
283,
450,
1007,
63,
1238,
14,
354,
267,
340,
1007,
63,
1238,
14,
13501,
26,
288,
1768,
847,
2650,
6803,
267,
870,
4331,
289,
12,
283,
1302,
275,
2071,
83,
2,
8942,
450,
1768,
267,
284,
847,
413,
267,
1007,
1238,
63,
4359,
14,
525,
8,
954,
63,
1238,
14,
354,
9,
267,
367,
4045,
63,
354,
315,
1007,
63,
1238,
14,
1897,
63,
1247,
26,
288,
1007,
1238,
63,
4359,
14,
525,
8,
1897,
63,
354,
9,
288,
1212,
68,
275,
536,
18,
344,
59,
1897,
63,
354,
61,
288,
4045,
63,
888,
275,
1402,
63,
888,
14,
4359,
59,
7401,
61,
288,
1768,
275,
1852,
63,
1897,
63,
1302,
8,
1897,
63,
888,
9,
288,
870,
4331,
289,
12,
283,
76,
5,
83,
359,
1302,
5961,
83,
401,
2215,
29,
1977,
61,
8942,
450,
334,
7401,
12,
1768,
9,
267,
870,
4331,
289,
12,
23618,
339,
367,
284,
315,
4945,
8,
552,
8,
1238,
63,
888,
14,
4359,
2298,
267,
634,
275,
1402,
63,
888,
14,
4359,
59,
73,
61,
267,
340,
634,
14,
354,
440,
315,
1007,
1238,
63,
4359,
26,
288,
1768,
275,
1852,
63,
1897,
63,
1302,
8,
76,
9,
288,
870,
4331,
289,
12,
283,
76,
5,
83,
359,
1302,
5961,
83,
401,
2215,
29,
1977,
61,
8942,
450,
334,
73,
12,
1768,
9,
339,
367,
1007,
63,
1238,
315,
1402,
63,
888,
14,
954,
63,
992,
26,
267,
340,
1007,
63,
1238,
14,
354,
508,
283,
1231,
356,
288,
1980,
267,
367,
2142,
315,
1007,
63,
1238,
14,
262,
63,
4614,
26,
288,
870,
4331,
289,
12,
1852,
63,
1073,
8,
1073,
9,
267,
367,
2142,
315,
1007,
63,
1238,
14,
548,
63,
4614,
26,
288,
870,
4331,
289,
12,
1852,
63,
1073,
8,
1073,
9,
267,
367,
7573,
315,
1007,
63,
1238,
14,
5286,
6112,
26,
288
] |
[
1898,
334,
67,
9,
7800,
510,
20101,
48,
20101,
6642,
14,
2900,
5924,
5702,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
199,
3,
7958,
6308,
8348,
5975,
570,
367,
314,
1627,
28525,
1402,
1101,
199,
3,
710,
4046,
570,
883,
506,
2455,
379,
1808,
11513,
17249,
334,
1014,
921,
2180,
17249,
14,
1308,
9,
199,
199,
646,
984,
199,
646,
5190,
199,
199,
504,
28525,
14,
2834,
281,
14,
888,
63,
2087,
492,
2198,
63,
888,
421,
199,
318,
1852,
63,
1897,
63,
1302,
8,
1897,
63,
888,
304,
272,
1768,
275,
1543,
83,
730,
2458,
83,
7,
450,
334,
1897,
63,
888,
14,
354,
12,
4045,
63,
888,
14,
466,
9,
272,
340,
4045,
63,
888,
14,
13501,
26,
267,
1768,
847,
283,
665,
6803,
339,
1768,
18,
275,
2125,
272,
340,
4045,
63,
888,
14,
2682,
63,
466,
26,
267,
1768,
18,
847,
283,
2442,
2458,
83,
283,
450,
4045,
63,
888,
14,
2682,
63,
466,
272,
340,
4045,
63,
888,
14,
8160,
63,
5329,
63,
354,
26,
267,
1768,
18,
847,
283,
8160,
2458,
83,
283,
450,
4045,
63,
888,
14,
8160,
63,
5329,
63,
354,
339,
340,
1768,
18,
26,
267,
1768,
847,
1557,
76,
7,
435,
1768,
18,
272,
372,
1768,
421,
199,
318,
1852,
63,
32189,
8,
888,
63,
493,
12,
6308,
63,
493,
12,
1101,
63,
1273,
63,
495,
304,
272,
1101,
275,
2198,
63,
888,
8,
888,
63,
493,
12,
1101,
63,
1273,
63,
495,
9,
272,
1852,
63,
32189,
63,
504,
63,
2625,
8,
888,
14,
1238,
63,
888,
12,
6308,
63,
493,
9,
421,
199,
318,
1852,
63,
32189,
63,
504,
63,
2625,
8,
1238,
63,
888,
12,
6308,
63,
493,
304,
272,
327,
870,
4331,
984,
14,
3083,
12,
1101,
272,
536,
18,
344,
275,
1052,
272,
289,
275,
1551,
8,
3287,
63,
493,
12,
283,
87,
358,
272,
1007,
1238,
63,
4359,
275,
663,
342,
339,
347,
1852,
63,
1073,
8,
1073,
304,
267,
372,
283,
76,
5,
83,
1035,
634,
5,
83,
8942,
450,
334,
354,
18,
344,
59,
1073,
14,
1897,
63,
354,
467,
1816,
536,
18,
344,
59,
1073,
14,
1073,
63,
354,
566,
339,
347,
1852,
63,
5286,
8,
5286,
304,
267,
308,
275,
2125,
267,
340,
7573,
14,
4930,
63,
1897,
63,
354,
26,
288,
308,
847,
283,
76,
5,
83,
1035,
634,
5,
83,
3779,
78,
7,
450,
334,
354,
18,
344,
59,
5286,
14,
4930,
63,
1897,
63,
354,
467,
2511,
536,
18,
344,
59,
5286,
14,
1897,
63,
354,
566,
267,
308,
847,
283,
76,
5,
83,
1035,
634,
5,
83,
359,
2487,
29,
6760,
379,
61,
8942,
450,
334,
354,
18,
344,
59,
5286,
14,
1897,
63,
354,
467,
6163,
536,
18,
344,
59,
5286,
14,
1073,
63,
354,
566,
267,
372,
308,
339,
870,
4331,
289,
12,
283,
328,
2180,
3343,
354,
791,
272,
870,
4331,
289,
12,
283,
932,
359,
2063,
29,
16,
14,
9946,
12,
3333,
29,
16,
14,
821,
61,
8942,
272,
367,
284,
315,
4945,
8,
552,
8,
1238,
63,
888,
14,
4359,
2298,
267,
634,
275,
1402,
63,
888,
14,
4359,
59,
73,
61,
267,
536,
18,
344,
59,
76,
14,
354,
61,
275,
284,
339,
284,
275,
378,
272,
367,
1007,
63,
1238,
315,
1402,
63,
888,
14,
954,
63,
992,
26,
267,
340,
1007,
63,
1238,
14,
354,
508,
283,
1231,
356,
288,
1980,
267,
870,
4331,
289,
12,
283,
954,
2180,
4350,
4970,
83,
791,
450,
284,
267,
870,
4331,
289,
12,
283,
2487,
29,
6760,
379,
8942,
267,
1768,
275,
1543,
83,
283,
450,
1007,
63,
1238,
14,
354,
267,
340,
1007,
63,
1238,
14,
13501,
26,
288,
1768,
847,
2650,
6803,
267,
870,
4331,
289,
12,
283,
1302,
275,
2071,
83,
2,
8942,
450,
1768,
267,
284,
847,
413,
267,
1007,
1238,
63,
4359,
14,
525,
8,
954,
63,
1238,
14,
354,
9,
267,
367,
4045,
63,
354,
315,
1007,
63,
1238,
14,
1897,
63,
1247,
26,
288,
1007,
1238,
63,
4359,
14,
525,
8,
1897,
63,
354,
9,
288,
1212,
68,
275,
536,
18,
344,
59,
1897,
63,
354,
61,
288,
4045,
63,
888,
275,
1402,
63,
888,
14,
4359,
59,
7401,
61,
288,
1768,
275,
1852,
63,
1897,
63,
1302,
8,
1897,
63,
888,
9,
288,
870,
4331,
289,
12,
283,
76,
5,
83,
359,
1302,
5961,
83,
401,
2215,
29,
1977,
61,
8942,
450,
334,
7401,
12,
1768,
9,
267,
870,
4331,
289,
12,
23618,
339,
367,
284,
315,
4945,
8,
552,
8,
1238,
63,
888,
14,
4359,
2298,
267,
634,
275,
1402,
63,
888,
14,
4359,
59,
73,
61,
267,
340,
634,
14,
354,
440,
315,
1007,
1238,
63,
4359,
26,
288,
1768,
275,
1852,
63,
1897,
63,
1302,
8,
76,
9,
288,
870,
4331,
289,
12,
283,
76,
5,
83,
359,
1302,
5961,
83,
401,
2215,
29,
1977,
61,
8942,
450,
334,
73,
12,
1768,
9,
339,
367,
1007,
63,
1238,
315,
1402,
63,
888,
14,
954,
63,
992,
26,
267,
340,
1007,
63,
1238,
14,
354,
508,
283,
1231,
356,
288,
1980,
267,
367,
2142,
315,
1007,
63,
1238,
14,
262,
63,
4614,
26,
288,
870,
4331,
289,
12,
1852,
63,
1073,
8,
1073,
9,
267,
367,
2142,
315,
1007,
63,
1238,
14,
548,
63,
4614,
26,
288,
870,
4331,
289,
12,
1852,
63,
1073,
8,
1073,
9,
267,
367,
7573,
315,
1007,
63,
1238,
14,
5286,
6112,
26,
288,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
xleng/YCM_WIN_X86
|
third_party/requests/requests/packages/chardet/charsetgroupprober.py
|
2929
|
3791
|
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Mark Pilgrim - port to Python
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
######################### END LICENSE BLOCK #########################
from . import constants
import sys
from .charsetprober import CharSetProber
class CharSetGroupProber(CharSetProber):
def __init__(self):
CharSetProber.__init__(self)
self._mActiveNum = 0
self._mProbers = []
self._mBestGuessProber = None
def reset(self):
CharSetProber.reset(self)
self._mActiveNum = 0
for prober in self._mProbers:
if prober:
prober.reset()
prober.active = True
self._mActiveNum += 1
self._mBestGuessProber = None
def get_charset_name(self):
if not self._mBestGuessProber:
self.get_confidence()
if not self._mBestGuessProber:
return None
# self._mBestGuessProber = self._mProbers[0]
return self._mBestGuessProber.get_charset_name()
def feed(self, aBuf):
for prober in self._mProbers:
if not prober:
continue
if not prober.active:
continue
st = prober.feed(aBuf)
if not st:
continue
if st == constants.eFoundIt:
self._mBestGuessProber = prober
return self.get_state()
elif st == constants.eNotMe:
prober.active = False
self._mActiveNum -= 1
if self._mActiveNum <= 0:
self._mState = constants.eNotMe
return self.get_state()
return self.get_state()
def get_confidence(self):
st = self.get_state()
if st == constants.eFoundIt:
return 0.99
elif st == constants.eNotMe:
return 0.01
bestConf = 0.0
self._mBestGuessProber = None
for prober in self._mProbers:
if not prober:
continue
if not prober.active:
if constants._debug:
sys.stderr.write(prober.get_charset_name()
+ ' not active\n')
continue
cf = prober.get_confidence()
if constants._debug:
sys.stderr.write('%s confidence = %s\n' %
(prober.get_charset_name(), cf))
if bestConf < cf:
bestConf = cf
self._mBestGuessProber = prober
if not self._mBestGuessProber:
return 0.0
return bestConf
# else:
# self._mBestGuessProber = self._mProbers[0]
# return self._mBestGuessProber.get_confidence()
|
gpl-3.0
|
[
6565,
16427,
5113,
8068,
11945,
199,
3,
710,
12769,
5495,
365,
17728,
13338,
707,
1890,
1233,
14,
199,
3,
221,
199,
3,
710,
6026,
9607,
402,
314,
12769,
5495,
365,
199,
3,
20433,
18686,
11098,
14,
199,
3,
20825,
2737,
701,
314,
6026,
9607,
787,
1898,
334,
35,
9,
19960,
199,
3,
314,
6026,
9607,
14,
2900,
5924,
5702,
14,
199,
3,
221,
199,
3,
17636,
8,
83,
304,
199,
3,
257,
7173,
19641,
446,
1844,
370,
2018,
199,
3,
199,
3,
961,
3555,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
199,
3,
2811,
652,
1334,
314,
2895,
402,
314,
1664,
6401,
1696,
1684,
199,
3,
844,
465,
3267,
701,
314,
2868,
2290,
2752,
27,
1902,
199,
3,
1015,
499,
14,
17,
402,
314,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
221,
199,
3,
961,
3555,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
199,
3,
6401,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
221,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
199,
3,
844,
3180,
543,
642,
3555,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
199,
3,
2752,
12,
3277,
2020,
8026,
11236,
1933,
12,
12066,
11844,
12,
8226,
12,
4828,
199,
3,
11315,
13,
10067,
221,
8217,
199,
19054,
7729,
5113,
8068,
21186,
199,
199,
504,
1275,
492,
5262,
199,
646,
984,
199,
504,
1275,
6043,
19903,
492,
31727,
421,
199,
533,
6659,
1084,
2448,
8029,
8,
15159,
304,
272,
347,
636,
826,
721,
277,
304,
267,
31727,
855,
826,
721,
277,
9,
267,
291,
423,
77,
7472,
5667,
275,
378,
267,
291,
423,
77,
8029,
83,
275,
942,
267,
291,
423,
77,
19478,
25541,
8029,
275,
488,
339,
347,
5305,
8,
277,
304,
267,
31727,
14,
3958,
8,
277,
9,
267,
291,
423,
77,
7472,
5667,
275,
378,
267,
367,
16118,
315,
291,
423,
77,
8029,
83,
26,
288,
340,
16118,
26,
355,
16118,
14,
3958,
342,
355,
16118,
14,
2682,
275,
715,
355,
291,
423,
77,
7472,
5667,
847,
413,
267,
291,
423,
77,
19478,
25541,
8029,
275,
488,
339,
347,
664,
63,
6043,
63,
354,
8,
277,
304,
267,
340,
440,
291,
423,
77,
19478,
25541,
8029,
26,
288,
291,
14,
362,
63,
13969,
342,
288,
340,
440,
291,
423,
77,
19478,
25541,
8029,
26,
355,
372,
488,
199,
3,
4483,
291,
423,
77,
19478,
25541,
8029,
275,
291,
423,
77,
8029,
83,
59,
16,
61,
267,
372,
291,
423,
77,
19478,
25541,
8029,
14,
362,
63,
6043,
63,
354,
342,
339,
347,
4733,
8,
277,
12,
17407,
304,
267,
367,
16118,
315,
291,
423,
77,
8029,
83,
26,
288,
340,
440,
16118,
26,
355,
1980,
288,
340,
440,
16118,
14,
2682,
26,
355,
1980,
288,
410,
275,
16118,
14,
3871,
8,
22353,
9,
288,
340,
440,
410,
26,
355,
1980,
288,
340,
410,
508,
5262,
14,
69,
3601,
7940,
26,
355,
291,
423,
77,
19478,
25541,
8029,
275,
16118,
355,
372,
291,
14,
362,
63,
929,
342,
288,
916,
410,
508,
5262,
14,
69,
1763,
1352,
26,
355,
16118,
14,
2682,
275,
756,
355,
291,
423,
77,
7472,
5667,
4862,
413,
355,
340,
291,
423,
77,
7472,
5667,
2695,
378,
26,
490,
291,
423,
31984,
275,
5262,
14,
69,
1763,
1352,
490,
372,
291,
14,
362,
63,
929,
342,
267,
372,
291,
14,
362,
63,
929,
342,
339,
347,
664,
63,
13969,
8,
277,
304,
267,
410,
275,
291,
14,
362,
63,
929,
342,
267,
340,
410,
508,
5262,
14,
69,
3601,
7940,
26,
288,
372,
378,
14,
1020,
267,
916,
410,
508,
5262,
14,
69,
1763,
1352,
26,
288,
372,
378,
14,
614,
267,
5526,
8930,
275,
378,
14,
16,
267,
291,
423,
77,
19478,
25541,
8029,
275,
488,
267,
367,
16118,
315,
291,
423,
77,
8029,
83,
26,
288,
340,
440,
16118,
26,
355,
1980,
288,
340,
440,
16118,
14,
2682,
26,
355,
340,
5262,
423,
1757,
26,
490,
984,
14,
3083,
14,
952,
8,
19903,
14,
362,
63,
6043,
63,
354,
342,
3660,
435,
283,
440,
4702,
60,
78,
358,
355,
1980,
288,
3980,
275,
16118,
14,
362,
63,
13969,
342,
288,
340,
5262,
423,
1757,
26,
355,
984,
14,
3083,
14,
952,
3508,
83,
15197,
275,
450,
83,
60,
78,
7,
450,
639,
334,
19903,
14,
362,
63,
6043,
63,
354,
1062,
3980,
430,
288,
340,
5526,
8930,
665,
3980,
26,
355,
5526,
8930,
275,
3980,
355,
291,
423,
77,
19478,
25541,
8029,
275,
16118,
267,
340,
440,
291,
423,
77,
19478,
25541,
8029,
26,
288,
372,
378,
14,
16,
267,
372,
5526,
8930,
199,
3,
263,
587,
26,
199,
3,
3322,
291,
423,
77,
19478,
25541,
8029,
275,
291,
423,
77,
8029,
83,
59,
16,
61,
199,
3,
3322,
372,
291,
423,
77,
19478,
25541,
8029,
14,
362,
63,
13969,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
16427,
5113,
8068,
11945,
199,
3,
710,
12769,
5495,
365,
17728,
13338,
707,
1890,
1233,
14,
199,
3,
221,
199,
3,
710,
6026,
9607,
402,
314,
12769,
5495,
365,
199,
3,
20433,
18686,
11098,
14,
199,
3,
20825,
2737,
701,
314,
6026,
9607,
787,
1898,
334,
35,
9,
19960,
199,
3,
314,
6026,
9607,
14,
2900,
5924,
5702,
14,
199,
3,
221,
199,
3,
17636,
8,
83,
304,
199,
3,
257,
7173,
19641,
446,
1844,
370,
2018,
199,
3,
199,
3,
961,
3555,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
199,
3,
2811,
652,
1334,
314,
2895,
402,
314,
1664,
6401,
1696,
1684,
199,
3,
844,
465,
3267,
701,
314,
2868,
2290,
2752,
27,
1902,
199,
3,
1015,
499,
14,
17,
402,
314,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
221,
199,
3,
961,
3555,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
199,
3,
6401,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
221,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
199,
3,
844,
3180,
543,
642,
3555,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
199,
3,
2752,
12,
3277,
2020,
8026,
11236,
1933,
12,
12066,
11844,
12,
8226,
12,
4828,
199,
3,
11315,
13,
10067,
221,
8217,
199,
19054,
7729,
5113,
8068,
21186,
199,
199,
504,
1275,
492,
5262,
199,
646,
984,
199,
504,
1275,
6043,
19903,
492,
31727,
421,
199,
533,
6659,
1084,
2448,
8029,
8,
15159,
304,
272,
347,
636,
826,
721,
277,
304,
267,
31727,
855,
826,
721,
277,
9,
267,
291,
423,
77,
7472,
5667,
275,
378,
267,
291,
423,
77,
8029,
83,
275,
942,
267,
291,
423,
77,
19478,
25541,
8029,
275,
488,
339,
347,
5305,
8,
277,
304,
267,
31727,
14,
3958,
8,
277,
9,
267,
291,
423,
77,
7472,
5667,
275,
378,
267,
367,
16118,
315,
291,
423,
77,
8029,
83,
26,
288,
340,
16118,
26,
355,
16118,
14,
3958,
342,
355,
16118,
14,
2682,
275,
715,
355,
291,
423,
77,
7472,
5667,
847,
413,
267,
291,
423,
77,
19478,
25541,
8029,
275,
488,
339,
347,
664,
63,
6043,
63,
354,
8,
277,
304,
267,
340,
440,
291,
423,
77,
19478,
25541,
8029,
26,
288,
291,
14,
362,
63,
13969,
342,
288,
340,
440,
291,
423,
77,
19478,
25541,
8029,
26,
355,
372,
488,
199,
3,
4483,
291,
423,
77,
19478,
25541,
8029,
275,
291,
423,
77,
8029,
83,
59,
16,
61,
267,
372,
291,
423,
77,
19478,
25541,
8029,
14,
362,
63,
6043,
63,
354,
342,
339,
347,
4733,
8,
277,
12,
17407,
304,
267,
367,
16118,
315,
291,
423,
77,
8029,
83,
26,
288,
340,
440,
16118,
26,
355,
1980,
288,
340,
440,
16118,
14,
2682,
26,
355,
1980,
288,
410,
275,
16118,
14,
3871,
8,
22353,
9,
288,
340,
440,
410,
26,
355,
1980,
288,
340,
410,
508,
5262,
14,
69,
3601,
7940,
26,
355,
291,
423,
77,
19478,
25541,
8029,
275,
16118,
355,
372,
291,
14,
362,
63,
929,
342,
288,
916,
410,
508,
5262,
14,
69,
1763,
1352,
26,
355,
16118,
14,
2682,
275,
756,
355,
291,
423,
77,
7472,
5667,
4862,
413,
355,
340,
291,
423,
77,
7472,
5667,
2695,
378,
26,
490,
291,
423,
31984,
275,
5262,
14,
69,
1763,
1352,
490,
372,
291,
14,
362,
63,
929,
342,
267,
372,
291,
14,
362,
63,
929,
342,
339,
347,
664,
63,
13969,
8,
277,
304,
267,
410,
275,
291,
14,
362,
63,
929,
342,
267,
340,
410,
508,
5262,
14,
69,
3601,
7940,
26,
288,
372,
378,
14,
1020,
267,
916,
410,
508,
5262,
14,
69,
1763,
1352,
26,
288,
372,
378,
14,
614,
267,
5526,
8930,
275,
378,
14,
16,
267,
291,
423,
77,
19478,
25541,
8029,
275,
488,
267,
367,
16118,
315,
291,
423,
77,
8029,
83,
26,
288,
340,
440,
16118,
26,
355,
1980,
288,
340,
440,
16118,
14,
2682,
26,
355,
340,
5262,
423,
1757,
26,
490,
984,
14,
3083,
14,
952,
8,
19903,
14,
362,
63,
6043,
63,
354,
342,
3660,
435,
283,
440,
4702,
60,
78,
358,
355,
1980,
288,
3980,
275,
16118,
14,
362,
63,
13969,
342,
288,
340,
5262,
423,
1757,
26,
355,
984,
14,
3083,
14,
952,
3508,
83,
15197,
275,
450,
83,
60,
78,
7,
450,
639,
334,
19903,
14,
362,
63,
6043,
63,
354,
1062,
3980,
430,
288,
340,
5526,
8930,
665,
3980,
26,
355,
5526,
8930,
275,
3980,
355,
291,
423,
77,
19478,
25541,
8029,
275,
16118,
267,
340,
440,
291,
423,
77,
19478,
25541,
8029,
26,
288,
372,
378,
14,
16,
267,
372,
5526,
8930,
199,
3,
263,
587,
26,
199,
3,
3322,
291,
423,
77,
19478,
25541,
8029,
275,
291,
423,
77,
8029,
83,
59,
16,
61,
199,
3,
3322,
372,
291,
423,
77,
19478,
25541,
8029,
14,
362,
63,
13969,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
Acehaidrey/incubator-airflow
|
tests/api_connexion/endpoints/test_xcom_endpoint.py
|
7
|
17945
|
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import unittest
from datetime import timedelta
from parameterized import parameterized
from airflow.models import DagModel, DagRun as DR, XCom
from airflow.security import permissions
from airflow.utils.dates import parse_execution_date
from airflow.utils.session import provide_session
from airflow.utils.types import DagRunType
from airflow.www import app
from tests.test_utils.api_connexion_utils import assert_401, create_user, delete_user
from tests.test_utils.config import conf_vars
from tests.test_utils.db import clear_db_dags, clear_db_runs, clear_db_xcom
class TestXComEndpoint(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
super().setUpClass()
with conf_vars({("api", "auth_backend"): "tests.test_utils.remote_user_api_auth_backend"}):
cls.app = app.create_app(testing=True) # type:ignore
create_user(
cls.app, # type: ignore
username="test",
role_name="Test",
permissions=[
(permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG),
(permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG_RUN),
(permissions.ACTION_CAN_READ, permissions.RESOURCE_TASK_INSTANCE),
(permissions.ACTION_CAN_READ, permissions.RESOURCE_XCOM),
],
)
create_user(
cls.app, # type: ignore
username="test_granular_permissions",
role_name="TestGranularDag",
permissions=[
(permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG_RUN),
(permissions.ACTION_CAN_READ, permissions.RESOURCE_TASK_INSTANCE),
(permissions.ACTION_CAN_READ, permissions.RESOURCE_XCOM),
],
)
cls.app.appbuilder.sm.sync_perm_for_dag( # type: ignore # pylint: disable=no-member
"test-dag-id-1",
access_control={'TestGranularDag': [permissions.ACTION_CAN_EDIT, permissions.ACTION_CAN_READ]},
)
create_user(cls.app, username="test_no_permissions", role_name="TestNoPermissions") # type: ignore
@classmethod
def tearDownClass(cls) -> None:
delete_user(cls.app, username="test") # type: ignore
delete_user(cls.app, username="test_no_permissions") # type: ignore
@staticmethod
def clean_db():
clear_db_dags()
clear_db_runs()
clear_db_xcom()
def setUp(self) -> None:
"""
Setup For XCom endpoint TC
"""
self.client = self.app.test_client() # type:ignore
# clear existing xcoms
self.clean_db()
def tearDown(self) -> None:
"""
Clear Hanging XComs
"""
self.clean_db()
class TestGetXComEntry(TestXComEndpoint):
def test_should_respond_200(self):
dag_id = 'test-dag-id'
task_id = 'test-task-id'
execution_date = '2005-04-02T00:00:00+00:00'
xcom_key = 'test-xcom-key'
execution_date_parsed = parse_execution_date(execution_date)
dag_run_id = DR.generate_run_id(DagRunType.MANUAL, execution_date_parsed)
self._create_xcom_entry(dag_id, dag_run_id, execution_date_parsed, task_id, xcom_key)
response = self.client.get(
f"/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}",
environ_overrides={'REMOTE_USER': "test"},
)
self.assertEqual(200, response.status_code)
current_data = response.json
current_data['timestamp'] = 'TIMESTAMP'
self.assertEqual(
current_data,
{
'dag_id': dag_id,
'execution_date': execution_date,
'key': xcom_key,
'task_id': task_id,
'timestamp': 'TIMESTAMP',
},
)
def test_should_raises_401_unauthenticated(self):
dag_id = 'test-dag-id'
task_id = 'test-task-id'
execution_date = '2005-04-02T00:00:00+00:00'
xcom_key = 'test-xcom-key'
execution_date_parsed = parse_execution_date(execution_date)
dag_run_id = DR.generate_run_id(DagRunType.MANUAL, execution_date_parsed)
self._create_xcom_entry(dag_id, dag_run_id, execution_date_parsed, task_id, xcom_key)
response = self.client.get(
f"/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}"
)
assert_401(response)
def test_should_raise_403_forbidden(self):
dag_id = 'test-dag-id'
task_id = 'test-task-id'
execution_date = '2005-04-02T00:00:00+00:00'
xcom_key = 'test-xcom-key'
execution_date_parsed = parse_execution_date(execution_date)
dag_run_id = DR.generate_run_id(DagRunType.MANUAL, execution_date_parsed)
self._create_xcom_entry(dag_id, dag_run_id, execution_date_parsed, task_id, xcom_key)
response = self.client.get(
f"/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}",
environ_overrides={'REMOTE_USER': "test_no_permissions"},
)
assert response.status_code == 403
@provide_session
def _create_xcom_entry(self, dag_id, dag_run_id, execution_date, task_id, xcom_key, session=None):
XCom.set(
key=xcom_key,
value="TEST_VALUE",
execution_date=execution_date,
task_id=task_id,
dag_id=dag_id,
)
dagrun = DR(
dag_id=dag_id,
run_id=dag_run_id,
execution_date=execution_date,
start_date=execution_date,
run_type=DagRunType.MANUAL,
)
session.add(dagrun)
class TestGetXComEntries(TestXComEndpoint):
def test_should_respond_200(self):
dag_id = 'test-dag-id'
task_id = 'test-task-id'
execution_date = '2005-04-02T00:00:00+00:00'
execution_date_parsed = parse_execution_date(execution_date)
dag_run_id = DR.generate_run_id(DagRunType.MANUAL, execution_date_parsed)
self._create_xcom_entries(dag_id, dag_run_id, execution_date_parsed, task_id)
response = self.client.get(
f"/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries",
environ_overrides={'REMOTE_USER': "test"},
)
self.assertEqual(200, response.status_code)
response_data = response.json
for xcom_entry in response_data['xcom_entries']:
xcom_entry['timestamp'] = "TIMESTAMP"
self.assertEqual(
response.json,
{
'xcom_entries': [
{
'dag_id': dag_id,
'execution_date': execution_date,
'key': 'test-xcom-key-1',
'task_id': task_id,
'timestamp': "TIMESTAMP",
},
{
'dag_id': dag_id,
'execution_date': execution_date,
'key': 'test-xcom-key-2',
'task_id': task_id,
'timestamp': "TIMESTAMP",
},
],
'total_entries': 2,
},
)
def test_should_respond_200_with_tilde_and_access_to_all_dags(self):
dag_id_1 = 'test-dag-id-1'
task_id_1 = 'test-task-id-1'
execution_date = '2005-04-02T00:00:00+00:00'
execution_date_parsed = parse_execution_date(execution_date)
dag_run_id_1 = DR.generate_run_id(DagRunType.MANUAL, execution_date_parsed)
self._create_xcom_entries(dag_id_1, dag_run_id_1, execution_date_parsed, task_id_1)
dag_id_2 = 'test-dag-id-2'
task_id_2 = 'test-task-id-2'
dag_run_id_2 = DR.generate_run_id(DagRunType.MANUAL, execution_date_parsed)
self._create_xcom_entries(dag_id_2, dag_run_id_2, execution_date_parsed, task_id_2)
self._create_invalid_xcom_entries(execution_date_parsed)
response = self.client.get(
"/api/v1/dags/~/dagRuns/~/taskInstances/~/xcomEntries",
environ_overrides={'REMOTE_USER': "test"},
)
self.assertEqual(200, response.status_code)
response_data = response.json
for xcom_entry in response_data['xcom_entries']:
xcom_entry['timestamp'] = "TIMESTAMP"
self.assertEqual(
response.json,
{
'xcom_entries': [
{
'dag_id': dag_id_1,
'execution_date': execution_date,
'key': 'test-xcom-key-1',
'task_id': task_id_1,
'timestamp': "TIMESTAMP",
},
{
'dag_id': dag_id_1,
'execution_date': execution_date,
'key': 'test-xcom-key-2',
'task_id': task_id_1,
'timestamp': "TIMESTAMP",
},
{
'dag_id': dag_id_2,
'execution_date': execution_date,
'key': 'test-xcom-key-1',
'task_id': task_id_2,
'timestamp': "TIMESTAMP",
},
{
'dag_id': dag_id_2,
'execution_date': execution_date,
'key': 'test-xcom-key-2',
'task_id': task_id_2,
'timestamp': "TIMESTAMP",
},
],
'total_entries': 4,
},
)
def test_should_respond_200_with_tilde_and_granular_dag_access(self):
dag_id_1 = 'test-dag-id-1'
task_id_1 = 'test-task-id-1'
execution_date = '2005-04-02T00:00:00+00:00'
execution_date_parsed = parse_execution_date(execution_date)
dag_run_id_1 = DR.generate_run_id(DagRunType.MANUAL, execution_date_parsed)
self._create_xcom_entries(dag_id_1, dag_run_id_1, execution_date_parsed, task_id_1)
dag_id_2 = 'test-dag-id-2'
task_id_2 = 'test-task-id-2'
dag_run_id_2 = DR.generate_run_id(DagRunType.MANUAL, execution_date_parsed)
self._create_xcom_entries(dag_id_2, dag_run_id_2, execution_date_parsed, task_id_2)
self._create_invalid_xcom_entries(execution_date_parsed)
response = self.client.get(
"/api/v1/dags/~/dagRuns/~/taskInstances/~/xcomEntries",
environ_overrides={'REMOTE_USER': "test_granular_permissions"},
)
self.assertEqual(200, response.status_code)
response_data = response.json
for xcom_entry in response_data['xcom_entries']:
xcom_entry['timestamp'] = "TIMESTAMP"
self.assertEqual(
response.json,
{
'xcom_entries': [
{
'dag_id': dag_id_1,
'execution_date': execution_date,
'key': 'test-xcom-key-1',
'task_id': task_id_1,
'timestamp': "TIMESTAMP",
},
{
'dag_id': dag_id_1,
'execution_date': execution_date,
'key': 'test-xcom-key-2',
'task_id': task_id_1,
'timestamp': "TIMESTAMP",
},
],
'total_entries': 2,
},
)
def test_should_raises_401_unauthenticated(self):
dag_id = 'test-dag-id'
task_id = 'test-task-id'
execution_date = '2005-04-02T00:00:00+00:00'
execution_date_parsed = parse_execution_date(execution_date)
dag_run_id = DR.generate_run_id(DagRunType.MANUAL, execution_date_parsed)
self._create_xcom_entries(dag_id, dag_run_id, execution_date_parsed, task_id)
response = self.client.get(
f"/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries"
)
assert_401(response)
@provide_session
def _create_xcom_entries(self, dag_id, dag_run_id, execution_date, task_id, session=None):
for i in [1, 2]:
XCom.set(
key=f'test-xcom-key-{i}',
value="TEST",
execution_date=execution_date,
task_id=task_id,
dag_id=dag_id,
)
dag = DagModel(dag_id=dag_id)
session.add(dag)
dagrun = DR(
dag_id=dag_id,
run_id=dag_run_id,
execution_date=execution_date,
start_date=execution_date,
run_type=DagRunType.MANUAL,
)
session.add(dagrun)
@provide_session
def _create_invalid_xcom_entries(self, execution_date, session=None):
"""
Invalid XCom entries to test join query
"""
for i in [1, 2]:
XCom.set(
key=f'invalid-xcom-key-{i}',
value="TEST",
execution_date=execution_date,
task_id="invalid_task",
dag_id="invalid_dag",
)
dag = DagModel(dag_id="invalid_dag")
session.add(dag)
dagrun = DR(
dag_id="invalid_dag",
run_id="invalid_run_id",
execution_date=execution_date + timedelta(days=1),
start_date=execution_date,
run_type=DagRunType.MANUAL,
)
session.add(dagrun)
dagrun = DR(
dag_id="invalid_dag_1",
run_id="invalid_run_id",
execution_date=execution_date,
start_date=execution_date,
run_type=DagRunType.MANUAL,
)
session.commit()
class TestPaginationGetXComEntries(TestXComEndpoint):
def setUp(self):
super().setUp()
self.dag_id = 'test-dag-id'
self.task_id = 'test-task-id'
self.execution_date = '2005-04-02T00:00:00+00:00'
self.execution_date_parsed = parse_execution_date(self.execution_date)
self.dag_run_id = DR.generate_run_id(DagRunType.MANUAL, self.execution_date_parsed)
@parameterized.expand(
[
(
"limit=1",
["TEST_XCOM_KEY1"],
),
(
"limit=2",
["TEST_XCOM_KEY1", "TEST_XCOM_KEY10"],
),
(
"offset=5",
[
"TEST_XCOM_KEY5",
"TEST_XCOM_KEY6",
"TEST_XCOM_KEY7",
"TEST_XCOM_KEY8",
"TEST_XCOM_KEY9",
],
),
(
"offset=0",
[
"TEST_XCOM_KEY1",
"TEST_XCOM_KEY10",
"TEST_XCOM_KEY2",
"TEST_XCOM_KEY3",
"TEST_XCOM_KEY4",
"TEST_XCOM_KEY5",
"TEST_XCOM_KEY6",
"TEST_XCOM_KEY7",
"TEST_XCOM_KEY8",
"TEST_XCOM_KEY9",
],
),
(
"limit=1&offset=5",
["TEST_XCOM_KEY5"],
),
(
"limit=1&offset=1",
["TEST_XCOM_KEY10"],
),
(
"limit=2&offset=2",
["TEST_XCOM_KEY2", "TEST_XCOM_KEY3"],
),
]
)
@provide_session
def test_handle_limit_offset(self, query_params, expected_xcom_ids, session):
url = "/api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries?{query_params}"
url = url.format(
dag_id=self.dag_id, dag_run_id=self.dag_run_id, task_id=self.task_id, query_params=query_params
)
dagrun = DR(
dag_id=self.dag_id,
run_id=self.dag_run_id,
execution_date=self.execution_date_parsed,
start_date=self.execution_date_parsed,
run_type=DagRunType.MANUAL,
)
xcom_models = self._create_xcoms(10)
session.add_all(xcom_models)
session.add(dagrun)
session.commit()
response = self.client.get(url, environ_overrides={'REMOTE_USER': "test"})
assert response.status_code == 200
self.assertEqual(response.json["total_entries"], 10)
conn_ids = [conn["key"] for conn in response.json["xcom_entries"] if conn]
self.assertEqual(conn_ids, expected_xcom_ids)
def _create_xcoms(self, count):
return [
XCom(
key=f'TEST_XCOM_KEY{i}',
execution_date=self.execution_date_parsed,
task_id=self.task_id,
dag_id=self.dag_id,
timestamp=self.execution_date_parsed,
)
for i in range(1, count + 1)
]
|
apache-2.0
|
[
3,
3909,
370,
314,
3668,
2290,
2752,
334,
14950,
9,
1334,
1373,
199,
3,
503,
1655,
11615,
4190,
14024,
14,
221,
1666,
314,
12840,
570,
199,
3,
1854,
543,
642,
1736,
367,
4722,
2556,
199,
3,
12602,
4248,
12715,
14,
221,
710,
14857,
12378,
642,
570,
199,
3,
370,
1265,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
199,
3,
298,
3761,
3547,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
199,
3,
543,
314,
844,
14,
221,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
257,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
199,
3,
2032,
1854,
1334,
314,
844,
365,
1854,
641,
376,
199,
3,
298,
1179,
2281,
2,
4207,
12,
2428,
2990,
1549,
4217,
1634,
1821,
199,
3,
3826,
12,
1902,
4056,
503,
2478,
14,
221,
1666,
314,
844,
367,
314,
199,
3,
2488,
2637,
4210,
3443,
436,
4204,
199,
3,
1334,
314,
844,
14,
199,
646,
2882,
199,
504,
2197,
492,
6871,
199,
199,
504,
29526,
492,
29526,
199,
199,
504,
16321,
14,
992,
492,
26110,
1685,
12,
26110,
2540,
465,
577,
50,
12,
1323,
4373,
199,
504,
16321,
14,
4416,
492,
3443,
199,
504,
16321,
14,
1208,
14,
9356,
492,
2198,
63,
9416,
63,
602,
199,
504,
16321,
14,
1208,
14,
1730,
492,
5647,
63,
1730,
199,
504,
16321,
14,
1208,
14,
1313,
492,
26110,
2540,
804,
199,
504,
16321,
14,
1544,
492,
1145,
199,
504,
2295,
14,
396,
63,
1208,
14,
1246,
63,
1631,
476,
1636,
63,
1208,
492,
702,
63,
8854,
12,
1218,
63,
751,
12,
3145,
63,
751,
199,
504,
2295,
14,
396,
63,
1208,
14,
888,
492,
3743,
63,
2936,
199,
504,
2295,
14,
396,
63,
1208,
14,
697,
492,
5436,
63,
697,
63,
32137,
12,
5436,
63,
697,
63,
10802,
12,
5436,
63,
697,
63,
88,
957,
421,
199,
533,
1379,
56,
4373,
11442,
8,
2796,
14,
1746,
304,
272,
768,
3744,
272,
347,
18561,
8,
1886,
9,
1035,
488,
26,
267,
1613,
1252,
27777,
342,
267,
543,
3743,
63,
2936,
2561,
480,
1246,
401,
298,
1178,
63,
4620,
2349,
298,
2219,
14,
396,
63,
1208,
14,
3846,
63,
751,
63,
1246,
63,
1178,
63,
4620,
3570,
304,
288,
843,
14,
571,
275,
1145,
14,
981,
63,
571,
8,
4776,
29,
549,
9,
221,
327,
730,
26,
4247,
398,
1218,
63,
751,
8,
288,
843,
14,
571,
12,
221,
327,
730,
26,
3686,
288,
3434,
628,
396,
401,
288,
4719,
63,
354,
628,
774,
401,
288,
3443,
1524,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
28211,
395,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
28211,
63,
9390,
395,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
17179,
63,
18235,
395,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
56,
11265,
395,
288,
2156,
267,
776,
267,
1218,
63,
751,
8,
288,
843,
14,
571,
12,
221,
327,
730,
26,
3686,
288,
3434,
628,
396,
63,
26655,
2238,
63,
6060,
401,
288,
4719,
63,
354,
628,
774,
39,
1312,
2238,
27234,
401,
288,
3443,
1524,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
28211,
63,
9390,
395,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
17179,
63,
18235,
395,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
56,
11265,
395,
288,
2156,
267,
776,
267,
843,
14,
571,
14,
571,
5649,
14,
3300,
14,
5186,
63,
8220,
63,
509,
63,
7406,
8,
221,
327,
730,
26,
3686,
221,
327,
4287,
26,
3507,
29,
889,
13,
1114,
288,
298,
396,
13,
7406,
13,
344,
13,
17,
401,
288,
2879,
63,
2785,
3713,
774,
39,
1312,
2238,
27234,
356,
359,
6060,
14,
10052,
63,
18988,
63,
17929,
12,
3443,
14,
10052,
63,
18988,
63,
5670,
13888,
267,
776,
267,
1218,
63,
751,
8,
1886,
14,
571,
12,
3434,
628,
396,
63,
889,
63,
6060,
401,
4719,
63,
354,
628,
774,
1944,
17004,
531,
221,
327,
730,
26,
3686,
339,
768,
3744,
272,
347,
24468,
8,
1886,
9,
1035,
488,
26,
267,
3145,
63,
751,
8,
1886,
14,
571,
12,
3434,
628,
396,
531,
221,
327,
730,
26,
3686,
267,
3145,
63,
751,
8,
1886,
14,
571,
12,
3434,
628,
396,
63,
889,
63,
6060,
531,
221,
327,
730,
26,
3686,
339,
768,
4639,
272,
347,
3633,
63,
697,
837,
267,
5436,
63,
697,
63,
32137,
342,
267,
5436,
63,
697,
63,
10802,
342,
267,
5436,
63,
697,
63,
88,
957,
342,
339,
347,
3613,
8,
277,
9,
1035,
488,
26,
267,
408,
267,
12439,
2104,
1323,
4373,
6037,
377,
35,
267,
408,
267,
291,
14,
1258,
275,
291,
14,
571,
14,
396,
63,
1258,
342,
221,
327,
730,
26,
4247,
267,
327,
5436,
3411,
671,
331,
706,
267,
291,
14,
3118,
63,
697,
342,
339,
347,
6766,
8,
277,
9,
1035,
488,
26,
267,
408,
267,
14836,
869,
8544,
1323,
4373,
83,
267,
408,
267,
291,
14,
3118,
63,
697,
342,
421,
199,
533,
1379,
1002,
56,
4373,
3900,
8,
774,
56,
4373,
11442,
304,
272,
347,
511,
63,
5626,
63,
22720,
63,
1840,
8,
277,
304,
267,
10158,
63,
344,
275,
283,
396,
13,
7406,
13,
344,
7,
267,
2120,
63,
344,
275,
283,
396,
13,
1765,
13,
344,
7,
267,
6451,
63,
602,
275,
283,
9397,
13,
966,
13,
996,
52,
383,
26,
383,
26,
383,
11,
383,
26,
383,
7,
267,
671,
957,
63,
498,
275,
283,
396,
13,
88,
957,
13,
498,
7,
267,
6451,
63,
602,
63,
6751,
275,
2198,
63,
9416,
63,
602,
8,
9416,
63,
602,
9,
267,
10158,
63,
1065,
63,
344,
275,
577,
50,
14,
4208,
63,
1065,
63,
344,
8,
27234,
2540,
804,
14,
6588,
13841,
12,
6451,
63,
602,
63,
6751,
9,
267,
291,
423,
981,
63,
88,
957,
63,
2373,
8,
7406,
63,
344,
12,
10158,
63,
1065,
63
] |
[
3909,
370,
314,
3668,
2290,
2752,
334,
14950,
9,
1334,
1373,
199,
3,
503,
1655,
11615,
4190,
14024,
14,
221,
1666,
314,
12840,
570,
199,
3,
1854,
543,
642,
1736,
367,
4722,
2556,
199,
3,
12602,
4248,
12715,
14,
221,
710,
14857,
12378,
642,
570,
199,
3,
370,
1265,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
199,
3,
298,
3761,
3547,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
199,
3,
543,
314,
844,
14,
221,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
257,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
199,
3,
2032,
1854,
1334,
314,
844,
365,
1854,
641,
376,
199,
3,
298,
1179,
2281,
2,
4207,
12,
2428,
2990,
1549,
4217,
1634,
1821,
199,
3,
3826,
12,
1902,
4056,
503,
2478,
14,
221,
1666,
314,
844,
367,
314,
199,
3,
2488,
2637,
4210,
3443,
436,
4204,
199,
3,
1334,
314,
844,
14,
199,
646,
2882,
199,
504,
2197,
492,
6871,
199,
199,
504,
29526,
492,
29526,
199,
199,
504,
16321,
14,
992,
492,
26110,
1685,
12,
26110,
2540,
465,
577,
50,
12,
1323,
4373,
199,
504,
16321,
14,
4416,
492,
3443,
199,
504,
16321,
14,
1208,
14,
9356,
492,
2198,
63,
9416,
63,
602,
199,
504,
16321,
14,
1208,
14,
1730,
492,
5647,
63,
1730,
199,
504,
16321,
14,
1208,
14,
1313,
492,
26110,
2540,
804,
199,
504,
16321,
14,
1544,
492,
1145,
199,
504,
2295,
14,
396,
63,
1208,
14,
1246,
63,
1631,
476,
1636,
63,
1208,
492,
702,
63,
8854,
12,
1218,
63,
751,
12,
3145,
63,
751,
199,
504,
2295,
14,
396,
63,
1208,
14,
888,
492,
3743,
63,
2936,
199,
504,
2295,
14,
396,
63,
1208,
14,
697,
492,
5436,
63,
697,
63,
32137,
12,
5436,
63,
697,
63,
10802,
12,
5436,
63,
697,
63,
88,
957,
421,
199,
533,
1379,
56,
4373,
11442,
8,
2796,
14,
1746,
304,
272,
768,
3744,
272,
347,
18561,
8,
1886,
9,
1035,
488,
26,
267,
1613,
1252,
27777,
342,
267,
543,
3743,
63,
2936,
2561,
480,
1246,
401,
298,
1178,
63,
4620,
2349,
298,
2219,
14,
396,
63,
1208,
14,
3846,
63,
751,
63,
1246,
63,
1178,
63,
4620,
3570,
304,
288,
843,
14,
571,
275,
1145,
14,
981,
63,
571,
8,
4776,
29,
549,
9,
221,
327,
730,
26,
4247,
398,
1218,
63,
751,
8,
288,
843,
14,
571,
12,
221,
327,
730,
26,
3686,
288,
3434,
628,
396,
401,
288,
4719,
63,
354,
628,
774,
401,
288,
3443,
1524,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
28211,
395,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
28211,
63,
9390,
395,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
17179,
63,
18235,
395,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
56,
11265,
395,
288,
2156,
267,
776,
267,
1218,
63,
751,
8,
288,
843,
14,
571,
12,
221,
327,
730,
26,
3686,
288,
3434,
628,
396,
63,
26655,
2238,
63,
6060,
401,
288,
4719,
63,
354,
628,
774,
39,
1312,
2238,
27234,
401,
288,
3443,
1524,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
28211,
63,
9390,
395,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
17179,
63,
18235,
395,
355,
334,
6060,
14,
10052,
63,
18988,
63,
5670,
12,
3443,
14,
14110,
63,
56,
11265,
395,
288,
2156,
267,
776,
267,
843,
14,
571,
14,
571,
5649,
14,
3300,
14,
5186,
63,
8220,
63,
509,
63,
7406,
8,
221,
327,
730,
26,
3686,
221,
327,
4287,
26,
3507,
29,
889,
13,
1114,
288,
298,
396,
13,
7406,
13,
344,
13,
17,
401,
288,
2879,
63,
2785,
3713,
774,
39,
1312,
2238,
27234,
356,
359,
6060,
14,
10052,
63,
18988,
63,
17929,
12,
3443,
14,
10052,
63,
18988,
63,
5670,
13888,
267,
776,
267,
1218,
63,
751,
8,
1886,
14,
571,
12,
3434,
628,
396,
63,
889,
63,
6060,
401,
4719,
63,
354,
628,
774,
1944,
17004,
531,
221,
327,
730,
26,
3686,
339,
768,
3744,
272,
347,
24468,
8,
1886,
9,
1035,
488,
26,
267,
3145,
63,
751,
8,
1886,
14,
571,
12,
3434,
628,
396,
531,
221,
327,
730,
26,
3686,
267,
3145,
63,
751,
8,
1886,
14,
571,
12,
3434,
628,
396,
63,
889,
63,
6060,
531,
221,
327,
730,
26,
3686,
339,
768,
4639,
272,
347,
3633,
63,
697,
837,
267,
5436,
63,
697,
63,
32137,
342,
267,
5436,
63,
697,
63,
10802,
342,
267,
5436,
63,
697,
63,
88,
957,
342,
339,
347,
3613,
8,
277,
9,
1035,
488,
26,
267,
408,
267,
12439,
2104,
1323,
4373,
6037,
377,
35,
267,
408,
267,
291,
14,
1258,
275,
291,
14,
571,
14,
396,
63,
1258,
342,
221,
327,
730,
26,
4247,
267,
327,
5436,
3411,
671,
331,
706,
267,
291,
14,
3118,
63,
697,
342,
339,
347,
6766,
8,
277,
9,
1035,
488,
26,
267,
408,
267,
14836,
869,
8544,
1323,
4373,
83,
267,
408,
267,
291,
14,
3118,
63,
697,
342,
421,
199,
533,
1379,
1002,
56,
4373,
3900,
8,
774,
56,
4373,
11442,
304,
272,
347,
511,
63,
5626,
63,
22720,
63,
1840,
8,
277,
304,
267,
10158,
63,
344,
275,
283,
396,
13,
7406,
13,
344,
7,
267,
2120,
63,
344,
275,
283,
396,
13,
1765,
13,
344,
7,
267,
6451,
63,
602,
275,
283,
9397,
13,
966,
13,
996,
52,
383,
26,
383,
26,
383,
11,
383,
26,
383,
7,
267,
671,
957,
63,
498,
275,
283,
396,
13,
88,
957,
13,
498,
7,
267,
6451,
63,
602,
63,
6751,
275,
2198,
63,
9416,
63,
602,
8,
9416,
63,
602,
9,
267,
10158,
63,
1065,
63,
344,
275,
577,
50,
14,
4208,
63,
1065,
63,
344,
8,
27234,
2540,
804,
14,
6588,
13841,
12,
6451,
63,
602,
63,
6751,
9,
267,
291,
423,
981,
63,
88,
957,
63,
2373,
8,
7406,
63,
344,
12,
10158,
63,
1065,
63,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
jpshort/odoo
|
addons/account_budget/wizard/account_budget_crossovered_summary_report.py
|
373
|
2191
|
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from openerp.osv import fields, osv
class account_budget_crossvered_summary_report(osv.osv_memory):
"""
This wizard provides the crossovered budget summary report'
"""
_name = 'account.budget.crossvered.summary.report'
_description = 'Account Budget crossvered summary report'
_columns = {
'date_from': fields.date('Start of period', required=True),
'date_to': fields.date('End of period', required=True),
}
_defaults = {
'date_from': lambda *a: time.strftime('%Y-01-01'),
'date_to': lambda *a: time.strftime('%Y-%m-%d'),
}
def check_report(self, cr, uid, ids, context=None):
if context is None:
context = {}
data = self.read(cr, uid, ids, context=context)[0]
datas = {
'ids': context.get('active_ids',[]),
'model': 'crossovered.budget',
'form': data
}
datas['form']['ids'] = datas['ids']
datas['form']['report'] = 'analytic-one'
return self.pool['report'].get_action(cr, uid, [], 'account_budget.report_crossoveredbudget', data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
agpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
199,
3,
259,
7653,
12,
3232,
5800,
8259,
9274,
199,
3,
259,
1898,
334,
35,
9,
8353,
13,
6542,
11947,
12361,
8642,
1014,
921,
9864,
14,
1235,
10121,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
4605,
199,
199,
646,
900,
199,
504,
5166,
14,
4795,
492,
1504,
12,
9506,
421,
199,
533,
2933,
63,
16501,
63,
7925,
10050,
63,
4705,
63,
3070,
8,
4795,
14,
4795,
63,
4844,
304,
272,
408,
272,
961,
12262,
6571,
314,
8059,
79,
10050,
1032,
14080,
6212,
3622,
7,
272,
408,
272,
485,
354,
275,
283,
2048,
14,
16501,
14,
7925,
10050,
14,
4705,
14,
3070,
7,
272,
485,
1802,
275,
283,
6009,
699,
1181,
362,
221,
8059,
10050,
6212,
3622,
7,
272,
485,
3406,
275,
469,
267,
283,
602,
63,
504,
356,
1504,
14,
602,
360,
3162,
402,
6247,
297,
1415,
29,
549,
395,
267,
283,
602,
63,
475,
356,
1504,
14,
602,
360,
3005,
402,
6247,
297,
1415,
29,
549,
395,
272,
789,
272,
485,
4322,
275,
469,
267,
283,
602,
63,
504,
356,
2400,
627,
65,
26,
900,
14,
6205,
3508,
57,
13,
614,
13,
614,
659,
267,
283,
602,
63,
475,
356,
2400,
627,
65,
26,
900,
14,
6205,
3508,
57,
3295,
77,
3295,
68,
659,
272,
789,
339,
347,
1104,
63,
3070,
8,
277,
12,
2467,
12,
1747,
12,
2762,
12,
1067,
29,
403,
304,
267,
340,
1067,
365,
488,
26,
288,
1067,
275,
1052,
267,
666,
275,
291,
14,
739,
8,
1556,
12,
1747,
12,
2762,
12,
1067,
29,
1100,
2788,
16,
61,
267,
15012,
275,
469,
288,
283,
1580,
356,
1067,
14,
362,
360,
2682,
63,
1580,
23993,
2522,
288,
283,
1238,
356,
283,
7925,
79,
10050,
14,
16501,
297,
288,
283,
964,
356,
666,
267,
789,
267,
15012,
459,
964,
2545,
1580,
418,
275,
15012,
459,
1580,
418,
267,
15012,
459,
964,
2545,
3070,
418,
275,
283,
9782,
13,
368,
7,
267,
372,
291,
14,
2293,
459,
3070,
2278,
362,
63,
1287,
8,
1556,
12,
1747,
12,
990,
283,
2048,
63,
16501,
14,
3070,
63,
7925,
79,
10050,
16501,
297,
666,
29,
11563,
12,
1067,
29,
1100,
9,
199,
199,
3,
6695,
26,
10379,
26,
10558,
26,
6492,
29,
20,
26,
10503,
29,
20,
26,
10425,
29,
20,
26,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
199,
3,
259,
7653,
12,
3232,
5800,
8259,
9274,
199,
3,
259,
1898,
334,
35,
9,
8353,
13,
6542,
11947,
12361,
8642,
1014,
921,
9864,
14,
1235,
10121,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
4605,
199,
199,
646,
900,
199,
504,
5166,
14,
4795,
492,
1504,
12,
9506,
421,
199,
533,
2933,
63,
16501,
63,
7925,
10050,
63,
4705,
63,
3070,
8,
4795,
14,
4795,
63,
4844,
304,
272,
408,
272,
961,
12262,
6571,
314,
8059,
79,
10050,
1032,
14080,
6212,
3622,
7,
272,
408,
272,
485,
354,
275,
283,
2048,
14,
16501,
14,
7925,
10050,
14,
4705,
14,
3070,
7,
272,
485,
1802,
275,
283,
6009,
699,
1181,
362,
221,
8059,
10050,
6212,
3622,
7,
272,
485,
3406,
275,
469,
267,
283,
602,
63,
504,
356,
1504,
14,
602,
360,
3162,
402,
6247,
297,
1415,
29,
549,
395,
267,
283,
602,
63,
475,
356,
1504,
14,
602,
360,
3005,
402,
6247,
297,
1415,
29,
549,
395,
272,
789,
272,
485,
4322,
275,
469,
267,
283,
602,
63,
504,
356,
2400,
627,
65,
26,
900,
14,
6205,
3508,
57,
13,
614,
13,
614,
659,
267,
283,
602,
63,
475,
356,
2400,
627,
65,
26,
900,
14,
6205,
3508,
57,
3295,
77,
3295,
68,
659,
272,
789,
339,
347,
1104,
63,
3070,
8,
277,
12,
2467,
12,
1747,
12,
2762,
12,
1067,
29,
403,
304,
267,
340,
1067,
365,
488,
26,
288,
1067,
275,
1052,
267,
666,
275,
291,
14,
739,
8,
1556,
12,
1747,
12,
2762,
12,
1067,
29,
1100,
2788,
16,
61,
267,
15012,
275,
469,
288,
283,
1580,
356,
1067,
14,
362,
360,
2682,
63,
1580,
23993,
2522,
288,
283,
1238,
356,
283,
7925,
79,
10050,
14,
16501,
297,
288,
283,
964,
356,
666,
267,
789,
267,
15012,
459,
964,
2545,
1580,
418,
275,
15012,
459,
1580,
418,
267,
15012,
459,
964,
2545,
3070,
418,
275,
283,
9782,
13,
368,
7,
267,
372,
291,
14,
2293,
459,
3070,
2278,
362,
63,
1287,
8,
1556,
12,
1747,
12,
990,
283,
2048,
63,
16501,
14,
3070,
63,
7925,
79,
10050,
16501,
297,
666,
29,
11563,
12,
1067,
29,
1100,
9,
199,
199,
3,
6695,
26,
10379,
26,
10558,
26,
6492,
29,
20,
26,
10503,
29,
20,
26,
10425,
29,
20,
26,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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Lib.2.7.5-beta1/content/Lib/mailbox.py
|
74
|
78102
|
#! /usr/bin/env python
"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes."""
# Notes for authors of new mailbox subclasses:
#
# Remember to fsync() changes to disk before closing a modified file
# or returning from a flush() method. See functions _sync_flush() and
# _sync_close().
import sys
import os
import time
import calendar
import socket
import errno
import copy
import email
import email.message
import email.generator
import StringIO
try:
if sys.platform == 'os2emx':
# OS/2 EMX fcntl() not adequate
raise ImportError
import fcntl
except ImportError:
fcntl = None
import warnings
with warnings.catch_warnings():
if sys.py3kwarning:
warnings.filterwarnings("ignore", ".*rfc822 has been removed",
DeprecationWarning)
import rfc822
__all__ = [ 'Mailbox', 'Maildir', 'mbox', 'MH', 'Babyl', 'MMDF',
'Message', 'MaildirMessage', 'mboxMessage', 'MHMessage',
'BabylMessage', 'MMDFMessage', 'UnixMailbox',
'PortableUnixMailbox', 'MmdfMailbox', 'MHMailbox', 'BabylMailbox' ]
class Mailbox:
"""A group of messages in a particular place."""
def __init__(self, path, factory=None, create=True):
"""Initialize a Mailbox instance."""
self._path = os.path.abspath(os.path.expanduser(path))
self._factory = factory
def add(self, message):
"""Add message and return assigned key."""
raise NotImplementedError('Method must be implemented by subclass')
def remove(self, key):
"""Remove the keyed message; raise KeyError if it doesn't exist."""
raise NotImplementedError('Method must be implemented by subclass')
def __delitem__(self, key):
self.remove(key)
def discard(self, key):
"""If the keyed message exists, remove it."""
try:
self.remove(key)
except KeyError:
pass
def __setitem__(self, key, message):
"""Replace the keyed message; raise KeyError if it doesn't exist."""
raise NotImplementedError('Method must be implemented by subclass')
def get(self, key, default=None):
"""Return the keyed message, or default if it doesn't exist."""
try:
return self.__getitem__(key)
except KeyError:
return default
def __getitem__(self, key):
"""Return the keyed message; raise KeyError if it doesn't exist."""
if not self._factory:
return self.get_message(key)
else:
return self._factory(self.get_file(key))
def get_message(self, key):
"""Return a Message representation or raise a KeyError."""
raise NotImplementedError('Method must be implemented by subclass')
def get_string(self, key):
"""Return a string representation or raise a KeyError."""
raise NotImplementedError('Method must be implemented by subclass')
def get_file(self, key):
"""Return a file-like representation or raise a KeyError."""
raise NotImplementedError('Method must be implemented by subclass')
def iterkeys(self):
"""Return an iterator over keys."""
raise NotImplementedError('Method must be implemented by subclass')
def keys(self):
"""Return a list of keys."""
return list(self.iterkeys())
def itervalues(self):
"""Return an iterator over all messages."""
for key in self.iterkeys():
try:
value = self[key]
except KeyError:
continue
yield value
def __iter__(self):
return self.itervalues()
def values(self):
"""Return a list of messages. Memory intensive."""
return list(self.itervalues())
def iteritems(self):
"""Return an iterator over (key, message) tuples."""
for key in self.iterkeys():
try:
value = self[key]
except KeyError:
continue
yield (key, value)
def items(self):
"""Return a list of (key, message) tuples. Memory intensive."""
return list(self.iteritems())
def has_key(self, key):
"""Return True if the keyed message exists, False otherwise."""
raise NotImplementedError('Method must be implemented by subclass')
def __contains__(self, key):
return self.has_key(key)
def __len__(self):
"""Return a count of messages in the mailbox."""
raise NotImplementedError('Method must be implemented by subclass')
def clear(self):
"""Delete all messages."""
for key in self.iterkeys():
self.discard(key)
def pop(self, key, default=None):
"""Delete the keyed message and return it, or default."""
try:
result = self[key]
except KeyError:
return default
self.discard(key)
return result
def popitem(self):
"""Delete an arbitrary (key, message) pair and return it."""
for key in self.iterkeys():
return (key, self.pop(key)) # This is only run once.
else:
raise KeyError('No messages in mailbox')
def update(self, arg=None):
"""Change the messages that correspond to certain keys."""
if hasattr(arg, 'iteritems'):
source = arg.iteritems()
elif hasattr(arg, 'items'):
source = arg.items()
else:
source = arg
bad_key = False
for key, message in source:
try:
self[key] = message
except KeyError:
bad_key = True
if bad_key:
raise KeyError('No message with key(s)')
def flush(self):
"""Write any pending changes to the disk."""
raise NotImplementedError('Method must be implemented by subclass')
def lock(self):
"""Lock the mailbox."""
raise NotImplementedError('Method must be implemented by subclass')
def unlock(self):
"""Unlock the mailbox if it is locked."""
raise NotImplementedError('Method must be implemented by subclass')
def close(self):
"""Flush and close the mailbox."""
raise NotImplementedError('Method must be implemented by subclass')
def _dump_message(self, message, target, mangle_from_=False):
# Most files are opened in binary mode to allow predictable seeking.
# To get native line endings on disk, the user-friendly \n line endings
# used in strings and by email.Message are translated here.
"""Dump message contents to target file."""
if isinstance(message, email.message.Message):
buffer = StringIO.StringIO()
gen = email.generator.Generator(buffer, mangle_from_, 0)
gen.flatten(message)
buffer.seek(0)
target.write(buffer.read().replace('\n', os.linesep))
elif isinstance(message, str):
if mangle_from_:
message = message.replace('\nFrom ', '\n>From ')
message = message.replace('\n', os.linesep)
target.write(message)
elif hasattr(message, 'read'):
while True:
line = message.readline()
if line == '':
break
if mangle_from_ and line.startswith('From '):
line = '>From ' + line[5:]
line = line.replace('\n', os.linesep)
target.write(line)
else:
raise TypeError('Invalid message type: %s' % type(message))
class Maildir(Mailbox):
"""A qmail-style Maildir mailbox."""
colon = ':'
def __init__(self, dirname, factory=rfc822.Message, create=True):
"""Initialize a Maildir instance."""
Mailbox.__init__(self, dirname, factory, create)
self._paths = {
'tmp': os.path.join(self._path, 'tmp'),
'new': os.path.join(self._path, 'new'),
'cur': os.path.join(self._path, 'cur'),
}
if not os.path.exists(self._path):
if create:
os.mkdir(self._path, 0700)
for path in self._paths.values():
os.mkdir(path, 0o700)
else:
raise NoSuchMailboxError(self._path)
self._toc = {}
self._toc_mtimes = {}
for subdir in ('cur', 'new'):
self._toc_mtimes[subdir] = os.path.getmtime(self._paths[subdir])
self._last_read = time.time() # Records last time we read cur/new
self._skewfactor = 0.1 # Adjust if os/fs clocks are skewing
def add(self, message):
"""Add message and return assigned key."""
tmp_file = self._create_tmp()
try:
self._dump_message(message, tmp_file)
except BaseException:
tmp_file.close()
os.remove(tmp_file.name)
raise
_sync_close(tmp_file)
if isinstance(message, MaildirMessage):
subdir = message.get_subdir()
suffix = self.colon + message.get_info()
if suffix == self.colon:
suffix = ''
else:
subdir = 'new'
suffix = ''
uniq = os.path.basename(tmp_file.name).split(self.colon)[0]
dest = os.path.join(self._path, subdir, uniq + suffix)
try:
if hasattr(os, 'link'):
os.link(tmp_file.name, dest)
os.remove(tmp_file.name)
else:
os.rename(tmp_file.name, dest)
except OSError, e:
os.remove(tmp_file.name)
if e.errno == errno.EEXIST:
raise ExternalClashError('Name clash with existing message: %s'
% dest)
else:
raise
if isinstance(message, MaildirMessage):
os.utime(dest, (os.path.getatime(dest), message.get_date()))
return uniq
def remove(self, key):
"""Remove the keyed message; raise KeyError if it doesn't exist."""
os.remove(os.path.join(self._path, self._lookup(key)))
def discard(self, key):
"""If the keyed message exists, remove it."""
# This overrides an inapplicable implementation in the superclass.
try:
self.remove(key)
except KeyError:
pass
except OSError, e:
if e.errno != errno.ENOENT:
raise
def __setitem__(self, key, message):
"""Replace the keyed message; raise KeyError if it doesn't exist."""
old_subpath = self._lookup(key)
temp_key = self.add(message)
temp_subpath = self._lookup(temp_key)
if isinstance(message, MaildirMessage):
# temp's subdir and suffix were specified by message.
dominant_subpath = temp_subpath
else:
# temp's subdir and suffix were defaults from add().
dominant_subpath = old_subpath
subdir = os.path.dirname(dominant_subpath)
if self.colon in dominant_subpath:
suffix = self.colon + dominant_subpath.split(self.colon)[-1]
else:
suffix = ''
self.discard(key)
new_path = os.path.join(self._path, subdir, key + suffix)
os.rename(os.path.join(self._path, temp_subpath), new_path)
if isinstance(message, MaildirMessage):
os.utime(new_path, (os.path.getatime(new_path),
message.get_date()))
def get_message(self, key):
"""Return a Message representation or raise a KeyError."""
subpath = self._lookup(key)
f = open(os.path.join(self._path, subpath), 'r')
try:
if self._factory:
msg = self._factory(f)
else:
msg = MaildirMessage(f)
finally:
f.close()
subdir, name = os.path.split(subpath)
msg.set_subdir(subdir)
if self.colon in name:
msg.set_info(name.split(self.colon)[-1])
msg.set_date(os.path.getmtime(os.path.join(self._path, subpath)))
return msg
def get_string(self, key):
"""Return a string representation or raise a KeyError."""
f = open(os.path.join(self._path, self._lookup(key)), 'r')
try:
return f.read()
finally:
f.close()
def get_file(self, key):
"""Return a file-like representation or raise a KeyError."""
f = open(os.path.join(self._path, self._lookup(key)), 'rb')
return _ProxyFile(f)
def iterkeys(self):
"""Return an iterator over keys."""
self._refresh()
for key in self._toc:
try:
self._lookup(key)
except KeyError:
continue
yield key
def has_key(self, key):
"""Return True if the keyed message exists, False otherwise."""
self._refresh()
return key in self._toc
def __len__(self):
"""Return a count of messages in the mailbox."""
self._refresh()
return len(self._toc)
def flush(self):
"""Write any pending changes to disk."""
# Maildir changes are always written immediately, so there's nothing
# to do.
pass
def lock(self):
"""Lock the mailbox."""
return
def unlock(self):
"""Unlock the mailbox if it is locked."""
return
def close(self):
"""Flush and close the mailbox."""
return
def list_folders(self):
"""Return a list of folder names."""
result = []
for entry in os.listdir(self._path):
if len(entry) > 1 and entry[0] == '.' and \
os.path.isdir(os.path.join(self._path, entry)):
result.append(entry[1:])
return result
def get_folder(self, folder):
"""Return a Maildir instance for the named folder."""
return Maildir(os.path.join(self._path, '.' + folder),
factory=self._factory,
create=False)
def add_folder(self, folder):
"""Create a folder and return a Maildir instance representing it."""
path = os.path.join(self._path, '.' + folder)
result = Maildir(path, factory=self._factory)
maildirfolder_path = os.path.join(path, 'maildirfolder')
if not os.path.exists(maildirfolder_path):
os.close(os.open(maildirfolder_path, os.O_CREAT | os.O_WRONLY,
0666))
return result
def remove_folder(self, folder):
"""Delete the named folder, which must be empty."""
path = os.path.join(self._path, '.' + folder)
for entry in os.listdir(os.path.join(path, 'new')) + \
os.listdir(os.path.join(path, 'cur')):
if len(entry) < 1 or entry[0] != '.':
raise NotEmptyError('Folder contains message(s): %s' % folder)
for entry in os.listdir(path):
if entry != 'new' and entry != 'cur' and entry != 'tmp' and \
os.path.isdir(os.path.join(path, entry)):
raise NotEmptyError("Folder contains subdirectory '%s': %s" %
(folder, entry))
for root, dirs, files in os.walk(path, topdown=False):
for entry in files:
os.remove(os.path.join(root, entry))
for entry in dirs:
os.rmdir(os.path.join(root, entry))
os.rmdir(path)
def clean(self):
"""Delete old files in "tmp"."""
now = time.time()
for entry in os.listdir(os.path.join(self._path, 'tmp')):
path = os.path.join(self._path, 'tmp', entry)
if now - os.path.getatime(path) > 129600: # 60 * 60 * 36
os.remove(path)
_count = 1 # This is used to generate unique file names.
def _create_tmp(self):
"""Create a file in the tmp subdirectory and open and return it."""
now = time.time()
hostname = socket.gethostname()
if '/' in hostname:
hostname = hostname.replace('/', r'\057')
if ':' in hostname:
hostname = hostname.replace(':', r'\072')
uniq = "%s.M%sP%sQ%s.%s" % (int(now), int(now % 1 * 1e6), os.getpid(),
Maildir._count, hostname)
path = os.path.join(self._path, 'tmp', uniq)
try:
os.stat(path)
except OSError, e:
if e.errno == errno.ENOENT:
Maildir._count += 1
try:
return _create_carefully(path)
except OSError, e:
if e.errno != errno.EEXIST:
raise
else:
raise
# Fall through to here if stat succeeded or open raised EEXIST.
raise ExternalClashError('Name clash prevented file creation: %s' %
path)
def _refresh(self):
"""Update table of contents mapping."""
# If it has been less than two seconds since the last _refresh() call,
# we have to unconditionally re-read the mailbox just in case it has
# been modified, because os.path.mtime() has a 2 sec resolution in the
# most common worst case (FAT) and a 1 sec resolution typically. This
# results in a few unnecessary re-reads when _refresh() is called
# multiple times in that interval, but once the clock ticks over, we
# will only re-read as needed. Because the filesystem might be being
# served by an independent system with its own clock, we record and
# compare with the mtimes from the filesystem. Because the other
# system's clock might be skewing relative to our clock, we add an
# extra delta to our wait. The default is one tenth second, but is an
# instance variable and so can be adjusted if dealing with a
# particularly skewed or irregular system.
if time.time() - self._last_read > 2 + self._skewfactor:
refresh = False
for subdir in self._toc_mtimes:
mtime = os.path.getmtime(self._paths[subdir])
if mtime > self._toc_mtimes[subdir]:
refresh = True
self._toc_mtimes[subdir] = mtime
if not refresh:
return
# Refresh toc
self._toc = {}
for subdir in self._toc_mtimes:
path = self._paths[subdir]
for entry in os.listdir(path):
p = os.path.join(path, entry)
if os.path.isdir(p):
continue
uniq = entry.split(self.colon)[0]
self._toc[uniq] = os.path.join(subdir, entry)
self._last_read = time.time()
def _lookup(self, key):
"""Use TOC to return subpath for given key, or raise a KeyError."""
try:
if os.path.exists(os.path.join(self._path, self._toc[key])):
return self._toc[key]
except KeyError:
pass
self._refresh()
try:
return self._toc[key]
except KeyError:
raise KeyError('No message with key: %s' % key)
# This method is for backward compatibility only.
def next(self):
"""Return the next message in a one-time iteration."""
if not hasattr(self, '_onetime_keys'):
self._onetime_keys = self.iterkeys()
while True:
try:
return self[self._onetime_keys.next()]
except StopIteration:
return None
except KeyError:
continue
class _singlefileMailbox(Mailbox):
"""A single-file mailbox."""
def __init__(self, path, factory=None, create=True):
"""Initialize a single-file mailbox."""
Mailbox.__init__(self, path, factory, create)
try:
f = open(self._path, 'rb+')
except IOError, e:
if e.errno == errno.ENOENT:
if create:
f = open(self._path, 'wb+')
else:
raise NoSuchMailboxError(self._path)
elif e.errno in (errno.EACCES, errno.EROFS):
f = open(self._path, 'rb')
else:
raise
self._file = f
self._toc = None
self._next_key = 0
self._pending = False # No changes require rewriting the file.
self._locked = False
self._file_length = None # Used to record mailbox size
def add(self, message):
"""Add message and return assigned key."""
self._lookup()
self._toc[self._next_key] = self._append_message(message)
self._next_key += 1
self._pending = True
return self._next_key - 1
def remove(self, key):
"""Remove the keyed message; raise KeyError if it doesn't exist."""
self._lookup(key)
del self._toc[key]
self._pending = True
def __setitem__(self, key, message):
"""Replace the keyed message; raise KeyError if it doesn't exist."""
self._lookup(key)
self._toc[key] = self._append_message(message)
self._pending = True
def iterkeys(self):
"""Return an iterator over keys."""
self._lookup()
for key in self._toc.keys():
yield key
def has_key(self, key):
"""Return True if the keyed message exists, False otherwise."""
self._lookup()
return key in self._toc
def __len__(self):
"""Return a count of messages in the mailbox."""
self._lookup()
return len(self._toc)
def lock(self):
"""Lock the mailbox."""
if not self._locked:
_lock_file(self._file)
self._locked = True
def unlock(self):
"""Unlock the mailbox if it is locked."""
if self._locked:
_unlock_file(self._file)
self._locked = False
def flush(self):
"""Write any pending changes to disk."""
if not self._pending:
return
# In order to be writing anything out at all, self._toc must
# already have been generated (and presumably has been modified
# by adding or deleting an item).
assert self._toc is not None
# Check length of self._file; if it's changed, some other process
# has modified the mailbox since we scanned it.
self._file.seek(0, 2)
cur_len = self._file.tell()
if cur_len != self._file_length:
raise ExternalClashError('Size of mailbox file changed '
'(expected %i, found %i)' %
(self._file_length, cur_len))
new_file = _create_temporary(self._path)
try:
new_toc = {}
self._pre_mailbox_hook(new_file)
for key in sorted(self._toc.keys()):
start, stop = self._toc[key]
self._file.seek(start)
self._pre_message_hook(new_file)
new_start = new_file.tell()
while True:
buffer = self._file.read(min(4096,
stop - self._file.tell()))
if buffer == '':
break
new_file.write(buffer)
new_toc[key] = (new_start, new_file.tell())
self._post_message_hook(new_file)
except:
new_file.close()
os.remove(new_file.name)
raise
_sync_close(new_file)
# self._file is about to get replaced, so no need to sync.
self._file.close()
try:
os.rename(new_file.name, self._path)
except OSError, e:
if e.errno == errno.EEXIST or \
(os.name == 'os2' and e.errno == errno.EACCES):
os.remove(self._path)
os.rename(new_file.name, self._path)
else:
raise
self._file = open(self._path, 'rb+')
self._toc = new_toc
self._pending = False
if self._locked:
_lock_file(self._file, dotlock=False)
def _pre_mailbox_hook(self, f):
"""Called before writing the mailbox to file f."""
return
def _pre_message_hook(self, f):
"""Called before writing each message to file f."""
return
def _post_message_hook(self, f):
"""Called after writing each message to file f."""
return
def close(self):
"""Flush and close the mailbox."""
self.flush()
if self._locked:
self.unlock()
self._file.close() # Sync has been done by self.flush() above.
def _lookup(self, key=None):
"""Return (start, stop) or raise KeyError."""
if self._toc is None:
self._generate_toc()
if key is not None:
try:
return self._toc[key]
except KeyError:
raise KeyError('No message with key: %s' % key)
def _append_message(self, message):
"""Append message to mailbox and return (start, stop) offsets."""
self._file.seek(0, 2)
before = self._file.tell()
try:
self._pre_message_hook(self._file)
offsets = self._install_message(message)
self._post_message_hook(self._file)
except BaseException:
self._file.truncate(before)
raise
self._file.flush()
self._file_length = self._file.tell() # Record current length of mailbox
return offsets
class _mboxMMDF(_singlefileMailbox):
"""An mbox or MMDF mailbox."""
_mangle_from_ = True
def get_message(self, key):
"""Return a Message representation or raise a KeyError."""
start, stop = self._lookup(key)
self._file.seek(start)
from_line = self._file.readline().replace(os.linesep, '')
string = self._file.read(stop - self._file.tell())
msg = self._message_factory(string.replace(os.linesep, '\n'))
msg.set_from(from_line[5:])
return msg
def get_string(self, key, from_=False):
"""Return a string representation or raise a KeyError."""
start, stop = self._lookup(key)
self._file.seek(start)
if not from_:
self._file.readline()
string = self._file.read(stop - self._file.tell())
return string.replace(os.linesep, '\n')
def get_file(self, key, from_=False):
"""Return a file-like representation or raise a KeyError."""
start, stop = self._lookup(key)
self._file.seek(start)
if not from_:
self._file.readline()
return _PartialFile(self._file, self._file.tell(), stop)
def _install_message(self, message):
"""Format a message and blindly write to self._file."""
from_line = None
if isinstance(message, str) and message.startswith('From '):
newline = message.find('\n')
if newline != -1:
from_line = message[:newline]
message = message[newline + 1:]
else:
from_line = message
message = ''
elif isinstance(message, _mboxMMDFMessage):
from_line = 'From ' + message.get_from()
elif isinstance(message, email.message.Message):
from_line = message.get_unixfrom() # May be None.
if from_line is None:
from_line = 'From MAILER-DAEMON %s' % time.asctime(time.gmtime())
start = self._file.tell()
self._file.write(from_line + os.linesep)
self._dump_message(message, self._file, self._mangle_from_)
stop = self._file.tell()
return (start, stop)
class mbox(_mboxMMDF):
"""A classic mbox mailbox."""
_mangle_from_ = True
def __init__(self, path, factory=None, create=True):
"""Initialize an mbox mailbox."""
self._message_factory = mboxMessage
_mboxMMDF.__init__(self, path, factory, create)
def _pre_message_hook(self, f):
"""Called before writing each message to file f."""
if f.tell() != 0:
f.write(os.linesep)
def _generate_toc(self):
"""Generate key-to-(start, stop) table of contents."""
starts, stops = [], []
self._file.seek(0)
while True:
line_pos = self._file.tell()
line = self._file.readline()
if line.startswith('From '):
if len(stops) < len(starts):
stops.append(line_pos - len(os.linesep))
starts.append(line_pos)
elif line == '':
stops.append(line_pos)
break
self._toc = dict(enumerate(zip(starts, stops)))
self._next_key = len(self._toc)
self._file_length = self._file.tell()
class MMDF(_mboxMMDF):
"""An MMDF mailbox."""
def __init__(self, path, factory=None, create=True):
"""Initialize an MMDF mailbox."""
self._message_factory = MMDFMessage
_mboxMMDF.__init__(self, path, factory, create)
def _pre_message_hook(self, f):
"""Called before writing each message to file f."""
f.write('\001\001\001\001' + os.linesep)
def _post_message_hook(self, f):
"""Called after writing each message to file f."""
f.write(os.linesep + '\001\001\001\001' + os.linesep)
def _generate_toc(self):
"""Generate key-to-(start, stop) table of contents."""
starts, stops = [], []
self._file.seek(0)
next_pos = 0
while True:
line_pos = next_pos
line = self._file.readline()
next_pos = self._file.tell()
if line.startswith('\001\001\001\001' + os.linesep):
starts.append(next_pos)
while True:
line_pos = next_pos
line = self._file.readline()
next_pos = self._file.tell()
if line == '\001\001\001\001' + os.linesep:
stops.append(line_pos - len(os.linesep))
break
elif line == '':
stops.append(line_pos)
break
elif line == '':
break
self._toc = dict(enumerate(zip(starts, stops)))
self._next_key = len(self._toc)
self._file.seek(0, 2)
self._file_length = self._file.tell()
class MH(Mailbox):
"""An MH mailbox."""
def __init__(self, path, factory=None, create=True):
"""Initialize an MH instance."""
Mailbox.__init__(self, path, factory, create)
if not os.path.exists(self._path):
if create:
os.mkdir(self._path, 0700)
os.close(os.open(os.path.join(self._path, '.mh_sequences'),
os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0600))
else:
raise NoSuchMailboxError(self._path)
self._locked = False
def add(self, message):
"""Add message and return assigned key."""
keys = self.keys()
if len(keys) == 0:
new_key = 1
else:
new_key = max(keys) + 1
new_path = os.path.join(self._path, str(new_key))
f = _create_carefully(new_path)
closed = False
try:
if self._locked:
_lock_file(f)
try:
try:
self._dump_message(message, f)
except BaseException:
# Unlock and close so it can be deleted on Windows
if self._locked:
_unlock_file(f)
_sync_close(f)
closed = True
os.remove(new_path)
raise
if isinstance(message, MHMessage):
self._dump_sequences(message, new_key)
finally:
if self._locked:
_unlock_file(f)
finally:
if not closed:
_sync_close(f)
return new_key
def remove(self, key):
"""Remove the keyed message; raise KeyError if it doesn't exist."""
path = os.path.join(self._path, str(key))
try:
f = open(path, 'rb+')
except IOError, e:
if e.errno == errno.ENOENT:
raise KeyError('No message with key: %s' % key)
else:
raise
else:
f.close()
os.remove(path)
def __setitem__(self, key, message):
"""Replace the keyed message; raise KeyError if it doesn't exist."""
path = os.path.join(self._path, str(key))
try:
f = open(path, 'rb+')
except IOError, e:
if e.errno == errno.ENOENT:
raise KeyError('No message with key: %s' % key)
else:
raise
try:
if self._locked:
_lock_file(f)
try:
os.close(os.open(path, os.O_WRONLY | os.O_TRUNC))
self._dump_message(message, f)
if isinstance(message, MHMessage):
self._dump_sequences(message, key)
finally:
if self._locked:
_unlock_file(f)
finally:
_sync_close(f)
def get_message(self, key):
"""Return a Message representation or raise a KeyError."""
try:
if self._locked:
f = open(os.path.join(self._path, str(key)), 'r+')
else:
f = open(os.path.join(self._path, str(key)), 'r')
except IOError, e:
if e.errno == errno.ENOENT:
raise KeyError('No message with key: %s' % key)
else:
raise
try:
if self._locked:
_lock_file(f)
try:
msg = MHMessage(f)
finally:
if self._locked:
_unlock_file(f)
finally:
f.close()
for name, key_list in self.get_sequences().iteritems():
if key in key_list:
msg.add_sequence(name)
return msg
def get_string(self, key):
"""Return a string representation or raise a KeyError."""
try:
if self._locked:
f = open(os.path.join(self._path, str(key)), 'r+')
else:
f = open(os.path.join(self._path, str(key)), 'r')
except IOError, e:
if e.errno == errno.ENOENT:
raise KeyError('No message with key: %s' % key)
else:
raise
try:
if self._locked:
_lock_file(f)
try:
return f.read()
finally:
if self._locked:
_unlock_file(f)
finally:
f.close()
def get_file(self, key):
"""Return a file-like representation or raise a KeyError."""
try:
f = open(os.path.join(self._path, str(key)), 'rb')
except IOError, e:
if e.errno == errno.ENOENT:
raise KeyError('No message with key: %s' % key)
else:
raise
return _ProxyFile(f)
def iterkeys(self):
"""Return an iterator over keys."""
return iter(sorted(int(entry) for entry in os.listdir(self._path)
if entry.isdigit()))
def has_key(self, key):
"""Return True if the keyed message exists, False otherwise."""
return os.path.exists(os.path.join(self._path, str(key)))
def __len__(self):
"""Return a count of messages in the mailbox."""
return len(list(self.iterkeys()))
def lock(self):
"""Lock the mailbox."""
if not self._locked:
self._file = open(os.path.join(self._path, '.mh_sequences'), 'rb+')
_lock_file(self._file)
self._locked = True
def unlock(self):
"""Unlock the mailbox if it is locked."""
if self._locked:
_unlock_file(self._file)
_sync_close(self._file)
del self._file
self._locked = False
def flush(self):
"""Write any pending changes to the disk."""
return
def close(self):
"""Flush and close the mailbox."""
if self._locked:
self.unlock()
def list_folders(self):
"""Return a list of folder names."""
result = []
for entry in os.listdir(self._path):
if os.path.isdir(os.path.join(self._path, entry)):
result.append(entry)
return result
def get_folder(self, folder):
"""Return an MH instance for the named folder."""
return MH(os.path.join(self._path, folder),
factory=self._factory, create=False)
def add_folder(self, folder):
"""Create a folder and return an MH instance representing it."""
return MH(os.path.join(self._path, folder),
factory=self._factory)
def remove_folder(self, folder):
"""Delete the named folder, which must be empty."""
path = os.path.join(self._path, folder)
entries = os.listdir(path)
if entries == ['.mh_sequences']:
os.remove(os.path.join(path, '.mh_sequences'))
elif entries == []:
pass
else:
raise NotEmptyError('Folder not empty: %s' % self._path)
os.rmdir(path)
def get_sequences(self):
"""Return a name-to-key-list dictionary to define each sequence."""
results = {}
f = open(os.path.join(self._path, '.mh_sequences'), 'r')
try:
all_keys = set(self.keys())
for line in f:
try:
name, contents = line.split(':')
keys = set()
for spec in contents.split():
if spec.isdigit():
keys.add(int(spec))
else:
start, stop = (int(x) for x in spec.split('-'))
keys.update(range(start, stop + 1))
results[name] = [key for key in sorted(keys) \
if key in all_keys]
if len(results[name]) == 0:
del results[name]
except ValueError:
raise FormatError('Invalid sequence specification: %s' %
line.rstrip())
finally:
f.close()
return results
def set_sequences(self, sequences):
"""Set sequences using the given name-to-key-list dictionary."""
f = open(os.path.join(self._path, '.mh_sequences'), 'r+')
try:
os.close(os.open(f.name, os.O_WRONLY | os.O_TRUNC))
for name, keys in sequences.iteritems():
if len(keys) == 0:
continue
f.write('%s:' % name)
prev = None
completing = False
for key in sorted(set(keys)):
if key - 1 == prev:
if not completing:
completing = True
f.write('-')
elif completing:
completing = False
f.write('%s %s' % (prev, key))
else:
f.write(' %s' % key)
prev = key
if completing:
f.write(str(prev) + '\n')
else:
f.write('\n')
finally:
_sync_close(f)
def pack(self):
"""Re-name messages to eliminate numbering gaps. Invalidates keys."""
sequences = self.get_sequences()
prev = 0
changes = []
for key in self.iterkeys():
if key - 1 != prev:
changes.append((key, prev + 1))
if hasattr(os, 'link'):
os.link(os.path.join(self._path, str(key)),
os.path.join(self._path, str(prev + 1)))
os.unlink(os.path.join(self._path, str(key)))
else:
os.rename(os.path.join(self._path, str(key)),
os.path.join(self._path, str(prev + 1)))
prev += 1
self._next_key = prev + 1
if len(changes) == 0:
return
for name, key_list in sequences.items():
for old, new in changes:
if old in key_list:
key_list[key_list.index(old)] = new
self.set_sequences(sequences)
def _dump_sequences(self, message, key):
"""Inspect a new MHMessage and update sequences appropriately."""
pending_sequences = message.get_sequences()
all_sequences = self.get_sequences()
for name, key_list in all_sequences.iteritems():
if name in pending_sequences:
key_list.append(key)
elif key in key_list:
del key_list[key_list.index(key)]
for sequence in pending_sequences:
if sequence not in all_sequences:
all_sequences[sequence] = [key]
self.set_sequences(all_sequences)
class Babyl(_singlefileMailbox):
"""An Rmail-style Babyl mailbox."""
_special_labels = frozenset(('unseen', 'deleted', 'filed', 'answered',
'forwarded', 'edited', 'resent'))
def __init__(self, path, factory=None, create=True):
"""Initialize a Babyl mailbox."""
_singlefileMailbox.__init__(self, path, factory, create)
self._labels = {}
def add(self, message):
"""Add message and return assigned key."""
key = _singlefileMailbox.add(self, message)
if isinstance(message, BabylMessage):
self._labels[key] = message.get_labels()
return key
def remove(self, key):
"""Remove the keyed message; raise KeyError if it doesn't exist."""
_singlefileMailbox.remove(self, key)
if key in self._labels:
del self._labels[key]
def __setitem__(self, key, message):
"""Replace the keyed message; raise KeyError if it doesn't exist."""
_singlefileMailbox.__setitem__(self, key, message)
if isinstance(message, BabylMessage):
self._labels[key] = message.get_labels()
def get_message(self, key):
"""Return a Message representation or raise a KeyError."""
start, stop = self._lookup(key)
self._file.seek(start)
self._file.readline() # Skip '1,' line specifying labels.
original_headers = StringIO.StringIO()
while True:
line = self._file.readline()
if line == '*** EOOH ***' + os.linesep or line == '':
break
original_headers.write(line.replace(os.linesep, '\n'))
visible_headers = StringIO.StringIO()
while True:
line = self._file.readline()
if line == os.linesep or line == '':
break
visible_headers.write(line.replace(os.linesep, '\n'))
body = self._file.read(stop - self._file.tell()).replace(os.linesep,
'\n')
msg = BabylMessage(original_headers.getvalue() + body)
msg.set_visible(visible_headers.getvalue())
if key in self._labels:
msg.set_labels(self._labels[key])
return msg
def get_string(self, key):
"""Return a string representation or raise a KeyError."""
start, stop = self._lookup(key)
self._file.seek(start)
self._file.readline() # Skip '1,' line specifying labels.
original_headers = StringIO.StringIO()
while True:
line = self._file.readline()
if line == '*** EOOH ***' + os.linesep or line == '':
break
original_headers.write(line.replace(os.linesep, '\n'))
while True:
line = self._file.readline()
if line == os.linesep or line == '':
break
return original_headers.getvalue() + \
self._file.read(stop - self._file.tell()).replace(os.linesep,
'\n')
def get_file(self, key):
"""Return a file-like representation or raise a KeyError."""
return StringIO.StringIO(self.get_string(key).replace('\n',
os.linesep))
def get_labels(self):
"""Return a list of user-defined labels in the mailbox."""
self._lookup()
labels = set()
for label_list in self._labels.values():
labels.update(label_list)
labels.difference_update(self._special_labels)
return list(labels)
def _generate_toc(self):
"""Generate key-to-(start, stop) table of contents."""
starts, stops = [], []
self._file.seek(0)
next_pos = 0
label_lists = []
while True:
line_pos = next_pos
line = self._file.readline()
next_pos = self._file.tell()
if line == '\037\014' + os.linesep:
if len(stops) < len(starts):
stops.append(line_pos - len(os.linesep))
starts.append(next_pos)
labels = [label.strip() for label
in self._file.readline()[1:].split(',')
if label.strip() != '']
label_lists.append(labels)
elif line == '\037' or line == '\037' + os.linesep:
if len(stops) < len(starts):
stops.append(line_pos - len(os.linesep))
elif line == '':
stops.append(line_pos - len(os.linesep))
break
self._toc = dict(enumerate(zip(starts, stops)))
self._labels = dict(enumerate(label_lists))
self._next_key = len(self._toc)
self._file.seek(0, 2)
self._file_length = self._file.tell()
def _pre_mailbox_hook(self, f):
"""Called before writing the mailbox to file f."""
f.write('BABYL OPTIONS:%sVersion: 5%sLabels:%s%s\037' %
(os.linesep, os.linesep, ','.join(self.get_labels()),
os.linesep))
def _pre_message_hook(self, f):
"""Called before writing each message to file f."""
f.write('\014' + os.linesep)
def _post_message_hook(self, f):
"""Called after writing each message to file f."""
f.write(os.linesep + '\037')
def _install_message(self, message):
"""Write message contents and return (start, stop)."""
start = self._file.tell()
if isinstance(message, BabylMessage):
special_labels = []
labels = []
for label in message.get_labels():
if label in self._special_labels:
special_labels.append(label)
else:
labels.append(label)
self._file.write('1')
for label in special_labels:
self._file.write(', ' + label)
self._file.write(',,')
for label in labels:
self._file.write(' ' + label + ',')
self._file.write(os.linesep)
else:
self._file.write('1,,' + os.linesep)
if isinstance(message, email.message.Message):
orig_buffer = StringIO.StringIO()
orig_generator = email.generator.Generator(orig_buffer, False, 0)
orig_generator.flatten(message)
orig_buffer.seek(0)
while True:
line = orig_buffer.readline()
self._file.write(line.replace('\n', os.linesep))
if line == '\n' or line == '':
break
self._file.write('*** EOOH ***' + os.linesep)
if isinstance(message, BabylMessage):
vis_buffer = StringIO.StringIO()
vis_generator = email.generator.Generator(vis_buffer, False, 0)
vis_generator.flatten(message.get_visible())
while True:
line = vis_buffer.readline()
self._file.write(line.replace('\n', os.linesep))
if line == '\n' or line == '':
break
else:
orig_buffer.seek(0)
while True:
line = orig_buffer.readline()
self._file.write(line.replace('\n', os.linesep))
if line == '\n' or line == '':
break
while True:
buffer = orig_buffer.read(4096) # Buffer size is arbitrary.
if buffer == '':
break
self._file.write(buffer.replace('\n', os.linesep))
elif isinstance(message, str):
body_start = message.find('\n\n') + 2
if body_start - 2 != -1:
self._file.write(message[:body_start].replace('\n',
os.linesep))
self._file.write('*** EOOH ***' + os.linesep)
self._file.write(message[:body_start].replace('\n',
os.linesep))
self._file.write(message[body_start:].replace('\n',
os.linesep))
else:
self._file.write('*** EOOH ***' + os.linesep + os.linesep)
self._file.write(message.replace('\n', os.linesep))
elif hasattr(message, 'readline'):
original_pos = message.tell()
first_pass = True
while True:
line = message.readline()
self._file.write(line.replace('\n', os.linesep))
if line == '\n' or line == '':
self._file.write('*** EOOH ***' + os.linesep)
if first_pass:
first_pass = False
message.seek(original_pos)
else:
break
while True:
buffer = message.read(4096) # Buffer size is arbitrary.
if buffer == '':
break
self._file.write(buffer.replace('\n', os.linesep))
else:
raise TypeError('Invalid message type: %s' % type(message))
stop = self._file.tell()
return (start, stop)
class Message(email.message.Message):
"""Message with mailbox-format-specific properties."""
def __init__(self, message=None):
"""Initialize a Message instance."""
if isinstance(message, email.message.Message):
self._become_message(copy.deepcopy(message))
if isinstance(message, Message):
message._explain_to(self)
elif isinstance(message, str):
self._become_message(email.message_from_string(message))
elif hasattr(message, "read"):
self._become_message(email.message_from_file(message))
elif message is None:
email.message.Message.__init__(self)
else:
raise TypeError('Invalid message type: %s' % type(message))
def _become_message(self, message):
"""Assume the non-format-specific state of message."""
for name in ('_headers', '_unixfrom', '_payload', '_charset',
'preamble', 'epilogue', 'defects', '_default_type'):
self.__dict__[name] = message.__dict__[name]
def _explain_to(self, message):
"""Copy format-specific state to message insofar as possible."""
if isinstance(message, Message):
return # There's nothing format-specific to explain.
else:
raise TypeError('Cannot convert to specified type')
class MaildirMessage(Message):
"""Message with Maildir-specific properties."""
def __init__(self, message=None):
"""Initialize a MaildirMessage instance."""
self._subdir = 'new'
self._info = ''
self._date = time.time()
Message.__init__(self, message)
def get_subdir(self):
"""Return 'new' or 'cur'."""
return self._subdir
def set_subdir(self, subdir):
"""Set subdir to 'new' or 'cur'."""
if subdir == 'new' or subdir == 'cur':
self._subdir = subdir
else:
raise ValueError("subdir must be 'new' or 'cur': %s" % subdir)
def get_flags(self):
"""Return as a string the flags that are set."""
if self._info.startswith('2,'):
return self._info[2:]
else:
return ''
def set_flags(self, flags):
"""Set the given flags and unset all others."""
self._info = '2,' + ''.join(sorted(flags))
def add_flag(self, flag):
"""Set the given flag(s) without changing others."""
self.set_flags(''.join(set(self.get_flags()) | set(flag)))
def remove_flag(self, flag):
"""Unset the given string flag(s) without changing others."""
if self.get_flags() != '':
self.set_flags(''.join(set(self.get_flags()) - set(flag)))
def get_date(self):
"""Return delivery date of message, in seconds since the epoch."""
return self._date
def set_date(self, date):
"""Set delivery date of message, in seconds since the epoch."""
try:
self._date = float(date)
except ValueError:
raise TypeError("can't convert to float: %s" % date)
def get_info(self):
"""Get the message's "info" as a string."""
return self._info
def set_info(self, info):
"""Set the message's "info" string."""
if isinstance(info, str):
self._info = info
else:
raise TypeError('info must be a string: %s' % type(info))
def _explain_to(self, message):
"""Copy Maildir-specific state to message insofar as possible."""
if isinstance(message, MaildirMessage):
message.set_flags(self.get_flags())
message.set_subdir(self.get_subdir())
message.set_date(self.get_date())
elif isinstance(message, _mboxMMDFMessage):
flags = set(self.get_flags())
if 'S' in flags:
message.add_flag('R')
if self.get_subdir() == 'cur':
message.add_flag('O')
if 'T' in flags:
message.add_flag('D')
if 'F' in flags:
message.add_flag('F')
if 'R' in flags:
message.add_flag('A')
message.set_from('MAILER-DAEMON', time.gmtime(self.get_date()))
elif isinstance(message, MHMessage):
flags = set(self.get_flags())
if 'S' not in flags:
message.add_sequence('unseen')
if 'R' in flags:
message.add_sequence('replied')
if 'F' in flags:
message.add_sequence('flagged')
elif isinstance(message, BabylMessage):
flags = set(self.get_flags())
if 'S' not in flags:
message.add_label('unseen')
if 'T' in flags:
message.add_label('deleted')
if 'R' in flags:
message.add_label('answered')
if 'P' in flags:
message.add_label('forwarded')
elif isinstance(message, Message):
pass
else:
raise TypeError('Cannot convert to specified type: %s' %
type(message))
class _mboxMMDFMessage(Message):
"""Message with mbox- or MMDF-specific properties."""
def __init__(self, message=None):
"""Initialize an mboxMMDFMessage instance."""
self.set_from('MAILER-DAEMON', True)
if isinstance(message, email.message.Message):
unixfrom = message.get_unixfrom()
if unixfrom is not None and unixfrom.startswith('From '):
self.set_from(unixfrom[5:])
Message.__init__(self, message)
def get_from(self):
"""Return contents of "From " line."""
return self._from
def set_from(self, from_, time_=None):
"""Set "From " line, formatting and appending time_ if specified."""
if time_ is not None:
if time_ is True:
time_ = time.gmtime()
from_ += ' ' + time.asctime(time_)
self._from = from_
def get_flags(self):
"""Return as a string the flags that are set."""
return self.get('Status', '') + self.get('X-Status', '')
def set_flags(self, flags):
"""Set the given flags and unset all others."""
flags = set(flags)
status_flags, xstatus_flags = '', ''
for flag in ('R', 'O'):
if flag in flags:
status_flags += flag
flags.remove(flag)
for flag in ('D', 'F', 'A'):
if flag in flags:
xstatus_flags += flag
flags.remove(flag)
xstatus_flags += ''.join(sorted(flags))
try:
self.replace_header('Status', status_flags)
except KeyError:
self.add_header('Status', status_flags)
try:
self.replace_header('X-Status', xstatus_flags)
except KeyError:
self.add_header('X-Status', xstatus_flags)
def add_flag(self, flag):
"""Set the given flag(s) without changing others."""
self.set_flags(''.join(set(self.get_flags()) | set(flag)))
def remove_flag(self, flag):
"""Unset the given string flag(s) without changing others."""
if 'Status' in self or 'X-Status' in self:
self.set_flags(''.join(set(self.get_flags()) - set(flag)))
def _explain_to(self, message):
"""Copy mbox- or MMDF-specific state to message insofar as possible."""
if isinstance(message, MaildirMessage):
flags = set(self.get_flags())
if 'O' in flags:
message.set_subdir('cur')
if 'F' in flags:
message.add_flag('F')
if 'A' in flags:
message.add_flag('R')
if 'R' in flags:
message.add_flag('S')
if 'D' in flags:
message.add_flag('T')
del message['status']
del message['x-status']
maybe_date = ' '.join(self.get_from().split()[-5:])
try:
message.set_date(calendar.timegm(time.strptime(maybe_date,
'%a %b %d %H:%M:%S %Y')))
except (ValueError, OverflowError):
pass
elif isinstance(message, _mboxMMDFMessage):
message.set_flags(self.get_flags())
message.set_from(self.get_from())
elif isinstance(message, MHMessage):
flags = set(self.get_flags())
if 'R' not in flags:
message.add_sequence('unseen')
if 'A' in flags:
message.add_sequence('replied')
if 'F' in flags:
message.add_sequence('flagged')
del message['status']
del message['x-status']
elif isinstance(message, BabylMessage):
flags = set(self.get_flags())
if 'R' not in flags:
message.add_label('unseen')
if 'D' in flags:
message.add_label('deleted')
if 'A' in flags:
message.add_label('answered')
del message['status']
del message['x-status']
elif isinstance(message, Message):
pass
else:
raise TypeError('Cannot convert to specified type: %s' %
type(message))
class mboxMessage(_mboxMMDFMessage):
"""Message with mbox-specific properties."""
class MHMessage(Message):
"""Message with MH-specific properties."""
def __init__(self, message=None):
"""Initialize an MHMessage instance."""
self._sequences = []
Message.__init__(self, message)
def get_sequences(self):
"""Return a list of sequences that include the message."""
return self._sequences[:]
def set_sequences(self, sequences):
"""Set the list of sequences that include the message."""
self._sequences = list(sequences)
def add_sequence(self, sequence):
"""Add sequence to list of sequences including the message."""
if isinstance(sequence, str):
if not sequence in self._sequences:
self._sequences.append(sequence)
else:
raise TypeError('sequence must be a string: %s' % type(sequence))
def remove_sequence(self, sequence):
"""Remove sequence from the list of sequences including the message."""
try:
self._sequences.remove(sequence)
except ValueError:
pass
def _explain_to(self, message):
"""Copy MH-specific state to message insofar as possible."""
if isinstance(message, MaildirMessage):
sequences = set(self.get_sequences())
if 'unseen' in sequences:
message.set_subdir('cur')
else:
message.set_subdir('cur')
message.add_flag('S')
if 'flagged' in sequences:
message.add_flag('F')
if 'replied' in sequences:
message.add_flag('R')
elif isinstance(message, _mboxMMDFMessage):
sequences = set(self.get_sequences())
if 'unseen' not in sequences:
message.add_flag('RO')
else:
message.add_flag('O')
if 'flagged' in sequences:
message.add_flag('F')
if 'replied' in sequences:
message.add_flag('A')
elif isinstance(message, MHMessage):
for sequence in self.get_sequences():
message.add_sequence(sequence)
elif isinstance(message, BabylMessage):
sequences = set(self.get_sequences())
if 'unseen' in sequences:
message.add_label('unseen')
if 'replied' in sequences:
message.add_label('answered')
elif isinstance(message, Message):
pass
else:
raise TypeError('Cannot convert to specified type: %s' %
type(message))
class BabylMessage(Message):
"""Message with Babyl-specific properties."""
def __init__(self, message=None):
"""Initialize an BabylMessage instance."""
self._labels = []
self._visible = Message()
Message.__init__(self, message)
def get_labels(self):
"""Return a list of labels on the message."""
return self._labels[:]
def set_labels(self, labels):
"""Set the list of labels on the message."""
self._labels = list(labels)
def add_label(self, label):
"""Add label to list of labels on the message."""
if isinstance(label, str):
if label not in self._labels:
self._labels.append(label)
else:
raise TypeError('label must be a string: %s' % type(label))
def remove_label(self, label):
"""Remove label from the list of labels on the message."""
try:
self._labels.remove(label)
except ValueError:
pass
def get_visible(self):
"""Return a Message representation of visible headers."""
return Message(self._visible)
def set_visible(self, visible):
"""Set the Message representation of visible headers."""
self._visible = Message(visible)
def update_visible(self):
"""Update and/or sensibly generate a set of visible headers."""
for header in self._visible.keys():
if header in self:
self._visible.replace_header(header, self[header])
else:
del self._visible[header]
for header in ('Date', 'From', 'Reply-To', 'To', 'CC', 'Subject'):
if header in self and header not in self._visible:
self._visible[header] = self[header]
def _explain_to(self, message):
"""Copy Babyl-specific state to message insofar as possible."""
if isinstance(message, MaildirMessage):
labels = set(self.get_labels())
if 'unseen' in labels:
message.set_subdir('cur')
else:
message.set_subdir('cur')
message.add_flag('S')
if 'forwarded' in labels or 'resent' in labels:
message.add_flag('P')
if 'answered' in labels:
message.add_flag('R')
if 'deleted' in labels:
message.add_flag('T')
elif isinstance(message, _mboxMMDFMessage):
labels = set(self.get_labels())
if 'unseen' not in labels:
message.add_flag('RO')
else:
message.add_flag('O')
if 'deleted' in labels:
message.add_flag('D')
if 'answered' in labels:
message.add_flag('A')
elif isinstance(message, MHMessage):
labels = set(self.get_labels())
if 'unseen' in labels:
message.add_sequence('unseen')
if 'answered' in labels:
message.add_sequence('replied')
elif isinstance(message, BabylMessage):
message.set_visible(self.get_visible())
for label in self.get_labels():
message.add_label(label)
elif isinstance(message, Message):
pass
else:
raise TypeError('Cannot convert to specified type: %s' %
type(message))
class MMDFMessage(_mboxMMDFMessage):
"""Message with MMDF-specific properties."""
class _ProxyFile:
"""A read-only wrapper of a file."""
def __init__(self, f, pos=None):
"""Initialize a _ProxyFile."""
self._file = f
if pos is None:
self._pos = f.tell()
else:
self._pos = pos
def read(self, size=None):
"""Read bytes."""
return self._read(size, self._file.read)
def readline(self, size=None):
"""Read a line."""
return self._read(size, self._file.readline)
def readlines(self, sizehint=None):
"""Read multiple lines."""
result = []
for line in self:
result.append(line)
if sizehint is not None:
sizehint -= len(line)
if sizehint <= 0:
break
return result
def __iter__(self):
"""Iterate over lines."""
return iter(self.readline, "")
def tell(self):
"""Return the position."""
return self._pos
def seek(self, offset, whence=0):
"""Change position."""
if whence == 1:
self._file.seek(self._pos)
self._file.seek(offset, whence)
self._pos = self._file.tell()
def close(self):
"""Close the file."""
del self._file
def _read(self, size, read_method):
"""Read size bytes using read_method."""
if size is None:
size = -1
self._file.seek(self._pos)
result = read_method(size)
self._pos = self._file.tell()
return result
class _PartialFile(_ProxyFile):
"""A read-only wrapper of part of a file."""
def __init__(self, f, start=None, stop=None):
"""Initialize a _PartialFile."""
_ProxyFile.__init__(self, f, start)
self._start = start
self._stop = stop
def tell(self):
"""Return the position with respect to start."""
return _ProxyFile.tell(self) - self._start
def seek(self, offset, whence=0):
"""Change position, possibly with respect to start or stop."""
if whence == 0:
self._pos = self._start
whence = 1
elif whence == 2:
self._pos = self._stop
whence = 1
_ProxyFile.seek(self, offset, whence)
def _read(self, size, read_method):
"""Read size bytes using read_method, honoring start and stop."""
remaining = self._stop - self._pos
if remaining <= 0:
return ''
if size is None or size < 0 or size > remaining:
size = remaining
return _ProxyFile._read(self, size, read_method)
def _lock_file(f, dotlock=True):
"""Lock file f using lockf and dot locking."""
dotlock_done = False
try:
if fcntl:
try:
fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError, e:
if e.errno in (errno.EAGAIN, errno.EACCES, errno.EROFS):
raise ExternalClashError('lockf: lock unavailable: %s' %
f.name)
else:
raise
if dotlock:
try:
pre_lock = _create_temporary(f.name + '.lock')
pre_lock.close()
except IOError, e:
if e.errno in (errno.EACCES, errno.EROFS):
return # Without write access, just skip dotlocking.
else:
raise
try:
if hasattr(os, 'link'):
os.link(pre_lock.name, f.name + '.lock')
dotlock_done = True
os.unlink(pre_lock.name)
else:
os.rename(pre_lock.name, f.name + '.lock')
dotlock_done = True
except OSError, e:
if e.errno == errno.EEXIST or \
(os.name == 'os2' and e.errno == errno.EACCES):
os.remove(pre_lock.name)
raise ExternalClashError('dot lock unavailable: %s' %
f.name)
else:
raise
except:
if fcntl:
fcntl.lockf(f, fcntl.LOCK_UN)
if dotlock_done:
os.remove(f.name + '.lock')
raise
def _unlock_file(f):
"""Unlock file f using lockf and dot locking."""
if fcntl:
fcntl.lockf(f, fcntl.LOCK_UN)
if os.path.exists(f.name + '.lock'):
os.remove(f.name + '.lock')
def _create_carefully(path):
"""Create a file if it doesn't exist and open for reading and writing."""
fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_RDWR, 0666)
try:
return open(path, 'rb+')
finally:
os.close(fd)
def _create_temporary(path):
"""Create a temp file based on path and open for reading and writing."""
return _create_carefully('%s.%s.%s.%s' % (path, int(time.time()),
socket.gethostname(),
os.getpid()))
def _sync_flush(f):
"""Ensure changes to file f are physically on disk."""
f.flush()
if hasattr(os, 'fsync'):
os.fsync(f.fileno())
def _sync_close(f):
"""Close file f, ensuring all changes are physically on disk."""
_sync_flush(f)
f.close()
## Start: classes from the original module (for backward compatibility).
# Note that the Maildir class, whose name is unchanged, itself offers a next()
# method for backward compatibility.
class _Mailbox:
def __init__(self, fp, factory=rfc822.Message):
self.fp = fp
self.seekp = 0
self.factory = factory
def __iter__(self):
return iter(self.next, None)
def next(self):
while 1:
self.fp.seek(self.seekp)
try:
self._search_start()
except EOFError:
self.seekp = self.fp.tell()
return None
start = self.fp.tell()
self._search_end()
self.seekp = stop = self.fp.tell()
if start != stop:
break
return self.factory(_PartialFile(self.fp, start, stop))
# Recommended to use PortableUnixMailbox instead!
class UnixMailbox(_Mailbox):
def _search_start(self):
while 1:
pos = self.fp.tell()
line = self.fp.readline()
if not line:
raise EOFError
if line[:5] == 'From ' and self._isrealfromline(line):
self.fp.seek(pos)
return
def _search_end(self):
self.fp.readline() # Throw away header line
while 1:
pos = self.fp.tell()
line = self.fp.readline()
if not line:
return
if line[:5] == 'From ' and self._isrealfromline(line):
self.fp.seek(pos)
return
# An overridable mechanism to test for From-line-ness. You can either
# specify a different regular expression or define a whole new
# _isrealfromline() method. Note that this only gets called for lines
# starting with the 5 characters "From ".
#
# BAW: According to
#http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html
# the only portable, reliable way to find message delimiters in a BSD (i.e
# Unix mailbox) style folder is to search for "\n\nFrom .*\n", or at the
# beginning of the file, "^From .*\n". While _fromlinepattern below seems
# like a good idea, in practice, there are too many variations for more
# strict parsing of the line to be completely accurate.
#
# _strict_isrealfromline() is the old version which tries to do stricter
# parsing of the From_ line. _portable_isrealfromline() simply returns
# true, since it's never called if the line doesn't already start with
# "From ".
#
# This algorithm, and the way it interacts with _search_start() and
# _search_end() may not be completely correct, because it doesn't check
# that the two characters preceding "From " are \n\n or the beginning of
# the file. Fixing this would require a more extensive rewrite than is
# necessary. For convenience, we've added a PortableUnixMailbox class
# which does no checking of the format of the 'From' line.
_fromlinepattern = (r"From \s*[^\s]+\s+\w\w\w\s+\w\w\w\s+\d?\d\s+"
r"\d?\d:\d\d(:\d\d)?(\s+[^\s]+)?\s+\d\d\d\d\s*"
r"[^\s]*\s*"
"$")
_regexp = None
def _strict_isrealfromline(self, line):
if not self._regexp:
import re
self._regexp = re.compile(self._fromlinepattern)
return self._regexp.match(line)
def _portable_isrealfromline(self, line):
return True
_isrealfromline = _strict_isrealfromline
class PortableUnixMailbox(UnixMailbox):
_isrealfromline = UnixMailbox._portable_isrealfromline
class MmdfMailbox(_Mailbox):
def _search_start(self):
while 1:
line = self.fp.readline()
if not line:
raise EOFError
if line[:5] == '\001\001\001\001\n':
return
def _search_end(self):
while 1:
pos = self.fp.tell()
line = self.fp.readline()
if not line:
return
if line == '\001\001\001\001\n':
self.fp.seek(pos)
return
class MHMailbox:
def __init__(self, dirname, factory=rfc822.Message):
import re
pat = re.compile('^[1-9][0-9]*$')
self.dirname = dirname
# the three following lines could be combined into:
# list = map(long, filter(pat.match, os.listdir(self.dirname)))
list = os.listdir(self.dirname)
list = filter(pat.match, list)
list = map(long, list)
list.sort()
# This only works in Python 1.6 or later;
# before that str() added 'L':
self.boxes = map(str, list)
self.boxes.reverse()
self.factory = factory
def __iter__(self):
return iter(self.next, None)
def next(self):
if not self.boxes:
return None
fn = self.boxes.pop()
fp = open(os.path.join(self.dirname, fn))
msg = self.factory(fp)
try:
msg._mh_msgno = fn
except (AttributeError, TypeError):
pass
return msg
class BabylMailbox(_Mailbox):
def _search_start(self):
while 1:
line = self.fp.readline()
if not line:
raise EOFError
if line == '*** EOOH ***\n':
return
def _search_end(self):
while 1:
pos = self.fp.tell()
line = self.fp.readline()
if not line:
return
if line == '\037\014\n' or line == '\037':
self.fp.seek(pos)
return
## End: classes from the original module (for backward compatibility).
class Error(Exception):
"""Raised for module-specific errors."""
class NoSuchMailboxError(Error):
"""The specified mailbox does not exist and won't be created."""
class NotEmptyError(Error):
"""The specified mailbox is not empty and deletion was requested."""
class ExternalClashError(Error):
"""Another process caused an action to fail."""
class FormatError(Error):
"""A file appears to have an invalid format."""
|
gpl-3.0
|
[
3168,
1182,
2647,
15,
1393,
15,
1813,
2366,
199,
199,
624,
3284,
15,
952,
2291,
367,
18027,
694,
12,
333,
1977,
12,
603,
40,
12,
699,
17585,
76,
12,
436,
603,
45,
3888,
6016,
12922,
1041,
199,
199,
3,
8144,
367,
11462,
402,
892,
17470,
9180,
26,
199,
3,
199,
3,
31859,
370,
289,
5186,
342,
4493,
370,
4543,
2544,
11261,
282,
6042,
570,
199,
3,
503,
8152,
687,
282,
8976,
342,
1083,
14,
221,
1666,
3423,
485,
5186,
63,
4939,
342,
436,
199,
3,
485,
5186,
63,
1600,
1252,
199,
199,
646,
984,
199,
646,
747,
199,
646,
900,
199,
646,
11234,
199,
646,
2838,
199,
646,
7554,
199,
646,
1331,
199,
646,
3031,
199,
646,
3031,
14,
1188,
199,
646,
3031,
14,
4679,
199,
646,
5228,
199,
893,
26,
272,
340,
984,
14,
3246,
508,
283,
736,
18,
5633,
88,
356,
267,
327,
4403,
15,
18,
662,
17401,
12871,
342,
440,
282,
271,
392,
323,
267,
746,
3545,
272,
492,
12871,
199,
2590,
3545,
26,
272,
12871,
275,
488,
199,
199,
646,
3598,
199,
1045,
3598,
14,
9341,
63,
5451,
837,
272,
340,
984,
14,
647,
19,
829,
1791,
26,
267,
3598,
14,
23945,
480,
4247,
401,
298,
2795,
8973,
10228,
965,
2757,
4829,
401,
1816,
13413,
9,
272,
492,
18158,
10228,
199,
199,
363,
452,
363,
275,
359,
283,
13681,
1977,
297,
283,
13681,
694,
297,
283,
27201,
297,
283,
30668,
297,
283,
34,
17585,
76,
297,
283,
3218,
3888,
297,
288,
283,
2209,
297,
283,
13681,
694,
2209,
297,
283,
27201,
2209,
297,
283,
30668,
2209,
297,
288,
283,
34,
17585,
76,
2209,
297,
283,
3218,
3888,
2209,
297,
283,
21607,
13681,
1977,
297,
288,
283,
4313,
461,
21607,
13681,
1977,
297,
283,
45,
1064,
70,
13681,
1977,
297,
283,
30668,
13681,
1977,
297,
283,
34,
17585,
76,
13681,
1977,
7,
1622,
199,
199,
533,
18027,
1977,
26,
272,
408,
33,
1572,
402,
3788,
315,
282,
6770,
4192,
1041,
339,
347,
636,
826,
721,
277,
12,
931,
12,
6434,
29,
403,
12,
1218,
29,
549,
304,
267,
408,
9345,
282,
18027,
1977,
1256,
1041,
267,
291,
423,
515,
275,
747,
14,
515,
14,
4832,
8,
736,
14,
515,
14,
12131,
8,
515,
430,
267,
291,
423,
3702,
275,
6434,
339,
347,
1050,
8,
277,
12,
1245,
304,
267,
408,
1123,
1245,
436,
372,
7943,
790,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
2813,
8,
277,
12,
790,
304,
267,
408,
5587,
314,
19272,
1245,
27,
746,
4067,
340,
652,
3181,
1133,
2187,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
636,
13228,
721,
277,
12,
790,
304,
267,
291,
14,
2168,
8,
498,
9,
339,
347,
16895,
8,
277,
12,
790,
304,
267,
408,
3917,
314,
19272,
1245,
3495,
12,
2813,
652,
1041,
267,
862,
26,
288,
291,
14,
2168,
8,
498,
9,
267,
871,
4067,
26,
288,
986,
339,
347,
636,
8617,
721,
277,
12,
790,
12,
1245,
304,
267,
408,
11328,
314,
19272,
1245,
27,
746,
4067,
340,
652,
3181,
1133,
2187,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
664,
8,
277,
12,
790,
12,
849,
29,
403,
304,
267,
408,
1767,
314,
19272,
1245,
12,
503,
849,
340,
652,
3181,
1133,
2187,
1041,
267,
862,
26,
288,
372,
291,
855,
6095,
721,
498,
9,
267,
871,
4067,
26,
288,
372,
849,
339,
347,
636,
6095,
721,
277,
12,
790,
304,
267,
408,
1767,
314,
19272,
1245,
27,
746,
4067,
340,
652,
3181,
1133,
2187,
1041,
267,
340,
440,
291,
423,
3702,
26,
288,
372,
291,
14,
362,
63,
1188,
8,
498,
9,
267,
587,
26,
288,
372,
291,
423,
3702,
8,
277,
14,
362,
63,
493,
8,
498,
430,
339,
347,
664,
63,
1188,
8,
277,
12,
790,
304,
267,
408,
1767,
282,
6430,
6025,
503,
746,
282,
4067,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
664,
63,
875,
8,
277,
12,
790,
304,
267,
408,
1767,
282,
1059,
6025,
503,
746,
282,
4067,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
664,
63,
493,
8,
277,
12,
790,
304,
267,
408,
1767,
282,
570,
13,
2930,
6025,
503,
746,
282,
4067,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
25706,
8,
277,
304,
267,
408,
1767,
376,
6122,
1806,
2883,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
2883,
8,
277,
304,
267,
408,
1767,
282,
769,
402,
2883,
1041,
267,
372,
769,
8,
277,
14,
16007,
1012,
339,
347,
24451,
8,
277,
304,
267,
408,
1767,
376,
6122,
1806,
1006,
3788,
1041,
267,
367,
790,
315,
291,
14,
16007,
837,
288,
862,
26,
355,
574,
275,
291,
59,
498,
61,
288,
871,
4067,
26,
355,
1980,
288,
1995,
574,
339,
347,
636,
1661,
721,
277,
304,
267,
372,
291,
14,
13012,
342,
339,
347,
1338,
8,
277,
304,
267,
408,
1767,
282,
769,
402,
3788,
14,
15825,
315,
724,
3398,
1041,
267,
372,
769,
8,
277,
14,
13012,
1012,
339,
347,
10849,
8,
277,
304,
267,
408,
1767,
376,
6122,
1806,
334,
498,
12,
1245,
9,
6346,
1041,
267,
367,
790,
315,
291,
14,
16007,
837,
288,
862,
26,
355,
574,
275,
291,
59,
498,
61,
288,
871,
4067,
26,
355,
1980,
288,
1995,
334,
498,
12,
574,
9,
339,
347,
2974,
8,
277,
304,
267,
408,
1767,
282,
769,
402,
334,
498,
12,
1245,
9,
6346,
14,
15825,
315,
724,
3398,
1041,
267,
372,
769,
8,
277,
14,
4611,
1012,
339,
347,
965,
63,
498,
8,
277,
12,
790,
304,
267,
408,
1767,
715,
340,
314,
19272,
1245,
3495,
12,
756,
4257,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
636,
6134,
721,
277,
12,
790,
304,
267,
372,
291,
14,
1989,
63,
498,
8,
498,
9,
339,
347,
636,
552,
721,
277,
304,
267,
408,
1767,
282,
2338,
402,
3788,
315,
314,
17470,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
5436,
8,
277,
304,
267
] |
[
1182,
2647,
15,
1393,
15,
1813,
2366,
199,
199,
624,
3284,
15,
952,
2291,
367,
18027,
694,
12,
333,
1977,
12,
603,
40,
12,
699,
17585,
76,
12,
436,
603,
45,
3888,
6016,
12922,
1041,
199,
199,
3,
8144,
367,
11462,
402,
892,
17470,
9180,
26,
199,
3,
199,
3,
31859,
370,
289,
5186,
342,
4493,
370,
4543,
2544,
11261,
282,
6042,
570,
199,
3,
503,
8152,
687,
282,
8976,
342,
1083,
14,
221,
1666,
3423,
485,
5186,
63,
4939,
342,
436,
199,
3,
485,
5186,
63,
1600,
1252,
199,
199,
646,
984,
199,
646,
747,
199,
646,
900,
199,
646,
11234,
199,
646,
2838,
199,
646,
7554,
199,
646,
1331,
199,
646,
3031,
199,
646,
3031,
14,
1188,
199,
646,
3031,
14,
4679,
199,
646,
5228,
199,
893,
26,
272,
340,
984,
14,
3246,
508,
283,
736,
18,
5633,
88,
356,
267,
327,
4403,
15,
18,
662,
17401,
12871,
342,
440,
282,
271,
392,
323,
267,
746,
3545,
272,
492,
12871,
199,
2590,
3545,
26,
272,
12871,
275,
488,
199,
199,
646,
3598,
199,
1045,
3598,
14,
9341,
63,
5451,
837,
272,
340,
984,
14,
647,
19,
829,
1791,
26,
267,
3598,
14,
23945,
480,
4247,
401,
298,
2795,
8973,
10228,
965,
2757,
4829,
401,
1816,
13413,
9,
272,
492,
18158,
10228,
199,
199,
363,
452,
363,
275,
359,
283,
13681,
1977,
297,
283,
13681,
694,
297,
283,
27201,
297,
283,
30668,
297,
283,
34,
17585,
76,
297,
283,
3218,
3888,
297,
288,
283,
2209,
297,
283,
13681,
694,
2209,
297,
283,
27201,
2209,
297,
283,
30668,
2209,
297,
288,
283,
34,
17585,
76,
2209,
297,
283,
3218,
3888,
2209,
297,
283,
21607,
13681,
1977,
297,
288,
283,
4313,
461,
21607,
13681,
1977,
297,
283,
45,
1064,
70,
13681,
1977,
297,
283,
30668,
13681,
1977,
297,
283,
34,
17585,
76,
13681,
1977,
7,
1622,
199,
199,
533,
18027,
1977,
26,
272,
408,
33,
1572,
402,
3788,
315,
282,
6770,
4192,
1041,
339,
347,
636,
826,
721,
277,
12,
931,
12,
6434,
29,
403,
12,
1218,
29,
549,
304,
267,
408,
9345,
282,
18027,
1977,
1256,
1041,
267,
291,
423,
515,
275,
747,
14,
515,
14,
4832,
8,
736,
14,
515,
14,
12131,
8,
515,
430,
267,
291,
423,
3702,
275,
6434,
339,
347,
1050,
8,
277,
12,
1245,
304,
267,
408,
1123,
1245,
436,
372,
7943,
790,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
2813,
8,
277,
12,
790,
304,
267,
408,
5587,
314,
19272,
1245,
27,
746,
4067,
340,
652,
3181,
1133,
2187,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
636,
13228,
721,
277,
12,
790,
304,
267,
291,
14,
2168,
8,
498,
9,
339,
347,
16895,
8,
277,
12,
790,
304,
267,
408,
3917,
314,
19272,
1245,
3495,
12,
2813,
652,
1041,
267,
862,
26,
288,
291,
14,
2168,
8,
498,
9,
267,
871,
4067,
26,
288,
986,
339,
347,
636,
8617,
721,
277,
12,
790,
12,
1245,
304,
267,
408,
11328,
314,
19272,
1245,
27,
746,
4067,
340,
652,
3181,
1133,
2187,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
664,
8,
277,
12,
790,
12,
849,
29,
403,
304,
267,
408,
1767,
314,
19272,
1245,
12,
503,
849,
340,
652,
3181,
1133,
2187,
1041,
267,
862,
26,
288,
372,
291,
855,
6095,
721,
498,
9,
267,
871,
4067,
26,
288,
372,
849,
339,
347,
636,
6095,
721,
277,
12,
790,
304,
267,
408,
1767,
314,
19272,
1245,
27,
746,
4067,
340,
652,
3181,
1133,
2187,
1041,
267,
340,
440,
291,
423,
3702,
26,
288,
372,
291,
14,
362,
63,
1188,
8,
498,
9,
267,
587,
26,
288,
372,
291,
423,
3702,
8,
277,
14,
362,
63,
493,
8,
498,
430,
339,
347,
664,
63,
1188,
8,
277,
12,
790,
304,
267,
408,
1767,
282,
6430,
6025,
503,
746,
282,
4067,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
664,
63,
875,
8,
277,
12,
790,
304,
267,
408,
1767,
282,
1059,
6025,
503,
746,
282,
4067,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
664,
63,
493,
8,
277,
12,
790,
304,
267,
408,
1767,
282,
570,
13,
2930,
6025,
503,
746,
282,
4067,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
25706,
8,
277,
304,
267,
408,
1767,
376,
6122,
1806,
2883,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
2883,
8,
277,
304,
267,
408,
1767,
282,
769,
402,
2883,
1041,
267,
372,
769,
8,
277,
14,
16007,
1012,
339,
347,
24451,
8,
277,
304,
267,
408,
1767,
376,
6122,
1806,
1006,
3788,
1041,
267,
367,
790,
315,
291,
14,
16007,
837,
288,
862,
26,
355,
574,
275,
291,
59,
498,
61,
288,
871,
4067,
26,
355,
1980,
288,
1995,
574,
339,
347,
636,
1661,
721,
277,
304,
267,
372,
291,
14,
13012,
342,
339,
347,
1338,
8,
277,
304,
267,
408,
1767,
282,
769,
402,
3788,
14,
15825,
315,
724,
3398,
1041,
267,
372,
769,
8,
277,
14,
13012,
1012,
339,
347,
10849,
8,
277,
304,
267,
408,
1767,
376,
6122,
1806,
334,
498,
12,
1245,
9,
6346,
1041,
267,
367,
790,
315,
291,
14,
16007,
837,
288,
862,
26,
355,
574,
275,
291,
59,
498,
61,
288,
871,
4067,
26,
355,
1980,
288,
1995,
334,
498,
12,
574,
9,
339,
347,
2974,
8,
277,
304,
267,
408,
1767,
282,
769,
402,
334,
498,
12,
1245,
9,
6346,
14,
15825,
315,
724,
3398,
1041,
267,
372,
769,
8,
277,
14,
4611,
1012,
339,
347,
965,
63,
498,
8,
277,
12,
790,
304,
267,
408,
1767,
715,
340,
314,
19272,
1245,
3495,
12,
756,
4257,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
636,
6134,
721,
277,
12,
790,
304,
267,
372,
291,
14,
1989,
63,
498,
8,
498,
9,
339,
347,
636,
552,
721,
277,
304,
267,
408,
1767,
282,
2338,
402,
3788,
315,
314,
17470,
1041,
267,
746,
4279,
360,
3767,
1471,
506,
6366,
701,
5516,
358,
339,
347,
5436,
8,
277,
304,
267,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
holmes/intellij-community
|
plugins/hg4idea/testData/bin/mercurial/changegroup.py
|
91
|
8282
|
# changegroup.py - Mercurial changegroup manipulation functions
#
# Copyright 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
from node import nullrev
import mdiff, util
import struct, os, bz2, zlib, tempfile
_BUNDLE10_DELTA_HEADER = "20s20s20s20s"
def readexactly(stream, n):
'''read n bytes from stream.read and abort if less was available'''
s = stream.read(n)
if len(s) < n:
raise util.Abort(_("stream ended unexpectedly"
" (got %d bytes, expected %d)")
% (len(s), n))
return s
def getchunk(stream):
"""return the next chunk from stream as a string"""
d = readexactly(stream, 4)
l = struct.unpack(">l", d)[0]
if l <= 4:
if l:
raise util.Abort(_("invalid chunk length %d") % l)
return ""
return readexactly(stream, l - 4)
def chunkheader(length):
"""return a changegroup chunk header (string)"""
return struct.pack(">l", length + 4)
def closechunk():
"""return a changegroup chunk header (string) for a zero-length chunk"""
return struct.pack(">l", 0)
class nocompress(object):
def compress(self, x):
return x
def flush(self):
return ""
bundletypes = {
"": ("", nocompress), # only when using unbundle on ssh and old http servers
# since the unification ssh accepts a header but there
# is no capability signaling it.
"HG10UN": ("HG10UN", nocompress),
"HG10BZ": ("HG10", lambda: bz2.BZ2Compressor()),
"HG10GZ": ("HG10GZ", lambda: zlib.compressobj()),
}
# hgweb uses this list to communicate its preferred type
bundlepriority = ['HG10GZ', 'HG10BZ', 'HG10UN']
def writebundle(cg, filename, bundletype):
"""Write a bundle file and return its filename.
Existing files will not be overwritten.
If no filename is specified, a temporary file is created.
bz2 compression can be turned off.
The bundle file will be deleted in case of errors.
"""
fh = None
cleanup = None
try:
if filename:
fh = open(filename, "wb")
else:
fd, filename = tempfile.mkstemp(prefix="hg-bundle-", suffix=".hg")
fh = os.fdopen(fd, "wb")
cleanup = filename
header, compressor = bundletypes[bundletype]
fh.write(header)
z = compressor()
# parse the changegroup data, otherwise we will block
# in case of sshrepo because we don't know the end of the stream
# an empty chunkgroup is the end of the changegroup
# a changegroup has at least 2 chunkgroups (changelog and manifest).
# after that, an empty chunkgroup is the end of the changegroup
empty = False
count = 0
while not empty or count <= 2:
empty = True
count += 1
while True:
chunk = getchunk(cg)
if not chunk:
break
empty = False
fh.write(z.compress(chunkheader(len(chunk))))
pos = 0
while pos < len(chunk):
next = pos + 2**20
fh.write(z.compress(chunk[pos:next]))
pos = next
fh.write(z.compress(closechunk()))
fh.write(z.flush())
cleanup = None
return filename
finally:
if fh is not None:
fh.close()
if cleanup is not None:
os.unlink(cleanup)
def decompressor(fh, alg):
if alg == 'UN':
return fh
elif alg == 'GZ':
def generator(f):
zd = zlib.decompressobj()
for chunk in util.filechunkiter(f):
yield zd.decompress(chunk)
elif alg == 'BZ':
def generator(f):
zd = bz2.BZ2Decompressor()
zd.decompress("BZ")
for chunk in util.filechunkiter(f, 4096):
yield zd.decompress(chunk)
else:
raise util.Abort("unknown bundle compression '%s'" % alg)
return util.chunkbuffer(generator(fh))
class unbundle10(object):
deltaheader = _BUNDLE10_DELTA_HEADER
deltaheadersize = struct.calcsize(deltaheader)
def __init__(self, fh, alg):
self._stream = decompressor(fh, alg)
self._type = alg
self.callback = None
def compressed(self):
return self._type != 'UN'
def read(self, l):
return self._stream.read(l)
def seek(self, pos):
return self._stream.seek(pos)
def tell(self):
return self._stream.tell()
def close(self):
return self._stream.close()
def chunklength(self):
d = readexactly(self._stream, 4)
l = struct.unpack(">l", d)[0]
if l <= 4:
if l:
raise util.Abort(_("invalid chunk length %d") % l)
return 0
if self.callback:
self.callback()
return l - 4
def changelogheader(self):
"""v10 does not have a changelog header chunk"""
return {}
def manifestheader(self):
"""v10 does not have a manifest header chunk"""
return {}
def filelogheader(self):
"""return the header of the filelogs chunk, v10 only has the filename"""
l = self.chunklength()
if not l:
return {}
fname = readexactly(self._stream, l)
return dict(filename=fname)
def _deltaheader(self, headertuple, prevnode):
node, p1, p2, cs = headertuple
if prevnode is None:
deltabase = p1
else:
deltabase = prevnode
return node, p1, p2, deltabase, cs
def deltachunk(self, prevnode):
l = self.chunklength()
if not l:
return {}
headerdata = readexactly(self._stream, self.deltaheadersize)
header = struct.unpack(self.deltaheader, headerdata)
delta = readexactly(self._stream, l - self.deltaheadersize)
node, p1, p2, deltabase, cs = self._deltaheader(header, prevnode)
return dict(node=node, p1=p1, p2=p2, cs=cs,
deltabase=deltabase, delta=delta)
class headerlessfixup(object):
def __init__(self, fh, h):
self._h = h
self._fh = fh
def read(self, n):
if self._h:
d, self._h = self._h[:n], self._h[n:]
if len(d) < n:
d += readexactly(self._fh, n - len(d))
return d
return readexactly(self._fh, n)
def readbundle(fh, fname):
header = readexactly(fh, 6)
if not fname:
fname = "stream"
if not header.startswith('HG') and header.startswith('\0'):
fh = headerlessfixup(fh, header)
header = "HG10UN"
magic, version, alg = header[0:2], header[2:4], header[4:6]
if magic != 'HG':
raise util.Abort(_('%s: not a Mercurial bundle') % fname)
if version != '10':
raise util.Abort(_('%s: unknown bundle version %s') % (fname, version))
return unbundle10(fh, alg)
class bundle10(object):
deltaheader = _BUNDLE10_DELTA_HEADER
def __init__(self, lookup):
self._lookup = lookup
def close(self):
return closechunk()
def fileheader(self, fname):
return chunkheader(len(fname)) + fname
def revchunk(self, revlog, rev, prev):
node = revlog.node(rev)
p1, p2 = revlog.parentrevs(rev)
base = prev
prefix = ''
if base == nullrev:
delta = revlog.revision(node)
prefix = mdiff.trivialdiffheader(len(delta))
else:
delta = revlog.revdiff(base, rev)
linknode = self._lookup(revlog, node)
p1n, p2n = revlog.parents(node)
basenode = revlog.node(base)
meta = self.builddeltaheader(node, p1n, p2n, basenode, linknode)
meta += prefix
l = len(meta) + len(delta)
yield chunkheader(l)
yield meta
yield delta
def builddeltaheader(self, node, p1n, p2n, basenode, linknode):
# do nothing with basenode, it is implicitly the previous one in HG10
return struct.pack(self.deltaheader, node, p1n, p2n, linknode)
|
apache-2.0
|
[
3,
1570,
923,
14,
647,
446,
30522,
1570,
923,
26212,
3423,
199,
3,
199,
3,
221,
1898,
8315,
31653,
603,
564,
452,
665,
311,
77,
32,
261,
552,
530,
14,
957,
30,
199,
3,
199,
3,
961,
2032,
1443,
506,
1202,
436,
1854,
7182,
370,
314,
2895,
402,
314,
199,
3,
1664,
1696,
1684,
844,
1015,
499,
503,
1263,
2945,
1015,
14,
199,
199,
504,
284,
1085,
78,
492,
485,
199,
504,
1031,
492,
2973,
4964,
199,
646,
333,
3028,
12,
4884,
199,
646,
2702,
12,
747,
12,
15055,
18,
12,
12472,
12,
5549,
199,
199,
63,
32044,
906,
709,
63,
4424,
6166,
63,
7311,
275,
298,
1165,
83,
1165,
83,
1165,
83,
1165,
83,
2,
199,
199,
318,
295,
65,
731,
2442,
590,
8,
1745,
12,
302,
304,
272,
1449,
739,
302,
2783,
687,
2547,
14,
739,
436,
12004,
340,
6656,
1990,
2808,
2344,
272,
308,
275,
2547,
14,
739,
8,
78,
9,
272,
340,
822,
8,
83,
9,
665,
302,
26,
267,
746,
4884,
14,
16682,
6115,
1745,
22480,
10537,
590,
2,
2574,
298,
334,
7808,
450,
68,
2783,
12,
1420,
450,
68,
6320,
2079,
450,
334,
552,
8,
83,
395,
302,
430,
272,
372,
308,
199,
199,
318,
664,
4604,
8,
1745,
304,
272,
408,
1107,
314,
2163,
3728,
687,
2547,
465,
282,
1059,
624,
272,
366,
275,
295,
65,
731,
2442,
590,
8,
1745,
12,
841,
9,
272,
634,
275,
2702,
14,
5301,
19651,
76,
401,
366,
2788,
16,
61,
272,
340,
634,
2695,
841,
26,
267,
340,
634,
26,
288,
746,
4884,
14,
16682,
6115,
3197,
3728,
2582,
450,
68,
531,
450,
634,
9,
267,
372,
3087,
272,
372,
295,
65,
731,
2442,
590,
8,
1745,
12,
634,
446,
841,
9,
199,
199,
318,
3728,
1291,
8,
1267,
304,
272,
408,
1107,
282,
1570,
923,
3728,
1406,
334,
875,
9471,
272,
372,
2702,
14,
1389,
19651,
76,
401,
2582,
435,
841,
9,
199,
199,
318,
4002,
4604,
837,
272,
408,
1107,
282,
1570,
923,
3728,
1406,
334,
875,
9,
367,
282,
4697,
13,
1267,
3728,
624,
272,
372,
2702,
14,
1389,
19651,
76,
401,
378,
9,
199,
199,
533,
949,
6447,
8,
785,
304,
272,
347,
11029,
8,
277,
12,
671,
304,
267,
372,
671,
272,
347,
8976,
8,
277,
304,
267,
372,
3087,
199,
199,
6469,
1313,
275,
469,
272,
10812,
24727,
949,
6447,
395,
327,
1454,
1380,
1808,
625,
6469,
641,
8635,
436,
2269,
1455,
8037,
2079,
327,
3967,
314,
625,
7313,
8635,
11479,
282,
1406,
1325,
2337,
2079,
327,
365,
949,
19854,
4673,
316,
652,
14,
272,
298,
31442,
709,
1734,
582,
1689,
31442,
709,
1734,
401,
949,
6447,
395,
272,
298,
31442,
709,
21338,
582,
1689,
31442,
709,
401,
2400,
26,
15055,
18,
14,
21338,
18,
2404,
11686,
4000,
272,
298,
31442,
709,
29847,
582,
1689,
31442,
709,
29847,
401,
2400,
26,
12472,
14,
6447,
1113,
4000,
199,
93,
199,
199,
3,
18016,
2520,
4440,
642,
769,
370,
26808,
2399,
14388,
730,
199,
6469,
6693,
275,
788,
31442,
709,
29847,
297,
283,
31442,
709,
21338,
297,
283,
31442,
709,
1734,
418,
199,
199,
318,
2218,
6469,
8,
12595,
12,
1788,
12,
8844,
466,
304,
272,
408,
3534,
282,
8844,
570,
436,
372,
2399,
1788,
14,
339,
1316,
26958,
1584,
911,
440,
506,
20200,
14,
272,
982,
949,
1788,
365,
2013,
12,
282,
7937,
570,
365,
2737,
14,
272,
15055,
18,
10291,
883,
506,
19136,
2331,
14,
272,
710,
8844,
570,
911,
506,
5463,
315,
1930,
402,
2552,
14,
272,
408,
339,
11155,
275,
488,
272,
9058,
275,
488,
272,
862,
26,
267,
340,
1788,
26,
288,
11155,
275,
1551,
8,
1501,
12,
298,
6603,
531,
267,
587,
26,
288,
6111,
12,
1788,
275,
5549,
14,
17721,
8,
1861,
628,
9208,
13,
6469,
13,
401,
4739,
25356,
9208,
531,
288,
11155,
275,
747,
14,
23140,
8,
2592,
12,
298,
6603,
531,
267,
9058,
275,
1788,
398,
1406,
12,
11029,
269,
275,
8844,
1313,
59,
6469,
466,
61,
267,
11155,
14,
952,
8,
1291,
9,
267,
1315,
275,
11029,
269,
342,
398,
327,
2198,
314,
1570,
923,
666,
12,
4257,
781,
911,
1853,
267,
327,
315,
1930,
402,
8635,
3417,
2952,
781,
2793,
1133,
5715,
314,
1284,
402,
314,
2547,
398,
327,
376,
2701,
3728,
923,
365,
314,
1284,
402,
314,
1570,
923,
267,
327,
282,
1570,
923,
965,
737,
5210,
499,
3728,
2634,
334,
23436,
436,
7712,
680,
267,
327,
2410,
626,
12,
376,
2701,
3728,
923,
365,
314,
1284,
402,
314,
1570,
923,
267,
2701,
275,
756,
267,
2338,
275,
378,
267,
1830,
440,
2701,
503,
2338,
2695,
499,
26,
288,
2701,
275,
715,
288,
2338,
847,
413,
288,
1830,
715,
26,
355,
3728,
275,
664,
4604,
8,
12595,
9,
355,
340,
440,
3728,
26,
490,
2059,
355,
2701,
275,
756,
355,
11155,
14,
952,
8,
90,
14,
6447,
8,
4604,
1291,
8,
552,
8,
4604,
7845,
355,
2086,
275,
378,
355,
1830,
2086,
665,
822,
8,
4604,
304,
490,
2163,
275,
2086,
435,
499,
538,
1165,
490,
11155,
14,
952,
8,
90,
14,
6447,
8,
4604,
59,
1712,
26,
2184,
2459,
490,
2086,
275,
2163,
288,
11155,
14,
952,
8,
90,
14,
6447,
8,
1600,
4604,
4059,
267,
11155,
14,
952,
8,
90,
14,
4939,
1012,
267,
9058,
275,
488,
267,
372,
1788,
272,
3753,
26,
267,
340,
11155,
365,
440,
488,
26,
288,
11155,
14,
1600,
342,
267,
340,
9058,
365,
440,
488,
26,
288,
747,
14,
7162,
8,
7661,
9,
199,
199,
318,
24733,
269,
8,
12853,
12,
15760,
304,
272,
340,
15760,
508,
283,
1734,
356,
267,
372,
11155,
272,
916,
15760,
508,
283,
29847,
356,
267,
347,
4306,
8,
70,
304,
288,
1315,
68,
275,
12472,
14,
14954,
1113,
342,
288,
367,
3728,
315,
4884,
14,
493,
4604,
1661,
8,
70,
304,
355,
1995,
1315,
68,
14,
14954,
8,
4604,
9,
272,
916,
15760,
508,
283,
21338,
356,
267,
347,
4306,
8,
70,
304,
288,
1315,
68,
275,
15055,
18,
14,
21338,
18,
872,
27879,
342,
288,
1315,
68,
14,
14954,
480,
21338,
531,
288,
367,
3728,
315,
4884,
14,
493,
4604,
1661,
8,
70,
12,
17125,
304,
355,
1995,
1315,
68,
14,
14954,
8,
4604,
9,
272,
587,
26
] |
[
1570,
923,
14,
647,
446,
30522,
1570,
923,
26212,
3423,
199,
3,
199,
3,
221,
1898,
8315,
31653,
603,
564,
452,
665,
311,
77,
32,
261,
552,
530,
14,
957,
30,
199,
3,
199,
3,
961,
2032,
1443,
506,
1202,
436,
1854,
7182,
370,
314,
2895,
402,
314,
199,
3,
1664,
1696,
1684,
844,
1015,
499,
503,
1263,
2945,
1015,
14,
199,
199,
504,
284,
1085,
78,
492,
485,
199,
504,
1031,
492,
2973,
4964,
199,
646,
333,
3028,
12,
4884,
199,
646,
2702,
12,
747,
12,
15055,
18,
12,
12472,
12,
5549,
199,
199,
63,
32044,
906,
709,
63,
4424,
6166,
63,
7311,
275,
298,
1165,
83,
1165,
83,
1165,
83,
1165,
83,
2,
199,
199,
318,
295,
65,
731,
2442,
590,
8,
1745,
12,
302,
304,
272,
1449,
739,
302,
2783,
687,
2547,
14,
739,
436,
12004,
340,
6656,
1990,
2808,
2344,
272,
308,
275,
2547,
14,
739,
8,
78,
9,
272,
340,
822,
8,
83,
9,
665,
302,
26,
267,
746,
4884,
14,
16682,
6115,
1745,
22480,
10537,
590,
2,
2574,
298,
334,
7808,
450,
68,
2783,
12,
1420,
450,
68,
6320,
2079,
450,
334,
552,
8,
83,
395,
302,
430,
272,
372,
308,
199,
199,
318,
664,
4604,
8,
1745,
304,
272,
408,
1107,
314,
2163,
3728,
687,
2547,
465,
282,
1059,
624,
272,
366,
275,
295,
65,
731,
2442,
590,
8,
1745,
12,
841,
9,
272,
634,
275,
2702,
14,
5301,
19651,
76,
401,
366,
2788,
16,
61,
272,
340,
634,
2695,
841,
26,
267,
340,
634,
26,
288,
746,
4884,
14,
16682,
6115,
3197,
3728,
2582,
450,
68,
531,
450,
634,
9,
267,
372,
3087,
272,
372,
295,
65,
731,
2442,
590,
8,
1745,
12,
634,
446,
841,
9,
199,
199,
318,
3728,
1291,
8,
1267,
304,
272,
408,
1107,
282,
1570,
923,
3728,
1406,
334,
875,
9471,
272,
372,
2702,
14,
1389,
19651,
76,
401,
2582,
435,
841,
9,
199,
199,
318,
4002,
4604,
837,
272,
408,
1107,
282,
1570,
923,
3728,
1406,
334,
875,
9,
367,
282,
4697,
13,
1267,
3728,
624,
272,
372,
2702,
14,
1389,
19651,
76,
401,
378,
9,
199,
199,
533,
949,
6447,
8,
785,
304,
272,
347,
11029,
8,
277,
12,
671,
304,
267,
372,
671,
272,
347,
8976,
8,
277,
304,
267,
372,
3087,
199,
199,
6469,
1313,
275,
469,
272,
10812,
24727,
949,
6447,
395,
327,
1454,
1380,
1808,
625,
6469,
641,
8635,
436,
2269,
1455,
8037,
2079,
327,
3967,
314,
625,
7313,
8635,
11479,
282,
1406,
1325,
2337,
2079,
327,
365,
949,
19854,
4673,
316,
652,
14,
272,
298,
31442,
709,
1734,
582,
1689,
31442,
709,
1734,
401,
949,
6447,
395,
272,
298,
31442,
709,
21338,
582,
1689,
31442,
709,
401,
2400,
26,
15055,
18,
14,
21338,
18,
2404,
11686,
4000,
272,
298,
31442,
709,
29847,
582,
1689,
31442,
709,
29847,
401,
2400,
26,
12472,
14,
6447,
1113,
4000,
199,
93,
199,
199,
3,
18016,
2520,
4440,
642,
769,
370,
26808,
2399,
14388,
730,
199,
6469,
6693,
275,
788,
31442,
709,
29847,
297,
283,
31442,
709,
21338,
297,
283,
31442,
709,
1734,
418,
199,
199,
318,
2218,
6469,
8,
12595,
12,
1788,
12,
8844,
466,
304,
272,
408,
3534,
282,
8844,
570,
436,
372,
2399,
1788,
14,
339,
1316,
26958,
1584,
911,
440,
506,
20200,
14,
272,
982,
949,
1788,
365,
2013,
12,
282,
7937,
570,
365,
2737,
14,
272,
15055,
18,
10291,
883,
506,
19136,
2331,
14,
272,
710,
8844,
570,
911,
506,
5463,
315,
1930,
402,
2552,
14,
272,
408,
339,
11155,
275,
488,
272,
9058,
275,
488,
272,
862,
26,
267,
340,
1788,
26,
288,
11155,
275,
1551,
8,
1501,
12,
298,
6603,
531,
267,
587,
26,
288,
6111,
12,
1788,
275,
5549,
14,
17721,
8,
1861,
628,
9208,
13,
6469,
13,
401,
4739,
25356,
9208,
531,
288,
11155,
275,
747,
14,
23140,
8,
2592,
12,
298,
6603,
531,
267,
9058,
275,
1788,
398,
1406,
12,
11029,
269,
275,
8844,
1313,
59,
6469,
466,
61,
267,
11155,
14,
952,
8,
1291,
9,
267,
1315,
275,
11029,
269,
342,
398,
327,
2198,
314,
1570,
923,
666,
12,
4257,
781,
911,
1853,
267,
327,
315,
1930,
402,
8635,
3417,
2952,
781,
2793,
1133,
5715,
314,
1284,
402,
314,
2547,
398,
327,
376,
2701,
3728,
923,
365,
314,
1284,
402,
314,
1570,
923,
267,
327,
282,
1570,
923,
965,
737,
5210,
499,
3728,
2634,
334,
23436,
436,
7712,
680,
267,
327,
2410,
626,
12,
376,
2701,
3728,
923,
365,
314,
1284,
402,
314,
1570,
923,
267,
2701,
275,
756,
267,
2338,
275,
378,
267,
1830,
440,
2701,
503,
2338,
2695,
499,
26,
288,
2701,
275,
715,
288,
2338,
847,
413,
288,
1830,
715,
26,
355,
3728,
275,
664,
4604,
8,
12595,
9,
355,
340,
440,
3728,
26,
490,
2059,
355,
2701,
275,
756,
355,
11155,
14,
952,
8,
90,
14,
6447,
8,
4604,
1291,
8,
552,
8,
4604,
7845,
355,
2086,
275,
378,
355,
1830,
2086,
665,
822,
8,
4604,
304,
490,
2163,
275,
2086,
435,
499,
538,
1165,
490,
11155,
14,
952,
8,
90,
14,
6447,
8,
4604,
59,
1712,
26,
2184,
2459,
490,
2086,
275,
2163,
288,
11155,
14,
952,
8,
90,
14,
6447,
8,
1600,
4604,
4059,
267,
11155,
14,
952,
8,
90,
14,
4939,
1012,
267,
9058,
275,
488,
267,
372,
1788,
272,
3753,
26,
267,
340,
11155,
365,
440,
488,
26,
288,
11155,
14,
1600,
342,
267,
340,
9058,
365,
440,
488,
26,
288,
747,
14,
7162,
8,
7661,
9,
199,
199,
318,
24733,
269,
8,
12853,
12,
15760,
304,
272,
340,
15760,
508,
283,
1734,
356,
267,
372,
11155,
272,
916,
15760,
508,
283,
29847,
356,
267,
347,
4306,
8,
70,
304,
288,
1315,
68,
275,
12472,
14,
14954,
1113,
342,
288,
367,
3728,
315,
4884,
14,
493,
4604,
1661,
8,
70,
304,
355,
1995,
1315,
68,
14,
14954,
8,
4604,
9,
272,
916,
15760,
508,
283,
21338,
356,
267,
347,
4306,
8,
70,
304,
288,
1315,
68,
275,
15055,
18,
14,
21338,
18,
872,
27879,
342,
288,
1315,
68,
14,
14954,
480,
21338,
531,
288,
367,
3728,
315,
4884,
14,
493,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
hansey/youtube-dl
|
youtube_dl/extractor/clubic.py
|
41
|
2057
|
# coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import (
clean_html,
qualities,
)
class ClubicIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?clubic\.com/video/(?:[^/]+/)*video.*-(?P<id>[0-9]+)\.html'
_TESTS = [{
'url': 'http://www.clubic.com/video/clubic-week/video-clubic-week-2-0-le-fbi-se-lance-dans-la-photo-d-identite-448474.html',
'md5': '1592b694ba586036efac1776b0b43cd3',
'info_dict': {
'id': '448474',
'ext': 'mp4',
'title': 'Clubic Week 2.0 : le FBI se lance dans la photo d\u0092identité',
'description': 're:Gueule de bois chez Nokia. Le constructeur a indiqué cette.*',
'thumbnail': 're:^http://img\.clubic\.com/.*\.jpg$',
}
}, {
'url': 'http://www.clubic.com/video/video-clubic-week-2-0-apple-iphone-6s-et-plus-mais-surtout-le-pencil-469792.html',
'only_matching': True,
}]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
player_url = 'http://player.m6web.fr/v1/player/clubic/%s.html' % video_id
player_page = self._download_webpage(player_url, video_id)
config_json = self._search_regex(
r'(?m)M6\.Player\.config\s*=\s*(\{.+?\});$', player_page,
'configuration')
config = json.loads(config_json)
video_info = config['videoInfo']
sources = config['sources']
quality_order = qualities(['sd', 'hq'])
formats = [{
'format_id': src['streamQuality'],
'url': src['src'],
'quality': quality_order(src['streamQuality']),
} for src in sources]
self._sort_formats(formats)
return {
'id': video_id,
'title': video_info['title'],
'formats': formats,
'description': clean_html(video_info.get('description')),
'thumbnail': config.get('poster'),
}
|
unlicense
|
[
3,
2803,
26,
2774,
13,
24,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
2022,
199,
646,
295,
199,
199,
504,
1275,
2330,
492,
21298,
199,
504,
2508,
1208,
492,
334,
272,
3633,
63,
1360,
12,
272,
6420,
12107,
12,
199,
9,
421,
199,
533,
8465,
456,
530,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
1014,
921,
5169,
1544,
20316,
429,
456,
530,
4537,
957,
15,
3722,
32576,
26285,
15,
3342,
3722,
14,
1837,
2229,
48,
28,
344,
9514,
16,
13,
25,
18096,
14,
1360,
7,
339,
485,
7569,
275,
8910,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
429,
456,
530,
14,
957,
15,
3722,
15,
429,
456,
530,
13,
6419,
15,
3722,
13,
429,
456,
530,
13,
6419,
13,
18,
13,
16,
13,
274,
13,
70,
4492,
13,
261,
13,
76,
554,
13,
68,
796,
13,
416,
13,
13834,
13,
68,
13,
9281,
280,
266,
13,
1602,
1349,
1342,
14,
1360,
297,
267,
283,
1064,
21,
356,
283,
1046,
2942,
66,
19421,
2470,
21,
14832,
1344,
2829,
645,
8881,
22,
66,
16,
66,
2824,
2866,
19,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
1602,
1349,
1342,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
1968,
456,
530,
31072,
499,
14,
16,
520,
1026,
481,
19419,
542,
634,
554,
366,
796,
1127,
19397,
366,
60,
85,
383,
2942,
9281,
6403,
5741,
297,
288,
283,
1802,
356,
283,
264,
26,
39,
310,
443,
477,
1234,
374,
17546,
90,
653,
745,
4674,
14,
7005,
406,
9853,
266,
300,
282,
2539,
392,
5741,
286,
386,
266,
16110,
288,
283,
8311,
356,
283,
264,
23497,
1014,
921,
4060,
4537,
429,
456,
530,
4537,
957,
15,
24736,
8476,
4268,
267,
789,
272,
1660,
469,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
429,
456,
530,
14,
957,
15,
3722,
15,
3722,
13,
429,
456,
530,
13,
6419,
13,
18,
13,
16,
13,
12820,
13,
28303,
13,
22,
83,
13,
386,
13,
6666,
13,
391,
374,
13,
5105,
475,
337,
13,
274,
13,
897,
24707,
13,
16112,
22364,
14,
1360,
297,
267,
283,
2118,
63,
9467,
356,
715,
12,
272,
14877,
339,
347,
485,
3093,
63,
5005,
8,
277,
12,
1166,
304,
267,
14208,
275,
295,
14,
1431,
8,
277,
423,
5600,
63,
2632,
12,
1166,
9,
267,
3991,
63,
344,
275,
14208,
14,
923,
360,
344,
358,
398,
7748,
63,
633,
275,
283,
1014,
921,
6147,
14,
77,
22,
2520,
14,
4391,
15,
86,
17,
15,
6147,
15,
429,
456,
530,
3149,
83,
14,
1360,
7,
450,
3991,
63,
344,
267,
7748,
63,
1606,
275,
291,
423,
4249,
63,
12022,
8,
6147,
63,
633,
12,
3991,
63,
344,
9,
398,
1101,
63,
1001,
275,
291,
423,
1733,
63,
3821,
8,
288,
519,
10120,
77,
9,
45,
22,
4537,
10921,
4537,
888,
60,
83,
23440,
83,
22588,
91,
6977,
8995,
32056,
4268,
7748,
63,
1606,
12,
288,
283,
4758,
358,
267,
1101,
275,
2022,
14,
3640,
8,
888,
63,
1001,
9,
398,
3991,
63,
815,
275,
1101,
459,
3722,
2354,
418,
267,
5274,
275,
1101,
459,
4553,
418,
267,
11030,
63,
1648,
275,
6420,
12107,
2941,
3893,
297,
283,
21550,
1105,
398,
6752,
275,
8910,
288,
283,
908,
63,
344,
356,
2928,
459,
1745,
19436,
995,
288,
283,
633,
356,
2928,
459,
2164,
995,
288,
283,
9161,
356,
11030,
63,
1648,
8,
2164,
459,
1745,
19436,
3815,
267,
789,
367,
2928,
315,
5274,
61,
267,
291,
423,
3191,
63,
6321,
8,
6321,
9,
398,
372,
469,
288,
283,
344,
356,
3991,
63,
344,
12,
288,
283,
1213,
356,
3991,
63,
815,
459,
1213,
995,
288,
283,
6321,
356,
6752,
12,
288,
283,
1802,
356,
3633,
63,
1360,
8,
3722,
63,
815,
14,
362,
360,
1802,
3855,
288,
283,
8311,
356,
1101,
14,
362,
360,
20801,
659,
267,
789,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2803,
26,
2774,
13,
24,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
2022,
199,
646,
295,
199,
199,
504,
1275,
2330,
492,
21298,
199,
504,
2508,
1208,
492,
334,
272,
3633,
63,
1360,
12,
272,
6420,
12107,
12,
199,
9,
421,
199,
533,
8465,
456,
530,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
1014,
921,
5169,
1544,
20316,
429,
456,
530,
4537,
957,
15,
3722,
32576,
26285,
15,
3342,
3722,
14,
1837,
2229,
48,
28,
344,
9514,
16,
13,
25,
18096,
14,
1360,
7,
339,
485,
7569,
275,
8910,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
429,
456,
530,
14,
957,
15,
3722,
15,
429,
456,
530,
13,
6419,
15,
3722,
13,
429,
456,
530,
13,
6419,
13,
18,
13,
16,
13,
274,
13,
70,
4492,
13,
261,
13,
76,
554,
13,
68,
796,
13,
416,
13,
13834,
13,
68,
13,
9281,
280,
266,
13,
1602,
1349,
1342,
14,
1360,
297,
267,
283,
1064,
21,
356,
283,
1046,
2942,
66,
19421,
2470,
21,
14832,
1344,
2829,
645,
8881,
22,
66,
16,
66,
2824,
2866,
19,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
1602,
1349,
1342,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
1968,
456,
530,
31072,
499,
14,
16,
520,
1026,
481,
19419,
542,
634,
554,
366,
796,
1127,
19397,
366,
60,
85,
383,
2942,
9281,
6403,
5741,
297,
288,
283,
1802,
356,
283,
264,
26,
39,
310,
443,
477,
1234,
374,
17546,
90,
653,
745,
4674,
14,
7005,
406,
9853,
266,
300,
282,
2539,
392,
5741,
286,
386,
266,
16110,
288,
283,
8311,
356,
283,
264,
23497,
1014,
921,
4060,
4537,
429,
456,
530,
4537,
957,
15,
24736,
8476,
4268,
267,
789,
272,
1660,
469,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
429,
456,
530,
14,
957,
15,
3722,
15,
3722,
13,
429,
456,
530,
13,
6419,
13,
18,
13,
16,
13,
12820,
13,
28303,
13,
22,
83,
13,
386,
13,
6666,
13,
391,
374,
13,
5105,
475,
337,
13,
274,
13,
897,
24707,
13,
16112,
22364,
14,
1360,
297,
267,
283,
2118,
63,
9467,
356,
715,
12,
272,
14877,
339,
347,
485,
3093,
63,
5005,
8,
277,
12,
1166,
304,
267,
14208,
275,
295,
14,
1431,
8,
277,
423,
5600,
63,
2632,
12,
1166,
9,
267,
3991,
63,
344,
275,
14208,
14,
923,
360,
344,
358,
398,
7748,
63,
633,
275,
283,
1014,
921,
6147,
14,
77,
22,
2520,
14,
4391,
15,
86,
17,
15,
6147,
15,
429,
456,
530,
3149,
83,
14,
1360,
7,
450,
3991,
63,
344,
267,
7748,
63,
1606,
275,
291,
423,
4249,
63,
12022,
8,
6147,
63,
633,
12,
3991,
63,
344,
9,
398,
1101,
63,
1001,
275,
291,
423,
1733,
63,
3821,
8,
288,
519,
10120,
77,
9,
45,
22,
4537,
10921,
4537,
888,
60,
83,
23440,
83,
22588,
91,
6977,
8995,
32056,
4268,
7748,
63,
1606,
12,
288,
283,
4758,
358,
267,
1101,
275,
2022,
14,
3640,
8,
888,
63,
1001,
9,
398,
3991,
63,
815,
275,
1101,
459,
3722,
2354,
418,
267,
5274,
275,
1101,
459,
4553,
418,
267,
11030,
63,
1648,
275,
6420,
12107,
2941,
3893,
297,
283,
21550,
1105,
398,
6752,
275,
8910,
288,
283,
908,
63,
344,
356,
2928,
459,
1745,
19436,
995,
288,
283,
633,
356,
2928,
459,
2164,
995,
288,
283,
9161,
356,
11030,
63,
1648,
8,
2164,
459,
1745,
19436,
3815,
267,
789,
367,
2928,
315,
5274,
61,
267,
291,
423,
3191,
63,
6321,
8,
6321,
9,
398,
372,
469,
288,
283,
344,
356,
3991,
63,
344,
12,
288,
283,
1213,
356,
3991,
63,
815,
459,
1213,
995,
288,
283,
6321,
356,
6752,
12,
288,
283,
1802,
356,
3633,
63,
1360,
8,
3722,
63,
815,
14,
362,
360,
1802,
3855,
288,
283,
8311,
356,
1101,
14,
362,
360,
20801,
659,
267,
789,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
PRX/Infrastructure
|
etc/serverless-s3-upload/lambdas/StaticWebsiteAuthorizerFunction/lambda_function.py
|
1
|
1077
|
# This function is triggered by API Gateway as an authorizer. It uses the HTTP
# basic auth Authorization header to permit access to API Gateway methods by
# returning a policy document when the credentials match those defined as stack
# parameters.
import os
import base64
def lambda_handler(event, context):
headers = event["headers"]
if headers["Authorization"] is None:
return
base_64_credentials = headers["Authorization"].split(" ")[1]
credentials = base64.b64decode(base_64_credentials).decode("utf-8")
username = credentials.split(":")[0]
password = credentials.split(":")[1]
if username != os.environ["BASIC_AUTH_USERNAME"]:
return
if password != os.environ["BASIC_AUTH_PASSWORD"]:
return
return {
"policyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Action": "execute-api:Invoke",
"Effect": "Allow",
"Resource": event["methodArn"],
}
],
}
}
|
mit
|
[
3,
961,
805,
365,
15572,
701,
3261,
27166,
465,
376,
4132,
1793,
14,
2779,
4440,
314,
3101,
199,
3,
5678,
1790,
21527,
1406,
370,
11291,
2879,
370,
3261,
27166,
3102,
701,
199,
3,
8152,
282,
4592,
2213,
1380,
314,
6235,
1336,
5204,
3247,
465,
3464,
199,
3,
2633,
14,
199,
199,
646,
747,
199,
646,
1300,
772,
421,
199,
318,
2400,
63,
2232,
8,
1430,
12,
1067,
304,
272,
2323,
275,
1566,
905,
2139,
937,
339,
340,
2323,
905,
11626,
937,
365,
488,
26,
267,
372,
339,
1300,
63,
772,
63,
6942,
275,
2323,
905,
11626,
4140,
1294,
480,
298,
2788,
17,
61,
272,
6235,
275,
1300,
772,
14,
66,
772,
2708,
8,
1095,
63,
772,
63,
6942,
680,
2708,
480,
1624,
13,
24,
531,
339,
3434,
275,
6235,
14,
1294,
20063,
59,
16,
61,
272,
2505,
275,
6235,
14,
1294,
20063,
59,
17,
61,
339,
340,
3434,
1137,
747,
14,
2314,
905,
27271,
63,
5580,
63,
11958,
6229,
267,
372,
272,
340,
2505,
1137,
747,
14,
2314,
905,
27271,
63,
5580,
63,
9032,
6229,
267,
372,
339,
372,
469,
267,
298,
3185,
5564,
582,
469,
288,
298,
3353,
582,
298,
7409,
13,
709,
13,
1196,
401,
288,
298,
15173,
582,
359,
355,
469,
490,
298,
3310,
582,
298,
2526,
13,
1246,
26,
27736,
401,
490,
298,
21339,
582,
298,
7852,
401,
490,
298,
4031,
582,
1566,
905,
765,
20498,
2255,
355,
789,
288,
2156,
267,
789,
272,
789,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
961,
805,
365,
15572,
701,
3261,
27166,
465,
376,
4132,
1793,
14,
2779,
4440,
314,
3101,
199,
3,
5678,
1790,
21527,
1406,
370,
11291,
2879,
370,
3261,
27166,
3102,
701,
199,
3,
8152,
282,
4592,
2213,
1380,
314,
6235,
1336,
5204,
3247,
465,
3464,
199,
3,
2633,
14,
199,
199,
646,
747,
199,
646,
1300,
772,
421,
199,
318,
2400,
63,
2232,
8,
1430,
12,
1067,
304,
272,
2323,
275,
1566,
905,
2139,
937,
339,
340,
2323,
905,
11626,
937,
365,
488,
26,
267,
372,
339,
1300,
63,
772,
63,
6942,
275,
2323,
905,
11626,
4140,
1294,
480,
298,
2788,
17,
61,
272,
6235,
275,
1300,
772,
14,
66,
772,
2708,
8,
1095,
63,
772,
63,
6942,
680,
2708,
480,
1624,
13,
24,
531,
339,
3434,
275,
6235,
14,
1294,
20063,
59,
16,
61,
272,
2505,
275,
6235,
14,
1294,
20063,
59,
17,
61,
339,
340,
3434,
1137,
747,
14,
2314,
905,
27271,
63,
5580,
63,
11958,
6229,
267,
372,
272,
340,
2505,
1137,
747,
14,
2314,
905,
27271,
63,
5580,
63,
9032,
6229,
267,
372,
339,
372,
469,
267,
298,
3185,
5564,
582,
469,
288,
298,
3353,
582,
298,
7409,
13,
709,
13,
1196,
401,
288,
298,
15173,
582,
359,
355,
469,
490,
298,
3310,
582,
298,
2526,
13,
1246,
26,
27736,
401,
490,
298,
21339,
582,
298,
7852,
401,
490,
298,
4031,
582,
1566,
905,
765,
20498,
2255,
355,
789,
288,
2156,
267,
789,
272,
789,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
ryfeus/lambda-packs
|
Keras_tensorflow_nightly/source2.7/tensorflow/python/keras/_impl/keras/layers/recurrent.py
|
3
|
99323
|
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# pylint: disable=protected-access
"""Recurrent layers and their base classes.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numbers
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import tensor_shape
from tensorflow.python.keras._impl.keras import activations
from tensorflow.python.keras._impl.keras import backend as K
from tensorflow.python.keras._impl.keras import constraints
from tensorflow.python.keras._impl.keras import initializers
from tensorflow.python.keras._impl.keras import regularizers
from tensorflow.python.keras._impl.keras.engine import InputSpec
from tensorflow.python.keras._impl.keras.engine import Layer
from tensorflow.python.keras._impl.keras.engine.base_layer import shape_type_conversion
from tensorflow.python.keras._impl.keras.utils.generic_utils import has_arg
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util.tf_export import tf_export
@tf_export('keras.layers.StackedRNNCells')
class StackedRNNCells(Layer):
"""Wrapper allowing a stack of RNN cells to behave as a single cell.
Used to implement efficient stacked RNNs.
Arguments:
cells: List of RNN cell instances.
Examples:
```python
cells = [
keras.layers.LSTMCell(output_dim),
keras.layers.LSTMCell(output_dim),
keras.layers.LSTMCell(output_dim),
]
inputs = keras.Input((timesteps, input_dim))
x = keras.layers.RNN(cells)(inputs)
```
"""
def __init__(self, cells, **kwargs):
for cell in cells:
if not hasattr(cell, 'call'):
raise ValueError('All cells must have a `call` method. '
'received cells:', cells)
if not hasattr(cell, 'state_size'):
raise ValueError('All cells must have a '
'`state_size` attribute. '
'received cells:', cells)
self.cells = cells
super(StackedRNNCells, self).__init__(**kwargs)
@property
def state_size(self):
# States are a flat list
# in reverse order of the cell stack.
# This allows to preserve the requirement
# `stack.state_size[0] == output_dim`.
# e.g. states of a 2-layer LSTM would be
# `[h2, c2, h1, c1]`
# (assuming one LSTM has states [h, c])
state_size = []
for cell in self.cells[::-1]:
if hasattr(cell.state_size, '__len__'):
state_size += list(cell.state_size)
else:
state_size.append(cell.state_size)
return tuple(state_size)
def call(self, inputs, states, constants=None, **kwargs):
# Recover per-cell states.
nested_states = []
for cell in self.cells[::-1]:
if hasattr(cell.state_size, '__len__'):
nested_states.append(states[:len(cell.state_size)])
states = states[len(cell.state_size):]
else:
nested_states.append([states[0]])
states = states[1:]
nested_states = nested_states[::-1]
# Call the cells in order and store the returned states.
new_nested_states = []
for cell, states in zip(self.cells, nested_states):
if has_arg(cell.call, 'constants'):
inputs, states = cell.call(inputs, states, constants=constants,
**kwargs)
else:
inputs, states = cell.call(inputs, states, **kwargs)
new_nested_states.append(states)
# Format the new states as a flat list
# in reverse cell order.
states = []
for cell_states in new_nested_states[::-1]:
states += cell_states
return inputs, states
@shape_type_conversion
def build(self, input_shape):
if isinstance(input_shape, list):
constants_shape = input_shape[1:]
input_shape = input_shape[0]
for cell in self.cells:
if isinstance(cell, Layer):
if has_arg(cell.call, 'constants'):
cell.build([input_shape] + constants_shape)
else:
cell.build(input_shape)
if hasattr(cell.state_size, '__len__'):
output_dim = cell.state_size[0]
else:
output_dim = cell.state_size
input_shape = (input_shape[0], output_dim)
self.built = True
def get_config(self):
cells = []
for cell in self.cells:
cells.append({
'class_name': cell.__class__.__name__,
'config': cell.get_config()
})
config = {'cells': cells}
base_config = super(StackedRNNCells, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
@classmethod
def from_config(cls, config, custom_objects=None):
from tensorflow.python.keras._impl.keras.layers import deserialize as deserialize_layer # pylint: disable=g-import-not-at-top
cells = []
for cell_config in config.pop('cells'):
cells.append(
deserialize_layer(cell_config, custom_objects=custom_objects))
return cls(cells, **config)
@property
def trainable_weights(self):
if not self.trainable:
return []
weights = []
for cell in self.cells:
if isinstance(cell, Layer):
weights += cell.trainable_weights
return weights
@property
def non_trainable_weights(self):
weights = []
for cell in self.cells:
if isinstance(cell, Layer):
weights += cell.non_trainable_weights
if not self.trainable:
trainable_weights = []
for cell in self.cells:
if isinstance(cell, Layer):
trainable_weights += cell.trainable_weights
return trainable_weights + weights
return weights
def get_weights(self):
"""Retrieves the weights of the model.
Returns:
A flat list of Numpy arrays.
"""
weights = []
for cell in self.cells:
if isinstance(cell, Layer):
weights += cell.weights
return K.batch_get_value(weights)
def set_weights(self, weights):
"""Sets the weights of the model.
Arguments:
weights: A list of Numpy arrays with shapes and types matching
the output of `model.get_weights()`.
"""
tuples = []
for cell in self.cells:
if isinstance(cell, Layer):
num_param = len(cell.weights)
weights = weights[:num_param]
for sw, w in zip(cell.weights, weights):
tuples.append((sw, w))
weights = weights[num_param:]
K.batch_set_value(tuples)
@property
def losses(self):
losses = []
for cell in self.cells:
if isinstance(cell, Layer):
losses += cell.losses
return losses + self._losses
@property
def updates(self):
updates = []
for cell in self.cells:
if isinstance(cell, Layer):
updates += cell.updates
return updates + self._updates
@tf_export('keras.layers.RNN')
class RNN(Layer):
"""Base class for recurrent layers.
Arguments:
cell: A RNN cell instance. A RNN cell is a class that has:
- a `call(input_at_t, states_at_t)` method, returning
`(output_at_t, states_at_t_plus_1)`. The call method of the
cell can also take the optional argument `constants`, see
section "Note on passing external constants" below.
- a `state_size` attribute. This can be a single integer
(single state) in which case it is
the size of the recurrent state
(which should be the same as the size of the cell output).
This can also be a list/tuple of integers
(one size per state). In this case, the first entry
(`state_size[0]`) should be the same as
the size of the cell output.
It is also possible for `cell` to be a list of RNN cell instances,
in which cases the cells get stacked on after the other in the RNN,
implementing an efficient stacked RNN.
return_sequences: Boolean. Whether to return the last output
in the output sequence, or the full sequence.
return_state: Boolean. Whether to return the last state
in addition to the output.
go_backwards: Boolean (default False).
If True, process the input sequence backwards and return the
reversed sequence.
stateful: Boolean (default False). If True, the last state
for each sample at index i in a batch will be used as initial
state for the sample of index i in the following batch.
unroll: Boolean (default False).
If True, the network will be unrolled,
else a symbolic loop will be used.
Unrolling can speed-up a RNN,
although it tends to be more memory-intensive.
Unrolling is only suitable for short sequences.
input_dim: dimensionality of the input (integer).
This argument (or alternatively,
the keyword argument `input_shape`)
is required when using this layer as the first layer in a model.
input_length: Length of input sequences, to be specified
when it is constant.
This argument is required if you are going to connect
`Flatten` then `Dense` layers upstream
(without it, the shape of the dense outputs cannot be computed).
Note that if the recurrent layer is not the first layer
in your model, you would need to specify the input length
at the level of the first layer
(e.g. via the `input_shape` argument)
Input shape:
3D tensor with shape `(batch_size, timesteps, input_dim)`.
Output shape:
- if `return_state`: a list of tensors. The first tensor is
the output. The remaining tensors are the last states,
each with shape `(batch_size, units)`.
- if `return_sequences`: 3D tensor with shape
`(batch_size, timesteps, units)`.
- else, 2D tensor with shape `(batch_size, units)`.
# Masking
This layer supports masking for input data with a variable number
of timesteps. To introduce masks to your data,
use an [Embedding](embeddings.md) layer with the `mask_zero` parameter
set to `True`.
# Note on using statefulness in RNNs
You can set RNN layers to be 'stateful', which means that the states
computed for the samples in one batch will be reused as initial states
for the samples in the next batch. This assumes a one-to-one mapping
between samples in different successive batches.
To enable statefulness:
- specify `stateful=True` in the layer constructor.
- specify a fixed batch size for your model, by passing
if sequential model:
`batch_input_shape=(...)` to the first layer in your model.
else for functional model with 1 or more Input layers:
`batch_shape=(...)` to all the first layers in your model.
This is the expected shape of your inputs
*including the batch size*.
It should be a tuple of integers, e.g. `(32, 10, 100)`.
- specify `shuffle=False` when calling fit().
To reset the states of your model, call `.reset_states()` on either
a specific layer, or on your entire model.
# Note on specifying the initial state of RNNs
You can specify the initial state of RNN layers symbolically by
calling them with the keyword argument `initial_state`. The value of
`initial_state` should be a tensor or list of tensors representing
the initial state of the RNN layer.
You can specify the initial state of RNN layers numerically by
calling `reset_states` with the keyword argument `states`. The value of
`states` should be a numpy array or list of numpy arrays representing
the initial state of the RNN layer.
# Note on passing external constants to RNNs
You can pass "external" constants to the cell using the `constants`
keyword argument of `RNN.__call__` (as well as `RNN.call`) method. This
requires that the `cell.call` method accepts the same keyword argument
`constants`. Such constants can be used to condition the cell
transformation on additional static inputs (not changing over time),
a.k.a. an attention mechanism.
Examples:
```python
# First, let's define a RNN Cell, as a layer subclass.
class MinimalRNNCell(keras.layers.Layer):
def __init__(self, units, **kwargs):
self.units = units
self.state_size = units
super(MinimalRNNCell, self).__init__(**kwargs)
def build(self, input_shape):
self.kernel = self.add_weight(shape=(input_shape[-1], self.units),
initializer='uniform',
name='kernel')
self.recurrent_kernel = self.add_weight(
shape=(self.units, self.units),
initializer='uniform',
name='recurrent_kernel')
self.built = True
def call(self, inputs, states):
prev_output = states[0]
h = K.dot(inputs, self.kernel)
output = h + K.dot(prev_output, self.recurrent_kernel)
return output, [output]
# Let's use this cell in a RNN layer:
cell = MinimalRNNCell(32)
x = keras.Input((None, 5))
layer = RNN(cell)
y = layer(x)
# Here's how to use the cell to build a stacked RNN:
cells = [MinimalRNNCell(32), MinimalRNNCell(64)]
x = keras.Input((None, 5))
layer = RNN(cells)
y = layer(x)
```
"""
def __init__(self,
cell,
return_sequences=False,
return_state=False,
go_backwards=False,
stateful=False,
unroll=False,
**kwargs):
if isinstance(cell, (list, tuple)):
cell = StackedRNNCells(cell)
if not hasattr(cell, 'call'):
raise ValueError('`cell` should have a `call` method. '
'The RNN was passed:', cell)
if not hasattr(cell, 'state_size'):
raise ValueError('The RNN cell should have '
'an attribute `state_size` '
'(tuple of integers, '
'one integer per RNN state).')
super(RNN, self).__init__(**kwargs)
self.cell = cell
self.return_sequences = return_sequences
self.return_state = return_state
self.go_backwards = go_backwards
self.stateful = stateful
self.unroll = unroll
self.supports_masking = True
self.input_spec = [InputSpec(ndim=3)]
self.state_spec = None
self._states = None
self.constants_spec = None
self._num_constants = None
@property
def states(self):
if self._states is None:
if isinstance(self.cell.state_size, numbers.Integral):
num_states = 1
else:
num_states = len(self.cell.state_size)
return [None for _ in range(num_states)]
return self._states
@states.setter
def states(self, states):
self._states = states
@shape_type_conversion
def compute_output_shape(self, input_shape):
if isinstance(input_shape, list):
input_shape = input_shape[0]
if hasattr(self.cell.state_size, '__len__'):
state_size = self.cell.state_size
else:
state_size = [self.cell.state_size]
output_dim = state_size[0]
if self.return_sequences:
output_shape = (input_shape[0], input_shape[1], output_dim)
else:
output_shape = (input_shape[0], output_dim)
if self.return_state:
state_shape = [(input_shape[0], dim) for dim in state_size]
return [output_shape] + state_shape
else:
return output_shape
def compute_mask(self, inputs, mask):
if isinstance(mask, list):
mask = mask[0]
output_mask = mask if self.return_sequences else None
if self.return_state:
state_mask = [None for _ in self.states]
return [output_mask] + state_mask
else:
return output_mask
@shape_type_conversion
def build(self, input_shape):
# Note input_shape will be list of shapes of initial states and
# constants if these are passed in __call__.
if self._num_constants is not None:
constants_shape = input_shape[-self._num_constants:] # pylint: disable=invalid-unary-operand-type
else:
constants_shape = None
if isinstance(input_shape, list):
input_shape = input_shape[0]
batch_size = input_shape[0] if self.stateful else None
input_dim = input_shape[-1]
self.input_spec[0] = InputSpec(shape=(batch_size, None, input_dim))
# allow cell (if layer) to build before we set or validate state_spec
if isinstance(self.cell, Layer):
step_input_shape = (input_shape[0],) + input_shape[2:]
if constants_shape is not None:
self.cell.build([step_input_shape] + constants_shape)
else:
self.cell.build(step_input_shape)
# set or validate state_spec
if hasattr(self.cell.state_size, '__len__'):
state_size = list(self.cell.state_size)
else:
state_size = [self.cell.state_size]
if self.state_spec is not None:
# initial_state was passed in call, check compatibility
if [spec.shape[-1] for spec in self.state_spec] != state_size:
raise ValueError(
'An `initial_state` was passed that is not compatible with '
'`cell.state_size`. Received `state_spec`={}; '
'however `cell.state_size` is '
'{}'.format(self.state_spec, self.cell.state_size))
else:
self.state_spec = [InputSpec(shape=(None, dim)) for dim in state_size]
if self.stateful:
self.reset_states()
def get_initial_state(self, inputs):
# build an all-zero tensor of shape (samples, output_dim)
initial_state = array_ops.zeros_like(inputs)
# shape of initial_state = (samples, timesteps, input_dim)
initial_state = math_ops.reduce_sum(initial_state, axis=(1, 2))
# shape of initial_state = (samples,)
initial_state = array_ops.expand_dims(initial_state, axis=-1)
# shape of initial_state = (samples, 1)
if hasattr(self.cell.state_size, '__len__'):
return [K.tile(initial_state, [1, dim]) for dim in self.cell.state_size]
else:
return [K.tile(initial_state, [1, self.cell.state_size])]
def __call__(self, inputs, initial_state=None, constants=None, **kwargs):
inputs, initial_state, constants = self._standardize_args(
inputs, initial_state, constants)
if initial_state is None and constants is None:
return super(RNN, self).__call__(inputs, **kwargs)
# If any of `initial_state` or `constants` are specified and are Keras
# tensors, then add them to the inputs and temporarily modify the
# input_spec to include them.
additional_inputs = []
additional_specs = []
if initial_state is not None:
kwargs['initial_state'] = initial_state
additional_inputs += initial_state
self.state_spec = [
InputSpec(shape=K.int_shape(state)) for state in initial_state
]
additional_specs += self.state_spec
if constants is not None:
kwargs['constants'] = constants
additional_inputs += constants
self.constants_spec = [
InputSpec(shape=K.int_shape(constant)) for constant in constants
]
self._num_constants = len(constants)
additional_specs += self.constants_spec
# at this point additional_inputs cannot be empty
is_keras_tensor = K.is_keras_tensor(additional_inputs[0])
for tensor in additional_inputs:
if K.is_keras_tensor(tensor) != is_keras_tensor:
raise ValueError('The initial state or constants of an RNN'
' layer cannot be specified with a mix of'
' Keras tensors and non-Keras tensors'
' (a "Keras tensor" is a tensor that was'
' returned by a Keras layer, or by `Input`)')
if is_keras_tensor:
# Compute the full input spec, including state and constants
full_input = [inputs] + additional_inputs
full_input_spec = self.input_spec + additional_specs
# Perform the call with temporarily replaced input_spec
original_input_spec = self.input_spec
self.input_spec = full_input_spec
output = super(RNN, self).__call__(full_input, **kwargs)
self.input_spec = original_input_spec
return output
else:
return super(RNN, self).__call__(inputs, **kwargs)
def call(self,
inputs,
mask=None,
training=None,
initial_state=None,
constants=None):
# input shape: `(samples, time (padded with zeros), input_dim)`
# note that the .build() method of subclasses MUST define
# self.input_spec and self.state_spec with complete input shapes.
if isinstance(inputs, list):
inputs = inputs[0]
if initial_state is not None:
pass
elif self.stateful:
initial_state = self.states
else:
initial_state = self.get_initial_state(inputs)
if isinstance(mask, list):
mask = mask[0]
if len(initial_state) != len(self.states):
raise ValueError(
'Layer has ' + str(len(self.states)) + ' states but was passed ' +
str(len(initial_state)) + ' initial states.')
input_shape = K.int_shape(inputs)
timesteps = input_shape[1]
if self.unroll and timesteps in [None, 1]:
raise ValueError('Cannot unroll a RNN if the '
'time dimension is undefined or equal to 1. \n'
'- If using a Sequential model, '
'specify the time dimension by passing '
'an `input_shape` or `batch_input_shape` '
'argument to your first layer. If your '
'first layer is an Embedding, you can '
'also use the `input_length` argument.\n'
'- If using the functional API, specify '
'the time dimension by passing a `shape` '
'or `batch_shape` argument to your Input layer.')
kwargs = {}
if has_arg(self.cell.call, 'training'):
kwargs['training'] = training
if constants:
if not has_arg(self.cell.call, 'constants'):
raise ValueError('RNN cell does not support constants')
def step(inputs, states):
constants = states[-self._num_constants:] # pylint: disable=invalid-unary-operand-type
states = states[:-self._num_constants] # pylint: disable=invalid-unary-operand-type
return self.cell.call(inputs, states, constants=constants, **kwargs)
else:
def step(inputs, states):
return self.cell.call(inputs, states, **kwargs)
last_output, outputs, states = K.rnn(
step,
inputs,
initial_state,
constants=constants,
go_backwards=self.go_backwards,
mask=mask,
unroll=self.unroll,
input_length=timesteps)
if self.stateful:
updates = []
for i in range(len(states)):
updates.append(state_ops.assign(self.states[i], states[i]))
self.add_update(updates, inputs)
if self.return_sequences:
output = outputs
else:
output = last_output
# Properly set learning phase
if getattr(last_output, '_uses_learning_phase', False):
output._uses_learning_phase = True
for state in states:
state._uses_learning_phase = True
if self.return_state:
if not isinstance(states, (list, tuple)):
states = [states]
else:
states = list(states)
return [output] + states
else:
return output
def _standardize_args(self, inputs, initial_state, constants):
"""Standardize `__call__` to a single list of tensor inputs.
When running a model loaded from file, the input tensors
`initial_state` and `constants` can be passed to `RNN.__call__` as part
of `inputs` instead of by the dedicated keyword arguments. This method
makes sure the arguments are separated and that `initial_state` and
`constants` are lists of tensors (or None).
Arguments:
inputs: tensor or list/tuple of tensors
initial_state: tensor or list of tensors or None
constants: tensor or list of tensors or None
Returns:
inputs: tensor
initial_state: list of tensors or None
constants: list of tensors or None
"""
if isinstance(inputs, list):
assert initial_state is None and constants is None
if self._num_constants is not None:
constants = inputs[-self._num_constants:] # pylint: disable=invalid-unary-operand-type
inputs = inputs[:-self._num_constants] # pylint: disable=invalid-unary-operand-type
if len(inputs) > 1:
initial_state = inputs[1:]
inputs = inputs[0]
def to_list_or_none(x):
if x is None or isinstance(x, list):
return x
if isinstance(x, tuple):
return list(x)
return [x]
initial_state = to_list_or_none(initial_state)
constants = to_list_or_none(constants)
return inputs, initial_state, constants
def reset_states(self, states=None):
if not self.stateful:
raise AttributeError('Layer must be stateful.')
batch_size = self.input_spec[0].shape[0]
if not batch_size:
raise ValueError('If a RNN is stateful, it needs to know '
'its batch size. Specify the batch size '
'of your input tensors: \n'
'- If using a Sequential model, '
'specify the batch size by passing '
'a `batch_input_shape` '
'argument to your first layer.\n'
'- If using the functional API, specify '
'the batch size by passing a '
'`batch_shape` argument to your Input layer.')
# initialize state if None
if self.states[0] is None:
if hasattr(self.cell.state_size, '__len__'):
self.states = [
K.zeros((batch_size, dim)) for dim in self.cell.state_size
]
else:
self.states = [K.zeros((batch_size, self.cell.state_size))]
elif states is None:
if hasattr(self.cell.state_size, '__len__'):
for state, dim in zip(self.states, self.cell.state_size):
K.set_value(state, np.zeros((batch_size, dim)))
else:
K.set_value(self.states[0], np.zeros((batch_size,
self.cell.state_size)))
else:
if not isinstance(states, (list, tuple)):
states = [states]
if len(states) != len(self.states):
raise ValueError('Layer ' + self.name + ' expects ' +
str(len(self.states)) + ' states, '
'but it received ' + str(len(states)) +
' state values. Input received: ' + str(states))
for index, (value, state) in enumerate(zip(states, self.states)):
if hasattr(self.cell.state_size, '__len__'):
dim = self.cell.state_size[index]
else:
dim = self.cell.state_size
if value.shape != (batch_size, dim):
raise ValueError(
'State ' + str(index) + ' is incompatible with layer ' +
self.name + ': expected shape=' + str(
(batch_size, dim)) + ', found shape=' + str(value.shape))
# TODO(fchollet): consider batch calls to `set_value`.
K.set_value(state, value)
def get_config(self):
config = {
'return_sequences': self.return_sequences,
'return_state': self.return_state,
'go_backwards': self.go_backwards,
'stateful': self.stateful,
'unroll': self.unroll
}
if self._num_constants is not None:
config['num_constants'] = self._num_constants
cell_config = self.cell.get_config()
config['cell'] = {
'class_name': self.cell.__class__.__name__,
'config': cell_config
}
base_config = super(RNN, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
@classmethod
def from_config(cls, config, custom_objects=None):
from tensorflow.python.keras._impl.keras.layers import deserialize as deserialize_layer # pylint: disable=g-import-not-at-top
cell = deserialize_layer(config.pop('cell'), custom_objects=custom_objects)
num_constants = config.pop('num_constants', None)
layer = cls(cell, **config)
layer._num_constants = num_constants
return layer
@property
def trainable_weights(self):
if not self.trainable:
return []
if isinstance(self.cell, Layer):
return self.cell.trainable_weights
return []
@property
def non_trainable_weights(self):
if isinstance(self.cell, Layer):
if not self.trainable:
return self.cell.weights
return self.cell.non_trainable_weights
return []
@property
def losses(self):
layer_losses = super(RNN, self).losses
if isinstance(self.cell, Layer):
return self.cell.losses + layer_losses
return layer_losses
@property
def updates(self):
updates = []
if isinstance(self.cell, Layer):
updates += self.cell.updates
return updates + self._updates
@tf_export('keras.layers.SimpleRNNCell')
class SimpleRNNCell(Layer):
"""Cell class for SimpleRNN.
Arguments:
units: Positive integer, dimensionality of the output space.
activation: Activation function to use.
Default: hyperbolic tangent (`tanh`).
If you pass `None`, no activation is applied
(ie. "linear" activation: `a(x) = x`).
use_bias: Boolean, whether the layer uses a bias vector.
kernel_initializer: Initializer for the `kernel` weights matrix,
used for the linear transformation of the inputs.
recurrent_initializer: Initializer for the `recurrent_kernel`
weights matrix,
used for the linear transformation of the recurrent state.
bias_initializer: Initializer for the bias vector.
kernel_regularizer: Regularizer function applied to
the `kernel` weights matrix.
recurrent_regularizer: Regularizer function applied to
the `recurrent_kernel` weights matrix.
bias_regularizer: Regularizer function applied to the bias vector.
kernel_constraint: Constraint function applied to
the `kernel` weights matrix.
recurrent_constraint: Constraint function applied to
the `recurrent_kernel` weights matrix.
bias_constraint: Constraint function applied to the bias vector.
dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the inputs.
recurrent_dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the recurrent state.
"""
def __init__(self,
units,
activation='tanh',
use_bias=True,
kernel_initializer='glorot_uniform',
recurrent_initializer='orthogonal',
bias_initializer='zeros',
kernel_regularizer=None,
recurrent_regularizer=None,
bias_regularizer=None,
kernel_constraint=None,
recurrent_constraint=None,
bias_constraint=None,
dropout=0.,
recurrent_dropout=0.,
**kwargs):
super(SimpleRNNCell, self).__init__(**kwargs)
self.units = units
self.activation = activations.get(activation)
self.use_bias = use_bias
self.kernel_initializer = initializers.get(kernel_initializer)
self.recurrent_initializer = initializers.get(recurrent_initializer)
self.bias_initializer = initializers.get(bias_initializer)
self.kernel_regularizer = regularizers.get(kernel_regularizer)
self.recurrent_regularizer = regularizers.get(recurrent_regularizer)
self.bias_regularizer = regularizers.get(bias_regularizer)
self.kernel_constraint = constraints.get(kernel_constraint)
self.recurrent_constraint = constraints.get(recurrent_constraint)
self.bias_constraint = constraints.get(bias_constraint)
self.dropout = min(1., max(0., dropout))
self.recurrent_dropout = min(1., max(0., recurrent_dropout))
self.state_size = self.units
self._dropout_mask = None
self._recurrent_dropout_mask = None
@shape_type_conversion
def build(self, input_shape):
self.kernel = self.add_weight(
shape=(input_shape[-1], self.units),
name='kernel',
initializer=self.kernel_initializer,
regularizer=self.kernel_regularizer,
constraint=self.kernel_constraint)
self.recurrent_kernel = self.add_weight(
shape=(self.units, self.units),
name='recurrent_kernel',
initializer=self.recurrent_initializer,
regularizer=self.recurrent_regularizer,
constraint=self.recurrent_constraint)
if self.use_bias:
self.bias = self.add_weight(
shape=(self.units,),
name='bias',
initializer=self.bias_initializer,
regularizer=self.bias_regularizer,
constraint=self.bias_constraint)
else:
self.bias = None
self.built = True
def call(self, inputs, states, training=None):
prev_output = states[0]
if 0 < self.dropout < 1 and self._dropout_mask is None:
self._dropout_mask = _generate_dropout_mask(
_generate_dropout_ones(inputs, array_ops.shape(inputs)[-1]),
self.dropout,
training=training)
if (0 < self.recurrent_dropout < 1 and
self._recurrent_dropout_mask is None):
self._recurrent_dropout_mask = _generate_dropout_mask(
_generate_dropout_ones(inputs, self.units),
self.recurrent_dropout,
training=training)
dp_mask = self._dropout_mask
rec_dp_mask = self._recurrent_dropout_mask
if dp_mask is not None:
h = K.dot(inputs * dp_mask, self.kernel)
else:
h = K.dot(inputs, self.kernel)
if self.bias is not None:
h = K.bias_add(h, self.bias)
if rec_dp_mask is not None:
prev_output *= rec_dp_mask
output = h + K.dot(prev_output, self.recurrent_kernel)
if self.activation is not None:
output = self.activation(output)
# Properly set learning phase on output tensor.
if 0 < self.dropout + self.recurrent_dropout:
if training is None and not context.executing_eagerly():
# This would be harmless to set in eager mode, but eager tensors
# disallow setting arbitrary attributes.
output._uses_learning_phase = True
return output, [output]
def get_config(self):
config = {
'units':
self.units,
'activation':
activations.serialize(self.activation),
'use_bias':
self.use_bias,
'kernel_initializer':
initializers.serialize(self.kernel_initializer),
'recurrent_initializer':
initializers.serialize(self.recurrent_initializer),
'bias_initializer':
initializers.serialize(self.bias_initializer),
'kernel_regularizer':
regularizers.serialize(self.kernel_regularizer),
'recurrent_regularizer':
regularizers.serialize(self.recurrent_regularizer),
'bias_regularizer':
regularizers.serialize(self.bias_regularizer),
'kernel_constraint':
constraints.serialize(self.kernel_constraint),
'recurrent_constraint':
constraints.serialize(self.recurrent_constraint),
'bias_constraint':
constraints.serialize(self.bias_constraint),
'dropout':
self.dropout,
'recurrent_dropout':
self.recurrent_dropout
}
base_config = super(SimpleRNNCell, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
@tf_export('keras.layers.SimpleRNN')
class SimpleRNN(RNN):
"""Fully-connected RNN where the output is to be fed back to input.
Arguments:
units: Positive integer, dimensionality of the output space.
activation: Activation function to use.
Default: hyperbolic tangent (`tanh`).
If you pass None, no activation is applied
(ie. "linear" activation: `a(x) = x`).
use_bias: Boolean, whether the layer uses a bias vector.
kernel_initializer: Initializer for the `kernel` weights matrix,
used for the linear transformation of the inputs.
recurrent_initializer: Initializer for the `recurrent_kernel`
weights matrix,
used for the linear transformation of the recurrent state.
bias_initializer: Initializer for the bias vector.
kernel_regularizer: Regularizer function applied to
the `kernel` weights matrix.
recurrent_regularizer: Regularizer function applied to
the `recurrent_kernel` weights matrix.
bias_regularizer: Regularizer function applied to the bias vector.
activity_regularizer: Regularizer function applied to
the output of the layer (its "activation")..
kernel_constraint: Constraint function applied to
the `kernel` weights matrix.
recurrent_constraint: Constraint function applied to
the `recurrent_kernel` weights matrix.
bias_constraint: Constraint function applied to the bias vector.
dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the inputs.
recurrent_dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the recurrent state.
return_sequences: Boolean. Whether to return the last output
in the output sequence, or the full sequence.
return_state: Boolean. Whether to return the last state
in addition to the output.
go_backwards: Boolean (default False).
If True, process the input sequence backwards and return the
reversed sequence.
stateful: Boolean (default False). If True, the last state
for each sample at index i in a batch will be used as initial
state for the sample of index i in the following batch.
unroll: Boolean (default False).
If True, the network will be unrolled,
else a symbolic loop will be used.
Unrolling can speed-up a RNN,
although it tends to be more memory-intensive.
Unrolling is only suitable for short sequences.
"""
def __init__(self,
units,
activation='tanh',
use_bias=True,
kernel_initializer='glorot_uniform',
recurrent_initializer='orthogonal',
bias_initializer='zeros',
kernel_regularizer=None,
recurrent_regularizer=None,
bias_regularizer=None,
activity_regularizer=None,
kernel_constraint=None,
recurrent_constraint=None,
bias_constraint=None,
dropout=0.,
recurrent_dropout=0.,
return_sequences=False,
return_state=False,
go_backwards=False,
stateful=False,
unroll=False,
**kwargs):
if 'implementation' in kwargs:
kwargs.pop('implementation')
logging.warning('The `implementation` argument '
'in `SimpleRNN` has been deprecated. '
'Please remove it from your layer call.')
cell = SimpleRNNCell(
units,
activation=activation,
use_bias=use_bias,
kernel_initializer=kernel_initializer,
recurrent_initializer=recurrent_initializer,
bias_initializer=bias_initializer,
kernel_regularizer=kernel_regularizer,
recurrent_regularizer=recurrent_regularizer,
bias_regularizer=bias_regularizer,
kernel_constraint=kernel_constraint,
recurrent_constraint=recurrent_constraint,
bias_constraint=bias_constraint,
dropout=dropout,
recurrent_dropout=recurrent_dropout)
super(SimpleRNN, self).__init__(
cell,
return_sequences=return_sequences,
return_state=return_state,
go_backwards=go_backwards,
stateful=stateful,
unroll=unroll,
**kwargs)
self.activity_regularizer = regularizers.get(activity_regularizer)
def call(self, inputs, mask=None, training=None, initial_state=None):
self.cell._dropout_mask = None
self.cell._recurrent_dropout_mask = None
return super(SimpleRNN, self).call(
inputs, mask=mask, training=training, initial_state=initial_state)
@property
def units(self):
return self.cell.units
@property
def activation(self):
return self.cell.activation
@property
def use_bias(self):
return self.cell.use_bias
@property
def kernel_initializer(self):
return self.cell.kernel_initializer
@property
def recurrent_initializer(self):
return self.cell.recurrent_initializer
@property
def bias_initializer(self):
return self.cell.bias_initializer
@property
def kernel_regularizer(self):
return self.cell.kernel_regularizer
@property
def recurrent_regularizer(self):
return self.cell.recurrent_regularizer
@property
def bias_regularizer(self):
return self.cell.bias_regularizer
@property
def kernel_constraint(self):
return self.cell.kernel_constraint
@property
def recurrent_constraint(self):
return self.cell.recurrent_constraint
@property
def bias_constraint(self):
return self.cell.bias_constraint
@property
def dropout(self):
return self.cell.dropout
@property
def recurrent_dropout(self):
return self.cell.recurrent_dropout
def get_config(self):
config = {
'units':
self.units,
'activation':
activations.serialize(self.activation),
'use_bias':
self.use_bias,
'kernel_initializer':
initializers.serialize(self.kernel_initializer),
'recurrent_initializer':
initializers.serialize(self.recurrent_initializer),
'bias_initializer':
initializers.serialize(self.bias_initializer),
'kernel_regularizer':
regularizers.serialize(self.kernel_regularizer),
'recurrent_regularizer':
regularizers.serialize(self.recurrent_regularizer),
'bias_regularizer':
regularizers.serialize(self.bias_regularizer),
'activity_regularizer':
regularizers.serialize(self.activity_regularizer),
'kernel_constraint':
constraints.serialize(self.kernel_constraint),
'recurrent_constraint':
constraints.serialize(self.recurrent_constraint),
'bias_constraint':
constraints.serialize(self.bias_constraint),
'dropout':
self.dropout,
'recurrent_dropout':
self.recurrent_dropout
}
base_config = super(SimpleRNN, self).get_config()
del base_config['cell']
return dict(list(base_config.items()) + list(config.items()))
@classmethod
def from_config(cls, config):
if 'implementation' in config:
config.pop('implementation')
return cls(**config)
@tf_export('keras.layers.GRUCell')
class GRUCell(Layer):
"""Cell class for the GRU layer.
Arguments:
units: Positive integer, dimensionality of the output space.
activation: Activation function to use.
Default: hyperbolic tangent (`tanh`).
If you pass None, no activation is applied
(ie. "linear" activation: `a(x) = x`).
recurrent_activation: Activation function to use
for the recurrent step.
Default: hard sigmoid (`hard_sigmoid`).
If you pass `None`, no activation is applied
(ie. "linear" activation: `a(x) = x`).
use_bias: Boolean, whether the layer uses a bias vector.
kernel_initializer: Initializer for the `kernel` weights matrix,
used for the linear transformation of the inputs.
recurrent_initializer: Initializer for the `recurrent_kernel`
weights matrix,
used for the linear transformation of the recurrent state.
bias_initializer: Initializer for the bias vector.
kernel_regularizer: Regularizer function applied to
the `kernel` weights matrix.
recurrent_regularizer: Regularizer function applied to
the `recurrent_kernel` weights matrix.
bias_regularizer: Regularizer function applied to the bias vector.
kernel_constraint: Constraint function applied to
the `kernel` weights matrix.
recurrent_constraint: Constraint function applied to
the `recurrent_kernel` weights matrix.
bias_constraint: Constraint function applied to the bias vector.
dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the inputs.
recurrent_dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the recurrent state.
implementation: Implementation mode, either 1 or 2.
Mode 1 will structure its operations as a larger number of
smaller dot products and additions, whereas mode 2 will
batch them into fewer, larger operations. These modes will
have different performance profiles on different hardware and
for different applications.
reset_after: GRU convention (whether to apply reset gate after or
before matrix multiplication). False = "before" (default),
True = "after" (CuDNN compatible).
"""
def __init__(self,
units,
activation='tanh',
recurrent_activation='hard_sigmoid',
use_bias=True,
kernel_initializer='glorot_uniform',
recurrent_initializer='orthogonal',
bias_initializer='zeros',
kernel_regularizer=None,
recurrent_regularizer=None,
bias_regularizer=None,
kernel_constraint=None,
recurrent_constraint=None,
bias_constraint=None,
dropout=0.,
recurrent_dropout=0.,
implementation=1,
reset_after=False,
**kwargs):
super(GRUCell, self).__init__(**kwargs)
self.units = units
self.activation = activations.get(activation)
self.recurrent_activation = activations.get(recurrent_activation)
self.use_bias = use_bias
self.kernel_initializer = initializers.get(kernel_initializer)
self.recurrent_initializer = initializers.get(recurrent_initializer)
self.bias_initializer = initializers.get(bias_initializer)
self.kernel_regularizer = regularizers.get(kernel_regularizer)
self.recurrent_regularizer = regularizers.get(recurrent_regularizer)
self.bias_regularizer = regularizers.get(bias_regularizer)
self.kernel_constraint = constraints.get(kernel_constraint)
self.recurrent_constraint = constraints.get(recurrent_constraint)
self.bias_constraint = constraints.get(bias_constraint)
self.dropout = min(1., max(0., dropout))
self.recurrent_dropout = min(1., max(0., recurrent_dropout))
self.implementation = implementation
self.reset_after = reset_after
self.state_size = self.units
self._dropout_mask = None
self._recurrent_dropout_mask = None
@shape_type_conversion
def build(self, input_shape):
input_dim = input_shape[-1]
self.kernel = self.add_weight(
shape=(input_dim, self.units * 3),
name='kernel',
initializer=self.kernel_initializer,
regularizer=self.kernel_regularizer,
constraint=self.kernel_constraint)
self.recurrent_kernel = self.add_weight(
shape=(self.units, self.units * 3),
name='recurrent_kernel',
initializer=self.recurrent_initializer,
regularizer=self.recurrent_regularizer,
constraint=self.recurrent_constraint)
if self.use_bias:
if not self.reset_after:
bias_shape = (3 * self.units,)
else:
# separate biases for input and recurrent kernels
# Note: the shape is intentionally different from CuDNNGRU biases
# `(2 * 3 * self.units,)`, so that we can distinguish the classes
# when loading and converting saved weights.
bias_shape = (2, 3 * self.units)
self.bias = self.add_weight(shape=bias_shape,
name='bias',
initializer=self.bias_initializer,
regularizer=self.bias_regularizer,
constraint=self.bias_constraint)
if not self.reset_after:
self.input_bias, self.recurrent_bias = self.bias, None
else:
self.input_bias = K.flatten(self.bias[0])
self.recurrent_bias = K.flatten(self.bias[1])
else:
self.bias = None
self.built = True
def call(self, inputs, states, training=None):
h_tm1 = states[0] # previous memory
if 0 < self.dropout < 1 and self._dropout_mask is None:
self._dropout_mask = _generate_dropout_mask(
_generate_dropout_ones(inputs, array_ops.shape(inputs)[-1]),
self.dropout,
training=training,
count=3)
if (0 < self.recurrent_dropout < 1 and
self._recurrent_dropout_mask is None):
self._recurrent_dropout_mask = _generate_dropout_mask(
_generate_dropout_ones(inputs, self.units),
self.recurrent_dropout,
training=training,
count=3)
# dropout matrices for input units
dp_mask = self._dropout_mask
# dropout matrices for recurrent units
rec_dp_mask = self._recurrent_dropout_mask
if self.implementation == 1:
if 0. < self.dropout < 1.:
inputs_z = inputs * dp_mask[0]
inputs_r = inputs * dp_mask[1]
inputs_h = inputs * dp_mask[2]
else:
inputs_z = inputs
inputs_r = inputs
inputs_h = inputs
x_z = K.dot(inputs_z, self.kernel[:, :self.units])
x_r = K.dot(inputs_r, self.kernel[:, self.units:self.units * 2])
x_h = K.dot(inputs_h, self.kernel[:, self.units * 2:])
if self.use_bias:
x_z = K.bias_add(x_z, self.input_bias[:self.units])
x_r = K.bias_add(x_r, self.input_bias[self.units: self.units * 2])
x_h = K.bias_add(x_h, self.input_bias[self.units * 2:])
if 0. < self.recurrent_dropout < 1.:
h_tm1_z = h_tm1 * rec_dp_mask[0]
h_tm1_r = h_tm1 * rec_dp_mask[1]
h_tm1_h = h_tm1 * rec_dp_mask[2]
else:
h_tm1_z = h_tm1
h_tm1_r = h_tm1
h_tm1_h = h_tm1
recurrent_z = K.dot(h_tm1_z, self.recurrent_kernel[:, :self.units])
recurrent_r = K.dot(h_tm1_r,
self.recurrent_kernel[:, self.units:self.units * 2])
if self.reset_after and self.use_bias:
recurrent_z = K.bias_add(recurrent_z, self.recurrent_bias[:self.units])
recurrent_r = K.bias_add(recurrent_r,
self.recurrent_bias[self.units:
self.units * 2])
z = self.recurrent_activation(x_z + recurrent_z)
r = self.recurrent_activation(x_r + recurrent_r)
# reset gate applied after/before matrix multiplication
if self.reset_after:
recurrent_h = K.dot(h_tm1_h, self.recurrent_kernel[:, self.units * 2:])
if self.use_bias:
recurrent_h = K.bias_add(recurrent_h,
self.recurrent_bias[self.units * 2:])
recurrent_h = r * recurrent_h
else:
recurrent_h = K.dot(r * h_tm1_h,
self.recurrent_kernel[:, self.units * 2:])
hh = self.activation(x_h + recurrent_h)
else:
if 0. < self.dropout < 1.:
inputs *= dp_mask[0]
# inputs projected by all gate matrices at once
matrix_x = K.dot(inputs, self.kernel)
if self.use_bias:
# biases: bias_z_i, bias_r_i, bias_h_i
matrix_x = K.bias_add(matrix_x, self.input_bias)
x_z = matrix_x[:, :self.units]
x_r = matrix_x[:, self.units: 2 * self.units]
x_h = matrix_x[:, 2 * self.units:]
if 0. < self.recurrent_dropout < 1.:
h_tm1 *= rec_dp_mask[0]
matrix_inner = K.dot(h_tm1, self.recurrent_kernel[:, :2 * self.units])
recurrent_z = matrix_inner[:, :self.units]
recurrent_r = matrix_inner[:, self.units:2 * self.units]
z = self.recurrent_activation(x_z + recurrent_z)
r = self.recurrent_activation(x_r + recurrent_r)
if self.reset_after:
recurrent_h = r * matrix_inner[:, 2 * self.units:]
else:
recurrent_h = K.dot(r * h_tm1,
self.recurrent_kernel[:, 2 * self.units:])
hh = self.activation(x_h + recurrent_h)
# previous and candidate state mixed by update gate
h = z * h_tm1 + (1 - z) * hh
if 0 < self.dropout + self.recurrent_dropout:
if training is None and not context.executing_eagerly():
# This would be harmless to set in eager mode, but eager tensors
# disallow setting arbitrary attributes.
h._uses_learning_phase = True
return h, [h]
def get_config(self):
config = {
'units': self.units,
'activation': activations.serialize(self.activation),
'recurrent_activation':
activations.serialize(self.recurrent_activation),
'use_bias': self.use_bias,
'kernel_initializer': initializers.serialize(self.kernel_initializer),
'recurrent_initializer':
initializers.serialize(self.recurrent_initializer),
'bias_initializer': initializers.serialize(self.bias_initializer),
'kernel_regularizer': regularizers.serialize(self.kernel_regularizer),
'recurrent_regularizer':
regularizers.serialize(self.recurrent_regularizer),
'bias_regularizer': regularizers.serialize(self.bias_regularizer),
'kernel_constraint': constraints.serialize(self.kernel_constraint),
'recurrent_constraint':
constraints.serialize(self.recurrent_constraint),
'bias_constraint': constraints.serialize(self.bias_constraint),
'dropout': self.dropout,
'recurrent_dropout': self.recurrent_dropout,
'implementation': self.implementation,
'reset_after': self.reset_after
}
base_config = super(GRUCell, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
@tf_export('keras.layers.GRU')
class GRU(RNN):
"""Gated Recurrent Unit - Cho et al. 2014.
There are two variants. The default one is based on 1406.1078v3 and
has reset gate applied to hidden state before matrix multiplication. The
other one is based on original 1406.1078v1 and has the order reversed.
The second variant is compatible with CuDNNGRU (GPU-only) and allows
inference on CPU. Thus it has separate biases for `kernel` and
`recurrent_kernel`. Use `'reset_after'=True` and
`recurrent_activation='sigmoid'`.
Arguments:
units: Positive integer, dimensionality of the output space.
activation: Activation function to use.
Default: hyperbolic tangent (`tanh`).
If you pass `None`, no activation is applied
(ie. "linear" activation: `a(x) = x`).
recurrent_activation: Activation function to use
for the recurrent step.
Default: hard sigmoid (`hard_sigmoid`).
If you pass `None`, no activation is applied
(ie. "linear" activation: `a(x) = x`).
use_bias: Boolean, whether the layer uses a bias vector.
kernel_initializer: Initializer for the `kernel` weights matrix,
used for the linear transformation of the inputs.
recurrent_initializer: Initializer for the `recurrent_kernel`
weights matrix,
used for the linear transformation of the recurrent state.
bias_initializer: Initializer for the bias vector.
kernel_regularizer: Regularizer function applied to
the `kernel` weights matrix.
recurrent_regularizer: Regularizer function applied to
the `recurrent_kernel` weights matrix.
bias_regularizer: Regularizer function applied to the bias vector.
activity_regularizer: Regularizer function applied to
the output of the layer (its "activation")..
kernel_constraint: Constraint function applied to
the `kernel` weights matrix.
recurrent_constraint: Constraint function applied to
the `recurrent_kernel` weights matrix.
bias_constraint: Constraint function applied to the bias vector.
dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the inputs.
recurrent_dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the recurrent state.
implementation: Implementation mode, either 1 or 2.
Mode 1 will structure its operations as a larger number of
smaller dot products and additions, whereas mode 2 will
batch them into fewer, larger operations. These modes will
have different performance profiles on different hardware and
for different applications.
return_sequences: Boolean. Whether to return the last output
in the output sequence, or the full sequence.
return_state: Boolean. Whether to return the last state
in addition to the output.
go_backwards: Boolean (default False).
If True, process the input sequence backwards and return the
reversed sequence.
stateful: Boolean (default False). If True, the last state
for each sample at index i in a batch will be used as initial
state for the sample of index i in the following batch.
unroll: Boolean (default False).
If True, the network will be unrolled,
else a symbolic loop will be used.
Unrolling can speed-up a RNN,
although it tends to be more memory-intensive.
Unrolling is only suitable for short sequences.
reset_after: GRU convention (whether to apply reset gate after or
before matrix multiplication). False = "before" (default),
True = "after" (CuDNN compatible).
"""
def __init__(self,
units,
activation='tanh',
recurrent_activation='hard_sigmoid',
use_bias=True,
kernel_initializer='glorot_uniform',
recurrent_initializer='orthogonal',
bias_initializer='zeros',
kernel_regularizer=None,
recurrent_regularizer=None,
bias_regularizer=None,
activity_regularizer=None,
kernel_constraint=None,
recurrent_constraint=None,
bias_constraint=None,
dropout=0.,
recurrent_dropout=0.,
implementation=1,
return_sequences=False,
return_state=False,
go_backwards=False,
stateful=False,
unroll=False,
reset_after=False,
**kwargs):
if implementation == 0:
logging.warning('`implementation=0` has been deprecated, '
'and now defaults to `implementation=1`.'
'Please update your layer call.')
cell = GRUCell(
units,
activation=activation,
recurrent_activation=recurrent_activation,
use_bias=use_bias,
kernel_initializer=kernel_initializer,
recurrent_initializer=recurrent_initializer,
bias_initializer=bias_initializer,
kernel_regularizer=kernel_regularizer,
recurrent_regularizer=recurrent_regularizer,
bias_regularizer=bias_regularizer,
kernel_constraint=kernel_constraint,
recurrent_constraint=recurrent_constraint,
bias_constraint=bias_constraint,
dropout=dropout,
recurrent_dropout=recurrent_dropout,
implementation=implementation,
reset_after=reset_after)
super(GRU, self).__init__(
cell,
return_sequences=return_sequences,
return_state=return_state,
go_backwards=go_backwards,
stateful=stateful,
unroll=unroll,
**kwargs)
self.activity_regularizer = regularizers.get(activity_regularizer)
def call(self, inputs, mask=None, training=None, initial_state=None):
self.cell._dropout_mask = None
self.cell._recurrent_dropout_mask = None
return super(GRU, self).call(
inputs, mask=mask, training=training, initial_state=initial_state)
@property
def units(self):
return self.cell.units
@property
def activation(self):
return self.cell.activation
@property
def recurrent_activation(self):
return self.cell.recurrent_activation
@property
def use_bias(self):
return self.cell.use_bias
@property
def kernel_initializer(self):
return self.cell.kernel_initializer
@property
def recurrent_initializer(self):
return self.cell.recurrent_initializer
@property
def bias_initializer(self):
return self.cell.bias_initializer
@property
def kernel_regularizer(self):
return self.cell.kernel_regularizer
@property
def recurrent_regularizer(self):
return self.cell.recurrent_regularizer
@property
def bias_regularizer(self):
return self.cell.bias_regularizer
@property
def kernel_constraint(self):
return self.cell.kernel_constraint
@property
def recurrent_constraint(self):
return self.cell.recurrent_constraint
@property
def bias_constraint(self):
return self.cell.bias_constraint
@property
def dropout(self):
return self.cell.dropout
@property
def recurrent_dropout(self):
return self.cell.recurrent_dropout
@property
def implementation(self):
return self.cell.implementation
@property
def reset_after(self):
return self.cell.reset_after
def get_config(self):
config = {
'units':
self.units,
'activation':
activations.serialize(self.activation),
'recurrent_activation':
activations.serialize(self.recurrent_activation),
'use_bias':
self.use_bias,
'kernel_initializer':
initializers.serialize(self.kernel_initializer),
'recurrent_initializer':
initializers.serialize(self.recurrent_initializer),
'bias_initializer':
initializers.serialize(self.bias_initializer),
'kernel_regularizer':
regularizers.serialize(self.kernel_regularizer),
'recurrent_regularizer':
regularizers.serialize(self.recurrent_regularizer),
'bias_regularizer':
regularizers.serialize(self.bias_regularizer),
'activity_regularizer':
regularizers.serialize(self.activity_regularizer),
'kernel_constraint':
constraints.serialize(self.kernel_constraint),
'recurrent_constraint':
constraints.serialize(self.recurrent_constraint),
'bias_constraint':
constraints.serialize(self.bias_constraint),
'dropout':
self.dropout,
'recurrent_dropout':
self.recurrent_dropout,
'implementation':
self.implementation,
'reset_after':
self.reset_after
}
base_config = super(GRU, self).get_config()
del base_config['cell']
return dict(list(base_config.items()) + list(config.items()))
@classmethod
def from_config(cls, config):
if 'implementation' in config and config['implementation'] == 0:
config['implementation'] = 1
return cls(**config)
@tf_export('keras.layers.LSTMCell')
class LSTMCell(Layer):
"""Cell class for the LSTM layer.
Arguments:
units: Positive integer, dimensionality of the output space.
activation: Activation function to use.
Default: hyperbolic tangent (`tanh`).
If you pass `None`, no activation is applied
(ie. "linear" activation: `a(x) = x`).
recurrent_activation: Activation function to use
for the recurrent step.
Default: hard sigmoid (`hard_sigmoid`).
If you pass `None`, no activation is applied
(ie. "linear" activation: `a(x) = x`).x
use_bias: Boolean, whether the layer uses a bias vector.
kernel_initializer: Initializer for the `kernel` weights matrix,
used for the linear transformation of the inputs.
recurrent_initializer: Initializer for the `recurrent_kernel`
weights matrix,
used for the linear transformation of the recurrent state.
bias_initializer: Initializer for the bias vector.
unit_forget_bias: Boolean.
If True, add 1 to the bias of the forget gate at initialization.
Setting it to true will also force `bias_initializer="zeros"`.
This is recommended in [Jozefowicz et
al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf)
kernel_regularizer: Regularizer function applied to
the `kernel` weights matrix.
recurrent_regularizer: Regularizer function applied to
the `recurrent_kernel` weights matrix.
bias_regularizer: Regularizer function applied to the bias vector.
kernel_constraint: Constraint function applied to
the `kernel` weights matrix.
recurrent_constraint: Constraint function applied to
the `recurrent_kernel` weights matrix.
bias_constraint: Constraint function applied to the bias vector.
dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the inputs.
recurrent_dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the recurrent state.
implementation: Implementation mode, either 1 or 2.
Mode 1 will structure its operations as a larger number of
smaller dot products and additions, whereas mode 2 will
batch them into fewer, larger operations. These modes will
have different performance profiles on different hardware and
for different applications.
"""
def __init__(self,
units,
activation='tanh',
recurrent_activation='hard_sigmoid',
use_bias=True,
kernel_initializer='glorot_uniform',
recurrent_initializer='orthogonal',
bias_initializer='zeros',
unit_forget_bias=True,
kernel_regularizer=None,
recurrent_regularizer=None,
bias_regularizer=None,
kernel_constraint=None,
recurrent_constraint=None,
bias_constraint=None,
dropout=0.,
recurrent_dropout=0.,
implementation=1,
**kwargs):
super(LSTMCell, self).__init__(**kwargs)
self.units = units
self.activation = activations.get(activation)
self.recurrent_activation = activations.get(recurrent_activation)
self.use_bias = use_bias
self.kernel_initializer = initializers.get(kernel_initializer)
self.recurrent_initializer = initializers.get(recurrent_initializer)
self.bias_initializer = initializers.get(bias_initializer)
self.unit_forget_bias = unit_forget_bias
self.kernel_regularizer = regularizers.get(kernel_regularizer)
self.recurrent_regularizer = regularizers.get(recurrent_regularizer)
self.bias_regularizer = regularizers.get(bias_regularizer)
self.kernel_constraint = constraints.get(kernel_constraint)
self.recurrent_constraint = constraints.get(recurrent_constraint)
self.bias_constraint = constraints.get(bias_constraint)
self.dropout = min(1., max(0., dropout))
self.recurrent_dropout = min(1., max(0., recurrent_dropout))
self.implementation = implementation
self.state_size = (self.units, self.units)
self._dropout_mask = None
self._recurrent_dropout_mask = None
@shape_type_conversion
def build(self, input_shape):
input_dim = input_shape[-1]
self.kernel = self.add_weight(
shape=(input_dim, self.units * 4),
name='kernel',
initializer=self.kernel_initializer,
regularizer=self.kernel_regularizer,
constraint=self.kernel_constraint)
self.recurrent_kernel = self.add_weight(
shape=(self.units, self.units * 4),
name='recurrent_kernel',
initializer=self.recurrent_initializer,
regularizer=self.recurrent_regularizer,
constraint=self.recurrent_constraint)
if self.use_bias:
if self.unit_forget_bias:
def bias_initializer(_, *args, **kwargs):
return K.concatenate([
self.bias_initializer((self.units,), *args, **kwargs),
initializers.Ones()((self.units,), *args, **kwargs),
self.bias_initializer((self.units * 2,), *args, **kwargs),
])
else:
bias_initializer = self.bias_initializer
self.bias = self.add_weight(
shape=(self.units * 4,),
name='bias',
initializer=bias_initializer,
regularizer=self.bias_regularizer,
constraint=self.bias_constraint)
else:
self.bias = None
self.built = True
def call(self, inputs, states, training=None):
if 0 < self.dropout < 1 and self._dropout_mask is None:
self._dropout_mask = _generate_dropout_mask(
_generate_dropout_ones(inputs, array_ops.shape(inputs)[-1]),
self.dropout,
training=training,
count=4)
if (0 < self.recurrent_dropout < 1 and
self._recurrent_dropout_mask is None):
self._recurrent_dropout_mask = _generate_dropout_mask(
_generate_dropout_ones(inputs, self.units),
self.recurrent_dropout,
training=training,
count=4)
# dropout matrices for input units
dp_mask = self._dropout_mask
# dropout matrices for recurrent units
rec_dp_mask = self._recurrent_dropout_mask
h_tm1 = states[0] # previous memory state
c_tm1 = states[1] # previous carry state
if self.implementation == 1:
if 0 < self.dropout < 1.:
inputs_i = inputs * dp_mask[0]
inputs_f = inputs * dp_mask[1]
inputs_c = inputs * dp_mask[2]
inputs_o = inputs * dp_mask[3]
else:
inputs_i = inputs
inputs_f = inputs
inputs_c = inputs
inputs_o = inputs
x_i = K.dot(inputs_i, self.kernel[:, :self.units])
x_f = K.dot(inputs_f, self.kernel[:, self.units:self.units * 2])
x_c = K.dot(inputs_c, self.kernel[:, self.units * 2:self.units * 3])
x_o = K.dot(inputs_o, self.kernel[:, self.units * 3:])
if self.use_bias:
x_i = K.bias_add(x_i, self.bias[:self.units])
x_f = K.bias_add(x_f, self.bias[self.units:self.units * 2])
x_c = K.bias_add(x_c, self.bias[self.units * 2:self.units * 3])
x_o = K.bias_add(x_o, self.bias[self.units * 3:])
if 0 < self.recurrent_dropout < 1.:
h_tm1_i = h_tm1 * rec_dp_mask[0]
h_tm1_f = h_tm1 * rec_dp_mask[1]
h_tm1_c = h_tm1 * rec_dp_mask[2]
h_tm1_o = h_tm1 * rec_dp_mask[3]
else:
h_tm1_i = h_tm1
h_tm1_f = h_tm1
h_tm1_c = h_tm1
h_tm1_o = h_tm1
i = self.recurrent_activation(
x_i + K.dot(h_tm1_i, self.recurrent_kernel[:, :self.units]))
f = self.recurrent_activation(
x_f + K.dot(h_tm1_f,
self.recurrent_kernel[:, self.units: self.units * 2]))
c = f * c_tm1 + i * self.activation(
x_c + K.dot(h_tm1_c,
self.recurrent_kernel[:, self.units * 2: self.units * 3]))
o = self.recurrent_activation(
x_o + K.dot(h_tm1_o, self.recurrent_kernel[:, self.units * 3:]))
else:
if 0. < self.dropout < 1.:
inputs *= dp_mask[0]
z = K.dot(inputs, self.kernel)
if 0. < self.recurrent_dropout < 1.:
h_tm1 *= rec_dp_mask[0]
z += K.dot(h_tm1, self.recurrent_kernel)
if self.use_bias:
z = K.bias_add(z, self.bias)
z0 = z[:, :self.units]
z1 = z[:, self.units:2 * self.units]
z2 = z[:, 2 * self.units:3 * self.units]
z3 = z[:, 3 * self.units:]
i = self.recurrent_activation(z0)
f = self.recurrent_activation(z1)
c = f * c_tm1 + i * self.activation(z2)
o = self.recurrent_activation(z3)
h = o * self.activation(c)
if 0 < self.dropout + self.recurrent_dropout:
if training is None and not context.executing_eagerly():
# This would be harmless to set in eager mode, but eager tensors
# disallow setting arbitrary attributes.
h._uses_learning_phase = True
return h, [h, c]
def get_config(self):
config = {
'units':
self.units,
'activation':
activations.serialize(self.activation),
'recurrent_activation':
activations.serialize(self.recurrent_activation),
'use_bias':
self.use_bias,
'kernel_initializer':
initializers.serialize(self.kernel_initializer),
'recurrent_initializer':
initializers.serialize(self.recurrent_initializer),
'bias_initializer':
initializers.serialize(self.bias_initializer),
'unit_forget_bias':
self.unit_forget_bias,
'kernel_regularizer':
regularizers.serialize(self.kernel_regularizer),
'recurrent_regularizer':
regularizers.serialize(self.recurrent_regularizer),
'bias_regularizer':
regularizers.serialize(self.bias_regularizer),
'kernel_constraint':
constraints.serialize(self.kernel_constraint),
'recurrent_constraint':
constraints.serialize(self.recurrent_constraint),
'bias_constraint':
constraints.serialize(self.bias_constraint),
'dropout':
self.dropout,
'recurrent_dropout':
self.recurrent_dropout,
'implementation':
self.implementation
}
base_config = super(LSTMCell, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
@tf_export('keras.layers.LSTM')
class LSTM(RNN):
"""Long Short-Term Memory layer - Hochreiter 1997.
Arguments:
units: Positive integer, dimensionality of the output space.
activation: Activation function to use.
Default: hyperbolic tangent (`tanh`).
If you pass `None`, no activation is applied
(ie. "linear" activation: `a(x) = x`).
recurrent_activation: Activation function to use
for the recurrent step.
Default: hard sigmoid (`hard_sigmoid`).
If you pass `None`, no activation is applied
(ie. "linear" activation: `a(x) = x`).
use_bias: Boolean, whether the layer uses a bias vector.
kernel_initializer: Initializer for the `kernel` weights matrix,
used for the linear transformation of the inputs..
recurrent_initializer: Initializer for the `recurrent_kernel`
weights matrix,
used for the linear transformation of the recurrent state..
bias_initializer: Initializer for the bias vector.
unit_forget_bias: Boolean.
If True, add 1 to the bias of the forget gate at initialization.
Setting it to true will also force `bias_initializer="zeros"`.
This is recommended in [Jozefowicz et
al.](http://www.jmlr.org/proceedings/papers/v37/jozefowicz15.pdf)
kernel_regularizer: Regularizer function applied to
the `kernel` weights matrix.
recurrent_regularizer: Regularizer function applied to
the `recurrent_kernel` weights matrix.
bias_regularizer: Regularizer function applied to the bias vector.
activity_regularizer: Regularizer function applied to
the output of the layer (its "activation")..
kernel_constraint: Constraint function applied to
the `kernel` weights matrix.
recurrent_constraint: Constraint function applied to
the `recurrent_kernel` weights matrix.
bias_constraint: Constraint function applied to the bias vector.
dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the inputs.
recurrent_dropout: Float between 0 and 1.
Fraction of the units to drop for
the linear transformation of the recurrent state.
implementation: Implementation mode, either 1 or 2.
Mode 1 will structure its operations as a larger number of
smaller dot products and additions, whereas mode 2 will
batch them into fewer, larger operations. These modes will
have different performance profiles on different hardware and
for different applications.
return_sequences: Boolean. Whether to return the last output.
in the output sequence, or the full sequence.
return_state: Boolean. Whether to return the last state
in addition to the output.
go_backwards: Boolean (default False).
If True, process the input sequence backwards and return the
reversed sequence.
stateful: Boolean (default False). If True, the last state
for each sample at index i in a batch will be used as initial
state for the sample of index i in the following batch.
unroll: Boolean (default False).
If True, the network will be unrolled,
else a symbolic loop will be used.
Unrolling can speed-up a RNN,
although it tends to be more memory-intensive.
Unrolling is only suitable for short sequences.
"""
def __init__(self,
units,
activation='tanh',
recurrent_activation='hard_sigmoid',
use_bias=True,
kernel_initializer='glorot_uniform',
recurrent_initializer='orthogonal',
bias_initializer='zeros',
unit_forget_bias=True,
kernel_regularizer=None,
recurrent_regularizer=None,
bias_regularizer=None,
activity_regularizer=None,
kernel_constraint=None,
recurrent_constraint=None,
bias_constraint=None,
dropout=0.,
recurrent_dropout=0.,
implementation=1,
return_sequences=False,
return_state=False,
go_backwards=False,
stateful=False,
unroll=False,
**kwargs):
if implementation == 0:
logging.warning('`implementation=0` has been deprecated, '
'and now defaults to `implementation=1`.'
'Please update your layer call.')
cell = LSTMCell(
units,
activation=activation,
recurrent_activation=recurrent_activation,
use_bias=use_bias,
kernel_initializer=kernel_initializer,
recurrent_initializer=recurrent_initializer,
unit_forget_bias=unit_forget_bias,
bias_initializer=bias_initializer,
kernel_regularizer=kernel_regularizer,
recurrent_regularizer=recurrent_regularizer,
bias_regularizer=bias_regularizer,
kernel_constraint=kernel_constraint,
recurrent_constraint=recurrent_constraint,
bias_constraint=bias_constraint,
dropout=dropout,
recurrent_dropout=recurrent_dropout,
implementation=implementation)
super(LSTM, self).__init__(
cell,
return_sequences=return_sequences,
return_state=return_state,
go_backwards=go_backwards,
stateful=stateful,
unroll=unroll,
**kwargs)
self.activity_regularizer = regularizers.get(activity_regularizer)
def call(self, inputs, mask=None, training=None, initial_state=None):
self.cell._dropout_mask = None
self.cell._recurrent_dropout_mask = None
return super(LSTM, self).call(
inputs, mask=mask, training=training, initial_state=initial_state)
@property
def units(self):
return self.cell.units
@property
def activation(self):
return self.cell.activation
@property
def recurrent_activation(self):
return self.cell.recurrent_activation
@property
def use_bias(self):
return self.cell.use_bias
@property
def kernel_initializer(self):
return self.cell.kernel_initializer
@property
def recurrent_initializer(self):
return self.cell.recurrent_initializer
@property
def bias_initializer(self):
return self.cell.bias_initializer
@property
def unit_forget_bias(self):
return self.cell.unit_forget_bias
@property
def kernel_regularizer(self):
return self.cell.kernel_regularizer
@property
def recurrent_regularizer(self):
return self.cell.recurrent_regularizer
@property
def bias_regularizer(self):
return self.cell.bias_regularizer
@property
def kernel_constraint(self):
return self.cell.kernel_constraint
@property
def recurrent_constraint(self):
return self.cell.recurrent_constraint
@property
def bias_constraint(self):
return self.cell.bias_constraint
@property
def dropout(self):
return self.cell.dropout
@property
def recurrent_dropout(self):
return self.cell.recurrent_dropout
@property
def implementation(self):
return self.cell.implementation
def get_config(self):
config = {
'units':
self.units,
'activation':
activations.serialize(self.activation),
'recurrent_activation':
activations.serialize(self.recurrent_activation),
'use_bias':
self.use_bias,
'kernel_initializer':
initializers.serialize(self.kernel_initializer),
'recurrent_initializer':
initializers.serialize(self.recurrent_initializer),
'bias_initializer':
initializers.serialize(self.bias_initializer),
'unit_forget_bias':
self.unit_forget_bias,
'kernel_regularizer':
regularizers.serialize(self.kernel_regularizer),
'recurrent_regularizer':
regularizers.serialize(self.recurrent_regularizer),
'bias_regularizer':
regularizers.serialize(self.bias_regularizer),
'activity_regularizer':
regularizers.serialize(self.activity_regularizer),
'kernel_constraint':
constraints.serialize(self.kernel_constraint),
'recurrent_constraint':
constraints.serialize(self.recurrent_constraint),
'bias_constraint':
constraints.serialize(self.bias_constraint),
'dropout':
self.dropout,
'recurrent_dropout':
self.recurrent_dropout,
'implementation':
self.implementation
}
base_config = super(LSTM, self).get_config()
del base_config['cell']
return dict(list(base_config.items()) + list(config.items()))
@classmethod
def from_config(cls, config):
if 'implementation' in config and config['implementation'] == 0:
config['implementation'] = 1
return cls(**config)
def _generate_dropout_ones(inputs, dims):
return K.ones((array_ops.shape(inputs)[0], dims))
def _generate_dropout_mask(ones, rate, training=None, count=1):
def dropped_inputs():
return K.dropout(ones, rate)
if count > 1:
return [
K.in_train_phase(dropped_inputs, ones, training=training)
for _ in range(count)
]
return K.in_train_phase(dropped_inputs, ones, training=training)
class Recurrent(Layer):
"""Deprecated abstract base class for recurrent layers.
It still exists because it is leveraged by the convolutional-recurrent layers.
It will be removed entirely in the future.
It was never part of the public API.
Do not use.
Arguments:
weights: list of Numpy arrays to set as initial weights.
The list should have 3 elements, of shapes:
`[(input_dim, output_dim), (output_dim, output_dim), (output_dim,)]`.
return_sequences: Boolean. Whether to return the last output
in the output sequence, or the full sequence.
return_state: Boolean. Whether to return the last state
in addition to the output.
go_backwards: Boolean (default False).
If True, process the input sequence backwards and return the
reversed sequence.
stateful: Boolean (default False). If True, the last state
for each sample at index i in a batch will be used as initial
state for the sample of index i in the following batch.
unroll: Boolean (default False).
If True, the network will be unrolled,
else a symbolic loop will be used.
Unrolling can speed-up a RNN,
although it tends to be more memory-intensive.
Unrolling is only suitable for short sequences.
implementation: one of {0, 1, or 2}.
If set to 0, the RNN will use
an implementation that uses fewer, larger matrix products,
thus running faster on CPU but consuming more memory.
If set to 1, the RNN will use more matrix products,
but smaller ones, thus running slower
(may actually be faster on GPU) while consuming less memory.
If set to 2 (LSTM/GRU only),
the RNN will combine the input gate,
the forget gate and the output gate into a single matrix,
enabling more time-efficient parallelization on the GPU.
Note: RNN dropout must be shared for all gates,
resulting in a slightly reduced regularization.
input_dim: dimensionality of the input (integer).
This argument (or alternatively, the keyword argument `input_shape`)
is required when using this layer as the first layer in a model.
input_length: Length of input sequences, to be specified
when it is constant.
This argument is required if you are going to connect
`Flatten` then `Dense` layers upstream
(without it, the shape of the dense outputs cannot be computed).
Note that if the recurrent layer is not the first layer
in your model, you would need to specify the input length
at the level of the first layer
(e.g. via the `input_shape` argument)
Input shape:
3D tensor with shape `(batch_size, timesteps, input_dim)`,
(Optional) 2D tensors with shape `(batch_size, output_dim)`.
Output shape:
- if `return_state`: a list of tensors. The first tensor is
the output. The remaining tensors are the last states,
each with shape `(batch_size, units)`.
- if `return_sequences`: 3D tensor with shape
`(batch_size, timesteps, units)`.
- else, 2D tensor with shape `(batch_size, units)`.
# Masking
This layer supports masking for input data with a variable number
of timesteps. To introduce masks to your data,
use an `Embedding` layer with the `mask_zero` parameter
set to `True`.
# Note on using statefulness in RNNs
You can set RNN layers to be 'stateful', which means that the states
computed for the samples in one batch will be reused as initial states
for the samples in the next batch. This assumes a one-to-one mapping
between samples in different successive batches.
To enable statefulness:
- specify `stateful=True` in the layer constructor.
- specify a fixed batch size for your model, by passing
if sequential model:
`batch_input_shape=(...)` to the first layer in your model.
else for functional model with 1 or more Input layers:
`batch_shape=(...)` to all the first layers in your model.
This is the expected shape of your inputs
*including the batch size*.
It should be a tuple of integers, e.g. `(32, 10, 100)`.
- specify `shuffle=False` when calling fit().
To reset the states of your model, call `.reset_states()` on either
a specific layer, or on your entire model.
# Note on specifying the initial state of RNNs
You can specify the initial state of RNN layers symbolically by
calling them with the keyword argument `initial_state`. The value of
`initial_state` should be a tensor or list of tensors representing
the initial state of the RNN layer.
You can specify the initial state of RNN layers numerically by
calling `reset_states` with the keyword argument `states`. The value of
`states` should be a numpy array or list of numpy arrays representing
the initial state of the RNN layer.
"""
def __init__(self,
return_sequences=False,
return_state=False,
go_backwards=False,
stateful=False,
unroll=False,
implementation=0,
**kwargs):
super(Recurrent, self).__init__(**kwargs)
self.return_sequences = return_sequences
self.return_state = return_state
self.go_backwards = go_backwards
self.stateful = stateful
self.unroll = unroll
self.implementation = implementation
self.supports_masking = True
self.input_spec = [InputSpec(ndim=3)]
self.state_spec = None
self.dropout = 0
self.recurrent_dropout = 0
@shape_type_conversion
def compute_output_shape(self, input_shape):
if isinstance(input_shape, list):
input_shape = input_shape[0]
input_shape = tensor_shape.TensorShape(input_shape).as_list()
if self.return_sequences:
output_shape = (input_shape[0], input_shape[1], self.units)
else:
output_shape = (input_shape[0], self.units)
if self.return_state:
state_shape = [tensor_shape.TensorShape(
(input_shape[0], self.units)) for _ in self.states]
return [tensor_shape.TensorShape(output_shape)] + state_shape
return tensor_shape.TensorShape(output_shape)
def compute_mask(self, inputs, mask):
if isinstance(mask, list):
mask = mask[0]
output_mask = mask if self.return_sequences else None
if self.return_state:
state_mask = [None for _ in self.states]
return [output_mask] + state_mask
return output_mask
def step(self, inputs, states):
raise NotImplementedError
def get_constants(self, inputs, training=None):
return []
def get_initial_state(self, inputs):
# build an all-zero tensor of shape (samples, output_dim)
initial_state = array_ops.zeros_like(inputs)
# shape of initial_state = (samples, timesteps, input_dim)
initial_state = math_ops.reduce_sum(initial_state, axis=(1, 2))
# shape of initial_state = (samples,)
initial_state = array_ops.expand_dims(initial_state, axis=-1)
# shape of initial_state = (samples, 1)
initial_state = K.tile(initial_state, [1,
self.units]) # (samples, output_dim)
initial_state = [initial_state for _ in range(len(self.states))]
return initial_state
def preprocess_input(self, inputs, training=None):
return inputs
def __call__(self, inputs, initial_state=None, **kwargs):
if (isinstance(inputs, (list, tuple)) and
len(inputs) > 1
and initial_state is None):
initial_state = inputs[1:]
inputs = inputs[0]
# If `initial_state` is specified,
# and if it a Keras tensor,
# then add it to the inputs and temporarily
# modify the input spec to include the state.
if initial_state is None:
return super(Recurrent, self).__call__(inputs, **kwargs)
if not isinstance(initial_state, (list, tuple)):
initial_state = [initial_state]
is_keras_tensor = hasattr(initial_state[0], '_keras_history')
for tensor in initial_state:
if hasattr(tensor, '_keras_history') != is_keras_tensor:
raise ValueError('The initial state of an RNN layer cannot be'
' specified with a mix of Keras tensors and'
' non-Keras tensors')
if is_keras_tensor:
# Compute the full input spec, including state
input_spec = self.input_spec
state_spec = self.state_spec
if not isinstance(input_spec, list):
input_spec = [input_spec]
if not isinstance(state_spec, list):
state_spec = [state_spec]
self.input_spec = input_spec + state_spec
# Compute the full inputs, including state
inputs = [inputs] + list(initial_state)
# Perform the call
output = super(Recurrent, self).__call__(inputs, **kwargs)
# Restore original input spec
self.input_spec = input_spec
return output
else:
kwargs['initial_state'] = initial_state
return super(Recurrent, self).__call__(inputs, **kwargs)
def call(self, inputs, mask=None, training=None, initial_state=None):
# input shape: `(samples, time (padded with zeros), input_dim)`
# note that the .build() method of subclasses MUST define
# self.input_spec and self.state_spec with complete input shapes.
if isinstance(inputs, list):
initial_state = inputs[1:]
inputs = inputs[0]
elif initial_state is not None:
pass
elif self.stateful:
initial_state = self.states
else:
initial_state = self.get_initial_state(inputs)
if isinstance(mask, list):
mask = mask[0]
if len(initial_state) != len(self.states):
raise ValueError('Layer has ' + str(len(self.states)) +
' states but was passed ' + str(len(initial_state)) +
' initial states.')
input_shape = K.int_shape(inputs)
if self.unroll and input_shape[1] is None:
raise ValueError('Cannot unroll a RNN if the '
'time dimension is undefined. \n'
'- If using a Sequential model, '
'specify the time dimension by passing '
'an `input_shape` or `batch_input_shape` '
'argument to your first layer. If your '
'first layer is an Embedding, you can '
'also use the `input_length` argument.\n'
'- If using the functional API, specify '
'the time dimension by passing a `shape` '
'or `batch_shape` argument to your Input layer.')
constants = self.get_constants(inputs, training=None)
preprocessed_input = self.preprocess_input(inputs, training=None)
last_output, outputs, states = K.rnn(
self.step,
preprocessed_input,
initial_state,
go_backwards=self.go_backwards,
mask=mask,
constants=constants,
unroll=self.unroll)
if self.stateful:
updates = []
for i in range(len(states)):
updates.append(state_ops.assign(self.states[i], states[i]))
self.add_update(updates, inputs)
# Properly set learning phase
if 0 < self.dropout + self.recurrent_dropout:
last_output._uses_learning_phase = True
outputs._uses_learning_phase = True
if not self.return_sequences:
outputs = last_output
if self.return_state:
if not isinstance(states, (list, tuple)):
states = [states]
else:
states = list(states)
return [outputs] + states
return outputs
def reset_states(self, states=None):
if not self.stateful:
raise AttributeError('Layer must be stateful.')
batch_size = self.input_spec[0].shape[0]
if not batch_size:
raise ValueError('If a RNN is stateful, it needs to know '
'its batch size. Specify the batch size '
'of your input tensors: \n'
'- If using a Sequential model, '
'specify the batch size by passing '
'a `batch_input_shape` '
'argument to your first layer.\n'
'- If using the functional API, specify '
'the time dimension by passing a '
'`batch_shape` argument to your Input layer.')
# initialize state if None
if self.states[0] is None:
self.states = [K.zeros((batch_size, self.units)) for _ in self.states]
elif states is None:
for state in self.states:
K.set_value(state, np.zeros((batch_size, self.units)))
else:
if not isinstance(states, (list, tuple)):
states = [states]
if len(states) != len(self.states):
raise ValueError('Layer ' + self.name + ' expects ' +
str(len(self.states)) + ' states, '
'but it received ' + str(len(states)) +
' state values. Input received: ' + str(states))
for index, (value, state) in enumerate(zip(states, self.states)):
if value.shape != (batch_size, self.units):
raise ValueError('State ' + str(index) +
' is incompatible with layer ' + self.name +
': expected shape=' + str((batch_size, self.units)) +
', found shape=' + str(value.shape))
K.set_value(state, value)
def get_config(self):
config = {
'return_sequences': self.return_sequences,
'return_state': self.return_state,
'go_backwards': self.go_backwards,
'stateful': self.stateful,
'unroll': self.unroll,
'implementation': self.implementation
}
base_config = super(Recurrent, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
|
mit
|
[
3,
1898,
6900,
710,
9134,
6642,
14,
2900,
5924,
5702,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
3,
11148,
199,
3,
4287,
26,
3507,
29,
6798,
13,
2732,
199,
624,
497,
1818,
9393,
436,
3932,
1300,
3992,
14,
199,
624,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
4629,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
199,
646,
5579,
199,
646,
2680,
465,
980,
199,
199,
504,
3228,
14,
1548,
14,
10283,
492,
1067,
199,
504,
3228,
14,
1548,
14,
4857,
492,
2345,
63,
1392,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
492,
32038,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
492,
4865,
465,
1804,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
492,
9565,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
492,
2536,
6315,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
492,
5578,
6315,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
14,
3908,
492,
6924,
5307,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
14,
3908,
492,
11915,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
14,
3908,
14,
1095,
63,
1897,
492,
2215,
63,
466,
63,
15083,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
14,
1208,
14,
6767,
63,
1208,
492,
965,
63,
1273,
199,
504,
3228,
14,
1548,
14,
1483,
492,
1625,
63,
1483,
199,
504,
3228,
14,
1548,
14,
1483,
492,
3473,
63,
1483,
199,
504,
3228,
14,
1548,
14,
1483,
492,
1174,
63,
1483,
199,
504,
3228,
14,
1548,
14,
3246,
492,
2833,
63,
4806,
465,
2050,
199,
504,
3228,
14,
1548,
14,
1974,
14,
3249,
63,
3790,
492,
2833,
63,
3790,
421,
199,
32,
3249,
63,
3790,
360,
8811,
14,
4359,
14,
4851,
379,
15303,
6389,
6840,
358,
199,
533,
13894,
379,
15303,
6389,
6840,
8,
5003,
304,
523,
408,
4590,
17266,
282,
3464,
402,
26009,
10106,
370,
24062,
465,
282,
2849,
4917,
14,
819,
8051,
370,
5669,
13402,
28378,
32378,
2438,
14,
819,
7628,
26,
489,
10106,
26,
3820,
402,
26009,
4917,
4454,
14,
819,
6058,
26,
819,
10841,
1548,
489,
10106,
275,
359,
881,
11708,
14,
4359,
14,
29805,
7608,
1697,
8,
1199,
63,
3572,
395,
881,
11708,
14,
4359,
14,
29805,
7608,
1697,
8,
1199,
63,
3572,
395,
881,
11708,
14,
4359,
14,
29805,
7608,
1697,
8,
1199,
63,
3572,
395,
489,
1622,
2541,
4153,
275,
11708,
14,
3205,
1332,
521,
5895,
12,
1324,
63,
3572,
430,
489,
671,
275,
11708,
14,
4359,
14,
24124,
8,
9041,
5130,
3711,
9,
523,
10841,
523,
408,
819,
347,
636,
826,
721,
277,
12,
10106,
12,
1011,
958,
304,
272,
367,
4917,
315,
10106,
26,
489,
340,
440,
2688,
8,
3890,
12,
283,
1250,
735,
267,
746,
1722,
360,
2422,
10106,
1471,
1172,
282,
658,
1250,
64,
1083,
14,
283,
586,
283,
9226,
10106,
6536,
10106,
9,
489,
340,
440,
2688,
8,
3890,
12,
283,
929,
63,
890,
735,
267,
746,
1722,
360,
2422,
10106,
1471,
1172,
282,
283,
586,
26144,
929,
63,
890,
64,
2225,
14,
283,
586,
283,
9226,
10106,
6536,
10106,
9,
272,
291,
14,
9041,
275,
10106,
272,
1613,
8,
4851,
379,
15303,
6389,
6840,
12,
291,
2843,
826,
14155,
958,
9,
819,
768,
1829,
523,
347,
1174,
63,
890,
8,
277,
304,
272,
327,
24230,
787,
282,
6829,
769,
272,
327,
315,
3837,
1865,
402,
314,
4917,
3464,
14,
272,
327,
961,
6127,
370,
11211,
314,
10685,
272,
327,
658,
2340,
14,
929,
63,
890,
59,
16,
61,
508,
1072,
63,
3572,
2313,
272,
327,
325,
14,
71,
14,
6363,
402,
282,
499,
13,
1897,
491,
16644,
3955,
506,
272,
327,
14505,
72,
18,
12,
286,
18,
12,
394,
17,
12,
286,
17,
16090,
272,
327,
334,
405,
12848,
1373,
491,
16644,
965,
6363,
359,
72,
12,
286,
566,
272,
1174,
63,
890,
275,
942,
272,
367,
4917,
315,
291,
14,
9041,
14172,
17,
2189,
489,
340,
2688,
8,
3890,
14,
929,
63,
890,
12,
2560,
552,
12168,
267,
1174,
63,
890,
847,
769,
8,
3890,
14,
929,
63,
890,
9,
489,
587,
26,
267,
1174,
63,
890,
14,
740,
8,
3890,
14,
929,
63,
890,
9,
272,
372,
2008,
8,
929,
63,
890,
9,
819,
347,
1240,
8,
277,
12,
4153,
12,
6363,
12,
5262,
29,
403,
12,
1011,
958,
304,
272,
327,
799,
5899,
1126,
13,
3890,
6363,
14,
272,
6032,
63,
4981,
275,
942,
272,
367,
4917,
315,
291,
14,
9041,
14172,
17,
2189,
489,
340,
2688,
8,
3890,
14,
929,
63,
890,
12,
2560,
552,
12168,
267,
6032,
63,
4981,
14,
740,
8,
4981,
1491,
552,
8,
3890,
14,
929,
63,
890,
3948,
267,
6363,
275,
6363,
59,
552,
8,
3890,
14,
929,
63,
890,
15405,
489,
587,
26,
267,
6032,
63,
4981,
14,
740,
779,
4981,
59,
16,
3934,
267,
6363,
275,
6363,
59,
17,
2938,
272,
6032,
63,
4981,
275,
6032,
63,
4981,
14172,
17,
61,
339,
327,
6523,
314,
10106,
315,
1865,
436,
3877,
314,
2138,
6363,
14,
272,
892,
63,
6376,
63,
4981,
275,
942,
272,
367,
4917,
12,
6363,
315,
3482,
8,
277,
14,
9041,
12,
6032,
63,
4981,
304,
489,
340,
965,
63,
1273,
8,
3890,
14,
1250,
12,
283,
5559,
735,
267,
4153,
12,
6363,
275,
4917,
14,
1250,
8,
3711,
12,
6363
] |
[
1898,
6900,
710,
9134,
6642,
14,
2900,
5924,
5702,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
3,
11148,
199,
3,
4287,
26,
3507,
29,
6798,
13,
2732,
199,
624,
497,
1818,
9393,
436,
3932,
1300,
3992,
14,
199,
624,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
4629,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
199,
646,
5579,
199,
646,
2680,
465,
980,
199,
199,
504,
3228,
14,
1548,
14,
10283,
492,
1067,
199,
504,
3228,
14,
1548,
14,
4857,
492,
2345,
63,
1392,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
492,
32038,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
492,
4865,
465,
1804,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
492,
9565,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
492,
2536,
6315,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
492,
5578,
6315,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
14,
3908,
492,
6924,
5307,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
14,
3908,
492,
11915,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
14,
3908,
14,
1095,
63,
1897,
492,
2215,
63,
466,
63,
15083,
199,
504,
3228,
14,
1548,
14,
8811,
423,
5472,
14,
8811,
14,
1208,
14,
6767,
63,
1208,
492,
965,
63,
1273,
199,
504,
3228,
14,
1548,
14,
1483,
492,
1625,
63,
1483,
199,
504,
3228,
14,
1548,
14,
1483,
492,
3473,
63,
1483,
199,
504,
3228,
14,
1548,
14,
1483,
492,
1174,
63,
1483,
199,
504,
3228,
14,
1548,
14,
3246,
492,
2833,
63,
4806,
465,
2050,
199,
504,
3228,
14,
1548,
14,
1974,
14,
3249,
63,
3790,
492,
2833,
63,
3790,
421,
199,
32,
3249,
63,
3790,
360,
8811,
14,
4359,
14,
4851,
379,
15303,
6389,
6840,
358,
199,
533,
13894,
379,
15303,
6389,
6840,
8,
5003,
304,
523,
408,
4590,
17266,
282,
3464,
402,
26009,
10106,
370,
24062,
465,
282,
2849,
4917,
14,
819,
8051,
370,
5669,
13402,
28378,
32378,
2438,
14,
819,
7628,
26,
489,
10106,
26,
3820,
402,
26009,
4917,
4454,
14,
819,
6058,
26,
819,
10841,
1548,
489,
10106,
275,
359,
881,
11708,
14,
4359,
14,
29805,
7608,
1697,
8,
1199,
63,
3572,
395,
881,
11708,
14,
4359,
14,
29805,
7608,
1697,
8,
1199,
63,
3572,
395,
881,
11708,
14,
4359,
14,
29805,
7608,
1697,
8,
1199,
63,
3572,
395,
489,
1622,
2541,
4153,
275,
11708,
14,
3205,
1332,
521,
5895,
12,
1324,
63,
3572,
430,
489,
671,
275,
11708,
14,
4359,
14,
24124,
8,
9041,
5130,
3711,
9,
523,
10841,
523,
408,
819,
347,
636,
826,
721,
277,
12,
10106,
12,
1011,
958,
304,
272,
367,
4917,
315,
10106,
26,
489,
340,
440,
2688,
8,
3890,
12,
283,
1250,
735,
267,
746,
1722,
360,
2422,
10106,
1471,
1172,
282,
658,
1250,
64,
1083,
14,
283,
586,
283,
9226,
10106,
6536,
10106,
9,
489,
340,
440,
2688,
8,
3890,
12,
283,
929,
63,
890,
735,
267,
746,
1722,
360,
2422,
10106,
1471,
1172,
282,
283,
586,
26144,
929,
63,
890,
64,
2225,
14,
283,
586,
283,
9226,
10106,
6536,
10106,
9,
272,
291,
14,
9041,
275,
10106,
272,
1613,
8,
4851,
379,
15303,
6389,
6840,
12,
291,
2843,
826,
14155,
958,
9,
819,
768,
1829,
523,
347,
1174,
63,
890,
8,
277,
304,
272,
327,
24230,
787,
282,
6829,
769,
272,
327,
315,
3837,
1865,
402,
314,
4917,
3464,
14,
272,
327,
961,
6127,
370,
11211,
314,
10685,
272,
327,
658,
2340,
14,
929,
63,
890,
59,
16,
61,
508,
1072,
63,
3572,
2313,
272,
327,
325,
14,
71,
14,
6363,
402,
282,
499,
13,
1897,
491,
16644,
3955,
506,
272,
327,
14505,
72,
18,
12,
286,
18,
12,
394,
17,
12,
286,
17,
16090,
272,
327,
334,
405,
12848,
1373,
491,
16644,
965,
6363,
359,
72,
12,
286,
566,
272,
1174,
63,
890,
275,
942,
272,
367,
4917,
315,
291,
14,
9041,
14172,
17,
2189,
489,
340,
2688,
8,
3890,
14,
929,
63,
890,
12,
2560,
552,
12168,
267,
1174,
63,
890,
847,
769,
8,
3890,
14,
929,
63,
890,
9,
489,
587,
26,
267,
1174,
63,
890,
14,
740,
8,
3890,
14,
929,
63,
890,
9,
272,
372,
2008,
8,
929,
63,
890,
9,
819,
347,
1240,
8,
277,
12,
4153,
12,
6363,
12,
5262,
29,
403,
12,
1011,
958,
304,
272,
327,
799,
5899,
1126,
13,
3890,
6363,
14,
272,
6032,
63,
4981,
275,
942,
272,
367,
4917,
315,
291,
14,
9041,
14172,
17,
2189,
489,
340,
2688,
8,
3890,
14,
929,
63,
890,
12,
2560,
552,
12168,
267,
6032,
63,
4981,
14,
740,
8,
4981,
1491,
552,
8,
3890,
14,
929,
63,
890,
3948,
267,
6363,
275,
6363,
59,
552,
8,
3890,
14,
929,
63,
890,
15405,
489,
587,
26,
267,
6032,
63,
4981,
14,
740,
779,
4981,
59,
16,
3934,
267,
6363,
275,
6363,
59,
17,
2938,
272,
6032,
63,
4981,
275,
6032,
63,
4981,
14172,
17,
61,
339,
327,
6523,
314,
10106,
315,
1865,
436,
3877,
314,
2138,
6363,
14,
272,
892,
63,
6376,
63,
4981,
275,
942,
272,
367,
4917,
12,
6363,
315,
3482,
8,
277,
14,
9041,
12,
6032,
63,
4981,
304,
489,
340,
965,
63,
1273,
8,
3890,
14,
1250,
12,
283,
5559,
735,
267,
4153,
12,
6363,
275,
4917,
14,
1250,
8,
3711,
12,
6363,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
pstjohn/cobrapy
|
cobra/core/DictList.py
|
2
|
12271
|
import re
from itertools import islice
from six import string_types, iteritems, PY3
try:
from numpy import bool_
except:
bool_ = bool
class DictList(list):
"""A combined dict and list
This object behaves like a list, but has the O(1) speed
benefits of a dict when looking up elements by their id.
"""
def __init__(self, *args):
if len(args) > 2:
raise TypeError("takes at most 1 argument (%d given)" % len(args))
list.__init__(self)
self._dict = {}
if len(args) == 1:
other = args[0]
if isinstance(other, DictList):
list.extend(self, other)
self._dict = other._dict.copy()
else:
self.extend(other)
def has_id(self, id):
return id in self._dict
def _check(self, id):
"""make sure duplicate id's are not added.
This function is called before adding in elements.
"""
if id in self._dict:
raise ValueError("id %s is already present in list" % str(id))
def _generate_index(self):
"""rebuild the _dict index"""
self._dict = {v.id: k for k, v in enumerate(self)}
def get_by_id(self, id):
"""return the element with a matching id"""
return list.__getitem__(self, self._dict[id])
def list_attr(self, attribute):
"""return a list of the given attribute for every object
"""
return [getattr(i, attribute) for i in self]
def query(self, search_function, attribute="id"):
"""query the list
search_function: used to select which objects to return
* a string, in which case any object.attribute containing
the string will be returned
* a compiled regular expression
* a function which takes one argument and returns True
for desired values
attribute: the attribute to be searched for (default is 'id').
If this is None, the object itself is used.
returns: a list of objects which match the query
"""
if attribute is None:
def select_attribute(x):
return x
else:
def select_attribute(x):
return getattr(x, attribute)
# if the search_function is a regular expression
if isinstance(search_function, str):
search_function = re.compile(search_function)
if hasattr(search_function, "findall"):
matches = (i for i in self
if search_function.findall(select_attribute(i)) != [])
else:
matches = (i for i in self
if search_function(select_attribute(i)))
results = self.__class__()
results._extend_nocheck(matches)
return results
def _replace_on_id(self, new_object):
"""Replace an object by another with the same id."""
the_id = new_object.id
the_index = self._dict[the_id]
list.__setitem__(self, the_index, new_object)
# overriding default list functions with new ones
def append(self, object):
"""append object to end"""
the_id = object.id
self._check(the_id)
self._dict[the_id] = len(self)
list.append(self, object)
def union(self, iterable):
"""adds elements with id's not already in the model"""
_dict = self._dict
append = self.append
for i in iterable:
if i.id not in _dict:
append(i)
def extend(self, iterable):
"""extend list by appending elements from the iterable"""
# Sometimes during initialization from an older pickle, _dict
# will not have initialized yet, because the initialization class was
# left unspecified. This is an issue because unpickling calls
# DictList.extend, which requires the presence of _dict. Therefore,
# the issue is caught and addressed here.
if not hasattr(self, "_dict") or self._dict is None:
self._dict = {}
_dict = self._dict
current_length = len(self)
list.extend(self, iterable)
for i, obj in enumerate(islice(self, current_length, None),
current_length):
the_id = obj.id
if the_id not in _dict:
_dict[the_id] = i
else:
# undo the extend and raise an error
self = self[:current_length]
self._check(the_id)
# if the above succeeded, then the id must be present
# twice in the list being added
raise ValueError("id '%s' at index %d is non-unique. "
"Is it present twice?" % (str(the_id), i))
def _extend_nocheck(self, iterable):
"""extends without checking for uniqueness
This function should only be used internally by DictList when it
can guarentee elements are already unique (as in when coming from
self or other DictList). It will be faster because it skips these
checks.
"""
current_length = len(self)
list.extend(self, iterable)
_dict = self._dict
if current_length is 0:
self._generate_index()
return
for i, obj in enumerate(islice(self, current_length, None),
current_length):
_dict[obj.id] = i
def __add__(self, other):
"""x.__add__(y) <==> x + y
other: iterable
other must contain only unique id's which do not intersect
with self
"""
total = DictList()
total.extend(self)
total.extend(other)
return total
def __iadd__(self, other):
"""x.__iadd__(y) <==> x += y
other: iterable
other must contain only unique id's whcih do not intersect
with self
"""
self.extend(other)
return self
def __reduce__(self):
return (self.__class__, (), self.__getstate__(), self.__iter__())
def __getstate__(self):
"""gets internal state
This is only provided for backwards compatibilty so older
versions of cobrapy can load pickles generated with cobrapy. In
reality, the "_dict" state is ignored when loading a pickle"""
return {"_dict": self._dict}
def __setstate__(self, state):
"""sets internal state
Ignore the passed in state and recalculate it. This is only for
compatibility with older pickles which did not correctly specify
the initialization class"""
self._generate_index()
def index(self, id, *args):
"""Determine the position in the list
id: A string or a :class:`~cobra.core.Object.Object`
"""
# because values are unique, start and stop are not relevant
if isinstance(id, string_types):
try:
return self._dict[id]
except KeyError:
raise ValueError("%s not found" % id)
try:
i = self._dict[id.id]
if self[i] is not id:
raise ValueError(
"Another object with the identical id (%s) found" % id.id)
return i
except KeyError:
raise ValueError("%s not found" % str(id))
def __contains__(self, object):
"""DictList.__contains__(object) <==> object in DictList
object: str or :class:`~cobra.core.Object.Object`
"""
if hasattr(object, "id"):
the_id = object.id
# allow to check with the object itself in addition to the id
else:
the_id = object
return the_id in self._dict
def __copy__(self):
the_copy = DictList()
list.extend(the_copy, self)
the_copy._dict = self._dict.copy()
return the_copy
def insert(self, index, object):
"""insert object before index"""
self._check(object.id)
list.insert(self, index, object)
# all subsequent entries now have been shifted up by 1
_dict = self._dict
for i, j in iteritems(_dict):
if j >= index:
_dict[i] = j + 1
_dict[object.id] = index
def pop(self, *args):
"""remove and return item at index (default last)."""
value = list.pop(self, *args)
index = self._dict.pop(value.id)
# If the pop occured from a location other than the end of the list,
# we will need to subtract 1 from every entry afterwards
if len(args) == 0 or args == [-1]: # removing from the end of the list
return value
_dict = self._dict
for i, j in iteritems(_dict):
if j > index:
_dict[i] = j - 1
return value
def remove(self, x):
""".. warning :: Internal use only"""
# Each item is unique in the list which allows this
# It is much faster to do a dict lookup than n string comparisons
self.pop(self.index(x))
# these functions are slower because they rebuild the _dict every time
def reverse(self):
"""reverse *IN PLACE*"""
list.reverse(self)
self._generate_index()
def sort(self, cmp=None, key=None, reverse=False):
"""stable sort *IN PLACE*
cmp(x, y) -> -1, 0, 1
"""
if key is None:
def key(i):
return i.id
if PY3:
list.sort(self, key=key, reverse=reverse)
else:
list.sort(self, cmp=cmp, key=key, reverse=reverse)
self._generate_index()
def __getitem__(self, i):
if isinstance(i, int):
return list.__getitem__(self, i)
elif isinstance(i, slice):
selection = self.__class__()
selection._extend_nocheck(list.__getitem__(self, i))
return selection
elif hasattr(i, "__len__"):
if len(i) == len(self) and isinstance(i[0], (bool, bool_)):
selection = self.__class__()
result = (o for j, o in enumerate(self) if i[j])
selection._extend_nocheck(result)
return selection
else:
return self.__class__(list.__getitem__(self, i))
else:
return list.__getitem__(self, i)
def __setitem__(self, i, y):
if isinstance(i, slice):
# In this case, y needs to be a list. We will ensure all
# the id's are unique
for obj in y: # need to be setting to a list
self._check(obj.id)
# Insert a temporary placeholder so we catch the presence
# of a duplicate in the items being added
self._dict[obj.id] = None
list.__setitem__(self, i, y)
self._generate_index()
return
# in case a rename has occured
if self._dict.get(self[i].id) == i:
self._dict.pop(self[i].id)
the_id = y.id
self._check(the_id)
list.__setitem__(self, i, y)
self._dict[the_id] = i
def __delitem__(self, index):
removed = self[index]
list.__delitem__(self, index)
if isinstance(removed, list):
self._generate_index()
return
_dict = self._dict
_dict.pop(removed.id)
for i, j in iteritems(_dict):
if j > index:
_dict[i] = j - 1
def __getslice__(self, i, j):
return self.__getitem__(slice(i, j))
def __setslice__(self, i, j, y):
self.__setitem__(slice(i, j), y)
def __delslice__(self, i, j):
self.__delitem__(slice(i, j))
def __getattr__(self, attr):
try:
return DictList.get_by_id(self, attr)
except KeyError:
raise AttributeError("DictList has no attribute or entry %s" %
(attr))
def __dir__(self):
# override this to allow tab complete of items by their id
attributes = dir(self.__class__)
attributes.append("_dict")
attributes.extend(self._dict.keys())
return attributes
|
gpl-2.0
|
[
646,
295,
199,
504,
7975,
492,
365,
3037,
199,
504,
3816,
492,
1059,
63,
1313,
12,
10849,
12,
7843,
19,
199,
199,
893,
26,
272,
687,
2680,
492,
2155,
63,
199,
2590,
26,
272,
2155,
63,
275,
2155,
421,
199,
533,
7448,
1296,
8,
513,
304,
272,
408,
33,
12149,
1211,
436,
769,
339,
961,
909,
25113,
2839,
282,
769,
12,
1325,
965,
314,
593,
8,
17,
9,
8112,
272,
22477,
14948,
402,
282,
1211,
1380,
10023,
1536,
4008,
701,
3932,
1305,
14,
339,
408,
339,
347,
636,
826,
721,
277,
12,
627,
589,
304,
267,
340,
822,
8,
589,
9,
690,
499,
26,
288,
746,
3146,
480,
31613,
737,
4750,
413,
1423,
4366,
68,
1627,
2924,
450,
822,
8,
589,
430,
267,
769,
855,
826,
721,
277,
9,
267,
291,
423,
807,
275,
1052,
267,
340,
822,
8,
589,
9,
508,
413,
26,
288,
1163,
275,
1249,
59,
16,
61,
288,
340,
1228,
8,
1848,
12,
7448,
1296,
304,
355,
769,
14,
2880,
8,
277,
12,
1163,
9,
355,
291,
423,
807,
275,
1163,
423,
807,
14,
1574,
342,
288,
587,
26,
355,
291,
14,
2880,
8,
1848,
9,
339,
347,
965,
63,
344,
8,
277,
12,
1305,
304,
267,
372,
1305,
315,
291,
423,
807,
339,
347,
485,
1074,
8,
277,
12,
1305,
304,
267,
408,
1875,
3238,
9250,
1305,
1159,
787,
440,
3483,
14,
267,
961,
805,
365,
2797,
2544,
7791,
315,
4008,
14,
398,
408,
267,
340,
1305,
315,
291,
423,
807,
26,
288,
746,
1722,
480,
344,
450,
83,
365,
2575,
3451,
315,
769,
2,
450,
620,
8,
344,
430,
339,
347,
485,
4208,
63,
1080,
8,
277,
304,
267,
408,
19278,
314,
485,
807,
1478,
624,
267,
291,
423,
807,
275,
469,
86,
14,
344,
26,
1022,
367,
1022,
12,
373,
315,
3874,
8,
277,
6769,
339,
347,
664,
63,
991,
63,
344,
8,
277,
12,
1305,
304,
267,
408,
1107,
314,
1819,
543,
282,
4877,
1305,
624,
267,
372,
769,
855,
6095,
721,
277,
12,
291,
423,
807,
59,
344,
566,
339,
347,
769,
63,
962,
8,
277,
12,
2225,
304,
267,
408,
1107,
282,
769,
402,
314,
1627,
2225,
367,
4036,
909,
398,
408,
267,
372,
359,
5675,
8,
73,
12,
2225,
9,
367,
284,
315,
291,
61,
339,
347,
1827,
8,
277,
12,
2754,
63,
1593,
12,
2225,
628,
344,
2349,
267,
408,
1131,
314,
769,
398,
2754,
63,
1593,
26,
1202,
370,
3504,
1314,
2251,
370,
372,
288,
627,
282,
1059,
12,
315,
1314,
1930,
1263,
909,
14,
3215,
3035,
1598,
314,
1059,
911,
506,
2138,
953,
627,
282,
10311,
5578,
3965,
953,
627,
282,
805,
1314,
6181,
1373,
1423,
436,
2529,
715,
1598,
367,
6387,
1338,
398,
2225,
26,
314,
2225,
370,
506,
17543,
367,
334,
885,
365,
283,
344,
1959,
673,
982,
642,
365,
488,
12,
314,
909,
6337,
365,
1202,
14,
398,
2529,
26,
282,
769,
402,
2251,
1314,
1336,
314,
1827,
267,
408,
267,
340,
2225,
365,
488,
26,
288,
347,
3504,
63,
3215,
8,
88,
304,
355,
372,
671,
267,
587,
26,
288,
347,
3504,
63,
3215,
8,
88,
304,
355,
372,
2519,
8,
88,
12,
2225,
9,
398,
327,
340,
314,
2754,
63,
1593,
365,
282,
5578,
3965,
267,
340,
1228,
8,
1733,
63,
1593,
12,
620,
304,
288,
2754,
63,
1593,
275,
295,
14,
2014,
8,
1733,
63,
1593,
9,
267,
340,
2688,
8,
1733,
63,
1593,
12,
298,
6452,
2349,
288,
4450,
275,
334,
73,
367,
284,
315,
291,
2432,
340,
2754,
63,
1593,
14,
6452,
8,
2416,
63,
3215,
8,
73,
430,
1137,
3073,
267,
587,
26,
288,
4450,
275,
334,
73,
367,
284,
315,
291,
2432,
340,
2754,
63,
1593,
8,
2416,
63,
3215,
8,
73,
1724,
267,
2058,
275,
291,
855,
533,
4533,
267,
2058,
423,
2880,
63,
889,
1074,
8,
6742,
9,
267,
372,
2058,
339,
347,
485,
1814,
63,
265,
63,
344,
8,
277,
12,
892,
63,
785,
304,
267,
408,
11328,
376,
909,
701,
4573,
543,
314,
2011,
1305,
1041,
267,
314,
63,
344,
275,
892,
63,
785,
14,
344,
267,
314,
63,
1080,
275,
291,
423,
807,
59,
1589,
63,
344,
61,
267,
769,
855,
8617,
721,
277,
12,
314,
63,
1080,
12,
892,
63,
785,
9,
339,
327,
18972,
849,
769,
3423,
543,
892,
7869,
272,
347,
5666,
8,
277,
12,
909,
304,
267,
408,
740,
909,
370,
1284,
624,
267,
314,
63,
344,
275,
909,
14,
344,
267,
291,
423,
1074,
8,
1589,
63,
344,
9,
267,
291,
423,
807,
59,
1589,
63,
344,
61,
275,
822,
8,
277,
9,
267,
769,
14,
740,
8,
277,
12,
909,
9,
339,
347,
13629,
8,
277,
12,
6076,
304,
267,
408,
525,
83,
4008,
543,
1305,
1159,
440,
2575,
315,
314,
1402,
624,
267,
485,
807,
275,
291,
423,
807,
267,
5666,
275,
291,
14,
740,
267,
367,
284,
315,
6076,
26,
288,
340,
284,
14,
344,
440,
315,
485,
807,
26,
355,
5666,
8,
73,
9,
339,
347,
12247,
8,
277,
12,
6076,
304,
267,
408,
2880,
769,
701,
24373,
4008,
687,
314,
6076,
624,
267,
327,
30094,
5309,
11097,
687,
376,
12731,
5927,
12,
485,
807,
267,
327,
911,
440,
1172,
10038,
5966,
12,
2952,
314,
11097,
1021,
1990,
267,
327,
3602,
21994,
14,
961,
365,
376,
4976,
2952,
625,
24773,
4882,
267,
327,
7448,
1296,
14,
2880,
12,
1314,
5074,
314,
20024,
402,
485,
807,
14,
21039,
12,
267,
327,
314,
4976,
365,
15604,
436,
1050,
5111,
2348,
14,
267,
340,
440,
2688,
8,
277,
12,
2668,
807,
531,
503,
291,
423,
807,
365,
488,
26,
288,
291,
423,
807,
275,
1052,
267,
485,
807,
275,
291,
423,
807,
267,
1453,
63,
1267,
275,
822,
8,
277,
9,
267,
769,
14,
2880,
8,
277,
12,
6076,
9,
267,
367,
284,
12,
1559,
315,
3874,
8,
374,
3037,
8,
277,
12,
1453,
63,
1267,
12,
488,
395,
1816,
1453,
63,
1267,
304,
288,
314,
63,
344,
275,
1559,
14,
344,
288,
340,
314,
63,
344,
440,
315,
485,
807,
26,
355,
485,
807,
59,
1589,
63,
344,
61,
275,
284,
288,
587,
26,
355,
327,
18172,
314,
12247,
436,
746,
376,
1125,
355,
291,
275,
291,
1491
] |
[
295,
199,
504,
7975,
492,
365,
3037,
199,
504,
3816,
492,
1059,
63,
1313,
12,
10849,
12,
7843,
19,
199,
199,
893,
26,
272,
687,
2680,
492,
2155,
63,
199,
2590,
26,
272,
2155,
63,
275,
2155,
421,
199,
533,
7448,
1296,
8,
513,
304,
272,
408,
33,
12149,
1211,
436,
769,
339,
961,
909,
25113,
2839,
282,
769,
12,
1325,
965,
314,
593,
8,
17,
9,
8112,
272,
22477,
14948,
402,
282,
1211,
1380,
10023,
1536,
4008,
701,
3932,
1305,
14,
339,
408,
339,
347,
636,
826,
721,
277,
12,
627,
589,
304,
267,
340,
822,
8,
589,
9,
690,
499,
26,
288,
746,
3146,
480,
31613,
737,
4750,
413,
1423,
4366,
68,
1627,
2924,
450,
822,
8,
589,
430,
267,
769,
855,
826,
721,
277,
9,
267,
291,
423,
807,
275,
1052,
267,
340,
822,
8,
589,
9,
508,
413,
26,
288,
1163,
275,
1249,
59,
16,
61,
288,
340,
1228,
8,
1848,
12,
7448,
1296,
304,
355,
769,
14,
2880,
8,
277,
12,
1163,
9,
355,
291,
423,
807,
275,
1163,
423,
807,
14,
1574,
342,
288,
587,
26,
355,
291,
14,
2880,
8,
1848,
9,
339,
347,
965,
63,
344,
8,
277,
12,
1305,
304,
267,
372,
1305,
315,
291,
423,
807,
339,
347,
485,
1074,
8,
277,
12,
1305,
304,
267,
408,
1875,
3238,
9250,
1305,
1159,
787,
440,
3483,
14,
267,
961,
805,
365,
2797,
2544,
7791,
315,
4008,
14,
398,
408,
267,
340,
1305,
315,
291,
423,
807,
26,
288,
746,
1722,
480,
344,
450,
83,
365,
2575,
3451,
315,
769,
2,
450,
620,
8,
344,
430,
339,
347,
485,
4208,
63,
1080,
8,
277,
304,
267,
408,
19278,
314,
485,
807,
1478,
624,
267,
291,
423,
807,
275,
469,
86,
14,
344,
26,
1022,
367,
1022,
12,
373,
315,
3874,
8,
277,
6769,
339,
347,
664,
63,
991,
63,
344,
8,
277,
12,
1305,
304,
267,
408,
1107,
314,
1819,
543,
282,
4877,
1305,
624,
267,
372,
769,
855,
6095,
721,
277,
12,
291,
423,
807,
59,
344,
566,
339,
347,
769,
63,
962,
8,
277,
12,
2225,
304,
267,
408,
1107,
282,
769,
402,
314,
1627,
2225,
367,
4036,
909,
398,
408,
267,
372,
359,
5675,
8,
73,
12,
2225,
9,
367,
284,
315,
291,
61,
339,
347,
1827,
8,
277,
12,
2754,
63,
1593,
12,
2225,
628,
344,
2349,
267,
408,
1131,
314,
769,
398,
2754,
63,
1593,
26,
1202,
370,
3504,
1314,
2251,
370,
372,
288,
627,
282,
1059,
12,
315,
1314,
1930,
1263,
909,
14,
3215,
3035,
1598,
314,
1059,
911,
506,
2138,
953,
627,
282,
10311,
5578,
3965,
953,
627,
282,
805,
1314,
6181,
1373,
1423,
436,
2529,
715,
1598,
367,
6387,
1338,
398,
2225,
26,
314,
2225,
370,
506,
17543,
367,
334,
885,
365,
283,
344,
1959,
673,
982,
642,
365,
488,
12,
314,
909,
6337,
365,
1202,
14,
398,
2529,
26,
282,
769,
402,
2251,
1314,
1336,
314,
1827,
267,
408,
267,
340,
2225,
365,
488,
26,
288,
347,
3504,
63,
3215,
8,
88,
304,
355,
372,
671,
267,
587,
26,
288,
347,
3504,
63,
3215,
8,
88,
304,
355,
372,
2519,
8,
88,
12,
2225,
9,
398,
327,
340,
314,
2754,
63,
1593,
365,
282,
5578,
3965,
267,
340,
1228,
8,
1733,
63,
1593,
12,
620,
304,
288,
2754,
63,
1593,
275,
295,
14,
2014,
8,
1733,
63,
1593,
9,
267,
340,
2688,
8,
1733,
63,
1593,
12,
298,
6452,
2349,
288,
4450,
275,
334,
73,
367,
284,
315,
291,
2432,
340,
2754,
63,
1593,
14,
6452,
8,
2416,
63,
3215,
8,
73,
430,
1137,
3073,
267,
587,
26,
288,
4450,
275,
334,
73,
367,
284,
315,
291,
2432,
340,
2754,
63,
1593,
8,
2416,
63,
3215,
8,
73,
1724,
267,
2058,
275,
291,
855,
533,
4533,
267,
2058,
423,
2880,
63,
889,
1074,
8,
6742,
9,
267,
372,
2058,
339,
347,
485,
1814,
63,
265,
63,
344,
8,
277,
12,
892,
63,
785,
304,
267,
408,
11328,
376,
909,
701,
4573,
543,
314,
2011,
1305,
1041,
267,
314,
63,
344,
275,
892,
63,
785,
14,
344,
267,
314,
63,
1080,
275,
291,
423,
807,
59,
1589,
63,
344,
61,
267,
769,
855,
8617,
721,
277,
12,
314,
63,
1080,
12,
892,
63,
785,
9,
339,
327,
18972,
849,
769,
3423,
543,
892,
7869,
272,
347,
5666,
8,
277,
12,
909,
304,
267,
408,
740,
909,
370,
1284,
624,
267,
314,
63,
344,
275,
909,
14,
344,
267,
291,
423,
1074,
8,
1589,
63,
344,
9,
267,
291,
423,
807,
59,
1589,
63,
344,
61,
275,
822,
8,
277,
9,
267,
769,
14,
740,
8,
277,
12,
909,
9,
339,
347,
13629,
8,
277,
12,
6076,
304,
267,
408,
525,
83,
4008,
543,
1305,
1159,
440,
2575,
315,
314,
1402,
624,
267,
485,
807,
275,
291,
423,
807,
267,
5666,
275,
291,
14,
740,
267,
367,
284,
315,
6076,
26,
288,
340,
284,
14,
344,
440,
315,
485,
807,
26,
355,
5666,
8,
73,
9,
339,
347,
12247,
8,
277,
12,
6076,
304,
267,
408,
2880,
769,
701,
24373,
4008,
687,
314,
6076,
624,
267,
327,
30094,
5309,
11097,
687,
376,
12731,
5927,
12,
485,
807,
267,
327,
911,
440,
1172,
10038,
5966,
12,
2952,
314,
11097,
1021,
1990,
267,
327,
3602,
21994,
14,
961,
365,
376,
4976,
2952,
625,
24773,
4882,
267,
327,
7448,
1296,
14,
2880,
12,
1314,
5074,
314,
20024,
402,
485,
807,
14,
21039,
12,
267,
327,
314,
4976,
365,
15604,
436,
1050,
5111,
2348,
14,
267,
340,
440,
2688,
8,
277,
12,
2668,
807,
531,
503,
291,
423,
807,
365,
488,
26,
288,
291,
423,
807,
275,
1052,
267,
485,
807,
275,
291,
423,
807,
267,
1453,
63,
1267,
275,
822,
8,
277,
9,
267,
769,
14,
2880,
8,
277,
12,
6076,
9,
267,
367,
284,
12,
1559,
315,
3874,
8,
374,
3037,
8,
277,
12,
1453,
63,
1267,
12,
488,
395,
1816,
1453,
63,
1267,
304,
288,
314,
63,
344,
275,
1559,
14,
344,
288,
340,
314,
63,
344,
440,
315,
485,
807,
26,
355,
485,
807,
59,
1589,
63,
344,
61,
275,
284,
288,
587,
26,
355,
327,
18172,
314,
12247,
436,
746,
376,
1125,
355,
291,
275,
291,
1491,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
scottdangelo/RemoveVolumeMangerLocks
|
cinder/tests/unit/test_huawei_drivers_compatibility.py
|
20
|
2367
|
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from oslo_utils import importutils
from cinder import context
from cinder import test
CONF = cfg.CONF
HUAWEI_ISCSI_MODULE = ("cinder.volume.drivers.huawei.huawei_driver."
"Huawei18000ISCSIDriver")
HUAWEI_FC_MODULE = ("cinder.volume.drivers.huawei.huawei_driver."
"Huawei18000FCDriver")
class VolumeDriverCompatibility(test.TestCase):
"""Test backwards compatibility for volume drivers."""
def fake_update_cluster_status(self):
return
def setUp(self):
super(VolumeDriverCompatibility, self).setUp()
self.manager = importutils.import_object(CONF.volume_manager)
self.context = context.get_admin_context()
def _load_driver(self, driver):
self.manager.__init__(volume_driver=driver)
def _driver_module_name(self):
return "%s.%s" % (self.manager.driver.__class__.__module__,
self.manager.driver.__class__.__name__)
def test_huawei_driver_iscsi_old(self):
self._load_driver(
'cinder.volume.drivers.huawei.huawei_18000.Huawei18000ISCSIDriver')
self.assertEqual(self._driver_module_name(), HUAWEI_ISCSI_MODULE)
def test_huawei_driver_iscsi_new(self):
self._load_driver(HUAWEI_ISCSI_MODULE)
self.assertEqual(self._driver_module_name(), HUAWEI_ISCSI_MODULE)
def test_huawei_driver_fc_old(self):
self._load_driver(
'cinder.volume.drivers.huawei.huawei_18000.Huawei18000FCDriver')
self.assertEqual(self._driver_module_name(), HUAWEI_FC_MODULE)
def test_huawei_driver_fc_new(self):
self._load_driver(HUAWEI_FC_MODULE)
self.assertEqual(self._driver_module_name(), HUAWEI_FC_MODULE)
|
apache-2.0
|
[
3,
259,
1898,
6029,
14260,
2752,
199,
3,
199,
3,
259,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
1265,
1443,
199,
3,
259,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
2047,
1443,
3332,
199,
3,
259,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
260,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
259,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
259,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
2428,
199,
3,
259,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
1666,
314,
199,
3,
259,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
4204,
199,
3,
259,
1334,
314,
844,
14,
421,
199,
504,
11258,
63,
888,
492,
4810,
199,
504,
11258,
63,
1208,
492,
492,
1208,
199,
199,
504,
13069,
492,
1067,
199,
504,
13069,
492,
511,
421,
199,
3103,
275,
4810,
14,
3103,
199,
40,
21659,
5408,
41,
63,
31826,
63,
10001,
275,
1689,
12372,
14,
2405,
14,
13337,
14,
31665,
14,
31665,
63,
3090,
2122,
2432,
298,
40,
1458,
21431,
1085,
1493,
1311,
3298,
998,
2046,
531,
199,
40,
21659,
5408,
41,
63,
4161,
63,
10001,
275,
1689,
12372,
14,
2405,
14,
13337,
14,
31665,
14,
31665,
63,
3090,
2122,
490,
298,
40,
1458,
21431,
1085,
1493,
4161,
6158,
531,
421,
199,
533,
15018,
6158,
2404,
5880,
8,
396,
14,
1746,
304,
272,
408,
774,
8552,
7163,
367,
3301,
19016,
1041,
339,
347,
4026,
63,
873,
63,
4201,
63,
1205,
8,
277,
304,
267,
372,
339,
347,
3613,
8,
277,
304,
267,
1613,
8,
6464,
6158,
2404,
5880,
12,
291,
680,
5996,
342,
267,
291,
14,
2609,
275,
492,
1208,
14,
646,
63,
785,
8,
3103,
14,
2405,
63,
2609,
9,
267,
291,
14,
1100,
275,
1067,
14,
362,
63,
2113,
63,
1100,
342,
339,
347,
485,
912,
63,
3090,
8,
277,
12,
5253,
304,
267,
291,
14,
2609,
855,
826,
721,
2405,
63,
3090,
29,
3090,
9,
339,
347,
485,
3090,
63,
578,
63,
354,
8,
277,
304,
267,
372,
2071,
83,
4111,
83,
2,
450,
334,
277,
14,
2609,
14,
3090,
855,
533,
4914,
578,
3108,
2079,
291,
14,
2609,
14,
3090,
855,
533,
4914,
354,
3368,
339,
347,
511,
63,
31665,
63,
3090,
63,
17139,
63,
1753,
8,
277,
304,
267,
291,
423,
912,
63,
3090,
8,
288,
283,
12372,
14,
2405,
14,
13337,
14,
31665,
14,
31665,
63,
1085,
1493,
14,
40,
1458,
21431,
1085,
1493,
1311,
3298,
998,
2046,
358,
267,
291,
14,
629,
8,
277,
423,
3090,
63,
578,
63,
354,
1062,
869,
21659,
5408,
41,
63,
31826,
63,
10001,
9,
339,
347,
511,
63,
31665,
63,
3090,
63,
17139,
63,
1222,
8,
277,
304,
267,
291,
423,
912,
63,
3090,
8,
40,
21659,
5408,
41,
63,
31826,
63,
10001,
9,
267,
291,
14,
629,
8,
277,
423,
3090,
63,
578,
63,
354,
1062,
869,
21659,
5408,
41,
63,
31826,
63,
10001,
9,
339,
347,
511,
63,
31665,
63,
3090,
63,
3003,
63,
1753,
8,
277,
304,
267,
291,
423,
912,
63,
3090,
8,
288,
283,
12372,
14,
2405,
14,
13337,
14,
31665,
14,
31665,
63,
1085,
1493,
14,
40,
1458,
21431,
1085,
1493,
4161,
6158,
358,
267,
291,
14,
629,
8,
277,
423,
3090,
63,
578,
63,
354,
1062,
869,
21659,
5408,
41,
63,
4161,
63,
10001,
9,
339,
347,
511,
63,
31665,
63,
3090,
63,
3003,
63,
1222,
8,
277,
304,
267,
291,
423,
912,
63,
3090,
8,
40,
21659,
5408,
41,
63,
4161,
63,
10001,
9,
267,
291,
14,
629,
8,
277,
423,
3090,
63,
578,
63,
354,
1062,
869,
21659,
5408,
41,
63,
4161,
63,
10001,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
259,
1898,
6029,
14260,
2752,
199,
3,
199,
3,
259,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
1265,
1443,
199,
3,
259,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
2047,
1443,
3332,
199,
3,
259,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
260,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
259,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
259,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
2428,
199,
3,
259,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
1666,
314,
199,
3,
259,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
4204,
199,
3,
259,
1334,
314,
844,
14,
421,
199,
504,
11258,
63,
888,
492,
4810,
199,
504,
11258,
63,
1208,
492,
492,
1208,
199,
199,
504,
13069,
492,
1067,
199,
504,
13069,
492,
511,
421,
199,
3103,
275,
4810,
14,
3103,
199,
40,
21659,
5408,
41,
63,
31826,
63,
10001,
275,
1689,
12372,
14,
2405,
14,
13337,
14,
31665,
14,
31665,
63,
3090,
2122,
2432,
298,
40,
1458,
21431,
1085,
1493,
1311,
3298,
998,
2046,
531,
199,
40,
21659,
5408,
41,
63,
4161,
63,
10001,
275,
1689,
12372,
14,
2405,
14,
13337,
14,
31665,
14,
31665,
63,
3090,
2122,
490,
298,
40,
1458,
21431,
1085,
1493,
4161,
6158,
531,
421,
199,
533,
15018,
6158,
2404,
5880,
8,
396,
14,
1746,
304,
272,
408,
774,
8552,
7163,
367,
3301,
19016,
1041,
339,
347,
4026,
63,
873,
63,
4201,
63,
1205,
8,
277,
304,
267,
372,
339,
347,
3613,
8,
277,
304,
267,
1613,
8,
6464,
6158,
2404,
5880,
12,
291,
680,
5996,
342,
267,
291,
14,
2609,
275,
492,
1208,
14,
646,
63,
785,
8,
3103,
14,
2405,
63,
2609,
9,
267,
291,
14,
1100,
275,
1067,
14,
362,
63,
2113,
63,
1100,
342,
339,
347,
485,
912,
63,
3090,
8,
277,
12,
5253,
304,
267,
291,
14,
2609,
855,
826,
721,
2405,
63,
3090,
29,
3090,
9,
339,
347,
485,
3090,
63,
578,
63,
354,
8,
277,
304,
267,
372,
2071,
83,
4111,
83,
2,
450,
334,
277,
14,
2609,
14,
3090,
855,
533,
4914,
578,
3108,
2079,
291,
14,
2609,
14,
3090,
855,
533,
4914,
354,
3368,
339,
347,
511,
63,
31665,
63,
3090,
63,
17139,
63,
1753,
8,
277,
304,
267,
291,
423,
912,
63,
3090,
8,
288,
283,
12372,
14,
2405,
14,
13337,
14,
31665,
14,
31665,
63,
1085,
1493,
14,
40,
1458,
21431,
1085,
1493,
1311,
3298,
998,
2046,
358,
267,
291,
14,
629,
8,
277,
423,
3090,
63,
578,
63,
354,
1062,
869,
21659,
5408,
41,
63,
31826,
63,
10001,
9,
339,
347,
511,
63,
31665,
63,
3090,
63,
17139,
63,
1222,
8,
277,
304,
267,
291,
423,
912,
63,
3090,
8,
40,
21659,
5408,
41,
63,
31826,
63,
10001,
9,
267,
291,
14,
629,
8,
277,
423,
3090,
63,
578,
63,
354,
1062,
869,
21659,
5408,
41,
63,
31826,
63,
10001,
9,
339,
347,
511,
63,
31665,
63,
3090,
63,
3003,
63,
1753,
8,
277,
304,
267,
291,
423,
912,
63,
3090,
8,
288,
283,
12372,
14,
2405,
14,
13337,
14,
31665,
14,
31665,
63,
1085,
1493,
14,
40,
1458,
21431,
1085,
1493,
4161,
6158,
358,
267,
291,
14,
629,
8,
277,
423,
3090,
63,
578,
63,
354,
1062,
869,
21659,
5408,
41,
63,
4161,
63,
10001,
9,
339,
347,
511,
63,
31665,
63,
3090,
63,
3003,
63,
1222,
8,
277,
304,
267,
291,
423,
912,
63,
3090,
8,
40,
21659,
5408,
41,
63,
4161,
63,
10001,
9,
267,
291,
14,
629,
8,
277,
423,
3090,
63,
578,
63,
354,
1062,
869,
21659,
5408,
41,
63,
4161,
63,
10001,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[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] |
Thraxis/SickRage
|
lib/unidecode/x0cb.py
|
253
|
5012
|
data = (
'jjwaels', # 0x00
'jjwaelt', # 0x01
'jjwaelp', # 0x02
'jjwaelh', # 0x03
'jjwaem', # 0x04
'jjwaeb', # 0x05
'jjwaebs', # 0x06
'jjwaes', # 0x07
'jjwaess', # 0x08
'jjwaeng', # 0x09
'jjwaej', # 0x0a
'jjwaec', # 0x0b
'jjwaek', # 0x0c
'jjwaet', # 0x0d
'jjwaep', # 0x0e
'jjwaeh', # 0x0f
'jjoe', # 0x10
'jjoeg', # 0x11
'jjoegg', # 0x12
'jjoegs', # 0x13
'jjoen', # 0x14
'jjoenj', # 0x15
'jjoenh', # 0x16
'jjoed', # 0x17
'jjoel', # 0x18
'jjoelg', # 0x19
'jjoelm', # 0x1a
'jjoelb', # 0x1b
'jjoels', # 0x1c
'jjoelt', # 0x1d
'jjoelp', # 0x1e
'jjoelh', # 0x1f
'jjoem', # 0x20
'jjoeb', # 0x21
'jjoebs', # 0x22
'jjoes', # 0x23
'jjoess', # 0x24
'jjoeng', # 0x25
'jjoej', # 0x26
'jjoec', # 0x27
'jjoek', # 0x28
'jjoet', # 0x29
'jjoep', # 0x2a
'jjoeh', # 0x2b
'jjyo', # 0x2c
'jjyog', # 0x2d
'jjyogg', # 0x2e
'jjyogs', # 0x2f
'jjyon', # 0x30
'jjyonj', # 0x31
'jjyonh', # 0x32
'jjyod', # 0x33
'jjyol', # 0x34
'jjyolg', # 0x35
'jjyolm', # 0x36
'jjyolb', # 0x37
'jjyols', # 0x38
'jjyolt', # 0x39
'jjyolp', # 0x3a
'jjyolh', # 0x3b
'jjyom', # 0x3c
'jjyob', # 0x3d
'jjyobs', # 0x3e
'jjyos', # 0x3f
'jjyoss', # 0x40
'jjyong', # 0x41
'jjyoj', # 0x42
'jjyoc', # 0x43
'jjyok', # 0x44
'jjyot', # 0x45
'jjyop', # 0x46
'jjyoh', # 0x47
'jju', # 0x48
'jjug', # 0x49
'jjugg', # 0x4a
'jjugs', # 0x4b
'jjun', # 0x4c
'jjunj', # 0x4d
'jjunh', # 0x4e
'jjud', # 0x4f
'jjul', # 0x50
'jjulg', # 0x51
'jjulm', # 0x52
'jjulb', # 0x53
'jjuls', # 0x54
'jjult', # 0x55
'jjulp', # 0x56
'jjulh', # 0x57
'jjum', # 0x58
'jjub', # 0x59
'jjubs', # 0x5a
'jjus', # 0x5b
'jjuss', # 0x5c
'jjung', # 0x5d
'jjuj', # 0x5e
'jjuc', # 0x5f
'jjuk', # 0x60
'jjut', # 0x61
'jjup', # 0x62
'jjuh', # 0x63
'jjweo', # 0x64
'jjweog', # 0x65
'jjweogg', # 0x66
'jjweogs', # 0x67
'jjweon', # 0x68
'jjweonj', # 0x69
'jjweonh', # 0x6a
'jjweod', # 0x6b
'jjweol', # 0x6c
'jjweolg', # 0x6d
'jjweolm', # 0x6e
'jjweolb', # 0x6f
'jjweols', # 0x70
'jjweolt', # 0x71
'jjweolp', # 0x72
'jjweolh', # 0x73
'jjweom', # 0x74
'jjweob', # 0x75
'jjweobs', # 0x76
'jjweos', # 0x77
'jjweoss', # 0x78
'jjweong', # 0x79
'jjweoj', # 0x7a
'jjweoc', # 0x7b
'jjweok', # 0x7c
'jjweot', # 0x7d
'jjweop', # 0x7e
'jjweoh', # 0x7f
'jjwe', # 0x80
'jjweg', # 0x81
'jjwegg', # 0x82
'jjwegs', # 0x83
'jjwen', # 0x84
'jjwenj', # 0x85
'jjwenh', # 0x86
'jjwed', # 0x87
'jjwel', # 0x88
'jjwelg', # 0x89
'jjwelm', # 0x8a
'jjwelb', # 0x8b
'jjwels', # 0x8c
'jjwelt', # 0x8d
'jjwelp', # 0x8e
'jjwelh', # 0x8f
'jjwem', # 0x90
'jjweb', # 0x91
'jjwebs', # 0x92
'jjwes', # 0x93
'jjwess', # 0x94
'jjweng', # 0x95
'jjwej', # 0x96
'jjwec', # 0x97
'jjwek', # 0x98
'jjwet', # 0x99
'jjwep', # 0x9a
'jjweh', # 0x9b
'jjwi', # 0x9c
'jjwig', # 0x9d
'jjwigg', # 0x9e
'jjwigs', # 0x9f
'jjwin', # 0xa0
'jjwinj', # 0xa1
'jjwinh', # 0xa2
'jjwid', # 0xa3
'jjwil', # 0xa4
'jjwilg', # 0xa5
'jjwilm', # 0xa6
'jjwilb', # 0xa7
'jjwils', # 0xa8
'jjwilt', # 0xa9
'jjwilp', # 0xaa
'jjwilh', # 0xab
'jjwim', # 0xac
'jjwib', # 0xad
'jjwibs', # 0xae
'jjwis', # 0xaf
'jjwiss', # 0xb0
'jjwing', # 0xb1
'jjwij', # 0xb2
'jjwic', # 0xb3
'jjwik', # 0xb4
'jjwit', # 0xb5
'jjwip', # 0xb6
'jjwih', # 0xb7
'jjyu', # 0xb8
'jjyug', # 0xb9
'jjyugg', # 0xba
'jjyugs', # 0xbb
'jjyun', # 0xbc
'jjyunj', # 0xbd
'jjyunh', # 0xbe
'jjyud', # 0xbf
'jjyul', # 0xc0
'jjyulg', # 0xc1
'jjyulm', # 0xc2
'jjyulb', # 0xc3
'jjyuls', # 0xc4
'jjyult', # 0xc5
'jjyulp', # 0xc6
'jjyulh', # 0xc7
'jjyum', # 0xc8
'jjyub', # 0xc9
'jjyubs', # 0xca
'jjyus', # 0xcb
'jjyuss', # 0xcc
'jjyung', # 0xcd
'jjyuj', # 0xce
'jjyuc', # 0xcf
'jjyuk', # 0xd0
'jjyut', # 0xd1
'jjyup', # 0xd2
'jjyuh', # 0xd3
'jjeu', # 0xd4
'jjeug', # 0xd5
'jjeugg', # 0xd6
'jjeugs', # 0xd7
'jjeun', # 0xd8
'jjeunj', # 0xd9
'jjeunh', # 0xda
'jjeud', # 0xdb
'jjeul', # 0xdc
'jjeulg', # 0xdd
'jjeulm', # 0xde
'jjeulb', # 0xdf
'jjeuls', # 0xe0
'jjeult', # 0xe1
'jjeulp', # 0xe2
'jjeulh', # 0xe3
'jjeum', # 0xe4
'jjeub', # 0xe5
'jjeubs', # 0xe6
'jjeus', # 0xe7
'jjeuss', # 0xe8
'jjeung', # 0xe9
'jjeuj', # 0xea
'jjeuc', # 0xeb
'jjeuk', # 0xec
'jjeut', # 0xed
'jjeup', # 0xee
'jjeuh', # 0xef
'jjyi', # 0xf0
'jjyig', # 0xf1
'jjyigg', # 0xf2
'jjyigs', # 0xf3
'jjyin', # 0xf4
'jjyinj', # 0xf5
'jjyinh', # 0xf6
'jjyid', # 0xf7
'jjyil', # 0xf8
'jjyilg', # 0xf9
'jjyilm', # 0xfa
'jjyilb', # 0xfb
'jjyils', # 0xfc
'jjyilt', # 0xfd
'jjyilp', # 0xfe
'jjyilh', # 0xff
)
|
gpl-3.0
|
[
576,
275,
334,
199,
7,
12098,
758,
18099,
297,
259,
327,
378,
88,
383,
199,
7,
12098,
758,
15330,
297,
259,
327,
378,
88,
614,
199,
7,
12098,
758,
1357,
297,
259,
327,
378,
88,
996,
199,
7,
12098,
758,
352,
72,
297,
259,
327,
378,
88,
1644,
199,
7,
12098,
758,
5633,
297,
259,
327,
378,
88,
966,
199,
7,
12098,
758,
2871,
297,
259,
327,
378,
88,
1717,
199,
7,
12098,
758,
69,
1533,
297,
259,
327,
378,
88,
1690,
199,
7,
12098,
758,
397,
297,
259,
327,
378,
88,
1780,
199,
7,
12098,
758,
16709,
297,
259,
327,
378,
88,
2036,
199,
7,
12098,
758,
7420,
297,
259,
327,
378,
88,
1643,
199,
7,
12098,
758,
69,
74,
297,
259,
327,
378,
88,
16,
65,
199,
7,
12098,
758,
825,
297,
259,
327,
378,
88,
16,
66,
199,
7,
12098,
758,
5711,
297,
259,
327,
378,
88,
16,
67,
199,
7,
12098,
758,
386,
297,
259,
327,
378,
88,
16,
68,
199,
7,
12098,
758,
1545,
297,
259,
327,
378,
88,
16,
69,
199,
7,
12098,
758,
24528,
297,
259,
327,
378,
88,
16,
70,
199,
7,
74,
20241,
297,
259,
327,
378,
88,
709,
199,
7,
74,
743,
5902,
297,
259,
327,
378,
88,
845,
199,
7,
74,
743,
5799,
297,
259,
327,
378,
88,
713,
199,
7,
74,
20241,
458,
297,
259,
327,
378,
88,
969,
199,
7,
74,
743,
287,
297,
259,
327,
378,
88,
1079,
199,
7,
74,
743,
287,
74,
297,
259,
327,
378,
88,
1046,
199,
7,
74,
743,
287,
72,
297,
259,
327,
378,
88,
975,
199,
7,
74,
743,
379,
297,
259,
327,
378,
88,
1196,
199,
7,
74,
743,
352,
297,
259,
327,
378,
88,
1085,
199,
7,
74,
743,
352,
71,
297,
259,
327,
378,
88,
1167,
199,
7,
74,
743,
21226,
297,
259,
327,
378,
88,
17,
65,
199,
7,
74,
743,
17778,
297,
259,
327,
378,
88,
17,
66,
199,
7,
74,
743,
18099,
297,
259,
327,
378,
88,
17,
67,
199,
7,
74,
743,
15330,
297,
259,
327,
378,
88,
17,
68,
199,
7,
74,
743,
1357,
297,
259,
327,
378,
88,
17,
69,
199,
7,
74,
743,
352,
72,
297,
259,
327,
378,
88,
17,
70,
199,
7,
74,
743,
5633,
297,
259,
327,
378,
88,
1165,
199,
7,
74,
743,
2871,
297,
259,
327,
378,
88,
2025,
199,
7,
74,
20241,
1533,
297,
259,
327,
378,
88,
1081,
199,
7,
74,
743,
397,
297,
259,
327,
378,
88,
1789,
199,
7,
74,
743,
16709,
297,
259,
327,
378,
88,
1194,
199,
7,
74,
743,
7420,
297,
259,
327,
378,
88,
821,
199,
7,
74,
20241,
74,
297,
259,
327,
378,
88,
1479,
199,
7,
74,
743,
825,
297,
259,
327,
378,
88,
1465,
199,
7,
74,
743,
5711,
297,
259,
327,
378,
88,
1651,
199,
7,
74,
743,
386,
297,
259,
327,
378,
88,
1398,
199,
7,
74,
743,
1545,
297,
259,
327,
378,
88,
18,
65,
199,
7,
74,
20241,
72,
297,
259,
327,
378,
88,
18,
66,
199,
7,
12098,
16540,
297,
259,
327,
378,
88,
18,
67,
199,
7,
12098,
89,
974,
297,
259,
327,
378,
88,
18,
68,
199,
7,
12098,
89,
24798,
297,
259,
327,
378,
88,
18,
69,
199,
7,
12098,
16540,
458,
297,
259,
327,
378,
88,
18,
70,
199,
7,
12098,
89,
265,
297,
259,
327,
378,
88,
1216,
199,
7,
12098,
89,
265,
74,
297,
259,
327,
378,
88,
2192,
199,
7,
12098,
89,
265,
72,
297,
259,
327,
378,
88,
708,
199,
7,
12098,
89,
364,
297,
259,
327,
378,
88,
1153,
199,
7,
12098,
89,
393,
297,
259,
327,
378,
88,
1082,
199,
7,
12098,
89,
393,
71,
297,
259,
327,
378,
88,
1276,
199,
7,
12098,
89,
393,
77,
297,
259,
327,
378,
88,
1344,
199,
7,
12098,
89,
393,
66,
297,
259,
327,
378,
88,
1401,
199,
7,
12098,
89,
1446,
297,
259,
327,
378,
88,
1703,
199,
7,
12098,
89,
28934,
297,
259,
327,
378,
88,
1355,
199,
7,
12098,
89,
393,
80,
297,
259,
327,
378,
88,
19,
65,
199,
7,
12098,
89,
393,
72,
297,
259,
327,
378,
88,
19,
66,
199,
7,
12098,
89,
676,
297,
259,
327,
378,
88,
19,
67,
199,
7,
12098,
89,
2873,
297,
259,
327,
378,
88,
19,
68,
199,
7,
12098,
89,
11226,
297,
259,
327,
378,
88,
19,
69,
199,
7,
12098,
89,
736,
297,
259,
327,
378,
88,
19,
70,
199,
7,
12098,
16540,
385,
297,
259,
327,
378,
88,
2167,
199,
7,
12098,
89,
951,
297,
259,
327,
378,
88,
2953,
199,
7,
12098,
16540,
74,
297,
259,
327,
378,
88,
2260,
199,
7,
12098,
89,
679,
297,
259,
327,
378,
88,
2824,
199,
7,
12098,
89,
745,
297,
259,
327,
378,
88,
1602,
199,
7,
12098,
89,
357,
297,
259,
327,
378,
88,
2322,
199,
7,
12098,
89,
411,
297,
259,
327,
378,
88,
2466,
199,
7,
12098,
16540,
72,
297,
259,
327,
378,
88,
2417,
199,
7,
12098,
85,
297,
259,
327,
378,
88,
2006,
199,
7,
12098,
1518,
297,
259,
327,
378,
88,
1887,
199,
7,
12098,
1518,
71,
297,
259,
327,
378,
88,
20,
65,
199,
7,
12098,
85,
458,
297,
259,
327,
378,
88,
20,
66,
199,
7,
12098,
324,
297,
259,
327,
378,
88,
20,
67,
199,
7,
12098,
324,
74,
297,
259,
327,
378,
88,
20,
68,
199,
7,
12098,
324,
72,
297,
259,
327,
378,
88,
20,
69,
199,
7,
12098,
1181,
297,
259,
327,
378,
88,
20,
70,
199,
7,
12098,
348,
297,
259,
327,
378,
88,
1400,
199,
7,
12098,
27092,
297,
259,
327,
378,
88,
2869,
199,
7,
12098,
348,
77,
297,
259,
327,
378,
88,
2528,
199,
7,
12098,
348,
66,
297,
259,
327,
378,
88,
2481,
199,
7,
12098,
348,
83,
297,
259,
327,
378,
88,
1477,
199,
7,
12098,
427,
297,
259,
327,
378,
88,
1229,
199,
7,
12098,
15513,
297,
259,
327,
378,
88,
1367,
199,
7,
12098,
348,
72,
297,
259,
327,
378,
88,
1641,
199,
7,
12098,
453,
297,
259,
327,
378,
88,
2010,
199,
7,
12098,
456,
297,
259,
327,
378,
88
] |
[
275,
334,
199,
7,
12098,
758,
18099,
297,
259,
327,
378,
88,
383,
199,
7,
12098,
758,
15330,
297,
259,
327,
378,
88,
614,
199,
7,
12098,
758,
1357,
297,
259,
327,
378,
88,
996,
199,
7,
12098,
758,
352,
72,
297,
259,
327,
378,
88,
1644,
199,
7,
12098,
758,
5633,
297,
259,
327,
378,
88,
966,
199,
7,
12098,
758,
2871,
297,
259,
327,
378,
88,
1717,
199,
7,
12098,
758,
69,
1533,
297,
259,
327,
378,
88,
1690,
199,
7,
12098,
758,
397,
297,
259,
327,
378,
88,
1780,
199,
7,
12098,
758,
16709,
297,
259,
327,
378,
88,
2036,
199,
7,
12098,
758,
7420,
297,
259,
327,
378,
88,
1643,
199,
7,
12098,
758,
69,
74,
297,
259,
327,
378,
88,
16,
65,
199,
7,
12098,
758,
825,
297,
259,
327,
378,
88,
16,
66,
199,
7,
12098,
758,
5711,
297,
259,
327,
378,
88,
16,
67,
199,
7,
12098,
758,
386,
297,
259,
327,
378,
88,
16,
68,
199,
7,
12098,
758,
1545,
297,
259,
327,
378,
88,
16,
69,
199,
7,
12098,
758,
24528,
297,
259,
327,
378,
88,
16,
70,
199,
7,
74,
20241,
297,
259,
327,
378,
88,
709,
199,
7,
74,
743,
5902,
297,
259,
327,
378,
88,
845,
199,
7,
74,
743,
5799,
297,
259,
327,
378,
88,
713,
199,
7,
74,
20241,
458,
297,
259,
327,
378,
88,
969,
199,
7,
74,
743,
287,
297,
259,
327,
378,
88,
1079,
199,
7,
74,
743,
287,
74,
297,
259,
327,
378,
88,
1046,
199,
7,
74,
743,
287,
72,
297,
259,
327,
378,
88,
975,
199,
7,
74,
743,
379,
297,
259,
327,
378,
88,
1196,
199,
7,
74,
743,
352,
297,
259,
327,
378,
88,
1085,
199,
7,
74,
743,
352,
71,
297,
259,
327,
378,
88,
1167,
199,
7,
74,
743,
21226,
297,
259,
327,
378,
88,
17,
65,
199,
7,
74,
743,
17778,
297,
259,
327,
378,
88,
17,
66,
199,
7,
74,
743,
18099,
297,
259,
327,
378,
88,
17,
67,
199,
7,
74,
743,
15330,
297,
259,
327,
378,
88,
17,
68,
199,
7,
74,
743,
1357,
297,
259,
327,
378,
88,
17,
69,
199,
7,
74,
743,
352,
72,
297,
259,
327,
378,
88,
17,
70,
199,
7,
74,
743,
5633,
297,
259,
327,
378,
88,
1165,
199,
7,
74,
743,
2871,
297,
259,
327,
378,
88,
2025,
199,
7,
74,
20241,
1533,
297,
259,
327,
378,
88,
1081,
199,
7,
74,
743,
397,
297,
259,
327,
378,
88,
1789,
199,
7,
74,
743,
16709,
297,
259,
327,
378,
88,
1194,
199,
7,
74,
743,
7420,
297,
259,
327,
378,
88,
821,
199,
7,
74,
20241,
74,
297,
259,
327,
378,
88,
1479,
199,
7,
74,
743,
825,
297,
259,
327,
378,
88,
1465,
199,
7,
74,
743,
5711,
297,
259,
327,
378,
88,
1651,
199,
7,
74,
743,
386,
297,
259,
327,
378,
88,
1398,
199,
7,
74,
743,
1545,
297,
259,
327,
378,
88,
18,
65,
199,
7,
74,
20241,
72,
297,
259,
327,
378,
88,
18,
66,
199,
7,
12098,
16540,
297,
259,
327,
378,
88,
18,
67,
199,
7,
12098,
89,
974,
297,
259,
327,
378,
88,
18,
68,
199,
7,
12098,
89,
24798,
297,
259,
327,
378,
88,
18,
69,
199,
7,
12098,
16540,
458,
297,
259,
327,
378,
88,
18,
70,
199,
7,
12098,
89,
265,
297,
259,
327,
378,
88,
1216,
199,
7,
12098,
89,
265,
74,
297,
259,
327,
378,
88,
2192,
199,
7,
12098,
89,
265,
72,
297,
259,
327,
378,
88,
708,
199,
7,
12098,
89,
364,
297,
259,
327,
378,
88,
1153,
199,
7,
12098,
89,
393,
297,
259,
327,
378,
88,
1082,
199,
7,
12098,
89,
393,
71,
297,
259,
327,
378,
88,
1276,
199,
7,
12098,
89,
393,
77,
297,
259,
327,
378,
88,
1344,
199,
7,
12098,
89,
393,
66,
297,
259,
327,
378,
88,
1401,
199,
7,
12098,
89,
1446,
297,
259,
327,
378,
88,
1703,
199,
7,
12098,
89,
28934,
297,
259,
327,
378,
88,
1355,
199,
7,
12098,
89,
393,
80,
297,
259,
327,
378,
88,
19,
65,
199,
7,
12098,
89,
393,
72,
297,
259,
327,
378,
88,
19,
66,
199,
7,
12098,
89,
676,
297,
259,
327,
378,
88,
19,
67,
199,
7,
12098,
89,
2873,
297,
259,
327,
378,
88,
19,
68,
199,
7,
12098,
89,
11226,
297,
259,
327,
378,
88,
19,
69,
199,
7,
12098,
89,
736,
297,
259,
327,
378,
88,
19,
70,
199,
7,
12098,
16540,
385,
297,
259,
327,
378,
88,
2167,
199,
7,
12098,
89,
951,
297,
259,
327,
378,
88,
2953,
199,
7,
12098,
16540,
74,
297,
259,
327,
378,
88,
2260,
199,
7,
12098,
89,
679,
297,
259,
327,
378,
88,
2824,
199,
7,
12098,
89,
745,
297,
259,
327,
378,
88,
1602,
199,
7,
12098,
89,
357,
297,
259,
327,
378,
88,
2322,
199,
7,
12098,
89,
411,
297,
259,
327,
378,
88,
2466,
199,
7,
12098,
16540,
72,
297,
259,
327,
378,
88,
2417,
199,
7,
12098,
85,
297,
259,
327,
378,
88,
2006,
199,
7,
12098,
1518,
297,
259,
327,
378,
88,
1887,
199,
7,
12098,
1518,
71,
297,
259,
327,
378,
88,
20,
65,
199,
7,
12098,
85,
458,
297,
259,
327,
378,
88,
20,
66,
199,
7,
12098,
324,
297,
259,
327,
378,
88,
20,
67,
199,
7,
12098,
324,
74,
297,
259,
327,
378,
88,
20,
68,
199,
7,
12098,
324,
72,
297,
259,
327,
378,
88,
20,
69,
199,
7,
12098,
1181,
297,
259,
327,
378,
88,
20,
70,
199,
7,
12098,
348,
297,
259,
327,
378,
88,
1400,
199,
7,
12098,
27092,
297,
259,
327,
378,
88,
2869,
199,
7,
12098,
348,
77,
297,
259,
327,
378,
88,
2528,
199,
7,
12098,
348,
66,
297,
259,
327,
378,
88,
2481,
199,
7,
12098,
348,
83,
297,
259,
327,
378,
88,
1477,
199,
7,
12098,
427,
297,
259,
327,
378,
88,
1229,
199,
7,
12098,
15513,
297,
259,
327,
378,
88,
1367,
199,
7,
12098,
348,
72,
297,
259,
327,
378,
88,
1641,
199,
7,
12098,
453,
297,
259,
327,
378,
88,
2010,
199,
7,
12098,
456,
297,
259,
327,
378,
88,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
txtbits/daw-python
|
pygame/starwars/StarWars[LUISMI]/game.py
|
1
|
3787
|
# -*- coding: utf-8 -*-
'''
Clon de Space Invaders
(Basado en un script original de Kevin Harris)
A partir de un ejercicio de Fernando Salamero
'''
import pygame
from pygame.locals import *
from starwarslib import *
from random import randint
random.seed()
pygame.init()
visor = pygame.display.set_mode( (ANCHO, ALTO) )
pygame.display.set_caption( "Star Wars" )
pygame.mouse.set_visible(False)
fondo_intro = cargar_imagen( "intro.bmp")
fondo_jugando = cargar_imagen( "background.bmp" )
visor.blit(fondo_intro, (0,0))
xwing = XWing()
# grupo de Xwing para colisiones
xwingGrupo = pygame.sprite.RenderUpdates(xwing)
# grupod de naves enemigas
tiefighterGrupo = pygame.sprite.RenderUpdates()
# inicialización: tres naves
tiefighterGrupo.add( TIEFighter( 150 ) )
tiefighterGrupo.add( TIEFighter( 400 ) )
tiefighterGrupo.add( TIEFighter( 650 ) )
marcadorvidas = Marcador()
vida_perdida = False
iniciando = True
jugando = False
cerrar = True
finalizando = False
contador = 0
intervaloEnemigos = 0
tipoLetra = pygame.font.SysFont('arial', 24)
tipoLetra2 = pygame.font.SysFont('arial', 17)
reloj = pygame.time.Clock()
while cerrar:
reloj.tick( 60 ) # FPS
if vida_perdida:
contador -= 1
if contador == 0:
vida_perdida = False
for event in pygame.event.get():
if event.type == QUIT:
cerrar = False
elif event.type == KEYDOWN:
if event.key == K_SPACE:
xwing.dispara()
jugando = True
iniciando = False
elif event.type == KEYUP:
xwing.dx , xwing.dy = 0 , 0
teclasPulsadas = pygame.key.get_pressed()
# Movimiento nave
if teclasPulsadas[K_LEFT]:
xwing.dx = -4
if teclasPulsadas[K_RIGHT]:
xwing.dx = 4
if teclasPulsadas[K_UP]:
xwing.dy = -4
if teclasPulsadas[K_DOWN]:
xwing.dy = 4
intervaloEnemigos += 1
if intervaloEnemigos >= 200:
tiefighterGrupo.add( TIEFighter( randint(30,770) ) )
intervaloEnemigos = 0
# Actualiza
xwingGrupo.update()
XWing.laser_grupo.update()
tiefighterGrupo.update()
TIEFighter.laser_grupo.update()
'''
Elimina nuestra nave
'''
if pygame.sprite.spritecollideany(xwing, TIEFighter.laser_grupo):
xwing.vidas -= 1
xwing.rect.center = (ANCHO/2,ALTO)
for nave in tiefighterGrupo:
tiefighterGrupo.remove(nave)
for disparo in TIEFighter.laser_grupo:
TIEFighter.laser_grupo.remove(disparo)
for disparo in XWing.laser_grupo:
XWing.laser_grupo.remove(disparo)
vida_perdida = True
contador = 2* 60
# Elimina enemigos tocados
for pum in pygame.sprite.groupcollide(tiefighterGrupo, XWing.laser_grupo, 1, 1):
pum.explota()
xwing.puntos += 1
pygame.sprite.groupcollide(TIEFighter.laser_grupo, XWing.laser_grupo, 1, 1)
# fondo
if iniciando:
visor.blit(fondo_intro, (0,0))
elif jugando:
visor.blit(fondo_jugando, (0,0))
'''
elif finalizando:
visor.blit(fondo_fin, (0,0))
'''
# Borra
TIEFighter.laser_grupo.clear( visor, fondo_jugando )
tiefighterGrupo.clear( visor, fondo_jugando )
XWing.laser_grupo.clear( visor, fondo_jugando)
xwingGrupo.clear( visor, fondo_jugando )
#Marcador.grupo.clear(visor,fondo_jugando)
# Dibuja
TIEFighter.laser_grupo.draw( visor )
XWing.laser_grupo.draw( visor )
tiefighterGrupo.draw( visor )
xwingGrupo.draw( visor )
if jugando:
xwing.dibujar_puntos(visor,tipoLetra,tipoLetra2,xwing.puntos)
marcadorvidas.dibuja(xwing.vidas,visor)
# Actualiza
pygame.display.update()
|
mit
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
2344,
199,
1968,
265,
477,
19326,
30110,
669,
83,
199,
8,
34,
305,
5129,
655,
625,
2884,
3379,
477,
25645,
11908,
25378,
5719,
9,
199,
199,
33,
623,
280,
82,
477,
625,
325,
74,
281,
67,
530,
2308,
477,
481,
27569,
22066,
428,
279,
313,
293,
199,
2344,
199,
199,
646,
9193,
199,
504,
9193,
14,
9350,
492,
627,
199,
504,
14664,
3281,
83,
773,
492,
627,
199,
504,
2196,
492,
29722,
199,
199,
2355,
14,
5176,
342,
199,
199,
22278,
14,
826,
342,
199,
199,
8286,
275,
9193,
14,
2918,
14,
409,
63,
632,
8,
334,
879,
10465,
12,
12112,
2566,
9,
776,
199,
22278,
14,
2918,
14,
409,
63,
13410,
8,
298,
23197,
644,
4291,
2,
776,
199,
22278,
14,
10544,
14,
409,
63,
6604,
8,
797,
9,
421,
199,
70,
265,
1117,
63,
18206,
275,
286,
1273,
285,
63,
11744,
2268,
8,
298,
18206,
14,
22308,
531,
199,
70,
265,
1117,
63,
74,
1518,
22066,
275,
286,
1273,
285,
63,
11744,
2268,
8,
298,
7451,
14,
22308,
2,
776,
199,
8286,
14,
15574,
8,
70,
265,
1117,
63,
18206,
12,
334,
16,
12,
16,
430,
421,
199,
88,
87,
316,
275,
1323,
55,
316,
342,
199,
3,
486,
5505,
79,
477,
1323,
87,
316,
12665,
512,
317,
338,
4548,
199,
88,
87,
316,
39,
5505,
79,
275,
9193,
14,
15972,
14,
9216,
16083,
8,
88,
87,
316,
9,
199,
3,
486,
5505,
364,
477,
302,
7047,
655,
69,
4071,
305,
199,
23958,
592,
72,
351,
39,
5505,
79,
275,
9193,
14,
15972,
14,
9216,
16083,
342,
199,
3,
315,
530,
2380,
565,
22832,
19228,
26,
307,
470,
302,
7047,
199,
23958,
592,
72,
351,
39,
5505,
79,
14,
525,
8,
377,
4332,
38,
2056,
351,
8,
14711,
776,
776,
199,
23958,
592,
72,
351,
39,
5505,
79,
14,
525,
8,
377,
4332,
38,
2056,
351,
8,
8290,
776,
776,
199,
23958,
592,
72,
351,
39,
5505,
79,
14,
525,
8,
377,
4332,
38,
2056,
351,
8,
1227,
1400,
776,
776,
421,
199,
30342,
25453,
5017,
305,
275,
603,
9912,
25453,
342,
199,
5017,
65,
63,
529,
328,
983,
275,
756,
199,
26715,
73,
22066,
275,
715,
258,
199,
74,
1518,
22066,
275,
756,
199,
67,
1508,
285,
275,
715,
199,
5094,
565,
22066,
275,
756,
199,
11096,
25453,
275,
378,
199,
4284,
79,
37,
685,
4071,
736,
275,
378,
199,
280,
555,
15314,
345,
275,
9193,
14,
4246,
14,
11319,
6986,
360,
759,
279,
297,
5504,
9,
199,
280,
555,
15314,
345,
18,
275,
9193,
14,
4246,
14,
11319,
6986,
360,
759,
279,
297,
5557,
9,
421,
199,
264,
320,
74,
275,
9193,
14,
521,
14,
17387,
342,
199,
199,
6710,
286,
1508,
285,
26,
272,
295,
320,
74,
14,
8284,
8,
5212,
776,
221,
327,
481,
5067,
2286,
340,
27767,
65,
63,
529,
328,
983,
26,
267,
13770,
25453,
4862,
413,
267,
340,
13770,
25453,
508,
378,
26,
288,
27767,
65,
63,
529,
328,
983,
275,
756,
15567,
367,
1566,
315,
9193,
14,
1430,
14,
362,
837,
267,
340,
1566,
14,
466,
508,
7813,
649,
26,
288,
286,
1508,
285,
275,
756,
267,
916,
1566,
14,
466,
508,
9301,
8819,
26,
259,
288,
340,
1566,
14,
498,
508,
1804,
63,
11658,
26,
355,
671,
87,
316,
14,
2297,
12227,
342,
355,
1335,
1518,
22066,
275,
715,
355,
315,
530,
73,
22066,
275,
756,
267,
916,
1566,
14,
466,
508,
9301,
2160,
26,
288,
671,
87,
316,
14,
8373,
2360,
671,
87,
316,
14,
8161,
275,
378,
2360,
378,
2286,
1565,
429,
305,
48,
348,
83,
350,
305,
275,
9193,
14,
498,
14,
362,
63,
30455,
342,
272,
327,
3930,
433,
2664,
287,
475,
302,
811,
272,
340,
1565,
429,
305,
48,
348,
83,
350,
305,
59,
43,
63,
9894,
2189,
267,
671,
87,
316,
14,
8373,
275,
446,
20,
272,
340,
1565,
429,
305,
48,
348,
83,
350,
305,
59,
43,
63,
12811,
2189,
267,
671,
87,
316,
14,
8373,
275,
841,
272,
340,
1565,
429,
305,
48,
348,
83,
350,
305,
59,
43,
63,
2160,
2189,
267,
671,
87,
316,
14,
8161,
275,
446,
20,
272,
340,
1565,
429,
305,
48,
348,
83,
350,
305,
59,
43,
63,
8819,
2189,
267,
671,
87,
316,
14,
8161,
275,
841,
339,
6252,
79,
37,
685,
4071,
736,
847,
413,
272,
340,
6252,
79,
37,
685,
4071,
736,
2356,
1926,
26,
267,
3367,
69,
592,
72,
351,
39,
5505,
79,
14,
525,
8,
377,
4332,
38,
2056,
351,
8,
29722,
8,
1216,
12,
17902,
9,
776,
776,
267,
6252,
79,
37,
685,
4071,
736,
275,
378,
2286,
327,
18982,
1061,
565,
65,
272,
671,
87,
316,
39,
5505,
79,
14,
873,
342,
272,
1323,
55,
316,
14,
416,
332,
63,
2587,
384,
79,
14,
873,
342,
272,
3367,
69,
592,
72,
351,
39,
5505,
79,
14,
873,
342,
272,
377,
4332,
38,
2056,
351,
14,
416,
332,
63,
2587,
384,
79,
14,
873,
342,
2286,
1449,
272,
662,
13769,
65,
302,
5291,
345,
302,
811,
272,
1449,
272,
340,
9193,
14,
15972,
14,
15972,
761,
8409,
1629,
8,
88,
87,
316,
12,
377,
4332,
38,
2056,
351,
14,
416,
332,
63,
2587,
384,
79,
304,
267,
671,
87,
316,
14,
5017,
305,
4862,
413,
267,
671,
87,
316,
14,
1201,
14,
4218,
275,
334,
879,
10465,
15,
18,
12,
748,
2566,
9,
267,
367,
302,
811,
315,
3367,
69,
592,
72,
351,
39,
5505,
79,
26,
288,
3367,
69,
592,
72,
351,
39,
5505,
79,
14,
2168,
8,
78,
811,
9,
267,
367,
2153,
462,
79,
315,
377,
4332,
38,
2056,
351,
14,
416,
332,
63,
2587,
384,
79,
26,
288,
377,
4332,
38,
2056,
351,
14,
416,
332,
63,
2587,
384,
79,
14,
2168,
8,
2297,
462,
79,
9,
267,
367,
2153,
462,
79,
315,
1323,
55,
316,
14,
416,
332,
63,
2587,
384,
79,
26,
288,
1323,
55,
316,
14,
416,
332,
63,
2587,
384,
79,
14,
2168,
8,
2297,
462,
79,
9,
267,
27767,
65,
63,
529,
328,
983,
275,
715,
267,
13770,
25453,
275,
499,
10,
5212,
2286,
327,
662,
13769,
65,
655,
69,
4071,
736,
22021,
20257,
272
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
2344,
199,
1968,
265,
477,
19326,
30110,
669,
83,
199,
8,
34,
305,
5129,
655,
625,
2884,
3379,
477,
25645,
11908,
25378,
5719,
9,
199,
199,
33,
623,
280,
82,
477,
625,
325,
74,
281,
67,
530,
2308,
477,
481,
27569,
22066,
428,
279,
313,
293,
199,
2344,
199,
199,
646,
9193,
199,
504,
9193,
14,
9350,
492,
627,
199,
504,
14664,
3281,
83,
773,
492,
627,
199,
504,
2196,
492,
29722,
199,
199,
2355,
14,
5176,
342,
199,
199,
22278,
14,
826,
342,
199,
199,
8286,
275,
9193,
14,
2918,
14,
409,
63,
632,
8,
334,
879,
10465,
12,
12112,
2566,
9,
776,
199,
22278,
14,
2918,
14,
409,
63,
13410,
8,
298,
23197,
644,
4291,
2,
776,
199,
22278,
14,
10544,
14,
409,
63,
6604,
8,
797,
9,
421,
199,
70,
265,
1117,
63,
18206,
275,
286,
1273,
285,
63,
11744,
2268,
8,
298,
18206,
14,
22308,
531,
199,
70,
265,
1117,
63,
74,
1518,
22066,
275,
286,
1273,
285,
63,
11744,
2268,
8,
298,
7451,
14,
22308,
2,
776,
199,
8286,
14,
15574,
8,
70,
265,
1117,
63,
18206,
12,
334,
16,
12,
16,
430,
421,
199,
88,
87,
316,
275,
1323,
55,
316,
342,
199,
3,
486,
5505,
79,
477,
1323,
87,
316,
12665,
512,
317,
338,
4548,
199,
88,
87,
316,
39,
5505,
79,
275,
9193,
14,
15972,
14,
9216,
16083,
8,
88,
87,
316,
9,
199,
3,
486,
5505,
364,
477,
302,
7047,
655,
69,
4071,
305,
199,
23958,
592,
72,
351,
39,
5505,
79,
275,
9193,
14,
15972,
14,
9216,
16083,
342,
199,
3,
315,
530,
2380,
565,
22832,
19228,
26,
307,
470,
302,
7047,
199,
23958,
592,
72,
351,
39,
5505,
79,
14,
525,
8,
377,
4332,
38,
2056,
351,
8,
14711,
776,
776,
199,
23958,
592,
72,
351,
39,
5505,
79,
14,
525,
8,
377,
4332,
38,
2056,
351,
8,
8290,
776,
776,
199,
23958,
592,
72,
351,
39,
5505,
79,
14,
525,
8,
377,
4332,
38,
2056,
351,
8,
1227,
1400,
776,
776,
421,
199,
30342,
25453,
5017,
305,
275,
603,
9912,
25453,
342,
199,
5017,
65,
63,
529,
328,
983,
275,
756,
199,
26715,
73,
22066,
275,
715,
258,
199,
74,
1518,
22066,
275,
756,
199,
67,
1508,
285,
275,
715,
199,
5094,
565,
22066,
275,
756,
199,
11096,
25453,
275,
378,
199,
4284,
79,
37,
685,
4071,
736,
275,
378,
199,
280,
555,
15314,
345,
275,
9193,
14,
4246,
14,
11319,
6986,
360,
759,
279,
297,
5504,
9,
199,
280,
555,
15314,
345,
18,
275,
9193,
14,
4246,
14,
11319,
6986,
360,
759,
279,
297,
5557,
9,
421,
199,
264,
320,
74,
275,
9193,
14,
521,
14,
17387,
342,
199,
199,
6710,
286,
1508,
285,
26,
272,
295,
320,
74,
14,
8284,
8,
5212,
776,
221,
327,
481,
5067,
2286,
340,
27767,
65,
63,
529,
328,
983,
26,
267,
13770,
25453,
4862,
413,
267,
340,
13770,
25453,
508,
378,
26,
288,
27767,
65,
63,
529,
328,
983,
275,
756,
15567,
367,
1566,
315,
9193,
14,
1430,
14,
362,
837,
267,
340,
1566,
14,
466,
508,
7813,
649,
26,
288,
286,
1508,
285,
275,
756,
267,
916,
1566,
14,
466,
508,
9301,
8819,
26,
259,
288,
340,
1566,
14,
498,
508,
1804,
63,
11658,
26,
355,
671,
87,
316,
14,
2297,
12227,
342,
355,
1335,
1518,
22066,
275,
715,
355,
315,
530,
73,
22066,
275,
756,
267,
916,
1566,
14,
466,
508,
9301,
2160,
26,
288,
671,
87,
316,
14,
8373,
2360,
671,
87,
316,
14,
8161,
275,
378,
2360,
378,
2286,
1565,
429,
305,
48,
348,
83,
350,
305,
275,
9193,
14,
498,
14,
362,
63,
30455,
342,
272,
327,
3930,
433,
2664,
287,
475,
302,
811,
272,
340,
1565,
429,
305,
48,
348,
83,
350,
305,
59,
43,
63,
9894,
2189,
267,
671,
87,
316,
14,
8373,
275,
446,
20,
272,
340,
1565,
429,
305,
48,
348,
83,
350,
305,
59,
43,
63,
12811,
2189,
267,
671,
87,
316,
14,
8373,
275,
841,
272,
340,
1565,
429,
305,
48,
348,
83,
350,
305,
59,
43,
63,
2160,
2189,
267,
671,
87,
316,
14,
8161,
275,
446,
20,
272,
340,
1565,
429,
305,
48,
348,
83,
350,
305,
59,
43,
63,
8819,
2189,
267,
671,
87,
316,
14,
8161,
275,
841,
339,
6252,
79,
37,
685,
4071,
736,
847,
413,
272,
340,
6252,
79,
37,
685,
4071,
736,
2356,
1926,
26,
267,
3367,
69,
592,
72,
351,
39,
5505,
79,
14,
525,
8,
377,
4332,
38,
2056,
351,
8,
29722,
8,
1216,
12,
17902,
9,
776,
776,
267,
6252,
79,
37,
685,
4071,
736,
275,
378,
2286,
327,
18982,
1061,
565,
65,
272,
671,
87,
316,
39,
5505,
79,
14,
873,
342,
272,
1323,
55,
316,
14,
416,
332,
63,
2587,
384,
79,
14,
873,
342,
272,
3367,
69,
592,
72,
351,
39,
5505,
79,
14,
873,
342,
272,
377,
4332,
38,
2056,
351,
14,
416,
332,
63,
2587,
384,
79,
14,
873,
342,
2286,
1449,
272,
662,
13769,
65,
302,
5291,
345,
302,
811,
272,
1449,
272,
340,
9193,
14,
15972,
14,
15972,
761,
8409,
1629,
8,
88,
87,
316,
12,
377,
4332,
38,
2056,
351,
14,
416,
332,
63,
2587,
384,
79,
304,
267,
671,
87,
316,
14,
5017,
305,
4862,
413,
267,
671,
87,
316,
14,
1201,
14,
4218,
275,
334,
879,
10465,
15,
18,
12,
748,
2566,
9,
267,
367,
302,
811,
315,
3367,
69,
592,
72,
351,
39,
5505,
79,
26,
288,
3367,
69,
592,
72,
351,
39,
5505,
79,
14,
2168,
8,
78,
811,
9,
267,
367,
2153,
462,
79,
315,
377,
4332,
38,
2056,
351,
14,
416,
332,
63,
2587,
384,
79,
26,
288,
377,
4332,
38,
2056,
351,
14,
416,
332,
63,
2587,
384,
79,
14,
2168,
8,
2297,
462,
79,
9,
267,
367,
2153,
462,
79,
315,
1323,
55,
316,
14,
416,
332,
63,
2587,
384,
79,
26,
288,
1323,
55,
316,
14,
416,
332,
63,
2587,
384,
79,
14,
2168,
8,
2297,
462,
79,
9,
267,
27767,
65,
63,
529,
328,
983,
275,
715,
267,
13770,
25453,
275,
499,
10,
5212,
2286,
327,
662,
13769,
65,
655,
69,
4071,
736,
22021,
20257,
272,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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idlelib.SearchDialogBase import SearchDialogBase
import re
def replace(text):
root = text._root()
engine = SearchEngine.get(root)
if not hasattr(engine, "_replacedialog"):
engine._replacedialog = ReplaceDialog(root, engine)
dialog = engine._replacedialog
dialog.open(text)
class ReplaceDialog(SearchDialogBase):
title = "Replace Dialog"
icon = "Replace"
def __init__(self, root, engine):
SearchDialogBase.__init__(self, root, engine)
self.replvar = StringVar(root)
def open(self, text):
SearchDialogBase.open(self, text)
try:
first = text.index("sel.first")
except TclError:
first = None
try:
last = text.index("sel.last")
except TclError:
last = None
first = first or text.index("insert")
last = last or first
self.show_hit(first, last)
self.ok = 1
def create_entries(self):
SearchDialogBase.create_entries(self)
self.replent = self.make_entry("Replace with:", self.replvar)
def create_command_buttons(self):
SearchDialogBase.create_command_buttons(self)
self.make_button("Find", self.find_it)
self.make_button("Replace", self.replace_it)
self.make_button("Replace+Find", self.default_command, 1)
self.make_button("Replace All", self.replace_all)
def find_it(self, event=None):
self.do_find(0)
def replace_it(self, event=None):
if self.do_find(self.ok):
self.do_replace()
def default_command(self, event=None):
if self.do_find(self.ok):
if self.do_replace(): # Only find next match if replace succeeded.
# A bad re can cause a it to fail.
self.do_find(0)
def _replace_expand(self, m, repl):
""" Helper function for expanding a regular expression
in the replace field, if needed. """
if self.engine.isre():
try:
new = m.expand(repl)
except re.error:
self.engine.report_error(repl, 'Invalid Replace Expression')
new = None
else:
new = repl
return new
def replace_all(self, event=None):
prog = self.engine.getprog()
if not prog:
return
repl = self.replvar.get()
text = self.text
res = self.engine.search_text(text, prog)
if not res:
text.bell()
return
text.tag_remove("sel", "1.0", "end")
text.tag_remove("hit", "1.0", "end")
line = res[0]
col = res[1].start()
if self.engine.iswrap():
line = 1
col = 0
ok = 1
first = last = None
# XXX ought to replace circular instead of top-to-bottom when wrapping
text.undo_block_start()
while 1:
res = self.engine.search_forward(text, prog, line, col, 0, ok)
if not res:
break
line, m = res
chars = text.get("%d.0" % line, "%d.0" % (line+1))
orig = m.group()
new = self._replace_expand(m, repl)
if new is None:
break
i, j = m.span()
first = "%d.%d" % (line, i)
last = "%d.%d" % (line, j)
if new == orig:
text.mark_set("insert", last)
else:
text.mark_set("insert", first)
if first != last:
text.delete(first, last)
if new:
text.insert(first, new)
col = i + len(new)
ok = 0
text.undo_block_stop()
if first and last:
self.show_hit(first, last)
self.close()
def do_find(self, ok=0):
if not self.engine.getprog():
return False
text = self.text
res = self.engine.search_text(text, None, ok)
if not res:
text.bell()
return False
line, m = res
i, j = m.span()
first = "%d.%d" % (line, i)
last = "%d.%d" % (line, j)
self.show_hit(first, last)
self.ok = 1
return True
def do_replace(self):
prog = self.engine.getprog()
if not prog:
return False
text = self.text
try:
first = pos = text.index("sel.first")
last = text.index("sel.last")
except TclError:
pos = None
if not pos:
first = last = pos = text.index("insert")
line, col = SearchEngine.get_line_col(pos)
chars = text.get("%d.0" % line, "%d.0" % (line+1))
m = prog.match(chars, col)
if not prog:
return False
new = self._replace_expand(m, self.replvar.get())
if new is None:
return False
text.mark_set("insert", first)
text.undo_block_start()
if m.group():
text.delete(first, last)
if new:
text.insert(first, new)
text.undo_block_stop()
self.show_hit(first, text.index("insert"))
self.ok = 0
return True
def show_hit(self, first, last):
text = self.text
text.mark_set("insert", first)
text.tag_remove("sel", "1.0", "end")
text.tag_add("sel", first, last)
text.tag_remove("hit", "1.0", "end")
if first == last:
text.tag_add("hit", first)
else:
text.tag_add("hit", first, last)
text.see("insert")
text.update_idletasks()
def close(self, event=None):
SearchDialogBase.close(self, event)
self.text.tag_remove("hit", "1.0", "end")
|
lgpl-3.0
|
[
504,
22171,
492,
627,
199,
199,
504,
15072,
773,
492,
8730,
8524,
199,
504,
15072,
773,
14,
5278,
5619,
1563,
492,
8730,
5619,
1563,
199,
646,
295,
421,
199,
318,
3350,
8,
505,
304,
272,
1738,
275,
1318,
423,
1231,
342,
272,
6869,
275,
8730,
8524,
14,
362,
8,
1231,
9,
272,
340,
440,
2688,
8,
3908,
12,
2668,
1814,
7196,
2349,
267,
6869,
423,
1814,
7196,
275,
14402,
5619,
8,
1231,
12,
6869,
9,
272,
9592,
275,
6869,
423,
1814,
7196,
272,
9592,
14,
1490,
8,
505,
9,
421,
199,
533,
14402,
5619,
8,
5278,
5619,
1563,
304,
339,
2538,
275,
298,
11328,
30631,
2,
272,
7016,
275,
298,
11328,
2,
339,
347,
636,
826,
721,
277,
12,
1738,
12,
6869,
304,
267,
8730,
5619,
1563,
855,
826,
721,
277,
12,
1738,
12,
6869,
9,
267,
291,
14,
16349,
1391,
275,
2624,
5894,
8,
1231,
9,
339,
347,
1551,
8,
277,
12,
1318,
304,
267,
8730,
5619,
1563,
14,
1490,
8,
277,
12,
1318,
9,
267,
862,
26,
288,
1642,
275,
1318,
14,
1080,
480,
5891,
14,
2246,
531,
267,
871,
29251,
547,
26,
288,
1642,
275,
488,
267,
862,
26,
288,
2061,
275,
1318,
14,
1080,
480,
5891,
14,
2019,
531,
267,
871,
29251,
547,
26,
288,
2061,
275,
488,
267,
1642,
275,
1642,
503,
1318,
14,
1080,
480,
3176,
531,
267,
2061,
275,
2061,
503,
1642,
267,
291,
14,
2384,
63,
12948,
8,
2246,
12,
2061,
9,
267,
291,
14,
745,
275,
413,
339,
347,
1218,
63,
3189,
8,
277,
304,
267,
8730,
5619,
1563,
14,
981,
63,
3189,
8,
277,
9,
267,
291,
14,
1155,
12518,
275,
291,
14,
1875,
63,
2373,
480,
11328,
543,
6783,
291,
14,
16349,
1391,
9,
339,
347,
1218,
63,
1531,
63,
15687,
8,
277,
304,
267,
8730,
5619,
1563,
14,
981,
63,
1531,
63,
15687,
8,
277,
9,
267,
291,
14,
1875,
63,
3887,
480,
6591,
401,
291,
14,
1623,
63,
390,
9,
267,
291,
14,
1875,
63,
3887,
480,
11328,
401,
291,
14,
1814,
63,
390,
9,
267,
291,
14,
1875,
63,
3887,
480,
11328,
11,
6591,
401,
291,
14,
885,
63,
1531,
12,
413,
9,
267,
291,
14,
1875,
63,
3887,
480,
11328,
2900,
401,
291,
14,
1814,
63,
452,
9,
339,
347,
2342,
63,
390,
8,
277,
12,
1566,
29,
403,
304,
267,
291,
14,
1117,
63,
1623,
8,
16,
9,
339,
347,
3350,
63,
390,
8,
277,
12,
1566,
29,
403,
304,
267,
340,
291,
14,
1117,
63,
1623,
8,
277,
14,
745,
304,
288,
291,
14,
1117,
63,
1814,
342,
339,
347,
849,
63,
1531,
8,
277,
12,
1566,
29,
403,
304,
267,
340,
291,
14,
1117,
63,
1623,
8,
277,
14,
745,
304,
288,
340,
291,
14,
1117,
63,
1814,
837,
257,
327,
5972,
2342,
2163,
1336,
340,
3350,
19268,
14,
2511,
327,
437,
4875,
295,
883,
7675,
282,
652,
370,
2449,
14,
355,
291,
14,
1117,
63,
1623,
8,
16,
9,
339,
347,
485,
1814,
63,
4441,
8,
277,
12,
333,
12,
20265,
304,
267,
408,
11642,
805,
367,
6544,
316,
282,
5578,
3965,
288,
315,
314,
3350,
901,
12,
340,
4346,
14,
408,
267,
340,
291,
14,
3908,
14,
374,
264,
837,
288,
862,
26,
355,
892,
275,
333,
14,
4441,
8,
16349,
9,
288,
871,
295,
14,
705,
26,
355,
291,
14,
3908,
14,
3070,
63,
705,
8,
16349,
12,
283,
3364,
14402,
22013,
358,
355,
892,
275,
488,
267,
587,
26,
288,
892,
275,
20265,
398,
372,
892,
339,
347,
3350,
63,
452,
8,
277,
12,
1566,
29,
403,
304,
267,
13205,
275,
291,
14,
3908,
14,
362,
6595,
342,
267,
340,
440,
13205,
26,
288,
372,
267,
20265,
275,
291,
14,
16349,
1391,
14,
362,
342,
267,
1318,
275,
291,
14,
505,
267,
522,
275,
291,
14,
3908,
14,
1733,
63,
505,
8,
505,
12,
13205,
9,
267,
340,
440,
522,
26,
288,
1318,
14,
30930,
342,
288,
372,
267,
1318,
14,
1450,
63,
2168,
480,
5891,
401,
298,
17,
14,
16,
401,
298,
500,
531,
267,
1318,
14,
1450,
63,
2168,
480,
12948,
401,
298,
17,
14,
16,
401,
298,
500,
531,
267,
1004,
275,
522,
59,
16,
61,
267,
1048,
275,
522,
59,
17,
1055,
928,
342,
267,
340,
291,
14,
3908,
14,
374,
3823,
837,
288,
1004,
275,
413,
288,
1048,
275,
378,
267,
4112,
275,
413,
267,
1642,
275,
2061,
275,
488,
267,
327,
5787,
312,
10846,
370,
3350,
15032,
3140,
402,
2746,
13,
475,
13,
8305,
1380,
19696,
267,
1318,
14,
11833,
63,
1457,
63,
928,
342,
267,
1830,
413,
26,
288,
522,
275,
291,
14,
3908,
14,
1733,
63,
6688,
8,
505,
12,
13205,
12,
1004,
12,
1048,
12,
378,
12,
4112,
9,
288,
340,
440,
522,
26,
355,
2059,
288,
1004,
12,
333,
275,
522,
288,
8365,
275,
1318,
14,
362,
3647,
68,
14,
16,
2,
450,
1004,
12,
2071,
68,
14,
16,
2,
450,
334,
604,
11,
17,
430,
288,
2306,
275,
333,
14,
923,
342,
288,
892,
275,
291,
423,
1814,
63,
4441,
8,
77,
12,
20265,
9,
288,
340,
892,
365,
488,
26,
355,
2059,
288,
284,
12,
1335,
275,
333,
14,
3751,
342,
288,
1642,
275,
2071,
68,
4111,
68,
2,
450,
334,
604,
12,
284,
9,
288,
2061,
275,
2071,
68,
4111,
68,
2,
450,
334,
604,
12,
1335,
9,
288,
340,
892,
508,
2306,
26,
355,
1318,
14,
1657,
63,
409,
480,
3176,
401,
2061,
9,
288,
587,
26,
355,
1318,
14,
1657,
63,
409,
480,
3176,
401,
1642,
9,
355,
340,
1642,
1137,
2061,
26,
490,
1318,
14,
1807,
8,
2246,
12,
2061,
9,
355,
340,
892,
26,
490,
1318,
14,
3176,
8,
2246,
12,
892,
9,
288,
1048,
275,
284,
435,
822,
8,
1222,
9,
288,
4112,
275,
378,
267,
1318,
14,
11833,
63,
1457,
63,
2379,
342,
267,
340,
1642,
436,
2061,
26,
288,
291,
14,
2384,
63,
12948,
8,
2246,
12,
2061,
9,
267,
291,
14,
1600,
342,
339,
347,
886,
63,
1623,
8,
277,
12,
4112,
29,
16,
304,
267,
340,
440,
291,
14,
3908,
14,
362,
6595,
837,
288,
372,
756,
267,
1318,
275,
291,
14,
505,
267,
522,
275,
291,
14,
3908,
14
] |
[
22171,
492,
627,
199,
199,
504,
15072,
773,
492,
8730,
8524,
199,
504,
15072,
773,
14,
5278,
5619,
1563,
492,
8730,
5619,
1563,
199,
646,
295,
421,
199,
318,
3350,
8,
505,
304,
272,
1738,
275,
1318,
423,
1231,
342,
272,
6869,
275,
8730,
8524,
14,
362,
8,
1231,
9,
272,
340,
440,
2688,
8,
3908,
12,
2668,
1814,
7196,
2349,
267,
6869,
423,
1814,
7196,
275,
14402,
5619,
8,
1231,
12,
6869,
9,
272,
9592,
275,
6869,
423,
1814,
7196,
272,
9592,
14,
1490,
8,
505,
9,
421,
199,
533,
14402,
5619,
8,
5278,
5619,
1563,
304,
339,
2538,
275,
298,
11328,
30631,
2,
272,
7016,
275,
298,
11328,
2,
339,
347,
636,
826,
721,
277,
12,
1738,
12,
6869,
304,
267,
8730,
5619,
1563,
855,
826,
721,
277,
12,
1738,
12,
6869,
9,
267,
291,
14,
16349,
1391,
275,
2624,
5894,
8,
1231,
9,
339,
347,
1551,
8,
277,
12,
1318,
304,
267,
8730,
5619,
1563,
14,
1490,
8,
277,
12,
1318,
9,
267,
862,
26,
288,
1642,
275,
1318,
14,
1080,
480,
5891,
14,
2246,
531,
267,
871,
29251,
547,
26,
288,
1642,
275,
488,
267,
862,
26,
288,
2061,
275,
1318,
14,
1080,
480,
5891,
14,
2019,
531,
267,
871,
29251,
547,
26,
288,
2061,
275,
488,
267,
1642,
275,
1642,
503,
1318,
14,
1080,
480,
3176,
531,
267,
2061,
275,
2061,
503,
1642,
267,
291,
14,
2384,
63,
12948,
8,
2246,
12,
2061,
9,
267,
291,
14,
745,
275,
413,
339,
347,
1218,
63,
3189,
8,
277,
304,
267,
8730,
5619,
1563,
14,
981,
63,
3189,
8,
277,
9,
267,
291,
14,
1155,
12518,
275,
291,
14,
1875,
63,
2373,
480,
11328,
543,
6783,
291,
14,
16349,
1391,
9,
339,
347,
1218,
63,
1531,
63,
15687,
8,
277,
304,
267,
8730,
5619,
1563,
14,
981,
63,
1531,
63,
15687,
8,
277,
9,
267,
291,
14,
1875,
63,
3887,
480,
6591,
401,
291,
14,
1623,
63,
390,
9,
267,
291,
14,
1875,
63,
3887,
480,
11328,
401,
291,
14,
1814,
63,
390,
9,
267,
291,
14,
1875,
63,
3887,
480,
11328,
11,
6591,
401,
291,
14,
885,
63,
1531,
12,
413,
9,
267,
291,
14,
1875,
63,
3887,
480,
11328,
2900,
401,
291,
14,
1814,
63,
452,
9,
339,
347,
2342,
63,
390,
8,
277,
12,
1566,
29,
403,
304,
267,
291,
14,
1117,
63,
1623,
8,
16,
9,
339,
347,
3350,
63,
390,
8,
277,
12,
1566,
29,
403,
304,
267,
340,
291,
14,
1117,
63,
1623,
8,
277,
14,
745,
304,
288,
291,
14,
1117,
63,
1814,
342,
339,
347,
849,
63,
1531,
8,
277,
12,
1566,
29,
403,
304,
267,
340,
291,
14,
1117,
63,
1623,
8,
277,
14,
745,
304,
288,
340,
291,
14,
1117,
63,
1814,
837,
257,
327,
5972,
2342,
2163,
1336,
340,
3350,
19268,
14,
2511,
327,
437,
4875,
295,
883,
7675,
282,
652,
370,
2449,
14,
355,
291,
14,
1117,
63,
1623,
8,
16,
9,
339,
347,
485,
1814,
63,
4441,
8,
277,
12,
333,
12,
20265,
304,
267,
408,
11642,
805,
367,
6544,
316,
282,
5578,
3965,
288,
315,
314,
3350,
901,
12,
340,
4346,
14,
408,
267,
340,
291,
14,
3908,
14,
374,
264,
837,
288,
862,
26,
355,
892,
275,
333,
14,
4441,
8,
16349,
9,
288,
871,
295,
14,
705,
26,
355,
291,
14,
3908,
14,
3070,
63,
705,
8,
16349,
12,
283,
3364,
14402,
22013,
358,
355,
892,
275,
488,
267,
587,
26,
288,
892,
275,
20265,
398,
372,
892,
339,
347,
3350,
63,
452,
8,
277,
12,
1566,
29,
403,
304,
267,
13205,
275,
291,
14,
3908,
14,
362,
6595,
342,
267,
340,
440,
13205,
26,
288,
372,
267,
20265,
275,
291,
14,
16349,
1391,
14,
362,
342,
267,
1318,
275,
291,
14,
505,
267,
522,
275,
291,
14,
3908,
14,
1733,
63,
505,
8,
505,
12,
13205,
9,
267,
340,
440,
522,
26,
288,
1318,
14,
30930,
342,
288,
372,
267,
1318,
14,
1450,
63,
2168,
480,
5891,
401,
298,
17,
14,
16,
401,
298,
500,
531,
267,
1318,
14,
1450,
63,
2168,
480,
12948,
401,
298,
17,
14,
16,
401,
298,
500,
531,
267,
1004,
275,
522,
59,
16,
61,
267,
1048,
275,
522,
59,
17,
1055,
928,
342,
267,
340,
291,
14,
3908,
14,
374,
3823,
837,
288,
1004,
275,
413,
288,
1048,
275,
378,
267,
4112,
275,
413,
267,
1642,
275,
2061,
275,
488,
267,
327,
5787,
312,
10846,
370,
3350,
15032,
3140,
402,
2746,
13,
475,
13,
8305,
1380,
19696,
267,
1318,
14,
11833,
63,
1457,
63,
928,
342,
267,
1830,
413,
26,
288,
522,
275,
291,
14,
3908,
14,
1733,
63,
6688,
8,
505,
12,
13205,
12,
1004,
12,
1048,
12,
378,
12,
4112,
9,
288,
340,
440,
522,
26,
355,
2059,
288,
1004,
12,
333,
275,
522,
288,
8365,
275,
1318,
14,
362,
3647,
68,
14,
16,
2,
450,
1004,
12,
2071,
68,
14,
16,
2,
450,
334,
604,
11,
17,
430,
288,
2306,
275,
333,
14,
923,
342,
288,
892,
275,
291,
423,
1814,
63,
4441,
8,
77,
12,
20265,
9,
288,
340,
892,
365,
488,
26,
355,
2059,
288,
284,
12,
1335,
275,
333,
14,
3751,
342,
288,
1642,
275,
2071,
68,
4111,
68,
2,
450,
334,
604,
12,
284,
9,
288,
2061,
275,
2071,
68,
4111,
68,
2,
450,
334,
604,
12,
1335,
9,
288,
340,
892,
508,
2306,
26,
355,
1318,
14,
1657,
63,
409,
480,
3176,
401,
2061,
9,
288,
587,
26,
355,
1318,
14,
1657,
63,
409,
480,
3176,
401,
1642,
9,
355,
340,
1642,
1137,
2061,
26,
490,
1318,
14,
1807,
8,
2246,
12,
2061,
9,
355,
340,
892,
26,
490,
1318,
14,
3176,
8,
2246,
12,
892,
9,
288,
1048,
275,
284,
435,
822,
8,
1222,
9,
288,
4112,
275,
378,
267,
1318,
14,
11833,
63,
1457,
63,
2379,
342,
267,
340,
1642,
436,
2061,
26,
288,
291,
14,
2384,
63,
12948,
8,
2246,
12,
2061,
9,
267,
291,
14,
1600,
342,
339,
347,
886,
63,
1623,
8,
277,
12,
4112,
29,
16,
304,
267,
340,
440,
291,
14,
3908,
14,
362,
6595,
837,
288,
372,
756,
267,
1318,
275,
291,
14,
505,
267,
522,
275,
291,
14,
3908,
14,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
loele/samba
|
third_party/waf/wafadmin/Constants.py
|
32
|
1307
|
#!/usr/bin/env python
# encoding: utf-8
# Yinon dot me gmail 2008
"""
these constants are somewhat public, try not to mess them
maintainer: the version number is updated from the top-level wscript file
"""
# do not touch these three lines, they are updated automatically
HEXVERSION=0x105019
WAFVERSION="1.5.19"
WAFREVISION = "9709M"
ABI = 7
# permissions
O644 = 420
O755 = 493
MAXJOBS = 99999999
CACHE_DIR = 'c4che'
CACHE_SUFFIX = '.cache.py'
DBFILE = '.wafpickle-%d' % ABI
WSCRIPT_FILE = 'wscript'
WSCRIPT_BUILD_FILE = 'wscript_build'
WAF_CONFIG_LOG = 'config.log'
WAF_CONFIG_H = 'config.h'
SIG_NIL = 'iluvcuteoverload'
VARIANT = '_VARIANT_'
DEFAULT = 'default'
SRCDIR = 'srcdir'
BLDDIR = 'blddir'
APPNAME = 'APPNAME'
VERSION = 'VERSION'
DEFINES = 'defines'
UNDEFINED = ()
BREAK = "break"
CONTINUE = "continue"
# task scheduler options
JOBCONTROL = "JOBCONTROL"
MAXPARALLEL = "MAXPARALLEL"
NORMAL = "NORMAL"
# task state
NOT_RUN = 0
MISSING = 1
CRASHED = 2
EXCEPTION = 3
SKIPPED = 8
SUCCESS = 9
ASK_LATER = -1
SKIP_ME = -2
RUN_ME = -3
LOG_FORMAT = "%(asctime)s %(c1)s%(zone)s%(c2)s %(message)s"
HOUR_FORMAT = "%H:%M:%S"
TEST_OK = True
CFG_FILES = 'cfg_files'
# positive '->' install
# negative '<-' uninstall
INSTALL = 1337
UNINSTALL = -1337
|
gpl-3.0
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
3,
2644,
26,
2774,
13,
24,
199,
3,
1488,
262,
265,
6308,
562,
29712,
9079,
199,
199,
624,
199,
29032,
5262,
787,
30362,
4575,
12,
862,
440,
370,
15634,
3062,
199,
199,
26665,
26,
314,
1015,
1329,
365,
4588,
687,
314,
2746,
13,
1896,
336,
1579,
570,
199,
624,
199,
199,
3,
886,
440,
12943,
3520,
7795,
2385,
12,
2985,
787,
4588,
5847,
199,
21377,
4612,
29,
16,
88,
7320,
12512,
199,
55,
5699,
4612,
628,
17,
14,
21,
14,
1167,
2,
199,
55,
5699,
907,
18775,
275,
298,
2576,
1643,
45,
2,
199,
1217,
41,
275,
1520,
199,
199,
3,
3443,
199,
47,
10893,
275,
841,
1165,
199,
47,
12315,
275,
841,
3129,
199,
199,
4283,
14879,
51,
275,
221,
13453,
199,
199,
8677,
63,
3022,
3515,
275,
283,
67,
20,
595,
7,
199,
8677,
63,
12273,
755,
275,
1987,
1637,
14,
647,
7,
199,
2846,
3817,
3777,
275,
1987,
21500,
8092,
3295,
68,
7,
450,
14840,
41,
199,
5035,
4461,
63,
3817,
755,
275,
283,
87,
1579,
7,
199,
5035,
4461,
63,
8248,
63,
3817,
275,
283,
87,
1579,
63,
1506,
7,
199,
55,
5699,
63,
5569,
63,
4947,
258,
275,
283,
888,
14,
793,
7,
199,
55,
5699,
63,
5569,
63,
40,
755,
275,
283,
888,
14,
72,
7,
199,
199,
7864,
63,
46,
1193,
275,
283,
382,
85,
6737,
938,
1883,
912,
7,
199,
199,
30582,
275,
2513,
30582,
8650,
199,
3472,
275,
283,
885,
7,
199,
199,
12447,
3022,
221,
275,
283,
17878,
7,
199,
34,
6533,
3022,
221,
275,
283,
14341,
694,
7,
199,
7121,
2339,
275,
283,
7121,
2339,
7,
199,
4612,
275,
283,
4612,
7,
199,
199,
27196,
275,
283,
14334,
7,
199,
1734,
12857,
275,
6248,
199,
199,
14731,
275,
298,
4785,
2,
199,
26663,
4187,
275,
298,
6958,
2,
199,
199,
3,
2120,
11899,
1511,
199,
14879,
13060,
275,
298,
14879,
13060,
2,
199,
4283,
4014,
748,
906,
44,
275,
298,
4283,
4014,
748,
906,
44,
2,
199,
10765,
275,
298,
10765,
2,
199,
199,
3,
2120,
1174,
199,
4609,
63,
9390,
275,
378,
199,
18701,
275,
413,
199,
2944,
8100,
1149,
275,
499,
199,
15375,
275,
650,
199,
13525,
19359,
275,
1695,
199,
12779,
275,
1749,
199,
199,
7946,
63,
44,
10447,
275,
446,
17,
199,
13525,
63,
3635,
275,
446,
18,
199,
9390,
63,
3635,
275,
446,
19,
421,
199,
4947,
63,
4807,
275,
11792,
18331,
9,
83,
2818,
67,
17,
9,
83,
2840,
2619,
9,
83,
2840,
67,
18,
9,
83,
2818,
1188,
9,
83,
2,
199,
2979,
1230,
63,
4807,
275,
2071,
40,
2689,
45,
2689,
51,
2,
199,
199,
2864,
63,
3593,
275,
715,
199,
199,
10118,
63,
9472,
275,
283,
4128,
63,
1725,
7,
199,
199,
3,
7317,
2475,
3524,
3907,
199,
3,
6946,
2650,
15668,
22199,
199,
16811,
275,
413,
11062,
199,
1734,
16811,
275,
446,
969,
1401,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
3,
2644,
26,
2774,
13,
24,
199,
3,
1488,
262,
265,
6308,
562,
29712,
9079,
199,
199,
624,
199,
29032,
5262,
787,
30362,
4575,
12,
862,
440,
370,
15634,
3062,
199,
199,
26665,
26,
314,
1015,
1329,
365,
4588,
687,
314,
2746,
13,
1896,
336,
1579,
570,
199,
624,
199,
199,
3,
886,
440,
12943,
3520,
7795,
2385,
12,
2985,
787,
4588,
5847,
199,
21377,
4612,
29,
16,
88,
7320,
12512,
199,
55,
5699,
4612,
628,
17,
14,
21,
14,
1167,
2,
199,
55,
5699,
907,
18775,
275,
298,
2576,
1643,
45,
2,
199,
1217,
41,
275,
1520,
199,
199,
3,
3443,
199,
47,
10893,
275,
841,
1165,
199,
47,
12315,
275,
841,
3129,
199,
199,
4283,
14879,
51,
275,
221,
13453,
199,
199,
8677,
63,
3022,
3515,
275,
283,
67,
20,
595,
7,
199,
8677,
63,
12273,
755,
275,
1987,
1637,
14,
647,
7,
199,
2846,
3817,
3777,
275,
1987,
21500,
8092,
3295,
68,
7,
450,
14840,
41,
199,
5035,
4461,
63,
3817,
755,
275,
283,
87,
1579,
7,
199,
5035,
4461,
63,
8248,
63,
3817,
275,
283,
87,
1579,
63,
1506,
7,
199,
55,
5699,
63,
5569,
63,
4947,
258,
275,
283,
888,
14,
793,
7,
199,
55,
5699,
63,
5569,
63,
40,
755,
275,
283,
888,
14,
72,
7,
199,
199,
7864,
63,
46,
1193,
275,
283,
382,
85,
6737,
938,
1883,
912,
7,
199,
199,
30582,
275,
2513,
30582,
8650,
199,
3472,
275,
283,
885,
7,
199,
199,
12447,
3022,
221,
275,
283,
17878,
7,
199,
34,
6533,
3022,
221,
275,
283,
14341,
694,
7,
199,
7121,
2339,
275,
283,
7121,
2339,
7,
199,
4612,
275,
283,
4612,
7,
199,
199,
27196,
275,
283,
14334,
7,
199,
1734,
12857,
275,
6248,
199,
199,
14731,
275,
298,
4785,
2,
199,
26663,
4187,
275,
298,
6958,
2,
199,
199,
3,
2120,
11899,
1511,
199,
14879,
13060,
275,
298,
14879,
13060,
2,
199,
4283,
4014,
748,
906,
44,
275,
298,
4283,
4014,
748,
906,
44,
2,
199,
10765,
275,
298,
10765,
2,
199,
199,
3,
2120,
1174,
199,
4609,
63,
9390,
275,
378,
199,
18701,
275,
413,
199,
2944,
8100,
1149,
275,
499,
199,
15375,
275,
650,
199,
13525,
19359,
275,
1695,
199,
12779,
275,
1749,
199,
199,
7946,
63,
44,
10447,
275,
446,
17,
199,
13525,
63,
3635,
275,
446,
18,
199,
9390,
63,
3635,
275,
446,
19,
421,
199,
4947,
63,
4807,
275,
11792,
18331,
9,
83,
2818,
67,
17,
9,
83,
2840,
2619,
9,
83,
2840,
67,
18,
9,
83,
2818,
1188,
9,
83,
2,
199,
2979,
1230,
63,
4807,
275,
2071,
40,
2689,
45,
2689,
51,
2,
199,
199,
2864,
63,
3593,
275,
715,
199,
199,
10118,
63,
9472,
275,
283,
4128,
63,
1725,
7,
199,
199,
3,
7317,
2475,
3524,
3907,
199,
3,
6946,
2650,
15668,
22199,
199,
16811,
275,
413,
11062,
199,
1734,
16811,
275,
446,
969,
1401,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
idea4bsd/idea4bsd
|
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_except.py
|
326
|
3352
|
"""Fixer for except statements with named exceptions.
The following cases will be converted:
- "except E, T:" where T is a name:
except E as T:
- "except E, T:" where T is not a name, tuple or list:
except E as t:
T = t
This is done because the target of an "except" clause must be a
name.
- "except E, T:" where T is a tuple or list literal:
except E as t:
T = t.args
"""
# Author: Collin Winter
# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Assign, Attr, Name, is_tuple, is_list, syms
def find_excepts(nodes):
for i, n in enumerate(nodes):
if n.type == syms.except_clause:
if n.children[0].value == u'except':
yield (n, nodes[i+2])
class FixExcept(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
try_stmt< 'try' ':' (simple_stmt | suite)
cleanup=(except_clause ':' (simple_stmt | suite))+
tail=(['except' ':' (simple_stmt | suite)]
['else' ':' (simple_stmt | suite)]
['finally' ':' (simple_stmt | suite)]) >
"""
def transform(self, node, results):
syms = self.syms
tail = [n.clone() for n in results["tail"]]
try_cleanup = [ch.clone() for ch in results["cleanup"]]
for except_clause, e_suite in find_excepts(try_cleanup):
if len(except_clause.children) == 4:
(E, comma, N) = except_clause.children[1:4]
comma.replace(Name(u"as", prefix=u" "))
if N.type != token.NAME:
# Generate a new N for the except clause
new_N = Name(self.new_name(), prefix=u" ")
target = N.clone()
target.prefix = u""
N.replace(new_N)
new_N = new_N.clone()
# Insert "old_N = new_N" as the first statement in
# the except body. This loop skips leading whitespace
# and indents
#TODO(cwinter) suite-cleanup
suite_stmts = e_suite.children
for i, stmt in enumerate(suite_stmts):
if isinstance(stmt, pytree.Node):
break
# The assignment is different if old_N is a tuple or list
# In that case, the assignment is old_N = new_N.args
if is_tuple(N) or is_list(N):
assign = Assign(target, Attr(new_N, Name(u'args')))
else:
assign = Assign(target, new_N)
#TODO(cwinter) stopgap until children becomes a smart list
for child in reversed(suite_stmts[:i]):
e_suite.insert_child(0, child)
e_suite.insert_child(i, assign)
elif N.prefix == u"":
# No space after a comma is legal; no space after "as",
# not so much.
N.prefix = u" "
#TODO(cwinter) fix this when children becomes a smart list
children = [c.clone() for c in node.children[:3]] + try_cleanup + tail
return pytree.Node(node.type, children)
|
apache-2.0
|
[
624,
11985,
281,
367,
871,
9834,
543,
4310,
4967,
14,
199,
199,
1918,
2569,
5560,
911,
506,
6702,
26,
199,
199,
13,
298,
2590,
662,
12,
377,
5424,
2382,
377,
365,
282,
536,
26,
339,
871,
662,
465,
377,
26,
199,
199,
13,
298,
2590,
662,
12,
377,
5424,
2382,
377,
365,
440,
282,
536,
12,
2008,
503,
769,
26,
398,
871,
662,
465,
307,
26,
288,
377,
275,
307,
339,
961,
365,
4224,
2952,
314,
1347,
402,
376,
298,
2590,
2,
8502,
1471,
506,
282,
272,
536,
14,
199,
199,
13,
298,
2590,
662,
12,
377,
5424,
2382,
377,
365,
282,
2008,
503,
769,
8785,
26,
398,
871,
662,
465,
307,
26,
288,
377,
275,
307,
14,
589,
199,
624,
199,
3,
6529,
26,
3626,
472,
644,
1058,
199,
199,
3,
10111,
8925,
199,
504,
2508,
492,
23353,
199,
504,
2508,
80,
2268,
18,
492,
1526,
199,
504,
2508,
492,
24739,
63,
1095,
199,
504,
2508,
25973,
63,
1974,
492,
16927,
12,
20516,
12,
2812,
12,
365,
63,
2960,
12,
365,
63,
513,
12,
25308,
199,
199,
318,
2342,
63,
2590,
83,
8,
2415,
304,
272,
367,
284,
12,
302,
315,
3874,
8,
2415,
304,
267,
340,
302,
14,
466,
508,
25308,
14,
2590,
63,
8501,
26,
288,
340,
302,
14,
3223,
59,
16,
1055,
585,
508,
399,
7,
2590,
356,
355,
1995,
334,
78,
12,
3380,
59,
73,
11,
18,
566,
199,
199,
533,
14811,
920,
716,
8,
25973,
63,
1095,
14,
1563,
11985,
304,
272,
699,
45,
63,
6490,
275,
715,
339,
31467,
7689,
275,
408,
272,
862,
63,
9649,
28,
283,
893,
7,
10871,
334,
4129,
63,
9649,
1204,
5241,
9,
2116,
9058,
2687,
2590,
63,
8501,
10871,
334,
4129,
63,
9649,
1204,
5241,
430,
11,
2116,
9483,
2687,
459,
2590,
7,
10871,
334,
4129,
63,
9649,
1204,
5241,
1874,
717,
788,
2836,
7,
10871,
334,
4129,
63,
9649,
1204,
5241,
1874,
717,
788,
15172,
7,
10871,
334,
4129,
63,
9649,
1204,
5241,
3948,
690,
272,
408,
339,
347,
5793,
8,
277,
12,
1031,
12,
2058,
304,
267,
25308,
275,
291,
14,
13807,
398,
9483,
275,
359,
78,
14,
6311,
342,
367,
302,
315,
2058,
905,
1521,
15261,
398,
862,
63,
7661,
275,
359,
335,
14,
6311,
342,
367,
682,
315,
2058,
905,
7661,
15261,
267,
367,
871,
63,
8501,
12,
325,
63,
5768,
315,
2342,
63,
2590,
83,
8,
893,
63,
7661,
304,
288,
340,
822,
8,
2590,
63,
8501,
14,
3223,
9,
508,
841,
26,
355,
334,
37,
12,
10029,
12,
653,
9,
275,
871,
63,
8501,
14,
3223,
59,
17,
26,
20,
61,
355,
10029,
14,
1814,
8,
985,
8,
85,
2,
305,
401,
2403,
29,
85,
2,
26725,
2234,
340,
653,
14,
466,
1137,
1526,
14,
2339,
26,
490,
327,
7958,
282,
892,
653,
367,
314,
871,
8502,
490,
892,
63,
46,
275,
2812,
8,
277,
14,
1222,
63,
354,
1062,
2403,
29,
85,
2,
6099,
490,
1347,
275,
653,
14,
6311,
342,
490,
1347,
14,
1861,
275,
399,
341,
490,
653,
14,
1814,
8,
1222,
63,
46,
9,
490,
892,
63,
46,
275,
892,
63,
46,
14,
6311,
342,
4951,
327,
15496,
298,
1753,
63,
46,
275,
892,
63,
46,
2,
465,
314,
1642,
5164,
315,
490,
327,
221,
314,
871,
2396,
14,
961,
4438,
30505,
9186,
8139,
490,
327,
221,
436,
31140,
490,
327,
11768,
8,
15346,
1058,
9,
5241,
13,
7661,
490,
5241,
63,
270,
22862,
275,
325,
63,
5768,
14,
3223,
490,
367,
284,
12,
12284,
315,
3874,
8,
5768,
63,
270,
22862,
304,
717,
340,
1228,
8,
9649,
12,
23353,
14,
1716,
304,
1169,
2059,
4951,
327,
710,
9801,
365,
3365,
340,
2269,
63,
46,
365,
282,
2008,
503,
769,
490,
327,
1010,
626,
1930,
12,
314,
9801,
365,
2269,
63,
46,
275,
892,
63,
46,
14,
589,
490,
340,
365,
63,
2960,
8,
46,
9,
503,
365,
63,
513,
8,
46,
304,
717,
5090,
275,
16927,
8,
1375,
12,
20516,
8,
1222,
63,
46,
12,
2812,
8,
85,
7,
589,
7058,
490,
587,
26,
717,
5090,
275,
16927,
8,
1375,
12,
892,
63,
46,
9,
4951,
327,
11768,
8,
15346,
1058,
9,
3631,
15046,
5133,
4978,
15410,
282,
11179,
769,
490,
367,
1982,
315,
10822,
8,
5768,
63,
270,
22862,
1491,
73,
4682,
717,
325,
63,
5768,
14,
3176,
63,
1739,
8,
16,
12,
1982,
9,
490,
325,
63,
5768,
14,
3176,
63,
1739,
8,
73,
12,
5090,
9,
355,
916,
653,
14,
1861,
508,
399,
29679,
490,
327,
3091,
4601,
2410,
282,
10029,
365,
18393,
27,
949,
4601,
2410,
298,
305,
401,
490,
327,
440,
880,
8298,
14,
490,
653,
14,
1861,
275,
399,
2,
298,
398,
327,
11768,
8,
15346,
1058,
9,
5325,
642,
1380,
4978,
15410,
282,
11179,
769,
267,
4978,
275,
359,
67,
14,
6311,
342,
367,
286,
315,
1031,
14,
3223,
1491,
19,
2677,
435,
862,
63,
7661,
435,
9483,
267,
372,
23353,
14,
1716,
8,
932,
14,
466,
12,
4978,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
11985,
281,
367,
871,
9834,
543,
4310,
4967,
14,
199,
199,
1918,
2569,
5560,
911,
506,
6702,
26,
199,
199,
13,
298,
2590,
662,
12,
377,
5424,
2382,
377,
365,
282,
536,
26,
339,
871,
662,
465,
377,
26,
199,
199,
13,
298,
2590,
662,
12,
377,
5424,
2382,
377,
365,
440,
282,
536,
12,
2008,
503,
769,
26,
398,
871,
662,
465,
307,
26,
288,
377,
275,
307,
339,
961,
365,
4224,
2952,
314,
1347,
402,
376,
298,
2590,
2,
8502,
1471,
506,
282,
272,
536,
14,
199,
199,
13,
298,
2590,
662,
12,
377,
5424,
2382,
377,
365,
282,
2008,
503,
769,
8785,
26,
398,
871,
662,
465,
307,
26,
288,
377,
275,
307,
14,
589,
199,
624,
199,
3,
6529,
26,
3626,
472,
644,
1058,
199,
199,
3,
10111,
8925,
199,
504,
2508,
492,
23353,
199,
504,
2508,
80,
2268,
18,
492,
1526,
199,
504,
2508,
492,
24739,
63,
1095,
199,
504,
2508,
25973,
63,
1974,
492,
16927,
12,
20516,
12,
2812,
12,
365,
63,
2960,
12,
365,
63,
513,
12,
25308,
199,
199,
318,
2342,
63,
2590,
83,
8,
2415,
304,
272,
367,
284,
12,
302,
315,
3874,
8,
2415,
304,
267,
340,
302,
14,
466,
508,
25308,
14,
2590,
63,
8501,
26,
288,
340,
302,
14,
3223,
59,
16,
1055,
585,
508,
399,
7,
2590,
356,
355,
1995,
334,
78,
12,
3380,
59,
73,
11,
18,
566,
199,
199,
533,
14811,
920,
716,
8,
25973,
63,
1095,
14,
1563,
11985,
304,
272,
699,
45,
63,
6490,
275,
715,
339,
31467,
7689,
275,
408,
272,
862,
63,
9649,
28,
283,
893,
7,
10871,
334,
4129,
63,
9649,
1204,
5241,
9,
2116,
9058,
2687,
2590,
63,
8501,
10871,
334,
4129,
63,
9649,
1204,
5241,
430,
11,
2116,
9483,
2687,
459,
2590,
7,
10871,
334,
4129,
63,
9649,
1204,
5241,
1874,
717,
788,
2836,
7,
10871,
334,
4129,
63,
9649,
1204,
5241,
1874,
717,
788,
15172,
7,
10871,
334,
4129,
63,
9649,
1204,
5241,
3948,
690,
272,
408,
339,
347,
5793,
8,
277,
12,
1031,
12,
2058,
304,
267,
25308,
275,
291,
14,
13807,
398,
9483,
275,
359,
78,
14,
6311,
342,
367,
302,
315,
2058,
905,
1521,
15261,
398,
862,
63,
7661,
275,
359,
335,
14,
6311,
342,
367,
682,
315,
2058,
905,
7661,
15261,
267,
367,
871,
63,
8501,
12,
325,
63,
5768,
315,
2342,
63,
2590,
83,
8,
893,
63,
7661,
304,
288,
340,
822,
8,
2590,
63,
8501,
14,
3223,
9,
508,
841,
26,
355,
334,
37,
12,
10029,
12,
653,
9,
275,
871,
63,
8501,
14,
3223,
59,
17,
26,
20,
61,
355,
10029,
14,
1814,
8,
985,
8,
85,
2,
305,
401,
2403,
29,
85,
2,
26725,
2234,
340,
653,
14,
466,
1137,
1526,
14,
2339,
26,
490,
327,
7958,
282,
892,
653,
367,
314,
871,
8502,
490,
892,
63,
46,
275,
2812,
8,
277,
14,
1222,
63,
354,
1062,
2403,
29,
85,
2,
6099,
490,
1347,
275,
653,
14,
6311,
342,
490,
1347,
14,
1861,
275,
399,
341,
490,
653,
14,
1814,
8,
1222,
63,
46,
9,
490,
892,
63,
46,
275,
892,
63,
46,
14,
6311,
342,
4951,
327,
15496,
298,
1753,
63,
46,
275,
892,
63,
46,
2,
465,
314,
1642,
5164,
315,
490,
327,
221,
314,
871,
2396,
14,
961,
4438,
30505,
9186,
8139,
490,
327,
221,
436,
31140,
490,
327,
11768,
8,
15346,
1058,
9,
5241,
13,
7661,
490,
5241,
63,
270,
22862,
275,
325,
63,
5768,
14,
3223,
490,
367,
284,
12,
12284,
315,
3874,
8,
5768,
63,
270,
22862,
304,
717,
340,
1228,
8,
9649,
12,
23353,
14,
1716,
304,
1169,
2059,
4951,
327,
710,
9801,
365,
3365,
340,
2269,
63,
46,
365,
282,
2008,
503,
769,
490,
327,
1010,
626,
1930,
12,
314,
9801,
365,
2269,
63,
46,
275,
892,
63,
46,
14,
589,
490,
340,
365,
63,
2960,
8,
46,
9,
503,
365,
63,
513,
8,
46,
304,
717,
5090,
275,
16927,
8,
1375,
12,
20516,
8,
1222,
63,
46,
12,
2812,
8,
85,
7,
589,
7058,
490,
587,
26,
717,
5090,
275,
16927,
8,
1375,
12,
892,
63,
46,
9,
4951,
327,
11768,
8,
15346,
1058,
9,
3631,
15046,
5133,
4978,
15410,
282,
11179,
769,
490,
367,
1982,
315,
10822,
8,
5768,
63,
270,
22862,
1491,
73,
4682,
717,
325,
63,
5768,
14,
3176,
63,
1739,
8,
16,
12,
1982,
9,
490,
325,
63,
5768,
14,
3176,
63,
1739,
8,
73,
12,
5090,
9,
355,
916,
653,
14,
1861,
508,
399,
29679,
490,
327,
3091,
4601,
2410,
282,
10029,
365,
18393,
27,
949,
4601,
2410,
298,
305,
401,
490,
327,
440,
880,
8298,
14,
490,
653,
14,
1861,
275,
399,
2,
298,
398,
327,
11768,
8,
15346,
1058,
9,
5325,
642,
1380,
4978,
15410,
282,
11179,
769,
267,
4978,
275,
359,
67,
14,
6311,
342,
367,
286,
315,
1031,
14,
3223,
1491,
19,
2677,
435,
862,
63,
7661,
435,
9483,
267,
372,
23353,
14,
1716,
8,
932,
14,
466,
12,
4978,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
jmcarp/django
|
django/utils/datastructures.py
|
394
|
9231
|
import copy
from collections import OrderedDict
from django.utils import six
class OrderedSet(object):
"""
A set which keeps the ordering of the inserted items.
Currently backs onto OrderedDict.
"""
def __init__(self, iterable=None):
self.dict = OrderedDict(((x, None) for x in iterable) if iterable else [])
def add(self, item):
self.dict[item] = None
def remove(self, item):
del self.dict[item]
def discard(self, item):
try:
self.remove(item)
except KeyError:
pass
def __iter__(self):
return iter(self.dict.keys())
def __contains__(self, item):
return item in self.dict
def __bool__(self):
return bool(self.dict)
def __nonzero__(self): # Python 2 compatibility
return type(self).__bool__(self)
def __len__(self):
return len(self.dict)
class MultiValueDictKeyError(KeyError):
pass
class MultiValueDict(dict):
"""
A subclass of dictionary customized to handle multiple values for the
same key.
>>> d = MultiValueDict({'name': ['Adrian', 'Simon'], 'position': ['Developer']})
>>> d['name']
'Simon'
>>> d.getlist('name')
['Adrian', 'Simon']
>>> d.getlist('doesnotexist')
[]
>>> d.getlist('doesnotexist', ['Adrian', 'Simon'])
['Adrian', 'Simon']
>>> d.get('lastname', 'nonexistent')
'nonexistent'
>>> d.setlist('lastname', ['Holovaty', 'Willison'])
This class exists to solve the irritating problem raised by cgi.parse_qs,
which returns a list for every key, even though most Web forms submit
single name-value pairs.
"""
def __init__(self, key_to_list_mapping=()):
super(MultiValueDict, self).__init__(key_to_list_mapping)
def __repr__(self):
return "<%s: %s>" % (self.__class__.__name__,
super(MultiValueDict, self).__repr__())
def __getitem__(self, key):
"""
Returns the last data value for this key, or [] if it's an empty list;
raises KeyError if not found.
"""
try:
list_ = super(MultiValueDict, self).__getitem__(key)
except KeyError:
raise MultiValueDictKeyError(repr(key))
try:
return list_[-1]
except IndexError:
return []
def __setitem__(self, key, value):
super(MultiValueDict, self).__setitem__(key, [value])
def __copy__(self):
return self.__class__([
(k, v[:])
for k, v in self.lists()
])
def __deepcopy__(self, memo=None):
if memo is None:
memo = {}
result = self.__class__()
memo[id(self)] = result
for key, value in dict.items(self):
dict.__setitem__(result, copy.deepcopy(key, memo),
copy.deepcopy(value, memo))
return result
def __getstate__(self):
obj_dict = self.__dict__.copy()
obj_dict['_data'] = {k: self.getlist(k) for k in self}
return obj_dict
def __setstate__(self, obj_dict):
data = obj_dict.pop('_data', {})
for k, v in data.items():
self.setlist(k, v)
self.__dict__.update(obj_dict)
def get(self, key, default=None):
"""
Returns the last data value for the passed key. If key doesn't exist
or value is an empty list, then default is returned.
"""
try:
val = self[key]
except KeyError:
return default
if val == []:
return default
return val
def getlist(self, key, default=None):
"""
Returns the list of values for the passed key. If key doesn't exist,
then a default value is returned.
"""
try:
return super(MultiValueDict, self).__getitem__(key)
except KeyError:
if default is None:
return []
return default
def setlist(self, key, list_):
super(MultiValueDict, self).__setitem__(key, list_)
def setdefault(self, key, default=None):
if key not in self:
self[key] = default
# Do not return default here because __setitem__() may store
# another value -- QueryDict.__setitem__() does. Look it up.
return self[key]
def setlistdefault(self, key, default_list=None):
if key not in self:
if default_list is None:
default_list = []
self.setlist(key, default_list)
# Do not return default_list here because setlist() may store
# another value -- QueryDict.setlist() does. Look it up.
return self.getlist(key)
def appendlist(self, key, value):
"""Appends an item to the internal list associated with key."""
self.setlistdefault(key).append(value)
def _iteritems(self):
"""
Yields (key, value) pairs, where value is the last item in the list
associated with the key.
"""
for key in self:
yield key, self[key]
def _iterlists(self):
"""Yields (key, list) pairs."""
return six.iteritems(super(MultiValueDict, self))
def _itervalues(self):
"""Yield the last value on every key list."""
for key in self:
yield self[key]
if six.PY3:
items = _iteritems
lists = _iterlists
values = _itervalues
else:
iteritems = _iteritems
iterlists = _iterlists
itervalues = _itervalues
def items(self):
return list(self.iteritems())
def lists(self):
return list(self.iterlists())
def values(self):
return list(self.itervalues())
def copy(self):
"""Returns a shallow copy of this object."""
return copy.copy(self)
def update(self, *args, **kwargs):
"""
update() extends rather than replaces existing key lists.
Also accepts keyword args.
"""
if len(args) > 1:
raise TypeError("update expected at most 1 arguments, got %d" % len(args))
if args:
other_dict = args[0]
if isinstance(other_dict, MultiValueDict):
for key, value_list in other_dict.lists():
self.setlistdefault(key).extend(value_list)
else:
try:
for key, value in other_dict.items():
self.setlistdefault(key).append(value)
except TypeError:
raise ValueError("MultiValueDict.update() takes either a MultiValueDict or dictionary")
for key, value in six.iteritems(kwargs):
self.setlistdefault(key).append(value)
def dict(self):
"""
Returns current object as a dict with singular values.
"""
return {key: self[key] for key in self}
class ImmutableList(tuple):
"""
A tuple-like object that raises useful errors when it is asked to mutate.
Example::
>>> a = ImmutableList(range(5), warning="You cannot mutate this.")
>>> a[3] = '4'
Traceback (most recent call last):
...
AttributeError: You cannot mutate this.
"""
def __new__(cls, *args, **kwargs):
if 'warning' in kwargs:
warning = kwargs['warning']
del kwargs['warning']
else:
warning = 'ImmutableList object is immutable.'
self = tuple.__new__(cls, *args, **kwargs)
self.warning = warning
return self
def complain(self, *wargs, **kwargs):
if isinstance(self.warning, Exception):
raise self.warning
else:
raise AttributeError(self.warning)
# All list mutation functions complain.
__delitem__ = complain
__delslice__ = complain
__iadd__ = complain
__imul__ = complain
__setitem__ = complain
__setslice__ = complain
append = complain
extend = complain
insert = complain
pop = complain
remove = complain
sort = complain
reverse = complain
class DictWrapper(dict):
"""
Wraps accesses to a dictionary so that certain values (those starting with
the specified prefix) are passed through a function before being returned.
The prefix is removed before looking up the real value.
Used by the SQL construction code to ensure that values are correctly
quoted before being used.
"""
def __init__(self, data, func, prefix):
super(DictWrapper, self).__init__(data)
self.func = func
self.prefix = prefix
def __getitem__(self, key):
"""
Retrieves the real value after stripping the prefix string (if
present). If the prefix is present, pass the value through self.func
before returning, otherwise return the raw value.
"""
if key.startswith(self.prefix):
use_func = True
key = key[len(self.prefix):]
else:
use_func = False
value = super(DictWrapper, self).__getitem__(key)
if use_func:
return self.func(value)
return value
|
bsd-3-clause
|
[
646,
1331,
199,
504,
5055,
492,
8773,
199,
199,
504,
1639,
14,
1208,
492,
3816,
421,
199,
533,
23617,
8,
785,
304,
272,
408,
272,
437,
663,
1314,
18578,
314,
7794,
402,
314,
11788,
2974,
14,
272,
13550,
1771,
83,
14602,
8773,
14,
272,
408,
339,
347,
636,
826,
721,
277,
12,
6076,
29,
403,
304,
267,
291,
14,
807,
275,
8773,
12925,
88,
12,
488,
9,
367,
671,
315,
6076,
9,
340,
6076,
587,
3073,
339,
347,
1050,
8,
277,
12,
1242,
304,
267,
291,
14,
807,
59,
1053,
61,
275,
488,
339,
347,
2813,
8,
277,
12,
1242,
304,
267,
2150,
291,
14,
807,
59,
1053,
61,
339,
347,
16895,
8,
277,
12,
1242,
304,
267,
862,
26,
288,
291,
14,
2168,
8,
1053,
9,
267,
871,
4067,
26,
288,
986,
339,
347,
636,
1661,
721,
277,
304,
267,
372,
2740,
8,
277,
14,
807,
14,
1612,
1012,
339,
347,
636,
6134,
721,
277,
12,
1242,
304,
267,
372,
1242,
315,
291,
14,
807,
339,
347,
636,
2245,
721,
277,
304,
267,
372,
2155,
8,
277,
14,
807,
9,
339,
347,
636,
10262,
721,
277,
304,
420,
327,
2018,
499,
7163,
267,
372,
730,
8,
277,
2843,
2245,
721,
277,
9,
339,
347,
636,
552,
721,
277,
304,
267,
372,
822,
8,
277,
14,
807,
9,
421,
199,
533,
6879,
24811,
10230,
8,
10230,
304,
272,
986,
421,
199,
533,
6879,
24811,
8,
807,
304,
272,
408,
272,
437,
5516,
402,
2600,
26707,
370,
2429,
3663,
1338,
367,
314,
272,
2011,
790,
14,
339,
1306,
366,
275,
6879,
24811,
3252,
354,
356,
788,
2767,
18429,
297,
283,
7467,
265,
995,
283,
3124,
356,
788,
31032,
13678,
272,
1306,
366,
459,
354,
418,
272,
283,
7467,
265,
7,
272,
1306,
366,
14,
21343,
360,
354,
358,
272,
788,
2767,
18429,
297,
283,
7467,
265,
418,
272,
1306,
366,
14,
21343,
360,
9105,
889,
3858,
631,
358,
272,
942,
272,
1306,
366,
14,
21343,
360,
9105,
889,
3858,
631,
297,
788,
2767,
18429,
297,
283,
7467,
265,
1105,
272,
788,
2767,
18429,
297,
283,
7467,
265,
418,
272,
1306,
366,
14,
362,
360,
31164,
297,
283,
21573,
358,
272,
283,
21573,
7,
272,
1306,
366,
14,
409,
513,
360,
31164,
297,
788,
17810,
320,
16305,
89,
297,
283,
55,
8148,
834,
1105,
339,
961,
1021,
3495,
370,
14241,
314,
8190,
11133,
1958,
5160,
4915,
701,
16004,
14,
1122,
63,
6177,
12,
272,
1314,
2529,
282,
769,
367,
4036,
790,
12,
2755,
10617,
4750,
6001,
4513,
11482,
272,
2849,
536,
13,
585,
6342,
14,
272,
408,
272,
347,
636,
826,
721,
277,
12,
790,
63,
475,
63,
513,
63,
4745,
23603,
267,
1613,
8,
3947,
24811,
12,
291,
2843,
826,
721,
498,
63,
475,
63,
513,
63,
4745,
9,
339,
347,
636,
2722,
721,
277,
304,
267,
372,
23054,
83,
26,
450,
83,
4335,
450,
334,
277,
855,
533,
4914,
354,
3108,
2490,
1613,
8,
3947,
24811,
12,
291,
2843,
2722,
29133,
339,
347,
636,
6095,
721,
277,
12,
790,
304,
267,
408,
267,
1803,
314,
2061,
666,
574,
367,
642,
790,
12,
503,
942,
340,
652,
1159,
376,
2701,
769,
27,
267,
6534,
4067,
340,
440,
1911,
14,
267,
408,
267,
862,
26,
288,
769,
63,
275,
1613,
8,
3947,
24811,
12,
291,
2843,
6095,
721,
498,
9,
267,
871,
4067,
26,
288,
746,
6879,
24811,
10230,
8,
2722,
8,
498,
430,
267,
862,
26,
288,
372,
769,
63,
1988,
17,
61,
267,
871,
7888,
26,
288,
372,
942,
339,
347,
636,
8617,
721,
277,
12,
790,
12,
574,
304,
267,
1613,
8,
3947,
24811,
12,
291,
2843,
8617,
721,
498,
12,
359,
585,
566,
339,
347,
636,
1574,
721,
277,
304,
267,
372,
291,
855,
533,
721,
59,
288,
334,
75,
12,
373,
1491,
566,
288,
367,
1022,
12,
373,
315,
291,
14,
6717,
342,
267,
4794,
339,
347,
636,
8293,
721,
277,
12,
11955,
29,
403,
304,
267,
340,
11955,
365,
488,
26,
288,
11955,
275,
1052,
267,
754,
275,
291,
855,
533,
4533,
267,
11955,
59,
344,
8,
277,
1874,
275,
754,
267,
367,
790,
12,
574,
315,
1211,
14,
1744,
8,
277,
304,
288,
1211,
855,
8617,
721,
1099,
12,
1331,
14,
8293,
8,
498,
12,
11955,
395,
2490,
1331,
14,
8293,
8,
585,
12,
11955,
430,
267,
372,
754,
339,
347,
636,
16011,
721,
277,
304,
267,
1559,
63,
807,
275,
291,
855,
807,
4343,
1574,
342,
267,
1559,
63,
807,
8680,
576,
418,
275,
469,
75,
26,
291,
14,
21343,
8,
75,
9,
367,
1022,
315,
291,
93,
267,
372,
1559,
63,
807,
339,
347,
636,
17212,
721,
277,
12,
1559,
63,
807,
304,
267,
666,
275,
1559,
63,
807,
14,
1935,
6412,
576,
297,
5009,
267,
367,
1022,
12,
373,
315,
666,
14,
1744,
837,
288,
291,
14,
409,
513,
8,
75,
12,
373,
9,
267,
291,
855,
807,
4343,
873,
8,
1113,
63,
807,
9,
339,
347,
664,
8,
277,
12,
790,
12,
849,
29,
403,
304,
267,
408,
267,
1803,
314,
2061,
666,
574,
367,
314,
3032,
790,
14,
982,
790,
3181,
1133,
2187,
267,
503,
574,
365,
376,
2701,
769,
12,
2066,
849,
365,
2138,
14,
267,
408,
267,
862,
26,
288,
1139,
275,
291,
59,
498,
61,
267,
871,
4067,
26,
288,
372,
849,
267,
340,
1139,
508,
18410,
288,
372,
849,
267,
372,
1139,
339,
347,
664,
513,
8,
277,
12,
790,
12,
849,
29,
403,
304,
267,
408,
267,
1803,
314,
769,
402,
1338,
367,
314,
3032,
790,
14,
982,
790,
3181,
1133,
2187,
12,
267,
2066,
282,
849,
574,
365,
2138,
14,
267,
408,
267,
862,
26,
288,
372,
1613,
8,
3947,
24811,
12,
291,
2843,
6095,
721,
498,
9,
267,
871,
4067,
26,
288,
340,
849,
365,
488,
26,
355,
372,
942,
288,
372,
849,
339,
347,
663,
513,
8,
277,
12,
790,
12,
769,
7822,
267,
1613,
8,
3947,
24811,
12,
291,
2843,
8617,
721,
498,
12,
769,
4602,
339,
347,
29408,
8,
277,
12,
790,
12,
849,
29,
403,
304,
267,
340,
790,
440,
315,
291,
26,
288,
291,
59,
498,
61,
275,
849,
288,
327,
4226,
440,
372,
849,
2348,
2952,
636,
8617,
4533,
1443,
3877
] |
[
1331,
199,
504,
5055,
492,
8773,
199,
199,
504,
1639,
14,
1208,
492,
3816,
421,
199,
533,
23617,
8,
785,
304,
272,
408,
272,
437,
663,
1314,
18578,
314,
7794,
402,
314,
11788,
2974,
14,
272,
13550,
1771,
83,
14602,
8773,
14,
272,
408,
339,
347,
636,
826,
721,
277,
12,
6076,
29,
403,
304,
267,
291,
14,
807,
275,
8773,
12925,
88,
12,
488,
9,
367,
671,
315,
6076,
9,
340,
6076,
587,
3073,
339,
347,
1050,
8,
277,
12,
1242,
304,
267,
291,
14,
807,
59,
1053,
61,
275,
488,
339,
347,
2813,
8,
277,
12,
1242,
304,
267,
2150,
291,
14,
807,
59,
1053,
61,
339,
347,
16895,
8,
277,
12,
1242,
304,
267,
862,
26,
288,
291,
14,
2168,
8,
1053,
9,
267,
871,
4067,
26,
288,
986,
339,
347,
636,
1661,
721,
277,
304,
267,
372,
2740,
8,
277,
14,
807,
14,
1612,
1012,
339,
347,
636,
6134,
721,
277,
12,
1242,
304,
267,
372,
1242,
315,
291,
14,
807,
339,
347,
636,
2245,
721,
277,
304,
267,
372,
2155,
8,
277,
14,
807,
9,
339,
347,
636,
10262,
721,
277,
304,
420,
327,
2018,
499,
7163,
267,
372,
730,
8,
277,
2843,
2245,
721,
277,
9,
339,
347,
636,
552,
721,
277,
304,
267,
372,
822,
8,
277,
14,
807,
9,
421,
199,
533,
6879,
24811,
10230,
8,
10230,
304,
272,
986,
421,
199,
533,
6879,
24811,
8,
807,
304,
272,
408,
272,
437,
5516,
402,
2600,
26707,
370,
2429,
3663,
1338,
367,
314,
272,
2011,
790,
14,
339,
1306,
366,
275,
6879,
24811,
3252,
354,
356,
788,
2767,
18429,
297,
283,
7467,
265,
995,
283,
3124,
356,
788,
31032,
13678,
272,
1306,
366,
459,
354,
418,
272,
283,
7467,
265,
7,
272,
1306,
366,
14,
21343,
360,
354,
358,
272,
788,
2767,
18429,
297,
283,
7467,
265,
418,
272,
1306,
366,
14,
21343,
360,
9105,
889,
3858,
631,
358,
272,
942,
272,
1306,
366,
14,
21343,
360,
9105,
889,
3858,
631,
297,
788,
2767,
18429,
297,
283,
7467,
265,
1105,
272,
788,
2767,
18429,
297,
283,
7467,
265,
418,
272,
1306,
366,
14,
362,
360,
31164,
297,
283,
21573,
358,
272,
283,
21573,
7,
272,
1306,
366,
14,
409,
513,
360,
31164,
297,
788,
17810,
320,
16305,
89,
297,
283,
55,
8148,
834,
1105,
339,
961,
1021,
3495,
370,
14241,
314,
8190,
11133,
1958,
5160,
4915,
701,
16004,
14,
1122,
63,
6177,
12,
272,
1314,
2529,
282,
769,
367,
4036,
790,
12,
2755,
10617,
4750,
6001,
4513,
11482,
272,
2849,
536,
13,
585,
6342,
14,
272,
408,
272,
347,
636,
826,
721,
277,
12,
790,
63,
475,
63,
513,
63,
4745,
23603,
267,
1613,
8,
3947,
24811,
12,
291,
2843,
826,
721,
498,
63,
475,
63,
513,
63,
4745,
9,
339,
347,
636,
2722,
721,
277,
304,
267,
372,
23054,
83,
26,
450,
83,
4335,
450,
334,
277,
855,
533,
4914,
354,
3108,
2490,
1613,
8,
3947,
24811,
12,
291,
2843,
2722,
29133,
339,
347,
636,
6095,
721,
277,
12,
790,
304,
267,
408,
267,
1803,
314,
2061,
666,
574,
367,
642,
790,
12,
503,
942,
340,
652,
1159,
376,
2701,
769,
27,
267,
6534,
4067,
340,
440,
1911,
14,
267,
408,
267,
862,
26,
288,
769,
63,
275,
1613,
8,
3947,
24811,
12,
291,
2843,
6095,
721,
498,
9,
267,
871,
4067,
26,
288,
746,
6879,
24811,
10230,
8,
2722,
8,
498,
430,
267,
862,
26,
288,
372,
769,
63,
1988,
17,
61,
267,
871,
7888,
26,
288,
372,
942,
339,
347,
636,
8617,
721,
277,
12,
790,
12,
574,
304,
267,
1613,
8,
3947,
24811,
12,
291,
2843,
8617,
721,
498,
12,
359,
585,
566,
339,
347,
636,
1574,
721,
277,
304,
267,
372,
291,
855,
533,
721,
59,
288,
334,
75,
12,
373,
1491,
566,
288,
367,
1022,
12,
373,
315,
291,
14,
6717,
342,
267,
4794,
339,
347,
636,
8293,
721,
277,
12,
11955,
29,
403,
304,
267,
340,
11955,
365,
488,
26,
288,
11955,
275,
1052,
267,
754,
275,
291,
855,
533,
4533,
267,
11955,
59,
344,
8,
277,
1874,
275,
754,
267,
367,
790,
12,
574,
315,
1211,
14,
1744,
8,
277,
304,
288,
1211,
855,
8617,
721,
1099,
12,
1331,
14,
8293,
8,
498,
12,
11955,
395,
2490,
1331,
14,
8293,
8,
585,
12,
11955,
430,
267,
372,
754,
339,
347,
636,
16011,
721,
277,
304,
267,
1559,
63,
807,
275,
291,
855,
807,
4343,
1574,
342,
267,
1559,
63,
807,
8680,
576,
418,
275,
469,
75,
26,
291,
14,
21343,
8,
75,
9,
367,
1022,
315,
291,
93,
267,
372,
1559,
63,
807,
339,
347,
636,
17212,
721,
277,
12,
1559,
63,
807,
304,
267,
666,
275,
1559,
63,
807,
14,
1935,
6412,
576,
297,
5009,
267,
367,
1022,
12,
373,
315,
666,
14,
1744,
837,
288,
291,
14,
409,
513,
8,
75,
12,
373,
9,
267,
291,
855,
807,
4343,
873,
8,
1113,
63,
807,
9,
339,
347,
664,
8,
277,
12,
790,
12,
849,
29,
403,
304,
267,
408,
267,
1803,
314,
2061,
666,
574,
367,
314,
3032,
790,
14,
982,
790,
3181,
1133,
2187,
267,
503,
574,
365,
376,
2701,
769,
12,
2066,
849,
365,
2138,
14,
267,
408,
267,
862,
26,
288,
1139,
275,
291,
59,
498,
61,
267,
871,
4067,
26,
288,
372,
849,
267,
340,
1139,
508,
18410,
288,
372,
849,
267,
372,
1139,
339,
347,
664,
513,
8,
277,
12,
790,
12,
849,
29,
403,
304,
267,
408,
267,
1803,
314,
769,
402,
1338,
367,
314,
3032,
790,
14,
982,
790,
3181,
1133,
2187,
12,
267,
2066,
282,
849,
574,
365,
2138,
14,
267,
408,
267,
862,
26,
288,
372,
1613,
8,
3947,
24811,
12,
291,
2843,
6095,
721,
498,
9,
267,
871,
4067,
26,
288,
340,
849,
365,
488,
26,
355,
372,
942,
288,
372,
849,
339,
347,
663,
513,
8,
277,
12,
790,
12,
769,
7822,
267,
1613,
8,
3947,
24811,
12,
291,
2843,
8617,
721,
498,
12,
769,
4602,
339,
347,
29408,
8,
277,
12,
790,
12,
849,
29,
403,
304,
267,
340,
790,
440,
315,
291,
26,
288,
291,
59,
498,
61,
275,
849,
288,
327,
4226,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
fxia22/ASM_xf
|
PythonD/site_python/twisted/python/roots.py
|
2
|
8341
|
# -*- test-case-name: twisted.test.test_roots -*-
#
# Twisted, the Framework of Your Internet
# Copyright (C) 2001 Matthew W. Lefkowitz
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""Twisted Python Roots: an abstract hierarchy representation for Twisted.
Maintainer: Glyph Lefkowitz
Stability: Unstable
Future Plans: Removing distinction between 'static' and 'dynamic' entities,
which never made much sense anyway and bloats the API horribly. This probably
involves updating all of Coil to have tree widgets that can be dynamically
expanded, which probably involves porting all of Coil to Woven, so it might not
happen for a while.
"""
# System imports
import types
from twisted.python import reflect
class NotSupportedError(NotImplementedError):
"""
An exception meaning that the tree-manipulation operation
you're attempting to perform is not supported.
"""
class Request:
"""I am an abstract representation of a request for an entity.
I also function as the response. The request is responded to by calling
self.write(data) until there is no data left and then calling
self.finish().
"""
# This attribute should be set to the string name of the protocol being
# responded to (e.g. HTTP or FTP)
wireProtocol = None
def write(self, data):
"""Add some data to the response to this request.
"""
raise NotImplementedError("%s.write" % reflect.qual(self.__class__))
def finish(self):
"""The response to this request is finished; flush all data to the network stream.
"""
raise NotImplementedError("%s.finish" % reflect.qual(self.__class__))
class Entity:
"""I am a terminal object in a hierarchy, with no children.
I represent a null interface; certain non-instance objects (strings and
integers, notably) are Entities.
Methods on this class are suggested to be implemented, but are not
required, and will be emulated on a per-protocol basis for types which do
not handle them.
"""
def render(self, request):
"""
I produce a stream of bytes for the request, by calling request.write()
and request.finish().
"""
raise NotImplementedError("%s.render" % reflect.qual(self.__class__))
class Collection:
"""I represent a static collection of entities.
I contain methods designed to represent collections that can be dynamically
created.
"""
def __init__(self, entities=None):
"""Initialize me.
"""
if entities is not None:
self.entities = entities
else:
self.entities = {}
def getStaticEntity(self, name):
"""Get an entity that was added to me using putEntity.
This method will return 'None' if it fails.
"""
return self.entities.get(name)
def getDynamicEntity(self, name, request):
"""Subclass this to generate an entity on demand.
This method should return 'None' if it fails.
"""
def getEntity(self, name, request):
"""Retrieve an entity from me.
I will first attempt to retrieve an entity statically; static entities
will obscure dynamic ones. If that fails, I will retrieve the entity
dynamically.
If I cannot retrieve an entity, I will return 'None'.
"""
ent = self.getStaticEntity(name)
if ent is not None:
return ent
ent = self.getDynamicEntity(name, request)
if ent is not None:
return ent
return None
def putEntity(self, name, entity):
"""Store a static reference on 'name' for 'entity'.
Raises a KeyError if the operation fails.
"""
self.entities[name] = entity
def delEntity(self, name):
"""Remove a static reference for 'name'.
Raises a KeyError if the operation fails.
"""
del self.entities[name]
def storeEntity(self, name, request):
"""Store an entity for 'name', based on the content of 'request'.
"""
raise NotSupportedError("%s.storeEntity" % reflect.qual(self.__class__))
def removeEntity(self, name, request):
"""Remove an entity for 'name', based on the content of 'request'.
"""
raise NotSupportedError("%s.removeEntity" % reflect.qual(self.__class__))
def listStaticEntities(self):
"""Retrieve a list of all name, entity pairs that I store references to.
See getStaticEntity.
"""
return self.entities.items()
def listDynamicEntities(self, request):
"""A list of all name, entity that I can generate on demand.
See getDynamicEntity.
"""
return []
def listEntities(self, request):
"""Retrieve a list of all name, entity pairs I contain.
See getEntity.
"""
return self.listStaticEntities() + self.listDynamicEntities(request)
def listStaticNames(self):
"""Retrieve a list of the names of entities that I store references to.
See getStaticEntity.
"""
return self.entities.keys()
def listDynamicNames(self):
"""Retrieve a list of the names of entities that I store references to.
See getDynamicEntity.
"""
return []
def listNames(self, request):
"""Retrieve a list of all names for entities that I contain.
See getEntity.
"""
return self.listStaticNames()
class ConstraintViolation(Exception):
"""An exception raised when a constraint is violated.
"""
class Constrained(Collection):
"""A collection that has constraints on its names and/or entities."""
def nameConstraint(self, name):
"""A method that determines whether an entity may be added to me with a given name.
If the constraint is satisfied, return 1; if the constraint is not
satisfied, either return 0 or raise a descriptive ConstraintViolation.
"""
return 1
def entityConstraint(self, entity):
"""A method that determines whether an entity may be added to me.
If the constraint is satisfied, return 1; if the constraint is not
satisfied, either return 0 or raise a descriptive ConstraintViolation.
"""
return 1
def reallyPutEntity(self, name, entity):
Collection.putEntity(self, name, entity)
def putEntity(self, name, entity):
"""Store an entity if it meets both constraints.
Otherwise raise a ConstraintViolation.
"""
if self.nameConstraint(name):
if self.entityConstraint(entity):
self.reallyPutEntity(name, entity)
else:
raise ConstraintViolation("Entity constraint violated.")
else:
raise ConstraintViolation("Name constraint violated.")
class Locked(Constrained):
"""A collection that can be locked from adding entities."""
locked = 0
def lock(self):
self.locked = 1
def entityConstraint(self, entity):
return not self.locked
class Homogenous(Constrained):
"""A homogenous collection of entities.
I will only contain entities that are an instance of the class or type
specified by my 'entityType' attribute.
"""
entityType = types.InstanceType
def entityConstraint(self, entity):
if isinstance(entity, self.entityType):
return 1
else:
raise ConstraintViolation("%s of incorrect type (%s)" %
(entity, self.entityType))
def getNameType(self):
return "Name"
def getEntityType(self):
return self.entityType.__name__
|
gpl-2.0
|
[
3,
1882,
511,
13,
2546,
13,
354,
26,
7390,
14,
396,
14,
396,
63,
12065,
1882,
199,
3,
199,
3,
17078,
12,
314,
22545,
402,
19519,
22026,
199,
3,
1898,
334,
35,
9,
12521,
18619,
29640,
644,
14,
491,
2829,
75,
583,
23751,
199,
3,
199,
3,
961,
3555,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
199,
3,
2811,
652,
1334,
314,
2895,
402,
1015,
499,
14,
17,
402,
314,
1664,
6401,
1696,
1684,
199,
3,
844,
465,
3267,
701,
314,
2868,
2290,
2752,
14,
199,
3,
199,
3,
961,
3555,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
199,
3,
6401,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
199,
3,
844,
3180,
543,
642,
3555,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
199,
3,
2752,
12,
3277,
2020,
8155,
15630,
10902,
12,
14453,
13540,
12,
8226,
12,
4828,
221,
15673,
13,
13421,
221,
8217,
199,
199,
624,
52,
5221,
2018,
12826,
83,
26,
376,
9006,
14446,
6025,
367,
17078,
14,
199,
199,
11903,
8368,
281,
26,
598,
7234,
491,
2829,
75,
583,
23751,
199,
199,
933,
3616,
26,
1910,
11989,
199,
199,
14224,
7497,
796,
26,
29343,
2917,
262,
414,
3382,
283,
1986,
7,
436,
283,
7764,
7,
9045,
12,
199,
6777,
7078,
6326,
8298,
12249,
15988,
436,
330,
1088,
83,
314,
3261,
394,
269,
30759,
590,
14,
221,
961,
8646,
199,
5350,
393,
2310,
12928,
1006,
402,
1849,
382,
370,
1172,
3123,
11114,
626,
883,
506,
18774,
199,
15645,
12,
1314,
8646,
25613,
2310,
1844,
316,
1006,
402,
1849,
382,
370,
644,
79,
1856,
12,
880,
652,
5594,
440,
199,
72,
5435,
367,
282,
1830,
14,
199,
199,
624,
199,
199,
3,
6187,
8925,
199,
646,
2943,
199,
504,
7390,
14,
1548,
492,
16806,
199,
199,
533,
2832,
10682,
547,
8,
18097,
304,
272,
408,
272,
1626,
1919,
11150,
626,
314,
3123,
13,
29798,
5332,
3439,
272,
1265,
3984,
19595,
370,
5147,
365,
440,
3748,
14,
272,
408,
421,
199,
533,
4784,
26,
272,
408,
41,
8140,
376,
9006,
6025,
402,
282,
1056,
367,
376,
4642,
14,
339,
473,
2597,
805,
465,
314,
1177,
14,
221,
710,
1056,
365,
9163,
770,
370,
701,
6358,
272,
291,
14,
952,
8,
576,
9,
5133,
2337,
365,
949,
666,
3602,
436,
2066,
6358,
272,
291,
14,
8192,
1252,
272,
408,
272,
327,
961,
2225,
1077,
506,
663,
370,
314,
1059,
536,
402,
314,
4113,
3769,
272,
327,
9163,
770,
370,
334,
69,
14,
71,
14,
3101,
503,
23125,
9,
272,
11799,
3658,
275,
488,
272,
347,
2218,
8,
277,
12,
666,
304,
267,
408,
1123,
2005,
666,
370,
314,
1177,
370,
642,
1056,
14,
267,
408,
267,
746,
4279,
3647,
83,
14,
952,
2,
450,
16806,
14,
537,
8,
277,
855,
533,
8964,
339,
347,
9578,
8,
277,
304,
267,
408,
1918,
1177,
370,
642,
1056,
365,
9158,
27,
8976,
1006,
666,
370,
314,
2784,
2547,
14,
267,
408,
267,
746,
4279,
3647,
83,
14,
8192,
2,
450,
16806,
14,
537,
8,
277,
855,
533,
8964,
421,
199,
533,
17680,
26,
272,
408,
41,
8140,
282,
11167,
909,
315,
282,
14446,
12,
543,
949,
4978,
14,
339,
473,
2954,
282,
2973,
3217,
27,
9842,
2222,
13,
842,
2251,
334,
5465,
436,
272,
9446,
12,
440,
6665,
9,
787,
3447,
5080,
14,
339,
17653,
641,
642,
1021,
787,
25697,
370,
506,
6366,
12,
1325,
787,
440,
272,
1415,
12,
436,
911,
506,
17423,
972,
641,
282,
1126,
13,
3922,
5597,
367,
2943,
1314,
886,
272,
440,
2429,
3062,
14,
272,
408,
272,
347,
3795,
8,
277,
12,
1056,
304,
267,
408,
267,
473,
7389,
282,
2547,
402,
2783,
367,
314,
1056,
12,
701,
6358,
1056,
14,
952,
342,
267,
436,
1056,
14,
8192,
1252,
267,
408,
267,
746,
4279,
3647,
83,
14,
3352,
2,
450,
16806,
14,
537,
8,
277,
855,
533,
8964,
421,
199,
533,
18003,
26,
272,
408,
41,
2954,
282,
2955,
3245,
402,
9045,
14,
339,
473,
1395,
3102,
19829,
370,
2954,
5055,
626,
883,
506,
18774,
272,
2737,
14,
272,
408,
339,
347,
636,
826,
721,
277,
12,
9045,
29,
403,
304,
267,
408,
9345,
562,
14,
267,
408,
267,
340,
9045,
365,
440,
488,
26,
288,
291,
14,
8327,
275,
9045,
267,
587,
26,
288,
291,
14,
8327,
275,
1052,
339,
347,
664,
9278,
7302,
8,
277,
12,
536,
304,
267,
408,
1002,
376,
4642,
626,
1990,
3483,
370,
562,
1808,
5324,
7302,
14,
398,
961,
1083,
911,
372,
283,
403,
7,
340,
652,
6918,
14,
267,
408,
267,
372,
291,
14,
8327,
14,
362,
8,
354,
9,
339,
347,
664,
14451,
7302,
8,
277,
12,
536,
12,
1056,
304,
267,
408,
23636,
642,
370,
3550,
376,
4642,
641,
29237,
14,
398,
961,
1083,
1077,
372,
283,
403,
7,
340,
652,
6918,
14,
267,
408,
339,
347,
664,
7302,
8,
277,
12,
536,
12,
1056,
304,
267,
408,
15310,
376,
4642,
687,
562,
14,
398,
473,
911,
1642,
7427,
370,
8044,
376,
4642,
2955,
1183,
27,
2955,
9045,
267,
911,
2607,
551,
608,
8336,
7869,
14,
221,
982,
626,
6918,
12,
473,
911,
8044,
314,
4642,
267,
18774,
14,
398,
982,
473,
3913,
8044,
376,
4642,
12,
473,
911,
372,
283,
403,
1370,
267,
408,
267,
15992,
275,
291,
14,
362,
9278,
7302,
8,
354,
9,
267,
340,
15992,
365,
440,
488,
26,
288,
372,
15992,
267,
15992,
275,
291,
14,
362,
14451,
7302,
8,
354,
12,
1056,
9,
267,
340,
15992,
365,
440,
488,
26,
288,
372,
15992,
267,
372,
488,
339,
347,
5324,
7302,
8,
277,
12,
536,
12,
4642,
304,
267,
408,
5502,
282,
2955,
3659,
641,
283,
354,
7,
367,
283,
4502,
1370,
398,
6218,
282,
4067,
340,
314,
3439,
6918,
14,
267,
408,
267,
291,
14,
8327,
59,
354,
61,
275,
4642,
339,
347,
2150,
7302,
8,
277,
12,
536,
304,
267,
408,
5587,
282,
2955,
3659,
367,
283,
354,
1370,
398,
6218,
282
] |
[
1882,
511,
13,
2546,
13,
354,
26,
7390,
14,
396,
14,
396,
63,
12065,
1882,
199,
3,
199,
3,
17078,
12,
314,
22545,
402,
19519,
22026,
199,
3,
1898,
334,
35,
9,
12521,
18619,
29640,
644,
14,
491,
2829,
75,
583,
23751,
199,
3,
199,
3,
961,
3555,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
199,
3,
2811,
652,
1334,
314,
2895,
402,
1015,
499,
14,
17,
402,
314,
1664,
6401,
1696,
1684,
199,
3,
844,
465,
3267,
701,
314,
2868,
2290,
2752,
14,
199,
3,
199,
3,
961,
3555,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
199,
3,
6401,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
199,
3,
844,
3180,
543,
642,
3555,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
199,
3,
2752,
12,
3277,
2020,
8155,
15630,
10902,
12,
14453,
13540,
12,
8226,
12,
4828,
221,
15673,
13,
13421,
221,
8217,
199,
199,
624,
52,
5221,
2018,
12826,
83,
26,
376,
9006,
14446,
6025,
367,
17078,
14,
199,
199,
11903,
8368,
281,
26,
598,
7234,
491,
2829,
75,
583,
23751,
199,
199,
933,
3616,
26,
1910,
11989,
199,
199,
14224,
7497,
796,
26,
29343,
2917,
262,
414,
3382,
283,
1986,
7,
436,
283,
7764,
7,
9045,
12,
199,
6777,
7078,
6326,
8298,
12249,
15988,
436,
330,
1088,
83,
314,
3261,
394,
269,
30759,
590,
14,
221,
961,
8646,
199,
5350,
393,
2310,
12928,
1006,
402,
1849,
382,
370,
1172,
3123,
11114,
626,
883,
506,
18774,
199,
15645,
12,
1314,
8646,
25613,
2310,
1844,
316,
1006,
402,
1849,
382,
370,
644,
79,
1856,
12,
880,
652,
5594,
440,
199,
72,
5435,
367,
282,
1830,
14,
199,
199,
624,
199,
199,
3,
6187,
8925,
199,
646,
2943,
199,
504,
7390,
14,
1548,
492,
16806,
199,
199,
533,
2832,
10682,
547,
8,
18097,
304,
272,
408,
272,
1626,
1919,
11150,
626,
314,
3123,
13,
29798,
5332,
3439,
272,
1265,
3984,
19595,
370,
5147,
365,
440,
3748,
14,
272,
408,
421,
199,
533,
4784,
26,
272,
408,
41,
8140,
376,
9006,
6025,
402,
282,
1056,
367,
376,
4642,
14,
339,
473,
2597,
805,
465,
314,
1177,
14,
221,
710,
1056,
365,
9163,
770,
370,
701,
6358,
272,
291,
14,
952,
8,
576,
9,
5133,
2337,
365,
949,
666,
3602,
436,
2066,
6358,
272,
291,
14,
8192,
1252,
272,
408,
272,
327,
961,
2225,
1077,
506,
663,
370,
314,
1059,
536,
402,
314,
4113,
3769,
272,
327,
9163,
770,
370,
334,
69,
14,
71,
14,
3101,
503,
23125,
9,
272,
11799,
3658,
275,
488,
272,
347,
2218,
8,
277,
12,
666,
304,
267,
408,
1123,
2005,
666,
370,
314,
1177,
370,
642,
1056,
14,
267,
408,
267,
746,
4279,
3647,
83,
14,
952,
2,
450,
16806,
14,
537,
8,
277,
855,
533,
8964,
339,
347,
9578,
8,
277,
304,
267,
408,
1918,
1177,
370,
642,
1056,
365,
9158,
27,
8976,
1006,
666,
370,
314,
2784,
2547,
14,
267,
408,
267,
746,
4279,
3647,
83,
14,
8192,
2,
450,
16806,
14,
537,
8,
277,
855,
533,
8964,
421,
199,
533,
17680,
26,
272,
408,
41,
8140,
282,
11167,
909,
315,
282,
14446,
12,
543,
949,
4978,
14,
339,
473,
2954,
282,
2973,
3217,
27,
9842,
2222,
13,
842,
2251,
334,
5465,
436,
272,
9446,
12,
440,
6665,
9,
787,
3447,
5080,
14,
339,
17653,
641,
642,
1021,
787,
25697,
370,
506,
6366,
12,
1325,
787,
440,
272,
1415,
12,
436,
911,
506,
17423,
972,
641,
282,
1126,
13,
3922,
5597,
367,
2943,
1314,
886,
272,
440,
2429,
3062,
14,
272,
408,
272,
347,
3795,
8,
277,
12,
1056,
304,
267,
408,
267,
473,
7389,
282,
2547,
402,
2783,
367,
314,
1056,
12,
701,
6358,
1056,
14,
952,
342,
267,
436,
1056,
14,
8192,
1252,
267,
408,
267,
746,
4279,
3647,
83,
14,
3352,
2,
450,
16806,
14,
537,
8,
277,
855,
533,
8964,
421,
199,
533,
18003,
26,
272,
408,
41,
2954,
282,
2955,
3245,
402,
9045,
14,
339,
473,
1395,
3102,
19829,
370,
2954,
5055,
626,
883,
506,
18774,
272,
2737,
14,
272,
408,
339,
347,
636,
826,
721,
277,
12,
9045,
29,
403,
304,
267,
408,
9345,
562,
14,
267,
408,
267,
340,
9045,
365,
440,
488,
26,
288,
291,
14,
8327,
275,
9045,
267,
587,
26,
288,
291,
14,
8327,
275,
1052,
339,
347,
664,
9278,
7302,
8,
277,
12,
536,
304,
267,
408,
1002,
376,
4642,
626,
1990,
3483,
370,
562,
1808,
5324,
7302,
14,
398,
961,
1083,
911,
372,
283,
403,
7,
340,
652,
6918,
14,
267,
408,
267,
372,
291,
14,
8327,
14,
362,
8,
354,
9,
339,
347,
664,
14451,
7302,
8,
277,
12,
536,
12,
1056,
304,
267,
408,
23636,
642,
370,
3550,
376,
4642,
641,
29237,
14,
398,
961,
1083,
1077,
372,
283,
403,
7,
340,
652,
6918,
14,
267,
408,
339,
347,
664,
7302,
8,
277,
12,
536,
12,
1056,
304,
267,
408,
15310,
376,
4642,
687,
562,
14,
398,
473,
911,
1642,
7427,
370,
8044,
376,
4642,
2955,
1183,
27,
2955,
9045,
267,
911,
2607,
551,
608,
8336,
7869,
14,
221,
982,
626,
6918,
12,
473,
911,
8044,
314,
4642,
267,
18774,
14,
398,
982,
473,
3913,
8044,
376,
4642,
12,
473,
911,
372,
283,
403,
1370,
267,
408,
267,
15992,
275,
291,
14,
362,
9278,
7302,
8,
354,
9,
267,
340,
15992,
365,
440,
488,
26,
288,
372,
15992,
267,
15992,
275,
291,
14,
362,
14451,
7302,
8,
354,
12,
1056,
9,
267,
340,
15992,
365,
440,
488,
26,
288,
372,
15992,
267,
372,
488,
339,
347,
5324,
7302,
8,
277,
12,
536,
12,
4642,
304,
267,
408,
5502,
282,
2955,
3659,
641,
283,
354,
7,
367,
283,
4502,
1370,
398,
6218,
282,
4067,
340,
314,
3439,
6918,
14,
267,
408,
267,
291,
14,
8327,
59,
354,
61,
275,
4642,
339,
347,
2150,
7302,
8,
277,
12,
536,
304,
267,
408,
5587,
282,
2955,
3659,
367,
283,
354,
1370,
398,
6218,
282,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
huaweiswitch/neutron
|
neutron/plugins/cisco/common/cisco_faults.py
|
50
|
4085
|
# Copyright 2011 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import webob.dec
from neutron import wsgi
class Fault(webob.exc.HTTPException):
"""Error codes for API faults."""
_fault_names = {
400: "malformedRequest",
401: "unauthorized",
451: "CredentialNotFound",
452: "QoSNotFound",
453: "NovatenantNotFound",
454: "MultiportNotFound",
470: "serviceUnavailable",
471: "pluginFault"
}
def __init__(self, exception):
"""Create a Fault for the given webob.exc.exception."""
self.wrapped_exc = exception
@webob.dec.wsgify(RequestClass=wsgi.Request)
def __call__(self, req):
"""Generate a WSGI response.
Response is generated based on the exception passed to constructor.
"""
# Replace the body with fault details.
code = self.wrapped_exc.status_int
fault_name = self._fault_names.get(code, "neutronServiceFault")
fault_data = {
fault_name: {
'code': code,
'message': self.wrapped_exc.explanation}}
# 'code' is an attribute on the fault tag itself
content_type = req.best_match_content_type()
self.wrapped_exc.body = wsgi.Serializer().serialize(
fault_data, content_type)
self.wrapped_exc.content_type = content_type
return self.wrapped_exc
class PortNotFound(webob.exc.HTTPClientError):
"""PortNotFound exception.
subclass of :class:`~HTTPClientError`
This indicates that the server did not find the port specified
in the HTTP request for a given network
code: 430, title: Port not Found
"""
code = 430
title = _('Port not Found')
explanation = _('Unable to find a port with the specified identifier.')
class CredentialNotFound(webob.exc.HTTPClientError):
"""CredentialNotFound exception.
subclass of :class:`~HTTPClientError`
This indicates that the server did not find the Credential specified
in the HTTP request
code: 451, title: Credential not Found
"""
code = 451
title = _('Credential Not Found')
explanation = _('Unable to find a Credential with'
' the specified identifier.')
class QosNotFound(webob.exc.HTTPClientError):
"""QosNotFound exception.
subclass of :class:`~HTTPClientError`
This indicates that the server did not find the QoS specified
in the HTTP request
code: 452, title: QoS not Found
"""
code = 452
title = _('QoS Not Found')
explanation = _('Unable to find a QoS with'
' the specified identifier.')
class NovatenantNotFound(webob.exc.HTTPClientError):
"""NovatenantNotFound exception.
subclass of :class:`~HTTPClientError`
This indicates that the server did not find the Novatenant specified
in the HTTP request
code: 453, title: Nova tenant not Found
"""
code = 453
title = _('Nova tenant Not Found')
explanation = _('Unable to find a Novatenant with'
' the specified identifier.')
class RequestedStateInvalid(webob.exc.HTTPClientError):
"""RequestedStateInvalid exception.
subclass of :class:`~HTTPClientError`
This indicates that the server could not update the port state
to the request value
code: 431, title: Requested State Invalid
"""
code = 431
title = _('Requested State Invalid')
explanation = _('Unable to update port state with specified value.')
|
apache-2.0
|
[
3,
1898,
7760,
28356,
15285,
12,
3277,
14,
221,
2900,
4481,
4644,
14,
199,
3,
199,
3,
259,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
1265,
1443,
199,
3,
259,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
2047,
1443,
3332,
199,
3,
259,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
260,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
259,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
259,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
2428,
199,
3,
259,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
1666,
314,
199,
3,
259,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
4204,
199,
3,
259,
1334,
314,
844,
14,
199,
199,
646,
14568,
14,
7778,
199,
199,
504,
8224,
492,
12464,
421,
199,
533,
31422,
8,
24057,
14,
2804,
14,
26871,
304,
272,
408,
547,
9479,
367,
3261,
16898,
83,
1041,
339,
485,
1879,
63,
1247,
275,
469,
267,
8290,
26,
298,
31029,
2017,
401,
267,
13952,
26,
298,
324,
11497,
401,
267,
841,
2869,
26,
298,
23330,
4667,
401,
267,
841,
2528,
26,
298,
25064,
51,
4667,
401,
267,
841,
2481,
26,
298,
1944,
2409,
78,
867,
4667,
401,
267,
841,
1477,
26,
298,
3947,
719,
4667,
401,
267,
841,
2760,
26,
298,
1364,
28049,
401,
267,
841,
3172,
26,
298,
2718,
16665,
2,
272,
789,
339,
347,
636,
826,
721,
277,
12,
1919,
304,
267,
408,
2499,
282,
31422,
367,
314,
1627,
14568,
14,
2804,
14,
1971,
1041,
267,
291,
14,
9130,
63,
2804,
275,
1919,
339,
768,
24057,
14,
7778,
14,
87,
1226,
2021,
8,
2017,
2543,
29,
6508,
14,
2017,
9,
272,
347,
636,
1250,
721,
277,
12,
2648,
304,
267,
408,
6864,
282,
9279,
1177,
14,
398,
7232,
365,
4046,
4079,
641,
314,
1919,
3032,
370,
3787,
14,
267,
408,
267,
327,
14402,
314,
2396,
543,
16898,
2436,
14,
267,
1233,
275,
291,
14,
9130,
63,
2804,
14,
1205,
63,
442,
267,
16898,
63,
354,
275,
291,
423,
1879,
63,
1247,
14,
362,
8,
600,
12,
298,
10271,
3167,
16665,
531,
267,
16898,
63,
576,
275,
469,
288,
16898,
63,
354,
26,
469,
355,
283,
600,
356,
1233,
12,
355,
283,
1188,
356,
291,
14,
9130,
63,
2804,
14,
15228,
4863,
267,
327,
283,
600,
7,
365,
376,
2225,
641,
314,
16898,
1947,
6337,
267,
1564,
63,
466,
275,
2648,
14,
7010,
63,
1431,
63,
1317,
63,
466,
342,
267,
291,
14,
9130,
63,
2804,
14,
2030,
275,
12464,
14,
7299,
1252,
3549,
8,
288,
16898,
63,
576,
12,
1564,
63,
466,
9,
267,
291,
14,
9130,
63,
2804,
14,
1317,
63,
466,
275,
1564,
63,
466,
267,
372,
291,
14,
9130,
63,
2804,
421,
199,
533,
10977,
4667,
8,
24057,
14,
2804,
14,
2856,
19992,
304,
272,
408,
4313,
4667,
1919,
14,
339,
5516,
402,
520,
533,
6054,
2856,
19992,
64,
339,
961,
9126,
626,
314,
1654,
8103,
440,
2342,
314,
1844,
2013,
272,
315,
314,
3101,
1056,
367,
282,
1627,
2784,
339,
1233,
26,
841,
1216,
12,
2538,
26,
10977,
440,
2643,
272,
408,
272,
1233,
275,
841,
1216,
272,
2538,
275,
4018,
4313,
440,
2643,
358,
272,
17531,
275,
4018,
6005,
370,
2342,
282,
1844,
543,
314,
2013,
5148,
2659,
421,
199,
533,
9750,
3256,
4667,
8,
24057,
14,
2804,
14,
2856,
19992,
304,
272,
408,
23330,
4667,
1919,
14,
339,
5516,
402,
520,
533,
6054,
2856,
19992,
64,
339,
961,
9126,
626,
314,
1654,
8103,
440,
2342,
314,
9750,
3256,
2013,
272,
315,
314,
3101,
1056,
339,
1233,
26,
841,
2869,
12,
2538,
26,
9750,
3256,
440,
2643,
272,
408,
272,
1233,
275,
841,
2869,
272,
2538,
275,
4018,
23330,
2832,
2643,
358,
272,
17531,
275,
4018,
6005,
370,
2342,
282,
9750,
3256,
543,
7,
490,
283,
314,
2013,
5148,
2659,
421,
199,
533,
1413,
736,
4667,
8,
24057,
14,
2804,
14,
2856,
19992,
304,
272,
408,
20633,
4667,
1919,
14,
339,
5516,
402,
520,
533,
6054,
2856,
19992,
64,
339,
961,
9126,
626,
314,
1654,
8103,
440,
2342,
314,
1413,
79,
51,
2013,
272,
315,
314,
3101,
1056,
339,
1233,
26,
841,
2528,
12,
2538,
26,
1413,
79,
51,
440,
2643,
272,
408,
272,
1233,
275,
841,
2528,
272,
2538,
275,
4018,
25064,
51,
2832,
2643,
358,
272,
17531,
275,
4018,
6005,
370,
2342,
282,
1413,
79,
51,
543,
7,
490,
283,
314,
2013,
5148,
2659,
421,
199,
533,
3091,
2409,
78,
867,
4667,
8,
24057,
14,
2804,
14,
2856,
19992,
304,
272,
408,
1944,
2409,
78,
867,
4667,
1919,
14,
339,
5516,
402,
520,
533,
6054,
2856,
19992,
64,
339,
961,
9126,
626,
314,
1654,
8103,
440,
2342,
314,
3091,
2409,
78,
867,
2013,
272,
315,
314,
3101,
1056,
339,
1233,
26,
841,
2481,
12,
2538,
26,
28184,
8261,
440,
2643,
272,
408,
272,
1233,
275,
841,
2481,
272,
2538,
275,
4018,
19884,
8261,
2832,
2643,
358,
272,
17531,
275,
4018,
6005,
370,
2342,
282,
3091,
2409,
78,
867,
543,
7,
490,
283,
314,
2013,
5148,
2659,
421,
199,
533,
799,
4522,
2223,
3364,
8,
24057,
14,
2804,
14,
2856,
19992,
304,
272,
408,
17935,
2223,
3364,
1919,
14,
339,
5516,
402,
520,
533,
6054,
2856,
19992,
64,
339,
961,
9126,
626,
314,
1654,
4293,
440,
1678,
314,
1844,
1174,
272,
370,
314,
1056,
574,
339,
1233,
26,
841,
2192,
12,
2538,
26,
799,
4522,
8511,
6378,
272,
408,
272,
1233,
275,
841,
2192,
272,
2538,
275,
4018,
17935,
8511,
6378,
358,
272,
17531,
275,
4018,
6005,
370,
1678,
1844,
1174,
543,
2013,
574,
2659,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1898,
7760,
28356,
15285,
12,
3277,
14,
221,
2900,
4481,
4644,
14,
199,
3,
199,
3,
259,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
1265,
1443,
199,
3,
259,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
2047,
1443,
3332,
199,
3,
259,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
260,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
259,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
259,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
2428,
199,
3,
259,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
1666,
314,
199,
3,
259,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
4204,
199,
3,
259,
1334,
314,
844,
14,
199,
199,
646,
14568,
14,
7778,
199,
199,
504,
8224,
492,
12464,
421,
199,
533,
31422,
8,
24057,
14,
2804,
14,
26871,
304,
272,
408,
547,
9479,
367,
3261,
16898,
83,
1041,
339,
485,
1879,
63,
1247,
275,
469,
267,
8290,
26,
298,
31029,
2017,
401,
267,
13952,
26,
298,
324,
11497,
401,
267,
841,
2869,
26,
298,
23330,
4667,
401,
267,
841,
2528,
26,
298,
25064,
51,
4667,
401,
267,
841,
2481,
26,
298,
1944,
2409,
78,
867,
4667,
401,
267,
841,
1477,
26,
298,
3947,
719,
4667,
401,
267,
841,
2760,
26,
298,
1364,
28049,
401,
267,
841,
3172,
26,
298,
2718,
16665,
2,
272,
789,
339,
347,
636,
826,
721,
277,
12,
1919,
304,
267,
408,
2499,
282,
31422,
367,
314,
1627,
14568,
14,
2804,
14,
1971,
1041,
267,
291,
14,
9130,
63,
2804,
275,
1919,
339,
768,
24057,
14,
7778,
14,
87,
1226,
2021,
8,
2017,
2543,
29,
6508,
14,
2017,
9,
272,
347,
636,
1250,
721,
277,
12,
2648,
304,
267,
408,
6864,
282,
9279,
1177,
14,
398,
7232,
365,
4046,
4079,
641,
314,
1919,
3032,
370,
3787,
14,
267,
408,
267,
327,
14402,
314,
2396,
543,
16898,
2436,
14,
267,
1233,
275,
291,
14,
9130,
63,
2804,
14,
1205,
63,
442,
267,
16898,
63,
354,
275,
291,
423,
1879,
63,
1247,
14,
362,
8,
600,
12,
298,
10271,
3167,
16665,
531,
267,
16898,
63,
576,
275,
469,
288,
16898,
63,
354,
26,
469,
355,
283,
600,
356,
1233,
12,
355,
283,
1188,
356,
291,
14,
9130,
63,
2804,
14,
15228,
4863,
267,
327,
283,
600,
7,
365,
376,
2225,
641,
314,
16898,
1947,
6337,
267,
1564,
63,
466,
275,
2648,
14,
7010,
63,
1431,
63,
1317,
63,
466,
342,
267,
291,
14,
9130,
63,
2804,
14,
2030,
275,
12464,
14,
7299,
1252,
3549,
8,
288,
16898,
63,
576,
12,
1564,
63,
466,
9,
267,
291,
14,
9130,
63,
2804,
14,
1317,
63,
466,
275,
1564,
63,
466,
267,
372,
291,
14,
9130,
63,
2804,
421,
199,
533,
10977,
4667,
8,
24057,
14,
2804,
14,
2856,
19992,
304,
272,
408,
4313,
4667,
1919,
14,
339,
5516,
402,
520,
533,
6054,
2856,
19992,
64,
339,
961,
9126,
626,
314,
1654,
8103,
440,
2342,
314,
1844,
2013,
272,
315,
314,
3101,
1056,
367,
282,
1627,
2784,
339,
1233,
26,
841,
1216,
12,
2538,
26,
10977,
440,
2643,
272,
408,
272,
1233,
275,
841,
1216,
272,
2538,
275,
4018,
4313,
440,
2643,
358,
272,
17531,
275,
4018,
6005,
370,
2342,
282,
1844,
543,
314,
2013,
5148,
2659,
421,
199,
533,
9750,
3256,
4667,
8,
24057,
14,
2804,
14,
2856,
19992,
304,
272,
408,
23330,
4667,
1919,
14,
339,
5516,
402,
520,
533,
6054,
2856,
19992,
64,
339,
961,
9126,
626,
314,
1654,
8103,
440,
2342,
314,
9750,
3256,
2013,
272,
315,
314,
3101,
1056,
339,
1233,
26,
841,
2869,
12,
2538,
26,
9750,
3256,
440,
2643,
272,
408,
272,
1233,
275,
841,
2869,
272,
2538,
275,
4018,
23330,
2832,
2643,
358,
272,
17531,
275,
4018,
6005,
370,
2342,
282,
9750,
3256,
543,
7,
490,
283,
314,
2013,
5148,
2659,
421,
199,
533,
1413,
736,
4667,
8,
24057,
14,
2804,
14,
2856,
19992,
304,
272,
408,
20633,
4667,
1919,
14,
339,
5516,
402,
520,
533,
6054,
2856,
19992,
64,
339,
961,
9126,
626,
314,
1654,
8103,
440,
2342,
314,
1413,
79,
51,
2013,
272,
315,
314,
3101,
1056,
339,
1233,
26,
841,
2528,
12,
2538,
26,
1413,
79,
51,
440,
2643,
272,
408,
272,
1233,
275,
841,
2528,
272,
2538,
275,
4018,
25064,
51,
2832,
2643,
358,
272,
17531,
275,
4018,
6005,
370,
2342,
282,
1413,
79,
51,
543,
7,
490,
283,
314,
2013,
5148,
2659,
421,
199,
533,
3091,
2409,
78,
867,
4667,
8,
24057,
14,
2804,
14,
2856,
19992,
304,
272,
408,
1944,
2409,
78,
867,
4667,
1919,
14,
339,
5516,
402,
520,
533,
6054,
2856,
19992,
64,
339,
961,
9126,
626,
314,
1654,
8103,
440,
2342,
314,
3091,
2409,
78,
867,
2013,
272,
315,
314,
3101,
1056,
339,
1233,
26,
841,
2481,
12,
2538,
26,
28184,
8261,
440,
2643,
272,
408,
272,
1233,
275,
841,
2481,
272,
2538,
275,
4018,
19884,
8261,
2832,
2643,
358,
272,
17531,
275,
4018,
6005,
370,
2342,
282,
3091,
2409,
78,
867,
543,
7,
490,
283,
314,
2013,
5148,
2659,
421,
199,
533,
799,
4522,
2223,
3364,
8,
24057,
14,
2804,
14,
2856,
19992,
304,
272,
408,
17935,
2223,
3364,
1919,
14,
339,
5516,
402,
520,
533,
6054,
2856,
19992,
64,
339,
961,
9126,
626,
314,
1654,
4293,
440,
1678,
314,
1844,
1174,
272,
370,
314,
1056,
574,
339,
1233,
26,
841,
2192,
12,
2538,
26,
799,
4522,
8511,
6378,
272,
408,
272,
1233,
275,
841,
2192,
272,
2538,
275,
4018,
17935,
8511,
6378,
358,
272,
17531,
275,
4018,
6005,
370,
1678,
1844,
1174,
543,
2013,
574,
2659,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
takeflight/django
|
django/core/context_processors.py
|
27
|
2462
|
"""
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.
These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by
RequestContext.
"""
from __future__ import unicode_literals
from django.conf import settings
from django.middleware.csrf import get_token
from django.utils import six
from django.utils.encoding import smart_text
from django.utils.functional import lazy
def csrf(request):
"""
Context processor that provides a CSRF token, or the string 'NOTPROVIDED' if
it has not been provided by either a view decorator or the middleware
"""
def _get_val():
token = get_token(request)
if token is None:
# In order to be able to provide debugging info in the
# case of misconfiguration, we use a sentinel value
# instead of returning an empty dict.
return 'NOTPROVIDED'
else:
return smart_text(token)
_get_val = lazy(_get_val, six.text_type)
return {'csrf_token': _get_val()}
def debug(request):
"""
Returns context variables helpful for debugging.
"""
context_extras = {}
if settings.DEBUG and request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS:
context_extras['debug'] = True
from django.db import connection
# Return a lazy reference that computes connection.queries on access,
# to ensure it contains queries triggered after this function runs.
context_extras['sql_queries'] = lazy(lambda: connection.queries, list)
return context_extras
def i18n(request):
from django.utils import translation
context_extras = {}
context_extras['LANGUAGES'] = settings.LANGUAGES
context_extras['LANGUAGE_CODE'] = translation.get_language()
context_extras['LANGUAGE_BIDI'] = translation.get_language_bidi()
return context_extras
def tz(request):
from django.utils import timezone
return {'TIME_ZONE': timezone.get_current_timezone_name()}
def static(request):
"""
Adds static-related context variables to the context.
"""
return {'STATIC_URL': settings.STATIC_URL}
def media(request):
"""
Adds media-related context variables to the context.
"""
return {'MEDIA_URL': settings.MEDIA_URL}
def request(request):
return {'request': request}
|
bsd-3-clause
|
[
624,
199,
33,
663,
402,
1056,
21620,
626,
372,
11196,
370,
506,
9545,
1901,
282,
199,
1160,
1067,
14,
7048,
805,
6181,
314,
1056,
909,
465,
2399,
1454,
2725,
199,
460,
2529,
282,
2600,
370,
1050,
370,
314,
1067,
14,
199,
199,
20676,
787,
11812,
687,
314,
4260,
24877,
63,
9059,
63,
10494,
4149,
436,
1202,
701,
199,
17679,
14,
199,
624,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
5754,
14,
10088,
492,
664,
63,
1418,
199,
504,
1639,
14,
1208,
492,
3816,
199,
504,
1639,
14,
1208,
14,
2991,
492,
11179,
63,
505,
199,
504,
1639,
14,
1208,
14,
15481,
492,
9617,
421,
199,
318,
19213,
8,
1069,
304,
272,
408,
272,
9470,
12495,
626,
6571,
282,
22468,
1526,
12,
503,
314,
1059,
283,
4609,
21403,
1149,
7,
340,
272,
652,
965,
440,
2757,
2741,
701,
1902,
282,
2455,
7531,
503,
314,
10816,
272,
408,
272,
347,
485,
362,
63,
637,
837,
267,
1526,
275,
664,
63,
1418,
8,
1069,
9,
267,
340,
1526,
365,
488,
26,
288,
327,
1010,
1865,
370,
506,
7688,
370,
5647,
10201,
2256,
315,
314,
288,
327,
1930,
402,
3201,
4758,
12,
781,
675,
282,
13792,
574,
288,
327,
3140,
402,
8152,
376,
2701,
1211,
14,
288,
372,
283,
4609,
21403,
1149,
7,
267,
587,
26,
288,
372,
11179,
63,
505,
8,
1418,
9,
272,
485,
362,
63,
637,
275,
9617,
1547,
362,
63,
637,
12,
3816,
14,
505,
63,
466,
9,
339,
372,
791,
10088,
63,
1418,
356,
485,
362,
63,
637,
12737,
421,
199,
318,
3105,
8,
1069,
304,
272,
408,
272,
1803,
1067,
2860,
24606,
367,
10201,
14,
272,
408,
272,
1067,
63,
9975,
275,
1052,
272,
340,
2202,
14,
5287,
436,
1056,
14,
10614,
14,
362,
360,
16058,
63,
7803,
358,
315,
2202,
14,
17681,
63,
12346,
26,
267,
1067,
63,
9975,
459,
1757,
418,
275,
715,
267,
687,
1639,
14,
697,
492,
1950,
267,
327,
1432,
282,
9617,
3659,
626,
21445,
1950,
14,
10590,
641,
2879,
12,
267,
327,
370,
4868,
652,
3509,
9212,
15572,
2410,
642,
805,
7858,
14,
267,
1067,
63,
9975,
459,
3009,
63,
10590,
418,
275,
9617,
8,
2734,
26,
1950,
14,
10590,
12,
769,
9,
272,
372,
1067,
63,
9975,
421,
199,
318,
284,
1085,
78,
8,
1069,
304,
272,
687,
1639,
14,
1208,
492,
7761,
339,
1067,
63,
9975,
275,
1052,
272,
1067,
63,
9975,
459,
26886,
418,
275,
2202,
14,
26886,
272,
1067,
63,
9975,
459,
13947,
63,
6012,
418,
275,
7761,
14,
362,
63,
3671,
342,
272,
1067,
63,
9975,
459,
13947,
63,
34,
28904,
418,
275,
7761,
14,
362,
63,
3671,
63,
21555,
342,
339,
372,
1067,
63,
9975,
421,
199,
318,
5823,
8,
1069,
304,
272,
687,
1639,
14,
1208,
492,
7137,
339,
372,
791,
4961,
63,
15353,
356,
7137,
14,
362,
63,
1818,
63,
7145,
63,
354,
12737,
421,
199,
318,
2955,
8,
1069,
304,
272,
408,
272,
15747,
2955,
13,
2407,
1067,
2860,
370,
314,
1067,
14,
339,
408,
272,
372,
791,
10449,
63,
2632,
356,
2202,
14,
10449,
63,
2632,
93,
421,
199,
318,
5898,
8,
1069,
304,
272,
408,
272,
15747,
5898,
13,
2407,
1067,
2860,
370,
314,
1067,
14,
339,
408,
272,
372,
791,
13669,
63,
2632,
356,
2202,
14,
13669,
63,
2632,
93,
421,
199,
318,
1056,
8,
1069,
304,
272,
372,
791,
1069,
356,
1056,
93,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
199,
33,
663,
402,
1056,
21620,
626,
372,
11196,
370,
506,
9545,
1901,
282,
199,
1160,
1067,
14,
7048,
805,
6181,
314,
1056,
909,
465,
2399,
1454,
2725,
199,
460,
2529,
282,
2600,
370,
1050,
370,
314,
1067,
14,
199,
199,
20676,
787,
11812,
687,
314,
4260,
24877,
63,
9059,
63,
10494,
4149,
436,
1202,
701,
199,
17679,
14,
199,
624,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
5754,
14,
10088,
492,
664,
63,
1418,
199,
504,
1639,
14,
1208,
492,
3816,
199,
504,
1639,
14,
1208,
14,
2991,
492,
11179,
63,
505,
199,
504,
1639,
14,
1208,
14,
15481,
492,
9617,
421,
199,
318,
19213,
8,
1069,
304,
272,
408,
272,
9470,
12495,
626,
6571,
282,
22468,
1526,
12,
503,
314,
1059,
283,
4609,
21403,
1149,
7,
340,
272,
652,
965,
440,
2757,
2741,
701,
1902,
282,
2455,
7531,
503,
314,
10816,
272,
408,
272,
347,
485,
362,
63,
637,
837,
267,
1526,
275,
664,
63,
1418,
8,
1069,
9,
267,
340,
1526,
365,
488,
26,
288,
327,
1010,
1865,
370,
506,
7688,
370,
5647,
10201,
2256,
315,
314,
288,
327,
1930,
402,
3201,
4758,
12,
781,
675,
282,
13792,
574,
288,
327,
3140,
402,
8152,
376,
2701,
1211,
14,
288,
372,
283,
4609,
21403,
1149,
7,
267,
587,
26,
288,
372,
11179,
63,
505,
8,
1418,
9,
272,
485,
362,
63,
637,
275,
9617,
1547,
362,
63,
637,
12,
3816,
14,
505,
63,
466,
9,
339,
372,
791,
10088,
63,
1418,
356,
485,
362,
63,
637,
12737,
421,
199,
318,
3105,
8,
1069,
304,
272,
408,
272,
1803,
1067,
2860,
24606,
367,
10201,
14,
272,
408,
272,
1067,
63,
9975,
275,
1052,
272,
340,
2202,
14,
5287,
436,
1056,
14,
10614,
14,
362,
360,
16058,
63,
7803,
358,
315,
2202,
14,
17681,
63,
12346,
26,
267,
1067,
63,
9975,
459,
1757,
418,
275,
715,
267,
687,
1639,
14,
697,
492,
1950,
267,
327,
1432,
282,
9617,
3659,
626,
21445,
1950,
14,
10590,
641,
2879,
12,
267,
327,
370,
4868,
652,
3509,
9212,
15572,
2410,
642,
805,
7858,
14,
267,
1067,
63,
9975,
459,
3009,
63,
10590,
418,
275,
9617,
8,
2734,
26,
1950,
14,
10590,
12,
769,
9,
272,
372,
1067,
63,
9975,
421,
199,
318,
284,
1085,
78,
8,
1069,
304,
272,
687,
1639,
14,
1208,
492,
7761,
339,
1067,
63,
9975,
275,
1052,
272,
1067,
63,
9975,
459,
26886,
418,
275,
2202,
14,
26886,
272,
1067,
63,
9975,
459,
13947,
63,
6012,
418,
275,
7761,
14,
362,
63,
3671,
342,
272,
1067,
63,
9975,
459,
13947,
63,
34,
28904,
418,
275,
7761,
14,
362,
63,
3671,
63,
21555,
342,
339,
372,
1067,
63,
9975,
421,
199,
318,
5823,
8,
1069,
304,
272,
687,
1639,
14,
1208,
492,
7137,
339,
372,
791,
4961,
63,
15353,
356,
7137,
14,
362,
63,
1818,
63,
7145,
63,
354,
12737,
421,
199,
318,
2955,
8,
1069,
304,
272,
408,
272,
15747,
2955,
13,
2407,
1067,
2860,
370,
314,
1067,
14,
339,
408,
272,
372,
791,
10449,
63,
2632,
356,
2202,
14,
10449,
63,
2632,
93,
421,
199,
318,
5898,
8,
1069,
304,
272,
408,
272,
15747,
5898,
13,
2407,
1067,
2860,
370,
314,
1067,
14,
339,
408,
272,
372,
791,
13669,
63,
2632,
356,
2202,
14,
13669,
63,
2632,
93,
421,
199,
318,
1056,
8,
1069,
304,
272,
372,
791,
1069,
356,
1056,
93,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
andrius-preimantas/purchase-workflow
|
purchase_partner_invoice_method/__openerp__.py
|
9
|
1803
|
# -*- encoding: utf-8 -*-
##############################################################################
#
# Purchase Partner Invoice Method module for Odoo
# Copyright (C) 2014 Akretion (http://www.akretion.com).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Purchase Partner Invoice Method',
'version': '8.0.1.0.0',
'category': 'Purchase Management',
'license': 'AGPL-3',
'summary': "Adds supplier invoicing control on partner form",
'description': """
This module adds a new field on the partner form in the *Accouting* tab:
*Supplier Invoicing Control*. The value of this field will be used when you
create a new Purchase Order with this partner as supplier.
This module has been written by Alexis de Lattre
<alexis.delattre@akretion.com>
""",
'author': "Akretion,Odoo Community Association (OCA)",
'website': 'http://www.akretion.com',
'depends': ['purchase'],
'data': ['partner_view.xml'],
'demo': ['partner_demo.xml'],
'installable': True,
}
|
agpl-3.0
|
[
3,
1882,
2644,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
199,
3,
259,
23177,
6703,
31351,
19868,
9075,
859,
367,
28935,
199,
3,
259,
1898,
334,
35,
9,
6927,
437,
75,
264,
296,
334,
1014,
921,
1544,
14,
1151,
264,
296,
14,
957,
680,
199,
3,
259,
768,
2502,
22986,
374,
477,
491,
6796,
264,
665,
1895,
7291,
14,
2264,
6796,
264,
32,
1151,
264,
296,
14,
957,
30,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
4605,
199,
199,
91,
272,
283,
354,
356,
283,
20486,
31351,
19868,
9075,
297,
272,
283,
1023,
356,
283,
24,
14,
16,
14,
17,
14,
16,
14,
16,
297,
272,
283,
3710,
356,
283,
20486,
8259,
297,
272,
283,
1682,
356,
283,
1254,
2749,
13,
19,
297,
272,
283,
4705,
356,
298,
14995,
23700,
315,
2392,
31713,
3304,
641,
5854,
1824,
401,
272,
283,
1802,
356,
408,
199,
2765,
859,
9584,
282,
892,
901,
641,
314,
5854,
1824,
315,
314,
627,
1945,
331,
4655,
10,
5174,
26,
199,
10,
30080,
1010,
2392,
31713,
8612,
4856,
710,
574,
402,
642,
901,
911,
506,
1202,
1380,
1265,
199,
981,
282,
892,
23177,
6703,
9240,
543,
642,
5854,
465,
23700,
14,
199,
199,
2765,
859,
965,
2757,
5313,
701,
22986,
374,
477,
491,
6796,
264,
199,
28,
1895,
7291,
14,
2264,
6796,
264,
32,
1151,
264,
296,
14,
957,
30,
272,
10327,
272,
283,
2502,
356,
298,
33,
75,
264,
296,
12,
47,
16766,
7046,
6639,
24207,
425,
334,
47,
3263,
4186,
272,
283,
7360,
356,
283,
1014,
921,
1544,
14,
1151,
264,
296,
14,
957,
297,
272,
283,
8912,
356,
788,
9533,
995,
272,
283,
576,
356,
788,
3899,
63,
1345,
14,
1652,
995,
272,
283,
8768,
356,
788,
3899,
63,
8768,
14,
1652,
995,
272,
283,
21762,
356,
715,
12,
199,
93,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1882,
2644,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
199,
3,
259,
23177,
6703,
31351,
19868,
9075,
859,
367,
28935,
199,
3,
259,
1898,
334,
35,
9,
6927,
437,
75,
264,
296,
334,
1014,
921,
1544,
14,
1151,
264,
296,
14,
957,
680,
199,
3,
259,
768,
2502,
22986,
374,
477,
491,
6796,
264,
665,
1895,
7291,
14,
2264,
6796,
264,
32,
1151,
264,
296,
14,
957,
30,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
4605,
199,
199,
91,
272,
283,
354,
356,
283,
20486,
31351,
19868,
9075,
297,
272,
283,
1023,
356,
283,
24,
14,
16,
14,
17,
14,
16,
14,
16,
297,
272,
283,
3710,
356,
283,
20486,
8259,
297,
272,
283,
1682,
356,
283,
1254,
2749,
13,
19,
297,
272,
283,
4705,
356,
298,
14995,
23700,
315,
2392,
31713,
3304,
641,
5854,
1824,
401,
272,
283,
1802,
356,
408,
199,
2765,
859,
9584,
282,
892,
901,
641,
314,
5854,
1824,
315,
314,
627,
1945,
331,
4655,
10,
5174,
26,
199,
10,
30080,
1010,
2392,
31713,
8612,
4856,
710,
574,
402,
642,
901,
911,
506,
1202,
1380,
1265,
199,
981,
282,
892,
23177,
6703,
9240,
543,
642,
5854,
465,
23700,
14,
199,
199,
2765,
859,
965,
2757,
5313,
701,
22986,
374,
477,
491,
6796,
264,
199,
28,
1895,
7291,
14,
2264,
6796,
264,
32,
1151,
264,
296,
14,
957,
30,
272,
10327,
272,
283,
2502,
356,
298,
33,
75,
264,
296,
12,
47,
16766,
7046,
6639,
24207,
425,
334,
47,
3263,
4186,
272,
283,
7360,
356,
283,
1014,
921,
1544,
14,
1151,
264,
296,
14,
957,
297,
272,
283,
8912,
356,
788,
9533,
995,
272,
283,
576,
356,
788,
3899,
63,
1345,
14,
1652,
995,
272,
283,
8768,
356,
788,
3899,
63,
8768,
14,
1652,
995,
272,
283,
21762,
356,
715,
12,
199,
93,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,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bwhmather/python-linemode
|
linemode/drivers/command_list.py
|
1
|
1130
|
import sys
from urllib.parse import urlparse
from linemode.base import Printer
def _compile_command(command):
if isinstance(command, str):
command_name, args = command, []
else:
command_name, *args = command
if len(args):
return (
command_name + ": " +
", ".join(repr(arg) for arg in args)
).encode('utf-8')
else:
return command_name.encode('utf-8')
def compile(commands):
return b'\n'.join(
_compile_command(command) for command in commands
)
class CommandListPrinter(Printer):
def __init__(self, port, *, _close_port=False):
self._port = port
self._close_port = _close_port
def compile(self, commands):
return compile(commands)
def execute(self, program):
self._port.write(program)
def shutdown(self):
if self._close_port:
self._port.close()
def open_file(uri):
uri_parts = urlparse(uri)
port = open(uri_parts.path, 'wb')
return CommandListPrinter(port, _close_port=True)
def open_stdout(uri):
return CommandListPrinter(sys.stdout)
|
bsd-3-clause
|
[
646,
984,
199,
504,
4011,
14,
1122,
492,
7097,
199,
199,
504,
1004,
632,
14,
1095,
492,
25716,
1058,
421,
199,
318,
485,
2014,
63,
1531,
8,
1531,
304,
272,
340,
1228,
8,
1531,
12,
620,
304,
267,
1414,
63,
354,
12,
1249,
275,
1414,
12,
942,
272,
587,
26,
267,
1414,
63,
354,
12,
627,
589,
275,
1414,
339,
340,
822,
8,
589,
304,
267,
372,
334,
288,
1414,
63,
354,
435,
7244,
298,
435,
288,
3872,
3680,
904,
8,
2722,
8,
1273,
9,
367,
1680,
315,
1249,
9,
267,
7092,
2143,
360,
1624,
13,
24,
358,
272,
587,
26,
267,
372,
1414,
63,
354,
14,
2143,
360,
1624,
13,
24,
358,
421,
199,
318,
6555,
8,
4405,
304,
272,
372,
330,
1154,
78,
1370,
904,
8,
267,
485,
2014,
63,
1531,
8,
1531,
9,
367,
1414,
315,
3718,
272,
776,
421,
199,
533,
5817,
1296,
14131,
8,
14131,
304,
272,
347,
636,
826,
721,
277,
12,
1844,
12,
9889,
485,
1600,
63,
719,
29,
797,
304,
267,
291,
423,
719,
275,
1844,
267,
291,
423,
1600,
63,
719,
275,
485,
1600,
63,
719,
339,
347,
6555,
8,
277,
12,
3718,
304,
267,
372,
6555,
8,
4405,
9,
339,
347,
5341,
8,
277,
12,
2240,
304,
267,
291,
423,
719,
14,
952,
8,
6815,
9,
339,
347,
12842,
8,
277,
304,
267,
340,
291,
423,
1600,
63,
719,
26,
288,
291,
423,
719,
14,
1600,
342,
421,
199,
318,
1551,
63,
493,
8,
2302,
304,
272,
5108,
63,
4181,
275,
7097,
8,
2302,
9,
272,
1844,
275,
1551,
8,
2302,
63,
4181,
14,
515,
12,
283,
6603,
358,
339,
372,
5817,
1296,
14131,
8,
719,
12,
485,
1600,
63,
719,
29,
549,
9,
421,
199,
318,
1551,
63,
2703,
8,
2302,
304,
272,
372,
5817,
1296,
14131,
8,
1274,
14,
2703,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
984,
199,
504,
4011,
14,
1122,
492,
7097,
199,
199,
504,
1004,
632,
14,
1095,
492,
25716,
1058,
421,
199,
318,
485,
2014,
63,
1531,
8,
1531,
304,
272,
340,
1228,
8,
1531,
12,
620,
304,
267,
1414,
63,
354,
12,
1249,
275,
1414,
12,
942,
272,
587,
26,
267,
1414,
63,
354,
12,
627,
589,
275,
1414,
339,
340,
822,
8,
589,
304,
267,
372,
334,
288,
1414,
63,
354,
435,
7244,
298,
435,
288,
3872,
3680,
904,
8,
2722,
8,
1273,
9,
367,
1680,
315,
1249,
9,
267,
7092,
2143,
360,
1624,
13,
24,
358,
272,
587,
26,
267,
372,
1414,
63,
354,
14,
2143,
360,
1624,
13,
24,
358,
421,
199,
318,
6555,
8,
4405,
304,
272,
372,
330,
1154,
78,
1370,
904,
8,
267,
485,
2014,
63,
1531,
8,
1531,
9,
367,
1414,
315,
3718,
272,
776,
421,
199,
533,
5817,
1296,
14131,
8,
14131,
304,
272,
347,
636,
826,
721,
277,
12,
1844,
12,
9889,
485,
1600,
63,
719,
29,
797,
304,
267,
291,
423,
719,
275,
1844,
267,
291,
423,
1600,
63,
719,
275,
485,
1600,
63,
719,
339,
347,
6555,
8,
277,
12,
3718,
304,
267,
372,
6555,
8,
4405,
9,
339,
347,
5341,
8,
277,
12,
2240,
304,
267,
291,
423,
719,
14,
952,
8,
6815,
9,
339,
347,
12842,
8,
277,
304,
267,
340,
291,
423,
1600,
63,
719,
26,
288,
291,
423,
719,
14,
1600,
342,
421,
199,
318,
1551,
63,
493,
8,
2302,
304,
272,
5108,
63,
4181,
275,
7097,
8,
2302,
9,
272,
1844,
275,
1551,
8,
2302,
63,
4181,
14,
515,
12,
283,
6603,
358,
339,
372,
5817,
1296,
14131,
8,
719,
12,
485,
1600,
63,
719,
29,
549,
9,
421,
199,
318,
1551,
63,
2703,
8,
2302,
304,
272,
372,
5817,
1296,
14131,
8,
1274,
14,
2703,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1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iprogramming
|
jsrepl/build/extern/python/reloop-closured/lib/python2.7/posixpath.py
|
145
|
13182
|
"""Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. macpath, ntpath).
Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
"""
import os
import sys
import stat
import genericpath
import warnings
from genericpath import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","getctime","islink","exists","lexists","isdir","isfile",
"ismount","walk","expanduser","expandvars","normpath","abspath",
"samefile","sameopenfile","samestat",
"curdir","pardir","sep","pathsep","defpath","altsep","extsep",
"devnull","realpath","supports_unicode_filenames","relpath"]
# strings representing various path-related bits and pieces
curdir = '.'
pardir = '..'
extsep = '.'
sep = '/'
pathsep = ':'
defpath = ':/bin:/usr/bin'
altsep = None
devnull = '/dev/null'
# Normalize the case of a pathname. Trivial in Posix, string.lower on Mac.
# On MS-DOS this may also turn slashes into backslashes; however, other
# normalizations (such as optimizing '../' away) are not allowed
# (another function should be defined to do that).
def normcase(s):
"""Normalize case of pathname. Has no effect under Posix"""
return s
# Return whether a path is absolute.
# Trivial in Posix, harder on the Mac or MS-DOS.
def isabs(s):
"""Test whether a path is absolute"""
return s.startswith('/')
# Join pathnames.
# Ignore the previous parts if a part is absolute.
# Insert a '/' unless the first part is empty or already ends in '/'.
def join(a, *p):
"""Join two or more pathname components, inserting '/' as needed.
If any component is an absolute path, all previous path components
will be discarded."""
path = a
for b in p:
if b.startswith('/'):
path = b
elif path == '' or path.endswith('/'):
path += b
else:
path += '/' + b
return path
# Split a path in head (everything up to the last '/') and tail (the
# rest). If the path ends in '/', tail will be empty. If there is no
# '/' in the path, head will be empty.
# Trailing '/'es are stripped from head unless it is the root.
def split(p):
"""Split a pathname. Returns tuple "(head, tail)" where "tail" is
everything after the final slash. Either part may be empty."""
i = p.rfind('/') + 1
head, tail = p[:i], p[i:]
if head and head != '/'*len(head):
head = head.rstrip('/')
return head, tail
# Split a path in root and extension.
# The extension is everything starting at the last dot in the last
# pathname component; the root is everything before that.
# It is always true that root + ext == p.
def splitext(p):
return genericpath._splitext(p, sep, altsep, extsep)
splitext.__doc__ = genericpath._splitext.__doc__
# Split a pathname into a drive specification and the rest of the
# path. Useful on DOS/Windows/NT; on Unix, the drive is always empty.
def splitdrive(p):
"""Split a pathname into drive and path. On Posix, drive is always
empty."""
return '', p
# Return the tail (basename) part of a path, same as split(path)[1].
def basename(p):
"""Returns the final component of a pathname"""
i = p.rfind('/') + 1
return p[i:]
# Return the head (dirname) part of a path, same as split(path)[0].
def dirname(p):
"""Returns the directory component of a pathname"""
i = p.rfind('/') + 1
head = p[:i]
if head and head != '/'*len(head):
head = head.rstrip('/')
return head
# Is a path a symbolic link?
# This will always return false on systems where os.lstat doesn't exist.
def islink(path):
"""Test whether a path is a symbolic link"""
try:
st = os.lstat(path)
except (os.error, AttributeError):
return False
return stat.S_ISLNK(st.st_mode)
# Being true for dangling symbolic links is also useful.
def lexists(path):
"""Test whether a path exists. Returns True for broken symbolic links"""
try:
os.lstat(path)
except os.error:
return False
return True
# Are two filenames really pointing to the same file?
def samefile(f1, f2):
"""Test whether two pathnames reference the same actual file"""
s1 = os.stat(f1)
s2 = os.stat(f2)
return samestat(s1, s2)
# Are two open files really referencing the same file?
# (Not necessarily the same file descriptor!)
def sameopenfile(fp1, fp2):
"""Test whether two open file objects reference the same file"""
s1 = os.fstat(fp1)
s2 = os.fstat(fp2)
return samestat(s1, s2)
# Are two stat buffers (obtained from stat, fstat or lstat)
# describing the same file?
def samestat(s1, s2):
"""Test whether two stat buffers reference the same file"""
return s1.st_ino == s2.st_ino and \
s1.st_dev == s2.st_dev
# Is a path a mount point?
# (Does this work for all UNIXes? Is it even guaranteed to work by Posix?)
def ismount(path):
"""Test whether a path is a mount point"""
if islink(path):
# A symlink can never be a mount point
return False
try:
s1 = os.lstat(path)
s2 = os.lstat(join(path, '..'))
except os.error:
return False # It doesn't exist -- so not a mount point :-)
dev1 = s1.st_dev
dev2 = s2.st_dev
if dev1 != dev2:
return True # path/.. on a different device as path
ino1 = s1.st_ino
ino2 = s2.st_ino
if ino1 == ino2:
return True # path/.. is the same i-node as path
return False
# Directory tree walk.
# For each directory under top (including top itself, but excluding
# '.' and '..'), func(arg, dirname, filenames) is called, where
# dirname is the name of the directory and filenames is the list
# of files (and subdirectories etc.) in the directory.
# The func may modify the filenames list, to implement a filter,
# or to impose a different order of visiting.
def walk(top, func, arg):
"""Directory tree walk with callback function.
For each directory in the directory tree rooted at top (including top
itself, but excluding '.' and '..'), call func(arg, dirname, fnames).
dirname is the name of the directory, and fnames a list of the names of
the files and subdirectories in dirname (excluding '.' and '..'). func
may modify the fnames list in-place (e.g. via del or slice assignment),
and walk will only recurse into the subdirectories whose names remain in
fnames; this can be used to implement a filter, or to impose a specific
order of visiting. No semantics are defined for, or required of, arg,
beyond that arg is always passed to func. It can be used, e.g., to pass
a filename pattern, or a mutable object designed to accumulate
statistics. Passing None for arg is common."""
warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.",
stacklevel=2)
try:
names = os.listdir(top)
except os.error:
return
func(arg, top, names)
for name in names:
name = join(top, name)
try:
st = os.lstat(name)
except os.error:
continue
if stat.S_ISDIR(st.st_mode):
walk(name, func, arg)
# Expand paths beginning with '~' or '~user'.
# '~' means $HOME; '~user' means that user's home directory.
# If the path doesn't begin with '~', or if the user or $HOME is unknown,
# the path is returned unchanged (leaving error reporting to whatever
# function is called with the expanded path as argument).
# See also module 'glob' for expansion of *, ? and [...] in pathnames.
# (A function should also be defined to do full *sh-style environment
# variable expansion.)
def expanduser(path):
"""Expand ~ and ~user constructions. If user or $HOME is unknown,
do nothing."""
if not path.startswith('~'):
return path
i = path.find('/', 1)
if i < 0:
i = len(path)
if i == 1:
if 'HOME' not in os.environ:
import pwd
userhome = pwd.getpwuid(os.getuid()).pw_dir
else:
userhome = os.environ['HOME']
else:
import pwd
try:
pwent = pwd.getpwnam(path[1:i])
except KeyError:
return path
userhome = pwent.pw_dir
userhome = userhome.rstrip('/') or userhome
return userhome + path[i:]
# Expand paths containing shell variable substitutions.
# This expands the forms $variable and ${variable} only.
# Non-existent variables are left unchanged.
_varprog = None
def expandvars(path):
"""Expand shell variables of form $var and ${var}. Unknown variables
are left unchanged."""
global _varprog
if '$' not in path:
return path
if not _varprog:
import re
_varprog = re.compile(r'\$(\w+|\{[^}]*\})')
i = 0
while True:
m = _varprog.search(path, i)
if not m:
break
i, j = m.span(0)
name = m.group(1)
if name.startswith('{') and name.endswith('}'):
name = name[1:-1]
if name in os.environ:
tail = path[j:]
path = path[:i] + os.environ[name]
i = len(path)
path += tail
else:
i = j
return path
# Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.
# It should be understood that this may change the meaning of the path
# if it contains symbolic links!
def normpath(path):
"""Normalize path, eliminating double slashes, etc."""
# Preserve unicode (if path is unicode)
slash, dot = (u'/', u'.') if isinstance(path, unicode) else ('/', '.')
if path == '':
return dot
initial_slashes = path.startswith('/')
# POSIX allows one or two initial slashes, but treats three or more
# as single slash.
if (initial_slashes and
path.startswith('//') and not path.startswith('///')):
initial_slashes = 2
comps = path.split('/')
new_comps = []
for comp in comps:
if comp in ('', '.'):
continue
if (comp != '..' or (not initial_slashes and not new_comps) or
(new_comps and new_comps[-1] == '..')):
new_comps.append(comp)
elif new_comps:
new_comps.pop()
comps = new_comps
path = slash.join(comps)
if initial_slashes:
path = slash*initial_slashes + path
return path or dot
def abspath(path):
"""Return an absolute path."""
if not isabs(path):
if isinstance(path, unicode):
cwd = os.getcwdu()
else:
cwd = os.getcwd()
path = join(cwd, path)
return normpath(path)
# Return a canonical path (i.e. the absolute location of a file on the
# filesystem).
def realpath(filename):
"""Return the canonical path of the specified filename, eliminating any
symbolic links encountered in the path."""
if isabs(filename):
bits = ['/'] + filename.split('/')[1:]
else:
bits = [''] + filename.split('/')
for i in range(2, len(bits)+1):
component = join(*bits[0:i])
# Resolve symbolic links.
if islink(component):
resolved = _resolve_link(component)
if resolved is None:
# Infinite loop -- return original component + rest of the path
return abspath(join(*([component] + bits[i:])))
else:
newpath = join(*([resolved] + bits[i:]))
return realpath(newpath)
return abspath(filename)
def _resolve_link(path):
"""Internal helper function. Takes a path and follows symlinks
until we either arrive at something that isn't a symlink, or
encounter a path we've seen before (meaning that there's a loop).
"""
paths_seen = set()
while islink(path):
if path in paths_seen:
# Already seen this path, so we must have a symlink loop
return None
paths_seen.add(path)
# Resolve where the link points to
resolved = os.readlink(path)
if not isabs(resolved):
dir = dirname(path)
path = normpath(join(dir, resolved))
else:
path = normpath(resolved)
return path
supports_unicode_filenames = (sys.platform == 'darwin')
def relpath(path, start=curdir):
"""Return a relative version of a path"""
if not path:
raise ValueError("no path specified")
start_list = [x for x in abspath(start).split(sep) if x]
path_list = [x for x in abspath(path).split(sep) if x]
# Work out how much of the filepath is shared by start and path.
i = len(commonprefix([start_list, path_list]))
rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
if not rel_list:
return curdir
return join(*rel_list)
|
mit
|
[
624,
7844,
5331,
641,
4376,
4174,
931,
1247,
14,
199,
199,
13962,
13558,
402,
16306,
642,
859,
5370,
12,
492,
747,
436,
10618,
370,
199,
3749,
859,
465,
747,
14,
515,
14,
221,
710,
298,
736,
14,
515,
2,
536,
365,
376,
5162,
367,
642,
199,
578,
641,
4376,
4174,
10460,
27,
641,
1163,
10460,
334,
69,
14,
71,
14,
10444,
12,
5417,
395,
199,
736,
14,
515,
6571,
314,
2011,
5331,
315,
282,
30800,
2488,
370,
626,
199,
3246,
12,
436,
365,
376,
5162,
370,
4573,
859,
334,
69,
14,
71,
14,
4497,
515,
12,
13377,
515,
680,
199,
199,
7700,
402,
642,
883,
5965,
506,
2997,
641,
2222,
13,
1575,
4174,
10460,
4634,
12,
325,
14,
71,
14,
199,
509,
26212,
402,
314,
11776,
3931,
402,
10867,
14,
199,
624,
199,
199,
646,
747,
199,
646,
984,
199,
646,
5672,
199,
646,
7809,
515,
199,
646,
3598,
199,
504,
7809,
515,
492,
627,
199,
199,
363,
452,
363,
275,
2097,
21288,
2266,
17896,
2266,
904,
2266,
1294,
9541,
2266,
1294,
2266,
7973,
401,
1779,
298,
4846,
2266,
3475,
2266,
2330,
1861,
2266,
20733,
2266,
26628,
401,
1779,
298,
362,
27867,
2266,
362,
20691,
2266,
20719,
2266,
2444,
2266,
3113,
1670,
2266,
6027,
2266,
6292,
401,
1779,
298,
374,
3956,
2266,
7757,
2266,
12131,
2266,
4441,
2936,
2266,
9267,
2266,
4832,
401,
1779,
298,
7191,
493,
2266,
7191,
1490,
493,
2266,
7191,
3736,
401,
1779,
298,
15594,
2266,
21386,
2266,
4127,
2266,
17843,
2266,
318,
515,
2266,
4478,
4127,
2266,
832,
4127,
401,
1779,
298,
19778,
2266,
11091,
2266,
9823,
63,
2975,
63,
10309,
2266,
12405,
937,
199,
199,
3,
3326,
6144,
7750,
931,
13,
2407,
5821,
436,
10338,
199,
15594,
275,
7815,
199,
21386,
275,
11541,
7,
199,
832,
4127,
275,
7815,
199,
4127,
275,
7324,
199,
17843,
275,
10871,
199,
318,
515,
275,
7596,
15,
1393,
11254,
2647,
15,
1393,
7,
199,
4478,
4127,
275,
488,
199,
19778,
275,
1994,
2374,
15,
2307,
7,
199,
199,
3,
21017,
314,
1930,
402,
282,
11776,
14,
221,
12480,
15652,
315,
4376,
4174,
12,
1059,
14,
2325,
641,
10444,
14,
199,
3,
4068,
14282,
13,
32735,
642,
1443,
2597,
7485,
20275,
1901,
23396,
27,
13432,
12,
1163,
199,
3,
3293,
12270,
334,
10180,
465,
5323,
9147,
11541,
4805,
13437,
9,
787,
440,
4370,
199,
3,
334,
13565,
805,
1077,
506,
3247,
370,
886,
626,
680,
199,
199,
318,
6316,
2546,
8,
83,
304,
272,
408,
22580,
1930,
402,
11776,
14,
221,
13481,
949,
7763,
1334,
4376,
4174,
624,
272,
372,
308,
421,
199,
3,
1432,
3775,
282,
931,
365,
3679,
14,
199,
3,
12480,
15652,
315,
4376,
4174,
12,
12159,
424,
641,
314,
10444,
503,
14282,
13,
32735,
14,
199,
199,
318,
365,
2101,
8,
83,
304,
272,
408,
774,
3775,
282,
931,
365,
3679,
624,
272,
372,
308,
14,
2460,
7825,
421,
199,
3,
25733,
931,
1247,
14,
199,
3,
14092,
314,
4136,
4184,
340,
282,
1777,
365,
3679,
14,
199,
3,
15496,
282,
7324,
7444,
314,
1642,
1777,
365,
2701,
503,
2575,
11187,
315,
20538,
199,
199,
318,
4263,
8,
65,
12,
627,
80,
304,
272,
408,
13005,
2877,
503,
1655,
11776,
7323,
12,
28498,
7324,
465,
4346,
14,
272,
982,
1263,
3931,
365,
376,
3679,
931,
12,
1006,
4136,
931,
7323,
272,
911,
506,
22002,
1041,
272,
931,
275,
282,
272,
367,
330,
315,
299,
26,
267,
340,
330,
14,
2460,
18265,
288,
931,
275,
330,
267,
916,
931,
508,
2125,
503,
931,
14,
4130,
18265,
288,
931,
847,
221,
330,
267,
587,
26,
288,
931,
847,
7324,
435,
330,
272,
372,
931,
421,
199,
3,
11740,
282,
931,
315,
4854,
334,
14287,
2127,
1536,
370,
314,
2061,
15107,
436,
9483,
334,
1589,
199,
3,
4618,
680,
221,
982,
314,
931,
11187,
315,
17220,
9483,
911,
506,
2701,
14,
221,
982,
2337,
365,
949,
199,
3,
7324,
315,
314,
931,
12,
4854,
221,
911,
506,
2701,
14,
199,
3,
12643,
5662,
7324,
397,
787,
14489,
687,
4854,
7444,
652,
365,
314,
1738,
14,
199,
199,
318,
3715,
8,
80,
304,
272,
408,
8862,
282,
11776,
14,
221,
1803,
2008,
7340,
2993,
12,
9483,
2924,
2382,
298,
1521,
2,
365,
272,
8137,
2410,
314,
4242,
14457,
14,
221,
13083,
1777,
1443,
506,
2701,
1041,
272,
284,
275,
299,
14,
14542,
7825,
435,
413,
272,
4854,
12,
9483,
275,
299,
1491,
73,
467,
299,
59,
73,
2938,
272,
340,
4854,
436,
4854,
1137,
7324,
10,
552,
8,
2993,
304,
267,
4854,
275,
4854,
14,
6735,
7825,
272,
372,
4854,
12,
9483,
421,
199,
3,
11740,
282,
931,
315,
1738,
436,
3329,
14,
199,
3,
710,
3329,
365,
8137,
6617,
737,
314,
2061,
6308,
315,
314,
2061,
199,
3,
11776,
3931,
27,
314,
1738,
365,
8137,
2544,
626,
14,
199,
3,
2779,
365,
3544,
2549,
626,
1738,
435,
1599,
508,
299,
14,
199,
199,
318,
2249,
7699,
8,
80,
304,
272,
372,
7809,
515,
423,
7973,
8,
80,
12,
7375,
12,
8791,
4127,
12,
1599,
4127,
9,
199,
7973,
855,
1301,
363,
275,
7809,
515,
423,
7973,
855,
1301,
363,
199,
199,
3,
11740,
282,
11776,
1901,
282,
12912,
8929,
436,
314,
4618,
402,
314,
199,
3,
931,
14,
221,
18491,
641,
577,
3100,
15,
8647,
15,
12460,
27,
641,
13074,
12,
314,
12912,
365,
3544,
2701,
14,
199,
199,
318,
3715,
9541,
8,
80,
304,
272,
408,
8862,
282,
11776,
1901,
12912,
436,
931,
14,
4068,
4376,
4174,
12,
12912,
365,
3544,
272,
2701,
1041,
272,
372,
3260,
299,
421,
199,
3,
1432,
314,
9483,
334,
4846,
9,
1777,
402,
282,
931,
12,
2011,
465,
3715,
8,
515,
2788,
17,
1055,
199,
199,
318,
9593,
8,
80,
304,
272,
408,
3407,
314,
4242,
3931,
402,
282,
11776,
624,
272,
284,
275,
299,
14,
14542,
7825,
435,
413,
272,
372,
299,
59,
73,
2938,
421,
199,
3,
1432,
314,
4854,
334,
3475,
9,
1777,
402,
282,
931,
12,
2011,
465,
3715,
8,
515,
2788,
16,
1055,
199,
199,
318,
9017,
8,
80,
304,
272,
408,
3407,
314,
2082,
3931,
402,
282,
11776,
624,
272,
284,
275,
299,
14,
14542,
7825,
435,
413,
272,
4854,
275,
299,
1491,
73,
61,
272,
340,
4854,
436,
4854
] |
[
7844,
5331,
641,
4376,
4174,
931,
1247,
14,
199,
199,
13962,
13558,
402,
16306,
642,
859,
5370,
12,
492,
747,
436,
10618,
370,
199,
3749,
859,
465,
747,
14,
515,
14,
221,
710,
298,
736,
14,
515,
2,
536,
365,
376,
5162,
367,
642,
199,
578,
641,
4376,
4174,
10460,
27,
641,
1163,
10460,
334,
69,
14,
71,
14,
10444,
12,
5417,
395,
199,
736,
14,
515,
6571,
314,
2011,
5331,
315,
282,
30800,
2488,
370,
626,
199,
3246,
12,
436,
365,
376,
5162,
370,
4573,
859,
334,
69,
14,
71,
14,
4497,
515,
12,
13377,
515,
680,
199,
199,
7700,
402,
642,
883,
5965,
506,
2997,
641,
2222,
13,
1575,
4174,
10460,
4634,
12,
325,
14,
71,
14,
199,
509,
26212,
402,
314,
11776,
3931,
402,
10867,
14,
199,
624,
199,
199,
646,
747,
199,
646,
984,
199,
646,
5672,
199,
646,
7809,
515,
199,
646,
3598,
199,
504,
7809,
515,
492,
627,
199,
199,
363,
452,
363,
275,
2097,
21288,
2266,
17896,
2266,
904,
2266,
1294,
9541,
2266,
1294,
2266,
7973,
401,
1779,
298,
4846,
2266,
3475,
2266,
2330,
1861,
2266,
20733,
2266,
26628,
401,
1779,
298,
362,
27867,
2266,
362,
20691,
2266,
20719,
2266,
2444,
2266,
3113,
1670,
2266,
6027,
2266,
6292,
401,
1779,
298,
374,
3956,
2266,
7757,
2266,
12131,
2266,
4441,
2936,
2266,
9267,
2266,
4832,
401,
1779,
298,
7191,
493,
2266,
7191,
1490,
493,
2266,
7191,
3736,
401,
1779,
298,
15594,
2266,
21386,
2266,
4127,
2266,
17843,
2266,
318,
515,
2266,
4478,
4127,
2266,
832,
4127,
401,
1779,
298,
19778,
2266,
11091,
2266,
9823,
63,
2975,
63,
10309,
2266,
12405,
937,
199,
199,
3,
3326,
6144,
7750,
931,
13,
2407,
5821,
436,
10338,
199,
15594,
275,
7815,
199,
21386,
275,
11541,
7,
199,
832,
4127,
275,
7815,
199,
4127,
275,
7324,
199,
17843,
275,
10871,
199,
318,
515,
275,
7596,
15,
1393,
11254,
2647,
15,
1393,
7,
199,
4478,
4127,
275,
488,
199,
19778,
275,
1994,
2374,
15,
2307,
7,
199,
199,
3,
21017,
314,
1930,
402,
282,
11776,
14,
221,
12480,
15652,
315,
4376,
4174,
12,
1059,
14,
2325,
641,
10444,
14,
199,
3,
4068,
14282,
13,
32735,
642,
1443,
2597,
7485,
20275,
1901,
23396,
27,
13432,
12,
1163,
199,
3,
3293,
12270,
334,
10180,
465,
5323,
9147,
11541,
4805,
13437,
9,
787,
440,
4370,
199,
3,
334,
13565,
805,
1077,
506,
3247,
370,
886,
626,
680,
199,
199,
318,
6316,
2546,
8,
83,
304,
272,
408,
22580,
1930,
402,
11776,
14,
221,
13481,
949,
7763,
1334,
4376,
4174,
624,
272,
372,
308,
421,
199,
3,
1432,
3775,
282,
931,
365,
3679,
14,
199,
3,
12480,
15652,
315,
4376,
4174,
12,
12159,
424,
641,
314,
10444,
503,
14282,
13,
32735,
14,
199,
199,
318,
365,
2101,
8,
83,
304,
272,
408,
774,
3775,
282,
931,
365,
3679,
624,
272,
372,
308,
14,
2460,
7825,
421,
199,
3,
25733,
931,
1247,
14,
199,
3,
14092,
314,
4136,
4184,
340,
282,
1777,
365,
3679,
14,
199,
3,
15496,
282,
7324,
7444,
314,
1642,
1777,
365,
2701,
503,
2575,
11187,
315,
20538,
199,
199,
318,
4263,
8,
65,
12,
627,
80,
304,
272,
408,
13005,
2877,
503,
1655,
11776,
7323,
12,
28498,
7324,
465,
4346,
14,
272,
982,
1263,
3931,
365,
376,
3679,
931,
12,
1006,
4136,
931,
7323,
272,
911,
506,
22002,
1041,
272,
931,
275,
282,
272,
367,
330,
315,
299,
26,
267,
340,
330,
14,
2460,
18265,
288,
931,
275,
330,
267,
916,
931,
508,
2125,
503,
931,
14,
4130,
18265,
288,
931,
847,
221,
330,
267,
587,
26,
288,
931,
847,
7324,
435,
330,
272,
372,
931,
421,
199,
3,
11740,
282,
931,
315,
4854,
334,
14287,
2127,
1536,
370,
314,
2061,
15107,
436,
9483,
334,
1589,
199,
3,
4618,
680,
221,
982,
314,
931,
11187,
315,
17220,
9483,
911,
506,
2701,
14,
221,
982,
2337,
365,
949,
199,
3,
7324,
315,
314,
931,
12,
4854,
221,
911,
506,
2701,
14,
199,
3,
12643,
5662,
7324,
397,
787,
14489,
687,
4854,
7444,
652,
365,
314,
1738,
14,
199,
199,
318,
3715,
8,
80,
304,
272,
408,
8862,
282,
11776,
14,
221,
1803,
2008,
7340,
2993,
12,
9483,
2924,
2382,
298,
1521,
2,
365,
272,
8137,
2410,
314,
4242,
14457,
14,
221,
13083,
1777,
1443,
506,
2701,
1041,
272,
284,
275,
299,
14,
14542,
7825,
435,
413,
272,
4854,
12,
9483,
275,
299,
1491,
73,
467,
299,
59,
73,
2938,
272,
340,
4854,
436,
4854,
1137,
7324,
10,
552,
8,
2993,
304,
267,
4854,
275,
4854,
14,
6735,
7825,
272,
372,
4854,
12,
9483,
421,
199,
3,
11740,
282,
931,
315,
1738,
436,
3329,
14,
199,
3,
710,
3329,
365,
8137,
6617,
737,
314,
2061,
6308,
315,
314,
2061,
199,
3,
11776,
3931,
27,
314,
1738,
365,
8137,
2544,
626,
14,
199,
3,
2779,
365,
3544,
2549,
626,
1738,
435,
1599,
508,
299,
14,
199,
199,
318,
2249,
7699,
8,
80,
304,
272,
372,
7809,
515,
423,
7973,
8,
80,
12,
7375,
12,
8791,
4127,
12,
1599,
4127,
9,
199,
7973,
855,
1301,
363,
275,
7809,
515,
423,
7973,
855,
1301,
363,
199,
199,
3,
11740,
282,
11776,
1901,
282,
12912,
8929,
436,
314,
4618,
402,
314,
199,
3,
931,
14,
221,
18491,
641,
577,
3100,
15,
8647,
15,
12460,
27,
641,
13074,
12,
314,
12912,
365,
3544,
2701,
14,
199,
199,
318,
3715,
9541,
8,
80,
304,
272,
408,
8862,
282,
11776,
1901,
12912,
436,
931,
14,
4068,
4376,
4174,
12,
12912,
365,
3544,
272,
2701,
1041,
272,
372,
3260,
299,
421,
199,
3,
1432,
314,
9483,
334,
4846,
9,
1777,
402,
282,
931,
12,
2011,
465,
3715,
8,
515,
2788,
17,
1055,
199,
199,
318,
9593,
8,
80,
304,
272,
408,
3407,
314,
4242,
3931,
402,
282,
11776,
624,
272,
284,
275,
299,
14,
14542,
7825,
435,
413,
272,
372,
299,
59,
73,
2938,
421,
199,
3,
1432,
314,
4854,
334,
3475,
9,
1777,
402,
282,
931,
12,
2011,
465,
3715,
8,
515,
2788,
16,
1055,
199,
199,
318,
9017,
8,
80,
304,
272,
408,
3407,
314,
2082,
3931,
402,
282,
11776,
624,
272,
284,
275,
299,
14,
14542,
7825,
435,
413,
272,
4854,
275,
299,
1491,
73,
61,
272,
340,
4854,
436,
4854,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
julian-seward1/servo
|
tests/wpt/css-tests/tools/wptserve/wptserve/server.py
|
87
|
17881
|
import BaseHTTPServer
import errno
import os
import socket
from SocketServer import ThreadingMixIn
import ssl
import sys
import threading
import time
import traceback
import types
import urlparse
from . import routes as default_routes
from .logger import get_logger
from .request import Server, Request
from .response import Response
from .router import Router
from .utils import HTTPException
"""HTTP server designed for testing purposes.
The server is designed to provide flexibility in the way that
requests are handled, and to provide control both of exactly
what bytes are put on the wire for the response, and in the
timing of sending those bytes.
The server is based on the stdlib HTTPServer, but with some
notable differences in the way that requests are processed.
Overall processing is handled by a WebTestRequestHandler,
which is a subclass of BaseHTTPRequestHandler. This is responsible
for parsing the incoming request. A RequestRewriter is then
applied and may change the request data if it matches a
supplied rule.
Once the request data had been finalised, Request and Reponse
objects are constructed. These are used by the other parts of the
system to read information about the request and manipulate the
response.
Each request is handled by a particular handler function. The
mapping between Request and the appropriate handler is determined
by a Router. By default handlers are installed to interpret files
under the document root with .py extensions as executable python
files (see handlers.py for the api for such files), .asis files as
bytestreams to be sent literally and all other files to be served
statically.
The handler functions are responsible for either populating the
fields of the response object, which will then be written when the
handler returns, or for directly writing to the output stream.
"""
class RequestRewriter(object):
def __init__(self, rules):
"""Object for rewriting the request path.
:param rules: Initial rules to add; a list of three item tuples
(method, input_path, output_path), defined as for
register()
"""
self.rules = {}
for rule in reversed(rules):
self.register(*rule)
self.logger = get_logger()
def register(self, methods, input_path, output_path):
"""Register a rewrite rule.
:param methods: Set of methods this should match. "*" is a
special value indicating that all methods should
be matched.
:param input_path: Path to match for the initial request.
:param output_path: Path to replace the input path with in
the request.
"""
if type(methods) in types.StringTypes:
methods = [methods]
self.rules[input_path] = (methods, output_path)
def rewrite(self, request_handler):
"""Rewrite the path in a BaseHTTPRequestHandler instance, if
it matches a rule.
:param request_handler: BaseHTTPRequestHandler for which to
rewrite the request.
"""
split_url = urlparse.urlsplit(request_handler.path)
if split_url.path in self.rules:
methods, destination = self.rules[split_url.path]
if "*" in methods or request_handler.command in methods:
self.logger.debug("Rewriting request path %s to %s" %
(request_handler.path, destination))
new_url = list(split_url)
new_url[2] = destination
new_url = urlparse.urlunsplit(new_url)
request_handler.path = new_url
class WebTestServer(ThreadingMixIn, BaseHTTPServer.HTTPServer):
allow_reuse_address = True
acceptable_errors = (errno.EPIPE, errno.ECONNABORTED)
request_queue_size = 2000
# Ensure that we don't hang on shutdown waiting for requests
daemon_threads = True
def __init__(self, server_address, RequestHandlerClass, router, rewriter, bind_hostname,
config=None, use_ssl=False, key_file=None, certificate=None,
encrypt_after_connect=False, latency=None, **kwargs):
"""Server for HTTP(s) Requests
:param server_address: tuple of (server_name, port)
:param RequestHandlerClass: BaseHTTPRequestHandler-like class to use for
handling requests.
:param router: Router instance to use for matching requests to handler
functions
:param rewriter: RequestRewriter-like instance to use for preprocessing
requests before they are routed
:param config: Dictionary holding environment configuration settings for
handlers to read, or None to use the default values.
:param use_ssl: Boolean indicating whether the server should use SSL
:param key_file: Path to key file to use if SSL is enabled.
:param certificate: Path to certificate to use if SSL is enabled.
:param encrypt_after_connect: For each connection, don't start encryption
until a CONNECT message has been received.
This enables the server to act as a
self-proxy.
:param bind_hostname True to bind the server to both the hostname and
port specified in the server_address parameter.
False to bind the server only to the port in the
server_address parameter, but not to the hostname.
:param latency: Delay in ms to wait before seving each response, or
callable that returns a delay in ms
"""
self.router = router
self.rewriter = rewriter
self.scheme = "https" if use_ssl else "http"
self.logger = get_logger()
self.latency = latency
if bind_hostname:
hostname_port = server_address
else:
hostname_port = ("",server_address[1])
#super doesn't work here because BaseHTTPServer.HTTPServer is old-style
BaseHTTPServer.HTTPServer.__init__(self, hostname_port, RequestHandlerClass, **kwargs)
if config is not None:
Server.config = config
else:
self.logger.debug("Using default configuration")
Server.config = {"host": server_address[0],
"domains": {"": server_address[0]},
"ports": {"http": [self.server_address[1]]}}
self.key_file = key_file
self.certificate = certificate
self.encrypt_after_connect = use_ssl and encrypt_after_connect
if use_ssl and not encrypt_after_connect:
self.socket = ssl.wrap_socket(self.socket,
keyfile=self.key_file,
certfile=self.certificate,
server_side=True)
def handle_error(self, request, client_address):
error = sys.exc_info()[1]
if ((isinstance(error, socket.error) and
isinstance(error.args, tuple) and
error.args[0] in self.acceptable_errors) or
(isinstance(error, IOError) and
error.errno in self.acceptable_errors)):
pass # remote hang up before the result is sent
else:
self.logger.error(traceback.format_exc())
class WebTestRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""RequestHandler for WebTestHttpd"""
protocol_version = "HTTP/1.1"
def handle_one_request(self):
response = None
self.logger = get_logger()
try:
self.close_connection = False
request_line_is_valid = self.get_request_line()
if self.close_connection:
return
request_is_valid = self.parse_request()
if not request_is_valid:
#parse_request() actually sends its own error responses
return
self.server.rewriter.rewrite(self)
request = Request(self)
response = Response(self, request)
if request.method == "CONNECT":
self.handle_connect(response)
return
if not request_line_is_valid:
response.set_error(414)
response.write()
return
self.logger.debug("%s %s" % (request.method, request.request_path))
handler = self.server.router.get_handler(request)
# If the handler we used for the request had a non-default base path
# set update the doc_root of the request to reflect this
if hasattr(handler, "base_path") and handler.base_path:
request.doc_root = handler.base_path
if hasattr(handler, "url_base") and handler.url_base != "/":
request.url_base = handler.url_base
if self.server.latency is not None:
if callable(self.server.latency):
latency = self.server.latency()
else:
latency = self.server.latency
self.logger.warning("Latency enabled. Sleeping %i ms" % latency)
time.sleep(latency / 1000.)
if handler is None:
response.set_error(404)
else:
try:
handler(request, response)
except HTTPException as e:
response.set_error(e.code, e.message)
except Exception as e:
if e.message:
err = [e.message]
else:
err = []
err.append(traceback.format_exc())
response.set_error(500, "\n".join(err))
self.logger.debug("%i %s %s (%s) %i" % (response.status[0],
request.method,
request.request_path,
request.headers.get('Referer'),
request.raw_input.length))
if not response.writer.content_written:
response.write()
# If we want to remove this in the future, a solution is needed for
# scripts that produce a non-string iterable of content, since these
# can't set a Content-Length header. A notable example of this kind of
# problem is with the trickle pipe i.e. foo.js?pipe=trickle(d1)
if response.close_connection:
self.close_connection = True
if not self.close_connection:
# Ensure that the whole request has been read from the socket
request.raw_input.read()
except socket.timeout as e:
self.log_error("Request timed out: %r", e)
self.close_connection = True
return
except Exception as e:
err = traceback.format_exc()
if response:
response.set_error(500, err)
response.write()
self.logger.error(err)
def get_request_line(self):
try:
self.raw_requestline = self.rfile.readline(65537)
except socket.error:
self.close_connection = True
return False
if len(self.raw_requestline) > 65536:
self.requestline = ''
self.request_version = ''
self.command = ''
return False
if not self.raw_requestline:
self.close_connection = True
return True
def handle_connect(self, response):
self.logger.debug("Got CONNECT")
response.status = 200
response.write()
if self.server.encrypt_after_connect:
self.logger.debug("Enabling SSL for connection")
self.request = ssl.wrap_socket(self.connection,
keyfile=self.server.key_file,
certfile=self.server.certificate,
server_side=True)
self.setup()
return
class WebTestHttpd(object):
"""
:param host: Host from which to serve (default: 127.0.0.1)
:param port: Port from which to serve (default: 8000)
:param server_cls: Class to use for the server (default depends on ssl vs non-ssl)
:param handler_cls: Class to use for the RequestHandler
:param use_ssl: Use a SSL server if no explicit server_cls is supplied
:param key_file: Path to key file to use if ssl is enabled
:param certificate: Path to certificate file to use if ssl is enabled
:param encrypt_after_connect: For each connection, don't start encryption
until a CONNECT message has been received.
This enables the server to act as a
self-proxy.
:param router_cls: Router class to use when matching URLs to handlers
:param doc_root: Document root for serving files
:param routes: List of routes with which to initialize the router
:param rewriter_cls: Class to use for request rewriter
:param rewrites: List of rewrites with which to initialize the rewriter_cls
:param config: Dictionary holding environment configuration settings for
handlers to read, or None to use the default values.
:param bind_hostname: Boolean indicating whether to bind server to hostname.
:param latency: Delay in ms to wait before seving each response, or
callable that returns a delay in ms
HTTP server designed for testing scenarios.
Takes a router class which provides one method get_handler which takes a Request
and returns a handler function.
.. attribute:: host
The host name or ip address of the server
.. attribute:: port
The port on which the server is running
.. attribute:: router
The Router object used to associate requests with resources for this server
.. attribute:: rewriter
The Rewriter object used for URL rewriting
.. attribute:: use_ssl
Boolean indicating whether the server is using ssl
.. attribute:: started
Boolean indictaing whether the server is running
"""
def __init__(self, host="127.0.0.1", port=8000,
server_cls=None, handler_cls=WebTestRequestHandler,
use_ssl=False, key_file=None, certificate=None, encrypt_after_connect=False,
router_cls=Router, doc_root=os.curdir, routes=None,
rewriter_cls=RequestRewriter, bind_hostname=True, rewrites=None,
latency=None, config=None):
if routes is None:
routes = default_routes.routes
self.host = host
self.router = router_cls(doc_root, routes)
self.rewriter = rewriter_cls(rewrites if rewrites is not None else [])
self.use_ssl = use_ssl
self.logger = get_logger()
if server_cls is None:
server_cls = WebTestServer
if use_ssl:
if key_file is not None:
assert os.path.exists(key_file)
assert certificate is not None and os.path.exists(certificate)
try:
self.httpd = server_cls((host, port),
handler_cls,
self.router,
self.rewriter,
config=config,
bind_hostname=bind_hostname,
use_ssl=use_ssl,
key_file=key_file,
certificate=certificate,
encrypt_after_connect=encrypt_after_connect,
latency=latency)
self.started = False
_host, self.port = self.httpd.socket.getsockname()
except Exception:
self.logger.error('Init failed! You may need to modify your hosts file. Refer to README.md.')
raise
def start(self, block=False):
"""Start the server.
:param block: True to run the server on the current thread, blocking,
False to run on a separate thread."""
self.logger.info("Starting http server on %s:%s" % (self.host, self.port))
self.started = True
if block:
self.httpd.serve_forever()
else:
self.server_thread = threading.Thread(target=self.httpd.serve_forever)
self.server_thread.setDaemon(True) # don't hang on exit
self.server_thread.start()
def stop(self):
"""
Stops the server.
If the server is not running, this method has no effect.
"""
if self.started:
try:
self.httpd.shutdown()
self.httpd.server_close()
self.server_thread.join()
self.server_thread = None
self.logger.info("Stopped http server on %s:%s" % (self.host, self.port))
except AttributeError:
pass
self.started = False
self.httpd = None
def get_url(self, path="/", query=None, fragment=None):
if not self.started:
return None
return urlparse.urlunsplit(("http" if not self.use_ssl else "https",
"%s:%s" % (self.host, self.port),
path, query, fragment))
|
mpl-2.0
|
[
646,
3523,
14938,
199,
646,
7554,
199,
646,
747,
199,
646,
2838,
199,
504,
17766,
3120,
492,
11086,
316,
26527,
199,
646,
6149,
199,
646,
984,
199,
646,
5796,
199,
646,
900,
199,
646,
5190,
199,
646,
2943,
199,
646,
7097,
199,
199,
504,
1275,
492,
15777,
465,
849,
63,
13243,
199,
504,
1275,
2921,
492,
664,
63,
2921,
199,
504,
1275,
1069,
492,
7146,
12,
4784,
199,
504,
1275,
1310,
492,
7232,
199,
504,
1275,
4995,
492,
22708,
199,
504,
1275,
1208,
492,
28185,
421,
199,
624,
2856,
1654,
19829,
367,
5343,
12901,
14,
199,
199,
1918,
1654,
365,
19829,
370,
5647,
20758,
29524,
315,
314,
4340,
626,
199,
6615,
787,
8860,
12,
436,
370,
5647,
3304,
3865,
402,
8840,
199,
10058,
2783,
787,
5324,
641,
314,
11799,
367,
314,
1177,
12,
436,
315,
314,
199,
14639,
402,
10209,
5204,
2783,
14,
199,
199,
1918,
1654,
365,
4079,
641,
314,
26678,
3101,
3120,
12,
1325,
543,
2005,
199,
1397,
461,
15109,
315,
314,
4340,
626,
4145,
787,
7686,
14,
199,
5674,
452,
6661,
365,
8860,
701,
282,
6001,
774,
11149,
12,
199,
6777,
365,
282,
5516,
402,
3523,
23518,
14,
961,
365,
17845,
199,
509,
6057,
314,
12467,
1056,
14,
437,
4784,
497,
5491,
365,
2066,
199,
17250,
436,
1443,
1570,
314,
1056,
666,
340,
652,
4450,
282,
199,
22525,
2332,
14,
199,
199,
25690,
314,
1056,
666,
10530,
2757,
4242,
9096,
12,
4784,
436,
799,
732,
199,
1462,
787,
14701,
14,
5723,
787,
1202,
701,
314,
1163,
4184,
402,
314,
199,
2253,
370,
1586,
2556,
3595,
314,
1056,
436,
27232,
314,
199,
1310,
14,
199,
199,
22321,
1056,
365,
8860,
701,
282,
6770,
3016,
805,
14,
710,
199,
4745,
3382,
4784,
436,
314,
5827,
3016,
365,
12037,
199,
991,
282,
22708,
14,
4885,
849,
8297,
787,
4903,
370,
15579,
1584,
199,
7138,
314,
2213,
1738,
543,
1275,
647,
5478,
465,
7286,
2366,
199,
1725,
334,
3239,
8297,
14,
647,
367,
314,
2986,
367,
4066,
1584,
395,
1275,
4864,
1584,
465,
199,
991,
396,
1091,
83,
370,
506,
4847,
7142,
1183,
436,
1006,
1163,
1584,
370,
506,
19733,
199,
1986,
1183,
14,
199,
199,
1918,
3016,
3423,
787,
17845,
367,
1902,
4560,
20529,
314,
199,
955,
402,
314,
1177,
909,
12,
1314,
911,
2066,
506,
5313,
1380,
314,
199,
2232,
2529,
12,
503,
367,
5370,
3575,
370,
314,
1072,
2547,
14,
199,
624,
421,
199,
533,
4784,
497,
5491,
8,
785,
304,
272,
347,
636,
826,
721,
277,
12,
4713,
304,
267,
408,
1692,
367,
295,
14827,
314,
1056,
931,
14,
398,
520,
635,
4713,
26,
6026,
4713,
370,
1050,
27,
282,
769,
402,
7795,
1242,
6346,
1993,
334,
765,
12,
1324,
63,
515,
12,
1072,
63,
515,
395,
3247,
465,
367,
1993,
2274,
342,
267,
408,
267,
291,
14,
4423,
275,
1052,
267,
367,
2332,
315,
10822,
8,
4423,
304,
288,
291,
14,
2683,
2031,
2200,
9,
267,
291,
14,
2921,
275,
664,
63,
2921,
342,
339,
347,
2274,
8,
277,
12,
3102,
12,
1324,
63,
515,
12,
1072,
63,
515,
304,
267,
408,
7099,
282,
19913,
2332,
14,
398,
520,
635,
3102,
26,
2494,
402,
3102,
642,
1077,
1336,
14,
22423,
365,
282,
717,
4539,
574,
9297,
626,
1006,
3102,
1077,
717,
506,
7838,
14,
398,
520,
635,
1324,
63,
515,
26,
6912,
370,
1336,
367,
314,
2536,
1056,
14,
398,
520,
635,
1072,
63,
515,
26,
6912,
370,
3350,
314,
1324,
931,
543,
315,
1169,
314,
1056,
14,
267,
408,
267,
340,
730,
8,
2474,
9,
315,
2943,
14,
1558,
4100,
26,
288,
3102,
275,
359,
2474,
61,
267,
291,
14,
4423,
59,
1210,
63,
515,
61,
275,
334,
2474,
12,
1072,
63,
515,
9,
339,
347,
19913,
8,
277,
12,
1056,
63,
2232,
304,
267,
408,
497,
952,
314,
931,
315,
282,
3523,
23518,
1256,
12,
340,
1779,
652,
4450,
282,
2332,
14,
398,
520,
635,
1056,
63,
2232,
26,
3523,
23518,
367,
1314,
370,
1816,
19913,
314,
1056,
14,
267,
408,
267,
3715,
63,
633,
275,
7097,
14,
29491,
8,
1069,
63,
2232,
14,
515,
9,
267,
340,
3715,
63,
633,
14,
515,
315,
291,
14,
4423,
26,
288,
3102,
12,
5724,
275,
291,
14,
4423,
59,
1294,
63,
633,
14,
515,
61,
288,
340,
22423,
315,
3102,
503,
1056,
63,
2232,
14,
1531,
315,
3102,
26,
355,
291,
14,
2921,
14,
1757,
480,
497,
14827,
1056,
931,
450,
83,
370,
450,
83,
2,
450,
2490,
334,
1069,
63,
2232,
14,
515,
12,
5724,
430,
355,
892,
63,
633,
275,
769,
8,
1294,
63,
633,
9,
355,
892,
63,
633,
59,
18,
61,
275,
5724,
355,
892,
63,
633,
275,
7097,
14,
633,
30038,
8,
1222,
63,
633,
9,
355,
1056,
63,
2232,
14,
515,
275,
892,
63,
633,
421,
199,
533,
6001,
774,
3120,
8,
4436,
316,
26527,
12,
3523,
14938,
14,
14938,
304,
272,
2040,
63,
15712,
63,
1562,
275,
715,
272,
14712,
63,
2550,
275,
334,
7931,
14,
37,
6089,
12,
7554,
14,
37,
17489,
27113,
1149,
9,
272,
1056,
63,
1825,
63,
890,
275,
12293,
339,
327,
7523,
626,
781,
2793,
1133,
30084,
641,
12842,
10923,
367,
4145,
272,
11128,
63,
6962,
275,
715,
339,
347,
636,
826,
721,
277,
12,
1654,
63,
1562,
12,
4784,
2461,
2543,
12,
6197,
12,
295,
5491,
12,
5398,
63,
4269,
12,
326,
1101,
29,
403,
12,
675,
63,
4266,
29,
797,
12,
790,
63,
493,
29,
403,
12,
5897,
29,
403,
12,
326,
14645,
63,
4399,
63,
2242,
29,
797,
12,
23967,
29,
403,
12,
1011,
958,
304,
267,
408,
3120,
367,
3101,
8,
83,
9,
20260,
398,
520,
635,
1654,
63,
1562,
26,
2008,
402,
334,
1000,
63,
354,
12,
1844,
9,
398,
520,
635,
4784,
2461,
2543,
26,
3523,
23518,
13,
2930,
1021,
370,
675,
367,
2511,
7252,
4145,
14,
398,
520,
635,
6197,
26,
22708,
1256,
370,
675,
367,
4877,
4145,
370,
3016,
2432,
3423,
398,
520,
635,
295,
5491,
26,
4784,
497,
5491,
13,
2930,
1256,
370,
675,
367,
26471,
586,
4145,
2544,
2985,
787,
882,
4241,
398,
520,
635,
1101,
26,
11932,
17573,
3734,
2897,
2202,
367,
2432,
8297,
370,
1586,
12,
503,
488,
370,
675,
314,
849,
1338,
14,
398,
520
] |
[
3523,
14938,
199,
646,
7554,
199,
646,
747,
199,
646,
2838,
199,
504,
17766,
3120,
492,
11086,
316,
26527,
199,
646,
6149,
199,
646,
984,
199,
646,
5796,
199,
646,
900,
199,
646,
5190,
199,
646,
2943,
199,
646,
7097,
199,
199,
504,
1275,
492,
15777,
465,
849,
63,
13243,
199,
504,
1275,
2921,
492,
664,
63,
2921,
199,
504,
1275,
1069,
492,
7146,
12,
4784,
199,
504,
1275,
1310,
492,
7232,
199,
504,
1275,
4995,
492,
22708,
199,
504,
1275,
1208,
492,
28185,
421,
199,
624,
2856,
1654,
19829,
367,
5343,
12901,
14,
199,
199,
1918,
1654,
365,
19829,
370,
5647,
20758,
29524,
315,
314,
4340,
626,
199,
6615,
787,
8860,
12,
436,
370,
5647,
3304,
3865,
402,
8840,
199,
10058,
2783,
787,
5324,
641,
314,
11799,
367,
314,
1177,
12,
436,
315,
314,
199,
14639,
402,
10209,
5204,
2783,
14,
199,
199,
1918,
1654,
365,
4079,
641,
314,
26678,
3101,
3120,
12,
1325,
543,
2005,
199,
1397,
461,
15109,
315,
314,
4340,
626,
4145,
787,
7686,
14,
199,
5674,
452,
6661,
365,
8860,
701,
282,
6001,
774,
11149,
12,
199,
6777,
365,
282,
5516,
402,
3523,
23518,
14,
961,
365,
17845,
199,
509,
6057,
314,
12467,
1056,
14,
437,
4784,
497,
5491,
365,
2066,
199,
17250,
436,
1443,
1570,
314,
1056,
666,
340,
652,
4450,
282,
199,
22525,
2332,
14,
199,
199,
25690,
314,
1056,
666,
10530,
2757,
4242,
9096,
12,
4784,
436,
799,
732,
199,
1462,
787,
14701,
14,
5723,
787,
1202,
701,
314,
1163,
4184,
402,
314,
199,
2253,
370,
1586,
2556,
3595,
314,
1056,
436,
27232,
314,
199,
1310,
14,
199,
199,
22321,
1056,
365,
8860,
701,
282,
6770,
3016,
805,
14,
710,
199,
4745,
3382,
4784,
436,
314,
5827,
3016,
365,
12037,
199,
991,
282,
22708,
14,
4885,
849,
8297,
787,
4903,
370,
15579,
1584,
199,
7138,
314,
2213,
1738,
543,
1275,
647,
5478,
465,
7286,
2366,
199,
1725,
334,
3239,
8297,
14,
647,
367,
314,
2986,
367,
4066,
1584,
395,
1275,
4864,
1584,
465,
199,
991,
396,
1091,
83,
370,
506,
4847,
7142,
1183,
436,
1006,
1163,
1584,
370,
506,
19733,
199,
1986,
1183,
14,
199,
199,
1918,
3016,
3423,
787,
17845,
367,
1902,
4560,
20529,
314,
199,
955,
402,
314,
1177,
909,
12,
1314,
911,
2066,
506,
5313,
1380,
314,
199,
2232,
2529,
12,
503,
367,
5370,
3575,
370,
314,
1072,
2547,
14,
199,
624,
421,
199,
533,
4784,
497,
5491,
8,
785,
304,
272,
347,
636,
826,
721,
277,
12,
4713,
304,
267,
408,
1692,
367,
295,
14827,
314,
1056,
931,
14,
398,
520,
635,
4713,
26,
6026,
4713,
370,
1050,
27,
282,
769,
402,
7795,
1242,
6346,
1993,
334,
765,
12,
1324,
63,
515,
12,
1072,
63,
515,
395,
3247,
465,
367,
1993,
2274,
342,
267,
408,
267,
291,
14,
4423,
275,
1052,
267,
367,
2332,
315,
10822,
8,
4423,
304,
288,
291,
14,
2683,
2031,
2200,
9,
267,
291,
14,
2921,
275,
664,
63,
2921,
342,
339,
347,
2274,
8,
277,
12,
3102,
12,
1324,
63,
515,
12,
1072,
63,
515,
304,
267,
408,
7099,
282,
19913,
2332,
14,
398,
520,
635,
3102,
26,
2494,
402,
3102,
642,
1077,
1336,
14,
22423,
365,
282,
717,
4539,
574,
9297,
626,
1006,
3102,
1077,
717,
506,
7838,
14,
398,
520,
635,
1324,
63,
515,
26,
6912,
370,
1336,
367,
314,
2536,
1056,
14,
398,
520,
635,
1072,
63,
515,
26,
6912,
370,
3350,
314,
1324,
931,
543,
315,
1169,
314,
1056,
14,
267,
408,
267,
340,
730,
8,
2474,
9,
315,
2943,
14,
1558,
4100,
26,
288,
3102,
275,
359,
2474,
61,
267,
291,
14,
4423,
59,
1210,
63,
515,
61,
275,
334,
2474,
12,
1072,
63,
515,
9,
339,
347,
19913,
8,
277,
12,
1056,
63,
2232,
304,
267,
408,
497,
952,
314,
931,
315,
282,
3523,
23518,
1256,
12,
340,
1779,
652,
4450,
282,
2332,
14,
398,
520,
635,
1056,
63,
2232,
26,
3523,
23518,
367,
1314,
370,
1816,
19913,
314,
1056,
14,
267,
408,
267,
3715,
63,
633,
275,
7097,
14,
29491,
8,
1069,
63,
2232,
14,
515,
9,
267,
340,
3715,
63,
633,
14,
515,
315,
291,
14,
4423,
26,
288,
3102,
12,
5724,
275,
291,
14,
4423,
59,
1294,
63,
633,
14,
515,
61,
288,
340,
22423,
315,
3102,
503,
1056,
63,
2232,
14,
1531,
315,
3102,
26,
355,
291,
14,
2921,
14,
1757,
480,
497,
14827,
1056,
931,
450,
83,
370,
450,
83,
2,
450,
2490,
334,
1069,
63,
2232,
14,
515,
12,
5724,
430,
355,
892,
63,
633,
275,
769,
8,
1294,
63,
633,
9,
355,
892,
63,
633,
59,
18,
61,
275,
5724,
355,
892,
63,
633,
275,
7097,
14,
633,
30038,
8,
1222,
63,
633,
9,
355,
1056,
63,
2232,
14,
515,
275,
892,
63,
633,
421,
199,
533,
6001,
774,
3120,
8,
4436,
316,
26527,
12,
3523,
14938,
14,
14938,
304,
272,
2040,
63,
15712,
63,
1562,
275,
715,
272,
14712,
63,
2550,
275,
334,
7931,
14,
37,
6089,
12,
7554,
14,
37,
17489,
27113,
1149,
9,
272,
1056,
63,
1825,
63,
890,
275,
12293,
339,
327,
7523,
626,
781,
2793,
1133,
30084,
641,
12842,
10923,
367,
4145,
272,
11128,
63,
6962,
275,
715,
339,
347,
636,
826,
721,
277,
12,
1654,
63,
1562,
12,
4784,
2461,
2543,
12,
6197,
12,
295,
5491,
12,
5398,
63,
4269,
12,
326,
1101,
29,
403,
12,
675,
63,
4266,
29,
797,
12,
790,
63,
493,
29,
403,
12,
5897,
29,
403,
12,
326,
14645,
63,
4399,
63,
2242,
29,
797,
12,
23967,
29,
403,
12,
1011,
958,
304,
267,
408,
3120,
367,
3101,
8,
83,
9,
20260,
398,
520,
635,
1654,
63,
1562,
26,
2008,
402,
334,
1000,
63,
354,
12,
1844,
9,
398,
520,
635,
4784,
2461,
2543,
26,
3523,
23518,
13,
2930,
1021,
370,
675,
367,
2511,
7252,
4145,
14,
398,
520,
635,
6197,
26,
22708,
1256,
370,
675,
367,
4877,
4145,
370,
3016,
2432,
3423,
398,
520,
635,
295,
5491,
26,
4784,
497,
5491,
13,
2930,
1256,
370,
675,
367,
26471,
586,
4145,
2544,
2985,
787,
882,
4241,
398,
520,
635,
1101,
26,
11932,
17573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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
jabesq/home-assistant
|
tests/components/homekit/test_type_locks.py
|
13
|
3305
|
"""Test different accessory types: Locks."""
import pytest
from homeassistant.components.homekit.const import ATTR_VALUE
from homeassistant.components.homekit.type_locks import Lock
from homeassistant.components.lock import DOMAIN
from homeassistant.const import (
ATTR_CODE, ATTR_ENTITY_ID, STATE_LOCKED, STATE_UNKNOWN, STATE_UNLOCKED)
from tests.common import async_mock_service
async def test_lock_unlock(hass, hk_driver, events):
"""Test if accessory and HA are updated accordingly."""
code = '1234'
config = {ATTR_CODE: code}
entity_id = 'lock.kitchen_door'
hass.states.async_set(entity_id, None)
await hass.async_block_till_done()
acc = Lock(hass, hk_driver, 'Lock', entity_id, 2, config)
await hass.async_add_job(acc.run)
assert acc.aid == 2
assert acc.category == 6 # DoorLock
assert acc.char_current_state.value == 3
assert acc.char_target_state.value == 1
hass.states.async_set(entity_id, STATE_LOCKED)
await hass.async_block_till_done()
assert acc.char_current_state.value == 1
assert acc.char_target_state.value == 1
hass.states.async_set(entity_id, STATE_UNLOCKED)
await hass.async_block_till_done()
assert acc.char_current_state.value == 0
assert acc.char_target_state.value == 0
hass.states.async_set(entity_id, STATE_UNKNOWN)
await hass.async_block_till_done()
assert acc.char_current_state.value == 3
assert acc.char_target_state.value == 0
hass.states.async_remove(entity_id)
await hass.async_block_till_done()
assert acc.char_current_state.value == 3
assert acc.char_target_state.value == 0
# Set from HomeKit
call_lock = async_mock_service(hass, DOMAIN, 'lock')
call_unlock = async_mock_service(hass, DOMAIN, 'unlock')
await hass.async_add_job(acc.char_target_state.client_update_value, 1)
await hass.async_block_till_done()
assert call_lock
assert call_lock[0].data[ATTR_ENTITY_ID] == entity_id
assert call_lock[0].data[ATTR_CODE] == code
assert acc.char_target_state.value == 1
assert len(events) == 1
assert events[-1].data[ATTR_VALUE] is None
await hass.async_add_job(acc.char_target_state.client_update_value, 0)
await hass.async_block_till_done()
assert call_unlock
assert call_unlock[0].data[ATTR_ENTITY_ID] == entity_id
assert call_unlock[0].data[ATTR_CODE] == code
assert acc.char_target_state.value == 0
assert len(events) == 2
assert events[-1].data[ATTR_VALUE] is None
@pytest.mark.parametrize('config', [{}, {ATTR_CODE: None}])
async def test_no_code(hass, hk_driver, config, events):
"""Test accessory if lock doesn't require a code."""
entity_id = 'lock.kitchen_door'
hass.states.async_set(entity_id, None)
await hass.async_block_till_done()
acc = Lock(hass, hk_driver, 'Lock', entity_id, 2, config)
# Set from HomeKit
call_lock = async_mock_service(hass, DOMAIN, 'lock')
await hass.async_add_job(acc.char_target_state.client_update_value, 1)
await hass.async_block_till_done()
assert call_lock
assert call_lock[0].data[ATTR_ENTITY_ID] == entity_id
assert ATTR_CODE not in call_lock[0].data
assert acc.char_target_state.value == 1
assert len(events) == 1
assert events[-1].data[ATTR_VALUE] is None
|
apache-2.0
|
[
624,
774,
3365,
2879,
1089,
2943,
26,
15536,
83,
1041,
199,
646,
4613,
199,
199,
504,
8846,
14,
4608,
14,
4219,
6065,
14,
1297,
492,
10762,
63,
7041,
199,
504,
8846,
14,
4608,
14,
4219,
6065,
14,
466,
63,
20218,
492,
15536,
199,
504,
8846,
14,
4608,
14,
831,
492,
15265,
199,
504,
8846,
14,
1297,
492,
334,
272,
10762,
63,
6012,
12,
10762,
63,
13630,
63,
998,
12,
11377,
63,
4406,
1149,
12,
11377,
63,
11588,
12,
11377,
63,
1734,
4406,
1149,
9,
199,
199,
504,
2295,
14,
2330,
492,
5316,
63,
1805,
63,
1364,
421,
199,
4146,
347,
511,
63,
831,
63,
17966,
8,
5387,
12,
394,
75,
63,
3090,
12,
4474,
304,
272,
408,
774,
340,
2879,
1089,
436,
16100,
787,
4588,
24137,
1041,
272,
1233,
275,
283,
4321,
7,
272,
1101,
275,
469,
5280,
63,
6012,
26,
1233,
93,
272,
4642,
63,
344,
275,
283,
831,
14,
6065,
24604,
63,
20842,
7,
339,
6298,
14,
4981,
14,
4146,
63,
409,
8,
4502,
63,
344,
12,
488,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
6907,
275,
15536,
8,
5387,
12,
394,
75,
63,
3090,
12,
283,
6432,
297,
4642,
63,
344,
12,
499,
12,
1101,
9,
272,
5517,
6298,
14,
4146,
63,
525,
63,
2423,
8,
5470,
14,
1065,
9,
339,
702,
6907,
14,
21745,
508,
499,
272,
702,
6907,
14,
3710,
508,
1227,
221,
327,
4226,
269,
6432,
339,
702,
6907,
14,
1560,
63,
1818,
63,
929,
14,
585,
508,
650,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
413,
339,
6298,
14,
4981,
14,
4146,
63,
409,
8,
4502,
63,
344,
12,
11377,
63,
4406,
1149,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
6907,
14,
1560,
63,
1818,
63,
929,
14,
585,
508,
413,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
413,
339,
6298,
14,
4981,
14,
4146,
63,
409,
8,
4502,
63,
344,
12,
11377,
63,
1734,
4406,
1149,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
6907,
14,
1560,
63,
1818,
63,
929,
14,
585,
508,
378,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
378,
339,
6298,
14,
4981,
14,
4146,
63,
409,
8,
4502,
63,
344,
12,
11377,
63,
11588,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
6907,
14,
1560,
63,
1818,
63,
929,
14,
585,
508,
650,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
378,
339,
6298,
14,
4981,
14,
4146,
63,
2168,
8,
4502,
63,
344,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
6907,
14,
1560,
63,
1818,
63,
929,
14,
585,
508,
650,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
378,
339,
327,
2494,
687,
14621,
14591,
272,
1240,
63,
831,
275,
5316,
63,
1805,
63,
1364,
8,
5387,
12,
15265,
12,
283,
831,
358,
272,
1240,
63,
17966,
275,
5316,
63,
1805,
63,
1364,
8,
5387,
12,
15265,
12,
283,
17966,
358,
339,
5517,
6298,
14,
4146,
63,
525,
63,
2423,
8,
5470,
14,
1560,
63,
1375,
63,
929,
14,
1258,
63,
873,
63,
585,
12,
413,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
1240,
63,
831,
272,
702,
1240,
63,
831,
59,
16,
1055,
576,
59,
5280,
63,
13630,
63,
998,
61,
508,
4642,
63,
344,
272,
702,
1240,
63,
831,
59,
16,
1055,
576,
59,
5280,
63,
6012,
61,
508,
1233,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
413,
272,
702,
822,
8,
4368,
9,
508,
413,
272,
702,
4474,
1988,
17,
1055,
576,
59,
5280,
63,
7041,
61,
365,
488,
339,
5517,
6298,
14,
4146,
63,
525,
63,
2423,
8,
5470,
14,
1560,
63,
1375,
63,
929,
14,
1258,
63,
873,
63,
585,
12,
378,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
1240,
63,
17966,
272,
702,
1240,
63,
17966,
59,
16,
1055,
576,
59,
5280,
63,
13630,
63,
998,
61,
508,
4642,
63,
344,
272,
702,
1240,
63,
17966,
59,
16,
1055,
576,
59,
5280,
63,
6012,
61,
508,
1233,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
378,
272,
702,
822,
8,
4368,
9,
508,
499,
272,
702,
4474,
1988,
17,
1055,
576,
59,
5280,
63,
7041,
61,
365,
488,
421,
199,
32,
4462,
14,
1657,
14,
10396,
360,
888,
297,
8910,
1386,
469,
5280,
63,
6012,
26,
488,
29810,
199,
4146,
347,
511,
63,
889,
63,
600,
8,
5387,
12,
394,
75,
63,
3090,
12,
1101,
12,
4474,
304,
272,
408,
774,
2879,
1089,
340,
4650,
3181,
1133,
4409,
282,
1233,
1041,
272,
4642,
63,
344,
275,
283,
831,
14,
6065,
24604,
63,
20842,
7,
339,
6298,
14,
4981,
14,
4146,
63,
409,
8,
4502,
63,
344,
12,
488,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
6907,
275,
15536,
8,
5387,
12,
394,
75,
63,
3090,
12,
283,
6432,
297,
4642,
63,
344,
12,
499,
12,
1101,
9,
339,
327,
2494,
687,
14621,
14591,
272,
1240,
63,
831,
275,
5316,
63,
1805,
63,
1364,
8,
5387,
12,
15265,
12,
283,
831,
358,
339,
5517,
6298,
14,
4146,
63,
525,
63,
2423,
8,
5470,
14,
1560,
63,
1375,
63,
929,
14,
1258,
63,
873,
63,
585,
12,
413,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
1240,
63,
831,
272,
702,
1240,
63,
831,
59,
16,
1055,
576,
59,
5280,
63,
13630,
63,
998,
61,
508,
4642,
63,
344,
272,
702,
10762,
63,
6012,
440,
315,
1240,
63,
831,
59,
16,
1055,
576,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
413,
272,
702,
822,
8,
4368,
9,
508,
413,
272,
702,
4474,
1988,
17,
1055,
576,
59,
5280,
63,
7041,
61,
365,
488,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
774,
3365,
2879,
1089,
2943,
26,
15536,
83,
1041,
199,
646,
4613,
199,
199,
504,
8846,
14,
4608,
14,
4219,
6065,
14,
1297,
492,
10762,
63,
7041,
199,
504,
8846,
14,
4608,
14,
4219,
6065,
14,
466,
63,
20218,
492,
15536,
199,
504,
8846,
14,
4608,
14,
831,
492,
15265,
199,
504,
8846,
14,
1297,
492,
334,
272,
10762,
63,
6012,
12,
10762,
63,
13630,
63,
998,
12,
11377,
63,
4406,
1149,
12,
11377,
63,
11588,
12,
11377,
63,
1734,
4406,
1149,
9,
199,
199,
504,
2295,
14,
2330,
492,
5316,
63,
1805,
63,
1364,
421,
199,
4146,
347,
511,
63,
831,
63,
17966,
8,
5387,
12,
394,
75,
63,
3090,
12,
4474,
304,
272,
408,
774,
340,
2879,
1089,
436,
16100,
787,
4588,
24137,
1041,
272,
1233,
275,
283,
4321,
7,
272,
1101,
275,
469,
5280,
63,
6012,
26,
1233,
93,
272,
4642,
63,
344,
275,
283,
831,
14,
6065,
24604,
63,
20842,
7,
339,
6298,
14,
4981,
14,
4146,
63,
409,
8,
4502,
63,
344,
12,
488,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
6907,
275,
15536,
8,
5387,
12,
394,
75,
63,
3090,
12,
283,
6432,
297,
4642,
63,
344,
12,
499,
12,
1101,
9,
272,
5517,
6298,
14,
4146,
63,
525,
63,
2423,
8,
5470,
14,
1065,
9,
339,
702,
6907,
14,
21745,
508,
499,
272,
702,
6907,
14,
3710,
508,
1227,
221,
327,
4226,
269,
6432,
339,
702,
6907,
14,
1560,
63,
1818,
63,
929,
14,
585,
508,
650,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
413,
339,
6298,
14,
4981,
14,
4146,
63,
409,
8,
4502,
63,
344,
12,
11377,
63,
4406,
1149,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
6907,
14,
1560,
63,
1818,
63,
929,
14,
585,
508,
413,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
413,
339,
6298,
14,
4981,
14,
4146,
63,
409,
8,
4502,
63,
344,
12,
11377,
63,
1734,
4406,
1149,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
6907,
14,
1560,
63,
1818,
63,
929,
14,
585,
508,
378,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
378,
339,
6298,
14,
4981,
14,
4146,
63,
409,
8,
4502,
63,
344,
12,
11377,
63,
11588,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
6907,
14,
1560,
63,
1818,
63,
929,
14,
585,
508,
650,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
378,
339,
6298,
14,
4981,
14,
4146,
63,
2168,
8,
4502,
63,
344,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
6907,
14,
1560,
63,
1818,
63,
929,
14,
585,
508,
650,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
378,
339,
327,
2494,
687,
14621,
14591,
272,
1240,
63,
831,
275,
5316,
63,
1805,
63,
1364,
8,
5387,
12,
15265,
12,
283,
831,
358,
272,
1240,
63,
17966,
275,
5316,
63,
1805,
63,
1364,
8,
5387,
12,
15265,
12,
283,
17966,
358,
339,
5517,
6298,
14,
4146,
63,
525,
63,
2423,
8,
5470,
14,
1560,
63,
1375,
63,
929,
14,
1258,
63,
873,
63,
585,
12,
413,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
1240,
63,
831,
272,
702,
1240,
63,
831,
59,
16,
1055,
576,
59,
5280,
63,
13630,
63,
998,
61,
508,
4642,
63,
344,
272,
702,
1240,
63,
831,
59,
16,
1055,
576,
59,
5280,
63,
6012,
61,
508,
1233,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
413,
272,
702,
822,
8,
4368,
9,
508,
413,
272,
702,
4474,
1988,
17,
1055,
576,
59,
5280,
63,
7041,
61,
365,
488,
339,
5517,
6298,
14,
4146,
63,
525,
63,
2423,
8,
5470,
14,
1560,
63,
1375,
63,
929,
14,
1258,
63,
873,
63,
585,
12,
378,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
1240,
63,
17966,
272,
702,
1240,
63,
17966,
59,
16,
1055,
576,
59,
5280,
63,
13630,
63,
998,
61,
508,
4642,
63,
344,
272,
702,
1240,
63,
17966,
59,
16,
1055,
576,
59,
5280,
63,
6012,
61,
508,
1233,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
378,
272,
702,
822,
8,
4368,
9,
508,
499,
272,
702,
4474,
1988,
17,
1055,
576,
59,
5280,
63,
7041,
61,
365,
488,
421,
199,
32,
4462,
14,
1657,
14,
10396,
360,
888,
297,
8910,
1386,
469,
5280,
63,
6012,
26,
488,
29810,
199,
4146,
347,
511,
63,
889,
63,
600,
8,
5387,
12,
394,
75,
63,
3090,
12,
1101,
12,
4474,
304,
272,
408,
774,
2879,
1089,
340,
4650,
3181,
1133,
4409,
282,
1233,
1041,
272,
4642,
63,
344,
275,
283,
831,
14,
6065,
24604,
63,
20842,
7,
339,
6298,
14,
4981,
14,
4146,
63,
409,
8,
4502,
63,
344,
12,
488,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
6907,
275,
15536,
8,
5387,
12,
394,
75,
63,
3090,
12,
283,
6432,
297,
4642,
63,
344,
12,
499,
12,
1101,
9,
339,
327,
2494,
687,
14621,
14591,
272,
1240,
63,
831,
275,
5316,
63,
1805,
63,
1364,
8,
5387,
12,
15265,
12,
283,
831,
358,
339,
5517,
6298,
14,
4146,
63,
525,
63,
2423,
8,
5470,
14,
1560,
63,
1375,
63,
929,
14,
1258,
63,
873,
63,
585,
12,
413,
9,
272,
5517,
6298,
14,
4146,
63,
1457,
63,
12587,
63,
4456,
342,
272,
702,
1240,
63,
831,
272,
702,
1240,
63,
831,
59,
16,
1055,
576,
59,
5280,
63,
13630,
63,
998,
61,
508,
4642,
63,
344,
272,
702,
10762,
63,
6012,
440,
315,
1240,
63,
831,
59,
16,
1055,
576,
272,
702,
6907,
14,
1560,
63,
1375,
63,
929,
14,
585,
508,
413,
272,
702,
822,
8,
4368,
9,
508,
413,
272,
702,
4474,
1988,
17,
1055,
576,
59,
5280,
63,
7041,
61,
365,
488,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
jedarnaude/gmock
|
scripts/generator/cpp/tokenize.py
|
679
|
9703
|
#!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tokenize C++ source code."""
__author__ = 'nnorwitz@google.com (Neal Norwitz)'
try:
# Python 3.x
import builtins
except ImportError:
# Python 2.x
import __builtin__ as builtins
import sys
from cpp import utils
if not hasattr(builtins, 'set'):
# Nominal support for Python 2.3.
from sets import Set as set
# Add $ as a valid identifier char since so much code uses it.
_letters = 'abcdefghijklmnopqrstuvwxyz'
VALID_IDENTIFIER_CHARS = set(_letters + _letters.upper() + '_0123456789$')
HEX_DIGITS = set('0123456789abcdefABCDEF')
INT_OR_FLOAT_DIGITS = set('01234567890eE-+')
# C++0x string preffixes.
_STR_PREFIXES = set(('R', 'u8', 'u8R', 'u', 'uR', 'U', 'UR', 'L', 'LR'))
# Token types.
UNKNOWN = 'UNKNOWN'
SYNTAX = 'SYNTAX'
CONSTANT = 'CONSTANT'
NAME = 'NAME'
PREPROCESSOR = 'PREPROCESSOR'
# Where the token originated from. This can be used for backtracking.
# It is always set to WHENCE_STREAM in this code.
WHENCE_STREAM, WHENCE_QUEUE = range(2)
class Token(object):
"""Data container to represent a C++ token.
Tokens can be identifiers, syntax char(s), constants, or
pre-processor directives.
start contains the index of the first char of the token in the source
end contains the index of the last char of the token in the source
"""
def __init__(self, token_type, name, start, end):
self.token_type = token_type
self.name = name
self.start = start
self.end = end
self.whence = WHENCE_STREAM
def __str__(self):
if not utils.DEBUG:
return 'Token(%r)' % self.name
return 'Token(%r, %s, %s)' % (self.name, self.start, self.end)
__repr__ = __str__
def _GetString(source, start, i):
i = source.find('"', i+1)
while source[i-1] == '\\':
# Count the trailing backslashes.
backslash_count = 1
j = i - 2
while source[j] == '\\':
backslash_count += 1
j -= 1
# When trailing backslashes are even, they escape each other.
if (backslash_count % 2) == 0:
break
i = source.find('"', i+1)
return i + 1
def _GetChar(source, start, i):
# NOTE(nnorwitz): may not be quite correct, should be good enough.
i = source.find("'", i+1)
while source[i-1] == '\\':
# Need to special case '\\'.
if (i - 2) > start and source[i-2] == '\\':
break
i = source.find("'", i+1)
# Try to handle unterminated single quotes (in a #if 0 block).
if i < 0:
i = start
return i + 1
def GetTokens(source):
"""Returns a sequence of Tokens.
Args:
source: string of C++ source code.
Yields:
Token that represents the next token in the source.
"""
# Cache various valid character sets for speed.
valid_identifier_chars = VALID_IDENTIFIER_CHARS
hex_digits = HEX_DIGITS
int_or_float_digits = INT_OR_FLOAT_DIGITS
int_or_float_digits2 = int_or_float_digits | set('.')
# Only ignore errors while in a #if 0 block.
ignore_errors = False
count_ifs = 0
i = 0
end = len(source)
while i < end:
# Skip whitespace.
while i < end and source[i].isspace():
i += 1
if i >= end:
return
token_type = UNKNOWN
start = i
c = source[i]
if c.isalpha() or c == '_': # Find a string token.
token_type = NAME
while source[i] in valid_identifier_chars:
i += 1
# String and character constants can look like a name if
# they are something like L"".
if (source[i] == "'" and (i - start) == 1 and
source[start:i] in 'uUL'):
# u, U, and L are valid C++0x character preffixes.
token_type = CONSTANT
i = _GetChar(source, start, i)
elif source[i] == "'" and source[start:i] in _STR_PREFIXES:
token_type = CONSTANT
i = _GetString(source, start, i)
elif c == '/' and source[i+1] == '/': # Find // comments.
i = source.find('\n', i)
if i == -1: # Handle EOF.
i = end
continue
elif c == '/' and source[i+1] == '*': # Find /* comments. */
i = source.find('*/', i) + 2
continue
elif c in ':+-<>&|*=': # : or :: (plus other chars).
token_type = SYNTAX
i += 1
new_ch = source[i]
if new_ch == c:
i += 1
elif c == '-' and new_ch == '>':
i += 1
elif new_ch == '=':
i += 1
elif c in '()[]{}~!?^%;/.,': # Handle single char tokens.
token_type = SYNTAX
i += 1
if c == '.' and source[i].isdigit():
token_type = CONSTANT
i += 1
while source[i] in int_or_float_digits:
i += 1
# Handle float suffixes.
for suffix in ('l', 'f'):
if suffix == source[i:i+1].lower():
i += 1
break
elif c.isdigit(): # Find integer.
token_type = CONSTANT
if c == '0' and source[i+1] in 'xX':
# Handle hex digits.
i += 2
while source[i] in hex_digits:
i += 1
else:
while source[i] in int_or_float_digits2:
i += 1
# Handle integer (and float) suffixes.
for suffix in ('ull', 'll', 'ul', 'l', 'f', 'u'):
size = len(suffix)
if suffix == source[i:i+size].lower():
i += size
break
elif c == '"': # Find string.
token_type = CONSTANT
i = _GetString(source, start, i)
elif c == "'": # Find char.
token_type = CONSTANT
i = _GetChar(source, start, i)
elif c == '#': # Find pre-processor command.
token_type = PREPROCESSOR
got_if = source[i:i+3] == '#if' and source[i+3:i+4].isspace()
if got_if:
count_ifs += 1
elif source[i:i+6] == '#endif':
count_ifs -= 1
if count_ifs == 0:
ignore_errors = False
# TODO(nnorwitz): handle preprocessor statements (\ continuations).
while 1:
i1 = source.find('\n', i)
i2 = source.find('//', i)
i3 = source.find('/*', i)
i4 = source.find('"', i)
# NOTE(nnorwitz): doesn't handle comments in #define macros.
# Get the first important symbol (newline, comment, EOF/end).
i = min([x for x in (i1, i2, i3, i4, end) if x != -1])
# Handle #include "dir//foo.h" properly.
if source[i] == '"':
i = source.find('"', i+1) + 1
assert i > 0
continue
# Keep going if end of the line and the line ends with \.
if not (i == i1 and source[i-1] == '\\'):
if got_if:
condition = source[start+4:i].lstrip()
if (condition.startswith('0') or
condition.startswith('(0)')):
ignore_errors = True
break
i += 1
elif c == '\\': # Handle \ in code.
# This is different from the pre-processor \ handling.
i += 1
continue
elif ignore_errors:
# The tokenizer seems to be in pretty good shape. This
# raise is conditionally disabled so that bogus code
# in an #if 0 block can be handled. Since we will ignore
# it anyways, this is probably fine. So disable the
# exception and return the bogus char.
i += 1
else:
sys.stderr.write('Got invalid token in %s @ %d token:%s: %r\n' %
('?', i, c, source[i-10:i+10]))
raise RuntimeError('unexpected token')
if i <= 0:
print('Invalid index, exiting now.')
return
yield Token(token_type, source[start:i], start, i)
if __name__ == '__main__':
def main(argv):
"""Driver mostly for testing purposes."""
for filename in argv[1:]:
source = utils.ReadFile(filename)
if source is None:
continue
for token in GetTokens(source):
print('%-12s: %s' % (token.token_type, token.name))
# print('\r%6.2f%%' % (100.0 * index / token.end),)
sys.stdout.write('\n')
main(sys.argv)
|
bsd-3-clause
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
3,
199,
3,
1898,
10219,
5612,
279,
653,
28495,
199,
3,
20825,
1898,
10219,
4475,
3277,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
420,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
199,
624,
3264,
794,
445,
4176,
1350,
1233,
1041,
199,
199,
363,
2502,
363,
275,
283,
31203,
32,
3098,
14,
957,
334,
4698,
279,
653,
28495,
3171,
421,
199,
893,
26,
272,
327,
2018,
650,
14,
88,
272,
492,
12963,
199,
2590,
3545,
26,
272,
327,
2018,
499,
14,
88,
272,
492,
636,
5351,
363,
465,
12963,
421,
199,
646,
984,
199,
199,
504,
7246,
492,
3778,
421,
199,
692,
440,
2688,
8,
10372,
12,
283,
409,
735,
272,
327,
653,
676,
1582,
2291,
367,
2018,
499,
14,
19,
14,
272,
687,
5951,
492,
2494,
465,
663,
421,
199,
3,
2654,
2672,
465,
282,
1686,
5148,
1495,
3967,
880,
8298,
1233,
4440,
652,
14,
199,
63,
16415,
275,
283,
23459,
7,
199,
5600,
63,
22698,
63,
16326,
275,
663,
1547,
16415,
435,
485,
16415,
14,
4142,
342,
435,
2513,
11371,
9988,
199,
21377,
63,
22855,
5930,
275,
663,
360,
11371,
10678,
18820,
358,
199,
2919,
63,
726,
63,
11783,
63,
22855,
5930,
275,
663,
360,
11371,
16,
20565,
6793,
358,
421,
199,
3,
445,
4176,
16,
88,
1059,
20491,
26205,
14,
199,
63,
3027,
63,
6351,
654,
275,
663,
4725,
50,
297,
283,
85,
24,
297,
283,
85,
24,
50,
297,
283,
85,
297,
283,
85,
50,
297,
283,
53,
297,
283,
1230,
297,
283,
44,
297,
283,
17665,
1333,
421,
199,
3,
8767,
2943,
14,
199,
11588,
275,
283,
11588,
7,
199,
20763,
275,
283,
20763,
7,
199,
25825,
275,
283,
25825,
7,
199,
2339,
275,
283,
2339,
7,
199,
4225,
24341,
275,
283,
4225,
24341,
7,
199,
199,
3,
17685,
314,
1526,
6330,
972,
687,
14,
221,
961,
883,
506,
1202,
367,
1771,
14428,
14,
199,
3,
2779,
365,
3544,
663,
370,
5732,
6013,
63,
9484,
315,
642,
1233,
14,
199,
9792,
6013,
63,
9484,
12,
5732,
6013,
63,
15125,
275,
1425,
8,
18,
9,
421,
199,
533,
8767,
8,
785,
304,
272,
408,
1451,
3970,
370,
2954,
282,
445,
4176,
1526,
14,
339,
8767,
83,
883,
506,
14154,
12,
6302,
1495,
8,
83,
395,
5262,
12,
503,
272,
876,
13,
6459,
13502,
14,
339,
1343,
3509,
314,
1478,
402,
314,
1642,
1495,
402,
314,
1526,
315,
314,
1350,
272,
1284,
3509,
314,
1478,
402,
314,
2061,
1495,
402,
314,
1526,
315,
314,
1350,
272,
408,
339,
347,
636,
826,
721,
277,
12,
1526,
63,
466,
12,
536,
12,
1343,
12,
1284,
304,
267,
291,
14,
1418,
63,
466,
275,
1526,
63,
466,
267,
291,
14,
354,
275,
536,
267,
291,
14,
928,
275,
1343,
267,
291,
14,
500,
275,
1284,
267,
291,
14,
2191,
4894,
275,
5732,
6013,
63,
9484,
339,
347,
636,
495,
721,
277,
304,
267,
340,
440,
3778,
14,
5287,
26,
288,
372,
283,
3264,
4042,
82,
3171,
450,
291,
14,
354,
267,
372,
283,
3264,
4042,
82,
12,
450,
83,
12,
450,
83,
3171,
450,
334,
277,
14,
354,
12,
291,
14,
928,
12,
291,
14,
500,
9,
339,
636,
2722,
363,
275,
636,
495,
363,
421,
199,
318,
485,
1002,
1558,
8,
1365,
12,
1343,
12,
284,
304,
272,
284,
275,
1350,
14,
1623,
20630,
284,
11,
17,
9,
272,
1830,
1350,
59,
73,
13,
17,
61,
508,
29082,
267,
327,
14826,
314,
8520,
23396,
14,
267,
13831,
63,
835,
275,
413,
267,
1335,
275,
284,
446,
499,
267,
1830,
1350,
59,
74,
61,
508,
29082,
288,
13831,
63,
835,
847,
413,
288,
1335,
4862,
413,
267,
327,
3979,
8520,
23396,
787,
2755,
12,
2985,
4772,
1924,
1163,
14,
267,
340,
334,
21509,
63,
835,
450,
499,
9,
508,
378,
26,
288,
2059,
267,
284,
275,
1350,
14,
1623,
20630,
284,
11,
17,
9,
272,
372,
284,
435,
413,
421,
199,
318,
485,
1002,
1610,
8,
1365,
12,
1343,
12,
284,
304,
272,
327,
6944,
8,
31203,
304,
1443,
440,
506,
18794,
3211,
12,
1077,
506,
6954,
8321,
14,
272,
284,
275,
1350,
14,
1623,
27769,
284,
11,
17,
9,
272,
1830,
1350,
59,
73,
13,
17,
61,
508,
29082,
267,
327,
14012,
370,
4539,
1930,
6468,
1370,
267,
340,
334,
73,
446,
499,
9,
690,
1343,
436,
1350,
59,
73,
13,
18,
61,
508,
29082,
288,
2059,
267,
284,
275,
1350,
14,
1623,
27769,
284,
11,
17,
9,
272,
327,
7649,
370,
2429,
625,
18375,
2849,
9344,
334,
262,
282,
327,
692,
378,
1853,
680,
272,
340,
284,
665,
378,
26,
267,
284,
275,
1343,
272,
372,
284,
435,
413,
421,
199,
318,
2372,
16419,
8,
1365,
304,
272,
408,
3407,
282,
3414,
402,
8767,
83,
14,
339,
3033,
26,
489,
1350,
26,
1059,
402,
445,
4176,
1350,
1233,
14,
339,
23771,
83,
26,
489,
8767,
626,
8469,
314,
2163,
1526,
315,
314,
1350,
14,
272,
408,
272,
327,
11977,
7750,
1686,
4528,
5951,
367,
8112,
14,
272,
1686,
63,
5364,
63,
6574,
275,
22049,
63,
22698,
63,
16326,
272,
6318,
63,
7022,
275,
29467,
63,
22855,
5930,
272,
1109,
63,
269,
63,
1609,
63,
7022,
275,
16429,
63,
726,
63,
11783,
63,
22855,
5930,
272,
1109,
63,
269,
63,
1609,
63,
7022,
18,
275,
1109,
63,
269,
63,
1609,
63,
7022,
1204,
663,
7563,
339,
327,
5972,
3686,
2552,
1830,
315,
282,
327,
692,
378,
1853,
14,
272,
3686,
63,
2550,
275,
756,
272,
2338,
63,
20985
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
3,
199,
3,
1898,
10219,
5612,
279,
653,
28495,
199,
3,
20825,
1898,
10219,
4475,
3277,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
3,
199,
3,
420,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
3,
199,
3,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
4204,
1334,
314,
844,
14,
199,
199,
624,
3264,
794,
445,
4176,
1350,
1233,
1041,
199,
199,
363,
2502,
363,
275,
283,
31203,
32,
3098,
14,
957,
334,
4698,
279,
653,
28495,
3171,
421,
199,
893,
26,
272,
327,
2018,
650,
14,
88,
272,
492,
12963,
199,
2590,
3545,
26,
272,
327,
2018,
499,
14,
88,
272,
492,
636,
5351,
363,
465,
12963,
421,
199,
646,
984,
199,
199,
504,
7246,
492,
3778,
421,
199,
692,
440,
2688,
8,
10372,
12,
283,
409,
735,
272,
327,
653,
676,
1582,
2291,
367,
2018,
499,
14,
19,
14,
272,
687,
5951,
492,
2494,
465,
663,
421,
199,
3,
2654,
2672,
465,
282,
1686,
5148,
1495,
3967,
880,
8298,
1233,
4440,
652,
14,
199,
63,
16415,
275,
283,
23459,
7,
199,
5600,
63,
22698,
63,
16326,
275,
663,
1547,
16415,
435,
485,
16415,
14,
4142,
342,
435,
2513,
11371,
9988,
199,
21377,
63,
22855,
5930,
275,
663,
360,
11371,
10678,
18820,
358,
199,
2919,
63,
726,
63,
11783,
63,
22855,
5930,
275,
663,
360,
11371,
16,
20565,
6793,
358,
421,
199,
3,
445,
4176,
16,
88,
1059,
20491,
26205,
14,
199,
63,
3027,
63,
6351,
654,
275,
663,
4725,
50,
297,
283,
85,
24,
297,
283,
85,
24,
50,
297,
283,
85,
297,
283,
85,
50,
297,
283,
53,
297,
283,
1230,
297,
283,
44,
297,
283,
17665,
1333,
421,
199,
3,
8767,
2943,
14,
199,
11588,
275,
283,
11588,
7,
199,
20763,
275,
283,
20763,
7,
199,
25825,
275,
283,
25825,
7,
199,
2339,
275,
283,
2339,
7,
199,
4225,
24341,
275,
283,
4225,
24341,
7,
199,
199,
3,
17685,
314,
1526,
6330,
972,
687,
14,
221,
961,
883,
506,
1202,
367,
1771,
14428,
14,
199,
3,
2779,
365,
3544,
663,
370,
5732,
6013,
63,
9484,
315,
642,
1233,
14,
199,
9792,
6013,
63,
9484,
12,
5732,
6013,
63,
15125,
275,
1425,
8,
18,
9,
421,
199,
533,
8767,
8,
785,
304,
272,
408,
1451,
3970,
370,
2954,
282,
445,
4176,
1526,
14,
339,
8767,
83,
883,
506,
14154,
12,
6302,
1495,
8,
83,
395,
5262,
12,
503,
272,
876,
13,
6459,
13502,
14,
339,
1343,
3509,
314,
1478,
402,
314,
1642,
1495,
402,
314,
1526,
315,
314,
1350,
272,
1284,
3509,
314,
1478,
402,
314,
2061,
1495,
402,
314,
1526,
315,
314,
1350,
272,
408,
339,
347,
636,
826,
721,
277,
12,
1526,
63,
466,
12,
536,
12,
1343,
12,
1284,
304,
267,
291,
14,
1418,
63,
466,
275,
1526,
63,
466,
267,
291,
14,
354,
275,
536,
267,
291,
14,
928,
275,
1343,
267,
291,
14,
500,
275,
1284,
267,
291,
14,
2191,
4894,
275,
5732,
6013,
63,
9484,
339,
347,
636,
495,
721,
277,
304,
267,
340,
440,
3778,
14,
5287,
26,
288,
372,
283,
3264,
4042,
82,
3171,
450,
291,
14,
354,
267,
372,
283,
3264,
4042,
82,
12,
450,
83,
12,
450,
83,
3171,
450,
334,
277,
14,
354,
12,
291,
14,
928,
12,
291,
14,
500,
9,
339,
636,
2722,
363,
275,
636,
495,
363,
421,
199,
318,
485,
1002,
1558,
8,
1365,
12,
1343,
12,
284,
304,
272,
284,
275,
1350,
14,
1623,
20630,
284,
11,
17,
9,
272,
1830,
1350,
59,
73,
13,
17,
61,
508,
29082,
267,
327,
14826,
314,
8520,
23396,
14,
267,
13831,
63,
835,
275,
413,
267,
1335,
275,
284,
446,
499,
267,
1830,
1350,
59,
74,
61,
508,
29082,
288,
13831,
63,
835,
847,
413,
288,
1335,
4862,
413,
267,
327,
3979,
8520,
23396,
787,
2755,
12,
2985,
4772,
1924,
1163,
14,
267,
340,
334,
21509,
63,
835,
450,
499,
9,
508,
378,
26,
288,
2059,
267,
284,
275,
1350,
14,
1623,
20630,
284,
11,
17,
9,
272,
372,
284,
435,
413,
421,
199,
318,
485,
1002,
1610,
8,
1365,
12,
1343,
12,
284,
304,
272,
327,
6944,
8,
31203,
304,
1443,
440,
506,
18794,
3211,
12,
1077,
506,
6954,
8321,
14,
272,
284,
275,
1350,
14,
1623,
27769,
284,
11,
17,
9,
272,
1830,
1350,
59,
73,
13,
17,
61,
508,
29082,
267,
327,
14012,
370,
4539,
1930,
6468,
1370,
267,
340,
334,
73,
446,
499,
9,
690,
1343,
436,
1350,
59,
73,
13,
18,
61,
508,
29082,
288,
2059,
267,
284,
275,
1350,
14,
1623,
27769,
284,
11,
17,
9,
272,
327,
7649,
370,
2429,
625,
18375,
2849,
9344,
334,
262,
282,
327,
692,
378,
1853,
680,
272,
340,
284,
665,
378,
26,
267,
284,
275,
1343,
272,
372,
284,
435,
413,
421,
199,
318,
2372,
16419,
8,
1365,
304,
272,
408,
3407,
282,
3414,
402,
8767,
83,
14,
339,
3033,
26,
489,
1350,
26,
1059,
402,
445,
4176,
1350,
1233,
14,
339,
23771,
83,
26,
489,
8767,
626,
8469,
314,
2163,
1526,
315,
314,
1350,
14,
272,
408,
272,
327,
11977,
7750,
1686,
4528,
5951,
367,
8112,
14,
272,
1686,
63,
5364,
63,
6574,
275,
22049,
63,
22698,
63,
16326,
272,
6318,
63,
7022,
275,
29467,
63,
22855,
5930,
272,
1109,
63,
269,
63,
1609,
63,
7022,
275,
16429,
63,
726,
63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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
bjornlevi/5thpower
|
afmaeli/env/lib/python3.6/site-packages/pkg_resources/_vendor/packaging/specifiers.py
|
1107
|
28025
|
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import functools
import itertools
import re
from ._compat import string_types, with_metaclass
from .version import Version, LegacyVersion, parse
class InvalidSpecifier(ValueError):
"""
An invalid specifier was found, users should refer to PEP 440.
"""
class BaseSpecifier(with_metaclass(abc.ABCMeta, object)):
@abc.abstractmethod
def __str__(self):
"""
Returns the str representation of this Specifier like object. This
should be representative of the Specifier itself.
"""
@abc.abstractmethod
def __hash__(self):
"""
Returns a hash value for this Specifier like object.
"""
@abc.abstractmethod
def __eq__(self, other):
"""
Returns a boolean representing whether or not the two Specifier like
objects are equal.
"""
@abc.abstractmethod
def __ne__(self, other):
"""
Returns a boolean representing whether or not the two Specifier like
objects are not equal.
"""
@abc.abstractproperty
def prereleases(self):
"""
Returns whether or not pre-releases as a whole are allowed by this
specifier.
"""
@prereleases.setter
def prereleases(self, value):
"""
Sets whether or not pre-releases as a whole are allowed by this
specifier.
"""
@abc.abstractmethod
def contains(self, item, prereleases=None):
"""
Determines if the given item is contained within this specifier.
"""
@abc.abstractmethod
def filter(self, iterable, prereleases=None):
"""
Takes an iterable of items and filters them so that only items which
are contained within this specifier are allowed in it.
"""
class _IndividualSpecifier(BaseSpecifier):
_operators = {}
def __init__(self, spec="", prereleases=None):
match = self._regex.search(spec)
if not match:
raise InvalidSpecifier("Invalid specifier: '{0}'".format(spec))
self._spec = (
match.group("operator").strip(),
match.group("version").strip(),
)
# Store whether or not this Specifier should accept prereleases
self._prereleases = prereleases
def __repr__(self):
pre = (
", prereleases={0!r}".format(self.prereleases)
if self._prereleases is not None
else ""
)
return "<{0}({1!r}{2})>".format(
self.__class__.__name__,
str(self),
pre,
)
def __str__(self):
return "{0}{1}".format(*self._spec)
def __hash__(self):
return hash(self._spec)
def __eq__(self, other):
if isinstance(other, string_types):
try:
other = self.__class__(other)
except InvalidSpecifier:
return NotImplemented
elif not isinstance(other, self.__class__):
return NotImplemented
return self._spec == other._spec
def __ne__(self, other):
if isinstance(other, string_types):
try:
other = self.__class__(other)
except InvalidSpecifier:
return NotImplemented
elif not isinstance(other, self.__class__):
return NotImplemented
return self._spec != other._spec
def _get_operator(self, op):
return getattr(self, "_compare_{0}".format(self._operators[op]))
def _coerce_version(self, version):
if not isinstance(version, (LegacyVersion, Version)):
version = parse(version)
return version
@property
def operator(self):
return self._spec[0]
@property
def version(self):
return self._spec[1]
@property
def prereleases(self):
return self._prereleases
@prereleases.setter
def prereleases(self, value):
self._prereleases = value
def __contains__(self, item):
return self.contains(item)
def contains(self, item, prereleases=None):
# Determine if prereleases are to be allowed or not.
if prereleases is None:
prereleases = self.prereleases
# Normalize item to a Version or LegacyVersion, this allows us to have
# a shortcut for ``"2.0" in Specifier(">=2")
item = self._coerce_version(item)
# Determine if we should be supporting prereleases in this specifier
# or not, if we do not support prereleases than we can short circuit
# logic if this version is a prereleases.
if item.is_prerelease and not prereleases:
return False
# Actually do the comparison to determine if this item is contained
# within this Specifier or not.
return self._get_operator(self.operator)(item, self.version)
def filter(self, iterable, prereleases=None):
yielded = False
found_prereleases = []
kw = {"prereleases": prereleases if prereleases is not None else True}
# Attempt to iterate over all the values in the iterable and if any of
# them match, yield them.
for version in iterable:
parsed_version = self._coerce_version(version)
if self.contains(parsed_version, **kw):
# If our version is a prerelease, and we were not set to allow
# prereleases, then we'll store it for later incase nothing
# else matches this specifier.
if (parsed_version.is_prerelease and not
(prereleases or self.prereleases)):
found_prereleases.append(version)
# Either this is not a prerelease, or we should have been
# accepting prereleases from the begining.
else:
yielded = True
yield version
# Now that we've iterated over everything, determine if we've yielded
# any values, and if we have not and we have any prereleases stored up
# then we will go ahead and yield the prereleases.
if not yielded and found_prereleases:
for version in found_prereleases:
yield version
class LegacySpecifier(_IndividualSpecifier):
_regex_str = (
r"""
(?P<operator>(==|!=|<=|>=|<|>))
\s*
(?P<version>
[^,;\s)]* # Since this is a "legacy" specifier, and the version
# string can be just about anything, we match everything
# except for whitespace, a semi-colon for marker support,
# a closing paren since versions can be enclosed in
# them, and a comma since it's a version separator.
)
"""
)
_regex = re.compile(
r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE)
_operators = {
"==": "equal",
"!=": "not_equal",
"<=": "less_than_equal",
">=": "greater_than_equal",
"<": "less_than",
">": "greater_than",
}
def _coerce_version(self, version):
if not isinstance(version, LegacyVersion):
version = LegacyVersion(str(version))
return version
def _compare_equal(self, prospective, spec):
return prospective == self._coerce_version(spec)
def _compare_not_equal(self, prospective, spec):
return prospective != self._coerce_version(spec)
def _compare_less_than_equal(self, prospective, spec):
return prospective <= self._coerce_version(spec)
def _compare_greater_than_equal(self, prospective, spec):
return prospective >= self._coerce_version(spec)
def _compare_less_than(self, prospective, spec):
return prospective < self._coerce_version(spec)
def _compare_greater_than(self, prospective, spec):
return prospective > self._coerce_version(spec)
def _require_version_compare(fn):
@functools.wraps(fn)
def wrapped(self, prospective, spec):
if not isinstance(prospective, Version):
return False
return fn(self, prospective, spec)
return wrapped
class Specifier(_IndividualSpecifier):
_regex_str = (
r"""
(?P<operator>(~=|==|!=|<=|>=|<|>|===))
(?P<version>
(?:
# The identity operators allow for an escape hatch that will
# do an exact string match of the version you wish to install.
# This will not be parsed by PEP 440 and we cannot determine
# any semantic meaning from it. This operator is discouraged
# but included entirely as an escape hatch.
(?<====) # Only match for the identity operator
\s*
[^\s]* # We just match everything, except for whitespace
# since we are only testing for strict identity.
)
|
(?:
# The (non)equality operators allow for wild card and local
# versions to be specified so we have to define these two
# operators separately to enable that.
(?<===|!=) # Only match for equals and not equals
\s*
v?
(?:[0-9]+!)? # epoch
[0-9]+(?:\.[0-9]+)* # release
(?: # pre release
[-_\.]?
(a|b|c|rc|alpha|beta|pre|preview)
[-_\.]?
[0-9]*
)?
(?: # post release
(?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
)?
# You cannot use a wild card and a dev or local version
# together so group them with a | and make them optional.
(?:
(?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release
(?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
|
\.\* # Wild card syntax of .*
)?
)
|
(?:
# The compatible operator requires at least two digits in the
# release segment.
(?<=~=) # Only match for the compatible operator
\s*
v?
(?:[0-9]+!)? # epoch
[0-9]+(?:\.[0-9]+)+ # release (We have a + instead of a *)
(?: # pre release
[-_\.]?
(a|b|c|rc|alpha|beta|pre|preview)
[-_\.]?
[0-9]*
)?
(?: # post release
(?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
)?
(?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release
)
|
(?:
# All other operators only allow a sub set of what the
# (non)equality operators do. Specifically they do not allow
# local versions to be specified nor do they allow the prefix
# matching wild cards.
(?<!==|!=|~=) # We have special cases for these
# operators so we want to make sure they
# don't match here.
\s*
v?
(?:[0-9]+!)? # epoch
[0-9]+(?:\.[0-9]+)* # release
(?: # pre release
[-_\.]?
(a|b|c|rc|alpha|beta|pre|preview)
[-_\.]?
[0-9]*
)?
(?: # post release
(?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
)?
(?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release
)
)
"""
)
_regex = re.compile(
r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE)
_operators = {
"~=": "compatible",
"==": "equal",
"!=": "not_equal",
"<=": "less_than_equal",
">=": "greater_than_equal",
"<": "less_than",
">": "greater_than",
"===": "arbitrary",
}
@_require_version_compare
def _compare_compatible(self, prospective, spec):
# Compatible releases have an equivalent combination of >= and ==. That
# is that ~=2.2 is equivalent to >=2.2,==2.*. This allows us to
# implement this in terms of the other specifiers instead of
# implementing it ourselves. The only thing we need to do is construct
# the other specifiers.
# We want everything but the last item in the version, but we want to
# ignore post and dev releases and we want to treat the pre-release as
# it's own separate segment.
prefix = ".".join(
list(
itertools.takewhile(
lambda x: (not x.startswith("post") and not
x.startswith("dev")),
_version_split(spec),
)
)[:-1]
)
# Add the prefix notation to the end of our string
prefix += ".*"
return (self._get_operator(">=")(prospective, spec) and
self._get_operator("==")(prospective, prefix))
@_require_version_compare
def _compare_equal(self, prospective, spec):
# We need special logic to handle prefix matching
if spec.endswith(".*"):
# In the case of prefix matching we want to ignore local segment.
prospective = Version(prospective.public)
# Split the spec out by dots, and pretend that there is an implicit
# dot in between a release segment and a pre-release segment.
spec = _version_split(spec[:-2]) # Remove the trailing .*
# Split the prospective version out by dots, and pretend that there
# is an implicit dot in between a release segment and a pre-release
# segment.
prospective = _version_split(str(prospective))
# Shorten the prospective version to be the same length as the spec
# so that we can determine if the specifier is a prefix of the
# prospective version or not.
prospective = prospective[:len(spec)]
# Pad out our two sides with zeros so that they both equal the same
# length.
spec, prospective = _pad_version(spec, prospective)
else:
# Convert our spec string into a Version
spec = Version(spec)
# If the specifier does not have a local segment, then we want to
# act as if the prospective version also does not have a local
# segment.
if not spec.local:
prospective = Version(prospective.public)
return prospective == spec
@_require_version_compare
def _compare_not_equal(self, prospective, spec):
return not self._compare_equal(prospective, spec)
@_require_version_compare
def _compare_less_than_equal(self, prospective, spec):
return prospective <= Version(spec)
@_require_version_compare
def _compare_greater_than_equal(self, prospective, spec):
return prospective >= Version(spec)
@_require_version_compare
def _compare_less_than(self, prospective, spec):
# Convert our spec to a Version instance, since we'll want to work with
# it as a version.
spec = Version(spec)
# Check to see if the prospective version is less than the spec
# version. If it's not we can short circuit and just return False now
# instead of doing extra unneeded work.
if not prospective < spec:
return False
# This special case is here so that, unless the specifier itself
# includes is a pre-release version, that we do not accept pre-release
# versions for the version mentioned in the specifier (e.g. <3.1 should
# not match 3.1.dev0, but should match 3.0.dev0).
if not spec.is_prerelease and prospective.is_prerelease:
if Version(prospective.base_version) == Version(spec.base_version):
return False
# If we've gotten to here, it means that prospective version is both
# less than the spec version *and* it's not a pre-release of the same
# version in the spec.
return True
@_require_version_compare
def _compare_greater_than(self, prospective, spec):
# Convert our spec to a Version instance, since we'll want to work with
# it as a version.
spec = Version(spec)
# Check to see if the prospective version is greater than the spec
# version. If it's not we can short circuit and just return False now
# instead of doing extra unneeded work.
if not prospective > spec:
return False
# This special case is here so that, unless the specifier itself
# includes is a post-release version, that we do not accept
# post-release versions for the version mentioned in the specifier
# (e.g. >3.1 should not match 3.0.post0, but should match 3.2.post0).
if not spec.is_postrelease and prospective.is_postrelease:
if Version(prospective.base_version) == Version(spec.base_version):
return False
# Ensure that we do not allow a local version of the version mentioned
# in the specifier, which is techincally greater than, to match.
if prospective.local is not None:
if Version(prospective.base_version) == Version(spec.base_version):
return False
# If we've gotten to here, it means that prospective version is both
# greater than the spec version *and* it's not a pre-release of the
# same version in the spec.
return True
def _compare_arbitrary(self, prospective, spec):
return str(prospective).lower() == str(spec).lower()
@property
def prereleases(self):
# If there is an explicit prereleases set for this, then we'll just
# blindly use that.
if self._prereleases is not None:
return self._prereleases
# Look at all of our specifiers and determine if they are inclusive
# operators, and if they are if they are including an explicit
# prerelease.
operator, version = self._spec
if operator in ["==", ">=", "<=", "~=", "==="]:
# The == specifier can include a trailing .*, if it does we
# want to remove before parsing.
if operator == "==" and version.endswith(".*"):
version = version[:-2]
# Parse the version, and if it is a pre-release than this
# specifier allows pre-releases.
if parse(version).is_prerelease:
return True
return False
@prereleases.setter
def prereleases(self, value):
self._prereleases = value
_prefix_regex = re.compile(r"^([0-9]+)((?:a|b|c|rc)[0-9]+)$")
def _version_split(version):
result = []
for item in version.split("."):
match = _prefix_regex.search(item)
if match:
result.extend(match.groups())
else:
result.append(item)
return result
def _pad_version(left, right):
left_split, right_split = [], []
# Get the release segment of our versions
left_split.append(list(itertools.takewhile(lambda x: x.isdigit(), left)))
right_split.append(list(itertools.takewhile(lambda x: x.isdigit(), right)))
# Get the rest of our versions
left_split.append(left[len(left_split[0]):])
right_split.append(right[len(right_split[0]):])
# Insert our padding
left_split.insert(
1,
["0"] * max(0, len(right_split[0]) - len(left_split[0])),
)
right_split.insert(
1,
["0"] * max(0, len(left_split[0]) - len(right_split[0])),
)
return (
list(itertools.chain(*left_split)),
list(itertools.chain(*right_split)),
)
class SpecifierSet(BaseSpecifier):
def __init__(self, specifiers="", prereleases=None):
# Split on , to break each indidivual specifier into it's own item, and
# strip each item to remove leading/trailing whitespace.
specifiers = [s.strip() for s in specifiers.split(",") if s.strip()]
# Parsed each individual specifier, attempting first to make it a
# Specifier and falling back to a LegacySpecifier.
parsed = set()
for specifier in specifiers:
try:
parsed.add(Specifier(specifier))
except InvalidSpecifier:
parsed.add(LegacySpecifier(specifier))
# Turn our parsed specifiers into a frozen set and save them for later.
self._specs = frozenset(parsed)
# Store our prereleases value so we can use it later to determine if
# we accept prereleases or not.
self._prereleases = prereleases
def __repr__(self):
pre = (
", prereleases={0!r}".format(self.prereleases)
if self._prereleases is not None
else ""
)
return "<SpecifierSet({0!r}{1})>".format(str(self), pre)
def __str__(self):
return ",".join(sorted(str(s) for s in self._specs))
def __hash__(self):
return hash(self._specs)
def __and__(self, other):
if isinstance(other, string_types):
other = SpecifierSet(other)
elif not isinstance(other, SpecifierSet):
return NotImplemented
specifier = SpecifierSet()
specifier._specs = frozenset(self._specs | other._specs)
if self._prereleases is None and other._prereleases is not None:
specifier._prereleases = other._prereleases
elif self._prereleases is not None and other._prereleases is None:
specifier._prereleases = self._prereleases
elif self._prereleases == other._prereleases:
specifier._prereleases = self._prereleases
else:
raise ValueError(
"Cannot combine SpecifierSets with True and False prerelease "
"overrides."
)
return specifier
def __eq__(self, other):
if isinstance(other, string_types):
other = SpecifierSet(other)
elif isinstance(other, _IndividualSpecifier):
other = SpecifierSet(str(other))
elif not isinstance(other, SpecifierSet):
return NotImplemented
return self._specs == other._specs
def __ne__(self, other):
if isinstance(other, string_types):
other = SpecifierSet(other)
elif isinstance(other, _IndividualSpecifier):
other = SpecifierSet(str(other))
elif not isinstance(other, SpecifierSet):
return NotImplemented
return self._specs != other._specs
def __len__(self):
return len(self._specs)
def __iter__(self):
return iter(self._specs)
@property
def prereleases(self):
# If we have been given an explicit prerelease modifier, then we'll
# pass that through here.
if self._prereleases is not None:
return self._prereleases
# If we don't have any specifiers, and we don't have a forced value,
# then we'll just return None since we don't know if this should have
# pre-releases or not.
if not self._specs:
return None
# Otherwise we'll see if any of the given specifiers accept
# prereleases, if any of them do we'll return True, otherwise False.
return any(s.prereleases for s in self._specs)
@prereleases.setter
def prereleases(self, value):
self._prereleases = value
def __contains__(self, item):
return self.contains(item)
def contains(self, item, prereleases=None):
# Ensure that our item is a Version or LegacyVersion instance.
if not isinstance(item, (LegacyVersion, Version)):
item = parse(item)
# Determine if we're forcing a prerelease or not, if we're not forcing
# one for this particular filter call, then we'll use whatever the
# SpecifierSet thinks for whether or not we should support prereleases.
if prereleases is None:
prereleases = self.prereleases
# We can determine if we're going to allow pre-releases by looking to
# see if any of the underlying items supports them. If none of them do
# and this item is a pre-release then we do not allow it and we can
# short circuit that here.
# Note: This means that 1.0.dev1 would not be contained in something
# like >=1.0.devabc however it would be in >=1.0.debabc,>0.0.dev0
if not prereleases and item.is_prerelease:
return False
# We simply dispatch to the underlying specs here to make sure that the
# given version is contained within all of them.
# Note: This use of all() here means that an empty set of specifiers
# will always return True, this is an explicit design decision.
return all(
s.contains(item, prereleases=prereleases)
for s in self._specs
)
def filter(self, iterable, prereleases=None):
# Determine if we're forcing a prerelease or not, if we're not forcing
# one for this particular filter call, then we'll use whatever the
# SpecifierSet thinks for whether or not we should support prereleases.
if prereleases is None:
prereleases = self.prereleases
# If we have any specifiers, then we want to wrap our iterable in the
# filter method for each one, this will act as a logical AND amongst
# each specifier.
if self._specs:
for spec in self._specs:
iterable = spec.filter(iterable, prereleases=bool(prereleases))
return iterable
# If we do not have any specifiers, then we need to have a rough filter
# which will filter out any pre-releases, unless there are no final
# releases, and which will filter out LegacyVersion in general.
else:
filtered = []
found_prereleases = []
for item in iterable:
# Ensure that we some kind of Version class for this item.
if not isinstance(item, (LegacyVersion, Version)):
parsed_version = parse(item)
else:
parsed_version = item
# Filter out any item which is parsed as a LegacyVersion
if isinstance(parsed_version, LegacyVersion):
continue
# Store any item which is a pre-release for later unless we've
# already found a final version or we are accepting prereleases
if parsed_version.is_prerelease and not prereleases:
if not filtered:
found_prereleases.append(item)
else:
filtered.append(item)
# If we've found no items except for pre-releases, then we'll go
# ahead and use the pre-releases
if not filtered and found_prereleases and prereleases is None:
return found_prereleases
return filtered
|
mit
|
[
3,
961,
570,
365,
21164,
18233,
1334,
314,
2895,
402,
314,
3668,
844,
12,
3394,
199,
3,
499,
14,
16,
12,
436,
314,
6289,
844,
14,
1666,
314,
5113,
570,
315,
314,
1738,
402,
642,
7611,
199,
3,
367,
4890,
2436,
14,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
12,
4629,
12,
870,
63,
1593,
199,
199,
646,
13022,
199,
646,
9143,
199,
646,
7975,
199,
646,
295,
199,
199,
504,
13653,
5819,
492,
1059,
63,
1313,
12,
543,
63,
6577,
199,
504,
1275,
1023,
492,
3394,
12,
26251,
3353,
12,
2198,
421,
199,
533,
6378,
6154,
3895,
8,
3393,
304,
272,
408,
272,
1626,
3866,
16628,
1990,
1911,
12,
4390,
1077,
10618,
370,
13663,
841,
2167,
14,
272,
408,
421,
199,
533,
3523,
6154,
3895,
8,
1045,
63,
6577,
8,
3175,
14,
22254,
12,
909,
2298,
339,
768,
3175,
14,
10315,
272,
347,
636,
495,
721,
277,
304,
267,
408,
267,
1803,
314,
620,
6025,
402,
642,
5367,
3895,
2839,
909,
14,
961,
267,
1077,
506,
2954,
1905,
402,
314,
5367,
3895,
6337,
14,
267,
408,
339,
768,
3175,
14,
10315,
272,
347,
636,
2227,
721,
277,
304,
267,
408,
267,
1803,
282,
2631,
574,
367,
642,
5367,
3895,
2839,
909,
14,
267,
408,
339,
768,
3175,
14,
10315,
272,
347,
636,
4077,
721,
277,
12,
1163,
304,
267,
408,
267,
1803,
282,
5046,
6144,
3775,
503,
440,
314,
2877,
5367,
3895,
2839,
267,
2251,
787,
4472,
14,
267,
408,
339,
768,
3175,
14,
10315,
272,
347,
636,
685,
721,
277,
12,
1163,
304,
267,
408,
267,
1803,
282,
5046,
6144,
3775,
503,
440,
314,
2877,
5367,
3895,
2839,
267,
2251,
787,
440,
4472,
14,
267,
408,
339,
768,
3175,
14,
6198,
1829,
272,
347,
24045,
8,
277,
304,
267,
408,
267,
1803,
3775,
503,
440,
876,
13,
11840,
465,
282,
8852,
787,
4370,
701,
642,
267,
16628,
14,
267,
408,
339,
768,
25648,
14,
8345,
272,
347,
24045,
8,
277,
12,
574,
304,
267,
408,
267,
10729,
3775,
503,
440,
876,
13,
11840,
465,
282,
8852,
787,
4370,
701,
642,
267,
16628,
14,
267,
408,
339,
768,
3175,
14,
10315,
272,
347,
3509,
8,
277,
12,
1242,
12,
24045,
29,
403,
304,
267,
408,
267,
22391,
340,
314,
1627,
1242,
365,
10470,
4453,
642,
16628,
14,
267,
408,
339,
768,
3175,
14,
10315,
272,
347,
2457,
8,
277,
12,
6076,
12,
24045,
29,
403,
304,
267,
408,
267,
17415,
376,
6076,
402,
2974,
436,
4766,
3062,
880,
626,
1454,
2974,
1314,
267,
787,
10470,
4453,
642,
16628,
787,
4370,
315,
652,
14,
267,
408,
421,
199,
533,
485,
28604,
6154,
3895,
8,
1563,
6154,
3895,
304,
339,
485,
12688,
275,
1052,
339,
347,
636,
826,
721,
277,
12,
3158,
8772,
24045,
29,
403,
304,
267,
1336,
275,
291,
423,
3821,
14,
1733,
8,
1650,
9,
267,
340,
440,
1336,
26,
288,
746,
6378,
6154,
3895,
480,
3364,
16628,
26,
5041,
16,
30366,
908,
8,
1650,
430,
398,
291,
423,
1650,
275,
334,
288,
1336,
14,
923,
480,
3856,
3471,
1913,
1062,
288,
1336,
14,
923,
480,
1023,
3471,
1913,
1062,
267,
776,
398,
327,
13874,
3775,
503,
440,
642,
5367,
3895,
1077,
4729,
24045,
267,
291,
423,
25648,
275,
24045,
339,
347,
636,
2722,
721,
277,
304,
267,
876,
275,
334,
288,
3872,
24045,
3126,
16,
1,
82,
5469,
908,
8,
277,
14,
25648,
9,
288,
340,
291,
423,
25648,
365,
440,
488,
288,
587,
3087,
267,
776,
398,
372,
3886,
91,
16,
93,
2561,
17,
1,
82,
8847,
18,
1552,
23167,
908,
8,
288,
291,
855,
533,
4914,
354,
3108,
288,
620,
8,
277,
395,
288,
876,
12,
267,
776,
339,
347,
636,
495,
721,
277,
304,
267,
372,
5310,
16,
8847,
17,
5469,
908,
2031,
277,
423,
1650,
9,
339,
347,
636,
2227,
721,
277,
304,
267,
372,
2631,
8,
277,
423,
1650,
9,
339,
347,
636,
4077,
721,
277,
12,
1163,
304,
267,
340,
1228,
8,
1848,
12,
1059,
63,
1313,
304,
288,
862,
26,
355,
1163,
275,
291,
855,
533,
721,
1848,
9,
288,
871,
6378,
6154,
3895,
26,
355,
372,
3784,
267,
916,
440,
1228,
8,
1848,
12,
291,
855,
533,
18580,
288,
372,
3784,
398,
372,
291,
423,
1650,
508,
1163,
423,
1650,
339,
347,
636,
685,
721,
277,
12,
1163,
304,
267,
340,
1228,
8,
1848,
12,
1059,
63,
1313,
304,
288,
862,
26,
355,
1163,
275,
291,
855,
533,
721,
1848,
9,
288,
871,
6378,
6154,
3895,
26,
355,
372,
3784,
267,
916,
440,
1228,
8,
1848,
12,
291,
855,
533,
18580,
288,
372,
3784,
398,
372,
291,
423,
1650,
1137,
1163,
423,
1650,
339,
347,
485,
362,
63,
3856,
8,
277,
12,
1687,
304,
267,
372,
2519,
8,
277,
12,
2668,
5785,
7348,
16,
5469,
908,
8,
277,
423,
12688,
59,
411,
2459,
339,
347,
485,
14141,
63,
1023,
8,
277,
12,
1015,
304,
267,
340,
440,
1228,
8,
1023,
12,
334,
22628,
3353,
12,
3394,
2298,
288,
1015,
275,
2198,
8,
1023,
9,
267,
372,
1015,
339,
768,
1829,
272,
347,
4182,
8,
277,
304,
267,
372,
291,
423,
1650,
59,
16,
61,
339,
768,
1829,
272,
347,
1015,
8,
277,
304,
267,
372,
291,
423,
1650,
59,
17,
61,
339,
768,
1829,
272,
347,
24045,
8,
277,
304,
267,
372,
291,
423,
25648,
339,
768,
25648,
14,
8345,
272,
347,
24045,
8,
277,
12,
574,
304,
267,
291,
423,
25648,
275,
574,
339,
347,
636,
6134,
721,
277,
12,
1242,
304,
267,
372,
291,
14,
6134,
8,
1053,
9,
339,
347,
3509,
8,
277,
12,
1242,
12,
24045,
29,
403,
304,
267,
327,
14703,
340,
24045,
787,
370,
506,
4370,
503,
440,
14,
267,
340,
24045,
365,
488,
26,
288,
24045,
275,
291,
14,
25648,
398,
327,
21017,
1242,
370,
282,
3394,
503,
26251,
3353,
12,
642,
6127,
2739,
370,
1172,
267,
327,
282,
17522,
367,
25916,
18,
14,
16,
2,
315,
5367,
3895,
480,
8119,
18,
531,
267,
1242,
275,
291,
423,
14141,
63,
1023,
8,
1053,
9,
398,
327,
14703,
340,
781,
1077,
506,
21038,
24045,
315,
642,
16628,
267,
327,
503,
440,
12,
340,
781,
886,
440,
2291,
24045,
2419,
781,
883,
3974,
20304,
267,
327
] |
[
961,
570,
365,
21164,
18233,
1334,
314,
2895,
402,
314,
3668,
844,
12,
3394,
199,
3,
499,
14,
16,
12,
436,
314,
6289,
844,
14,
1666,
314,
5113,
570,
315,
314,
1738,
402,
642,
7611,
199,
3,
367,
4890,
2436,
14,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
12,
4629,
12,
870,
63,
1593,
199,
199,
646,
13022,
199,
646,
9143,
199,
646,
7975,
199,
646,
295,
199,
199,
504,
13653,
5819,
492,
1059,
63,
1313,
12,
543,
63,
6577,
199,
504,
1275,
1023,
492,
3394,
12,
26251,
3353,
12,
2198,
421,
199,
533,
6378,
6154,
3895,
8,
3393,
304,
272,
408,
272,
1626,
3866,
16628,
1990,
1911,
12,
4390,
1077,
10618,
370,
13663,
841,
2167,
14,
272,
408,
421,
199,
533,
3523,
6154,
3895,
8,
1045,
63,
6577,
8,
3175,
14,
22254,
12,
909,
2298,
339,
768,
3175,
14,
10315,
272,
347,
636,
495,
721,
277,
304,
267,
408,
267,
1803,
314,
620,
6025,
402,
642,
5367,
3895,
2839,
909,
14,
961,
267,
1077,
506,
2954,
1905,
402,
314,
5367,
3895,
6337,
14,
267,
408,
339,
768,
3175,
14,
10315,
272,
347,
636,
2227,
721,
277,
304,
267,
408,
267,
1803,
282,
2631,
574,
367,
642,
5367,
3895,
2839,
909,
14,
267,
408,
339,
768,
3175,
14,
10315,
272,
347,
636,
4077,
721,
277,
12,
1163,
304,
267,
408,
267,
1803,
282,
5046,
6144,
3775,
503,
440,
314,
2877,
5367,
3895,
2839,
267,
2251,
787,
4472,
14,
267,
408,
339,
768,
3175,
14,
10315,
272,
347,
636,
685,
721,
277,
12,
1163,
304,
267,
408,
267,
1803,
282,
5046,
6144,
3775,
503,
440,
314,
2877,
5367,
3895,
2839,
267,
2251,
787,
440,
4472,
14,
267,
408,
339,
768,
3175,
14,
6198,
1829,
272,
347,
24045,
8,
277,
304,
267,
408,
267,
1803,
3775,
503,
440,
876,
13,
11840,
465,
282,
8852,
787,
4370,
701,
642,
267,
16628,
14,
267,
408,
339,
768,
25648,
14,
8345,
272,
347,
24045,
8,
277,
12,
574,
304,
267,
408,
267,
10729,
3775,
503,
440,
876,
13,
11840,
465,
282,
8852,
787,
4370,
701,
642,
267,
16628,
14,
267,
408,
339,
768,
3175,
14,
10315,
272,
347,
3509,
8,
277,
12,
1242,
12,
24045,
29,
403,
304,
267,
408,
267,
22391,
340,
314,
1627,
1242,
365,
10470,
4453,
642,
16628,
14,
267,
408,
339,
768,
3175,
14,
10315,
272,
347,
2457,
8,
277,
12,
6076,
12,
24045,
29,
403,
304,
267,
408,
267,
17415,
376,
6076,
402,
2974,
436,
4766,
3062,
880,
626,
1454,
2974,
1314,
267,
787,
10470,
4453,
642,
16628,
787,
4370,
315,
652,
14,
267,
408,
421,
199,
533,
485,
28604,
6154,
3895,
8,
1563,
6154,
3895,
304,
339,
485,
12688,
275,
1052,
339,
347,
636,
826,
721,
277,
12,
3158,
8772,
24045,
29,
403,
304,
267,
1336,
275,
291,
423,
3821,
14,
1733,
8,
1650,
9,
267,
340,
440,
1336,
26,
288,
746,
6378,
6154,
3895,
480,
3364,
16628,
26,
5041,
16,
30366,
908,
8,
1650,
430,
398,
291,
423,
1650,
275,
334,
288,
1336,
14,
923,
480,
3856,
3471,
1913,
1062,
288,
1336,
14,
923,
480,
1023,
3471,
1913,
1062,
267,
776,
398,
327,
13874,
3775,
503,
440,
642,
5367,
3895,
1077,
4729,
24045,
267,
291,
423,
25648,
275,
24045,
339,
347,
636,
2722,
721,
277,
304,
267,
876,
275,
334,
288,
3872,
24045,
3126,
16,
1,
82,
5469,
908,
8,
277,
14,
25648,
9,
288,
340,
291,
423,
25648,
365,
440,
488,
288,
587,
3087,
267,
776,
398,
372,
3886,
91,
16,
93,
2561,
17,
1,
82,
8847,
18,
1552,
23167,
908,
8,
288,
291,
855,
533,
4914,
354,
3108,
288,
620,
8,
277,
395,
288,
876,
12,
267,
776,
339,
347,
636,
495,
721,
277,
304,
267,
372,
5310,
16,
8847,
17,
5469,
908,
2031,
277,
423,
1650,
9,
339,
347,
636,
2227,
721,
277,
304,
267,
372,
2631,
8,
277,
423,
1650,
9,
339,
347,
636,
4077,
721,
277,
12,
1163,
304,
267,
340,
1228,
8,
1848,
12,
1059,
63,
1313,
304,
288,
862,
26,
355,
1163,
275,
291,
855,
533,
721,
1848,
9,
288,
871,
6378,
6154,
3895,
26,
355,
372,
3784,
267,
916,
440,
1228,
8,
1848,
12,
291,
855,
533,
18580,
288,
372,
3784,
398,
372,
291,
423,
1650,
508,
1163,
423,
1650,
339,
347,
636,
685,
721,
277,
12,
1163,
304,
267,
340,
1228,
8,
1848,
12,
1059,
63,
1313,
304,
288,
862,
26,
355,
1163,
275,
291,
855,
533,
721,
1848,
9,
288,
871,
6378,
6154,
3895,
26,
355,
372,
3784,
267,
916,
440,
1228,
8,
1848,
12,
291,
855,
533,
18580,
288,
372,
3784,
398,
372,
291,
423,
1650,
1137,
1163,
423,
1650,
339,
347,
485,
362,
63,
3856,
8,
277,
12,
1687,
304,
267,
372,
2519,
8,
277,
12,
2668,
5785,
7348,
16,
5469,
908,
8,
277,
423,
12688,
59,
411,
2459,
339,
347,
485,
14141,
63,
1023,
8,
277,
12,
1015,
304,
267,
340,
440,
1228,
8,
1023,
12,
334,
22628,
3353,
12,
3394,
2298,
288,
1015,
275,
2198,
8,
1023,
9,
267,
372,
1015,
339,
768,
1829,
272,
347,
4182,
8,
277,
304,
267,
372,
291,
423,
1650,
59,
16,
61,
339,
768,
1829,
272,
347,
1015,
8,
277,
304,
267,
372,
291,
423,
1650,
59,
17,
61,
339,
768,
1829,
272,
347,
24045,
8,
277,
304,
267,
372,
291,
423,
25648,
339,
768,
25648,
14,
8345,
272,
347,
24045,
8,
277,
12,
574,
304,
267,
291,
423,
25648,
275,
574,
339,
347,
636,
6134,
721,
277,
12,
1242,
304,
267,
372,
291,
14,
6134,
8,
1053,
9,
339,
347,
3509,
8,
277,
12,
1242,
12,
24045,
29,
403,
304,
267,
327,
14703,
340,
24045,
787,
370,
506,
4370,
503,
440,
14,
267,
340,
24045,
365,
488,
26,
288,
24045,
275,
291,
14,
25648,
398,
327,
21017,
1242,
370,
282,
3394,
503,
26251,
3353,
12,
642,
6127,
2739,
370,
1172,
267,
327,
282,
17522,
367,
25916,
18,
14,
16,
2,
315,
5367,
3895,
480,
8119,
18,
531,
267,
1242,
275,
291,
423,
14141,
63,
1023,
8,
1053,
9,
398,
327,
14703,
340,
781,
1077,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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
llann/django-filebrowser
|
setup.py
|
5
|
1335
|
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-filebrowser',
version='3.5.7',
description='Media-Management with Grappelli',
long_description = read('README.rst'),
url = 'http://django-filebrowser.readthedocs.org',
download_url='',
author='Patrick Kranzlmueller, Axel Swoboda (vonautomatisch)',
author_email='office@vonautomatisch.at',
license='BSD',
packages=find_packages(),
include_package_data=True,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
],
zip_safe = False,
install_requires = [
'django-grappelli>=2.4,<2.6.99',
],
)
|
bsd-3-clause
|
[
646,
747,
199,
504,
9116,
492,
3272,
12,
2342,
63,
5154,
199,
199,
318,
1586,
8,
5252,
304,
272,
372,
1551,
8,
736,
14,
515,
14,
904,
8,
736,
14,
515,
14,
3475,
3460,
493,
10139,
6748,
4992,
739,
342,
199,
199,
2758,
8,
272,
536,
534,
1176,
13,
493,
5750,
297,
272,
1015,
534,
19,
14,
21,
14,
23,
297,
272,
1369,
534,
11398,
13,
14552,
543,
598,
5034,
13876,
297,
272,
1846,
63,
1802,
275,
1586,
360,
18195,
14,
8332,
659,
272,
1166,
275,
283,
1014,
921,
1176,
13,
493,
5750,
14,
25085,
14,
1308,
297,
272,
5235,
63,
633,
4581,
272,
4132,
534,
48,
292,
27091,
1804,
1312,
90,
14344,
13086,
1435,
12,
437,
31418,
428,
32517,
364,
65,
334,
86,
265,
2495,
391,
280,
15820,
3196,
272,
4132,
63,
2123,
534,
18812,
32,
86,
265,
2495,
391,
280,
15820,
14,
292,
297,
272,
4190,
534,
15400,
297,
272,
6117,
29,
1623,
63,
5154,
1062,
272,
2387,
63,
2491,
63,
576,
29,
549,
12,
272,
19137,
1524,
267,
283,
23753,
9795,
3800,
959,
446,
24114,
15,
933,
461,
297,
267,
283,
8263,
3800,
6001,
9711,
297,
267,
283,
16442,
3800,
5634,
297,
267,
283,
23910,
23975,
3800,
23493,
297,
267,
283,
3761,
3800,
25718,
26330,
3800,
6289,
844,
297,
267,
283,
23699,
6187,
3800,
4403,
1010,
7106,
297,
267,
283,
11411,
8466,
3800,
2018,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
499,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
499,
14,
22,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
499,
14,
23,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
650,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
650,
14,
17,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
650,
14,
18,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
650,
14,
19,
297,
272,
2156,
272,
3482,
63,
3489,
275,
756,
12,
272,
3907,
63,
6537,
275,
359,
267,
283,
1176,
13,
926,
80,
321,
13876,
8119,
18,
14,
20,
30027,
18,
14,
22,
14,
1020,
297,
272,
2156,
199,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
747,
199,
504,
9116,
492,
3272,
12,
2342,
63,
5154,
199,
199,
318,
1586,
8,
5252,
304,
272,
372,
1551,
8,
736,
14,
515,
14,
904,
8,
736,
14,
515,
14,
3475,
3460,
493,
10139,
6748,
4992,
739,
342,
199,
199,
2758,
8,
272,
536,
534,
1176,
13,
493,
5750,
297,
272,
1015,
534,
19,
14,
21,
14,
23,
297,
272,
1369,
534,
11398,
13,
14552,
543,
598,
5034,
13876,
297,
272,
1846,
63,
1802,
275,
1586,
360,
18195,
14,
8332,
659,
272,
1166,
275,
283,
1014,
921,
1176,
13,
493,
5750,
14,
25085,
14,
1308,
297,
272,
5235,
63,
633,
4581,
272,
4132,
534,
48,
292,
27091,
1804,
1312,
90,
14344,
13086,
1435,
12,
437,
31418,
428,
32517,
364,
65,
334,
86,
265,
2495,
391,
280,
15820,
3196,
272,
4132,
63,
2123,
534,
18812,
32,
86,
265,
2495,
391,
280,
15820,
14,
292,
297,
272,
4190,
534,
15400,
297,
272,
6117,
29,
1623,
63,
5154,
1062,
272,
2387,
63,
2491,
63,
576,
29,
549,
12,
272,
19137,
1524,
267,
283,
23753,
9795,
3800,
959,
446,
24114,
15,
933,
461,
297,
267,
283,
8263,
3800,
6001,
9711,
297,
267,
283,
16442,
3800,
5634,
297,
267,
283,
23910,
23975,
3800,
23493,
297,
267,
283,
3761,
3800,
25718,
26330,
3800,
6289,
844,
297,
267,
283,
23699,
6187,
3800,
4403,
1010,
7106,
297,
267,
283,
11411,
8466,
3800,
2018,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
499,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
499,
14,
22,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
499,
14,
23,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
650,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
650,
14,
17,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
650,
14,
18,
297,
267,
283,
11411,
8466,
3800,
2018,
3800,
650,
14,
19,
297,
272,
2156,
272,
3482,
63,
3489,
275,
756,
12,
272,
3907,
63,
6537,
275,
359,
267,
283,
1176,
13,
926,
80,
321,
13876,
8119,
18,
14,
20,
30027,
18,
14,
22,
14,
1020,
297,
272,
2156,
199,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
Praveen-1987/devstack-Quantumleap
|
files/pip-1.4.1/pip/vendor/html5lib/treebuilders/_base.py
|
79
|
13710
|
from __future__ import absolute_import, division, unicode_literals
from pip.vendor.six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent formatting
# from "leaking" into tables, object elements, and marquees.
Marker = None
listElementsMap = {
None: (frozenset(scopingElements), False),
"button": (frozenset(scopingElements | set([(namespaces["html"], "button")])), False),
"list": (frozenset(scopingElements | set([(namespaces["html"], "ol"),
(namespaces["html"], "ul")])), False),
"table": (frozenset([(namespaces["html"], "html"),
(namespaces["html"], "table")]), False),
"select": (frozenset([(namespaces["html"], "optgroup"),
(namespaces["html"], "option")]), True)
}
class Node(object):
def __init__(self, name):
"""Node representing an item in the tree.
name - The tag name associated with the node
parent - The parent of the current node (or None for the document node)
value - The value of the current node (applies to text nodes and
comments
attributes - a dict holding name, value pairs for attributes of the node
childNodes - a list of child nodes of the current node. This must
include all elements but not necessarily other node types
_flags - A list of miscellaneous flags that can be set on the node
"""
self.name = name
self.parent = None
self.value = None
self.attributes = {}
self.childNodes = []
self._flags = []
def __str__(self):
attributesStr = " ".join(["%s=\"%s\"" % (name, value)
for name, value in
self.attributes.items()])
if attributesStr:
return "<%s %s>" % (self.name, attributesStr)
else:
return "<%s>" % (self.name)
def __repr__(self):
return "<%s>" % (self.name)
def appendChild(self, node):
"""Insert node as a child of the current node
"""
raise NotImplementedError
def insertText(self, data, insertBefore=None):
"""Insert data as text in the current node, positioned before the
start of node insertBefore or to the end of the node's text.
"""
raise NotImplementedError
def insertBefore(self, node, refNode):
"""Insert node as a child of the current node, before refNode in the
list of child nodes. Raises ValueError if refNode is not a child of
the current node"""
raise NotImplementedError
def removeChild(self, node):
"""Remove node from the children of the current node
"""
raise NotImplementedError
def reparentChildren(self, newParent):
"""Move all the children of the current node to newParent.
This is needed so that trees that don't store text as nodes move the
text in the correct way
"""
# XXX - should this method be made more general?
for child in self.childNodes:
newParent.appendChild(child)
self.childNodes = []
def cloneNode(self):
"""Return a shallow copy of the current node i.e. a node with the same
name and attributes but with no parent or child nodes
"""
raise NotImplementedError
def hasContent(self):
"""Return true if the node has children or text, false otherwise
"""
raise NotImplementedError
class ActiveFormattingElements(list):
def append(self, node):
equalCount = 0
if node != Marker:
for element in self[::-1]:
if element == Marker:
break
if self.nodesEqual(element, node):
equalCount += 1
if equalCount == 3:
self.remove(element)
break
list.append(self, node)
def nodesEqual(self, node1, node2):
if not node1.nameTuple == node2.nameTuple:
return False
if not node1.attributes == node2.attributes:
return False
return True
class TreeBuilder(object):
"""Base treebuilder implementation
documentClass - the class to use for the bottommost node of a document
elementClass - the class to use for HTML Elements
commentClass - the class to use for comments
doctypeClass - the class to use for doctypes
"""
# Document class
documentClass = None
# The class to use for creating a node
elementClass = None
# The class to use for creating comments
commentClass = None
# The class to use for creating doctypes
doctypeClass = None
# Fragment class
fragmentClass = None
def __init__(self, namespaceHTMLElements):
if namespaceHTMLElements:
self.defaultNamespace = "http://www.w3.org/1999/xhtml"
else:
self.defaultNamespace = None
self.reset()
def reset(self):
self.openElements = []
self.activeFormattingElements = ActiveFormattingElements()
# XXX - rename these to headElement, formElement
self.headPointer = None
self.formPointer = None
self.insertFromTable = False
self.document = self.documentClass()
def elementInScope(self, target, variant=None):
# If we pass a node in we match that. if we pass a string
# match any node with that name
exactNode = hasattr(target, "nameTuple")
listElements, invert = listElementsMap[variant]
for node in reversed(self.openElements):
if (node.name == target and not exactNode or
node == target and exactNode):
return True
elif (invert ^ (node.nameTuple in listElements)):
return False
assert False # We should never reach this point
def reconstructActiveFormattingElements(self):
# Within this algorithm the order of steps described in the
# specification is not quite the same as the order of steps in the
# code. It should still do the same though.
# Step 1: stop the algorithm when there's nothing to do.
if not self.activeFormattingElements:
return
# Step 2 and step 3: we start with the last element. So i is -1.
i = len(self.activeFormattingElements) - 1
entry = self.activeFormattingElements[i]
if entry == Marker or entry in self.openElements:
return
# Step 6
while entry != Marker and entry not in self.openElements:
if i == 0:
# This will be reset to 0 below
i = -1
break
i -= 1
# Step 5: let entry be one earlier in the list.
entry = self.activeFormattingElements[i]
while True:
# Step 7
i += 1
# Step 8
entry = self.activeFormattingElements[i]
clone = entry.cloneNode() # Mainly to get a new copy of the attributes
# Step 9
element = self.insertElement({"type": "StartTag",
"name": clone.name,
"namespace": clone.namespace,
"data": clone.attributes})
# Step 10
self.activeFormattingElements[i] = element
# Step 11
if element == self.activeFormattingElements[-1]:
break
def clearActiveFormattingElements(self):
entry = self.activeFormattingElements.pop()
while self.activeFormattingElements and entry != Marker:
entry = self.activeFormattingElements.pop()
def elementInActiveFormattingElements(self, name):
"""Check if an element exists between the end of the active
formatting elements and the last marker. If it does, return it, else
return false"""
for item in self.activeFormattingElements[::-1]:
# Check for Marker first because if it's a Marker it doesn't have a
# name attribute.
if item == Marker:
break
elif item.name == name:
return item
return False
def insertRoot(self, token):
element = self.createElement(token)
self.openElements.append(element)
self.document.appendChild(element)
def insertDoctype(self, token):
name = token["name"]
publicId = token["publicId"]
systemId = token["systemId"]
doctype = self.doctypeClass(name, publicId, systemId)
self.document.appendChild(doctype)
def insertComment(self, token, parent=None):
if parent is None:
parent = self.openElements[-1]
parent.appendChild(self.commentClass(token["data"]))
def createElement(self, token):
"""Create an element but don't insert it anywhere"""
name = token["name"]
namespace = token.get("namespace", self.defaultNamespace)
element = self.elementClass(name, namespace)
element.attributes = token["data"]
return element
def _getInsertFromTable(self):
return self._insertFromTable
def _setInsertFromTable(self, value):
"""Switch the function used to insert an element from the
normal one to the misnested table one and back again"""
self._insertFromTable = value
if value:
self.insertElement = self.insertElementTable
else:
self.insertElement = self.insertElementNormal
insertFromTable = property(_getInsertFromTable, _setInsertFromTable)
def insertElementNormal(self, token):
name = token["name"]
assert isinstance(name, text_type), "Element %s not unicode" % name
namespace = token.get("namespace", self.defaultNamespace)
element = self.elementClass(name, namespace)
element.attributes = token["data"]
self.openElements[-1].appendChild(element)
self.openElements.append(element)
return element
def insertElementTable(self, token):
"""Create an element and insert it into the tree"""
element = self.createElement(token)
if self.openElements[-1].name not in tableInsertModeElements:
return self.insertElementNormal(token)
else:
# We should be in the InTable mode. This means we want to do
# special magic element rearranging
parent, insertBefore = self.getTableMisnestedNodePosition()
if insertBefore is None:
parent.appendChild(element)
else:
parent.insertBefore(element, insertBefore)
self.openElements.append(element)
return element
def insertText(self, data, parent=None):
"""Insert text data."""
if parent is None:
parent = self.openElements[-1]
if (not self.insertFromTable or (self.insertFromTable and
self.openElements[-1].name
not in tableInsertModeElements)):
parent.insertText(data)
else:
# We should be in the InTable mode. This means we want to do
# special magic element rearranging
parent, insertBefore = self.getTableMisnestedNodePosition()
parent.insertText(data, insertBefore)
def getTableMisnestedNodePosition(self):
"""Get the foster parent element, and sibling to insert before
(or None) when inserting a misnested table node"""
# The foster parent element is the one which comes before the most
# recently opened table element
# XXX - this is really inelegant
lastTable = None
fosterParent = None
insertBefore = None
for elm in self.openElements[::-1]:
if elm.name == "table":
lastTable = elm
break
if lastTable:
# XXX - we should really check that this parent is actually a
# node here
if lastTable.parent:
fosterParent = lastTable.parent
insertBefore = lastTable
else:
fosterParent = self.openElements[
self.openElements.index(lastTable) - 1]
else:
fosterParent = self.openElements[0]
return fosterParent, insertBefore
def generateImpliedEndTags(self, exclude=None):
name = self.openElements[-1].name
# XXX td, th and tr are not actually needed
if (name in frozenset(("dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"))
and name != exclude):
self.openElements.pop()
# XXX This is not entirely what the specification says. We should
# investigate it more closely.
self.generateImpliedEndTags(exclude)
def getDocument(self):
"Return the final tree"
return self.document
def getFragment(self):
"Return the final fragment"
# assert self.innerHTML
fragment = self.fragmentClass()
self.openElements[0].reparentChildren(fragment)
return fragment
def testSerializer(self, node):
"""Serialize the subtree of node in the format required by unit tests
node - the node from which to start serializing"""
raise NotImplementedError
|
apache-2.0
|
[
504,
636,
2443,
363,
492,
3679,
63,
646,
12,
4629,
12,
2649,
63,
5955,
199,
504,
7305,
14,
9884,
14,
4174,
492,
1318,
63,
466,
199,
199,
504,
2508,
5559,
492,
27748,
4073,
6255,
12,
1817,
9971,
1385,
6255,
12,
10747,
199,
199,
3,
710,
4194,
14327,
787,
11788,
1380,
9509,
316,
909,
4008,
12,
199,
3,
7557,
544,
397,
12,
1817,
10106,
12,
436,
1817,
4021,
852,
12,
436,
787,
1202,
370,
7981,
10803,
199,
3,
687,
298,
274,
11124,
2,
1901,
6716,
12,
909,
4008,
12,
436,
7557,
544,
397,
14,
199,
12825,
275,
488,
199,
199,
513,
6255,
2956,
275,
469,
272,
488,
26,
334,
21362,
8,
20845,
4073,
6255,
395,
756,
395,
272,
298,
3887,
582,
334,
21362,
8,
20845,
4073,
6255,
1204,
663,
7694,
9247,
905,
1360,
2255,
298,
3887,
531,
12884,
756,
395,
272,
298,
513,
582,
334,
21362,
8,
20845,
4073,
6255,
1204,
663,
7694,
9247,
905,
1360,
2255,
298,
393,
1288,
6343,
334,
9247,
905,
1360,
2255,
298,
348,
531,
12884,
756,
395,
272,
298,
1224,
582,
334,
21362,
7694,
9247,
905,
1360,
2255,
298,
1360,
1288,
586,
334,
9247,
905,
1360,
2255,
298,
1224,
531,
2522,
756,
395,
272,
298,
2416,
582,
334,
21362,
7694,
9247,
905,
1360,
2255,
298,
2992,
923,
1288,
2079,
334,
9247,
905,
1360,
2255,
298,
1422,
531,
2522,
715,
9,
199,
93,
421,
199,
533,
5013,
8,
785,
304,
272,
347,
636,
826,
721,
277,
12,
536,
304,
267,
408,
1716,
6144,
376,
1242,
315,
314,
3123,
14,
267,
536,
446,
710,
1947,
536,
4568,
543,
314,
1031,
267,
1676,
446,
710,
1676,
402,
314,
1453,
1031,
334,
269,
488,
367,
314,
2213,
1031,
9,
267,
574,
446,
710,
574,
402,
314,
1453,
1031,
334,
571,
6528,
370,
1318,
3380,
436,
267,
6786,
267,
3004,
446,
282,
1211,
17573,
536,
12,
574,
6342,
367,
3004,
402,
314,
1031,
267,
1982,
6300,
446,
282,
769,
402,
1982,
3380,
402,
314,
1453,
1031,
14,
961,
1471,
267,
2387,
1006,
4008,
1325,
440,
20513,
1163,
1031,
2943,
267,
485,
2469,
446,
437,
769,
402,
3201,
19549,
3285,
626,
883,
506,
663,
641,
314,
1031,
267,
408,
267,
291,
14,
354,
275,
536,
267,
291,
14,
1708,
275,
488,
267,
291,
14,
585,
275,
488,
267,
291,
14,
2987,
275,
1052,
267,
291,
14,
10626,
275,
942,
267,
291,
423,
2469,
275,
942,
339,
347,
636,
495,
721,
277,
304,
267,
3004,
2848,
275,
298,
3680,
904,
30387,
83,
26766,
83,
18781,
450,
334,
354,
12,
574,
9,
3303,
367,
536,
12,
574,
315,
3303,
291,
14,
2987,
14,
1744,
9383,
267,
340,
3004,
2848,
26,
288,
372,
23054,
83,
450,
83,
4335,
450,
334,
277,
14,
354,
12,
3004,
2848,
9,
267,
587,
26,
288,
372,
23054,
83,
4335,
450,
334,
277,
14,
354,
9,
339,
347,
636,
2722,
721,
277,
304,
267,
372,
23054,
83,
4335,
450,
334,
277,
14,
354,
9,
339,
347,
5666,
3493,
8,
277,
12,
1031,
304,
267,
408,
9971,
1031,
465,
282,
1982,
402,
314,
1453,
1031,
267,
408,
267,
746,
4279,
339,
347,
5518,
1872,
8,
277,
12,
666,
12,
5518,
13569,
29,
403,
304,
267,
408,
9971,
666,
465,
1318,
315,
314,
1453,
1031,
12,
3421,
379,
2544,
314,
267,
1343,
402,
1031,
5518,
13569,
503,
370,
314,
1284,
402,
314,
1031,
1159,
1318,
14,
267,
408,
267,
746,
4279,
339,
347,
5518,
13569,
8,
277,
12,
1031,
12,
2984,
1716,
304,
267,
408,
9971,
1031,
465,
282,
1982,
402,
314,
1453,
1031,
12,
2544,
2984,
1716,
315,
314,
267,
769,
402,
1982,
3380,
14,
6218,
1722,
340,
2984,
1716,
365,
440,
282,
1982,
402,
267,
314,
1453,
1031,
624,
267,
746,
4279,
339,
347,
2813,
3493,
8,
277,
12,
1031,
304,
267,
408,
5587,
1031,
687,
314,
4978,
402,
314,
1453,
1031,
267,
408,
267,
746,
4279,
339,
347,
295,
1708,
7139,
8,
277,
12,
892,
6652,
304,
267,
408,
10370,
1006,
314,
4978,
402,
314,
1453,
1031,
370,
892,
6652,
14,
267,
961,
365,
4346,
880,
626,
14416,
626,
2793,
1133,
3877,
1318,
465,
3380,
4057,
314,
267,
1318,
315,
314,
3211,
4340,
267,
408,
267,
327,
5787,
446,
1077,
642,
1083,
506,
6326,
1655,
8605,
31,
267,
367,
1982,
315,
291,
14,
10626,
26,
288,
892,
6652,
14,
14988,
8,
1739,
9,
267,
291,
14,
10626,
275,
942,
339,
347,
7289,
1716,
8,
277,
304,
267,
408,
1767,
282,
23834,
1331,
402,
314,
1453,
1031,
284,
14,
69,
14,
282,
1031,
543,
314,
2011,
267,
536,
436,
3004,
1325,
543,
949,
1676,
503,
1982,
3380,
267,
408,
267,
746,
4279,
339,
347,
28770,
8,
277,
304,
267,
408,
1767,
2549,
340,
314,
1031,
965,
4978,
503,
1318,
12,
3055,
4257,
267,
408,
267,
746,
4279,
421,
199,
533,
23241,
26590,
8,
513,
304,
272,
347,
5666,
8,
277,
12,
1031,
304,
267,
4472,
2353,
275,
378,
267,
340,
1031,
1137,
26903,
26,
288,
367,
1819,
315,
291,
14172,
17,
2189,
355,
340,
1819,
508,
26903,
26,
490,
2059,
355,
340,
291,
14,
2415,
591,
8,
2108,
12,
1031,
304,
490,
4472,
2353,
847,
413,
355,
340,
4472,
2353,
508,
650,
26,
490,
291,
14,
2168,
8,
2108,
9,
490,
2059,
267,
769,
14,
740,
8,
277,
12,
1031,
9,
339,
347,
3380,
591,
8,
277,
12,
1031,
17,
12,
1031,
18,
304,
267,
340,
440,
1031,
17,
14,
354,
7075,
508,
1031,
18,
14,
354,
7075,
26,
288,
372,
756,
398,
340,
440,
1031,
17,
14,
2987,
508,
1031,
18,
14,
2987,
26,
288,
372,
756,
398,
372,
715,
421,
199,
533,
12178,
6437,
8,
785,
304,
272,
408,
1563,
3123,
5649,
4514,
272,
2213,
2543,
446,
314,
1021,
370,
675,
367,
314,
9048,
2786,
1031,
402,
282,
2213,
272,
1819,
2543,
446,
314,
1021,
370,
675,
367,
4163,
6566,
83,
272,
3721,
2543,
446,
314,
1021,
370,
675,
367,
6786,
272,
13265,
2543,
446,
314,
1021,
370,
675,
367,
886,
9798,
272,
408,
339,
327,
7543,
1021,
272,
2213,
2543,
275,
488,
339,
327,
710,
1021,
370,
675,
367,
6425,
282,
1031,
272,
1819,
2543,
275,
488,
339,
327,
710,
1021,
370,
675,
367,
6425,
6786,
272,
3721,
2543,
275,
488
] |
[
636,
2443,
363,
492,
3679,
63,
646,
12,
4629,
12,
2649,
63,
5955,
199,
504,
7305,
14,
9884,
14,
4174,
492,
1318,
63,
466,
199,
199,
504,
2508,
5559,
492,
27748,
4073,
6255,
12,
1817,
9971,
1385,
6255,
12,
10747,
199,
199,
3,
710,
4194,
14327,
787,
11788,
1380,
9509,
316,
909,
4008,
12,
199,
3,
7557,
544,
397,
12,
1817,
10106,
12,
436,
1817,
4021,
852,
12,
436,
787,
1202,
370,
7981,
10803,
199,
3,
687,
298,
274,
11124,
2,
1901,
6716,
12,
909,
4008,
12,
436,
7557,
544,
397,
14,
199,
12825,
275,
488,
199,
199,
513,
6255,
2956,
275,
469,
272,
488,
26,
334,
21362,
8,
20845,
4073,
6255,
395,
756,
395,
272,
298,
3887,
582,
334,
21362,
8,
20845,
4073,
6255,
1204,
663,
7694,
9247,
905,
1360,
2255,
298,
3887,
531,
12884,
756,
395,
272,
298,
513,
582,
334,
21362,
8,
20845,
4073,
6255,
1204,
663,
7694,
9247,
905,
1360,
2255,
298,
393,
1288,
6343,
334,
9247,
905,
1360,
2255,
298,
348,
531,
12884,
756,
395,
272,
298,
1224,
582,
334,
21362,
7694,
9247,
905,
1360,
2255,
298,
1360,
1288,
586,
334,
9247,
905,
1360,
2255,
298,
1224,
531,
2522,
756,
395,
272,
298,
2416,
582,
334,
21362,
7694,
9247,
905,
1360,
2255,
298,
2992,
923,
1288,
2079,
334,
9247,
905,
1360,
2255,
298,
1422,
531,
2522,
715,
9,
199,
93,
421,
199,
533,
5013,
8,
785,
304,
272,
347,
636,
826,
721,
277,
12,
536,
304,
267,
408,
1716,
6144,
376,
1242,
315,
314,
3123,
14,
267,
536,
446,
710,
1947,
536,
4568,
543,
314,
1031,
267,
1676,
446,
710,
1676,
402,
314,
1453,
1031,
334,
269,
488,
367,
314,
2213,
1031,
9,
267,
574,
446,
710,
574,
402,
314,
1453,
1031,
334,
571,
6528,
370,
1318,
3380,
436,
267,
6786,
267,
3004,
446,
282,
1211,
17573,
536,
12,
574,
6342,
367,
3004,
402,
314,
1031,
267,
1982,
6300,
446,
282,
769,
402,
1982,
3380,
402,
314,
1453,
1031,
14,
961,
1471,
267,
2387,
1006,
4008,
1325,
440,
20513,
1163,
1031,
2943,
267,
485,
2469,
446,
437,
769,
402,
3201,
19549,
3285,
626,
883,
506,
663,
641,
314,
1031,
267,
408,
267,
291,
14,
354,
275,
536,
267,
291,
14,
1708,
275,
488,
267,
291,
14,
585,
275,
488,
267,
291,
14,
2987,
275,
1052,
267,
291,
14,
10626,
275,
942,
267,
291,
423,
2469,
275,
942,
339,
347,
636,
495,
721,
277,
304,
267,
3004,
2848,
275,
298,
3680,
904,
30387,
83,
26766,
83,
18781,
450,
334,
354,
12,
574,
9,
3303,
367,
536,
12,
574,
315,
3303,
291,
14,
2987,
14,
1744,
9383,
267,
340,
3004,
2848,
26,
288,
372,
23054,
83,
450,
83,
4335,
450,
334,
277,
14,
354,
12,
3004,
2848,
9,
267,
587,
26,
288,
372,
23054,
83,
4335,
450,
334,
277,
14,
354,
9,
339,
347,
636,
2722,
721,
277,
304,
267,
372,
23054,
83,
4335,
450,
334,
277,
14,
354,
9,
339,
347,
5666,
3493,
8,
277,
12,
1031,
304,
267,
408,
9971,
1031,
465,
282,
1982,
402,
314,
1453,
1031,
267,
408,
267,
746,
4279,
339,
347,
5518,
1872,
8,
277,
12,
666,
12,
5518,
13569,
29,
403,
304,
267,
408,
9971,
666,
465,
1318,
315,
314,
1453,
1031,
12,
3421,
379,
2544,
314,
267,
1343,
402,
1031,
5518,
13569,
503,
370,
314,
1284,
402,
314,
1031,
1159,
1318,
14,
267,
408,
267,
746,
4279,
339,
347,
5518,
13569,
8,
277,
12,
1031,
12,
2984,
1716,
304,
267,
408,
9971,
1031,
465,
282,
1982,
402,
314,
1453,
1031,
12,
2544,
2984,
1716,
315,
314,
267,
769,
402,
1982,
3380,
14,
6218,
1722,
340,
2984,
1716,
365,
440,
282,
1982,
402,
267,
314,
1453,
1031,
624,
267,
746,
4279,
339,
347,
2813,
3493,
8,
277,
12,
1031,
304,
267,
408,
5587,
1031,
687,
314,
4978,
402,
314,
1453,
1031,
267,
408,
267,
746,
4279,
339,
347,
295,
1708,
7139,
8,
277,
12,
892,
6652,
304,
267,
408,
10370,
1006,
314,
4978,
402,
314,
1453,
1031,
370,
892,
6652,
14,
267,
961,
365,
4346,
880,
626,
14416,
626,
2793,
1133,
3877,
1318,
465,
3380,
4057,
314,
267,
1318,
315,
314,
3211,
4340,
267,
408,
267,
327,
5787,
446,
1077,
642,
1083,
506,
6326,
1655,
8605,
31,
267,
367,
1982,
315,
291,
14,
10626,
26,
288,
892,
6652,
14,
14988,
8,
1739,
9,
267,
291,
14,
10626,
275,
942,
339,
347,
7289,
1716,
8,
277,
304,
267,
408,
1767,
282,
23834,
1331,
402,
314,
1453,
1031,
284,
14,
69,
14,
282,
1031,
543,
314,
2011,
267,
536,
436,
3004,
1325,
543,
949,
1676,
503,
1982,
3380,
267,
408,
267,
746,
4279,
339,
347,
28770,
8,
277,
304,
267,
408,
1767,
2549,
340,
314,
1031,
965,
4978,
503,
1318,
12,
3055,
4257,
267,
408,
267,
746,
4279,
421,
199,
533,
23241,
26590,
8,
513,
304,
272,
347,
5666,
8,
277,
12,
1031,
304,
267,
4472,
2353,
275,
378,
267,
340,
1031,
1137,
26903,
26,
288,
367,
1819,
315,
291,
14172,
17,
2189,
355,
340,
1819,
508,
26903,
26,
490,
2059,
355,
340,
291,
14,
2415,
591,
8,
2108,
12,
1031,
304,
490,
4472,
2353,
847,
413,
355,
340,
4472,
2353,
508,
650,
26,
490,
291,
14,
2168,
8,
2108,
9,
490,
2059,
267,
769,
14,
740,
8,
277,
12,
1031,
9,
339,
347,
3380,
591,
8,
277,
12,
1031,
17,
12,
1031,
18,
304,
267,
340,
440,
1031,
17,
14,
354,
7075,
508,
1031,
18,
14,
354,
7075,
26,
288,
372,
756,
398,
340,
440,
1031,
17,
14,
2987,
508,
1031,
18,
14,
2987,
26,
288,
372,
756,
398,
372,
715,
421,
199,
533,
12178,
6437,
8,
785,
304,
272,
408,
1563,
3123,
5649,
4514,
272,
2213,
2543,
446,
314,
1021,
370,
675,
367,
314,
9048,
2786,
1031,
402,
282,
2213,
272,
1819,
2543,
446,
314,
1021,
370,
675,
367,
4163,
6566,
83,
272,
3721,
2543,
446,
314,
1021,
370,
675,
367,
6786,
272,
13265,
2543,
446,
314,
1021,
370,
675,
367,
886,
9798,
272,
408,
339,
327,
7543,
1021,
272,
2213,
2543,
275,
488,
339,
327,
710,
1021,
370,
675,
367,
6425,
282,
1031,
272,
1819,
2543,
275,
488,
339,
327,
710,
1021,
370,
675,
367,
6425,
6786,
272,
3721,
2543,
275,
488,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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to:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 2.1 of the License, or (at your
# option) any later version.
#
# astroid is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with astroid. If not, see <http://www.gnu.org/licenses/>.
"""this module contains a set of functions to create astroid trees from scratch
(build_* functions) or from living object (object_build_* functions)
"""
__docformat__ = "restructuredtext en"
import sys
from os.path import abspath
from inspect import (getargspec, isdatadescriptor, isfunction, ismethod,
ismethoddescriptor, isclass, isbuiltin, ismodule)
import six
from astroid.node_classes import CONST_CLS
from astroid.nodes import (Module, Class, Const, const_factory, From,
Function, EmptyNode, Name, Arguments)
from astroid.bases import BUILTINS, Generator
from astroid.manager import AstroidManager
MANAGER = AstroidManager()
_CONSTANTS = tuple(CONST_CLS) # the keys of CONST_CLS eg python builtin types
def _io_discrepancy(member):
# _io module names itself `io`: http://bugs.python.org/issue18602
member_self = getattr(member, '__self__', None)
return (member_self and
ismodule(member_self) and
member_self.__name__ == '_io' and
member.__module__ == 'io')
def _attach_local_node(parent, node, name):
node.name = name # needed by add_local_node
parent.add_local_node(node)
_marker = object()
def attach_dummy_node(node, name, object=_marker):
"""create a dummy node and register it in the locals of the given
node with the specified name
"""
enode = EmptyNode()
enode.object = object
_attach_local_node(node, enode, name)
def _has_underlying_object(self):
return hasattr(self, 'object') and self.object is not _marker
EmptyNode.has_underlying_object = _has_underlying_object
def attach_const_node(node, name, value):
"""create a Const node and register it in the locals of the given
node with the specified name
"""
if not name in node.special_attributes:
_attach_local_node(node, const_factory(value), name)
def attach_import_node(node, modname, membername):
"""create a From node and register it in the locals of the given
node with the specified name
"""
from_node = From(modname, [(membername, None)])
_attach_local_node(node, from_node, membername)
def build_module(name, doc=None):
"""create and initialize a astroid Module node"""
node = Module(name, doc, pure_python=False)
node.package = False
node.parent = None
return node
def build_class(name, basenames=(), doc=None):
"""create and initialize a astroid Class node"""
node = Class(name, doc)
for base in basenames:
basenode = Name()
basenode.name = base
node.bases.append(basenode)
basenode.parent = node
return node
def build_function(name, args=None, defaults=None, flag=0, doc=None):
"""create and initialize a astroid Function node"""
args, defaults = args or [], defaults or []
# first argument is now a list of decorators
func = Function(name, doc)
func.args = argsnode = Arguments()
argsnode.args = []
for arg in args:
argsnode.args.append(Name())
argsnode.args[-1].name = arg
argsnode.args[-1].parent = argsnode
argsnode.defaults = []
for default in defaults:
argsnode.defaults.append(const_factory(default))
argsnode.defaults[-1].parent = argsnode
argsnode.kwarg = None
argsnode.vararg = None
argsnode.parent = func
if args:
register_arguments(func)
return func
def build_from_import(fromname, names):
"""create and initialize an astroid From import statement"""
return From(fromname, [(name, None) for name in names])
def register_arguments(func, args=None):
"""add given arguments to local
args is a list that may contains nested lists
(i.e. def func(a, (b, c, d)): ...)
"""
if args is None:
args = func.args.args
if func.args.vararg:
func.set_local(func.args.vararg, func.args)
if func.args.kwarg:
func.set_local(func.args.kwarg, func.args)
for arg in args:
if isinstance(arg, Name):
func.set_local(arg.name, arg)
else:
register_arguments(func, arg.elts)
def object_build_class(node, member, localname):
"""create astroid for a living class object"""
basenames = [base.__name__ for base in member.__bases__]
return _base_class_object_build(node, member, basenames,
localname=localname)
def object_build_function(node, member, localname):
"""create astroid for a living function object"""
args, varargs, varkw, defaults = getargspec(member)
if varargs is not None:
args.append(varargs)
if varkw is not None:
args.append(varkw)
func = build_function(getattr(member, '__name__', None) or localname, args,
defaults, member.func_code.co_flags, member.__doc__)
node.add_local_node(func, localname)
def object_build_datadescriptor(node, member, name):
"""create astroid for a living data descriptor object"""
return _base_class_object_build(node, member, [], name)
def object_build_methoddescriptor(node, member, localname):
"""create astroid for a living method descriptor object"""
# FIXME get arguments ?
func = build_function(getattr(member, '__name__', None) or localname,
doc=member.__doc__)
# set node's arguments to None to notice that we have no information, not
# and empty argument list
func.args.args = None
node.add_local_node(func, localname)
def _base_class_object_build(node, member, basenames, name=None, localname=None):
"""create astroid for a living class object, with a given set of base names
(e.g. ancestors)
"""
klass = build_class(name or getattr(member, '__name__', None) or localname,
basenames, member.__doc__)
klass._newstyle = isinstance(member, type)
node.add_local_node(klass, localname)
try:
# limit the instantiation trick since it's too dangerous
# (such as infinite test execution...)
# this at least resolves common case such as Exception.args,
# OSError.errno
if issubclass(member, Exception):
instdict = member().__dict__
else:
raise TypeError
except:
pass
else:
for name, obj in instdict.items():
valnode = EmptyNode()
valnode.object = obj
valnode.parent = klass
valnode.lineno = 1
klass.instance_attrs[name] = [valnode]
return klass
class InspectBuilder(object):
"""class for building nodes from living object
this is actually a really minimal representation, including only Module,
Function and Class nodes and some others as guessed.
"""
# astroid from living objects ###############################################
def __init__(self):
self._done = {}
self._module = None
def inspect_build(self, module, modname=None, path=None):
"""build astroid from a living module (i.e. using inspect)
this is used when there is no python source code available (either
because it's a built-in module or because the .py is not available)
"""
self._module = module
if modname is None:
modname = module.__name__
try:
node = build_module(modname, module.__doc__)
except AttributeError:
# in jython, java modules have no __doc__ (see #109562)
node = build_module(modname)
node.file = node.path = path and abspath(path) or path
node.name = modname
MANAGER.cache_module(node)
node.package = hasattr(module, '__path__')
self._done = {}
self.object_build(node, module)
return node
def object_build(self, node, obj):
"""recursive method which create a partial ast from real objects
(only function, class, and method are handled)
"""
if obj in self._done:
return self._done[obj]
self._done[obj] = node
for name in dir(obj):
try:
member = getattr(obj, name)
except AttributeError:
# damned ExtensionClass.Base, I know you're there !
attach_dummy_node(node, name)
continue
if ismethod(member):
member = six.get_method_function(member)
if isfunction(member):
# verify this is not an imported function
filename = getattr(six.get_function_code(member),
'co_filename', None)
if filename is None:
assert isinstance(member, object)
object_build_methoddescriptor(node, member, name)
elif filename != getattr(self._module, '__file__', None):
attach_dummy_node(node, name, member)
else:
object_build_function(node, member, name)
elif isbuiltin(member):
if (not _io_discrepancy(member) and
self.imported_member(node, member, name)):
continue
object_build_methoddescriptor(node, member, name)
elif isclass(member):
if self.imported_member(node, member, name):
continue
if member in self._done:
class_node = self._done[member]
if not class_node in node.locals.get(name, ()):
node.add_local_node(class_node, name)
else:
class_node = object_build_class(node, member, name)
# recursion
self.object_build(class_node, member)
if name == '__class__' and class_node.parent is None:
class_node.parent = self._done[self._module]
elif ismethoddescriptor(member):
assert isinstance(member, object)
object_build_methoddescriptor(node, member, name)
elif isdatadescriptor(member):
assert isinstance(member, object)
object_build_datadescriptor(node, member, name)
elif type(member) in _CONSTANTS:
attach_const_node(node, name, member)
else:
# create an empty node so that the name is actually defined
attach_dummy_node(node, name, member)
def imported_member(self, node, member, name):
"""verify this is not an imported class or handle it"""
# /!\ some classes like ExtensionClass doesn't have a __module__
# attribute ! Also, this may trigger an exception on badly built module
# (see http://www.logilab.org/ticket/57299 for instance)
try:
modname = getattr(member, '__module__', None)
except:
# XXX use logging
print('unexpected error while building astroid from living object')
import traceback
traceback.print_exc()
modname = None
if modname is None:
if name in ('__new__', '__subclasshook__'):
# Python 2.5.1 (r251:54863, Sep 1 2010, 22:03:14)
# >>> print object.__new__.__module__
# None
modname = BUILTINS
else:
attach_dummy_node(node, name, member)
return True
if {'gtk': 'gtk._gtk'}.get(modname, modname) != self._module.__name__:
# check if it sounds valid and then add an import node, else use a
# dummy node
try:
getattr(sys.modules[modname], name)
except (KeyError, AttributeError):
attach_dummy_node(node, name, member)
else:
attach_import_node(node, modname, name)
return True
return False
### astroid bootstrapping ######################################################
Astroid_BUILDER = InspectBuilder()
_CONST_PROXY = {}
def _astroid_bootstrapping(astroid_builtin=None):
"""astroid boot strapping the builtins module"""
# this boot strapping is necessary since we need the Const nodes to
# inspect_build builtins, and then we can proxy Const
if astroid_builtin is None:
from logilab.common.compat import builtins
astroid_builtin = Astroid_BUILDER.inspect_build(builtins)
for cls, node_cls in CONST_CLS.items():
if cls is type(None):
proxy = build_class('NoneType')
proxy.parent = astroid_builtin
else:
proxy = astroid_builtin.getattr(cls.__name__)[0]
if cls in (dict, list, set, tuple):
node_cls._proxied = proxy
else:
_CONST_PROXY[cls] = proxy
_astroid_bootstrapping()
# TODO : find a nicer way to handle this situation;
# However __proxied introduced an
# infinite recursion (see https://bugs.launchpad.net/pylint/+bug/456870)
def _set_proxied(const):
return _CONST_PROXY[const.value.__class__]
Const._proxied = property(_set_proxied)
from types import GeneratorType
Generator._proxied = Class(GeneratorType.__name__, GeneratorType.__doc__)
Astroid_BUILDER.object_build(Generator._proxied, GeneratorType)
|
mit
|
[
3,
4248,
13004,
13,
6965,
5051,
1193,
1217,
428,
14,
33,
14,
334,
1262,
374,
12,
28671,
7140,
395,
1006,
4481,
4644,
14,
199,
3,
8966,
1455,
921,
1544,
14,
793,
24142,
14,
4391,
15,
1553,
6016,
475,
26,
7811,
32,
793,
24142,
14,
4391,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
24440,
14,
199,
3,
199,
3,
24440,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
652,
199,
3,
1334,
314,
2895,
402,
314,
1664,
6401,
1696,
1684,
844,
465,
3267,
701,
314,
199,
3,
2868,
2290,
2752,
12,
1902,
1015,
499,
14,
17,
402,
314,
844,
12,
503,
334,
292,
2195,
199,
3,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
24440,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
1325,
199,
3,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
3169,
503,
199,
3,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
6401,
1696,
1684,
844,
199,
3,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
844,
3180,
199,
3,
543,
24440,
14,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
624,
3749,
859,
3509,
282,
663,
402,
3423,
370,
1218,
24440,
14416,
687,
28975,
199,
8,
1506,
15192,
3423,
9,
503,
687,
1212,
4007,
909,
334,
785,
63,
1506,
15192,
3423,
9,
199,
624,
199,
199,
363,
21841,
363,
275,
298,
26854,
655,
2,
199,
199,
646,
984,
199,
504,
747,
14,
515,
492,
19529,
199,
504,
6485,
492,
334,
29836,
12,
365,
576,
4120,
12,
365,
1593,
12,
365,
765,
12,
2151,
365,
765,
4120,
12,
365,
533,
12,
365,
5351,
12,
365,
578,
9,
199,
646,
3816,
199,
199,
504,
24440,
14,
932,
63,
2888,
492,
21803,
63,
1981,
51,
199,
504,
24440,
14,
2415,
492,
334,
2377,
12,
8089,
12,
13435,
12,
950,
63,
3702,
12,
11606,
12,
2574,
6801,
12,
9630,
1716,
12,
2812,
12,
7628,
9,
199,
504,
24440,
14,
12087,
492,
16331,
1193,
52,
10789,
12,
15042,
199,
504,
24440,
14,
2609,
492,
31986,
3977,
2988,
199,
28541,
275,
31986,
3977,
2988,
342,
199,
199,
63,
25825,
51,
275,
2008,
8,
13310,
63,
1981,
51,
9,
327,
314,
2883,
402,
21803,
63,
1981,
51,
11837,
2366,
6762,
2943,
199,
199,
318,
485,
2308,
63,
6409,
1155,
9844,
8,
1114,
304,
272,
327,
485,
2308,
859,
1561,
6337,
658,
2308,
8340,
1455,
921,
13017,
14,
1548,
14,
1308,
15,
5237,
11656,
996,
272,
3653,
63,
277,
275,
2519,
8,
1114,
12,
2560,
277,
7500,
488,
9,
272,
372,
334,
1114,
63,
277,
436,
288,
365,
578,
8,
1114,
63,
277,
9,
436,
288,
3653,
63,
277,
855,
354,
363,
508,
2513,
2308,
7,
436,
288,
3653,
855,
578,
363,
508,
283,
2308,
358,
199,
199,
318,
485,
5040,
63,
1832,
63,
932,
8,
1708,
12,
1031,
12,
536,
304,
272,
1031,
14,
354,
275,
536,
327,
4346,
701,
1050,
63,
1832,
63,
932,
272,
1676,
14,
525,
63,
1832,
63,
932,
8,
932,
9,
199,
199,
63,
4211,
275,
909,
342,
199,
199,
318,
6554,
63,
5869,
63,
932,
8,
932,
12,
536,
12,
909,
3699,
4211,
304,
272,
408,
981,
282,
7283,
1031,
436,
2274,
652,
315,
314,
9480,
402,
314,
1627,
272,
1031,
543,
314,
2013,
536,
272,
408,
272,
655,
380,
275,
9630,
1716,
342,
272,
655,
380,
14,
785,
275,
909,
272,
485,
5040,
63,
1832,
63,
932,
8,
932,
12,
655,
380,
12,
536,
9,
199,
199,
318,
485,
1989,
63,
7138,
6670,
63,
785,
8,
277,
304,
272,
372,
2688,
8,
277,
12,
283,
785,
358,
436,
291,
14,
785,
365,
440,
485,
4211,
199,
199,
4699,
1716,
14,
1989,
63,
7138,
6670,
63,
785,
275,
485,
1989,
63,
7138,
6670,
63,
785,
199,
199,
318,
6554,
63,
1297,
63,
932,
8,
932,
12,
536,
12,
574,
304,
272,
408,
981,
282,
13435,
1031,
436,
2274,
652,
315,
314,
9480,
402,
314,
1627,
272,
1031,
543,
314,
2013,
536,
272,
408,
272,
340,
440,
536,
315,
1031,
14,
6664,
63,
2987,
26,
267,
485,
5040,
63,
1832,
63,
932,
8,
932,
12,
950,
63,
3702,
8,
585,
395,
536,
9,
199,
199,
318,
6554,
63,
646,
63,
932,
8,
932,
12,
13526,
12,
3653,
354,
304,
272,
408,
981,
282,
11606,
1031,
436,
2274,
652,
315,
314,
9480,
402,
314,
1627,
272,
1031,
543,
314,
2013,
536,
272,
408,
272,
687,
63,
932,
275,
11606,
8,
14789,
12,
3842,
1114,
354,
12,
488,
3948,
272,
485,
5040,
63,
1832,
63,
932,
8,
932,
12,
687,
63,
932,
12,
3653,
354,
9,
421,
199,
318,
1900,
63,
578,
8,
354,
12,
1382,
29,
403,
304,
272,
408,
981,
436,
8265,
282,
24440,
5673,
1031,
624,
272,
1031,
275,
5673,
8,
354,
12,
1382,
12,
15111,
63,
1548,
29,
797,
9,
272,
1031,
14,
2491,
275,
756,
272,
1031,
14,
1708,
275,
488,
272,
372,
1031,
199,
199,
318,
1900,
63,
533,
8,
354,
12,
1300,
1247,
16729,
1382,
29,
403,
304,
272,
408,
981,
436,
8265,
282,
24440,
8089,
1031,
624,
272,
1031,
275,
8089,
8,
354,
12,
1382,
9,
272,
367,
1300,
315,
1300,
1247,
26,
267,
1300,
932,
275,
2812,
342,
267,
1300,
932,
14,
354,
275,
1300,
267,
1031,
14,
12087,
14,
740,
8,
1095,
932,
9,
267,
1300,
932,
14,
1708,
275,
1031,
272,
372,
1031,
199,
199,
318,
1900,
63,
1593,
8,
354,
12,
1249,
29,
403,
12,
4243,
29,
403,
12,
3305,
29,
16,
12,
1382,
29,
403,
304,
272,
408,
981,
436,
8265,
282,
24440,
6801,
1031,
624,
272,
1249,
12,
4243,
275,
1249,
503,
990,
4243,
503,
942,
272,
327,
1642,
1423,
365,
3063,
282,
769,
402,
20419,
272,
2562,
275,
6801,
8,
354,
12,
1382,
9,
272,
2562,
14,
589,
275,
1249,
932,
275,
7628,
342,
272,
1249,
932,
14,
589,
275,
942,
272,
367,
1680,
315,
1249,
26,
267,
1249,
932,
14,
589,
14,
740,
8,
985,
1012,
267,
1249,
932,
14,
589,
1988,
17,
1055,
354,
275,
1680,
267,
1249,
932,
14,
589,
1988
] |
[
4248,
13004,
13,
6965,
5051,
1193,
1217,
428,
14,
33,
14,
334,
1262,
374,
12,
28671,
7140,
395,
1006,
4481,
4644,
14,
199,
3,
8966,
1455,
921,
1544,
14,
793,
24142,
14,
4391,
15,
1553,
6016,
475,
26,
7811,
32,
793,
24142,
14,
4391,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
24440,
14,
199,
3,
199,
3,
24440,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
652,
199,
3,
1334,
314,
2895,
402,
314,
1664,
6401,
1696,
1684,
844,
465,
3267,
701,
314,
199,
3,
2868,
2290,
2752,
12,
1902,
1015,
499,
14,
17,
402,
314,
844,
12,
503,
334,
292,
2195,
199,
3,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
24440,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
1325,
199,
3,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
3169,
503,
199,
3,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
6401,
1696,
1684,
844,
199,
3,
367,
1655,
2436,
14,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
844,
3180,
199,
3,
543,
24440,
14,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
624,
3749,
859,
3509,
282,
663,
402,
3423,
370,
1218,
24440,
14416,
687,
28975,
199,
8,
1506,
15192,
3423,
9,
503,
687,
1212,
4007,
909,
334,
785,
63,
1506,
15192,
3423,
9,
199,
624,
199,
199,
363,
21841,
363,
275,
298,
26854,
655,
2,
199,
199,
646,
984,
199,
504,
747,
14,
515,
492,
19529,
199,
504,
6485,
492,
334,
29836,
12,
365,
576,
4120,
12,
365,
1593,
12,
365,
765,
12,
2151,
365,
765,
4120,
12,
365,
533,
12,
365,
5351,
12,
365,
578,
9,
199,
646,
3816,
199,
199,
504,
24440,
14,
932,
63,
2888,
492,
21803,
63,
1981,
51,
199,
504,
24440,
14,
2415,
492,
334,
2377,
12,
8089,
12,
13435,
12,
950,
63,
3702,
12,
11606,
12,
2574,
6801,
12,
9630,
1716,
12,
2812,
12,
7628,
9,
199,
504,
24440,
14,
12087,
492,
16331,
1193,
52,
10789,
12,
15042,
199,
504,
24440,
14,
2609,
492,
31986,
3977,
2988,
199,
28541,
275,
31986,
3977,
2988,
342,
199,
199,
63,
25825,
51,
275,
2008,
8,
13310,
63,
1981,
51,
9,
327,
314,
2883,
402,
21803,
63,
1981,
51,
11837,
2366,
6762,
2943,
199,
199,
318,
485,
2308,
63,
6409,
1155,
9844,
8,
1114,
304,
272,
327,
485,
2308,
859,
1561,
6337,
658,
2308,
8340,
1455,
921,
13017,
14,
1548,
14,
1308,
15,
5237,
11656,
996,
272,
3653,
63,
277,
275,
2519,
8,
1114,
12,
2560,
277,
7500,
488,
9,
272,
372,
334,
1114,
63,
277,
436,
288,
365,
578,
8,
1114,
63,
277,
9,
436,
288,
3653,
63,
277,
855,
354,
363,
508,
2513,
2308,
7,
436,
288,
3653,
855,
578,
363,
508,
283,
2308,
358,
199,
199,
318,
485,
5040,
63,
1832,
63,
932,
8,
1708,
12,
1031,
12,
536,
304,
272,
1031,
14,
354,
275,
536,
327,
4346,
701,
1050,
63,
1832,
63,
932,
272,
1676,
14,
525,
63,
1832,
63,
932,
8,
932,
9,
199,
199,
63,
4211,
275,
909,
342,
199,
199,
318,
6554,
63,
5869,
63,
932,
8,
932,
12,
536,
12,
909,
3699,
4211,
304,
272,
408,
981,
282,
7283,
1031,
436,
2274,
652,
315,
314,
9480,
402,
314,
1627,
272,
1031,
543,
314,
2013,
536,
272,
408,
272,
655,
380,
275,
9630,
1716,
342,
272,
655,
380,
14,
785,
275,
909,
272,
485,
5040,
63,
1832,
63,
932,
8,
932,
12,
655,
380,
12,
536,
9,
199,
199,
318,
485,
1989,
63,
7138,
6670,
63,
785,
8,
277,
304,
272,
372,
2688,
8,
277,
12,
283,
785,
358,
436,
291,
14,
785,
365,
440,
485,
4211,
199,
199,
4699,
1716,
14,
1989,
63,
7138,
6670,
63,
785,
275,
485,
1989,
63,
7138,
6670,
63,
785,
199,
199,
318,
6554,
63,
1297,
63,
932,
8,
932,
12,
536,
12,
574,
304,
272,
408,
981,
282,
13435,
1031,
436,
2274,
652,
315,
314,
9480,
402,
314,
1627,
272,
1031,
543,
314,
2013,
536,
272,
408,
272,
340,
440,
536,
315,
1031,
14,
6664,
63,
2987,
26,
267,
485,
5040,
63,
1832,
63,
932,
8,
932,
12,
950,
63,
3702,
8,
585,
395,
536,
9,
199,
199,
318,
6554,
63,
646,
63,
932,
8,
932,
12,
13526,
12,
3653,
354,
304,
272,
408,
981,
282,
11606,
1031,
436,
2274,
652,
315,
314,
9480,
402,
314,
1627,
272,
1031,
543,
314,
2013,
536,
272,
408,
272,
687,
63,
932,
275,
11606,
8,
14789,
12,
3842,
1114,
354,
12,
488,
3948,
272,
485,
5040,
63,
1832,
63,
932,
8,
932,
12,
687,
63,
932,
12,
3653,
354,
9,
421,
199,
318,
1900,
63,
578,
8,
354,
12,
1382,
29,
403,
304,
272,
408,
981,
436,
8265,
282,
24440,
5673,
1031,
624,
272,
1031,
275,
5673,
8,
354,
12,
1382,
12,
15111,
63,
1548,
29,
797,
9,
272,
1031,
14,
2491,
275,
756,
272,
1031,
14,
1708,
275,
488,
272,
372,
1031,
199,
199,
318,
1900,
63,
533,
8,
354,
12,
1300,
1247,
16729,
1382,
29,
403,
304,
272,
408,
981,
436,
8265,
282,
24440,
8089,
1031,
624,
272,
1031,
275,
8089,
8,
354,
12,
1382,
9,
272,
367,
1300,
315,
1300,
1247,
26,
267,
1300,
932,
275,
2812,
342,
267,
1300,
932,
14,
354,
275,
1300,
267,
1031,
14,
12087,
14,
740,
8,
1095,
932,
9,
267,
1300,
932,
14,
1708,
275,
1031,
272,
372,
1031,
199,
199,
318,
1900,
63,
1593,
8,
354,
12,
1249,
29,
403,
12,
4243,
29,
403,
12,
3305,
29,
16,
12,
1382,
29,
403,
304,
272,
408,
981,
436,
8265,
282,
24440,
6801,
1031,
624,
272,
1249,
12,
4243,
275,
1249,
503,
990,
4243,
503,
942,
272,
327,
1642,
1423,
365,
3063,
282,
769,
402,
20419,
272,
2562,
275,
6801,
8,
354,
12,
1382,
9,
272,
2562,
14,
589,
275,
1249,
932,
275,
7628,
342,
272,
1249,
932,
14,
589,
275,
942,
272,
367,
1680,
315,
1249,
26,
267,
1249,
932,
14,
589,
14,
740,
8,
985,
1012,
267,
1249,
932,
14,
589,
1988,
17,
1055,
354,
275,
1680,
267,
1249,
932,
14,
589,
1988,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_DRIVE_API_URI = 'https://www.googleapis.com/drive/v2/files/'
logger = app.logger
HEADERS = {
'Authorization': "Bearer {access_token}",
'Content-type': "application/json",
}
class GoogleDriveAPI(object):
def get_document(self, access_token, document_id):
headers = self.build_headers(access_token=access_token)
r = requests.get(GOOGLE_DRIVE_API_URI + document_id, headers=headers)
file_resource = None
if r.status_code == requests.codes.ok:
file_resource = r.json
logger.debug("File found: %s", file_resource)
else:
logger.error("Failed to find document: %s", r.reason)
logger.error("Full response %s", r.text)
return file_resource
def search(self, access_token, query):
headers = self.build_headers(access_token=access_token)
query_string = {'q': query}
r = requests.get(GOOGLE_DRIVE_API_URI, headers=headers, params=query_string)
if r.status_code != requests.codes.ok:
return None
logger.debug("Response %s" % r.text)
results_list = r.json['items']
return results_list
def children(self, access_token, folder_id):
headers = self.build_headers(access_token=access_token)
r = requests.get(GOOGLE_DRIVE_API_URI + folder_id + '/children', headers=headers, params={'maxResults': 5})
logger.debug("Response %s" % r.json['items'])
if r.status_code != requests.codes.ok:
return None
return r.json['items']
def build_headers(self, *args, **kwargs):
headers = {}
for key, val in HEADERS.iteritems():
headers[key] = val.format(**kwargs)
return headers
|
bsd-3-clause
|
[
646,
4145,
199,
504,
307,
6078,
63,
895,
707,
492,
1145,
199,
24243,
63,
4564,
5399,
63,
3735,
63,
7639,
275,
283,
2859,
921,
1544,
14,
17533,
14,
957,
15,
9541,
15,
86,
18,
15,
1725,
4805,
199,
199,
2921,
275,
1145,
14,
2921,
199,
21178,
275,
469,
272,
283,
11626,
356,
298,
3655,
21462,
469,
2732,
63,
1418,
10750,
272,
283,
2714,
13,
466,
356,
298,
3578,
15,
1001,
401,
199,
93,
421,
199,
533,
4475,
24276,
3735,
8,
785,
304,
272,
347,
664,
63,
3554,
8,
277,
12,
2879,
63,
1418,
12,
2213,
63,
344,
304,
267,
2323,
275,
291,
14,
1506,
63,
2139,
8,
2732,
63,
1418,
29,
2732,
63,
1418,
9,
398,
519,
275,
4145,
14,
362,
8,
24243,
63,
4564,
5399,
63,
3735,
63,
7639,
435,
2213,
63,
344,
12,
2323,
29,
2139,
9,
267,
570,
63,
1927,
275,
488,
267,
340,
519,
14,
1205,
63,
600,
508,
4145,
14,
6021,
14,
745,
26,
288,
570,
63,
1927,
275,
519,
14,
1001,
288,
2512,
14,
1757,
480,
1173,
1911,
26,
450,
83,
401,
570,
63,
1927,
9,
267,
587,
26,
288,
2512,
14,
705,
480,
4276,
370,
2342,
2213,
26,
450,
83,
401,
519,
14,
5764,
9,
288,
2512,
14,
705,
480,
9042,
1177,
450,
83,
401,
519,
14,
505,
9,
267,
372,
570,
63,
1927,
339,
347,
2754,
8,
277,
12,
2879,
63,
1418,
12,
1827,
304,
267,
2323,
275,
291,
14,
1506,
63,
2139,
8,
2732,
63,
1418,
29,
2732,
63,
1418,
9,
267,
1827,
63,
875,
275,
791,
81,
356,
1827,
93,
267,
519,
275,
4145,
14,
362,
8,
24243,
63,
4564,
5399,
63,
3735,
63,
7639,
12,
2323,
29,
2139,
12,
1862,
29,
1131,
63,
875,
9,
267,
340,
519,
14,
1205,
63,
600,
1137,
4145,
14,
6021,
14,
745,
26,
288,
372,
488,
398,
2512,
14,
1757,
480,
2364,
450,
83,
2,
450,
519,
14,
505,
9,
267,
2058,
63,
513,
275,
519,
14,
1001,
459,
1744,
418,
267,
372,
2058,
63,
513,
339,
347,
4978,
8,
277,
12,
2879,
63,
1418,
12,
4922,
63,
344,
304,
267,
2323,
275,
291,
14,
1506,
63,
2139,
8,
2732,
63,
1418,
29,
2732,
63,
1418,
9,
267,
519,
275,
4145,
14,
362,
8,
24243,
63,
4564,
5399,
63,
3735,
63,
7639,
435,
4922,
63,
344,
435,
1994,
3223,
297,
2323,
29,
2139,
12,
1862,
3713,
988,
6579,
356,
959,
1552,
267,
2512,
14,
1757,
480,
2364,
450,
83,
2,
450,
519,
14,
1001,
459,
1744,
1105,
267,
340,
519,
14,
1205,
63,
600,
1137,
4145,
14,
6021,
14,
745,
26,
288,
372,
488,
267,
372,
519,
14,
1001,
459,
1744,
418,
339,
347,
1900,
63,
2139,
8,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
2323,
275,
1052,
267,
367,
790,
12,
1139,
315,
13053,
3960,
14,
4611,
837,
288,
2323,
59,
498,
61,
275,
1139,
14,
908,
3682,
958,
9,
267,
372,
2323,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
4145,
199,
504,
307,
6078,
63,
895,
707,
492,
1145,
199,
24243,
63,
4564,
5399,
63,
3735,
63,
7639,
275,
283,
2859,
921,
1544,
14,
17533,
14,
957,
15,
9541,
15,
86,
18,
15,
1725,
4805,
199,
199,
2921,
275,
1145,
14,
2921,
199,
21178,
275,
469,
272,
283,
11626,
356,
298,
3655,
21462,
469,
2732,
63,
1418,
10750,
272,
283,
2714,
13,
466,
356,
298,
3578,
15,
1001,
401,
199,
93,
421,
199,
533,
4475,
24276,
3735,
8,
785,
304,
272,
347,
664,
63,
3554,
8,
277,
12,
2879,
63,
1418,
12,
2213,
63,
344,
304,
267,
2323,
275,
291,
14,
1506,
63,
2139,
8,
2732,
63,
1418,
29,
2732,
63,
1418,
9,
398,
519,
275,
4145,
14,
362,
8,
24243,
63,
4564,
5399,
63,
3735,
63,
7639,
435,
2213,
63,
344,
12,
2323,
29,
2139,
9,
267,
570,
63,
1927,
275,
488,
267,
340,
519,
14,
1205,
63,
600,
508,
4145,
14,
6021,
14,
745,
26,
288,
570,
63,
1927,
275,
519,
14,
1001,
288,
2512,
14,
1757,
480,
1173,
1911,
26,
450,
83,
401,
570,
63,
1927,
9,
267,
587,
26,
288,
2512,
14,
705,
480,
4276,
370,
2342,
2213,
26,
450,
83,
401,
519,
14,
5764,
9,
288,
2512,
14,
705,
480,
9042,
1177,
450,
83,
401,
519,
14,
505,
9,
267,
372,
570,
63,
1927,
339,
347,
2754,
8,
277,
12,
2879,
63,
1418,
12,
1827,
304,
267,
2323,
275,
291,
14,
1506,
63,
2139,
8,
2732,
63,
1418,
29,
2732,
63,
1418,
9,
267,
1827,
63,
875,
275,
791,
81,
356,
1827,
93,
267,
519,
275,
4145,
14,
362,
8,
24243,
63,
4564,
5399,
63,
3735,
63,
7639,
12,
2323,
29,
2139,
12,
1862,
29,
1131,
63,
875,
9,
267,
340,
519,
14,
1205,
63,
600,
1137,
4145,
14,
6021,
14,
745,
26,
288,
372,
488,
398,
2512,
14,
1757,
480,
2364,
450,
83,
2,
450,
519,
14,
505,
9,
267,
2058,
63,
513,
275,
519,
14,
1001,
459,
1744,
418,
267,
372,
2058,
63,
513,
339,
347,
4978,
8,
277,
12,
2879,
63,
1418,
12,
4922,
63,
344,
304,
267,
2323,
275,
291,
14,
1506,
63,
2139,
8,
2732,
63,
1418,
29,
2732,
63,
1418,
9,
267,
519,
275,
4145,
14,
362,
8,
24243,
63,
4564,
5399,
63,
3735,
63,
7639,
435,
4922,
63,
344,
435,
1994,
3223,
297,
2323,
29,
2139,
12,
1862,
3713,
988,
6579,
356,
959,
1552,
267,
2512,
14,
1757,
480,
2364,
450,
83,
2,
450,
519,
14,
1001,
459,
1744,
1105,
267,
340,
519,
14,
1205,
63,
600,
1137,
4145,
14,
6021,
14,
745,
26,
288,
372,
488,
267,
372,
519,
14,
1001,
459,
1744,
418,
339,
347,
1900,
63,
2139,
8,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
2323,
275,
1052,
267,
367,
790,
12,
1139,
315,
13053,
3960,
14,
4611,
837,
288,
2323,
59,
498,
61,
275,
1139,
14,
908,
3682,
958,
9,
267,
372,
2323,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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902
|
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
)
class TVCIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?tvc\.ru/video/iframe/id/(?P<id>\d+)'
_TEST = {
'url': 'http://www.tvc.ru/video/iframe/id/74622/isPlay/false/id_stat/channel/?acc_video_id=/channel/brand/id/17/show/episodes/episode_id/39702',
'md5': 'bbc5ff531d1e90e856f60fc4b3afd708',
'info_dict': {
'id': '74622',
'ext': 'mp4',
'title': 'События. "События". Эфир от 22.05.2015 14:30',
'thumbnail': 're:^https?://.*\.jpg$',
'duration': 1122,
},
}
@classmethod
def _extract_url(cls, webpage):
mobj = re.search(
r'<iframe[^>]+?src=(["\'])(?P<url>(?:http:)?//(?:www\.)?tvc\.ru/video/iframe/id/[^"]+)\1', webpage)
if mobj:
return mobj.group('url')
def _real_extract(self, url):
video_id = self._match_id(url)
video = self._download_json(
'http://www.tvc.ru/video/json/id/%s' % video_id, video_id)
formats = []
for info in video.get('path', {}).get('quality', []):
video_url = info.get('url')
if not video_url:
continue
format_id = self._search_regex(
r'cdnvideo/([^/]+?)(?:-[^/]+?)?/', video_url,
'format id', default=None)
formats.append({
'url': video_url,
'format_id': format_id,
'width': int_or_none(info.get('width')),
'height': int_or_none(info.get('height')),
'tbr': int_or_none(info.get('bitrate')),
})
self._sort_formats(formats)
return {
'id': video_id,
'title': video['title'],
'thumbnail': video.get('picture'),
'duration': int_or_none(video.get('duration')),
'formats': formats,
}
class TVCArticleIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?tvc\.ru/(?!video/iframe/id/)(?P<id>[^?#]+)'
_TESTS = [{
'url': 'http://www.tvc.ru/channel/brand/id/29/show/episodes/episode_id/39702/',
'info_dict': {
'id': '74622',
'ext': 'mp4',
'title': 'События. "События". Эфир от 22.05.2015 14:30',
'description': 'md5:ad7aa7db22903f983e687b8a3e98c6dd',
'thumbnail': 're:^https?://.*\.jpg$',
'duration': 1122,
},
}, {
'url': 'http://www.tvc.ru/news/show/id/69944',
'info_dict': {
'id': '75399',
'ext': 'mp4',
'title': 'Эксперты: в столице встал вопрос о максимально безопасных остановках',
'description': 'md5:f2098f71e21f309e89f69b525fd9846e',
'thumbnail': 're:^https?://.*\.jpg$',
'duration': 278,
},
}, {
'url': 'http://www.tvc.ru/channel/brand/id/47/show/episodes#',
'info_dict': {
'id': '2185',
'ext': 'mp4',
'title': 'Ещё не поздно. Эфир от 03.08.2013',
'description': 'md5:51fae9f3f8cfe67abce014e428e5b027',
'thumbnail': 're:^https?://.*\.jpg$',
'duration': 3316,
},
}]
def _real_extract(self, url):
webpage = self._download_webpage(url, self._match_id(url))
return {
'_type': 'url_transparent',
'ie_key': 'TVC',
'url': self._og_search_video_url(webpage),
'title': clean_html(self._og_search_title(webpage)),
'description': clean_html(self._og_search_description(webpage)),
'thumbnail': self._og_search_thumbnail(webpage),
}
|
unlicense
|
[
3,
2803,
26,
2774,
13,
24,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
295,
199,
199,
504,
1275,
2330,
492,
21298,
199,
504,
2508,
1208,
492,
334,
272,
3633,
63,
1360,
12,
272,
1109,
63,
269,
63,
3592,
12,
199,
9,
421,
199,
533,
26990,
3553,
37,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
1014,
921,
5169,
1544,
20316,
84,
6737,
4537,
6558,
15,
3722,
15,
20052,
15,
344,
9448,
48,
28,
344,
3072,
68,
29600,
272,
485,
2864,
275,
469,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
84,
6737,
14,
6558,
15,
3722,
15,
20052,
15,
344,
15,
17718,
1081,
15,
374,
9651,
15,
3910,
15,
344,
63,
3736,
15,
2775,
10197,
5470,
63,
3722,
63,
344,
13043,
2775,
15,
19026,
15,
344,
15,
1196,
15,
2384,
15,
22027,
15,
9544,
63,
344,
15,
13145,
996,
297,
267,
283,
1064,
21,
356,
283,
27621,
21,
556,
21,
2192,
68,
17,
69,
2710,
69,
30625,
70,
2259,
3003,
20,
66,
19,
65,
2592,
23,
2036,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
17718,
1081,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
141,
95,
8381,
110,
17445,
7413,
6500,
14978,
14,
298,
141,
95,
8381,
110,
17445,
7413,
6500,
14978,
1674,
7038,
256,
31815,
6500,
7753,
221,
5806,
7413,
6928,
14,
1717,
14,
7806,
4329,
26,
1216,
297,
288,
283,
8311,
356,
283,
264,
23497,
2859,
32569,
8476,
4268,
288,
283,
5553,
356,
413,
7507,
12,
267,
1660,
272,
789,
339,
768,
3744,
272,
347,
485,
5005,
63,
633,
8,
1886,
12,
9248,
304,
267,
14208,
275,
295,
14,
1733,
8,
288,
519,
7601,
20052,
25524,
31,
2164,
30982,
3212,
1105,
2229,
48,
28,
633,
30,
5169,
1014,
26,
5547,
501,
5169,
1544,
20316,
84,
6737,
4537,
6558,
15,
3722,
15,
20052,
15,
344,
15,
25153,
13439,
17,
297,
9248,
9,
267,
340,
14208,
26,
288,
372,
14208,
14,
923,
360,
633,
358,
339,
347,
485,
3093,
63,
5005,
8,
277,
12,
1166,
304,
267,
3991,
63,
344,
275,
291,
423,
1431,
63,
344,
8,
633,
9,
398,
3991,
275,
291,
423,
4249,
63,
1001,
8,
288,
283,
1014,
921,
1544,
14,
84,
6737,
14,
6558,
15,
3722,
15,
1001,
15,
344,
3149,
83,
7,
450,
3991,
63,
344,
12,
3991,
63,
344,
9,
398,
6752,
275,
942,
267,
367,
2256,
315,
3991,
14,
362,
360,
515,
297,
13056,
362,
360,
9161,
297,
12319,
288,
3991,
63,
633,
275,
2256,
14,
362,
360,
633,
358,
288,
340,
440,
3991,
63,
633,
26,
355,
1980,
288,
1475,
63,
344,
275,
291,
423,
1733,
63,
3821,
8,
355,
519,
7,
23982,
3722,
15,
7059,
15251,
17076,
5169,
13,
26285,
31,
5547,
3678,
3991,
63,
633,
12,
355,
283,
908,
1305,
297,
849,
29,
403,
9,
288,
6752,
14,
740,
2561,
355,
283,
633,
356,
3991,
63,
633,
12,
355,
283,
908,
63,
344,
356,
1475,
63,
344,
12,
355,
283,
2063,
356,
1109,
63,
269,
63,
3592,
8,
815,
14,
362,
360,
2063,
3855,
355,
283,
3333,
356,
1109,
63,
269,
63,
3592,
8,
815,
14,
362,
360,
3333,
3855,
355,
283,
84,
3289,
356,
1109,
63,
269,
63,
3592,
8,
815,
14,
362,
360,
24484,
3855,
288,
3828,
267,
291,
423,
3191,
63,
6321,
8,
6321,
9,
398,
372,
469,
288,
283,
344,
356,
3991,
63,
344,
12,
288,
283,
1213,
356,
3991,
459,
1213,
995,
288,
283,
8311,
356,
3991,
14,
362,
360,
12538,
659,
288,
283,
5553,
356,
1109,
63,
269,
63,
3592,
8,
3722,
14,
362,
360,
5553,
3855,
288,
283,
6321,
356,
6752,
12,
267,
789,
421,
199,
533,
377,
9454,
7221,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
1014,
921,
5169,
1544,
20316,
84,
6737,
4537,
6558,
9448,
1,
3722,
15,
20052,
15,
344,
15,
18168,
48,
28,
344,
13489,
31,
3,
29716,
272,
485,
7569,
275,
8910,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
84,
6737,
14,
6558,
15,
2775,
15,
19026,
15,
344,
15,
1398,
15,
2384,
15,
22027,
15,
9544,
63,
344,
15,
13145,
996,
3678,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
17718,
1081,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
141,
95,
8381,
110,
17445,
7413,
6500,
14978,
14,
298,
141,
95,
8381,
110,
17445,
7413,
6500,
14978,
1674,
7038,
256,
31815,
6500,
7753,
221,
5806,
7413,
6928,
14,
1717,
14,
7806,
4329,
26,
1216,
297,
288,
283,
1802,
356,
283,
1064,
21,
26,
350,
23,
2158,
23,
697,
11182,
1644,
70,
25,
2658,
69,
31828,
66,
24,
65,
19,
69,
2905,
67,
22,
617,
297,
288,
283,
8311,
356,
283,
264,
23497,
2859,
32569,
8476,
4268,
288,
283,
5553,
356,
413,
7507,
12,
267,
1660,
272,
1660,
469,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
84,
6737,
14,
6558,
15,
13224,
15,
2384,
15,
344,
15,
30688,
1602,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
2194,
10936,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
141,
256,
11487,
8474,
23645,
21273,
7413,
17445,
26,
22213,
221,
18261,
26927,
6500,
25827,
6286,
22213,
18261,
30638,
22213,
8381,
124,
7753,
5806,
8474,
221,
5806,
7038,
121,
5657,
11487,
8474,
16863,
121,
30638,
16961,
7592,
5806,
7038,
110,
15578,
116,
8381,
124,
5657,
8474,
7592,
17445,
25969,
221,
5806,
18261,
21674,
21267,
29352,
25969,
297,
288,
283,
1802,
356,
283,
1064,
21,
26,
70,
1165,
2905,
70,
3172,
69,
2025,
70,
10556,
69,
1407,
70,
1876,
66,
24334,
2592,
25,
16134,
69,
297,
288,
283,
8311,
356,
283,
264,
23497,
2859,
32569,
8476,
4268,
288,
283,
5553,
356,
499,
2277,
12,
267,
1660,
272,
1660,
469,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
84,
6737,
14,
6558,
15,
2775,
15,
19026,
15,
344,
15,
2417,
15,
2384,
15,
22027,
23470,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
9252,
21,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
141
] |
[
2803,
26,
2774,
13,
24,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
295,
199,
199,
504,
1275,
2330,
492,
21298,
199,
504,
2508,
1208,
492,
334,
272,
3633,
63,
1360,
12,
272,
1109,
63,
269,
63,
3592,
12,
199,
9,
421,
199,
533,
26990,
3553,
37,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
1014,
921,
5169,
1544,
20316,
84,
6737,
4537,
6558,
15,
3722,
15,
20052,
15,
344,
9448,
48,
28,
344,
3072,
68,
29600,
272,
485,
2864,
275,
469,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
84,
6737,
14,
6558,
15,
3722,
15,
20052,
15,
344,
15,
17718,
1081,
15,
374,
9651,
15,
3910,
15,
344,
63,
3736,
15,
2775,
10197,
5470,
63,
3722,
63,
344,
13043,
2775,
15,
19026,
15,
344,
15,
1196,
15,
2384,
15,
22027,
15,
9544,
63,
344,
15,
13145,
996,
297,
267,
283,
1064,
21,
356,
283,
27621,
21,
556,
21,
2192,
68,
17,
69,
2710,
69,
30625,
70,
2259,
3003,
20,
66,
19,
65,
2592,
23,
2036,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
17718,
1081,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
141,
95,
8381,
110,
17445,
7413,
6500,
14978,
14,
298,
141,
95,
8381,
110,
17445,
7413,
6500,
14978,
1674,
7038,
256,
31815,
6500,
7753,
221,
5806,
7413,
6928,
14,
1717,
14,
7806,
4329,
26,
1216,
297,
288,
283,
8311,
356,
283,
264,
23497,
2859,
32569,
8476,
4268,
288,
283,
5553,
356,
413,
7507,
12,
267,
1660,
272,
789,
339,
768,
3744,
272,
347,
485,
5005,
63,
633,
8,
1886,
12,
9248,
304,
267,
14208,
275,
295,
14,
1733,
8,
288,
519,
7601,
20052,
25524,
31,
2164,
30982,
3212,
1105,
2229,
48,
28,
633,
30,
5169,
1014,
26,
5547,
501,
5169,
1544,
20316,
84,
6737,
4537,
6558,
15,
3722,
15,
20052,
15,
344,
15,
25153,
13439,
17,
297,
9248,
9,
267,
340,
14208,
26,
288,
372,
14208,
14,
923,
360,
633,
358,
339,
347,
485,
3093,
63,
5005,
8,
277,
12,
1166,
304,
267,
3991,
63,
344,
275,
291,
423,
1431,
63,
344,
8,
633,
9,
398,
3991,
275,
291,
423,
4249,
63,
1001,
8,
288,
283,
1014,
921,
1544,
14,
84,
6737,
14,
6558,
15,
3722,
15,
1001,
15,
344,
3149,
83,
7,
450,
3991,
63,
344,
12,
3991,
63,
344,
9,
398,
6752,
275,
942,
267,
367,
2256,
315,
3991,
14,
362,
360,
515,
297,
13056,
362,
360,
9161,
297,
12319,
288,
3991,
63,
633,
275,
2256,
14,
362,
360,
633,
358,
288,
340,
440,
3991,
63,
633,
26,
355,
1980,
288,
1475,
63,
344,
275,
291,
423,
1733,
63,
3821,
8,
355,
519,
7,
23982,
3722,
15,
7059,
15251,
17076,
5169,
13,
26285,
31,
5547,
3678,
3991,
63,
633,
12,
355,
283,
908,
1305,
297,
849,
29,
403,
9,
288,
6752,
14,
740,
2561,
355,
283,
633,
356,
3991,
63,
633,
12,
355,
283,
908,
63,
344,
356,
1475,
63,
344,
12,
355,
283,
2063,
356,
1109,
63,
269,
63,
3592,
8,
815,
14,
362,
360,
2063,
3855,
355,
283,
3333,
356,
1109,
63,
269,
63,
3592,
8,
815,
14,
362,
360,
3333,
3855,
355,
283,
84,
3289,
356,
1109,
63,
269,
63,
3592,
8,
815,
14,
362,
360,
24484,
3855,
288,
3828,
267,
291,
423,
3191,
63,
6321,
8,
6321,
9,
398,
372,
469,
288,
283,
344,
356,
3991,
63,
344,
12,
288,
283,
1213,
356,
3991,
459,
1213,
995,
288,
283,
8311,
356,
3991,
14,
362,
360,
12538,
659,
288,
283,
5553,
356,
1109,
63,
269,
63,
3592,
8,
3722,
14,
362,
360,
5553,
3855,
288,
283,
6321,
356,
6752,
12,
267,
789,
421,
199,
533,
377,
9454,
7221,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
1014,
921,
5169,
1544,
20316,
84,
6737,
4537,
6558,
9448,
1,
3722,
15,
20052,
15,
344,
15,
18168,
48,
28,
344,
13489,
31,
3,
29716,
272,
485,
7569,
275,
8910,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
84,
6737,
14,
6558,
15,
2775,
15,
19026,
15,
344,
15,
1398,
15,
2384,
15,
22027,
15,
9544,
63,
344,
15,
13145,
996,
3678,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
17718,
1081,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
141,
95,
8381,
110,
17445,
7413,
6500,
14978,
14,
298,
141,
95,
8381,
110,
17445,
7413,
6500,
14978,
1674,
7038,
256,
31815,
6500,
7753,
221,
5806,
7413,
6928,
14,
1717,
14,
7806,
4329,
26,
1216,
297,
288,
283,
1802,
356,
283,
1064,
21,
26,
350,
23,
2158,
23,
697,
11182,
1644,
70,
25,
2658,
69,
31828,
66,
24,
65,
19,
69,
2905,
67,
22,
617,
297,
288,
283,
8311,
356,
283,
264,
23497,
2859,
32569,
8476,
4268,
288,
283,
5553,
356,
413,
7507,
12,
267,
1660,
272,
1660,
469,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
84,
6737,
14,
6558,
15,
13224,
15,
2384,
15,
344,
15,
30688,
1602,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
2194,
10936,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
141,
256,
11487,
8474,
23645,
21273,
7413,
17445,
26,
22213,
221,
18261,
26927,
6500,
25827,
6286,
22213,
18261,
30638,
22213,
8381,
124,
7753,
5806,
8474,
221,
5806,
7038,
121,
5657,
11487,
8474,
16863,
121,
30638,
16961,
7592,
5806,
7038,
110,
15578,
116,
8381,
124,
5657,
8474,
7592,
17445,
25969,
221,
5806,
18261,
21674,
21267,
29352,
25969,
297,
288,
283,
1802,
356,
283,
1064,
21,
26,
70,
1165,
2905,
70,
3172,
69,
2025,
70,
10556,
69,
1407,
70,
1876,
66,
24334,
2592,
25,
16134,
69,
297,
288,
283,
8311,
356,
283,
264,
23497,
2859,
32569,
8476,
4268,
288,
283,
5553,
356,
499,
2277,
12,
267,
1660,
272,
1660,
469,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
84,
6737,
14,
6558,
15,
2775,
15,
19026,
15,
344,
15,
2417,
15,
2384,
15,
22027,
23470,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
9252,
21,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
141,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
SymbiFlow/symbiflow-robot
|
maintain-repos.py
|
1
|
2727
|
#!/usr/bin/env python3
import logging
import os
import re
import sys
import traceback
from github3.exceptions import ForbiddenError
from github3 import login
from github3.repos.status import Status
try:
GITHUB_API_TOKEN = os.environ['GITHUB_API_TOKEN']
ORGANIZATION = os.environ['ORGANIZATION']
# PROJECT-100, [project2-900], etc
LABEL_EXTRACTING_REGEX = os.environ.get('LABEL_EXTRACTING_REGEX',r'\s*[\[]*([a-zA-Z0-9]{2,})[-|\s][0-9]+')
except KeyError as error:
sys.stderr.write('Please set the environment variable {0}'.format(error))
sys.exit(1)
# logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler(sys.stdout)
handler.setLevel(logging.DEBUG)
logger.addHandler(handler)
def main():
client = login(token=GITHUB_API_TOKEN)
organization = client.organization(ORGANIZATION)
repos_iterator = organization.repositories()
info = logger.info
debug = logger.debug
info(f"Getting all repos in {ORGANIZATION}...")
teams = {}
for team in organization.teams():
teams[team.name] = team
if not teams['triage']:
raise Exception("Unable to find `triage` team")
triage_members = [x.login for x in teams['triage'].members()]
triage_repos = [x for x in teams['triage'].repositories()]
if not teams['committers']:
raise Exception("Unable to find `triage` team")
for repository in repos_iterator:
if repository in triage_repos:
print(f"Team triage already has {repository}")
else:
print(f"Adding triage to {repository}")
teams['triage'].add_repository(repository, 'triage')
print("Current triage_members", triage_members)
for user in teams['committers'].members():
if user.login not in triage_members:
print(f'Adding {user} to triage team')
teams['triage'].add_member(user)
else:
print(f'User {user} already in triage team')
for repository in repos_iterator:
labels = set(x.name for x in repository.labels())
print(repository, labels)
if 'merge-if-green' not in labels:
try:
repository.create_label('merge-if-green', '#00ff00', """\
Merge pull request if the CI system goes green.""")
except ForbiddenError as e:
print(e)
if 'kokoro:force-run' not in labels:
try:
repository.create_label('kokoro:force-run', '#170e6d', """\
Force the Google Kokoro CI system to run on a pull request.""")
except ForbiddenError as e:
print(e)
if __name__ == '__main__':
main()
|
mit
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
19,
199,
646,
2050,
199,
646,
747,
199,
646,
295,
199,
646,
984,
199,
646,
5190,
199,
199,
504,
12869,
19,
14,
3924,
492,
2104,
10912,
547,
199,
504,
12869,
19,
492,
4676,
199,
504,
12869,
19,
14,
11857,
14,
1205,
492,
9795,
421,
199,
893,
26,
272,
598,
30087,
63,
3735,
63,
8803,
275,
747,
14,
2314,
459,
39,
30087,
63,
3735,
63,
8803,
418,
272,
1549,
39,
879,
22800,
275,
747,
14,
2314,
459,
25797,
879,
22800,
418,
272,
327,
21915,
13,
1960,
12,
359,
1715,
18,
13,
17518,
467,
5423,
272,
491,
1217,
2901,
63,
30335,
1206,
63,
10710,
275,
747,
14,
2314,
14,
362,
360,
13837,
63,
30335,
1206,
63,
10710,
297,
82,
1154,
83,
10,
7023,
59,
3672,
779,
65,
13,
6353,
13,
58,
16,
13,
25,
8194,
18,
12,
1552,
1988,
6113,
83,
1527,
16,
13,
25,
2807,
358,
199,
2590,
4067,
465,
1125,
26,
272,
984,
14,
3083,
14,
952,
360,
8254,
663,
314,
3734,
1750,
469,
16,
5285,
908,
8,
705,
430,
272,
984,
14,
2224,
8,
17,
9,
199,
199,
3,
2050,
14,
19602,
8,
1745,
29,
1274,
14,
2703,
12,
2166,
29,
4806,
14,
5287,
9,
199,
2921,
275,
2050,
14,
5572,
3460,
354,
3368,
199,
2921,
14,
13548,
8,
4806,
14,
5287,
9,
199,
2232,
275,
2050,
14,
22482,
8,
1274,
14,
2703,
9,
199,
2232,
14,
13548,
8,
4806,
14,
5287,
9,
199,
2921,
14,
18826,
8,
2232,
9,
421,
199,
318,
2446,
837,
272,
1890,
275,
4676,
8,
1418,
29,
39,
30087,
63,
3735,
63,
8803,
9,
272,
13237,
275,
1890,
14,
9071,
8,
25797,
879,
22800,
9,
272,
20416,
63,
5778,
275,
13237,
14,
23949,
342,
339,
2256,
275,
2512,
14,
815,
272,
3105,
275,
2512,
14,
1757,
339,
2256,
8,
70,
2,
28277,
1006,
20416,
315,
469,
25797,
879,
22800,
93,
12594,
272,
25823,
275,
1052,
272,
367,
8099,
315,
13237,
14,
19048,
837,
267,
25823,
59,
5969,
14,
354,
61,
275,
8099,
339,
340,
440,
25823,
459,
599,
474,
2565,
267,
746,
2186,
480,
6005,
370,
2342,
658,
599,
474,
64,
8099,
531,
272,
3229,
474,
63,
6334,
275,
359,
88,
14,
2886,
367,
671,
315,
25823,
459,
599,
474,
2278,
6334,
5106,
272,
3229,
474,
63,
11857,
275,
359,
88,
367,
671,
315,
25823,
459,
599,
474,
2278,
23949,
5106,
272,
340,
440,
25823,
459,
3543,
878,
2565,
267,
746,
2186,
480,
6005,
370,
2342,
658,
599,
474,
64,
8099,
531,
339,
367,
7611,
315,
20416,
63,
5778,
26,
267,
340,
7611,
315,
3229,
474,
63,
11857,
26,
288,
870,
8,
70,
2,
13126,
3229,
474,
2575,
965,
469,
8421,
15412,
267,
587,
26,
288,
870,
8,
70,
2,
20897,
3229,
474,
370,
469,
8421,
15412,
288,
25823,
459,
599,
474,
2278,
525,
63,
8421,
8,
8421,
12,
283,
599,
474,
358,
339,
870,
480,
5639,
3229,
474,
63,
6334,
401,
3229,
474,
63,
6334,
9,
272,
367,
922,
315,
25823,
459,
3543,
878,
2278,
6334,
837,
267,
340,
922,
14,
2886,
440,
315,
3229,
474,
63,
6334,
26,
288,
870,
8,
70,
7,
20897,
469,
751,
93,
370,
3229,
474,
8099,
358,
288,
25823,
459,
599,
474,
2278,
525,
63,
1114,
8,
751,
9,
267,
587,
26,
288,
870,
8,
70,
7,
1899,
469,
751,
93,
2575,
315,
3229,
474,
8099,
358,
339,
367,
7611,
315,
20416,
63,
5778,
26,
267,
3628,
275,
663,
8,
88,
14,
354,
367,
671,
315,
7611,
14,
3512,
1012,
267,
870,
8,
8421,
12,
3628,
9,
267,
340,
283,
5628,
13,
692,
13,
7731,
7,
440,
315,
3628,
26,
288,
862,
26,
355,
7611,
14,
981,
63,
1302,
360,
5628,
13,
692,
13,
7731,
297,
3943,
383,
556,
383,
297,
9638,
199,
11359,
10299,
1056,
340,
314,
445,
41,
2656,
13538,
12431,
24887,
288,
871,
2104,
10912,
547,
465,
325,
26,
355,
870,
8,
69,
9,
267,
340,
283,
75,
745,
269,
79,
26,
3990,
13,
1065,
7,
440,
315,
3628,
26,
288,
862,
26,
355,
7611,
14,
981,
63,
1302,
360,
75,
745,
269,
79,
26,
3990,
13,
1065,
297,
3943,
11010,
69,
22,
68,
297,
9638,
199,
13606,
314,
4475,
1804,
745,
269,
79,
445,
41,
2656,
370,
1255,
641,
282,
10299,
1056,
24887,
288,
871,
2104,
10912,
547,
465,
325,
26,
355,
870,
8,
69,
9,
421,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
2446,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2647,
15,
1393,
15,
1813,
2366,
19,
199,
646,
2050,
199,
646,
747,
199,
646,
295,
199,
646,
984,
199,
646,
5190,
199,
199,
504,
12869,
19,
14,
3924,
492,
2104,
10912,
547,
199,
504,
12869,
19,
492,
4676,
199,
504,
12869,
19,
14,
11857,
14,
1205,
492,
9795,
421,
199,
893,
26,
272,
598,
30087,
63,
3735,
63,
8803,
275,
747,
14,
2314,
459,
39,
30087,
63,
3735,
63,
8803,
418,
272,
1549,
39,
879,
22800,
275,
747,
14,
2314,
459,
25797,
879,
22800,
418,
272,
327,
21915,
13,
1960,
12,
359,
1715,
18,
13,
17518,
467,
5423,
272,
491,
1217,
2901,
63,
30335,
1206,
63,
10710,
275,
747,
14,
2314,
14,
362,
360,
13837,
63,
30335,
1206,
63,
10710,
297,
82,
1154,
83,
10,
7023,
59,
3672,
779,
65,
13,
6353,
13,
58,
16,
13,
25,
8194,
18,
12,
1552,
1988,
6113,
83,
1527,
16,
13,
25,
2807,
358,
199,
2590,
4067,
465,
1125,
26,
272,
984,
14,
3083,
14,
952,
360,
8254,
663,
314,
3734,
1750,
469,
16,
5285,
908,
8,
705,
430,
272,
984,
14,
2224,
8,
17,
9,
199,
199,
3,
2050,
14,
19602,
8,
1745,
29,
1274,
14,
2703,
12,
2166,
29,
4806,
14,
5287,
9,
199,
2921,
275,
2050,
14,
5572,
3460,
354,
3368,
199,
2921,
14,
13548,
8,
4806,
14,
5287,
9,
199,
2232,
275,
2050,
14,
22482,
8,
1274,
14,
2703,
9,
199,
2232,
14,
13548,
8,
4806,
14,
5287,
9,
199,
2921,
14,
18826,
8,
2232,
9,
421,
199,
318,
2446,
837,
272,
1890,
275,
4676,
8,
1418,
29,
39,
30087,
63,
3735,
63,
8803,
9,
272,
13237,
275,
1890,
14,
9071,
8,
25797,
879,
22800,
9,
272,
20416,
63,
5778,
275,
13237,
14,
23949,
342,
339,
2256,
275,
2512,
14,
815,
272,
3105,
275,
2512,
14,
1757,
339,
2256,
8,
70,
2,
28277,
1006,
20416,
315,
469,
25797,
879,
22800,
93,
12594,
272,
25823,
275,
1052,
272,
367,
8099,
315,
13237,
14,
19048,
837,
267,
25823,
59,
5969,
14,
354,
61,
275,
8099,
339,
340,
440,
25823,
459,
599,
474,
2565,
267,
746,
2186,
480,
6005,
370,
2342,
658,
599,
474,
64,
8099,
531,
272,
3229,
474,
63,
6334,
275,
359,
88,
14,
2886,
367,
671,
315,
25823,
459,
599,
474,
2278,
6334,
5106,
272,
3229,
474,
63,
11857,
275,
359,
88,
367,
671,
315,
25823,
459,
599,
474,
2278,
23949,
5106,
272,
340,
440,
25823,
459,
3543,
878,
2565,
267,
746,
2186,
480,
6005,
370,
2342,
658,
599,
474,
64,
8099,
531,
339,
367,
7611,
315,
20416,
63,
5778,
26,
267,
340,
7611,
315,
3229,
474,
63,
11857,
26,
288,
870,
8,
70,
2,
13126,
3229,
474,
2575,
965,
469,
8421,
15412,
267,
587,
26,
288,
870,
8,
70,
2,
20897,
3229,
474,
370,
469,
8421,
15412,
288,
25823,
459,
599,
474,
2278,
525,
63,
8421,
8,
8421,
12,
283,
599,
474,
358,
339,
870,
480,
5639,
3229,
474,
63,
6334,
401,
3229,
474,
63,
6334,
9,
272,
367,
922,
315,
25823,
459,
3543,
878,
2278,
6334,
837,
267,
340,
922,
14,
2886,
440,
315,
3229,
474,
63,
6334,
26,
288,
870,
8,
70,
7,
20897,
469,
751,
93,
370,
3229,
474,
8099,
358,
288,
25823,
459,
599,
474,
2278,
525,
63,
1114,
8,
751,
9,
267,
587,
26,
288,
870,
8,
70,
7,
1899,
469,
751,
93,
2575,
315,
3229,
474,
8099,
358,
339,
367,
7611,
315,
20416,
63,
5778,
26,
267,
3628,
275,
663,
8,
88,
14,
354,
367,
671,
315,
7611,
14,
3512,
1012,
267,
870,
8,
8421,
12,
3628,
9,
267,
340,
283,
5628,
13,
692,
13,
7731,
7,
440,
315,
3628,
26,
288,
862,
26,
355,
7611,
14,
981,
63,
1302,
360,
5628,
13,
692,
13,
7731,
297,
3943,
383,
556,
383,
297,
9638,
199,
11359,
10299,
1056,
340,
314,
445,
41,
2656,
13538,
12431,
24887,
288,
871,
2104,
10912,
547,
465,
325,
26,
355,
870,
8,
69,
9,
267,
340,
283,
75,
745,
269,
79,
26,
3990,
13,
1065,
7,
440,
315,
3628,
26,
288,
862,
26,
355,
7611,
14,
981,
63,
1302,
360,
75,
745,
269,
79,
26,
3990,
13,
1065,
297,
3943,
11010,
69,
22,
68,
297,
9638,
199,
13606,
314,
4475,
1804,
745,
269,
79,
445,
41,
2656,
370,
1255,
641,
282,
10299,
1056,
24887,
288,
871,
2104,
10912,
547,
465,
325,
26,
355,
870,
8,
69,
9,
421,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
2446,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
atloiaco/vivo-pump
|
uf_examples/publications/filters/author_match_filter.py
|
2
|
2750
|
#!/usr/bin/env/python
"""
author_match_filter.py -- find the authors in VIVO, and match them to authors
in the source. This is often called disambiguation.
There are two inputs:
1. authors in VIVO. Keyed by name parts
1. authors in the source. Keyed by name parts
There are two cases:
1. The source indicates the author is not a UF author. In this case, the author will automatically be added as
a "stub." No attempt is made to match stubs. This leads to proliferation of stubs but is consistent with
"Assert what you know" and avoids assuming two stubs are the same.
1. The source indicates the author is at UF. In this case, extensive disambiguation matching occurs, based on
name and name parts. If no match occurs, the author will be added as a UFEntity. If multiple matches occur,
one is selected at random and a disambiguation report entry is produced showing all the possible matches and
the one that was selected. Many disambiguation cases involve two URI. Randomly selecting one cuts the effort to
assign these potentially by half. If exactly one match occurs, the match is made, the URI provided in the
update data.
See CHANGELOG.md for history
"""
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2015 (c) Michael Conlon"
__license__ = "New BSD License"
__version__ = "0.01"
from vivopump import read_csv_fp, write_csv_fp, get_vivo_authors, get_parms
import sys
def disambiguate_author(author, vivo_authors):
"""
Given an author dictionary with name parts, find matches in the data structure returned by get_vivo_authors
:param author: dictionary of name parts
:param vivo_authors: authors in VIVO, seven dictionaries with seven keys based on various types of name parts
:return: list of uri in vivo matching the author
"""
author_uri_list = []
return author_uri_list
parms = get_parms()
data_in = read_csv_fp(sys.stdin)
print >>sys.stderr, len(data_in)
vivo_authors = get_vivo_authors(parms) # get dictionaries of authors keyed by name parts
print >>sys.stderr, 'VIVO authors', len(vivo_authors)
print >>sys.stderr, vivo_authors
data_out = {}
row_out = 0
for row, data in data_in.items():
if data['uf'] == 'false': # Always put in the non-UF author as new
row_out += 1
data_out[row_out] = data
data_out[row_out]['uri'] = ''
else:
author_uris = disambiguate_author(data, vivo_authors)
if len(author_uris) == 0: # Only put in a new UF author if no one at UF matches
row_out += 1
data_out[row_out] = data
data_out[row_out]['uri'] = ''
print >>sys.stderr, 'data out', len(data_out)
write_csv_fp(sys.stdout, data_out)
|
bsd-3-clause
|
[
3381,
2647,
15,
1393,
15,
1813,
15,
1548,
199,
199,
624,
272,
4132,
63,
1431,
63,
1541,
14,
647,
1553,
2342,
314,
11462,
315,
812,
6882,
47,
12,
436,
1336,
3062,
370,
11462,
272,
315,
314,
1350,
14,
221,
961,
365,
14115,
2797,
2153,
16902,
4086,
14,
339,
6006,
787,
2877,
4153,
26,
272,
413,
14,
11462,
315,
812,
6882,
47,
14,
2606,
379,
701,
536,
4184,
272,
413,
14,
11462,
315,
314,
1350,
14,
221,
2606,
379,
701,
536,
4184,
339,
6006,
787,
2877,
5560,
26,
339,
413,
14,
221,
710,
1350,
9126,
314,
4132,
365,
440,
282,
738,
38,
4132,
14,
221,
1010,
642,
1930,
12,
314,
4132,
911,
5847,
506,
3483,
465,
272,
282,
298,
5811,
2122,
221,
3091,
7427,
365,
6326,
370,
1336,
22312,
14,
221,
961,
27401,
370,
557,
853,
281,
425,
402,
22312,
1325,
365,
12137,
543,
272,
298,
9699,
4052,
1265,
5715,
2,
436,
23674,
18002,
2877,
22312,
787,
314,
2011,
14,
272,
413,
14,
221,
710,
1350,
9126,
314,
4132,
365,
737,
738,
38,
14,
221,
1010,
642,
1930,
12,
2178,
3398,
2153,
16902,
4086,
4877,
11058,
12,
4079,
641,
272,
536,
436,
536,
4184,
14,
221,
982,
949,
1336,
11058,
12,
314,
4132,
911,
506,
3483,
465,
282,
738,
38,
7302,
14,
221,
982,
3663,
4450,
4781,
12,
272,
1373,
365,
4895,
737,
2196,
436,
282,
2153,
16902,
4086,
3622,
2397,
365,
13584,
21207,
1006,
314,
3962,
4450,
436,
272,
314,
1373,
626,
1990,
4895,
14,
221,
15517,
2153,
16902,
4086,
5560,
4572,
3344,
2877,
9022,
14,
221,
9571,
590,
30090,
1373,
10415,
83,
314,
28058,
370,
272,
5090,
3520,
18994,
701,
12995,
14,
221,
982,
8840,
1373,
1336,
11058,
12,
314,
1336,
365,
6326,
12,
314,
9022,
2741,
315,
314,
272,
1678,
666,
14,
339,
1666,
6624,
9011,
4947,
14,
1064,
367,
7994,
199,
624,
199,
199,
363,
2502,
363,
275,
298,
45,
11781,
1448,
5298,
2,
199,
363,
7307,
363,
275,
298,
7384,
6900,
334,
67,
9,
16922,
1448,
5298,
2,
199,
363,
1682,
363,
275,
298,
4665,
6289,
844,
2,
199,
363,
1023,
363,
275,
298,
16,
14,
614,
2,
199,
199,
504,
373,
1003,
411,
1220,
492,
1586,
63,
4737,
63,
3997,
12,
2218,
63,
4737,
63,
3997,
12,
664,
63,
433,
2392,
63,
8149,
12,
664,
63,
28899,
199,
646,
984,
421,
199,
318,
2153,
16902,
4767,
63,
2502,
8,
2502,
12,
373,
1003,
79,
63,
8149,
304,
272,
408,
272,
9138,
376,
4132,
2600,
543,
536,
4184,
12,
2342,
4450,
315,
314,
666,
5523,
2138,
701,
664,
63,
433,
2392,
63,
8149,
272,
520,
635,
4132,
26,
2600,
402,
536,
4184,
272,
520,
635,
373,
1003,
79,
63,
8149,
26,
11462,
315,
812,
6882,
47,
12,
542,
1856,
11196,
543,
542,
1856,
2883,
4079,
641,
7750,
2943,
402,
536,
4184,
272,
520,
1107,
26,
769,
402,
5108,
315,
373,
1003,
79,
4877,
314,
4132,
272,
408,
272,
4132,
63,
2302,
63,
513,
275,
942,
272,
372,
4132,
63,
2302,
63,
513,
199,
199,
28899,
275,
664,
63,
28899,
342,
199,
576,
63,
262,
275,
1586,
63,
4737,
63,
3997,
8,
1274,
14,
6626,
9,
199,
1361,
4331,
1274,
14,
3083,
12,
822,
8,
576,
63,
262,
9,
199,
433,
2392,
63,
8149,
275,
664,
63,
433,
2392,
63,
8149,
8,
28899,
9,
221,
327,
664,
11196,
402,
11462,
19272,
701,
536,
4184,
199,
1361,
4331,
1274,
14,
3083,
12,
283,
54,
6882,
47,
11462,
297,
822,
8,
433,
2392,
63,
8149,
9,
199,
1361,
4331,
1274,
14,
3083,
12,
373,
1003,
79,
63,
8149,
199,
576,
63,
548,
275,
1052,
199,
1143,
63,
548,
275,
378,
199,
199,
509,
1962,
12,
666,
315,
666,
63,
262,
14,
1744,
837,
272,
340,
666,
459,
1286,
418,
508,
283,
3910,
356,
259,
327,
16763,
5324,
315,
314,
2222,
13,
27363,
4132,
465,
892,
267,
1962,
63,
548,
847,
413,
267,
666,
63,
548,
59,
1143,
63,
548,
61,
275,
666,
267,
666,
63,
548,
59,
1143,
63,
548,
2733,
2302,
418,
275,
2125,
272,
587,
26,
267,
4132,
63,
17656,
275,
2153,
16902,
4767,
63,
2502,
8,
576,
12,
373,
1003,
79,
63,
8149,
9,
267,
340,
822,
8,
2502,
63,
17656,
9,
508,
378,
26,
259,
327,
5972,
5324,
315,
282,
892,
738,
38,
4132,
340,
949,
1373,
737,
738,
38,
4450,
288,
1962,
63,
548,
847,
413,
288,
666,
63,
548,
59,
1143,
63,
548,
61,
275,
666,
288,
666,
63,
548,
59,
1143,
63,
548,
2733,
2302,
418,
275,
2125,
199,
199,
1361,
4331,
1274,
14,
3083,
12,
283,
576,
734,
297,
822,
8,
576,
63,
548,
9,
199,
952,
63,
4737,
63,
3997,
8,
1274,
14,
2703,
12,
666,
63,
548,
9,
6905,
421,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2647,
15,
1393,
15,
1813,
15,
1548,
199,
199,
624,
272,
4132,
63,
1431,
63,
1541,
14,
647,
1553,
2342,
314,
11462,
315,
812,
6882,
47,
12,
436,
1336,
3062,
370,
11462,
272,
315,
314,
1350,
14,
221,
961,
365,
14115,
2797,
2153,
16902,
4086,
14,
339,
6006,
787,
2877,
4153,
26,
272,
413,
14,
11462,
315,
812,
6882,
47,
14,
2606,
379,
701,
536,
4184,
272,
413,
14,
11462,
315,
314,
1350,
14,
221,
2606,
379,
701,
536,
4184,
339,
6006,
787,
2877,
5560,
26,
339,
413,
14,
221,
710,
1350,
9126,
314,
4132,
365,
440,
282,
738,
38,
4132,
14,
221,
1010,
642,
1930,
12,
314,
4132,
911,
5847,
506,
3483,
465,
272,
282,
298,
5811,
2122,
221,
3091,
7427,
365,
6326,
370,
1336,
22312,
14,
221,
961,
27401,
370,
557,
853,
281,
425,
402,
22312,
1325,
365,
12137,
543,
272,
298,
9699,
4052,
1265,
5715,
2,
436,
23674,
18002,
2877,
22312,
787,
314,
2011,
14,
272,
413,
14,
221,
710,
1350,
9126,
314,
4132,
365,
737,
738,
38,
14,
221,
1010,
642,
1930,
12,
2178,
3398,
2153,
16902,
4086,
4877,
11058,
12,
4079,
641,
272,
536,
436,
536,
4184,
14,
221,
982,
949,
1336,
11058,
12,
314,
4132,
911,
506,
3483,
465,
282,
738,
38,
7302,
14,
221,
982,
3663,
4450,
4781,
12,
272,
1373,
365,
4895,
737,
2196,
436,
282,
2153,
16902,
4086,
3622,
2397,
365,
13584,
21207,
1006,
314,
3962,
4450,
436,
272,
314,
1373,
626,
1990,
4895,
14,
221,
15517,
2153,
16902,
4086,
5560,
4572,
3344,
2877,
9022,
14,
221,
9571,
590,
30090,
1373,
10415,
83,
314,
28058,
370,
272,
5090,
3520,
18994,
701,
12995,
14,
221,
982,
8840,
1373,
1336,
11058,
12,
314,
1336,
365,
6326,
12,
314,
9022,
2741,
315,
314,
272,
1678,
666,
14,
339,
1666,
6624,
9011,
4947,
14,
1064,
367,
7994,
199,
624,
199,
199,
363,
2502,
363,
275,
298,
45,
11781,
1448,
5298,
2,
199,
363,
7307,
363,
275,
298,
7384,
6900,
334,
67,
9,
16922,
1448,
5298,
2,
199,
363,
1682,
363,
275,
298,
4665,
6289,
844,
2,
199,
363,
1023,
363,
275,
298,
16,
14,
614,
2,
199,
199,
504,
373,
1003,
411,
1220,
492,
1586,
63,
4737,
63,
3997,
12,
2218,
63,
4737,
63,
3997,
12,
664,
63,
433,
2392,
63,
8149,
12,
664,
63,
28899,
199,
646,
984,
421,
199,
318,
2153,
16902,
4767,
63,
2502,
8,
2502,
12,
373,
1003,
79,
63,
8149,
304,
272,
408,
272,
9138,
376,
4132,
2600,
543,
536,
4184,
12,
2342,
4450,
315,
314,
666,
5523,
2138,
701,
664,
63,
433,
2392,
63,
8149,
272,
520,
635,
4132,
26,
2600,
402,
536,
4184,
272,
520,
635,
373,
1003,
79,
63,
8149,
26,
11462,
315,
812,
6882,
47,
12,
542,
1856,
11196,
543,
542,
1856,
2883,
4079,
641,
7750,
2943,
402,
536,
4184,
272,
520,
1107,
26,
769,
402,
5108,
315,
373,
1003,
79,
4877,
314,
4132,
272,
408,
272,
4132,
63,
2302,
63,
513,
275,
942,
272,
372,
4132,
63,
2302,
63,
513,
199,
199,
28899,
275,
664,
63,
28899,
342,
199,
576,
63,
262,
275,
1586,
63,
4737,
63,
3997,
8,
1274,
14,
6626,
9,
199,
1361,
4331,
1274,
14,
3083,
12,
822,
8,
576,
63,
262,
9,
199,
433,
2392,
63,
8149,
275,
664,
63,
433,
2392,
63,
8149,
8,
28899,
9,
221,
327,
664,
11196,
402,
11462,
19272,
701,
536,
4184,
199,
1361,
4331,
1274,
14,
3083,
12,
283,
54,
6882,
47,
11462,
297,
822,
8,
433,
2392,
63,
8149,
9,
199,
1361,
4331,
1274,
14,
3083,
12,
373,
1003,
79,
63,
8149,
199,
576,
63,
548,
275,
1052,
199,
1143,
63,
548,
275,
378,
199,
199,
509,
1962,
12,
666,
315,
666,
63,
262,
14,
1744,
837,
272,
340,
666,
459,
1286,
418,
508,
283,
3910,
356,
259,
327,
16763,
5324,
315,
314,
2222,
13,
27363,
4132,
465,
892,
267,
1962,
63,
548,
847,
413,
267,
666,
63,
548,
59,
1143,
63,
548,
61,
275,
666,
267,
666,
63,
548,
59,
1143,
63,
548,
2733,
2302,
418,
275,
2125,
272,
587,
26,
267,
4132,
63,
17656,
275,
2153,
16902,
4767,
63,
2502,
8,
576,
12,
373,
1003,
79,
63,
8149,
9,
267,
340,
822,
8,
2502,
63,
17656,
9,
508,
378,
26,
259,
327,
5972,
5324,
315,
282,
892,
738,
38,
4132,
340,
949,
1373,
737,
738,
38,
4450,
288,
1962,
63,
548,
847,
413,
288,
666,
63,
548,
59,
1143,
63,
548,
61,
275,
666,
288,
666,
63,
548,
59,
1143,
63,
548,
2733,
2302,
418,
275,
2125,
199,
199,
1361,
4331,
1274,
14,
3083,
12,
283,
576,
734,
297,
822,
8,
576,
63,
548,
9,
199,
952,
63,
4737,
63,
3997,
8,
1274,
14,
2703,
12,
666,
63,
548,
9,
6905,
421,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
delhivery/django
|
tests/gis_tests/inspectapp/tests.py
|
180
|
8022
|
from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.core.management import call_command
from django.db import connection, connections
from django.test import TestCase, skipUnlessDBFeature
from django.test.utils import modify_settings
from django.utils.six import StringIO
from ..test_data import TEST_DATA
if HAS_GDAL:
from django.contrib.gis.gdal import Driver, GDALException, GDAL_VERSION
from django.contrib.gis.utils.ogrinspect import ogrinspect
from .models import AllOGRFields
@skipUnless(HAS_GDAL, "InspectDbTests needs GDAL support")
class InspectDbTests(TestCase):
@skipUnlessDBFeature("gis_enabled")
def test_geom_columns(self):
"""
Test the geo-enabled inspectdb command.
"""
out = StringIO()
call_command(
'inspectdb',
table_name_filter=lambda tn: tn == 'inspectapp_allogrfields',
stdout=out
)
output = out.getvalue()
if connection.features.supports_geometry_field_introspection:
self.assertIn('geom = models.PolygonField()', output)
self.assertIn('point = models.PointField()', output)
else:
self.assertIn('geom = models.GeometryField(', output)
self.assertIn('point = models.GeometryField(', output)
@skipUnlessDBFeature("supports_3d_storage")
def test_3d_columns(self):
out = StringIO()
call_command(
'inspectdb',
table_name_filter=lambda tn: tn == 'inspectapp_fields3d',
stdout=out
)
output = out.getvalue()
if connection.features.supports_geometry_field_introspection:
self.assertIn('point = models.PointField(dim=3)', output)
self.assertIn('line = models.LineStringField(dim=3)', output)
self.assertIn('poly = models.PolygonField(dim=3)', output)
else:
self.assertIn('point = models.GeometryField(', output)
self.assertIn('line = models.GeometryField(', output)
self.assertIn('poly = models.GeometryField(', output)
@skipUnless(HAS_GDAL, "OGRInspectTest needs GDAL support")
@modify_settings(
INSTALLED_APPS={'append': 'django.contrib.gis'},
)
class OGRInspectTest(TestCase):
maxDiff = 1024
def test_poly(self):
shp_file = os.path.join(TEST_DATA, 'test_poly', 'test_poly.shp')
model_def = ogrinspect(shp_file, 'MyModel')
expected = [
'# This is an auto-generated Django model module created by ogrinspect.',
'from django.contrib.gis.db import models',
'',
'class MyModel(models.Model):',
' float = models.FloatField()',
' int = models.{}()'.format('BigIntegerField' if GDAL_VERSION >= (2, 0) else 'FloatField'),
' str = models.CharField(max_length=80)',
' geom = models.PolygonField(srid=-1)',
]
self.assertEqual(model_def, '\n'.join(expected))
def test_poly_multi(self):
shp_file = os.path.join(TEST_DATA, 'test_poly', 'test_poly.shp')
model_def = ogrinspect(shp_file, 'MyModel', multi_geom=True)
self.assertIn('geom = models.MultiPolygonField(srid=-1)', model_def)
# Same test with a 25D-type geometry field
shp_file = os.path.join(TEST_DATA, 'gas_lines', 'gas_leitung.shp')
model_def = ogrinspect(shp_file, 'MyModel', multi_geom=True)
self.assertIn('geom = models.MultiLineStringField(srid=-1)', model_def)
def test_date_field(self):
shp_file = os.path.join(TEST_DATA, 'cities', 'cities.shp')
model_def = ogrinspect(shp_file, 'City')
expected = [
'# This is an auto-generated Django model module created by ogrinspect.',
'from django.contrib.gis.db import models',
'',
'class City(models.Model):',
' name = models.CharField(max_length=80)',
' population = models.{}()'.format('BigIntegerField' if GDAL_VERSION >= (2, 0) else 'FloatField'),
' density = models.FloatField()',
' created = models.DateField()',
' geom = models.PointField(srid=-1)',
]
self.assertEqual(model_def, '\n'.join(expected))
def test_time_field(self):
# Getting the database identifier used by OGR, if None returned
# GDAL does not have the support compiled in.
ogr_db = get_ogr_db_string()
if not ogr_db:
self.skipTest("Unable to setup an OGR connection to your database")
try:
# Writing shapefiles via GDAL currently does not support writing OGRTime
# fields, so we need to actually use a database
model_def = ogrinspect(ogr_db, 'Measurement',
layer_key=AllOGRFields._meta.db_table,
decimal=['f_decimal'])
except GDALException:
self.skipTest("Unable to setup an OGR connection to your database")
self.assertTrue(model_def.startswith(
'# This is an auto-generated Django model module created by ogrinspect.\n'
'from django.contrib.gis.db import models\n'
'\n'
'class Measurement(models.Model):\n'
))
# The ordering of model fields might vary depending on several factors (version of GDAL, etc.)
self.assertIn(' f_decimal = models.DecimalField(max_digits=0, decimal_places=0)', model_def)
self.assertIn(' f_int = models.IntegerField()', model_def)
self.assertIn(' f_datetime = models.DateTimeField()', model_def)
self.assertIn(' f_time = models.TimeField()', model_def)
self.assertIn(' f_float = models.FloatField()', model_def)
self.assertIn(' f_char = models.CharField(max_length=10)', model_def)
self.assertIn(' f_date = models.DateField()', model_def)
# Some backends may have srid=-1
self.assertIsNotNone(re.search(r' geom = models.PolygonField\(([^\)])*\)', model_def))
def test_management_command(self):
shp_file = os.path.join(TEST_DATA, 'cities', 'cities.shp')
out = StringIO()
call_command('ogrinspect', shp_file, 'City', stdout=out)
output = out.getvalue()
self.assertIn('class City(models.Model):', output)
def get_ogr_db_string():
"""
Construct the DB string that GDAL will use to inspect the database.
GDAL will create its own connection to the database, so we re-use the
connection settings from the Django test.
"""
db = connections.databases['default']
# Map from the django backend into the OGR driver name and database identifier
# http://www.gdal.org/ogr/ogr_formats.html
#
# TODO: Support Oracle (OCI).
drivers = {
'django.contrib.gis.db.backends.postgis': ('PostgreSQL', "PG:dbname='%(db_name)s'", ' '),
'django.contrib.gis.db.backends.mysql': ('MySQL', 'MYSQL:"%(db_name)s"', ','),
'django.contrib.gis.db.backends.spatialite': ('SQLite', '%(db_name)s', '')
}
db_engine = db['ENGINE']
if db_engine not in drivers:
return None
drv_name, db_str, param_sep = drivers[db_engine]
# Ensure that GDAL library has driver support for the database.
try:
Driver(drv_name)
except:
return None
# SQLite/Spatialite in-memory databases
if db['NAME'] == ":memory:":
return None
# Build the params of the OGR database connection string
params = [db_str % {'db_name': db['NAME']}]
def add(key, template):
value = db.get(key, None)
# Don't add the parameter if it is not in django's settings
if value:
params.append(template % value)
add('HOST', "host='%s'")
add('PORT', "port='%s'")
add('USER', "user='%s'")
add('PASSWORD', "password='%s'")
return param_sep.join(params)
|
bsd-3-clause
|
[
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
747,
199,
646,
295,
199,
504,
2882,
492,
3372,
5524,
199,
199,
504,
1639,
14,
2828,
14,
5668,
14,
11600,
492,
7509,
63,
17835,
199,
504,
1639,
14,
1018,
14,
8110,
492,
1240,
63,
1531,
199,
504,
1639,
14,
697,
492,
1950,
12,
6947,
199,
504,
1639,
14,
396,
492,
7640,
12,
3372,
5524,
18093,
199,
504,
1639,
14,
396,
14,
1208,
492,
2811,
63,
1751,
199,
504,
1639,
14,
1208,
14,
4174,
492,
5228,
199,
199,
504,
2508,
396,
63,
576,
492,
7393,
63,
3998,
199,
199,
692,
7509,
63,
17835,
26,
272,
687,
1639,
14,
2828,
14,
5668,
14,
11600,
492,
19447,
12,
15801,
1726,
12,
15801,
63,
4612,
272,
687,
1639,
14,
2828,
14,
5668,
14,
1208,
14,
14945,
10955,
492,
20713,
10955,
339,
687,
1275,
992,
492,
2900,
17275,
7304,
421,
199,
32,
11278,
8,
13533,
63,
17835,
12,
298,
13962,
1764,
8882,
2925,
4839,
15801,
2291,
531,
199,
533,
12062,
1764,
8882,
2925,
8,
1746,
304,
272,
768,
22424,
480,
5668,
63,
3827,
531,
272,
347,
511,
63,
6481,
63,
3406,
8,
277,
304,
267,
408,
267,
1379,
314,
8509,
13,
3827,
6485,
697,
1414,
14,
267,
408,
267,
734,
275,
5228,
342,
267,
1240,
63,
1531,
8,
288,
283,
10955,
697,
297,
288,
1817,
63,
354,
63,
1541,
29,
2734,
22762,
26,
22762,
508,
283,
10955,
571,
63,
279,
793,
82,
955,
297,
288,
3839,
29,
548,
267,
776,
267,
1072,
275,
734,
14,
7150,
342,
267,
340,
1950,
14,
3179,
14,
9823,
63,
7660,
63,
698,
63,
21627,
26,
288,
291,
14,
4080,
360,
6481,
275,
1709,
14,
12367,
792,
19633,
1072,
9,
288,
291,
14,
4080,
360,
1403,
275,
1709,
14,
3428,
792,
19633,
1072,
9,
267,
587,
26,
288,
291,
14,
4080,
360,
6481,
275,
1709,
14,
6831,
792,
5102,
1072,
9,
288,
291,
14,
4080,
360,
1403,
275,
1709,
14,
6831,
792,
5102,
1072,
9,
339,
768,
22424,
480,
9823,
63,
19,
68,
63,
3494,
531,
272,
347,
511,
63,
19,
68,
63,
3406,
8,
277,
304,
267,
734,
275,
5228,
342,
267,
1240,
63,
1531,
8,
288,
283,
10955,
697,
297,
288,
1817,
63,
354,
63,
1541,
29,
2734,
22762,
26,
22762,
508,
283,
10955,
571,
63,
955,
19,
68,
297,
288,
3839,
29,
548,
267,
776,
267,
1072,
275,
734,
14,
7150,
342,
267,
340,
1950,
14,
3179,
14,
9823,
63,
7660,
63,
698,
63,
21627,
26,
288,
291,
14,
4080,
360,
1403,
275,
1709,
14,
3428,
792,
8,
3572,
29,
19,
3196,
1072,
9,
288,
291,
14,
4080,
360,
604,
275,
1709,
14,
3049,
14912,
8,
3572,
29,
19,
3196,
1072,
9,
288,
291,
14,
4080,
360,
6023,
275,
1709,
14,
12367,
792,
8,
3572,
29,
19,
3196,
1072,
9,
267,
587,
26,
288,
291,
14,
4080,
360,
1403,
275,
1709,
14,
6831,
792,
5102,
1072,
9,
288,
291,
14,
4080,
360,
604,
275,
1709,
14,
6831,
792,
5102,
1072,
9,
288,
291,
14,
4080,
360,
6023,
275,
1709,
14,
6831,
792,
5102,
1072,
9,
421,
199,
32,
11278,
8,
13533,
63,
17835,
12,
298,
17275,
13962,
1764,
774,
4839,
15801,
2291,
531,
199,
32,
8951,
63,
1751,
8,
272,
31061,
63,
14219,
3713,
740,
356,
283,
1176,
14,
2828,
14,
5668,
2267,
199,
9,
199,
533,
10904,
13962,
1764,
774,
8,
1746,
304,
272,
1390,
10746,
275,
6619,
339,
347,
511,
63,
6023,
8,
277,
304,
267,
1033,
80,
63,
493,
275,
747,
14,
515,
14,
904,
8,
2864,
63,
3998,
12,
283,
396,
63,
6023,
297,
283,
396,
63,
6023,
14,
17299,
358,
267,
1402,
63,
318,
275,
20713,
10955,
8,
17299,
63,
493,
12,
283,
5713,
1685,
358,
398,
1420,
275,
359,
288,
3943,
961,
365,
376,
2599,
13,
10176,
5634,
1402,
859,
2737,
701,
20713,
10955,
3130,
288,
283,
504,
1639,
14,
2828,
14,
5668,
14,
697,
492,
1709,
297,
288,
3260,
288,
283,
533,
4932,
1685,
8,
992,
14,
1685,
304,
297,
288,
283,
259,
2069,
275,
1709,
14,
13019,
19633,
288,
283,
259,
1109,
275,
1709,
14,
2440,
342,
1370,
908,
360,
25175,
7,
340,
15801,
63,
4612,
2356,
334,
18,
12,
378,
9,
587,
283,
13019,
659,
288,
283,
259,
620,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1257,
3196,
288,
283,
259,
9671,
275,
1709,
14,
12367,
792,
8,
10498,
4022,
17,
3196,
267,
1622,
398,
291,
14,
629,
8,
1238,
63,
318,
12,
1557,
78,
1370,
904,
8,
2062,
430,
339,
347,
511,
63,
6023,
63,
3029,
8,
277,
304,
267,
1033,
80,
63,
493,
275,
747,
14,
515,
14,
904,
8,
2864,
63,
3998,
12,
283,
396,
63,
6023,
297,
283,
396,
63,
6023,
14,
17299,
358,
267,
1402,
63,
318,
275,
20713,
10955,
8,
17299,
63,
493,
12,
283,
5713,
1685,
297,
3510,
63,
6481,
29,
549,
9,
267,
291,
14,
4080,
360,
6481,
275,
1709,
14,
3947,
12367,
792,
8,
10498,
4022,
17,
3196,
1402,
63,
318,
9,
267,
327,
14766,
511,
543,
282,
5661,
36,
13,
466,
3400,
901,
267,
1033,
80,
63,
493,
275,
747,
14,
515,
14,
904,
8,
2864,
63,
3998,
12,
283,
24364,
63,
1278,
297,
283,
24364,
63,
274,
390,
10335,
14,
17299,
358,
267,
1402,
63,
318,
275,
20713,
10955,
8,
17299,
63,
493,
12,
283,
5713,
1685,
297,
3510,
63,
6481,
29,
549,
9,
267,
291,
14,
4080,
360,
6481,
275,
1709,
14,
3947,
3049,
14912,
8,
10498,
4022,
17,
3196,
1402,
63,
318,
9,
339,
347,
511,
63,
602,
63,
698,
8,
277,
304,
267,
1033,
80,
63,
493,
275,
747,
14,
515,
14,
904,
8,
2864,
63,
3998,
12,
283,
18207,
297,
283,
18207,
14,
17299,
358,
267,
1402,
63,
318,
275,
20713,
10955,
8,
17299,
63,
493,
12,
283,
17024,
358,
398,
1420,
275,
359,
288,
3943,
961,
365,
376,
2599,
13,
10176,
5634,
1402,
859,
2737,
701,
20713,
10955,
3130,
288,
283,
504,
1639,
14,
2828,
14,
5668,
14,
697,
492,
1709,
297,
288,
3260,
288,
283,
533,
14753,
8,
992,
14,
1685,
304,
297,
288,
283,
259,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1257,
3196,
288,
283,
259,
16423
] |
[
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
747,
199,
646,
295,
199,
504,
2882,
492,
3372,
5524,
199,
199,
504,
1639,
14,
2828,
14,
5668,
14,
11600,
492,
7509,
63,
17835,
199,
504,
1639,
14,
1018,
14,
8110,
492,
1240,
63,
1531,
199,
504,
1639,
14,
697,
492,
1950,
12,
6947,
199,
504,
1639,
14,
396,
492,
7640,
12,
3372,
5524,
18093,
199,
504,
1639,
14,
396,
14,
1208,
492,
2811,
63,
1751,
199,
504,
1639,
14,
1208,
14,
4174,
492,
5228,
199,
199,
504,
2508,
396,
63,
576,
492,
7393,
63,
3998,
199,
199,
692,
7509,
63,
17835,
26,
272,
687,
1639,
14,
2828,
14,
5668,
14,
11600,
492,
19447,
12,
15801,
1726,
12,
15801,
63,
4612,
272,
687,
1639,
14,
2828,
14,
5668,
14,
1208,
14,
14945,
10955,
492,
20713,
10955,
339,
687,
1275,
992,
492,
2900,
17275,
7304,
421,
199,
32,
11278,
8,
13533,
63,
17835,
12,
298,
13962,
1764,
8882,
2925,
4839,
15801,
2291,
531,
199,
533,
12062,
1764,
8882,
2925,
8,
1746,
304,
272,
768,
22424,
480,
5668,
63,
3827,
531,
272,
347,
511,
63,
6481,
63,
3406,
8,
277,
304,
267,
408,
267,
1379,
314,
8509,
13,
3827,
6485,
697,
1414,
14,
267,
408,
267,
734,
275,
5228,
342,
267,
1240,
63,
1531,
8,
288,
283,
10955,
697,
297,
288,
1817,
63,
354,
63,
1541,
29,
2734,
22762,
26,
22762,
508,
283,
10955,
571,
63,
279,
793,
82,
955,
297,
288,
3839,
29,
548,
267,
776,
267,
1072,
275,
734,
14,
7150,
342,
267,
340,
1950,
14,
3179,
14,
9823,
63,
7660,
63,
698,
63,
21627,
26,
288,
291,
14,
4080,
360,
6481,
275,
1709,
14,
12367,
792,
19633,
1072,
9,
288,
291,
14,
4080,
360,
1403,
275,
1709,
14,
3428,
792,
19633,
1072,
9,
267,
587,
26,
288,
291,
14,
4080,
360,
6481,
275,
1709,
14,
6831,
792,
5102,
1072,
9,
288,
291,
14,
4080,
360,
1403,
275,
1709,
14,
6831,
792,
5102,
1072,
9,
339,
768,
22424,
480,
9823,
63,
19,
68,
63,
3494,
531,
272,
347,
511,
63,
19,
68,
63,
3406,
8,
277,
304,
267,
734,
275,
5228,
342,
267,
1240,
63,
1531,
8,
288,
283,
10955,
697,
297,
288,
1817,
63,
354,
63,
1541,
29,
2734,
22762,
26,
22762,
508,
283,
10955,
571,
63,
955,
19,
68,
297,
288,
3839,
29,
548,
267,
776,
267,
1072,
275,
734,
14,
7150,
342,
267,
340,
1950,
14,
3179,
14,
9823,
63,
7660,
63,
698,
63,
21627,
26,
288,
291,
14,
4080,
360,
1403,
275,
1709,
14,
3428,
792,
8,
3572,
29,
19,
3196,
1072,
9,
288,
291,
14,
4080,
360,
604,
275,
1709,
14,
3049,
14912,
8,
3572,
29,
19,
3196,
1072,
9,
288,
291,
14,
4080,
360,
6023,
275,
1709,
14,
12367,
792,
8,
3572,
29,
19,
3196,
1072,
9,
267,
587,
26,
288,
291,
14,
4080,
360,
1403,
275,
1709,
14,
6831,
792,
5102,
1072,
9,
288,
291,
14,
4080,
360,
604,
275,
1709,
14,
6831,
792,
5102,
1072,
9,
288,
291,
14,
4080,
360,
6023,
275,
1709,
14,
6831,
792,
5102,
1072,
9,
421,
199,
32,
11278,
8,
13533,
63,
17835,
12,
298,
17275,
13962,
1764,
774,
4839,
15801,
2291,
531,
199,
32,
8951,
63,
1751,
8,
272,
31061,
63,
14219,
3713,
740,
356,
283,
1176,
14,
2828,
14,
5668,
2267,
199,
9,
199,
533,
10904,
13962,
1764,
774,
8,
1746,
304,
272,
1390,
10746,
275,
6619,
339,
347,
511,
63,
6023,
8,
277,
304,
267,
1033,
80,
63,
493,
275,
747,
14,
515,
14,
904,
8,
2864,
63,
3998,
12,
283,
396,
63,
6023,
297,
283,
396,
63,
6023,
14,
17299,
358,
267,
1402,
63,
318,
275,
20713,
10955,
8,
17299,
63,
493,
12,
283,
5713,
1685,
358,
398,
1420,
275,
359,
288,
3943,
961,
365,
376,
2599,
13,
10176,
5634,
1402,
859,
2737,
701,
20713,
10955,
3130,
288,
283,
504,
1639,
14,
2828,
14,
5668,
14,
697,
492,
1709,
297,
288,
3260,
288,
283,
533,
4932,
1685,
8,
992,
14,
1685,
304,
297,
288,
283,
259,
2069,
275,
1709,
14,
13019,
19633,
288,
283,
259,
1109,
275,
1709,
14,
2440,
342,
1370,
908,
360,
25175,
7,
340,
15801,
63,
4612,
2356,
334,
18,
12,
378,
9,
587,
283,
13019,
659,
288,
283,
259,
620,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1257,
3196,
288,
283,
259,
9671,
275,
1709,
14,
12367,
792,
8,
10498,
4022,
17,
3196,
267,
1622,
398,
291,
14,
629,
8,
1238,
63,
318,
12,
1557,
78,
1370,
904,
8,
2062,
430,
339,
347,
511,
63,
6023,
63,
3029,
8,
277,
304,
267,
1033,
80,
63,
493,
275,
747,
14,
515,
14,
904,
8,
2864,
63,
3998,
12,
283,
396,
63,
6023,
297,
283,
396,
63,
6023,
14,
17299,
358,
267,
1402,
63,
318,
275,
20713,
10955,
8,
17299,
63,
493,
12,
283,
5713,
1685,
297,
3510,
63,
6481,
29,
549,
9,
267,
291,
14,
4080,
360,
6481,
275,
1709,
14,
3947,
12367,
792,
8,
10498,
4022,
17,
3196,
1402,
63,
318,
9,
267,
327,
14766,
511,
543,
282,
5661,
36,
13,
466,
3400,
901,
267,
1033,
80,
63,
493,
275,
747,
14,
515,
14,
904,
8,
2864,
63,
3998,
12,
283,
24364,
63,
1278,
297,
283,
24364,
63,
274,
390,
10335,
14,
17299,
358,
267,
1402,
63,
318,
275,
20713,
10955,
8,
17299,
63,
493,
12,
283,
5713,
1685,
297,
3510,
63,
6481,
29,
549,
9,
267,
291,
14,
4080,
360,
6481,
275,
1709,
14,
3947,
3049,
14912,
8,
10498,
4022,
17,
3196,
1402,
63,
318,
9,
339,
347,
511,
63,
602,
63,
698,
8,
277,
304,
267,
1033,
80,
63,
493,
275,
747,
14,
515,
14,
904,
8,
2864,
63,
3998,
12,
283,
18207,
297,
283,
18207,
14,
17299,
358,
267,
1402,
63,
318,
275,
20713,
10955,
8,
17299,
63,
493,
12,
283,
17024,
358,
398,
1420,
275,
359,
288,
3943,
961,
365,
376,
2599,
13,
10176,
5634,
1402,
859,
2737,
701,
20713,
10955,
3130,
288,
283,
504,
1639,
14,
2828,
14,
5668,
14,
697,
492,
1709,
297,
288,
3260,
288,
283,
533,
14753,
8,
992,
14,
1685,
304,
297,
288,
283,
259,
536,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1257,
3196,
288,
283,
259,
16423,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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for correct wait3() behavior.
"""
import os
import time
import unittest
from test.fork_wait import ForkWait
from test.support import run_unittest, reap_children
if not hasattr(os, 'fork'):
raise unittest.SkipTest("os.fork not defined")
if not hasattr(os, 'wait3'):
raise unittest.SkipTest("os.wait3 not defined")
class Wait3Test(ForkWait):
def wait_impl(self, cpid):
# This many iterations can be required, since some previously run
# tests (e.g. test_ctypes) could have spawned a lot of children
# very quickly.
for i in range(30):
# wait3() shouldn't hang, but some of the buildbots seem to hang
# in the forking tests. This is an attempt to fix the problem.
spid, status, rusage = os.wait3(os.WNOHANG)
if spid == cpid:
break
time.sleep(0.1)
self.assertEqual(spid, cpid)
self.assertEqual(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8))
self.assertTrue(rusage)
def test_main():
run_unittest(Wait3Test)
reap_children()
if __name__ == "__main__":
test_main()
|
lgpl-3.0
|
[
624,
2765,
511,
5920,
367,
3211,
3618,
19,
342,
5953,
14,
199,
624,
199,
199,
646,
747,
199,
646,
900,
199,
646,
2882,
199,
504,
511,
14,
11796,
63,
2573,
492,
2104,
75,
7536,
199,
504,
511,
14,
4058,
492,
1255,
63,
2796,
12,
295,
439,
63,
3223,
199,
199,
692,
440,
2688,
8,
736,
12,
283,
11796,
735,
272,
746,
2882,
14,
25755,
480,
736,
14,
11796,
440,
3247,
531,
199,
199,
692,
440,
2688,
8,
736,
12,
283,
2573,
19,
735,
272,
746,
2882,
14,
25755,
480,
736,
14,
2573,
19,
440,
3247,
531,
199,
199,
533,
13144,
19,
774,
8,
1858,
75,
7536,
304,
272,
347,
3618,
63,
5472,
8,
277,
12,
286,
3150,
304,
267,
327,
961,
5002,
10615,
883,
506,
1415,
12,
3967,
2005,
10889,
1255,
267,
327,
2295,
334,
69,
14,
71,
14,
511,
63,
9798,
9,
4293,
1172,
15187,
379,
282,
13918,
402,
4978,
267,
327,
7437,
23661,
14,
267,
367,
284,
315,
1425,
8,
1216,
304,
288,
327,
3618,
19,
342,
9296,
1133,
30084,
12,
1325,
2005,
402,
314,
21306,
83,
17021,
370,
30084,
288,
327,
315,
314,
14926,
316,
2295,
14,
221,
961,
365,
376,
7427,
370,
5325,
314,
5160,
14,
288,
2249,
344,
12,
2004,
12,
519,
3807,
275,
747,
14,
2573,
19,
8,
736,
14,
55,
2826,
40,
3986,
9,
288,
340,
2249,
344,
508,
286,
3150,
26,
355,
2059,
288,
900,
14,
4532,
8,
16,
14,
17,
9,
398,
291,
14,
629,
8,
681,
344,
12,
286,
3150,
9,
267,
291,
14,
629,
8,
1205,
12,
378,
12,
298,
2651,
275,
450,
68,
12,
4458,
275,
450,
68,
2,
450,
334,
1205,
6,
16,
3581,
12,
2004,
1140,
24,
430,
267,
291,
14,
1815,
8,
82,
3807,
9,
199,
199,
318,
511,
63,
973,
837,
272,
1255,
63,
2796,
8,
7536,
19,
774,
9,
272,
295,
439,
63,
3223,
342,
199,
199,
692,
636,
354,
363,
508,
4396,
973,
5727,
272,
511,
63,
973,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2765,
511,
5920,
367,
3211,
3618,
19,
342,
5953,
14,
199,
624,
199,
199,
646,
747,
199,
646,
900,
199,
646,
2882,
199,
504,
511,
14,
11796,
63,
2573,
492,
2104,
75,
7536,
199,
504,
511,
14,
4058,
492,
1255,
63,
2796,
12,
295,
439,
63,
3223,
199,
199,
692,
440,
2688,
8,
736,
12,
283,
11796,
735,
272,
746,
2882,
14,
25755,
480,
736,
14,
11796,
440,
3247,
531,
199,
199,
692,
440,
2688,
8,
736,
12,
283,
2573,
19,
735,
272,
746,
2882,
14,
25755,
480,
736,
14,
2573,
19,
440,
3247,
531,
199,
199,
533,
13144,
19,
774,
8,
1858,
75,
7536,
304,
272,
347,
3618,
63,
5472,
8,
277,
12,
286,
3150,
304,
267,
327,
961,
5002,
10615,
883,
506,
1415,
12,
3967,
2005,
10889,
1255,
267,
327,
2295,
334,
69,
14,
71,
14,
511,
63,
9798,
9,
4293,
1172,
15187,
379,
282,
13918,
402,
4978,
267,
327,
7437,
23661,
14,
267,
367,
284,
315,
1425,
8,
1216,
304,
288,
327,
3618,
19,
342,
9296,
1133,
30084,
12,
1325,
2005,
402,
314,
21306,
83,
17021,
370,
30084,
288,
327,
315,
314,
14926,
316,
2295,
14,
221,
961,
365,
376,
7427,
370,
5325,
314,
5160,
14,
288,
2249,
344,
12,
2004,
12,
519,
3807,
275,
747,
14,
2573,
19,
8,
736,
14,
55,
2826,
40,
3986,
9,
288,
340,
2249,
344,
508,
286,
3150,
26,
355,
2059,
288,
900,
14,
4532,
8,
16,
14,
17,
9,
398,
291,
14,
629,
8,
681,
344,
12,
286,
3150,
9,
267,
291,
14,
629,
8,
1205,
12,
378,
12,
298,
2651,
275,
450,
68,
12,
4458,
275,
450,
68,
2,
450,
334,
1205,
6,
16,
3581,
12,
2004,
1140,
24,
430,
267,
291,
14,
1815,
8,
82,
3807,
9,
199,
199,
318,
511,
63,
973,
837,
272,
1255,
63,
2796,
8,
7536,
19,
774,
9,
272,
295,
439,
63,
3223,
342,
199,
199,
692,
636,
354,
363,
508,
4396,
973,
5727,
272,
511,
63,
973,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1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/attendance_errors.py
|
377
|
3669
|
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import datetime
import time
from openerp.osv import osv
from openerp.report import report_sxw
class attendance_print(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(attendance_print, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'lst': self._lst,
'total': self._lst_total,
'get_employees':self._get_employees,
})
def _get_employees(self, emp_ids):
emp_obj_list = self.pool.get('hr.employee').browse(self.cr, self.uid, emp_ids)
return emp_obj_list
def _lst(self, employee_id, dt_from, dt_to, max, *args):
self.cr.execute("select name as date, create_date, action, create_date-name as delay from hr_attendance where employee_id=%s and to_char(name,'YYYY-mm-dd')<=%s and to_char(name,'YYYY-mm-dd')>=%s and action IN (%s,%s) order by name", (employee_id, dt_to, dt_from, 'sign_in', 'sign_out'))
res = self.cr.dictfetchall()
for r in res:
if r['action'] == 'sign_out':
r['delay'] = -r['delay']
temp = r['delay'].seconds
r['delay'] = str(r['delay']).split('.')[0]
if abs(temp) < max*60:
r['delay2'] = r['delay']
else:
r['delay2'] = '/'
return res
def _lst_total(self, employee_id, dt_from, dt_to, max, *args):
self.cr.execute("select name as date, create_date, action, create_date-name as delay from hr_attendance where employee_id=%s and to_char(name,'YYYY-mm-dd')<=%s and to_char(name,'YYYY-mm-dd')>=%s and action IN (%s,%s) order by name", (employee_id, dt_to, dt_from, 'sign_in', 'sign_out'))
res = self.cr.dictfetchall()
if not res:
return ('/','/')
total2 = datetime.timedelta(seconds = 0, minutes = 0, hours = 0)
total = datetime.timedelta(seconds = 0, minutes = 0, hours = 0)
for r in res:
if r['action'] == 'sign_out':
r['delay'] = -r['delay']
total += r['delay']
if abs(r['delay'].seconds) < max*60:
total2 += r['delay']
result_dict = {
'total': total and str(total).split('.')[0],
'total2': total2 and str(total2).split('.')[0]
}
return [result_dict]
class report_hr_attendanceerrors(osv.AbstractModel):
_name = 'report.hr_attendance.report_attendanceerrors'
_inherit = 'report.abstract_report'
_template = 'hr_attendance.report_attendanceerrors'
_wrapped_report_class = attendance_print
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
agpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
199,
3,
259,
7653,
12,
3232,
5800,
8259,
9274,
199,
3,
259,
1898,
334,
35,
9,
8353,
13,
6542,
11947,
12361,
8642,
1014,
921,
9864,
14,
1235,
10121,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
4605,
199,
199,
646,
2197,
199,
646,
900,
199,
504,
5166,
14,
4795,
492,
9506,
199,
504,
5166,
14,
3070,
492,
3622,
63,
20851,
421,
199,
533,
737,
7169,
554,
63,
1361,
8,
3070,
63,
20851,
14,
16300,
63,
1122,
304,
339,
347,
636,
826,
721,
277,
12,
2467,
12,
1747,
12,
536,
12,
1067,
304,
267,
1613,
8,
23985,
63,
1361,
12,
291,
2843,
826,
721,
1556,
12,
1747,
12,
536,
12,
1067,
29,
1100,
9,
267,
291,
14,
17886,
14,
873,
2561,
288,
283,
521,
356,
900,
12,
288,
283,
6916,
356,
291,
423,
6916,
12,
288,
283,
2923,
356,
291,
423,
6916,
63,
2923,
12,
288,
283,
362,
63,
24561,
356,
277,
423,
362,
63,
24561,
12,
267,
3828,
339,
347,
485,
362,
63,
24561,
8,
277,
12,
9052,
63,
1580,
304,
267,
9052,
63,
1113,
63,
513,
275,
291,
14,
2293,
14,
362,
360,
6271,
14,
10103,
1959,
4570,
8,
277,
14,
1556,
12,
291,
14,
1535,
12,
9052,
63,
1580,
9,
267,
372,
9052,
63,
1113,
63,
513,
339,
347,
485,
6916,
8,
277,
12,
15778,
63,
344,
12,
4487,
63,
504,
12,
4487,
63,
475,
12,
1390,
12,
627,
589,
304,
267,
291,
14,
1556,
14,
2526,
480,
2416,
536,
465,
1434,
12,
1218,
63,
602,
12,
1595,
12,
1218,
63,
602,
13,
354,
465,
7339,
687,
16140,
63,
23985,
2382,
15778,
63,
344,
2458,
83,
436,
370,
63,
1560,
8,
354,
2584,
15703,
13,
596,
13,
617,
358,
28,
2458,
83,
436,
370,
63,
1560,
8,
354,
2584,
15703,
13,
596,
13,
617,
358,
30,
2458,
83,
436,
1595,
1621,
4366,
83,
8719,
83,
9,
1865,
701,
536,
401,
334,
10103,
63,
344,
12,
4487,
63,
475,
12,
4487,
63,
504,
12,
283,
1037,
63,
262,
297,
283,
1037,
63,
548,
1333,
267,
522,
275,
291,
14,
1556,
14,
807,
10174,
342,
267,
367,
519,
315,
522,
26,
288,
340,
519,
459,
1287,
418,
508,
283,
1037,
63,
548,
356,
355,
519,
459,
5814,
418,
275,
446,
82,
459,
5814,
418,
288,
2388,
275,
519,
459,
5814,
2278,
4515,
953,
519,
459,
5814,
418,
275,
620,
8,
82,
459,
5814,
13227,
1294,
19237,
16,
61,
288,
340,
2853,
8,
808,
9,
665,
1390,
10,
2259,
26,
355,
519,
459,
5814,
18,
418,
275,
519,
459,
5814,
418,
288,
587,
26,
355,
519,
459,
5814,
18,
418,
275,
7324,
267,
372,
522,
339,
347,
485,
6916,
63,
2923,
8,
277,
12,
15778,
63,
344,
12,
4487,
63,
504,
12,
4487,
63,
475,
12,
1390,
12,
627,
589,
304,
267,
291,
14,
1556,
14,
2526,
480,
2416,
536,
465,
1434,
12,
1218,
63,
602,
12,
1595,
12,
1218,
63,
602,
13,
354,
465,
7339,
687,
16140,
63,
23985,
2382,
15778,
63,
344,
2458,
83,
436,
370,
63,
1560,
8,
354,
2584,
15703,
13,
596,
13,
617,
358,
28,
2458,
83,
436,
370,
63,
1560,
8,
354,
2584,
15703,
13,
596,
13,
617,
358,
30,
2458,
83,
436,
1595,
1621,
4366,
83,
8719,
83,
9,
1865,
701,
536,
401,
334,
10103,
63,
344,
12,
4487,
63,
475,
12,
4487,
63,
504,
12,
283,
1037,
63,
262,
297,
283,
1037,
63,
548,
1333,
267,
522,
275,
291,
14,
1556,
14,
807,
10174,
342,
267,
340,
440,
522,
26,
288,
372,
14606,
1673,
6217,
267,
3141,
18,
275,
2197,
14,
7473,
8,
4515,
275,
378,
12,
9395,
275,
378,
12,
10857,
275,
378,
9,
267,
3141,
275,
2197,
14,
7473,
8,
4515,
275,
378,
12,
9395,
275,
378,
12,
10857,
275,
378,
9,
267,
367,
519,
315,
522,
26,
288,
340,
519,
459,
1287,
418,
508,
283,
1037,
63,
548,
356,
355,
519,
459,
5814,
418,
275,
446,
82,
459,
5814,
418,
288,
3141,
847,
519,
459,
5814,
418,
288,
340,
2853,
8,
82,
459,
5814,
2278,
4515,
9,
665,
1390,
10,
2259,
26,
355,
3141,
18,
847,
519,
459,
5814,
418,
398,
754,
63,
807,
275,
469,
355,
283,
2923,
356,
3141,
436,
620,
8,
2923,
680,
1294,
19237,
16,
467,
355,
283,
2923,
18,
356,
3141,
18,
221,
436,
620,
8,
2923,
18,
680,
1294,
19237,
16,
61,
355,
789,
267,
372,
359,
1099,
63,
807,
61,
421,
199,
533,
3622,
63,
6271,
63,
23985,
2550,
8,
4795,
14,
8458,
1685,
304,
272,
485,
354,
275,
283,
3070,
14,
6271,
63,
23985,
14,
3070,
63,
23985,
2550,
7,
272,
485,
6486,
275,
283,
3070,
14,
6198,
63,
3070,
7,
272,
485,
1160,
275,
283,
6271,
63,
23985,
14,
3070,
63,
23985,
2550,
7,
272,
485,
9130,
63,
3070,
63,
533,
275,
737,
7169,
554,
63,
1361,
199,
199,
3,
6695,
26,
10379,
26,
10558,
26,
6492,
29,
20,
26,
10503,
29,
20,
26,
10425,
29,
20,
26,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
4605,
199,
3,
199,
3,
259,
7653,
12,
3232,
5800,
8259,
9274,
199,
3,
259,
1898,
334,
35,
9,
8353,
13,
6542,
11947,
12361,
8642,
1014,
921,
9864,
14,
1235,
10121,
199,
3,
199,
3,
259,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
259,
652,
1334,
314,
2895,
402,
314,
1664,
4265,
1696,
1684,
844,
465,
199,
3,
259,
3267,
701,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
199,
3,
259,
844,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
199,
3,
259,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
259,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
259,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
3,
259,
1664,
4265,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
259,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
4265,
1696,
1684,
844,
199,
3,
259,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
3,
199,
4605,
199,
199,
646,
2197,
199,
646,
900,
199,
504,
5166,
14,
4795,
492,
9506,
199,
504,
5166,
14,
3070,
492,
3622,
63,
20851,
421,
199,
533,
737,
7169,
554,
63,
1361,
8,
3070,
63,
20851,
14,
16300,
63,
1122,
304,
339,
347,
636,
826,
721,
277,
12,
2467,
12,
1747,
12,
536,
12,
1067,
304,
267,
1613,
8,
23985,
63,
1361,
12,
291,
2843,
826,
721,
1556,
12,
1747,
12,
536,
12,
1067,
29,
1100,
9,
267,
291,
14,
17886,
14,
873,
2561,
288,
283,
521,
356,
900,
12,
288,
283,
6916,
356,
291,
423,
6916,
12,
288,
283,
2923,
356,
291,
423,
6916,
63,
2923,
12,
288,
283,
362,
63,
24561,
356,
277,
423,
362,
63,
24561,
12,
267,
3828,
339,
347,
485,
362,
63,
24561,
8,
277,
12,
9052,
63,
1580,
304,
267,
9052,
63,
1113,
63,
513,
275,
291,
14,
2293,
14,
362,
360,
6271,
14,
10103,
1959,
4570,
8,
277,
14,
1556,
12,
291,
14,
1535,
12,
9052,
63,
1580,
9,
267,
372,
9052,
63,
1113,
63,
513,
339,
347,
485,
6916,
8,
277,
12,
15778,
63,
344,
12,
4487,
63,
504,
12,
4487,
63,
475,
12,
1390,
12,
627,
589,
304,
267,
291,
14,
1556,
14,
2526,
480,
2416,
536,
465,
1434,
12,
1218,
63,
602,
12,
1595,
12,
1218,
63,
602,
13,
354,
465,
7339,
687,
16140,
63,
23985,
2382,
15778,
63,
344,
2458,
83,
436,
370,
63,
1560,
8,
354,
2584,
15703,
13,
596,
13,
617,
358,
28,
2458,
83,
436,
370,
63,
1560,
8,
354,
2584,
15703,
13,
596,
13,
617,
358,
30,
2458,
83,
436,
1595,
1621,
4366,
83,
8719,
83,
9,
1865,
701,
536,
401,
334,
10103,
63,
344,
12,
4487,
63,
475,
12,
4487,
63,
504,
12,
283,
1037,
63,
262,
297,
283,
1037,
63,
548,
1333,
267,
522,
275,
291,
14,
1556,
14,
807,
10174,
342,
267,
367,
519,
315,
522,
26,
288,
340,
519,
459,
1287,
418,
508,
283,
1037,
63,
548,
356,
355,
519,
459,
5814,
418,
275,
446,
82,
459,
5814,
418,
288,
2388,
275,
519,
459,
5814,
2278,
4515,
953,
519,
459,
5814,
418,
275,
620,
8,
82,
459,
5814,
13227,
1294,
19237,
16,
61,
288,
340,
2853,
8,
808,
9,
665,
1390,
10,
2259,
26,
355,
519,
459,
5814,
18,
418,
275,
519,
459,
5814,
418,
288,
587,
26,
355,
519,
459,
5814,
18,
418,
275,
7324,
267,
372,
522,
339,
347,
485,
6916,
63,
2923,
8,
277,
12,
15778,
63,
344,
12,
4487,
63,
504,
12,
4487,
63,
475,
12,
1390,
12,
627,
589,
304,
267,
291,
14,
1556,
14,
2526,
480,
2416,
536,
465,
1434,
12,
1218,
63,
602,
12,
1595,
12,
1218,
63,
602,
13,
354,
465,
7339,
687,
16140,
63,
23985,
2382,
15778,
63,
344,
2458,
83,
436,
370,
63,
1560,
8,
354,
2584,
15703,
13,
596,
13,
617,
358,
28,
2458,
83,
436,
370,
63,
1560,
8,
354,
2584,
15703,
13,
596,
13,
617,
358,
30,
2458,
83,
436,
1595,
1621,
4366,
83,
8719,
83,
9,
1865,
701,
536,
401,
334,
10103,
63,
344,
12,
4487,
63,
475,
12,
4487,
63,
504,
12,
283,
1037,
63,
262,
297,
283,
1037,
63,
548,
1333,
267,
522,
275,
291,
14,
1556,
14,
807,
10174,
342,
267,
340,
440,
522,
26,
288,
372,
14606,
1673,
6217,
267,
3141,
18,
275,
2197,
14,
7473,
8,
4515,
275,
378,
12,
9395,
275,
378,
12,
10857,
275,
378,
9,
267,
3141,
275,
2197,
14,
7473,
8,
4515,
275,
378,
12,
9395,
275,
378,
12,
10857,
275,
378,
9,
267,
367,
519,
315,
522,
26,
288,
340,
519,
459,
1287,
418,
508,
283,
1037,
63,
548,
356,
355,
519,
459,
5814,
418,
275,
446,
82,
459,
5814,
418,
288,
3141,
847,
519,
459,
5814,
418,
288,
340,
2853,
8,
82,
459,
5814,
2278,
4515,
9,
665,
1390,
10,
2259,
26,
355,
3141,
18,
847,
519,
459,
5814,
418,
398,
754,
63,
807,
275,
469,
355,
283,
2923,
356,
3141,
436,
620,
8,
2923,
680,
1294,
19237,
16,
467,
355,
283,
2923,
18,
356,
3141,
18,
221,
436,
620,
8,
2923,
18,
680,
1294,
19237,
16,
61,
355,
789,
267,
372,
359,
1099,
63,
807,
61,
421,
199,
533,
3622,
63,
6271,
63,
23985,
2550,
8,
4795,
14,
8458,
1685,
304,
272,
485,
354,
275,
283,
3070,
14,
6271,
63,
23985,
14,
3070,
63,
23985,
2550,
7,
272,
485,
6486,
275,
283,
3070,
14,
6198,
63,
3070,
7,
272,
485,
1160,
275,
283,
6271,
63,
23985,
14,
3070,
63,
23985,
2550,
7,
272,
485,
9130,
63,
3070,
63,
533,
275,
737,
7169,
554,
63,
1361,
199,
199,
3,
6695,
26,
10379,
26,
10558,
26,
6492,
29,
20,
26,
10503,
29,
20,
26,
10425,
29,
20,
26,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
CartoDB/mapnik
|
scons/scons-local-3.0.1/SCons/Tool/g++.py
|
5
|
1631
|
"""SCons.Tool.g++
Tool-specific initialization for g++.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Tool/g++.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
#forward proxy to the preffered cxx version
from SCons.Tool.gxx import *
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
|
lgpl-2.1
|
[
624,
18521,
14,
5157,
14,
71,
4176,
199,
199,
5157,
13,
6100,
11097,
367,
486,
4176,
14,
199,
199,
10924,
12252,
9296,
1133,
506,
1263,
1929,
370,
492,
642,
859,
5370,
14,
199,
7940,
911,
9987,
506,
8439,
4012,
314,
7809,
8218,
14,
5157,
14,
5157,
342,
199,
5592,
1083,
14,
199,
199,
624,
199,
199,
3,
199,
3,
1898,
334,
67,
9,
12521,
446,
9708,
710,
8218,
2752,
199,
3,
199,
3,
8779,
365,
11882,
10009,
12,
2867,
402,
11204,
12,
370,
1263,
4954,
12408,
199,
3,
282,
1331,
402,
642,
2032,
436,
4568,
3794,
1584,
334,
1589,
199,
3,
298,
10337,
1288,
370,
7962,
315,
314,
2290,
1928,
10588,
12,
5893,
199,
3,
1928,
12305,
314,
4481,
370,
675,
12,
1331,
12,
2811,
12,
5389,
12,
2780,
12,
199,
3,
11207,
12,
13473,
12,
436,
15,
269,
12743,
6866,
402,
314,
2290,
12,
436,
370,
199,
3,
11291,
12103,
370,
12676,
314,
2290,
365,
13985,
370,
886,
880,
12,
5420,
370,
199,
3,
314,
2569,
3704,
26,
199,
3,
199,
3,
710,
3432,
4248,
4245,
436,
642,
4983,
4245,
10989,
506,
5120,
199,
3,
315,
1006,
6866,
503,
13393,
12468,
402,
314,
2290,
14,
199,
3,
199,
3,
2334,
4141,
2281,
7049,
298,
1179,
2281,
401,
2428,
3408,
1634,
1821,
199,
3,
3826,
12,
7168,
1549,
5292,
12,
6931,
5400,
2845,
5471,
2296,
2334,
199,
3,
2990,
1634,
3169,
12,
3092,
2381,
437,
3115,
3104,
2401,
199,
3,
13229,
14,
1621,
4825,
6461,
7000,
2334,
10610,
1549,
5877,
8164,
6262,
199,
3,
7024,
2381,
1821,
13140,
12,
6736,
1549,
5010,
5603,
12,
7061,
1621,
1261,
9612,
199,
3,
1634,
7066,
12,
7056,
1549,
7334,
12,
7043,
4442,
12,
5738,
1634,
1549,
1621,
11287,
199,
3,
1663,
2334,
4141,
1549,
2334,
4815,
1549,
5010,
13198,
1621,
2334,
4141,
14,
199,
3,
199,
199,
363,
5792,
363,
275,
298,
2164,
15,
3908,
15,
18521,
15,
5157,
15,
71,
4176,
14,
647,
9720,
66,
18,
67,
2481,
3776,
23814,
2710,
69,
25,
845,
66,
8425,
65,
22,
66,
1602,
70,
11775,
983,
20983,
65,
16654,
9708,
15,
845,
15,
1079,
4944,
26,
975,
26,
2481,
330,
697,
525,
974,
2,
421,
199,
3,
6688,
4566,
370,
314,
876,
9224,
17327,
1015,
199,
504,
8218,
14,
5157,
14,
71,
2154,
492,
627,
421,
199,
3,
10111,
17198,
26,
199,
3,
5174,
13,
2063,
26,
20,
199,
3,
4363,
13,
8741,
13,
632,
26,
20613,
199,
3,
9599,
26,
199,
3,
6695,
26,
663,
26414,
20849,
29,
20,
20105,
29,
20,
26,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
18521,
14,
5157,
14,
71,
4176,
199,
199,
5157,
13,
6100,
11097,
367,
486,
4176,
14,
199,
199,
10924,
12252,
9296,
1133,
506,
1263,
1929,
370,
492,
642,
859,
5370,
14,
199,
7940,
911,
9987,
506,
8439,
4012,
314,
7809,
8218,
14,
5157,
14,
5157,
342,
199,
5592,
1083,
14,
199,
199,
624,
199,
199,
3,
199,
3,
1898,
334,
67,
9,
12521,
446,
9708,
710,
8218,
2752,
199,
3,
199,
3,
8779,
365,
11882,
10009,
12,
2867,
402,
11204,
12,
370,
1263,
4954,
12408,
199,
3,
282,
1331,
402,
642,
2032,
436,
4568,
3794,
1584,
334,
1589,
199,
3,
298,
10337,
1288,
370,
7962,
315,
314,
2290,
1928,
10588,
12,
5893,
199,
3,
1928,
12305,
314,
4481,
370,
675,
12,
1331,
12,
2811,
12,
5389,
12,
2780,
12,
199,
3,
11207,
12,
13473,
12,
436,
15,
269,
12743,
6866,
402,
314,
2290,
12,
436,
370,
199,
3,
11291,
12103,
370,
12676,
314,
2290,
365,
13985,
370,
886,
880,
12,
5420,
370,
199,
3,
314,
2569,
3704,
26,
199,
3,
199,
3,
710,
3432,
4248,
4245,
436,
642,
4983,
4245,
10989,
506,
5120,
199,
3,
315,
1006,
6866,
503,
13393,
12468,
402,
314,
2290,
14,
199,
3,
199,
3,
2334,
4141,
2281,
7049,
298,
1179,
2281,
401,
2428,
3408,
1634,
1821,
199,
3,
3826,
12,
7168,
1549,
5292,
12,
6931,
5400,
2845,
5471,
2296,
2334,
199,
3,
2990,
1634,
3169,
12,
3092,
2381,
437,
3115,
3104,
2401,
199,
3,
13229,
14,
1621,
4825,
6461,
7000,
2334,
10610,
1549,
5877,
8164,
6262,
199,
3,
7024,
2381,
1821,
13140,
12,
6736,
1549,
5010,
5603,
12,
7061,
1621,
1261,
9612,
199,
3,
1634,
7066,
12,
7056,
1549,
7334,
12,
7043,
4442,
12,
5738,
1634,
1549,
1621,
11287,
199,
3,
1663,
2334,
4141,
1549,
2334,
4815,
1549,
5010,
13198,
1621,
2334,
4141,
14,
199,
3,
199,
199,
363,
5792,
363,
275,
298,
2164,
15,
3908,
15,
18521,
15,
5157,
15,
71,
4176,
14,
647,
9720,
66,
18,
67,
2481,
3776,
23814,
2710,
69,
25,
845,
66,
8425,
65,
22,
66,
1602,
70,
11775,
983,
20983,
65,
16654,
9708,
15,
845,
15,
1079,
4944,
26,
975,
26,
2481,
330,
697,
525,
974,
2,
421,
199,
3,
6688,
4566,
370,
314,
876,
9224,
17327,
1015,
199,
504,
8218,
14,
5157,
14,
71,
2154,
492,
627,
421,
199,
3,
10111,
17198,
26,
199,
3,
5174,
13,
2063,
26,
20,
199,
3,
4363,
13,
8741,
13,
632,
26,
20613,
199,
3,
9599,
26,
199,
3,
6695,
26,
663,
26414,
20849,
29,
20,
20105,
29,
20,
26,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
anryko/ansible
|
lib/ansible/modules/network/onyx/onyx_lldp.py
|
118
|
3101
|
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = """
---
module: onyx_lldp
version_added: "2.5"
author: "Samer Deeb (@samerd)"
short_description: Manage LLDP configuration on Mellanox ONYX network devices
description:
- This module provides declarative management of LLDP service configuration
on Mellanox ONYX network devices.
options:
state:
description:
- State of the LLDP protocol configuration.
default: present
choices: ['present', 'absent']
"""
EXAMPLES = """
- name: Enable LLDP protocol
onyx_lldp:
state: present
- name: Disable LLDP protocol
onyx_lldp:
state: lldp
"""
RETURN = """
commands:
description: The list of configuration mode commands to send to the device
returned: always.
type: list
sample:
- lldp
"""
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.network.onyx.onyx import BaseOnyxModule
from ansible.module_utils.network.onyx.onyx import show_cmd
class OnyxLldpModule(BaseOnyxModule):
LLDP_ENTRY = 'LLDP'
SHOW_LLDP_CMD = 'show lldp local'
@classmethod
def _get_element_spec(cls):
return dict(
state=dict(default='present', choices=['present', 'absent']),
)
def init_module(self):
""" module initialization
"""
element_spec = self._get_element_spec()
argument_spec = dict()
argument_spec.update(element_spec)
self._module = AnsibleModule(
argument_spec=argument_spec,
supports_check_mode=True)
def get_required_config(self):
self._required_config = dict()
module_params = self._module.params
params = {
'state': module_params['state'],
}
self.validate_param_values(params)
self._required_config.update(params)
def _get_lldp_config(self):
return show_cmd(self._module, self.SHOW_LLDP_CMD)
def load_current_config(self):
self._current_config = dict()
state = 'absent'
config = self._get_lldp_config() or dict()
for item in config:
lldp_state = item.get(self.LLDP_ENTRY)
if lldp_state is not None:
if lldp_state == 'enabled':
state = 'present'
break
self._current_config['state'] = state
def generate_commands(self):
req_state = self._required_config['state']
curr_state = self._current_config['state']
if curr_state != req_state:
cmd = 'lldp'
if req_state == 'absent':
cmd = 'no %s' % cmd
self._commands.append(cmd)
def main():
""" main entry point for module execution
"""
OnyxLldpModule.main()
if __name__ == '__main__':
main()
|
gpl-3.0
|
[
3381,
2647,
15,
1393,
15,
1548,
199,
199,
3,
1898,
26,
2622,
7290,
199,
3,
1664,
1696,
1684,
844,
373,
19,
14,
16,
11,
334,
3239,
9685,
503,
4178,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
15,
11692,
13,
19,
14,
16,
14,
2424,
9,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
12,
4629,
12,
870,
63,
1593,
199,
363,
6577,
363,
275,
730,
199,
199,
8490,
63,
8314,
275,
791,
2343,
63,
1023,
356,
283,
17,
14,
17,
297,
490,
283,
1205,
356,
788,
7780,
995,
490,
283,
4946,
63,
991,
356,
283,
9387,
936,
199,
199,
8948,
275,
408,
199,
2595,
199,
578,
26,
641,
20937,
63,
24319,
199,
1023,
63,
3270,
26,
298,
18,
14,
21,
2,
199,
2502,
26,
298,
8479,
82,
577,
1024,
66,
8593,
7191,
6883,
2924,
199,
3612,
63,
1802,
26,
14944,
491,
29187,
2897,
641,
603,
352,
1502,
19131,
5258,
16936,
2784,
7256,
199,
1802,
26,
523,
446,
961,
859,
6571,
30191,
10041,
402,
491,
29187,
2435,
2897,
272,
641,
603,
352,
1502,
19131,
5258,
16936,
2784,
7256,
14,
199,
1419,
26,
523,
1174,
26,
272,
1369,
26,
489,
446,
8511,
402,
314,
491,
29187,
4113,
2897,
14,
272,
849,
26,
3451,
272,
3415,
26,
788,
1881,
297,
283,
5575,
418,
199,
624,
199,
199,
8918,
275,
408,
199,
13,
536,
26,
12030,
491,
29187,
4113,
523,
641,
20937,
63,
24319,
26,
272,
1174,
26,
3451,
199,
199,
13,
536,
26,
17534,
491,
29187,
4113,
523,
641,
20937,
63,
24319,
26,
272,
1174,
26,
28768,
199,
624,
199,
199,
9677,
275,
408,
199,
4405,
26,
523,
1369,
26,
710,
769,
402,
2897,
818,
3718,
370,
3222,
370,
314,
2243,
523,
2138,
26,
3544,
14,
523,
730,
26,
769,
523,
2690,
26,
272,
446,
28768,
199,
624,
199,
199,
504,
3242,
14,
578,
63,
1208,
14,
4316,
492,
6953,
199,
199,
504,
3242,
14,
578,
63,
1208,
14,
1200,
14,
5220,
88,
14,
5220,
88,
492,
3523,
3314,
20937,
2377,
199,
504,
3242,
14,
578,
63,
1208,
14,
1200,
14,
5220,
88,
14,
5220,
88,
492,
2498,
63,
1760,
421,
199,
533,
4068,
20937,
44,
17288,
2377,
8,
1563,
3314,
20937,
2377,
304,
272,
491,
29187,
63,
7285,
275,
283,
4464,
11741,
7,
272,
428,
16210,
63,
4464,
11741,
63,
9744,
275,
283,
2384,
28768,
2257,
7,
339,
768,
3744,
272,
347,
485,
362,
63,
2108,
63,
1650,
8,
1886,
304,
267,
372,
1211,
8,
288,
1174,
29,
807,
8,
885,
534,
1881,
297,
3415,
2968,
1881,
297,
283,
5575,
3815,
267,
776,
339,
347,
4205,
63,
578,
8,
277,
304,
267,
408,
859,
11097,
267,
408,
267,
1819,
63,
1650,
275,
291,
423,
362,
63,
2108,
63,
1650,
342,
267,
1423,
63,
1650,
275,
1211,
342,
267,
1423,
63,
1650,
14,
873,
8,
2108,
63,
1650,
9,
267,
291,
423,
578,
275,
6953,
8,
288,
1423,
63,
1650,
29,
2094,
63,
1650,
12,
288,
5171,
63,
1074,
63,
632,
29,
549,
9,
339,
347,
664,
63,
2427,
63,
888,
8,
277,
304,
267,
291,
423,
2427,
63,
888,
275,
1211,
342,
267,
859,
63,
1162,
275,
291,
423,
578,
14,
1162,
267,
1862,
275,
469,
288,
283,
929,
356,
859,
63,
1162,
459,
929,
995,
267,
789,
398,
291,
14,
3502,
63,
635,
63,
1459,
8,
1162,
9,
267,
291,
423,
2427,
63,
888,
14,
873,
8,
1162,
9,
339,
347,
485,
362,
63,
24319,
63,
888,
8,
277,
304,
267,
372,
2498,
63,
1760,
8,
277,
423,
578,
12,
291,
14,
19085,
63,
4464,
11741,
63,
9744,
9,
339,
347,
2248,
63,
1818,
63,
888,
8,
277,
304,
267,
291,
423,
1818,
63,
888,
275,
1211,
342,
267,
1174,
275,
283,
5575,
7,
267,
1101,
275,
291,
423,
362,
63,
24319,
63,
888,
342,
503,
1211,
342,
267,
367,
1242,
315,
1101,
26,
288,
28768,
63,
929,
275,
1242,
14,
362,
8,
277,
14,
4464,
11741,
63,
7285,
9,
288,
340,
28768,
63,
929,
365,
440,
488,
26,
355,
340,
28768,
63,
929,
508,
283,
3827,
356,
490,
1174,
275,
283,
1881,
7,
355,
2059,
267,
291,
423,
1818,
63,
888,
459,
929,
418,
275,
1174,
339,
347,
3550,
63,
4405,
8,
277,
304,
267,
2648,
63,
929,
275,
291,
423,
2427,
63,
888,
459,
929,
418,
267,
8230,
63,
929,
275,
291,
423,
1818,
63,
888,
459,
929,
418,
267,
340,
8230,
63,
929,
1137,
2648,
63,
929,
26,
288,
2088,
275,
283,
24319,
7,
288,
340,
2648,
63,
929,
508,
283,
5575,
356,
355,
2088,
275,
283,
889,
450,
83,
7,
450,
2088,
288,
291,
423,
4405,
14,
740,
8,
1760,
9,
421,
199,
318,
2446,
837,
272,
408,
2446,
2397,
2376,
367,
859,
6451,
272,
408,
272,
4068,
20937,
44,
17288,
2377,
14,
973,
342,
421,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
2446,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2647,
15,
1393,
15,
1548,
199,
199,
3,
1898,
26,
2622,
7290,
199,
3,
1664,
1696,
1684,
844,
373,
19,
14,
16,
11,
334,
3239,
9685,
503,
4178,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
15,
11692,
13,
19,
14,
16,
14,
2424,
9,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
12,
4629,
12,
870,
63,
1593,
199,
363,
6577,
363,
275,
730,
199,
199,
8490,
63,
8314,
275,
791,
2343,
63,
1023,
356,
283,
17,
14,
17,
297,
490,
283,
1205,
356,
788,
7780,
995,
490,
283,
4946,
63,
991,
356,
283,
9387,
936,
199,
199,
8948,
275,
408,
199,
2595,
199,
578,
26,
641,
20937,
63,
24319,
199,
1023,
63,
3270,
26,
298,
18,
14,
21,
2,
199,
2502,
26,
298,
8479,
82,
577,
1024,
66,
8593,
7191,
6883,
2924,
199,
3612,
63,
1802,
26,
14944,
491,
29187,
2897,
641,
603,
352,
1502,
19131,
5258,
16936,
2784,
7256,
199,
1802,
26,
523,
446,
961,
859,
6571,
30191,
10041,
402,
491,
29187,
2435,
2897,
272,
641,
603,
352,
1502,
19131,
5258,
16936,
2784,
7256,
14,
199,
1419,
26,
523,
1174,
26,
272,
1369,
26,
489,
446,
8511,
402,
314,
491,
29187,
4113,
2897,
14,
272,
849,
26,
3451,
272,
3415,
26,
788,
1881,
297,
283,
5575,
418,
199,
624,
199,
199,
8918,
275,
408,
199,
13,
536,
26,
12030,
491,
29187,
4113,
523,
641,
20937,
63,
24319,
26,
272,
1174,
26,
3451,
199,
199,
13,
536,
26,
17534,
491,
29187,
4113,
523,
641,
20937,
63,
24319,
26,
272,
1174,
26,
28768,
199,
624,
199,
199,
9677,
275,
408,
199,
4405,
26,
523,
1369,
26,
710,
769,
402,
2897,
818,
3718,
370,
3222,
370,
314,
2243,
523,
2138,
26,
3544,
14,
523,
730,
26,
769,
523,
2690,
26,
272,
446,
28768,
199,
624,
199,
199,
504,
3242,
14,
578,
63,
1208,
14,
4316,
492,
6953,
199,
199,
504,
3242,
14,
578,
63,
1208,
14,
1200,
14,
5220,
88,
14,
5220,
88,
492,
3523,
3314,
20937,
2377,
199,
504,
3242,
14,
578,
63,
1208,
14,
1200,
14,
5220,
88,
14,
5220,
88,
492,
2498,
63,
1760,
421,
199,
533,
4068,
20937,
44,
17288,
2377,
8,
1563,
3314,
20937,
2377,
304,
272,
491,
29187,
63,
7285,
275,
283,
4464,
11741,
7,
272,
428,
16210,
63,
4464,
11741,
63,
9744,
275,
283,
2384,
28768,
2257,
7,
339,
768,
3744,
272,
347,
485,
362,
63,
2108,
63,
1650,
8,
1886,
304,
267,
372,
1211,
8,
288,
1174,
29,
807,
8,
885,
534,
1881,
297,
3415,
2968,
1881,
297,
283,
5575,
3815,
267,
776,
339,
347,
4205,
63,
578,
8,
277,
304,
267,
408,
859,
11097,
267,
408,
267,
1819,
63,
1650,
275,
291,
423,
362,
63,
2108,
63,
1650,
342,
267,
1423,
63,
1650,
275,
1211,
342,
267,
1423,
63,
1650,
14,
873,
8,
2108,
63,
1650,
9,
267,
291,
423,
578,
275,
6953,
8,
288,
1423,
63,
1650,
29,
2094,
63,
1650,
12,
288,
5171,
63,
1074,
63,
632,
29,
549,
9,
339,
347,
664,
63,
2427,
63,
888,
8,
277,
304,
267,
291,
423,
2427,
63,
888,
275,
1211,
342,
267,
859,
63,
1162,
275,
291,
423,
578,
14,
1162,
267,
1862,
275,
469,
288,
283,
929,
356,
859,
63,
1162,
459,
929,
995,
267,
789,
398,
291,
14,
3502,
63,
635,
63,
1459,
8,
1162,
9,
267,
291,
423,
2427,
63,
888,
14,
873,
8,
1162,
9,
339,
347,
485,
362,
63,
24319,
63,
888,
8,
277,
304,
267,
372,
2498,
63,
1760,
8,
277,
423,
578,
12,
291,
14,
19085,
63,
4464,
11741,
63,
9744,
9,
339,
347,
2248,
63,
1818,
63,
888,
8,
277,
304,
267,
291,
423,
1818,
63,
888,
275,
1211,
342,
267,
1174,
275,
283,
5575,
7,
267,
1101,
275,
291,
423,
362,
63,
24319,
63,
888,
342,
503,
1211,
342,
267,
367,
1242,
315,
1101,
26,
288,
28768,
63,
929,
275,
1242,
14,
362,
8,
277,
14,
4464,
11741,
63,
7285,
9,
288,
340,
28768,
63,
929,
365,
440,
488,
26,
355,
340,
28768,
63,
929,
508,
283,
3827,
356,
490,
1174,
275,
283,
1881,
7,
355,
2059,
267,
291,
423,
1818,
63,
888,
459,
929,
418,
275,
1174,
339,
347,
3550,
63,
4405,
8,
277,
304,
267,
2648,
63,
929,
275,
291,
423,
2427,
63,
888,
459,
929,
418,
267,
8230,
63,
929,
275,
291,
423,
1818,
63,
888,
459,
929,
418,
267,
340,
8230,
63,
929,
1137,
2648,
63,
929,
26,
288,
2088,
275,
283,
24319,
7,
288,
340,
2648,
63,
929,
508,
283,
5575,
356,
355,
2088,
275,
283,
889,
450,
83,
7,
450,
2088,
288,
291,
423,
4405,
14,
740,
8,
1760,
9,
421,
199,
318,
2446,
837,
272,
408,
2446,
2397,
2376,
367,
859,
6451,
272,
408,
272,
4068,
20937,
44,
17288,
2377,
14,
973,
342,
421,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
2446,
342,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
SEL-Columbia/commcare-hq
|
custom/_legacy/pact/lib/quicksect.py
|
3
|
6312
|
"""
Interval tree library data structure.
Given a set of data that represents data that spans some time interval, create an object in memory
that given a query with a datetime timestamp, return the relevant data back whose time interval matches that.
Intersects ... faster. Suports GenomicInterval datatype and multiple chromosomes.
source:
http://bitbucket.org/james_taylor/bx-python/src/14b6a6c95da6/lib/bx/intervals/operations/quicksect.py
"""
import math
import time
import sys
import random
class IntervalTree( object ):
def __init__( self ):
self.chroms = {}
def insert( self, interval, linenum=0, other=None ):
chrom = interval.chrom
start = interval.start
end = interval.end
if interval.chrom in self.chroms:
self.chroms[chrom] = self.chroms[chrom].insert( start, end, linenum, other )
else:
self.chroms[chrom] = IntervalNode( start, end, linenum, other )
def intersect( self, interval, report_func ):
chrom = interval.chrom
start = interval.start
end = interval.end
if chrom in self.chroms:
self.chroms[chrom].intersect( start, end, report_func )
def traverse( self, func ):
for item in self.chroms.itervalues():
item.traverse( func )
class IntervalNode( object ):
def __init__( self, start, end, linenum=0, other=None ):
# Python lacks the binomial distribution, so we convert a
# uniform into a binomial because it naturally scales with
# tree size. Also, python's uniform is perfect since the
# upper limit is not inclusive, which gives us undefined here.
#self.priority = math.ceil( (-1.0 / math.log(.5)) * math.log( -1.0 / (random.uniform(0,1) - 1)))
self.priority=1
self.start = start
self.end = end
self.maxend = self.end
self.minend = self.end
self.left = None
self.right = None
self.linenum = linenum
self.other = other
def insert( self, start, end, linenum=0, other=None ):
root = self
if start > self.start:
# insert to right tree
if self.right:
self.right = self.right.insert( start, end, linenum, other )
else:
self.right = IntervalNode(start, end, linenum, other )
# rebalance tree
if self.priority < self.right.priority:
root = self.rotateleft()
else:
# insert to left tree
if self.left:
self.left = self.left.insert( start, end, linenum, other )
else:
self.left = IntervalNode(start, end, linenum, other )
# rebalance tree
if self.priority < self.left.priority:
root = self.rotateright()
if root.right and root.left:
root.maxend = max( root.end, root.right.maxend, root.left.maxend )
root.minend = min( root.end, root.right.minend, root.left.minend )
elif root.right:
root.maxend = max( root.end, root.right.maxend )
root.minend = min( root.end, root.right.minend )
elif root.left:
root.maxend = max( root.end, root.left.maxend )
root.minend = min( root.end, root.left.minend )
return root
def rotateright( self ):
print "rotate right"
root = self.left
self.left = self.left.right
root.right = self
if self.right and self.left:
self.maxend = max(self.end, self.right.maxend, self.left.maxend)
self.minend = min(self.end, self.right.minend, self.left.minend )
elif self.right:
self.maxend = max(self.end, self.right.maxend)
self.minend = min(self.end, self.right.minend)
elif self.left:
self.maxend = max(self.end, self.left.maxend)
self.minend = min(self.end, self.left.minend )
return root
def rotateleft( self ):
print "rotate left"
root = self.right
self.right = self.right.left
root.left = self
if self.right and self.left:
self.maxend = max(self.end, self.right.maxend, self.left.maxend)
self.minend = min(self.end, self.right.minend, self.left.minend )
elif self.right:
self.maxend = max(self.end, self.right.maxend)
self.minend = min(self.end, self.right.minend)
elif self.left:
self.maxend = max(self.end, self.left.maxend)
self.minend = min(self.end, self.left.minend )
return root
def intersect( self, start, end, report_func ):
if start < self.end and end > self.start: report_func( self )
if self.left and start < self.left.maxend:
self.left.intersect( start, end, report_func )
if self.right and end > self.start:
self.right.intersect( start, end, report_func )
def traverse( self, func ):
if self.left: self.left.traverse( func )
func( self )
if self.right: self.right.traverse( func )
def main():
test = None
intlist = []
for x in range(20000):
start = random.randint(0,1000000)
end = start + random.randint(1, 1000)
if test: test = test.insert( start, end )
else: test = IntervalNode( start, end )
intlist.append( (start, end) )
starttime = time.clock()
for x in range(5000):
start = random.randint(0, 10000000)
end = start + random.randint(1, 1000)
result = []
test.intersect( start, end, lambda x: result.append(x.linenum) )
print "%f for tree method" % (time.clock() - starttime)
starttime = time.clock()
for x in range(5000):
start = random.randint(0, 10000000)
end = start + random.randint(1, 1000)
bad_sect( intlist, start, end)
print "%f for linear (bad) method" % (time.clock() - starttime)
def test_func( node ):
print "[%d, %d), %d" % (node.start, node.end, node.maxend)
def bad_sect( lst, int_start, int_end ):
intersection = []
for start, end in lst:
if int_start < end and int_end > start:
intersection.append( (start, end) )
return intersection
if __name__ == "__main__":
main()
|
bsd-3-clause
|
[
624,
199,
199,
8227,
3123,
3555,
666,
5523,
14,
199,
199,
13735,
282,
663,
402,
666,
626,
8469,
666,
626,
2249,
796,
2005,
900,
6252,
12,
1218,
376,
909,
315,
4402,
199,
9099,
1627,
282,
1827,
543,
282,
2197,
4913,
12,
372,
314,
12082,
666,
1771,
7447,
900,
6252,
4450,
626,
14,
199,
199,
2620,
25353,
2263,
12930,
14,
221,
6820,
361,
83,
18870,
676,
530,
8227,
16048,
436,
3663,
20074,
26803,
83,
14,
199,
199,
1365,
26,
199,
1014,
921,
25668,
14,
1308,
15,
74,
14015,
63,
502,
89,
25339,
15,
13691,
13,
1548,
15,
2164,
15,
1079,
66,
22,
65,
22,
67,
2720,
983,
22,
15,
773,
15,
13691,
15,
18574,
15,
8170,
15,
13239,
8519,
14,
647,
199,
624,
199,
646,
3473,
199,
646,
900,
199,
646,
984,
199,
646,
2196,
199,
199,
533,
18766,
3987,
8,
909,
3461,
272,
347,
636,
826,
721,
291,
3461,
267,
291,
14,
23473,
83,
275,
1052,
272,
347,
5518,
8,
291,
12,
6252,
12,
13434,
29,
16,
12,
1163,
29,
403,
3461,
267,
20074,
275,
6252,
14,
23473,
267,
1343,
275,
6252,
14,
928,
267,
1284,
275,
6252,
14,
500,
267,
340,
6252,
14,
23473,
315,
291,
14,
23473,
83,
26,
288,
291,
14,
23473,
83,
59,
23473,
61,
275,
291,
14,
23473,
83,
59,
23473,
1055,
3176,
8,
1343,
12,
1284,
12,
13434,
12,
1163,
776,
267,
587,
26,
288,
291,
14,
23473,
83,
59,
23473,
61,
275,
18766,
1716,
8,
1343,
12,
1284,
12,
13434,
12,
1163,
776,
272,
347,
26066,
8,
291,
12,
6252,
12,
3622,
63,
1532,
3461,
267,
20074,
275,
6252,
14,
23473,
267,
1343,
275,
6252,
14,
928,
267,
1284,
275,
6252,
14,
500,
267,
340,
20074,
315,
291,
14,
23473,
83,
26,
288,
291,
14,
23473,
83,
59,
23473,
1055,
23149,
8,
1343,
12,
1284,
12,
3622,
63,
1532,
776,
272,
347,
24749,
8,
291,
12,
2562,
3461,
267,
367,
1242,
315,
291,
14,
23473,
83,
14,
13012,
837,
288,
1242,
14,
23650,
8,
2562,
776,
199,
199,
533,
18766,
1716,
8,
909,
3461,
272,
347,
636,
826,
721,
291,
12,
1343,
12,
1284,
12,
13434,
29,
16,
12,
1163,
29,
403,
3461,
267,
327,
2018,
1127,
5618,
314,
2517,
6471,
4084,
12,
880,
781,
3957,
282,
267,
327,
14818,
1901,
282,
2517,
6471,
2952,
652,
13872,
300,
1183,
29823,
543,
267,
327,
3123,
1568,
14,
221,
6121,
12,
2366,
1159,
14818,
365,
23668,
3967,
314,
267,
327,
7008,
2304,
365,
440,
20728,
12,
1314,
10557,
2739,
10942,
2348,
14,
267,
327,
277,
14,
6693,
275,
3473,
14,
14085,
8,
5868,
17,
14,
16,
1182,
3473,
14,
793,
13417,
21,
430,
627,
3473,
14,
793,
8,
446,
17,
14,
16,
1182,
334,
2355,
14,
8830,
8,
16,
12,
17,
9,
446,
413,
1724,
267,
291,
14,
6693,
29,
17,
267,
291,
14,
928,
275,
1343,
267,
291,
14,
500,
275,
1284,
267,
291,
14,
988,
500,
275,
291,
14,
500,
267,
291,
14,
827,
500,
275,
291,
14,
500,
267,
291,
14,
3039,
275,
488,
267,
291,
14,
1019,
275,
488,
267,
291,
14,
19466,
275,
13434,
267,
291,
14,
1848,
275,
1163,
272,
347,
5518,
8,
291,
12,
1343,
12,
1284,
12,
13434,
29,
16,
12,
1163,
29,
403,
3461,
267,
1738,
275,
291,
267,
340,
1343,
690,
291,
14,
928,
26,
288,
327,
5518,
370,
2451,
3123,
288,
340,
291,
14,
1019,
26,
355,
291,
14,
1019,
275,
291,
14,
1019,
14,
3176,
8,
1343,
12,
1284,
12,
13434,
12,
1163,
776,
288,
587,
26,
355,
291,
14,
1019,
275,
18766,
1716,
8,
928,
12,
1284,
12,
13434,
12,
1163,
776,
288,
327,
295,
7358,
3123,
288,
340,
291,
14,
6693,
665,
291,
14,
1019,
14,
6693,
26,
355,
1738,
275,
291,
14,
12873,
3039,
342,
267,
587,
26,
288,
327,
5518,
370,
3602,
3123,
288,
340,
291,
14,
3039,
26,
355,
291,
14,
3039,
275,
291,
14,
3039,
14,
3176,
8,
1343,
12,
1284,
12,
13434,
12,
1163,
776,
288,
587,
26,
355,
291,
14,
3039,
275,
18766,
1716,
8,
928,
12,
1284,
12,
13434,
12,
1163,
776,
288,
327,
295,
7358,
3123,
288,
340,
291,
14,
6693,
665,
291,
14,
3039,
14,
6693,
26,
355,
1738,
275,
291,
14,
12873,
1019,
342,
267,
340,
1738,
14,
1019,
436,
1738,
14,
3039,
26,
7205,
1738,
14,
988,
500,
275,
1390,
8,
1738,
14,
500,
12,
1738,
14,
1019,
14,
988,
500,
12,
1738,
14,
3039,
14,
988,
500,
776,
288,
1738,
14,
827,
500,
275,
1748,
8,
1738,
14,
500,
12,
1738,
14,
1019,
14,
827,
500,
12,
1738,
14,
3039,
14,
827,
500,
776,
267,
916,
1738,
14,
1019,
26,
7205,
1738,
14,
988,
500,
275,
1390,
8,
1738,
14,
500,
12,
1738,
14,
1019,
14,
988,
500,
776,
288,
1738,
14,
827,
500,
275,
1748,
8,
1738,
14,
500,
12,
1738,
14,
1019,
14,
827,
500,
776,
267,
916,
1738,
14,
3039,
26,
288,
1738,
14,
988,
500,
275,
1390,
8,
1738,
14,
500,
12,
1738,
14,
3039,
14,
988,
500,
776,
288,
1738,
14,
827,
500,
275,
1748,
8,
1738,
14,
500,
12,
1738,
14,
3039,
14,
827,
500,
776,
267,
372,
1738,
339,
347,
20071,
1019,
8,
291,
3461,
267,
870,
298,
12873,
2451,
2,
267,
1738,
275,
291,
14,
3039,
267,
291,
14,
3039,
275,
291,
14,
3039,
14,
1019,
267,
1738,
14,
1019,
275,
291,
267,
340,
291,
14,
1019,
436,
291,
14,
3039,
26,
7205,
291,
14,
988,
500,
275,
1390,
8,
277,
14,
500,
12,
291,
14,
1019,
14,
988,
500,
12,
291,
14,
3039,
14,
988,
500,
9,
288,
291,
14,
827,
500,
275,
1748,
8,
277,
14,
500,
12,
291,
14,
1019,
14,
827,
500,
12,
291,
14,
3039,
14,
827,
500,
776,
267,
916,
291,
14,
1019,
26,
288,
291,
14,
988,
500,
275,
1390,
8,
277,
14,
500,
12,
291,
14,
1019,
14,
988,
500,
9,
288,
291,
14,
827,
500,
275,
1748,
8,
277,
14,
500,
12,
291,
14,
1019,
14,
827,
500,
9,
267,
916,
291,
14,
3039,
26,
288,
291,
14,
988,
500,
275,
1390,
8,
277,
14,
500,
12,
291,
14,
3039,
14,
988,
500,
9,
288,
291
] |
[
199,
199,
8227,
3123,
3555,
666,
5523,
14,
199,
199,
13735,
282,
663,
402,
666,
626,
8469,
666,
626,
2249,
796,
2005,
900,
6252,
12,
1218,
376,
909,
315,
4402,
199,
9099,
1627,
282,
1827,
543,
282,
2197,
4913,
12,
372,
314,
12082,
666,
1771,
7447,
900,
6252,
4450,
626,
14,
199,
199,
2620,
25353,
2263,
12930,
14,
221,
6820,
361,
83,
18870,
676,
530,
8227,
16048,
436,
3663,
20074,
26803,
83,
14,
199,
199,
1365,
26,
199,
1014,
921,
25668,
14,
1308,
15,
74,
14015,
63,
502,
89,
25339,
15,
13691,
13,
1548,
15,
2164,
15,
1079,
66,
22,
65,
22,
67,
2720,
983,
22,
15,
773,
15,
13691,
15,
18574,
15,
8170,
15,
13239,
8519,
14,
647,
199,
624,
199,
646,
3473,
199,
646,
900,
199,
646,
984,
199,
646,
2196,
199,
199,
533,
18766,
3987,
8,
909,
3461,
272,
347,
636,
826,
721,
291,
3461,
267,
291,
14,
23473,
83,
275,
1052,
272,
347,
5518,
8,
291,
12,
6252,
12,
13434,
29,
16,
12,
1163,
29,
403,
3461,
267,
20074,
275,
6252,
14,
23473,
267,
1343,
275,
6252,
14,
928,
267,
1284,
275,
6252,
14,
500,
267,
340,
6252,
14,
23473,
315,
291,
14,
23473,
83,
26,
288,
291,
14,
23473,
83,
59,
23473,
61,
275,
291,
14,
23473,
83,
59,
23473,
1055,
3176,
8,
1343,
12,
1284,
12,
13434,
12,
1163,
776,
267,
587,
26,
288,
291,
14,
23473,
83,
59,
23473,
61,
275,
18766,
1716,
8,
1343,
12,
1284,
12,
13434,
12,
1163,
776,
272,
347,
26066,
8,
291,
12,
6252,
12,
3622,
63,
1532,
3461,
267,
20074,
275,
6252,
14,
23473,
267,
1343,
275,
6252,
14,
928,
267,
1284,
275,
6252,
14,
500,
267,
340,
20074,
315,
291,
14,
23473,
83,
26,
288,
291,
14,
23473,
83,
59,
23473,
1055,
23149,
8,
1343,
12,
1284,
12,
3622,
63,
1532,
776,
272,
347,
24749,
8,
291,
12,
2562,
3461,
267,
367,
1242,
315,
291,
14,
23473,
83,
14,
13012,
837,
288,
1242,
14,
23650,
8,
2562,
776,
199,
199,
533,
18766,
1716,
8,
909,
3461,
272,
347,
636,
826,
721,
291,
12,
1343,
12,
1284,
12,
13434,
29,
16,
12,
1163,
29,
403,
3461,
267,
327,
2018,
1127,
5618,
314,
2517,
6471,
4084,
12,
880,
781,
3957,
282,
267,
327,
14818,
1901,
282,
2517,
6471,
2952,
652,
13872,
300,
1183,
29823,
543,
267,
327,
3123,
1568,
14,
221,
6121,
12,
2366,
1159,
14818,
365,
23668,
3967,
314,
267,
327,
7008,
2304,
365,
440,
20728,
12,
1314,
10557,
2739,
10942,
2348,
14,
267,
327,
277,
14,
6693,
275,
3473,
14,
14085,
8,
5868,
17,
14,
16,
1182,
3473,
14,
793,
13417,
21,
430,
627,
3473,
14,
793,
8,
446,
17,
14,
16,
1182,
334,
2355,
14,
8830,
8,
16,
12,
17,
9,
446,
413,
1724,
267,
291,
14,
6693,
29,
17,
267,
291,
14,
928,
275,
1343,
267,
291,
14,
500,
275,
1284,
267,
291,
14,
988,
500,
275,
291,
14,
500,
267,
291,
14,
827,
500,
275,
291,
14,
500,
267,
291,
14,
3039,
275,
488,
267,
291,
14,
1019,
275,
488,
267,
291,
14,
19466,
275,
13434,
267,
291,
14,
1848,
275,
1163,
272,
347,
5518,
8,
291,
12,
1343,
12,
1284,
12,
13434,
29,
16,
12,
1163,
29,
403,
3461,
267,
1738,
275,
291,
267,
340,
1343,
690,
291,
14,
928,
26,
288,
327,
5518,
370,
2451,
3123,
288,
340,
291,
14,
1019,
26,
355,
291,
14,
1019,
275,
291,
14,
1019,
14,
3176,
8,
1343,
12,
1284,
12,
13434,
12,
1163,
776,
288,
587,
26,
355,
291,
14,
1019,
275,
18766,
1716,
8,
928,
12,
1284,
12,
13434,
12,
1163,
776,
288,
327,
295,
7358,
3123,
288,
340,
291,
14,
6693,
665,
291,
14,
1019,
14,
6693,
26,
355,
1738,
275,
291,
14,
12873,
3039,
342,
267,
587,
26,
288,
327,
5518,
370,
3602,
3123,
288,
340,
291,
14,
3039,
26,
355,
291,
14,
3039,
275,
291,
14,
3039,
14,
3176,
8,
1343,
12,
1284,
12,
13434,
12,
1163,
776,
288,
587,
26,
355,
291,
14,
3039,
275,
18766,
1716,
8,
928,
12,
1284,
12,
13434,
12,
1163,
776,
288,
327,
295,
7358,
3123,
288,
340,
291,
14,
6693,
665,
291,
14,
3039,
14,
6693,
26,
355,
1738,
275,
291,
14,
12873,
1019,
342,
267,
340,
1738,
14,
1019,
436,
1738,
14,
3039,
26,
7205,
1738,
14,
988,
500,
275,
1390,
8,
1738,
14,
500,
12,
1738,
14,
1019,
14,
988,
500,
12,
1738,
14,
3039,
14,
988,
500,
776,
288,
1738,
14,
827,
500,
275,
1748,
8,
1738,
14,
500,
12,
1738,
14,
1019,
14,
827,
500,
12,
1738,
14,
3039,
14,
827,
500,
776,
267,
916,
1738,
14,
1019,
26,
7205,
1738,
14,
988,
500,
275,
1390,
8,
1738,
14,
500,
12,
1738,
14,
1019,
14,
988,
500,
776,
288,
1738,
14,
827,
500,
275,
1748,
8,
1738,
14,
500,
12,
1738,
14,
1019,
14,
827,
500,
776,
267,
916,
1738,
14,
3039,
26,
288,
1738,
14,
988,
500,
275,
1390,
8,
1738,
14,
500,
12,
1738,
14,
3039,
14,
988,
500,
776,
288,
1738,
14,
827,
500,
275,
1748,
8,
1738,
14,
500,
12,
1738,
14,
3039,
14,
827,
500,
776,
267,
372,
1738,
339,
347,
20071,
1019,
8,
291,
3461,
267,
870,
298,
12873,
2451,
2,
267,
1738,
275,
291,
14,
3039,
267,
291,
14,
3039,
275,
291,
14,
3039,
14,
1019,
267,
1738,
14,
1019,
275,
291,
267,
340,
291,
14,
1019,
436,
291,
14,
3039,
26,
7205,
291,
14,
988,
500,
275,
1390,
8,
277,
14,
500,
12,
291,
14,
1019,
14,
988,
500,
12,
291,
14,
3039,
14,
988,
500,
9,
288,
291,
14,
827,
500,
275,
1748,
8,
277,
14,
500,
12,
291,
14,
1019,
14,
827,
500,
12,
291,
14,
3039,
14,
827,
500,
776,
267,
916,
291,
14,
1019,
26,
288,
291,
14,
988,
500,
275,
1390,
8,
277,
14,
500,
12,
291,
14,
1019,
14,
988,
500,
9,
288,
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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
setten/pymatgen
|
pymatgen/core/composition.py
|
2
|
38512
|
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import collections
import numbers
import string
from itertools import combinations_with_replacement, product
import os
import six
import re
from collections import defaultdict
from monty.serialization import loadfn
from six.moves import filter, map, zip
from functools import total_ordering
from monty.fractions import gcd, gcd_float
from pymatgen.core.periodic_table import get_el_sp, Element, Specie
from pymatgen.util.string import formula_double_format
from monty.json import MSONable
from pymatgen.core.units import unitized
"""
This module implements a Composition class to represent compositions,
and a ChemicalPotential class to represent potentials.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__status__ = "Production"
__date__ = "Nov 10, 2012"
@total_ordering
class Composition(collections.Hashable, collections.Mapping, MSONable):
"""
Represents a Composition, which is essentially a {element:amount} mapping
type. Composition is written to be immutable and hashable,
unlike a standard Python dict.
Note that the key can be either an Element or a Specie. Elements and Specie
are treated differently. i.e., a Fe2+ is not the same as a Fe3+ Specie and
would be put in separate keys. This differentiation is deliberate to
support using Composition to determine the fraction of a particular Specie.
Works almost completely like a standard python dictionary, except that
__getitem__ is overridden to return 0 when an element is not found.
(somewhat like a defaultdict, except it is immutable).
Also adds more convenience methods relevant to compositions, e.g.,
get_fraction.
It should also be noted that many Composition related functionality takes
in a standard string as a convenient input. For example,
even though the internal representation of a Fe2O3 composition is
{Element("Fe"): 2, Element("O"): 3}, you can obtain the amount of Fe
simply by comp["Fe"] instead of the more verbose comp[Element("Fe")].
>>> comp = Composition("LiFePO4")
>>> comp.get_atomic_fraction(Element("Li"))
0.14285714285714285
>>> comp.num_atoms
7.0
>>> comp.reduced_formula
'LiFePO4'
>>> comp.formula
'Li1 Fe1 P1 O4'
>>> comp.get_wt_fraction(Element("Li"))
0.04399794666951898
>>> comp.num_atoms
7.0
"""
"""
Tolerance in distinguishing different composition amounts.
1e-8 is fairly tight, but should cut out most floating point arithmetic
errors.
"""
amount_tolerance = 1e-8
"""
Special formula handling for peroxides and certain elements. This is so
that formula output does not write LiO instead of Li2O2 for example.
"""
special_formulas = {"LiO": "Li2O2", "NaO": "Na2O2", "KO": "K2O2",
"HO": "H2O2", "CsO": "Cs2O2", "RbO": "Rb2O2",
"O": "O2", "N": "N2", "F": "F2", "Cl": "Cl2",
"H": "H2"}
oxi_prob = None # prior probability of oxidation used by oxi_state_guesses
def __init__(self, *args, **kwargs): # allow_negative=False
"""
Very flexible Composition construction, similar to the built-in Python
dict(). Also extended to allow simple string init.
Args:
Any form supported by the Python built-in dict() function.
1. A dict of either {Element/Specie: amount},
{string symbol:amount}, or {atomic number:amount} or any mixture
of these. E.g., {Element("Li"):2 ,Element("O"):1},
{"Li":2, "O":1}, {3:2, 8:1} all result in a Li2O composition.
2. Keyword arg initialization, similar to a dict, e.g.,
Composition(Li = 2, O = 1)
In addition, the Composition constructor also allows a single
string as an input formula. E.g., Composition("Li2O").
allow_negative: Whether to allow negative compositions. This
argument must be popped from the \\*\\*kwargs due to \\*args
ambiguity.
"""
self.allow_negative = kwargs.pop('allow_negative', False)
# it's much faster to recognize a composition and use the elmap than
# to pass the composition to dict()
if len(args) == 1 and isinstance(args[0], Composition):
elmap = args[0]
elif len(args) == 1 and isinstance(args[0], six.string_types):
elmap = self._parse_formula(args[0])
else:
elmap = dict(*args, **kwargs)
elamt = {}
self._natoms = 0
for k, v in elmap.items():
if v < -Composition.amount_tolerance and not self.allow_negative:
raise CompositionError("Amounts in Composition cannot be "
"negative!")
if abs(v) >= Composition.amount_tolerance:
elamt[get_el_sp(k)] = v
self._natoms += abs(v)
self._data = elamt
def __getitem__(self, item):
try:
sp = get_el_sp(item)
return self._data.get(sp, 0)
except ValueError as ex:
raise TypeError("Invalid key {}, {} for Composition\n"
"ValueError exception:\n{}".format(item,
type(item), ex))
def __len__(self):
return len(self._data)
def __iter__(self):
return self._data.keys().__iter__()
def __contains__(self, item):
try:
sp = get_el_sp(item)
return sp in self._data
except ValueError as ex:
raise TypeError("Invalid key {}, {} for Composition\n"
"ValueError exception:\n{}".format(item,
type(item), ex))
def __eq__(self, other):
# elements with amounts < Composition.amount_tolerance don't show up
# in the elmap, so checking len enables us to only check one
# compositions elements
if len(self) != len(other):
return False
for el, v in self.items():
if abs(v - other[el]) > Composition.amount_tolerance:
return False
return True
def __ge__(self, other):
"""
Defines >= for Compositions. Should ONLY be used for defining a sort
order (the behavior is probably not what you'd expect)
"""
for el in sorted(set(self.elements + other.elements)):
if other[el] - self[el] >= Composition.amount_tolerance:
return False
elif self[el] - other[el] >= Composition.amount_tolerance:
return True
return True
def __ne__(self, other):
return not self.__eq__(other)
def __add__(self, other):
"""
Adds two compositions. For example, an Fe2O3 composition + an FeO
composition gives a Fe3O4 composition.
"""
new_el_map = collections.defaultdict(float)
new_el_map.update(self)
for k, v in other.items():
new_el_map[get_el_sp(k)] += v
return Composition(new_el_map, allow_negative=self.allow_negative)
def __sub__(self, other):
"""
Subtracts two compositions. For example, an Fe2O3 composition - an FeO
composition gives an FeO2 composition.
Raises:
CompositionError if the subtracted composition is greater than the
original composition in any of its elements, unless allow_negative
is True
"""
new_el_map = collections.defaultdict(float)
new_el_map.update(self)
for k, v in other.items():
new_el_map[get_el_sp(k)] -= v
return Composition(new_el_map, allow_negative=self.allow_negative)
def __mul__(self, other):
"""
Multiply a Composition by an integer or a float.
Fe2O3 * 4 -> Fe8O12
"""
if not isinstance(other, numbers.Number):
return NotImplemented
return Composition({el: self[el] * other for el in self},
allow_negative=self.allow_negative)
__rmul__ = __mul__
def __truediv__(self, other):
if not isinstance(other, numbers.Number):
return NotImplemented
return Composition({el: self[el] / other for el in self},
allow_negative=self.allow_negative)
__div__ = __truediv__
def __hash__(self):
"""
Minimally effective hash function that just distinguishes between
Compositions with different elements.
"""
hashcode = 0
for el, amt in self.items():
if abs(amt) > Composition.amount_tolerance:
hashcode += el.Z
return hashcode
@property
def average_electroneg(self):
return sum((el.X * abs(amt) for el, amt in self.items())) / \
self.num_atoms
@property
def total_electrons(self):
return sum((el.Z * abs(amt) for el, amt in self.items()))
def almost_equals(self, other, rtol=0.1, atol=1e-8):
"""
Returns true if compositions are equal within a tolerance.
Args:
other (Composition): Other composition to check
rtol (float): Relative tolerance
atol (float): Absolute tolerance
"""
sps = set(self.elements + other.elements)
for sp in sps:
a = self[sp]
b = other[sp]
tol = atol + rtol * (abs(a) + abs(b)) / 2
if abs(b - a) > tol:
return False
return True
@property
def is_element(self):
"""
True if composition is for an element.
"""
return len(self) == 1
def copy(self):
return Composition(self, allow_negative=self.allow_negative)
@property
def formula(self):
"""
Returns a formula string, with elements sorted by electronegativity,
e.g., Li4 Fe4 P4 O16.
"""
sym_amt = self.get_el_amt_dict()
syms = sorted(sym_amt.keys(), key=lambda sym: get_el_sp(sym).X)
formula = [s + formula_double_format(sym_amt[s], False) for s in syms]
return " ".join(formula)
@property
def alphabetical_formula(self):
"""
Returns a formula string, with elements sorted by alphabetically
e.g., Fe4 Li4 O16 P4.
"""
sym_amt = self.get_el_amt_dict()
syms = sorted(sym_amt.keys())
formula = [s + formula_double_format(sym_amt[s], False) for s in syms]
return " ".join(formula)
@property
def element_composition(self):
"""
Returns the composition replacing any species by the corresponding
element.
"""
return Composition(self.get_el_amt_dict(),
allow_negative=self.allow_negative)
@property
def fractional_composition(self):
"""
Returns the normalized composition which the number of species sum to
1.
Returns:
Normalized composition which the number of species sum to 1.
"""
return self / self._natoms
@property
def reduced_composition(self):
"""
Returns the reduced composition,i.e. amounts normalized by greatest
common denominator. e.g., Composition("FePO4") for
Composition("Fe4P4O16").
"""
return self.get_reduced_composition_and_factor()[0]
def get_reduced_composition_and_factor(self):
"""
Calculates a reduced composition and factor.
Returns:
A normalized composition and a multiplicative factor, i.e.,
Li4Fe4P4O16 returns (Composition("LiFePO4"), 4).
"""
factor = self.get_reduced_formula_and_factor()[1]
return self / factor, factor
def get_reduced_formula_and_factor(self):
"""
Calculates a reduced formula and factor.
Returns:
A pretty normalized formula and a multiplicative factor, i.e.,
Li4Fe4P4O16 returns (LiFePO4, 4).
"""
all_int = all(abs(x - round(x)) < Composition.amount_tolerance
for x in self.values())
if not all_int:
return self.formula.replace(" ", ""), 1
d = {k: int(round(v)) for k, v in self.get_el_amt_dict().items()}
(formula, factor) = reduce_formula(d)
if formula in Composition.special_formulas:
formula = Composition.special_formulas[formula]
factor /= 2
return formula, factor
def get_integer_formula_and_factor(self, max_denominator=10000):
"""
Calculates an integer formula and factor.
Args:
max_denominator (int): all amounts in the el:amt dict are
first converted to a Fraction with this maximum denominator
Returns:
A pretty normalized formula and a multiplicative factor, i.e.,
Li0.5O0.25 returns (Li2O, 0.25). O0.25 returns (O2, 0.125)
"""
el_amt = self.get_el_amt_dict()
g = gcd_float(list(el_amt.values()), 1 / max_denominator)
d = {k: round(v / g) for k, v in el_amt.items()}
(formula, factor) = reduce_formula(d)
if formula in Composition.special_formulas:
formula = Composition.special_formulas[formula]
factor /= 2
return formula, factor * g
@property
def reduced_formula(self):
"""
Returns a pretty normalized formula, i.e., LiFePO4 instead of
Li4Fe4P4O16.
"""
return self.get_reduced_formula_and_factor()[0]
@property
def hill_formula(self):
c = self.element_composition
elements = sorted([el.symbol for el in c.keys()])
if "C" in elements:
elements = ["C"] + [el for el in elements if el != "C"]
formula = ["%s%s" % (el, formula_double_format(c[el]) if c[el] != 1 else "")
for el in elements]
return " ".join(formula)
@property
def elements(self):
"""
Returns view of elements in Composition.
"""
return list(self.keys())
def __str__(self):
return " ".join([
"{}{}".format(k, formula_double_format(v, ignore_ones=False))
for k, v in self.as_dict().items()])
@property
def num_atoms(self):
"""
Total number of atoms in Composition. For negative amounts, sum
of absolute values
"""
return self._natoms
@property
@unitized("amu")
def weight(self):
"""
Total molecular weight of Composition
"""
return sum([amount * el.atomic_mass
for el, amount in self.items()])
def get_atomic_fraction(self, el):
"""
Calculate atomic fraction of an Element or Specie.
Args:
el (Element/Specie): Element or Specie to get fraction for.
Returns:
Atomic fraction for element el in Composition
"""
return abs(self[el]) / self._natoms
def get_wt_fraction(self, el):
"""
Calculate weight fraction of an Element or Specie.
Args:
el (Element/Specie): Element or Specie to get fraction for.
Returns:
Weight fraction for element el in Composition
"""
return get_el_sp(el).atomic_mass * abs(self[el]) / self.weight
def _parse_formula(self, formula):
"""
Args:
formula (str): A string formula, e.g. Fe2O3, Li3Fe2(PO4)3
Returns:
Composition with that formula.
"""
def get_sym_dict(f, factor):
sym_dict = collections.defaultdict(float)
for m in re.finditer(r"([A-Z][a-z]*)\s*([-*\.\d]*)", f):
el = m.group(1)
amt = 1
if m.group(2).strip() != "":
amt = float(m.group(2))
sym_dict[el] += amt * factor
f = f.replace(m.group(), "", 1)
if f.strip():
raise CompositionError("{} is an invalid formula!".format(f))
return sym_dict
m = re.search(r"\(([^\(\)]+)\)\s*([\.\d]*)", formula)
if m:
factor = 1
if m.group(2) != "":
factor = float(m.group(2))
unit_sym_dict = get_sym_dict(m.group(1), factor)
expanded_sym = "".join(["{}{}".format(el, amt)
for el, amt in unit_sym_dict.items()])
expanded_formula = formula.replace(m.group(), expanded_sym)
return self._parse_formula(expanded_formula)
return get_sym_dict(formula, 1)
@property
def anonymized_formula(self):
"""
An anonymized formula. Unique species are arranged in ordering of
increasing amounts and assigned ascending alphabets. Useful for
prototyping formulas. For example, all stoichiometric perovskites have
anonymized_formula ABC3.
"""
reduced = self.element_composition
if all(x == int(x) for x in self.values()):
reduced /= gcd(*(int(i) for i in self.values()))
anon = ""
for e, amt in zip(string.ascii_uppercase, sorted(reduced.values())):
if amt == 1:
amt_str = ""
elif abs(amt % 1) < 1e-8:
amt_str = str(int(amt))
else:
amt_str = str(amt)
anon += ("{}{}".format(e, amt_str))
return anon
def __repr__(self):
return "Comp: " + self.formula
@classmethod
def from_dict(cls, d):
"""
Creates a composition from a dict generated by as_dict(). Strictly not
necessary given that the standard constructor already takes in such an
input, but this method preserves the standard pymatgen API of having
from_dict methods to reconstitute objects generated by as_dict(). Allows
for easier introspection.
Args:
d (dict): {symbol: amount} dict.
"""
return cls(d)
def get_el_amt_dict(self):
"""
Returns:
Dict with element symbol and (unreduced) amount e.g.,
{"Fe": 4.0, "O":6.0} or {"Fe3+": 4.0, "O2-":6.0}
"""
d = collections.defaultdict(float)
for e, a in self.items():
d[e.symbol] += a
return d
def as_dict(self):
"""
Returns:
dict with species symbol and (unreduced) amount e.g.,
{"Fe": 4.0, "O":6.0} or {"Fe3+": 4.0, "O2-":6.0}
"""
d = collections.defaultdict(float)
for e, a in self.items():
d[str(e)] += a
return d
@property
def to_reduced_dict(self):
"""
Returns:
Dict with element symbol and reduced amount e.g.,
{"Fe": 2.0, "O":3.0}
"""
c = Composition(self.reduced_formula)
return c.as_dict()
@property
def to_data_dict(self):
"""
Returns:
A dict with many keys and values relating to Composition/Formula,
including reduced_cell_composition, unit_cell_composition,
reduced_cell_formula, elements and nelements.
"""
return {"reduced_cell_composition": self.to_reduced_dict,
"unit_cell_composition": self.as_dict(),
"reduced_cell_formula": self.reduced_formula,
"elements": self.as_dict().keys(),
"nelements": len(self.as_dict().keys())}
def oxi_state_guesses(self, oxi_states_override=None, target_charge=0,
all_oxi_states=False, max_sites=None):
"""
Checks if the composition is charge-balanced and returns back all
charge-balanced oxidation state combinations. Composition must have
integer values. Note that more num_atoms in the composition gives
more degrees of freedom. e.g., if possible oxidation states of
element X are [2,4] and Y are [-3], then XY is not charge balanced
but X2Y2 is. Results are returned from most to least probable based
on ICSD statistics. Use max_sites to improve performance if needed.
Args:
oxi_states_override (dict): dict of str->list to override an
element's common oxidation states, e.g. {"V": [2,3,4,5]}
target_charge (int): the desired total charge on the structure.
Default is 0 signifying charge balance.
all_oxi_states (bool): if True, an element defaults to
all oxidation states in pymatgen Element.icsd_oxidation_states.
Otherwise, default is Element.common_oxidation_states. Note
that the full oxidation state list is *very* inclusive and
can produce nonsensical results.
max_sites (int): if possible, will reduce Compositions to at most
this many many sites to speed up oxidation state guesses. Set
to -1 to just reduce fully.
Returns:
A list of dicts - each dict reports an element symbol and average
oxidation state across all sites in that composition. If the
composition is not charge balanced, an empty list is returned.
"""
comp = self.copy()
# reduce Composition if necessary
if max_sites == -1:
comp = self.reduced_composition
elif max_sites and comp.num_atoms > max_sites:
reduced_comp, reduced_factor = self.\
get_reduced_composition_and_factor()
if reduced_factor > 1:
reduced_comp *= max(1, int(max_sites / reduced_comp.num_atoms))
comp = reduced_comp # as close to max_sites as possible
if comp.num_atoms > max_sites:
raise ValueError("Composition {} cannot accommodate max_sites "
"setting!".format(comp))
# Load prior probabilities of oxidation states, used to rank solutions
if not Composition.oxi_prob:
module_dir = os.path.join(os.path.
dirname(os.path.abspath(__file__)))
all_data = loadfn(os.path.join(module_dir, "..",
"analysis", "icsd_bv.yaml"))
Composition.oxi_prob = {Specie.from_string(sp): data
for sp, data in
all_data["occurrence"].items()}
oxi_states_override = oxi_states_override or {}
# assert: Composition only has integer amounts
if not all(amt == int(amt) for amt in comp.values()):
raise ValueError("Charge balance analysis requires integer "
"values in Composition!")
# for each element, determine all possible sum of oxidations
# (taking into account nsites for that particular element)
el_amt = comp.get_el_amt_dict()
els = el_amt.keys()
el_sums = [] # matrix: dim1= el_idx, dim2=possible sums
el_sum_scores = defaultdict(set) # dict of el_idx, sum -> score
for idx, el in enumerate(els):
el_sum_scores[idx] = {}
el_sums.append([])
if oxi_states_override.get(el):
oxids = oxi_states_override[el]
elif all_oxi_states:
oxids = Element(el).oxidation_states
else:
oxids = Element(el).icsd_oxidation_states or \
Element(el).oxidation_states
# get all possible combinations of oxidation states
# and sum each combination
for oxid_combo in combinations_with_replacement(oxids,
int(el_amt[el])):
if sum(oxid_combo) not in el_sums[idx]:
el_sums[idx].append(sum(oxid_combo))
score = sum([Composition.oxi_prob.get(Specie(el, o), 0) for
o in oxid_combo]) # how probable is this combo?
el_sum_scores[idx][sum(oxid_combo)] = max(
el_sum_scores[idx].get(sum(oxid_combo), 0), score)
all_sols = [] # will contain all solutions
all_scores = [] # will contain a score for each solution
for x in product(*el_sums):
# each x is a trial of one possible oxidation sum for each element
if sum(x) == target_charge: # charge balance condition
el_sum_sol = dict(zip(els, x)) # element->oxid_sum
# normalize oxid_sum by amount to get avg oxid state
sol = {el: v / el_amt[el] for el, v in el_sum_sol.items()}
all_sols.append(sol) # add the solution to the list of solutions
# determine the score for this solution
score = 0
for idx, v in enumerate(x):
score += el_sum_scores[idx][v]
all_scores.append(score)
# sort the solutions by highest to lowest score
all_sols = [x for (y, x) in sorted(zip(all_scores, all_sols),
key=lambda pair: pair[0],
reverse=True)]
return all_sols
@staticmethod
def ranked_compositions_from_indeterminate_formula(fuzzy_formula,
lock_if_strict=True):
"""
Takes in a formula where capitilization might not be correctly entered,
and suggests a ranked list of potential Composition matches.
Author: Anubhav Jain
Args:
fuzzy_formula (str): A formula string, such as "co2o3" or "MN",
that may or may not have multiple interpretations
lock_if_strict (bool): If true, a properly entered formula will
only return the one correct interpretation. For example,
"Co1" will only return "Co1" if true, but will return both
"Co1" and "C1 O1" if false.
Returns:
A ranked list of potential Composition matches
"""
#if we have an exact match and the user specifies lock_if_strict, just
#return the exact match!
if lock_if_strict:
#the strict composition parsing might throw an error, we can ignore
#it and just get on with fuzzy matching
try:
comp = Composition(fuzzy_formula)
return [comp]
except (CompositionError, ValueError):
pass
all_matches = Composition._comps_from_fuzzy_formula(fuzzy_formula)
#remove duplicates
all_matches = list(set(all_matches))
#sort matches by rank descending
all_matches = sorted(all_matches,
key=lambda match: match[1], reverse=True)
all_matches = [m[0] for m in all_matches]
return all_matches
@staticmethod
def _comps_from_fuzzy_formula(fuzzy_formula, m_dict={}, m_points=0,
factor=1):
"""
A recursive helper method for formula parsing that helps in
interpreting and ranking indeterminate formulas.
Author: Anubhav Jain
Args:
fuzzy_formula (str): A formula string, such as "co2o3" or "MN",
that may or may not have multiple interpretations.
m_dict (dict): A symbol:amt dictionary from the previously parsed
formula.
m_points: Number of points gained from the previously parsed
formula.
factor: Coefficient for this parse, e.g. (PO4)2 will feed in PO4
as the fuzzy_formula with a coefficient of 2.
Returns:
A list of tuples, with the first element being a Composition and
the second element being the number of points awarded that
Composition intepretation.
"""
def _parse_chomp_and_rank(m, f, m_dict, m_points):
"""
A helper method for formula parsing that helps in interpreting and
ranking indeterminate formulas
Author: Anubhav Jain
Args:
m: A regex match, with the first group being the element and
the second group being the amount
f: The formula part containing the match
m_dict: A symbol:amt dictionary from the previously parsed
formula
m_points: Number of points gained from the previously parsed
formula
Returns:
A tuple of (f, m_dict, points) where m_dict now contains data
from the match and the match has been removed (chomped) from
the formula f. The "goodness" of the match determines the
number of points returned for chomping. Returns
(None, None, None) if no element could be found...
"""
points = 0
# Points awarded if the first element of the element is correctly
# specified as a capital
points_first_capital = 100
# Points awarded if the second letter of the element is correctly
# specified as lowercase
points_second_lowercase = 100
#get element and amount from regex match
el = m.group(1)
if len(el) > 2 or len(el) < 1:
raise CompositionError("Invalid element symbol entered!")
amt = float(m.group(2)) if m.group(2).strip() != "" else 1
#convert the element string to proper [uppercase,lowercase] format
#and award points if it is already in that format
char1 = el[0]
char2 = el[1] if len(el) > 1 else ""
if char1 == char1.upper():
points += points_first_capital
if char2 and char2 == char2.lower():
points += points_second_lowercase
el = char1.upper() + char2.lower()
#if it's a valid element, chomp and add to the points
if Element.is_valid_symbol(el):
if el in m_dict:
m_dict[el] += amt * factor
else:
m_dict[el] = amt * factor
return f.replace(m.group(), "", 1), m_dict, m_points + points
#else return None
return None, None, None
fuzzy_formula = fuzzy_formula.strip()
if len(fuzzy_formula) == 0:
# The entire formula has been parsed into m_dict. Return the
# corresponding Composition and number of points
if m_dict:
yield (Composition.from_dict(m_dict), m_points)
else:
# if there is a parenthesis, remove it and match the remaining stuff
# with the appropriate factor
for mp in re.finditer(r"\(([^\(\)]+)\)([\.\d]*)", fuzzy_formula):
mp_points = m_points
mp_form = fuzzy_formula.replace(mp.group(), " ", 1)
mp_dict = dict(m_dict)
mp_factor = 1 if mp.group(2) == "" else float(mp.group(2))
# Match the stuff inside the parenthesis with the appropriate
# factor
for match in \
Composition._comps_from_fuzzy_formula(mp.group(1),
mp_dict,
mp_points,
factor=mp_factor):
only_me = True
# Match the stuff outside the parentheses and return the
# sum.
for match2 in \
Composition._comps_from_fuzzy_formula(mp_form,
mp_dict,
mp_points,
factor=1):
only_me = False
yield (match[0] + match2[0], match[1] + match2[1])
# if the stuff inside the parenthesis is nothing, then just
# return the stuff inside the parentheses
if only_me:
yield match
return
# try to match the single-letter elements
m1 = re.match(r"([A-z])([\.\d]*)", fuzzy_formula)
if m1:
m_points1 = m_points
m_form1 = fuzzy_formula
m_dict1 = dict(m_dict)
(m_form1, m_dict1, m_points1) = \
_parse_chomp_and_rank(m1, m_form1, m_dict1, m_points1)
if m_dict1:
#there was a real match
for match in \
Composition._comps_from_fuzzy_formula(m_form1,
m_dict1,
m_points1,
factor):
yield match
#try to match two-letter elements
m2 = re.match(r"([A-z]{2})([\.\d]*)", fuzzy_formula)
if m2:
m_points2 = m_points
m_form2 = fuzzy_formula
m_dict2 = dict(m_dict)
(m_form2, m_dict2, m_points2) = \
_parse_chomp_and_rank(m2, m_form2, m_dict2, m_points2)
if m_dict2:
#there was a real match
for match in \
Composition._comps_from_fuzzy_formula(m_form2, m_dict2,
m_points2,
factor):
yield match
def reduce_formula(sym_amt):
"""
Helper method to reduce a sym_amt dict to a reduced formula and factor.
Args:
sym_amt (dict): {symbol: amount}.
Returns:
(reduced_formula, factor).
"""
syms = sorted(sym_amt.keys(),
key=lambda s: [get_el_sp(s).X, s])
syms = list(filter(lambda s: abs(sym_amt[s]) >
Composition.amount_tolerance, syms))
num_el = len(syms)
contains_polyanion = (num_el >= 3 and
get_el_sp(syms[num_el - 1]).X
- get_el_sp(syms[num_el - 2]).X < 1.65)
factor = 1
# Enforce integers for doing gcd.
if all((int(i) == i for i in sym_amt.values())):
factor = abs(gcd(*(int(i) for i in sym_amt.values())))
reduced_form = []
n = num_el - 2 if contains_polyanion else num_el
for i in range(0, n):
s = syms[i]
normamt = sym_amt[s] * 1.0 / factor
reduced_form.append(s)
reduced_form.append(formula_double_format(normamt))
if contains_polyanion:
poly_sym_amt = {syms[i]: sym_amt[syms[i]] / factor
for i in range(n, num_el)}
(poly_form, poly_factor) = reduce_formula(poly_sym_amt)
if poly_factor != 1:
reduced_form.append("({}){}".format(poly_form, int(poly_factor)))
else:
reduced_form.append(poly_form)
reduced_form = "".join(reduced_form)
return reduced_form, factor
class CompositionError(Exception):
"""Exception class for composition errors"""
pass
class ChemicalPotential(dict, MSONable):
"""
Class to represent set of chemical potentials. Can be:
multiplied/divided by a Number
multiplied by a Composition (returns an energy)
added/subtracted with other ChemicalPotentials.
"""
def __init__(self, *args, **kwargs):
"""
Args:
*args, **kwargs: any valid dict init arguments
"""
d = dict(*args, **kwargs)
super(ChemicalPotential, self).__init__((get_el_sp(k), v)
for k, v in d.items())
if len(d) != len(self):
raise ValueError("Duplicate potential specified")
def __mul__(self, other):
if isinstance(other, numbers.Number):
return ChemicalPotential({k: v * other for k, v in self.items()})
else:
return NotImplemented
__rmul__ = __mul__
def __truediv__(self, other):
if isinstance(other, numbers.Number):
return ChemicalPotential({k: v / other for k, v in self.items()})
else:
return NotImplemented
__div__ = __truediv__
def __sub__(self, other):
if isinstance(other, ChemicalPotential):
els = set(self.keys()).union(other.keys())
return ChemicalPotential({e: self.get(e, 0) - other.get(e, 0)
for e in els})
else:
return NotImplemented
def __add__(self, other):
if isinstance(other, ChemicalPotential):
els = set(self.keys()).union(other.keys())
return ChemicalPotential({e: self.get(e, 0) + other.get(e, 0)
for e in els})
else:
return NotImplemented
def get_energy(self, composition, strict=True):
"""
Calculates the energy of a composition.
Args:
composition (Composition): input composition
strict (bool): Whether all potentials must be specified
"""
if strict and set(composition.keys()) > set(self.keys()):
s = set(composition.keys()) - set(self.keys())
raise ValueError("Potentials not specified for {}".format(s))
return sum(self.get(k, 0) * v for k, v in composition.items())
def __repr__(self):
return "ChemPots: " + super(ChemicalPotential, self).__repr__()
if __name__ == "__main__":
import doctest
doctest.testmod()
|
mit
|
[
3,
2803,
26,
2774,
13,
24,
199,
3,
1898,
334,
67,
9,
1611,
30649,
15290,
11682,
14,
199,
3,
17484,
1334,
314,
2895,
402,
314,
10697,
844,
14,
199,
199,
504,
636,
2443,
363,
492,
4629,
12,
2649,
63,
5955,
199,
199,
646,
5055,
199,
646,
5579,
199,
646,
1059,
199,
504,
7975,
492,
15821,
63,
1045,
63,
15895,
12,
3336,
199,
199,
646,
747,
199,
646,
3816,
199,
646,
295,
199,
199,
504,
5055,
492,
10018,
199,
199,
504,
3485,
369,
14,
12161,
492,
2248,
2324,
199,
504,
3816,
14,
4912,
492,
2457,
12,
2341,
12,
3482,
199,
199,
504,
9143,
492,
3141,
63,
7128,
199,
199,
504,
3485,
369,
14,
21844,
2452,
492,
486,
2866,
12,
486,
2866,
63,
1609,
199,
504,
1134,
30649,
14,
1018,
14,
20339,
63,
1224,
492,
664,
63,
352,
63,
681,
12,
6566,
12,
5367,
69,
199,
504,
1134,
30649,
14,
1974,
14,
875,
492,
15723,
63,
3157,
63,
908,
199,
504,
3485,
369,
14,
1001,
492,
603,
3377,
461,
199,
504,
1134,
30649,
14,
1018,
14,
5260,
492,
625,
5277,
7068,
421,
199,
624,
199,
2765,
859,
9031,
282,
27506,
1588,
1021,
370,
2954,
11395,
6150,
12,
199,
460,
282,
445,
27037,
2652,
1575,
9443,
1021,
370,
2954,
12330,
83,
14,
199,
624,
199,
199,
363,
2502,
363,
275,
298,
2662,
89,
310,
510,
316,
593,
2753,
2,
199,
363,
7307,
363,
275,
298,
7384,
7760,
12,
710,
26570,
83,
7290,
2,
199,
363,
1023,
363,
275,
298,
16,
14,
17,
2,
199,
363,
26665,
363,
275,
298,
2662,
89,
310,
510,
316,
593,
2753,
2,
199,
363,
2123,
363,
275,
298,
609,
89,
310,
80,
32,
6799,
14,
957,
2,
199,
363,
1205,
363,
275,
298,
26432,
2,
199,
363,
602,
363,
275,
298,
1944,
86,
1616,
12,
6029,
2,
421,
199,
32,
2923,
63,
7128,
199,
533,
27506,
1588,
8,
7882,
14,
3476,
461,
12,
5055,
14,
7674,
12,
603,
3377,
461,
304,
272,
408,
272,
21591,
282,
27506,
1588,
12,
1314,
365,
28891,
282,
469,
2108,
26,
4606,
93,
4412,
272,
730,
14,
27506,
1588,
365,
5313,
370,
506,
17092,
436,
21197,
12,
272,
29750,
282,
4465,
2018,
1211,
14,
339,
3390,
626,
314,
790,
883,
506,
1902,
376,
6566,
503,
282,
5367,
69,
14,
6566,
83,
436,
5367,
69,
272,
787,
10184,
23142,
14,
284,
14,
69,
2020,
282,
7949,
18,
11,
365,
440,
314,
2011,
465,
282,
7949,
19,
11,
5367,
69,
436,
272,
3955,
506,
5324,
315,
7396,
2883,
14,
961,
26796,
425,
365,
9122,
605,
323,
370,
272,
2291,
1808,
27506,
1588,
370,
6705,
314,
12347,
402,
282,
6770,
5367,
69,
14,
339,
28099,
18871,
14793,
2839,
282,
4465,
2366,
2600,
12,
871,
626,
272,
636,
6095,
363,
365,
10087,
370,
372,
378,
1380,
376,
1819,
365,
440,
1911,
14,
272,
334,
3972,
10058,
2839,
282,
10018,
12,
871,
652,
365,
17092,
680,
339,
6121,
9584,
1655,
16777,
3102,
12082,
370,
11395,
6150,
12,
325,
14,
71,
2020,
272,
664,
63,
13054,
14,
339,
2779,
1077,
2597,
506,
949,
471,
626,
5002,
27506,
1588,
4048,
9330,
6181,
272,
315,
282,
4465,
1059,
465,
282,
22700,
1324,
14,
2104,
2893,
12,
272,
2755,
10617,
314,
5007,
6025,
402,
282,
7949,
18,
47,
19,
31586,
365,
272,
469,
2162,
480,
3456,
2349,
499,
12,
6566,
480,
47,
2349,
650,
1386,
1265,
883,
3332,
314,
5982,
402,
7949,
272,
9329,
701,
1013,
905,
3456,
937,
3140,
402,
314,
1655,
3376,
1013,
59,
2162,
480,
3456,
531,
1055,
339,
1306,
1013,
275,
27506,
1588,
480,
13009,
3456,
1512,
20,
531,
272,
1306,
1013,
14,
362,
63,
10910,
63,
13054,
8,
2162,
480,
13009,
2237,
272,
378,
14,
1079,
31269,
1079,
31269,
1079,
14523,
272,
1306,
1013,
14,
1507,
63,
11521,
272,
1520,
14,
16,
272,
1306,
1013,
14,
19523,
63,
16798,
272,
283,
13009,
3456,
1512,
20,
7,
272,
1306,
1013,
14,
16798,
272,
283,
13009,
17,
7949,
17,
510,
17,
593,
20,
7,
272,
1306,
1013,
14,
362,
63,
9115,
63,
13054,
8,
2162,
480,
13009,
2237,
272,
378,
14,
5882,
1020,
21618,
1272,
20017,
1085,
2905,
272,
1306,
1013,
14,
1507,
63,
11521,
272,
1520,
14,
16,
272,
408,
339,
408,
272,
4005,
8807,
315,
22237,
316,
3365,
31586,
32247,
14,
272,
413,
69,
13,
24,
365,
28092,
590,
3367,
913,
12,
1325,
1077,
10415,
734,
4750,
8402,
2376,
24166,
272,
2552,
14,
272,
408,
272,
5982,
63,
16312,
275,
413,
69,
13,
24,
339,
408,
272,
12568,
15723,
7252,
367,
1126,
19131,
2655,
83,
436,
9842,
4008,
14,
961,
365,
880,
272,
626,
15723,
1072,
1630,
440,
2218,
24157,
47,
3140,
402,
24157,
18,
47,
18,
367,
2893,
14,
272,
408,
272,
4539,
63,
964,
32646,
275,
2420,
13009,
47,
582,
298,
13009,
18,
47,
18,
401,
298,
8565,
47,
582,
298,
8565,
18,
47,
18,
401,
298,
24839,
582,
298,
43,
18,
47,
18,
401,
717,
298,
2979,
582,
298,
40,
18,
47,
18,
401,
298,
13912,
47,
582,
298,
13912,
18,
47,
18,
401,
298,
50,
66,
47,
582,
298,
50,
66,
18,
47,
18,
401,
717,
298,
47,
582,
298,
47,
18,
401,
221,
298,
46,
582,
298,
46,
18,
401,
298,
38,
582,
298,
38,
18,
401,
298,
1968,
582,
298,
1968,
18,
401,
717,
298,
40,
582,
298,
40,
18,
3570,
339,
312,
6865,
63,
6101,
275,
488,
221,
327,
6791,
12224,
402,
312,
21352,
425,
1202,
701,
312,
6865,
63,
929,
63,
71,
10138,
874,
339,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
221,
327,
2040,
63,
7371,
29,
797,
267,
408,
267,
812,
994,
26841,
27506,
1588,
14538,
12,
8545,
370,
314,
6137,
13,
262,
2018,
267,
1211,
1252,
6121,
9243,
370,
2040,
3486,
1059,
4205,
14,
398,
3033,
26,
288,
6184,
1824,
3748,
701,
314,
2018,
6137,
13,
262,
1211,
342,
805,
14,
953,
413,
14,
437,
1211,
402,
1902,
469,
2162,
15,
6154,
69,
26,
5982,
1386,
199,
2049,
469,
875,
5272,
26,
4606,
1386,
503,
469,
10910,
1329,
26,
4606,
93,
503,
1263,
31885,
2049,
402,
3520,
14,
662,
14,
71,
2020,
469,
2162,
480,
13009,
2349,
18,
2360,
2162,
480,
47,
2349,
17,
1386
] |
[
2803,
26,
2774,
13,
24,
199,
3,
1898,
334,
67,
9,
1611,
30649,
15290,
11682,
14,
199,
3,
17484,
1334,
314,
2895,
402,
314,
10697,
844,
14,
199,
199,
504,
636,
2443,
363,
492,
4629,
12,
2649,
63,
5955,
199,
199,
646,
5055,
199,
646,
5579,
199,
646,
1059,
199,
504,
7975,
492,
15821,
63,
1045,
63,
15895,
12,
3336,
199,
199,
646,
747,
199,
646,
3816,
199,
646,
295,
199,
199,
504,
5055,
492,
10018,
199,
199,
504,
3485,
369,
14,
12161,
492,
2248,
2324,
199,
504,
3816,
14,
4912,
492,
2457,
12,
2341,
12,
3482,
199,
199,
504,
9143,
492,
3141,
63,
7128,
199,
199,
504,
3485,
369,
14,
21844,
2452,
492,
486,
2866,
12,
486,
2866,
63,
1609,
199,
504,
1134,
30649,
14,
1018,
14,
20339,
63,
1224,
492,
664,
63,
352,
63,
681,
12,
6566,
12,
5367,
69,
199,
504,
1134,
30649,
14,
1974,
14,
875,
492,
15723,
63,
3157,
63,
908,
199,
504,
3485,
369,
14,
1001,
492,
603,
3377,
461,
199,
504,
1134,
30649,
14,
1018,
14,
5260,
492,
625,
5277,
7068,
421,
199,
624,
199,
2765,
859,
9031,
282,
27506,
1588,
1021,
370,
2954,
11395,
6150,
12,
199,
460,
282,
445,
27037,
2652,
1575,
9443,
1021,
370,
2954,
12330,
83,
14,
199,
624,
199,
199,
363,
2502,
363,
275,
298,
2662,
89,
310,
510,
316,
593,
2753,
2,
199,
363,
7307,
363,
275,
298,
7384,
7760,
12,
710,
26570,
83,
7290,
2,
199,
363,
1023,
363,
275,
298,
16,
14,
17,
2,
199,
363,
26665,
363,
275,
298,
2662,
89,
310,
510,
316,
593,
2753,
2,
199,
363,
2123,
363,
275,
298,
609,
89,
310,
80,
32,
6799,
14,
957,
2,
199,
363,
1205,
363,
275,
298,
26432,
2,
199,
363,
602,
363,
275,
298,
1944,
86,
1616,
12,
6029,
2,
421,
199,
32,
2923,
63,
7128,
199,
533,
27506,
1588,
8,
7882,
14,
3476,
461,
12,
5055,
14,
7674,
12,
603,
3377,
461,
304,
272,
408,
272,
21591,
282,
27506,
1588,
12,
1314,
365,
28891,
282,
469,
2108,
26,
4606,
93,
4412,
272,
730,
14,
27506,
1588,
365,
5313,
370,
506,
17092,
436,
21197,
12,
272,
29750,
282,
4465,
2018,
1211,
14,
339,
3390,
626,
314,
790,
883,
506,
1902,
376,
6566,
503,
282,
5367,
69,
14,
6566,
83,
436,
5367,
69,
272,
787,
10184,
23142,
14,
284,
14,
69,
2020,
282,
7949,
18,
11,
365,
440,
314,
2011,
465,
282,
7949,
19,
11,
5367,
69,
436,
272,
3955,
506,
5324,
315,
7396,
2883,
14,
961,
26796,
425,
365,
9122,
605,
323,
370,
272,
2291,
1808,
27506,
1588,
370,
6705,
314,
12347,
402,
282,
6770,
5367,
69,
14,
339,
28099,
18871,
14793,
2839,
282,
4465,
2366,
2600,
12,
871,
626,
272,
636,
6095,
363,
365,
10087,
370,
372,
378,
1380,
376,
1819,
365,
440,
1911,
14,
272,
334,
3972,
10058,
2839,
282,
10018,
12,
871,
652,
365,
17092,
680,
339,
6121,
9584,
1655,
16777,
3102,
12082,
370,
11395,
6150,
12,
325,
14,
71,
2020,
272,
664,
63,
13054,
14,
339,
2779,
1077,
2597,
506,
949,
471,
626,
5002,
27506,
1588,
4048,
9330,
6181,
272,
315,
282,
4465,
1059,
465,
282,
22700,
1324,
14,
2104,
2893,
12,
272,
2755,
10617,
314,
5007,
6025,
402,
282,
7949,
18,
47,
19,
31586,
365,
272,
469,
2162,
480,
3456,
2349,
499,
12,
6566,
480,
47,
2349,
650,
1386,
1265,
883,
3332,
314,
5982,
402,
7949,
272,
9329,
701,
1013,
905,
3456,
937,
3140,
402,
314,
1655,
3376,
1013,
59,
2162,
480,
3456,
531,
1055,
339,
1306,
1013,
275,
27506,
1588,
480,
13009,
3456,
1512,
20,
531,
272,
1306,
1013,
14,
362,
63,
10910,
63,
13054,
8,
2162,
480,
13009,
2237,
272,
378,
14,
1079,
31269,
1079,
31269,
1079,
14523,
272,
1306,
1013,
14,
1507,
63,
11521,
272,
1520,
14,
16,
272,
1306,
1013,
14,
19523,
63,
16798,
272,
283,
13009,
3456,
1512,
20,
7,
272,
1306,
1013,
14,
16798,
272,
283,
13009,
17,
7949,
17,
510,
17,
593,
20,
7,
272,
1306,
1013,
14,
362,
63,
9115,
63,
13054,
8,
2162,
480,
13009,
2237,
272,
378,
14,
5882,
1020,
21618,
1272,
20017,
1085,
2905,
272,
1306,
1013,
14,
1507,
63,
11521,
272,
1520,
14,
16,
272,
408,
339,
408,
272,
4005,
8807,
315,
22237,
316,
3365,
31586,
32247,
14,
272,
413,
69,
13,
24,
365,
28092,
590,
3367,
913,
12,
1325,
1077,
10415,
734,
4750,
8402,
2376,
24166,
272,
2552,
14,
272,
408,
272,
5982,
63,
16312,
275,
413,
69,
13,
24,
339,
408,
272,
12568,
15723,
7252,
367,
1126,
19131,
2655,
83,
436,
9842,
4008,
14,
961,
365,
880,
272,
626,
15723,
1072,
1630,
440,
2218,
24157,
47,
3140,
402,
24157,
18,
47,
18,
367,
2893,
14,
272,
408,
272,
4539,
63,
964,
32646,
275,
2420,
13009,
47,
582,
298,
13009,
18,
47,
18,
401,
298,
8565,
47,
582,
298,
8565,
18,
47,
18,
401,
298,
24839,
582,
298,
43,
18,
47,
18,
401,
717,
298,
2979,
582,
298,
40,
18,
47,
18,
401,
298,
13912,
47,
582,
298,
13912,
18,
47,
18,
401,
298,
50,
66,
47,
582,
298,
50,
66,
18,
47,
18,
401,
717,
298,
47,
582,
298,
47,
18,
401,
221,
298,
46,
582,
298,
46,
18,
401,
298,
38,
582,
298,
38,
18,
401,
298,
1968,
582,
298,
1968,
18,
401,
717,
298,
40,
582,
298,
40,
18,
3570,
339,
312,
6865,
63,
6101,
275,
488,
221,
327,
6791,
12224,
402,
312,
21352,
425,
1202,
701,
312,
6865,
63,
929,
63,
71,
10138,
874,
339,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
221,
327,
2040,
63,
7371,
29,
797,
267,
408,
267,
812,
994,
26841,
27506,
1588,
14538,
12,
8545,
370,
314,
6137,
13,
262,
2018,
267,
1211,
1252,
6121,
9243,
370,
2040,
3486,
1059,
4205,
14,
398,
3033,
26,
288,
6184,
1824,
3748,
701,
314,
2018,
6137,
13,
262,
1211,
342,
805,
14,
953,
413,
14,
437,
1211,
402,
1902,
469,
2162,
15,
6154,
69,
26,
5982,
1386,
199,
2049,
469,
875,
5272,
26,
4606,
1386,
503,
469,
10910,
1329,
26,
4606,
93,
503,
1263,
31885,
2049,
402,
3520,
14,
662,
14,
71,
2020,
469,
2162,
480,
13009,
2349,
18,
2360,
2162,
480,
47,
2349,
17,
1386,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
redhat-cip/numeter
|
poller/numeter/poller/munin_connect.py
|
2
|
4093
|
#!/usr/bin/env python
import socket
import re
from logging import getLogger
class MuninSock(object):
'''Open and close a socket with munin-node socket. This class allow you
to use ``with`` statement (for python < 3).
::
with MuninSock(self.munin_host, self.munin_port) as sock:
...'''
def __init__(self, host, port):
''' * ``host`` : munin-node host
* ``port`` : munin-node port'''
self.host = host
self.port = port
def __enter__(self):
"Open socket with munin-node"
self.munin_sock = socket.create_connection((self.host, self.port))
_s = self.munin_sock.makefile()
hello_string = _s.readline().strip()
return self.munin_sock
def __exit__(self, type, value, traceback):
"Close socket with munin-node"
self.munin_sock.shutdown(socket.SHUT_RDWR)
self.munin_sock.close()
class MuninConnection(object):
'''Read lines from ``MuninSock``. Provide also basic munin-node commandes :
* Config
* Fetch
* List
* Nodes'''
def __init__(self, munin_host="127.0.0.1", munin_port=4949):
self.watchdog = 1000 # watchdog for munin socket error
self.munin_host = munin_host
self.munin_port = munin_port
self._logger = getLogger(__name__)
def _readline(self):
return self._s.readline().strip()
def _iterline(self):
watchdog = self.watchdog
while watchdog > 0:
watchdog = watchdog - 1
line = self._readline()
if not line:
break
elif line.startswith('#'):
continue
elif line == '.':
break
yield line
def munin_fetch(self, key):
with MuninSock(self.munin_host, self.munin_port) as sock:
self._s = sock.makefile()
sock.sendall("fetch %s\n" % key)
ret = {}
for line in self._iterline():
match = re.match("^(.+)\.value", line)
if match is None: continue
key = match.group(1)
match = re.match("^[^ ]+\s+([0-9\.U-]+)$", line)
if match is not None: value = match.group(1)
else: value = 'U'
ret[key] = value
return ret
def munin_list(self):
# Get node name
node = self.munin_nodes()
with MuninSock(self.munin_host, self.munin_port) as sock:
self._s = sock.makefile()
sock.sendall("list %s\n" % node)
return_list = self._readline().split(' ')
return [ plugin for plugin in return_list if plugin != '' ]
def munin_nodes(self):
with MuninSock(self.munin_host, self.munin_port) as sock:
self._s = sock.makefile()
sock.sendall("nodes\n")
return_node = [ line for line in self._iterline() ]
return return_node[0] if return_node else None
def munin_config(self, key):
with MuninSock(self.munin_host, self.munin_port) as sock:
self._s = sock.makefile()
sock.sendall("config %s\n" % key)
ret = {}
for line in self._iterline():
if line.startswith('graph_'):
try:
key, value = line.split(' ', 1)
ret[key] = value
except ValueError:
self._logger.info("MuninModule : skipped key %s" % key)
else:
# less sure but faster
#key, rest = line.split('.', 1)
#prop, value = rest.split(' ', 1)
match = re.match("^([^\.]+)\.([^\ ]+)\s+(.+)", line)
if match is None: continue
key = match.group(1)
prop = match.group(2)
value = match.group(3)
if not ret.get(key):
ret[key] = {}
ret[key][prop] = value
return ret
|
agpl-3.0
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
199,
646,
2838,
199,
646,
295,
199,
504,
2050,
492,
28138,
199,
199,
533,
603,
324,
262,
51,
766,
8,
785,
304,
272,
1449,
4299,
436,
4002,
282,
2838,
543,
333,
324,
262,
13,
932,
2838,
14,
961,
1021,
2040,
1265,
2126,
370,
675,
1124,
1045,
1040,
5164,
334,
509,
2366,
665,
650,
680,
10817,
3800,
8592,
543,
603,
324,
262,
51,
766,
8,
277,
14,
32368,
262,
63,
1102,
12,
291,
14,
32368,
262,
63,
719,
9,
465,
6771,
26,
288,
2263,
2344,
339,
347,
636,
826,
721,
277,
12,
1591,
12,
1844,
304,
267,
1449,
627,
1124,
1102,
1040,
520,
333,
324,
262,
13,
932,
1591,
288,
627,
1124,
719,
1040,
520,
333,
324,
262,
13,
932,
1844,
2344,
267,
291,
14,
1102,
275,
1591,
267,
291,
14,
719,
275,
1844,
339,
347,
636,
4200,
721,
277,
304,
267,
298,
4299,
2838,
543,
333,
324,
262,
13,
932,
2,
267,
291,
14,
32368,
262,
63,
5096,
275,
2838,
14,
981,
63,
2105,
1332,
277,
14,
1102,
12,
291,
14,
719,
430,
267,
485,
83,
275,
291,
14,
32368,
262,
63,
5096,
14,
13941,
342,
267,
16509,
63,
875,
275,
485,
83,
14,
6407,
1252,
1913,
342,
267,
372,
291,
14,
32368,
262,
63,
5096,
339,
347,
636,
2224,
721,
277,
12,
730,
12,
574,
12,
5190,
304,
267,
298,
4724,
2838,
543,
333,
324,
262,
13,
932,
2,
267,
291,
14,
32368,
262,
63,
5096,
14,
8831,
8,
3450,
14,
24340,
63,
15543,
6524,
9,
267,
291,
14,
32368,
262,
63,
5096,
14,
1600,
342,
421,
199,
533,
603,
324,
262,
3225,
8,
785,
304,
272,
1449,
3284,
2385,
687,
1124,
45,
324,
262,
51,
766,
4345,
22896,
2597,
5678,
333,
324,
262,
13,
932,
1923,
290,
3424,
520,
10817,
627,
4094,
2126,
627,
16347,
2126,
627,
3820,
2126,
627,
23836,
2344,
339,
347,
636,
826,
721,
277,
12,
333,
324,
262,
63,
1102,
628,
4195,
14,
16,
14,
16,
14,
17,
401,
333,
324,
262,
63,
719,
29,
1887,
1887,
304,
267,
291,
14,
6821,
13889,
275,
5198,
327,
9626,
13889,
367,
333,
324,
262,
2838,
1125,
267,
291,
14,
32368,
262,
63,
1102,
275,
333,
324,
262,
63,
1102,
267,
291,
14,
32368,
262,
63,
719,
275,
333,
324,
262,
63,
719,
267,
291,
423,
2921,
275,
28138,
3460,
354,
3368,
339,
347,
485,
6407,
8,
277,
304,
267,
372,
291,
423,
83,
14,
6407,
1252,
1913,
342,
339,
347,
485,
1661,
604,
8,
277,
304,
267,
9626,
13889,
275,
291,
14,
6821,
13889,
267,
1830,
9626,
13889,
690,
378,
26,
288,
9626,
13889,
275,
9626,
13889,
446,
413,
288,
1004,
275,
291,
423,
6407,
342,
288,
340,
440,
1004,
26,
355,
2059,
288,
916,
1004,
14,
2460,
7863,
735,
355,
1980,
288,
916,
1004,
508,
26351,
355,
2059,
288,
1995,
1004,
339,
347,
333,
324,
262,
63,
3535,
8,
277,
12,
790,
304,
267,
543,
603,
324,
262,
51,
766,
8,
277,
14,
32368,
262,
63,
1102,
12,
291,
14,
32368,
262,
63,
719,
9,
465,
6771,
26,
288,
291,
423,
83,
275,
6771,
14,
13941,
342,
288,
6771,
14,
22695,
480,
3535,
450,
83,
60,
78,
2,
450,
790,
9,
288,
2203,
275,
1052,
288,
367,
1004,
315,
291,
423,
1661,
604,
837,
355,
1336,
275,
295,
14,
1431,
18523,
8,
6977,
31477,
585,
401,
1004,
9,
355,
340,
1336,
365,
488,
26,
1980,
355,
790,
275,
1336,
14,
923,
8,
17,
9,
355,
1336,
275,
295,
14,
1431,
18523,
4735,
1622,
7896,
83,
11,
779,
16,
13,
25,
4537,
53,
13,
11896,
11918,
1004,
9,
355,
340,
1336,
365,
440,
488,
26,
574,
275,
1336,
14,
923,
8,
17,
9,
355,
587,
26,
574,
275,
283,
53,
7,
355,
2203,
59,
498,
61,
275,
574,
267,
372,
2203,
339,
347,
333,
324,
262,
63,
513,
8,
277,
304,
267,
327,
2372,
1031,
536,
267,
1031,
275,
291,
14,
32368,
262,
63,
2415,
342,
267,
543,
603,
324,
262,
51,
766,
8,
277,
14,
32368,
262,
63,
1102,
12,
291,
14,
32368,
262,
63,
719,
9,
465,
6771,
26,
288,
291,
423,
83,
275,
6771,
14,
13941,
342,
288,
6771,
14,
22695,
480,
513,
450,
83,
60,
78,
2,
450,
1031,
9,
288,
372,
63,
513,
275,
291,
423,
6407,
1252,
1294,
360,
5320,
267,
372,
359,
3589,
367,
3589,
315,
372,
63,
513,
340,
3589,
1137,
2125,
1622,
339,
347,
333,
324,
262,
63,
2415,
8,
277,
304,
267,
543,
603,
324,
262,
51,
766,
8,
277,
14,
32368,
262,
63,
1102,
12,
291,
14,
32368,
262,
63,
719,
9,
465,
6771,
26,
288,
291,
423,
83,
275,
6771,
14,
13941,
342,
288,
6771,
14,
22695,
480,
2415,
60,
78,
531,
288,
372,
63,
932,
275,
359,
1004,
367,
1004,
315,
291,
423,
1661,
604,
342,
1622,
267,
372,
372,
63,
932,
59,
16,
61,
340,
372,
63,
932,
587,
488,
339,
347,
333,
324,
262,
63,
888,
8,
277,
12,
790,
304,
267,
543,
603,
324,
262,
51,
766,
8,
277,
14,
32368,
262,
63,
1102,
12,
291,
14,
32368,
262,
63,
719,
9,
465,
6771,
26,
288,
291,
423,
83,
275,
6771,
14,
13941,
342,
288,
6771,
14,
22695,
480,
888,
450,
83,
60,
78,
2,
450,
790,
9,
288,
2203,
275,
1052,
288,
367,
1004,
315,
291,
423,
1661,
604,
837,
355,
340,
1004,
14,
2460,
360,
2180,
25865,
490,
862,
26,
717,
790,
12,
574,
275,
1004,
14,
1294,
360,
1656,
413,
9,
717,
2203,
59,
498,
61,
275,
574,
490,
871,
1722,
26,
717,
291,
423,
2921,
14,
815,
480,
45,
324,
262,
2377,
520,
9645,
790,
450,
83,
2,
450,
790,
9,
355,
587,
26,
490,
327,
6656,
3238,
1325,
12930,
490,
327,
498,
12,
4618,
275,
1004,
14,
1294,
14078,
413,
9,
490,
327,
4469,
12,
574,
275,
4618,
14,
1294,
360,
1656,
413,
9,
490,
1336,
275,
295,
14,
1431,
18523,
7059,
4537,
18096,
14,
21690,
1622,
13439,
83,
15622,
6977,
4186,
1004,
9,
490,
340,
1336,
365,
488,
26,
1980,
490,
790,
257,
275,
1336,
14,
923,
8,
17,
9,
490,
5931,
221,
275,
1336,
14,
923,
8,
18,
9
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
199,
646,
2838,
199,
646,
295,
199,
504,
2050,
492,
28138,
199,
199,
533,
603,
324,
262,
51,
766,
8,
785,
304,
272,
1449,
4299,
436,
4002,
282,
2838,
543,
333,
324,
262,
13,
932,
2838,
14,
961,
1021,
2040,
1265,
2126,
370,
675,
1124,
1045,
1040,
5164,
334,
509,
2366,
665,
650,
680,
10817,
3800,
8592,
543,
603,
324,
262,
51,
766,
8,
277,
14,
32368,
262,
63,
1102,
12,
291,
14,
32368,
262,
63,
719,
9,
465,
6771,
26,
288,
2263,
2344,
339,
347,
636,
826,
721,
277,
12,
1591,
12,
1844,
304,
267,
1449,
627,
1124,
1102,
1040,
520,
333,
324,
262,
13,
932,
1591,
288,
627,
1124,
719,
1040,
520,
333,
324,
262,
13,
932,
1844,
2344,
267,
291,
14,
1102,
275,
1591,
267,
291,
14,
719,
275,
1844,
339,
347,
636,
4200,
721,
277,
304,
267,
298,
4299,
2838,
543,
333,
324,
262,
13,
932,
2,
267,
291,
14,
32368,
262,
63,
5096,
275,
2838,
14,
981,
63,
2105,
1332,
277,
14,
1102,
12,
291,
14,
719,
430,
267,
485,
83,
275,
291,
14,
32368,
262,
63,
5096,
14,
13941,
342,
267,
16509,
63,
875,
275,
485,
83,
14,
6407,
1252,
1913,
342,
267,
372,
291,
14,
32368,
262,
63,
5096,
339,
347,
636,
2224,
721,
277,
12,
730,
12,
574,
12,
5190,
304,
267,
298,
4724,
2838,
543,
333,
324,
262,
13,
932,
2,
267,
291,
14,
32368,
262,
63,
5096,
14,
8831,
8,
3450,
14,
24340,
63,
15543,
6524,
9,
267,
291,
14,
32368,
262,
63,
5096,
14,
1600,
342,
421,
199,
533,
603,
324,
262,
3225,
8,
785,
304,
272,
1449,
3284,
2385,
687,
1124,
45,
324,
262,
51,
766,
4345,
22896,
2597,
5678,
333,
324,
262,
13,
932,
1923,
290,
3424,
520,
10817,
627,
4094,
2126,
627,
16347,
2126,
627,
3820,
2126,
627,
23836,
2344,
339,
347,
636,
826,
721,
277,
12,
333,
324,
262,
63,
1102,
628,
4195,
14,
16,
14,
16,
14,
17,
401,
333,
324,
262,
63,
719,
29,
1887,
1887,
304,
267,
291,
14,
6821,
13889,
275,
5198,
327,
9626,
13889,
367,
333,
324,
262,
2838,
1125,
267,
291,
14,
32368,
262,
63,
1102,
275,
333,
324,
262,
63,
1102,
267,
291,
14,
32368,
262,
63,
719,
275,
333,
324,
262,
63,
719,
267,
291,
423,
2921,
275,
28138,
3460,
354,
3368,
339,
347,
485,
6407,
8,
277,
304,
267,
372,
291,
423,
83,
14,
6407,
1252,
1913,
342,
339,
347,
485,
1661,
604,
8,
277,
304,
267,
9626,
13889,
275,
291,
14,
6821,
13889,
267,
1830,
9626,
13889,
690,
378,
26,
288,
9626,
13889,
275,
9626,
13889,
446,
413,
288,
1004,
275,
291,
423,
6407,
342,
288,
340,
440,
1004,
26,
355,
2059,
288,
916,
1004,
14,
2460,
7863,
735,
355,
1980,
288,
916,
1004,
508,
26351,
355,
2059,
288,
1995,
1004,
339,
347,
333,
324,
262,
63,
3535,
8,
277,
12,
790,
304,
267,
543,
603,
324,
262,
51,
766,
8,
277,
14,
32368,
262,
63,
1102,
12,
291,
14,
32368,
262,
63,
719,
9,
465,
6771,
26,
288,
291,
423,
83,
275,
6771,
14,
13941,
342,
288,
6771,
14,
22695,
480,
3535,
450,
83,
60,
78,
2,
450,
790,
9,
288,
2203,
275,
1052,
288,
367,
1004,
315,
291,
423,
1661,
604,
837,
355,
1336,
275,
295,
14,
1431,
18523,
8,
6977,
31477,
585,
401,
1004,
9,
355,
340,
1336,
365,
488,
26,
1980,
355,
790,
275,
1336,
14,
923,
8,
17,
9,
355,
1336,
275,
295,
14,
1431,
18523,
4735,
1622,
7896,
83,
11,
779,
16,
13,
25,
4537,
53,
13,
11896,
11918,
1004,
9,
355,
340,
1336,
365,
440,
488,
26,
574,
275,
1336,
14,
923,
8,
17,
9,
355,
587,
26,
574,
275,
283,
53,
7,
355,
2203,
59,
498,
61,
275,
574,
267,
372,
2203,
339,
347,
333,
324,
262,
63,
513,
8,
277,
304,
267,
327,
2372,
1031,
536,
267,
1031,
275,
291,
14,
32368,
262,
63,
2415,
342,
267,
543,
603,
324,
262,
51,
766,
8,
277,
14,
32368,
262,
63,
1102,
12,
291,
14,
32368,
262,
63,
719,
9,
465,
6771,
26,
288,
291,
423,
83,
275,
6771,
14,
13941,
342,
288,
6771,
14,
22695,
480,
513,
450,
83,
60,
78,
2,
450,
1031,
9,
288,
372,
63,
513,
275,
291,
423,
6407,
1252,
1294,
360,
5320,
267,
372,
359,
3589,
367,
3589,
315,
372,
63,
513,
340,
3589,
1137,
2125,
1622,
339,
347,
333,
324,
262,
63,
2415,
8,
277,
304,
267,
543,
603,
324,
262,
51,
766,
8,
277,
14,
32368,
262,
63,
1102,
12,
291,
14,
32368,
262,
63,
719,
9,
465,
6771,
26,
288,
291,
423,
83,
275,
6771,
14,
13941,
342,
288,
6771,
14,
22695,
480,
2415,
60,
78,
531,
288,
372,
63,
932,
275,
359,
1004,
367,
1004,
315,
291,
423,
1661,
604,
342,
1622,
267,
372,
372,
63,
932,
59,
16,
61,
340,
372,
63,
932,
587,
488,
339,
347,
333,
324,
262,
63,
888,
8,
277,
12,
790,
304,
267,
543,
603,
324,
262,
51,
766,
8,
277,
14,
32368,
262,
63,
1102,
12,
291,
14,
32368,
262,
63,
719,
9,
465,
6771,
26,
288,
291,
423,
83,
275,
6771,
14,
13941,
342,
288,
6771,
14,
22695,
480,
888,
450,
83,
60,
78,
2,
450,
790,
9,
288,
2203,
275,
1052,
288,
367,
1004,
315,
291,
423,
1661,
604,
837,
355,
340,
1004,
14,
2460,
360,
2180,
25865,
490,
862,
26,
717,
790,
12,
574,
275,
1004,
14,
1294,
360,
1656,
413,
9,
717,
2203,
59,
498,
61,
275,
574,
490,
871,
1722,
26,
717,
291,
423,
2921,
14,
815,
480,
45,
324,
262,
2377,
520,
9645,
790,
450,
83,
2,
450,
790,
9,
355,
587,
26,
490,
327,
6656,
3238,
1325,
12930,
490,
327,
498,
12,
4618,
275,
1004,
14,
1294,
14078,
413,
9,
490,
327,
4469,
12,
574,
275,
4618,
14,
1294,
360,
1656,
413,
9,
490,
1336,
275,
295,
14,
1431,
18523,
7059,
4537,
18096,
14,
21690,
1622,
13439,
83,
15622,
6977,
4186,
1004,
9,
490,
340,
1336,
365,
488,
26,
1980,
490,
790,
257,
275,
1336,
14,
923,
8,
17,
9,
490,
5931,
221,
275,
1336,
14,
923,
8,
18,
9,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
qilicun/python
|
python2/PyMOTW-1.132/PyMOTW/shlex/shlex_split.py
|
1
|
1272
|
#!/usr/bin/env python
#
# Copyright 2007 Doug Hellmann.
#
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of Doug
# Hellmann not be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior
# permission.
#
# DOUG HELLMANN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
# NO EVENT SHALL DOUG HELLMANN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
"""Splitting strings with shlex.
"""
__version__ = "$Id$"
#end_pymotw_header
import shlex
text = """This text has "quoted parts" inside it."""
print 'ORIGINAL:', repr(text)
print
print 'TOKENS:'
print shlex.split(text)
|
gpl-3.0
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
3,
199,
3,
1898,
10219,
577,
810,
71,
869,
1697,
20059,
14,
199,
3,
199,
3,
199,
3,
12793,
2900,
5924,
5702,
199,
3,
199,
3,
8779,
370,
675,
12,
1331,
12,
2811,
12,
436,
11207,
642,
2032,
436,
199,
3,
2399,
3794,
367,
1263,
12016,
436,
1928,
14751,
365,
11882,
199,
3,
10009,
12,
2741,
626,
314,
3432,
4248,
4245,
7468,
315,
1006,
199,
3,
6866,
436,
626,
3865,
626,
4248,
4245,
436,
642,
4983,
199,
3,
4245,
7468,
315,
21038,
3794,
12,
436,
626,
314,
536,
402,
577,
810,
71,
199,
3,
869,
1697,
20059,
440,
506,
1202,
315,
19613,
1044,
503,
7974,
20976,
1126,
24522,
370,
199,
3,
4084,
402,
314,
2032,
1928,
2488,
12,
5313,
6791,
199,
3,
4983,
14,
199,
3,
199,
3,
3506,
10134,
869,
14952,
6588,
46,
8990,
51,
11727,
2990,
1663,
14142,
7816,
2296,
5749,
4141,
12,
199,
3,
6931,
11727,
5292,
2990,
1634,
3169,
2401,
3092,
12,
1621,
199,
3,
4825,
6461,
7000,
3506,
10134,
869,
14952,
6588,
46,
6262,
7024,
2381,
1821,
8820,
12,
9168,
1549,
199,
3,
9110,
6736,
1549,
1821,
6736,
28752,
4118,
27362,
20668,
1206,
4442,
9102,
199,
3,
1634,
4815,
12,
7126,
1549,
9206,
12,
7061,
1621,
1261,
9612,
1634,
7066,
12,
199,
3,
9254,
1549,
5010,
7056,
25657,
9612,
12,
7043,
5738,
1634,
1549,
1621,
199,
3,
11287,
1663,
2334,
4815,
1549,
13873,
30340,
1634,
5749,
4141,
14,
199,
3,
199,
199,
624,
8862,
1337,
3326,
543,
16701,
14,
199,
199,
624,
199,
199,
363,
1023,
363,
275,
7880,
1304,
17351,
199,
3,
500,
63,
647,
30034,
87,
63,
1291,
199,
199,
646,
16701,
199,
199,
505,
275,
408,
2765,
1318,
965,
298,
9888,
4184,
2,
6272,
652,
1041,
199,
1361,
283,
20332,
13384,
6536,
4700,
8,
505,
9,
199,
1361,
199,
199,
1361,
283,
8803,
51,
4881,
199,
1361,
16701,
14,
1294,
8,
505,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
3,
199,
3,
1898,
10219,
577,
810,
71,
869,
1697,
20059,
14,
199,
3,
199,
3,
199,
3,
12793,
2900,
5924,
5702,
199,
3,
199,
3,
8779,
370,
675,
12,
1331,
12,
2811,
12,
436,
11207,
642,
2032,
436,
199,
3,
2399,
3794,
367,
1263,
12016,
436,
1928,
14751,
365,
11882,
199,
3,
10009,
12,
2741,
626,
314,
3432,
4248,
4245,
7468,
315,
1006,
199,
3,
6866,
436,
626,
3865,
626,
4248,
4245,
436,
642,
4983,
199,
3,
4245,
7468,
315,
21038,
3794,
12,
436,
626,
314,
536,
402,
577,
810,
71,
199,
3,
869,
1697,
20059,
440,
506,
1202,
315,
19613,
1044,
503,
7974,
20976,
1126,
24522,
370,
199,
3,
4084,
402,
314,
2032,
1928,
2488,
12,
5313,
6791,
199,
3,
4983,
14,
199,
3,
199,
3,
3506,
10134,
869,
14952,
6588,
46,
8990,
51,
11727,
2990,
1663,
14142,
7816,
2296,
5749,
4141,
12,
199,
3,
6931,
11727,
5292,
2990,
1634,
3169,
2401,
3092,
12,
1621,
199,
3,
4825,
6461,
7000,
3506,
10134,
869,
14952,
6588,
46,
6262,
7024,
2381,
1821,
8820,
12,
9168,
1549,
199,
3,
9110,
6736,
1549,
1821,
6736,
28752,
4118,
27362,
20668,
1206,
4442,
9102,
199,
3,
1634,
4815,
12,
7126,
1549,
9206,
12,
7061,
1621,
1261,
9612,
1634,
7066,
12,
199,
3,
9254,
1549,
5010,
7056,
25657,
9612,
12,
7043,
5738,
1634,
1549,
1621,
199,
3,
11287,
1663,
2334,
4815,
1549,
13873,
30340,
1634,
5749,
4141,
14,
199,
3,
199,
199,
624,
8862,
1337,
3326,
543,
16701,
14,
199,
199,
624,
199,
199,
363,
1023,
363,
275,
7880,
1304,
17351,
199,
3,
500,
63,
647,
30034,
87,
63,
1291,
199,
199,
646,
16701,
199,
199,
505,
275,
408,
2765,
1318,
965,
298,
9888,
4184,
2,
6272,
652,
1041,
199,
1361,
283,
20332,
13384,
6536,
4700,
8,
505,
9,
199,
1361,
199,
199,
1361,
283,
8803,
51,
4881,
199,
1361,
16701,
14,
1294,
8,
505,
9,
199,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768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