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
|
|---|---|---|---|---|---|---|---|---|
rhelmer/socorro
|
socorro/unittest/database/createSchema.py
|
11
|
2145
|
#! /usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# XXX Set to be deprecated in favor of socorro/external/postgresql/models.py
"""
Just set up the database and exit. Assume we can get config details from the test config file, but allow sys.argv to override
"""
import logging
import sys
import socorro.lib.ConfigurationManager as configurationManager
from socorro.unittest.testlib.testDB import TestDB
import dbTestconfig as testConfig
def help():
print """Usage: (python) createSchema.py [config-options] [--help]
First removes all the known socorro tables, then creates an instance of
the current socorro schema in an existing database. Does NOT drop tables
other than the ones known to this schema.
Default: use current unittest config for host, database, user and password.
--help: print this message and exit
config-options: You may pass any of the following:
[--]host=someHostName
[--]dbname=someDatabaseName
[--]user=someUserName
[--]password=somePassword
"""
def main():
logger = logging.getLogger("topcrashes_summary")
logger.setLevel(logging.WARNING)
stderrLog = logging.StreamHandler()
stderrLog.setLevel(logging.WARNING)
stderrLogFormatter = logging.Formatter('%(asctime)s %(levelname)s - %(message)s')
stderrLog.setFormatter(stderrLogFormatter)
logger.addHandler(stderrLog)
kwargs = {}
for i in sys.argv[1:]:
if i.startswith('-h') or i.startswith('--he'):
help()
sys.exit(0)
j = i
if i.startswith('-'):
j = i.lstrip('-')
if '=' in j:
name,value = (s.strip() for s in j.split('='))
kwargs[name] = value
else:
print >> sys.stderr,"Ignoring unkown argument '%s'"%(i)
sys.argv = sys.argv[:1]
config = configurationManager.newConfiguration(configurationModule = testConfig, applicationName='Create Database')
config.update(kwargs)
testDB = TestDB()
testDB.removeDB(config,logger)
testDB.createDB(config,logger)
if __name__ == '__main__':
main()
|
mpl-2.0
|
[
3168,
1182,
2647,
15,
1393,
15,
1813,
2366,
199,
3,
961,
5800,
5495,
8204,
365,
5420,
370,
314,
2895,
402,
314,
17728,
1684,
199,
3,
844,
12,
373,
14,
499,
14,
16,
14,
982,
282,
1331,
402,
314,
28481,
1990,
440,
1854,
543,
642,
199,
3,
570,
12,
2047,
883,
3332,
1373,
737,
1455,
921,
12102,
14,
1308,
15,
3950,
15,
18,
14,
16,
8083,
199,
199,
3,
5787,
2494,
370,
506,
5906,
315,
17914,
402,
308,
28720,
293,
15,
5159,
15,
15437,
15,
992,
14,
647,
199,
199,
624,
199,
22850,
663,
1536,
314,
3050,
436,
4458,
14,
16269,
781,
883,
664,
1101,
2436,
687,
314,
511,
1101,
570,
12,
1325,
2040,
984,
14,
3020,
370,
4278,
199,
624,
199,
646,
2050,
199,
646,
984,
199,
646,
308,
28720,
293,
14,
773,
14,
5688,
2988,
465,
2897,
2988,
199,
504,
308,
28720,
293,
14,
2796,
14,
396,
773,
14,
396,
2846,
492,
1379,
2846,
199,
646,
1592,
774,
888,
465,
511,
2028,
199,
199,
318,
1720,
837,
523,
870,
408,
7692,
26,
334,
1548,
9,
1218,
6700,
14,
647,
359,
888,
13,
1419,
61,
19344,
3437,
61,
199,
7147,
14185,
1006,
314,
6040,
308,
28720,
293,
6716,
12,
2066,
8491,
376,
1256,
402,
199,
1589,
1453,
308,
28720,
293,
4177,
315,
376,
3411,
3050,
14,
12078,
2845,
5978,
6716,
199,
1848,
2419,
314,
7869,
6040,
370,
642,
4177,
14,
199,
2698,
26,
675,
1453,
2882,
1101,
367,
1591,
12,
3050,
12,
922,
436,
2505,
14,
523,
1553,
3437,
26,
870,
642,
1245,
436,
4458,
523,
1101,
13,
1419,
26,
2047,
1443,
986,
1263,
402,
314,
2569,
26,
272,
19344,
61,
1102,
29,
3972,
4965,
985,
272,
19344,
61,
13238,
29,
3972,
7243,
985,
272,
19344,
61,
751,
29,
3972,
25108,
272,
19344,
61,
2060,
29,
3972,
6139,
523,
408,
199,
199,
318,
2446,
837,
523,
2512,
275,
2050,
14,
5572,
480,
2119,
1556,
9030,
63,
4705,
531,
523,
2512,
14,
13548,
8,
4806,
14,
9171,
9,
819,
4635,
2445,
275,
2050,
14,
22482,
342,
523,
4635,
2445,
14,
13548,
8,
4806,
14,
9171,
9,
523,
4635,
2445,
7772,
275,
2050,
14,
7772,
24713,
18331,
9,
83,
2818,
20056,
9,
83,
446,
2818,
1188,
9,
83,
358,
523,
4635,
2445,
14,
26076,
8,
3083,
2445,
7772,
9,
523,
2512,
14,
18826,
8,
3083,
2445,
9,
819,
2074,
275,
1052,
523,
367,
284,
315,
984,
14,
3020,
59,
17,
10688,
272,
340,
284,
14,
2460,
3654,
72,
358,
503,
284,
14,
2460,
4517,
426,
735,
489,
1720,
342,
489,
984,
14,
2224,
8,
16,
9,
272,
1335,
275,
284,
272,
340,
284,
14,
2460,
3654,
735,
489,
1335,
275,
284,
14,
10124,
21950,
272,
340,
14051,
315,
1335,
26,
489,
536,
12,
585,
275,
334,
83,
14,
1913,
342,
367,
308,
315,
1335,
14,
1294,
26800,
1333,
489,
2074,
59,
354,
61,
275,
574,
272,
587,
26,
489,
870,
4331,
984,
14,
3083,
4589,
32390,
625,
75,
944,
1423,
1543,
83,
4065,
2840,
73,
9,
523,
984,
14,
3020,
275,
984,
14,
3020,
1491,
17,
61,
523,
1101,
275,
2897,
2988,
14,
1222,
5688,
8,
4758,
2377,
275,
511,
2028,
12,
4223,
985,
534,
2499,
8692,
358,
523,
1101,
14,
873,
8,
958,
9,
523,
511,
2846,
275,
1379,
2846,
342,
523,
511,
2846,
14,
2168,
2846,
8,
888,
12,
2921,
9,
523,
511,
2846,
14,
981,
2846,
8,
888,
12,
2921,
9,
199,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
523,
2446,
342,
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
] |
[
1182,
2647,
15,
1393,
15,
1813,
2366,
199,
3,
961,
5800,
5495,
8204,
365,
5420,
370,
314,
2895,
402,
314,
17728,
1684,
199,
3,
844,
12,
373,
14,
499,
14,
16,
14,
982,
282,
1331,
402,
314,
28481,
1990,
440,
1854,
543,
642,
199,
3,
570,
12,
2047,
883,
3332,
1373,
737,
1455,
921,
12102,
14,
1308,
15,
3950,
15,
18,
14,
16,
8083,
199,
199,
3,
5787,
2494,
370,
506,
5906,
315,
17914,
402,
308,
28720,
293,
15,
5159,
15,
15437,
15,
992,
14,
647,
199,
199,
624,
199,
22850,
663,
1536,
314,
3050,
436,
4458,
14,
16269,
781,
883,
664,
1101,
2436,
687,
314,
511,
1101,
570,
12,
1325,
2040,
984,
14,
3020,
370,
4278,
199,
624,
199,
646,
2050,
199,
646,
984,
199,
646,
308,
28720,
293,
14,
773,
14,
5688,
2988,
465,
2897,
2988,
199,
504,
308,
28720,
293,
14,
2796,
14,
396,
773,
14,
396,
2846,
492,
1379,
2846,
199,
646,
1592,
774,
888,
465,
511,
2028,
199,
199,
318,
1720,
837,
523,
870,
408,
7692,
26,
334,
1548,
9,
1218,
6700,
14,
647,
359,
888,
13,
1419,
61,
19344,
3437,
61,
199,
7147,
14185,
1006,
314,
6040,
308,
28720,
293,
6716,
12,
2066,
8491,
376,
1256,
402,
199,
1589,
1453,
308,
28720,
293,
4177,
315,
376,
3411,
3050,
14,
12078,
2845,
5978,
6716,
199,
1848,
2419,
314,
7869,
6040,
370,
642,
4177,
14,
199,
2698,
26,
675,
1453,
2882,
1101,
367,
1591,
12,
3050,
12,
922,
436,
2505,
14,
523,
1553,
3437,
26,
870,
642,
1245,
436,
4458,
523,
1101,
13,
1419,
26,
2047,
1443,
986,
1263,
402,
314,
2569,
26,
272,
19344,
61,
1102,
29,
3972,
4965,
985,
272,
19344,
61,
13238,
29,
3972,
7243,
985,
272,
19344,
61,
751,
29,
3972,
25108,
272,
19344,
61,
2060,
29,
3972,
6139,
523,
408,
199,
199,
318,
2446,
837,
523,
2512,
275,
2050,
14,
5572,
480,
2119,
1556,
9030,
63,
4705,
531,
523,
2512,
14,
13548,
8,
4806,
14,
9171,
9,
819,
4635,
2445,
275,
2050,
14,
22482,
342,
523,
4635,
2445,
14,
13548,
8,
4806,
14,
9171,
9,
523,
4635,
2445,
7772,
275,
2050,
14,
7772,
24713,
18331,
9,
83,
2818,
20056,
9,
83,
446,
2818,
1188,
9,
83,
358,
523,
4635,
2445,
14,
26076,
8,
3083,
2445,
7772,
9,
523,
2512,
14,
18826,
8,
3083,
2445,
9,
819,
2074,
275,
1052,
523,
367,
284,
315,
984,
14,
3020,
59,
17,
10688,
272,
340,
284,
14,
2460,
3654,
72,
358,
503,
284,
14,
2460,
4517,
426,
735,
489,
1720,
342,
489,
984,
14,
2224,
8,
16,
9,
272,
1335,
275,
284,
272,
340,
284,
14,
2460,
3654,
735,
489,
1335,
275,
284,
14,
10124,
21950,
272,
340,
14051,
315,
1335,
26,
489,
536,
12,
585,
275,
334,
83,
14,
1913,
342,
367,
308,
315,
1335,
14,
1294,
26800,
1333,
489,
2074,
59,
354,
61,
275,
574,
272,
587,
26,
489,
870,
4331,
984,
14,
3083,
4589,
32390,
625,
75,
944,
1423,
1543,
83,
4065,
2840,
73,
9,
523,
984,
14,
3020,
275,
984,
14,
3020,
1491,
17,
61,
523,
1101,
275,
2897,
2988,
14,
1222,
5688,
8,
4758,
2377,
275,
511,
2028,
12,
4223,
985,
534,
2499,
8692,
358,
523,
1101,
14,
873,
8,
958,
9,
523,
511,
2846,
275,
1379,
2846,
342,
523,
511,
2846,
14,
2168,
2846,
8,
888,
12,
2921,
9,
523,
511,
2846,
14,
981,
2846,
8,
888,
12,
2921,
9,
199,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
523,
2446,
342,
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,
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,
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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
] |
toshywoshy/ansible
|
lib/ansible/modules/network/netconf/netconf_get.py
|
19
|
9775
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Ansible by Red Hat, inc
# 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': 'network'}
DOCUMENTATION = """
---
module: netconf_get
version_added: "2.6"
author:
- "Ganesh Nalawade (@ganeshrn)"
- "Sven Wisotzky (@wisotzky)"
short_description: Fetch configuration/state data from NETCONF enabled network devices.
description:
- NETCONF is a network management protocol developed and standardized by
the IETF. It is documented in RFC 6241.
- This module allows the user to fetch configuration and state data from NETCONF
enabled network devices.
extends_documentation_fragment: network_agnostic
options:
source:
description:
- This argument specifies the datastore from which configuration data should be fetched.
Valid values are I(running), I(candidate) and I(startup). If the C(source) value is not
set both configuration and state information are returned in response from running datastore.
choices: ['running', 'candidate', 'startup']
filter:
description:
- This argument specifies the XML string which acts as a filter to restrict the portions of
the data to be are retrieved from the remote device. If this option is not specified entire
configuration or state data is returned in result depending on the value of C(source)
option. The C(filter) value can be either XML string or XPath, if the filter is in
XPath format the NETCONF server running on remote host should support xpath capability
else it will result in an error.
display:
description:
- Encoding scheme to use when serializing output from the device. The option I(json) will
serialize the output as JSON data. If the option value is I(json) it requires jxmlease
to be installed on control node. The option I(pretty) is similar to received XML response
but is using human readable format (spaces, new lines). The option value I(xml) is similar
to received XML response but removes all XML namespaces.
choices: ['json', 'pretty', 'xml']
lock:
description:
- Instructs the module to explicitly lock the datastore specified as C(source). If no
I(source) is defined, the I(running) datastore will be locked. By setting the option
value I(always) is will explicitly lock the datastore mentioned in C(source) option.
By setting the option value I(never) it will not lock the C(source) datastore. The
value I(if-supported) allows better interworking with NETCONF servers, which do not
support the (un)lock operation for all supported datastores.
default: never
choices: ['never', 'always', 'if-supported']
requirements:
- ncclient (>=v0.5.2)
- jxmlease
notes:
- This module requires the NETCONF system service be enabled on
the remote device being managed.
- This module supports the use of connection=netconf
"""
EXAMPLES = """
- name: Get running configuration and state data
netconf_get:
- name: Get configuration and state data from startup datastore
netconf_get:
source: startup
- name: Get system configuration data from running datastore state (junos)
netconf_get:
source: running
filter: <configuration><system></system></configuration>
- name: Get configuration and state data in JSON format
netconf_get:
display: json
- name: get schema list using subtree w/ namespaces
netconf_get:
display: json
filter: <netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><schemas><schema/></schemas></netconf-state>
lock: never
- name: get schema list using xpath
netconf_get:
display: xml
filter: /netconf-state/schemas/schema
- name: get interface configuration with filter (iosxr)
netconf_get:
display: pretty
filter: <interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"></interface-configurations>
lock: if-supported
- name: Get system configuration data from running datastore state (junos)
netconf_get:
source: running
filter: <configuration><system></system></configuration>
lock: if-supported
- name: Get complete configuration data from running datastore (SROS)
netconf_get:
source: running
filter: <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf"/>
- name: Get complete state data (SROS)
netconf_get:
filter: <state xmlns="urn:nokia.com:sros:ns:yang:sr:state"/>
"""
RETURN = """
stdout:
description: The raw XML string containing configuration or state data
received from the underlying ncclient library.
returned: always apart from low-level errors (such as action plugin)
type: str
sample: '...'
stdout_lines:
description: The value of stdout split into a list
returned: always apart from low-level errors (such as action plugin)
type: list
sample: ['...', '...']
output:
description: Based on the value of display option will return either the set of
transformed XML to JSON format from the RPC response with type dict
or pretty XML string response (human-readable) or response with
namespace removed from XML string.
returned: when the display format is selected as JSON it is returned as dict type, if the
display format is xml or pretty pretty it is returned as a string apart from low-level
errors (such as action plugin).
type: complex
contains:
formatted_output:
- Contains formatted response received from remote host as per the value in display format.
"""
import sys
try:
from lxml.etree import tostring, fromstring, XMLSyntaxError
except ImportError:
from xml.etree.ElementTree import tostring, fromstring
if sys.version_info < (2, 7):
from xml.parsers.expat import ExpatError as XMLSyntaxError
else:
from xml.etree.ElementTree import ParseError as XMLSyntaxError
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.network.netconf.netconf import get_capabilities, get_config, get
from ansible.module_utils.network.common.netconf import remove_namespaces
from ansible.module_utils._text import to_text
try:
import jxmlease
HAS_JXMLEASE = True
except ImportError:
HAS_JXMLEASE = False
def get_filter_type(filter):
if not filter:
return None
else:
try:
fromstring(filter)
return 'subtree'
except XMLSyntaxError:
return 'xpath'
def main():
"""entry point for module execution
"""
argument_spec = dict(
source=dict(choices=['running', 'candidate', 'startup']),
filter=dict(),
display=dict(choices=['json', 'pretty', 'xml']),
lock=dict(default='never', choices=['never', 'always', 'if-supported'])
)
module = AnsibleModule(argument_spec=argument_spec,
supports_check_mode=True)
capabilities = get_capabilities(module)
operations = capabilities['device_operations']
source = module.params['source']
filter = module.params['filter']
filter_type = get_filter_type(filter)
lock = module.params['lock']
display = module.params['display']
if source == 'candidate' and not operations.get('supports_commit', False):
module.fail_json(msg='candidate source is not supported on this device')
if source == 'startup' and not operations.get('supports_startup', False):
module.fail_json(msg='startup source is not supported on this device')
if filter_type == 'xpath' and not operations.get('supports_xpath', False):
module.fail_json(msg="filter value '%s' of type xpath is not supported on this device" % filter)
# If source is None, NETCONF <get> operation is issued, reading config/state data
# from the running datastore. The python expression "(source or 'running')" results
# in the value of source (if not None) or the value 'running' (if source is None).
if lock == 'never':
execute_lock = False
elif (source or 'running') in operations.get('lock_datastore', []):
# lock is requested (always/if-support) and supported => lets do it
execute_lock = True
else:
# lock is requested (always/if-supported) but not supported => issue warning
module.warn("lock operation on '%s' source is not supported on this device" % (source or 'running'))
execute_lock = (lock == 'always')
if display == 'json' and not HAS_JXMLEASE:
module.fail_json(msg='jxmlease is required to display response in json format'
'but does not appear to be installed. '
'It can be installed using `pip install jxmlease`')
filter_spec = (filter_type, filter) if filter_type else None
if source is not None:
response = get_config(module, source, filter_spec, execute_lock)
else:
response = get(module, filter_spec, execute_lock)
xml_resp = to_text(tostring(response))
output = None
if display == 'xml':
output = remove_namespaces(xml_resp)
elif display == 'json':
try:
output = jxmlease.parse(xml_resp)
except Exception:
raise ValueError(xml_resp)
elif display == 'pretty':
output = to_text(tostring(response, pretty_print=True))
result = {
'stdout': xml_resp,
'output': output
}
module.exit_json(**result)
if __name__ == '__main__':
main()
|
gpl-3.0
|
[
3381,
2647,
15,
1393,
15,
1548,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
334,
67,
9,
14894,
12,
2622,
701,
9572,
13002,
12,
12864,
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,
421,
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,
1200,
936,
421,
199,
8948,
275,
408,
199,
2595,
199,
578,
26,
1851,
2190,
63,
362,
199,
1023,
63,
3270,
26,
298,
18,
14,
22,
2,
199,
2502,
26,
272,
446,
298,
39,
290,
10613,
653,
14774,
758,
271,
8593,
24975,
397,
6271,
78,
2924,
272,
446,
298,
51,
1856,
644,
374,
357,
90,
10562,
8593,
87,
374,
357,
90,
10562,
2924,
199,
3612,
63,
1802,
26,
16347,
2897,
15,
929,
666,
687,
18340,
3103,
5223,
2784,
7256,
14,
199,
1802,
26,
272,
446,
18340,
3103,
365,
282,
2784,
10041,
4113,
477,
27813,
436,
28974,
7068,
701,
489,
314,
473,
775,
38,
14,
2779,
365,
22751,
315,
7329,
1227,
13571,
14,
272,
446,
961,
859,
6127,
314,
922,
370,
5267,
2897,
436,
1174,
666,
687,
18340,
3103,
489,
5223,
2784,
7256,
14,
199,
11036,
63,
9970,
63,
7677,
26,
2784,
63,
643,
19075,
199,
1419,
26,
523,
1350,
26,
272,
1369,
26,
489,
446,
961,
1423,
9314,
314,
12007,
687,
1314,
2897,
666,
1077,
506,
19251,
14,
267,
4821,
1338,
787,
473,
8,
5720,
395,
473,
8,
9007,
9,
436,
473,
8,
16480,
680,
982,
314,
445,
8,
1365,
9,
574,
365,
440,
267,
663,
3865,
2897,
436,
1174,
2556,
787,
2138,
315,
1177,
687,
3879,
12007,
14,
272,
3415,
26,
788,
5720,
297,
283,
9007,
297,
283,
16480,
418,
523,
2457,
26,
272,
1369,
26,
489,
446,
961,
1423,
9314,
314,
4692,
1059,
1314,
17795,
465,
282,
2457,
370,
18152,
314,
12468,
402,
267,
314,
666,
370,
506,
787,
12396,
687,
314,
3982,
2243,
14,
982,
642,
945,
365,
440,
2013,
8039,
267,
2897,
503,
1174,
666,
365,
2138,
315,
754,
10298,
641,
314,
574,
402,
445,
8,
1365,
9,
267,
945,
14,
710,
445,
8,
1541,
9,
574,
883,
506,
1902,
4692,
1059,
503,
1323,
2042,
12,
340,
314,
2457,
365,
315,
267,
1323,
2042,
1475,
314,
18340,
3103,
1654,
3879,
641,
3982,
1591,
1077,
2291,
14462,
19854,
267,
587,
652,
911,
754,
315,
376,
1125,
14,
523,
2929,
26,
272,
1369,
26,
489,
446,
19694,
5687,
370,
675,
1380,
3012,
9147,
1072,
687,
314,
2243,
14,
710,
945,
473,
8,
1001,
9,
911,
267,
8437,
314,
1072,
465,
4840,
666,
14,
982,
314,
945,
574,
365,
473,
8,
1001,
9,
652,
5074,
1335,
10198,
1756,
267,
370,
506,
4903,
641,
3304,
1031,
14,
710,
945,
473,
8,
9118,
9,
365,
8545,
370,
3086,
4692,
1177,
267,
1325,
365,
1808,
11779,
12701,
1475,
334,
10749,
12,
892,
2385,
680,
710,
945,
574,
473,
8,
1652,
9,
365,
8545,
267,
370,
3086,
4692,
1177,
1325,
14185,
1006,
4692,
10747,
14,
272,
3415,
26,
788,
1001,
297,
283,
9118,
297,
283,
1652,
418,
523,
4650,
26,
272,
1369,
26,
489,
446,
1010,
23253,
314,
859,
370,
7662,
4650,
314,
12007,
2013,
465,
445,
8,
1365,
680,
982,
949,
267,
473,
8,
1365,
9,
365,
3247,
12,
314,
473,
8,
5720,
9,
12007,
911,
506,
14233,
14,
4885,
4260,
314,
945,
267,
574,
473,
8,
9223,
9,
365,
911,
7662,
4650,
314,
12007,
26239,
315,
445,
8,
1365,
9,
945,
14,
267,
4885,
4260,
314,
945,
574,
473,
8,
18178,
9,
652,
911,
440,
4650,
314,
445,
8,
1365,
9,
12007,
14,
710,
267,
574,
473,
8,
692,
13,
4946,
9,
6127,
8034,
1640,
9818,
543,
18340,
3103,
8037,
12,
1314,
886,
440,
267,
2291,
314,
334,
324,
9,
831,
3439,
367,
1006,
3748,
666,
18958,
14,
272,
849,
26,
7078,
272,
3415,
26,
788,
18178,
297,
283,
9223,
297,
283,
692,
13,
4946,
418,
199,
7538,
26,
523,
446,
12698,
1258,
334,
8119,
86,
16,
14,
21,
14,
18,
9,
523,
446,
1335,
10198,
1756,
199,
199,
5983,
26,
523,
446,
961,
859,
5074,
314,
18340,
3103,
2656,
2435,
506,
5223,
641,
272,
314,
3982,
2243,
3769,
12883,
14,
523,
446,
961,
859,
5171,
314,
675,
402,
1950,
29,
18242,
199,
624,
199,
199,
8918,
275,
408,
199,
13,
536,
26,
2372,
3879,
2897,
436,
1174,
666,
523,
1851,
2190,
63,
362,
26,
199,
199,
13,
536,
26,
2372,
2897,
436,
1174,
666,
687,
14210,
12007,
523,
1851,
2190,
63,
362,
26,
272,
1350,
26,
14210,
199,
199,
13,
536,
26,
2372,
2656,
2897,
666,
687,
3879,
12007,
1174,
334,
31959,
9,
523,
1851,
2190,
63,
362,
26,
272,
1350,
26,
3879,
272,
2457,
26,
665,
4758,
2535,
2253,
2957,
2253,
2957,
4758,
30,
199,
199,
13,
536,
26,
2372,
2897,
436,
1174,
666,
315,
4840,
1475,
523,
1851,
2190,
63,
362,
26,
272,
2929,
26,
2022,
199,
199,
13,
536,
26,
664,
4177,
769,
1808,
26897,
336,
15,
10747,
523,
1851,
2190,
63,
362,
26,
272,
2929,
26,
2022,
272,
2457,
26,
665,
18242,
13,
929,
9604,
628,
349,
26,
15799,
26,
1162,
26,
1652,
26,
561,
26,
11912,
26,
15799,
13,
18242,
13,
20554,
8186,
9482,
2535,
3629,
15,
2957,
9482,
2957,
18242,
13,
929,
30,
272,
4650,
26,
7078,
199,
199,
13,
536,
26,
664,
4177,
769,
1808,
14462,
523,
1851,
2190,
63,
362,
26,
272,
2929,
26,
2748,
272,
2457,
26,
1182,
18242,
13,
929,
15,
9482,
15,
3629,
199,
199,
13,
536,
26,
664,
3217,
2897,
543,
2457,
334,
9207,
15775,
9,
523,
1851,
2190,
63,
362,
26,
272,
2929,
26,
7268,
272,
2457,
26,
665,
3266,
13,
10057,
9604,
628,
1014,
921,
19597,
14,
957,
15,
561,
15,
11912,
15,
17540,
13,
13532,
13,
12297,
13,
692,
7755,
13,
4128,
10070,
3266,
13,
10057,
30,
272,
4650,
26,
340,
13,
4946,
199,
199,
13
] |
[
2647,
15,
1393,
15,
1548,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
334,
67,
9,
14894,
12,
2622,
701,
9572,
13002,
12,
12864,
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,
421,
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,
1200,
936,
421,
199,
8948,
275,
408,
199,
2595,
199,
578,
26,
1851,
2190,
63,
362,
199,
1023,
63,
3270,
26,
298,
18,
14,
22,
2,
199,
2502,
26,
272,
446,
298,
39,
290,
10613,
653,
14774,
758,
271,
8593,
24975,
397,
6271,
78,
2924,
272,
446,
298,
51,
1856,
644,
374,
357,
90,
10562,
8593,
87,
374,
357,
90,
10562,
2924,
199,
3612,
63,
1802,
26,
16347,
2897,
15,
929,
666,
687,
18340,
3103,
5223,
2784,
7256,
14,
199,
1802,
26,
272,
446,
18340,
3103,
365,
282,
2784,
10041,
4113,
477,
27813,
436,
28974,
7068,
701,
489,
314,
473,
775,
38,
14,
2779,
365,
22751,
315,
7329,
1227,
13571,
14,
272,
446,
961,
859,
6127,
314,
922,
370,
5267,
2897,
436,
1174,
666,
687,
18340,
3103,
489,
5223,
2784,
7256,
14,
199,
11036,
63,
9970,
63,
7677,
26,
2784,
63,
643,
19075,
199,
1419,
26,
523,
1350,
26,
272,
1369,
26,
489,
446,
961,
1423,
9314,
314,
12007,
687,
1314,
2897,
666,
1077,
506,
19251,
14,
267,
4821,
1338,
787,
473,
8,
5720,
395,
473,
8,
9007,
9,
436,
473,
8,
16480,
680,
982,
314,
445,
8,
1365,
9,
574,
365,
440,
267,
663,
3865,
2897,
436,
1174,
2556,
787,
2138,
315,
1177,
687,
3879,
12007,
14,
272,
3415,
26,
788,
5720,
297,
283,
9007,
297,
283,
16480,
418,
523,
2457,
26,
272,
1369,
26,
489,
446,
961,
1423,
9314,
314,
4692,
1059,
1314,
17795,
465,
282,
2457,
370,
18152,
314,
12468,
402,
267,
314,
666,
370,
506,
787,
12396,
687,
314,
3982,
2243,
14,
982,
642,
945,
365,
440,
2013,
8039,
267,
2897,
503,
1174,
666,
365,
2138,
315,
754,
10298,
641,
314,
574,
402,
445,
8,
1365,
9,
267,
945,
14,
710,
445,
8,
1541,
9,
574,
883,
506,
1902,
4692,
1059,
503,
1323,
2042,
12,
340,
314,
2457,
365,
315,
267,
1323,
2042,
1475,
314,
18340,
3103,
1654,
3879,
641,
3982,
1591,
1077,
2291,
14462,
19854,
267,
587,
652,
911,
754,
315,
376,
1125,
14,
523,
2929,
26,
272,
1369,
26,
489,
446,
19694,
5687,
370,
675,
1380,
3012,
9147,
1072,
687,
314,
2243,
14,
710,
945,
473,
8,
1001,
9,
911,
267,
8437,
314,
1072,
465,
4840,
666,
14,
982,
314,
945,
574,
365,
473,
8,
1001,
9,
652,
5074,
1335,
10198,
1756,
267,
370,
506,
4903,
641,
3304,
1031,
14,
710,
945,
473,
8,
9118,
9,
365,
8545,
370,
3086,
4692,
1177,
267,
1325,
365,
1808,
11779,
12701,
1475,
334,
10749,
12,
892,
2385,
680,
710,
945,
574,
473,
8,
1652,
9,
365,
8545,
267,
370,
3086,
4692,
1177,
1325,
14185,
1006,
4692,
10747,
14,
272,
3415,
26,
788,
1001,
297,
283,
9118,
297,
283,
1652,
418,
523,
4650,
26,
272,
1369,
26,
489,
446,
1010,
23253,
314,
859,
370,
7662,
4650,
314,
12007,
2013,
465,
445,
8,
1365,
680,
982,
949,
267,
473,
8,
1365,
9,
365,
3247,
12,
314,
473,
8,
5720,
9,
12007,
911,
506,
14233,
14,
4885,
4260,
314,
945,
267,
574,
473,
8,
9223,
9,
365,
911,
7662,
4650,
314,
12007,
26239,
315,
445,
8,
1365,
9,
945,
14,
267,
4885,
4260,
314,
945,
574,
473,
8,
18178,
9,
652,
911,
440,
4650,
314,
445,
8,
1365,
9,
12007,
14,
710,
267,
574,
473,
8,
692,
13,
4946,
9,
6127,
8034,
1640,
9818,
543,
18340,
3103,
8037,
12,
1314,
886,
440,
267,
2291,
314,
334,
324,
9,
831,
3439,
367,
1006,
3748,
666,
18958,
14,
272,
849,
26,
7078,
272,
3415,
26,
788,
18178,
297,
283,
9223,
297,
283,
692,
13,
4946,
418,
199,
7538,
26,
523,
446,
12698,
1258,
334,
8119,
86,
16,
14,
21,
14,
18,
9,
523,
446,
1335,
10198,
1756,
199,
199,
5983,
26,
523,
446,
961,
859,
5074,
314,
18340,
3103,
2656,
2435,
506,
5223,
641,
272,
314,
3982,
2243,
3769,
12883,
14,
523,
446,
961,
859,
5171,
314,
675,
402,
1950,
29,
18242,
199,
624,
199,
199,
8918,
275,
408,
199,
13,
536,
26,
2372,
3879,
2897,
436,
1174,
666,
523,
1851,
2190,
63,
362,
26,
199,
199,
13,
536,
26,
2372,
2897,
436,
1174,
666,
687,
14210,
12007,
523,
1851,
2190,
63,
362,
26,
272,
1350,
26,
14210,
199,
199,
13,
536,
26,
2372,
2656,
2897,
666,
687,
3879,
12007,
1174,
334,
31959,
9,
523,
1851,
2190,
63,
362,
26,
272,
1350,
26,
3879,
272,
2457,
26,
665,
4758,
2535,
2253,
2957,
2253,
2957,
4758,
30,
199,
199,
13,
536,
26,
2372,
2897,
436,
1174,
666,
315,
4840,
1475,
523,
1851,
2190,
63,
362,
26,
272,
2929,
26,
2022,
199,
199,
13,
536,
26,
664,
4177,
769,
1808,
26897,
336,
15,
10747,
523,
1851,
2190,
63,
362,
26,
272,
2929,
26,
2022,
272,
2457,
26,
665,
18242,
13,
929,
9604,
628,
349,
26,
15799,
26,
1162,
26,
1652,
26,
561,
26,
11912,
26,
15799,
13,
18242,
13,
20554,
8186,
9482,
2535,
3629,
15,
2957,
9482,
2957,
18242,
13,
929,
30,
272,
4650,
26,
7078,
199,
199,
13,
536,
26,
664,
4177,
769,
1808,
14462,
523,
1851,
2190,
63,
362,
26,
272,
2929,
26,
2748,
272,
2457,
26,
1182,
18242,
13,
929,
15,
9482,
15,
3629,
199,
199,
13,
536,
26,
664,
3217,
2897,
543,
2457,
334,
9207,
15775,
9,
523,
1851,
2190,
63,
362,
26,
272,
2929,
26,
7268,
272,
2457,
26,
665,
3266,
13,
10057,
9604,
628,
1014,
921,
19597,
14,
957,
15,
561,
15,
11912,
15,
17540,
13,
13532,
13,
12297,
13,
692,
7755,
13,
4128,
10070,
3266,
13,
10057,
30,
272,
4650,
26,
340,
13,
4946,
199,
199,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
bitforks/pysilfont
|
scripts/samples/demoExecuteScript.py
|
1
|
1573
|
#!/usr/bin/env python
'FontForge: Demo code to paste into the "Execute Script" dialog'
__url__ = 'http://github.com/silnrsi/pysilfont'
__copyright__ = 'Copyright (c) 2013, SIL International (http://www.sil.org)'
__license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)'
__author__ = 'David Raymond'
__version__ = '0.0.1'
import sys, os, fontforge
sys.path.append(os.path.join(os.environ['HOME'], 'src/pysilfont/scripts'))
import samples.demoFunctions # Loads demoFunctions.py module from src/pysilfont/scripts/samples
reload (samples.demoFunctions) # Reload the demo module each time you execute the script to pick up any recent edits
samples.demoFunctions.callFunctions("Colour Glyphs",fontforge.activeFont())
'''Demo usage:
Open the "Execute Script" dialog (from the FontForge File menu or press ctrl+.),
paste just the code section this (from "import..." to "samples...") into there then
run it (Alt+o) and see how it pops up a dialogue with a choice of 3 functions to run.
Edit demoFunctions.py and alter one of the functions.
Execute the script again and see that that the function's behaviour has changed.
Additional functions can be added to demoFunctions.py and, if also defined functionList()
become availably immdiately.
If you want to see the output from print statements, or use commands like input, (eg
for degugging purposes) then start FontForge from a terminal window rather than the
desktop launcher.
When starting from a terminal window, you can also specify the font to use,
eg $ fontforge /home/david/RFS/GenBasR.sfd'''
|
mit
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
7,
6986,
1858,
303,
26,
28939,
1233,
370,
20901,
1901,
314,
298,
12049,
14914,
2,
9592,
7,
199,
363,
633,
363,
275,
283,
1014,
921,
5031,
14,
957,
15,
338,
6066,
82,
338,
15,
647,
338,
276,
1888,
7,
199,
363,
7307,
363,
275,
283,
7384,
334,
67,
9,
6171,
12,
428,
1193,
28220,
221,
334,
1014,
921,
1544,
14,
20329,
14,
1308,
3171,
199,
363,
1682,
363,
275,
283,
9625,
68,
1334,
314,
10697,
844,
334,
1014,
921,
16374,
14,
1308,
15,
2383,
15,
13965,
3171,
199,
363,
2502,
363,
275,
283,
36,
17204,
30703,
2106,
68,
7,
199,
363,
1023,
363,
275,
283,
16,
14,
16,
14,
17,
7,
199,
199,
646,
984,
12,
747,
12,
5023,
16677,
199,
1274,
14,
515,
14,
740,
8,
736,
14,
515,
14,
904,
8,
736,
14,
2314,
459,
9524,
995,
283,
2164,
15,
647,
338,
276,
1888,
15,
6429,
1333,
199,
646,
5845,
14,
8768,
13967,
327,
30367,
14779,
13967,
14,
647,
859,
687,
2928,
15,
647,
338,
276,
1888,
15,
6429,
15,
3356,
199,
9233,
334,
3356,
14,
8768,
13967,
9,
327,
799,
912,
314,
14779,
859,
1924,
900,
1265,
5341,
314,
2884,
370,
3732,
1536,
1263,
8058,
7860,
1086,
199,
3356,
14,
8768,
13967,
14,
1250,
13967,
480,
15758,
598,
7234,
83,
401,
4246,
16677,
14,
2682,
6986,
1012,
199,
199,
2344,
21493,
4503,
26,
199,
4299,
314,
298,
12049,
14914,
2,
9592,
334,
504,
314,
26159,
1858,
303,
3814,
6269,
503,
15105,
15427,
11,
15631,
199,
16586,
2951,
314,
1233,
3420,
642,
334,
504,
298,
646,
11500,
370,
298,
3356,
12594,
1901,
2337,
2066,
199,
1065,
652,
334,
16985,
11,
79,
9,
436,
1937,
4212,
652,
299,
1483,
1536,
282,
9592,
310,
543,
282,
7141,
402,
650,
3423,
370,
1255,
14,
199,
4685,
14779,
13967,
14,
647,
436,
17355,
1373,
402,
314,
3423,
14,
199,
12049,
314,
2884,
4020,
436,
1937,
626,
626,
314,
805,
1159,
13942,
965,
2896,
14,
199,
199,
8824,
3423,
883,
506,
3483,
370,
14779,
13967,
14,
647,
436,
12,
340,
2597,
3247,
805,
1296,
342,
221,
199,
13970,
21006,
6665,
25531,
328,
13824,
14,
199,
199,
3917,
1265,
2934,
370,
1937,
314,
1072,
687,
870,
9834,
12,
503,
675,
3718,
2839,
1324,
12,
334,
5902,
199,
509,
7926,
1518,
1540,
12901,
9,
2066,
1343,
26159,
1858,
303,
687,
282,
11167,
4353,
7830,
2419,
314,
221,
199,
14487,
28757,
14,
199,
199,
11423,
6617,
687,
282,
11167,
4353,
12,
1265,
883,
2597,
4165,
314,
5023,
370,
675,
12,
199,
5902,
2672,
5023,
16677,
1182,
4219,
15,
983,
5017,
15,
50,
7079,
15,
8168,
34,
305,
50,
14,
83,
2592,
2344,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
7,
6986,
1858,
303,
26,
28939,
1233,
370,
20901,
1901,
314,
298,
12049,
14914,
2,
9592,
7,
199,
363,
633,
363,
275,
283,
1014,
921,
5031,
14,
957,
15,
338,
6066,
82,
338,
15,
647,
338,
276,
1888,
7,
199,
363,
7307,
363,
275,
283,
7384,
334,
67,
9,
6171,
12,
428,
1193,
28220,
221,
334,
1014,
921,
1544,
14,
20329,
14,
1308,
3171,
199,
363,
1682,
363,
275,
283,
9625,
68,
1334,
314,
10697,
844,
334,
1014,
921,
16374,
14,
1308,
15,
2383,
15,
13965,
3171,
199,
363,
2502,
363,
275,
283,
36,
17204,
30703,
2106,
68,
7,
199,
363,
1023,
363,
275,
283,
16,
14,
16,
14,
17,
7,
199,
199,
646,
984,
12,
747,
12,
5023,
16677,
199,
1274,
14,
515,
14,
740,
8,
736,
14,
515,
14,
904,
8,
736,
14,
2314,
459,
9524,
995,
283,
2164,
15,
647,
338,
276,
1888,
15,
6429,
1333,
199,
646,
5845,
14,
8768,
13967,
327,
30367,
14779,
13967,
14,
647,
859,
687,
2928,
15,
647,
338,
276,
1888,
15,
6429,
15,
3356,
199,
9233,
334,
3356,
14,
8768,
13967,
9,
327,
799,
912,
314,
14779,
859,
1924,
900,
1265,
5341,
314,
2884,
370,
3732,
1536,
1263,
8058,
7860,
1086,
199,
3356,
14,
8768,
13967,
14,
1250,
13967,
480,
15758,
598,
7234,
83,
401,
4246,
16677,
14,
2682,
6986,
1012,
199,
199,
2344,
21493,
4503,
26,
199,
4299,
314,
298,
12049,
14914,
2,
9592,
334,
504,
314,
26159,
1858,
303,
3814,
6269,
503,
15105,
15427,
11,
15631,
199,
16586,
2951,
314,
1233,
3420,
642,
334,
504,
298,
646,
11500,
370,
298,
3356,
12594,
1901,
2337,
2066,
199,
1065,
652,
334,
16985,
11,
79,
9,
436,
1937,
4212,
652,
299,
1483,
1536,
282,
9592,
310,
543,
282,
7141,
402,
650,
3423,
370,
1255,
14,
199,
4685,
14779,
13967,
14,
647,
436,
17355,
1373,
402,
314,
3423,
14,
199,
12049,
314,
2884,
4020,
436,
1937,
626,
626,
314,
805,
1159,
13942,
965,
2896,
14,
199,
199,
8824,
3423,
883,
506,
3483,
370,
14779,
13967,
14,
647,
436,
12,
340,
2597,
3247,
805,
1296,
342,
221,
199,
13970,
21006,
6665,
25531,
328,
13824,
14,
199,
199,
3917,
1265,
2934,
370,
1937,
314,
1072,
687,
870,
9834,
12,
503,
675,
3718,
2839,
1324,
12,
334,
5902,
199,
509,
7926,
1518,
1540,
12901,
9,
2066,
1343,
26159,
1858,
303,
687,
282,
11167,
4353,
7830,
2419,
314,
221,
199,
14487,
28757,
14,
199,
199,
11423,
6617,
687,
282,
11167,
4353,
12,
1265,
883,
2597,
4165,
314,
5023,
370,
675,
12,
199,
5902,
2672,
5023,
16677,
1182,
4219,
15,
983,
5017,
15,
50,
7079,
15,
8168,
34,
305,
50,
14,
83,
2592,
2344,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,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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
] |
Foxboron/SyncBox
|
tests/test_syncAPI.py
|
1
|
1395
|
"""
Testing src/syncAPI
"""
import unittest
import src.syncAPI
class SyncAPITest(unittest.TestCase):
"""Test the SyncAPI class methods"""
def setUp(self):
"""Set up the test"""
self.syncAPI = src.syncAPI.SyncAPI()
def test_syncAPI_has_a_shared_state(self):
"""Test the shared state of the syncAPI class"""
firstInstance = src.syncAPI.SyncAPI()
secondInstance = src.syncAPI.SyncAPI()
# Make sure their not the same object
self.assertNotEqual(firstInstance, secondInstance)
# Set the watchList property and check it is the same in both instances
firstInstance.watchList = {'biz': 'baz'}
self.assertEqual(firstInstance.watchList, secondInstance.watchList)
def test_the_watchList_property_can_be_set_and_get(self):
"""Test the setter for _watchList"""
watchList = {'foo': 'bar'}
self.syncAPI.watchList = watchList
self.assertEqual(self.syncAPI.watchList, watchList)
def test_CrawlDirectory_returns_a_dictionary_with_a_directory_tree(self):
"""Test crawlDirectory"""
pass
def test_WatchDirectory_adds_a_directory_to_the_watchList(self):
"""Test watchDirectory"""
pass
def test_WatchFile_adds_a_file_to_the_watchList(self):
"""Test watchFile"""
pass
if __name__ == '__main__':
unittest.main()
|
bsd-3-clause
|
[
624,
199,
9029,
2928,
15,
5186,
3735,
199,
199,
624,
199,
199,
646,
2882,
199,
646,
2928,
14,
5186,
3735,
421,
199,
533,
22407,
2642,
597,
8,
2796,
14,
1746,
304,
272,
408,
774,
314,
22407,
3735,
1021,
3102,
624,
339,
347,
3613,
8,
277,
304,
267,
408,
1084,
1536,
314,
511,
624,
267,
291,
14,
5186,
3735,
275,
2928,
14,
5186,
3735,
14,
10878,
3735,
342,
2286,
347,
511,
63,
5186,
3735,
63,
1989,
63,
65,
63,
5555,
63,
929,
8,
277,
304,
267,
408,
774,
314,
5709,
1174,
402,
314,
7604,
3735,
1021,
624,
267,
1642,
3244,
275,
2928,
14,
5186,
3735,
14,
10878,
3735,
342,
267,
3499,
3244,
275,
2928,
14,
5186,
3735,
14,
10878,
3735,
342,
267,
327,
4155,
3238,
3932,
440,
314,
2011,
909,
267,
291,
14,
7418,
8,
2246,
3244,
12,
3499,
3244,
9,
267,
327,
2494,
314,
9626,
1296,
3324,
436,
1104,
652,
365,
314,
2011,
315,
3865,
4454,
267,
1642,
3244,
14,
6821,
1296,
275,
791,
66,
565,
356,
283,
6185,
936,
267,
291,
14,
629,
8,
2246,
3244,
14,
6821,
1296,
12,
3499,
3244,
14,
6821,
1296,
9,
339,
347,
511,
63,
1589,
63,
6821,
1296,
63,
1829,
63,
2425,
63,
1235,
63,
409,
63,
460,
63,
362,
8,
277,
304,
267,
408,
774,
314,
18743,
367,
485,
6821,
1296,
624,
267,
9626,
1296,
275,
791,
1421,
356,
283,
1700,
936,
267,
291,
14,
5186,
3735,
14,
6821,
1296,
275,
9626,
1296,
267,
291,
14,
629,
8,
277,
14,
5186,
3735,
14,
6821,
1296,
12,
9626,
1296,
9,
339,
347,
511,
63,
35,
22910,
6231,
63,
5808,
63,
65,
63,
9086,
63,
1045,
63,
65,
63,
3619,
63,
2350,
8,
277,
304,
267,
408,
774,
286,
22910,
6231,
624,
267,
986,
339,
347,
511,
63,
13978,
6231,
63,
525,
83,
63,
65,
63,
3619,
63,
475,
63,
1589,
63,
6821,
1296,
8,
277,
304,
267,
408,
774,
9626,
6231,
624,
267,
986,
339,
347,
511,
63,
13978,
1173,
63,
525,
83,
63,
65,
63,
493,
63,
475,
63,
1589,
63,
6821,
1296,
8,
277,
304,
267,
408,
774,
9626,
1173,
624,
267,
986,
421,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
9029,
2928,
15,
5186,
3735,
199,
199,
624,
199,
199,
646,
2882,
199,
646,
2928,
14,
5186,
3735,
421,
199,
533,
22407,
2642,
597,
8,
2796,
14,
1746,
304,
272,
408,
774,
314,
22407,
3735,
1021,
3102,
624,
339,
347,
3613,
8,
277,
304,
267,
408,
1084,
1536,
314,
511,
624,
267,
291,
14,
5186,
3735,
275,
2928,
14,
5186,
3735,
14,
10878,
3735,
342,
2286,
347,
511,
63,
5186,
3735,
63,
1989,
63,
65,
63,
5555,
63,
929,
8,
277,
304,
267,
408,
774,
314,
5709,
1174,
402,
314,
7604,
3735,
1021,
624,
267,
1642,
3244,
275,
2928,
14,
5186,
3735,
14,
10878,
3735,
342,
267,
3499,
3244,
275,
2928,
14,
5186,
3735,
14,
10878,
3735,
342,
267,
327,
4155,
3238,
3932,
440,
314,
2011,
909,
267,
291,
14,
7418,
8,
2246,
3244,
12,
3499,
3244,
9,
267,
327,
2494,
314,
9626,
1296,
3324,
436,
1104,
652,
365,
314,
2011,
315,
3865,
4454,
267,
1642,
3244,
14,
6821,
1296,
275,
791,
66,
565,
356,
283,
6185,
936,
267,
291,
14,
629,
8,
2246,
3244,
14,
6821,
1296,
12,
3499,
3244,
14,
6821,
1296,
9,
339,
347,
511,
63,
1589,
63,
6821,
1296,
63,
1829,
63,
2425,
63,
1235,
63,
409,
63,
460,
63,
362,
8,
277,
304,
267,
408,
774,
314,
18743,
367,
485,
6821,
1296,
624,
267,
9626,
1296,
275,
791,
1421,
356,
283,
1700,
936,
267,
291,
14,
5186,
3735,
14,
6821,
1296,
275,
9626,
1296,
267,
291,
14,
629,
8,
277,
14,
5186,
3735,
14,
6821,
1296,
12,
9626,
1296,
9,
339,
347,
511,
63,
35,
22910,
6231,
63,
5808,
63,
65,
63,
9086,
63,
1045,
63,
65,
63,
3619,
63,
2350,
8,
277,
304,
267,
408,
774,
286,
22910,
6231,
624,
267,
986,
339,
347,
511,
63,
13978,
6231,
63,
525,
83,
63,
65,
63,
3619,
63,
475,
63,
1589,
63,
6821,
1296,
8,
277,
304,
267,
408,
774,
9626,
6231,
624,
267,
986,
339,
347,
511,
63,
13978,
1173,
63,
525,
83,
63,
65,
63,
493,
63,
475,
63,
1589,
63,
6821,
1296,
8,
277,
304,
267,
408,
774,
9626,
1173,
624,
267,
986,
421,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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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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
] |
MasonLeeBack/PolyEngine
|
thirdparty/vulkan/shaderc/glslc/test/option_mfmt.py
|
8
|
8194
|
# Copyright 2016 The Shaderc 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.
import expect
import re
from glslc_test_framework import inside_glslc_testsuite
from placeholder import FileShader
MINIMAL_SHADER = '#version 140\nvoid main() {}'
# Regular expression patterns for the minimal shader. The magic number should
# match exactly, and there should not be a trailing comma at the end of the
# list. When -mfmt=c is specified, curly brackets should be presented.
MINIMAL_SHADER_NUM_FORMAT_PATTERN = "^0x07230203.*[0-9a-f]$"
MINIMAL_SHADER_C_FORMAT_PATTERN = "^\{0x07230203.*[0-9a-f]\}"
ERROR_SHADER = '#version 140\n#error\nvoid main() {}'
@inside_glslc_testsuite('OptionMfmt')
class TestFmtCWorksWithDashC(expect.ValidFileContents):
"""Tests that -mfmt=c works with -c for single input file. SPIR-V binary
code output should be emitted as a C-style initializer list in the output
file.
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-c', '-mfmt=c', '-o', 'output_file']
target_filename = 'output_file'
expected_file_contents = re.compile(MINIMAL_SHADER_C_FORMAT_PATTERN, re.S)
@inside_glslc_testsuite('OptionMfmt')
class TestFmtNumWorksWithDashC(expect.ValidFileContents):
"""Tests that -mfmt=num works with -c for single input file. SPIR-V binary
code output should be emitted as a list of hex numbers in the output file.
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-c', '-mfmt=num', '-o', 'output_file']
target_filename = 'output_file'
expected_file_contents = re.compile(MINIMAL_SHADER_NUM_FORMAT_PATTERN, re.S)
@inside_glslc_testsuite('OptionMfmt')
class TestFmtBinWorksWithDashC(expect.ValidObjectFile):
"""Tests that -mfmt=bin works with -c for single input file. This test
should simply have the SPIR-V binary generated.
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-c', '-mfmt=bin']
@inside_glslc_testsuite('OptionMfmt')
class TestFmtCWithLinking(expect.ValidFileContents):
"""Tests that -mfmt=c works when linkding is enabled (no -c specified).
SPIR-V binary code should be emitted as a C-style initializer list in the
output file.
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-mfmt=c']
target_filename = 'a.spv'
expected_file_contents = re.compile(MINIMAL_SHADER_C_FORMAT_PATTERN, re.S)
@inside_glslc_testsuite('OptionMfmt')
class TestFmtNumWithLinking(expect.ValidFileContents):
"""Tests that -mfmt=num works when linkding is enabled (no -c specified).
SPIR-V binary code should be emitted as a C-style initializer list in the
output file.
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-mfmt=num']
target_filename = 'a.spv'
expected_file_contents = re.compile(MINIMAL_SHADER_NUM_FORMAT_PATTERN, re.S)
@inside_glslc_testsuite('OptionMfmt')
class TestFmtCErrorWhenOutputDisasembly(expect.ErrorMessage):
"""Tests that specifying '-mfmt=c' when the compiler is set to
disassembly mode should trigger an error.
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-mfmt=c', '-S', '-o', 'output_file']
expected_error = ("glslc: error: cannot emit output as a C-style "
"initializer list when the output is not SPIR-V "
"binary code\n")
@inside_glslc_testsuite('OptionMfmt')
class TestFmtNumErrorWhenOutputDisasembly(expect.ErrorMessage):
"""Tests that specifying '-mfmt=num' when the compiler is set to
disassembly mode should trigger an error.
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-mfmt=num', '-S', '-o', 'output_file']
expected_error = (
"glslc: error: cannot emit output as a list of hex numbers "
"when the output is not SPIR-V binary code\n")
@inside_glslc_testsuite('OptionMfmt')
class TestFmtBinErrorWhenOutputDisasembly(expect.ErrorMessage):
"""Tests that specifying '-mfmt=bin' when the compiler is set to
disassembly mode should trigger an error.
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-mfmt=bin', '-S', '-o', 'output_file']
expected_error = ("glslc: error: cannot emit output as a binary "
"when the output is not SPIR-V binary code\n")
@inside_glslc_testsuite('OptionMfmt')
class TestFmtNumErrorWhenOutputPreprocess(expect.ErrorMessage):
"""Tests that specifying '-mfmt=num' when the compiler is set to
preprocessing only mode should trigger an error.
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-mfmt=num', '-E', '-o', 'output_file']
expected_error = (
"glslc: error: cannot emit output as a list of hex numbers "
"when the output is not SPIR-V binary code\n")
@inside_glslc_testsuite('OptionMfmt')
class TestFmtCErrorWithDashCapM(expect.ErrorMessage):
"""Tests that specifying '-mfmt=c' should trigger an error when the
compiler is set to dump dependency info as the output (-M or -MM is
specified).
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-mfmt=c', '-M', '-o', 'output_file']
expected_error = ("glslc: error: cannot emit output as a C-style "
"initializer list when the output is not SPIR-V "
"binary code\n")
@inside_glslc_testsuite('OptionMfmt')
class TestFmtCWorksWithDashCapMD(expect.ValidFileContents):
"""Tests that -mfmt=c works with '-c -MD'. SPIR-V binary code
should be emitted as a C-style initializer list in the output file.
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-mfmt=c', '-c', '-MD', '-o', 'output_file']
target_filename = 'output_file'
expected_file_contents = re.compile(MINIMAL_SHADER_C_FORMAT_PATTERN, re.S)
@inside_glslc_testsuite('OptionMfmt')
class TestFmtNumWorksWithDashCapMD(expect.ValidFileContents):
"""Tests that -mfmt=num works with '-c -MD'. SPIR-V binary code
should be emitted as a C-style initializer list in the output file.
"""
shader = FileShader(MINIMAL_SHADER, '.vert')
glslc_args = [shader, '-mfmt=num', '-c', '-MD', '-o', 'output_file']
target_filename = 'output_file'
expected_file_contents = re.compile(MINIMAL_SHADER_NUM_FORMAT_PATTERN, re.S)
@inside_glslc_testsuite('OptionMfmt')
class TestFmtCExitsElegantlyWithErrorInShader(expect.ErrorMessage):
"""Tests that the compiler fails elegantly with -mfmt=c when there are
errors in the input shader.
"""
shader = FileShader(ERROR_SHADER, '.vert')
glslc_args = [shader, '-mfmt=c']
expected_error = [shader, ':3: error: \'#error\' :\n',
'1 error generated.\n']
@inside_glslc_testsuite('OptionMfmt')
class TestFmtNumExitsElegantlyWithErrorInShader(expect.ErrorMessage):
"""Tests that the compiler fails elegantly with -mfmt=num when there are
errors in the input shader.
"""
shader = FileShader(ERROR_SHADER, '.vert')
glslc_args = [shader, '-mfmt=num']
expected_error = [shader, ':3: error: \'#error\' :\n',
'1 error generated.\n']
@inside_glslc_testsuite('OptionMfmt')
class TestFmtBinExitsElegantlyWithErrorInShader(expect.ErrorMessage):
"""Tests that the compiler fails elegantly with -mfmt=binary when there are
errors in the input shader.
"""
shader = FileShader(ERROR_SHADER, '.vert')
glslc_args = [shader, '-mfmt=bin']
expected_error = [shader, ':3: error: \'#error\' :\n',
'1 error generated.\n']
|
mit
|
[
3,
1898,
7800,
710,
5244,
669,
67,
6642,
14,
2900,
4481,
4644,
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,
199,
646,
4282,
199,
646,
295,
199,
504,
486,
478,
10181,
63,
396,
63,
4857,
492,
6272,
63,
71,
478,
10181,
63,
14239,
199,
504,
10069,
492,
3814,
21511,
199,
199,
4896,
16980,
63,
3234,
21372,
275,
3943,
1023,
22796,
60,
78,
1647,
2446,
342,
1052,
7,
199,
3,
18528,
3965,
7970,
367,
314,
13460,
25958,
14,
710,
10628,
1329,
1077,
199,
3,
1336,
8840,
12,
436,
2337,
1077,
440,
506,
282,
8520,
10029,
737,
314,
1284,
402,
314,
199,
3,
769,
14,
3979,
446,
77,
5045,
29,
67,
365,
2013,
12,
1094,
590,
21873,
1077,
506,
26568,
14,
199,
4896,
16980,
63,
3234,
21372,
63,
7125,
63,
4807,
63,
10764,
275,
18129,
16,
88,
1780,
1789,
996,
1644,
2795,
59,
16,
13,
25,
65,
13,
70,
61,
17351,
199,
4896,
16980,
63,
3234,
21372,
63,
35,
63,
4807,
63,
10764,
275,
298,
12773,
91,
16,
88,
1780,
1789,
996,
1644,
2795,
59,
16,
13,
25,
65,
13,
70,
7272,
7063,
199,
3170,
63,
3234,
21372,
275,
3943,
1023,
22796,
60,
78,
3,
705,
60,
78,
1647,
2446,
342,
1052,
7,
421,
199,
32,
17183,
63,
71,
478,
10181,
63,
14239,
360,
2602,
45,
5045,
358,
199,
533,
1379,
38,
2037,
35,
25348,
3007,
16659,
35,
8,
4921,
14,
3490,
1173,
11383,
304,
272,
408,
2925,
626,
446,
77,
5045,
29,
67,
5419,
543,
446,
67,
367,
2849,
1324,
570,
14,
428,
2252,
50,
13,
54,
3366,
272,
1233,
1072,
1077,
506,
19515,
465,
282,
445,
13,
2487,
11130,
769,
315,
314,
1072,
272,
570,
14,
272,
408,
272,
25958,
275,
3814,
21511,
8,
4896,
16980,
63,
3234,
21372,
12,
1987,
1884,
358,
272,
486,
478,
10181,
63,
589,
275,
359,
18116,
12,
2475,
67,
297,
2475,
77,
5045,
29,
67,
297,
2475,
79,
297,
283,
1199,
63,
493,
418,
272,
1347,
63,
1501,
275,
283,
1199,
63,
493,
7,
272,
1420,
63,
493,
63,
4407,
275,
295,
14,
2014,
8,
4896,
16980,
63,
3234,
21372,
63,
35,
63,
4807,
63,
10764,
12,
295,
14,
51,
9,
421,
199,
32,
17183,
63,
71,
478,
10181,
63,
14239,
360,
2602,
45,
5045,
358,
199,
533,
1379,
38,
2037,
5667,
25348,
3007,
16659,
35,
8,
4921,
14,
3490,
1173,
11383,
304,
272,
408,
2925,
626,
446,
77,
5045,
29,
1507,
5419,
543,
446,
67,
367,
2849,
1324,
570,
14,
428,
2252,
50,
13,
54,
3366,
272,
1233,
1072,
1077,
506,
19515,
465,
282,
769,
402,
6318,
5579,
315,
314,
1072,
570,
14,
272,
408,
272,
25958,
275,
3814,
21511,
8,
4896,
16980,
63,
3234,
21372,
12,
1987,
1884,
358,
272,
486,
478,
10181,
63,
589,
275,
359,
18116,
12,
2475,
67,
297,
2475,
77,
5045,
29,
1507,
297,
2475,
79,
297,
283,
1199,
63,
493,
418,
272,
1347,
63,
1501,
275,
283,
1199,
63,
493,
7,
272,
1420,
63,
493,
63,
4407,
275,
295,
14,
2014,
8,
4896,
16980,
63,
3234,
21372,
63,
7125,
63,
4807,
63,
10764,
12,
295,
14,
51,
9,
421,
199,
32,
17183,
63,
71,
478,
10181,
63,
14239,
360,
2602,
45,
5045,
358,
199,
533,
1379,
38,
2037,
13394,
25348,
3007,
16659,
35,
8,
4921,
14,
3490,
1692,
1173,
304,
272,
408,
2925,
626,
446,
77,
5045,
29,
1393,
5419,
543,
446,
67,
367,
2849,
1324,
570,
14,
961,
511,
272,
1077,
9329,
1172,
314,
428,
2252,
50,
13,
54,
3366,
4046,
14,
272,
408,
272,
25958,
275,
3814,
21511,
8,
4896,
16980,
63,
3234,
21372,
12,
1987,
1884,
358,
272,
486,
478,
10181,
63,
589,
275,
359,
18116,
12,
2475,
67,
297,
2475,
77,
5045,
29,
1393,
418,
421,
199,
32,
17183,
63,
71,
478,
10181,
63,
14239,
360,
2602,
45,
5045,
358,
199,
533,
1379,
38,
2037,
35,
3007,
3834,
316,
8,
4921,
14,
3490,
1173,
11383,
304,
272,
408,
2925,
626,
446,
77,
5045,
29,
67,
5419,
1380,
2142,
1098,
365,
5223,
334,
889,
446,
67,
2013,
680,
272,
428,
2252,
50,
13,
54,
3366,
1233,
1077,
506,
19515,
465,
282,
445,
13,
2487,
11130,
769,
315,
314,
272,
1072,
570,
14,
272,
408,
272,
25958,
275,
3814,
21511,
8,
4896,
16980,
63,
3234,
21372,
12,
1987,
1884,
358,
272,
486,
478,
10181,
63,
589,
275,
359,
18116,
12,
2475,
77,
5045,
29,
67,
418,
272,
1347,
63,
1501,
275,
283,
65,
14,
681,
86,
7,
272,
1420,
63,
493,
63,
4407,
275,
295,
14,
2014,
8,
4896,
16980,
63,
3234,
21372,
63,
35,
63,
4807,
63,
10764,
12,
295,
14,
51,
9,
421,
199,
32,
17183,
63,
71,
478,
10181,
63,
14239,
360,
2602,
45,
5045,
358,
199,
533,
1379,
38,
2037,
5667,
3007,
3834,
316,
8,
4921,
14,
3490,
1173,
11383,
304,
272,
408,
2925,
626,
446,
77,
5045,
29,
1507,
5419,
1380,
2142,
1098,
365,
5223,
334,
889,
446,
67,
2013,
680,
272,
428,
2252,
50,
13,
54,
3366,
1233,
1077,
506,
19515,
465,
282,
445,
13,
2487,
11130,
769,
315,
314,
272,
1072,
570,
14,
272,
408,
272,
25958,
275,
3814,
21511,
8,
4896,
16980,
63,
3234,
21372,
12,
1987,
1884,
358,
272,
486,
478,
10181,
63,
589,
275,
359,
18116,
12,
2475,
77,
5045,
29,
1507,
418,
272,
1347,
63,
1501,
275,
283,
65,
14,
681,
86,
7,
272,
1420,
63,
493,
63,
4407,
275,
295,
14,
2014,
8,
4896,
16980,
63,
3234,
21372,
63,
7125,
63,
4807
] |
[
1898,
7800,
710,
5244,
669,
67,
6642,
14,
2900,
4481,
4644,
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,
199,
646,
4282,
199,
646,
295,
199,
504,
486,
478,
10181,
63,
396,
63,
4857,
492,
6272,
63,
71,
478,
10181,
63,
14239,
199,
504,
10069,
492,
3814,
21511,
199,
199,
4896,
16980,
63,
3234,
21372,
275,
3943,
1023,
22796,
60,
78,
1647,
2446,
342,
1052,
7,
199,
3,
18528,
3965,
7970,
367,
314,
13460,
25958,
14,
710,
10628,
1329,
1077,
199,
3,
1336,
8840,
12,
436,
2337,
1077,
440,
506,
282,
8520,
10029,
737,
314,
1284,
402,
314,
199,
3,
769,
14,
3979,
446,
77,
5045,
29,
67,
365,
2013,
12,
1094,
590,
21873,
1077,
506,
26568,
14,
199,
4896,
16980,
63,
3234,
21372,
63,
7125,
63,
4807,
63,
10764,
275,
18129,
16,
88,
1780,
1789,
996,
1644,
2795,
59,
16,
13,
25,
65,
13,
70,
61,
17351,
199,
4896,
16980,
63,
3234,
21372,
63,
35,
63,
4807,
63,
10764,
275,
298,
12773,
91,
16,
88,
1780,
1789,
996,
1644,
2795,
59,
16,
13,
25,
65,
13,
70,
7272,
7063,
199,
3170,
63,
3234,
21372,
275,
3943,
1023,
22796,
60,
78,
3,
705,
60,
78,
1647,
2446,
342,
1052,
7,
421,
199,
32,
17183,
63,
71,
478,
10181,
63,
14239,
360,
2602,
45,
5045,
358,
199,
533,
1379,
38,
2037,
35,
25348,
3007,
16659,
35,
8,
4921,
14,
3490,
1173,
11383,
304,
272,
408,
2925,
626,
446,
77,
5045,
29,
67,
5419,
543,
446,
67,
367,
2849,
1324,
570,
14,
428,
2252,
50,
13,
54,
3366,
272,
1233,
1072,
1077,
506,
19515,
465,
282,
445,
13,
2487,
11130,
769,
315,
314,
1072,
272,
570,
14,
272,
408,
272,
25958,
275,
3814,
21511,
8,
4896,
16980,
63,
3234,
21372,
12,
1987,
1884,
358,
272,
486,
478,
10181,
63,
589,
275,
359,
18116,
12,
2475,
67,
297,
2475,
77,
5045,
29,
67,
297,
2475,
79,
297,
283,
1199,
63,
493,
418,
272,
1347,
63,
1501,
275,
283,
1199,
63,
493,
7,
272,
1420,
63,
493,
63,
4407,
275,
295,
14,
2014,
8,
4896,
16980,
63,
3234,
21372,
63,
35,
63,
4807,
63,
10764,
12,
295,
14,
51,
9,
421,
199,
32,
17183,
63,
71,
478,
10181,
63,
14239,
360,
2602,
45,
5045,
358,
199,
533,
1379,
38,
2037,
5667,
25348,
3007,
16659,
35,
8,
4921,
14,
3490,
1173,
11383,
304,
272,
408,
2925,
626,
446,
77,
5045,
29,
1507,
5419,
543,
446,
67,
367,
2849,
1324,
570,
14,
428,
2252,
50,
13,
54,
3366,
272,
1233,
1072,
1077,
506,
19515,
465,
282,
769,
402,
6318,
5579,
315,
314,
1072,
570,
14,
272,
408,
272,
25958,
275,
3814,
21511,
8,
4896,
16980,
63,
3234,
21372,
12,
1987,
1884,
358,
272,
486,
478,
10181,
63,
589,
275,
359,
18116,
12,
2475,
67,
297,
2475,
77,
5045,
29,
1507,
297,
2475,
79,
297,
283,
1199,
63,
493,
418,
272,
1347,
63,
1501,
275,
283,
1199,
63,
493,
7,
272,
1420,
63,
493,
63,
4407,
275,
295,
14,
2014,
8,
4896,
16980,
63,
3234,
21372,
63,
7125,
63,
4807,
63,
10764,
12,
295,
14,
51,
9,
421,
199,
32,
17183,
63,
71,
478,
10181,
63,
14239,
360,
2602,
45,
5045,
358,
199,
533,
1379,
38,
2037,
13394,
25348,
3007,
16659,
35,
8,
4921,
14,
3490,
1692,
1173,
304,
272,
408,
2925,
626,
446,
77,
5045,
29,
1393,
5419,
543,
446,
67,
367,
2849,
1324,
570,
14,
961,
511,
272,
1077,
9329,
1172,
314,
428,
2252,
50,
13,
54,
3366,
4046,
14,
272,
408,
272,
25958,
275,
3814,
21511,
8,
4896,
16980,
63,
3234,
21372,
12,
1987,
1884,
358,
272,
486,
478,
10181,
63,
589,
275,
359,
18116,
12,
2475,
67,
297,
2475,
77,
5045,
29,
1393,
418,
421,
199,
32,
17183,
63,
71,
478,
10181,
63,
14239,
360,
2602,
45,
5045,
358,
199,
533,
1379,
38,
2037,
35,
3007,
3834,
316,
8,
4921,
14,
3490,
1173,
11383,
304,
272,
408,
2925,
626,
446,
77,
5045,
29,
67,
5419,
1380,
2142,
1098,
365,
5223,
334,
889,
446,
67,
2013,
680,
272,
428,
2252,
50,
13,
54,
3366,
1233,
1077,
506,
19515,
465,
282,
445,
13,
2487,
11130,
769,
315,
314,
272,
1072,
570,
14,
272,
408,
272,
25958,
275,
3814,
21511,
8,
4896,
16980,
63,
3234,
21372,
12,
1987,
1884,
358,
272,
486,
478,
10181,
63,
589,
275,
359,
18116,
12,
2475,
77,
5045,
29,
67,
418,
272,
1347,
63,
1501,
275,
283,
65,
14,
681,
86,
7,
272,
1420,
63,
493,
63,
4407,
275,
295,
14,
2014,
8,
4896,
16980,
63,
3234,
21372,
63,
35,
63,
4807,
63,
10764,
12,
295,
14,
51,
9,
421,
199,
32,
17183,
63,
71,
478,
10181,
63,
14239,
360,
2602,
45,
5045,
358,
199,
533,
1379,
38,
2037,
5667,
3007,
3834,
316,
8,
4921,
14,
3490,
1173,
11383,
304,
272,
408,
2925,
626,
446,
77,
5045,
29,
1507,
5419,
1380,
2142,
1098,
365,
5223,
334,
889,
446,
67,
2013,
680,
272,
428,
2252,
50,
13,
54,
3366,
1233,
1077,
506,
19515,
465,
282,
445,
13,
2487,
11130,
769,
315,
314,
272,
1072,
570,
14,
272,
408,
272,
25958,
275,
3814,
21511,
8,
4896,
16980,
63,
3234,
21372,
12,
1987,
1884,
358,
272,
486,
478,
10181,
63,
589,
275,
359,
18116,
12,
2475,
77,
5045,
29,
1507,
418,
272,
1347,
63,
1501,
275,
283,
65,
14,
681,
86,
7,
272,
1420,
63,
493,
63,
4407,
275,
295,
14,
2014,
8,
4896,
16980,
63,
3234,
21372,
63,
7125,
63,
4807,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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 -*-
"""
Various utilities.
"""
from lib.hachoir_core.i18n import _, ngettext
import re
import stat
from datetime import datetime, timedelta, MAXYEAR
from warnings import warn
def deprecated(comment=None):
"""
This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emmitted
when the function is used.
Examples: ::
@deprecated
def oldfunc(): ...
@deprecated("use newfunc()!")
def oldfunc2(): ...
Code from: http://code.activestate.com/recipes/391367/
"""
def _deprecated(func):
def newFunc(*args, **kwargs):
message = "Call to deprecated function %s" % func.__name__
if comment:
message += ": " + comment
warn(message, category=DeprecationWarning, stacklevel=2)
return func(*args, **kwargs)
newFunc.__name__ = func.__name__
newFunc.__doc__ = func.__doc__
newFunc.__dict__.update(func.__dict__)
return newFunc
return _deprecated
def paddingSize(value, align):
"""
Compute size of a padding field.
>>> paddingSize(31, 4)
1
>>> paddingSize(32, 4)
0
>>> paddingSize(33, 4)
3
Note: (value + paddingSize(value, align)) == alignValue(value, align)
"""
if value % align != 0:
return align - (value % align)
else:
return 0
def alignValue(value, align):
"""
Align a value to next 'align' multiple.
>>> alignValue(31, 4)
32
>>> alignValue(32, 4)
32
>>> alignValue(33, 4)
36
Note: alignValue(value, align) == (value + paddingSize(value, align))
"""
if value % align != 0:
return value + align - (value % align)
else:
return value
def timedelta2seconds(delta):
"""
Convert a datetime.timedelta() objet to a number of second
(floatting point number).
>>> timedelta2seconds(timedelta(seconds=2, microseconds=40000))
2.04
>>> timedelta2seconds(timedelta(minutes=1, milliseconds=250))
60.25
"""
return delta.microseconds / 1000000.0 \
+ delta.seconds + delta.days * 60*60*24
def humanDurationNanosec(nsec):
"""
Convert a duration in nanosecond to human natural representation.
Returns an unicode string.
>>> humanDurationNanosec(60417893)
u'60.42 ms'
"""
# Nano second
if nsec < 1000:
return u"%u nsec" % nsec
# Micro seconds
usec, nsec = divmod(nsec, 1000)
if usec < 1000:
return u"%.2f usec" % (usec+float(nsec)/1000)
# Milli seconds
msec, usec = divmod(usec, 1000)
if msec < 1000:
return u"%.2f ms" % (msec + float(usec)/1000)
return humanDuration(msec)
def humanDuration(delta):
"""
Convert a duration in millisecond to human natural representation.
Returns an unicode string.
>>> humanDuration(0)
u'0 ms'
>>> humanDuration(213)
u'213 ms'
>>> humanDuration(4213)
u'4 sec 213 ms'
>>> humanDuration(6402309)
u'1 hour 46 min 42 sec'
"""
if not isinstance(delta, timedelta):
delta = timedelta(microseconds=delta*1000)
# Milliseconds
text = []
if 1000 <= delta.microseconds:
text.append(u"%u ms" % (delta.microseconds//1000))
# Seconds
minutes, seconds = divmod(delta.seconds, 60)
hours, minutes = divmod(minutes, 60)
if seconds:
text.append(u"%u sec" % seconds)
if minutes:
text.append(u"%u min" % minutes)
if hours:
text.append(ngettext("%u hour", "%u hours", hours) % hours)
# Days
years, days = divmod(delta.days, 365)
if days:
text.append(ngettext("%u day", "%u days", days) % days)
if years:
text.append(ngettext("%u year", "%u years", years) % years)
if 3 < len(text):
text = text[-3:]
elif not text:
return u"0 ms"
return u" ".join(reversed(text))
def humanFilesize(size):
"""
Convert a file size in byte to human natural representation.
It uses the values: 1 KB is 1024 bytes, 1 MB is 1024 KB, etc.
The result is an unicode string.
>>> humanFilesize(1)
u'1 byte'
>>> humanFilesize(790)
u'790 bytes'
>>> humanFilesize(256960)
u'250.9 KB'
"""
if size < 10000:
return ngettext("%u byte", "%u bytes", size) % size
units = [_("KB"), _("MB"), _("GB"), _("TB")]
size = float(size)
divisor = 1024
for unit in units:
size = size / divisor
if size < divisor:
return "%.1f %s" % (size, unit)
return "%u %s" % (size, unit)
def humanBitSize(size):
"""
Convert a size in bit to human classic representation.
It uses the values: 1 Kbit is 1000 bits, 1 Mbit is 1000 Kbit, etc.
The result is an unicode string.
>>> humanBitSize(1)
u'1 bit'
>>> humanBitSize(790)
u'790 bits'
>>> humanBitSize(256960)
u'257.0 Kbit'
"""
divisor = 1000
if size < divisor:
return ngettext("%u bit", "%u bits", size) % size
units = [u"Kbit", u"Mbit", u"Gbit", u"Tbit"]
size = float(size)
for unit in units:
size = size / divisor
if size < divisor:
return "%.1f %s" % (size, unit)
return u"%u %s" % (size, unit)
def humanBitRate(size):
"""
Convert a bit rate to human classic representation. It uses humanBitSize()
to convert size into human reprensation. The result is an unicode string.
>>> humanBitRate(790)
u'790 bits/sec'
>>> humanBitRate(256960)
u'257.0 Kbit/sec'
"""
return "".join((humanBitSize(size), "/sec"))
def humanFrequency(hertz):
"""
Convert a frequency in hertz to human classic representation.
It uses the values: 1 KHz is 1000 Hz, 1 MHz is 1000 KMhz, etc.
The result is an unicode string.
>>> humanFrequency(790)
u'790 Hz'
>>> humanFrequency(629469)
u'629.5 kHz'
"""
divisor = 1000
if hertz < divisor:
return u"%u Hz" % hertz
units = [u"kHz", u"MHz", u"GHz", u"THz"]
hertz = float(hertz)
for unit in units:
hertz = hertz / divisor
if hertz < divisor:
return u"%.1f %s" % (hertz, unit)
return u"%s %s" % (hertz, unit)
regex_control_code = re.compile(r"([\x00-\x1f\x7f])")
controlchars = tuple({
# Don't use "\0", because "\0"+"0"+"1" = "\001" = "\1" (1 character)
# Same rease to not use octal syntax ("\1")
ord("\n"): r"\n",
ord("\r"): r"\r",
ord("\t"): r"\t",
ord("\a"): r"\a",
ord("\b"): r"\b",
}.get(code, '\\x%02x' % code)
for code in xrange(128)
)
def makePrintable(data, charset, quote=None, to_unicode=False, smart=True):
r"""
Prepare a string to make it printable in the specified charset.
It escapes control characters. Characters with code bigger than 127
are escaped if data type is 'str' or if charset is "ASCII".
Examples with Unicode:
>>> aged = unicode("âgé", "UTF-8")
>>> repr(aged) # text type is 'unicode'
"u'\\xe2g\\xe9'"
>>> makePrintable("abc\0", "UTF-8")
'abc\\0'
>>> makePrintable(aged, "latin1")
'\xe2g\xe9'
>>> makePrintable(aged, "latin1", quote='"')
'"\xe2g\xe9"'
Examples with string encoded in latin1:
>>> aged_latin = unicode("âgé", "UTF-8").encode("latin1")
>>> repr(aged_latin) # text type is 'str'
"'\\xe2g\\xe9'"
>>> makePrintable(aged_latin, "latin1")
'\\xe2g\\xe9'
>>> makePrintable("", "latin1")
''
>>> makePrintable("a", "latin1", quote='"')
'"a"'
>>> makePrintable("", "latin1", quote='"')
'(empty)'
>>> makePrintable("abc", "latin1", quote="'")
"'abc'"
Control codes:
>>> makePrintable("\0\x03\x0a\x10 \x7f", "latin1")
'\\0\\3\\n\\x10 \\x7f'
Quote character may also be escaped (only ' and "):
>>> print makePrintable("a\"b", "latin-1", quote='"')
"a\"b"
>>> print makePrintable("a\"b", "latin-1", quote="'")
'a"b'
>>> print makePrintable("a'b", "latin-1", quote="'")
'a\'b'
"""
if data:
if not isinstance(data, unicode):
data = unicode(data, "ISO-8859-1")
charset = "ASCII"
data = regex_control_code.sub(
lambda regs: controlchars[ord(regs.group(1))], data)
if quote:
if quote in "\"'":
data = data.replace(quote, '\\' + quote)
data = ''.join((quote, data, quote))
elif quote:
data = "(empty)"
data = data.encode(charset, "backslashreplace")
if smart:
# Replace \x00\x01 by \0\1
data = re.sub(r"\\x0([0-7])(?=[^0-7]|$)", r"\\\1", data)
if to_unicode:
data = unicode(data, charset)
return data
def makeUnicode(text):
r"""
Convert text to printable Unicode string. For byte string (type 'str'),
use charset ISO-8859-1 for the conversion to Unicode
>>> makeUnicode(u'abc\0d')
u'abc\\0d'
>>> makeUnicode('a\xe9')
u'a\xe9'
"""
if isinstance(text, str):
text = unicode(text, "ISO-8859-1")
elif not isinstance(text, unicode):
text = unicode(text)
text = regex_control_code.sub(
lambda regs: controlchars[ord(regs.group(1))], text)
text = re.sub(r"\\x0([0-7])(?=[^0-7]|$)", r"\\\1", text)
return text
def binarySearch(seq, cmp_func):
"""
Search a value in a sequence using binary search. Returns index of the
value, or None if the value doesn't exist.
'seq' have to be sorted in ascending order according to the
comparaison function ;
'cmp_func', prototype func(x), is the compare function:
- Return strictly positive value if we have to search forward ;
- Return strictly negative value if we have to search backward ;
- Otherwise (zero) we got the value.
>>> # Search number 5 (search forward)
... binarySearch([0, 4, 5, 10], lambda x: 5-x)
2
>>> # Backward search
... binarySearch([10, 5, 4, 0], lambda x: x-5)
1
"""
lower = 0
upper = len(seq)
while lower < upper:
index = (lower + upper) >> 1
diff = cmp_func(seq[index])
if diff < 0:
upper = index
elif diff > 0:
lower = index + 1
else:
return index
return None
def lowerBound(seq, cmp_func):
f = 0
l = len(seq)
while l > 0:
h = l >> 1
m = f + h
if cmp_func(seq[m]):
f = m
f += 1
l -= h + 1
else:
l = h
return f
def humanUnixAttributes(mode):
"""
Convert a Unix file attributes (or "file mode") to an unicode string.
Original source code:
http://cvs.savannah.gnu.org/viewcvs/coreutils/lib/filemode.c?root=coreutils
>>> humanUnixAttributes(0644)
u'-rw-r--r-- (644)'
>>> humanUnixAttributes(02755)
u'-rwxr-sr-x (2755)'
"""
def ftypelet(mode):
if stat.S_ISREG (mode) or not stat.S_IFMT(mode):
return '-'
if stat.S_ISBLK (mode): return 'b'
if stat.S_ISCHR (mode): return 'c'
if stat.S_ISDIR (mode): return 'd'
if stat.S_ISFIFO(mode): return 'p'
if stat.S_ISLNK (mode): return 'l'
if stat.S_ISSOCK(mode): return 's'
return '?'
chars = [ ftypelet(mode), 'r', 'w', 'x', 'r', 'w', 'x', 'r', 'w', 'x' ]
for i in xrange(1, 10):
if not mode & 1 << 9 - i:
chars[i] = '-'
if mode & stat.S_ISUID:
if chars[3] != 'x':
chars[3] = 'S'
else:
chars[3] = 's'
if mode & stat.S_ISGID:
if chars[6] != 'x':
chars[6] = 'S'
else:
chars[6] = 's'
if mode & stat.S_ISVTX:
if chars[9] != 'x':
chars[9] = 'T'
else:
chars[9] = 't'
return u"%s (%o)" % (''.join(chars), mode)
def createDict(data, index):
"""
Create a new dictionnay from dictionnary key=>values:
just keep value number 'index' from all values.
>>> data={10: ("dix", 100, "a"), 20: ("vingt", 200, "b")}
>>> createDict(data, 0)
{10: 'dix', 20: 'vingt'}
>>> createDict(data, 2)
{10: 'a', 20: 'b'}
"""
return dict( (key,values[index]) for key, values in data.iteritems() )
# Start of UNIX timestamp (Epoch): 1st January 1970 at 00:00
UNIX_TIMESTAMP_T0 = datetime(1970, 1, 1)
def timestampUNIX(value):
"""
Convert an UNIX (32-bit) timestamp to datetime object. Timestamp value
is the number of seconds since the 1st January 1970 at 00:00. Maximum
value is 2147483647: 19 january 2038 at 03:14:07.
May raise ValueError for invalid value: value have to be in 0..2147483647.
>>> timestampUNIX(0)
datetime.datetime(1970, 1, 1, 0, 0)
>>> timestampUNIX(1154175644)
datetime.datetime(2006, 7, 29, 12, 20, 44)
>>> timestampUNIX(1154175644.37)
datetime.datetime(2006, 7, 29, 12, 20, 44, 370000)
>>> timestampUNIX(2147483647)
datetime.datetime(2038, 1, 19, 3, 14, 7)
"""
if not isinstance(value, (float, int, long)):
raise TypeError("timestampUNIX(): an integer or float is required")
if not(0 <= value <= 2147483647):
raise ValueError("timestampUNIX(): value have to be in 0..2147483647")
return UNIX_TIMESTAMP_T0 + timedelta(seconds=value)
# Start of Macintosh timestamp: 1st January 1904 at 00:00
MAC_TIMESTAMP_T0 = datetime(1904, 1, 1)
def timestampMac32(value):
"""
Convert an Mac (32-bit) timestamp to string. The format is the number
of seconds since the 1st January 1904 (to 2040). Returns unicode string.
>>> timestampMac32(0)
datetime.datetime(1904, 1, 1, 0, 0)
>>> timestampMac32(2843043290)
datetime.datetime(1994, 2, 2, 14, 14, 50)
"""
if not isinstance(value, (float, int, long)):
raise TypeError("an integer or float is required")
if not(0 <= value <= 4294967295):
return _("invalid Mac timestamp (%s)") % value
return MAC_TIMESTAMP_T0 + timedelta(seconds=value)
def durationWin64(value):
"""
Convert Windows 64-bit duration to string. The timestamp format is
a 64-bit number: number of 100ns. See also timestampWin64().
>>> str(durationWin64(1072580000))
'0:01:47.258000'
>>> str(durationWin64(2146280000))
'0:03:34.628000'
"""
if not isinstance(value, (float, int, long)):
raise TypeError("an integer or float is required")
if value < 0:
raise ValueError("value have to be a positive or nul integer")
return timedelta(microseconds=value/10)
# Start of 64-bit Windows timestamp: 1st January 1600 at 00:00
WIN64_TIMESTAMP_T0 = datetime(1601, 1, 1, 0, 0, 0)
def timestampWin64(value):
"""
Convert Windows 64-bit timestamp to string. The timestamp format is
a 64-bit number which represents number of 100ns since the
1st January 1601 at 00:00. Result is an unicode string.
See also durationWin64(). Maximum date is 28 may 60056.
>>> timestampWin64(0)
datetime.datetime(1601, 1, 1, 0, 0)
>>> timestampWin64(127840491566710000)
datetime.datetime(2006, 2, 10, 12, 45, 56, 671000)
"""
try:
return WIN64_TIMESTAMP_T0 + durationWin64(value)
except OverflowError:
raise ValueError(_("date newer than year %s (value=%s)") % (MAXYEAR, value))
# Start of 60-bit UUID timestamp: 15 October 1582 at 00:00
UUID60_TIMESTAMP_T0 = datetime(1582, 10, 15, 0, 0, 0)
def timestampUUID60(value):
"""
Convert UUID 60-bit timestamp to string. The timestamp format is
a 60-bit number which represents number of 100ns since the
the 15 October 1582 at 00:00. Result is an unicode string.
>>> timestampUUID60(0)
datetime.datetime(1582, 10, 15, 0, 0)
>>> timestampUUID60(130435676263032368)
datetime.datetime(1996, 2, 14, 5, 13, 46, 303236)
"""
if not isinstance(value, (float, int, long)):
raise TypeError("an integer or float is required")
if value < 0:
raise ValueError("value have to be a positive or nul integer")
try:
return UUID60_TIMESTAMP_T0 + timedelta(microseconds=value/10)
except OverflowError:
raise ValueError(_("timestampUUID60() overflow (value=%s)") % value)
def humanDatetime(value, strip_microsecond=True):
"""
Convert a timestamp to Unicode string: use ISO format with space separator.
>>> humanDatetime( datetime(2006, 7, 29, 12, 20, 44) )
u'2006-07-29 12:20:44'
>>> humanDatetime( datetime(2003, 6, 30, 16, 0, 5, 370000) )
u'2003-06-30 16:00:05'
>>> humanDatetime( datetime(2003, 6, 30, 16, 0, 5, 370000), False )
u'2003-06-30 16:00:05.370000'
"""
text = unicode(value.isoformat())
text = text.replace('T', ' ')
if strip_microsecond and "." in text:
text = text.split(".")[0]
return text
NEWLINES_REGEX = re.compile("\n+")
def normalizeNewline(text):
r"""
Replace Windows and Mac newlines with Unix newlines.
Replace multiple consecutive newlines with one newline.
>>> normalizeNewline('a\r\nb')
'a\nb'
>>> normalizeNewline('a\r\rb')
'a\nb'
>>> normalizeNewline('a\n\nb')
'a\nb'
"""
text = text.replace("\r\n", "\n")
text = text.replace("\r", "\n")
return NEWLINES_REGEX.sub("\n", text)
|
gpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
624,
199,
9958,
1785,
15841,
14,
199,
624,
199,
199,
504,
1973,
14,
72,
21301,
63,
1018,
14,
73,
1085,
78,
492,
5501,
29793,
199,
646,
295,
199,
646,
5672,
199,
504,
2197,
492,
2197,
12,
6871,
12,
4828,
8195,
15550,
199,
504,
3598,
492,
7987,
199,
199,
318,
5906,
8,
3349,
29,
403,
304,
272,
408,
272,
961,
365,
282,
7531,
1314,
883,
506,
1202,
370,
2216,
3423,
272,
465,
5906,
14,
2779,
911,
754,
315,
282,
5721,
3769,
325,
596,
390,
471,
272,
1380,
314,
805,
365,
1202,
14,
339,
6058,
26,
3800,
10817,
768,
6667,
2126,
347,
2269,
1532,
837,
2263,
10817,
768,
6667,
480,
1180,
892,
1532,
342,
9124,
2126,
347,
2269,
1532,
18,
837,
2263,
339,
5495,
687,
26,
1455,
921,
600,
14,
32595,
14,
957,
15,
25200,
15,
1355,
969,
1822,
15,
272,
408,
272,
347,
485,
6667,
8,
1532,
304,
267,
347,
892,
7465,
2031,
589,
12,
1011,
958,
304,
288,
1245,
275,
298,
2176,
370,
5906,
805,
450,
83,
2,
450,
2562,
855,
354,
363,
288,
340,
3721,
26,
355,
1245,
847,
7244,
298,
435,
3721,
288,
7987,
8,
1188,
12,
4637,
29,
15561,
12,
13232,
29,
18,
9,
288,
372,
2562,
2031,
589,
12,
1011,
958,
9,
267,
892,
7465,
855,
354,
363,
275,
2562,
855,
354,
363,
267,
892,
7465,
855,
1301,
363,
275,
2562,
855,
1301,
363,
267,
892,
7465,
855,
807,
4343,
873,
8,
1532,
855,
807,
3368,
267,
372,
892,
7465,
272,
372,
485,
6667,
199,
199,
318,
6273,
2320,
8,
585,
12,
6998,
304,
272,
408,
272,
8354,
1568,
402,
282,
6273,
901,
14,
339,
1306,
6273,
2320,
8,
2192,
12,
841,
9,
272,
413,
272,
1306,
6273,
2320,
8,
708,
12,
841,
9,
272,
378,
272,
1306,
6273,
2320,
8,
1153,
12,
841,
9,
272,
650,
339,
3390,
26,
334,
585,
435,
6273,
2320,
8,
585,
12,
6998,
430,
508,
6998,
1110,
8,
585,
12,
6998,
9,
272,
408,
272,
340,
574,
450,
6998,
1137,
378,
26,
267,
372,
6998,
446,
334,
585,
450,
6998,
9,
272,
587,
26,
267,
372,
378,
199,
199,
318,
6998,
1110,
8,
585,
12,
6998,
304,
272,
408,
272,
15170,
784,
282,
574,
370,
2163,
283,
5743,
7,
3663,
14,
339,
1306,
6998,
1110,
8,
2192,
12,
841,
9,
272,
4337,
272,
1306,
6998,
1110,
8,
708,
12,
841,
9,
272,
4337,
272,
1306,
6998,
1110,
8,
1153,
12,
841,
9,
272,
8780,
339,
3390,
26,
6998,
1110,
8,
585,
12,
6998,
9,
508,
334,
585,
435,
6273,
2320,
8,
585,
12,
6998,
430,
272,
408,
339,
340,
574,
450,
6998,
1137,
378,
26,
267,
372,
574,
435,
6998,
446,
334,
585,
450,
6998,
9,
272,
587,
26,
267,
372,
574,
199,
199,
318,
6871,
18,
4515,
8,
3136,
304,
272,
408,
272,
7905,
282,
2197,
14,
7473,
342,
1559,
386,
370,
282,
1329,
402,
3499,
272,
334,
1609,
1337,
2376,
1329,
680,
339,
1306,
6871,
18,
4515,
8,
7473,
8,
4515,
29,
18,
12,
21574,
29,
20,
993,
430,
272,
499,
14,
966,
272,
1306,
6871,
18,
4515,
8,
7473,
8,
10430,
29,
17,
12,
21131,
29,
7991,
430,
272,
5212,
14,
821,
272,
408,
272,
372,
5762,
14,
18144,
1182,
19492,
14,
16,
971,
267,
435,
5762,
14,
4515,
435,
5762,
14,
4899,
627,
5212,
10,
2259,
10,
1194,
199,
199,
318,
11779,
13283,
46,
8143,
3321,
8,
78,
3321,
304,
272,
408,
272,
7905,
282,
7373,
315,
12055,
3362,
2067,
370,
11779,
19981,
6025,
14,
272,
1803,
376,
2649,
1059,
14,
339,
1306,
11779,
13283,
46,
8143,
3321,
8,
30320,
1196,
14590,
9,
272,
399,
7,
2259,
14,
2260,
6605,
7,
272,
408,
339,
327,
653,
8143,
3499,
272,
340,
14256,
665,
5198,
26,
267,
372,
399,
6808,
85,
14256,
2,
450,
14256,
339,
327,
27022,
4696,
272,
675,
67,
12,
14256,
275,
16438,
8,
78,
3321,
12,
5198,
9,
272,
340,
675,
67,
665,
5198,
26,
267,
372,
399,
6808,
14,
18,
70,
675,
67,
2,
450,
334,
1180,
67,
11,
1609,
8,
78,
3321,
2447,
5279,
9,
339,
327,
603,
8148,
4696,
272,
333,
3321,
12,
675,
67,
275,
16438,
8,
1180,
67,
12,
5198,
9,
272,
340,
333,
3321,
665,
5198,
26,
267,
372,
399,
6808,
14,
18,
70,
6605,
2,
450,
334,
19764,
435,
2069,
8,
1180,
67,
2447,
5279,
9,
272,
372,
11779,
13283,
8,
19764,
9,
199,
199,
318,
11779,
13283,
8,
3136,
304,
272,
408,
272,
7905,
282,
7373,
315,
15949,
4375,
370,
11779,
19981,
6025,
14,
272,
1803,
376,
2649,
1059,
14,
339,
1306,
11779,
13283,
8,
16,
9,
272,
399,
7,
16,
6605,
7,
272,
1306,
11779,
13283,
8,
14271,
9,
272,
399,
7,
14271,
6605,
7,
272,
1306,
11779,
13283,
8,
2260,
969,
9,
272,
399,
7,
20,
6513,
499,
969,
6605,
7,
272,
1306,
11779,
13283,
8,
772,
996,
10556,
9,
272,
399,
7,
17,
6925,
12426,
1748,
5685,
6513,
7,
272,
408,
272,
340,
440,
1228,
8,
3136,
12,
6871,
304,
267,
5762,
275,
6871,
8,
18144,
29,
3136,
10,
5279,
9,
339,
327,
603,
8148,
4515,
272,
1318,
275,
942,
272,
340,
5198,
2695,
5762,
14,
18144,
26,
267,
1318,
14,
740,
8,
85,
6808,
85,
6605,
2,
450,
334,
3136,
14,
18144,
501,
5279,
430,
339,
327,
3240,
2776,
272,
9395,
12,
4696,
275,
16438,
8,
3136,
14,
4515,
12,
5212,
9,
272,
10857,
12,
9395,
275,
16438,
8,
10430,
12,
5212,
9,
272,
340,
4696,
26,
267,
1318,
14,
740,
8,
85,
6808,
85,
6513,
2,
450,
4696,
9,
272,
340,
9395,
26,
267,
1318,
14,
740,
8,
85,
6808,
85,
1748,
2,
450,
9395,
9,
272,
340,
10857,
26,
267,
1318,
14,
740,
8,
28234,
3647,
85,
6925,
401,
2071,
85,
10857,
401,
10857,
9,
450,
10857,
9,
339,
327,
577,
5758,
272,
17399,
12,
7609,
275,
16438,
8,
3136,
14,
4899,
12,
28046,
9,
272,
340,
7609,
26,
267,
1318,
14,
740,
8,
28234,
3647,
85,
5382,
401,
2071,
85,
7609,
401,
7609,
9,
450,
7609,
9,
272,
340,
17399,
26,
267,
1318,
14,
740,
8,
28234,
3647,
85,
5361,
401,
2071,
85
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
624,
199,
9958,
1785,
15841,
14,
199,
624,
199,
199,
504,
1973,
14,
72,
21301,
63,
1018,
14,
73,
1085,
78,
492,
5501,
29793,
199,
646,
295,
199,
646,
5672,
199,
504,
2197,
492,
2197,
12,
6871,
12,
4828,
8195,
15550,
199,
504,
3598,
492,
7987,
199,
199,
318,
5906,
8,
3349,
29,
403,
304,
272,
408,
272,
961,
365,
282,
7531,
1314,
883,
506,
1202,
370,
2216,
3423,
272,
465,
5906,
14,
2779,
911,
754,
315,
282,
5721,
3769,
325,
596,
390,
471,
272,
1380,
314,
805,
365,
1202,
14,
339,
6058,
26,
3800,
10817,
768,
6667,
2126,
347,
2269,
1532,
837,
2263,
10817,
768,
6667,
480,
1180,
892,
1532,
342,
9124,
2126,
347,
2269,
1532,
18,
837,
2263,
339,
5495,
687,
26,
1455,
921,
600,
14,
32595,
14,
957,
15,
25200,
15,
1355,
969,
1822,
15,
272,
408,
272,
347,
485,
6667,
8,
1532,
304,
267,
347,
892,
7465,
2031,
589,
12,
1011,
958,
304,
288,
1245,
275,
298,
2176,
370,
5906,
805,
450,
83,
2,
450,
2562,
855,
354,
363,
288,
340,
3721,
26,
355,
1245,
847,
7244,
298,
435,
3721,
288,
7987,
8,
1188,
12,
4637,
29,
15561,
12,
13232,
29,
18,
9,
288,
372,
2562,
2031,
589,
12,
1011,
958,
9,
267,
892,
7465,
855,
354,
363,
275,
2562,
855,
354,
363,
267,
892,
7465,
855,
1301,
363,
275,
2562,
855,
1301,
363,
267,
892,
7465,
855,
807,
4343,
873,
8,
1532,
855,
807,
3368,
267,
372,
892,
7465,
272,
372,
485,
6667,
199,
199,
318,
6273,
2320,
8,
585,
12,
6998,
304,
272,
408,
272,
8354,
1568,
402,
282,
6273,
901,
14,
339,
1306,
6273,
2320,
8,
2192,
12,
841,
9,
272,
413,
272,
1306,
6273,
2320,
8,
708,
12,
841,
9,
272,
378,
272,
1306,
6273,
2320,
8,
1153,
12,
841,
9,
272,
650,
339,
3390,
26,
334,
585,
435,
6273,
2320,
8,
585,
12,
6998,
430,
508,
6998,
1110,
8,
585,
12,
6998,
9,
272,
408,
272,
340,
574,
450,
6998,
1137,
378,
26,
267,
372,
6998,
446,
334,
585,
450,
6998,
9,
272,
587,
26,
267,
372,
378,
199,
199,
318,
6998,
1110,
8,
585,
12,
6998,
304,
272,
408,
272,
15170,
784,
282,
574,
370,
2163,
283,
5743,
7,
3663,
14,
339,
1306,
6998,
1110,
8,
2192,
12,
841,
9,
272,
4337,
272,
1306,
6998,
1110,
8,
708,
12,
841,
9,
272,
4337,
272,
1306,
6998,
1110,
8,
1153,
12,
841,
9,
272,
8780,
339,
3390,
26,
6998,
1110,
8,
585,
12,
6998,
9,
508,
334,
585,
435,
6273,
2320,
8,
585,
12,
6998,
430,
272,
408,
339,
340,
574,
450,
6998,
1137,
378,
26,
267,
372,
574,
435,
6998,
446,
334,
585,
450,
6998,
9,
272,
587,
26,
267,
372,
574,
199,
199,
318,
6871,
18,
4515,
8,
3136,
304,
272,
408,
272,
7905,
282,
2197,
14,
7473,
342,
1559,
386,
370,
282,
1329,
402,
3499,
272,
334,
1609,
1337,
2376,
1329,
680,
339,
1306,
6871,
18,
4515,
8,
7473,
8,
4515,
29,
18,
12,
21574,
29,
20,
993,
430,
272,
499,
14,
966,
272,
1306,
6871,
18,
4515,
8,
7473,
8,
10430,
29,
17,
12,
21131,
29,
7991,
430,
272,
5212,
14,
821,
272,
408,
272,
372,
5762,
14,
18144,
1182,
19492,
14,
16,
971,
267,
435,
5762,
14,
4515,
435,
5762,
14,
4899,
627,
5212,
10,
2259,
10,
1194,
199,
199,
318,
11779,
13283,
46,
8143,
3321,
8,
78,
3321,
304,
272,
408,
272,
7905,
282,
7373,
315,
12055,
3362,
2067,
370,
11779,
19981,
6025,
14,
272,
1803,
376,
2649,
1059,
14,
339,
1306,
11779,
13283,
46,
8143,
3321,
8,
30320,
1196,
14590,
9,
272,
399,
7,
2259,
14,
2260,
6605,
7,
272,
408,
339,
327,
653,
8143,
3499,
272,
340,
14256,
665,
5198,
26,
267,
372,
399,
6808,
85,
14256,
2,
450,
14256,
339,
327,
27022,
4696,
272,
675,
67,
12,
14256,
275,
16438,
8,
78,
3321,
12,
5198,
9,
272,
340,
675,
67,
665,
5198,
26,
267,
372,
399,
6808,
14,
18,
70,
675,
67,
2,
450,
334,
1180,
67,
11,
1609,
8,
78,
3321,
2447,
5279,
9,
339,
327,
603,
8148,
4696,
272,
333,
3321,
12,
675,
67,
275,
16438,
8,
1180,
67,
12,
5198,
9,
272,
340,
333,
3321,
665,
5198,
26,
267,
372,
399,
6808,
14,
18,
70,
6605,
2,
450,
334,
19764,
435,
2069,
8,
1180,
67,
2447,
5279,
9,
272,
372,
11779,
13283,
8,
19764,
9,
199,
199,
318,
11779,
13283,
8,
3136,
304,
272,
408,
272,
7905,
282,
7373,
315,
15949,
4375,
370,
11779,
19981,
6025,
14,
272,
1803,
376,
2649,
1059,
14,
339,
1306,
11779,
13283,
8,
16,
9,
272,
399,
7,
16,
6605,
7,
272,
1306,
11779,
13283,
8,
14271,
9,
272,
399,
7,
14271,
6605,
7,
272,
1306,
11779,
13283,
8,
2260,
969,
9,
272,
399,
7,
20,
6513,
499,
969,
6605,
7,
272,
1306,
11779,
13283,
8,
772,
996,
10556,
9,
272,
399,
7,
17,
6925,
12426,
1748,
5685,
6513,
7,
272,
408,
272,
340,
440,
1228,
8,
3136,
12,
6871,
304,
267,
5762,
275,
6871,
8,
18144,
29,
3136,
10,
5279,
9,
339,
327,
603,
8148,
4515,
272,
1318,
275,
942,
272,
340,
5198,
2695,
5762,
14,
18144,
26,
267,
1318,
14,
740,
8,
85,
6808,
85,
6605,
2,
450,
334,
3136,
14,
18144,
501,
5279,
430,
339,
327,
3240,
2776,
272,
9395,
12,
4696,
275,
16438,
8,
3136,
14,
4515,
12,
5212,
9,
272,
10857,
12,
9395,
275,
16438,
8,
10430,
12,
5212,
9,
272,
340,
4696,
26,
267,
1318,
14,
740,
8,
85,
6808,
85,
6513,
2,
450,
4696,
9,
272,
340,
9395,
26,
267,
1318,
14,
740,
8,
85,
6808,
85,
1748,
2,
450,
9395,
9,
272,
340,
10857,
26,
267,
1318,
14,
740,
8,
28234,
3647,
85,
6925,
401,
2071,
85,
10857,
401,
10857,
9,
450,
10857,
9,
339,
327,
577,
5758,
272,
17399,
12,
7609,
275,
16438,
8,
3136,
14,
4899,
12,
28046,
9,
272,
340,
7609,
26,
267,
1318,
14,
740,
8,
28234,
3647,
85,
5382,
401,
2071,
85,
7609,
401,
7609,
9,
450,
7609,
9,
272,
340,
17399,
26,
267,
1318,
14,
740,
8,
28234,
3647,
85,
5361,
401,
2071,
85,
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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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
] |
iraghumitra/incubator-metron
|
metron-deployment/packaging/ambari/elasticsearch-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/params.py
|
17
|
6818
|
#!/usr/bin/env python
"""
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.
"""
from resource_management.libraries.script import Script
def yamlify_variables(var) :
if isinstance(var, type(True)):
return str(var).lower()
else:
return var
# server configurations
config = Script.get_config()
masters_also_are_datanodes = config['configurations']['elastic-site']['masters_also_are_datanodes']
elastic_home = config['configurations']['elastic-sysconfig']['elastic_home']
data_dir = config['configurations']['elastic-sysconfig']['data_dir']
work_dir = config['configurations']['elastic-sysconfig']['work_dir']
conf_dir = config['configurations']['elastic-sysconfig']['conf_dir']
heap_size = config['configurations']['elastic-sysconfig']['heap_size']
max_open_files = config['configurations']['elastic-sysconfig']['max_open_files']
max_map_count = config['configurations']['elastic-sysconfig']['max_map_count']
elastic_user = config['configurations']['elastic-env']['elastic_user']
elastic_group = config['configurations']['elastic-env']['elastic_group']
log_dir = config['configurations']['elastic-env']['elastic_log_dir']
pid_dir = config['configurations']['elastic-env']['elastic_pid_dir']
hostname = config['hostname']
java64_home = config['hostLevelParams']['java_home']
elastic_env_sh_template = config['configurations']['elastic-env']['content']
sysconfig_template = config['configurations']['elastic-sysconfig']['content']
cluster_name = config['configurations']['elastic-site']['cluster_name']
zen_discovery_ping_unicast_hosts = config['configurations']['elastic-site']['zen_discovery_ping_unicast_hosts']
path_data = config['configurations']['elastic-site']['path_data']
http_cors_enabled = config['configurations']['elastic-site']['http_cors_enabled']
http_port = config['configurations']['elastic-site']['http_port']
transport_tcp_port = config['configurations']['elastic-site']['transport_tcp_port']
recover_after_time = config['configurations']['elastic-site']['recover_after_time']
gateway_recover_after_data_nodes = config['configurations']['elastic-site']['gateway_recover_after_data_nodes']
expected_data_nodes = config['configurations']['elastic-site']['expected_data_nodes']
index_merge_scheduler_max_thread_count = config['configurations']['elastic-site']['index_merge_scheduler_max_thread_count']
index_translog_flush_threshold_size = config['configurations']['elastic-site']['index_translog_flush_threshold_size']
index_refresh_interval = config['configurations']['elastic-site']['index_refresh_interval']
indices_memory_index_store_throttle_type = config['configurations']['elastic-site']['indices_memory_index_store_throttle_type']
index_number_of_shards = config['configurations']['elastic-site']['index_number_of_shards']
index_number_of_replicas = config['configurations']['elastic-site']['index_number_of_replicas']
indices_memory_index_buffer_size = config['configurations']['elastic-site']['indices_memory_index_buffer_size']
bootstrap_memory_lock = yamlify_variables(config['configurations']['elastic-site']['bootstrap_memory_lock'])
threadpool_bulk_queue_size = config['configurations']['elastic-site']['threadpool_bulk_queue_size']
cluster_routing_allocation_node_concurrent_recoveries = config['configurations']['elastic-site']['cluster_routing_allocation_node_concurrent_recoveries']
cluster_routing_allocation_disk_watermark_low = config['configurations']['elastic-site']['cluster_routing_allocation_disk_watermark_low']
cluster_routing_allocation_disk_threshold_enabled = yamlify_variables(config['configurations']['elastic-site']['cluster_routing_allocation_disk_threshold_enabled'])
cluster_routing_allocation_disk_watermark_high = config['configurations']['elastic-site']['cluster_routing_allocation_disk_watermark_high']
indices_fielddata_cache_size = config['configurations']['elastic-site']['indices_fielddata_cache_size']
indices_cluster_send_refresh_mapping = yamlify_variables(config['configurations']['elastic-site']['indices_cluster_send_refresh_mapping'])
threadpool_index_queue_size = config['configurations']['elastic-site']['threadpool_index_queue_size']
discovery_zen_ping_timeout = config['configurations']['elastic-site']['discovery_zen_ping_timeout']
discovery_zen_fd_ping_interval = config['configurations']['elastic-site']['discovery_zen_fd_ping_interval']
discovery_zen_fd_ping_timeout = config['configurations']['elastic-site']['discovery_zen_fd_ping_timeout']
discovery_zen_fd_ping_retries = config['configurations']['elastic-site']['discovery_zen_fd_ping_retries']
network_host = config['configurations']['elastic-site']['network_host']
network_publish_host = config['configurations']['elastic-site']['network_publish_host']
limits_conf_dir = "/etc/security/limits.d"
limits_conf_file = limits_conf_dir + "/elasticsearch.conf"
elastic_user_nofile_limit = config['configurations']['elastic-env']['elastic_user_nofile_limit']
elastic_user_nproc_limit = config['configurations']['elastic-env']['elastic_user_nproc_limit']
elastic_user_memlock_soft_limit = config['configurations']['elastic-env']['elastic_user_memlock_soft_limit']
elastic_user_memlock_hard_limit = config['configurations']['elastic-env']['elastic_user_memlock_hard_limit']
# the status check (service elasticsearch status) cannot be run by the 'elasticsearch'
# user due to the default permissions that are set when the package is installed. the
# status check must be run as root
elastic_status_check_user = 'root'
# when using the RPM or Debian packages on systems that use systemd, system limits
# must be specified via systemd.
# see https://www.elastic.co/guide/en/elasticsearch/reference/5.6/setting-system-settings.html#systemd
systemd_parent_dir = '/etc/systemd/system/'
systemd_elasticsearch_dir = systemd_parent_dir + 'elasticsearch.service.d/'
systemd_override_file = systemd_elasticsearch_dir + 'override.conf'
systemd_override_template = config['configurations']['elastic-systemd']['content']
heap_size = config['configurations']['elastic-jvm-options']['heap_size']
jvm_options_template = config['configurations']['elastic-jvm-options']['content']
|
apache-2.0
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
624,
199,
31661,
370,
314,
3668,
2290,
2752,
334,
14950,
9,
1334,
1373,
199,
269,
1655,
11615,
4190,
14024,
14,
221,
1666,
314,
12840,
570,
199,
16832,
543,
642,
1736,
367,
4722,
2556,
199,
1135,
1005,
316,
4248,
12715,
14,
221,
710,
14857,
12378,
642,
570,
199,
475,
1265,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
199,
2,
3761,
3547,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
199,
1045,
314,
844,
14,
221,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
339,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
199,
5524,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
16832,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
29946,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
9295,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3097,
1298,
1334,
314,
844,
14,
199,
199,
624,
199,
199,
504,
2073,
63,
8110,
14,
10159,
14,
1579,
492,
14914,
199,
199,
318,
612,
455,
8209,
63,
3669,
8,
1391,
9,
520,
523,
340,
1228,
8,
1391,
12,
730,
8,
549,
2298,
272,
372,
620,
8,
1391,
680,
2325,
342,
523,
587,
26,
272,
372,
2729,
199,
199,
3,
1654,
13422,
199,
888,
275,
14914,
14,
362,
63,
888,
342,
199,
199,
5892,
878,
63,
12344,
63,
1530,
63,
4616,
290,
380,
83,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
5892,
878,
63,
12344,
63,
1530,
63,
4616,
290,
380,
83,
418,
199,
15565,
63,
4219,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
15565,
63,
4219,
418,
199,
576,
63,
694,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
576,
63,
694,
418,
199,
800,
63,
694,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
800,
63,
694,
418,
199,
2190,
63,
694,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
2190,
63,
694,
418,
199,
12492,
63,
890,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
12492,
63,
890,
418,
199,
988,
63,
1490,
63,
1725,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
988,
63,
1490,
63,
1725,
418,
199,
988,
63,
1130,
63,
835,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
988,
63,
1130,
63,
835,
418,
199,
199,
15565,
63,
751,
275,
1101,
459,
10057,
2545,
15565,
13,
1813,
2545,
15565,
63,
751,
418,
199,
15565,
63,
923,
275,
1101,
459,
10057,
2545,
15565,
13,
1813,
2545,
15565,
63,
923,
418,
199,
793,
63,
694,
275,
1101,
459,
10057,
2545,
15565,
13,
1813,
2545,
15565,
63,
793,
63,
694,
418,
199,
3150,
63,
694,
275,
1101,
459,
10057,
2545,
15565,
13,
1813,
2545,
15565,
63,
3150,
63,
694,
418,
199,
199,
4269,
275,
1101,
459,
4269,
418,
199,
6138,
772,
63,
4219,
275,
1101,
459,
1102,
4670,
6007,
2545,
6138,
63,
4219,
418,
199,
15565,
63,
1813,
63,
609,
63,
1160,
275,
1101,
459,
10057,
2545,
15565,
13,
1813,
2545,
1317,
418,
199,
24030,
63,
1160,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
1317,
418,
199,
199,
4201,
63,
354,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
4201,
63,
354,
418,
199,
5193,
63,
14859,
63,
4073,
63,
5209,
1810,
63,
5146,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
5193,
63,
14859,
63,
4073,
63,
5209,
1810,
63,
5146,
418,
199,
199,
515,
63,
576,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
515,
63,
576,
418,
199,
1014,
63,
30967,
63,
3827,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1014,
63,
30967,
63,
3827,
418,
199,
1014,
63,
719,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1014,
63,
719,
418,
199,
5545,
63,
8815,
63,
719,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
5545,
63,
8815,
63,
719,
418,
199,
199,
23131,
63,
4399,
63,
521,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
23131,
63,
4399,
63,
521,
418,
199,
7019,
63,
23131,
63,
4399,
63,
576,
63,
2415,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
7019,
63,
23131,
63,
4399,
63,
576,
63,
2415,
418,
199,
2062,
63,
576,
63,
2415,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
2062,
63,
576,
63,
2415,
418,
199,
1080,
63,
5628,
63,
8874,
63,
988,
63,
2671,
63,
835,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1080,
63,
5628,
63,
8874,
63,
988,
63,
2671,
63,
835,
418,
199,
1080,
63,
1515,
793,
63,
4939,
63,
7227,
63,
890,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1080,
63,
1515,
793,
63,
4939,
63,
7227,
63,
890,
418,
199,
1080,
63,
6635,
63,
4284,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1080,
63,
6635,
63,
4284,
418,
199,
4108,
63,
4844,
63,
1080,
63,
1617,
63,
20086,
63,
466,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
4108,
63,
4844,
63,
1080,
63,
1617,
63,
20086,
63,
466,
418,
199,
1080,
63,
1955,
63,
1618,
63,
15570,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1080,
63,
1955,
63,
1618,
63,
15570,
418,
199,
1080,
63,
1955,
63,
1618,
63,
16755,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1080,
63,
1955,
63,
1618,
63,
16755,
418,
199,
4108,
63,
4844,
63,
1080,
63,
2738,
63,
890,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
4108,
63,
4844,
63,
1080,
63,
2738,
63,
890,
418,
199,
11146,
63,
4844,
63,
831,
275,
612,
455,
8209,
63,
3669,
8,
888,
459,
10057,
2545,
15565,
13,
2124,
2545,
11146,
63,
4844,
63,
831,
1105,
199,
2671,
2293,
63,
9377,
63,
1825,
63,
890,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
2671,
2293,
63,
9377,
63,
1825,
63,
890,
418,
199,
4201,
63,
9492,
63,
14940,
63,
932,
63,
27237,
63,
23131,
1500,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
4201,
63,
9492,
63,
14940,
63,
932,
63,
27237,
63,
23131,
1500,
418,
199,
4201,
63,
9492,
63,
14940,
63,
4032,
63,
17217
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
624,
199,
31661,
370,
314,
3668,
2290,
2752,
334,
14950,
9,
1334,
1373,
199,
269,
1655,
11615,
4190,
14024,
14,
221,
1666,
314,
12840,
570,
199,
16832,
543,
642,
1736,
367,
4722,
2556,
199,
1135,
1005,
316,
4248,
12715,
14,
221,
710,
14857,
12378,
642,
570,
199,
475,
1265,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
199,
2,
3761,
3547,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
199,
1045,
314,
844,
14,
221,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
339,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
199,
5524,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
16832,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
29946,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
9295,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3097,
1298,
1334,
314,
844,
14,
199,
199,
624,
199,
199,
504,
2073,
63,
8110,
14,
10159,
14,
1579,
492,
14914,
199,
199,
318,
612,
455,
8209,
63,
3669,
8,
1391,
9,
520,
523,
340,
1228,
8,
1391,
12,
730,
8,
549,
2298,
272,
372,
620,
8,
1391,
680,
2325,
342,
523,
587,
26,
272,
372,
2729,
199,
199,
3,
1654,
13422,
199,
888,
275,
14914,
14,
362,
63,
888,
342,
199,
199,
5892,
878,
63,
12344,
63,
1530,
63,
4616,
290,
380,
83,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
5892,
878,
63,
12344,
63,
1530,
63,
4616,
290,
380,
83,
418,
199,
15565,
63,
4219,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
15565,
63,
4219,
418,
199,
576,
63,
694,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
576,
63,
694,
418,
199,
800,
63,
694,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
800,
63,
694,
418,
199,
2190,
63,
694,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
2190,
63,
694,
418,
199,
12492,
63,
890,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
12492,
63,
890,
418,
199,
988,
63,
1490,
63,
1725,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
988,
63,
1490,
63,
1725,
418,
199,
988,
63,
1130,
63,
835,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
988,
63,
1130,
63,
835,
418,
199,
199,
15565,
63,
751,
275,
1101,
459,
10057,
2545,
15565,
13,
1813,
2545,
15565,
63,
751,
418,
199,
15565,
63,
923,
275,
1101,
459,
10057,
2545,
15565,
13,
1813,
2545,
15565,
63,
923,
418,
199,
793,
63,
694,
275,
1101,
459,
10057,
2545,
15565,
13,
1813,
2545,
15565,
63,
793,
63,
694,
418,
199,
3150,
63,
694,
275,
1101,
459,
10057,
2545,
15565,
13,
1813,
2545,
15565,
63,
3150,
63,
694,
418,
199,
199,
4269,
275,
1101,
459,
4269,
418,
199,
6138,
772,
63,
4219,
275,
1101,
459,
1102,
4670,
6007,
2545,
6138,
63,
4219,
418,
199,
15565,
63,
1813,
63,
609,
63,
1160,
275,
1101,
459,
10057,
2545,
15565,
13,
1813,
2545,
1317,
418,
199,
24030,
63,
1160,
275,
1101,
459,
10057,
2545,
15565,
13,
24030,
2545,
1317,
418,
199,
199,
4201,
63,
354,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
4201,
63,
354,
418,
199,
5193,
63,
14859,
63,
4073,
63,
5209,
1810,
63,
5146,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
5193,
63,
14859,
63,
4073,
63,
5209,
1810,
63,
5146,
418,
199,
199,
515,
63,
576,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
515,
63,
576,
418,
199,
1014,
63,
30967,
63,
3827,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1014,
63,
30967,
63,
3827,
418,
199,
1014,
63,
719,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1014,
63,
719,
418,
199,
5545,
63,
8815,
63,
719,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
5545,
63,
8815,
63,
719,
418,
199,
199,
23131,
63,
4399,
63,
521,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
23131,
63,
4399,
63,
521,
418,
199,
7019,
63,
23131,
63,
4399,
63,
576,
63,
2415,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
7019,
63,
23131,
63,
4399,
63,
576,
63,
2415,
418,
199,
2062,
63,
576,
63,
2415,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
2062,
63,
576,
63,
2415,
418,
199,
1080,
63,
5628,
63,
8874,
63,
988,
63,
2671,
63,
835,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1080,
63,
5628,
63,
8874,
63,
988,
63,
2671,
63,
835,
418,
199,
1080,
63,
1515,
793,
63,
4939,
63,
7227,
63,
890,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1080,
63,
1515,
793,
63,
4939,
63,
7227,
63,
890,
418,
199,
1080,
63,
6635,
63,
4284,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1080,
63,
6635,
63,
4284,
418,
199,
4108,
63,
4844,
63,
1080,
63,
1617,
63,
20086,
63,
466,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
4108,
63,
4844,
63,
1080,
63,
1617,
63,
20086,
63,
466,
418,
199,
1080,
63,
1955,
63,
1618,
63,
15570,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1080,
63,
1955,
63,
1618,
63,
15570,
418,
199,
1080,
63,
1955,
63,
1618,
63,
16755,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
1080,
63,
1955,
63,
1618,
63,
16755,
418,
199,
4108,
63,
4844,
63,
1080,
63,
2738,
63,
890,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
4108,
63,
4844,
63,
1080,
63,
2738,
63,
890,
418,
199,
11146,
63,
4844,
63,
831,
275,
612,
455,
8209,
63,
3669,
8,
888,
459,
10057,
2545,
15565,
13,
2124,
2545,
11146,
63,
4844,
63,
831,
1105,
199,
2671,
2293,
63,
9377,
63,
1825,
63,
890,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
2671,
2293,
63,
9377,
63,
1825,
63,
890,
418,
199,
4201,
63,
9492,
63,
14940,
63,
932,
63,
27237,
63,
23131,
1500,
275,
1101,
459,
10057,
2545,
15565,
13,
2124,
2545,
4201,
63,
9492,
63,
14940,
63,
932,
63,
27237,
63,
23131,
1500,
418,
199,
4201,
63,
9492,
63,
14940,
63,
4032,
63,
17217,
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,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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
] |
simvisage/oricreate
|
oricreate/gu/gu_dofs.py
|
1
|
2557
|
'''
#-------------------------------------------------------------------------------
#
# Copyright (c) 2009, IMB, RWTH Aachen.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in simvisage/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license. The license
# is also available online at http://www.simvisage.com/licenses/BSD.txt
#
# Thanks for using Simvisage open source!
#
# Created on Apr 25, 2013
'''
import collections
import types
import numpy as np
def _broadcast_nd(n, d):
'''Construct the combination of supplied node and dimension indexes.
'''
nodes, dirs = n, d
if isinstance(nodes, (int, np.int_)):
nodes = np.array([n], dtype='int')
elif isinstance(nodes, collections.Container):
nodes = np.array(list(nodes), np.int_)
if isinstance(dirs, (int, np.int_)):
dirs = np.array([d], dtype='int')
elif isinstance(dirs, collections.Container):
dirs = np.array(list(dirs), dtype=np.int_)
return np.broadcast(nodes[None, :], dirs[:, None])
def fix(nodes, dirs, fn=None):
'''Return constraints corresponding to the specified arrys of nodes and dirs.
For example, given the call::
fix([2,4],[0,1])
defines the dof_constraints of the form:
[([(2, 0, 1.0)], 0.0, None ), ([(2, 1, 1.0)], 0.0, None ),
([(4, 0, 1.0)], 0.0, None), ([(4, 1, 1.0)], 0.0, None ),]
The structure of the dof_constraints list
is explained here :class:`DofConstraints`
'''
return [([(n, d, 1.0)], fn) for n, d in _broadcast_nd(nodes, dirs)]
def link(nodes1, dirs1, c1, nodes2, dirs2, c2, fn=None):
'''Return constraints corresponding to the specified arrys of nodes and dirs.
For example, given the call::
link([2,4],[0],1.0,[0,1],[0],-1.0)
defines the dof_constraints of the form:
[([(2, 0, 1.0), (0, 0, -1.0)], -1.0),
([(4, 0, 1.0), (1, 0, -1.0)], -1.0)]
The structure of the dof_constraints list
is explained here :class:`DofConstraints`
'''
print('BROADCAST')
print(nodes1)
print(dirs1)
bc_dofs1 = np.array([[n, d] for n, d in _broadcast_nd(nodes1, dirs1)])
print(nodes2)
print(dirs2)
bc_dofs2 = np.array([[n, d] for n, d in _broadcast_nd(nodes2, dirs2)])
bc_linked_dofs = np.broadcast_arrays(bc_dofs1,
bc_dofs2)
return [([(n1, d1, c1), (n2, d2, c2)], fn)
for (n1, d1), (n2, d2) in zip(*bc_linked_dofs)]
|
gpl-3.0
|
[
2344,
199,
7656,
18964,
199,
3,
199,
3,
1898,
334,
67,
9,
8937,
12,
473,
4567,
12,
820,
55,
2080,
437,
1225,
287,
14,
199,
3,
2900,
4481,
4644,
14,
199,
3,
199,
3,
961,
2032,
365,
2741,
1928,
3750,
1334,
314,
2895,
402,
314,
6289,
199,
3,
4190,
5120,
315,
4389,
5068,
474,
15,
3961,
14,
2424,
436,
1443,
506,
295,
16832,
1454,
199,
3,
1334,
314,
3704,
11736,
315,
314,
282,
1707,
32016,
379,
4190,
14,
221,
710,
4190,
199,
3,
365,
2597,
2808,
18470,
737,
1455,
921,
1544,
14,
5206,
5068,
474,
14,
957,
15,
2383,
15,
15400,
14,
2424,
199,
3,
199,
3,
3868,
25088,
367,
1808,
10751,
5068,
474,
1551,
1350,
1,
199,
3,
199,
3,
18208,
641,
437,
2700,
5661,
12,
6171,
199,
199,
2344,
199,
199,
646,
5055,
199,
646,
2943,
199,
199,
646,
2680,
465,
980,
421,
199,
318,
485,
10786,
63,
977,
8,
78,
12,
366,
304,
272,
1449,
11493,
314,
14665,
402,
6841,
1031,
436,
6240,
10507,
14,
272,
1449,
272,
3380,
12,
7606,
275,
302,
12,
366,
272,
340,
1228,
8,
2415,
12,
334,
442,
12,
980,
14,
442,
63,
2298,
267,
3380,
275,
980,
14,
1144,
779,
78,
467,
2152,
534,
442,
358,
272,
916,
1228,
8,
2415,
12,
5055,
14,
4076,
304,
267,
3380,
275,
980,
14,
1144,
8,
513,
8,
2415,
395,
980,
14,
442,
4602,
339,
340,
1228,
8,
3220,
12,
334,
442,
12,
980,
14,
442,
63,
2298,
267,
7606,
275,
980,
14,
1144,
779,
68,
467,
2152,
534,
442,
358,
272,
916,
1228,
8,
3220,
12,
5055,
14,
4076,
304,
267,
7606,
275,
980,
14,
1144,
8,
513,
8,
3220,
395,
2152,
29,
1590,
14,
442,
4602,
272,
372,
980,
14,
10786,
8,
2415,
59,
403,
12,
26450,
7606,
3981,
488,
566,
421,
199,
318,
5325,
8,
2415,
12,
7606,
12,
4325,
29,
403,
304,
272,
1449,
1767,
9565,
5226,
370,
314,
2013,
7953,
588,
402,
3380,
436,
7606,
14,
339,
2104,
2893,
12,
1627,
314,
1240,
447,
398,
5325,
779,
18,
12,
20,
6922,
16,
12,
17,
566,
339,
7890,
314,
886,
70,
63,
9882,
402,
314,
1824,
26,
339,
359,
7694,
18,
12,
378,
12,
413,
14,
16,
4360,
378,
14,
16,
12,
488,
2318,
7287,
8,
18,
12,
413,
12,
413,
14,
16,
4360,
378,
14,
16,
12,
488,
2318,
1362,
7287,
8,
20,
12,
378,
12,
413,
14,
16,
4360,
378,
14,
16,
12,
488,
395,
7287,
8,
20,
12,
413,
12,
413,
14,
16,
4360,
378,
14,
16,
12,
488,
2318,
61,
339,
710,
5523,
402,
314,
886,
70,
63,
9882,
769,
272,
365,
1437,
23918,
2348,
520,
533,
1705,
36,
1618,
21007,
64,
272,
1449,
272,
372,
359,
7694,
78,
12,
366,
12,
413,
14,
16,
4360,
4325,
9,
367,
302,
12,
366,
315,
485,
10786,
63,
977,
8,
2415,
12,
7606,
1874,
421,
199,
318,
2142,
8,
2415,
17,
12,
7606,
17,
12,
286,
17,
12,
3380,
18,
12,
7606,
18,
12,
286,
18,
12,
4325,
29,
403,
304,
272,
1449,
1767,
9565,
5226,
370,
314,
2013,
7953,
588,
402,
3380,
436,
7606,
14,
339,
2104,
2893,
12,
1627,
314,
1240,
447,
398,
2142,
779,
18,
12,
20,
6922,
16,
467,
17,
14,
16,
14343,
16,
12,
17,
6922,
16,
467,
13,
17,
14,
16,
9,
339,
7890,
314,
886,
70,
63,
9882,
402,
314,
1824,
26,
339,
359,
7694,
18,
12,
378,
12,
413,
14,
16,
395,
334,
16,
12,
378,
12,
446,
17,
14,
16,
4360,
446,
17,
14,
16,
395,
1362,
7287,
8,
20,
12,
378,
12,
413,
14,
16,
395,
334,
17,
12,
378,
12,
446,
17,
14,
16,
4360,
446,
17,
14,
16,
1874,
339,
710,
5523,
402,
314,
886,
70,
63,
9882,
769,
272,
365,
1437,
23918,
2348,
520,
533,
1705,
36,
1618,
21007,
64,
272,
1449,
272,
870,
360,
21111,
32215,
358,
272,
870,
8,
2415,
17,
9,
272,
870,
8,
3220,
17,
9,
272,
16604,
63,
1117,
2319,
17,
275,
980,
14,
1144,
4038,
78,
12,
366,
61,
367,
302,
12,
366,
315,
485,
10786,
63,
977,
8,
2415,
17,
12,
7606,
17,
3948,
272,
870,
8,
2415,
18,
9,
272,
870,
8,
3220,
18,
9,
272,
16604,
63,
1117,
2319,
18,
275,
980,
14,
1144,
4038,
78,
12,
366,
61,
367,
302,
12,
366,
315,
485,
10786,
63,
977,
8,
2415,
18,
12,
7606,
18,
3948,
272,
16604,
63,
12751,
63,
1117,
2319,
275,
980,
14,
10786,
63,
10095,
8,
3776,
63,
1117,
2319,
17,
12,
1460,
16604,
63,
1117,
2319,
18,
9,
272,
372,
359,
7694,
78,
17,
12,
366,
17,
12,
286,
17,
395,
334,
78,
18,
12,
366,
18,
12,
286,
18,
4360,
4325,
9,
288,
367,
334,
78,
17,
12,
366,
17,
395,
334,
78,
18,
12,
366,
18,
9,
315,
3482,
2031,
3776,
63,
12751,
63,
1117,
2319,
1874,
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
] |
[
199,
7656,
18964,
199,
3,
199,
3,
1898,
334,
67,
9,
8937,
12,
473,
4567,
12,
820,
55,
2080,
437,
1225,
287,
14,
199,
3,
2900,
4481,
4644,
14,
199,
3,
199,
3,
961,
2032,
365,
2741,
1928,
3750,
1334,
314,
2895,
402,
314,
6289,
199,
3,
4190,
5120,
315,
4389,
5068,
474,
15,
3961,
14,
2424,
436,
1443,
506,
295,
16832,
1454,
199,
3,
1334,
314,
3704,
11736,
315,
314,
282,
1707,
32016,
379,
4190,
14,
221,
710,
4190,
199,
3,
365,
2597,
2808,
18470,
737,
1455,
921,
1544,
14,
5206,
5068,
474,
14,
957,
15,
2383,
15,
15400,
14,
2424,
199,
3,
199,
3,
3868,
25088,
367,
1808,
10751,
5068,
474,
1551,
1350,
1,
199,
3,
199,
3,
18208,
641,
437,
2700,
5661,
12,
6171,
199,
199,
2344,
199,
199,
646,
5055,
199,
646,
2943,
199,
199,
646,
2680,
465,
980,
421,
199,
318,
485,
10786,
63,
977,
8,
78,
12,
366,
304,
272,
1449,
11493,
314,
14665,
402,
6841,
1031,
436,
6240,
10507,
14,
272,
1449,
272,
3380,
12,
7606,
275,
302,
12,
366,
272,
340,
1228,
8,
2415,
12,
334,
442,
12,
980,
14,
442,
63,
2298,
267,
3380,
275,
980,
14,
1144,
779,
78,
467,
2152,
534,
442,
358,
272,
916,
1228,
8,
2415,
12,
5055,
14,
4076,
304,
267,
3380,
275,
980,
14,
1144,
8,
513,
8,
2415,
395,
980,
14,
442,
4602,
339,
340,
1228,
8,
3220,
12,
334,
442,
12,
980,
14,
442,
63,
2298,
267,
7606,
275,
980,
14,
1144,
779,
68,
467,
2152,
534,
442,
358,
272,
916,
1228,
8,
3220,
12,
5055,
14,
4076,
304,
267,
7606,
275,
980,
14,
1144,
8,
513,
8,
3220,
395,
2152,
29,
1590,
14,
442,
4602,
272,
372,
980,
14,
10786,
8,
2415,
59,
403,
12,
26450,
7606,
3981,
488,
566,
421,
199,
318,
5325,
8,
2415,
12,
7606,
12,
4325,
29,
403,
304,
272,
1449,
1767,
9565,
5226,
370,
314,
2013,
7953,
588,
402,
3380,
436,
7606,
14,
339,
2104,
2893,
12,
1627,
314,
1240,
447,
398,
5325,
779,
18,
12,
20,
6922,
16,
12,
17,
566,
339,
7890,
314,
886,
70,
63,
9882,
402,
314,
1824,
26,
339,
359,
7694,
18,
12,
378,
12,
413,
14,
16,
4360,
378,
14,
16,
12,
488,
2318,
7287,
8,
18,
12,
413,
12,
413,
14,
16,
4360,
378,
14,
16,
12,
488,
2318,
1362,
7287,
8,
20,
12,
378,
12,
413,
14,
16,
4360,
378,
14,
16,
12,
488,
395,
7287,
8,
20,
12,
413,
12,
413,
14,
16,
4360,
378,
14,
16,
12,
488,
2318,
61,
339,
710,
5523,
402,
314,
886,
70,
63,
9882,
769,
272,
365,
1437,
23918,
2348,
520,
533,
1705,
36,
1618,
21007,
64,
272,
1449,
272,
372,
359,
7694,
78,
12,
366,
12,
413,
14,
16,
4360,
4325,
9,
367,
302,
12,
366,
315,
485,
10786,
63,
977,
8,
2415,
12,
7606,
1874,
421,
199,
318,
2142,
8,
2415,
17,
12,
7606,
17,
12,
286,
17,
12,
3380,
18,
12,
7606,
18,
12,
286,
18,
12,
4325,
29,
403,
304,
272,
1449,
1767,
9565,
5226,
370,
314,
2013,
7953,
588,
402,
3380,
436,
7606,
14,
339,
2104,
2893,
12,
1627,
314,
1240,
447,
398,
2142,
779,
18,
12,
20,
6922,
16,
467,
17,
14,
16,
14343,
16,
12,
17,
6922,
16,
467,
13,
17,
14,
16,
9,
339,
7890,
314,
886,
70,
63,
9882,
402,
314,
1824,
26,
339,
359,
7694,
18,
12,
378,
12,
413,
14,
16,
395,
334,
16,
12,
378,
12,
446,
17,
14,
16,
4360,
446,
17,
14,
16,
395,
1362,
7287,
8,
20,
12,
378,
12,
413,
14,
16,
395,
334,
17,
12,
378,
12,
446,
17,
14,
16,
4360,
446,
17,
14,
16,
1874,
339,
710,
5523,
402,
314,
886,
70,
63,
9882,
769,
272,
365,
1437,
23918,
2348,
520,
533,
1705,
36,
1618,
21007,
64,
272,
1449,
272,
870,
360,
21111,
32215,
358,
272,
870,
8,
2415,
17,
9,
272,
870,
8,
3220,
17,
9,
272,
16604,
63,
1117,
2319,
17,
275,
980,
14,
1144,
4038,
78,
12,
366,
61,
367,
302,
12,
366,
315,
485,
10786,
63,
977,
8,
2415,
17,
12,
7606,
17,
3948,
272,
870,
8,
2415,
18,
9,
272,
870,
8,
3220,
18,
9,
272,
16604,
63,
1117,
2319,
18,
275,
980,
14,
1144,
4038,
78,
12,
366,
61,
367,
302,
12,
366,
315,
485,
10786,
63,
977,
8,
2415,
18,
12,
7606,
18,
3948,
272,
16604,
63,
12751,
63,
1117,
2319,
275,
980,
14,
10786,
63,
10095,
8,
3776,
63,
1117,
2319,
17,
12,
1460,
16604,
63,
1117,
2319,
18,
9,
272,
372,
359,
7694,
78,
17,
12,
366,
17,
12,
286,
17,
395,
334,
78,
18,
12,
366,
18,
12,
286,
18,
4360,
4325,
9,
288,
367,
334,
78,
17,
12,
366,
17,
395,
334,
78,
18,
12,
366,
18,
9,
315,
3482,
2031,
3776,
63,
12751,
63,
1117,
2319,
1874,
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,
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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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
] |
Scriptopathe/simso-exp
|
clientapi/doc/source/conf.py
|
1
|
8209
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# simsoexp documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 28 16:53:27 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
sys.path += ["../"]
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'simsoexp'
copyright = '2015, Josué Alvarez'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'simsoexpdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'simsoexp.tex', 'simsoexp Documentation',
'Josué Alvarez', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'simsoexp', 'simsoexp Documentation',
['Josué Alvarez'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'simsoexp', 'simsoexp Documentation',
'Josué Alvarez', 'simsoexp', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
|
bsd-2-clause
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
19,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
308,
11171,
79,
1474,
3794,
1900,
2897,
570,
12,
2737,
701,
199,
3,
15882,
13,
28957,
641,
377,
310,
1603,
348,
7294,
3193,
26,
2481,
26,
1465,
6900,
14,
199,
3,
199,
3,
961,
570,
365,
22711,
342,
68,
543,
314,
1453,
2082,
663,
370,
2399,
199,
3,
3035,
2935,
14,
199,
3,
199,
3,
3390,
626,
440,
1006,
3962,
2897,
1338,
787,
3451,
315,
642,
199,
3,
18392,
570,
14,
199,
3,
199,
3,
2900,
2897,
1338,
1172,
282,
849,
27,
1338,
626,
787,
21804,
734,
199,
3,
14062,
370,
2498,
314,
849,
14,
199,
199,
646,
984,
199,
646,
747,
199,
199,
1274,
14,
515,
847,
2097,
5093,
937,
199,
3,
982,
5478,
334,
269,
4621,
370,
2213,
543,
29973,
9,
787,
315,
4573,
2082,
12,
199,
3,
1050,
3520,
6602,
370,
984,
14,
515,
2348,
14,
982,
314,
2082,
365,
3847,
370,
314,
199,
3,
3794,
1738,
12,
675,
747,
14,
515,
14,
4832,
370,
1852,
652,
3679,
12,
2839,
9164,
2348,
14,
199,
3,
1274,
14,
515,
14,
3176,
8,
16,
12,
747,
14,
515,
14,
4832,
24535,
199,
199,
3,
1553,
1696,
2897,
9527,
199,
199,
3,
982,
2195,
3794,
4839,
282,
13460,
10229,
1015,
12,
1174,
652,
2348,
14,
199,
3,
10065,
63,
8008,
275,
283,
17,
14,
16,
7,
199,
199,
3,
2654,
1263,
10229,
3329,
859,
1561,
2348,
12,
465,
3326,
14,
9322,
883,
506,
199,
3,
5478,
17262,
543,
10229,
334,
4579,
283,
8008,
14,
832,
24915,
503,
2195,
3537,
199,
3,
7869,
14,
199,
5359,
275,
359,
272,
283,
8008,
14,
832,
14,
28056,
297,
199,
61,
199,
199,
3,
2654,
1263,
3792,
626,
1395,
7009,
2348,
12,
3847,
370,
642,
2082,
14,
199,
5876,
63,
515,
275,
4044,
5876,
418,
199,
199,
3,
710,
4739,
402,
1350,
6203,
14,
199,
1365,
63,
4511,
275,
1987,
8332,
7,
199,
199,
3,
710,
2644,
402,
1350,
1584,
14,
199,
3,
1365,
63,
2991,
275,
283,
1624,
13,
24,
13,
4093,
7,
199,
199,
3,
710,
5288,
28310,
2213,
14,
199,
4133,
63,
1301,
275,
283,
1080,
7,
199,
199,
3,
1696,
2556,
3595,
314,
2199,
14,
199,
1715,
275,
283,
338,
706,
79,
1474,
7,
199,
7307,
275,
283,
7806,
12,
1603,
736,
85,
5741,
4580,
86,
1530,
90,
7,
199,
199,
3,
710,
1015,
2256,
367,
314,
2199,
1265,
3984,
29904,
12,
17795,
465,
8343,
367,
199,
3,
1204,
1023,
92,
436,
1204,
3221,
18712,
2597,
1202,
315,
7750,
1163,
9825,
23088,
314,
199,
3,
6137,
8247,
14,
199,
3,
199,
3,
710,
3974,
1323,
14,
57,
1015,
14,
199,
1023,
275,
283,
17,
14,
16,
7,
199,
3,
710,
2615,
1015,
12,
5893,
5131,
15,
5683,
15,
1195,
3762,
14,
199,
3221,
275,
283,
16,
7,
199,
199,
3,
710,
2637,
367,
1564,
18392,
701,
10229,
14,
21751,
370,
3794,
199,
3,
367,
282,
769,
402,
3748,
10815,
14,
199,
3,
3671,
275,
488,
199,
199,
3,
6006,
787,
2877,
1511,
367,
15810,
1204,
8136,
25004,
1902,
12,
1265,
663,
11168,
370,
2005,
199,
3,
2222,
13,
3910,
574,
12,
2066,
652,
365,
1202,
26,
199,
3,
8136,
275,
2125,
199,
3,
19524,
12,
11168,
63,
5045,
365,
1202,
465,
314,
1475,
367,
282,
14053,
1240,
14,
199,
3,
8136,
63,
5045,
275,
1543,
34,
450,
68,
12,
450,
57,
7,
199,
199,
3,
3820,
402,
7970,
12,
3847,
370,
1350,
2082,
12,
626,
1336,
1584,
436,
199,
3,
6602,
370,
3686,
1380,
10023,
367,
1350,
1584,
14,
199,
5473,
63,
7435,
275,
942,
199,
199,
3,
710,
20883,
849,
4719,
334,
2972,
367,
642,
9189,
26,
658,
505,
10522,
370,
675,
367,
1006,
199,
3,
8247,
14,
199,
3,
885,
63,
3756,
275,
488,
199,
199,
3,
982,
2549,
12,
26380,
911,
506,
11544,
370,
520,
1532,
26,
5423,
14,
8059,
13,
4443,
1318,
14,
199,
3,
525,
63,
1593,
63,
25510,
275,
715,
199,
199,
3,
982,
2549,
12,
314,
1453,
859,
536,
911,
506,
20247,
370,
1006,
1369,
199,
3,
4137,
16194,
334,
10180,
465,
2508,
805,
32469,
199,
3,
525,
63,
578,
63,
1247,
275,
715,
199,
199,
3,
982,
2549,
12,
3420,
2502,
436,
28966,
13502,
911,
506,
9164,
315,
314,
199,
3,
1072,
14,
9322,
787,
5525,
701,
849,
14,
199,
3,
2384,
63,
8149,
275,
756,
199,
199,
3,
710,
536,
402,
314,
14493,
334,
7093,
22437,
9,
3449,
370,
675,
14,
199,
12173,
63,
2487,
275,
283,
8008,
7,
199,
199,
3,
437,
769,
402,
5525,
13158,
367,
859,
1478,
13351,
14,
199,
3,
27555,
63,
2330,
63,
1861,
275,
942,
199,
199,
3,
982,
2549,
12,
4215,
3598,
465,
298,
2253,
1245,
2,
26603,
315,
314,
6137,
8247,
14,
199,
3,
3250,
63,
5451,
275,
756,
421,
199,
3,
1553,
8394,
367,
4163,
1072,
11016,
10965,
199,
199,
3,
710,
8879,
370,
675,
367,
4163,
436,
4163,
15456,
6497,
14,
221,
1666,
314,
3794,
367,
199,
3,
282,
769,
402,
6762,
17915,
14,
199,
1360,
63,
7915,
275,
283,
885,
7,
199,
199,
3,
23978,
1511,
787,
8879,
13,
6100,
436,
17551,
314,
3648,
436,
23109,
402,
282,
8879,
199,
3,
9848,
14,
221,
2104,
282,
769,
402,
1511,
2808,
367,
1924,
8879,
12,
1937,
314,
199,
3,
3794,
14,
199,
3,
1360,
63,
7915,
63,
1419,
275,
1052,
199,
199,
3,
2654,
1263,
3792,
626,
1395,
3537,
17915,
2348,
12,
3847,
370,
642,
2082,
14,
199,
3,
1360,
63,
7915,
63,
515,
275,
942,
199,
199,
3,
710,
536,
367,
642,
663,
402,
10229,
8247,
14,
221,
982,
488,
12,
652,
4243,
370,
199,
3,
3886,
1715,
30,
373,
28,
3221,
30,
3794,
1674,
199,
3,
1360,
63,
1213,
275,
488,
199,
199,
3,
437,
18299,
2538,
367,
314,
19191,
4681,
14,
221,
3758,
365,
314,
2011,
465,
3517,
63,
1213,
14,
199,
3,
1360,
63,
3612,
63,
1213,
275,
488,
199,
199,
3,
710,
536,
402,
376,
1834,
570,
334,
6188,
370,
642,
2082,
9,
370,
4192,
737,
314,
2746,
199,
3,
402,
314,
18437,
14,
199,
3,
1360,
63,
9733
] |
[
2647,
15,
1393,
15,
1813,
2366,
19,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
308,
11171,
79,
1474,
3794,
1900,
2897,
570,
12,
2737,
701,
199,
3,
15882,
13,
28957,
641,
377,
310,
1603,
348,
7294,
3193,
26,
2481,
26,
1465,
6900,
14,
199,
3,
199,
3,
961,
570,
365,
22711,
342,
68,
543,
314,
1453,
2082,
663,
370,
2399,
199,
3,
3035,
2935,
14,
199,
3,
199,
3,
3390,
626,
440,
1006,
3962,
2897,
1338,
787,
3451,
315,
642,
199,
3,
18392,
570,
14,
199,
3,
199,
3,
2900,
2897,
1338,
1172,
282,
849,
27,
1338,
626,
787,
21804,
734,
199,
3,
14062,
370,
2498,
314,
849,
14,
199,
199,
646,
984,
199,
646,
747,
199,
199,
1274,
14,
515,
847,
2097,
5093,
937,
199,
3,
982,
5478,
334,
269,
4621,
370,
2213,
543,
29973,
9,
787,
315,
4573,
2082,
12,
199,
3,
1050,
3520,
6602,
370,
984,
14,
515,
2348,
14,
982,
314,
2082,
365,
3847,
370,
314,
199,
3,
3794,
1738,
12,
675,
747,
14,
515,
14,
4832,
370,
1852,
652,
3679,
12,
2839,
9164,
2348,
14,
199,
3,
1274,
14,
515,
14,
3176,
8,
16,
12,
747,
14,
515,
14,
4832,
24535,
199,
199,
3,
1553,
1696,
2897,
9527,
199,
199,
3,
982,
2195,
3794,
4839,
282,
13460,
10229,
1015,
12,
1174,
652,
2348,
14,
199,
3,
10065,
63,
8008,
275,
283,
17,
14,
16,
7,
199,
199,
3,
2654,
1263,
10229,
3329,
859,
1561,
2348,
12,
465,
3326,
14,
9322,
883,
506,
199,
3,
5478,
17262,
543,
10229,
334,
4579,
283,
8008,
14,
832,
24915,
503,
2195,
3537,
199,
3,
7869,
14,
199,
5359,
275,
359,
272,
283,
8008,
14,
832,
14,
28056,
297,
199,
61,
199,
199,
3,
2654,
1263,
3792,
626,
1395,
7009,
2348,
12,
3847,
370,
642,
2082,
14,
199,
5876,
63,
515,
275,
4044,
5876,
418,
199,
199,
3,
710,
4739,
402,
1350,
6203,
14,
199,
1365,
63,
4511,
275,
1987,
8332,
7,
199,
199,
3,
710,
2644,
402,
1350,
1584,
14,
199,
3,
1365,
63,
2991,
275,
283,
1624,
13,
24,
13,
4093,
7,
199,
199,
3,
710,
5288,
28310,
2213,
14,
199,
4133,
63,
1301,
275,
283,
1080,
7,
199,
199,
3,
1696,
2556,
3595,
314,
2199,
14,
199,
1715,
275,
283,
338,
706,
79,
1474,
7,
199,
7307,
275,
283,
7806,
12,
1603,
736,
85,
5741,
4580,
86,
1530,
90,
7,
199,
199,
3,
710,
1015,
2256,
367,
314,
2199,
1265,
3984,
29904,
12,
17795,
465,
8343,
367,
199,
3,
1204,
1023,
92,
436,
1204,
3221,
18712,
2597,
1202,
315,
7750,
1163,
9825,
23088,
314,
199,
3,
6137,
8247,
14,
199,
3,
199,
3,
710,
3974,
1323,
14,
57,
1015,
14,
199,
1023,
275,
283,
17,
14,
16,
7,
199,
3,
710,
2615,
1015,
12,
5893,
5131,
15,
5683,
15,
1195,
3762,
14,
199,
3221,
275,
283,
16,
7,
199,
199,
3,
710,
2637,
367,
1564,
18392,
701,
10229,
14,
21751,
370,
3794,
199,
3,
367,
282,
769,
402,
3748,
10815,
14,
199,
3,
3671,
275,
488,
199,
199,
3,
6006,
787,
2877,
1511,
367,
15810,
1204,
8136,
25004,
1902,
12,
1265,
663,
11168,
370,
2005,
199,
3,
2222,
13,
3910,
574,
12,
2066,
652,
365,
1202,
26,
199,
3,
8136,
275,
2125,
199,
3,
19524,
12,
11168,
63,
5045,
365,
1202,
465,
314,
1475,
367,
282,
14053,
1240,
14,
199,
3,
8136,
63,
5045,
275,
1543,
34,
450,
68,
12,
450,
57,
7,
199,
199,
3,
3820,
402,
7970,
12,
3847,
370,
1350,
2082,
12,
626,
1336,
1584,
436,
199,
3,
6602,
370,
3686,
1380,
10023,
367,
1350,
1584,
14,
199,
5473,
63,
7435,
275,
942,
199,
199,
3,
710,
20883,
849,
4719,
334,
2972,
367,
642,
9189,
26,
658,
505,
10522,
370,
675,
367,
1006,
199,
3,
8247,
14,
199,
3,
885,
63,
3756,
275,
488,
199,
199,
3,
982,
2549,
12,
26380,
911,
506,
11544,
370,
520,
1532,
26,
5423,
14,
8059,
13,
4443,
1318,
14,
199,
3,
525,
63,
1593,
63,
25510,
275,
715,
199,
199,
3,
982,
2549,
12,
314,
1453,
859,
536,
911,
506,
20247,
370,
1006,
1369,
199,
3,
4137,
16194,
334,
10180,
465,
2508,
805,
32469,
199,
3,
525,
63,
578,
63,
1247,
275,
715,
199,
199,
3,
982,
2549,
12,
3420,
2502,
436,
28966,
13502,
911,
506,
9164,
315,
314,
199,
3,
1072,
14,
9322,
787,
5525,
701,
849,
14,
199,
3,
2384,
63,
8149,
275,
756,
199,
199,
3,
710,
536,
402,
314,
14493,
334,
7093,
22437,
9,
3449,
370,
675,
14,
199,
12173,
63,
2487,
275,
283,
8008,
7,
199,
199,
3,
437,
769,
402,
5525,
13158,
367,
859,
1478,
13351,
14,
199,
3,
27555,
63,
2330,
63,
1861,
275,
942,
199,
199,
3,
982,
2549,
12,
4215,
3598,
465,
298,
2253,
1245,
2,
26603,
315,
314,
6137,
8247,
14,
199,
3,
3250,
63,
5451,
275,
756,
421,
199,
3,
1553,
8394,
367,
4163,
1072,
11016,
10965,
199,
199,
3,
710,
8879,
370,
675,
367,
4163,
436,
4163,
15456,
6497,
14,
221,
1666,
314,
3794,
367,
199,
3,
282,
769,
402,
6762,
17915,
14,
199,
1360,
63,
7915,
275,
283,
885,
7,
199,
199,
3,
23978,
1511,
787,
8879,
13,
6100,
436,
17551,
314,
3648,
436,
23109,
402,
282,
8879,
199,
3,
9848,
14,
221,
2104,
282,
769,
402,
1511,
2808,
367,
1924,
8879,
12,
1937,
314,
199,
3,
3794,
14,
199,
3,
1360,
63,
7915,
63,
1419,
275,
1052,
199,
199,
3,
2654,
1263,
3792,
626,
1395,
3537,
17915,
2348,
12,
3847,
370,
642,
2082,
14,
199,
3,
1360,
63,
7915,
63,
515,
275,
942,
199,
199,
3,
710,
536,
367,
642,
663,
402,
10229,
8247,
14,
221,
982,
488,
12,
652,
4243,
370,
199,
3,
3886,
1715,
30,
373,
28,
3221,
30,
3794,
1674,
199,
3,
1360,
63,
1213,
275,
488,
199,
199,
3,
437,
18299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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
] |
submergerock/avatar-hadoop
|
build/hadoop-0.20.1-dev/src/contrib/hod/hodlib/Hod/hod.py
|
182
|
29420
|
#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.
# -*- python -*-
import sys, os, getpass, pprint, re, cPickle, random, shutil, time, errno
import hodlib.Common.logger
from hodlib.ServiceRegistry.serviceRegistry import svcrgy
from hodlib.Common.xmlrpc import hodXRClient
from hodlib.Common.util import to_http_url, get_exception_string
from hodlib.Common.util import get_exception_error_string
from hodlib.Common.util import hodInterrupt, HodInterruptException
from hodlib.Common.util import HOD_INTERRUPTED_CODE
from hodlib.Common.nodepoolutil import NodePoolUtil
from hodlib.Hod.hadoop import hadoopCluster, hadoopScript
CLUSTER_DATA_FILE = 'clusters'
INVALID_STATE_FILE_MSGS = \
[
"Requested operation cannot be performed. Cannot read %s: " + \
"Permission denied.",
"Requested operation cannot be performed. " + \
"Cannot write to %s: Permission denied.",
"Requested operation cannot be performed. " + \
"Cannot read/write to %s: Permission denied.",
"Cannot update %s: Permission denied. " + \
"Cluster is deallocated, but info and list " + \
"operations might show incorrect information.",
]
class hodState:
def __init__(self, store):
self.__store = store
self.__stateFile = None
self.__init_store()
self.__STORE_EXT = ".state"
def __init_store(self):
if not os.path.exists(self.__store):
os.mkdir(self.__store)
def __set_state_file(self, id=None):
if id:
self.__stateFile = os.path.join(self.__store, "%s%s" % (id,
self.__STORE_EXT))
else:
for item in os.listdir(self.__store):
if item.endswith(self.__STORE_EXT):
self.__stateFile = os.path.join(self.__store, item)
def get_state_file(self):
return self.__stateFile
def checkStateFile(self, id=None, modes=(os.R_OK,)):
# is state file exists/readable/writable/both?
self.__set_state_file(id)
# return true if file doesn't exist, because HOD CAN create
# state file and so WILL have permissions to read and/or write
try:
os.stat(self.__stateFile)
except OSError, err:
if err.errno == errno.ENOENT: # error 2 (no such file)
return True
# file exists
ret = True
for mode in modes:
ret = ret and os.access(self.__stateFile, mode)
return ret
def read(self, id=None):
info = {}
self.__set_state_file(id)
if self.__stateFile:
if os.path.isfile(self.__stateFile):
stateFile = open(self.__stateFile, 'r')
try:
info = cPickle.load(stateFile)
except EOFError:
pass
stateFile.close()
return info
def write(self, id, info):
self.__set_state_file(id)
if not os.path.exists(self.__stateFile):
self.clear(id)
stateFile = open(self.__stateFile, 'w')
cPickle.dump(info, stateFile)
stateFile.close()
def clear(self, id=None):
self.__set_state_file(id)
if self.__stateFile and os.path.exists(self.__stateFile):
os.remove(self.__stateFile)
else:
for item in os.listdir(self.__store):
if item.endswith(self.__STORE_EXT):
os.remove(item)
class hodRunner:
def __init__(self, cfg, log=None, cluster=None):
self.__hodhelp = hodHelp()
self.__ops = self.__hodhelp.ops
self.__cfg = cfg
self.__npd = self.__cfg['nodepooldesc']
self.__opCode = 0
self.__user = getpass.getuser()
self.__registry = None
self.__baseLogger = None
# Allowing to pass in log object to help testing - a stub can be passed in
if log is None:
self.__setup_logger()
else:
self.__log = log
self.__userState = hodState(self.__cfg['hod']['user_state'])
self.__clusterState = None
self.__clusterStateInfo = { 'env' : None, 'hdfs' : None, 'mapred' : None }
# Allowing to pass in log object to help testing - a stib can be passed in
if cluster is None:
self.__cluster = hadoopCluster(self.__cfg, self.__log)
else:
self.__cluster = cluster
def __setup_logger(self):
self.__baseLogger = hodlib.Common.logger.hodLog('hod')
self.__log = self.__baseLogger.add_logger(self.__user )
if self.__cfg['hod']['stream']:
self.__baseLogger.add_stream(level=self.__cfg['hod']['debug'],
addToLoggerNames=(self.__user ,))
if self.__cfg['hod'].has_key('syslog-address'):
self.__baseLogger.add_syslog(self.__cfg['hod']['syslog-address'],
level=self.__cfg['hod']['debug'],
addToLoggerNames=(self.__user ,))
def get_logger(self):
return self.__log
def __setup_cluster_logger(self, directory):
self.__baseLogger.add_file(logDirectory=directory, level=4,
backupCount=self.__cfg['hod']['log-rollover-count'],
addToLoggerNames=(self.__user ,))
def __setup_cluster_state(self, directory):
self.__clusterState = hodState(directory)
def __norm_cluster_dir(self, directory):
directory = os.path.expanduser(directory)
if not os.path.isabs(directory):
directory = os.path.join(self.__cfg['hod']['original-dir'], directory)
directory = os.path.abspath(directory)
return directory
def __setup_service_registry(self):
cfg = self.__cfg['hod'].copy()
cfg['debug'] = 0
self.__registry = svcrgy(cfg, self.__log)
self.__registry.start()
self.__log.debug(self.__registry.getXMLRPCAddr())
self.__cfg['hod']['xrs-address'] = self.__registry.getXMLRPCAddr()
self.__cfg['ringmaster']['svcrgy-addr'] = self.__cfg['hod']['xrs-address']
def __set_cluster_state_info(self, env, hdfs, mapred, ring, jobid, min, max):
self.__clusterStateInfo['env'] = env
self.__clusterStateInfo['hdfs'] = "http://%s" % hdfs
self.__clusterStateInfo['mapred'] = "http://%s" % mapred
self.__clusterStateInfo['ring'] = ring
self.__clusterStateInfo['jobid'] = jobid
self.__clusterStateInfo['min'] = min
self.__clusterStateInfo['max'] = max
def __set_user_state_info(self, info):
userState = self.__userState.read(CLUSTER_DATA_FILE)
for key in info.keys():
userState[key] = info[key]
self.__userState.write(CLUSTER_DATA_FILE, userState)
def __remove_cluster(self, clusterDir):
clusterInfo = self.__userState.read(CLUSTER_DATA_FILE)
if clusterDir in clusterInfo:
del(clusterInfo[clusterDir])
self.__userState.write(CLUSTER_DATA_FILE, clusterInfo)
def __cleanup(self):
if self.__registry: self.__registry.stop()
def __check_operation(self, operation):
opList = operation.split()
if not opList[0] in self.__ops:
self.__log.critical("Invalid hod operation specified: %s" % operation)
self._op_help(None)
self.__opCode = 2
return opList
def __adjustMasterFailureCountConfig(self, nodeCount):
# This method adjusts the ringmaster.max-master-failures variable
# to a value that is bounded by the a function of the number of
# nodes.
maxFailures = self.__cfg['ringmaster']['max-master-failures']
# Count number of masters required - depends on which services
# are external
masters = 0
if not self.__cfg['gridservice-hdfs']['external']:
masters += 1
if not self.__cfg['gridservice-mapred']['external']:
masters += 1
# So, if there are n nodes and m masters, we look atleast for
# all masters to come up. Therefore, atleast m nodes should be
# good, which means a maximum of n-m master nodes can fail.
maxFailedNodes = nodeCount - masters
# The configured max number of failures is now bounded by this
# number.
self.__cfg['ringmaster']['max-master-failures'] = \
min(maxFailures, maxFailedNodes)
def _op_allocate(self, args):
operation = "allocate"
argLength = len(args)
min = 0
max = 0
errorFlag = False
errorMsgs = []
if argLength == 3:
nodes = args[2]
clusterDir = self.__norm_cluster_dir(args[1])
if not os.path.exists(clusterDir):
try:
os.makedirs(clusterDir)
except OSError, err:
errorFlag = True
errorMsgs.append("Could not create cluster directory. %s" \
% (str(err)))
elif not os.path.isdir(clusterDir):
errorFlag = True
errorMsgs.append( \
"Invalid cluster directory (--hod.clusterdir or -d) : " + \
clusterDir + " : Not a directory")
if int(nodes) < 3 :
errorFlag = True
errorMsgs.append("Invalid nodecount (--hod.nodecount or -n) : " + \
"Must be >= 3. Given nodes: %s" % nodes)
if errorFlag:
for msg in errorMsgs:
self.__log.critical(msg)
self.__opCode = 3
return
if not self.__userState.checkStateFile(CLUSTER_DATA_FILE, \
(os.R_OK, os.W_OK)):
self.__log.critical(INVALID_STATE_FILE_MSGS[2] % \
self.__userState.get_state_file())
self.__opCode = 1
return
clusterList = self.__userState.read(CLUSTER_DATA_FILE)
if clusterDir in clusterList.keys():
self.__setup_cluster_state(clusterDir)
clusterInfo = self.__clusterState.read()
# Check if the job is not running. Only then can we safely
# allocate another cluster. Otherwise the user would need
# to deallocate and free up resources himself.
if clusterInfo.has_key('jobid') and \
self.__cluster.is_cluster_deallocated(clusterInfo['jobid']):
self.__log.warn("Found a dead cluster at cluster directory '%s'. Deallocating it to allocate a new one." % (clusterDir))
self.__remove_cluster(clusterDir)
self.__clusterState.clear()
else:
self.__log.critical("Found a previously allocated cluster at cluster directory '%s'. HOD cannot determine if this cluster can be automatically deallocated. Deallocate the cluster if it is unused." % (clusterDir))
self.__opCode = 12
return
self.__setup_cluster_logger(clusterDir)
(status, message) = self.__cluster.is_valid_account()
if status is not 0:
if message:
for line in message:
self.__log.critical("verify-account output: %s" % line)
self.__log.critical("Cluster cannot be allocated because account verification failed. " \
+ "verify-account returned exit code: %s." % status)
self.__opCode = 4
return
else:
self.__log.debug("verify-account returned zero exit code.")
if message:
self.__log.debug("verify-account output: %s" % message)
if re.match('\d+-\d+', nodes):
(min, max) = nodes.split("-")
min = int(min)
max = int(max)
else:
try:
nodes = int(nodes)
min = nodes
max = nodes
except ValueError:
print self.__hodhelp.help(operation)
self.__log.critical(
"%s operation requires a pos_int value for n(nodecount)." %
operation)
self.__opCode = 3
else:
self.__setup_cluster_state(clusterDir)
clusterInfo = self.__clusterState.read()
self.__opCode = self.__cluster.check_cluster(clusterInfo)
if self.__opCode == 0 or self.__opCode == 15:
self.__setup_service_registry()
if hodInterrupt.isSet():
self.__cleanup()
raise HodInterruptException()
self.__log.debug("Service Registry started.")
self.__adjustMasterFailureCountConfig(nodes)
try:
allocateStatus = self.__cluster.allocate(clusterDir, min, max)
except HodInterruptException, h:
self.__cleanup()
raise h
# Allocation has gone through.
# Don't care about interrupts any more
try:
if allocateStatus == 0:
self.__set_cluster_state_info(os.environ,
self.__cluster.hdfsInfo,
self.__cluster.mapredInfo,
self.__cluster.ringmasterXRS,
self.__cluster.jobId,
min, max)
self.__setup_cluster_state(clusterDir)
self.__clusterState.write(self.__cluster.jobId,
self.__clusterStateInfo)
# Do we need to check for interrupts here ??
self.__set_user_state_info(
{ clusterDir : self.__cluster.jobId, } )
self.__opCode = allocateStatus
except Exception, e:
# Some unknown problem.
self.__cleanup()
self.__cluster.deallocate(clusterDir, self.__clusterStateInfo)
self.__opCode = 1
raise Exception(e)
elif self.__opCode == 12:
self.__log.critical("Cluster %s already allocated." % clusterDir)
elif self.__opCode == 10:
self.__log.critical("dead\t%s\t%s" % (clusterInfo['jobid'],
clusterDir))
elif self.__opCode == 13:
self.__log.warn("hdfs dead\t%s\t%s" % (clusterInfo['jobid'],
clusterDir))
elif self.__opCode == 14:
self.__log.warn("mapred dead\t%s\t%s" % (clusterInfo['jobid'],
clusterDir))
if self.__opCode > 0 and self.__opCode != 15:
self.__log.critical("Cannot allocate cluster %s" % clusterDir)
else:
print self.__hodhelp.help(operation)
self.__log.critical("%s operation requires two arguments. " % operation
+ "A cluster directory and a nodecount.")
self.__opCode = 3
def _is_cluster_allocated(self, clusterDir):
if os.path.isdir(clusterDir):
self.__setup_cluster_state(clusterDir)
clusterInfo = self.__clusterState.read()
if clusterInfo != {}:
return True
return False
def _op_deallocate(self, args):
operation = "deallocate"
argLength = len(args)
if argLength == 2:
clusterDir = self.__norm_cluster_dir(args[1])
if os.path.isdir(clusterDir):
self.__setup_cluster_state(clusterDir)
clusterInfo = self.__clusterState.read()
if clusterInfo == {}:
self.__handle_invalid_cluster_directory(clusterDir, cleanUp=True)
else:
self.__opCode = \
self.__cluster.deallocate(clusterDir, clusterInfo)
# irrespective of whether deallocate failed or not\
# remove the cluster state.
self.__clusterState.clear()
if not self.__userState.checkStateFile(CLUSTER_DATA_FILE, (os.W_OK,)):
self.__log.critical(INVALID_STATE_FILE_MSGS[3] % \
self.__userState.get_state_file())
self.__opCode = 1
return
self.__remove_cluster(clusterDir)
else:
self.__handle_invalid_cluster_directory(clusterDir, cleanUp=True)
else:
print self.__hodhelp.help(operation)
self.__log.critical("%s operation requires one argument. " % operation
+ "A cluster path.")
self.__opCode = 3
def _op_list(self, args):
operation = 'list'
clusterList = self.__userState.read(CLUSTER_DATA_FILE)
for path in clusterList.keys():
if not os.path.isdir(path):
self.__log.info("cluster state unknown\t%s\t%s" % (clusterList[path], path))
continue
self.__setup_cluster_state(path)
clusterInfo = self.__clusterState.read()
if clusterInfo == {}:
# something wrong with the cluster directory.
self.__log.info("cluster state unknown\t%s\t%s" % (clusterList[path], path))
continue
clusterStatus = self.__cluster.check_cluster(clusterInfo)
if clusterStatus == 12:
self.__log.info("alive\t%s\t%s" % (clusterList[path], path))
elif clusterStatus == 10:
self.__log.info("dead\t%s\t%s" % (clusterList[path], path))
elif clusterStatus == 13:
self.__log.info("hdfs dead\t%s\t%s" % (clusterList[path], path))
elif clusterStatus == 14:
self.__log.info("mapred dead\t%s\t%s" % (clusterList[path], path))
def _op_info(self, args):
operation = 'info'
argLength = len(args)
if argLength == 2:
clusterDir = self.__norm_cluster_dir(args[1])
if os.path.isdir(clusterDir):
self.__setup_cluster_state(clusterDir)
clusterInfo = self.__clusterState.read()
if clusterInfo == {}:
# something wrong with the cluster directory.
self.__handle_invalid_cluster_directory(clusterDir)
else:
clusterStatus = self.__cluster.check_cluster(clusterInfo)
if clusterStatus == 12:
self.__print_cluster_info(clusterInfo)
self.__log.info("hadoop-site.xml at %s" % clusterDir)
elif clusterStatus == 10:
self.__log.critical("%s cluster is dead" % clusterDir)
elif clusterStatus == 13:
self.__log.warn("%s cluster hdfs is dead" % clusterDir)
elif clusterStatus == 14:
self.__log.warn("%s cluster mapred is dead" % clusterDir)
if clusterStatus != 12:
if clusterStatus == 15:
self.__log.critical("Cluster %s not allocated." % clusterDir)
else:
self.__print_cluster_info(clusterInfo)
self.__log.info("hadoop-site.xml at %s" % clusterDir)
self.__opCode = clusterStatus
else:
self.__handle_invalid_cluster_directory(clusterDir)
else:
print self.__hodhelp.help(operation)
self.__log.critical("%s operation requires one argument. " % operation
+ "A cluster path.")
self.__opCode = 3
def __handle_invalid_cluster_directory(self, clusterDir, cleanUp=False):
if not self.__userState.checkStateFile(CLUSTER_DATA_FILE, (os.R_OK,)):
self.__log.critical(INVALID_STATE_FILE_MSGS[0] % \
self.__userState.get_state_file())
self.__opCode = 1
return
clusterList = self.__userState.read(CLUSTER_DATA_FILE)
if clusterDir in clusterList.keys():
# previously allocated cluster.
self.__log.critical("Cannot find information for cluster with id '%s' in previously allocated cluster directory '%s'." % (clusterList[clusterDir], clusterDir))
if cleanUp:
self.__cluster.delete_job(clusterList[clusterDir])
self.__log.critical("Freeing resources allocated to the cluster.")
if not self.__userState.checkStateFile(CLUSTER_DATA_FILE, (os.W_OK,)):
self.__log.critical(INVALID_STATE_FILE_MSGS[1] % \
self.__userState.get_state_file())
self.__opCode = 1
return
self.__remove_cluster(clusterDir)
self.__opCode = 3
else:
if not os.path.exists(clusterDir):
self.__log.critical( \
"Invalid hod.clusterdir(--hod.clusterdir or -d). " + \
clusterDir + " : No such directory")
elif not os.path.isdir(clusterDir):
self.__log.critical( \
"Invalid hod.clusterdir(--hod.clusterdir or -d). " + \
clusterDir + " : Not a directory")
else:
self.__log.critical( \
"Invalid hod.clusterdir(--hod.clusterdir or -d). " + \
clusterDir + " : Not tied to any allocated cluster.")
self.__opCode = 15
def __print_cluster_info(self, clusterInfo):
keys = clusterInfo.keys()
_dict = {
'jobid' : 'Cluster Id', 'min' : 'Nodecount',
'hdfs' : 'HDFS UI at' , 'mapred' : 'Mapred UI at'
}
for key in _dict.keys():
if clusterInfo.has_key(key):
self.__log.info("%s %s" % (_dict[key], clusterInfo[key]))
if clusterInfo.has_key('ring'):
self.__log.debug("%s\t%s" % ('Ringmaster at ', clusterInfo['ring']))
if self.__cfg['hod']['debug'] == 4:
for var in clusterInfo['env'].keys():
self.__log.debug("%s = %s" % (var, clusterInfo['env'][var]))
def _op_help(self, arg):
if arg == None or arg.__len__() != 2:
print "hod commands:\n"
for op in self.__ops:
print self.__hodhelp.help(op)
else:
if arg[1] not in self.__ops:
print self.__hodhelp.help('help')
self.__log.critical("Help requested for invalid operation : %s"%arg[1])
self.__opCode = 3
else: print self.__hodhelp.help(arg[1])
def operation(self):
operation = self.__cfg['hod']['operation']
try:
opList = self.__check_operation(operation)
if self.__opCode == 0:
if not self.__userState.checkStateFile(CLUSTER_DATA_FILE, (os.R_OK,)):
self.__log.critical(INVALID_STATE_FILE_MSGS[0] % \
self.__userState.get_state_file())
self.__opCode = 1
return self.__opCode
getattr(self, "_op_%s" % opList[0])(opList)
except HodInterruptException, h:
self.__log.critical("op: %s failed because of a process interrupt." \
% operation)
self.__opCode = HOD_INTERRUPTED_CODE
except:
self.__log.critical("op: %s failed: %s" % (operation,
get_exception_error_string()))
self.__log.debug(get_exception_string())
self.__cleanup()
self.__log.debug("return code: %s" % self.__opCode)
return self.__opCode
def script(self):
errorFlag = False
errorMsgs = []
scriptRet = 0 # return from the script, if run
script = self.__cfg['hod']['script']
nodes = self.__cfg['hod']['nodecount']
clusterDir = self.__cfg['hod']['clusterdir']
if not os.path.exists(script):
errorFlag = True
errorMsgs.append("Invalid script file (--hod.script or -s) : " + \
script + " : No such file")
elif not os.path.isfile(script):
errorFlag = True
errorMsgs.append("Invalid script file (--hod.script or -s) : " + \
script + " : Not a file.")
else:
isExecutable = os.access(script, os.X_OK)
if not isExecutable:
errorFlag = True
errorMsgs.append("Invalid script file (--hod.script or -s) : " + \
script + " : Not an executable.")
if not os.path.exists(clusterDir):
try:
os.makedirs(clusterDir)
except OSError, err:
errorFlag = True
errorMsgs.append("Could not create cluster directory. %s" % (str(err)))
elif not os.path.isdir(clusterDir):
errorFlag = True
errorMsgs.append( \
"Invalid cluster directory (--hod.clusterdir or -d) : " + \
clusterDir + " : Not a directory")
if int(self.__cfg['hod']['nodecount']) < 3 :
errorFlag = True
errorMsgs.append("Invalid nodecount (--hod.nodecount or -n) : " + \
"Must be >= 3. Given nodes: %s" % nodes)
if errorFlag:
for msg in errorMsgs:
self.__log.critical(msg)
self.handle_script_exit_code(scriptRet, clusterDir)
sys.exit(3)
try:
self._op_allocate(('allocate', clusterDir, str(nodes)))
if self.__opCode == 0:
if self.__cfg['hod'].has_key('script-wait-time'):
time.sleep(self.__cfg['hod']['script-wait-time'])
self.__log.debug('Slept for %d time. Now going to run the script' % self.__cfg['hod']['script-wait-time'])
if hodInterrupt.isSet():
self.__log.debug('Hod interrupted - not executing script')
else:
scriptRunner = hadoopScript(clusterDir,
self.__cfg['hod']['original-dir'])
self.__opCode = scriptRunner.run(script)
scriptRet = self.__opCode
self.__log.info("Exit code from running the script: %d" % self.__opCode)
else:
self.__log.critical("Error %d in allocating the cluster. Cannot run the script." % self.__opCode)
if hodInterrupt.isSet():
# Got interrupt while executing script. Unsetting it for deallocating
hodInterrupt.setFlag(False)
if self._is_cluster_allocated(clusterDir):
self._op_deallocate(('deallocate', clusterDir))
except HodInterruptException, h:
self.__log.critical("Script failed because of a process interrupt.")
self.__opCode = HOD_INTERRUPTED_CODE
except:
self.__log.critical("script: %s failed: %s" % (script,
get_exception_error_string()))
self.__log.debug(get_exception_string())
self.__cleanup()
self.handle_script_exit_code(scriptRet, clusterDir)
return self.__opCode
def handle_script_exit_code(self, scriptRet, clusterDir):
# We want to give importance to a failed script's exit code, and write out exit code to a file separately
# so users can easily get it if required. This way they can differentiate between the script's exit code
# and hod's exit code.
if os.path.exists(clusterDir):
exit_code_file_name = (os.path.join(clusterDir, 'script.exitcode'))
if scriptRet != 0:
exit_code_file = open(exit_code_file_name, 'w')
print >>exit_code_file, scriptRet
exit_code_file.close()
self.__opCode = scriptRet
else:
#ensure script exit code file is not there:
if (os.path.exists(exit_code_file_name)):
os.remove(exit_code_file_name)
class hodHelp:
def __init__(self):
self.ops = ['allocate', 'deallocate', 'info', 'list','script', 'help']
self.usage_strings = \
{
'allocate' : 'hod allocate -d <clusterdir> -n <nodecount> [OPTIONS]',
'deallocate' : 'hod deallocate -d <clusterdir> [OPTIONS]',
'list' : 'hod list [OPTIONS]',
'info' : 'hod info -d <clusterdir> [OPTIONS]',
'script' :
'hod script -d <clusterdir> -n <nodecount> -s <script> [OPTIONS]',
'help' : 'hod help <OPERATION>',
}
self.description_strings = \
{
'allocate' : "Allocates a cluster of n nodes using the specified \n" + \
" cluster directory to store cluster state \n" + \
" information. The Hadoop site XML is also stored \n" + \
" in this location.\n",
'deallocate' : "Deallocates a cluster using the specified \n" + \
" cluster directory. This operation is also \n" + \
" required to clean up a dead cluster.\n",
'list' : "List all clusters currently allocated by a user, \n" + \
" along with limited status information and the \n" + \
" cluster ID.\n",
'info' : "Provide detailed information on an allocated cluster.\n",
'script' : "Allocates a cluster of n nodes with the given \n" +\
" cluster directory, runs the specified script \n" + \
" using the allocated cluster, and then \n" + \
" deallocates the cluster.\n",
'help' : "Print help for the operation and exit.\n" + \
"Available operations : %s.\n" % self.ops,
}
def usage(self, op):
return "Usage : " + self.usage_strings[op] + "\n" + \
"For full description: hod help " + op + ".\n"
def help(self, op=None):
if op is None:
return "hod <operation> [ARGS] [OPTIONS]\n" + \
"Available operations : %s\n" % self.ops + \
"For help on a particular operation : hod help <operation>.\n" + \
"For all options : hod help options."
else:
return "Usage : " + self.usage_strings[op] + "\n" + \
"Description : " + self.description_strings[op] + \
"For all options : hod help options.\n"
|
apache-2.0
|
[
3,
31661,
370,
314,
3668,
2290,
2752,
334,
14950,
9,
1334,
1373,
199,
3,
269,
1655,
11615,
4190,
14024,
14,
221,
1666,
314,
12840,
570,
199,
3,
16832,
543,
642,
1736,
367,
4722,
2556,
199,
3,
1135,
1005,
316,
4248,
12715,
14,
221,
710,
14857,
12378,
642,
570,
199,
3,
475,
1265,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
199,
23662,
3761,
3547,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
199,
3,
1045,
314,
844,
14,
221,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
199,
3,
5524,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
16832,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
29946,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
9295,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
3097,
1298,
1334,
314,
844,
14,
199,
3,
1882,
2366,
1882,
199,
199,
646,
984,
12,
747,
12,
18354,
12,
10933,
12,
295,
12,
17572,
12,
2196,
12,
5145,
12,
900,
12,
7554,
199,
199,
646,
394,
364,
773,
14,
7844,
14,
2921,
199,
199,
504,
394,
364,
773,
14,
3167,
10899,
14,
1364,
10899,
492,
19291,
1556,
4312,
199,
504,
394,
364,
773,
14,
7844,
14,
17596,
492,
394,
364,
12297,
3041,
199,
504,
394,
364,
773,
14,
7844,
14,
1974,
492,
370,
63,
1014,
63,
633,
12,
664,
63,
1971,
63,
875,
199,
504,
394,
364,
773,
14,
7844,
14,
1974,
492,
664,
63,
1971,
63,
705,
63,
875,
199,
504,
394,
364,
773,
14,
7844,
14,
1974,
492,
394,
364,
10647,
12,
869,
364,
10647,
1726,
199,
504,
394,
364,
773,
14,
7844,
14,
1974,
492,
7781,
36,
63,
3843,
9343,
1149,
63,
6012,
199,
199,
504,
394,
364,
773,
14,
7844,
14,
932,
2293,
1974,
492,
5013,
5453,
9562,
199,
504,
394,
364,
773,
14,
40,
364,
14,
15449,
492,
29252,
9581,
12,
29252,
5229,
199,
199,
26340,
63,
3998,
63,
3817,
275,
283,
9170,
7,
199,
9692,
63,
6689,
63,
3817,
63,
3053,
8021,
275,
971,
1598,
359,
2234,
298,
17935,
3439,
3913,
506,
10585,
14,
18435,
1586,
450,
83,
26,
298,
435,
971,
355,
298,
7980,
23355,
4765,
2234,
298,
17935,
3439,
3913,
506,
10585,
14,
298,
435,
971,
355,
298,
6612,
2218,
370,
450,
83,
26,
8779,
23355,
4765,
2234,
298,
17935,
3439,
3913,
506,
10585,
14,
298,
435,
971,
355,
298,
6612,
1586,
15,
952,
370,
450,
83,
26,
8779,
23355,
4765,
2234,
298,
6612,
1678,
450,
83,
26,
8779,
23355,
14,
298,
435,
971,
355,
298,
9581,
365,
7962,
13340,
12,
1325,
2256,
436,
769,
298,
435,
971,
355,
298,
8170,
5594,
2498,
8927,
2556,
4765,
25841,
1622,
199,
199,
533,
394,
364,
2223,
26,
523,
347,
636,
826,
721,
277,
12,
3877,
304,
272,
291,
855,
1617,
275,
3877,
272,
291,
855,
929,
1173,
275,
488,
272,
291,
855,
826,
63,
1617,
342,
272,
291,
855,
16169,
63,
2472,
275,
3680,
929,
2,
272,
523,
347,
636,
826,
63,
1617,
8,
277,
304,
272,
340,
440,
747,
14,
515,
14,
2444,
8,
277,
855,
1617,
304,
489,
747,
14,
8215,
8,
277,
855,
1617,
9,
12244,
347,
636,
409,
63,
929,
63,
493,
8,
277,
12,
1305,
29,
403,
304,
272,
340,
1305,
26,
489,
291,
855,
929,
1173,
275,
747,
14,
515,
14,
904,
8,
277,
855,
1617,
12,
2071,
83,
5,
83,
2,
450,
334,
344,
12,
221,
4228,
291,
855,
16169,
63,
2472,
430,
272,
587,
26,
489,
367,
1242,
315,
747,
14,
7374,
8,
277,
855,
1617,
304,
267,
340,
1242,
14,
4130,
8,
277,
855,
16169,
63,
2472,
304,
257,
881,
291,
855,
929,
1173,
275,
747,
14,
515,
14,
904,
8,
277,
855,
1617,
12,
1242,
9,
3698,
819,
347,
664,
63,
929,
63,
493,
8,
277,
304,
272,
372,
291,
855,
929,
1173,
1779,
523,
347,
1104,
2223,
1173,
8,
277,
12,
1305,
29,
403,
12,
12404,
2687,
736,
14,
50,
63,
3593,
12,
2298,
272,
327,
365,
1174,
570,
3495,
15,
11875,
15,
15053,
15,
10727,
31,
272,
291,
855,
409,
63,
929,
63,
493,
8,
344,
9,
339,
327,
372,
2549,
340,
570,
3181,
1133,
2187,
12,
2952,
7781,
36,
29661,
1218,
272,
327,
1174,
570,
436,
880,
644,
14961,
1172,
3443,
370,
1586,
436,
15,
269,
2218,
272,
862,
26,
489,
747,
14,
3736,
8,
277,
855,
929,
1173,
9,
272,
871,
6440,
12,
2329,
26,
489,
340,
2329,
14,
7931,
508,
7554,
14,
20465,
26,
327,
1125,
499,
334,
889,
4066,
570,
9,
267,
372,
715,
339,
327,
570,
3495,
272,
2203,
275,
715,
272,
367,
818,
315,
12404,
26,
489,
2203,
275,
2203,
436,
747,
14,
2732,
8,
277,
855,
929,
1173,
12,
818,
9,
272,
372,
2203,
819,
347,
1586,
8,
277,
12,
1305,
29,
403,
304,
272,
2256,
275,
1052,
2286,
291,
855,
409,
63,
929,
63,
493,
8,
344,
9,
2043,
272,
340,
291,
855,
929,
1173,
26,
489,
340,
747,
14,
515,
14,
6292,
8,
277,
855,
929,
1173,
304,
267,
1174,
1173,
275,
1551,
8,
277,
855,
929,
1173,
12,
283,
82,
358,
267,
862,
26,
881,
2256,
275,
17572,
14,
912,
8,
929,
1173,
9,
267,
871,
21157,
26,
881,
986,
2728,
1174,
1173,
14,
1600,
342,
2286,
372,
2256,
288,
523,
347,
2218,
8,
277,
12,
1305,
12,
2256,
304,
272,
291,
855,
409,
63,
929,
63,
493,
8,
344,
9,
272,
340,
440,
747,
14,
515,
14,
2444,
8,
277,
855,
929,
1173,
304,
489,
291,
14,
3584,
8,
344,
9,
20950,
1174,
1173,
275,
1551,
8,
277,
855,
929,
1173,
12,
283,
87,
358,
272,
17572,
14,
2724,
8,
815,
12,
1174,
1173,
9,
272,
1174,
1173,
14,
1600,
342,
12244,
347,
5436,
8,
277,
12,
1305,
29,
403,
304,
272,
291,
855,
409,
63,
929,
63,
493,
8,
344,
9,
272,
340,
291,
855,
929,
1173,
436,
747,
14,
515,
14,
2444,
8,
277,
855,
929,
1173,
304,
489,
747,
14
] |
[
31661,
370,
314,
3668,
2290,
2752,
334,
14950,
9,
1334,
1373,
199,
3,
269,
1655,
11615,
4190,
14024,
14,
221,
1666,
314,
12840,
570,
199,
3,
16832,
543,
642,
1736,
367,
4722,
2556,
199,
3,
1135,
1005,
316,
4248,
12715,
14,
221,
710,
14857,
12378,
642,
570,
199,
3,
475,
1265,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
199,
23662,
3761,
3547,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
199,
3,
1045,
314,
844,
14,
221,
2047,
1443,
3332,
282,
1331,
402,
314,
844,
737,
199,
199,
3,
258,
1455,
921,
1544,
14,
3796,
14,
1308,
15,
2383,
15,
3961,
13,
18,
14,
16,
199,
199,
3,
5524,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
16832,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
29946,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
9295,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
3097,
1298,
1334,
314,
844,
14,
199,
3,
1882,
2366,
1882,
199,
199,
646,
984,
12,
747,
12,
18354,
12,
10933,
12,
295,
12,
17572,
12,
2196,
12,
5145,
12,
900,
12,
7554,
199,
199,
646,
394,
364,
773,
14,
7844,
14,
2921,
199,
199,
504,
394,
364,
773,
14,
3167,
10899,
14,
1364,
10899,
492,
19291,
1556,
4312,
199,
504,
394,
364,
773,
14,
7844,
14,
17596,
492,
394,
364,
12297,
3041,
199,
504,
394,
364,
773,
14,
7844,
14,
1974,
492,
370,
63,
1014,
63,
633,
12,
664,
63,
1971,
63,
875,
199,
504,
394,
364,
773,
14,
7844,
14,
1974,
492,
664,
63,
1971,
63,
705,
63,
875,
199,
504,
394,
364,
773,
14,
7844,
14,
1974,
492,
394,
364,
10647,
12,
869,
364,
10647,
1726,
199,
504,
394,
364,
773,
14,
7844,
14,
1974,
492,
7781,
36,
63,
3843,
9343,
1149,
63,
6012,
199,
199,
504,
394,
364,
773,
14,
7844,
14,
932,
2293,
1974,
492,
5013,
5453,
9562,
199,
504,
394,
364,
773,
14,
40,
364,
14,
15449,
492,
29252,
9581,
12,
29252,
5229,
199,
199,
26340,
63,
3998,
63,
3817,
275,
283,
9170,
7,
199,
9692,
63,
6689,
63,
3817,
63,
3053,
8021,
275,
971,
1598,
359,
2234,
298,
17935,
3439,
3913,
506,
10585,
14,
18435,
1586,
450,
83,
26,
298,
435,
971,
355,
298,
7980,
23355,
4765,
2234,
298,
17935,
3439,
3913,
506,
10585,
14,
298,
435,
971,
355,
298,
6612,
2218,
370,
450,
83,
26,
8779,
23355,
4765,
2234,
298,
17935,
3439,
3913,
506,
10585,
14,
298,
435,
971,
355,
298,
6612,
1586,
15,
952,
370,
450,
83,
26,
8779,
23355,
4765,
2234,
298,
6612,
1678,
450,
83,
26,
8779,
23355,
14,
298,
435,
971,
355,
298,
9581,
365,
7962,
13340,
12,
1325,
2256,
436,
769,
298,
435,
971,
355,
298,
8170,
5594,
2498,
8927,
2556,
4765,
25841,
1622,
199,
199,
533,
394,
364,
2223,
26,
523,
347,
636,
826,
721,
277,
12,
3877,
304,
272,
291,
855,
1617,
275,
3877,
272,
291,
855,
929,
1173,
275,
488,
272,
291,
855,
826,
63,
1617,
342,
272,
291,
855,
16169,
63,
2472,
275,
3680,
929,
2,
272,
523,
347,
636,
826,
63,
1617,
8,
277,
304,
272,
340,
440,
747,
14,
515,
14,
2444,
8,
277,
855,
1617,
304,
489,
747,
14,
8215,
8,
277,
855,
1617,
9,
12244,
347,
636,
409,
63,
929,
63,
493,
8,
277,
12,
1305,
29,
403,
304,
272,
340,
1305,
26,
489,
291,
855,
929,
1173,
275,
747,
14,
515,
14,
904,
8,
277,
855,
1617,
12,
2071,
83,
5,
83,
2,
450,
334,
344,
12,
221,
4228,
291,
855,
16169,
63,
2472,
430,
272,
587,
26,
489,
367,
1242,
315,
747,
14,
7374,
8,
277,
855,
1617,
304,
267,
340,
1242,
14,
4130,
8,
277,
855,
16169,
63,
2472,
304,
257,
881,
291,
855,
929,
1173,
275,
747,
14,
515,
14,
904,
8,
277,
855,
1617,
12,
1242,
9,
3698,
819,
347,
664,
63,
929,
63,
493,
8,
277,
304,
272,
372,
291,
855,
929,
1173,
1779,
523,
347,
1104,
2223,
1173,
8,
277,
12,
1305,
29,
403,
12,
12404,
2687,
736,
14,
50,
63,
3593,
12,
2298,
272,
327,
365,
1174,
570,
3495,
15,
11875,
15,
15053,
15,
10727,
31,
272,
291,
855,
409,
63,
929,
63,
493,
8,
344,
9,
339,
327,
372,
2549,
340,
570,
3181,
1133,
2187,
12,
2952,
7781,
36,
29661,
1218,
272,
327,
1174,
570,
436,
880,
644,
14961,
1172,
3443,
370,
1586,
436,
15,
269,
2218,
272,
862,
26,
489,
747,
14,
3736,
8,
277,
855,
929,
1173,
9,
272,
871,
6440,
12,
2329,
26,
489,
340,
2329,
14,
7931,
508,
7554,
14,
20465,
26,
327,
1125,
499,
334,
889,
4066,
570,
9,
267,
372,
715,
339,
327,
570,
3495,
272,
2203,
275,
715,
272,
367,
818,
315,
12404,
26,
489,
2203,
275,
2203,
436,
747,
14,
2732,
8,
277,
855,
929,
1173,
12,
818,
9,
272,
372,
2203,
819,
347,
1586,
8,
277,
12,
1305,
29,
403,
304,
272,
2256,
275,
1052,
2286,
291,
855,
409,
63,
929,
63,
493,
8,
344,
9,
2043,
272,
340,
291,
855,
929,
1173,
26,
489,
340,
747,
14,
515,
14,
6292,
8,
277,
855,
929,
1173,
304,
267,
1174,
1173,
275,
1551,
8,
277,
855,
929,
1173,
12,
283,
82,
358,
267,
862,
26,
881,
2256,
275,
17572,
14,
912,
8,
929,
1173,
9,
267,
871,
21157,
26,
881,
986,
2728,
1174,
1173,
14,
1600,
342,
2286,
372,
2256,
288,
523,
347,
2218,
8,
277,
12,
1305,
12,
2256,
304,
272,
291,
855,
409,
63,
929,
63,
493,
8,
344,
9,
272,
340,
440,
747,
14,
515,
14,
2444,
8,
277,
855,
929,
1173,
304,
489,
291,
14,
3584,
8,
344,
9,
20950,
1174,
1173,
275,
1551,
8,
277,
855,
929,
1173,
12,
283,
87,
358,
272,
17572,
14,
2724,
8,
815,
12,
1174,
1173,
9,
272,
1174,
1173,
14,
1600,
342,
12244,
347,
5436,
8,
277,
12,
1305,
29,
403,
304,
272,
291,
855,
409,
63,
929,
63,
493,
8,
344,
9,
272,
340,
291,
855,
929,
1173,
436,
747,
14,
515,
14,
2444,
8,
277,
855,
929,
1173,
304,
489,
747,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
sorenk/ansible
|
test/units/modules/network/f5/test_bigip_partition.py
|
23
|
6168
|
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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
import os
import json
import sys
from nose.plugins.skip import SkipTest
if sys.version_info < (2, 7):
raise SkipTest("F5 Ansible modules require Python >= 2.7")
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import Mock
from ansible.compat.tests.mock import patch
from ansible.module_utils.basic import AnsibleModule
try:
from library.bigip_partition import Parameters
from library.bigip_partition import ModuleManager
from library.bigip_partition import ArgumentSpec
from library.module_utils.network.f5.common import F5ModuleError
from library.module_utils.network.f5.common import iControlUnexpectedHTTPError
from test.unit.modules.utils import set_module_args
except ImportError:
try:
from ansible.modules.network.f5.bigip_partition import Parameters
from ansible.modules.network.f5.bigip_partition import ModuleManager
from ansible.modules.network.f5.bigip_partition import ArgumentSpec
from ansible.module_utils.network.f5.common import F5ModuleError
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
from units.modules.utils import set_module_args
except ImportError:
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures')
fixture_data = {}
def load_fixture(name):
path = os.path.join(fixture_path, name)
if path in fixture_data:
return fixture_data[path]
with open(path) as f:
data = f.read()
try:
data = json.loads(data)
except Exception:
pass
fixture_data[path] = data
return data
class TestParameters(unittest.TestCase):
def test_module_parameters(self):
args = dict(
name='foo',
description='my description',
route_domain=0
)
p = Parameters(params=args)
assert p.name == 'foo'
assert p.description == 'my description'
assert p.route_domain == 0
def test_module_parameters_string_domain(self):
args = dict(
name='foo',
route_domain='0'
)
p = Parameters(params=args)
assert p.name == 'foo'
assert p.route_domain == 0
def test_api_parameters(self):
args = dict(
name='foo',
description='my description',
defaultRouteDomain=1
)
p = Parameters(params=args)
assert p.name == 'foo'
assert p.description == 'my description'
assert p.route_domain == 1
class TestManagerEcho(unittest.TestCase):
def setUp(self):
self.spec = ArgumentSpec()
def test_create_partition(self, *args):
set_module_args(dict(
name='foo',
description='my description',
server='localhost',
password='password',
user='admin'
))
module = AnsibleModule(
argument_spec=self.spec.argument_spec,
supports_check_mode=self.spec.supports_check_mode
)
# Override methods in the specific type of manager
mm = ModuleManager(module=module)
mm.exists = Mock(side_effect=[False, True])
mm.create_on_device = Mock(return_value=True)
results = mm.exec_module()
assert results['changed'] is True
def test_create_partition_idempotent(self, *args):
set_module_args(dict(
name='foo',
description='my description',
server='localhost',
password='password',
user='admin'
))
current = Parameters(params=load_fixture('load_tm_auth_partition.json'))
module = AnsibleModule(
argument_spec=self.spec.argument_spec,
supports_check_mode=self.spec.supports_check_mode
)
# Override methods in the specific type of manager
mm = ModuleManager(module=module)
mm.exists = Mock(return_value=True)
mm.read_current_from_device = Mock(return_value=current)
results = mm.exec_module()
assert results['changed'] is False
def test_update_description(self, *args):
set_module_args(dict(
name='foo',
description='another description',
server='localhost',
password='password',
user='admin'
))
current = Parameters(params=load_fixture('load_tm_auth_partition.json'))
module = AnsibleModule(
argument_spec=self.spec.argument_spec,
supports_check_mode=self.spec.supports_check_mode
)
# Override methods in the specific type of manager
mm = ModuleManager(module=module)
mm.exists = Mock(return_value=True)
mm.read_current_from_device = Mock(return_value=current)
mm.update_on_device = Mock(return_value=True)
results = mm.exec_module()
assert results['changed'] is True
assert results['description'] == 'another description'
def test_update_route_domain(self, *args):
set_module_args(dict(
name='foo',
route_domain=1,
server='localhost',
password='password',
user='admin'
))
current = Parameters(params=load_fixture('load_tm_auth_partition.json'))
module = AnsibleModule(
argument_spec=self.spec.argument_spec,
supports_check_mode=self.spec.supports_check_mode
)
# Override methods in the specific type of manager
mm = ModuleManager(module=module)
mm.exists = Mock(return_value=True)
mm.read_current_from_device = Mock(return_value=current)
mm.update_on_device = Mock(return_value=True)
results = mm.exec_module()
assert results['changed'] is True
assert results['route_domain'] == 1
|
gpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
1898,
334,
67,
9,
9708,
481,
21,
17138,
3277,
14,
199,
3,
1664,
1696,
1684,
844,
373,
19,
14,
16,
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,
334,
6116,
63,
646,
12,
4629,
12,
870,
63,
1593,
9,
199,
363,
6577,
363,
275,
730,
199,
199,
646,
747,
199,
646,
2022,
199,
646,
984,
199,
199,
504,
11354,
14,
5265,
14,
2759,
492,
18795,
199,
692,
984,
14,
1023,
63,
815,
665,
334,
18,
12,
1520,
304,
272,
746,
18795,
480,
38,
21,
2622,
4621,
4409,
2018,
2356,
499,
14,
23,
531,
199,
199,
504,
3242,
14,
5819,
14,
2219,
492,
2882,
199,
504,
3242,
14,
5819,
14,
2219,
14,
1805,
492,
4420,
199,
504,
3242,
14,
5819,
14,
2219,
14,
1805,
492,
3371,
199,
504,
3242,
14,
578,
63,
1208,
14,
4316,
492,
6953,
199,
199,
893,
26,
272,
687,
3555,
14,
17833,
63,
5312,
492,
3897,
272,
687,
3555,
14,
17833,
63,
5312,
492,
24118,
272,
687,
3555,
14,
17833,
63,
5312,
492,
28405,
272,
687,
3555,
14,
578,
63,
1208,
14,
1200,
14,
70,
21,
14,
2330,
492,
481,
21,
12232,
272,
687,
3555,
14,
578,
63,
1208,
14,
1200,
14,
70,
21,
14,
2330,
492,
284,
3717,
8708,
12815,
272,
687,
511,
14,
3248,
14,
3112,
14,
1208,
492,
663,
63,
578,
63,
589,
199,
2590,
3545,
26,
272,
862,
26,
267,
687,
3242,
14,
3112,
14,
1200,
14,
70,
21,
14,
17833,
63,
5312,
492,
3897,
267,
687,
3242,
14,
3112,
14,
1200,
14,
70,
21,
14,
17833,
63,
5312,
492,
24118,
267,
687,
3242,
14,
3112,
14,
1200,
14,
70,
21,
14,
17833,
63,
5312,
492,
28405,
267,
687,
3242,
14,
578,
63,
1208,
14,
1200,
14,
70,
21,
14,
2330,
492,
481,
21,
12232,
267,
687,
3242,
14,
578,
63,
1208,
14,
1200,
14,
70,
21,
14,
2330,
492,
284,
3717,
8708,
12815,
267,
687,
6204,
14,
3112,
14,
1208,
492,
663,
63,
578,
63,
589,
272,
871,
3545,
26,
267,
746,
18795,
480,
38,
21,
2622,
4621,
4409,
314,
289,
21,
13,
9277,
2018,
3555,
531,
199,
199,
5997,
63,
515,
275,
747,
14,
515,
14,
904,
8,
736,
14,
515,
14,
3475,
3460,
493,
10139,
283,
8769,
358,
199,
5997,
63,
576,
275,
1052,
421,
199,
318,
2248,
63,
5997,
8,
354,
304,
272,
931,
275,
747,
14,
515,
14,
904,
8,
5997,
63,
515,
12,
536,
9,
339,
340,
931,
315,
10949,
63,
576,
26,
267,
372,
10949,
63,
576,
59,
515,
61,
339,
543,
1551,
8,
515,
9,
465,
289,
26,
267,
666,
275,
289,
14,
739,
342,
339,
862,
26,
267,
666,
275,
2022,
14,
3640,
8,
576,
9,
272,
871,
2186,
26,
267,
986,
339,
10949,
63,
576,
59,
515,
61,
275,
666,
272,
372,
666,
421,
199,
533,
1379,
5976,
8,
2796,
14,
1746,
304,
272,
347,
511,
63,
578,
63,
3214,
8,
277,
304,
267,
1249,
275,
1211,
8,
288,
536,
534,
1421,
297,
288,
1369,
534,
1662,
1369,
297,
288,
7475,
63,
2261,
29,
16,
267,
776,
398,
299,
275,
3897,
8,
1162,
29,
589,
9,
267,
702,
299,
14,
354,
508,
283,
1421,
7,
267,
702,
299,
14,
1802,
508,
283,
1662,
1369,
7,
267,
702,
299,
14,
4449,
63,
2261,
508,
378,
339,
347,
511,
63,
578,
63,
3214,
63,
875,
63,
2261,
8,
277,
304,
267,
1249,
275,
1211,
8,
288,
536,
534,
1421,
297,
288,
7475,
63,
2261,
534,
16,
7,
267,
776,
398,
299,
275,
3897,
8,
1162,
29,
589,
9,
267,
702,
299,
14,
354,
508,
283,
1421,
7,
267,
702,
299,
14,
4449,
63,
2261,
508,
378,
339,
347,
511,
63,
1246,
63,
3214,
8,
277,
304,
267,
1249,
275,
1211,
8,
288,
536,
534,
1421,
297,
288,
1369,
534,
1662,
1369,
297,
288,
849,
7161,
7705,
29,
17,
267,
776,
398,
299,
275,
3897,
8,
1162,
29,
589,
9,
267,
702,
299,
14,
354,
508,
283,
1421,
7,
267,
702,
299,
14,
1802,
508,
283,
1662,
1369,
7,
267,
702,
299,
14,
4449,
63,
2261,
508,
413,
421,
199,
533,
1379,
2988,
18690,
8,
2796,
14,
1746,
304,
339,
347,
3613,
8,
277,
304,
267,
291,
14,
1650,
275,
28405,
342,
339,
347,
511,
63,
981,
63,
5312,
8,
277,
12,
627,
589,
304,
267,
663,
63,
578,
63,
589,
8,
807,
8,
288,
536,
534,
1421,
297,
288,
1369,
534,
1662,
1369,
297,
288,
1654,
534,
5967,
297,
288,
2505,
534,
2060,
297,
288,
922,
534,
2113,
7,
267,
5082,
398,
859,
275,
6953,
8,
288,
1423,
63,
1650,
29,
277,
14,
1650,
14,
2094,
63,
1650,
12,
288,
5171,
63,
1074,
63,
632,
29,
277,
14,
1650,
14,
9823,
63,
1074,
63,
632,
267,
776,
398,
327,
11041,
3102,
315,
314,
2488,
730,
402,
5256,
267,
8562,
275,
24118,
8,
578,
29,
578,
9,
267,
8562,
14,
2444,
275,
4420,
8,
2441,
63,
5881,
1524,
797,
12,
715,
566,
267,
8562,
14,
981,
63,
265,
63,
1782,
275,
4420,
8,
1107,
63,
585,
29,
549,
9,
398,
2058,
275,
8562,
14,
1628,
63,
578,
342,
398,
702,
2058,
459,
2489,
418,
365,
715,
339,
347,
511,
63,
981,
63,
5312,
63,
21307,
8,
277,
12,
627,
589,
304,
267,
663,
63,
578,
63,
589,
8,
807,
8,
288,
536,
534,
1421,
297,
288,
1369,
534,
1662,
1369,
297,
288,
1654,
534,
5967,
297,
288,
2505,
534,
2060,
297,
288,
922,
534,
2113,
7,
267,
5082,
398,
1453,
275,
3897,
8,
1162,
29,
912,
63,
5997,
360,
912,
63,
7574,
63,
1178,
63,
5312,
14,
1001,
1333,
267,
859,
275,
6953,
8,
288,
1423,
63,
1650,
29,
277,
14,
1650,
14,
2094,
63,
1650,
12,
288,
5171,
63,
1074,
63,
632,
29,
277,
14,
1650,
14,
9823,
63,
1074,
63,
632,
267,
776,
398,
327,
11041,
3102,
315,
314,
2488,
730,
402,
5256,
267,
8562,
275,
24118,
8,
578,
29,
578,
9,
267,
8562,
14,
2444,
275,
4420,
8,
1107,
63,
585,
29,
549,
9
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
1898,
334,
67,
9,
9708,
481,
21,
17138,
3277,
14,
199,
3,
1664,
1696,
1684,
844,
373,
19,
14,
16,
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,
334,
6116,
63,
646,
12,
4629,
12,
870,
63,
1593,
9,
199,
363,
6577,
363,
275,
730,
199,
199,
646,
747,
199,
646,
2022,
199,
646,
984,
199,
199,
504,
11354,
14,
5265,
14,
2759,
492,
18795,
199,
692,
984,
14,
1023,
63,
815,
665,
334,
18,
12,
1520,
304,
272,
746,
18795,
480,
38,
21,
2622,
4621,
4409,
2018,
2356,
499,
14,
23,
531,
199,
199,
504,
3242,
14,
5819,
14,
2219,
492,
2882,
199,
504,
3242,
14,
5819,
14,
2219,
14,
1805,
492,
4420,
199,
504,
3242,
14,
5819,
14,
2219,
14,
1805,
492,
3371,
199,
504,
3242,
14,
578,
63,
1208,
14,
4316,
492,
6953,
199,
199,
893,
26,
272,
687,
3555,
14,
17833,
63,
5312,
492,
3897,
272,
687,
3555,
14,
17833,
63,
5312,
492,
24118,
272,
687,
3555,
14,
17833,
63,
5312,
492,
28405,
272,
687,
3555,
14,
578,
63,
1208,
14,
1200,
14,
70,
21,
14,
2330,
492,
481,
21,
12232,
272,
687,
3555,
14,
578,
63,
1208,
14,
1200,
14,
70,
21,
14,
2330,
492,
284,
3717,
8708,
12815,
272,
687,
511,
14,
3248,
14,
3112,
14,
1208,
492,
663,
63,
578,
63,
589,
199,
2590,
3545,
26,
272,
862,
26,
267,
687,
3242,
14,
3112,
14,
1200,
14,
70,
21,
14,
17833,
63,
5312,
492,
3897,
267,
687,
3242,
14,
3112,
14,
1200,
14,
70,
21,
14,
17833,
63,
5312,
492,
24118,
267,
687,
3242,
14,
3112,
14,
1200,
14,
70,
21,
14,
17833,
63,
5312,
492,
28405,
267,
687,
3242,
14,
578,
63,
1208,
14,
1200,
14,
70,
21,
14,
2330,
492,
481,
21,
12232,
267,
687,
3242,
14,
578,
63,
1208,
14,
1200,
14,
70,
21,
14,
2330,
492,
284,
3717,
8708,
12815,
267,
687,
6204,
14,
3112,
14,
1208,
492,
663,
63,
578,
63,
589,
272,
871,
3545,
26,
267,
746,
18795,
480,
38,
21,
2622,
4621,
4409,
314,
289,
21,
13,
9277,
2018,
3555,
531,
199,
199,
5997,
63,
515,
275,
747,
14,
515,
14,
904,
8,
736,
14,
515,
14,
3475,
3460,
493,
10139,
283,
8769,
358,
199,
5997,
63,
576,
275,
1052,
421,
199,
318,
2248,
63,
5997,
8,
354,
304,
272,
931,
275,
747,
14,
515,
14,
904,
8,
5997,
63,
515,
12,
536,
9,
339,
340,
931,
315,
10949,
63,
576,
26,
267,
372,
10949,
63,
576,
59,
515,
61,
339,
543,
1551,
8,
515,
9,
465,
289,
26,
267,
666,
275,
289,
14,
739,
342,
339,
862,
26,
267,
666,
275,
2022,
14,
3640,
8,
576,
9,
272,
871,
2186,
26,
267,
986,
339,
10949,
63,
576,
59,
515,
61,
275,
666,
272,
372,
666,
421,
199,
533,
1379,
5976,
8,
2796,
14,
1746,
304,
272,
347,
511,
63,
578,
63,
3214,
8,
277,
304,
267,
1249,
275,
1211,
8,
288,
536,
534,
1421,
297,
288,
1369,
534,
1662,
1369,
297,
288,
7475,
63,
2261,
29,
16,
267,
776,
398,
299,
275,
3897,
8,
1162,
29,
589,
9,
267,
702,
299,
14,
354,
508,
283,
1421,
7,
267,
702,
299,
14,
1802,
508,
283,
1662,
1369,
7,
267,
702,
299,
14,
4449,
63,
2261,
508,
378,
339,
347,
511,
63,
578,
63,
3214,
63,
875,
63,
2261,
8,
277,
304,
267,
1249,
275,
1211,
8,
288,
536,
534,
1421,
297,
288,
7475,
63,
2261,
534,
16,
7,
267,
776,
398,
299,
275,
3897,
8,
1162,
29,
589,
9,
267,
702,
299,
14,
354,
508,
283,
1421,
7,
267,
702,
299,
14,
4449,
63,
2261,
508,
378,
339,
347,
511,
63,
1246,
63,
3214,
8,
277,
304,
267,
1249,
275,
1211,
8,
288,
536,
534,
1421,
297,
288,
1369,
534,
1662,
1369,
297,
288,
849,
7161,
7705,
29,
17,
267,
776,
398,
299,
275,
3897,
8,
1162,
29,
589,
9,
267,
702,
299,
14,
354,
508,
283,
1421,
7,
267,
702,
299,
14,
1802,
508,
283,
1662,
1369,
7,
267,
702,
299,
14,
4449,
63,
2261,
508,
413,
421,
199,
533,
1379,
2988,
18690,
8,
2796,
14,
1746,
304,
339,
347,
3613,
8,
277,
304,
267,
291,
14,
1650,
275,
28405,
342,
339,
347,
511,
63,
981,
63,
5312,
8,
277,
12,
627,
589,
304,
267,
663,
63,
578,
63,
589,
8,
807,
8,
288,
536,
534,
1421,
297,
288,
1369,
534,
1662,
1369,
297,
288,
1654,
534,
5967,
297,
288,
2505,
534,
2060,
297,
288,
922,
534,
2113,
7,
267,
5082,
398,
859,
275,
6953,
8,
288,
1423,
63,
1650,
29,
277,
14,
1650,
14,
2094,
63,
1650,
12,
288,
5171,
63,
1074,
63,
632,
29,
277,
14,
1650,
14,
9823,
63,
1074,
63,
632,
267,
776,
398,
327,
11041,
3102,
315,
314,
2488,
730,
402,
5256,
267,
8562,
275,
24118,
8,
578,
29,
578,
9,
267,
8562,
14,
2444,
275,
4420,
8,
2441,
63,
5881,
1524,
797,
12,
715,
566,
267,
8562,
14,
981,
63,
265,
63,
1782,
275,
4420,
8,
1107,
63,
585,
29,
549,
9,
398,
2058,
275,
8562,
14,
1628,
63,
578,
342,
398,
702,
2058,
459,
2489,
418,
365,
715,
339,
347,
511,
63,
981,
63,
5312,
63,
21307,
8,
277,
12,
627,
589,
304,
267,
663,
63,
578,
63,
589,
8,
807,
8,
288,
536,
534,
1421,
297,
288,
1369,
534,
1662,
1369,
297,
288,
1654,
534,
5967,
297,
288,
2505,
534,
2060,
297,
288,
922,
534,
2113,
7,
267,
5082,
398,
1453,
275,
3897,
8,
1162,
29,
912,
63,
5997,
360,
912,
63,
7574,
63,
1178,
63,
5312,
14,
1001,
1333,
267,
859,
275,
6953,
8,
288,
1423,
63,
1650,
29,
277,
14,
1650,
14,
2094,
63,
1650,
12,
288,
5171,
63,
1074,
63,
632,
29,
277,
14,
1650,
14,
9823,
63,
1074,
63,
632,
267,
776,
398,
327,
11041,
3102,
315,
314,
2488,
730,
402,
5256,
267,
8562,
275,
24118,
8,
578,
29,
578,
9,
267,
8562,
14,
2444,
275,
4420,
8,
1107,
63,
585,
29,
549,
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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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
] |
rzambre/servo
|
tests/wpt/web-platform-tests/XMLHttpRequest/resources/authentication.py
|
247
|
1292
|
def main(request, response):
if "logout" in request.GET:
return ((401, "Unauthorized"),
[("WWW-Authenticate", 'Basic realm="test"')],
"Logged out, hopefully")
session_user = request.auth.username
session_pass = request.auth.password
expected_user_name = request.headers.get("X-User", None)
token = expected_user_name
if session_user is None and session_pass is None:
if token is not None and request.server.stash.take(token) is not None:
return 'FAIL (did not authorize)'
else:
if token is not None:
request.server.stash.put(token, "1")
status = (401, 'Unauthorized')
headers = [('WWW-Authenticate', 'Basic realm="test"'),
('XHR-USER', expected_user_name),
('SES-USER', session_user)]
return status, headers, 'FAIL (should be transparent)'
else:
if request.server.stash.take(token) == "1":
challenge = "DID"
else:
challenge = "DID-NOT"
headers = [('XHR-USER', expected_user_name),
('SES-USER', session_user),
("X-challenge", challenge)]
return headers, session_user + "\n" + session_pass;
|
mpl-2.0
|
[
318,
2446,
8,
1069,
12,
1177,
304,
272,
340,
298,
11646,
2,
315,
1056,
14,
2970,
26,
267,
372,
3666,
8854,
12,
298,
28290,
1288,
355,
10003,
27084,
13,
21476,
401,
283,
6845,
10482,
628,
396,
2,
2665,
355,
298,
28985,
734,
12,
3661,
5836,
531,
339,
2351,
63,
751,
275,
1056,
14,
1178,
14,
2473,
272,
2351,
63,
1529,
275,
1056,
14,
1178,
14,
2060,
272,
1420,
63,
751,
63,
354,
275,
1056,
14,
2139,
14,
362,
480,
56,
13,
1899,
401,
488,
9,
339,
1526,
275,
1420,
63,
751,
63,
354,
272,
340,
2351,
63,
751,
365,
488,
436,
2351,
63,
1529,
365,
488,
26,
267,
340,
1526,
365,
440,
488,
436,
1056,
14,
1000,
14,
27145,
14,
11066,
8,
1418,
9,
365,
440,
488,
26,
288,
372,
283,
8784,
334,
14887,
440,
20210,
3171,
267,
587,
26,
288,
340,
1526,
365,
440,
488,
26,
355,
1056,
14,
1000,
14,
27145,
14,
524,
8,
1418,
12,
298,
17,
531,
288,
2004,
275,
334,
8854,
12,
283,
28290,
358,
288,
2323,
275,
4274,
27084,
13,
21476,
297,
283,
6845,
10482,
628,
396,
32574,
2432,
661,
56,
14784,
13,
3791,
297,
1420,
63,
751,
63,
354,
395,
2432,
661,
51,
654,
13,
3791,
297,
2351,
63,
751,
1874,
288,
372,
2004,
12,
2323,
12,
283,
8784,
334,
5626,
506,
17265,
3171,
272,
587,
26,
267,
340,
1056,
14,
1000,
14,
27145,
14,
11066,
8,
1418,
9,
508,
298,
17,
582,
288,
14929,
275,
298,
36,
998,
2,
267,
587,
26,
288,
14929,
275,
298,
36,
998,
13,
4609,
2,
267,
2323,
275,
4274,
56,
14784,
13,
3791,
297,
1420,
63,
751,
63,
354,
395,
673,
661,
51,
654,
13,
3791,
297,
2351,
63,
751,
395,
673,
1689,
56,
13,
13911,
401,
14929,
1874,
267,
372,
2323,
12,
2351,
63,
751,
435,
1867,
78,
2,
435,
2351,
63,
1529,
27,
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
] |
[
2446,
8,
1069,
12,
1177,
304,
272,
340,
298,
11646,
2,
315,
1056,
14,
2970,
26,
267,
372,
3666,
8854,
12,
298,
28290,
1288,
355,
10003,
27084,
13,
21476,
401,
283,
6845,
10482,
628,
396,
2,
2665,
355,
298,
28985,
734,
12,
3661,
5836,
531,
339,
2351,
63,
751,
275,
1056,
14,
1178,
14,
2473,
272,
2351,
63,
1529,
275,
1056,
14,
1178,
14,
2060,
272,
1420,
63,
751,
63,
354,
275,
1056,
14,
2139,
14,
362,
480,
56,
13,
1899,
401,
488,
9,
339,
1526,
275,
1420,
63,
751,
63,
354,
272,
340,
2351,
63,
751,
365,
488,
436,
2351,
63,
1529,
365,
488,
26,
267,
340,
1526,
365,
440,
488,
436,
1056,
14,
1000,
14,
27145,
14,
11066,
8,
1418,
9,
365,
440,
488,
26,
288,
372,
283,
8784,
334,
14887,
440,
20210,
3171,
267,
587,
26,
288,
340,
1526,
365,
440,
488,
26,
355,
1056,
14,
1000,
14,
27145,
14,
524,
8,
1418,
12,
298,
17,
531,
288,
2004,
275,
334,
8854,
12,
283,
28290,
358,
288,
2323,
275,
4274,
27084,
13,
21476,
297,
283,
6845,
10482,
628,
396,
32574,
2432,
661,
56,
14784,
13,
3791,
297,
1420,
63,
751,
63,
354,
395,
2432,
661,
51,
654,
13,
3791,
297,
2351,
63,
751,
1874,
288,
372,
2004,
12,
2323,
12,
283,
8784,
334,
5626,
506,
17265,
3171,
272,
587,
26,
267,
340,
1056,
14,
1000,
14,
27145,
14,
11066,
8,
1418,
9,
508,
298,
17,
582,
288,
14929,
275,
298,
36,
998,
2,
267,
587,
26,
288,
14929,
275,
298,
36,
998,
13,
4609,
2,
267,
2323,
275,
4274,
56,
14784,
13,
3791,
297,
1420,
63,
751,
63,
354,
395,
673,
661,
51,
654,
13,
3791,
297,
2351,
63,
751,
395,
673,
1689,
56,
13,
13911,
401,
14929,
1874,
267,
372,
2323,
12,
2351,
63,
751,
435,
1867,
78,
2,
435,
2351,
63,
1529,
27,
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,
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,
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jyij', # 0x06
'jjyic', # 0x07
'jjyik', # 0x08
'jjyit', # 0x09
'jjyip', # 0x0a
'jjyih', # 0x0b
'jji', # 0x0c
'jjig', # 0x0d
'jjigg', # 0x0e
'jjigs', # 0x0f
'jjin', # 0x10
'jjinj', # 0x11
'jjinh', # 0x12
'jjid', # 0x13
'jjil', # 0x14
'jjilg', # 0x15
'jjilm', # 0x16
'jjilb', # 0x17
'jjils', # 0x18
'jjilt', # 0x19
'jjilp', # 0x1a
'jjilh', # 0x1b
'jjim', # 0x1c
'jjib', # 0x1d
'jjibs', # 0x1e
'jjis', # 0x1f
'jjiss', # 0x20
'jjing', # 0x21
'jjij', # 0x22
'jjic', # 0x23
'jjik', # 0x24
'jjit', # 0x25
'jjip', # 0x26
'jjih', # 0x27
'ca', # 0x28
'cag', # 0x29
'cagg', # 0x2a
'cags', # 0x2b
'can', # 0x2c
'canj', # 0x2d
'canh', # 0x2e
'cad', # 0x2f
'cal', # 0x30
'calg', # 0x31
'calm', # 0x32
'calb', # 0x33
'cals', # 0x34
'calt', # 0x35
'calp', # 0x36
'calh', # 0x37
'cam', # 0x38
'cab', # 0x39
'cabs', # 0x3a
'cas', # 0x3b
'cass', # 0x3c
'cang', # 0x3d
'caj', # 0x3e
'cac', # 0x3f
'cak', # 0x40
'cat', # 0x41
'cap', # 0x42
'cah', # 0x43
'cae', # 0x44
'caeg', # 0x45
'caegg', # 0x46
'caegs', # 0x47
'caen', # 0x48
'caenj', # 0x49
'caenh', # 0x4a
'caed', # 0x4b
'cael', # 0x4c
'caelg', # 0x4d
'caelm', # 0x4e
'caelb', # 0x4f
'caels', # 0x50
'caelt', # 0x51
'caelp', # 0x52
'caelh', # 0x53
'caem', # 0x54
'caeb', # 0x55
'caebs', # 0x56
'caes', # 0x57
'caess', # 0x58
'caeng', # 0x59
'caej', # 0x5a
'caec', # 0x5b
'caek', # 0x5c
'caet', # 0x5d
'caep', # 0x5e
'caeh', # 0x5f
'cya', # 0x60
'cyag', # 0x61
'cyagg', # 0x62
'cyags', # 0x63
'cyan', # 0x64
'cyanj', # 0x65
'cyanh', # 0x66
'cyad', # 0x67
'cyal', # 0x68
'cyalg', # 0x69
'cyalm', # 0x6a
'cyalb', # 0x6b
'cyals', # 0x6c
'cyalt', # 0x6d
'cyalp', # 0x6e
'cyalh', # 0x6f
'cyam', # 0x70
'cyab', # 0x71
'cyabs', # 0x72
'cyas', # 0x73
'cyass', # 0x74
'cyang', # 0x75
'cyaj', # 0x76
'cyac', # 0x77
'cyak', # 0x78
'cyat', # 0x79
'cyap', # 0x7a
'cyah', # 0x7b
'cyae', # 0x7c
'cyaeg', # 0x7d
'cyaegg', # 0x7e
'cyaegs', # 0x7f
'cyaen', # 0x80
'cyaenj', # 0x81
'cyaenh', # 0x82
'cyaed', # 0x83
'cyael', # 0x84
'cyaelg', # 0x85
'cyaelm', # 0x86
'cyaelb', # 0x87
'cyaels', # 0x88
'cyaelt', # 0x89
'cyaelp', # 0x8a
'cyaelh', # 0x8b
'cyaem', # 0x8c
'cyaeb', # 0x8d
'cyaebs', # 0x8e
'cyaes', # 0x8f
'cyaess', # 0x90
'cyaeng', # 0x91
'cyaej', # 0x92
'cyaec', # 0x93
'cyaek', # 0x94
'cyaet', # 0x95
'cyaep', # 0x96
'cyaeh', # 0x97
'ceo', # 0x98
'ceog', # 0x99
'ceogg', # 0x9a
'ceogs', # 0x9b
'ceon', # 0x9c
'ceonj', # 0x9d
'ceonh', # 0x9e
'ceod', # 0x9f
'ceol', # 0xa0
'ceolg', # 0xa1
'ceolm', # 0xa2
'ceolb', # 0xa3
'ceols', # 0xa4
'ceolt', # 0xa5
'ceolp', # 0xa6
'ceolh', # 0xa7
'ceom', # 0xa8
'ceob', # 0xa9
'ceobs', # 0xaa
'ceos', # 0xab
'ceoss', # 0xac
'ceong', # 0xad
'ceoj', # 0xae
'ceoc', # 0xaf
'ceok', # 0xb0
'ceot', # 0xb1
'ceop', # 0xb2
'ceoh', # 0xb3
'ce', # 0xb4
'ceg', # 0xb5
'cegg', # 0xb6
'cegs', # 0xb7
'cen', # 0xb8
'cenj', # 0xb9
'cenh', # 0xba
'ced', # 0xbb
'cel', # 0xbc
'celg', # 0xbd
'celm', # 0xbe
'celb', # 0xbf
'cels', # 0xc0
'celt', # 0xc1
'celp', # 0xc2
'celh', # 0xc3
'cem', # 0xc4
'ceb', # 0xc5
'cebs', # 0xc6
'ces', # 0xc7
'cess', # 0xc8
'ceng', # 0xc9
'cej', # 0xca
'cec', # 0xcb
'cek', # 0xcc
'cet', # 0xcd
'cep', # 0xce
'ceh', # 0xcf
'cyeo', # 0xd0
'cyeog', # 0xd1
'cyeogg', # 0xd2
'cyeogs', # 0xd3
'cyeon', # 0xd4
'cyeonj', # 0xd5
'cyeonh', # 0xd6
'cyeod', # 0xd7
'cyeol', # 0xd8
'cyeolg', # 0xd9
'cyeolm', # 0xda
'cyeolb', # 0xdb
'cyeols', # 0xdc
'cyeolt', # 0xdd
'cyeolp', # 0xde
'cyeolh', # 0xdf
'cyeom', # 0xe0
'cyeob', # 0xe1
'cyeobs', # 0xe2
'cyeos', # 0xe3
'cyeoss', # 0xe4
'cyeong', # 0xe5
'cyeoj', # 0xe6
'cyeoc', # 0xe7
'cyeok', # 0xe8
'cyeot', # 0xe9
'cyeop', # 0xea
'cyeoh', # 0xeb
'cye', # 0xec
'cyeg', # 0xed
'cyegg', # 0xee
'cyegs', # 0xef
'cyen', # 0xf0
'cyenj', # 0xf1
'cyenh', # 0xf2
'cyed', # 0xf3
'cyel', # 0xf4
'cyelg', # 0xf5
'cyelm', # 0xf6
'cyelb', # 0xf7
'cyels', # 0xf8
'cyelt', # 0xf9
'cyelp', # 0xfa
'cyelh', # 0xfb
'cyem', # 0xfc
'cyeb', # 0xfd
'cyebs', # 0xfe
'cyes', # 0xff
)
|
apache-2.0
|
[
576,
275,
334,
202,
199,
7,
12098,
89,
1017,
297,
259,
327,
378,
88,
383,
202,
199,
7,
12098,
89,
1892,
297,
259,
327,
378,
88,
614,
202,
199,
7,
12098,
21643,
1533,
297,
259,
327,
378,
88,
996,
202,
199,
7,
12098,
89,
374,
297,
259,
327,
378,
88,
1644,
202,
199,
7,
12098,
89,
19857,
297,
259,
327,
378,
88,
966,
202,
199,
7,
12098,
22440,
297,
259,
327,
378,
88,
1717,
202,
199,
7,
12098,
89,
7879,
297,
259,
327,
378,
88,
1690,
202,
199,
7,
12098,
89,
530,
297,
259,
327,
378,
88,
1780,
202,
199,
7,
12098,
89,
3258,
297,
259,
327,
378,
88,
2036,
202,
199,
7,
12098,
89,
390,
297,
259,
327,
378,
88,
1643,
202,
199,
7,
12098,
89,
711,
297,
259,
327,
378,
88,
16,
65,
202,
199,
7,
12098,
21643,
72,
297,
259,
327,
378,
88,
16,
66,
202,
199,
7,
74,
8047,
297,
259,
327,
378,
88,
16,
67,
202,
199,
7,
12098,
528,
297,
259,
327,
378,
88,
16,
68,
202,
199,
7,
12098,
528,
71,
297,
259,
327,
378,
88,
16,
69,
202,
199,
7,
74,
8047,
458,
297,
259,
327,
378,
88,
16,
70,
202,
199,
7,
12098,
262,
297,
259,
327,
378,
88,
709,
202,
199,
7,
12098,
262,
74,
297,
259,
327,
378,
88,
845,
202,
199,
7,
12098,
17695,
297,
259,
327,
378,
88,
713,
202,
199,
7,
12098,
344,
297,
259,
327,
378,
88,
969,
202,
199,
7,
12098,
382,
297,
259,
327,
378,
88,
1079,
202,
199,
7,
12098,
382,
71,
297,
259,
327,
378,
88,
1046,
202,
199,
7,
12098,
382,
77,
297,
259,
327,
378,
88,
975,
202,
199,
7,
12098,
382,
66,
297,
259,
327,
378,
88,
1196,
202,
199,
7,
12098,
17841,
297,
259,
327,
378,
88,
1085,
202,
199,
7,
12098,
4803,
297,
259,
327,
378,
88,
1167,
202,
199,
7,
12098,
382,
80,
297,
259,
327,
378,
88,
17,
65,
202,
199,
7,
12098,
382,
72,
297,
259,
327,
378,
88,
17,
66,
202,
199,
7,
12098,
1017,
297,
259,
327,
378,
88,
17,
67,
202,
199,
7,
12098,
1892,
297,
259,
327,
378,
88,
17,
68,
202,
199,
7,
74,
8047,
1533,
297,
259,
327,
378,
88,
17,
69,
202,
199,
7,
12098,
374,
297,
259,
327,
378,
88,
17,
70,
202,
199,
7,
12098,
19857,
297,
259,
327,
378,
88,
1165,
202,
199,
7,
12098,
316,
297,
259,
327,
378,
88,
2025,
202,
199,
7,
12098,
7879,
297,
259,
327,
378,
88,
1081,
202,
199,
7,
12098,
530,
297,
259,
327,
378,
88,
1789,
202,
199,
7,
12098,
3258,
297,
259,
327,
378,
88,
1194,
202,
199,
7,
12098,
390,
297,
259,
327,
378,
88,
821,
202,
199,
7,
12098,
711,
297,
259,
327,
378,
88,
1479,
202,
199,
7,
74,
8047,
72,
297,
259,
327,
378,
88,
1465,
202,
199,
7,
696,
297,
259,
327,
378,
88,
1651,
202,
199,
7,
67,
643,
297,
259,
327,
378,
88,
1398,
202,
199,
7,
67,
13452,
297,
259,
327,
378,
88,
18,
65,
202,
199,
7,
696,
458,
297,
259,
327,
378,
88,
18,
66,
202,
199,
7,
2425,
297,
259,
327,
378,
88,
18,
67,
202,
199,
7,
2425,
74,
297,
259,
327,
378,
88,
18,
68,
202,
199,
7,
2425,
72,
297,
259,
327,
378,
88,
18,
69,
202,
199,
7,
28806,
297,
259,
327,
378,
88,
18,
70,
202,
199,
7,
915,
297,
259,
327,
378,
88,
1216,
202,
199,
7,
915,
71,
297,
259,
327,
378,
88,
2192,
202,
199,
7,
915,
77,
297,
259,
327,
378,
88,
708,
202,
199,
7,
915,
66,
297,
259,
327,
378,
88,
1153,
202,
199,
7,
915,
83,
297,
259,
327,
378,
88,
1082,
202,
199,
7,
915,
84,
297,
259,
327,
378,
88,
1276,
202,
199,
7,
915,
80,
297,
259,
327,
378,
88,
1344,
202,
199,
7,
915,
72,
297,
259,
327,
378,
88,
1401,
202,
199,
7,
15176,
297,
259,
327,
378,
88,
1703,
202,
199,
7,
26481,
297,
259,
327,
378,
88,
1355,
202,
199,
7,
67,
2101,
297,
259,
327,
378,
88,
19,
65,
202,
199,
7,
9765,
297,
259,
327,
378,
88,
19,
66,
202,
199,
7,
67,
405,
297,
259,
327,
378,
88,
19,
67,
202,
199,
7,
67,
621,
297,
259,
327,
378,
88,
19,
68,
202,
199,
7,
696,
74,
297,
259,
327,
378,
88,
19,
69,
202,
199,
7,
11055,
297,
259,
327,
378,
88,
19,
70,
202,
199,
7,
696,
75,
297,
259,
327,
378,
88,
2167,
202,
199,
7,
3385,
297,
259,
327,
378,
88,
2953,
202,
199,
7,
2874,
297,
259,
327,
378,
88,
2260,
202,
199,
7,
696,
72,
297,
259,
327,
378,
88,
2824,
202,
199,
7,
696,
69,
297,
259,
327,
378,
88,
1602,
202,
199,
7,
696,
5902,
297,
259,
327,
378,
88,
2322,
202,
199,
7,
696,
5799,
297,
259,
327,
378,
88,
2466,
202,
199,
7,
696,
69,
458,
297,
259,
327,
378,
88,
2417,
202,
199,
7,
696,
287,
297,
259,
327,
378,
88,
2006,
202,
199,
7,
696,
287,
74,
297,
259,
327,
378,
88,
1887,
202,
199,
7,
696,
287,
72,
297,
259,
327,
378,
88,
20,
65,
202,
199,
7,
696,
379,
297,
259,
327,
378,
88,
20,
66,
202,
199,
7,
696,
352,
297,
259,
327,
378,
88,
20,
67,
202,
199,
7,
696,
352,
71,
297,
259,
327,
378,
88,
20,
68,
202,
199,
7,
696,
21226,
297,
259,
327,
378,
88,
20,
69,
202,
199,
7,
696,
17778,
297,
259,
327,
378,
88,
20,
70,
202,
199,
7,
696,
18099,
297,
259,
327,
378,
88,
1400,
202,
199,
7,
696,
15330,
297,
259,
327,
378,
88,
2869,
202,
199,
7,
696,
1357,
297,
259,
327,
378,
88,
2528,
202,
199,
7,
696,
352,
72,
297,
259,
327,
378,
88,
2481,
202,
199,
7,
696,
5633,
297,
259,
327,
378,
88,
1477,
202,
199,
7,
696,
2871,
297,
259,
327,
378,
88,
1229,
202,
199,
7,
696,
69,
1533,
297,
259,
327,
378,
88,
1367,
202,
199,
7,
696,
397,
297,
259,
327,
378,
88,
1641,
202,
199,
7,
696,
16709,
297
] |
[
275,
334,
202,
199,
7,
12098,
89,
1017,
297,
259,
327,
378,
88,
383,
202,
199,
7,
12098,
89,
1892,
297,
259,
327,
378,
88,
614,
202,
199,
7,
12098,
21643,
1533,
297,
259,
327,
378,
88,
996,
202,
199,
7,
12098,
89,
374,
297,
259,
327,
378,
88,
1644,
202,
199,
7,
12098,
89,
19857,
297,
259,
327,
378,
88,
966,
202,
199,
7,
12098,
22440,
297,
259,
327,
378,
88,
1717,
202,
199,
7,
12098,
89,
7879,
297,
259,
327,
378,
88,
1690,
202,
199,
7,
12098,
89,
530,
297,
259,
327,
378,
88,
1780,
202,
199,
7,
12098,
89,
3258,
297,
259,
327,
378,
88,
2036,
202,
199,
7,
12098,
89,
390,
297,
259,
327,
378,
88,
1643,
202,
199,
7,
12098,
89,
711,
297,
259,
327,
378,
88,
16,
65,
202,
199,
7,
12098,
21643,
72,
297,
259,
327,
378,
88,
16,
66,
202,
199,
7,
74,
8047,
297,
259,
327,
378,
88,
16,
67,
202,
199,
7,
12098,
528,
297,
259,
327,
378,
88,
16,
68,
202,
199,
7,
12098,
528,
71,
297,
259,
327,
378,
88,
16,
69,
202,
199,
7,
74,
8047,
458,
297,
259,
327,
378,
88,
16,
70,
202,
199,
7,
12098,
262,
297,
259,
327,
378,
88,
709,
202,
199,
7,
12098,
262,
74,
297,
259,
327,
378,
88,
845,
202,
199,
7,
12098,
17695,
297,
259,
327,
378,
88,
713,
202,
199,
7,
12098,
344,
297,
259,
327,
378,
88,
969,
202,
199,
7,
12098,
382,
297,
259,
327,
378,
88,
1079,
202,
199,
7,
12098,
382,
71,
297,
259,
327,
378,
88,
1046,
202,
199,
7,
12098,
382,
77,
297,
259,
327,
378,
88,
975,
202,
199,
7,
12098,
382,
66,
297,
259,
327,
378,
88,
1196,
202,
199,
7,
12098,
17841,
297,
259,
327,
378,
88,
1085,
202,
199,
7,
12098,
4803,
297,
259,
327,
378,
88,
1167,
202,
199,
7,
12098,
382,
80,
297,
259,
327,
378,
88,
17,
65,
202,
199,
7,
12098,
382,
72,
297,
259,
327,
378,
88,
17,
66,
202,
199,
7,
12098,
1017,
297,
259,
327,
378,
88,
17,
67,
202,
199,
7,
12098,
1892,
297,
259,
327,
378,
88,
17,
68,
202,
199,
7,
74,
8047,
1533,
297,
259,
327,
378,
88,
17,
69,
202,
199,
7,
12098,
374,
297,
259,
327,
378,
88,
17,
70,
202,
199,
7,
12098,
19857,
297,
259,
327,
378,
88,
1165,
202,
199,
7,
12098,
316,
297,
259,
327,
378,
88,
2025,
202,
199,
7,
12098,
7879,
297,
259,
327,
378,
88,
1081,
202,
199,
7,
12098,
530,
297,
259,
327,
378,
88,
1789,
202,
199,
7,
12098,
3258,
297,
259,
327,
378,
88,
1194,
202,
199,
7,
12098,
390,
297,
259,
327,
378,
88,
821,
202,
199,
7,
12098,
711,
297,
259,
327,
378,
88,
1479,
202,
199,
7,
74,
8047,
72,
297,
259,
327,
378,
88,
1465,
202,
199,
7,
696,
297,
259,
327,
378,
88,
1651,
202,
199,
7,
67,
643,
297,
259,
327,
378,
88,
1398,
202,
199,
7,
67,
13452,
297,
259,
327,
378,
88,
18,
65,
202,
199,
7,
696,
458,
297,
259,
327,
378,
88,
18,
66,
202,
199,
7,
2425,
297,
259,
327,
378,
88,
18,
67,
202,
199,
7,
2425,
74,
297,
259,
327,
378,
88,
18,
68,
202,
199,
7,
2425,
72,
297,
259,
327,
378,
88,
18,
69,
202,
199,
7,
28806,
297,
259,
327,
378,
88,
18,
70,
202,
199,
7,
915,
297,
259,
327,
378,
88,
1216,
202,
199,
7,
915,
71,
297,
259,
327,
378,
88,
2192,
202,
199,
7,
915,
77,
297,
259,
327,
378,
88,
708,
202,
199,
7,
915,
66,
297,
259,
327,
378,
88,
1153,
202,
199,
7,
915,
83,
297,
259,
327,
378,
88,
1082,
202,
199,
7,
915,
84,
297,
259,
327,
378,
88,
1276,
202,
199,
7,
915,
80,
297,
259,
327,
378,
88,
1344,
202,
199,
7,
915,
72,
297,
259,
327,
378,
88,
1401,
202,
199,
7,
15176,
297,
259,
327,
378,
88,
1703,
202,
199,
7,
26481,
297,
259,
327,
378,
88,
1355,
202,
199,
7,
67,
2101,
297,
259,
327,
378,
88,
19,
65,
202,
199,
7,
9765,
297,
259,
327,
378,
88,
19,
66,
202,
199,
7,
67,
405,
297,
259,
327,
378,
88,
19,
67,
202,
199,
7,
67,
621,
297,
259,
327,
378,
88,
19,
68,
202,
199,
7,
696,
74,
297,
259,
327,
378,
88,
19,
69,
202,
199,
7,
11055,
297,
259,
327,
378,
88,
19,
70,
202,
199,
7,
696,
75,
297,
259,
327,
378,
88,
2167,
202,
199,
7,
3385,
297,
259,
327,
378,
88,
2953,
202,
199,
7,
2874,
297,
259,
327,
378,
88,
2260,
202,
199,
7,
696,
72,
297,
259,
327,
378,
88,
2824,
202,
199,
7,
696,
69,
297,
259,
327,
378,
88,
1602,
202,
199,
7,
696,
5902,
297,
259,
327,
378,
88,
2322,
202,
199,
7,
696,
5799,
297,
259,
327,
378,
88,
2466,
202,
199,
7,
696,
69,
458,
297,
259,
327,
378,
88,
2417,
202,
199,
7,
696,
287,
297,
259,
327,
378,
88,
2006,
202,
199,
7,
696,
287,
74,
297,
259,
327,
378,
88,
1887,
202,
199,
7,
696,
287,
72,
297,
259,
327,
378,
88,
20,
65,
202,
199,
7,
696,
379,
297,
259,
327,
378,
88,
20,
66,
202,
199,
7,
696,
352,
297,
259,
327,
378,
88,
20,
67,
202,
199,
7,
696,
352,
71,
297,
259,
327,
378,
88,
20,
68,
202,
199,
7,
696,
21226,
297,
259,
327,
378,
88,
20,
69,
202,
199,
7,
696,
17778,
297,
259,
327,
378,
88,
20,
70,
202,
199,
7,
696,
18099,
297,
259,
327,
378,
88,
1400,
202,
199,
7,
696,
15330,
297,
259,
327,
378,
88,
2869,
202,
199,
7,
696,
1357,
297,
259,
327,
378,
88,
2528,
202,
199,
7,
696,
352,
72,
297,
259,
327,
378,
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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
] |
ruibarreira/linuxtrail
|
usr/lib/python3.4/asyncio/base_events.py
|
2
|
41913
|
"""Base implementation of event loop.
The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.
Whenever a public API takes a callback, subsequent positional
arguments will be passed to the callback if/when it is called. This
avoids the proliferation of trivial lambdas implementing closures.
Keyword arguments for the callback are not supported; this is a
conscious design decision, leaving the door open for keyword arguments
to modify the meaning of the API call itself.
"""
import collections
import concurrent.futures
import heapq
import inspect
import logging
import os
import socket
import subprocess
import time
import traceback
import sys
from . import coroutines
from . import events
from . import futures
from . import tasks
from .coroutines import coroutine
from .log import logger
__all__ = ['BaseEventLoop', 'Server']
# Argument for default thread pool executor creation.
_MAX_WORKERS = 5
# Minimum number of _scheduled timer handles before cleanup of
# cancelled handles is performed.
_MIN_SCHEDULED_TIMER_HANDLES = 100
# Minimum fraction of _scheduled timer handles that are cancelled
# before cleanup of cancelled handles is performed.
_MIN_CANCELLED_TIMER_HANDLES_FRACTION = 0.5
def _format_handle(handle):
cb = handle._callback
if inspect.ismethod(cb) and isinstance(cb.__self__, tasks.Task):
# format the task
return repr(cb.__self__)
else:
return str(handle)
def _format_pipe(fd):
if fd == subprocess.PIPE:
return '<pipe>'
elif fd == subprocess.STDOUT:
return '<stdout>'
else:
return repr(fd)
class _StopError(BaseException):
"""Raised to stop the event loop."""
def _check_resolved_address(sock, address):
# Ensure that the address is already resolved to avoid the trap of hanging
# the entire event loop when the address requires doing a DNS lookup.
family = sock.family
if family == socket.AF_INET:
host, port = address
elif family == socket.AF_INET6:
host, port = address[:2]
else:
return
type_mask = 0
if hasattr(socket, 'SOCK_NONBLOCK'):
type_mask |= socket.SOCK_NONBLOCK
if hasattr(socket, 'SOCK_CLOEXEC'):
type_mask |= socket.SOCK_CLOEXEC
# Use getaddrinfo(flags=AI_NUMERICHOST) to ensure that the address is
# already resolved.
try:
socket.getaddrinfo(host, port,
family=family,
type=(sock.type & ~type_mask),
proto=sock.proto,
flags=socket.AI_NUMERICHOST)
except socket.gaierror as err:
raise ValueError("address must be resolved (IP address), got %r: %s"
% (address, err))
def _raise_stop_error(*args):
raise _StopError
class Server(events.AbstractServer):
def __init__(self, loop, sockets):
self._loop = loop
self.sockets = sockets
self._active_count = 0
self._waiters = []
def __repr__(self):
return '<%s sockets=%r>' % (self.__class__.__name__, self.sockets)
def _attach(self):
assert self.sockets is not None
self._active_count += 1
def _detach(self):
assert self._active_count > 0
self._active_count -= 1
if self._active_count == 0 and self.sockets is None:
self._wakeup()
def close(self):
sockets = self.sockets
if sockets is None:
return
self.sockets = None
for sock in sockets:
self._loop._stop_serving(sock)
if self._active_count == 0:
self._wakeup()
def _wakeup(self):
waiters = self._waiters
self._waiters = None
for waiter in waiters:
if not waiter.done():
waiter.set_result(waiter)
@coroutine
def wait_closed(self):
if self.sockets is None or self._waiters is None:
return
waiter = futures.Future(loop=self._loop)
self._waiters.append(waiter)
yield from waiter
class BaseEventLoop(events.AbstractEventLoop):
def __init__(self):
self._timer_cancelled_count = 0
self._closed = False
self._ready = collections.deque()
self._scheduled = []
self._default_executor = None
self._internal_fds = 0
self._running = False
self._clock_resolution = time.get_clock_info('monotonic').resolution
self._exception_handler = None
self._debug = (not sys.flags.ignore_environment
and bool(os.environ.get('PYTHONASYNCIODEBUG')))
# In debug mode, if the execution of a callback or a step of a task
# exceed this duration in seconds, the slow callback/task is logged.
self.slow_callback_duration = 0.1
def __repr__(self):
return ('<%s running=%s closed=%s debug=%s>'
% (self.__class__.__name__, self.is_running(),
self.is_closed(), self.get_debug()))
def create_task(self, coro):
"""Schedule a coroutine object.
Return a task object.
"""
task = tasks.Task(coro, loop=self)
if task._source_traceback:
del task._source_traceback[-1]
return task
def _make_socket_transport(self, sock, protocol, waiter=None, *,
extra=None, server=None):
"""Create socket transport."""
raise NotImplementedError
def _make_ssl_transport(self, rawsock, protocol, sslcontext, waiter, *,
server_side=False, server_hostname=None,
extra=None, server=None):
"""Create SSL transport."""
raise NotImplementedError
def _make_datagram_transport(self, sock, protocol,
address=None, waiter=None, extra=None):
"""Create datagram transport."""
raise NotImplementedError
def _make_read_pipe_transport(self, pipe, protocol, waiter=None,
extra=None):
"""Create read pipe transport."""
raise NotImplementedError
def _make_write_pipe_transport(self, pipe, protocol, waiter=None,
extra=None):
"""Create write pipe transport."""
raise NotImplementedError
@coroutine
def _make_subprocess_transport(self, protocol, args, shell,
stdin, stdout, stderr, bufsize,
extra=None, **kwargs):
"""Create subprocess transport."""
raise NotImplementedError
def _write_to_self(self):
"""Write a byte to self-pipe, to wake up the event loop.
This may be called from a different thread.
The subclass is responsible for implementing the self-pipe.
"""
raise NotImplementedError
def _process_events(self, event_list):
"""Process selector events."""
raise NotImplementedError
def _check_closed(self):
if self._closed:
raise RuntimeError('Event loop is closed')
def run_forever(self):
"""Run until stop() is called."""
self._check_closed()
if self._running:
raise RuntimeError('Event loop is running.')
self._running = True
try:
while True:
try:
self._run_once()
except _StopError:
break
finally:
self._running = False
def run_until_complete(self, future):
"""Run until the Future is done.
If the argument is a coroutine, it is wrapped in a Task.
WARNING: It would be disastrous to call run_until_complete()
with the same coroutine twice -- it would wrap it in two
different Tasks and that can't be good.
Return the Future's result, or raise its exception.
"""
self._check_closed()
new_task = not isinstance(future, futures.Future)
future = tasks.async(future, loop=self)
if new_task:
# An exception is raised if the future didn't complete, so there
# is no need to log the "destroy pending task" message
future._log_destroy_pending = False
future.add_done_callback(_raise_stop_error)
self.run_forever()
future.remove_done_callback(_raise_stop_error)
if not future.done():
raise RuntimeError('Event loop stopped before Future completed.')
return future.result()
def stop(self):
"""Stop running the event loop.
Every callback scheduled before stop() is called will run. Callbacks
scheduled after stop() is called will not run. However, those callbacks
will run if run_forever is called again later.
"""
self.call_soon(_raise_stop_error)
def close(self):
"""Close the event loop.
This clears the queues and shuts down the executor,
but does not wait for the executor to finish.
The event loop must not be running.
"""
if self._running:
raise RuntimeError("Cannot close a running event loop")
if self._closed:
return
if self._debug:
logger.debug("Close %r", self)
self._closed = True
self._ready.clear()
self._scheduled.clear()
executor = self._default_executor
if executor is not None:
self._default_executor = None
executor.shutdown(wait=False)
def is_closed(self):
"""Returns True if the event loop was closed."""
return self._closed
def is_running(self):
"""Returns True if the event loop is running."""
return self._running
def time(self):
"""Return the time according to the event loop's clock.
This is a float expressed in seconds since an epoch, but the
epoch, precision, accuracy and drift are unspecified and may
differ per event loop.
"""
return time.monotonic()
def call_later(self, delay, callback, *args):
"""Arrange for a callback to be called at a given time.
Return a Handle: an opaque object with a cancel() method that
can be used to cancel the call.
The delay can be an int or float, expressed in seconds. It is
always relative to the current time.
Each callback will be called exactly once. If two callbacks
are scheduled for exactly the same time, it undefined which
will be called first.
Any positional arguments after the callback will be passed to
the callback when it is called.
"""
timer = self.call_at(self.time() + delay, callback, *args)
if timer._source_traceback:
del timer._source_traceback[-1]
return timer
def call_at(self, when, callback, *args):
"""Like call_later(), but uses an absolute time.
Absolute time corresponds to the event loop's time() method.
"""
if coroutines.iscoroutinefunction(callback):
raise TypeError("coroutines cannot be used with call_at()")
if self._debug:
self._assert_is_current_event_loop()
timer = events.TimerHandle(when, callback, args, self)
if timer._source_traceback:
del timer._source_traceback[-1]
heapq.heappush(self._scheduled, timer)
timer._scheduled = True
return timer
def call_soon(self, callback, *args):
"""Arrange for a callback to be called as soon as possible.
This operates as a FIFO queue: callbacks are called in the
order in which they are registered. Each callback will be
called exactly once.
Any positional arguments after the callback will be passed to
the callback when it is called.
"""
handle = self._call_soon(callback, args, check_loop=True)
if handle._source_traceback:
del handle._source_traceback[-1]
return handle
def _call_soon(self, callback, args, check_loop):
if coroutines.iscoroutinefunction(callback):
raise TypeError("coroutines cannot be used with call_soon()")
if self._debug and check_loop:
self._assert_is_current_event_loop()
handle = events.Handle(callback, args, self)
if handle._source_traceback:
del handle._source_traceback[-1]
self._ready.append(handle)
return handle
def _assert_is_current_event_loop(self):
"""Asserts that this event loop is the current event loop.
Non-thread-safe methods of this class make this assumption and will
likely behave incorrectly when the assumption is violated.
Should only be called when (self._debug == True). The caller is
responsible for checking this condition for performance reasons.
"""
try:
current = events.get_event_loop()
except AssertionError:
return
if current is not self:
raise RuntimeError(
"Non-thread-safe operation invoked on an event loop other "
"than the current one")
def call_soon_threadsafe(self, callback, *args):
"""Like call_soon(), but thread-safe."""
handle = self._call_soon(callback, args, check_loop=False)
if handle._source_traceback:
del handle._source_traceback[-1]
self._write_to_self()
return handle
def run_in_executor(self, executor, callback, *args):
if coroutines.iscoroutinefunction(callback):
raise TypeError("Coroutines cannot be used with run_in_executor()")
if isinstance(callback, events.Handle):
assert not args
assert not isinstance(callback, events.TimerHandle)
if callback._cancelled:
f = futures.Future(loop=self)
f.set_result(None)
return f
callback, args = callback._callback, callback._args
if executor is None:
executor = self._default_executor
if executor is None:
executor = concurrent.futures.ThreadPoolExecutor(_MAX_WORKERS)
self._default_executor = executor
return futures.wrap_future(executor.submit(callback, *args), loop=self)
def set_default_executor(self, executor):
self._default_executor = executor
def _getaddrinfo_debug(self, host, port, family, type, proto, flags):
msg = ["%s:%r" % (host, port)]
if family:
msg.append('family=%r' % family)
if type:
msg.append('type=%r' % type)
if proto:
msg.append('proto=%r' % proto)
if flags:
msg.append('flags=%r' % flags)
msg = ', '.join(msg)
logger.debug('Get address info %s', msg)
t0 = self.time()
addrinfo = socket.getaddrinfo(host, port, family, type, proto, flags)
dt = self.time() - t0
msg = ('Getting address info %s took %.3f ms: %r'
% (msg, dt * 1e3, addrinfo))
if dt >= self.slow_callback_duration:
logger.info(msg)
else:
logger.debug(msg)
return addrinfo
def getaddrinfo(self, host, port, *,
family=0, type=0, proto=0, flags=0):
if self._debug:
return self.run_in_executor(None, self._getaddrinfo_debug,
host, port, family, type, proto, flags)
else:
return self.run_in_executor(None, socket.getaddrinfo,
host, port, family, type, proto, flags)
def getnameinfo(self, sockaddr, flags=0):
return self.run_in_executor(None, socket.getnameinfo, sockaddr, flags)
@coroutine
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
"""Connect to a TCP server.
Create a streaming transport connection to a given Internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.
This method is a coroutine which will try to establish the connection
in the background. When successful, the coroutine returns a
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
# if host is empty or not set, e.g. when an
# already-connected socket was passed or when only a port
# is given. To avoid this error, you can pass
# server_hostname='' -- this will bypass the hostname
# check. (This also means that if host is a numeric
# IP/IPv6 address, we will attempt to verify that exact
# address; this will probably fail, but it is possible to
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
raise ValueError('You must set server_hostname '
'when using ssl without a host')
server_hostname = host
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
f1 = self.getaddrinfo(
host, port, family=family,
type=socket.SOCK_STREAM, proto=proto, flags=flags)
fs = [f1]
if local_addr is not None:
f2 = self.getaddrinfo(
*local_addr, family=family,
type=socket.SOCK_STREAM, proto=proto, flags=flags)
fs.append(f2)
else:
f2 = None
yield from tasks.wait(fs, loop=self)
infos = f1.result()
if not infos:
raise OSError('getaddrinfo() returned empty list')
if f2 is not None:
laddr_infos = f2.result()
if not laddr_infos:
raise OSError('getaddrinfo() returned empty list')
exceptions = []
for family, type, proto, cname, address in infos:
try:
sock = socket.socket(family=family, type=type, proto=proto)
sock.setblocking(False)
if f2 is not None:
for _, _, _, _, laddr in laddr_infos:
try:
sock.bind(laddr)
break
except OSError as exc:
exc = OSError(
exc.errno, 'error while '
'attempting to bind on address '
'{!r}: {}'.format(
laddr, exc.strerror.lower()))
exceptions.append(exc)
else:
sock.close()
sock = None
continue
if self._debug:
logger.debug("connect %r to %r", sock, address)
yield from self.sock_connect(sock, address)
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
if len(exceptions) == 1:
raise exceptions[0]
else:
# If they all have the same str(), raise one.
model = str(exceptions[0])
if all(str(exc) == model for exc in exceptions):
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
raise OSError('Multiple exceptions: {}'.format(
', '.join(str(exc) for exc in exceptions)))
elif sock is None:
raise ValueError(
'host and port was not specified and no sock specified')
sock.setblocking(False)
transport, protocol = yield from self._create_connection_transport(
sock, protocol_factory, ssl, server_hostname)
if self._debug:
# Get the socket from the transport because SSL transport closes
# the old socket and creates a new SSL socket
sock = transport.get_extra_info('socket')
logger.debug("%r connected to %s:%r: (%r, %r)",
sock, host, port, transport, protocol)
return transport, protocol
@coroutine
def _create_connection_transport(self, sock, protocol_factory, ssl,
server_hostname):
protocol = protocol_factory()
waiter = futures.Future(loop=self)
if ssl:
sslcontext = None if isinstance(ssl, bool) else ssl
transport = self._make_ssl_transport(
sock, protocol, sslcontext, waiter,
server_side=False, server_hostname=server_hostname)
else:
transport = self._make_socket_transport(sock, protocol, waiter)
yield from waiter
return transport, protocol
@coroutine
def create_datagram_endpoint(self, protocol_factory,
local_addr=None, remote_addr=None, *,
family=0, proto=0, flags=0):
"""Create datagram connection."""
if not (local_addr or remote_addr):
if family == 0:
raise ValueError('unexpected address family')
addr_pairs_info = (((family, proto), (None, None)),)
else:
# join address by (family, protocol)
addr_infos = collections.OrderedDict()
for idx, addr in ((0, local_addr), (1, remote_addr)):
if addr is not None:
assert isinstance(addr, tuple) and len(addr) == 2, (
'2-tuple is expected')
infos = yield from self.getaddrinfo(
*addr, family=family, type=socket.SOCK_DGRAM,
proto=proto, flags=flags)
if not infos:
raise OSError('getaddrinfo() returned empty list')
for fam, _, pro, _, address in infos:
key = (fam, pro)
if key not in addr_infos:
addr_infos[key] = [None, None]
addr_infos[key][idx] = address
# each addr has to have info for each (family, proto) pair
addr_pairs_info = [
(key, addr_pair) for key, addr_pair in addr_infos.items()
if not ((local_addr and addr_pair[0] is None) or
(remote_addr and addr_pair[1] is None))]
if not addr_pairs_info:
raise ValueError('can not get address information')
exceptions = []
for ((family, proto),
(local_address, remote_address)) in addr_pairs_info:
sock = None
r_addr = None
try:
sock = socket.socket(
family=family, type=socket.SOCK_DGRAM, proto=proto)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setblocking(False)
if local_addr:
sock.bind(local_address)
if remote_addr:
yield from self.sock_connect(sock, remote_address)
r_addr = remote_address
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
raise exceptions[0]
protocol = protocol_factory()
waiter = futures.Future(loop=self)
transport = self._make_datagram_transport(sock, protocol, r_addr,
waiter)
if self._debug:
if local_addr:
logger.info("Datagram endpoint local_addr=%r remote_addr=%r "
"created: (%r, %r)",
local_addr, remote_addr, transport, protocol)
else:
logger.debug("Datagram endpoint remote_addr=%r created: "
"(%r, %r)",
remote_addr, transport, protocol)
yield from waiter
return transport, protocol
@coroutine
def create_server(self, protocol_factory, host=None, port=None,
*,
family=socket.AF_UNSPEC,
flags=socket.AI_PASSIVE,
sock=None,
backlog=100,
ssl=None,
reuse_address=None):
"""Create a TCP server bound to host and port.
Return a Server object which can be used to stop the service.
This method is a coroutine.
"""
if isinstance(ssl, bool):
raise TypeError('ssl argument must be an SSLContext or None')
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
AF_INET6 = getattr(socket, 'AF_INET6', 0)
if reuse_address is None:
reuse_address = os.name == 'posix' and sys.platform != 'cygwin'
sockets = []
if host == '':
host = None
infos = yield from self.getaddrinfo(
host, port, family=family,
type=socket.SOCK_STREAM, proto=0, flags=flags)
if not infos:
raise OSError('getaddrinfo() returned empty list')
completed = False
try:
for res in infos:
af, socktype, proto, canonname, sa = res
try:
sock = socket.socket(af, socktype, proto)
except socket.error:
# Assume it's a bad family/type/protocol combination.
if self._debug:
logger.warning('create_server() failed to create '
'socket.socket(%r, %r, %r)',
af, socktype, proto, exc_info=True)
continue
sockets.append(sock)
if reuse_address:
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,
True)
# Disable IPv4/IPv6 dual stack support (enabled by
# default on Linux) which makes a single socket
# listen on both address families.
if af == AF_INET6 and hasattr(socket, 'IPPROTO_IPV6'):
sock.setsockopt(socket.IPPROTO_IPV6,
socket.IPV6_V6ONLY,
True)
try:
sock.bind(sa)
except OSError as err:
raise OSError(err.errno, 'error while attempting '
'to bind on address %r: %s'
% (sa, err.strerror.lower()))
completed = True
finally:
if not completed:
for sock in sockets:
sock.close()
else:
if sock is None:
raise ValueError('Neither host/port nor sock were specified')
sockets = [sock]
server = Server(self, sockets)
for sock in sockets:
sock.listen(backlog)
sock.setblocking(False)
self._start_serving(protocol_factory, sock, ssl, server)
if self._debug:
logger.info("%r is serving", server)
return server
@coroutine
def connect_read_pipe(self, protocol_factory, pipe):
protocol = protocol_factory()
waiter = futures.Future(loop=self)
transport = self._make_read_pipe_transport(pipe, protocol, waiter)
yield from waiter
if self._debug:
logger.debug('Read pipe %r connected: (%r, %r)',
pipe.fileno(), transport, protocol)
return transport, protocol
@coroutine
def connect_write_pipe(self, protocol_factory, pipe):
protocol = protocol_factory()
waiter = futures.Future(loop=self)
transport = self._make_write_pipe_transport(pipe, protocol, waiter)
yield from waiter
if self._debug:
logger.debug('Write pipe %r connected: (%r, %r)',
pipe.fileno(), transport, protocol)
return transport, protocol
def _log_subprocess(self, msg, stdin, stdout, stderr):
info = [msg]
if stdin is not None:
info.append('stdin=%s' % _format_pipe(stdin))
if stdout is not None and stderr == subprocess.STDOUT:
info.append('stdout=stderr=%s' % _format_pipe(stdout))
else:
if stdout is not None:
info.append('stdout=%s' % _format_pipe(stdout))
if stderr is not None:
info.append('stderr=%s' % _format_pipe(stderr))
logger.debug(' '.join(info))
@coroutine
def subprocess_shell(self, protocol_factory, cmd, *, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=False, shell=True, bufsize=0,
**kwargs):
if not isinstance(cmd, (bytes, str)):
raise ValueError("cmd must be a string")
if universal_newlines:
raise ValueError("universal_newlines must be False")
if not shell:
raise ValueError("shell must be True")
if bufsize != 0:
raise ValueError("bufsize must be 0")
protocol = protocol_factory()
if self._debug:
# don't log parameters: they may contain sensitive information
# (password) and may be too long
debug_log = 'run shell command %r' % cmd
self._log_subprocess(debug_log, stdin, stdout, stderr)
transport = yield from self._make_subprocess_transport(
protocol, cmd, True, stdin, stdout, stderr, bufsize, **kwargs)
if self._debug:
logger.info('%s: %r' % (debug_log, transport))
return transport, protocol
@coroutine
def subprocess_exec(self, protocol_factory, program, *args,
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, universal_newlines=False,
shell=False, bufsize=0, **kwargs):
if universal_newlines:
raise ValueError("universal_newlines must be False")
if shell:
raise ValueError("shell must be False")
if bufsize != 0:
raise ValueError("bufsize must be 0")
popen_args = (program,) + args
for arg in popen_args:
if not isinstance(arg, (str, bytes)):
raise TypeError("program arguments must be "
"a bytes or text string, not %s"
% type(arg).__name__)
protocol = protocol_factory()
if self._debug:
# don't log parameters: they may contain sensitive information
# (password) and may be too long
debug_log = 'execute program %r' % program
self._log_subprocess(debug_log, stdin, stdout, stderr)
transport = yield from self._make_subprocess_transport(
protocol, popen_args, False, stdin, stdout, stderr,
bufsize, **kwargs)
if self._debug:
logger.info('%s: %r' % (debug_log, transport))
return transport, protocol
def set_exception_handler(self, handler):
"""Set handler as the new event loop exception handler.
If handler is None, the default exception handler will
be set.
If handler is a callable object, it should have a
signature matching '(loop, context)', where 'loop'
will be a reference to the active event loop, 'context'
will be a dict object (see `call_exception_handler()`
documentation for details about context).
"""
if handler is not None and not callable(handler):
raise TypeError('A callable object or None is expected, '
'got {!r}'.format(handler))
self._exception_handler = handler
def default_exception_handler(self, context):
"""Default exception handler.
This is called when an exception occurs and no exception
handler is set, and can be called by a custom exception
handler that wants to defer to the default behavior.
The context parameter has the same meaning as in
`call_exception_handler()`.
"""
message = context.get('message')
if not message:
message = 'Unhandled exception in event loop'
exception = context.get('exception')
if exception is not None:
exc_info = (type(exception), exception, exception.__traceback__)
else:
exc_info = False
log_lines = [message]
for key in sorted(context):
if key in {'message', 'exception'}:
continue
value = context[key]
if key == 'source_traceback':
tb = ''.join(traceback.format_list(value))
value = 'Object created at (most recent call last):\n'
value += tb.rstrip()
else:
value = repr(value)
log_lines.append('{}: {}'.format(key, value))
logger.error('\n'.join(log_lines), exc_info=exc_info)
def call_exception_handler(self, context):
"""Call the current event loop's exception handler.
The context argument is a dict containing the following keys:
- 'message': Error message;
- 'exception' (optional): Exception object;
- 'future' (optional): Future instance;
- 'handle' (optional): Handle instance;
- 'protocol' (optional): Protocol instance;
- 'transport' (optional): Transport instance;
- 'socket' (optional): Socket instance.
New keys maybe introduced in the future.
Note: do not overload this method in an event loop subclass.
For custom exception handling, use the
`set_exception_handler()` method.
"""
if self._exception_handler is None:
try:
self.default_exception_handler(context)
except Exception:
# Second protection layer for unexpected errors
# in the default implementation, as well as for subclassed
# event loops with overloaded "default_exception_handler".
logger.error('Exception in default exception handler',
exc_info=True)
else:
try:
self._exception_handler(self, context)
except Exception as exc:
# Exception in the user set custom exception handler.
try:
# Let's try default handler.
self.default_exception_handler({
'message': 'Unhandled error in exception handler',
'exception': exc,
'context': context,
})
except Exception:
# Guard 'default_exception_handler' in case it is
# overloaded.
logger.error('Exception in default exception handler '
'while handling an unexpected error '
'in custom exception handler',
exc_info=True)
def _add_callback(self, handle):
"""Add a Handle to _scheduled (TimerHandle) or _ready."""
assert isinstance(handle, events.Handle), 'A Handle is required here'
if handle._cancelled:
return
assert not isinstance(handle, events.TimerHandle)
self._ready.append(handle)
def _add_callback_signalsafe(self, handle):
"""Like _add_callback() but called from a signal handler."""
self._add_callback(handle)
self._write_to_self()
def _timer_handle_cancelled(self, handle):
"""Notification that a TimerHandle has been cancelled."""
if handle._scheduled:
self._timer_cancelled_count += 1
def _run_once(self):
"""Run one full iteration of the event loop.
This calls all currently ready callbacks, polls for I/O,
schedules the resulting callbacks, and finally schedules
'call_later' callbacks.
"""
sched_count = len(self._scheduled)
if (sched_count > _MIN_SCHEDULED_TIMER_HANDLES and
self._timer_cancelled_count / sched_count >
_MIN_CANCELLED_TIMER_HANDLES_FRACTION):
# Remove delayed calls that were cancelled if their number
# is too high
new_scheduled = []
for handle in self._scheduled:
if handle._cancelled:
handle._scheduled = False
else:
new_scheduled.append(handle)
heapq.heapify(new_scheduled)
self._scheduled = new_scheduled
self._timer_cancelled_count = 0
else:
# Remove delayed calls that were cancelled from head of queue.
while self._scheduled and self._scheduled[0]._cancelled:
self._timer_cancelled_count -= 1
handle = heapq.heappop(self._scheduled)
handle._scheduled = False
timeout = None
if self._ready:
timeout = 0
elif self._scheduled:
# Compute the desired timeout.
when = self._scheduled[0]._when
timeout = max(0, when - self.time())
if self._debug and timeout != 0:
t0 = self.time()
event_list = self._selector.select(timeout)
dt = self.time() - t0
if dt >= 1.0:
level = logging.INFO
else:
level = logging.DEBUG
nevent = len(event_list)
if timeout is None:
logger.log(level, 'poll took %.3f ms: %s events',
dt * 1e3, nevent)
elif nevent:
logger.log(level,
'poll %.3f ms took %.3f ms: %s events',
timeout * 1e3, dt * 1e3, nevent)
elif dt >= 1.0:
logger.log(level,
'poll %.3f ms took %.3f ms: timeout',
timeout * 1e3, dt * 1e3)
else:
event_list = self._selector.select(timeout)
self._process_events(event_list)
# Handle 'later' callbacks that are ready.
end_time = self.time() + self._clock_resolution
while self._scheduled:
handle = self._scheduled[0]
if handle._when >= end_time:
break
handle = heapq.heappop(self._scheduled)
handle._scheduled = False
self._ready.append(handle)
# This is the only place where callbacks are actually *called*.
# All other places just add them to ready.
# Note: We run all currently scheduled callbacks, but not any
# callbacks scheduled by callbacks run this time around --
# they will be run the next time (after another I/O poll).
# Use an idiom that is thread-safe without using locks.
ntodo = len(self._ready)
for i in range(ntodo):
handle = self._ready.popleft()
if handle._cancelled:
continue
if self._debug:
t0 = self.time()
handle._run()
dt = self.time() - t0
if dt >= self.slow_callback_duration:
logger.warning('Executing %s took %.3f seconds',
_format_handle(handle), dt)
else:
handle._run()
handle = None # Needed to break cycles when an exception occurs.
def get_debug(self):
return self._debug
def set_debug(self, enabled):
self._debug = enabled
|
gpl-3.0
|
[
624,
1563,
4514,
402,
1566,
4438,
14,
199,
199,
1918,
1566,
4438,
883,
506,
10529,
1536,
1901,
282,
3663,
32200,
334,
1589,
1777,
199,
3853,
1164,
367,
11705,
316,
2739,
402,
473,
15,
47,
4474,
9,
436,
314,
1566,
4438,
5576,
12,
199,
6777,
14018,
282,
3663,
32200,
543,
9330,
367,
23800,
13484,
12,
199,
20250,
590,
503,
737,
282,
1627,
900,
315,
314,
6466,
14,
199,
199,
11423,
5907,
282,
4575,
3261,
6181,
282,
3233,
12,
13372,
11333,
199,
4958,
911,
506,
3032,
370,
314,
3233,
340,
15,
6526,
652,
365,
2797,
14,
221,
961,
199,
27403,
83,
314,
557,
853,
281,
425,
402,
28586,
27593,
24315,
18234,
2463,
83,
1482,
14,
199,
10650,
2368,
367,
314,
3233,
787,
440,
3748,
27,
642,
365,
282,
199,
388,
9907,
1785,
12899,
14692,
12,
23188,
314,
886,
269,
1551,
367,
4252,
2368,
199,
475,
2811,
314,
11150,
402,
314,
3261,
1240,
6337,
14,
199,
624,
421,
199,
646,
5055,
199,
646,
23002,
14,
25513,
199,
646,
13295,
81,
199,
646,
6485,
199,
646,
2050,
199,
646,
747,
199,
646,
2838,
199,
646,
3873,
199,
646,
900,
199,
646,
5190,
199,
646,
984,
199,
199,
504,
1275,
492,
1970,
548,
3746,
199,
504,
1275,
492,
4474,
199,
504,
1275,
492,
27471,
199,
504,
1275,
492,
6527,
199,
504,
1275,
989,
548,
3746,
492,
1970,
13242,
199,
504,
1275,
793,
492,
2512,
421,
199,
363,
452,
363,
275,
788,
1563,
2390,
7382,
297,
283,
3120,
418,
421,
199,
3,
5886,
367,
849,
2462,
4203,
13270,
7143,
14,
199,
63,
4283,
63,
8406,
3960,
275,
959,
199,
199,
3,
22466,
1329,
402,
485,
19274,
9715,
10022,
2544,
9058,
402,
199,
3,
20115,
10022,
365,
10585,
14,
199,
63,
4896,
63,
27944,
53,
5290,
63,
29108,
63,
10854,
11344,
275,
2948,
199,
199,
3,
22466,
12347,
402,
485,
19274,
9715,
10022,
626,
787,
20115,
199,
3,
2544,
9058,
402,
20115,
10022,
365,
10585,
14,
199,
63,
4896,
63,
20707,
5290,
63,
29108,
63,
10854,
11344,
63,
38,
20656,
275,
378,
14,
21,
199,
199,
318,
485,
908,
63,
2479,
8,
2479,
304,
272,
7434,
275,
2429,
423,
3058,
272,
340,
6485,
14,
374,
765,
8,
2894,
9,
436,
1228,
8,
2894,
855,
277,
3108,
6527,
14,
4476,
304,
267,
327,
1475,
314,
2120,
267,
372,
4700,
8,
2894,
855,
277,
3368,
272,
587,
26,
267,
372,
620,
8,
2479,
9,
421,
199,
318,
485,
908,
63,
4990,
8,
2592,
304,
272,
340,
6111,
508,
3873,
14,
6089,
26,
267,
372,
2650,
4990,
3524,
272,
916,
6111,
508,
3873,
14,
13850,
26,
267,
372,
2650,
2703,
3524,
272,
587,
26,
267,
372,
4700,
8,
2592,
9,
421,
199,
533,
485,
6293,
547,
8,
29900,
304,
272,
408,
16894,
370,
3631,
314,
1566,
4438,
1041,
421,
199,
318,
485,
1074,
63,
13697,
63,
1562,
8,
5096,
12,
2287,
304,
272,
327,
7523,
626,
314,
2287,
365,
2575,
12152,
370,
5126,
314,
22514,
402,
394,
8544,
272,
327,
314,
8039,
1566,
4438,
1380,
314,
2287,
5074,
9689,
282,
10237,
4237,
14,
272,
9614,
275,
6771,
14,
6606,
272,
340,
9614,
508,
2838,
14,
5699,
63,
11367,
26,
267,
1591,
12,
1844,
275,
2287,
272,
916,
9614,
508,
2838,
14,
5699,
63,
11367,
22,
26,
267,
1591,
12,
1844,
275,
2287,
1491,
18,
61,
272,
587,
26,
267,
372,
339,
730,
63,
2629,
275,
378,
272,
340,
2688,
8,
3450,
12,
283,
9469,
63,
13887,
8475,
735,
267,
730,
63,
2629,
8901,
2838,
14,
9469,
63,
13887,
8475,
272,
340,
2688,
8,
3450,
12,
283,
9469,
63,
10353,
10276,
735,
267,
730,
63,
2629,
8901,
2838,
14,
9469,
63,
10353,
10276,
272,
327,
3645,
664,
2697,
815,
8,
2469,
29,
7730,
63,
28425,
5449,
9,
370,
4868,
626,
314,
2287,
365,
272,
327,
2575,
12152,
14,
272,
862,
26,
267,
2838,
14,
27606,
815,
8,
1102,
12,
1844,
12,
2574,
9614,
29,
6606,
12,
2574,
730,
2687,
5096,
14,
466,
1253,
6146,
466,
63,
2629,
395,
2574,
4104,
29,
5096,
14,
2625,
12,
2574,
3285,
29,
3450,
14,
7730,
63,
28425,
5449,
9,
272,
871,
2838,
14,
5294,
73,
705,
465,
2329,
26,
267,
746,
1722,
480,
1562,
1471,
506,
12152,
334,
1772,
2287,
395,
4788,
450,
82,
26,
450,
83,
2,
586,
450,
334,
1562,
12,
2329,
430,
199,
199,
318,
485,
3730,
63,
2379,
63,
705,
2031,
589,
304,
272,
746,
485,
6293,
547,
421,
199,
533,
7146,
8,
4368,
14,
8458,
3120,
304,
339,
347,
636,
826,
721,
277,
12,
4438,
12,
18772,
304,
267,
291,
423,
3813,
275,
4438,
267,
291,
14,
20517,
275,
18772,
267,
291,
423,
2682,
63,
835,
275,
378,
267,
291,
423,
758,
15266,
275,
942,
339,
347,
636,
2722,
721,
277,
304,
267,
372,
18342,
83,
18772,
2458,
82,
3524,
450,
334,
277,
855,
533,
4914,
354,
3108,
291,
14,
20517,
9,
339,
347,
485,
5040,
8,
277,
304,
267,
702,
291,
14,
20517,
365,
440,
488,
267,
291,
423,
2682,
63,
835,
847,
413,
339,
347,
485,
14481,
8,
277,
304,
267,
702,
291,
423,
2682,
63,
835,
690,
378,
267,
291,
423,
2682,
63,
835,
4862,
413,
267,
340,
291,
423,
2682,
63,
835,
508,
378,
436,
291,
14,
20517,
365,
488,
26,
288,
291,
423,
28715,
342,
339,
347,
4002,
8,
277,
304,
267,
18772,
275,
291,
14,
20517,
267,
340,
18772,
365,
488,
26,
288,
372,
267,
291,
14,
20517,
275,
488,
267,
367,
6771,
315,
18772,
26,
288,
291,
423,
3813,
423,
2379,
63,
14717,
8,
5096,
9,
267,
340,
291,
423,
2682,
63,
835,
508,
378,
26,
288,
291,
423,
28715,
342,
339,
347,
485,
28715,
8,
277,
304,
267,
336,
5789,
878,
275,
291,
423,
758,
15266,
267,
291,
423,
758,
15266,
275,
488,
267,
367,
27730,
315,
336,
5789,
878,
26,
288,
340,
440,
27730,
14,
4456,
837,
355,
27730,
14,
409,
63,
1099,
8,
758,
1661,
9,
339,
768,
16675,
272,
347,
3618,
63,
5938,
8,
277,
304,
267,
340,
291,
14,
20517,
365,
488,
503,
291,
423,
758,
15266,
365,
488,
26,
288,
372,
267,
27730,
275,
27471,
14,
14224,
8,
3813,
29,
277,
423,
3813,
9,
267,
291,
423,
758,
15266,
14,
740
] |
[
1563,
4514,
402,
1566,
4438,
14,
199,
199,
1918,
1566,
4438,
883,
506,
10529,
1536,
1901,
282,
3663,
32200,
334,
1589,
1777,
199,
3853,
1164,
367,
11705,
316,
2739,
402,
473,
15,
47,
4474,
9,
436,
314,
1566,
4438,
5576,
12,
199,
6777,
14018,
282,
3663,
32200,
543,
9330,
367,
23800,
13484,
12,
199,
20250,
590,
503,
737,
282,
1627,
900,
315,
314,
6466,
14,
199,
199,
11423,
5907,
282,
4575,
3261,
6181,
282,
3233,
12,
13372,
11333,
199,
4958,
911,
506,
3032,
370,
314,
3233,
340,
15,
6526,
652,
365,
2797,
14,
221,
961,
199,
27403,
83,
314,
557,
853,
281,
425,
402,
28586,
27593,
24315,
18234,
2463,
83,
1482,
14,
199,
10650,
2368,
367,
314,
3233,
787,
440,
3748,
27,
642,
365,
282,
199,
388,
9907,
1785,
12899,
14692,
12,
23188,
314,
886,
269,
1551,
367,
4252,
2368,
199,
475,
2811,
314,
11150,
402,
314,
3261,
1240,
6337,
14,
199,
624,
421,
199,
646,
5055,
199,
646,
23002,
14,
25513,
199,
646,
13295,
81,
199,
646,
6485,
199,
646,
2050,
199,
646,
747,
199,
646,
2838,
199,
646,
3873,
199,
646,
900,
199,
646,
5190,
199,
646,
984,
199,
199,
504,
1275,
492,
1970,
548,
3746,
199,
504,
1275,
492,
4474,
199,
504,
1275,
492,
27471,
199,
504,
1275,
492,
6527,
199,
504,
1275,
989,
548,
3746,
492,
1970,
13242,
199,
504,
1275,
793,
492,
2512,
421,
199,
363,
452,
363,
275,
788,
1563,
2390,
7382,
297,
283,
3120,
418,
421,
199,
3,
5886,
367,
849,
2462,
4203,
13270,
7143,
14,
199,
63,
4283,
63,
8406,
3960,
275,
959,
199,
199,
3,
22466,
1329,
402,
485,
19274,
9715,
10022,
2544,
9058,
402,
199,
3,
20115,
10022,
365,
10585,
14,
199,
63,
4896,
63,
27944,
53,
5290,
63,
29108,
63,
10854,
11344,
275,
2948,
199,
199,
3,
22466,
12347,
402,
485,
19274,
9715,
10022,
626,
787,
20115,
199,
3,
2544,
9058,
402,
20115,
10022,
365,
10585,
14,
199,
63,
4896,
63,
20707,
5290,
63,
29108,
63,
10854,
11344,
63,
38,
20656,
275,
378,
14,
21,
199,
199,
318,
485,
908,
63,
2479,
8,
2479,
304,
272,
7434,
275,
2429,
423,
3058,
272,
340,
6485,
14,
374,
765,
8,
2894,
9,
436,
1228,
8,
2894,
855,
277,
3108,
6527,
14,
4476,
304,
267,
327,
1475,
314,
2120,
267,
372,
4700,
8,
2894,
855,
277,
3368,
272,
587,
26,
267,
372,
620,
8,
2479,
9,
421,
199,
318,
485,
908,
63,
4990,
8,
2592,
304,
272,
340,
6111,
508,
3873,
14,
6089,
26,
267,
372,
2650,
4990,
3524,
272,
916,
6111,
508,
3873,
14,
13850,
26,
267,
372,
2650,
2703,
3524,
272,
587,
26,
267,
372,
4700,
8,
2592,
9,
421,
199,
533,
485,
6293,
547,
8,
29900,
304,
272,
408,
16894,
370,
3631,
314,
1566,
4438,
1041,
421,
199,
318,
485,
1074,
63,
13697,
63,
1562,
8,
5096,
12,
2287,
304,
272,
327,
7523,
626,
314,
2287,
365,
2575,
12152,
370,
5126,
314,
22514,
402,
394,
8544,
272,
327,
314,
8039,
1566,
4438,
1380,
314,
2287,
5074,
9689,
282,
10237,
4237,
14,
272,
9614,
275,
6771,
14,
6606,
272,
340,
9614,
508,
2838,
14,
5699,
63,
11367,
26,
267,
1591,
12,
1844,
275,
2287,
272,
916,
9614,
508,
2838,
14,
5699,
63,
11367,
22,
26,
267,
1591,
12,
1844,
275,
2287,
1491,
18,
61,
272,
587,
26,
267,
372,
339,
730,
63,
2629,
275,
378,
272,
340,
2688,
8,
3450,
12,
283,
9469,
63,
13887,
8475,
735,
267,
730,
63,
2629,
8901,
2838,
14,
9469,
63,
13887,
8475,
272,
340,
2688,
8,
3450,
12,
283,
9469,
63,
10353,
10276,
735,
267,
730,
63,
2629,
8901,
2838,
14,
9469,
63,
10353,
10276,
272,
327,
3645,
664,
2697,
815,
8,
2469,
29,
7730,
63,
28425,
5449,
9,
370,
4868,
626,
314,
2287,
365,
272,
327,
2575,
12152,
14,
272,
862,
26,
267,
2838,
14,
27606,
815,
8,
1102,
12,
1844,
12,
2574,
9614,
29,
6606,
12,
2574,
730,
2687,
5096,
14,
466,
1253,
6146,
466,
63,
2629,
395,
2574,
4104,
29,
5096,
14,
2625,
12,
2574,
3285,
29,
3450,
14,
7730,
63,
28425,
5449,
9,
272,
871,
2838,
14,
5294,
73,
705,
465,
2329,
26,
267,
746,
1722,
480,
1562,
1471,
506,
12152,
334,
1772,
2287,
395,
4788,
450,
82,
26,
450,
83,
2,
586,
450,
334,
1562,
12,
2329,
430,
199,
199,
318,
485,
3730,
63,
2379,
63,
705,
2031,
589,
304,
272,
746,
485,
6293,
547,
421,
199,
533,
7146,
8,
4368,
14,
8458,
3120,
304,
339,
347,
636,
826,
721,
277,
12,
4438,
12,
18772,
304,
267,
291,
423,
3813,
275,
4438,
267,
291,
14,
20517,
275,
18772,
267,
291,
423,
2682,
63,
835,
275,
378,
267,
291,
423,
758,
15266,
275,
942,
339,
347,
636,
2722,
721,
277,
304,
267,
372,
18342,
83,
18772,
2458,
82,
3524,
450,
334,
277,
855,
533,
4914,
354,
3108,
291,
14,
20517,
9,
339,
347,
485,
5040,
8,
277,
304,
267,
702,
291,
14,
20517,
365,
440,
488,
267,
291,
423,
2682,
63,
835,
847,
413,
339,
347,
485,
14481,
8,
277,
304,
267,
702,
291,
423,
2682,
63,
835,
690,
378,
267,
291,
423,
2682,
63,
835,
4862,
413,
267,
340,
291,
423,
2682,
63,
835,
508,
378,
436,
291,
14,
20517,
365,
488,
26,
288,
291,
423,
28715,
342,
339,
347,
4002,
8,
277,
304,
267,
18772,
275,
291,
14,
20517,
267,
340,
18772,
365,
488,
26,
288,
372,
267,
291,
14,
20517,
275,
488,
267,
367,
6771,
315,
18772,
26,
288,
291,
423,
3813,
423,
2379,
63,
14717,
8,
5096,
9,
267,
340,
291,
423,
2682,
63,
835,
508,
378,
26,
288,
291,
423,
28715,
342,
339,
347,
485,
28715,
8,
277,
304,
267,
336,
5789,
878,
275,
291,
423,
758,
15266,
267,
291,
423,
758,
15266,
275,
488,
267,
367,
27730,
315,
336,
5789,
878,
26,
288,
340,
440,
27730,
14,
4456,
837,
355,
27730,
14,
409,
63,
1099,
8,
758,
1661,
9,
339,
768,
16675,
272,
347,
3618,
63,
5938,
8,
277,
304,
267,
340,
291,
14,
20517,
365,
488,
503,
291,
423,
758,
15266,
365,
488,
26,
288,
372,
267,
27730,
275,
27471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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
dongjoon-hyun/tensorflow
|
tensorflow/contrib/metrics/python/metrics/classification.py
|
2
|
8319
|
# 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.
# ==============================================================================
"""Classification metrics library."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import metrics_impl
from tensorflow.python.ops import variable_scope
from tensorflow.python.training import distribution_strategy_context
# TODO(nsilberman): move into metrics/python/ops/
def accuracy(predictions, labels, weights=None, name=None):
"""Computes the percentage of times that predictions matches labels.
Args:
predictions: the predicted values, a `Tensor` whose dtype and shape
matches 'labels'.
labels: the ground truth values, a `Tensor` of any shape and
bool, integer, or string dtype.
weights: None or `Tensor` of float values to reweight the accuracy.
name: A name for the operation (optional).
Returns:
Accuracy `Tensor`.
Raises:
ValueError: if dtypes don't match or
if dtype is not bool, integer, or string.
"""
if not (labels.dtype.is_integer or
labels.dtype in (dtypes.bool, dtypes.string)):
raise ValueError(
'Labels should have bool, integer, or string dtype, not %r' %
labels.dtype)
if not labels.dtype.is_compatible_with(predictions.dtype):
raise ValueError('Dtypes of predictions and labels should match. '
'Given: predictions (%r) and labels (%r)' %
(predictions.dtype, labels.dtype))
with ops.name_scope(name, 'accuracy', values=[predictions, labels]):
is_correct = math_ops.cast(
math_ops.equal(predictions, labels), dtypes.float32)
if weights is not None:
is_correct = math_ops.multiply(is_correct, weights)
num_values = math_ops.multiply(weights, array_ops.ones_like(is_correct))
return math_ops.div(math_ops.reduce_sum(is_correct),
math_ops.reduce_sum(num_values))
return math_ops.reduce_mean(is_correct)
def f1_score(labels, predictions, weights=None, num_thresholds=200,
metrics_collections=None, updates_collections=None, name=None):
"""Computes the approximately best F1-score across different thresholds.
The f1_score function applies a range of thresholds to the predictions to
convert them from [0, 1] to bool. Precision and recall are computed by
comparing them to the labels. The F1-Score is then defined as
2 * precision * recall / (precision + recall). The best one across the
thresholds is returned.
Disclaimer: In practice it may be desirable to choose the best threshold on
the validation set and evaluate the F1 score with this threshold on a
separate test set. Or it may be desirable to use a fixed threshold (e.g. 0.5).
This function internally creates four local variables, `true_positives`,
`true_negatives`, `false_positives` and `false_negatives` that are used to
compute the pairs of recall and precision values for a linearly spaced set of
thresholds from which the best f1-score is derived.
This value is ultimately returned as `f1-score`, an idempotent operation that
computes the F1-score (computed using the aforementioned variables). The
`num_thresholds` variable controls the degree of discretization with larger
numbers of thresholds more closely approximating the true best F1-score.
For estimation of the metric over a stream of data, the function creates an
`update_op` operation that updates these variables and returns the F1-score.
Example usage with a custom estimator:
def model_fn(features, labels, mode):
predictions = make_predictions(features)
loss = make_loss(predictions, labels)
train_op = tf.contrib.training.create_train_op(
total_loss=loss,
optimizer='Adam')
eval_metric_ops = {'f1': f1_score(labels, predictions)}
return tf.estimator.EstimatorSpec(
mode=mode,
predictions=predictions,
loss=loss,
train_op=train_op,
eval_metric_ops=eval_metric_ops,
export_outputs=export_outputs)
estimator = tf.estimator.Estimator(model_fn=model_fn)
If `weights` is `None`, weights default to 1. Use weights of 0 to mask values.
Args:
labels: A `Tensor` whose shape matches `predictions`. Will be cast to
`bool`.
predictions: A floating point `Tensor` of arbitrary shape and whose values
are in the range `[0, 1]`.
weights: Optional `Tensor` whose rank is either 0, or the same rank as
`labels`, and must be broadcastable to `labels` (i.e., all dimensions must
be either `1`, or the same as the corresponding `labels` dimension).
num_thresholds: The number of thresholds to use when discretizing the roc
curve.
metrics_collections: An optional list of collections that `f1_score` should
be added to.
updates_collections: An optional list of collections that `update_op` should
be added to.
name: An optional variable_scope name.
Returns:
f1_score: A scalar `Tensor` representing the current best f1-score across
different thresholds.
update_op: An operation that increments the `true_positives`,
`true_negatives`, `false_positives` and `false_negatives` variables
appropriately and whose value matches the `f1_score`.
Raises:
ValueError: If `predictions` and `labels` have mismatched shapes, or if
`weights` is not `None` and its shape doesn't match `predictions`, or if
either `metrics_collections` or `updates_collections` are not a list or
tuple.
"""
with variable_scope.variable_scope(
name, 'f1', (labels, predictions, weights)):
predictions, labels, weights = metrics_impl._remove_squeezable_dimensions( # pylint: disable=protected-access
predictions=predictions, labels=labels, weights=weights)
# To account for floating point imprecisions / avoid division by zero.
epsilon = 1e-7
thresholds = [(i + 1) * 1.0 / (num_thresholds - 1)
for i in range(num_thresholds - 2)]
thresholds = [0.0 - epsilon] + thresholds + [1.0 + epsilon]
# Confusion matrix.
values, update_ops = metrics_impl._confusion_matrix_at_thresholds( # pylint: disable=protected-access
labels, predictions, thresholds, weights, includes=('tp', 'fp', 'fn'))
# Compute precision and recall at various thresholds.
def compute_best_f1_score(tp, fp, fn, name):
precision_at_t = math_ops.div(tp, epsilon + tp + fp,
name='precision_' + name)
recall_at_t = math_ops.div(tp, epsilon + tp + fn, name='recall_' + name)
# Compute F1 score.
f1_at_thresholds = (
2.0 * precision_at_t * recall_at_t /
(precision_at_t + recall_at_t + epsilon))
return math_ops.reduce_max(f1_at_thresholds)
def f1_across_replicas(_, values):
best_f1 = compute_best_f1_score(tp=values['tp'], fp=values['fp'],
fn=values['fn'], name='value')
if metrics_collections:
ops.add_to_collections(metrics_collections, best_f1)
return best_f1
best_f1 = distribution_strategy_context.get_replica_context().merge_call(
f1_across_replicas, values)
update_op = compute_best_f1_score(tp=update_ops['tp'], fp=update_ops['fp'],
fn=update_ops['fn'], name='update')
if updates_collections:
ops.add_to_collections(updates_collections, update_op)
return best_f1, update_op
|
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,
28362,
7186,
3555,
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,
14,
4857,
492,
6674,
199,
504,
3228,
14,
1548,
14,
4857,
492,
4156,
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,
7186,
63,
5472,
199,
504,
3228,
14,
1548,
14,
1483,
492,
1750,
63,
2645,
199,
504,
3228,
14,
1548,
14,
7588,
492,
4084,
63,
8590,
63,
1100,
199,
199,
3,
3254,
8,
78,
20329,
605,
1237,
304,
4057,
1901,
7186,
15,
1548,
15,
1483,
15,
421,
199,
318,
12862,
8,
9869,
12,
3628,
12,
4931,
29,
403,
12,
536,
29,
403,
304,
523,
408,
22594,
314,
16327,
402,
5431,
626,
7914,
4450,
3628,
14,
819,
3033,
26,
272,
7914,
26,
314,
14746,
1338,
12,
282,
658,
3861,
64,
7447,
2152,
436,
2215,
326,
4450,
283,
3512,
1370,
272,
3628,
26,
314,
19252,
16865,
1338,
12,
282,
658,
3861,
64,
402,
1263,
2215,
436,
288,
2155,
12,
3000,
12,
503,
1059,
2152,
14,
272,
4931,
26,
488,
503,
658,
3861,
64,
402,
2069,
1338,
370,
295,
3463,
314,
12862,
14,
272,
536,
26,
437,
536,
367,
314,
3439,
334,
4144,
680,
819,
1803,
26,
272,
4473,
7933,
658,
3861,
2313,
819,
6218,
26,
272,
1722,
26,
340,
6674,
2793,
1133,
1336,
503,
355,
340,
2152,
365,
440,
2155,
12,
3000,
12,
503,
1059,
14,
523,
408,
523,
340,
440,
334,
3512,
14,
2271,
14,
374,
63,
4115,
503,
881,
3628,
14,
2271,
315,
334,
5717,
14,
2245,
12,
6674,
14,
875,
2298,
272,
746,
1722,
8,
267,
283,
14016,
1077,
1172,
2155,
12,
3000,
12,
503,
1059,
2152,
12,
440,
450,
82,
7,
450,
267,
3628,
14,
2271,
9,
523,
340,
440,
3628,
14,
2271,
14,
374,
63,
6490,
63,
1045,
8,
9869,
14,
2271,
304,
272,
746,
1722,
360,
36,
1313,
402,
7914,
436,
3628,
1077,
1336,
14,
283,
2151,
283,
13735,
26,
7914,
4366,
82,
9,
436,
3628,
4366,
82,
3171,
450,
2151,
334,
9869,
14,
2271,
12,
3628,
14,
2271,
430,
523,
543,
4156,
14,
354,
63,
2645,
8,
354,
12,
283,
13374,
297,
1338,
1524,
9869,
12,
3628,
4682,
272,
365,
63,
4525,
275,
3473,
63,
1483,
14,
2931,
8,
267,
3473,
63,
1483,
14,
1452,
8,
9869,
12,
3628,
395,
6674,
14,
1609,
708,
9,
272,
340,
4931,
365,
440,
488,
26,
489,
365,
63,
4525,
275,
3473,
63,
1483,
14,
13710,
8,
374,
63,
4525,
12,
4931,
9,
489,
1967,
63,
1459,
275,
3473,
63,
1483,
14,
13710,
8,
4916,
12,
1625,
63,
1483,
14,
4548,
63,
2930,
8,
374,
63,
4525,
430,
489,
372,
3473,
63,
1483,
14,
3015,
8,
3442,
63,
1483,
14,
5270,
63,
1838,
8,
374,
63,
4525,
395,
2079,
3473,
63,
1483,
14,
5270,
63,
1838,
8,
1507,
63,
1459,
430,
272,
372,
3473,
63,
1483,
14,
5270,
63,
3670,
8,
374,
63,
4525,
9,
421,
199,
318,
289,
17,
63,
3397,
8,
3512,
12,
7914,
12,
4931,
29,
403,
12,
1967,
63,
22611,
29,
1840,
12,
1467,
7186,
63,
7882,
29,
403,
12,
7029,
63,
7882,
29,
403,
12,
536,
29,
403,
304,
523,
408,
22594,
314,
19917,
590,
5526,
481,
17,
13,
3397,
9371,
3365,
22757,
14,
819,
710,
289,
17,
63,
3397,
805,
12966,
282,
1425,
402,
22757,
370,
314,
7914,
370,
523,
3957,
3062,
687,
359,
16,
12,
413,
61,
370,
2155,
14,
5543,
3688,
436,
26174,
787,
9235,
701,
523,
20234,
3062,
370,
314,
3628,
14,
710,
481,
17,
13,
12642,
365,
2066,
3247,
465,
523,
499,
627,
7151,
627,
26174,
1182,
334,
6833,
435,
26174,
680,
710,
5526,
1373,
9371,
314,
523,
22757,
365,
2138,
14,
819,
5289,
3995,
6267,
26,
1010,
24471,
652,
1443,
506,
477,
338,
6842,
370,
11496,
314,
5526,
8765,
641,
523,
314,
6411,
663,
436,
9352,
314,
481,
17,
5396,
543,
642,
8765,
641,
282,
523,
7396,
511,
663,
14,
4236,
652,
1443,
506,
477,
338,
6842,
370,
675,
282,
6317,
8765,
334,
69,
14,
71,
14,
378,
14,
21,
680,
819,
961,
805,
14448,
8491,
11648,
2257,
2860,
12,
658,
2052,
63,
32181,
3559,
523,
658,
2052,
63,
8705,
10661,
3559,
658,
3910,
63,
32181,
64,
436,
658,
3910,
63,
8705,
10661,
64,
626,
787,
1202,
370,
523,
4526,
314,
6342,
402,
26174,
436,
7151,
1338,
367,
282,
7798,
590,
4601,
68,
663,
402,
523,
22757,
687,
1314,
314,
5526,
289,
17,
13,
3397,
365,
7131,
14,
819,
961,
574,
365,
221,
1141,
77,
13824,
2138,
465,
658,
70,
17,
13,
3397,
3559,
376,
32122,
3439,
626,
523,
21445,
314,
481,
17,
13,
3397,
334,
14378,
1808,
314,
282,
1707,
32016,
379,
2860,
680,
710,
523,
658,
1507,
63,
22611,
64,
1750,
13467,
314,
13666,
402,
4339,
264,
280,
13362,
543,
12142,
523,
5579,
402,
22757,
1655,
4002,
590,
14106,
3969,
316,
314,
2549,
5526,
481,
17,
13,
3397,
14,
819,
2104,
27156,
402,
314,
6370,
1806,
282,
2547,
402,
666,
12,
314,
805,
8491,
376,
523,
658,
873,
63,
411,
64,
3439,
626,
7029,
3520,
2860,
436,
2529,
314,
481,
17,
13,
3397,
14,
819
] |
[
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,
28362,
7186,
3555,
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,
14,
4857,
492,
6674,
199,
504,
3228,
14,
1548,
14,
4857,
492,
4156,
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,
7186,
63,
5472,
199,
504,
3228,
14,
1548,
14,
1483,
492,
1750,
63,
2645,
199,
504,
3228,
14,
1548,
14,
7588,
492,
4084,
63,
8590,
63,
1100,
199,
199,
3,
3254,
8,
78,
20329,
605,
1237,
304,
4057,
1901,
7186,
15,
1548,
15,
1483,
15,
421,
199,
318,
12862,
8,
9869,
12,
3628,
12,
4931,
29,
403,
12,
536,
29,
403,
304,
523,
408,
22594,
314,
16327,
402,
5431,
626,
7914,
4450,
3628,
14,
819,
3033,
26,
272,
7914,
26,
314,
14746,
1338,
12,
282,
658,
3861,
64,
7447,
2152,
436,
2215,
326,
4450,
283,
3512,
1370,
272,
3628,
26,
314,
19252,
16865,
1338,
12,
282,
658,
3861,
64,
402,
1263,
2215,
436,
288,
2155,
12,
3000,
12,
503,
1059,
2152,
14,
272,
4931,
26,
488,
503,
658,
3861,
64,
402,
2069,
1338,
370,
295,
3463,
314,
12862,
14,
272,
536,
26,
437,
536,
367,
314,
3439,
334,
4144,
680,
819,
1803,
26,
272,
4473,
7933,
658,
3861,
2313,
819,
6218,
26,
272,
1722,
26,
340,
6674,
2793,
1133,
1336,
503,
355,
340,
2152,
365,
440,
2155,
12,
3000,
12,
503,
1059,
14,
523,
408,
523,
340,
440,
334,
3512,
14,
2271,
14,
374,
63,
4115,
503,
881,
3628,
14,
2271,
315,
334,
5717,
14,
2245,
12,
6674,
14,
875,
2298,
272,
746,
1722,
8,
267,
283,
14016,
1077,
1172,
2155,
12,
3000,
12,
503,
1059,
2152,
12,
440,
450,
82,
7,
450,
267,
3628,
14,
2271,
9,
523,
340,
440,
3628,
14,
2271,
14,
374,
63,
6490,
63,
1045,
8,
9869,
14,
2271,
304,
272,
746,
1722,
360,
36,
1313,
402,
7914,
436,
3628,
1077,
1336,
14,
283,
2151,
283,
13735,
26,
7914,
4366,
82,
9,
436,
3628,
4366,
82,
3171,
450,
2151,
334,
9869,
14,
2271,
12,
3628,
14,
2271,
430,
523,
543,
4156,
14,
354,
63,
2645,
8,
354,
12,
283,
13374,
297,
1338,
1524,
9869,
12,
3628,
4682,
272,
365,
63,
4525,
275,
3473,
63,
1483,
14,
2931,
8,
267,
3473,
63,
1483,
14,
1452,
8,
9869,
12,
3628,
395,
6674,
14,
1609,
708,
9,
272,
340,
4931,
365,
440,
488,
26,
489,
365,
63,
4525,
275,
3473,
63,
1483,
14,
13710,
8,
374,
63,
4525,
12,
4931,
9,
489,
1967,
63,
1459,
275,
3473,
63,
1483,
14,
13710,
8,
4916,
12,
1625,
63,
1483,
14,
4548,
63,
2930,
8,
374,
63,
4525,
430,
489,
372,
3473,
63,
1483,
14,
3015,
8,
3442,
63,
1483,
14,
5270,
63,
1838,
8,
374,
63,
4525,
395,
2079,
3473,
63,
1483,
14,
5270,
63,
1838,
8,
1507,
63,
1459,
430,
272,
372,
3473,
63,
1483,
14,
5270,
63,
3670,
8,
374,
63,
4525,
9,
421,
199,
318,
289,
17,
63,
3397,
8,
3512,
12,
7914,
12,
4931,
29,
403,
12,
1967,
63,
22611,
29,
1840,
12,
1467,
7186,
63,
7882,
29,
403,
12,
7029,
63,
7882,
29,
403,
12,
536,
29,
403,
304,
523,
408,
22594,
314,
19917,
590,
5526,
481,
17,
13,
3397,
9371,
3365,
22757,
14,
819,
710,
289,
17,
63,
3397,
805,
12966,
282,
1425,
402,
22757,
370,
314,
7914,
370,
523,
3957,
3062,
687,
359,
16,
12,
413,
61,
370,
2155,
14,
5543,
3688,
436,
26174,
787,
9235,
701,
523,
20234,
3062,
370,
314,
3628,
14,
710,
481,
17,
13,
12642,
365,
2066,
3247,
465,
523,
499,
627,
7151,
627,
26174,
1182,
334,
6833,
435,
26174,
680,
710,
5526,
1373,
9371,
314,
523,
22757,
365,
2138,
14,
819,
5289,
3995,
6267,
26,
1010,
24471,
652,
1443,
506,
477,
338,
6842,
370,
11496,
314,
5526,
8765,
641,
523,
314,
6411,
663,
436,
9352,
314,
481,
17,
5396,
543,
642,
8765,
641,
282,
523,
7396,
511,
663,
14,
4236,
652,
1443,
506,
477,
338,
6842,
370,
675,
282,
6317,
8765,
334,
69,
14,
71,
14,
378,
14,
21,
680,
819,
961,
805,
14448,
8491,
11648,
2257,
2860,
12,
658,
2052,
63,
32181,
3559,
523,
658,
2052,
63,
8705,
10661,
3559,
658,
3910,
63,
32181,
64,
436,
658,
3910,
63,
8705,
10661,
64,
626,
787,
1202,
370,
523,
4526,
314,
6342,
402,
26174,
436,
7151,
1338,
367,
282,
7798,
590,
4601,
68,
663,
402,
523,
22757,
687,
1314,
314,
5526,
289,
17,
13,
3397,
365,
7131,
14,
819,
961,
574,
365,
221,
1141,
77,
13824,
2138,
465,
658,
70,
17,
13,
3397,
3559,
376,
32122,
3439,
626,
523,
21445,
314,
481,
17,
13,
3397,
334,
14378,
1808,
314,
282,
1707,
32016,
379,
2860,
680,
710,
523,
658,
1507,
63,
22611,
64,
1750,
13467,
314,
13666,
402,
4339,
264,
280,
13362,
543,
12142,
523,
5579,
402,
22757,
1655,
4002,
590,
14106,
3969,
316,
314,
2549,
5526,
481,
17,
13,
3397,
14,
819,
2104,
27156,
402,
314,
6370,
1806,
282,
2547,
402,
666,
12,
314,
805,
8491,
376,
523,
658,
873,
63,
411,
64,
3439,
626,
7029,
3520,
2860,
436,
2529,
314,
481,
17,
13,
3397,
14,
819,
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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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
] |
GinnyN/towerofdimensions-django
|
django/utils/archive.py
|
78
|
6642
|
"""
Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/
Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributers.
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 with_statement
import os
import shutil
import sys
import tarfile
import zipfile
class ArchiveException(Exception):
"""
Base exception class for all archive errors.
"""
class UnrecognizedArchiveFormat(ArchiveException):
"""
Error raised when passed file is not a recognized archive format.
"""
def extract(path, to_path=''):
"""
Unpack the tar or zip file at the specified path to the directory
specified by to_path.
"""
Archive(path).extract(to_path)
class Archive(object):
"""
The external API class that encapsulates an archive implementation.
"""
def __init__(self, file):
self._archive = self._archive_cls(file)(file)
@staticmethod
def _archive_cls(file):
cls = None
if isinstance(file, basestring):
filename = file
else:
try:
filename = file.name
except AttributeError:
raise UnrecognizedArchiveFormat(
"File object not a recognized archive format.")
base, tail_ext = os.path.splitext(filename.lower())
cls = extension_map.get(tail_ext)
if not cls:
base, ext = os.path.splitext(base)
cls = extension_map.get(ext)
if not cls:
raise UnrecognizedArchiveFormat(
"Path not a recognized archive format: %s" % filename)
return cls
def extract(self, to_path=''):
self._archive.extract(to_path)
def list(self):
self._archive.list()
class BaseArchive(object):
"""
Base Archive class. Implementations should inherit this class.
"""
def split_leading_dir(self, path):
path = str(path)
path = path.lstrip('/').lstrip('\\')
if '/' in path and (('\\' in path and path.find('/') < path.find('\\'))
or '\\' not in path):
return path.split('/', 1)
elif '\\' in path:
return path.split('\\', 1)
else:
return path, ''
def has_leading_dir(self, paths):
"""
Returns true if all the paths have the same leading path name
(i.e., everything is in one subdirectory in an archive)
"""
common_prefix = None
for path in paths:
prefix, rest = self.split_leading_dir(path)
if not prefix:
return False
elif common_prefix is None:
common_prefix = prefix
elif prefix != common_prefix:
return False
return True
def extract(self):
raise NotImplementedError
def list(self):
raise NotImplementedError
class TarArchive(BaseArchive):
def __init__(self, file):
self._archive = tarfile.open(file)
def list(self, *args, **kwargs):
self._archive.list(*args, **kwargs)
def extract(self, to_path):
# note: python<=2.5 doesnt seem to know about pax headers, filter them
members = [member for member in self._archive.getmembers()
if member.name != 'pax_global_header']
leading = self.has_leading_dir(members)
for member in members:
name = member.name
if leading:
name = self.split_leading_dir(name)[1]
filename = os.path.join(to_path, name)
if member.isdir():
if filename and not os.path.exists(filename):
os.makedirs(filename)
else:
try:
extracted = self._archive.extractfile(member)
except (KeyError, AttributeError):
# Some corrupt tar files seem to produce this
# (specifically bad symlinks)
print ("In the tar file %s the member %s is invalid: %s" %
(name, member.name, sys.exc_info()[1]))
else:
dirname = os.path.dirname(filename)
if dirname and not os.path.exists(dirname):
os.makedirs(dirname)
with open(filename, 'wb') as outfile:
shutil.copyfileobj(extracted, outfile)
finally:
if extracted:
extracted.close()
class ZipArchive(BaseArchive):
def __init__(self, file):
self._archive = zipfile.ZipFile(file)
def list(self, *args, **kwargs):
self._archive.printdir(*args, **kwargs)
def extract(self, to_path):
namelist = self._archive.namelist()
leading = self.has_leading_dir(namelist)
for name in namelist:
data = self._archive.read(name)
if leading:
name = self.split_leading_dir(name)[1]
filename = os.path.join(to_path, name)
dirname = os.path.dirname(filename)
if dirname and not os.path.exists(dirname):
os.makedirs(dirname)
if filename.endswith(('/', '\\')):
# A directory
if not os.path.exists(filename):
os.makedirs(filename)
else:
with open(filename, 'wb') as outfile:
outfile.write(data)
extension_map = {
'.tar': TarArchive,
'.tar.bz2': TarArchive,
'.tar.gz': TarArchive,
'.tgz': TarArchive,
'.tz2': TarArchive,
'.zip': ZipArchive,
}
|
bsd-3-clause
|
[
624,
199,
20409,
641,
298,
1548,
13,
6404,
2,
1553,
1455,
921,
17343,
14,
1548,
14,
1308,
15,
17343,
15,
1548,
13,
6404,
15,
199,
199,
7384,
334,
67,
9,
7129,
598,
695,
644,
382,
834,
1603,
82,
14,
665,
71,
695,
14,
87,
382,
834,
32,
6799,
14,
957,
30,
436,
406,
786,
878,
14,
199,
199,
7980,
365,
11882,
10009,
12,
2867,
402,
11204,
12,
370,
1263,
4954,
12408,
282,
1331,
199,
1618,
642,
2032,
436,
4568,
3794,
1584,
334,
1589,
298,
10337,
1288,
370,
7962,
199,
262,
314,
2290,
1928,
10588,
12,
5893,
1928,
12305,
314,
4481,
199,
475,
675,
12,
1331,
12,
2811,
12,
5389,
12,
2780,
12,
11207,
12,
13473,
12,
436,
15,
269,
12743,
199,
16847,
402,
314,
2290,
12,
436,
370,
11291,
12103,
370,
12676,
314,
2290,
365,
199,
70,
13399,
370,
886,
880,
12,
5420,
370,
314,
2569,
3704,
26,
199,
199,
1918,
3432,
4248,
4245,
436,
642,
4983,
4245,
10989,
506,
5120,
315,
199,
452,
6866,
503,
13393,
12468,
402,
314,
2290,
14,
199,
199,
18061,
4141,
2281,
7049,
298,
1179,
2281,
401,
2428,
3408,
1634,
1821,
3826,
12,
7168,
1549,
199,
8947,
5177,
12,
6931,
5400,
2845,
5471,
2296,
2334,
2990,
1634,
3169,
12,
199,
38,
3061,
2381,
437,
3115,
3104,
2401,
13229,
14,
1621,
4825,
6461,
7000,
2334,
199,
5580,
4149,
1549,
5877,
8164,
6262,
7024,
2381,
1821,
13140,
12,
6736,
1549,
5010,
199,
2673,
2477,
12,
7061,
1621,
1261,
9612,
1634,
7066,
12,
7056,
1549,
7334,
12,
7043,
4442,
12,
199,
1877,
1634,
1549,
1621,
11287,
1663,
2334,
4141,
1549,
2334,
4815,
1549,
5010,
13198,
1621,
199,
18061,
4141,
14,
199,
624,
199,
504,
636,
2443,
363,
492,
543,
63,
6242,
199,
646,
747,
199,
646,
5145,
199,
646,
984,
199,
646,
13608,
199,
646,
10392,
421,
199,
533,
19521,
1912,
1726,
8,
1726,
304,
272,
408,
272,
3523,
1919,
1021,
367,
1006,
6359,
2552,
14,
272,
408,
421,
199,
533,
1910,
13221,
13042,
3484,
8,
13042,
1726,
304,
272,
408,
272,
4520,
4915,
1380,
3032,
570,
365,
440,
282,
18054,
6359,
1475,
14,
272,
408,
421,
199,
318,
5536,
8,
515,
12,
370,
63,
515,
9280,
272,
408,
272,
31017,
314,
5330,
503,
3482,
570,
737,
314,
2013,
931,
370,
314,
2082,
272,
2013,
701,
370,
63,
515,
14,
272,
408,
272,
19521,
1912,
8,
515,
680,
5005,
8,
475,
63,
515,
9,
421,
199,
533,
19521,
1912,
8,
785,
304,
272,
408,
272,
710,
5957,
3261,
1021,
626,
22667,
15409,
376,
6359,
4514,
14,
272,
408,
272,
347,
636,
826,
721,
277,
12,
570,
304,
267,
291,
423,
6404,
275,
291,
423,
6404,
63,
1886,
8,
493,
5130,
493,
9,
339,
768,
4639,
272,
347,
485,
6404,
63,
1886,
8,
493,
304,
267,
843,
275,
488,
267,
340,
1228,
8,
493,
12,
7116,
304,
288,
1788,
275,
570,
267,
587,
26,
288,
862,
26,
355,
1788,
275,
570,
14,
354,
288,
871,
4281,
26,
355,
746,
1910,
13221,
13042,
3484,
8,
490,
298,
1173,
909,
440,
282,
18054,
6359,
1475,
2685,
267,
1300,
12,
9483,
63,
832,
275,
747,
14,
515,
14,
7973,
8,
1501,
14,
2325,
1012,
267,
843,
275,
3329,
63,
1130,
14,
362,
8,
1521,
63,
832,
9,
267,
340,
440,
843,
26,
288,
1300,
12,
1599,
275,
747,
14,
515,
14,
7973,
8,
1095,
9,
288,
843,
275,
3329,
63,
1130,
14,
362,
8,
832,
9,
267,
340,
440,
843,
26,
288,
746,
1910,
13221,
13042,
3484,
8,
355,
298,
2042,
440,
282,
18054,
6359,
1475,
26,
450,
83,
2,
450,
1788,
9,
267,
372,
843,
339,
347,
5536,
8,
277,
12,
370,
63,
515,
9280,
267,
291,
423,
6404,
14,
5005,
8,
475,
63,
515,
9,
339,
347,
769,
8,
277,
304,
267,
291,
423,
6404,
14,
513,
342,
421,
199,
533,
3523,
13042,
8,
785,
304,
272,
408,
272,
3523,
19521,
1912,
1021,
14,
221,
22467,
1298,
1077,
8287,
642,
1021,
14,
272,
408,
272,
347,
3715,
63,
16812,
63,
694,
8,
277,
12,
931,
304,
267,
931,
275,
620,
8,
515,
9,
267,
931,
275,
931,
14,
10124,
2336,
1959,
10124,
11671,
358,
267,
340,
7324,
315,
931,
436,
334,
11671,
7,
315,
931,
436,
931,
14,
1623,
7825,
665,
931,
14,
1623,
11671,
1333,
1169,
503,
22548,
440,
315,
931,
304,
288,
372,
931,
14,
1294,
10998,
413,
9,
267,
916,
22548,
315,
931,
26,
288,
372,
931,
14,
1294,
20786,
413,
9,
267,
587,
26,
288,
372,
931,
12,
2125,
339,
347,
965,
63,
16812,
63,
694,
8,
277,
12,
3792,
304,
267,
408,
267,
1803,
2549,
340,
1006,
314,
3792,
1172,
314,
2011,
9186,
931,
536,
267,
334,
73,
14,
69,
2020,
8137,
365,
315,
1373,
25094,
315,
376,
6359,
9,
267,
408,
267,
2863,
63,
1861,
275,
488,
267,
367,
931,
315,
3792,
26,
288,
2403,
12,
4618,
275,
291,
14,
1294,
63,
16812,
63,
694,
8,
515,
9,
288,
340,
440,
2403,
26,
355,
372,
756,
288,
916,
2863,
63,
1861,
365,
488,
26,
355,
2863,
63,
1861,
275,
2403,
288,
916,
2403,
1137,
2863,
63,
1861,
26,
355,
372,
756,
267,
372,
715,
339,
347,
5536,
8,
277,
304,
267,
746,
4279,
339,
347,
769,
8,
277,
304,
267,
746,
4279,
421,
199,
533,
16017,
13042,
8,
1563,
13042,
304,
339,
347,
636,
826,
721,
277,
12,
570,
304,
267,
291,
423,
6404,
275,
13608,
14,
1490,
8,
493,
9,
339,
347,
769,
8,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
291,
423,
6404,
14,
513,
2031,
589,
12,
1011,
958,
9,
339,
347,
5536,
8,
277,
12,
370,
63,
515,
304,
267,
327,
5317,
26,
2366,
12932,
18,
14,
21,
1630,
343,
17021,
370,
5715,
3595,
21093,
2323,
12,
2457,
3062,
267,
7556,
275,
359,
1114,
367,
3653,
315,
291,
423,
6404,
14,
28719,
342,
673,
340,
3653,
14,
354,
1137,
283,
25355,
63,
2966,
63,
1291,
418,
267,
9186,
275,
291,
14,
1989,
63,
16812,
63,
694,
8,
6334,
9,
267,
367,
3653,
315,
7556,
26,
288,
536,
275,
3653,
14,
354,
288,
340,
9186,
26,
355,
536,
275,
291,
14,
1294,
63,
16812,
63,
694,
8,
354,
2788,
17,
61,
288,
1788
] |
[
199,
20409,
641,
298,
1548,
13,
6404,
2,
1553,
1455,
921,
17343,
14,
1548,
14,
1308,
15,
17343,
15,
1548,
13,
6404,
15,
199,
199,
7384,
334,
67,
9,
7129,
598,
695,
644,
382,
834,
1603,
82,
14,
665,
71,
695,
14,
87,
382,
834,
32,
6799,
14,
957,
30,
436,
406,
786,
878,
14,
199,
199,
7980,
365,
11882,
10009,
12,
2867,
402,
11204,
12,
370,
1263,
4954,
12408,
282,
1331,
199,
1618,
642,
2032,
436,
4568,
3794,
1584,
334,
1589,
298,
10337,
1288,
370,
7962,
199,
262,
314,
2290,
1928,
10588,
12,
5893,
1928,
12305,
314,
4481,
199,
475,
675,
12,
1331,
12,
2811,
12,
5389,
12,
2780,
12,
11207,
12,
13473,
12,
436,
15,
269,
12743,
199,
16847,
402,
314,
2290,
12,
436,
370,
11291,
12103,
370,
12676,
314,
2290,
365,
199,
70,
13399,
370,
886,
880,
12,
5420,
370,
314,
2569,
3704,
26,
199,
199,
1918,
3432,
4248,
4245,
436,
642,
4983,
4245,
10989,
506,
5120,
315,
199,
452,
6866,
503,
13393,
12468,
402,
314,
2290,
14,
199,
199,
18061,
4141,
2281,
7049,
298,
1179,
2281,
401,
2428,
3408,
1634,
1821,
3826,
12,
7168,
1549,
199,
8947,
5177,
12,
6931,
5400,
2845,
5471,
2296,
2334,
2990,
1634,
3169,
12,
199,
38,
3061,
2381,
437,
3115,
3104,
2401,
13229,
14,
1621,
4825,
6461,
7000,
2334,
199,
5580,
4149,
1549,
5877,
8164,
6262,
7024,
2381,
1821,
13140,
12,
6736,
1549,
5010,
199,
2673,
2477,
12,
7061,
1621,
1261,
9612,
1634,
7066,
12,
7056,
1549,
7334,
12,
7043,
4442,
12,
199,
1877,
1634,
1549,
1621,
11287,
1663,
2334,
4141,
1549,
2334,
4815,
1549,
5010,
13198,
1621,
199,
18061,
4141,
14,
199,
624,
199,
504,
636,
2443,
363,
492,
543,
63,
6242,
199,
646,
747,
199,
646,
5145,
199,
646,
984,
199,
646,
13608,
199,
646,
10392,
421,
199,
533,
19521,
1912,
1726,
8,
1726,
304,
272,
408,
272,
3523,
1919,
1021,
367,
1006,
6359,
2552,
14,
272,
408,
421,
199,
533,
1910,
13221,
13042,
3484,
8,
13042,
1726,
304,
272,
408,
272,
4520,
4915,
1380,
3032,
570,
365,
440,
282,
18054,
6359,
1475,
14,
272,
408,
421,
199,
318,
5536,
8,
515,
12,
370,
63,
515,
9280,
272,
408,
272,
31017,
314,
5330,
503,
3482,
570,
737,
314,
2013,
931,
370,
314,
2082,
272,
2013,
701,
370,
63,
515,
14,
272,
408,
272,
19521,
1912,
8,
515,
680,
5005,
8,
475,
63,
515,
9,
421,
199,
533,
19521,
1912,
8,
785,
304,
272,
408,
272,
710,
5957,
3261,
1021,
626,
22667,
15409,
376,
6359,
4514,
14,
272,
408,
272,
347,
636,
826,
721,
277,
12,
570,
304,
267,
291,
423,
6404,
275,
291,
423,
6404,
63,
1886,
8,
493,
5130,
493,
9,
339,
768,
4639,
272,
347,
485,
6404,
63,
1886,
8,
493,
304,
267,
843,
275,
488,
267,
340,
1228,
8,
493,
12,
7116,
304,
288,
1788,
275,
570,
267,
587,
26,
288,
862,
26,
355,
1788,
275,
570,
14,
354,
288,
871,
4281,
26,
355,
746,
1910,
13221,
13042,
3484,
8,
490,
298,
1173,
909,
440,
282,
18054,
6359,
1475,
2685,
267,
1300,
12,
9483,
63,
832,
275,
747,
14,
515,
14,
7973,
8,
1501,
14,
2325,
1012,
267,
843,
275,
3329,
63,
1130,
14,
362,
8,
1521,
63,
832,
9,
267,
340,
440,
843,
26,
288,
1300,
12,
1599,
275,
747,
14,
515,
14,
7973,
8,
1095,
9,
288,
843,
275,
3329,
63,
1130,
14,
362,
8,
832,
9,
267,
340,
440,
843,
26,
288,
746,
1910,
13221,
13042,
3484,
8,
355,
298,
2042,
440,
282,
18054,
6359,
1475,
26,
450,
83,
2,
450,
1788,
9,
267,
372,
843,
339,
347,
5536,
8,
277,
12,
370,
63,
515,
9280,
267,
291,
423,
6404,
14,
5005,
8,
475,
63,
515,
9,
339,
347,
769,
8,
277,
304,
267,
291,
423,
6404,
14,
513,
342,
421,
199,
533,
3523,
13042,
8,
785,
304,
272,
408,
272,
3523,
19521,
1912,
1021,
14,
221,
22467,
1298,
1077,
8287,
642,
1021,
14,
272,
408,
272,
347,
3715,
63,
16812,
63,
694,
8,
277,
12,
931,
304,
267,
931,
275,
620,
8,
515,
9,
267,
931,
275,
931,
14,
10124,
2336,
1959,
10124,
11671,
358,
267,
340,
7324,
315,
931,
436,
334,
11671,
7,
315,
931,
436,
931,
14,
1623,
7825,
665,
931,
14,
1623,
11671,
1333,
1169,
503,
22548,
440,
315,
931,
304,
288,
372,
931,
14,
1294,
10998,
413,
9,
267,
916,
22548,
315,
931,
26,
288,
372,
931,
14,
1294,
20786,
413,
9,
267,
587,
26,
288,
372,
931,
12,
2125,
339,
347,
965,
63,
16812,
63,
694,
8,
277,
12,
3792,
304,
267,
408,
267,
1803,
2549,
340,
1006,
314,
3792,
1172,
314,
2011,
9186,
931,
536,
267,
334,
73,
14,
69,
2020,
8137,
365,
315,
1373,
25094,
315,
376,
6359,
9,
267,
408,
267,
2863,
63,
1861,
275,
488,
267,
367,
931,
315,
3792,
26,
288,
2403,
12,
4618,
275,
291,
14,
1294,
63,
16812,
63,
694,
8,
515,
9,
288,
340,
440,
2403,
26,
355,
372,
756,
288,
916,
2863,
63,
1861,
365,
488,
26,
355,
2863,
63,
1861,
275,
2403,
288,
916,
2403,
1137,
2863,
63,
1861,
26,
355,
372,
756,
267,
372,
715,
339,
347,
5536,
8,
277,
304,
267,
746,
4279,
339,
347,
769,
8,
277,
304,
267,
746,
4279,
421,
199,
533,
16017,
13042,
8,
1563,
13042,
304,
339,
347,
636,
826,
721,
277,
12,
570,
304,
267,
291,
423,
6404,
275,
13608,
14,
1490,
8,
493,
9,
339,
347,
769,
8,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
291,
423,
6404,
14,
513,
2031,
589,
12,
1011,
958,
9,
339,
347,
5536,
8,
277,
12,
370,
63,
515,
304,
267,
327,
5317,
26,
2366,
12932,
18,
14,
21,
1630,
343,
17021,
370,
5715,
3595,
21093,
2323,
12,
2457,
3062,
267,
7556,
275,
359,
1114,
367,
3653,
315,
291,
423,
6404,
14,
28719,
342,
673,
340,
3653,
14,
354,
1137,
283,
25355,
63,
2966,
63,
1291,
418,
267,
9186,
275,
291,
14,
1989,
63,
16812,
63,
694,
8,
6334,
9,
267,
367,
3653,
315,
7556,
26,
288,
536,
275,
3653,
14,
354,
288,
340,
9186,
26,
355,
536,
275,
291,
14,
1294,
63,
16812,
63,
694,
8,
354,
2788,
17,
61,
288,
1788,
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,
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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
] |
ehigh2014/rt-thread
|
bsp/lpc43xx/M0/rtconfig.py
|
27
|
3667
|
import os
# core to be use
USE_CORE = 'CORE_M0'
# toolchains options
ARCH='arm'
CPU = 'cortex-m0'
CROSS_TOOL='keil'
# get setting from environment.
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'C:/Program Files/CodeSourcery/arm-none-eabi/bin'
elif CROSS_TOOL == 'keil':
PLATFORM = 'armcc'
EXEC_PATH = r'D:/Keil'
elif CROSS_TOOL == 'iar':
PLATFORM = 'iar'
IAR_PATH = r'C:/Program Files/IAR Systems/Embedded Workbench 6.0'
if os.getenv('RTT_EXEC_PATH'):
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
#
BUILD = 'debug'
if PLATFORM == 'gcc':
# toolchains
PREFIX = 'arm-none-eabi-'
CC = PREFIX + 'gcc'
AS = PREFIX + 'gcc'
AR = PREFIX + 'ar'
LINK = PREFIX + 'gcc'
TARGET_EXT = 'elf'
SIZE = PREFIX + 'size'
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mthumb -mcpu=cortex-m0 -ffunction-sections -fdata-sections -Wall'
CFLAGS = DEVICE
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread-lpc43xx.map,-cref,-u,Reset_Handler -T rtthread-lpc43xx.ld'
CPATH = ''
LPATH = ''
CFLAGS += ' -gdwarf-2'
AFLAGS += ' -gdwarf-2'
if BUILD == 'debug':
CFLAGS += ' -O0'
else:
CFLAGS += ' -O2'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' +\
SIZE + ' $TARGET \n' +\
'../bin2C.py rtthread.bin ../M4/applications/M0_CODE.h'
elif PLATFORM == 'armcc':
# toolchains
CC = 'armcc'
AS = 'armasm'
AR = 'armar'
LINK = 'armlink'
TARGET_EXT = 'axf'
DEVICE = ' --device DARMSTM'
CFLAGS = DEVICE + ' --apcs=interwork'
AFLAGS = DEVICE
LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers --list rtthread-lpc43xx.map --scatter rtthread-lpc43xx_spifi.sct'
CFLAGS += ' -I' + EXEC_PATH + '/ARM/RV31/INC'
LFLAGS += ' --libpath ' + EXEC_PATH + '/ARM/RV31/LIB'
EXEC_PATH += '/arm/bin40/'
if BUILD == 'debug':
CFLAGS += ' -g -O0'
AFLAGS += ' -g'
else:
CFLAGS += ' -O2'
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
elif PLATFORM == 'iar':
# toolchains
CC = 'iccarm'
AS = 'iasmarm'
AR = 'iarchive'
LINK = 'ilinkarm'
TARGET_EXT = 'out'
CFLAGS = ' --diag_suppress Pa050'
CFLAGS += ' --no_cse'
CFLAGS += ' --no_unroll'
CFLAGS += ' --no_inline'
CFLAGS += ' --no_code_motion'
CFLAGS += ' --no_tbaa'
CFLAGS += ' --no_clustering'
CFLAGS += ' --no_scheduling'
CFLAGS += ' --debug'
CFLAGS += ' --endian=little'
if USE_CORE == 'CORE_M4':
CFLAGS += ' --cpu=Cortex-M4'
CFLAGS += ' --fpu=None'
else:
CFLAGS += ' --cpu=Cortex-M0'
CFLAGS += ' -e'
CFLAGS += ' --dlib_config "' + IAR_PATH + '/arm/INC/c/DLib_Config_Normal.h"'
CFLAGS += ' -Ol'
CFLAGS += ' --use_c++_inline'
AFLAGS = ''
AFLAGS += ' -s+'
AFLAGS += ' -w+'
AFLAGS += ' -r'
if USE_CORE == 'CORE_M4':
AFLAGS += ' --cpu Cortex-M4'
AFLAGS += ' --fpu None'
else:
AFLAGS += ' --cpu Cortex-M0'
LFLAGS = ' --config lpc43xx_flash.icf'
LFLAGS += ' --redirect _Printf=_PrintfTiny'
LFLAGS += ' --redirect _Scanf=_ScanfSmall'
LFLAGS += ' --entry __iar_program_start'
EXEC_PATH = IAR_PATH + '/arm/bin/'
POST_ACTION = ''
|
gpl-2.0
|
[
646,
747,
199,
199,
3,
6170,
370,
506,
675,
199,
4701,
63,
24428,
275,
283,
24428,
63,
45,
16,
7,
199,
199,
3,
4744,
17419,
1511,
199,
7762,
534,
5362,
7,
199,
199,
11011,
275,
283,
989,
3858,
13,
77,
16,
7,
199,
199,
28368,
63,
9731,
534,
415,
382,
7,
421,
199,
3,
664,
4260,
687,
3734,
14,
199,
692,
747,
14,
12959,
360,
50,
1481,
63,
2571,
735,
267,
445,
23264,
63,
9731,
275,
747,
14,
12959,
360,
50,
1481,
63,
2571,
358,
199,
199,
3,
8059,
63,
3557,
6571,
314,
8059,
6365,
199,
3,
3651,
4220,
63,
3243,
365,
314,
6365,
5341,
931,
12,
367,
2893,
12,
5495,
51,
567,
67,
994,
12,
25645,
382,
603,
10892,
12,
473,
689,
199,
692,
221,
445,
23264,
63,
9731,
508,
283,
13112,
356,
272,
21966,
275,
283,
13112,
7,
272,
3651,
4220,
63,
3243,
275,
519,
7,
35,
11254,
9184,
16920,
15,
3034,
51,
567,
67,
994,
15,
5362,
13,
3592,
13,
69,
14677,
15,
1393,
7,
199,
4164,
445,
23264,
63,
9731,
508,
283,
415,
382,
356,
272,
21966,
275,
283,
5362,
2055,
7,
272,
3651,
4220,
63,
3243,
275,
519,
7,
36,
11254,
1136,
382,
7,
199,
4164,
445,
23264,
63,
9731,
508,
283,
73,
285,
356,
272,
21966,
275,
283,
73,
285,
7,
272,
473,
689,
63,
3243,
275,
519,
7,
35,
11254,
9184,
16920,
15,
41,
689,
15285,
15,
27395,
9361,
16571,
1227,
14,
16,
7,
199,
199,
692,
747,
14,
12959,
360,
50,
1481,
63,
10276,
63,
3243,
735,
267,
3651,
4220,
63,
3243,
275,
747,
14,
12959,
360,
50,
1481,
63,
10276,
63,
3243,
358,
199,
199,
3,
199,
8248,
275,
283,
1757,
7,
199,
199,
692,
21966,
508,
283,
13112,
356,
272,
327,
4744,
17419,
272,
27884,
275,
283,
5362,
13,
3592,
13,
69,
14677,
15668,
272,
17586,
275,
27884,
435,
283,
13112,
7,
272,
4319,
275,
27884,
435,
283,
13112,
7,
272,
4160,
275,
27884,
435,
283,
285,
7,
272,
19774,
275,
27884,
435,
283,
13112,
7,
272,
26134,
63,
2472,
275,
283,
25371,
7,
272,
32289,
275,
27884,
435,
283,
890,
7,
272,
593,
16262,
26406,
275,
27884,
435,
283,
1113,
2724,
7,
272,
593,
16262,
2890,
57,
275,
27884,
435,
283,
1113,
1574,
7,
272,
11643,
275,
283,
446,
77,
16534,
446,
77,
3541,
29,
989,
3858,
13,
77,
16,
446,
556,
648,
13,
7786,
446,
70,
576,
13,
7786,
446,
18018,
7,
272,
25149,
275,
11643,
272,
437,
4831,
275,
283,
446,
67,
7,
435,
11643,
435,
283,
446,
88,
22931,
82,
13,
1045,
13,
5910,
446,
24804,
3057,
2664,
311,
3137,
13,
390,
29,
16534,
283,
272,
491,
4831,
275,
11643,
435,
283,
446,
16239,
28925,
9493,
13,
7786,
3057,
2956,
29,
2591,
2671,
13,
76,
2352,
2824,
2154,
14,
1130,
3057,
67,
1121,
3057,
85,
12,
9637,
63,
2461,
446,
52,
14059,
2671,
13,
76,
2352,
2824,
2154,
14,
1447,
7,
339,
445,
3243,
275,
2125,
272,
491,
3243,
275,
2125,
339,
25149,
847,
283,
446,
7136,
3281,
70,
13,
18,
7,
272,
437,
4831,
847,
283,
446,
7136,
3281,
70,
13,
18,
7,
272,
340,
22974,
508,
283,
1757,
356,
267,
25149,
847,
283,
446,
47,
16,
7,
272,
587,
26,
267,
25149,
847,
283,
446,
47,
18,
7,
339,
8761,
63,
10052,
275,
593,
16262,
2890,
57,
435,
283,
446,
47,
3366,
2672,
9268,
14059,
2671,
14,
1393,
60,
78,
7,
17992,
2116,
32289,
435,
283,
2672,
9268,
971,
78,
7,
17992,
2116,
20644,
1393,
18,
35,
14,
647,
14059,
2671,
14,
1393,
24272,
45,
20,
15,
15853,
15,
45,
16,
63,
6012,
14,
72,
7,
199,
199,
4164,
21966,
508,
283,
5362,
2055,
356,
272,
327,
4744,
17419,
272,
17586,
275,
283,
5362,
2055,
7,
272,
4319,
275,
283,
5362,
11374,
7,
272,
4160,
275,
283,
285,
4584,
7,
272,
19774,
275,
283,
5362,
1073,
7,
272,
26134,
63,
2472,
275,
283,
1219,
70,
7,
339,
11643,
275,
283,
1553,
1782,
577,
12482,
16644,
7,
272,
25149,
275,
11643,
435,
283,
1553,
439,
1259,
29,
1058,
800,
7,
272,
437,
4831,
275,
11643,
272,
491,
4831,
275,
11643,
435,
283,
1553,
815,
10627,
1553,
815,
23576,
1553,
815,
9563,
1553,
815,
373,
6349,
1192,
1553,
513,
14059,
2671,
13,
76,
2352,
2824,
2154,
14,
1130,
1553,
13512,
14059,
2671,
13,
76,
2352,
2824,
2154,
63,
681,
1903,
14,
83,
319,
7,
339,
25149,
847,
283,
446,
41,
7,
435,
3651,
4220,
63,
3243,
435,
1994,
12482,
15,
28841,
2192,
15,
25205,
7,
272,
491,
4831,
847,
283,
1553,
773,
515,
283,
435,
3651,
4220,
63,
3243,
435,
1994,
12482,
15,
28841,
2192,
15,
5617,
7,
339,
3651,
4220,
63,
3243,
847,
1994,
5362,
15,
1393,
2167,
4805,
339,
340,
22974,
508,
283,
1757,
356,
267,
25149,
847,
283,
446,
71,
446,
47,
16,
7,
267,
437,
4831,
847,
283,
446,
71,
7,
272,
587,
26,
267,
25149,
847,
283,
446,
47,
18,
7,
339,
8761,
63,
10052,
275,
283,
70,
5864,
276,
1553,
1393,
2672,
9268,
1553,
1199,
14059,
2671,
14,
1393,
971,
9914,
5864,
276,
446,
90,
2672,
9268,
7,
199,
199,
4164,
21966,
508,
283,
73,
285,
356,
272,
327,
4744,
17419,
272,
17586,
275,
283,
530,
67,
5362,
7,
272,
4319,
275,
283,
2241,
4584,
77,
7,
272,
4160,
275,
283,
73,
6404,
7,
272,
19774,
275,
283,
382,
2292,
5362,
7,
272,
26134,
63,
2472,
275,
283,
548,
7,
339,
25149,
275,
283,
1553,
6706,
63,
17381,
10164,
24742,
7,
272,
25149,
847,
283,
1553,
889,
63,
67,
261,
7,
5591,
25149,
847,
283,
1553,
889,
63,
324,
2827,
7,
5591,
25149,
847,
283,
1553,
889,
63,
6460,
7,
5591,
25149,
847,
283,
1553,
889,
63,
600,
63,
15335,
7,
5591,
25149,
847,
283,
1553,
889,
63,
5842,
2158,
7,
5591,
25149,
847,
283,
1553,
889,
63,
25802,
7,
5591,
25149,
847,
283,
1553,
889,
63,
10487,
15633,
7,
5591,
25149,
847,
283,
1553,
1757,
7,
5591,
25149,
847,
283,
1553,
15009,
29,
10182,
7,
5591,
340,
4815,
63,
24428,
508,
283,
24428,
63,
45,
20,
356,
267,
25149,
847,
283,
1553,
3541,
29,
8380,
3858,
13,
45,
20,
7,
4960,
25149,
847
] |
[
747,
199,
199,
3,
6170,
370,
506,
675,
199,
4701,
63,
24428,
275,
283,
24428,
63,
45,
16,
7,
199,
199,
3,
4744,
17419,
1511,
199,
7762,
534,
5362,
7,
199,
199,
11011,
275,
283,
989,
3858,
13,
77,
16,
7,
199,
199,
28368,
63,
9731,
534,
415,
382,
7,
421,
199,
3,
664,
4260,
687,
3734,
14,
199,
692,
747,
14,
12959,
360,
50,
1481,
63,
2571,
735,
267,
445,
23264,
63,
9731,
275,
747,
14,
12959,
360,
50,
1481,
63,
2571,
358,
199,
199,
3,
8059,
63,
3557,
6571,
314,
8059,
6365,
199,
3,
3651,
4220,
63,
3243,
365,
314,
6365,
5341,
931,
12,
367,
2893,
12,
5495,
51,
567,
67,
994,
12,
25645,
382,
603,
10892,
12,
473,
689,
199,
692,
221,
445,
23264,
63,
9731,
508,
283,
13112,
356,
272,
21966,
275,
283,
13112,
7,
272,
3651,
4220,
63,
3243,
275,
519,
7,
35,
11254,
9184,
16920,
15,
3034,
51,
567,
67,
994,
15,
5362,
13,
3592,
13,
69,
14677,
15,
1393,
7,
199,
4164,
445,
23264,
63,
9731,
508,
283,
415,
382,
356,
272,
21966,
275,
283,
5362,
2055,
7,
272,
3651,
4220,
63,
3243,
275,
519,
7,
36,
11254,
1136,
382,
7,
199,
4164,
445,
23264,
63,
9731,
508,
283,
73,
285,
356,
272,
21966,
275,
283,
73,
285,
7,
272,
473,
689,
63,
3243,
275,
519,
7,
35,
11254,
9184,
16920,
15,
41,
689,
15285,
15,
27395,
9361,
16571,
1227,
14,
16,
7,
199,
199,
692,
747,
14,
12959,
360,
50,
1481,
63,
10276,
63,
3243,
735,
267,
3651,
4220,
63,
3243,
275,
747,
14,
12959,
360,
50,
1481,
63,
10276,
63,
3243,
358,
199,
199,
3,
199,
8248,
275,
283,
1757,
7,
199,
199,
692,
21966,
508,
283,
13112,
356,
272,
327,
4744,
17419,
272,
27884,
275,
283,
5362,
13,
3592,
13,
69,
14677,
15668,
272,
17586,
275,
27884,
435,
283,
13112,
7,
272,
4319,
275,
27884,
435,
283,
13112,
7,
272,
4160,
275,
27884,
435,
283,
285,
7,
272,
19774,
275,
27884,
435,
283,
13112,
7,
272,
26134,
63,
2472,
275,
283,
25371,
7,
272,
32289,
275,
27884,
435,
283,
890,
7,
272,
593,
16262,
26406,
275,
27884,
435,
283,
1113,
2724,
7,
272,
593,
16262,
2890,
57,
275,
27884,
435,
283,
1113,
1574,
7,
272,
11643,
275,
283,
446,
77,
16534,
446,
77,
3541,
29,
989,
3858,
13,
77,
16,
446,
556,
648,
13,
7786,
446,
70,
576,
13,
7786,
446,
18018,
7,
272,
25149,
275,
11643,
272,
437,
4831,
275,
283,
446,
67,
7,
435,
11643,
435,
283,
446,
88,
22931,
82,
13,
1045,
13,
5910,
446,
24804,
3057,
2664,
311,
3137,
13,
390,
29,
16534,
283,
272,
491,
4831,
275,
11643,
435,
283,
446,
16239,
28925,
9493,
13,
7786,
3057,
2956,
29,
2591,
2671,
13,
76,
2352,
2824,
2154,
14,
1130,
3057,
67,
1121,
3057,
85,
12,
9637,
63,
2461,
446,
52,
14059,
2671,
13,
76,
2352,
2824,
2154,
14,
1447,
7,
339,
445,
3243,
275,
2125,
272,
491,
3243,
275,
2125,
339,
25149,
847,
283,
446,
7136,
3281,
70,
13,
18,
7,
272,
437,
4831,
847,
283,
446,
7136,
3281,
70,
13,
18,
7,
272,
340,
22974,
508,
283,
1757,
356,
267,
25149,
847,
283,
446,
47,
16,
7,
272,
587,
26,
267,
25149,
847,
283,
446,
47,
18,
7,
339,
8761,
63,
10052,
275,
593,
16262,
2890,
57,
435,
283,
446,
47,
3366,
2672,
9268,
14059,
2671,
14,
1393,
60,
78,
7,
17992,
2116,
32289,
435,
283,
2672,
9268,
971,
78,
7,
17992,
2116,
20644,
1393,
18,
35,
14,
647,
14059,
2671,
14,
1393,
24272,
45,
20,
15,
15853,
15,
45,
16,
63,
6012,
14,
72,
7,
199,
199,
4164,
21966,
508,
283,
5362,
2055,
356,
272,
327,
4744,
17419,
272,
17586,
275,
283,
5362,
2055,
7,
272,
4319,
275,
283,
5362,
11374,
7,
272,
4160,
275,
283,
285,
4584,
7,
272,
19774,
275,
283,
5362,
1073,
7,
272,
26134,
63,
2472,
275,
283,
1219,
70,
7,
339,
11643,
275,
283,
1553,
1782,
577,
12482,
16644,
7,
272,
25149,
275,
11643,
435,
283,
1553,
439,
1259,
29,
1058,
800,
7,
272,
437,
4831,
275,
11643,
272,
491,
4831,
275,
11643,
435,
283,
1553,
815,
10627,
1553,
815,
23576,
1553,
815,
9563,
1553,
815,
373,
6349,
1192,
1553,
513,
14059,
2671,
13,
76,
2352,
2824,
2154,
14,
1130,
1553,
13512,
14059,
2671,
13,
76,
2352,
2824,
2154,
63,
681,
1903,
14,
83,
319,
7,
339,
25149,
847,
283,
446,
41,
7,
435,
3651,
4220,
63,
3243,
435,
1994,
12482,
15,
28841,
2192,
15,
25205,
7,
272,
491,
4831,
847,
283,
1553,
773,
515,
283,
435,
3651,
4220,
63,
3243,
435,
1994,
12482,
15,
28841,
2192,
15,
5617,
7,
339,
3651,
4220,
63,
3243,
847,
1994,
5362,
15,
1393,
2167,
4805,
339,
340,
22974,
508,
283,
1757,
356,
267,
25149,
847,
283,
446,
71,
446,
47,
16,
7,
267,
437,
4831,
847,
283,
446,
71,
7,
272,
587,
26,
267,
25149,
847,
283,
446,
47,
18,
7,
339,
8761,
63,
10052,
275,
283,
70,
5864,
276,
1553,
1393,
2672,
9268,
1553,
1199,
14059,
2671,
14,
1393,
971,
9914,
5864,
276,
446,
90,
2672,
9268,
7,
199,
199,
4164,
21966,
508,
283,
73,
285,
356,
272,
327,
4744,
17419,
272,
17586,
275,
283,
530,
67,
5362,
7,
272,
4319,
275,
283,
2241,
4584,
77,
7,
272,
4160,
275,
283,
73,
6404,
7,
272,
19774,
275,
283,
382,
2292,
5362,
7,
272,
26134,
63,
2472,
275,
283,
548,
7,
339,
25149,
275,
283,
1553,
6706,
63,
17381,
10164,
24742,
7,
272,
25149,
847,
283,
1553,
889,
63,
67,
261,
7,
5591,
25149,
847,
283,
1553,
889,
63,
324,
2827,
7,
5591,
25149,
847,
283,
1553,
889,
63,
6460,
7,
5591,
25149,
847,
283,
1553,
889,
63,
600,
63,
15335,
7,
5591,
25149,
847,
283,
1553,
889,
63,
5842,
2158,
7,
5591,
25149,
847,
283,
1553,
889,
63,
25802,
7,
5591,
25149,
847,
283,
1553,
889,
63,
10487,
15633,
7,
5591,
25149,
847,
283,
1553,
1757,
7,
5591,
25149,
847,
283,
1553,
15009,
29,
10182,
7,
5591,
340,
4815,
63,
24428,
508,
283,
24428,
63,
45,
20,
356,
267,
25149,
847,
283,
1553,
3541,
29,
8380,
3858,
13,
45,
20,
7,
4960,
25149,
847,
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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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
ofayans/freeipa
|
ipaclient/plugins/migration.py
|
3
|
3020
|
# Authors:
# Pavel Zuna <pzuna@redhat.com>
#
# Copyright (C) 2009 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import six
from ipaclient.frontend import CommandOverride
from ipalib.parameters import File
from ipalib.plugable import Registry
from ipalib import _
if six.PY3:
unicode = str
register = Registry()
@register(override=True, no_fail=True)
class migrate_ds(CommandOverride):
migrate_order = ('user', 'group')
migration_disabled_msg = _('''\
Migration mode is disabled.
Use \'ipa config-mod --enable-migration=TRUE\' to enable it.''')
pwd_migration_msg = _('''\
Passwords have been migrated in pre-hashed format.
IPA is unable to generate Kerberos keys unless provided
with clear text passwords. All migrated users need to
login at https://your.domain/ipa/migration/ before they
can use their Kerberos accounts.''')
def get_options(self):
for option in super(migrate_ds, self).get_options():
if option.name == 'cacertfile':
option = option.clone_retype(option.name, File)
yield option
def output_for_cli(self, textui, result, ldapuri, **options):
textui.print_name(self.name)
if not result['enabled']:
textui.print_plain(self.migration_disabled_msg)
return 1
if not result['compat']:
textui.print_plain("The compat plug-in is enabled. This can increase the memory requirements during migration. Disable the compat plug-in with \'ipa-compat-manage disable\' or re-run this script with \'--with-compat\' option.")
return 1
any_migrated = any(result['result'].values())
textui.print_plain('Migrated:')
textui.print_entry1(
result['result'], attr_order=self.migrate_order,
one_value_per_line=False
)
for ldap_obj_name in self.migrate_order:
textui.print_plain('Failed %s:' % ldap_obj_name)
textui.print_entry1(
result['failed'][ldap_obj_name], attr_order=self.migrate_order,
one_value_per_line=True,
)
textui.print_plain('-' * len(self.name))
if not any_migrated:
textui.print_plain('No users/groups were migrated from %s' %
ldapuri)
return 1
textui.print_plain(unicode(self.pwd_migration_msg))
|
gpl-3.0
|
[
3,
6642,
26,
199,
3,
257,
10164,
1090,
3107,
31627,
665,
80,
90,
31627,
32,
17164,
14,
957,
30,
199,
3,
199,
3,
1898,
334,
35,
9,
8937,
221,
9572,
13002,
199,
3,
1937,
570,
283,
16188,
1206,
7,
367,
675,
436,
3750,
2556,
199,
3,
199,
3,
961,
2240,
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,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
199,
3,
334,
292,
2195,
945,
9,
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,
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,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
199,
646,
3816,
199,
199,
504,
18210,
1258,
14,
18062,
492,
5817,
11954,
199,
504,
3384,
25530,
14,
3214,
492,
3814,
199,
504,
3384,
25530,
14,
13963,
461,
492,
20738,
199,
504,
3384,
25530,
492,
485,
199,
199,
692,
3816,
14,
4521,
19,
26,
272,
2649,
275,
620,
199,
199,
2683,
275,
20738,
342,
421,
199,
32,
2683,
8,
4415,
29,
549,
12,
949,
63,
1633,
29,
549,
9,
199,
533,
12810,
63,
795,
8,
3110,
11954,
304,
272,
12810,
63,
1648,
275,
661,
751,
297,
283,
923,
358,
339,
8367,
63,
7011,
63,
1328,
275,
4018,
891,
60,
199,
9816,
818,
365,
6980,
14,
199,
6119,
8891,
20014,
1101,
13,
1494,
1553,
4296,
13,
8998,
29,
15064,
3985,
370,
4756,
652,
14,
12310,
339,
14374,
63,
8998,
63,
1328,
275,
4018,
891,
60,
199,
4986,
3148,
1172,
2757,
28322,
315,
876,
13,
26368,
1475,
14,
199,
1772,
33,
365,
17329,
370,
3550,
1804,
281,
23920,
2883,
7444,
2741,
199,
1045,
5436,
1318,
19572,
14,
2900,
28322,
4390,
1929,
370,
199,
2886,
737,
4178,
921,
12695,
14,
2261,
15,
20014,
15,
8998,
15,
2544,
2985,
199,
2425,
675,
3932,
1804,
281,
23920,
12639,
14,
12310,
339,
347,
664,
63,
1419,
8,
277,
304,
267,
367,
945,
315,
1613,
8,
8462,
63,
795,
12,
291,
680,
362,
63,
1419,
837,
288,
340,
945,
14,
354,
508,
283,
11055,
15299,
493,
356,
355,
945,
275,
945,
14,
6311,
63,
264,
466,
8,
1422,
14,
354,
12,
3814,
9,
288,
1995,
945,
339,
347,
1072,
63,
509,
63,
2764,
8,
277,
12,
1318,
1907,
12,
754,
12,
13727,
2302,
12,
1011,
1419,
304,
267,
1318,
1907,
14,
1361,
63,
354,
8,
277,
14,
354,
9,
267,
340,
440,
754,
459,
3827,
2565,
288,
1318,
1907,
14,
1361,
63,
6104,
8,
277,
14,
8998,
63,
7011,
63,
1328,
9,
288,
372,
413,
267,
340,
440,
754,
459,
5819,
2565,
288,
1318,
1907,
14,
1361,
63,
6104,
480,
1918,
8434,
14202,
13,
262,
365,
5223,
14,
961,
883,
19781,
314,
4402,
9760,
5309,
8367,
14,
17534,
314,
8434,
14202,
13,
262,
543,
8891,
20014,
13,
5819,
13,
9053,
3507,
3985,
503,
295,
13,
1065,
642,
2884,
543,
8891,
306,
1045,
13,
5819,
3985,
945,
2685,
288,
372,
413,
267,
1263,
63,
31544,
275,
1263,
8,
1099,
459,
1099,
2278,
1459,
1012,
267,
1318,
1907,
14,
1361,
63,
6104,
360,
19322,
12601,
10993,
267,
1318,
1907,
14,
1361,
63,
2373,
17,
8,
288,
754,
459,
1099,
995,
1921,
63,
1648,
29,
277,
14,
8462,
63,
1648,
12,
288,
1373,
63,
585,
63,
529,
63,
604,
29,
797,
267,
776,
267,
367,
13727,
63,
1113,
63,
354,
315,
291,
14,
8462,
63,
1648,
26,
288,
1318,
1907,
14,
1361,
63,
6104,
360,
4276,
450,
83,
4881,
450,
13727,
63,
1113,
63,
354,
9,
288,
1318,
1907,
14,
1361,
63,
2373,
17,
8,
355,
754,
459,
4892,
3488,
9642,
63,
1113,
63,
354,
467,
1921,
63,
1648,
29,
277,
14,
8462,
63,
1648,
12,
355,
1373,
63,
585,
63,
529,
63,
604,
29,
549,
12,
288,
776,
267,
1318,
1907,
14,
1361,
63,
6104,
3654,
7,
627,
822,
8,
277,
14,
354,
430,
267,
340,
440,
1263,
63,
31544,
26,
288,
1318,
1907,
14,
1361,
63,
6104,
360,
1944,
4390,
15,
2634,
4898,
28322,
687,
450,
83,
7,
450,
3044,
13727,
2302,
9,
288,
372,
413,
267,
1318,
1907,
14,
1361,
63,
6104,
8,
2975,
8,
277,
14,
14258,
63,
8998,
63,
1328,
430,
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
] |
[
6642,
26,
199,
3,
257,
10164,
1090,
3107,
31627,
665,
80,
90,
31627,
32,
17164,
14,
957,
30,
199,
3,
199,
3,
1898,
334,
35,
9,
8937,
221,
9572,
13002,
199,
3,
1937,
570,
283,
16188,
1206,
7,
367,
675,
436,
3750,
2556,
199,
3,
199,
3,
961,
2240,
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,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
199,
3,
334,
292,
2195,
945,
9,
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,
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,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
199,
646,
3816,
199,
199,
504,
18210,
1258,
14,
18062,
492,
5817,
11954,
199,
504,
3384,
25530,
14,
3214,
492,
3814,
199,
504,
3384,
25530,
14,
13963,
461,
492,
20738,
199,
504,
3384,
25530,
492,
485,
199,
199,
692,
3816,
14,
4521,
19,
26,
272,
2649,
275,
620,
199,
199,
2683,
275,
20738,
342,
421,
199,
32,
2683,
8,
4415,
29,
549,
12,
949,
63,
1633,
29,
549,
9,
199,
533,
12810,
63,
795,
8,
3110,
11954,
304,
272,
12810,
63,
1648,
275,
661,
751,
297,
283,
923,
358,
339,
8367,
63,
7011,
63,
1328,
275,
4018,
891,
60,
199,
9816,
818,
365,
6980,
14,
199,
6119,
8891,
20014,
1101,
13,
1494,
1553,
4296,
13,
8998,
29,
15064,
3985,
370,
4756,
652,
14,
12310,
339,
14374,
63,
8998,
63,
1328,
275,
4018,
891,
60,
199,
4986,
3148,
1172,
2757,
28322,
315,
876,
13,
26368,
1475,
14,
199,
1772,
33,
365,
17329,
370,
3550,
1804,
281,
23920,
2883,
7444,
2741,
199,
1045,
5436,
1318,
19572,
14,
2900,
28322,
4390,
1929,
370,
199,
2886,
737,
4178,
921,
12695,
14,
2261,
15,
20014,
15,
8998,
15,
2544,
2985,
199,
2425,
675,
3932,
1804,
281,
23920,
12639,
14,
12310,
339,
347,
664,
63,
1419,
8,
277,
304,
267,
367,
945,
315,
1613,
8,
8462,
63,
795,
12,
291,
680,
362,
63,
1419,
837,
288,
340,
945,
14,
354,
508,
283,
11055,
15299,
493,
356,
355,
945,
275,
945,
14,
6311,
63,
264,
466,
8,
1422,
14,
354,
12,
3814,
9,
288,
1995,
945,
339,
347,
1072,
63,
509,
63,
2764,
8,
277,
12,
1318,
1907,
12,
754,
12,
13727,
2302,
12,
1011,
1419,
304,
267,
1318,
1907,
14,
1361,
63,
354,
8,
277,
14,
354,
9,
267,
340,
440,
754,
459,
3827,
2565,
288,
1318,
1907,
14,
1361,
63,
6104,
8,
277,
14,
8998,
63,
7011,
63,
1328,
9,
288,
372,
413,
267,
340,
440,
754,
459,
5819,
2565,
288,
1318,
1907,
14,
1361,
63,
6104,
480,
1918,
8434,
14202,
13,
262,
365,
5223,
14,
961,
883,
19781,
314,
4402,
9760,
5309,
8367,
14,
17534,
314,
8434,
14202,
13,
262,
543,
8891,
20014,
13,
5819,
13,
9053,
3507,
3985,
503,
295,
13,
1065,
642,
2884,
543,
8891,
306,
1045,
13,
5819,
3985,
945,
2685,
288,
372,
413,
267,
1263,
63,
31544,
275,
1263,
8,
1099,
459,
1099,
2278,
1459,
1012,
267,
1318,
1907,
14,
1361,
63,
6104,
360,
19322,
12601,
10993,
267,
1318,
1907,
14,
1361,
63,
2373,
17,
8,
288,
754,
459,
1099,
995,
1921,
63,
1648,
29,
277,
14,
8462,
63,
1648,
12,
288,
1373,
63,
585,
63,
529,
63,
604,
29,
797,
267,
776,
267,
367,
13727,
63,
1113,
63,
354,
315,
291,
14,
8462,
63,
1648,
26,
288,
1318,
1907,
14,
1361,
63,
6104,
360,
4276,
450,
83,
4881,
450,
13727,
63,
1113,
63,
354,
9,
288,
1318,
1907,
14,
1361,
63,
2373,
17,
8,
355,
754,
459,
4892,
3488,
9642,
63,
1113,
63,
354,
467,
1921,
63,
1648,
29,
277,
14,
8462,
63,
1648,
12,
355,
1373,
63,
585,
63,
529,
63,
604,
29,
549,
12,
288,
776,
267,
1318,
1907,
14,
1361,
63,
6104,
3654,
7,
627,
822,
8,
277,
14,
354,
430,
267,
340,
440,
1263,
63,
31544,
26,
288,
1318,
1907,
14,
1361,
63,
6104,
360,
1944,
4390,
15,
2634,
4898,
28322,
687,
450,
83,
7,
450,
3044,
13727,
2302,
9,
288,
372,
413,
267,
1318,
1907,
14,
1361,
63,
6104,
8,
2975,
8,
277,
14,
14258,
63,
8998,
63,
1328,
430,
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,
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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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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
aristanetworks/neutron
|
neutron/db/migration/alembic_migrations/portsec_init_ops.py
|
61
|
1452
|
# Copyright 2014 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.
#
# Initial operations for the port security extension
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'networksecuritybindings',
sa.Column('network_id', sa.String(length=36), nullable=False),
sa.Column('port_security_enabled', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
ondelete='CASCADE'),
sa.PrimaryKeyConstraint('network_id'))
op.create_table(
'portsecuritybindings',
sa.Column('port_id', sa.String(length=36), nullable=False),
sa.Column('port_security_enabled', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['port_id'], ['ports.id'],
ondelete='CASCADE'),
sa.PrimaryKeyConstraint('port_id'))
|
apache-2.0
|
[
3,
1898,
6927,
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,
199,
3,
199,
199,
3,
6026,
5331,
367,
314,
1844,
6391,
3329,
421,
199,
504,
30960,
20596,
492,
1687,
199,
646,
8335,
465,
2937,
421,
199,
318,
10754,
837,
272,
1687,
14,
981,
63,
1224,
8,
267,
283,
1200,
4416,
10880,
297,
267,
2937,
14,
4547,
360,
1200,
63,
344,
297,
2937,
14,
1558,
8,
1267,
29,
1344,
395,
7854,
29,
797,
395,
267,
2937,
14,
4547,
360,
719,
63,
4416,
63,
3827,
297,
2937,
14,
4082,
1062,
7854,
29,
797,
395,
267,
2937,
14,
3190,
8463,
2941,
1200,
63,
344,
995,
788,
7642,
14,
344,
995,
1816,
16549,
534,
10855,
659,
267,
2937,
14,
29457,
8463,
360,
1200,
63,
344,
1333,
339,
1687,
14,
981,
63,
1224,
8,
267,
283,
719,
4416,
10880,
297,
267,
2937,
14,
4547,
360,
719,
63,
344,
297,
2937,
14,
1558,
8,
1267,
29,
1344,
395,
7854,
29,
797,
395,
267,
2937,
14,
4547,
360,
719,
63,
4416,
63,
3827,
297,
2937,
14,
4082,
1062,
7854,
29,
797,
395,
267,
2937,
14,
3190,
8463,
2941,
719,
63,
344,
995,
788,
5203,
14,
344,
995,
1816,
16549,
534,
10855,
659,
267,
2937,
14,
29457,
8463,
360,
719,
63,
344,
1333,
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
] |
[
1898,
6927,
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,
199,
3,
199,
199,
3,
6026,
5331,
367,
314,
1844,
6391,
3329,
421,
199,
504,
30960,
20596,
492,
1687,
199,
646,
8335,
465,
2937,
421,
199,
318,
10754,
837,
272,
1687,
14,
981,
63,
1224,
8,
267,
283,
1200,
4416,
10880,
297,
267,
2937,
14,
4547,
360,
1200,
63,
344,
297,
2937,
14,
1558,
8,
1267,
29,
1344,
395,
7854,
29,
797,
395,
267,
2937,
14,
4547,
360,
719,
63,
4416,
63,
3827,
297,
2937,
14,
4082,
1062,
7854,
29,
797,
395,
267,
2937,
14,
3190,
8463,
2941,
1200,
63,
344,
995,
788,
7642,
14,
344,
995,
1816,
16549,
534,
10855,
659,
267,
2937,
14,
29457,
8463,
360,
1200,
63,
344,
1333,
339,
1687,
14,
981,
63,
1224,
8,
267,
283,
719,
4416,
10880,
297,
267,
2937,
14,
4547,
360,
719,
63,
344,
297,
2937,
14,
1558,
8,
1267,
29,
1344,
395,
7854,
29,
797,
395,
267,
2937,
14,
4547,
360,
719,
63,
4416,
63,
3827,
297,
2937,
14,
4082,
1062,
7854,
29,
797,
395,
267,
2937,
14,
3190,
8463,
2941,
719,
63,
344,
995,
788,
5203,
14,
344,
995,
1816,
16549,
534,
10855,
659,
267,
2937,
14,
29457,
8463,
360,
719,
63,
344,
1333,
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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/Lib/test/test_builtin.py
|
72
|
58513
|
# Python test set -- built-in functions
import ast
import builtins
import collections
import io
import locale
import os
import pickle
import platform
import random
import sys
import traceback
import types
import unittest
import warnings
from operator import neg
from test.support import TESTFN, unlink, run_unittest, check_warnings
from test.script_helper import assert_python_ok
try:
import pty, signal
except ImportError:
pty = signal = None
class Squares:
def __init__(self, max):
self.max = max
self.sofar = []
def __len__(self): return len(self.sofar)
def __getitem__(self, i):
if not 0 <= i < self.max: raise IndexError
n = len(self.sofar)
while n <= i:
self.sofar.append(n*n)
n += 1
return self.sofar[i]
class StrSquares:
def __init__(self, max):
self.max = max
self.sofar = []
def __len__(self):
return len(self.sofar)
def __getitem__(self, i):
if not 0 <= i < self.max:
raise IndexError
n = len(self.sofar)
while n <= i:
self.sofar.append(str(n*n))
n += 1
return self.sofar[i]
class BitBucket:
def write(self, line):
pass
test_conv_no_sign = [
('0', 0),
('1', 1),
('9', 9),
('10', 10),
('99', 99),
('100', 100),
('314', 314),
(' 314', 314),
('314 ', 314),
(' \t\t 314 \t\t ', 314),
(repr(sys.maxsize), sys.maxsize),
(' 1x', ValueError),
(' 1 ', 1),
(' 1\02 ', ValueError),
('', ValueError),
(' ', ValueError),
(' \t\t ', ValueError),
(str(b'\u0663\u0661\u0664 ','raw-unicode-escape'), 314),
(chr(0x200), ValueError),
]
test_conv_sign = [
('0', 0),
('1', 1),
('9', 9),
('10', 10),
('99', 99),
('100', 100),
('314', 314),
(' 314', ValueError),
('314 ', 314),
(' \t\t 314 \t\t ', ValueError),
(repr(sys.maxsize), sys.maxsize),
(' 1x', ValueError),
(' 1 ', ValueError),
(' 1\02 ', ValueError),
('', ValueError),
(' ', ValueError),
(' \t\t ', ValueError),
(str(b'\u0663\u0661\u0664 ','raw-unicode-escape'), 314),
(chr(0x200), ValueError),
]
class TestFailingBool:
def __bool__(self):
raise RuntimeError
class TestFailingIter:
def __iter__(self):
raise RuntimeError
def filter_char(arg):
return ord(arg) > ord("d")
def map_char(arg):
return chr(ord(arg)+1)
class BuiltinTest(unittest.TestCase):
# Helper to check picklability
def check_iter_pickle(self, it, seq):
itorg = it
d = pickle.dumps(it)
it = pickle.loads(d)
self.assertEqual(type(itorg), type(it))
self.assertEqual(list(it), seq)
#test the iterator after dropping one from it
it = pickle.loads(d)
try:
next(it)
except StopIteration:
return
d = pickle.dumps(it)
it = pickle.loads(d)
self.assertEqual(list(it), seq[1:])
def test_import(self):
__import__('sys')
__import__('time')
__import__('string')
__import__(name='sys')
__import__(name='time', level=0)
self.assertRaises(ImportError, __import__, 'spamspam')
self.assertRaises(TypeError, __import__, 1, 2, 3, 4)
self.assertRaises(ValueError, __import__, '')
self.assertRaises(TypeError, __import__, 'sys', name='sys')
def test_abs(self):
# int
self.assertEqual(abs(0), 0)
self.assertEqual(abs(1234), 1234)
self.assertEqual(abs(-1234), 1234)
self.assertTrue(abs(-sys.maxsize-1) > 0)
# float
self.assertEqual(abs(0.0), 0.0)
self.assertEqual(abs(3.14), 3.14)
self.assertEqual(abs(-3.14), 3.14)
# str
self.assertRaises(TypeError, abs, 'a')
# bool
self.assertEqual(abs(True), 1)
self.assertEqual(abs(False), 0)
# other
self.assertRaises(TypeError, abs)
self.assertRaises(TypeError, abs, None)
class AbsClass(object):
def __abs__(self):
return -5
self.assertEqual(abs(AbsClass()), -5)
def test_all(self):
self.assertEqual(all([2, 4, 6]), True)
self.assertEqual(all([2, None, 6]), False)
self.assertRaises(RuntimeError, all, [2, TestFailingBool(), 6])
self.assertRaises(RuntimeError, all, TestFailingIter())
self.assertRaises(TypeError, all, 10) # Non-iterable
self.assertRaises(TypeError, all) # No args
self.assertRaises(TypeError, all, [2, 4, 6], []) # Too many args
self.assertEqual(all([]), True) # Empty iterator
self.assertEqual(all([0, TestFailingBool()]), False)# Short-circuit
S = [50, 60]
self.assertEqual(all(x > 42 for x in S), True)
S = [50, 40, 60]
self.assertEqual(all(x > 42 for x in S), False)
def test_any(self):
self.assertEqual(any([None, None, None]), False)
self.assertEqual(any([None, 4, None]), True)
self.assertRaises(RuntimeError, any, [None, TestFailingBool(), 6])
self.assertRaises(RuntimeError, any, TestFailingIter())
self.assertRaises(TypeError, any, 10) # Non-iterable
self.assertRaises(TypeError, any) # No args
self.assertRaises(TypeError, any, [2, 4, 6], []) # Too many args
self.assertEqual(any([]), False) # Empty iterator
self.assertEqual(any([1, TestFailingBool()]), True) # Short-circuit
S = [40, 60, 30]
self.assertEqual(any(x > 42 for x in S), True)
S = [10, 20, 30]
self.assertEqual(any(x > 42 for x in S), False)
def test_ascii(self):
self.assertEqual(ascii(''), '\'\'')
self.assertEqual(ascii(0), '0')
self.assertEqual(ascii(()), '()')
self.assertEqual(ascii([]), '[]')
self.assertEqual(ascii({}), '{}')
a = []
a.append(a)
self.assertEqual(ascii(a), '[[...]]')
a = {}
a[0] = a
self.assertEqual(ascii(a), '{0: {...}}')
# Advanced checks for unicode strings
def _check_uni(s):
self.assertEqual(ascii(s), repr(s))
_check_uni("'")
_check_uni('"')
_check_uni('"\'')
_check_uni('\0')
_check_uni('\r\n\t .')
# Unprintable non-ASCII characters
_check_uni('\x85')
_check_uni('\u1fff')
_check_uni('\U00012fff')
# Lone surrogates
_check_uni('\ud800')
_check_uni('\udfff')
# Issue #9804: surrogates should be joined even for printable
# wide characters (UCS-2 builds).
self.assertEqual(ascii('\U0001d121'), "'\\U0001d121'")
# All together
s = "'\0\"\n\r\t abcd\x85é\U00012fff\uD800\U0001D121xxx."
self.assertEqual(ascii(s),
r"""'\'\x00"\n\r\t abcd\x85\xe9\U00012fff\ud800\U0001d121xxx.'""")
def test_neg(self):
x = -sys.maxsize-1
self.assertTrue(isinstance(x, int))
self.assertEqual(-x, sys.maxsize+1)
def test_callable(self):
self.assertTrue(callable(len))
self.assertFalse(callable("a"))
self.assertTrue(callable(callable))
self.assertTrue(callable(lambda x, y: x + y))
self.assertFalse(callable(__builtins__))
def f(): pass
self.assertTrue(callable(f))
class C1:
def meth(self): pass
self.assertTrue(callable(C1))
c = C1()
self.assertTrue(callable(c.meth))
self.assertFalse(callable(c))
# __call__ is looked up on the class, not the instance
c.__call__ = None
self.assertFalse(callable(c))
c.__call__ = lambda self: 0
self.assertFalse(callable(c))
del c.__call__
self.assertFalse(callable(c))
class C2(object):
def __call__(self): pass
c2 = C2()
self.assertTrue(callable(c2))
c2.__call__ = None
self.assertTrue(callable(c2))
class C3(C2): pass
c3 = C3()
self.assertTrue(callable(c3))
def test_chr(self):
self.assertEqual(chr(32), ' ')
self.assertEqual(chr(65), 'A')
self.assertEqual(chr(97), 'a')
self.assertEqual(chr(0xff), '\xff')
self.assertRaises(ValueError, chr, 1<<24)
self.assertEqual(chr(sys.maxunicode),
str('\\U0010ffff'.encode("ascii"), 'unicode-escape'))
self.assertRaises(TypeError, chr)
self.assertEqual(chr(0x0000FFFF), "\U0000FFFF")
self.assertEqual(chr(0x00010000), "\U00010000")
self.assertEqual(chr(0x00010001), "\U00010001")
self.assertEqual(chr(0x000FFFFE), "\U000FFFFE")
self.assertEqual(chr(0x000FFFFF), "\U000FFFFF")
self.assertEqual(chr(0x00100000), "\U00100000")
self.assertEqual(chr(0x00100001), "\U00100001")
self.assertEqual(chr(0x0010FFFE), "\U0010FFFE")
self.assertEqual(chr(0x0010FFFF), "\U0010FFFF")
self.assertRaises(ValueError, chr, -1)
self.assertRaises(ValueError, chr, 0x00110000)
self.assertRaises((OverflowError, ValueError), chr, 2**32)
def test_cmp(self):
self.assertTrue(not hasattr(builtins, "cmp"))
def test_compile(self):
compile('print(1)\n', '', 'exec')
bom = b'\xef\xbb\xbf'
compile(bom + b'print(1)\n', '', 'exec')
compile(source='pass', filename='?', mode='exec')
compile(dont_inherit=0, filename='tmp', source='0', mode='eval')
compile('pass', '?', dont_inherit=1, mode='exec')
compile(memoryview(b"text"), "name", "exec")
self.assertRaises(TypeError, compile)
self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'badmode')
self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'single', 0xff)
self.assertRaises(TypeError, compile, chr(0), 'f', 'exec')
self.assertRaises(TypeError, compile, 'pass', '?', 'exec',
mode='eval', source='0', filename='tmp')
compile('print("\xe5")\n', '', 'exec')
self.assertRaises(TypeError, compile, chr(0), 'f', 'exec')
self.assertRaises(ValueError, compile, str('a = 1'), 'f', 'bad')
# test the optimize argument
codestr = '''def f():
"""doc"""
try:
assert False
except AssertionError:
return (True, f.__doc__)
else:
return (False, f.__doc__)
'''
def f(): """doc"""
values = [(-1, __debug__, f.__doc__),
(0, True, 'doc'),
(1, False, 'doc'),
(2, False, None)]
for optval, debugval, docstring in values:
# test both direct compilation and compilation via AST
codeobjs = []
codeobjs.append(compile(codestr, "<test>", "exec", optimize=optval))
tree = ast.parse(codestr)
codeobjs.append(compile(tree, "<test>", "exec", optimize=optval))
for code in codeobjs:
ns = {}
exec(code, ns)
rv = ns['f']()
self.assertEqual(rv, (debugval, docstring))
def test_delattr(self):
sys.spam = 1
delattr(sys, 'spam')
self.assertRaises(TypeError, delattr)
def test_dir(self):
# dir(wrong number of arguments)
self.assertRaises(TypeError, dir, 42, 42)
# dir() - local scope
local_var = 1
self.assertIn('local_var', dir())
# dir(module)
self.assertIn('exit', dir(sys))
# dir(module_with_invalid__dict__)
class Foo(types.ModuleType):
__dict__ = 8
f = Foo("foo")
self.assertRaises(TypeError, dir, f)
# dir(type)
self.assertIn("strip", dir(str))
self.assertNotIn("__mro__", dir(str))
# dir(obj)
class Foo(object):
def __init__(self):
self.x = 7
self.y = 8
self.z = 9
f = Foo()
self.assertIn("y", dir(f))
# dir(obj_no__dict__)
class Foo(object):
__slots__ = []
f = Foo()
self.assertIn("__repr__", dir(f))
# dir(obj_no__class__with__dict__)
# (an ugly trick to cause getattr(f, "__class__") to fail)
class Foo(object):
__slots__ = ["__class__", "__dict__"]
def __init__(self):
self.bar = "wow"
f = Foo()
self.assertNotIn("__repr__", dir(f))
self.assertIn("bar", dir(f))
# dir(obj_using __dir__)
class Foo(object):
def __dir__(self):
return ["kan", "ga", "roo"]
f = Foo()
self.assertTrue(dir(f) == ["ga", "kan", "roo"])
# dir(obj__dir__tuple)
class Foo(object):
def __dir__(self):
return ("b", "c", "a")
res = dir(Foo())
self.assertIsInstance(res, list)
self.assertTrue(res == ["a", "b", "c"])
# dir(obj__dir__not_sequence)
class Foo(object):
def __dir__(self):
return 7
f = Foo()
self.assertRaises(TypeError, dir, f)
# dir(traceback)
try:
raise IndexError
except:
self.assertEqual(len(dir(sys.exc_info()[2])), 4)
# test that object has a __dir__()
self.assertEqual(sorted([].__dir__()), dir([]))
def test_divmod(self):
self.assertEqual(divmod(12, 7), (1, 5))
self.assertEqual(divmod(-12, 7), (-2, 2))
self.assertEqual(divmod(12, -7), (-2, -2))
self.assertEqual(divmod(-12, -7), (1, -5))
self.assertEqual(divmod(-sys.maxsize-1, -1), (sys.maxsize+1, 0))
for num, denom, exp_result in [ (3.25, 1.0, (3.0, 0.25)),
(-3.25, 1.0, (-4.0, 0.75)),
(3.25, -1.0, (-4.0, -0.75)),
(-3.25, -1.0, (3.0, -0.25))]:
result = divmod(num, denom)
self.assertAlmostEqual(result[0], exp_result[0])
self.assertAlmostEqual(result[1], exp_result[1])
self.assertRaises(TypeError, divmod)
def test_eval(self):
self.assertEqual(eval('1+1'), 2)
self.assertEqual(eval(' 1+1\n'), 2)
globals = {'a': 1, 'b': 2}
locals = {'b': 200, 'c': 300}
self.assertEqual(eval('a', globals) , 1)
self.assertEqual(eval('a', globals, locals), 1)
self.assertEqual(eval('b', globals, locals), 200)
self.assertEqual(eval('c', globals, locals), 300)
globals = {'a': 1, 'b': 2}
locals = {'b': 200, 'c': 300}
bom = b'\xef\xbb\xbf'
self.assertEqual(eval(bom + b'a', globals, locals), 1)
self.assertEqual(eval('"\xe5"', globals), "\xe5")
self.assertRaises(TypeError, eval)
self.assertRaises(TypeError, eval, ())
self.assertRaises(SyntaxError, eval, bom[:2] + b'a')
class X:
def __getitem__(self, key):
raise ValueError
self.assertRaises(ValueError, eval, "foo", {}, X())
def test_general_eval(self):
# Tests that general mappings can be used for the locals argument
class M:
"Test mapping interface versus possible calls from eval()."
def __getitem__(self, key):
if key == 'a':
return 12
raise KeyError
def keys(self):
return list('xyz')
m = M()
g = globals()
self.assertEqual(eval('a', g, m), 12)
self.assertRaises(NameError, eval, 'b', g, m)
self.assertEqual(eval('dir()', g, m), list('xyz'))
self.assertEqual(eval('globals()', g, m), g)
self.assertEqual(eval('locals()', g, m), m)
self.assertRaises(TypeError, eval, 'a', m)
class A:
"Non-mapping"
pass
m = A()
self.assertRaises(TypeError, eval, 'a', g, m)
# Verify that dict subclasses work as well
class D(dict):
def __getitem__(self, key):
if key == 'a':
return 12
return dict.__getitem__(self, key)
def keys(self):
return list('xyz')
d = D()
self.assertEqual(eval('a', g, d), 12)
self.assertRaises(NameError, eval, 'b', g, d)
self.assertEqual(eval('dir()', g, d), list('xyz'))
self.assertEqual(eval('globals()', g, d), g)
self.assertEqual(eval('locals()', g, d), d)
# Verify locals stores (used by list comps)
eval('[locals() for i in (2,3)]', g, d)
eval('[locals() for i in (2,3)]', g, collections.UserDict())
class SpreadSheet:
"Sample application showing nested, calculated lookups."
_cells = {}
def __setitem__(self, key, formula):
self._cells[key] = formula
def __getitem__(self, key):
return eval(self._cells[key], globals(), self)
ss = SpreadSheet()
ss['a1'] = '5'
ss['a2'] = 'a1*6'
ss['a3'] = 'a2*7'
self.assertEqual(ss['a3'], 210)
# Verify that dir() catches a non-list returned by eval
# SF bug #1004669
class C:
def __getitem__(self, item):
raise KeyError(item)
def keys(self):
return 1 # used to be 'a' but that's no longer an error
self.assertRaises(TypeError, eval, 'dir()', globals(), C())
def test_exec(self):
g = {}
exec('z = 1', g)
if '__builtins__' in g:
del g['__builtins__']
self.assertEqual(g, {'z': 1})
exec('z = 1+1', g)
if '__builtins__' in g:
del g['__builtins__']
self.assertEqual(g, {'z': 2})
g = {}
l = {}
with check_warnings():
warnings.filterwarnings("ignore", "global statement",
module="<string>")
exec('global a; a = 1; b = 2', g, l)
if '__builtins__' in g:
del g['__builtins__']
if '__builtins__' in l:
del l['__builtins__']
self.assertEqual((g, l), ({'a': 1}, {'b': 2}))
def test_exec_globals(self):
code = compile("print('Hello World!')", "", "exec")
# no builtin function
self.assertRaisesRegex(NameError, "name 'print' is not defined",
exec, code, {'__builtins__': {}})
# __builtins__ must be a mapping type
self.assertRaises(TypeError,
exec, code, {'__builtins__': 123})
# no __build_class__ function
code = compile("class A: pass", "", "exec")
self.assertRaisesRegex(NameError, "__build_class__ not found",
exec, code, {'__builtins__': {}})
class frozendict_error(Exception):
pass
class frozendict(dict):
def __setitem__(self, key, value):
raise frozendict_error("frozendict is readonly")
# read-only builtins
if isinstance(__builtins__, types.ModuleType):
frozen_builtins = frozendict(__builtins__.__dict__)
else:
frozen_builtins = frozendict(__builtins__)
code = compile("__builtins__['superglobal']=2; print(superglobal)", "test", "exec")
self.assertRaises(frozendict_error,
exec, code, {'__builtins__': frozen_builtins})
# read-only globals
namespace = frozendict({})
code = compile("x=1", "test", "exec")
self.assertRaises(frozendict_error,
exec, code, namespace)
def test_exec_redirected(self):
savestdout = sys.stdout
sys.stdout = None # Whatever that cannot flush()
try:
# Used to raise SystemError('error return without exception set')
exec('a')
except NameError:
pass
finally:
sys.stdout = savestdout
def test_filter(self):
self.assertEqual(list(filter(lambda c: 'a' <= c <= 'z', 'Hello World')), list('elloorld'))
self.assertEqual(list(filter(None, [1, 'hello', [], [3], '', None, 9, 0])), [1, 'hello', [3], 9])
self.assertEqual(list(filter(lambda x: x > 0, [1, -3, 9, 0, 2])), [1, 9, 2])
self.assertEqual(list(filter(None, Squares(10))), [1, 4, 9, 16, 25, 36, 49, 64, 81])
self.assertEqual(list(filter(lambda x: x%2, Squares(10))), [1, 9, 25, 49, 81])
def identity(item):
return 1
filter(identity, Squares(5))
self.assertRaises(TypeError, filter)
class BadSeq(object):
def __getitem__(self, index):
if index<4:
return 42
raise ValueError
self.assertRaises(ValueError, list, filter(lambda x: x, BadSeq()))
def badfunc():
pass
self.assertRaises(TypeError, list, filter(badfunc, range(5)))
# test bltinmodule.c::filtertuple()
self.assertEqual(list(filter(None, (1, 2))), [1, 2])
self.assertEqual(list(filter(lambda x: x>=3, (1, 2, 3, 4))), [3, 4])
self.assertRaises(TypeError, list, filter(42, (1, 2)))
def test_filter_pickle(self):
f1 = filter(filter_char, "abcdeabcde")
f2 = filter(filter_char, "abcdeabcde")
self.check_iter_pickle(f1, list(f2))
def test_getattr(self):
self.assertTrue(getattr(sys, 'stdout') is sys.stdout)
self.assertRaises(TypeError, getattr, sys, 1)
self.assertRaises(TypeError, getattr, sys, 1, "foo")
self.assertRaises(TypeError, getattr)
self.assertRaises(AttributeError, getattr, sys, chr(sys.maxunicode))
# unicode surrogates are not encodable to the default encoding (utf8)
self.assertRaises(AttributeError, getattr, 1, "\uDAD1\uD51E")
def test_hasattr(self):
self.assertTrue(hasattr(sys, 'stdout'))
self.assertRaises(TypeError, hasattr, sys, 1)
self.assertRaises(TypeError, hasattr)
self.assertEqual(False, hasattr(sys, chr(sys.maxunicode)))
# Check that hasattr propagates all exceptions outside of
# AttributeError.
class A:
def __getattr__(self, what):
raise SystemExit
self.assertRaises(SystemExit, hasattr, A(), "b")
class B:
def __getattr__(self, what):
raise ValueError
self.assertRaises(ValueError, hasattr, B(), "b")
def test_hash(self):
hash(None)
self.assertEqual(hash(1), hash(1))
self.assertEqual(hash(1), hash(1.0))
hash('spam')
self.assertEqual(hash('spam'), hash(b'spam'))
hash((0,1,2,3))
def f(): pass
self.assertRaises(TypeError, hash, [])
self.assertRaises(TypeError, hash, {})
# Bug 1536021: Allow hash to return long objects
class X:
def __hash__(self):
return 2**100
self.assertEqual(type(hash(X())), int)
class Z(int):
def __hash__(self):
return self
self.assertEqual(hash(Z(42)), hash(42))
def test_hex(self):
self.assertEqual(hex(16), '0x10')
self.assertEqual(hex(-16), '-0x10')
self.assertRaises(TypeError, hex, {})
def test_id(self):
id(None)
id(1)
id(1.0)
id('spam')
id((0,1,2,3))
id([0,1,2,3])
id({'spam': 1, 'eggs': 2, 'ham': 3})
# Test input() later, alphabetized as if it were raw_input
def test_iter(self):
self.assertRaises(TypeError, iter)
self.assertRaises(TypeError, iter, 42, 42)
lists = [("1", "2"), ["1", "2"], "12"]
for l in lists:
i = iter(l)
self.assertEqual(next(i), '1')
self.assertEqual(next(i), '2')
self.assertRaises(StopIteration, next, i)
def test_isinstance(self):
class C:
pass
class D(C):
pass
class E:
pass
c = C()
d = D()
e = E()
self.assertTrue(isinstance(c, C))
self.assertTrue(isinstance(d, C))
self.assertTrue(not isinstance(e, C))
self.assertTrue(not isinstance(c, D))
self.assertTrue(not isinstance('foo', E))
self.assertRaises(TypeError, isinstance, E, 'foo')
self.assertRaises(TypeError, isinstance)
def test_issubclass(self):
class C:
pass
class D(C):
pass
class E:
pass
c = C()
d = D()
e = E()
self.assertTrue(issubclass(D, C))
self.assertTrue(issubclass(C, C))
self.assertTrue(not issubclass(C, D))
self.assertRaises(TypeError, issubclass, 'foo', E)
self.assertRaises(TypeError, issubclass, E, 'foo')
self.assertRaises(TypeError, issubclass)
def test_len(self):
self.assertEqual(len('123'), 3)
self.assertEqual(len(()), 0)
self.assertEqual(len((1, 2, 3, 4)), 4)
self.assertEqual(len([1, 2, 3, 4]), 4)
self.assertEqual(len({}), 0)
self.assertEqual(len({'a':1, 'b': 2}), 2)
class BadSeq:
def __len__(self):
raise ValueError
self.assertRaises(ValueError, len, BadSeq())
class InvalidLen:
def __len__(self):
return None
self.assertRaises(TypeError, len, InvalidLen())
class FloatLen:
def __len__(self):
return 4.5
self.assertRaises(TypeError, len, FloatLen())
class HugeLen:
def __len__(self):
return sys.maxsize + 1
self.assertRaises(OverflowError, len, HugeLen())
class NoLenMethod(object): pass
self.assertRaises(TypeError, len, NoLenMethod())
def test_map(self):
self.assertEqual(
list(map(lambda x: x*x, range(1,4))),
[1, 4, 9]
)
try:
from math import sqrt
except ImportError:
def sqrt(x):
return pow(x, 0.5)
self.assertEqual(
list(map(lambda x: list(map(sqrt, x)), [[16, 4], [81, 9]])),
[[4.0, 2.0], [9.0, 3.0]]
)
self.assertEqual(
list(map(lambda x, y: x+y, [1,3,2], [9,1,4])),
[10, 4, 6]
)
def plus(*v):
accu = 0
for i in v: accu = accu + i
return accu
self.assertEqual(
list(map(plus, [1, 3, 7])),
[1, 3, 7]
)
self.assertEqual(
list(map(plus, [1, 3, 7], [4, 9, 2])),
[1+4, 3+9, 7+2]
)
self.assertEqual(
list(map(plus, [1, 3, 7], [4, 9, 2], [1, 1, 0])),
[1+4+1, 3+9+1, 7+2+0]
)
self.assertEqual(
list(map(int, Squares(10))),
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
)
def Max(a, b):
if a is None:
return b
if b is None:
return a
return max(a, b)
self.assertEqual(
list(map(Max, Squares(3), Squares(2))),
[0, 1]
)
self.assertRaises(TypeError, map)
self.assertRaises(TypeError, map, lambda x: x, 42)
class BadSeq:
def __iter__(self):
raise ValueError
yield None
self.assertRaises(ValueError, list, map(lambda x: x, BadSeq()))
def badfunc(x):
raise RuntimeError
self.assertRaises(RuntimeError, list, map(badfunc, range(5)))
def test_map_pickle(self):
m1 = map(map_char, "Is this the real life?")
m2 = map(map_char, "Is this the real life?")
self.check_iter_pickle(m1, list(m2))
def test_max(self):
self.assertEqual(max('123123'), '3')
self.assertEqual(max(1, 2, 3), 3)
self.assertEqual(max((1, 2, 3, 1, 2, 3)), 3)
self.assertEqual(max([1, 2, 3, 1, 2, 3]), 3)
self.assertEqual(max(1, 2, 3.0), 3.0)
self.assertEqual(max(1, 2.0, 3), 3)
self.assertEqual(max(1.0, 2, 3), 3)
self.assertRaises(TypeError, max)
self.assertRaises(TypeError, max, 42)
self.assertRaises(ValueError, max, ())
class BadSeq:
def __getitem__(self, index):
raise ValueError
self.assertRaises(ValueError, max, BadSeq())
for stmt in (
"max(key=int)", # no args
"max(default=None)",
"max(1, 2, default=None)", # require container for default
"max(default=None, key=int)",
"max(1, key=int)", # single arg not iterable
"max(1, 2, keystone=int)", # wrong keyword
"max(1, 2, key=int, abc=int)", # two many keywords
"max(1, 2, key=1)", # keyfunc is not callable
):
try:
exec(stmt, globals())
except TypeError:
pass
else:
self.fail(stmt)
self.assertEqual(max((1,), key=neg), 1) # one elem iterable
self.assertEqual(max((1,2), key=neg), 1) # two elem iterable
self.assertEqual(max(1, 2, key=neg), 1) # two elems
self.assertEqual(max((), default=None), None) # zero elem iterable
self.assertEqual(max((1,), default=None), 1) # one elem iterable
self.assertEqual(max((1,2), default=None), 2) # two elem iterable
self.assertEqual(max((), default=1, key=neg), 1)
self.assertEqual(max((1, 2), default=3, key=neg), 1)
data = [random.randrange(200) for i in range(100)]
keys = dict((elem, random.randrange(50)) for elem in data)
f = keys.__getitem__
self.assertEqual(max(data, key=f),
sorted(reversed(data), key=f)[-1])
def test_min(self):
self.assertEqual(min('123123'), '1')
self.assertEqual(min(1, 2, 3), 1)
self.assertEqual(min((1, 2, 3, 1, 2, 3)), 1)
self.assertEqual(min([1, 2, 3, 1, 2, 3]), 1)
self.assertEqual(min(1, 2, 3.0), 1)
self.assertEqual(min(1, 2.0, 3), 1)
self.assertEqual(min(1.0, 2, 3), 1.0)
self.assertRaises(TypeError, min)
self.assertRaises(TypeError, min, 42)
self.assertRaises(ValueError, min, ())
class BadSeq:
def __getitem__(self, index):
raise ValueError
self.assertRaises(ValueError, min, BadSeq())
for stmt in (
"min(key=int)", # no args
"min(default=None)",
"min(1, 2, default=None)", # require container for default
"min(default=None, key=int)",
"min(1, key=int)", # single arg not iterable
"min(1, 2, keystone=int)", # wrong keyword
"min(1, 2, key=int, abc=int)", # two many keywords
"min(1, 2, key=1)", # keyfunc is not callable
):
try:
exec(stmt, globals())
except TypeError:
pass
else:
self.fail(stmt)
self.assertEqual(min((1,), key=neg), 1) # one elem iterable
self.assertEqual(min((1,2), key=neg), 2) # two elem iterable
self.assertEqual(min(1, 2, key=neg), 2) # two elems
self.assertEqual(min((), default=None), None) # zero elem iterable
self.assertEqual(min((1,), default=None), 1) # one elem iterable
self.assertEqual(min((1,2), default=None), 1) # two elem iterable
self.assertEqual(min((), default=1, key=neg), 1)
self.assertEqual(min((1, 2), default=1, key=neg), 2)
data = [random.randrange(200) for i in range(100)]
keys = dict((elem, random.randrange(50)) for elem in data)
f = keys.__getitem__
self.assertEqual(min(data, key=f),
sorted(data, key=f)[0])
def test_next(self):
it = iter(range(2))
self.assertEqual(next(it), 0)
self.assertEqual(next(it), 1)
self.assertRaises(StopIteration, next, it)
self.assertRaises(StopIteration, next, it)
self.assertEqual(next(it, 42), 42)
class Iter(object):
def __iter__(self):
return self
def __next__(self):
raise StopIteration
it = iter(Iter())
self.assertEqual(next(it, 42), 42)
self.assertRaises(StopIteration, next, it)
def gen():
yield 1
return
it = gen()
self.assertEqual(next(it), 1)
self.assertRaises(StopIteration, next, it)
self.assertEqual(next(it, 42), 42)
def test_oct(self):
self.assertEqual(oct(100), '0o144')
self.assertEqual(oct(-100), '-0o144')
self.assertRaises(TypeError, oct, ())
def write_testfile(self):
# NB the first 4 lines are also used to test input, below
fp = open(TESTFN, 'w')
self.addCleanup(unlink, TESTFN)
with fp:
fp.write('1+1\n')
fp.write('The quick brown fox jumps over the lazy dog')
fp.write('.\n')
fp.write('Dear John\n')
fp.write('XXX'*100)
fp.write('YYY'*100)
def test_open(self):
self.write_testfile()
fp = open(TESTFN, 'r')
with fp:
self.assertEqual(fp.readline(4), '1+1\n')
self.assertEqual(fp.readline(), 'The quick brown fox jumps over the lazy dog.\n')
self.assertEqual(fp.readline(4), 'Dear')
self.assertEqual(fp.readline(100), ' John\n')
self.assertEqual(fp.read(300), 'XXX'*100)
self.assertEqual(fp.read(1000), 'YYY'*100)
def test_open_default_encoding(self):
old_environ = dict(os.environ)
try:
# try to get a user preferred encoding different than the current
# locale encoding to check that open() uses the current locale
# encoding and not the user preferred encoding
for key in ('LC_ALL', 'LANG', 'LC_CTYPE'):
if key in os.environ:
del os.environ[key]
self.write_testfile()
current_locale_encoding = locale.getpreferredencoding(False)
fp = open(TESTFN, 'w')
with fp:
self.assertEqual(fp.encoding, current_locale_encoding)
finally:
os.environ.clear()
os.environ.update(old_environ)
def test_open_non_inheritable(self):
fileobj = open(__file__)
with fileobj:
self.assertFalse(os.get_inheritable(fileobj.fileno()))
def test_ord(self):
self.assertEqual(ord(' '), 32)
self.assertEqual(ord('A'), 65)
self.assertEqual(ord('a'), 97)
self.assertEqual(ord('\x80'), 128)
self.assertEqual(ord('\xff'), 255)
self.assertEqual(ord(b' '), 32)
self.assertEqual(ord(b'A'), 65)
self.assertEqual(ord(b'a'), 97)
self.assertEqual(ord(b'\x80'), 128)
self.assertEqual(ord(b'\xff'), 255)
self.assertEqual(ord(chr(sys.maxunicode)), sys.maxunicode)
self.assertRaises(TypeError, ord, 42)
self.assertEqual(ord(chr(0x10FFFF)), 0x10FFFF)
self.assertEqual(ord("\U0000FFFF"), 0x0000FFFF)
self.assertEqual(ord("\U00010000"), 0x00010000)
self.assertEqual(ord("\U00010001"), 0x00010001)
self.assertEqual(ord("\U000FFFFE"), 0x000FFFFE)
self.assertEqual(ord("\U000FFFFF"), 0x000FFFFF)
self.assertEqual(ord("\U00100000"), 0x00100000)
self.assertEqual(ord("\U00100001"), 0x00100001)
self.assertEqual(ord("\U0010FFFE"), 0x0010FFFE)
self.assertEqual(ord("\U0010FFFF"), 0x0010FFFF)
def test_pow(self):
self.assertEqual(pow(0,0), 1)
self.assertEqual(pow(0,1), 0)
self.assertEqual(pow(1,0), 1)
self.assertEqual(pow(1,1), 1)
self.assertEqual(pow(2,0), 1)
self.assertEqual(pow(2,10), 1024)
self.assertEqual(pow(2,20), 1024*1024)
self.assertEqual(pow(2,30), 1024*1024*1024)
self.assertEqual(pow(-2,0), 1)
self.assertEqual(pow(-2,1), -2)
self.assertEqual(pow(-2,2), 4)
self.assertEqual(pow(-2,3), -8)
self.assertAlmostEqual(pow(0.,0), 1.)
self.assertAlmostEqual(pow(0.,1), 0.)
self.assertAlmostEqual(pow(1.,0), 1.)
self.assertAlmostEqual(pow(1.,1), 1.)
self.assertAlmostEqual(pow(2.,0), 1.)
self.assertAlmostEqual(pow(2.,10), 1024.)
self.assertAlmostEqual(pow(2.,20), 1024.*1024.)
self.assertAlmostEqual(pow(2.,30), 1024.*1024.*1024.)
self.assertAlmostEqual(pow(-2.,0), 1.)
self.assertAlmostEqual(pow(-2.,1), -2.)
self.assertAlmostEqual(pow(-2.,2), 4.)
self.assertAlmostEqual(pow(-2.,3), -8.)
for x in 2, 2.0:
for y in 10, 10.0:
for z in 1000, 1000.0:
if isinstance(x, float) or \
isinstance(y, float) or \
isinstance(z, float):
self.assertRaises(TypeError, pow, x, y, z)
else:
self.assertAlmostEqual(pow(x, y, z), 24.0)
self.assertAlmostEqual(pow(-1, 0.5), 1j)
self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j)
self.assertRaises(TypeError, pow, -1, -2, 3)
self.assertRaises(ValueError, pow, 1, 2, 0)
self.assertRaises(TypeError, pow)
def test_input(self):
self.write_testfile()
fp = open(TESTFN, 'r')
savestdin = sys.stdin
savestdout = sys.stdout # Eats the echo
try:
sys.stdin = fp
sys.stdout = BitBucket()
self.assertEqual(input(), "1+1")
self.assertEqual(input(), 'The quick brown fox jumps over the lazy dog.')
self.assertEqual(input('testing\n'), 'Dear John')
# SF 1535165: don't segfault on closed stdin
# sys.stdout must be a regular file for triggering
sys.stdout = savestdout
sys.stdin.close()
self.assertRaises(ValueError, input)
sys.stdout = BitBucket()
sys.stdin = io.StringIO("NULL\0")
self.assertRaises(TypeError, input, 42, 42)
sys.stdin = io.StringIO(" 'whitespace'")
self.assertEqual(input(), " 'whitespace'")
sys.stdin = io.StringIO()
self.assertRaises(EOFError, input)
del sys.stdout
self.assertRaises(RuntimeError, input, 'prompt')
del sys.stdin
self.assertRaises(RuntimeError, input, 'prompt')
finally:
sys.stdin = savestdin
sys.stdout = savestdout
fp.close()
@unittest.skipUnless(pty, "the pty and signal modules must be available")
def check_input_tty(self, prompt, terminal_input, stdio_encoding=None):
if not sys.stdin.isatty() or not sys.stdout.isatty():
self.skipTest("stdin and stdout must be ttys")
r, w = os.pipe()
try:
pid, fd = pty.fork()
except (OSError, AttributeError) as e:
os.close(r)
os.close(w)
self.skipTest("pty.fork() raised {}".format(e))
if pid == 0:
# Child
try:
# Make sure we don't get stuck if there's a problem
signal.alarm(2)
os.close(r)
# Check the error handlers are accounted for
if stdio_encoding:
sys.stdin = io.TextIOWrapper(sys.stdin.detach(),
encoding=stdio_encoding,
errors='surrogateescape')
sys.stdout = io.TextIOWrapper(sys.stdout.detach(),
encoding=stdio_encoding,
errors='replace')
with open(w, "w") as wpipe:
print("tty =", sys.stdin.isatty() and sys.stdout.isatty(), file=wpipe)
print(ascii(input(prompt)), file=wpipe)
except:
traceback.print_exc()
finally:
# We don't want to return to unittest...
os._exit(0)
# Parent
os.close(w)
os.write(fd, terminal_input + b"\r\n")
# Get results from the pipe
with open(r, "r") as rpipe:
lines = []
while True:
line = rpipe.readline().strip()
if line == "":
# The other end was closed => the child exited
break
lines.append(line)
# Check the result was got and corresponds to the user's terminal input
if len(lines) != 2:
# Something went wrong, try to get at stderr
with open(fd, "r", encoding="ascii", errors="ignore") as child_output:
self.fail("got %d lines in pipe but expected 2, child output was:\n%s"
% (len(lines), child_output.read()))
os.close(fd)
# Check we did exercise the GNU readline path
self.assertIn(lines[0], {'tty = True', 'tty = False'})
if lines[0] != 'tty = True':
self.skipTest("standard IO in should have been a tty")
input_result = eval(lines[1]) # ascii() -> eval() roundtrip
if stdio_encoding:
expected = terminal_input.decode(stdio_encoding, 'surrogateescape')
else:
expected = terminal_input.decode(sys.stdin.encoding) # what else?
self.assertEqual(input_result, expected)
def test_input_tty(self):
# Test input() functionality when wired to a tty (the code path
# is different and invokes GNU readline if available).
self.check_input_tty("prompt", b"quux")
def test_input_tty_non_ascii(self):
# Check stdin/stdout encoding is used when invoking GNU readline
self.check_input_tty("prompté", b"quux\xe9", "utf-8")
def test_input_tty_non_ascii_unicode_errors(self):
# Check stdin/stdout error handler is used when invoking GNU readline
self.check_input_tty("prompté", b"quux\xe9", "ascii")
# test_int(): see test_int.py for tests of built-in function int().
def test_repr(self):
self.assertEqual(repr(''), '\'\'')
self.assertEqual(repr(0), '0')
self.assertEqual(repr(()), '()')
self.assertEqual(repr([]), '[]')
self.assertEqual(repr({}), '{}')
a = []
a.append(a)
self.assertEqual(repr(a), '[[...]]')
a = {}
a[0] = a
self.assertEqual(repr(a), '{0: {...}}')
def test_round(self):
self.assertEqual(round(0.0), 0.0)
self.assertEqual(type(round(0.0)), int)
self.assertEqual(round(1.0), 1.0)
self.assertEqual(round(10.0), 10.0)
self.assertEqual(round(1000000000.0), 1000000000.0)
self.assertEqual(round(1e20), 1e20)
self.assertEqual(round(-1.0), -1.0)
self.assertEqual(round(-10.0), -10.0)
self.assertEqual(round(-1000000000.0), -1000000000.0)
self.assertEqual(round(-1e20), -1e20)
self.assertEqual(round(0.1), 0.0)
self.assertEqual(round(1.1), 1.0)
self.assertEqual(round(10.1), 10.0)
self.assertEqual(round(1000000000.1), 1000000000.0)
self.assertEqual(round(-1.1), -1.0)
self.assertEqual(round(-10.1), -10.0)
self.assertEqual(round(-1000000000.1), -1000000000.0)
self.assertEqual(round(0.9), 1.0)
self.assertEqual(round(9.9), 10.0)
self.assertEqual(round(999999999.9), 1000000000.0)
self.assertEqual(round(-0.9), -1.0)
self.assertEqual(round(-9.9), -10.0)
self.assertEqual(round(-999999999.9), -1000000000.0)
self.assertEqual(round(-8.0, -1), -10.0)
self.assertEqual(type(round(-8.0, -1)), float)
self.assertEqual(type(round(-8.0, 0)), float)
self.assertEqual(type(round(-8.0, 1)), float)
# Check even / odd rounding behaviour
self.assertEqual(round(5.5), 6)
self.assertEqual(round(6.5), 6)
self.assertEqual(round(-5.5), -6)
self.assertEqual(round(-6.5), -6)
# Check behavior on ints
self.assertEqual(round(0), 0)
self.assertEqual(round(8), 8)
self.assertEqual(round(-8), -8)
self.assertEqual(type(round(0)), int)
self.assertEqual(type(round(-8, -1)), int)
self.assertEqual(type(round(-8, 0)), int)
self.assertEqual(type(round(-8, 1)), int)
# test new kwargs
self.assertEqual(round(number=-8.0, ndigits=-1), -10.0)
self.assertRaises(TypeError, round)
# test generic rounding delegation for reals
class TestRound:
def __round__(self):
return 23
class TestNoRound:
pass
self.assertEqual(round(TestRound()), 23)
self.assertRaises(TypeError, round, 1, 2, 3)
self.assertRaises(TypeError, round, TestNoRound())
t = TestNoRound()
t.__round__ = lambda *args: args
self.assertRaises(TypeError, round, t)
self.assertRaises(TypeError, round, t, 0)
# Some versions of glibc for alpha have a bug that affects
# float -> integer rounding (floor, ceil, rint, round) for
# values in the range [2**52, 2**53). See:
#
# http://sources.redhat.com/bugzilla/show_bug.cgi?id=5350
#
# We skip this test on Linux/alpha if it would fail.
linux_alpha = (platform.system().startswith('Linux') and
platform.machine().startswith('alpha'))
system_round_bug = round(5e15+1) != 5e15+1
@unittest.skipIf(linux_alpha and system_round_bug,
"test will fail; failure is probably due to a "
"buggy system round function")
def test_round_large(self):
# Issue #1869: integral floats should remain unchanged
self.assertEqual(round(5e15-1), 5e15-1)
self.assertEqual(round(5e15), 5e15)
self.assertEqual(round(5e15+1), 5e15+1)
self.assertEqual(round(5e15+2), 5e15+2)
self.assertEqual(round(5e15+3), 5e15+3)
def test_setattr(self):
setattr(sys, 'spam', 1)
self.assertEqual(sys.spam, 1)
self.assertRaises(TypeError, setattr, sys, 1, 'spam')
self.assertRaises(TypeError, setattr)
# test_str(): see test_unicode.py and test_bytes.py for str() tests.
def test_sum(self):
self.assertEqual(sum([]), 0)
self.assertEqual(sum(list(range(2,8))), 27)
self.assertEqual(sum(iter(list(range(2,8)))), 27)
self.assertEqual(sum(Squares(10)), 285)
self.assertEqual(sum(iter(Squares(10))), 285)
self.assertEqual(sum([[1], [2], [3]], []), [1, 2, 3])
self.assertRaises(TypeError, sum)
self.assertRaises(TypeError, sum, 42)
self.assertRaises(TypeError, sum, ['a', 'b', 'c'])
self.assertRaises(TypeError, sum, ['a', 'b', 'c'], '')
self.assertRaises(TypeError, sum, [b'a', b'c'], b'')
values = [bytearray(b'a'), bytearray(b'b')]
self.assertRaises(TypeError, sum, values, bytearray(b''))
self.assertRaises(TypeError, sum, [[1], [2], [3]])
self.assertRaises(TypeError, sum, [{2:3}])
self.assertRaises(TypeError, sum, [{2:3}]*2, {2:3})
class BadSeq:
def __getitem__(self, index):
raise ValueError
self.assertRaises(ValueError, sum, BadSeq())
empty = []
sum(([x] for x in range(10)), empty)
self.assertEqual(empty, [])
def test_type(self):
self.assertEqual(type(''), type('123'))
self.assertNotEqual(type(''), type(()))
# We don't want self in vars(), so these are static methods
@staticmethod
def get_vars_f0():
return vars()
@staticmethod
def get_vars_f2():
BuiltinTest.get_vars_f0()
a = 1
b = 2
return vars()
class C_get_vars(object):
def getDict(self):
return {'a':2}
__dict__ = property(fget=getDict)
def test_vars(self):
self.assertEqual(set(vars()), set(dir()))
self.assertEqual(set(vars(sys)), set(dir(sys)))
self.assertEqual(self.get_vars_f0(), {})
self.assertEqual(self.get_vars_f2(), {'a': 1, 'b': 2})
self.assertRaises(TypeError, vars, 42, 42)
self.assertRaises(TypeError, vars, 42)
self.assertEqual(vars(self.C_get_vars()), {'a':2})
def test_zip(self):
a = (1, 2, 3)
b = (4, 5, 6)
t = [(1, 4), (2, 5), (3, 6)]
self.assertEqual(list(zip(a, b)), t)
b = [4, 5, 6]
self.assertEqual(list(zip(a, b)), t)
b = (4, 5, 6, 7)
self.assertEqual(list(zip(a, b)), t)
class I:
def __getitem__(self, i):
if i < 0 or i > 2: raise IndexError
return i + 4
self.assertEqual(list(zip(a, I())), t)
self.assertEqual(list(zip()), [])
self.assertEqual(list(zip(*[])), [])
self.assertRaises(TypeError, zip, None)
class G:
pass
self.assertRaises(TypeError, zip, a, G())
self.assertRaises(RuntimeError, zip, a, TestFailingIter())
# Make sure zip doesn't try to allocate a billion elements for the
# result list when one of its arguments doesn't say how long it is.
# A MemoryError is the most likely failure mode.
class SequenceWithoutALength:
def __getitem__(self, i):
if i == 5:
raise IndexError
else:
return i
self.assertEqual(
list(zip(SequenceWithoutALength(), range(2**30))),
list(enumerate(range(5)))
)
class BadSeq:
def __getitem__(self, i):
if i == 5:
raise ValueError
else:
return i
self.assertRaises(ValueError, list, zip(BadSeq(), BadSeq()))
def test_zip_pickle(self):
a = (1, 2, 3)
b = (4, 5, 6)
t = [(1, 4), (2, 5), (3, 6)]
z1 = zip(a, b)
self.check_iter_pickle(z1, t)
def test_format(self):
# Test the basic machinery of the format() builtin. Don't test
# the specifics of the various formatters
self.assertEqual(format(3, ''), '3')
# Returns some classes to use for various tests. There's
# an old-style version, and a new-style version
def classes_new():
class A(object):
def __init__(self, x):
self.x = x
def __format__(self, format_spec):
return str(self.x) + format_spec
class DerivedFromA(A):
pass
class Simple(object): pass
class DerivedFromSimple(Simple):
def __init__(self, x):
self.x = x
def __format__(self, format_spec):
return str(self.x) + format_spec
class DerivedFromSimple2(DerivedFromSimple): pass
return A, DerivedFromA, DerivedFromSimple, DerivedFromSimple2
def class_test(A, DerivedFromA, DerivedFromSimple, DerivedFromSimple2):
self.assertEqual(format(A(3), 'spec'), '3spec')
self.assertEqual(format(DerivedFromA(4), 'spec'), '4spec')
self.assertEqual(format(DerivedFromSimple(5), 'abc'), '5abc')
self.assertEqual(format(DerivedFromSimple2(10), 'abcdef'),
'10abcdef')
class_test(*classes_new())
def empty_format_spec(value):
# test that:
# format(x, '') == str(x)
# format(x) == str(x)
self.assertEqual(format(value, ""), str(value))
self.assertEqual(format(value), str(value))
# for builtin types, format(x, "") == str(x)
empty_format_spec(17**13)
empty_format_spec(1.0)
empty_format_spec(3.1415e104)
empty_format_spec(-3.1415e104)
empty_format_spec(3.1415e-104)
empty_format_spec(-3.1415e-104)
empty_format_spec(object)
empty_format_spec(None)
# TypeError because self.__format__ returns the wrong type
class BadFormatResult:
def __format__(self, format_spec):
return 1.0
self.assertRaises(TypeError, format, BadFormatResult(), "")
# TypeError because format_spec is not unicode or str
self.assertRaises(TypeError, format, object(), 4)
self.assertRaises(TypeError, format, object(), object())
# tests for object.__format__ really belong elsewhere, but
# there's no good place to put them
x = object().__format__('')
self.assertTrue(x.startswith('<object object at'))
# first argument to object.__format__ must be string
self.assertRaises(TypeError, object().__format__, 3)
self.assertRaises(TypeError, object().__format__, object())
self.assertRaises(TypeError, object().__format__, None)
# --------------------------------------------------------------------
# Issue #7994: object.__format__ with a non-empty format string is
# deprecated
def test_deprecated_format_string(obj, fmt_str, should_raise):
if should_raise:
self.assertRaises(TypeError, format, obj, fmt_str)
else:
format(obj, fmt_str)
fmt_strs = ['', 's']
class A:
def __format__(self, fmt_str):
return format('', fmt_str)
for fmt_str in fmt_strs:
test_deprecated_format_string(A(), fmt_str, False)
class B:
pass
class C(object):
pass
for cls in [object, B, C]:
for fmt_str in fmt_strs:
test_deprecated_format_string(cls(), fmt_str, len(fmt_str) != 0)
# --------------------------------------------------------------------
# make sure we can take a subclass of str as a format spec
class DerivedFromStr(str): pass
self.assertEqual(format(0, DerivedFromStr('10')), ' 0')
def test_bin(self):
self.assertEqual(bin(0), '0b0')
self.assertEqual(bin(1), '0b1')
self.assertEqual(bin(-1), '-0b1')
self.assertEqual(bin(2**65), '0b1' + '0' * 65)
self.assertEqual(bin(2**65-1), '0b' + '1' * 65)
self.assertEqual(bin(-(2**65)), '-0b1' + '0' * 65)
self.assertEqual(bin(-(2**65-1)), '-0b' + '1' * 65)
def test_bytearray_translate(self):
x = bytearray(b"abc")
self.assertRaises(ValueError, x.translate, b"1", 1)
self.assertRaises(TypeError, x.translate, b"1"*256, 1)
def test_construct_singletons(self):
for const in None, Ellipsis, NotImplemented:
tp = type(const)
self.assertIs(tp(), const)
self.assertRaises(TypeError, tp, 1, 2)
self.assertRaises(TypeError, tp, a=1, b=2)
class TestSorted(unittest.TestCase):
def test_basic(self):
data = list(range(100))
copy = data[:]
random.shuffle(copy)
self.assertEqual(data, sorted(copy))
self.assertNotEqual(data, copy)
data.reverse()
random.shuffle(copy)
self.assertEqual(data, sorted(copy, key=lambda x: -x))
self.assertNotEqual(data, copy)
random.shuffle(copy)
self.assertEqual(data, sorted(copy, reverse=1))
self.assertNotEqual(data, copy)
def test_inputtypes(self):
s = 'abracadabra'
types = [list, tuple, str]
for T in types:
self.assertEqual(sorted(s), sorted(T(s)))
s = ''.join(set(s)) # unique letters only
types = [str, set, frozenset, list, tuple, dict.fromkeys]
for T in types:
self.assertEqual(sorted(s), sorted(T(s)))
def test_baddecorator(self):
data = 'The quick Brown fox Jumped over The lazy Dog'.split()
self.assertRaises(TypeError, sorted, data, None, lambda x,y: 0)
class ShutdownTest(unittest.TestCase):
def test_cleanup(self):
# Issue #19255: builtins are still available at shutdown
code = """if 1:
import builtins
import sys
class C:
def __del__(self):
print("before")
# Check that builtins still exist
len(())
print("after")
c = C()
# Make this module survive until builtins and sys are cleaned
builtins.here = sys.modules[__name__]
sys.here = sys.modules[__name__]
# Create a reference loop so that this module needs to go
# through a GC phase.
here = sys.modules[__name__]
"""
# Issue #20599: Force ASCII encoding to get a codec implemented in C,
# otherwise the codec may be unloaded before C.__del__() is called, and
# so print("before") fails because the codec cannot be used to encode
# "before" to sys.stdout.encoding. For example, on Windows,
# sys.stdout.encoding is the OEM code page and these code pages are
# implemented in Python
rc, out, err = assert_python_ok("-c", code,
PYTHONIOENCODING="ascii")
self.assertEqual(["before", "after"], out.decode().splitlines())
def load_tests(loader, tests, pattern):
from doctest import DocTestSuite
tests.addTest(DocTestSuite(builtins))
return tests
if __name__ == "__main__":
unittest.main()
|
lgpl-3.0
|
[
3,
2018,
511,
663,
1553,
6137,
13,
262,
3423,
199,
199,
646,
6073,
199,
646,
12963,
199,
646,
5055,
199,
646,
5890,
199,
646,
5867,
199,
646,
747,
199,
646,
5927,
199,
646,
4298,
199,
646,
2196,
199,
646,
984,
199,
646,
5190,
199,
646,
2943,
199,
646,
2882,
199,
646,
3598,
199,
504,
4182,
492,
14158,
199,
504,
511,
14,
4058,
492,
25788,
12,
17002,
12,
221,
1255,
63,
2796,
12,
1104,
63,
5451,
199,
504,
511,
14,
1579,
63,
3676,
492,
702,
63,
1548,
63,
745,
199,
893,
26,
272,
492,
31237,
12,
4673,
199,
2590,
3545,
26,
272,
31237,
275,
4673,
275,
488,
421,
199,
533,
428,
392,
11044,
26,
339,
347,
636,
826,
721,
277,
12,
1390,
304,
267,
291,
14,
988,
275,
1390,
267,
291,
14,
1152,
15315,
275,
942,
339,
347,
636,
552,
721,
277,
304,
372,
822,
8,
277,
14,
1152,
15315,
9,
339,
347,
636,
6095,
721,
277,
12,
284,
304,
267,
340,
440,
378,
2695,
284,
665,
291,
14,
988,
26,
746,
7888,
267,
302,
275,
822,
8,
277,
14,
1152,
15315,
9,
267,
1830,
302,
2695,
284,
26,
288,
291,
14,
1152,
15315,
14,
740,
8,
78,
10,
78,
9,
288,
302,
847,
413,
267,
372,
291,
14,
1152,
15315,
59,
73,
61,
199,
199,
533,
8303,
51,
392,
11044,
26,
339,
347,
636,
826,
721,
277,
12,
1390,
304,
267,
291,
14,
988,
275,
1390,
267,
291,
14,
1152,
15315,
275,
942,
339,
347,
636,
552,
721,
277,
304,
267,
372,
822,
8,
277,
14,
1152,
15315,
9,
339,
347,
636,
6095,
721,
277,
12,
284,
304,
267,
340,
440,
378,
2695,
284,
665,
291,
14,
988,
26,
288,
746,
7888,
267,
302,
275,
822,
8,
277,
14,
1152,
15315,
9,
267,
1830,
302,
2695,
284,
26,
288,
291,
14,
1152,
15315,
14,
740,
8,
495,
8,
78,
10,
78,
430,
288,
302,
847,
413,
267,
372,
291,
14,
1152,
15315,
59,
73,
61,
199,
199,
533,
10199,
12311,
26,
272,
347,
2218,
8,
277,
12,
1004,
304,
267,
986,
199,
199,
396,
63,
5598,
63,
889,
63,
1037,
275,
359,
267,
661,
16,
297,
378,
395,
267,
661,
17,
297,
413,
395,
267,
661,
25,
297,
1749,
395,
267,
661,
709,
297,
1616,
395,
267,
661,
1020,
297,
8806,
395,
267,
661,
1960,
297,
2948,
395,
267,
661,
8988,
297,
29182,
395,
267,
661,
29182,
297,
29182,
395,
267,
661,
8988,
1656,
29182,
395,
267,
661,
221,
971,
84,
60,
84,
221,
29182,
221,
971,
84,
60,
84,
221,
1656,
29182,
395,
267,
334,
2722,
8,
1274,
14,
13634,
395,
984,
14,
13634,
395,
267,
661,
221,
413,
88,
297,
1722,
395,
267,
661,
221,
413,
221,
1656,
413,
395,
267,
661,
221,
413,
60,
996,
221,
1656,
1722,
395,
267,
13134,
1722,
395,
267,
661,
1656,
1722,
395,
267,
661,
221,
971,
84,
60,
84,
221,
1656,
1722,
395,
267,
334,
495,
8,
66,
1154,
85,
14045,
19,
60,
85,
14045,
17,
60,
85,
1690,
772,
13647,
1773,
13,
2975,
13,
3765,
659,
29182,
395,
267,
334,
10194,
8,
16,
88,
1840,
395,
1722,
395,
199,
61,
199,
199,
396,
63,
5598,
63,
1037,
275,
359,
267,
661,
16,
297,
378,
395,
267,
661,
17,
297,
413,
395,
267,
661,
25,
297,
1749,
395,
267,
661,
709,
297,
1616,
395,
267,
661,
1020,
297,
8806,
395,
267,
661,
1960,
297,
2948,
395,
267,
661,
8988,
297,
29182,
395,
267,
661,
29182,
297,
1722,
395,
267,
661,
8988,
1656,
29182,
395,
267,
661,
221,
971,
84,
60,
84,
221,
29182,
221,
971,
84,
60,
84,
221,
1656,
1722,
395,
267,
334,
2722,
8,
1274,
14,
13634,
395,
984,
14,
13634,
395,
267,
661,
221,
413,
88,
297,
1722,
395,
267,
661,
221,
413,
221,
1656,
1722,
395,
267,
661,
221,
413,
60,
996,
221,
1656,
1722,
395,
267,
13134,
1722,
395,
267,
661,
1656,
1722,
395,
267,
661,
221,
971,
84,
60,
84,
221,
1656,
1722,
395,
267,
334,
495,
8,
66,
1154,
85,
14045,
19,
60,
85,
14045,
17,
60,
85,
1690,
772,
13647,
1773,
13,
2975,
13,
3765,
659,
29182,
395,
267,
334,
10194,
8,
16,
88,
1840,
395,
1722,
395,
199,
61,
199,
199,
533,
1379,
4874,
316,
10349,
26,
272,
347,
636,
2245,
721,
277,
304,
267,
746,
6064,
199,
199,
533,
1379,
4874,
316,
3315,
26,
272,
347,
636,
1661,
721,
277,
304,
267,
746,
6064,
199,
199,
318,
2457,
63,
1560,
8,
1273,
304,
272,
372,
6206,
8,
1273,
9,
690,
6206,
480,
68,
531,
199,
199,
318,
2341,
63,
1560,
8,
1273,
304,
272,
372,
8678,
8,
2181,
8,
1273,
6393,
17,
9,
199,
199,
533,
22422,
774,
8,
2796,
14,
1746,
304,
272,
327,
11642,
370,
1104,
3732,
76,
3616,
272,
347,
1104,
63,
1661,
63,
8092,
8,
277,
12,
652,
12,
5412,
304,
267,
652,
1308,
275,
652,
267,
366,
275,
5927,
14,
4180,
8,
390,
9,
267,
652,
275,
5927,
14,
3640,
8,
68,
9,
267,
291,
14,
629,
8,
466,
8,
390,
1308,
395,
730,
8,
390,
430,
267,
291,
14,
629,
8,
513,
8,
390,
395,
5412,
9,
398,
327,
396,
314,
6122,
2410,
366,
20148,
1373,
687,
652,
267,
652,
275,
5927,
14,
3640,
8,
68,
9,
267,
862,
26,
288,
2163,
8,
390,
9,
267,
871,
10852,
26,
288,
372,
267,
366,
275,
5927,
14,
4180,
8,
390,
9,
267,
652,
275,
5927,
14,
3640,
8,
68,
9,
267,
291,
14,
629,
8,
513,
8,
390,
395,
5412,
59,
17,
5728,
339,
347,
511,
63,
646,
8,
277,
304,
267,
636,
646,
19734,
1274,
358,
267,
636,
646,
19734,
521,
358,
267,
636,
646,
19734,
875,
358,
267,
636,
646,
721,
354,
534,
1274,
358,
267,
636,
646,
721,
354,
534,
521,
297,
2166,
29,
16,
9,
267,
291,
14,
1855,
8,
17825,
12,
636,
646,
3108,
283,
3770,
706,
28024,
358,
267,
291,
14,
1855,
8,
4333,
12,
636,
646,
3108,
413,
12,
499,
12,
650,
12,
841,
9,
267,
291,
14,
1855,
8,
3393,
12,
636,
646,
3108,
4074,
267,
291,
14,
1855,
8,
4333,
12,
636,
646,
3108,
283,
1274,
297,
536,
534,
1274,
358
] |
[
2018,
511,
663,
1553,
6137,
13,
262,
3423,
199,
199,
646,
6073,
199,
646,
12963,
199,
646,
5055,
199,
646,
5890,
199,
646,
5867,
199,
646,
747,
199,
646,
5927,
199,
646,
4298,
199,
646,
2196,
199,
646,
984,
199,
646,
5190,
199,
646,
2943,
199,
646,
2882,
199,
646,
3598,
199,
504,
4182,
492,
14158,
199,
504,
511,
14,
4058,
492,
25788,
12,
17002,
12,
221,
1255,
63,
2796,
12,
1104,
63,
5451,
199,
504,
511,
14,
1579,
63,
3676,
492,
702,
63,
1548,
63,
745,
199,
893,
26,
272,
492,
31237,
12,
4673,
199,
2590,
3545,
26,
272,
31237,
275,
4673,
275,
488,
421,
199,
533,
428,
392,
11044,
26,
339,
347,
636,
826,
721,
277,
12,
1390,
304,
267,
291,
14,
988,
275,
1390,
267,
291,
14,
1152,
15315,
275,
942,
339,
347,
636,
552,
721,
277,
304,
372,
822,
8,
277,
14,
1152,
15315,
9,
339,
347,
636,
6095,
721,
277,
12,
284,
304,
267,
340,
440,
378,
2695,
284,
665,
291,
14,
988,
26,
746,
7888,
267,
302,
275,
822,
8,
277,
14,
1152,
15315,
9,
267,
1830,
302,
2695,
284,
26,
288,
291,
14,
1152,
15315,
14,
740,
8,
78,
10,
78,
9,
288,
302,
847,
413,
267,
372,
291,
14,
1152,
15315,
59,
73,
61,
199,
199,
533,
8303,
51,
392,
11044,
26,
339,
347,
636,
826,
721,
277,
12,
1390,
304,
267,
291,
14,
988,
275,
1390,
267,
291,
14,
1152,
15315,
275,
942,
339,
347,
636,
552,
721,
277,
304,
267,
372,
822,
8,
277,
14,
1152,
15315,
9,
339,
347,
636,
6095,
721,
277,
12,
284,
304,
267,
340,
440,
378,
2695,
284,
665,
291,
14,
988,
26,
288,
746,
7888,
267,
302,
275,
822,
8,
277,
14,
1152,
15315,
9,
267,
1830,
302,
2695,
284,
26,
288,
291,
14,
1152,
15315,
14,
740,
8,
495,
8,
78,
10,
78,
430,
288,
302,
847,
413,
267,
372,
291,
14,
1152,
15315,
59,
73,
61,
199,
199,
533,
10199,
12311,
26,
272,
347,
2218,
8,
277,
12,
1004,
304,
267,
986,
199,
199,
396,
63,
5598,
63,
889,
63,
1037,
275,
359,
267,
661,
16,
297,
378,
395,
267,
661,
17,
297,
413,
395,
267,
661,
25,
297,
1749,
395,
267,
661,
709,
297,
1616,
395,
267,
661,
1020,
297,
8806,
395,
267,
661,
1960,
297,
2948,
395,
267,
661,
8988,
297,
29182,
395,
267,
661,
29182,
297,
29182,
395,
267,
661,
8988,
1656,
29182,
395,
267,
661,
221,
971,
84,
60,
84,
221,
29182,
221,
971,
84,
60,
84,
221,
1656,
29182,
395,
267,
334,
2722,
8,
1274,
14,
13634,
395,
984,
14,
13634,
395,
267,
661,
221,
413,
88,
297,
1722,
395,
267,
661,
221,
413,
221,
1656,
413,
395,
267,
661,
221,
413,
60,
996,
221,
1656,
1722,
395,
267,
13134,
1722,
395,
267,
661,
1656,
1722,
395,
267,
661,
221,
971,
84,
60,
84,
221,
1656,
1722,
395,
267,
334,
495,
8,
66,
1154,
85,
14045,
19,
60,
85,
14045,
17,
60,
85,
1690,
772,
13647,
1773,
13,
2975,
13,
3765,
659,
29182,
395,
267,
334,
10194,
8,
16,
88,
1840,
395,
1722,
395,
199,
61,
199,
199,
396,
63,
5598,
63,
1037,
275,
359,
267,
661,
16,
297,
378,
395,
267,
661,
17,
297,
413,
395,
267,
661,
25,
297,
1749,
395,
267,
661,
709,
297,
1616,
395,
267,
661,
1020,
297,
8806,
395,
267,
661,
1960,
297,
2948,
395,
267,
661,
8988,
297,
29182,
395,
267,
661,
29182,
297,
1722,
395,
267,
661,
8988,
1656,
29182,
395,
267,
661,
221,
971,
84,
60,
84,
221,
29182,
221,
971,
84,
60,
84,
221,
1656,
1722,
395,
267,
334,
2722,
8,
1274,
14,
13634,
395,
984,
14,
13634,
395,
267,
661,
221,
413,
88,
297,
1722,
395,
267,
661,
221,
413,
221,
1656,
1722,
395,
267,
661,
221,
413,
60,
996,
221,
1656,
1722,
395,
267,
13134,
1722,
395,
267,
661,
1656,
1722,
395,
267,
661,
221,
971,
84,
60,
84,
221,
1656,
1722,
395,
267,
334,
495,
8,
66,
1154,
85,
14045,
19,
60,
85,
14045,
17,
60,
85,
1690,
772,
13647,
1773,
13,
2975,
13,
3765,
659,
29182,
395,
267,
334,
10194,
8,
16,
88,
1840,
395,
1722,
395,
199,
61,
199,
199,
533,
1379,
4874,
316,
10349,
26,
272,
347,
636,
2245,
721,
277,
304,
267,
746,
6064,
199,
199,
533,
1379,
4874,
316,
3315,
26,
272,
347,
636,
1661,
721,
277,
304,
267,
746,
6064,
199,
199,
318,
2457,
63,
1560,
8,
1273,
304,
272,
372,
6206,
8,
1273,
9,
690,
6206,
480,
68,
531,
199,
199,
318,
2341,
63,
1560,
8,
1273,
304,
272,
372,
8678,
8,
2181,
8,
1273,
6393,
17,
9,
199,
199,
533,
22422,
774,
8,
2796,
14,
1746,
304,
272,
327,
11642,
370,
1104,
3732,
76,
3616,
272,
347,
1104,
63,
1661,
63,
8092,
8,
277,
12,
652,
12,
5412,
304,
267,
652,
1308,
275,
652,
267,
366,
275,
5927,
14,
4180,
8,
390,
9,
267,
652,
275,
5927,
14,
3640,
8,
68,
9,
267,
291,
14,
629,
8,
466,
8,
390,
1308,
395,
730,
8,
390,
430,
267,
291,
14,
629,
8,
513,
8,
390,
395,
5412,
9,
398,
327,
396,
314,
6122,
2410,
366,
20148,
1373,
687,
652,
267,
652,
275,
5927,
14,
3640,
8,
68,
9,
267,
862,
26,
288,
2163,
8,
390,
9,
267,
871,
10852,
26,
288,
372,
267,
366,
275,
5927,
14,
4180,
8,
390,
9,
267,
652,
275,
5927,
14,
3640,
8,
68,
9,
267,
291,
14,
629,
8,
513,
8,
390,
395,
5412,
59,
17,
5728,
339,
347,
511,
63,
646,
8,
277,
304,
267,
636,
646,
19734,
1274,
358,
267,
636,
646,
19734,
521,
358,
267,
636,
646,
19734,
875,
358,
267,
636,
646,
721,
354,
534,
1274,
358,
267,
636,
646,
721,
354,
534,
521,
297,
2166,
29,
16,
9,
267,
291,
14,
1855,
8,
17825,
12,
636,
646,
3108,
283,
3770,
706,
28024,
358,
267,
291,
14,
1855,
8,
4333,
12,
636,
646,
3108,
413,
12,
499,
12,
650,
12,
841,
9,
267,
291,
14,
1855,
8,
3393,
12,
636,
646,
3108,
4074,
267,
291,
14,
1855,
8,
4333,
12,
636,
646,
3108,
283,
1274,
297,
536,
534,
1274,
358,
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,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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
] |
abhitopia/tensorflow
|
tensorflow/python/ops/special_math_ops.py
|
13
|
17117
|
# 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.
# ==============================================================================
"""Arithmetic Operations that don't fit into math_ops due to dependencies.
To avoid circular dependencies, some math_ops should go here. Documentation
callouts, e.g. "@@my_op" should go in math_ops. To the user, these are just
normal math_ops.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
from six.moves import xrange # pylint: disable=redefined-builtin
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.platform import tf_logging as logging
# TODO(b/27419586) Change docstring for required dtype of x once int allowed
def lbeta(x, name='lbeta'):
r"""Computes `ln(|Beta(x)|)`, reducing along the last dimension.
Given one-dimensional `z = [z_0,...,z_{K-1}]`, we define
```Beta(z) = \prod_j Gamma(z_j) / Gamma(\sum_j z_j)```
And for `n + 1` dimensional `x` with shape `[N1, ..., Nn, K]`, we define
`lbeta(x)[i1, ..., in] = Log(|Beta(x[i1, ..., in, :])|)`. In other words,
the last dimension is treated as the `z` vector.
Note that if `z = [u, v]`, then
`Beta(z) = int_0^1 t^{u-1} (1 - t)^{v-1} dt`, which defines the traditional
bivariate beta function.
If the last dimension is empty, we follow the convention that the sum over
the empty set is zero, and the product is one.
Args:
x: A rank `n + 1` `Tensor`, `n >= 0` with type `float`, or `double`.
name: A name for the operation (optional).
Returns:
The logarithm of `|Beta(x)|` reducing along the last dimension.
"""
# In the event that the last dimension has zero entries, we return -inf.
# This is consistent with a convention that the sum over the empty set 0, and
# the product is 1.
# This is standard. See https://en.wikipedia.org/wiki/Empty_set.
with ops.name_scope(name, values=[x]):
x = ops.convert_to_tensor(x, name='x')
# Note reduce_sum([]) = 0.
log_prod_gamma_x = math_ops.reduce_sum(
math_ops.lgamma(x), reduction_indices=[-1])
# Note lgamma(0) = infinity, so if x = []
# log_gamma_sum_x = lgamma(0) = infinity, and
# log_prod_gamma_x = lgamma(1) = 0,
# so result = -infinity
sum_x = math_ops.reduce_sum(x, axis=[-1])
log_gamma_sum_x = math_ops.lgamma(sum_x)
result = log_prod_gamma_x - log_gamma_sum_x
return result
def einsum(equation, *inputs):
"""A generalized contraction between tensors of arbitrary dimension.
This function returns a tensor whose elements are defined by `equation`,
which is written in a shorthand form inspired by the Einstein summation
convention. As an example, consider multiplying two matrices
A and B to form a matrix C. The elements of C are given by:
```
C[i,k] = sum_j A[i,j] * B[j,k]
```
The corresponding `equation` is:
```
ij,jk->ik
```
In general, the `equation` is obtained from the more familiar element-wise
equation by
1. removing variable names, brackets, and commas,
2. replacing "*" with ",",
3. dropping summation signs, and
4. moving the output to the right, and replacing "=" with "->".
Many common operations can be expressed in this way. For example:
```python
# Matrix multiplication
>>> einsum('ij,jk->ik', m0, m1) # output[i,k] = sum_j m0[i,j] * m1[j, k]
# Dot product
>>> einsum('i,i->', u, v) # output = sum_i u[i]*v[i]
# Outer product
>>> einsum('i,j->ij', u, v) # output[i,j] = u[i]*v[j]
# Transpose
>>> einsum('ij->ji', m) # output[j,i] = m[i,j]
# Batch matrix multiplication
>>> einsum('aij,ajk->aik', s, t) # out[a,i,k] = sum_j s[a,i,j] * t[a, j, k]
```
This function behaves like `numpy.einsum`, but does not support:
* Ellipses (subscripts like `ij...,jk...->ik...`)
* Subscripts where an axis appears more than once for a single input
(e.g. `ijj,k->ik`).
* Subscripts that are summed across multiple inputs (e.g., `ij,ij,jk->ik`).
Args:
equation: a `str` describing the contraction, in the same format as
`numpy.einsum`.
*inputs: the inputs to contract (each one a `Tensor`), whose shapes should
be consistent with `equation`.
Returns:
The contracted `Tensor`, with shape determined by `equation`.
Raises:
ValueError: If
- the format of `equation` is incorrect,
- the number of inputs implied by `equation` does not match `len(inputs)`,
- an axis appears in the output subscripts but not in any of the inputs,
- the number of dimensions of an input differs from the number of
indices in its subscript, or
- the input shapes are inconsistent along a particular axis.
"""
if '...' in equation:
raise ValueError('Subscripts with ellipses are not yet supported.')
match = re.match('([a-z,]+)(->[a-z]*)?', equation)
if not match:
raise ValueError(
'Indices have incorrect format: %s' % equation
)
inputs = list(inputs)
input_axis_labels = match.group(1).split(',')
if len(inputs) != len(input_axis_labels):
raise ValueError('Got %d arguments for equation "%s", expecting %d' % (
len(inputs), equation, len(input_axis_labels)))
axis_labels = set(''.join(input_axis_labels))
if match.group(2):
output_axis_labels = match.group(2)[2:]
else:
# infer the output subscripts if not given, assume alphabetical order
indices = ''.join(sorted(axis_labels))
counts = {ax: 0 for ax in indices}
for axes_ in input_axis_labels:
for ax in axes_:
counts[ax] += 1
output_axis_labels = ''.join(sorted(
ax for ax in indices
if counts[ax] == 1
))
for a in axis_labels:
input_count = sum(1 for s in input_axis_labels if a in s)
if input_count > 2 and a not in output_axis_labels:
logging.warn(
'Falling back to exponential-space implementation of einsum() because'
' index "%s" is summed over more than two inputs.', a)
return _exponential_space_einsum(equation, *inputs)
temp = inputs[0]
temp_axis_labels = input_axis_labels[0]
for i in xrange(len(inputs)-1):
axes_to_sum = (set(temp_axis_labels) & set(input_axis_labels[i+1])
- set(output_axis_labels))
temp, temp_axis_labels = _einsum_reduction(temp,
temp_axis_labels,
inputs[i+1],
input_axis_labels[i+1],
axes_to_sum)
missing_indices = set(temp_axis_labels) - set(output_axis_labels)
if missing_indices:
reduction_indices = [i for i, a in enumerate(temp_axis_labels)
if a not in output_axis_labels]
temp = math_ops.reduce_sum(temp, reduction_indices=reduction_indices)
temp_axis_labels = ''.join(a for a in temp_axis_labels
if a in output_axis_labels)
if sorted(temp_axis_labels) != sorted(output_axis_labels):
raise ValueError('Invalid equation: %s' % equation)
perm = [temp_axis_labels.index(a) for a in output_axis_labels]
return _transpose_if_necessary(temp, perm)
def _einsum_reduction(t0, t0_axis_labels, t1, t1_axis_labels, axes_to_sum):
"""Helper for einsum() that computes the result of a two-argument einsum().
Args:
t0: a `Tensor`
t0_axis_labels: a string of axis labels. This string's length must equal
the rank of t0.
t1: a `Tensor`
t1_axis_labels: a string to axis labels. This string's length must equal
the rank of t1.
axes_to_sum: set of labels of axes to be summed over
Returns:
A `Tensor` whose elements are obtained by summing, over all axes in
`axes_to_sum`, the corresponding elements of `t0` and `t1`.
For example, if t0_axis_labels == 'abijk', t1_axis_labels == 'acjkl', and
axes_to_sum == {j,k}, this will return a tensor x where
out[a,b,c,i,l] = sum_j sum_k t0[a,b,i,j,k] * t1[a,c,j,k,l]
Raises:
ValueError: if the rank of `t0` does not match the length of
`t0_axis_labels`, or that of `t1` does not match the length of
`t1_axis_labels`.
"""
if len(t0_axis_labels) != len(t0.get_shape()):
raise ValueError()
if len(t1_axis_labels) != len(t1.get_shape()):
raise ValueError()
# This function computes the result of a two-argument einsum() using batch
# matrix multiplication. This involves
# 1. transposing t0 and t1 so that axes are in the correct order for
# batch matrix multiplication, and
# 2. reshaping t0 and t1 so that they are both of rank 3.
# First, we divide axes into three groups:
# * "preserved" axes are present in both inputs and the output
# * "summed" axes are present in both inputs but not the output
# * "broadcast" axes are present in exactly one input and the output
#
# As an example, if the einsum is abijk,acjkl->abcil, then "a" is a
# preserved axis, "b" and "c" are broadcast axes, and "j" and "k" are
# summed axes.
assert all(a in t0_axis_labels and a in t1_axis_labels for a in axes_to_sum)
preserved_axes = (set(t0_axis_labels) & set(t1_axis_labels)) - axes_to_sum
broadcast_axes = {}
for i, sym_list in enumerate([t0_axis_labels, t1_axis_labels]):
broadcast_axes[i] = set(sym_list) - preserved_axes - axes_to_sum
# Reorder the axes so that:
# 1. preserved axes come first in both inputs
# 2. in input 0, broadcast axes come next, followed by summed axes
# 3. in input 1, summed axes come next, followed by broadcast axes
def sort_key(input_index, a):
if a in preserved_axes:
return (-1, a)
elif ((input_index == 0 and a in broadcast_axes[0]) or
(input_index == 1 and a in axes_to_sum)):
return (0, a)
else:
return (1, a)
axis_labels = [t0_axis_labels, t1_axis_labels]
sorted_axes = [sorted(sym_list, key=lambda a: sort_key(i, a))
for i, sym_list in enumerate(axis_labels)]
inputs = [t0, t1]
for i, axes_str in enumerate(axis_labels):
perm = [axes_str.find(a) for a in sorted_axes[i]]
inputs[i] = _transpose_if_necessary(inputs[i], perm)
t0, t1 = inputs
if not axes_to_sum:
# In the special case where there are no axes to sum over, reduce to mul()
# rather than to batch matrix multiplication.
for _ in broadcast_axes[1]:
t0 = array_ops.expand_dims(t0, -1)
for _ in broadcast_axes[0]:
t1 = array_ops.expand_dims(t1, len(preserved_axes))
product = math_ops.multiply(t0, t1)
product_axes = sorted_axes[0] + sorted_axes[1][len(preserved_axes):]
return product, ''.join(product_axes)
else:
# Reduce to matmul().
# Reshape both inputs so as to combine multiple broadcast axes
# into a single axis, and combine multiple summed axes into a
# single axis.
t0_shape = _get_shape(t0)
num_broadcast_elements_t0 = _total_size(
t0_shape[len(preserved_axes):-len(axes_to_sum)])
num_summed_elements = _total_size(t0_shape[-len(axes_to_sum):])
new_shape = (t0_shape[:len(preserved_axes)]
+ [num_broadcast_elements_t0, num_summed_elements])
t0 = _reshape_if_necessary(t0, new_shape)
t1_shape = _get_shape(t1)
num_broadcast_elements_t1 = _total_size(
t1_shape[len(preserved_axes)+len(axes_to_sum):])
new_shape = (t1_shape[:len(preserved_axes)]
+ [num_summed_elements, num_broadcast_elements_t1])
t1 = _reshape_if_necessary(t1, new_shape)
product = math_ops.matmul(t0, t1)
# Undo compaction of broadcast axes
uncompacted_shape = (
t0_shape[:len(preserved_axes)+len(broadcast_axes[0])]
+ t1_shape[len(t1_shape)-len(broadcast_axes[1]):]
)
product = _reshape_if_necessary(product, uncompacted_shape)
product_axes = (
sorted_axes[0][:len(preserved_axes)+len(broadcast_axes[0])] +
sorted_axes[1][len(sorted_axes[1])-len(broadcast_axes[1]):]
)
return product, ''.join(product_axes)
def _transpose_if_necessary(tensor, perm):
"""Like transpose(), but avoids creating a new tensor if possible."""
if perm != range(len(perm)):
return array_ops.transpose(tensor, perm=perm)
else:
return tensor
def _reshape_if_necessary(tensor, new_shape):
"""Like reshape(), but avoids creating a new tensor if possible."""
# Accept None as an alias for -1 in new_shape.
new_shape = tuple(-1 if x is None else x for x in new_shape)
cur_shape = tuple(x.value for x in tensor.get_shape())
if (len(new_shape) == len(cur_shape) and
all(d0 == d1 or d1 == -1 for d0, d1 in zip(cur_shape, new_shape))):
return tensor
else:
return array_ops.reshape(tensor, new_shape)
def _get_shape(tensor):
"""Like get_shape().as_list(), but explicitly queries the shape of a tensor
if necessary to ensure that the returned value contains no unknown value."""
shape = tensor.get_shape().as_list()
none_indices = [i for i, d in enumerate(shape) if d is None]
if none_indices:
# Query the shape if shape contains None values
shape_tensor = array_ops.shape(tensor)
for i in none_indices:
shape[i] = shape_tensor[i]
return shape
def _total_size(shape_values):
"""Given list of tensor shape values, returns total size.
If shape_values contains tensor values (which are results of
array_ops.shape), then it returns a scalar tensor.
If not, it returns an integer."""
result = 1
for val in shape_values:
result *= val
return result
def _exponential_space_einsum(equation, *inputs):
"""Fallback implementation that supports summing an index over > 2 inputs."""
if '...' in equation:
raise ValueError("Subscripts with ellipses are not yet supported.")
match = re.match('([a-z,]+)(->[a-z]*)?', equation)
if not match:
raise ValueError(
'Indices have incorrect format: %s' % equation
)
inputs = list(inputs)
idx_in = match.group(1).split(',')
idx_all = set(''.join(idx_in))
indices = ''.join(sorted(idx_all))
if match.group(2):
idx_out = match.group(2)[2:]
else:
# infer the output subscripts if not given, assume alphabetical order
counts = {ax: 0 for ax in indices}
for axes_ in idx_in:
for ax in axes_:
counts[ax] += 1
idx_out = ''.join(sorted(
ax for ax in indices
if counts[ax] == 1
))
if len(idx_in) != len(inputs):
raise ValueError(
'Expected %d inputs but got %d' % (len(idx_in), len(inputs))
)
missing_idx = set(idx_out).difference(idx_all)
if missing_idx:
raise ValueError(
'Unknown ouput axes: %s' % missing_idx
)
axis_order = {}
for ax in indices:
if ax not in idx_out:
axis_order[ax] = len(axis_order)
for ax in idx_out:
axis_order[ax] = len(axis_order)
# transpose inputs so axes are in order
for i, (input_, axes_) in enumerate(zip(inputs, idx_in)):
if input_.get_shape().ndims != len(axes_):
raise ValueError(
'Input %d with axes %s has incorrect' \
' number of dimensions (expected %d, got %d)' % (
i, axes_, len(axes_), input_.get_shape().ndims
)
)
sorted_idx = sorted(axes_, key=axis_order.get)
if len(set(axes_)) != len(axes_):
raise ValueError(
'Subscript not supported: an axis appears more than once: %s' % axes_
)
if list(axes_) != sorted_idx:
permuted = [axes_.find(ax) for ax in sorted_idx]
inputs[i] = array_ops.transpose(input_, permuted)
idx_in[i] = sorted_idx
reduction_idx = []
shapes = [[dim if dim else -1
for dim in tensor.get_shape().as_list()]
for tensor in inputs]
# validate shapes for broadcasting
for j, ax in enumerate(sorted(idx_all, key=axis_order.get)):
dims = []
for i, idx in enumerate(idx_in):
if ax not in idx:
shapes[i].insert(j, 1)
else:
dim = shapes[i][j]
if isinstance(dim, int) and dim > 1:
dims.append(dim)
if len(set(dims)) > 1:
raise ValueError(
'Dimension mismatch on axis: %s' % ax
)
if ax not in idx_out:
reduction_idx.append(j)
# reshape, multiply
expanded_inputs = [array_ops.reshape(input_, shape)
for input_, shape in zip(inputs, shapes)]
expanded_output = 1
for input_ in expanded_inputs:
expanded_output *= input_
# contract
return math_ops.reduce_sum(expanded_output, reduction_idx)
|
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,
26291,
18764,
29474,
626,
2793,
1133,
5542,
1901,
3473,
63,
1483,
7037,
370,
5124,
14,
199,
199,
1378,
5126,
15032,
5124,
12,
2005,
3473,
63,
1483,
1077,
2621,
2348,
14,
221,
15249,
199,
915,
320,
14608,
12,
325,
14,
71,
14,
298,
7492,
1662,
63,
411,
2,
1077,
2621,
315,
3473,
63,
1483,
14,
221,
4005,
314,
922,
12,
3520,
787,
2951,
199,
3302,
3473,
63,
1483,
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,
646,
295,
199,
199,
504,
3816,
14,
4912,
492,
4945,
221,
327,
4287,
26,
3507,
29,
27913,
13,
5351,
199,
199,
504,
3228,
14,
1548,
14,
4857,
492,
4156,
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,
3246,
492,
2833,
63,
4806,
465,
2050,
421,
199,
3,
3254,
8,
66,
15,
9014,
11874,
1184,
9,
7743,
9214,
367,
1415,
2152,
402,
671,
5403,
1109,
4370,
199,
318,
634,
5683,
8,
88,
12,
536,
534,
76,
5683,
735,
523,
519,
624,
22594,
658,
6066,
8,
92,
21732,
8,
88,
8636,
32124,
295,
14713,
3180,
314,
2061,
6240,
14,
819,
9138,
1373,
13,
13014,
658,
90,
275,
359,
90,
63,
16,
32699,
90,
7348,
43,
13,
17,
11049,
3559,
781,
5627,
819,
10841,
21732,
8,
90,
9,
275,
971,
8788,
63,
74,
598,
4746,
8,
90,
63,
74,
9,
1182,
598,
4746,
2961,
1838,
63,
74,
1315,
63,
74,
9719,
64,
819,
6061,
367,
658,
78,
435,
413,
64,
28341,
658,
88,
64,
543,
2215,
14505,
46,
17,
12,
14263,
653,
78,
12,
1804,
61,
3559,
781,
5627,
523,
658,
76,
5683,
8,
88,
2788,
73,
17,
12,
14263,
315,
61,
275,
5297,
8,
92,
21732,
8,
88,
59,
73,
17,
12,
14263,
315,
12,
520,
566,
92,
20414,
221,
1010,
1163,
5932,
12,
523,
314,
2061,
6240,
365,
10184,
465,
314,
658,
90,
64,
5477,
14,
819,
3390,
626,
340,
658,
90,
275,
359,
85,
12,
373,
61,
3559,
2066,
523,
658,
21732,
8,
90,
9,
275,
1109,
63,
16,
62,
17,
307,
11683,
85,
13,
17,
93,
334,
17,
446,
307,
9,
11683,
86,
13,
17,
93,
4487,
3559,
1314,
7890,
314,
1468,
2603,
523,
330,
23225,
8201,
805,
14,
819,
982,
314,
2061,
6240,
365,
2701,
12,
781,
2035,
314,
16129,
626,
314,
3089,
1806,
523,
314,
2701,
663,
365,
4697,
12,
436,
314,
3336,
365,
1373,
14,
819,
3033,
26,
272,
671,
26,
437,
6915,
658,
78,
435,
413,
64,
658,
3861,
3559,
658,
78,
2356,
378,
64,
543,
730,
658,
1609,
3559,
503,
658,
3157,
2313,
272,
536,
26,
437,
536,
367,
314,
3439,
334,
4144,
680,
819,
1803,
26,
272,
710,
943,
18327,
77,
402,
658,
92,
21732,
8,
88,
8636,
64,
295,
14713,
3180,
314,
2061,
6240,
14,
523,
408,
523,
327,
1010,
314,
1566,
626,
314,
2061,
6240,
965,
4697,
4811,
12,
781,
372,
446,
4904,
14,
523,
327,
961,
365,
12137,
543,
282,
16129,
626,
314,
3089,
1806,
314,
2701,
663,
378,
12,
436,
523,
327,
314,
3336,
365,
413,
14,
523,
327,
961,
365,
4465,
14,
221,
1666,
4178,
921,
287,
14,
13961,
14,
1308,
15,
6797,
15,
4699,
63,
409,
14,
523,
543,
4156,
14,
354,
63,
2645,
8,
354,
12,
1338,
1524,
88,
4682,
272,
671,
275,
4156,
14,
3916,
63,
475,
63,
3128,
8,
88,
12,
536,
534,
88,
358,
339,
327,
3390,
7114,
63,
1838,
4157,
275,
378,
14,
272,
943,
63,
8788,
63,
7325,
63,
88,
275,
3473,
63,
1483,
14,
5270,
63,
1838,
8,
267,
3473,
63,
1483,
14,
76,
7325,
8,
88,
395,
16773,
63,
4108,
1524,
13,
17,
566,
339,
327,
3390,
634,
7325,
8,
16,
9,
275,
23573,
12,
880,
340,
671,
275,
942,
272,
327,
943,
63,
7325,
63,
1838,
63,
88,
275,
634,
7325,
8,
16,
9,
275,
23573,
12,
436,
272,
327,
943,
63,
8788,
63,
7325,
63,
88,
275,
634,
7325,
8,
17,
9,
275,
378,
12,
272,
327,
880,
754,
275,
446,
262,
9693,
272,
3089,
63,
88,
275,
3473,
63,
1483,
14,
5270,
63,
1838,
8,
88,
12,
3114,
1524,
13,
17,
566,
272,
943,
63,
7325,
63,
1838,
63,
88,
275,
3473,
63,
1483,
14,
76,
7325,
8,
1838,
63,
88,
9,
272,
754,
275,
943,
63,
8788,
63,
7325,
63,
88,
446,
943,
63,
7325,
63,
1838,
63,
88,
339,
372,
754,
421,
199,
318,
325,
19788,
8,
27247,
12,
627,
3711,
304,
523,
408,
33,
8605,
1759,
18782,
414,
3382,
10519,
402,
9697,
6240,
14,
819,
961,
805,
2529,
282,
2345,
7447,
4008,
787,
3247,
701,
658,
27247,
3559,
523,
1314,
365,
5313,
315,
282,
1033,
23999,
1824,
315,
8721,
581,
701,
314,
662,
262,
1597,
262,
3089,
1615,
523,
16129,
14,
221,
3709,
376,
2893,
12,
11201,
8897,
6670,
2877,
12627,
523,
437,
436,
699,
370,
1824,
282,
3634,
445,
14,
221,
710,
4008,
402,
445,
787,
1627,
701,
26,
819,
10841,
272,
445,
59,
73,
12,
75,
61,
275,
3089,
63,
74,
437,
59,
73,
12,
74,
61,
627,
699,
59,
74,
12,
75,
61,
523,
10841,
819,
710,
5226,
658
] |
[
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,
26291,
18764,
29474,
626,
2793,
1133,
5542,
1901,
3473,
63,
1483,
7037,
370,
5124,
14,
199,
199,
1378,
5126,
15032,
5124,
12,
2005,
3473,
63,
1483,
1077,
2621,
2348,
14,
221,
15249,
199,
915,
320,
14608,
12,
325,
14,
71,
14,
298,
7492,
1662,
63,
411,
2,
1077,
2621,
315,
3473,
63,
1483,
14,
221,
4005,
314,
922,
12,
3520,
787,
2951,
199,
3302,
3473,
63,
1483,
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,
646,
295,
199,
199,
504,
3816,
14,
4912,
492,
4945,
221,
327,
4287,
26,
3507,
29,
27913,
13,
5351,
199,
199,
504,
3228,
14,
1548,
14,
4857,
492,
4156,
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,
3246,
492,
2833,
63,
4806,
465,
2050,
421,
199,
3,
3254,
8,
66,
15,
9014,
11874,
1184,
9,
7743,
9214,
367,
1415,
2152,
402,
671,
5403,
1109,
4370,
199,
318,
634,
5683,
8,
88,
12,
536,
534,
76,
5683,
735,
523,
519,
624,
22594,
658,
6066,
8,
92,
21732,
8,
88,
8636,
32124,
295,
14713,
3180,
314,
2061,
6240,
14,
819,
9138,
1373,
13,
13014,
658,
90,
275,
359,
90,
63,
16,
32699,
90,
7348,
43,
13,
17,
11049,
3559,
781,
5627,
819,
10841,
21732,
8,
90,
9,
275,
971,
8788,
63,
74,
598,
4746,
8,
90,
63,
74,
9,
1182,
598,
4746,
2961,
1838,
63,
74,
1315,
63,
74,
9719,
64,
819,
6061,
367,
658,
78,
435,
413,
64,
28341,
658,
88,
64,
543,
2215,
14505,
46,
17,
12,
14263,
653,
78,
12,
1804,
61,
3559,
781,
5627,
523,
658,
76,
5683,
8,
88,
2788,
73,
17,
12,
14263,
315,
61,
275,
5297,
8,
92,
21732,
8,
88,
59,
73,
17,
12,
14263,
315,
12,
520,
566,
92,
20414,
221,
1010,
1163,
5932,
12,
523,
314,
2061,
6240,
365,
10184,
465,
314,
658,
90,
64,
5477,
14,
819,
3390,
626,
340,
658,
90,
275,
359,
85,
12,
373,
61,
3559,
2066,
523,
658,
21732,
8,
90,
9,
275,
1109,
63,
16,
62,
17,
307,
11683,
85,
13,
17,
93,
334,
17,
446,
307,
9,
11683,
86,
13,
17,
93,
4487,
3559,
1314,
7890,
314,
1468,
2603,
523,
330,
23225,
8201,
805,
14,
819,
982,
314,
2061,
6240,
365,
2701,
12,
781,
2035,
314,
16129,
626,
314,
3089,
1806,
523,
314,
2701,
663,
365,
4697,
12,
436,
314,
3336,
365,
1373,
14,
819,
3033,
26,
272,
671,
26,
437,
6915,
658,
78,
435,
413,
64,
658,
3861,
3559,
658,
78,
2356,
378,
64,
543,
730,
658,
1609,
3559,
503,
658,
3157,
2313,
272,
536,
26,
437,
536,
367,
314,
3439,
334,
4144,
680,
819,
1803,
26,
272,
710,
943,
18327,
77,
402,
658,
92,
21732,
8,
88,
8636,
64,
295,
14713,
3180,
314,
2061,
6240,
14,
523,
408,
523,
327,
1010,
314,
1566,
626,
314,
2061,
6240,
965,
4697,
4811,
12,
781,
372,
446,
4904,
14,
523,
327,
961,
365,
12137,
543,
282,
16129,
626,
314,
3089,
1806,
314,
2701,
663,
378,
12,
436,
523,
327,
314,
3336,
365,
413,
14,
523,
327,
961,
365,
4465,
14,
221,
1666,
4178,
921,
287,
14,
13961,
14,
1308,
15,
6797,
15,
4699,
63,
409,
14,
523,
543,
4156,
14,
354,
63,
2645,
8,
354,
12,
1338,
1524,
88,
4682,
272,
671,
275,
4156,
14,
3916,
63,
475,
63,
3128,
8,
88,
12,
536,
534,
88,
358,
339,
327,
3390,
7114,
63,
1838,
4157,
275,
378,
14,
272,
943,
63,
8788,
63,
7325,
63,
88,
275,
3473,
63,
1483,
14,
5270,
63,
1838,
8,
267,
3473,
63,
1483,
14,
76,
7325,
8,
88,
395,
16773,
63,
4108,
1524,
13,
17,
566,
339,
327,
3390,
634,
7325,
8,
16,
9,
275,
23573,
12,
880,
340,
671,
275,
942,
272,
327,
943,
63,
7325,
63,
1838,
63,
88,
275,
634,
7325,
8,
16,
9,
275,
23573,
12,
436,
272,
327,
943,
63,
8788,
63,
7325,
63,
88,
275,
634,
7325,
8,
17,
9,
275,
378,
12,
272,
327,
880,
754,
275,
446,
262,
9693,
272,
3089,
63,
88,
275,
3473,
63,
1483,
14,
5270,
63,
1838,
8,
88,
12,
3114,
1524,
13,
17,
566,
272,
943,
63,
7325,
63,
1838,
63,
88,
275,
3473,
63,
1483,
14,
76,
7325,
8,
1838,
63,
88,
9,
272,
754,
275,
943,
63,
8788,
63,
7325,
63,
88,
446,
943,
63,
7325,
63,
1838,
63,
88,
339,
372,
754,
421,
199,
318,
325,
19788,
8,
27247,
12,
627,
3711,
304,
523,
408,
33,
8605,
1759,
18782,
414,
3382,
10519,
402,
9697,
6240,
14,
819,
961,
805,
2529,
282,
2345,
7447,
4008,
787,
3247,
701,
658,
27247,
3559,
523,
1314,
365,
5313,
315,
282,
1033,
23999,
1824,
315,
8721,
581,
701,
314,
662,
262,
1597,
262,
3089,
1615,
523,
16129,
14,
221,
3709,
376,
2893,
12,
11201,
8897,
6670,
2877,
12627,
523,
437,
436,
699,
370,
1824,
282,
3634,
445,
14,
221,
710,
4008,
402,
445,
787,
1627,
701,
26,
819,
10841,
272,
445,
59,
73,
12,
75,
61,
275,
3089,
63,
74,
437,
59,
73,
12,
74,
61,
627,
699,
59,
74,
12,
75,
61,
523,
10841,
819,
710,
5226,
658,
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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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
] |
JamesShaeffer/QGIS
|
tests/src/python/test_qgslayoutshape.py
|
17
|
2357
|
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutItemShape.
.. 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__ = '(C) 2017 by Nyall Dawson'
__date__ = '23/10/2017'
__copyright__ = 'Copyright 2017, The QGIS Project'
import qgis # NOQA
from qgis.testing import start_app, unittest
from qgis.core import (
QgsLayoutItemShape,
QgsProject,
QgsLayout,
QgsLayoutItem,
QgsLayoutMeasurement,
QgsUnitTypes
)
from qgis.PyQt.QtCore import QRectF
from qgis.PyQt.QtTest import QSignalSpy
from test_qgslayoutitem import LayoutItemTestCase
start_app()
class TestQgsLayoutShape(unittest.TestCase, LayoutItemTestCase):
@classmethod
def setUpClass(cls):
cls.item_class = QgsLayoutItemShape
def testClipPath(self):
pr = QgsProject()
l = QgsLayout(pr)
shape = QgsLayoutItemShape(l)
shape.setShapeType(QgsLayoutItemShape.Rectangle)
shape.attemptSetSceneRect(QRectF(30, 10, 100, 200))
# must be a closed polygon, in scene coordinates!
self.assertEqual(shape.clipPath().asWkt(), 'Polygon ((30 10, 130 10, 130 210, 30 210, 30 10))')
self.assertTrue(int(shape.itemFlags() & QgsLayoutItem.FlagProvidesClipPath))
spy = QSignalSpy(shape.clipPathChanged)
shape.setCornerRadius(QgsLayoutMeasurement(10, QgsUnitTypes.LayoutMillimeters))
self.assertTrue(shape.clipPath().asWkt(0).startswith('Polygon ((30 20, 30 20, 30 19, 30 19, 30 19, 30 19'))
self.assertEqual(len(spy), 1)
shape.setShapeType(QgsLayoutItemShape.Ellipse)
self.assertEqual(len(spy), 2)
self.assertTrue(shape.clipPath().asWkt(0).startswith('Polygon ((130 110, 130 111, 130 113, 130 114'))
shape.setShapeType(QgsLayoutItemShape.Triangle)
self.assertEqual(len(spy), 3)
self.assertEqual(shape.clipPath().asWkt(), 'Polygon ((30 210, 130 210, 80 10, 30 210))')
shape.attemptSetSceneRect(QRectF(50, 20, 80, 120))
self.assertEqual(len(spy), 4)
self.assertEqual(shape.clipPath().asWkt(), 'Polygon ((50 140, 130 140, 90 20, 50 140))')
if __name__ == '__main__':
unittest.main()
|
gpl-2.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
624,
31329,
12008,
2295,
367,
29066,
2081,
7238,
14,
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,
624,
199,
363,
2502,
363,
275,
8189,
35,
9,
9708,
701,
653,
89,
452,
577,
10084,
834,
7,
199,
363,
602,
363,
275,
283,
1789,
15,
709,
15,
10680,
7,
199,
363,
7307,
363,
275,
283,
7384,
9708,
12,
710,
27024,
7290,
7,
199,
199,
646,
15640,
221,
327,
20432,
199,
199,
504,
15640,
14,
4776,
492,
1343,
63,
571,
12,
2882,
199,
504,
15640,
14,
1018,
492,
334,
272,
29066,
2081,
7238,
12,
272,
4888,
4761,
12,
272,
29066,
12,
272,
29066,
2081,
12,
272,
29066,
18611,
434,
12,
272,
30343,
199,
9,
199,
504,
15640,
14,
24107,
14,
10901,
492,
1413,
8252,
38,
199,
504,
15640,
14,
24107,
14,
4238,
774,
492,
1413,
11274,
51,
647,
199,
199,
504,
511,
63,
81,
458,
817,
810,
4484,
492,
25604,
2081,
1746,
199,
199,
928,
63,
571,
342,
421,
199,
533,
1379,
7350,
4798,
7238,
8,
2796,
14,
1746,
12,
25604,
2081,
1746,
304,
339,
768,
3744,
272,
347,
18561,
8,
1886,
304,
267,
843,
14,
1053,
63,
533,
275,
29066,
2081,
7238,
339,
347,
511,
17492,
2042,
8,
277,
304,
267,
5448,
275,
4888,
4761,
342,
267,
634,
275,
29066,
8,
2700,
9,
267,
2215,
275,
29066,
2081,
7238,
8,
76,
9,
398,
2215,
14,
409,
7238,
804,
8,
7350,
4798,
2081,
7238,
14,
18127,
9,
267,
2215,
14,
16880,
1084,
14216,
8252,
8,
30197,
38,
8,
1216,
12,
1616,
12,
2948,
12,
1926,
430,
398,
327,
1471,
506,
282,
6876,
17248,
12,
315,
13856,
8983,
1,
267,
291,
14,
629,
8,
1392,
14,
7548,
2042,
1252,
305,
31810,
1062,
283,
12367,
3666,
1216,
1616,
12,
21334,
1616,
12,
21334,
26160,
12,
4233,
26160,
12,
4233,
1616,
28435,
267,
291,
14,
1815,
8,
442,
8,
1392,
14,
1053,
6381,
342,
1253,
29066,
2081,
14,
5318,
17473,
17492,
2042,
430,
398,
308,
647,
275,
1413,
11274,
51,
647,
8,
1392,
14,
7548,
2042,
6970,
9,
267,
2215,
14,
409,
8380,
1372,
19800,
8,
7350,
4798,
18611,
434,
8,
709,
12,
30343,
14,
4798,
30145,
20893,
430,
267,
291,
14,
1815,
8,
1392,
14,
7548,
2042,
1252,
305,
31810,
8,
16,
680,
2460,
360,
12367,
3666,
1216,
3388,
12,
4233,
3388,
12,
4233,
5851,
12,
4233,
5851,
12,
4233,
5851,
12,
4233,
5851,
1333,
267,
291,
14,
629,
8,
552,
8,
15252,
395,
413,
9,
398,
2215,
14,
409,
7238,
804,
8,
7350,
4798,
2081,
7238,
14,
23525,
261,
9,
267,
291,
14,
629,
8,
552,
8,
15252,
395,
499,
9,
267,
291,
14,
1815,
8,
1392,
14,
7548,
2042,
1252,
305,
31810,
8,
16,
680,
2460,
360,
12367,
3666,
9056,
16814,
12,
21334,
20128,
12,
21334,
24073,
12,
21334,
23510,
1333,
398,
2215,
14,
409,
7238,
804,
8,
7350,
4798,
2081,
7238,
14,
30402,
9,
267,
291,
14,
629,
8,
552,
8,
15252,
395,
650,
9,
267,
291,
14,
629,
8,
1392,
14,
7548,
2042,
1252,
305,
31810,
1062,
283,
12367,
3666,
1216,
26160,
12,
21334,
26160,
12,
5939,
1616,
12,
4233,
26160,
28435,
398,
2215,
14,
16880,
1084,
14216,
8252,
8,
30197,
38,
8,
1400,
12,
3388,
12,
5939,
12,
13960,
430,
267,
291,
14,
629,
8,
552,
8,
15252,
395,
841,
9,
267,
291,
14,
629,
8,
1392,
14,
7548,
2042,
1252,
305,
31810,
1062,
283,
12367,
3666,
1400,
22796,
12,
21334,
22796,
12,
9137,
3388,
12,
5238,
22796,
28435,
421,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
624,
31329,
12008,
2295,
367,
29066,
2081,
7238,
14,
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,
624,
199,
363,
2502,
363,
275,
8189,
35,
9,
9708,
701,
653,
89,
452,
577,
10084,
834,
7,
199,
363,
602,
363,
275,
283,
1789,
15,
709,
15,
10680,
7,
199,
363,
7307,
363,
275,
283,
7384,
9708,
12,
710,
27024,
7290,
7,
199,
199,
646,
15640,
221,
327,
20432,
199,
199,
504,
15640,
14,
4776,
492,
1343,
63,
571,
12,
2882,
199,
504,
15640,
14,
1018,
492,
334,
272,
29066,
2081,
7238,
12,
272,
4888,
4761,
12,
272,
29066,
12,
272,
29066,
2081,
12,
272,
29066,
18611,
434,
12,
272,
30343,
199,
9,
199,
504,
15640,
14,
24107,
14,
10901,
492,
1413,
8252,
38,
199,
504,
15640,
14,
24107,
14,
4238,
774,
492,
1413,
11274,
51,
647,
199,
199,
504,
511,
63,
81,
458,
817,
810,
4484,
492,
25604,
2081,
1746,
199,
199,
928,
63,
571,
342,
421,
199,
533,
1379,
7350,
4798,
7238,
8,
2796,
14,
1746,
12,
25604,
2081,
1746,
304,
339,
768,
3744,
272,
347,
18561,
8,
1886,
304,
267,
843,
14,
1053,
63,
533,
275,
29066,
2081,
7238,
339,
347,
511,
17492,
2042,
8,
277,
304,
267,
5448,
275,
4888,
4761,
342,
267,
634,
275,
29066,
8,
2700,
9,
267,
2215,
275,
29066,
2081,
7238,
8,
76,
9,
398,
2215,
14,
409,
7238,
804,
8,
7350,
4798,
2081,
7238,
14,
18127,
9,
267,
2215,
14,
16880,
1084,
14216,
8252,
8,
30197,
38,
8,
1216,
12,
1616,
12,
2948,
12,
1926,
430,
398,
327,
1471,
506,
282,
6876,
17248,
12,
315,
13856,
8983,
1,
267,
291,
14,
629,
8,
1392,
14,
7548,
2042,
1252,
305,
31810,
1062,
283,
12367,
3666,
1216,
1616,
12,
21334,
1616,
12,
21334,
26160,
12,
4233,
26160,
12,
4233,
1616,
28435,
267,
291,
14,
1815,
8,
442,
8,
1392,
14,
1053,
6381,
342,
1253,
29066,
2081,
14,
5318,
17473,
17492,
2042,
430,
398,
308,
647,
275,
1413,
11274,
51,
647,
8,
1392,
14,
7548,
2042,
6970,
9,
267,
2215,
14,
409,
8380,
1372,
19800,
8,
7350,
4798,
18611,
434,
8,
709,
12,
30343,
14,
4798,
30145,
20893,
430,
267,
291,
14,
1815,
8,
1392,
14,
7548,
2042,
1252,
305,
31810,
8,
16,
680,
2460,
360,
12367,
3666,
1216,
3388,
12,
4233,
3388,
12,
4233,
5851,
12,
4233,
5851,
12,
4233,
5851,
12,
4233,
5851,
1333,
267,
291,
14,
629,
8,
552,
8,
15252,
395,
413,
9,
398,
2215,
14,
409,
7238,
804,
8,
7350,
4798,
2081,
7238,
14,
23525,
261,
9,
267,
291,
14,
629,
8,
552,
8,
15252,
395,
499,
9,
267,
291,
14,
1815,
8,
1392,
14,
7548,
2042,
1252,
305,
31810,
8,
16,
680,
2460,
360,
12367,
3666,
9056,
16814,
12,
21334,
20128,
12,
21334,
24073,
12,
21334,
23510,
1333,
398,
2215,
14,
409,
7238,
804,
8,
7350,
4798,
2081,
7238,
14,
30402,
9,
267,
291,
14,
629,
8,
552,
8,
15252,
395,
650,
9,
267,
291,
14,
629,
8,
1392,
14,
7548,
2042,
1252,
305,
31810,
1062,
283,
12367,
3666,
1216,
26160,
12,
21334,
26160,
12,
5939,
1616,
12,
4233,
26160,
28435,
398,
2215,
14,
16880,
1084,
14216,
8252,
8,
30197,
38,
8,
1400,
12,
3388,
12,
5939,
12,
13960,
430,
267,
291,
14,
629,
8,
552,
8,
15252,
395,
841,
9,
267,
291,
14,
629,
8,
1392,
14,
7548,
2042,
1252,
305,
31810,
1062,
283,
12367,
3666,
1400,
22796,
12,
21334,
22796,
12,
9137,
3388,
12,
5238,
22796,
28435,
421,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
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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
] |
xushuwei202/Vintageous
|
ex/parser/scanner.py
|
9
|
4444
|
'''
Tokenization for the Vim command line.
'''
from Vintageous.ex.ex_error import ERR_UNKNOWN_COMMAND
from Vintageous.ex.ex_error import VimError
from . import subscanners
from .state import EOF
from .state import ScannerState
from .tokens import TokenComma
from .tokens import TokenDigits
from .tokens import TokenDollar
from .tokens import TokenDot
from .tokens import TokenEof
from .tokens import TokenMark
from .tokens import TokenOffset
from .tokens import TokenPercent
from .tokens import TokenSearchBackward
from .tokens import TokenSearchForward
from .tokens import TokenSemicolon
# TODO: make this a function. We don't need state.
class Scanner(object):
'''
Produces ex command-line tokens from a string.
'''
def __init__(self, source):
self.state = ScannerState(source)
def scan(self):
'''
Generates ex command-line tokens for `source`.
The scanner works its way through the source string by passing the
current state to the next scanning function.
'''
next_func = scan_range
while True:
# We return multiple tokens so that we can work around cyclic imports:
# functions that need to, return TokenEof without having to call
# a function in this module from a separate module.
#
# Keep scanning while we get a scanning function.
(next_func, items) = next_func(self.state)
yield from items
if not next_func:
break
def scan_range(state):
'''
Produces tokens found in a command line range.
http://vimdoc.sourceforge.net/htmldoc/cmdline.html#cmdline-ranges
'''
c = state.consume()
if c == EOF:
return None, [TokenEof()]
if c == '.':
state.emit()
return scan_range, [TokenDot()]
if c == '$':
state.emit()
return scan_range, [TokenDollar()]
if c in ',;':
token = TokenComma if c == ',' else TokenSemicolon
state.emit()
return scan_range, [token()]
if c == "'":
return scan_mark(state)
if c in '/?':
return scan_search(state)
if c in '+-':
return scan_offset(state)
if c == '%':
state.emit()
return scan_range, [TokenPercent()]
if c in '\t ':
state.skip_run(' \t')
state.ignore()
if c.isdigit():
return scan_digits(state)
state.backup()
return scan_command, []
def scan_mark(state):
c = state.expect_match(r'[a-zA-Z\[\]()<>]')
return scan_range, [TokenMark(c.group(0))]
def scan_digits(state):
while True:
c = state.consume()
if not c.isdigit():
if c == EOF:
return None, [TokenDigits(state.emit()), TokenEof()]
state.backup()
break
return scan_range, [TokenDigits(state.emit())]
def scan_search(state):
delim = state.source[state.position - 1]
while True:
c = state.consume()
if c == delim:
state.start += 1
state.backup()
content = state.emit()
state.consume()
token = TokenSearchForward if c == '/' else TokenSearchBackward
return scan_range , [token(content)]
elif c == EOF:
raise ValueError('unclosed search pattern: {0}'.format(state.source))
def scan_offset(state):
offsets = []
to_int = lambda x: int(x, 10)
sign = '-' if state.source[state.position - 1] == '-' else ''
digits = state.expect_match(r'\s*(\d+)')
offsets.append(sign + digits.group(1))
while True:
c = state.consume()
if c == EOF:
state.ignore()
return None, [TokenOffset(list(map(to_int, offsets))), TokenEof()]
if c == '+' or c == '-':
digits = state.expect_match(r'\s*(\d+)')
sign = '-' if state.source[state.position - 1] == '-' else ''
offsets.append(sign + digits.group(1))
continue
if not c.isdigit():
state.backup()
state.ignore()
return scan_range, [TokenOffset(list(map(to_int, offsets)))]
def scan_command(state):
for (pattern, subscanner) in subscanners.patterns.items():
if state.match(pattern):
state.ignore()
return subscanner(state)
state.expect(EOF, lambda: VimError(ERR_UNKNOWN_COMMAND))
return None, [TokenEof()]
|
mit
|
[
2344,
199,
3264,
2072,
367,
314,
812,
1017,
1414,
1004,
14,
199,
2344,
199,
199,
504,
812,
442,
474,
1785,
14,
476,
14,
476,
63,
705,
492,
21569,
63,
11588,
63,
10761,
199,
504,
812,
442,
474,
1785,
14,
476,
14,
476,
63,
705,
492,
812,
1017,
547,
199,
199,
504,
1275,
492,
1007,
551,
27297,
199,
504,
1275,
929,
492,
9027,
199,
504,
1275,
929,
492,
28628,
2223,
199,
504,
1275,
4504,
492,
8767,
25732,
199,
504,
1275,
4504,
492,
8767,
29371,
199,
504,
1275,
4504,
492,
8767,
36,
25317,
199,
504,
1275,
4504,
492,
8767,
14004,
199,
504,
1275,
4504,
492,
8767,
37,
1618,
199,
504,
1275,
4504,
492,
8767,
6470,
199,
504,
1275,
4504,
492,
8767,
6397,
199,
504,
1275,
4504,
492,
8767,
17931,
199,
504,
1275,
4504,
492,
8767,
5278,
4540,
3079,
199,
504,
1275,
4504,
492,
8767,
5278,
12984,
199,
504,
1275,
4504,
492,
8767,
1513,
2664,
12167,
421,
199,
3,
3254,
26,
1852,
642,
282,
805,
14,
2136,
2793,
1133,
1929,
1174,
14,
199,
533,
28628,
8,
785,
304,
272,
1449,
272,
2165,
10569,
444,
1414,
13,
604,
4645,
687,
282,
1059,
14,
272,
1449,
272,
347,
636,
826,
721,
277,
12,
1350,
304,
267,
291,
14,
929,
275,
28628,
2223,
8,
1365,
9,
339,
347,
8000,
8,
277,
304,
267,
1449,
267,
21687,
444,
1414,
13,
604,
4645,
367,
658,
1365,
2313,
398,
710,
19121,
5419,
2399,
4340,
4012,
314,
1350,
1059,
701,
9476,
314,
267,
1453,
1174,
370,
314,
2163,
24928,
805,
14,
267,
1449,
267,
2163,
63,
1532,
275,
8000,
63,
1842,
267,
1830,
715,
26,
288,
327,
2136,
372,
3663,
4645,
880,
626,
781,
883,
1736,
6818,
32637,
8925,
26,
288,
327,
3423,
626,
1929,
370,
12,
372,
8767,
37,
1618,
1928,
9445,
370,
1240,
288,
327,
282,
805,
315,
642,
859,
687,
282,
7396,
859,
14,
288,
327,
288,
327,
14797,
24928,
1830,
781,
664,
282,
24928,
805,
14,
288,
334,
2184,
63,
1532,
12,
2974,
9,
275,
2163,
63,
1532,
8,
277,
14,
929,
9,
288,
1995,
687,
2974,
288,
340,
440,
2163,
63,
1532,
26,
355,
2059,
421,
199,
318,
8000,
63,
1842,
8,
929,
304,
272,
1449,
272,
2165,
10569,
4645,
1911,
315,
282,
1414,
1004,
1425,
14,
339,
1455,
921,
433,
1064,
679,
14,
22943,
14,
846,
15,
1360,
1301,
15,
15612,
14,
1360,
3,
15612,
13,
8404,
272,
1449,
272,
286,
275,
1174,
14,
10235,
342,
339,
340,
286,
508,
9027,
26,
267,
372,
488,
12,
359,
3264,
37,
1618,
5106,
339,
340,
286,
508,
26351,
267,
1174,
14,
8159,
342,
267,
372,
8000,
63,
1842,
12,
359,
3264,
14004,
5106,
339,
340,
286,
508,
4505,
356,
267,
1174,
14,
8159,
342,
267,
372,
8000,
63,
1842,
12,
359,
3264,
36,
25317,
5106,
339,
340,
286,
315,
1656,
6015,
267,
1526,
275,
8767,
25732,
340,
286,
508,
13647,
587,
8767,
1513,
2664,
12167,
267,
1174,
14,
8159,
342,
267,
372,
8000,
63,
1842,
12,
359,
1418,
5106,
339,
340,
286,
508,
3546,
582,
267,
372,
8000,
63,
1657,
8,
929,
9,
339,
340,
286,
315,
1994,
28867,
267,
372,
8000,
63,
1733,
8,
929,
9,
339,
340,
286,
315,
6681,
13,
356,
267,
372,
8000,
63,
2743,
8,
929,
9,
339,
340,
286,
508,
1543,
356,
267,
1174,
14,
8159,
342,
267,
372,
8000,
63,
1842,
12,
359,
3264,
17931,
5106,
339,
340,
286,
315,
1557,
84,
7596,
267,
1174,
14,
2759,
63,
1065,
360,
971,
84,
358,
267,
1174,
14,
4247,
342,
339,
340,
286,
14,
13896,
837,
267,
372,
8000,
63,
7022,
8,
929,
9,
339,
1174,
14,
5751,
342,
272,
372,
8000,
63,
1531,
12,
942,
421,
199,
318,
8000,
63,
1657,
8,
929,
304,
272,
286,
275,
1174,
14,
4921,
63,
1431,
8,
82,
3894,
65,
13,
6353,
13,
58,
60,
7023,
32702,
16137,
10374,
272,
372,
8000,
63,
1842,
12,
359,
3264,
6470,
8,
67,
14,
923,
8,
16,
10524,
421,
199,
318,
8000,
63,
7022,
8,
929,
304,
272,
1830,
715,
26,
267,
286,
275,
1174,
14,
10235,
342,
267,
340,
440,
286,
14,
13896,
837,
288,
340,
286,
508,
9027,
26,
355,
372,
488,
12,
359,
3264,
29371,
8,
929,
14,
8159,
4000,
8767,
37,
1618,
5106,
288,
1174,
14,
5751,
342,
288,
2059,
272,
372,
8000,
63,
1842,
12,
359,
3264,
29371,
8,
929,
14,
8159,
24821,
421,
199,
318,
8000,
63,
1733,
8,
929,
304,
272,
21799,
275,
1174,
14,
1365,
59,
929,
14,
3124,
446,
413,
61,
272,
1830,
715,
26,
267,
286,
275,
1174,
14,
10235,
342,
398,
340,
286,
508,
21799,
26,
288,
1174,
14,
928,
847,
413,
288,
1174,
14,
5751,
342,
288,
1564,
275,
1174,
14,
8159,
342,
288,
1174,
14,
10235,
342,
288,
1526,
275,
8767,
5278,
12984,
340,
286,
508,
7324,
587,
8767,
5278,
4540,
3079,
288,
372,
8000,
63,
1842,
2360,
359,
1418,
8,
1317,
1874,
398,
916,
286,
508,
9027,
26,
288,
746,
1722,
360,
1097,
320,
939,
2754,
3851,
26,
469,
16,
5285,
908,
8,
929,
14,
1365,
430,
421,
199,
318,
8000,
63,
2743,
8,
929,
304,
272,
15340,
275,
942,
272,
370,
63,
442,
275,
2400,
671,
26,
1109,
8,
88,
12,
1616,
9,
272,
2070,
275,
10791,
340,
1174,
14,
1365,
59,
929,
14,
3124,
446,
413,
61,
508,
10791,
587,
2125,
339,
7576,
275,
1174,
14,
4921,
63,
1431,
8,
82,
1154,
83,
22588,
68,
11,
5942,
272,
15340,
14,
740,
8,
1037,
435,
7576,
14,
923,
8,
17,
430,
339,
1830,
715,
26,
267,
286,
275,
1174,
14,
10235,
342,
398,
340,
286,
508,
9027,
26,
288,
1174,
14,
4247,
342,
288,
372,
488,
12,
359,
3264,
6397,
8,
513,
8,
1130,
8,
475,
63,
442,
12,
15340,
11508,
8767,
37,
1618,
5106,
398,
340,
286,
508,
20246,
503,
286,
508,
20905,
288,
7576,
275,
1174,
14,
4921,
63,
1431,
8,
82,
1154,
83,
22588,
68,
11,
5942,
288,
2070,
275,
10791,
340,
1174,
14,
1365,
59,
929,
14,
3124,
446,
413,
61,
508,
10791,
587,
2125,
288,
15340,
14,
740,
8,
1037,
435,
7576,
14,
923,
8,
17,
430,
288,
1980,
398,
340,
440,
286,
14,
13896,
837,
288,
1174,
14,
5751,
342
] |
[
199,
3264,
2072,
367,
314,
812,
1017,
1414,
1004,
14,
199,
2344,
199,
199,
504,
812,
442,
474,
1785,
14,
476,
14,
476,
63,
705,
492,
21569,
63,
11588,
63,
10761,
199,
504,
812,
442,
474,
1785,
14,
476,
14,
476,
63,
705,
492,
812,
1017,
547,
199,
199,
504,
1275,
492,
1007,
551,
27297,
199,
504,
1275,
929,
492,
9027,
199,
504,
1275,
929,
492,
28628,
2223,
199,
504,
1275,
4504,
492,
8767,
25732,
199,
504,
1275,
4504,
492,
8767,
29371,
199,
504,
1275,
4504,
492,
8767,
36,
25317,
199,
504,
1275,
4504,
492,
8767,
14004,
199,
504,
1275,
4504,
492,
8767,
37,
1618,
199,
504,
1275,
4504,
492,
8767,
6470,
199,
504,
1275,
4504,
492,
8767,
6397,
199,
504,
1275,
4504,
492,
8767,
17931,
199,
504,
1275,
4504,
492,
8767,
5278,
4540,
3079,
199,
504,
1275,
4504,
492,
8767,
5278,
12984,
199,
504,
1275,
4504,
492,
8767,
1513,
2664,
12167,
421,
199,
3,
3254,
26,
1852,
642,
282,
805,
14,
2136,
2793,
1133,
1929,
1174,
14,
199,
533,
28628,
8,
785,
304,
272,
1449,
272,
2165,
10569,
444,
1414,
13,
604,
4645,
687,
282,
1059,
14,
272,
1449,
272,
347,
636,
826,
721,
277,
12,
1350,
304,
267,
291,
14,
929,
275,
28628,
2223,
8,
1365,
9,
339,
347,
8000,
8,
277,
304,
267,
1449,
267,
21687,
444,
1414,
13,
604,
4645,
367,
658,
1365,
2313,
398,
710,
19121,
5419,
2399,
4340,
4012,
314,
1350,
1059,
701,
9476,
314,
267,
1453,
1174,
370,
314,
2163,
24928,
805,
14,
267,
1449,
267,
2163,
63,
1532,
275,
8000,
63,
1842,
267,
1830,
715,
26,
288,
327,
2136,
372,
3663,
4645,
880,
626,
781,
883,
1736,
6818,
32637,
8925,
26,
288,
327,
3423,
626,
1929,
370,
12,
372,
8767,
37,
1618,
1928,
9445,
370,
1240,
288,
327,
282,
805,
315,
642,
859,
687,
282,
7396,
859,
14,
288,
327,
288,
327,
14797,
24928,
1830,
781,
664,
282,
24928,
805,
14,
288,
334,
2184,
63,
1532,
12,
2974,
9,
275,
2163,
63,
1532,
8,
277,
14,
929,
9,
288,
1995,
687,
2974,
288,
340,
440,
2163,
63,
1532,
26,
355,
2059,
421,
199,
318,
8000,
63,
1842,
8,
929,
304,
272,
1449,
272,
2165,
10569,
4645,
1911,
315,
282,
1414,
1004,
1425,
14,
339,
1455,
921,
433,
1064,
679,
14,
22943,
14,
846,
15,
1360,
1301,
15,
15612,
14,
1360,
3,
15612,
13,
8404,
272,
1449,
272,
286,
275,
1174,
14,
10235,
342,
339,
340,
286,
508,
9027,
26,
267,
372,
488,
12,
359,
3264,
37,
1618,
5106,
339,
340,
286,
508,
26351,
267,
1174,
14,
8159,
342,
267,
372,
8000,
63,
1842,
12,
359,
3264,
14004,
5106,
339,
340,
286,
508,
4505,
356,
267,
1174,
14,
8159,
342,
267,
372,
8000,
63,
1842,
12,
359,
3264,
36,
25317,
5106,
339,
340,
286,
315,
1656,
6015,
267,
1526,
275,
8767,
25732,
340,
286,
508,
13647,
587,
8767,
1513,
2664,
12167,
267,
1174,
14,
8159,
342,
267,
372,
8000,
63,
1842,
12,
359,
1418,
5106,
339,
340,
286,
508,
3546,
582,
267,
372,
8000,
63,
1657,
8,
929,
9,
339,
340,
286,
315,
1994,
28867,
267,
372,
8000,
63,
1733,
8,
929,
9,
339,
340,
286,
315,
6681,
13,
356,
267,
372,
8000,
63,
2743,
8,
929,
9,
339,
340,
286,
508,
1543,
356,
267,
1174,
14,
8159,
342,
267,
372,
8000,
63,
1842,
12,
359,
3264,
17931,
5106,
339,
340,
286,
315,
1557,
84,
7596,
267,
1174,
14,
2759,
63,
1065,
360,
971,
84,
358,
267,
1174,
14,
4247,
342,
339,
340,
286,
14,
13896,
837,
267,
372,
8000,
63,
7022,
8,
929,
9,
339,
1174,
14,
5751,
342,
272,
372,
8000,
63,
1531,
12,
942,
421,
199,
318,
8000,
63,
1657,
8,
929,
304,
272,
286,
275,
1174,
14,
4921,
63,
1431,
8,
82,
3894,
65,
13,
6353,
13,
58,
60,
7023,
32702,
16137,
10374,
272,
372,
8000,
63,
1842,
12,
359,
3264,
6470,
8,
67,
14,
923,
8,
16,
10524,
421,
199,
318,
8000,
63,
7022,
8,
929,
304,
272,
1830,
715,
26,
267,
286,
275,
1174,
14,
10235,
342,
267,
340,
440,
286,
14,
13896,
837,
288,
340,
286,
508,
9027,
26,
355,
372,
488,
12,
359,
3264,
29371,
8,
929,
14,
8159,
4000,
8767,
37,
1618,
5106,
288,
1174,
14,
5751,
342,
288,
2059,
272,
372,
8000,
63,
1842,
12,
359,
3264,
29371,
8,
929,
14,
8159,
24821,
421,
199,
318,
8000,
63,
1733,
8,
929,
304,
272,
21799,
275,
1174,
14,
1365,
59,
929,
14,
3124,
446,
413,
61,
272,
1830,
715,
26,
267,
286,
275,
1174,
14,
10235,
342,
398,
340,
286,
508,
21799,
26,
288,
1174,
14,
928,
847,
413,
288,
1174,
14,
5751,
342,
288,
1564,
275,
1174,
14,
8159,
342,
288,
1174,
14,
10235,
342,
288,
1526,
275,
8767,
5278,
12984,
340,
286,
508,
7324,
587,
8767,
5278,
4540,
3079,
288,
372,
8000,
63,
1842,
2360,
359,
1418,
8,
1317,
1874,
398,
916,
286,
508,
9027,
26,
288,
746,
1722,
360,
1097,
320,
939,
2754,
3851,
26,
469,
16,
5285,
908,
8,
929,
14,
1365,
430,
421,
199,
318,
8000,
63,
2743,
8,
929,
304,
272,
15340,
275,
942,
272,
370,
63,
442,
275,
2400,
671,
26,
1109,
8,
88,
12,
1616,
9,
272,
2070,
275,
10791,
340,
1174,
14,
1365,
59,
929,
14,
3124,
446,
413,
61,
508,
10791,
587,
2125,
339,
7576,
275,
1174,
14,
4921,
63,
1431,
8,
82,
1154,
83,
22588,
68,
11,
5942,
272,
15340,
14,
740,
8,
1037,
435,
7576,
14,
923,
8,
17,
430,
339,
1830,
715,
26,
267,
286,
275,
1174,
14,
10235,
342,
398,
340,
286,
508,
9027,
26,
288,
1174,
14,
4247,
342,
288,
372,
488,
12,
359,
3264,
6397,
8,
513,
8,
1130,
8,
475,
63,
442,
12,
15340,
11508,
8767,
37,
1618,
5106,
398,
340,
286,
508,
20246,
503,
286,
508,
20905,
288,
7576,
275,
1174,
14,
4921,
63,
1431,
8,
82,
1154,
83,
22588,
68,
11,
5942,
288,
2070,
275,
10791,
340,
1174,
14,
1365,
59,
929,
14,
3124,
446,
413,
61,
508,
10791,
587,
2125,
288,
15340,
14,
740,
8,
1037,
435,
7576,
14,
923,
8,
17,
430,
288,
1980,
398,
340,
440,
286,
14,
13896,
837,
288,
1174,
14,
5751,
342,
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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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
jorik041/zmqproto
|
zmqproto/zre.py
|
5
|
2863
|
import struct
import random
class ZreProtocol:
# http://rfc.zeromq.org/spec:20
def __init__(self, ipaddr):
self.uuid = random.randint(0,20000)
self.port = 50000 + random.randint(0,10000)
self.seq = 0
self.ipaddr = ipaddr
self.groups = []
self.group_status_seq = 0
def buildString(self, text):
return struct.pack('B', len(text)) + text
def buildBeacon(self):
data = 'ZRE' + chr(0x01)
data += struct.pack('H', self.uuid)
data += struct.pack('H', self.port)
return data
def parseBeacon(self, data):
uuid = struct.unpack('H', data[4:6])[0]
port = struct.unpack('H', data[6:])[0]
return uuid, port
def buildHeader(self):
self.seq += 1
# signature
data = chr(0xAA) + chr(0xA1)
# sequence
data += struct.pack('H', self.seq)
return data
def buildHello(self):
data = self.buildHeader()
# ip address
data += buildString(self.ipaddr)
# sender mailbox port
data += struct.pack('H', self.port)
# groups
data += struct.pack('B', len(self.groups))
for group in self.groups:
data += self.buildString(group)
# sender group status sequence
data += struct.pack('B', len(self.group_status_seq))
# header
header = {}
data += struct.pack('B', len(header))
for key, val in header.iteritems():
data += self.buildString('%s=%s' % (key, val))
return data
def buildWhisper(self, content):
data = self.buildHeader()
data += chr(0x02)
data += self.buildFrame(content)
return data
def buildShout(self, group, content):
data = self.buildHeader()
data += chr(0x03)
data += self.buildString(group)
data += self.buildFrame(content)
return data
def buildJoin(self, group):
self.group_status_seq += 1
data = self.buildHeader()
data += chr(0x04)
data += self.buildString(group)
# sender group status sequence
data += struct.pack('B', len(self.group_status_seq))
return data
def buildLeave(self, group):
self.group_status_seq += 1
data = self.buildHeader()
data += chr(0x05)
data += self.buildString(group)
# sender group status sequence
data += struct.pack('B', len(self.group_status_seq))
return data
def buildPing(self, content):
data = self.buildHeader()
data += chr(0x06)
return data
def buildPingOk(self, content):
data = self.buildHeader()
data += chr(0x07)
return data
if __name__ == '__main__':
zre = ZreProtocol('127.0.0.1')
data = zre.buildBeacon()
print zre.parseBeacon(data)
|
lgpl-3.0
|
[
646,
2702,
199,
646,
2196,
199,
199,
533,
3107,
264,
3658,
26,
272,
327,
1455,
921,
8973,
14,
2282,
676,
81,
14,
1308,
15,
1650,
26,
1165,
272,
347,
636,
826,
721,
277,
12,
21249,
304,
267,
291,
14,
2580,
275,
2196,
14,
8393,
8,
16,
12,
27140,
9,
267,
291,
14,
719,
275,
959,
993,
435,
2196,
14,
8393,
8,
16,
12,
9943,
9,
267,
291,
14,
3610,
275,
378,
267,
291,
14,
22623,
275,
21249,
267,
291,
14,
2634,
275,
942,
267,
291,
14,
923,
63,
1205,
63,
3610,
275,
378,
339,
347,
1900,
1558,
8,
277,
12,
1318,
304,
267,
372,
2702,
14,
1389,
360,
34,
297,
822,
8,
505,
430,
435,
1318,
339,
347,
1900,
26436,
8,
277,
304,
267,
666,
275,
283,
58,
907,
7,
435,
8678,
8,
16,
88,
614,
9,
267,
666,
847,
2702,
14,
1389,
360,
40,
297,
291,
14,
2580,
9,
267,
666,
847,
2702,
14,
1389,
360,
40,
297,
291,
14,
719,
9,
267,
372,
666,
339,
347,
2198,
26436,
8,
277,
12,
666,
304,
267,
5377,
275,
2702,
14,
5301,
360,
40,
297,
666,
59,
20,
26,
22,
11057,
16,
61,
267,
1844,
275,
2702,
14,
5301,
360,
40,
297,
666,
59,
22,
5728,
59,
16,
61,
267,
372,
5377,
12,
1844,
339,
347,
1900,
2567,
8,
277,
304,
267,
291,
14,
3610,
847,
413,
267,
327,
4955,
267,
666,
275,
8678,
8,
16,
31234,
9,
435,
8678,
8,
16,
7471,
17,
9,
267,
327,
3414,
267,
666,
847,
2702,
14,
1389,
360,
40,
297,
291,
14,
3610,
9,
267,
372,
666,
339,
347,
1900,
6257,
8,
277,
304,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
327,
3384,
2287,
267,
666,
847,
1900,
1558,
8,
277,
14,
22623,
9,
267,
327,
8904,
17470,
1844,
267,
666,
847,
2702,
14,
1389,
360,
40,
297,
291,
14,
719,
9,
267,
327,
4652,
267,
666,
847,
2702,
14,
1389,
360,
34,
297,
822,
8,
277,
14,
2634,
430,
267,
367,
1572,
315,
291,
14,
2634,
26,
288,
666,
847,
291,
14,
1506,
1558,
8,
923,
9,
267,
327,
8904,
1572,
2004,
3414,
267,
666,
847,
2702,
14,
1389,
360,
34,
297,
822,
8,
277,
14,
923,
63,
1205,
63,
3610,
430,
267,
327,
1406,
267,
1406,
275,
1052,
267,
666,
847,
2702,
14,
1389,
360,
34,
297,
822,
8,
1291,
430,
267,
367,
790,
12,
1139,
315,
1406,
14,
4611,
837,
288,
666,
847,
291,
14,
1506,
1558,
3508,
83,
2458,
83,
7,
450,
334,
498,
12,
1139,
430,
267,
372,
666,
339,
347,
1900,
55,
866,
529,
8,
277,
12,
1564,
304,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
996,
9,
267,
666,
847,
291,
14,
1506,
3160,
8,
1317,
9,
267,
372,
666,
339,
347,
1900,
51,
20267,
8,
277,
12,
1572,
12,
1564,
304,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
1644,
9,
267,
666,
847,
291,
14,
1506,
1558,
8,
923,
9,
267,
666,
847,
291,
14,
1506,
3160,
8,
1317,
9,
267,
372,
666,
339,
347,
1900,
13005,
8,
277,
12,
1572,
304,
267,
291,
14,
923,
63,
1205,
63,
3610,
847,
413,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
966,
9,
267,
666,
847,
291,
14,
1506,
1558,
8,
923,
9,
267,
327,
8904,
1572,
2004,
3414,
267,
666,
847,
2702,
14,
1389,
360,
34,
297,
822,
8,
277,
14,
923,
63,
1205,
63,
3610,
430,
267,
372,
666,
339,
347,
1900,
23679,
8,
277,
12,
1572,
304,
267,
291,
14,
923,
63,
1205,
63,
3610,
847,
413,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
1717,
9,
267,
666,
847,
291,
14,
1506,
1558,
8,
923,
9,
267,
327,
8904,
1572,
2004,
3414,
267,
666,
847,
2702,
14,
1389,
360,
34,
297,
822,
8,
277,
14,
923,
63,
1205,
63,
3610,
430,
267,
372,
666,
339,
347,
1900,
22638,
8,
277,
12,
1564,
304,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
1690,
9,
267,
372,
666,
339,
347,
1900,
22638,
11622,
8,
277,
12,
1564,
304,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
1780,
9,
267,
372,
666,
199,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
1315,
264,
275,
3107,
264,
3658,
360,
4195,
14,
16,
14,
16,
14,
17,
358,
272,
666,
275,
1315,
264,
14,
1506,
26436,
342,
272,
870,
1315,
264,
14,
1122,
26436,
8,
576,
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
] |
[
2702,
199,
646,
2196,
199,
199,
533,
3107,
264,
3658,
26,
272,
327,
1455,
921,
8973,
14,
2282,
676,
81,
14,
1308,
15,
1650,
26,
1165,
272,
347,
636,
826,
721,
277,
12,
21249,
304,
267,
291,
14,
2580,
275,
2196,
14,
8393,
8,
16,
12,
27140,
9,
267,
291,
14,
719,
275,
959,
993,
435,
2196,
14,
8393,
8,
16,
12,
9943,
9,
267,
291,
14,
3610,
275,
378,
267,
291,
14,
22623,
275,
21249,
267,
291,
14,
2634,
275,
942,
267,
291,
14,
923,
63,
1205,
63,
3610,
275,
378,
339,
347,
1900,
1558,
8,
277,
12,
1318,
304,
267,
372,
2702,
14,
1389,
360,
34,
297,
822,
8,
505,
430,
435,
1318,
339,
347,
1900,
26436,
8,
277,
304,
267,
666,
275,
283,
58,
907,
7,
435,
8678,
8,
16,
88,
614,
9,
267,
666,
847,
2702,
14,
1389,
360,
40,
297,
291,
14,
2580,
9,
267,
666,
847,
2702,
14,
1389,
360,
40,
297,
291,
14,
719,
9,
267,
372,
666,
339,
347,
2198,
26436,
8,
277,
12,
666,
304,
267,
5377,
275,
2702,
14,
5301,
360,
40,
297,
666,
59,
20,
26,
22,
11057,
16,
61,
267,
1844,
275,
2702,
14,
5301,
360,
40,
297,
666,
59,
22,
5728,
59,
16,
61,
267,
372,
5377,
12,
1844,
339,
347,
1900,
2567,
8,
277,
304,
267,
291,
14,
3610,
847,
413,
267,
327,
4955,
267,
666,
275,
8678,
8,
16,
31234,
9,
435,
8678,
8,
16,
7471,
17,
9,
267,
327,
3414,
267,
666,
847,
2702,
14,
1389,
360,
40,
297,
291,
14,
3610,
9,
267,
372,
666,
339,
347,
1900,
6257,
8,
277,
304,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
327,
3384,
2287,
267,
666,
847,
1900,
1558,
8,
277,
14,
22623,
9,
267,
327,
8904,
17470,
1844,
267,
666,
847,
2702,
14,
1389,
360,
40,
297,
291,
14,
719,
9,
267,
327,
4652,
267,
666,
847,
2702,
14,
1389,
360,
34,
297,
822,
8,
277,
14,
2634,
430,
267,
367,
1572,
315,
291,
14,
2634,
26,
288,
666,
847,
291,
14,
1506,
1558,
8,
923,
9,
267,
327,
8904,
1572,
2004,
3414,
267,
666,
847,
2702,
14,
1389,
360,
34,
297,
822,
8,
277,
14,
923,
63,
1205,
63,
3610,
430,
267,
327,
1406,
267,
1406,
275,
1052,
267,
666,
847,
2702,
14,
1389,
360,
34,
297,
822,
8,
1291,
430,
267,
367,
790,
12,
1139,
315,
1406,
14,
4611,
837,
288,
666,
847,
291,
14,
1506,
1558,
3508,
83,
2458,
83,
7,
450,
334,
498,
12,
1139,
430,
267,
372,
666,
339,
347,
1900,
55,
866,
529,
8,
277,
12,
1564,
304,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
996,
9,
267,
666,
847,
291,
14,
1506,
3160,
8,
1317,
9,
267,
372,
666,
339,
347,
1900,
51,
20267,
8,
277,
12,
1572,
12,
1564,
304,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
1644,
9,
267,
666,
847,
291,
14,
1506,
1558,
8,
923,
9,
267,
666,
847,
291,
14,
1506,
3160,
8,
1317,
9,
267,
372,
666,
339,
347,
1900,
13005,
8,
277,
12,
1572,
304,
267,
291,
14,
923,
63,
1205,
63,
3610,
847,
413,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
966,
9,
267,
666,
847,
291,
14,
1506,
1558,
8,
923,
9,
267,
327,
8904,
1572,
2004,
3414,
267,
666,
847,
2702,
14,
1389,
360,
34,
297,
822,
8,
277,
14,
923,
63,
1205,
63,
3610,
430,
267,
372,
666,
339,
347,
1900,
23679,
8,
277,
12,
1572,
304,
267,
291,
14,
923,
63,
1205,
63,
3610,
847,
413,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
1717,
9,
267,
666,
847,
291,
14,
1506,
1558,
8,
923,
9,
267,
327,
8904,
1572,
2004,
3414,
267,
666,
847,
2702,
14,
1389,
360,
34,
297,
822,
8,
277,
14,
923,
63,
1205,
63,
3610,
430,
267,
372,
666,
339,
347,
1900,
22638,
8,
277,
12,
1564,
304,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
1690,
9,
267,
372,
666,
339,
347,
1900,
22638,
11622,
8,
277,
12,
1564,
304,
267,
666,
275,
291,
14,
1506,
2567,
342,
267,
666,
847,
8678,
8,
16,
88,
1780,
9,
267,
372,
666,
199,
199,
692,
636,
354,
363,
508,
2560,
973,
3706,
272,
1315,
264,
275,
3107,
264,
3658,
360,
4195,
14,
16,
14,
16,
14,
17,
358,
272,
666,
275,
1315,
264,
14,
1506,
26436,
342,
272,
870,
1315,
264,
14,
1122,
26436,
8,
576,
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,
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,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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
] |
yaojingwu1992/XlsxWriter
|
xlsxwriter/test/sharedstrings/test_write_sst.py
|
8
|
1422
|
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...sharedstrings import SharedStringTable
from ...sharedstrings import SharedStrings
class TestWriteSst(unittest.TestCase):
"""
Test the SharedStrings _write_sst() method.
"""
def setUp(self):
self.fh = StringIO()
self.sharedstrings = SharedStrings()
self.sharedstrings._set_filehandle(self.fh)
def test_write_sst(self):
"""Test the _write_sst() method"""
string_table = SharedStringTable()
# Add some strings and check the returned indices.
string_table._get_shared_string_index('neptune')
string_table._get_shared_string_index('neptune')
string_table._get_shared_string_index('neptune')
string_table._get_shared_string_index('mars')
string_table._get_shared_string_index('venus')
string_table._get_shared_string_index('mars')
string_table._get_shared_string_index('venus')
self.sharedstrings.string_table = string_table
self.sharedstrings._write_sst()
exp = """<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="7" uniqueCount="3">"""
got = self.fh.getvalue()
self.assertEqual(got, exp)
|
bsd-2-clause
|
[
11490,
199,
3,
199,
3,
6496,
367,
1323,
478,
88,
6261,
14,
199,
3,
199,
3,
1898,
334,
67,
395,
6171,
13,
7806,
12,
17815,
22895,
46,
455,
17956,
12,
1335,
5466,
17811,
17956,
32,
1850,
290,
14,
1308,
199,
3,
199,
199,
646,
2882,
199,
504,
2263,
15390,
492,
5228,
199,
504,
2263,
5555,
5465,
492,
23752,
1558,
3186,
199,
504,
2263,
5555,
5465,
492,
23752,
12672,
421,
199,
533,
1379,
3534,
51,
270,
8,
2796,
14,
1746,
304,
272,
408,
272,
1379,
314,
23752,
12672,
485,
952,
63,
83,
270,
342,
1083,
14,
339,
408,
339,
347,
3613,
8,
277,
304,
267,
291,
14,
12853,
275,
5228,
342,
267,
291,
14,
5555,
5465,
275,
23752,
12672,
342,
267,
291,
14,
5555,
5465,
423,
409,
63,
493,
2479,
8,
277,
14,
12853,
9,
339,
347,
511,
63,
952,
63,
83,
270,
8,
277,
304,
267,
408,
774,
314,
485,
952,
63,
83,
270,
342,
1083,
624,
398,
1059,
63,
1224,
275,
23752,
1558,
3186,
342,
398,
327,
2654,
2005,
3326,
436,
1104,
314,
2138,
4918,
14,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
685,
541,
11474,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
685,
541,
11474,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
685,
541,
11474,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
77,
4291,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
1856,
527,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
77,
4291,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
1856,
527,
358,
267,
291,
14,
5555,
5465,
14,
875,
63,
1224,
275,
1059,
63,
1224,
398,
291,
14,
5555,
5465,
423,
952,
63,
83,
270,
342,
398,
1437,
275,
8894,
83,
270,
9604,
628,
1014,
921,
9482,
14,
1490,
10198,
276,
269,
569,
83,
14,
1308,
15,
19930,
757,
15,
7968,
15,
973,
2,
2338,
628,
23,
2,
3747,
2353,
628,
19,
1743,
624,
267,
4788,
275,
291,
14,
12853,
14,
7150,
342,
398,
291,
14,
629,
8,
7808,
12,
1437,
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
] |
[
199,
3,
199,
3,
6496,
367,
1323,
478,
88,
6261,
14,
199,
3,
199,
3,
1898,
334,
67,
395,
6171,
13,
7806,
12,
17815,
22895,
46,
455,
17956,
12,
1335,
5466,
17811,
17956,
32,
1850,
290,
14,
1308,
199,
3,
199,
199,
646,
2882,
199,
504,
2263,
15390,
492,
5228,
199,
504,
2263,
5555,
5465,
492,
23752,
1558,
3186,
199,
504,
2263,
5555,
5465,
492,
23752,
12672,
421,
199,
533,
1379,
3534,
51,
270,
8,
2796,
14,
1746,
304,
272,
408,
272,
1379,
314,
23752,
12672,
485,
952,
63,
83,
270,
342,
1083,
14,
339,
408,
339,
347,
3613,
8,
277,
304,
267,
291,
14,
12853,
275,
5228,
342,
267,
291,
14,
5555,
5465,
275,
23752,
12672,
342,
267,
291,
14,
5555,
5465,
423,
409,
63,
493,
2479,
8,
277,
14,
12853,
9,
339,
347,
511,
63,
952,
63,
83,
270,
8,
277,
304,
267,
408,
774,
314,
485,
952,
63,
83,
270,
342,
1083,
624,
398,
1059,
63,
1224,
275,
23752,
1558,
3186,
342,
398,
327,
2654,
2005,
3326,
436,
1104,
314,
2138,
4918,
14,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
685,
541,
11474,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
685,
541,
11474,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
685,
541,
11474,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
77,
4291,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
1856,
527,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
77,
4291,
358,
267,
1059,
63,
1224,
423,
362,
63,
5555,
63,
875,
63,
1080,
360,
1856,
527,
358,
267,
291,
14,
5555,
5465,
14,
875,
63,
1224,
275,
1059,
63,
1224,
398,
291,
14,
5555,
5465,
423,
952,
63,
83,
270,
342,
398,
1437,
275,
8894,
83,
270,
9604,
628,
1014,
921,
9482,
14,
1490,
10198,
276,
269,
569,
83,
14,
1308,
15,
19930,
757,
15,
7968,
15,
973,
2,
2338,
628,
23,
2,
3747,
2353,
628,
19,
1743,
624,
267,
4788,
275,
291,
14,
12853,
14,
7150,
342,
398,
291,
14,
629,
8,
7808,
12,
1437,
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,
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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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
joker946/nova
|
nova/tests/unit/image/fake.py
|
22
|
9432
|
# Copyright 2011 Justin Santa Barbara
# Copyright 2012 OpenStack Foundation
# 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.
"""Implementation of a fake image service."""
import copy
import datetime
import uuid
from oslo_config import cfg
from oslo_log import log as logging
from nova.compute import arch
from nova import exception
import nova.image.glance
CONF = cfg.CONF
CONF.import_opt('null_kernel', 'nova.compute.api')
LOG = logging.getLogger(__name__)
AUTO_DISK_CONFIG_ENABLED_IMAGE_UUID = '70a599e0-31e7-49b7-b260-868f441e862b'
class _FakeImageService(object):
"""Mock (fake) image service for unit testing."""
def __init__(self):
self.images = {}
# NOTE(justinsb): The OpenStack API can't upload an image?
# So, make sure we've got one..
timestamp = datetime.datetime(2011, 1, 1, 1, 2, 3)
image1 = {'id': '155d900f-4e14-4e4c-a73d-069cbf4541e6',
'name': 'fakeimage123456',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': False,
'container_format': 'raw',
'disk_format': 'raw',
'size': '25165824',
'properties': {'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel,
'architecture': arch.X86_64}}
image2 = {'id': 'a2459075-d96c-40d5-893e-577ff92e721c',
'name': 'fakeimage123456',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': True,
'container_format': 'ami',
'disk_format': 'ami',
'size': '58145823',
'properties': {'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel}}
image3 = {'id': '76fa36fc-c930-4bf3-8c8a-ea2a2420deb6',
'name': 'fakeimage123456',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': True,
'container_format': None,
'disk_format': None,
'size': '83594576',
'properties': {'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel}}
image4 = {'id': 'cedef40a-ed67-4d10-800e-17455edce175',
'name': 'fakeimage123456',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': True,
'container_format': 'ami',
'disk_format': 'ami',
'size': '84035174',
'properties': {'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel}}
image5 = {'id': 'c905cedb-7281-47e4-8a62-f26bc5fc4c77',
'name': 'fakeimage123456',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': True,
'container_format': 'ami',
'disk_format': 'ami',
'size': '26360814',
'properties': {'kernel_id':
'155d900f-4e14-4e4c-a73d-069cbf4541e6',
'ramdisk_id': None}}
image6 = {'id': 'a440c04b-79fa-479c-bed1-0b816eaec379',
'name': 'fakeimage6',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': False,
'container_format': 'ova',
'disk_format': 'vhd',
'size': '49163826',
'properties': {'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel,
'architecture': arch.X86_64,
'auto_disk_config': 'False'}}
image7 = {'id': AUTO_DISK_CONFIG_ENABLED_IMAGE_UUID,
'name': 'fakeimage7',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': False,
'container_format': 'ova',
'disk_format': 'vhd',
'size': '74185822',
'properties': {'kernel_id': CONF.null_kernel,
'ramdisk_id': CONF.null_kernel,
'architecture': arch.X86_64,
'auto_disk_config': 'True'}}
self.create(None, image1)
self.create(None, image2)
self.create(None, image3)
self.create(None, image4)
self.create(None, image5)
self.create(None, image6)
self.create(None, image7)
self._imagedata = {}
super(_FakeImageService, self).__init__()
# TODO(bcwaldon): implement optional kwargs such as limit, sort_dir
def detail(self, context, **kwargs):
"""Return list of detailed image information."""
return copy.deepcopy(self.images.values())
def download(self, context, image_id, dst_path=None, data=None):
self.show(context, image_id)
if data:
data.write(self._imagedata.get(image_id, ''))
elif dst_path:
with open(dst_path, 'wb') as data:
data.write(self._imagedata.get(image_id, ''))
def show(self, context, image_id, include_locations=False,
show_deleted=True):
"""Get data about specified image.
Returns a dict containing image data for the given opaque image id.
"""
image = self.images.get(str(image_id))
if image:
return copy.deepcopy(image)
LOG.warning('Unable to find image id %s. Have images: %s',
image_id, self.images)
raise exception.ImageNotFound(image_id=image_id)
def create(self, context, metadata, data=None):
"""Store the image data and return the new image id.
:raises: Duplicate if the image already exist.
"""
image_id = str(metadata.get('id', uuid.uuid4()))
metadata['id'] = image_id
if image_id in self.images:
raise exception.CouldNotUploadImage(image_id=image_id)
self.images[image_id] = copy.deepcopy(metadata)
if data:
self._imagedata[image_id] = data.read()
return self.images[image_id]
def update(self, context, image_id, metadata, data=None,
purge_props=False):
"""Replace the contents of the given image with the new data.
:raises: ImageNotFound if the image does not exist.
"""
if not self.images.get(image_id):
raise exception.ImageNotFound(image_id=image_id)
if purge_props:
self.images[image_id] = copy.deepcopy(metadata)
else:
image = self.images[image_id]
try:
image['properties'].update(metadata.pop('properties'))
except KeyError:
pass
image.update(metadata)
return self.images[image_id]
def delete(self, context, image_id):
"""Delete the given image.
:raises: ImageNotFound if the image does not exist.
"""
removed = self.images.pop(image_id, None)
if not removed:
raise exception.ImageNotFound(image_id=image_id)
def get_location(self, context, image_id):
if image_id in self.images:
return 'fake_location'
return None
_fakeImageService = _FakeImageService()
def FakeImageService():
return _fakeImageService
def FakeImageService_reset():
global _fakeImageService
_fakeImageService = _FakeImageService()
def get_valid_image_id():
return AUTO_DISK_CONFIG_ENABLED_IMAGE_UUID
def stub_out_image_service(stubs):
image_service = FakeImageService()
stubs.Set(nova.image.glance, 'get_remote_image_service',
lambda x, y: (image_service, y))
stubs.Set(nova.image.glance, 'get_default_image_service',
lambda: image_service)
return image_service
|
apache-2.0
|
[
3,
1898,
7760,
13870,
262,
29359,
502,
12377,
1700,
65,
199,
3,
1898,
6029,
14260,
2752,
199,
3,
2900,
5924,
5702,
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,
624,
7921,
402,
282,
4026,
1834,
2435,
1041,
199,
199,
646,
1331,
199,
646,
2197,
199,
646,
5377,
199,
199,
504,
11258,
63,
888,
492,
4810,
199,
504,
11258,
63,
793,
492,
943,
465,
2050,
199,
199,
504,
5913,
14,
3357,
492,
3819,
199,
504,
5913,
492,
1919,
199,
646,
5913,
14,
1569,
14,
18773,
199,
199,
3103,
275,
4810,
14,
3103,
199,
3103,
14,
646,
63,
2992,
360,
2307,
63,
4989,
297,
283,
6765,
14,
3357,
14,
1246,
358,
199,
4947,
275,
2050,
14,
5572,
3460,
354,
3368,
199,
13883,
63,
20492,
63,
5569,
63,
15704,
63,
9438,
63,
8757,
275,
283,
2760,
65,
30859,
69,
16,
13,
2192,
69,
23,
13,
1887,
66,
23,
13,
66,
13085,
13,
15430,
70,
24284,
69,
16414,
66,
7,
421,
199,
533,
485,
8249,
3491,
3167,
8,
785,
304,
272,
408,
3346,
334,
3183,
9,
1834,
2435,
367,
4137,
5343,
1041,
339,
347,
636,
826,
721,
277,
304,
267,
291,
14,
4782,
275,
1052,
267,
327,
6944,
8,
4764,
3617,
66,
304,
710,
14260,
3261,
883,
1133,
5802,
376,
1834,
31,
267,
327,
2002,
12,
1852,
3238,
781,
9064,
4788,
1373,
703,
267,
4913,
275,
2197,
14,
2083,
8,
8128,
12,
413,
12,
413,
12,
413,
12,
499,
12,
650,
9,
398,
1834,
17,
275,
791,
344,
356,
283,
11520,
68,
17518,
70,
13,
20,
69,
1079,
13,
20,
69,
20,
67,
13,
65,
2898,
68,
13,
18264,
2894,
70,
12383,
17,
69,
22,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
756,
12,
326,
283,
3600,
63,
908,
356,
283,
1773,
297,
326,
283,
4032,
63,
908,
356,
283,
1773,
297,
326,
283,
890,
356,
283,
821,
975,
2010,
1194,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
6392,
14,
2307,
63,
4989,
12,
1816,
283,
26541,
63,
344,
356,
6392,
14,
2307,
63,
4989,
12,
1816,
283,
19134,
356,
3819,
14,
56,
1184,
63,
772,
4863,
398,
1834,
18,
275,
791,
344,
356,
283,
65,
1194,
1427,
19339,
13,
68,
2534,
67,
13,
2167,
68,
21,
13,
14590,
69,
13,
13539,
556,
2942,
69,
23,
2025,
67,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
283,
13496,
297,
326,
283,
4032,
63,
908,
356,
283,
13496,
297,
326,
283,
890,
356,
283,
2010,
1079,
2010,
1789,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
6392,
14,
2307,
63,
4989,
12,
1816,
283,
26541,
63,
344,
356,
6392,
14,
2307,
63,
4989,
4863,
398,
1834,
19,
275,
791,
344,
356,
283,
2114,
667,
1344,
3003,
13,
67,
25,
1216,
13,
20,
4361,
19,
13,
24,
67,
24,
65,
13,
4489,
18,
65,
1194,
1165,
16762,
22,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
488,
12,
326,
283,
4032,
63,
908,
356,
488,
12,
326,
283,
890,
356,
283,
32065,
2635,
12255,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
6392,
14,
2307,
63,
4989,
12,
1816,
283,
26541,
63,
344,
356,
6392,
14,
2307,
63,
4989,
4863,
398,
1834,
20,
275,
791,
344,
356,
283,
301,
318,
2167,
65,
13,
379,
1822,
13,
20,
68,
709,
13,
6718,
69,
13,
9892,
1229,
379,
301,
10848,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
283,
13496,
297,
326,
283,
4032,
63,
908,
356,
283,
13496,
297,
326,
283,
890,
356,
283,
13462,
1276,
9892,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
6392,
14,
2307,
63,
4989,
12,
1816,
283,
26541,
63,
344,
356,
6392,
14,
2307,
63,
4989,
4863,
398,
1834,
21,
275,
791,
344,
356,
283,
67,
29888,
301,
697,
13,
23,
16263,
13,
2417,
69,
20,
13,
24,
65,
2789,
13,
70,
1479,
3776,
21,
3003,
20,
67,
1138,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326
] |
[
1898,
7760,
13870,
262,
29359,
502,
12377,
1700,
65,
199,
3,
1898,
6029,
14260,
2752,
199,
3,
2900,
5924,
5702,
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,
624,
7921,
402,
282,
4026,
1834,
2435,
1041,
199,
199,
646,
1331,
199,
646,
2197,
199,
646,
5377,
199,
199,
504,
11258,
63,
888,
492,
4810,
199,
504,
11258,
63,
793,
492,
943,
465,
2050,
199,
199,
504,
5913,
14,
3357,
492,
3819,
199,
504,
5913,
492,
1919,
199,
646,
5913,
14,
1569,
14,
18773,
199,
199,
3103,
275,
4810,
14,
3103,
199,
3103,
14,
646,
63,
2992,
360,
2307,
63,
4989,
297,
283,
6765,
14,
3357,
14,
1246,
358,
199,
4947,
275,
2050,
14,
5572,
3460,
354,
3368,
199,
13883,
63,
20492,
63,
5569,
63,
15704,
63,
9438,
63,
8757,
275,
283,
2760,
65,
30859,
69,
16,
13,
2192,
69,
23,
13,
1887,
66,
23,
13,
66,
13085,
13,
15430,
70,
24284,
69,
16414,
66,
7,
421,
199,
533,
485,
8249,
3491,
3167,
8,
785,
304,
272,
408,
3346,
334,
3183,
9,
1834,
2435,
367,
4137,
5343,
1041,
339,
347,
636,
826,
721,
277,
304,
267,
291,
14,
4782,
275,
1052,
267,
327,
6944,
8,
4764,
3617,
66,
304,
710,
14260,
3261,
883,
1133,
5802,
376,
1834,
31,
267,
327,
2002,
12,
1852,
3238,
781,
9064,
4788,
1373,
703,
267,
4913,
275,
2197,
14,
2083,
8,
8128,
12,
413,
12,
413,
12,
413,
12,
499,
12,
650,
9,
398,
1834,
17,
275,
791,
344,
356,
283,
11520,
68,
17518,
70,
13,
20,
69,
1079,
13,
20,
69,
20,
67,
13,
65,
2898,
68,
13,
18264,
2894,
70,
12383,
17,
69,
22,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
756,
12,
326,
283,
3600,
63,
908,
356,
283,
1773,
297,
326,
283,
4032,
63,
908,
356,
283,
1773,
297,
326,
283,
890,
356,
283,
821,
975,
2010,
1194,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
6392,
14,
2307,
63,
4989,
12,
1816,
283,
26541,
63,
344,
356,
6392,
14,
2307,
63,
4989,
12,
1816,
283,
19134,
356,
3819,
14,
56,
1184,
63,
772,
4863,
398,
1834,
18,
275,
791,
344,
356,
283,
65,
1194,
1427,
19339,
13,
68,
2534,
67,
13,
2167,
68,
21,
13,
14590,
69,
13,
13539,
556,
2942,
69,
23,
2025,
67,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
283,
13496,
297,
326,
283,
4032,
63,
908,
356,
283,
13496,
297,
326,
283,
890,
356,
283,
2010,
1079,
2010,
1789,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
6392,
14,
2307,
63,
4989,
12,
1816,
283,
26541,
63,
344,
356,
6392,
14,
2307,
63,
4989,
4863,
398,
1834,
19,
275,
791,
344,
356,
283,
2114,
667,
1344,
3003,
13,
67,
25,
1216,
13,
20,
4361,
19,
13,
24,
67,
24,
65,
13,
4489,
18,
65,
1194,
1165,
16762,
22,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
488,
12,
326,
283,
4032,
63,
908,
356,
488,
12,
326,
283,
890,
356,
283,
32065,
2635,
12255,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
6392,
14,
2307,
63,
4989,
12,
1816,
283,
26541,
63,
344,
356,
6392,
14,
2307,
63,
4989,
4863,
398,
1834,
20,
275,
791,
344,
356,
283,
301,
318,
2167,
65,
13,
379,
1822,
13,
20,
68,
709,
13,
6718,
69,
13,
9892,
1229,
379,
301,
10848,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
283,
13496,
297,
326,
283,
4032,
63,
908,
356,
283,
13496,
297,
326,
283,
890,
356,
283,
13462,
1276,
9892,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
6392,
14,
2307,
63,
4989,
12,
1816,
283,
26541,
63,
344,
356,
6392,
14,
2307,
63,
4989,
4863,
398,
1834,
21,
275,
791,
344,
356,
283,
67,
29888,
301,
697,
13,
23,
16263,
13,
2417,
69,
20,
13,
24,
65,
2789,
13,
70,
1479,
3776,
21,
3003,
20,
67,
1138,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,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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
] |
jmcarp/django
|
django/core/management/__init__.py
|
32
|
13476
|
from __future__ import unicode_literals
import collections
import os
import pkgutil
import sys
from importlib import import_module
import django
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import (
BaseCommand, CommandError, CommandParser, handle_default_options,
)
from django.core.management.color import color_style
from django.utils import lru_cache, six
from django.utils._os import npath, upath
def find_commands(management_dir):
"""
Given a path to a management directory, returns a list of all the command
names that are available.
Returns an empty list if no commands are defined.
"""
command_dir = os.path.join(management_dir, 'commands')
return [name for _, name, is_pkg in pkgutil.iter_modules([npath(command_dir)])
if not is_pkg and not name.startswith('_')]
def load_command_class(app_name, name):
"""
Given a command name and an application name, returns the Command
class instance. All errors raised by the import process
(ImportError, AttributeError) are allowed to propagate.
"""
module = import_module('%s.management.commands.%s' % (app_name, name))
return module.Command()
@lru_cache.lru_cache(maxsize=None)
def get_commands():
"""
Returns a dictionary mapping command names to their callback applications.
This works by looking for a management.commands package in django.core, and
in each installed application -- if a commands package exists, all commands
in that package are registered.
Core commands are always included. If a settings module has been
specified, user-defined commands will also be included.
The dictionary is in the format {command_name: app_name}. Key-value
pairs from this dictionary can then be used in calls to
load_command_class(app_name, command_name)
If a specific version of a command must be loaded (e.g., with the
startapp command), the instantiated module can be placed in the
dictionary in place of the application name.
The dictionary is cached on the first call and reused on subsequent
calls.
"""
commands = {name: 'django.core' for name in find_commands(upath(__path__[0]))}
if not settings.configured:
return commands
for app_config in reversed(list(apps.get_app_configs())):
path = os.path.join(app_config.path, 'management')
commands.update({name: app_config.name for name in find_commands(path)})
return commands
def call_command(name, *args, **options):
"""
Calls the given command, with the given options and args/kwargs.
This is the primary API you should use for calling specific commands.
Some examples:
call_command('migrate')
call_command('shell', plain=True)
call_command('sqlmigrate', 'myapp')
"""
# Load the command object.
try:
app_name = get_commands()[name]
except KeyError:
raise CommandError("Unknown command: %r" % name)
if isinstance(app_name, BaseCommand):
# If the command is already loaded, use it directly.
command = app_name
else:
command = load_command_class(app_name, name)
# Simulate argument parsing to get the option defaults (see #10080 for details).
parser = command.create_parser('', name)
if command.use_argparse:
# Use the `dest` option name from the parser option
opt_mapping = {sorted(s_opt.option_strings)[0].lstrip('-').replace('-', '_'): s_opt.dest
for s_opt in parser._actions if s_opt.option_strings}
arg_options = {opt_mapping.get(key, key): value for key, value in options.items()}
defaults = parser.parse_args(args=args)
defaults = dict(defaults._get_kwargs(), **arg_options)
# Move positional args out of options to mimic legacy optparse
args = defaults.pop('args', ())
else:
# Legacy optparse method
defaults, _ = parser.parse_args(args=[])
defaults = dict(defaults.__dict__, **options)
if 'skip_checks' not in options:
defaults['skip_checks'] = True
return command.execute(*args, **defaults)
class ManagementUtility(object):
"""
Encapsulates the logic of the django-admin and manage.py utilities.
A ManagementUtility has a number of commands, which can be manipulated
by editing the self.commands dictionary.
"""
def __init__(self, argv=None):
self.argv = argv or sys.argv[:]
self.prog_name = os.path.basename(self.argv[0])
self.settings_exception = None
def main_help_text(self, commands_only=False):
"""
Returns the script's main help text, as a string.
"""
if commands_only:
usage = sorted(get_commands().keys())
else:
usage = [
"",
"Type '%s help <subcommand>' for help on a specific subcommand." % self.prog_name,
"",
"Available subcommands:",
]
commands_dict = collections.defaultdict(lambda: [])
for name, app in six.iteritems(get_commands()):
if app == 'django.core':
app = 'django'
else:
app = app.rpartition('.')[-1]
commands_dict[app].append(name)
style = color_style()
for app in sorted(commands_dict.keys()):
usage.append("")
usage.append(style.NOTICE("[%s]" % app))
for name in sorted(commands_dict[app]):
usage.append(" %s" % name)
# Output an extra note if settings are not properly configured
if self.settings_exception is not None:
usage.append(style.NOTICE(
"Note that only Django core commands are listed "
"as settings are not properly configured (error: %s)."
% self.settings_exception))
return '\n'.join(usage)
def fetch_command(self, subcommand):
"""
Tries to fetch the given subcommand, printing a message with the
appropriate command called from the command line (usually
"django-admin" or "manage.py") if it can't be found.
"""
# Get commands outside of try block to prevent swallowing exceptions
commands = get_commands()
try:
app_name = commands[subcommand]
except KeyError:
if os.environ.get('DJANGO_SETTINGS_MODULE'):
# If `subcommand` is missing due to misconfigured settings, the
# following line will retrigger an ImproperlyConfigured exception
# (get_commands() swallows the original one) so the user is
# informed about it.
settings.INSTALLED_APPS
else:
sys.stderr.write("No Django settings specified.\n")
sys.stderr.write("Unknown command: %r\nType '%s help' for usage.\n" %
(subcommand, self.prog_name))
sys.exit(1)
if isinstance(app_name, BaseCommand):
# If the command is already loaded, use it directly.
klass = app_name
else:
klass = load_command_class(app_name, subcommand)
return klass
def autocomplete(self):
"""
Output completion suggestions for BASH.
The output of this function is passed to BASH's `COMREPLY` variable and
treated as completion suggestions. `COMREPLY` expects a space
separated string as the result.
The `COMP_WORDS` and `COMP_CWORD` BASH environment variables are used
to get information about the cli input. Please refer to the BASH
man-page for more information about this variables.
Subcommand options are saved as pairs. A pair consists of
the long option string (e.g. '--exclude') and a boolean
value indicating if the option requires arguments. When printing to
stdout, an equal sign is appended to options which require arguments.
Note: If debugging this function, it is recommended to write the debug
output in a separate file. Otherwise the debug output will be treated
and formatted as potential completion suggestions.
"""
# Don't complete if user hasn't sourced bash_completion file.
if 'DJANGO_AUTO_COMPLETE' not in os.environ:
return
cwords = os.environ['COMP_WORDS'].split()[1:]
cword = int(os.environ['COMP_CWORD'])
try:
curr = cwords[cword - 1]
except IndexError:
curr = ''
subcommands = list(get_commands()) + ['help']
options = [('--help', False)]
# subcommand
if cword == 1:
print(' '.join(sorted(filter(lambda x: x.startswith(curr), subcommands))))
# subcommand options
# special case: the 'help' subcommand has no options
elif cwords[0] in subcommands and cwords[0] != 'help':
subcommand_cls = self.fetch_command(cwords[0])
# special case: add the names of installed apps to options
if cwords[0] in ('dumpdata', 'sqlmigrate', 'sqlsequencereset', 'test'):
try:
app_configs = apps.get_app_configs()
# Get the last part of the dotted path as the app name.
options.extend((app_config.label, 0) for app_config in app_configs)
except ImportError:
# Fail silently if DJANGO_SETTINGS_MODULE isn't set. The
# user will find out once they execute the command.
pass
parser = subcommand_cls.create_parser('', cwords[0])
if subcommand_cls.use_argparse:
options.extend((sorted(s_opt.option_strings)[0], s_opt.nargs != 0) for s_opt in
parser._actions if s_opt.option_strings)
else:
options.extend((s_opt.get_opt_string(), s_opt.nargs) for s_opt in
parser.option_list)
# filter out previously specified options from available options
prev_opts = [x.split('=')[0] for x in cwords[1:cword - 1]]
options = [opt for opt in options if opt[0] not in prev_opts]
# filter options by current input
options = sorted((k, v) for k, v in options if k.startswith(curr))
for option in options:
opt_label = option[0]
# append '=' to options which require args
if option[1]:
opt_label += '='
print(opt_label)
sys.exit(1)
def execute(self):
"""
Given the command-line arguments, this figures out which subcommand is
being run, creates a parser appropriate to that command, and runs it.
"""
try:
subcommand = self.argv[1]
except IndexError:
subcommand = 'help' # Display help if no arguments were given.
# Preprocess options to extract --settings and --pythonpath.
# These options could affect the commands that are available, so they
# must be processed early.
parser = CommandParser(None, usage="%(prog)s subcommand [options] [args]", add_help=False)
parser.add_argument('--settings')
parser.add_argument('--pythonpath')
parser.add_argument('args', nargs='*') # catch-all
try:
options, args = parser.parse_known_args(self.argv[2:])
handle_default_options(options)
except CommandError:
pass # Ignore any option errors at this point.
no_settings_commands = [
'help', 'version', '--help', '--version', '-h',
'compilemessages', 'makemessages',
'startapp', 'startproject',
]
try:
settings.INSTALLED_APPS
except ImproperlyConfigured as exc:
self.settings_exception = exc
# A handful of built-in management commands work without settings.
# Load the default settings -- where INSTALLED_APPS is empty.
if subcommand in no_settings_commands:
settings.configure()
if settings.configured:
django.setup()
self.autocomplete()
if subcommand == 'help':
if '--commands' in args:
sys.stdout.write(self.main_help_text(commands_only=True) + '\n')
elif len(options.args) < 1:
sys.stdout.write(self.main_help_text() + '\n')
else:
self.fetch_command(options.args[0]).print_help(self.prog_name, options.args[0])
# Special-cases: We want 'django-admin --version' and
# 'django-admin --help' to work, for backwards compatibility.
elif subcommand == 'version' or self.argv[1:] == ['--version']:
sys.stdout.write(django.get_version() + '\n')
elif self.argv[1:] in (['--help'], ['-h']):
sys.stdout.write(self.main_help_text() + '\n')
else:
self.fetch_command(subcommand).run_from_argv(self.argv)
def execute_from_command_line(argv=None):
"""
A simple method that runs a ManagementUtility.
"""
utility = ManagementUtility(argv)
utility.execute()
|
bsd-3-clause
|
[
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
5055,
199,
646,
747,
199,
646,
28728,
199,
646,
984,
199,
504,
14802,
492,
492,
63,
578,
199,
199,
646,
1639,
199,
504,
1639,
14,
5181,
492,
8686,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
1018,
14,
3924,
492,
11897,
199,
504,
1639,
14,
1018,
14,
8110,
14,
1095,
492,
334,
272,
22239,
12,
14393,
12,
5817,
2842,
12,
2429,
63,
885,
63,
1419,
12,
199,
9,
199,
504,
1639,
14,
1018,
14,
8110,
14,
2326,
492,
3164,
63,
2487,
199,
504,
1639,
14,
1208,
492,
634,
6558,
63,
1637,
12,
3816,
199,
504,
1639,
14,
1208,
423,
736,
492,
302,
515,
12,
1536,
1619,
421,
199,
318,
2342,
63,
4405,
8,
8110,
63,
694,
304,
272,
408,
272,
9138,
282,
931,
370,
282,
10041,
2082,
12,
2529,
282,
769,
402,
1006,
314,
1414,
272,
1561,
626,
787,
2808,
14,
339,
1803,
376,
2701,
769,
340,
949,
3718,
787,
3247,
14,
272,
408,
272,
1414,
63,
694,
275,
747,
14,
515,
14,
904,
8,
8110,
63,
694,
12,
283,
4405,
358,
272,
372,
359,
354,
367,
5501,
536,
12,
365,
63,
4600,
315,
28728,
14,
1661,
63,
3112,
779,
78,
515,
8,
1531,
63,
694,
3948,
288,
340,
440,
365,
63,
4600,
436,
440,
536,
14,
2460,
6412,
5440,
421,
199,
318,
2248,
63,
1531,
63,
533,
8,
571,
63,
354,
12,
536,
304,
272,
408,
272,
9138,
282,
1414,
536,
436,
376,
4223,
536,
12,
2529,
314,
5817,
272,
1021,
1256,
14,
2900,
2552,
4915,
701,
314,
492,
2112,
272,
334,
17825,
12,
4281,
9,
787,
4370,
370,
19843,
14,
272,
408,
272,
859,
275,
492,
63,
578,
3508,
83,
14,
8110,
14,
4405,
4111,
83,
7,
450,
334,
571,
63,
354,
12,
536,
430,
272,
372,
859,
14,
3110,
342,
421,
199,
32,
25003,
63,
1637,
14,
25003,
63,
1637,
8,
13634,
29,
403,
9,
199,
318,
664,
63,
4405,
837,
272,
408,
272,
1803,
282,
2600,
4412,
1414,
1561,
370,
3932,
3233,
13103,
14,
339,
961,
5419,
701,
10023,
367,
282,
10041,
14,
4405,
2559,
315,
1639,
14,
1018,
12,
436,
272,
315,
1924,
4903,
4223,
1553,
340,
282,
3718,
2559,
3495,
12,
1006,
3718,
272,
315,
626,
2559,
787,
7264,
14,
339,
11672,
3718,
787,
3544,
5120,
14,
982,
282,
2202,
859,
965,
2757,
272,
2013,
12,
922,
13,
4037,
3718,
911,
2597,
506,
5120,
14,
339,
710,
2600,
365,
315,
314,
1475,
469,
1531,
63,
354,
26,
1145,
63,
354,
5565,
2606,
13,
585,
272,
6342,
687,
642,
2600,
883,
2066,
506,
1202,
315,
4882,
370,
272,
2248,
63,
1531,
63,
533,
8,
571,
63,
354,
12,
1414,
63,
354,
9,
339,
982,
282,
2488,
1015,
402,
282,
1414,
1471,
506,
6511,
334,
69,
14,
71,
2020,
543,
314,
272,
1343,
571,
1414,
395,
314,
17544,
859,
883,
506,
15090,
315,
314,
272,
2600,
315,
4192,
402,
314,
4223,
536,
14,
339,
710,
2600,
365,
6328,
641,
314,
1642,
1240,
436,
24826,
641,
13372,
272,
4882,
14,
272,
408,
272,
3718,
275,
469,
354,
26,
283,
1176,
14,
1018,
7,
367,
536,
315,
2342,
63,
4405,
8,
384,
1619,
3460,
515,
12298,
16,
2459,
93,
339,
340,
440,
2202,
14,
11786,
26,
267,
372,
3718,
339,
367,
1145,
63,
888,
315,
10822,
8,
513,
8,
5181,
14,
362,
63,
571,
63,
7532,
28256,
267,
931,
275,
747,
14,
515,
14,
904,
8,
571,
63,
888,
14,
515,
12,
283,
8110,
358,
267,
3718,
14,
873,
2561,
354,
26,
1145,
63,
888,
14,
354,
367,
536,
315,
2342,
63,
4405,
8,
515,
11466,
339,
372,
3718,
421,
199,
318,
1240,
63,
1531,
8,
354,
12,
627,
589,
12,
1011,
1419,
304,
272,
408,
272,
28055,
314,
1627,
1414,
12,
543,
314,
1627,
1511,
436,
1249,
15,
958,
14,
339,
961,
365,
314,
5062,
3261,
1265,
1077,
675,
367,
6358,
2488,
3718,
14,
339,
6601,
7251,
26,
267,
1240,
63,
1531,
360,
8462,
358,
267,
1240,
63,
1531,
360,
5641,
297,
8971,
29,
549,
9,
267,
1240,
63,
1531,
360,
3009,
8462,
297,
283,
1662,
571,
358,
272,
408,
272,
327,
7190,
314,
1414,
909,
14,
272,
862,
26,
267,
1145,
63,
354,
275,
664,
63,
4405,
3430,
354,
61,
272,
871,
4067,
26,
267,
746,
14393,
480,
5912,
1414,
26,
450,
82,
2,
450,
536,
9,
339,
340,
1228,
8,
571,
63,
354,
12,
22239,
304,
267,
327,
982,
314,
1414,
365,
2575,
6511,
12,
675,
652,
5370,
14,
267,
1414,
275,
1145,
63,
354,
272,
587,
26,
267,
1414,
275,
2248,
63,
1531,
63,
533,
8,
571,
63,
354,
12,
536,
9,
339,
327,
10751,
5434,
1423,
6057,
370,
664,
314,
945,
4243,
334,
3239,
327,
1960,
1257,
367,
2436,
680,
272,
1798,
275,
1414,
14,
981,
63,
2087,
8594,
536,
9,
272,
340,
1414,
14,
1180,
63,
18978,
26,
267,
327,
3645,
314,
658,
2614,
64,
945,
536,
687,
314,
1798,
945,
267,
2450,
63,
4745,
275,
469,
5917,
8,
83,
63,
2992,
14,
1422,
63,
5465,
2788,
16,
1055,
10124,
3654,
1959,
1814,
13858,
2513,
735,
308,
63,
2992,
14,
2614,
2432,
367,
308,
63,
2992,
315,
1798,
423,
3723,
340,
308,
63,
2992,
14,
1422,
63,
5465,
93,
267,
1680,
63,
1419,
275,
469,
2992,
63,
4745,
14,
362,
8,
498,
12,
790,
304,
574,
367,
790,
12,
574,
315,
1511,
14,
1744,
12737,
267,
4243,
275,
1798,
14,
1122,
63,
589,
8,
589,
29,
589,
9,
267,
4243,
275,
1211,
8,
4322,
423,
362,
63,
958,
1062,
1011,
1273,
63,
1419,
9,
267,
327,
14171,
11333,
1249,
734,
402,
1511,
370,
24102,
530,
12139,
8691,
267,
1249,
275,
4243,
14,
1935,
360,
589,
297,
14515,
272,
587,
26,
267,
327,
26251,
8691,
1083,
267,
4243,
12,
485,
275,
1798,
14,
1122,
63,
589,
8,
589,
14285,
267,
4243,
275,
1211,
8,
4322,
855,
807,
3108,
1011,
1419,
9,
272,
340,
283,
2759,
63,
8625,
7,
440,
315,
1511,
26,
267,
4243,
459,
2759,
63,
8625,
418,
275,
715,
339,
372,
1414,
14,
2526,
2031,
589,
12,
1011,
4322,
9,
421,
199,
533,
8259,
17505,
8,
785,
304,
272,
408,
272
] |
[
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
5055,
199,
646,
747,
199,
646,
28728,
199,
646,
984,
199,
504,
14802,
492,
492,
63,
578,
199,
199,
646,
1639,
199,
504,
1639,
14,
5181,
492,
8686,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
1018,
14,
3924,
492,
11897,
199,
504,
1639,
14,
1018,
14,
8110,
14,
1095,
492,
334,
272,
22239,
12,
14393,
12,
5817,
2842,
12,
2429,
63,
885,
63,
1419,
12,
199,
9,
199,
504,
1639,
14,
1018,
14,
8110,
14,
2326,
492,
3164,
63,
2487,
199,
504,
1639,
14,
1208,
492,
634,
6558,
63,
1637,
12,
3816,
199,
504,
1639,
14,
1208,
423,
736,
492,
302,
515,
12,
1536,
1619,
421,
199,
318,
2342,
63,
4405,
8,
8110,
63,
694,
304,
272,
408,
272,
9138,
282,
931,
370,
282,
10041,
2082,
12,
2529,
282,
769,
402,
1006,
314,
1414,
272,
1561,
626,
787,
2808,
14,
339,
1803,
376,
2701,
769,
340,
949,
3718,
787,
3247,
14,
272,
408,
272,
1414,
63,
694,
275,
747,
14,
515,
14,
904,
8,
8110,
63,
694,
12,
283,
4405,
358,
272,
372,
359,
354,
367,
5501,
536,
12,
365,
63,
4600,
315,
28728,
14,
1661,
63,
3112,
779,
78,
515,
8,
1531,
63,
694,
3948,
288,
340,
440,
365,
63,
4600,
436,
440,
536,
14,
2460,
6412,
5440,
421,
199,
318,
2248,
63,
1531,
63,
533,
8,
571,
63,
354,
12,
536,
304,
272,
408,
272,
9138,
282,
1414,
536,
436,
376,
4223,
536,
12,
2529,
314,
5817,
272,
1021,
1256,
14,
2900,
2552,
4915,
701,
314,
492,
2112,
272,
334,
17825,
12,
4281,
9,
787,
4370,
370,
19843,
14,
272,
408,
272,
859,
275,
492,
63,
578,
3508,
83,
14,
8110,
14,
4405,
4111,
83,
7,
450,
334,
571,
63,
354,
12,
536,
430,
272,
372,
859,
14,
3110,
342,
421,
199,
32,
25003,
63,
1637,
14,
25003,
63,
1637,
8,
13634,
29,
403,
9,
199,
318,
664,
63,
4405,
837,
272,
408,
272,
1803,
282,
2600,
4412,
1414,
1561,
370,
3932,
3233,
13103,
14,
339,
961,
5419,
701,
10023,
367,
282,
10041,
14,
4405,
2559,
315,
1639,
14,
1018,
12,
436,
272,
315,
1924,
4903,
4223,
1553,
340,
282,
3718,
2559,
3495,
12,
1006,
3718,
272,
315,
626,
2559,
787,
7264,
14,
339,
11672,
3718,
787,
3544,
5120,
14,
982,
282,
2202,
859,
965,
2757,
272,
2013,
12,
922,
13,
4037,
3718,
911,
2597,
506,
5120,
14,
339,
710,
2600,
365,
315,
314,
1475,
469,
1531,
63,
354,
26,
1145,
63,
354,
5565,
2606,
13,
585,
272,
6342,
687,
642,
2600,
883,
2066,
506,
1202,
315,
4882,
370,
272,
2248,
63,
1531,
63,
533,
8,
571,
63,
354,
12,
1414,
63,
354,
9,
339,
982,
282,
2488,
1015,
402,
282,
1414,
1471,
506,
6511,
334,
69,
14,
71,
2020,
543,
314,
272,
1343,
571,
1414,
395,
314,
17544,
859,
883,
506,
15090,
315,
314,
272,
2600,
315,
4192,
402,
314,
4223,
536,
14,
339,
710,
2600,
365,
6328,
641,
314,
1642,
1240,
436,
24826,
641,
13372,
272,
4882,
14,
272,
408,
272,
3718,
275,
469,
354,
26,
283,
1176,
14,
1018,
7,
367,
536,
315,
2342,
63,
4405,
8,
384,
1619,
3460,
515,
12298,
16,
2459,
93,
339,
340,
440,
2202,
14,
11786,
26,
267,
372,
3718,
339,
367,
1145,
63,
888,
315,
10822,
8,
513,
8,
5181,
14,
362,
63,
571,
63,
7532,
28256,
267,
931,
275,
747,
14,
515,
14,
904,
8,
571,
63,
888,
14,
515,
12,
283,
8110,
358,
267,
3718,
14,
873,
2561,
354,
26,
1145,
63,
888,
14,
354,
367,
536,
315,
2342,
63,
4405,
8,
515,
11466,
339,
372,
3718,
421,
199,
318,
1240,
63,
1531,
8,
354,
12,
627,
589,
12,
1011,
1419,
304,
272,
408,
272,
28055,
314,
1627,
1414,
12,
543,
314,
1627,
1511,
436,
1249,
15,
958,
14,
339,
961,
365,
314,
5062,
3261,
1265,
1077,
675,
367,
6358,
2488,
3718,
14,
339,
6601,
7251,
26,
267,
1240,
63,
1531,
360,
8462,
358,
267,
1240,
63,
1531,
360,
5641,
297,
8971,
29,
549,
9,
267,
1240,
63,
1531,
360,
3009,
8462,
297,
283,
1662,
571,
358,
272,
408,
272,
327,
7190,
314,
1414,
909,
14,
272,
862,
26,
267,
1145,
63,
354,
275,
664,
63,
4405,
3430,
354,
61,
272,
871,
4067,
26,
267,
746,
14393,
480,
5912,
1414,
26,
450,
82,
2,
450,
536,
9,
339,
340,
1228,
8,
571,
63,
354,
12,
22239,
304,
267,
327,
982,
314,
1414,
365,
2575,
6511,
12,
675,
652,
5370,
14,
267,
1414,
275,
1145,
63,
354,
272,
587,
26,
267,
1414,
275,
2248,
63,
1531,
63,
533,
8,
571,
63,
354,
12,
536,
9,
339,
327,
10751,
5434,
1423,
6057,
370,
664,
314,
945,
4243,
334,
3239,
327,
1960,
1257,
367,
2436,
680,
272,
1798,
275,
1414,
14,
981,
63,
2087,
8594,
536,
9,
272,
340,
1414,
14,
1180,
63,
18978,
26,
267,
327,
3645,
314,
658,
2614,
64,
945,
536,
687,
314,
1798,
945,
267,
2450,
63,
4745,
275,
469,
5917,
8,
83,
63,
2992,
14,
1422,
63,
5465,
2788,
16,
1055,
10124,
3654,
1959,
1814,
13858,
2513,
735,
308,
63,
2992,
14,
2614,
2432,
367,
308,
63,
2992,
315,
1798,
423,
3723,
340,
308,
63,
2992,
14,
1422,
63,
5465,
93,
267,
1680,
63,
1419,
275,
469,
2992,
63,
4745,
14,
362,
8,
498,
12,
790,
304,
574,
367,
790,
12,
574,
315,
1511,
14,
1744,
12737,
267,
4243,
275,
1798,
14,
1122,
63,
589,
8,
589,
29,
589,
9,
267,
4243,
275,
1211,
8,
4322,
423,
362,
63,
958,
1062,
1011,
1273,
63,
1419,
9,
267,
327,
14171,
11333,
1249,
734,
402,
1511,
370,
24102,
530,
12139,
8691,
267,
1249,
275,
4243,
14,
1935,
360,
589,
297,
14515,
272,
587,
26,
267,
327,
26251,
8691,
1083,
267,
4243,
12,
485,
275,
1798,
14,
1122,
63,
589,
8,
589,
14285,
267,
4243,
275,
1211,
8,
4322,
855,
807,
3108,
1011,
1419,
9,
272,
340,
283,
2759,
63,
8625,
7,
440,
315,
1511,
26,
267,
4243,
459,
2759,
63,
8625,
418,
275,
715,
339,
372,
1414,
14,
2526,
2031,
589,
12,
1011,
4322,
9,
421,
199,
533,
8259,
17505,
8,
785,
304,
272,
408,
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,
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
] |
ABaldwinHunter/django-clone-classic
|
tests/middleware_exceptions/tests.py
|
119
|
44368
|
import sys
from django.conf import settings
from django.core.exceptions import MiddlewareNotUsed
from django.core.signals import got_request_exception
from django.http import HttpResponse
from django.template import engines
from django.template.response import TemplateResponse
from django.test import RequestFactory, SimpleTestCase, override_settings
from django.test.utils import patch_logger
class TestException(Exception):
pass
# A middleware base class that tracks which methods have been called
class TestMiddleware(object):
def __init__(self):
self.process_request_called = False
self.process_view_called = False
self.process_response_called = False
self.process_template_response_called = False
self.process_exception_called = False
def process_request(self, request):
self.process_request_called = True
def process_view(self, request, view_func, view_args, view_kwargs):
self.process_view_called = True
def process_template_response(self, request, response):
self.process_template_response_called = True
return response
def process_response(self, request, response):
self.process_response_called = True
return response
def process_exception(self, request, exception):
self.process_exception_called = True
# Middleware examples that do the right thing
class RequestMiddleware(TestMiddleware):
def process_request(self, request):
super(RequestMiddleware, self).process_request(request)
return HttpResponse('Request Middleware')
class ViewMiddleware(TestMiddleware):
def process_view(self, request, view_func, view_args, view_kwargs):
super(ViewMiddleware, self).process_view(request, view_func, view_args, view_kwargs)
return HttpResponse('View Middleware')
class ResponseMiddleware(TestMiddleware):
def process_response(self, request, response):
super(ResponseMiddleware, self).process_response(request, response)
return HttpResponse('Response Middleware')
class TemplateResponseMiddleware(TestMiddleware):
def process_template_response(self, request, response):
super(TemplateResponseMiddleware, self).process_template_response(request, response)
template = engines['django'].from_string('Template Response Middleware')
return TemplateResponse(request, template)
class ExceptionMiddleware(TestMiddleware):
def process_exception(self, request, exception):
super(ExceptionMiddleware, self).process_exception(request, exception)
return HttpResponse('Exception Middleware')
# Sample middlewares that raise exceptions
class BadRequestMiddleware(TestMiddleware):
def process_request(self, request):
super(BadRequestMiddleware, self).process_request(request)
raise TestException('Test Request Exception')
class BadViewMiddleware(TestMiddleware):
def process_view(self, request, view_func, view_args, view_kwargs):
super(BadViewMiddleware, self).process_view(request, view_func, view_args, view_kwargs)
raise TestException('Test View Exception')
class BadTemplateResponseMiddleware(TestMiddleware):
def process_template_response(self, request, response):
super(BadTemplateResponseMiddleware, self).process_template_response(request, response)
raise TestException('Test Template Response Exception')
class BadResponseMiddleware(TestMiddleware):
def process_response(self, request, response):
super(BadResponseMiddleware, self).process_response(request, response)
raise TestException('Test Response Exception')
class BadExceptionMiddleware(TestMiddleware):
def process_exception(self, request, exception):
super(BadExceptionMiddleware, self).process_exception(request, exception)
raise TestException('Test Exception Exception')
# Sample middlewares that omit to return an HttpResonse
class NoTemplateResponseMiddleware(TestMiddleware):
def process_template_response(self, request, response):
super(NoTemplateResponseMiddleware, self).process_template_response(request, response)
class NoResponseMiddleware(TestMiddleware):
def process_response(self, request, response):
super(NoResponseMiddleware, self).process_response(request, response)
@override_settings(ROOT_URLCONF='middleware_exceptions.urls')
class BaseMiddlewareExceptionTest(SimpleTestCase):
def setUp(self):
self.exceptions = []
got_request_exception.connect(self._on_request_exception)
self.client.handler.load_middleware()
def tearDown(self):
got_request_exception.disconnect(self._on_request_exception)
self.exceptions = []
def _on_request_exception(self, sender, request, **kwargs):
self.exceptions.append(sys.exc_info())
def _add_middleware(self, middleware):
self.client.handler._request_middleware.insert(0, middleware.process_request)
self.client.handler._view_middleware.insert(0, middleware.process_view)
self.client.handler._template_response_middleware.append(middleware.process_template_response)
self.client.handler._response_middleware.append(middleware.process_response)
self.client.handler._exception_middleware.append(middleware.process_exception)
def assert_exceptions_handled(self, url, errors, extra_error=None):
try:
self.client.get(url)
except TestException:
# Test client intentionally re-raises any exceptions being raised
# during request handling. Hence actual testing that exception was
# properly handled is done by relying on got_request_exception
# signal being sent.
pass
except Exception as e:
if type(extra_error) != type(e):
self.fail("Unexpected exception: %s" % e)
self.assertEqual(len(self.exceptions), len(errors))
for i, error in enumerate(errors):
exception, value, tb = self.exceptions[i]
self.assertEqual(value.args, (error, ))
def assert_middleware_usage(self, middleware, request, view, template_response, response, exception):
self.assertEqual(middleware.process_request_called, request)
self.assertEqual(middleware.process_view_called, view)
self.assertEqual(middleware.process_template_response_called, template_response)
self.assertEqual(middleware.process_response_called, response)
self.assertEqual(middleware.process_exception_called, exception)
class MiddlewareTests(BaseMiddlewareExceptionTest):
def test_process_request_middleware(self):
pre_middleware = TestMiddleware()
middleware = RequestMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/view/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, False, False, True, False)
self.assert_middleware_usage(middleware, True, False, False, True, False)
self.assert_middleware_usage(post_middleware, False, False, False, True, False)
def test_process_view_middleware(self):
pre_middleware = TestMiddleware()
middleware = ViewMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/view/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, False, False, True, False)
def test_process_response_middleware(self):
pre_middleware = TestMiddleware()
middleware = ResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/view/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, True, False, True, False)
def test_process_template_response_middleware(self):
pre_middleware = TestMiddleware()
middleware = TemplateResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/template_response/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, True, True, False)
self.assert_middleware_usage(middleware, True, True, True, True, False)
self.assert_middleware_usage(post_middleware, True, True, True, True, False)
def test_process_exception_middleware(self):
pre_middleware = TestMiddleware()
middleware = ExceptionMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/view/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, True, False, True, False)
def test_process_request_middleware_not_found(self):
pre_middleware = TestMiddleware()
middleware = RequestMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/not_found/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, False, False, True, False)
self.assert_middleware_usage(middleware, True, False, False, True, False)
self.assert_middleware_usage(post_middleware, False, False, False, True, False)
def test_process_view_middleware_not_found(self):
pre_middleware = TestMiddleware()
middleware = ViewMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/not_found/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, False, False, True, False)
def test_process_template_response_middleware_not_found(self):
pre_middleware = TestMiddleware()
middleware = TemplateResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/not_found/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, True)
self.assert_middleware_usage(middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_response_middleware_not_found(self):
pre_middleware = TestMiddleware()
middleware = ResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/not_found/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, True)
self.assert_middleware_usage(middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_exception_middleware_not_found(self):
pre_middleware = TestMiddleware()
middleware = ExceptionMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/not_found/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_request_middleware_exception(self):
pre_middleware = TestMiddleware()
middleware = RequestMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/error/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, False, False, True, False)
self.assert_middleware_usage(middleware, True, False, False, True, False)
self.assert_middleware_usage(post_middleware, False, False, False, True, False)
def test_process_view_middleware_exception(self):
pre_middleware = TestMiddleware()
middleware = ViewMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/error/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, False, False, True, False)
def test_process_response_middleware_exception(self):
pre_middleware = TestMiddleware()
middleware = ResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/error/', ['Error in view'], Exception())
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, True)
self.assert_middleware_usage(middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_exception_middleware_exception(self):
pre_middleware = TestMiddleware()
middleware = ExceptionMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/error/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_request_middleware_null_view(self):
pre_middleware = TestMiddleware()
middleware = RequestMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/null_view/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, False, False, True, False)
self.assert_middleware_usage(middleware, True, False, False, True, False)
self.assert_middleware_usage(post_middleware, False, False, False, True, False)
def test_process_view_middleware_null_view(self):
pre_middleware = TestMiddleware()
middleware = ViewMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/null_view/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, False, False, True, False)
def test_process_response_middleware_null_view(self):
pre_middleware = TestMiddleware()
middleware = ResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled(
'/middleware_exceptions/null_view/', [
"The view middleware_exceptions.views.null_view didn't return "
"an HttpResponse object. It returned None instead."
],
ValueError()
)
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, True, False, True, False)
def test_process_exception_middleware_null_view(self):
pre_middleware = TestMiddleware()
middleware = ExceptionMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled(
'/middleware_exceptions/null_view/', [
"The view middleware_exceptions.views.null_view didn't return "
"an HttpResponse object. It returned None instead."
],
ValueError()
)
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, True, False, True, False)
def test_process_request_middleware_permission_denied(self):
pre_middleware = TestMiddleware()
middleware = RequestMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/permission_denied/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, False, False, True, False)
self.assert_middleware_usage(middleware, True, False, False, True, False)
self.assert_middleware_usage(post_middleware, False, False, False, True, False)
def test_process_view_middleware_permission_denied(self):
pre_middleware = TestMiddleware()
middleware = ViewMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/permission_denied/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, False, False, True, False)
def test_process_response_middleware_permission_denied(self):
pre_middleware = TestMiddleware()
middleware = ResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/permission_denied/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, True)
self.assert_middleware_usage(middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_exception_middleware_permission_denied(self):
pre_middleware = TestMiddleware()
middleware = ExceptionMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/permission_denied/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_template_response_error(self):
middleware = TestMiddleware()
self._add_middleware(middleware)
self.assert_exceptions_handled('/middleware_exceptions/template_response_error/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(middleware, True, True, True, True, False)
@override_settings(
MIDDLEWARE_CLASSES=['middleware_exceptions.middleware.ProcessExceptionMiddleware'],
)
def test_exception_in_render_passed_to_process_exception(self):
# Repopulate the list of middlewares since it's already been populated
# by setUp() before the MIDDLEWARE_CLASSES setting got overridden
self.client.handler.load_middleware()
response = self.client.get('/middleware_exceptions/exception_in_render/')
self.assertEqual(response.content, b'Exception caught')
class BadMiddlewareTests(BaseMiddlewareExceptionTest):
def test_process_request_bad_middleware(self):
pre_middleware = TestMiddleware()
bad_middleware = BadRequestMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/view/', ['Test Request Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, False, False, True, False)
self.assert_middleware_usage(bad_middleware, True, False, False, True, False)
self.assert_middleware_usage(post_middleware, False, False, False, True, False)
def test_process_view_bad_middleware(self):
pre_middleware = TestMiddleware()
bad_middleware = BadViewMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/view/', ['Test View Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, False, False, True, False)
def test_process_template_response_bad_middleware(self):
pre_middleware = TestMiddleware()
bad_middleware = BadTemplateResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled(
'/middleware_exceptions/template_response/',
['Test Template Response Exception']
)
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(bad_middleware, True, True, True, True, False)
self.assert_middleware_usage(post_middleware, True, True, True, True, False)
def test_process_response_bad_middleware(self):
pre_middleware = TestMiddleware()
bad_middleware = BadResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/view/', ['Test Response Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, False, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, True, False, True, False)
def test_process_exception_bad_middleware(self):
pre_middleware = TestMiddleware()
bad_middleware = BadExceptionMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/view/', [])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, True, False, True, False)
def test_process_request_bad_middleware_not_found(self):
pre_middleware = TestMiddleware()
bad_middleware = BadRequestMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/not_found/', ['Test Request Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, False, False, True, False)
self.assert_middleware_usage(bad_middleware, True, False, False, True, False)
self.assert_middleware_usage(post_middleware, False, False, False, True, False)
def test_process_view_bad_middleware_not_found(self):
pre_middleware = TestMiddleware()
bad_middleware = BadViewMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/not_found/', ['Test View Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, False, False, True, False)
def test_process_response_bad_middleware_not_found(self):
pre_middleware = TestMiddleware()
bad_middleware = BadResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/not_found/', ['Test Response Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, False, True)
self.assert_middleware_usage(bad_middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_exception_bad_middleware_not_found(self):
pre_middleware = TestMiddleware()
bad_middleware = BadExceptionMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/not_found/', ['Test Exception Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_request_bad_middleware_exception(self):
pre_middleware = TestMiddleware()
bad_middleware = BadRequestMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/error/', ['Test Request Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, False, False, True, False)
self.assert_middleware_usage(bad_middleware, True, False, False, True, False)
self.assert_middleware_usage(post_middleware, False, False, False, True, False)
def test_process_view_bad_middleware_exception(self):
pre_middleware = TestMiddleware()
bad_middleware = BadViewMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/error/', ['Test View Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, False, False, True, False)
def test_process_response_bad_middleware_exception(self):
pre_middleware = TestMiddleware()
bad_middleware = BadResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/error/', ['Error in view', 'Test Response Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, False, True)
self.assert_middleware_usage(bad_middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_exception_bad_middleware_exception(self):
pre_middleware = TestMiddleware()
bad_middleware = BadExceptionMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/error/', ['Test Exception Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_request_bad_middleware_null_view(self):
pre_middleware = TestMiddleware()
bad_middleware = BadRequestMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/null_view/', ['Test Request Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, False, False, True, False)
self.assert_middleware_usage(bad_middleware, True, False, False, True, False)
self.assert_middleware_usage(post_middleware, False, False, False, True, False)
def test_process_view_bad_middleware_null_view(self):
pre_middleware = TestMiddleware()
bad_middleware = BadViewMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/null_view/', ['Test View Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, False, False, True, False)
def test_process_response_bad_middleware_null_view(self):
pre_middleware = TestMiddleware()
bad_middleware = BadResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled(
'/middleware_exceptions/null_view/', [
"The view middleware_exceptions.views.null_view didn't return "
"an HttpResponse object. It returned None instead.",
'Test Response Exception'
]
)
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, False, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, True, False, True, False)
def test_process_exception_bad_middleware_null_view(self):
pre_middleware = TestMiddleware()
bad_middleware = BadExceptionMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled(
'/middleware_exceptions/null_view/', [
"The view middleware_exceptions.views.null_view didn't return "
"an HttpResponse object. It returned None instead."
],
ValueError()
)
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, True, False, True, False)
def test_process_request_bad_middleware_permission_denied(self):
pre_middleware = TestMiddleware()
bad_middleware = BadRequestMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/permission_denied/', ['Test Request Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, False, False, True, False)
self.assert_middleware_usage(bad_middleware, True, False, False, True, False)
self.assert_middleware_usage(post_middleware, False, False, False, True, False)
def test_process_view_bad_middleware_permission_denied(self):
pre_middleware = TestMiddleware()
bad_middleware = BadViewMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/permission_denied/', ['Test View Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, False, False, True, False)
def test_process_response_bad_middleware_permission_denied(self):
pre_middleware = TestMiddleware()
bad_middleware = BadResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/permission_denied/', ['Test Response Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, False, True)
self.assert_middleware_usage(bad_middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_exception_bad_middleware_permission_denied(self):
pre_middleware = TestMiddleware()
bad_middleware = BadExceptionMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(bad_middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/permission_denied/', ['Test Exception Exception'])
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(bad_middleware, True, True, False, True, True)
self.assert_middleware_usage(post_middleware, True, True, False, True, True)
def test_process_response_no_response_middleware(self):
pre_middleware = TestMiddleware()
middleware = NoResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled('/middleware_exceptions/view/', [
"NoResponseMiddleware.process_response didn't return an HttpResponse object. It returned None instead."
],
ValueError())
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, False, False)
self.assert_middleware_usage(middleware, True, True, False, True, False)
self.assert_middleware_usage(post_middleware, True, True, False, True, False)
def test_process_template_response_no_response_middleware(self):
pre_middleware = TestMiddleware()
middleware = NoTemplateResponseMiddleware()
post_middleware = TestMiddleware()
self._add_middleware(post_middleware)
self._add_middleware(middleware)
self._add_middleware(pre_middleware)
self.assert_exceptions_handled(
'/middleware_exceptions/template_response/', [
"NoTemplateResponseMiddleware.process_template_response didn't "
"return an HttpResponse object. It returned None instead."
],
ValueError()
)
# Check that the right middleware methods have been invoked
self.assert_middleware_usage(pre_middleware, True, True, False, True, False)
self.assert_middleware_usage(middleware, True, True, True, True, False)
self.assert_middleware_usage(post_middleware, True, True, True, True, False)
_missing = object()
@override_settings(ROOT_URLCONF='middleware_exceptions.urls')
class RootUrlconfTests(SimpleTestCase):
@override_settings(ROOT_URLCONF=None)
def test_missing_root_urlconf(self):
# Removing ROOT_URLCONF is safe, as override_settings will restore
# the previously defined settings.
del settings.ROOT_URLCONF
self.assertRaises(AttributeError, self.client.get, "/middleware_exceptions/view/")
class MyMiddleware(object):
def __init__(self):
raise MiddlewareNotUsed
def process_request(self, request):
pass
class MyMiddlewareWithExceptionMessage(object):
def __init__(self):
raise MiddlewareNotUsed('spam eggs')
def process_request(self, request):
pass
@override_settings(
DEBUG=True,
ROOT_URLCONF='middleware_exceptions.urls',
)
class MiddlewareNotUsedTests(SimpleTestCase):
rf = RequestFactory()
def test_raise_exception(self):
request = self.rf.get('middleware_exceptions/view/')
with self.assertRaises(MiddlewareNotUsed):
MyMiddleware().process_request(request)
@override_settings(MIDDLEWARE_CLASSES=[
'middleware_exceptions.tests.MyMiddleware',
])
def test_log(self):
with patch_logger('django.request', 'debug') as calls:
self.client.get('/middleware_exceptions/view/')
self.assertEqual(len(calls), 1)
self.assertEqual(
calls[0],
"MiddlewareNotUsed: 'middleware_exceptions.tests.MyMiddleware'"
)
@override_settings(MIDDLEWARE_CLASSES=[
'middleware_exceptions.tests.MyMiddlewareWithExceptionMessage',
])
def test_log_custom_message(self):
with patch_logger('django.request', 'debug') as calls:
self.client.get('/middleware_exceptions/view/')
self.assertEqual(len(calls), 1)
self.assertEqual(
calls[0],
"MiddlewareNotUsed('middleware_exceptions.tests.MyMiddlewareWithExceptionMessage'): spam eggs"
)
@override_settings(DEBUG=False)
def test_do_not_log_when_debug_is_false(self):
with patch_logger('django.request', 'debug') as calls:
self.client.get('/middleware_exceptions/view/')
self.assertEqual(len(calls), 0)
|
bsd-3-clause
|
[
646,
984,
199,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
1018,
14,
3924,
492,
603,
3551,
1763,
9167,
199,
504,
1639,
14,
1018,
14,
10458,
492,
4788,
63,
1069,
63,
1971,
199,
504,
1639,
14,
1014,
492,
6183,
199,
504,
1639,
14,
1160,
492,
28156,
199,
504,
1639,
14,
1160,
14,
1310,
492,
29264,
199,
504,
1639,
14,
396,
492,
18638,
12,
24424,
12,
4278,
63,
1751,
199,
504,
1639,
14,
396,
14,
1208,
492,
3371,
63,
2921,
421,
199,
533,
1379,
1726,
8,
1726,
304,
272,
986,
421,
199,
3,
437,
10816,
1300,
1021,
626,
18917,
1314,
3102,
1172,
2757,
2797,
199,
533,
1379,
6608,
8,
785,
304,
272,
347,
636,
826,
721,
277,
304,
267,
291,
14,
1412,
63,
1069,
63,
3527,
275,
756,
267,
291,
14,
1412,
63,
1345,
63,
3527,
275,
756,
267,
291,
14,
1412,
63,
1310,
63,
3527,
275,
756,
267,
291,
14,
1412,
63,
1160,
63,
1310,
63,
3527,
275,
756,
267,
291,
14,
1412,
63,
1971,
63,
3527,
275,
756,
339,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
291,
14,
1412,
63,
1069,
63,
3527,
275,
715,
339,
347,
2112,
63,
1345,
8,
277,
12,
1056,
12,
2455,
63,
1532,
12,
2455,
63,
589,
12,
2455,
63,
958,
304,
267,
291,
14,
1412,
63,
1345,
63,
3527,
275,
715,
339,
347,
2112,
63,
1160,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
291,
14,
1412,
63,
1160,
63,
1310,
63,
3527,
275,
715,
267,
372,
1177,
339,
347,
2112,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
291,
14,
1412,
63,
1310,
63,
3527,
275,
715,
267,
372,
1177,
339,
347,
2112,
63,
1971,
8,
277,
12,
1056,
12,
1919,
304,
267,
291,
14,
1412,
63,
1971,
63,
3527,
275,
715,
421,
199,
3,
603,
3551,
7251,
626,
886,
314,
2451,
8377,
199,
533,
4784,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
1613,
8,
2017,
6608,
12,
291,
680,
1412,
63,
1069,
8,
1069,
9,
267,
372,
6183,
360,
2017,
603,
3551,
358,
421,
199,
533,
10935,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1345,
8,
277,
12,
1056,
12,
2455,
63,
1532,
12,
2455,
63,
589,
12,
2455,
63,
958,
304,
267,
1613,
8,
24060,
12,
291,
680,
1412,
63,
1345,
8,
1069,
12,
2455,
63,
1532,
12,
2455,
63,
589,
12,
2455,
63,
958,
9,
267,
372,
6183,
360,
2768,
603,
3551,
358,
421,
199,
533,
7232,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
2364,
6608,
12,
291,
680,
1412,
63,
1310,
8,
1069,
12,
1177,
9,
267,
372,
6183,
360,
2364,
603,
3551,
358,
421,
199,
533,
29264,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1160,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
31036,
6608,
12,
291,
680,
1412,
63,
1160,
63,
1310,
8,
1069,
12,
1177,
9,
267,
1978,
275,
28156,
459,
1176,
2278,
504,
63,
875,
360,
4231,
7232,
603,
3551,
358,
267,
372,
29264,
8,
1069,
12,
1978,
9,
421,
199,
533,
2186,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1971,
8,
277,
12,
1056,
12,
1919,
304,
267,
1613,
8,
1726,
6608,
12,
291,
680,
1412,
63,
1971,
8,
1069,
12,
1919,
9,
267,
372,
6183,
360,
1726,
603,
3551,
358,
421,
199,
3,
15227,
12180,
758,
470,
626,
746,
4967,
199,
533,
8857,
2017,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
1613,
8,
12380,
6608,
12,
291,
680,
1412,
63,
1069,
8,
1069,
9,
267,
746,
1379,
1726,
360,
774,
4784,
2186,
358,
421,
199,
533,
8857,
24060,
8,
774,
6608,
304,
272,
347,
2112,
63,
1345,
8,
277,
12,
1056,
12,
2455,
63,
1532,
12,
2455,
63,
589,
12,
2455,
63,
958,
304,
267,
1613,
8,
5725,
24060,
12,
291,
680,
1412,
63,
1345,
8,
1069,
12,
2455,
63,
1532,
12,
2455,
63,
589,
12,
2455,
63,
958,
9,
267,
746,
1379,
1726,
360,
774,
10935,
2186,
358,
421,
199,
533,
8857,
31036,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1160,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
5725,
31036,
6608,
12,
291,
680,
1412,
63,
1160,
63,
1310,
8,
1069,
12,
1177,
9,
267,
746,
1379,
1726,
360,
774,
5458,
7232,
2186,
358,
421,
199,
533,
8857,
2364,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
5725,
2364,
6608,
12,
291,
680,
1412,
63,
1310,
8,
1069,
12,
1177,
9,
267,
746,
1379,
1726,
360,
774,
7232,
2186,
358,
421,
199,
533,
8857,
1726,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1971,
8,
277,
12,
1056,
12,
1919,
304,
267,
1613,
8,
5725,
1726,
6608,
12,
291,
680,
1412,
63,
1971,
8,
1069,
12,
1919,
9,
267,
746,
1379,
1726,
360,
774,
2186,
2186,
358,
421,
199,
3,
15227,
12180,
758,
470,
626,
19413,
370,
372,
376,
4760,
1322,
265,
261,
199,
533,
3091,
31036,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1160,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
1944,
31036,
6608,
12,
291,
680,
1412,
63,
1160,
63,
1310,
8,
1069,
12,
1177,
9,
421,
199,
533,
3091,
2364,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
1944,
2364,
6608,
12,
291,
680,
1412,
63,
1310,
8,
1069,
12,
1177,
9,
421,
199,
32,
4415,
63,
1751,
8,
5441,
63,
18125,
534,
5754,
63,
3924,
14,
3603,
358,
199,
533,
3523,
6608,
1726,
774,
8,
17968,
304,
339,
347,
3613,
8,
277,
304,
267,
291,
14,
3924,
275,
942,
267,
4788,
63,
1069,
63,
1971,
14,
2242,
8,
277,
423,
265,
63,
1069,
63,
1971,
9,
267,
291,
14,
1258,
14,
2232,
14,
912,
63,
5754,
342,
339,
347,
6766,
8,
277,
304,
267,
4788,
63,
1069,
63,
1971,
14,
10673,
8,
277,
423,
265,
63,
1069,
63,
1971,
9,
267
] |
[
984,
199,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
1018,
14,
3924,
492,
603,
3551,
1763,
9167,
199,
504,
1639,
14,
1018,
14,
10458,
492,
4788,
63,
1069,
63,
1971,
199,
504,
1639,
14,
1014,
492,
6183,
199,
504,
1639,
14,
1160,
492,
28156,
199,
504,
1639,
14,
1160,
14,
1310,
492,
29264,
199,
504,
1639,
14,
396,
492,
18638,
12,
24424,
12,
4278,
63,
1751,
199,
504,
1639,
14,
396,
14,
1208,
492,
3371,
63,
2921,
421,
199,
533,
1379,
1726,
8,
1726,
304,
272,
986,
421,
199,
3,
437,
10816,
1300,
1021,
626,
18917,
1314,
3102,
1172,
2757,
2797,
199,
533,
1379,
6608,
8,
785,
304,
272,
347,
636,
826,
721,
277,
304,
267,
291,
14,
1412,
63,
1069,
63,
3527,
275,
756,
267,
291,
14,
1412,
63,
1345,
63,
3527,
275,
756,
267,
291,
14,
1412,
63,
1310,
63,
3527,
275,
756,
267,
291,
14,
1412,
63,
1160,
63,
1310,
63,
3527,
275,
756,
267,
291,
14,
1412,
63,
1971,
63,
3527,
275,
756,
339,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
291,
14,
1412,
63,
1069,
63,
3527,
275,
715,
339,
347,
2112,
63,
1345,
8,
277,
12,
1056,
12,
2455,
63,
1532,
12,
2455,
63,
589,
12,
2455,
63,
958,
304,
267,
291,
14,
1412,
63,
1345,
63,
3527,
275,
715,
339,
347,
2112,
63,
1160,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
291,
14,
1412,
63,
1160,
63,
1310,
63,
3527,
275,
715,
267,
372,
1177,
339,
347,
2112,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
291,
14,
1412,
63,
1310,
63,
3527,
275,
715,
267,
372,
1177,
339,
347,
2112,
63,
1971,
8,
277,
12,
1056,
12,
1919,
304,
267,
291,
14,
1412,
63,
1971,
63,
3527,
275,
715,
421,
199,
3,
603,
3551,
7251,
626,
886,
314,
2451,
8377,
199,
533,
4784,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
1613,
8,
2017,
6608,
12,
291,
680,
1412,
63,
1069,
8,
1069,
9,
267,
372,
6183,
360,
2017,
603,
3551,
358,
421,
199,
533,
10935,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1345,
8,
277,
12,
1056,
12,
2455,
63,
1532,
12,
2455,
63,
589,
12,
2455,
63,
958,
304,
267,
1613,
8,
24060,
12,
291,
680,
1412,
63,
1345,
8,
1069,
12,
2455,
63,
1532,
12,
2455,
63,
589,
12,
2455,
63,
958,
9,
267,
372,
6183,
360,
2768,
603,
3551,
358,
421,
199,
533,
7232,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
2364,
6608,
12,
291,
680,
1412,
63,
1310,
8,
1069,
12,
1177,
9,
267,
372,
6183,
360,
2364,
603,
3551,
358,
421,
199,
533,
29264,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1160,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
31036,
6608,
12,
291,
680,
1412,
63,
1160,
63,
1310,
8,
1069,
12,
1177,
9,
267,
1978,
275,
28156,
459,
1176,
2278,
504,
63,
875,
360,
4231,
7232,
603,
3551,
358,
267,
372,
29264,
8,
1069,
12,
1978,
9,
421,
199,
533,
2186,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1971,
8,
277,
12,
1056,
12,
1919,
304,
267,
1613,
8,
1726,
6608,
12,
291,
680,
1412,
63,
1971,
8,
1069,
12,
1919,
9,
267,
372,
6183,
360,
1726,
603,
3551,
358,
421,
199,
3,
15227,
12180,
758,
470,
626,
746,
4967,
199,
533,
8857,
2017,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1069,
8,
277,
12,
1056,
304,
267,
1613,
8,
12380,
6608,
12,
291,
680,
1412,
63,
1069,
8,
1069,
9,
267,
746,
1379,
1726,
360,
774,
4784,
2186,
358,
421,
199,
533,
8857,
24060,
8,
774,
6608,
304,
272,
347,
2112,
63,
1345,
8,
277,
12,
1056,
12,
2455,
63,
1532,
12,
2455,
63,
589,
12,
2455,
63,
958,
304,
267,
1613,
8,
5725,
24060,
12,
291,
680,
1412,
63,
1345,
8,
1069,
12,
2455,
63,
1532,
12,
2455,
63,
589,
12,
2455,
63,
958,
9,
267,
746,
1379,
1726,
360,
774,
10935,
2186,
358,
421,
199,
533,
8857,
31036,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1160,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
5725,
31036,
6608,
12,
291,
680,
1412,
63,
1160,
63,
1310,
8,
1069,
12,
1177,
9,
267,
746,
1379,
1726,
360,
774,
5458,
7232,
2186,
358,
421,
199,
533,
8857,
2364,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
5725,
2364,
6608,
12,
291,
680,
1412,
63,
1310,
8,
1069,
12,
1177,
9,
267,
746,
1379,
1726,
360,
774,
7232,
2186,
358,
421,
199,
533,
8857,
1726,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1971,
8,
277,
12,
1056,
12,
1919,
304,
267,
1613,
8,
5725,
1726,
6608,
12,
291,
680,
1412,
63,
1971,
8,
1069,
12,
1919,
9,
267,
746,
1379,
1726,
360,
774,
2186,
2186,
358,
421,
199,
3,
15227,
12180,
758,
470,
626,
19413,
370,
372,
376,
4760,
1322,
265,
261,
199,
533,
3091,
31036,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1160,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
1944,
31036,
6608,
12,
291,
680,
1412,
63,
1160,
63,
1310,
8,
1069,
12,
1177,
9,
421,
199,
533,
3091,
2364,
6608,
8,
774,
6608,
304,
272,
347,
2112,
63,
1310,
8,
277,
12,
1056,
12,
1177,
304,
267,
1613,
8,
1944,
2364,
6608,
12,
291,
680,
1412,
63,
1310,
8,
1069,
12,
1177,
9,
421,
199,
32,
4415,
63,
1751,
8,
5441,
63,
18125,
534,
5754,
63,
3924,
14,
3603,
358,
199,
533,
3523,
6608,
1726,
774,
8,
17968,
304,
339,
347,
3613,
8,
277,
304,
267,
291,
14,
3924,
275,
942,
267,
4788,
63,
1069,
63,
1971,
14,
2242,
8,
277,
423,
265,
63,
1069,
63,
1971,
9,
267,
291,
14,
1258,
14,
2232,
14,
912,
63,
5754,
342,
339,
347,
6766,
8,
277,
304,
267,
4788,
63,
1069,
63,
1971,
14,
10673,
8,
277,
423,
265,
63,
1069,
63,
1971,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
suvarnaraju/robotframework
|
src/robot/libdocpkg/__init__.py
|
27
|
1580
|
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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.
"""Implements the `Libdoc` tool.
The command line entry point and programmatic interface for Libdoc
are provided by the separate :mod:`robot.libdoc` module.
This package is considered stable but it is not part of the public API.
"""
from robot.errors import DataError
from robot.utils import get_error_message
from .builder import DocumentationBuilder
from .consoleviewer import ConsoleViewer
def LibraryDocumentation(library_or_resource, name=None, version=None,
doc_format=None):
builder = DocumentationBuilder(library_or_resource)
try:
libdoc = builder.build(library_or_resource)
except DataError:
raise
except:
raise DataError("Building library '%s' failed: %s"
% (library_or_resource, get_error_message()))
if name:
libdoc.name = name
if version:
libdoc.version = version
if doc_format:
libdoc.doc_format = doc_format
return libdoc
|
apache-2.0
|
[
3,
221,
1898,
9079,
13,
7806,
653,
745,
4674,
17991,
8653,
436,
17138,
199,
3,
199,
3,
221,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
221,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
221,
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,
221,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
221,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
221,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
221,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
221,
4204,
1334,
314,
844,
14,
199,
199,
624,
29452,
314,
658,
4728,
1301,
64,
4744,
14,
199,
199,
1918,
1414,
1004,
2397,
2376,
436,
2240,
3889,
3217,
367,
8003,
1301,
199,
1530,
2741,
701,
314,
7396,
520,
1494,
1705,
9751,
14,
773,
1301,
64,
859,
14,
199,
199,
2765,
2559,
365,
8652,
17830,
1325,
652,
365,
440,
1777,
402,
314,
4575,
3261,
14,
199,
624,
199,
199,
504,
14544,
14,
2550,
492,
3918,
547,
199,
504,
14544,
14,
1208,
492,
664,
63,
705,
63,
1188,
199,
199,
504,
1275,
5649,
492,
15249,
6437,
199,
504,
1275,
6614,
16645,
492,
19809,
22347,
421,
199,
318,
11243,
17763,
8,
4342,
63,
269,
63,
1927,
12,
536,
29,
403,
12,
1015,
29,
403,
12,
586,
1382,
63,
908,
29,
403,
304,
272,
6545,
275,
15249,
6437,
8,
4342,
63,
269,
63,
1927,
9,
272,
862,
26,
267,
1973,
1301,
275,
6545,
14,
1506,
8,
4342,
63,
269,
63,
1927,
9,
272,
871,
3918,
547,
26,
267,
746,
272,
871,
26,
267,
746,
3918,
547,
480,
16461,
3555,
1543,
83,
7,
3405,
26,
450,
83,
2,
717,
450,
334,
4342,
63,
269,
63,
1927,
12,
664,
63,
705,
63,
1188,
4059,
272,
340,
536,
26,
267,
1973,
1301,
14,
354,
275,
536,
272,
340,
1015,
26,
267,
1973,
1301,
14,
1023,
275,
1015,
272,
340,
1382,
63,
908,
26,
267,
1973,
1301,
14,
1301,
63,
908,
275,
1382,
63,
908,
272,
372,
1973,
1301,
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
] |
[
221,
1898,
9079,
13,
7806,
653,
745,
4674,
17991,
8653,
436,
17138,
199,
3,
199,
3,
221,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3547,
199,
3,
221,
1265,
1443,
440,
675,
642,
570,
871,
315,
4151,
543,
314,
844,
14,
199,
3,
221,
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,
221,
4158,
1415,
701,
3964,
4179,
503,
4193,
370,
315,
3575,
12,
2032,
199,
3,
221,
1854,
1334,
314,
844,
365,
1854,
641,
376,
298,
1179,
2281,
2,
4207,
12,
199,
3,
221,
2428,
2990,
1549,
4217,
1634,
1821,
3826,
12,
1902,
4056,
503,
2478,
14,
199,
3,
221,
1666,
314,
844,
367,
314,
2488,
2637,
4210,
3443,
436,
199,
3,
221,
4204,
1334,
314,
844,
14,
199,
199,
624,
29452,
314,
658,
4728,
1301,
64,
4744,
14,
199,
199,
1918,
1414,
1004,
2397,
2376,
436,
2240,
3889,
3217,
367,
8003,
1301,
199,
1530,
2741,
701,
314,
7396,
520,
1494,
1705,
9751,
14,
773,
1301,
64,
859,
14,
199,
199,
2765,
2559,
365,
8652,
17830,
1325,
652,
365,
440,
1777,
402,
314,
4575,
3261,
14,
199,
624,
199,
199,
504,
14544,
14,
2550,
492,
3918,
547,
199,
504,
14544,
14,
1208,
492,
664,
63,
705,
63,
1188,
199,
199,
504,
1275,
5649,
492,
15249,
6437,
199,
504,
1275,
6614,
16645,
492,
19809,
22347,
421,
199,
318,
11243,
17763,
8,
4342,
63,
269,
63,
1927,
12,
536,
29,
403,
12,
1015,
29,
403,
12,
586,
1382,
63,
908,
29,
403,
304,
272,
6545,
275,
15249,
6437,
8,
4342,
63,
269,
63,
1927,
9,
272,
862,
26,
267,
1973,
1301,
275,
6545,
14,
1506,
8,
4342,
63,
269,
63,
1927,
9,
272,
871,
3918,
547,
26,
267,
746,
272,
871,
26,
267,
746,
3918,
547,
480,
16461,
3555,
1543,
83,
7,
3405,
26,
450,
83,
2,
717,
450,
334,
4342,
63,
269,
63,
1927,
12,
664,
63,
705,
63,
1188,
4059,
272,
340,
536,
26,
267,
1973,
1301,
14,
354,
275,
536,
272,
340,
1015,
26,
267,
1973,
1301,
14,
1023,
275,
1015,
272,
340,
1382,
63,
908,
26,
267,
1973,
1301,
14,
1301,
63,
908,
275,
1382,
63,
908,
272,
372,
1973,
1301,
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,
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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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
TeachAtTUM/edx-platform
|
openedx/core/djangoapps/content/block_structure/transformer.py
|
25
|
9130
|
"""
This module provides the abstract base class for all Block Structure
Transformers.
"""
from abc import abstractmethod
class BlockStructureTransformer(object):
"""
Abstract base class for all block structure transformers.
"""
# All Transformers are expected to maintain version-related class
# attributes. While the values for the base class is set to 0,
# the values for each concrete transformer should be 1 or higher.
#
# A transformer's version attributes are used by the block_structure
# framework in order to determine whether any collected data for a
# transformer is outdated because of a data schema change by the
# transformer.
#
# The WRITE_VERSION number is stored along with the transformer's
# data when it is collected and cached (during the collect phase).
# The READ_VERSION number is then verified to be less than or equal
# to the version associated with the collected data when the
# collected data is accessed (during the transform phase).
#
# We distinguish between WRITE_VERSION and READ_VERSION numbers in
# order to:
# 1. support blue-green deployments where new and previous versions
# of the code base are simultaneously executing on different
# workers for a period of time.
#
# A 2-phase deployment is used to stagger read and write changes.
#
# 2. scale for large deployments where it is costly to recompute
# block structures for all courses when a transformer's collected
# data schema changes.
#
# A background management command is run to prime the new data.
#
# See the following document for further information:
# https://openedx.atlassian.net/wiki/display/MA/Block+Structure+Cache+Invalidation+Proposal
#
# The WRITE_VERSION number of a Transformer should be incremented
# when it's collect implementation is additively changed. Backward
# compatibility should be maintained with previous READ_VERSIONs
# until all readers are updated.
#
# The READ_VERSION number of a Transformer should be incremented
# when its transform implementation is updated to make use of the
# newly collected data - and released only after all collected
# block structures are updated with the new WRITE_VERSION.
#
WRITE_VERSION = 0
READ_VERSION = 0
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class. It is used to
identify the transformer's cached data. So it should be unique
and not conflict with other transformers. Consider using the
same name that is used in the Transformer Registry. For example,
for Stevedore, it is specified in the setup.py file.
Once the transformer is in use and its data is cached, do not
modify this name value without consideration of backward
compatibility with previously collected data.
"""
raise NotImplementedError
@classmethod
def collect(cls, block_structure):
"""
Collects and stores any xBlock and modulestore data into the
block_structure that's necessary for later execution of the
transformer's transform method. Transformers should store such
data in the block_structure using the following methods:
set_transformer_data
set_transformer_block_field
request_xblock_fields
Transformers can call block_structure.request_xblock_fields for
any common xBlock fields that should be collected by the
framework.
Any full block tree traversals should be implemented in this
collect phase, leaving the transform phase for fast and direct
access to a sub-block. If a block's transform output is
dependent on its ancestors' data, the ancestor's data should be
percolated down to the descendants. So when a (non-root) block
is directly accessed in the transform, all of its relevant data
is readily available (without needing to access its ancestors).
Traversals of the block_structure can be implemented using the
following methods:
topological_traversal
post_order_traversal
Arguments:
block_structure (BlockStructureModulestoreData) - A mutable
block structure that is to be modified with collected
data to be cached for the transformer.
"""
pass
@abstractmethod
def transform(self, usage_info, block_structure):
"""
Transforms the given block_structure for the given usage_info,
assuming the block_structure contains cached data from a prior
call to the collect method of the latest version of the
Transformer.
No access to the modulestore nor instantiation of xBlocks should
be performed during the execution of this method. However,
accesses to user-specific data (outside of the modulestore and
not via xBlocks) is permitted in order to apply the transform
for the given usage_info.
Note: The root of the given block_structure is not necessarily
the same as the root of the block_structure passed to the prior
collect method. The collect method is given the top-most root
of the structure, while the transform method may be called upon
any sub-structure or even a single block within the originally
collected structure.
A Transformer may choose to remove entire sub-structures during
the transform method and may do so using the remove_block and
filter_with_removal methods.
Amongst the many methods available for a block_structure, the
following methods are commonly used during transforms:
get_xblock_field
get_transformer_data
get_transformer_block_field
remove_block_traversal
filter_with_removal
filter_topological_traversal
topological_traversal
post_order_traversal
Arguments:
usage_info (any negotiated type) - A usage-specific object
that is passed to the block_structure and forwarded to all
requested Transformers in order to apply a
usage-specific transform. For example, an instance of
usage_info would contain a user object for which the
transform should be applied.
block_structure (BlockStructureBlockData) - A mutable
block structure, with already collected data for the
transformer, that is to be transformed in place.
"""
raise NotImplementedError
class FilteringTransformerMixin(BlockStructureTransformer):
"""
Transformers may optionally choose to implement this mixin if their
transform logic can be broken apart into a lambda for optimization of
combined tree traversals.
For performance reasons, developers should try to implement this mixin
whenever possible - with this alternative, traversal of the entire block
structure happens only once for all transformers that implement
FilteringTransformerMixin.
"""
def transform(self, usage_info, block_structure):
"""
By defining this method, FilteringTransformers can be run individually
if desired. In normal operations, the filters returned from multiple
transform_block_filters calls will be combined and used in a single
tree traversal.
"""
block_structure.filter_topological_traversal(self.transform_block_filters(usage_info, block_structure))
@abstractmethod
def transform_block_filters(self, usage_info, block_structure):
"""
This is an alternative to the standard transform method.
Returns a list of filter functions to be used for filtering out
any unwanted blocks in the given block_structure.
In addition to the commonly used methods listed above, the following
methods are commonly used by implementations of transform_block_filters:
create_universal_filter
create_removal_filter
Note: Transformers that implement this alternative should be
independent of all other registered transformers as they may not
be applied in the order in which they were listed in the registry.
Arguments:
usage_info (any negotiated type) - A usage-specific object
that is passed to the block_structure and forwarded to all
requested Transformers in order to apply a
usage-specific transform. For example, an instance of
usage_info would contain a user object for which the
transform should be applied.
block_structure (BlockStructureBlockData) - A mutable
block structure, with already collected data for the
transformer, that is to be transformed in place.
"""
raise NotImplementedError
|
agpl-3.0
|
[
624,
199,
2765,
859,
6571,
314,
9006,
1300,
1021,
367,
1006,
8651,
21730,
199,
3188,
22932,
14,
199,
624,
199,
504,
13022,
492,
9006,
765,
421,
199,
533,
8651,
10766,
19761,
8,
785,
304,
272,
408,
272,
11836,
1300,
1021,
367,
1006,
1853,
5523,
1752,
22932,
14,
272,
408,
339,
327,
2900,
6266,
22932,
787,
1420,
370,
11075,
1015,
13,
2407,
1021,
272,
327,
3004,
14,
221,
22117,
314,
1338,
367,
314,
1300,
1021,
365,
663,
370,
378,
12,
272,
327,
314,
1338,
367,
1924,
13801,
21484,
1077,
506,
413,
503,
10948,
14,
272,
327,
272,
327,
437,
21484,
1159,
1015,
3004,
787,
1202,
701,
314,
1853,
63,
6976,
272,
327,
10059,
315,
1865,
370,
6705,
3775,
1263,
13736,
666,
367,
282,
272,
327,
21484,
365,
734,
19074,
2952,
402,
282,
666,
4177,
1570,
701,
314,
272,
327,
21484,
14,
272,
327,
272,
327,
710,
32280,
63,
4612,
1329,
365,
5489,
3180,
543,
314,
21484,
1159,
272,
327,
666,
1380,
652,
365,
13736,
436,
6328,
334,
27868,
314,
8775,
7669,
680,
272,
327,
710,
16767,
63,
4612,
1329,
365,
2066,
16317,
370,
506,
6656,
2419,
503,
4472,
272,
327,
370,
314,
1015,
4568,
543,
314,
13736,
666,
1380,
314,
272,
327,
13736,
666,
365,
13810,
334,
27868,
314,
5793,
7669,
680,
272,
327,
272,
327,
2136,
22237,
3382,
32280,
63,
4612,
436,
16767,
63,
4612,
5579,
315,
272,
327,
1865,
370,
26,
272,
327,
413,
14,
2291,
10030,
13,
7731,
12287,
1470,
2382,
892,
436,
4136,
5459,
272,
327,
259,
402,
314,
1233,
1300,
787,
27008,
590,
14043,
641,
3365,
272,
327,
259,
14123,
367,
282,
6247,
402,
900,
14,
272,
327,
272,
327,
259,
437,
499,
13,
6971,
14295,
365,
1202,
370,
410,
16267,
1586,
436,
2218,
4493,
14,
272,
327,
272,
327,
499,
14,
4666,
367,
7031,
12287,
1470,
2382,
652,
365,
7918,
590,
370,
295,
3357,
272,
327,
259,
1853,
13955,
367,
1006,
13588,
1380,
282,
21484,
1159,
13736,
272,
327,
259,
666,
4177,
4493,
14,
272,
327,
272,
327,
259,
437,
8020,
10041,
1414,
365,
1255,
370,
21619,
314,
892,
666,
14,
272,
327,
272,
327,
1666,
314,
2569,
2213,
367,
9848,
2556,
26,
272,
327,
4178,
921,
1490,
8268,
14,
292,
76,
2608,
290,
14,
846,
15,
6797,
15,
2918,
15,
2054,
15,
3142,
11,
10766,
11,
4437,
11,
3364,
425,
11,
919,
14506,
272,
327,
272,
327,
710,
32280,
63,
4612,
1329,
402,
282,
30486,
1077,
506,
10035,
2509,
272,
327,
1380,
652,
1159,
8775,
4514,
365,
1503,
328,
9462,
2896,
14,
10257,
3079,
272,
327,
7163,
1077,
506,
26391,
543,
4136,
16767,
63,
4612,
83,
272,
327,
5133,
1006,
7002,
83,
787,
4588,
14,
272,
327,
272,
327,
710,
16767,
63,
4612,
1329,
402,
282,
30486,
1077,
506,
10035,
2509,
272,
327,
1380,
2399,
5793,
4514,
365,
4588,
370,
1852,
675,
402,
314,
272,
327,
13903,
13736,
666,
446,
436,
14286,
1454,
2410,
1006,
13736,
272,
327,
1853,
13955,
787,
4588,
543,
314,
892,
32280,
63,
4612,
14,
272,
327,
272,
32280,
63,
4612,
275,
378,
272,
16767,
63,
4612,
275,
378,
339,
768,
3744,
272,
347,
536,
8,
1886,
304,
267,
408,
267,
18276,
5148,
367,
314,
21484,
1159,
1021,
14,
2779,
365,
1202,
370,
267,
10405,
314,
21484,
1159,
6328,
666,
14,
2002,
652,
1077,
506,
3747,
267,
436,
440,
12395,
543,
1163,
1752,
22932,
14,
24413,
1808,
314,
267,
2011,
536,
626,
365,
1202,
315,
314,
30486,
20738,
14,
2104,
2893,
12,
267,
367,
17854,
1354,
720,
12,
652,
365,
2013,
315,
314,
3272,
14,
647,
570,
14,
398,
19468,
314,
21484,
365,
315,
675,
436,
2399,
666,
365,
6328,
12,
886,
440,
267,
2811,
642,
536,
574,
1928,
8219,
1754,
402,
13388,
267,
7163,
543,
10889,
13736,
666,
14,
267,
408,
267,
746,
4279,
339,
768,
3744,
272,
347,
8775,
8,
1886,
12,
1853,
63,
6976,
304,
267,
408,
267,
19649,
83,
436,
14086,
1263,
671,
3142,
436,
10996,
666,
1901,
314,
267,
1853,
63,
6976,
626,
1159,
5784,
367,
2945,
6451,
402,
314,
267,
21484,
1159,
5793,
1083,
14,
6266,
22932,
1077,
3877,
4066,
267,
666,
315,
314,
1853,
63,
6976,
1808,
314,
2569,
3102,
26,
288,
663,
63,
19754,
63,
576,
288,
663,
63,
19754,
63,
1457,
63,
698,
288,
1056,
63,
11283,
63,
955,
398,
6266,
22932,
883,
1240,
1853,
63,
6976,
14,
1069,
63,
11283,
63,
955,
367,
267,
1263,
2863,
671,
3142,
1504,
626,
1077,
506,
13736,
701,
314,
267,
10059,
14,
398,
6184,
2615,
1853,
3123,
1468,
14895,
2551,
1077,
506,
6366,
315,
642,
267,
8775,
7669,
12,
23188,
314,
5793,
7669,
367,
7377,
436,
4125,
267,
2879,
370,
282,
1007,
13,
1457,
14,
982,
282,
1853,
1159,
5793,
1072,
365,
267,
11410,
641,
2399,
20158,
7,
666,
12,
314,
18432,
1159,
666,
1077,
506,
267,
1126,
331,
1776,
3224,
370,
314,
26061,
14,
2002,
1380,
282,
334,
2865,
13,
1231,
9,
1853,
267,
365,
5370,
13810,
315,
314,
5793,
12,
1006,
402,
2399,
12082,
666,
267,
365,
295,
65,
328,
590,
2808,
334,
7395,
1929,
316,
370,
2879,
2399,
20158,
680,
398,
12643,
14895,
2551,
402,
314,
1853,
63,
6976,
883,
506,
6366,
1808,
314,
267,
2569,
3102,
26,
288,
11111,
7954,
63,
1239,
16222,
288,
2963,
63,
1648,
63,
1239,
16222,
398,
7628,
26,
288,
1853,
63,
6976,
334,
3142,
10766,
2377,
1617,
1451,
9,
446,
437,
17194,
355,
1853,
5523,
626,
365,
370,
506,
6042,
543,
13736,
355,
666,
370,
506,
6328,
367,
314,
21484,
14,
267,
408,
267,
986,
339,
768,
10315,
272,
347,
5793,
8,
277,
12,
4503,
63,
815,
12,
1853,
63,
6976,
304,
267,
408,
267,
6266,
3351,
314,
1627,
1853,
63,
6976,
367,
314,
1627,
4503,
63,
815,
12,
267,
18002,
314,
1853,
63,
6976,
3509,
6328,
666,
687,
282,
6791,
267,
1240,
370,
314,
8775,
1083,
402,
314,
8839,
1015,
402,
314,
267,
30486,
14,
398,
3091,
2879,
370,
314,
10996,
6590,
26621,
402,
671,
24996,
1077,
267,
506,
10585,
5309,
314,
6451,
402,
642,
1083,
14,
9738,
12,
267,
1066,
5804,
370,
922,
13,
6100,
666,
334,
22431,
402,
314,
10996,
436,
267,
440,
4799,
671,
24996,
9,
365,
8211,
315,
1865,
370,
4838,
314,
5793,
267
] |
[
199,
2765,
859,
6571,
314,
9006,
1300,
1021,
367,
1006,
8651,
21730,
199,
3188,
22932,
14,
199,
624,
199,
504,
13022,
492,
9006,
765,
421,
199,
533,
8651,
10766,
19761,
8,
785,
304,
272,
408,
272,
11836,
1300,
1021,
367,
1006,
1853,
5523,
1752,
22932,
14,
272,
408,
339,
327,
2900,
6266,
22932,
787,
1420,
370,
11075,
1015,
13,
2407,
1021,
272,
327,
3004,
14,
221,
22117,
314,
1338,
367,
314,
1300,
1021,
365,
663,
370,
378,
12,
272,
327,
314,
1338,
367,
1924,
13801,
21484,
1077,
506,
413,
503,
10948,
14,
272,
327,
272,
327,
437,
21484,
1159,
1015,
3004,
787,
1202,
701,
314,
1853,
63,
6976,
272,
327,
10059,
315,
1865,
370,
6705,
3775,
1263,
13736,
666,
367,
282,
272,
327,
21484,
365,
734,
19074,
2952,
402,
282,
666,
4177,
1570,
701,
314,
272,
327,
21484,
14,
272,
327,
272,
327,
710,
32280,
63,
4612,
1329,
365,
5489,
3180,
543,
314,
21484,
1159,
272,
327,
666,
1380,
652,
365,
13736,
436,
6328,
334,
27868,
314,
8775,
7669,
680,
272,
327,
710,
16767,
63,
4612,
1329,
365,
2066,
16317,
370,
506,
6656,
2419,
503,
4472,
272,
327,
370,
314,
1015,
4568,
543,
314,
13736,
666,
1380,
314,
272,
327,
13736,
666,
365,
13810,
334,
27868,
314,
5793,
7669,
680,
272,
327,
272,
327,
2136,
22237,
3382,
32280,
63,
4612,
436,
16767,
63,
4612,
5579,
315,
272,
327,
1865,
370,
26,
272,
327,
413,
14,
2291,
10030,
13,
7731,
12287,
1470,
2382,
892,
436,
4136,
5459,
272,
327,
259,
402,
314,
1233,
1300,
787,
27008,
590,
14043,
641,
3365,
272,
327,
259,
14123,
367,
282,
6247,
402,
900,
14,
272,
327,
272,
327,
259,
437,
499,
13,
6971,
14295,
365,
1202,
370,
410,
16267,
1586,
436,
2218,
4493,
14,
272,
327,
272,
327,
499,
14,
4666,
367,
7031,
12287,
1470,
2382,
652,
365,
7918,
590,
370,
295,
3357,
272,
327,
259,
1853,
13955,
367,
1006,
13588,
1380,
282,
21484,
1159,
13736,
272,
327,
259,
666,
4177,
4493,
14,
272,
327,
272,
327,
259,
437,
8020,
10041,
1414,
365,
1255,
370,
21619,
314,
892,
666,
14,
272,
327,
272,
327,
1666,
314,
2569,
2213,
367,
9848,
2556,
26,
272,
327,
4178,
921,
1490,
8268,
14,
292,
76,
2608,
290,
14,
846,
15,
6797,
15,
2918,
15,
2054,
15,
3142,
11,
10766,
11,
4437,
11,
3364,
425,
11,
919,
14506,
272,
327,
272,
327,
710,
32280,
63,
4612,
1329,
402,
282,
30486,
1077,
506,
10035,
2509,
272,
327,
1380,
652,
1159,
8775,
4514,
365,
1503,
328,
9462,
2896,
14,
10257,
3079,
272,
327,
7163,
1077,
506,
26391,
543,
4136,
16767,
63,
4612,
83,
272,
327,
5133,
1006,
7002,
83,
787,
4588,
14,
272,
327,
272,
327,
710,
16767,
63,
4612,
1329,
402,
282,
30486,
1077,
506,
10035,
2509,
272,
327,
1380,
2399,
5793,
4514,
365,
4588,
370,
1852,
675,
402,
314,
272,
327,
13903,
13736,
666,
446,
436,
14286,
1454,
2410,
1006,
13736,
272,
327,
1853,
13955,
787,
4588,
543,
314,
892,
32280,
63,
4612,
14,
272,
327,
272,
32280,
63,
4612,
275,
378,
272,
16767,
63,
4612,
275,
378,
339,
768,
3744,
272,
347,
536,
8,
1886,
304,
267,
408,
267,
18276,
5148,
367,
314,
21484,
1159,
1021,
14,
2779,
365,
1202,
370,
267,
10405,
314,
21484,
1159,
6328,
666,
14,
2002,
652,
1077,
506,
3747,
267,
436,
440,
12395,
543,
1163,
1752,
22932,
14,
24413,
1808,
314,
267,
2011,
536,
626,
365,
1202,
315,
314,
30486,
20738,
14,
2104,
2893,
12,
267,
367,
17854,
1354,
720,
12,
652,
365,
2013,
315,
314,
3272,
14,
647,
570,
14,
398,
19468,
314,
21484,
365,
315,
675,
436,
2399,
666,
365,
6328,
12,
886,
440,
267,
2811,
642,
536,
574,
1928,
8219,
1754,
402,
13388,
267,
7163,
543,
10889,
13736,
666,
14,
267,
408,
267,
746,
4279,
339,
768,
3744,
272,
347,
8775,
8,
1886,
12,
1853,
63,
6976,
304,
267,
408,
267,
19649,
83,
436,
14086,
1263,
671,
3142,
436,
10996,
666,
1901,
314,
267,
1853,
63,
6976,
626,
1159,
5784,
367,
2945,
6451,
402,
314,
267,
21484,
1159,
5793,
1083,
14,
6266,
22932,
1077,
3877,
4066,
267,
666,
315,
314,
1853,
63,
6976,
1808,
314,
2569,
3102,
26,
288,
663,
63,
19754,
63,
576,
288,
663,
63,
19754,
63,
1457,
63,
698,
288,
1056,
63,
11283,
63,
955,
398,
6266,
22932,
883,
1240,
1853,
63,
6976,
14,
1069,
63,
11283,
63,
955,
367,
267,
1263,
2863,
671,
3142,
1504,
626,
1077,
506,
13736,
701,
314,
267,
10059,
14,
398,
6184,
2615,
1853,
3123,
1468,
14895,
2551,
1077,
506,
6366,
315,
642,
267,
8775,
7669,
12,
23188,
314,
5793,
7669,
367,
7377,
436,
4125,
267,
2879,
370,
282,
1007,
13,
1457,
14,
982,
282,
1853,
1159,
5793,
1072,
365,
267,
11410,
641,
2399,
20158,
7,
666,
12,
314,
18432,
1159,
666,
1077,
506,
267,
1126,
331,
1776,
3224,
370,
314,
26061,
14,
2002,
1380,
282,
334,
2865,
13,
1231,
9,
1853,
267,
365,
5370,
13810,
315,
314,
5793,
12,
1006,
402,
2399,
12082,
666,
267,
365,
295,
65,
328,
590,
2808,
334,
7395,
1929,
316,
370,
2879,
2399,
20158,
680,
398,
12643,
14895,
2551,
402,
314,
1853,
63,
6976,
883,
506,
6366,
1808,
314,
267,
2569,
3102,
26,
288,
11111,
7954,
63,
1239,
16222,
288,
2963,
63,
1648,
63,
1239,
16222,
398,
7628,
26,
288,
1853,
63,
6976,
334,
3142,
10766,
2377,
1617,
1451,
9,
446,
437,
17194,
355,
1853,
5523,
626,
365,
370,
506,
6042,
543,
13736,
355,
666,
370,
506,
6328,
367,
314,
21484,
14,
267,
408,
267,
986,
339,
768,
10315,
272,
347,
5793,
8,
277,
12,
4503,
63,
815,
12,
1853,
63,
6976,
304,
267,
408,
267,
6266,
3351,
314,
1627,
1853,
63,
6976,
367,
314,
1627,
4503,
63,
815,
12,
267,
18002,
314,
1853,
63,
6976,
3509,
6328,
666,
687,
282,
6791,
267,
1240,
370,
314,
8775,
1083,
402,
314,
8839,
1015,
402,
314,
267,
30486,
14,
398,
3091,
2879,
370,
314,
10996,
6590,
26621,
402,
671,
24996,
1077,
267,
506,
10585,
5309,
314,
6451,
402,
642,
1083,
14,
9738,
12,
267,
1066,
5804,
370,
922,
13,
6100,
666,
334,
22431,
402,
314,
10996,
436,
267,
440,
4799,
671,
24996,
9,
365,
8211,
315,
1865,
370,
4838,
314,
5793,
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,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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
] |
ahmadiga/min_edx
|
lms/djangoapps/courseware/student_field_overrides.py
|
164
|
3118
|
"""
API related to providing field overrides for individual students. This is used
by the individual due dates feature.
"""
import json
from .field_overrides import FieldOverrideProvider
from .models import StudentFieldOverride
class IndividualStudentOverrideProvider(FieldOverrideProvider):
"""
A concrete implementation of
:class:`~courseware.field_overrides.FieldOverrideProvider` which allows for
overrides to be made on a per user basis.
"""
def get(self, block, name, default):
return get_override_for_user(self.user, block, name, default)
@classmethod
def enabled_for(cls, course):
"""This simple override provider is always enabled"""
return True
def get_override_for_user(user, block, name, default=None):
"""
Gets the value of the overridden field for the `user`. `block` and `name`
specify the block and the name of the field. If the field is not
overridden for the given user, returns `default`.
"""
if not hasattr(block, '_student_overrides'):
block._student_overrides = {} # pylint: disable=protected-access
overrides = block._student_overrides.get(user.id) # pylint: disable=protected-access
if overrides is None:
overrides = _get_overrides_for_user(user, block)
block._student_overrides[user.id] = overrides # pylint: disable=protected-access
return overrides.get(name, default)
def _get_overrides_for_user(user, block):
"""
Gets all of the individual student overrides for given user and block.
Returns a dictionary of field override values keyed by field name.
"""
query = StudentFieldOverride.objects.filter(
course_id=block.runtime.course_id,
location=block.location,
student_id=user.id,
)
overrides = {}
for override in query:
field = block.fields[override.field]
value = field.from_json(json.loads(override.value))
overrides[override.field] = value
return overrides
def override_field_for_user(user, block, name, value):
"""
Overrides a field for the `user`. `block` and `name` specify the block
and the name of the field on that block to override. `value` is the
value to set for the given field.
"""
override, _ = StudentFieldOverride.objects.get_or_create(
course_id=block.runtime.course_id,
location=block.location,
student_id=user.id,
field=name)
field = block.fields[name]
override.value = json.dumps(field.to_json(value))
override.save()
def clear_override_for_user(user, block, name):
"""
Clears a previously set field override for the `user`. `block` and `name`
specify the block and the name of the field on that block to clear.
This function is idempotent--if no override is set, nothing action is
performed.
"""
try:
StudentFieldOverride.objects.get(
course_id=block.runtime.course_id,
student_id=user.id,
location=block.location,
field=name).delete()
except StudentFieldOverride.DoesNotExist:
pass
|
agpl-3.0
|
[
624,
199,
3735,
4048,
370,
13070,
901,
10580,
367,
8212,
18557,
14,
221,
961,
365,
1202,
199,
991,
314,
8212,
7037,
10831,
3878,
14,
199,
624,
199,
646,
2022,
199,
199,
504,
1275,
698,
63,
12867,
492,
5024,
11954,
6663,
199,
504,
1275,
992,
492,
17246,
792,
11954,
421,
199,
533,
1010,
15067,
18086,
11954,
6663,
8,
792,
11954,
6663,
304,
272,
408,
272,
437,
13801,
4514,
402,
272,
520,
533,
6054,
17744,
14,
698,
63,
12867,
14,
792,
11954,
6663,
64,
1314,
6127,
367,
272,
10580,
370,
506,
6326,
641,
282,
1126,
922,
5597,
14,
272,
408,
272,
347,
664,
8,
277,
12,
1853,
12,
536,
12,
849,
304,
267,
372,
664,
63,
4415,
63,
509,
63,
751,
8,
277,
14,
751,
12,
1853,
12,
536,
12,
849,
9,
339,
768,
3744,
272,
347,
5223,
63,
509,
8,
1886,
12,
2518,
304,
267,
408,
2765,
3486,
4278,
5022,
365,
3544,
5223,
624,
267,
372,
715,
421,
199,
318,
664,
63,
4415,
63,
509,
63,
751,
8,
751,
12,
1853,
12,
536,
12,
849,
29,
403,
304,
272,
408,
272,
14509,
314,
574,
402,
314,
10087,
901,
367,
314,
658,
751,
2313,
221,
658,
1457,
64,
436,
658,
354,
64,
272,
4165,
314,
1853,
436,
314,
536,
402,
314,
901,
14,
221,
982,
314,
901,
365,
440,
272,
10087,
367,
314,
1627,
922,
12,
2529,
658,
885,
2313,
272,
408,
272,
340,
440,
2688,
8,
1457,
12,
2513,
5500,
63,
12867,
735,
267,
1853,
423,
5500,
63,
12867,
275,
1052,
221,
327,
4287,
26,
3507,
29,
6798,
13,
2732,
272,
10580,
275,
1853,
423,
5500,
63,
12867,
14,
362,
8,
751,
14,
344,
9,
221,
327,
4287,
26,
3507,
29,
6798,
13,
2732,
272,
340,
10580,
365,
488,
26,
267,
10580,
275,
485,
362,
63,
12867,
63,
509,
63,
751,
8,
751,
12,
1853,
9,
267,
1853,
423,
5500,
63,
12867,
59,
751,
14,
344,
61,
275,
10580,
221,
327,
4287,
26,
3507,
29,
6798,
13,
2732,
272,
372,
10580,
14,
362,
8,
354,
12,
849,
9,
421,
199,
318,
485,
362,
63,
12867,
63,
509,
63,
751,
8,
751,
12,
1853,
304,
272,
408,
272,
14509,
1006,
402,
314,
8212,
6474,
10580,
367,
1627,
922,
436,
1853,
14,
272,
1803,
282,
2600,
402,
901,
4278,
1338,
19272,
701,
901,
536,
14,
272,
408,
272,
1827,
275,
17246,
792,
11954,
14,
1462,
14,
1541,
8,
267,
2518,
63,
344,
29,
1457,
14,
7726,
14,
1972,
63,
344,
12,
267,
2909,
29,
1457,
14,
1985,
12,
267,
6474,
63,
344,
29,
751,
14,
344,
12,
272,
776,
272,
10580,
275,
1052,
272,
367,
4278,
315,
1827,
26,
267,
901,
275,
1853,
14,
955,
59,
4415,
14,
698,
61,
267,
574,
275,
901,
14,
504,
63,
1001,
8,
1001,
14,
3640,
8,
4415,
14,
585,
430,
267,
10580,
59,
4415,
14,
698,
61,
275,
574,
272,
372,
10580,
421,
199,
318,
4278,
63,
698,
63,
509,
63,
751,
8,
751,
12,
1853,
12,
536,
12,
574,
304,
272,
408,
272,
31144,
282,
901,
367,
314,
658,
751,
2313,
221,
658,
1457,
64,
436,
658,
354,
64,
4165,
314,
1853,
272,
436,
314,
536,
402,
314,
901,
641,
626,
1853,
370,
4278,
14,
221,
658,
585,
64,
365,
314,
272,
574,
370,
663,
367,
314,
1627,
901,
14,
272,
408,
272,
4278,
12,
485,
275,
17246,
792,
11954,
14,
1462,
14,
362,
63,
269,
63,
981,
8,
267,
2518,
63,
344,
29,
1457,
14,
7726,
14,
1972,
63,
344,
12,
267,
2909,
29,
1457,
14,
1985,
12,
267,
6474,
63,
344,
29,
751,
14,
344,
12,
267,
901,
29,
354,
9,
272,
901,
275,
1853,
14,
955,
59,
354,
61,
272,
4278,
14,
585,
275,
2022,
14,
4180,
8,
698,
14,
475,
63,
1001,
8,
585,
430,
272,
4278,
14,
2117,
342,
421,
199,
318,
5436,
63,
4415,
63,
509,
63,
751,
8,
751,
12,
1853,
12,
536,
304,
272,
408,
272,
14836,
83,
282,
10889,
663,
901,
4278,
367,
314,
658,
751,
2313,
221,
658,
1457,
64,
436,
658,
354,
64,
272,
4165,
314,
1853,
436,
314,
536,
402,
314,
901,
641,
626,
1853,
370,
5436,
14,
272,
961,
805,
365,
32122,
306,
692,
949,
4278,
365,
663,
12,
6548,
1595,
365,
272,
10585,
14,
272,
408,
272,
862,
26,
267,
17246,
792,
11954,
14,
1462,
14,
362,
8,
288,
2518,
63,
344,
29,
1457,
14,
7726,
14,
1972,
63,
344,
12,
288,
6474,
63,
344,
29,
751,
14,
344,
12,
288,
2909,
29,
1457,
14,
1985,
12,
288,
901,
29,
354,
680,
1807,
342,
272,
871,
17246,
792,
11954,
14,
7400,
26,
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
] |
[
199,
3735,
4048,
370,
13070,
901,
10580,
367,
8212,
18557,
14,
221,
961,
365,
1202,
199,
991,
314,
8212,
7037,
10831,
3878,
14,
199,
624,
199,
646,
2022,
199,
199,
504,
1275,
698,
63,
12867,
492,
5024,
11954,
6663,
199,
504,
1275,
992,
492,
17246,
792,
11954,
421,
199,
533,
1010,
15067,
18086,
11954,
6663,
8,
792,
11954,
6663,
304,
272,
408,
272,
437,
13801,
4514,
402,
272,
520,
533,
6054,
17744,
14,
698,
63,
12867,
14,
792,
11954,
6663,
64,
1314,
6127,
367,
272,
10580,
370,
506,
6326,
641,
282,
1126,
922,
5597,
14,
272,
408,
272,
347,
664,
8,
277,
12,
1853,
12,
536,
12,
849,
304,
267,
372,
664,
63,
4415,
63,
509,
63,
751,
8,
277,
14,
751,
12,
1853,
12,
536,
12,
849,
9,
339,
768,
3744,
272,
347,
5223,
63,
509,
8,
1886,
12,
2518,
304,
267,
408,
2765,
3486,
4278,
5022,
365,
3544,
5223,
624,
267,
372,
715,
421,
199,
318,
664,
63,
4415,
63,
509,
63,
751,
8,
751,
12,
1853,
12,
536,
12,
849,
29,
403,
304,
272,
408,
272,
14509,
314,
574,
402,
314,
10087,
901,
367,
314,
658,
751,
2313,
221,
658,
1457,
64,
436,
658,
354,
64,
272,
4165,
314,
1853,
436,
314,
536,
402,
314,
901,
14,
221,
982,
314,
901,
365,
440,
272,
10087,
367,
314,
1627,
922,
12,
2529,
658,
885,
2313,
272,
408,
272,
340,
440,
2688,
8,
1457,
12,
2513,
5500,
63,
12867,
735,
267,
1853,
423,
5500,
63,
12867,
275,
1052,
221,
327,
4287,
26,
3507,
29,
6798,
13,
2732,
272,
10580,
275,
1853,
423,
5500,
63,
12867,
14,
362,
8,
751,
14,
344,
9,
221,
327,
4287,
26,
3507,
29,
6798,
13,
2732,
272,
340,
10580,
365,
488,
26,
267,
10580,
275,
485,
362,
63,
12867,
63,
509,
63,
751,
8,
751,
12,
1853,
9,
267,
1853,
423,
5500,
63,
12867,
59,
751,
14,
344,
61,
275,
10580,
221,
327,
4287,
26,
3507,
29,
6798,
13,
2732,
272,
372,
10580,
14,
362,
8,
354,
12,
849,
9,
421,
199,
318,
485,
362,
63,
12867,
63,
509,
63,
751,
8,
751,
12,
1853,
304,
272,
408,
272,
14509,
1006,
402,
314,
8212,
6474,
10580,
367,
1627,
922,
436,
1853,
14,
272,
1803,
282,
2600,
402,
901,
4278,
1338,
19272,
701,
901,
536,
14,
272,
408,
272,
1827,
275,
17246,
792,
11954,
14,
1462,
14,
1541,
8,
267,
2518,
63,
344,
29,
1457,
14,
7726,
14,
1972,
63,
344,
12,
267,
2909,
29,
1457,
14,
1985,
12,
267,
6474,
63,
344,
29,
751,
14,
344,
12,
272,
776,
272,
10580,
275,
1052,
272,
367,
4278,
315,
1827,
26,
267,
901,
275,
1853,
14,
955,
59,
4415,
14,
698,
61,
267,
574,
275,
901,
14,
504,
63,
1001,
8,
1001,
14,
3640,
8,
4415,
14,
585,
430,
267,
10580,
59,
4415,
14,
698,
61,
275,
574,
272,
372,
10580,
421,
199,
318,
4278,
63,
698,
63,
509,
63,
751,
8,
751,
12,
1853,
12,
536,
12,
574,
304,
272,
408,
272,
31144,
282,
901,
367,
314,
658,
751,
2313,
221,
658,
1457,
64,
436,
658,
354,
64,
4165,
314,
1853,
272,
436,
314,
536,
402,
314,
901,
641,
626,
1853,
370,
4278,
14,
221,
658,
585,
64,
365,
314,
272,
574,
370,
663,
367,
314,
1627,
901,
14,
272,
408,
272,
4278,
12,
485,
275,
17246,
792,
11954,
14,
1462,
14,
362,
63,
269,
63,
981,
8,
267,
2518,
63,
344,
29,
1457,
14,
7726,
14,
1972,
63,
344,
12,
267,
2909,
29,
1457,
14,
1985,
12,
267,
6474,
63,
344,
29,
751,
14,
344,
12,
267,
901,
29,
354,
9,
272,
901,
275,
1853,
14,
955,
59,
354,
61,
272,
4278,
14,
585,
275,
2022,
14,
4180,
8,
698,
14,
475,
63,
1001,
8,
585,
430,
272,
4278,
14,
2117,
342,
421,
199,
318,
5436,
63,
4415,
63,
509,
63,
751,
8,
751,
12,
1853,
12,
536,
304,
272,
408,
272,
14836,
83,
282,
10889,
663,
901,
4278,
367,
314,
658,
751,
2313,
221,
658,
1457,
64,
436,
658,
354,
64,
272,
4165,
314,
1853,
436,
314,
536,
402,
314,
901,
641,
626,
1853,
370,
5436,
14,
272,
961,
805,
365,
32122,
306,
692,
949,
4278,
365,
663,
12,
6548,
1595,
365,
272,
10585,
14,
272,
408,
272,
862,
26,
267,
17246,
792,
11954,
14,
1462,
14,
362,
8,
288,
2518,
63,
344,
29,
1457,
14,
7726,
14,
1972,
63,
344,
12,
288,
6474,
63,
344,
29,
751,
14,
344,
12,
288,
2909,
29,
1457,
14,
1985,
12,
288,
901,
29,
354,
680,
1807,
342,
272,
871,
17246,
792,
11954,
14,
7400,
26,
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,
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,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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
] |
Korkki/django
|
tests/syndication_tests/feeds.py
|
278
|
4547
|
from __future__ import unicode_literals
from django.contrib.syndication import views
from django.utils import feedgenerator
from django.utils.timezone import get_fixed_timezone
from .models import Article, Entry
class TestRss2Feed(views.Feed):
title = 'My blog'
description = 'A more thorough description of my blog.'
link = '/blog/'
feed_guid = '/foo/bar/1234'
author_name = 'Sally Smith'
author_email = 'test@example.com'
author_link = 'http://www.example.com/'
categories = ('python', 'django')
feed_copyright = 'Copyright (c) 2007, Sally Smith'
ttl = 600
def items(self):
return Entry.objects.all()
def item_description(self, item):
return "Overridden description: %s" % item
def item_pubdate(self, item):
return item.published
def item_updateddate(self, item):
return item.updated
item_author_name = 'Sally Smith'
item_author_email = 'test@example.com'
item_author_link = 'http://www.example.com/'
item_categories = ('python', 'testing')
item_copyright = 'Copyright (c) 2007, Sally Smith'
class TestRss2FeedWithGuidIsPermaLinkTrue(TestRss2Feed):
def item_guid_is_permalink(self, item):
return True
class TestRss2FeedWithGuidIsPermaLinkFalse(TestRss2Feed):
def item_guid(self, item):
return str(item.pk)
def item_guid_is_permalink(self, item):
return False
class TestRss091Feed(TestRss2Feed):
feed_type = feedgenerator.RssUserland091Feed
class TestNoPubdateFeed(views.Feed):
title = 'Test feed'
link = '/feed/'
def items(self):
return Entry.objects.all()
class TestAtomFeed(TestRss2Feed):
feed_type = feedgenerator.Atom1Feed
subtitle = TestRss2Feed.description
class TestLatestFeed(TestRss2Feed):
"""
A feed where the latest entry date is an `updated` element.
"""
feed_type = feedgenerator.Atom1Feed
subtitle = TestRss2Feed.description
def items(self):
return Entry.objects.exclude(pk=5)
class ArticlesFeed(TestRss2Feed):
"""
A feed to test no link being defined. Articles have no get_absolute_url()
method, and item_link() is not defined.
"""
def items(self):
return Article.objects.all()
class TestEnclosureFeed(TestRss2Feed):
pass
class TemplateFeed(TestRss2Feed):
"""
A feed to test defining item titles and descriptions with templates.
"""
title_template = 'syndication/title.html'
description_template = 'syndication/description.html'
# Defining a template overrides any item_title definition
def item_title(self):
return "Not in a template"
class TemplateContextFeed(TestRss2Feed):
"""
A feed to test custom context data in templates for title or description.
"""
title_template = 'syndication/title_context.html'
description_template = 'syndication/description_context.html'
def get_context_data(self, **kwargs):
context = super(TemplateContextFeed, self).get_context_data(**kwargs)
context['foo'] = 'bar'
return context
class NaiveDatesFeed(TestAtomFeed):
"""
A feed with naive (non-timezone-aware) dates.
"""
def item_pubdate(self, item):
return item.published
class TZAwareDatesFeed(TestAtomFeed):
"""
A feed with timezone-aware dates.
"""
def item_pubdate(self, item):
# Provide a weird offset so that the test can know it's getting this
# specific offset and not accidentally getting on from
# settings.TIME_ZONE.
return item.published.replace(tzinfo=get_fixed_timezone(42))
class TestFeedUrlFeed(TestAtomFeed):
feed_url = 'http://example.com/customfeedurl/'
class MyCustomAtom1Feed(feedgenerator.Atom1Feed):
"""
Test of a custom feed generator class.
"""
def root_attributes(self):
attrs = super(MyCustomAtom1Feed, self).root_attributes()
attrs['django'] = 'rocks'
return attrs
def add_root_elements(self, handler):
super(MyCustomAtom1Feed, self).add_root_elements(handler)
handler.addQuickElement('spam', 'eggs')
def item_attributes(self, item):
attrs = super(MyCustomAtom1Feed, self).item_attributes(item)
attrs['bacon'] = 'yum'
return attrs
def add_item_elements(self, handler, item):
super(MyCustomAtom1Feed, self).add_item_elements(handler, item)
handler.addQuickElement('ministry', 'silly walks')
class TestCustomFeed(TestAtomFeed):
feed_type = MyCustomAtom1Feed
|
bsd-3-clause
|
[
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
504,
1639,
14,
2828,
14,
9466,
21171,
492,
6858,
199,
504,
1639,
14,
1208,
492,
4733,
4679,
199,
504,
1639,
14,
1208,
14,
7145,
492,
664,
63,
5964,
63,
7145,
199,
199,
504,
1275,
992,
492,
8281,
12,
11855,
421,
199,
533,
1379,
50,
385,
18,
7658,
8,
4196,
14,
7658,
304,
272,
2538,
275,
283,
5713,
19936,
7,
272,
1369,
275,
283,
33,
1655,
294,
269,
4937,
1369,
402,
3002,
19936,
3530,
272,
2142,
275,
1994,
11486,
4805,
272,
4733,
63,
9473,
275,
1994,
1421,
15,
1700,
15,
4321,
7,
272,
4132,
63,
354,
275,
283,
51,
1183,
25924,
7,
272,
4132,
63,
2123,
275,
283,
396,
32,
2694,
14,
957,
7,
272,
4132,
63,
1073,
275,
283,
1014,
921,
1544,
14,
2694,
14,
957,
4805,
272,
9695,
275,
661,
1548,
297,
283,
1176,
358,
272,
4733,
63,
7307,
275,
283,
7384,
334,
67,
9,
10219,
12,
428,
1183,
25924,
7,
272,
14856,
275,
11624,
339,
347,
2974,
8,
277,
304,
267,
372,
11855,
14,
1462,
14,
452,
342,
339,
347,
1242,
63,
1802,
8,
277,
12,
1242,
304,
267,
372,
298,
5674,
8639,
1369,
26,
450,
83,
2,
450,
1242,
339,
347,
1242,
63,
30218,
8,
277,
12,
1242,
304,
267,
372,
1242,
14,
8987,
339,
347,
1242,
63,
5334,
602,
8,
277,
12,
1242,
304,
267,
372,
1242,
14,
5334,
339,
1242,
63,
2502,
63,
354,
275,
283,
51,
1183,
25924,
7,
272,
1242,
63,
2502,
63,
2123,
275,
283,
396,
32,
2694,
14,
957,
7,
272,
1242,
63,
2502,
63,
1073,
275,
283,
1014,
921,
1544,
14,
2694,
14,
957,
4805,
272,
1242,
63,
8906,
275,
661,
1548,
297,
283,
4776,
358,
272,
1242,
63,
7307,
275,
283,
7384,
334,
67,
9,
10219,
12,
428,
1183,
25924,
7,
421,
199,
533,
1379,
50,
385,
18,
7658,
3007,
18834,
1831,
2623,
391,
3834,
549,
8,
774,
50,
385,
18,
7658,
304,
272,
347,
1242,
63,
9473,
63,
374,
63,
529,
2174,
2292,
8,
277,
12,
1242,
304,
267,
372,
715,
421,
199,
533,
1379,
50,
385,
18,
7658,
3007,
18834,
1831,
2623,
391,
3834,
797,
8,
774,
50,
385,
18,
7658,
304,
272,
347,
1242,
63,
9473,
8,
277,
12,
1242,
304,
267,
372,
620,
8,
1053,
14,
2051,
9,
339,
347,
1242,
63,
9473,
63,
374,
63,
529,
2174,
2292,
8,
277,
12,
1242,
304,
267,
372,
756,
421,
199,
533,
1379,
50,
385,
21013,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
4733,
63,
466,
275,
4733,
4679,
14,
50,
385,
1899,
9688,
21013,
7658,
421,
199,
533,
1379,
1944,
18060,
602,
7658,
8,
4196,
14,
7658,
304,
272,
2538,
275,
283,
774,
4733,
7,
272,
2142,
275,
1994,
3871,
4805,
339,
347,
2974,
8,
277,
304,
267,
372,
11855,
14,
1462,
14,
452,
342,
421,
199,
533,
1379,
12097,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
4733,
63,
466,
275,
4733,
4679,
14,
12097,
17,
7658,
272,
18197,
275,
1379,
50,
385,
18,
7658,
14,
1802,
421,
199,
533,
1379,
31438,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
408,
272,
437,
4733,
2382,
314,
8839,
2397,
1434,
365,
376,
658,
5334,
64,
1819,
14,
272,
408,
272,
4733,
63,
466,
275,
4733,
4679,
14,
12097,
17,
7658,
272,
18197,
275,
1379,
50,
385,
18,
7658,
14,
1802,
339,
347,
2974,
8,
277,
304,
267,
372,
11855,
14,
1462,
14,
5473,
8,
2051,
29,
21,
9,
421,
199,
533,
8281,
83,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
408,
272,
437,
4733,
370,
511,
949,
2142,
3769,
3247,
14,
8281,
83,
1172,
949,
664,
63,
6116,
63,
633,
342,
272,
1083,
12,
436,
1242,
63,
1073,
342,
365,
440,
3247,
14,
272,
408,
272,
347,
2974,
8,
277,
304,
267,
372,
8281,
14,
1462,
14,
452,
342,
421,
199,
533,
1379,
1327,
13008,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
986,
421,
199,
533,
5458,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
408,
272,
437,
4733,
370,
511,
12669,
1242,
16194,
436,
18714,
543,
7009,
14,
272,
408,
272,
2538,
63,
1160,
275,
283,
9466,
21171,
15,
1213,
14,
1360,
7,
272,
1369,
63,
1160,
275,
283,
9466,
21171,
15,
1802,
14,
1360,
7,
339,
327,
1487,
2408,
316,
282,
1978,
10580,
1263,
1242,
63,
1213,
5492,
272,
347,
1242,
63,
1213,
8,
277,
304,
267,
372,
298,
1763,
315,
282,
1978,
2,
421,
199,
533,
5458,
2998,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
408,
272,
437,
4733,
370,
511,
3537,
1067,
666,
315,
7009,
367,
2538,
503,
1369,
14,
272,
408,
272,
2538,
63,
1160,
275,
283,
9466,
21171,
15,
1213,
63,
1100,
14,
1360,
7,
272,
1369,
63,
1160,
275,
283,
9466,
21171,
15,
1802,
63,
1100,
14,
1360,
7,
339,
347,
664,
63,
1100,
63,
576,
8,
277,
12,
1011,
958,
304,
267,
1067,
275,
1613,
8,
4231,
2998,
7658,
12,
291,
680,
362,
63,
1100,
63,
576,
3682,
958,
9,
267,
1067,
459,
1421,
418,
275,
283,
1700,
7,
267,
372,
1067,
421,
199,
533,
11290,
1912,
36,
2335,
7658,
8,
774,
12097,
7658,
304,
272,
408,
272,
437,
4733,
543,
19995,
334,
2865,
13,
7145,
13,
14600,
9,
10831,
14,
272,
408,
272,
347,
1242,
63,
30218,
8,
277,
12,
1242,
304,
267,
372,
1242,
14,
8987,
421,
199,
533,
377,
21959,
1068,
36,
2335,
7658,
8,
774,
12097,
7658,
304,
272,
408,
272,
437,
4733,
543,
7137,
13,
14600,
10831,
14,
272,
408,
272,
347,
1242,
63,
30218,
8,
277,
12,
1242,
304,
267,
327,
22896,
282,
22965,
3268,
880,
626,
314,
511,
883,
5715,
652,
1159,
10232,
642,
267,
327,
2488,
3268,
436,
440,
24634,
1183,
10232,
641,
687,
267,
327,
2202,
14,
4961,
63,
15353,
14,
267,
372,
1242,
14,
8987,
14,
1814,
8,
9374,
29,
362,
63,
5964,
63,
7145,
8,
2260,
430,
421,
199,
533,
1379,
7658,
6417,
7658,
8,
774,
12097,
7658,
304,
272,
4733,
63,
633,
275,
283,
1014,
921,
2694,
14,
957,
15,
4229,
3871,
633,
4805,
421,
199,
533,
4932,
7223,
12097,
17,
7658,
8,
3871,
4679,
14,
12097,
17,
7658
] |
[
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
504,
1639,
14,
2828,
14,
9466,
21171,
492,
6858,
199,
504,
1639,
14,
1208,
492,
4733,
4679,
199,
504,
1639,
14,
1208,
14,
7145,
492,
664,
63,
5964,
63,
7145,
199,
199,
504,
1275,
992,
492,
8281,
12,
11855,
421,
199,
533,
1379,
50,
385,
18,
7658,
8,
4196,
14,
7658,
304,
272,
2538,
275,
283,
5713,
19936,
7,
272,
1369,
275,
283,
33,
1655,
294,
269,
4937,
1369,
402,
3002,
19936,
3530,
272,
2142,
275,
1994,
11486,
4805,
272,
4733,
63,
9473,
275,
1994,
1421,
15,
1700,
15,
4321,
7,
272,
4132,
63,
354,
275,
283,
51,
1183,
25924,
7,
272,
4132,
63,
2123,
275,
283,
396,
32,
2694,
14,
957,
7,
272,
4132,
63,
1073,
275,
283,
1014,
921,
1544,
14,
2694,
14,
957,
4805,
272,
9695,
275,
661,
1548,
297,
283,
1176,
358,
272,
4733,
63,
7307,
275,
283,
7384,
334,
67,
9,
10219,
12,
428,
1183,
25924,
7,
272,
14856,
275,
11624,
339,
347,
2974,
8,
277,
304,
267,
372,
11855,
14,
1462,
14,
452,
342,
339,
347,
1242,
63,
1802,
8,
277,
12,
1242,
304,
267,
372,
298,
5674,
8639,
1369,
26,
450,
83,
2,
450,
1242,
339,
347,
1242,
63,
30218,
8,
277,
12,
1242,
304,
267,
372,
1242,
14,
8987,
339,
347,
1242,
63,
5334,
602,
8,
277,
12,
1242,
304,
267,
372,
1242,
14,
5334,
339,
1242,
63,
2502,
63,
354,
275,
283,
51,
1183,
25924,
7,
272,
1242,
63,
2502,
63,
2123,
275,
283,
396,
32,
2694,
14,
957,
7,
272,
1242,
63,
2502,
63,
1073,
275,
283,
1014,
921,
1544,
14,
2694,
14,
957,
4805,
272,
1242,
63,
8906,
275,
661,
1548,
297,
283,
4776,
358,
272,
1242,
63,
7307,
275,
283,
7384,
334,
67,
9,
10219,
12,
428,
1183,
25924,
7,
421,
199,
533,
1379,
50,
385,
18,
7658,
3007,
18834,
1831,
2623,
391,
3834,
549,
8,
774,
50,
385,
18,
7658,
304,
272,
347,
1242,
63,
9473,
63,
374,
63,
529,
2174,
2292,
8,
277,
12,
1242,
304,
267,
372,
715,
421,
199,
533,
1379,
50,
385,
18,
7658,
3007,
18834,
1831,
2623,
391,
3834,
797,
8,
774,
50,
385,
18,
7658,
304,
272,
347,
1242,
63,
9473,
8,
277,
12,
1242,
304,
267,
372,
620,
8,
1053,
14,
2051,
9,
339,
347,
1242,
63,
9473,
63,
374,
63,
529,
2174,
2292,
8,
277,
12,
1242,
304,
267,
372,
756,
421,
199,
533,
1379,
50,
385,
21013,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
4733,
63,
466,
275,
4733,
4679,
14,
50,
385,
1899,
9688,
21013,
7658,
421,
199,
533,
1379,
1944,
18060,
602,
7658,
8,
4196,
14,
7658,
304,
272,
2538,
275,
283,
774,
4733,
7,
272,
2142,
275,
1994,
3871,
4805,
339,
347,
2974,
8,
277,
304,
267,
372,
11855,
14,
1462,
14,
452,
342,
421,
199,
533,
1379,
12097,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
4733,
63,
466,
275,
4733,
4679,
14,
12097,
17,
7658,
272,
18197,
275,
1379,
50,
385,
18,
7658,
14,
1802,
421,
199,
533,
1379,
31438,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
408,
272,
437,
4733,
2382,
314,
8839,
2397,
1434,
365,
376,
658,
5334,
64,
1819,
14,
272,
408,
272,
4733,
63,
466,
275,
4733,
4679,
14,
12097,
17,
7658,
272,
18197,
275,
1379,
50,
385,
18,
7658,
14,
1802,
339,
347,
2974,
8,
277,
304,
267,
372,
11855,
14,
1462,
14,
5473,
8,
2051,
29,
21,
9,
421,
199,
533,
8281,
83,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
408,
272,
437,
4733,
370,
511,
949,
2142,
3769,
3247,
14,
8281,
83,
1172,
949,
664,
63,
6116,
63,
633,
342,
272,
1083,
12,
436,
1242,
63,
1073,
342,
365,
440,
3247,
14,
272,
408,
272,
347,
2974,
8,
277,
304,
267,
372,
8281,
14,
1462,
14,
452,
342,
421,
199,
533,
1379,
1327,
13008,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
986,
421,
199,
533,
5458,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
408,
272,
437,
4733,
370,
511,
12669,
1242,
16194,
436,
18714,
543,
7009,
14,
272,
408,
272,
2538,
63,
1160,
275,
283,
9466,
21171,
15,
1213,
14,
1360,
7,
272,
1369,
63,
1160,
275,
283,
9466,
21171,
15,
1802,
14,
1360,
7,
339,
327,
1487,
2408,
316,
282,
1978,
10580,
1263,
1242,
63,
1213,
5492,
272,
347,
1242,
63,
1213,
8,
277,
304,
267,
372,
298,
1763,
315,
282,
1978,
2,
421,
199,
533,
5458,
2998,
7658,
8,
774,
50,
385,
18,
7658,
304,
272,
408,
272,
437,
4733,
370,
511,
3537,
1067,
666,
315,
7009,
367,
2538,
503,
1369,
14,
272,
408,
272,
2538,
63,
1160,
275,
283,
9466,
21171,
15,
1213,
63,
1100,
14,
1360,
7,
272,
1369,
63,
1160,
275,
283,
9466,
21171,
15,
1802,
63,
1100,
14,
1360,
7,
339,
347,
664,
63,
1100,
63,
576,
8,
277,
12,
1011,
958,
304,
267,
1067,
275,
1613,
8,
4231,
2998,
7658,
12,
291,
680,
362,
63,
1100,
63,
576,
3682,
958,
9,
267,
1067,
459,
1421,
418,
275,
283,
1700,
7,
267,
372,
1067,
421,
199,
533,
11290,
1912,
36,
2335,
7658,
8,
774,
12097,
7658,
304,
272,
408,
272,
437,
4733,
543,
19995,
334,
2865,
13,
7145,
13,
14600,
9,
10831,
14,
272,
408,
272,
347,
1242,
63,
30218,
8,
277,
12,
1242,
304,
267,
372,
1242,
14,
8987,
421,
199,
533,
377,
21959,
1068,
36,
2335,
7658,
8,
774,
12097,
7658,
304,
272,
408,
272,
437,
4733,
543,
7137,
13,
14600,
10831,
14,
272,
408,
272,
347,
1242,
63,
30218,
8,
277,
12,
1242,
304,
267,
327,
22896,
282,
22965,
3268,
880,
626,
314,
511,
883,
5715,
652,
1159,
10232,
642,
267,
327,
2488,
3268,
436,
440,
24634,
1183,
10232,
641,
687,
267,
327,
2202,
14,
4961,
63,
15353,
14,
267,
372,
1242,
14,
8987,
14,
1814,
8,
9374,
29,
362,
63,
5964,
63,
7145,
8,
2260,
430,
421,
199,
533,
1379,
7658,
6417,
7658,
8,
774,
12097,
7658,
304,
272,
4733,
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
] |
johankaito/fufuka
|
microblog/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py
|
1009
|
2281
|
import codecs
from uuid import uuid4
from io import BytesIO
from .packages import six
from .packages.six import b
from .fields import RequestField
writer = codecs.lookup('utf-8')[3]
def choose_boundary():
"""
Our embarassingly-simple replacement for mimetools.choose_boundary.
"""
return uuid4().hex
def iter_field_objects(fields):
"""
Iterate over fields.
Supports list of (k, v) tuples and dicts, and lists of
:class:`~urllib3.fields.RequestField`.
"""
if isinstance(fields, dict):
i = six.iteritems(fields)
else:
i = iter(fields)
for field in i:
if isinstance(field, RequestField):
yield field
else:
yield RequestField.from_tuples(*field)
def iter_fields(fields):
"""
.. deprecated:: 1.6
Iterate over fields.
The addition of :class:`~urllib3.fields.RequestField` makes this function
obsolete. Instead, use :func:`iter_field_objects`, which returns
:class:`~urllib3.fields.RequestField` objects.
Supports list of (k, v) tuples and dicts.
"""
if isinstance(fields, dict):
return ((k, v) for k, v in six.iteritems(fields))
return ((k, v) for k, v in fields)
def encode_multipart_formdata(fields, boundary=None):
"""
Encode a dictionary of ``fields`` using the multipart/form-data MIME format.
:param fields:
Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`).
:param boundary:
If not specified, then a random boundary will be generated using
:func:`mimetools.choose_boundary`.
"""
body = BytesIO()
if boundary is None:
boundary = choose_boundary()
for field in iter_field_objects(fields):
body.write(b('--%s\r\n' % (boundary)))
writer(body).write(field.render_headers())
data = field.data
if isinstance(data, int):
data = str(data) # Backwards compatibility
if isinstance(data, six.text_type):
writer(body).write(data)
else:
body.write(data)
body.write(b'\r\n')
body.write(b('--%s--\r\n' % (boundary)))
content_type = str('multipart/form-data; boundary=%s' % boundary)
return body.getvalue(), content_type
|
apache-2.0
|
[
646,
6010,
199,
199,
504,
5377,
492,
5377,
20,
199,
504,
5890,
492,
11808,
199,
199,
504,
1275,
5154,
492,
3816,
199,
504,
1275,
5154,
14,
4174,
492,
330,
199,
504,
1275,
955,
492,
4784,
792,
199,
199,
5491,
275,
6010,
14,
3892,
360,
1624,
13,
24,
5832,
19,
61,
421,
199,
318,
11496,
63,
9891,
837,
272,
408,
272,
25119,
25316,
285,
405,
316,
590,
13,
4129,
8343,
367,
6660,
2537,
14,
16143,
63,
9891,
14,
272,
408,
272,
372,
5377,
20,
1252,
4097,
421,
199,
318,
2740,
63,
698,
63,
1462,
8,
955,
304,
272,
408,
272,
23989,
1806,
1504,
14,
339,
32090,
769,
402,
334,
75,
12,
373,
9,
6346,
436,
10809,
12,
436,
5548,
402,
272,
520,
533,
6054,
4078,
19,
14,
955,
14,
2017,
792,
2313,
339,
408,
272,
340,
1228,
8,
955,
12,
1211,
304,
267,
284,
275,
3816,
14,
4611,
8,
955,
9,
272,
587,
26,
267,
284,
275,
2740,
8,
955,
9,
339,
367,
901,
315,
284,
26,
267,
340,
1228,
8,
698,
12,
4784,
792,
304,
288,
1995,
901,
267,
587,
26,
288,
1995,
4784,
792,
14,
504,
63,
11760,
2031,
698,
9,
421,
199,
318,
2740,
63,
955,
8,
955,
304,
272,
408,
272,
2508,
5906,
447,
413,
14,
22,
339,
23989,
1806,
1504,
14,
339,
710,
10234,
402,
520,
533,
6054,
4078,
19,
14,
955,
14,
2017,
792,
64,
7704,
642,
805,
272,
24985,
14,
15345,
12,
675,
520,
1532,
1705,
1661,
63,
698,
63,
1462,
3559,
1314,
2529,
272,
520,
533,
6054,
4078,
19,
14,
955,
14,
2017,
792,
64,
2251,
14,
339,
32090,
769,
402,
334,
75,
12,
373,
9,
6346,
436,
10809,
14,
272,
408,
272,
340,
1228,
8,
955,
12,
1211,
304,
267,
372,
3666,
75,
12,
373,
9,
367,
1022,
12,
373,
315,
3816,
14,
4611,
8,
955,
430,
339,
372,
3666,
75,
12,
373,
9,
367,
1022,
12,
373,
315,
1504,
9,
421,
199,
318,
3752,
63,
10123,
63,
30942,
8,
955,
12,
8424,
29,
403,
304,
272,
408,
272,
19244,
282,
2600,
402,
1124,
955,
1040,
1808,
314,
15193,
15,
964,
13,
576,
14735,
1475,
14,
339,
520,
635,
1504,
26,
267,
11932,
402,
1504,
503,
769,
402,
334,
498,
12,
520,
533,
6054,
4078,
19,
14,
955,
14,
2017,
792,
14963,
339,
520,
635,
8424,
26,
267,
982,
440,
2013,
12,
2066,
282,
2196,
8424,
911,
506,
4046,
1808,
267,
520,
1532,
1705,
7626,
2537,
14,
16143,
63,
9891,
2313,
272,
408,
272,
2396,
275,
11808,
342,
272,
340,
8424,
365,
488,
26,
267,
8424,
275,
11496,
63,
9891,
342,
339,
367,
901,
315,
2740,
63,
698,
63,
1462,
8,
955,
304,
267,
2396,
14,
952,
8,
66,
4517,
5,
83,
60,
82,
60,
78,
7,
450,
334,
9891,
1724,
398,
7060,
8,
2030,
680,
952,
8,
698,
14,
3352,
63,
2139,
1012,
267,
666,
275,
901,
14,
576,
398,
340,
1228,
8,
576,
12,
1109,
304,
288,
666,
275,
620,
8,
576,
9,
221,
327,
10257,
4751,
7163,
398,
340,
1228,
8,
576,
12,
3816,
14,
505,
63,
466,
304,
288,
7060,
8,
2030,
680,
952,
8,
576,
9,
267,
587,
26,
288,
2396,
14,
952,
8,
576,
9,
398,
2396,
14,
952,
8,
66,
1154,
82,
60,
78,
358,
339,
2396,
14,
952,
8,
66,
4517,
5,
83,
306,
60,
82,
60,
78,
7,
450,
334,
9891,
1724,
339,
1564,
63,
466,
275,
620,
360,
10123,
15,
964,
13,
576,
27,
8424,
2458,
83,
7,
450,
8424,
9,
339,
372,
2396,
14,
7150,
1062,
1564,
63,
466,
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
] |
[
6010,
199,
199,
504,
5377,
492,
5377,
20,
199,
504,
5890,
492,
11808,
199,
199,
504,
1275,
5154,
492,
3816,
199,
504,
1275,
5154,
14,
4174,
492,
330,
199,
504,
1275,
955,
492,
4784,
792,
199,
199,
5491,
275,
6010,
14,
3892,
360,
1624,
13,
24,
5832,
19,
61,
421,
199,
318,
11496,
63,
9891,
837,
272,
408,
272,
25119,
25316,
285,
405,
316,
590,
13,
4129,
8343,
367,
6660,
2537,
14,
16143,
63,
9891,
14,
272,
408,
272,
372,
5377,
20,
1252,
4097,
421,
199,
318,
2740,
63,
698,
63,
1462,
8,
955,
304,
272,
408,
272,
23989,
1806,
1504,
14,
339,
32090,
769,
402,
334,
75,
12,
373,
9,
6346,
436,
10809,
12,
436,
5548,
402,
272,
520,
533,
6054,
4078,
19,
14,
955,
14,
2017,
792,
2313,
339,
408,
272,
340,
1228,
8,
955,
12,
1211,
304,
267,
284,
275,
3816,
14,
4611,
8,
955,
9,
272,
587,
26,
267,
284,
275,
2740,
8,
955,
9,
339,
367,
901,
315,
284,
26,
267,
340,
1228,
8,
698,
12,
4784,
792,
304,
288,
1995,
901,
267,
587,
26,
288,
1995,
4784,
792,
14,
504,
63,
11760,
2031,
698,
9,
421,
199,
318,
2740,
63,
955,
8,
955,
304,
272,
408,
272,
2508,
5906,
447,
413,
14,
22,
339,
23989,
1806,
1504,
14,
339,
710,
10234,
402,
520,
533,
6054,
4078,
19,
14,
955,
14,
2017,
792,
64,
7704,
642,
805,
272,
24985,
14,
15345,
12,
675,
520,
1532,
1705,
1661,
63,
698,
63,
1462,
3559,
1314,
2529,
272,
520,
533,
6054,
4078,
19,
14,
955,
14,
2017,
792,
64,
2251,
14,
339,
32090,
769,
402,
334,
75,
12,
373,
9,
6346,
436,
10809,
14,
272,
408,
272,
340,
1228,
8,
955,
12,
1211,
304,
267,
372,
3666,
75,
12,
373,
9,
367,
1022,
12,
373,
315,
3816,
14,
4611,
8,
955,
430,
339,
372,
3666,
75,
12,
373,
9,
367,
1022,
12,
373,
315,
1504,
9,
421,
199,
318,
3752,
63,
10123,
63,
30942,
8,
955,
12,
8424,
29,
403,
304,
272,
408,
272,
19244,
282,
2600,
402,
1124,
955,
1040,
1808,
314,
15193,
15,
964,
13,
576,
14735,
1475,
14,
339,
520,
635,
1504,
26,
267,
11932,
402,
1504,
503,
769,
402,
334,
498,
12,
520,
533,
6054,
4078,
19,
14,
955,
14,
2017,
792,
14963,
339,
520,
635,
8424,
26,
267,
982,
440,
2013,
12,
2066,
282,
2196,
8424,
911,
506,
4046,
1808,
267,
520,
1532,
1705,
7626,
2537,
14,
16143,
63,
9891,
2313,
272,
408,
272,
2396,
275,
11808,
342,
272,
340,
8424,
365,
488,
26,
267,
8424,
275,
11496,
63,
9891,
342,
339,
367,
901,
315,
2740,
63,
698,
63,
1462,
8,
955,
304,
267,
2396,
14,
952,
8,
66,
4517,
5,
83,
60,
82,
60,
78,
7,
450,
334,
9891,
1724,
398,
7060,
8,
2030,
680,
952,
8,
698,
14,
3352,
63,
2139,
1012,
267,
666,
275,
901,
14,
576,
398,
340,
1228,
8,
576,
12,
1109,
304,
288,
666,
275,
620,
8,
576,
9,
221,
327,
10257,
4751,
7163,
398,
340,
1228,
8,
576,
12,
3816,
14,
505,
63,
466,
304,
288,
7060,
8,
2030,
680,
952,
8,
576,
9,
267,
587,
26,
288,
2396,
14,
952,
8,
576,
9,
398,
2396,
14,
952,
8,
66,
1154,
82,
60,
78,
358,
339,
2396,
14,
952,
8,
66,
4517,
5,
83,
306,
60,
82,
60,
78,
7,
450,
334,
9891,
1724,
339,
1564,
63,
466,
275,
620,
360,
10123,
15,
964,
13,
576,
27,
8424,
2458,
83,
7,
450,
8424,
9,
339,
372,
2396,
14,
7150,
1062,
1564,
63,
466,
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,
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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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
] |
inspyration/odoo
|
addons/website_crm_partner_assign/controllers/main.py
|
271
|
7541
|
# -*- coding: utf-8 -*-
import werkzeug
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models.website import slug, unslug
from openerp.tools.translate import _
class WebsiteCrmPartnerAssign(http.Controller):
_references_per_page = 40
@http.route([
'/partners',
'/partners/page/<int:page>',
'/partners/grade/<model("res.partner.grade"):grade>',
'/partners/grade/<model("res.partner.grade"):grade>/page/<int:page>',
'/partners/country/<model("res.country"):country>',
'/partners/country/<model("res.country"):country>/page/<int:page>',
'/partners/grade/<model("res.partner.grade"):grade>/country/<model("res.country"):country>',
'/partners/grade/<model("res.partner.grade"):grade>/country/<model("res.country"):country>/page/<int:page>',
], type='http', auth="public", website=True)
def partners(self, country=None, grade=None, page=0, **post):
country_all = post.pop('country_all', False)
partner_obj = request.registry['res.partner']
country_obj = request.registry['res.country']
search = post.get('search', '')
base_partner_domain = [('is_company', '=', True), ('grade_id.website_published', '=', True), ('website_published', '=', True)]
if search:
base_partner_domain += ['|', ('name', 'ilike', search), ('website_description', 'ilike', search)]
# group by grade
grade_domain = list(base_partner_domain)
if not country and not country_all:
country_code = request.session['geoip'].get('country_code')
if country_code:
country_ids = country_obj.search(request.cr, request.uid, [('code', '=', country_code)], context=request.context)
if country_ids:
country = country_obj.browse(request.cr, request.uid, country_ids[0], context=request.context)
if country:
grade_domain += [('country_id', '=', country.id)]
grades = partner_obj.read_group(
request.cr, SUPERUSER_ID, grade_domain, ["id", "grade_id"],
groupby="grade_id", orderby="grade_id DESC", context=request.context)
grades_partners = partner_obj.search(
request.cr, SUPERUSER_ID, grade_domain,
context=request.context, count=True)
# flag active grade
for grade_dict in grades:
grade_dict['active'] = grade and grade_dict['grade_id'][0] == grade.id
grades.insert(0, {
'grade_id_count': grades_partners,
'grade_id': (0, _("All Categories")),
'active': bool(grade is None),
})
# group by country
country_domain = list(base_partner_domain)
if grade:
country_domain += [('grade_id', '=', grade.id)]
countries = partner_obj.read_group(
request.cr, SUPERUSER_ID, country_domain, ["id", "country_id"],
groupby="country_id", orderby="country_id", context=request.context)
countries_partners = partner_obj.search(
request.cr, SUPERUSER_ID, country_domain,
context=request.context, count=True)
# flag active country
for country_dict in countries:
country_dict['active'] = country and country_dict['country_id'] and country_dict['country_id'][0] == country.id
countries.insert(0, {
'country_id_count': countries_partners,
'country_id': (0, _("All Countries")),
'active': bool(country is None),
})
# current search
if grade:
base_partner_domain += [('grade_id', '=', grade.id)]
if country:
base_partner_domain += [('country_id', '=', country.id)]
# format pager
if grade and not country:
url = '/partners/grade/' + slug(grade)
elif country and not grade:
url = '/partners/country/' + slug(country)
elif country and grade:
url = '/partners/grade/' + slug(grade) + '/country/' + slug(country)
else:
url = '/partners'
url_args = {}
if search:
url_args['search'] = search
if country_all:
url_args['country_all'] = True
partner_count = partner_obj.search_count(
request.cr, SUPERUSER_ID, base_partner_domain,
context=request.context)
pager = request.website.pager(
url=url, total=partner_count, page=page, step=self._references_per_page, scope=7,
url_args=url_args)
# search partners matching current search parameters
partner_ids = partner_obj.search(
request.cr, SUPERUSER_ID, base_partner_domain,
order="grade_id DESC",
context=request.context) # todo in trunk: order="grade_id DESC, implemented_count DESC", offset=pager['offset'], limit=self._references_per_page
partners = partner_obj.browse(request.cr, SUPERUSER_ID, partner_ids, request.context)
# remove me in trunk
partners = sorted(partners, key=lambda x: (x.grade_id.sequence if x.grade_id else 0, len([i for i in x.implemented_partner_ids if i.website_published])), reverse=True)
partners = partners[pager['offset']:pager['offset'] + self._references_per_page]
google_map_partner_ids = ','.join(map(str, [p.id for p in partners]))
values = {
'countries': countries,
'current_country': country,
'grades': grades,
'current_grade': grade,
'partners': partners,
'google_map_partner_ids': google_map_partner_ids,
'pager': pager,
'searches': post,
'search_path': "%s" % werkzeug.url_encode(post),
}
return request.website.render("website_crm_partner_assign.index", values)
# Do not use semantic controller due to SUPERUSER_ID
@http.route(['/partners/<partner_id>'], type='http', auth="public", website=True)
def partners_detail(self, partner_id, partner_name='', **post):
_, partner_id = unslug(partner_id)
current_grade, current_country = None, None
grade_id = post.get('grade_id')
country_id = post.get('country_id')
if grade_id:
grade_ids = request.registry['res.partner.grade'].exists(request.cr, request.uid, int(grade_id), context=request.context)
if grade_ids:
current_grade = request.registry['res.partner.grade'].browse(request.cr, request.uid, grade_ids[0], context=request.context)
if country_id:
country_ids = request.registry['res.country'].exists(request.cr, request.uid, int(country_id), context=request.context)
if country_ids:
current_country = request.registry['res.country'].browse(request.cr, request.uid, country_ids[0], context=request.context)
if partner_id:
partner = request.registry['res.partner'].browse(request.cr, SUPERUSER_ID, partner_id, context=request.context)
if partner.exists() and partner.website_published:
values = {
'main_object': partner,
'partner': partner,
'current_grade': current_grade,
'current_country': current_country
}
return request.website.render("website_crm_partner_assign.partner", values)
return self.partners(**post)
|
agpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
646,
10380,
199,
504,
5166,
492,
12824,
63,
998,
199,
504,
5166,
14,
10788,
14,
2520,
492,
1455,
199,
504,
5166,
14,
10788,
14,
2520,
14,
1014,
492,
1056,
199,
504,
5166,
14,
10788,
14,
7360,
14,
992,
14,
7360,
492,
8889,
12,
625,
5464,
199,
504,
5166,
14,
2537,
14,
5275,
492,
485,
421,
199,
533,
6001,
2124,
35,
5682,
24120,
9595,
8,
1014,
14,
7506,
304,
272,
485,
12635,
63,
529,
63,
1606,
275,
6335,
339,
768,
1014,
14,
4449,
779,
267,
1994,
23385,
297,
267,
1994,
23385,
15,
1606,
8316,
442,
26,
1606,
4206,
398,
1994,
23385,
15,
4523,
8316,
1238,
480,
470,
14,
3899,
14,
4523,
2349,
4523,
4206,
267,
1994,
23385,
15,
4523,
8316,
1238,
480,
470,
14,
3899,
14,
4523,
2349,
4523,
12202,
1606,
8316,
442,
26,
1606,
4206,
398,
1994,
23385,
15,
6063,
8316,
1238,
480,
470,
14,
6063,
2349,
6063,
4206,
267,
1994,
23385,
15,
6063,
8316,
1238,
480,
470,
14,
6063,
2349,
6063,
12202,
1606,
8316,
442,
26,
1606,
4206,
398,
1994,
23385,
15,
4523,
8316,
1238,
480,
470,
14,
3899,
14,
4523,
2349,
4523,
12202,
6063,
8316,
1238,
480,
470,
14,
6063,
2349,
6063,
4206,
267,
1994,
23385,
15,
4523,
8316,
1238,
480,
470,
14,
3899,
14,
4523,
2349,
4523,
12202,
6063,
8316,
1238,
480,
470,
14,
6063,
2349,
6063,
12202,
1606,
8316,
442,
26,
1606,
4206,
272,
2156,
730,
534,
1014,
297,
1790,
628,
3455,
401,
10691,
29,
549,
9,
272,
347,
18943,
8,
277,
12,
9023,
29,
403,
12,
16183,
29,
403,
12,
2034,
29,
16,
12,
1011,
1932,
304,
267,
9023,
63,
452,
275,
2963,
14,
1935,
360,
6063,
63,
452,
297,
756,
9,
267,
5854,
63,
1113,
275,
1056,
14,
5189,
459,
470,
14,
3899,
418,
267,
9023,
63,
1113,
275,
1056,
14,
5189,
459,
470,
14,
6063,
418,
267,
2754,
275,
2963,
14,
362,
360,
1733,
297,
4074,
398,
1300,
63,
3899,
63,
2261,
275,
4274,
374,
63,
4627,
297,
6291,
715,
395,
661,
4523,
63,
344,
14,
7360,
63,
8987,
297,
6291,
715,
395,
661,
7360,
63,
8987,
297,
6291,
715,
1874,
267,
340,
2754,
26,
288,
1300,
63,
3899,
63,
2261,
847,
788,
26320,
661,
354,
297,
283,
27774,
297,
2754,
395,
661,
7360,
63,
1802,
297,
283,
27774,
297,
2754,
1874,
398,
327,
1572,
701,
16183,
267,
16183,
63,
2261,
275,
769,
8,
1095,
63,
3899,
63,
2261,
9,
267,
340,
440,
9023,
436,
440,
9023,
63,
452,
26,
288,
9023,
63,
600,
275,
1056,
14,
1730,
459,
28799,
2278,
362,
360,
6063,
63,
600,
358,
288,
340,
9023,
63,
600,
26,
355,
9023,
63,
1580,
275,
9023,
63,
1113,
14,
1733,
8,
1069,
14,
1556,
12,
1056,
14,
1535,
12,
4274,
600,
297,
6291,
9023,
63,
600,
4360,
1067,
29,
1069,
14,
1100,
9,
355,
340,
9023,
63,
1580,
26,
490,
9023,
275,
9023,
63,
1113,
14,
4570,
8,
1069,
14,
1556,
12,
1056,
14,
1535,
12,
9023,
63,
1580,
59,
16,
467,
1067,
29,
1069,
14,
1100,
9,
267,
340,
9023,
26,
288,
16183,
63,
2261,
847,
4274,
6063,
63,
344,
297,
6291,
9023,
14,
344,
1874,
267,
1999,
3424,
275,
5854,
63,
1113,
14,
739,
63,
923,
8,
288,
1056,
14,
1556,
12,
12824,
63,
998,
12,
16183,
63,
2261,
12,
2097,
344,
401,
298,
4523,
63,
344,
2255,
288,
20371,
628,
4523,
63,
344,
401,
1865,
991,
628,
4523,
63,
344,
23915,
401,
1067,
29,
1069,
14,
1100,
9,
267,
1999,
3424,
63,
23385,
275,
5854,
63,
1113,
14,
1733,
8,
288,
1056,
14,
1556,
12,
12824,
63,
998,
12,
16183,
63,
2261,
12,
288,
1067,
29,
1069,
14,
1100,
12,
2338,
29,
549,
9,
267,
327,
3305,
4702,
16183,
267,
367,
16183,
63,
807,
315,
1999,
3424,
26,
288,
16183,
63,
807,
459,
2682,
418,
275,
16183,
436,
16183,
63,
807,
459,
4523,
63,
344,
3488,
16,
61,
508,
16183,
14,
344,
267,
1999,
3424,
14,
3176,
8,
16,
12,
469,
288,
283,
4523,
63,
344,
63,
835,
356,
1999,
3424,
63,
23385,
12,
288,
283,
4523,
63,
344,
356,
334,
16,
12,
3824,
2422,
23995,
6112,
8150,
288,
283,
2682,
356,
2155,
8,
4523,
365,
488,
395,
267,
3828,
398,
327,
1572,
701,
9023,
267,
9023,
63,
2261,
275,
769,
8,
1095,
63,
3899,
63,
2261,
9,
267,
340,
16183,
26,
288,
9023,
63,
2261,
847,
4274,
4523,
63,
344,
297,
6291,
16183,
14,
344,
1874,
267,
26013,
275,
5854,
63,
1113,
14,
739,
63,
923,
8,
288,
1056,
14,
1556,
12,
12824,
63,
998,
12,
9023,
63,
2261,
12,
2097,
344,
401,
298,
6063,
63,
344,
2255,
288,
20371,
628,
6063,
63,
344,
401,
1865,
991,
628,
6063,
63,
344,
401,
1067,
29,
1069,
14,
1100,
9,
267,
26013,
63,
23385,
275,
5854,
63,
1113,
14,
1733,
8,
288,
1056,
14,
1556,
12,
12824,
63,
998,
12,
9023,
63,
2261,
12,
288,
1067,
29,
1069,
14,
1100,
12,
2338,
29,
549,
9,
267,
327,
3305,
4702,
9023,
267,
367,
9023,
63,
807,
315,
26013,
26,
288,
9023,
63,
807,
459,
2682,
418,
275,
9023,
436,
9023,
63,
807,
459,
6063,
63,
344,
418,
436,
9023,
63,
807,
459,
6063,
63,
344,
3488,
16,
61,
508,
9023,
14,
344,
267,
26013,
14,
3176,
8,
16,
12,
469,
288,
283,
6063,
63,
344,
63,
835,
356,
26013,
63,
23385,
12,
288,
283,
6063,
63,
344,
356,
334,
16,
12,
3824,
2422,
1849,
324,
6264,
8150,
288,
283,
2682,
356,
2155,
8,
6063,
365,
488,
395,
267,
3828,
398,
327,
1453,
2754,
267,
340,
16183,
26,
288,
1300,
63,
3899,
63,
2261,
847,
4274,
4523,
63,
344,
297,
6291,
16183,
14,
344,
1874,
267,
340,
9023,
26,
288,
1300,
63,
3899,
63,
2261,
847,
4274,
6063,
63,
344,
297,
6291,
9023,
14,
344,
1874,
398,
327,
1475,
26581,
267,
340,
16183,
436,
440,
9023,
26,
288,
1166,
275,
1994,
23385,
15,
4523,
4805,
435,
8889,
8,
4523,
9,
267,
916,
9023,
436,
440,
16183,
26,
288,
1166,
275,
1994,
23385,
15,
6063,
4805,
435,
8889,
8,
6063,
9,
267,
916,
9023,
436,
16183,
26,
288,
1166,
275,
1994,
23385,
15,
4523,
4805,
435
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
646,
10380,
199,
504,
5166,
492,
12824,
63,
998,
199,
504,
5166,
14,
10788,
14,
2520,
492,
1455,
199,
504,
5166,
14,
10788,
14,
2520,
14,
1014,
492,
1056,
199,
504,
5166,
14,
10788,
14,
7360,
14,
992,
14,
7360,
492,
8889,
12,
625,
5464,
199,
504,
5166,
14,
2537,
14,
5275,
492,
485,
421,
199,
533,
6001,
2124,
35,
5682,
24120,
9595,
8,
1014,
14,
7506,
304,
272,
485,
12635,
63,
529,
63,
1606,
275,
6335,
339,
768,
1014,
14,
4449,
779,
267,
1994,
23385,
297,
267,
1994,
23385,
15,
1606,
8316,
442,
26,
1606,
4206,
398,
1994,
23385,
15,
4523,
8316,
1238,
480,
470,
14,
3899,
14,
4523,
2349,
4523,
4206,
267,
1994,
23385,
15,
4523,
8316,
1238,
480,
470,
14,
3899,
14,
4523,
2349,
4523,
12202,
1606,
8316,
442,
26,
1606,
4206,
398,
1994,
23385,
15,
6063,
8316,
1238,
480,
470,
14,
6063,
2349,
6063,
4206,
267,
1994,
23385,
15,
6063,
8316,
1238,
480,
470,
14,
6063,
2349,
6063,
12202,
1606,
8316,
442,
26,
1606,
4206,
398,
1994,
23385,
15,
4523,
8316,
1238,
480,
470,
14,
3899,
14,
4523,
2349,
4523,
12202,
6063,
8316,
1238,
480,
470,
14,
6063,
2349,
6063,
4206,
267,
1994,
23385,
15,
4523,
8316,
1238,
480,
470,
14,
3899,
14,
4523,
2349,
4523,
12202,
6063,
8316,
1238,
480,
470,
14,
6063,
2349,
6063,
12202,
1606,
8316,
442,
26,
1606,
4206,
272,
2156,
730,
534,
1014,
297,
1790,
628,
3455,
401,
10691,
29,
549,
9,
272,
347,
18943,
8,
277,
12,
9023,
29,
403,
12,
16183,
29,
403,
12,
2034,
29,
16,
12,
1011,
1932,
304,
267,
9023,
63,
452,
275,
2963,
14,
1935,
360,
6063,
63,
452,
297,
756,
9,
267,
5854,
63,
1113,
275,
1056,
14,
5189,
459,
470,
14,
3899,
418,
267,
9023,
63,
1113,
275,
1056,
14,
5189,
459,
470,
14,
6063,
418,
267,
2754,
275,
2963,
14,
362,
360,
1733,
297,
4074,
398,
1300,
63,
3899,
63,
2261,
275,
4274,
374,
63,
4627,
297,
6291,
715,
395,
661,
4523,
63,
344,
14,
7360,
63,
8987,
297,
6291,
715,
395,
661,
7360,
63,
8987,
297,
6291,
715,
1874,
267,
340,
2754,
26,
288,
1300,
63,
3899,
63,
2261,
847,
788,
26320,
661,
354,
297,
283,
27774,
297,
2754,
395,
661,
7360,
63,
1802,
297,
283,
27774,
297,
2754,
1874,
398,
327,
1572,
701,
16183,
267,
16183,
63,
2261,
275,
769,
8,
1095,
63,
3899,
63,
2261,
9,
267,
340,
440,
9023,
436,
440,
9023,
63,
452,
26,
288,
9023,
63,
600,
275,
1056,
14,
1730,
459,
28799,
2278,
362,
360,
6063,
63,
600,
358,
288,
340,
9023,
63,
600,
26,
355,
9023,
63,
1580,
275,
9023,
63,
1113,
14,
1733,
8,
1069,
14,
1556,
12,
1056,
14,
1535,
12,
4274,
600,
297,
6291,
9023,
63,
600,
4360,
1067,
29,
1069,
14,
1100,
9,
355,
340,
9023,
63,
1580,
26,
490,
9023,
275,
9023,
63,
1113,
14,
4570,
8,
1069,
14,
1556,
12,
1056,
14,
1535,
12,
9023,
63,
1580,
59,
16,
467,
1067,
29,
1069,
14,
1100,
9,
267,
340,
9023,
26,
288,
16183,
63,
2261,
847,
4274,
6063,
63,
344,
297,
6291,
9023,
14,
344,
1874,
267,
1999,
3424,
275,
5854,
63,
1113,
14,
739,
63,
923,
8,
288,
1056,
14,
1556,
12,
12824,
63,
998,
12,
16183,
63,
2261,
12,
2097,
344,
401,
298,
4523,
63,
344,
2255,
288,
20371,
628,
4523,
63,
344,
401,
1865,
991,
628,
4523,
63,
344,
23915,
401,
1067,
29,
1069,
14,
1100,
9,
267,
1999,
3424,
63,
23385,
275,
5854,
63,
1113,
14,
1733,
8,
288,
1056,
14,
1556,
12,
12824,
63,
998,
12,
16183,
63,
2261,
12,
288,
1067,
29,
1069,
14,
1100,
12,
2338,
29,
549,
9,
267,
327,
3305,
4702,
16183,
267,
367,
16183,
63,
807,
315,
1999,
3424,
26,
288,
16183,
63,
807,
459,
2682,
418,
275,
16183,
436,
16183,
63,
807,
459,
4523,
63,
344,
3488,
16,
61,
508,
16183,
14,
344,
267,
1999,
3424,
14,
3176,
8,
16,
12,
469,
288,
283,
4523,
63,
344,
63,
835,
356,
1999,
3424,
63,
23385,
12,
288,
283,
4523,
63,
344,
356,
334,
16,
12,
3824,
2422,
23995,
6112,
8150,
288,
283,
2682,
356,
2155,
8,
4523,
365,
488,
395,
267,
3828,
398,
327,
1572,
701,
9023,
267,
9023,
63,
2261,
275,
769,
8,
1095,
63,
3899,
63,
2261,
9,
267,
340,
16183,
26,
288,
9023,
63,
2261,
847,
4274,
4523,
63,
344,
297,
6291,
16183,
14,
344,
1874,
267,
26013,
275,
5854,
63,
1113,
14,
739,
63,
923,
8,
288,
1056,
14,
1556,
12,
12824,
63,
998,
12,
9023,
63,
2261,
12,
2097,
344,
401,
298,
6063,
63,
344,
2255,
288,
20371,
628,
6063,
63,
344,
401,
1865,
991,
628,
6063,
63,
344,
401,
1067,
29,
1069,
14,
1100,
9,
267,
26013,
63,
23385,
275,
5854,
63,
1113,
14,
1733,
8,
288,
1056,
14,
1556,
12,
12824,
63,
998,
12,
9023,
63,
2261,
12,
288,
1067,
29,
1069,
14,
1100,
12,
2338,
29,
549,
9,
267,
327,
3305,
4702,
9023,
267,
367,
9023,
63,
807,
315,
26013,
26,
288,
9023,
63,
807,
459,
2682,
418,
275,
9023,
436,
9023,
63,
807,
459,
6063,
63,
344,
418,
436,
9023,
63,
807,
459,
6063,
63,
344,
3488,
16,
61,
508,
9023,
14,
344,
267,
26013,
14,
3176,
8,
16,
12,
469,
288,
283,
6063,
63,
344,
63,
835,
356,
26013,
63,
23385,
12,
288,
283,
6063,
63,
344,
356,
334,
16,
12,
3824,
2422,
1849,
324,
6264,
8150,
288,
283,
2682,
356,
2155,
8,
6063,
365,
488,
395,
267,
3828,
398,
327,
1453,
2754,
267,
340,
16183,
26,
288,
1300,
63,
3899,
63,
2261,
847,
4274,
4523,
63,
344,
297,
6291,
16183,
14,
344,
1874,
267,
340,
9023,
26,
288,
1300,
63,
3899,
63,
2261,
847,
4274,
6063,
63,
344,
297,
6291,
9023,
14,
344,
1874,
398,
327,
1475,
26581,
267,
340,
16183,
436,
440,
9023,
26,
288,
1166,
275,
1994,
23385,
15,
4523,
4805,
435,
8889,
8,
4523,
9,
267,
916,
9023,
436,
440,
16183,
26,
288,
1166,
275,
1994,
23385,
15,
6063,
4805,
435,
8889,
8,
6063,
9,
267,
916,
9023,
436,
16183,
26,
288,
1166,
275,
1994,
23385,
15,
4523,
4805,
435,
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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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
] |
noelbk/neutron-juniper
|
neutron/openstack/common/rpc/impl_fake.py
|
11
|
5842
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.
"""Fake RPC implementation which calls proxy methods directly with no
queues. Casts will block, but this is very useful for tests.
"""
import inspect
# NOTE(russellb): We specifically want to use json, not our own jsonutils.
# jsonutils has some extra logic to automatically convert objects to primitive
# types so that they can be serialized. We want to catch all cases where
# non-primitive types make it into this code and treat it as an error.
import json
import time
import eventlet
from neutron.openstack.common.rpc import common as rpc_common
CONSUMERS = {}
class RpcContext(rpc_common.CommonRpcContext):
def __init__(self, **kwargs):
super(RpcContext, self).__init__(**kwargs)
self._response = []
self._done = False
def deepcopy(self):
values = self.to_dict()
new_inst = self.__class__(**values)
new_inst._response = self._response
new_inst._done = self._done
return new_inst
def reply(self, reply=None, failure=None, ending=False):
if ending:
self._done = True
if not self._done:
self._response.append((reply, failure))
class Consumer(object):
def __init__(self, topic, proxy):
self.topic = topic
self.proxy = proxy
def call(self, context, version, method, namespace, args, timeout):
done = eventlet.event.Event()
def _inner():
ctxt = RpcContext.from_dict(context.to_dict())
try:
rval = self.proxy.dispatch(context, version, method,
namespace, **args)
res = []
# Caller might have called ctxt.reply() manually
for (reply, failure) in ctxt._response:
if failure:
raise failure[0], failure[1], failure[2]
res.append(reply)
# if ending not 'sent'...we might have more data to
# return from the function itself
if not ctxt._done:
if inspect.isgenerator(rval):
for val in rval:
res.append(val)
else:
res.append(rval)
done.send(res)
except rpc_common.ClientException as e:
done.send_exception(e._exc_info[1])
except Exception as e:
done.send_exception(e)
thread = eventlet.greenthread.spawn(_inner)
if timeout:
start_time = time.time()
while not done.ready():
eventlet.greenthread.sleep(1)
cur_time = time.time()
if (cur_time - start_time) > timeout:
thread.kill()
raise rpc_common.Timeout()
return done.wait()
class Connection(object):
"""Connection object."""
def __init__(self):
self.consumers = []
def create_consumer(self, topic, proxy, fanout=False):
consumer = Consumer(topic, proxy)
self.consumers.append(consumer)
if topic not in CONSUMERS:
CONSUMERS[topic] = []
CONSUMERS[topic].append(consumer)
def close(self):
for consumer in self.consumers:
CONSUMERS[consumer.topic].remove(consumer)
self.consumers = []
def consume_in_thread(self):
pass
def create_connection(conf, new=True):
"""Create a connection."""
return Connection()
def check_serialize(msg):
"""Make sure a message intended for rpc can be serialized."""
json.dumps(msg)
def multicall(conf, context, topic, msg, timeout=None):
"""Make a call that returns multiple times."""
check_serialize(msg)
method = msg.get('method')
if not method:
return
args = msg.get('args', {})
version = msg.get('version', None)
namespace = msg.get('namespace', None)
try:
consumer = CONSUMERS[topic][0]
except (KeyError, IndexError):
return iter([None])
else:
return consumer.call(context, version, method, namespace, args,
timeout)
def call(conf, context, topic, msg, timeout=None):
"""Sends a message on a topic and wait for a response."""
rv = multicall(conf, context, topic, msg, timeout)
# NOTE(vish): return the last result from the multicall
rv = list(rv)
if not rv:
return
return rv[-1]
def cast(conf, context, topic, msg):
check_serialize(msg)
try:
call(conf, context, topic, msg)
except Exception:
pass
def notify(conf, context, topic, msg, envelope):
check_serialize(msg)
def cleanup():
pass
def fanout_cast(conf, context, topic, msg):
"""Cast to all consumers of a topic."""
check_serialize(msg)
method = msg.get('method')
if not method:
return
args = msg.get('args', {})
version = msg.get('version', None)
namespace = msg.get('namespace', None)
for consumer in CONSUMERS.get(topic, []):
try:
consumer.call(context, version, method, namespace, args, None)
except Exception:
pass
|
apache-2.0
|
[
3,
6695,
26,
20849,
29,
20,
20105,
29,
20,
25966,
29,
20,
199,
199,
3,
259,
1898,
7760,
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,
199,
624,
8249,
11785,
4514,
1314,
4882,
4566,
3102,
5370,
543,
949,
199,
18849,
14,
221,
445,
1810,
83,
911,
1853,
12,
1325,
642,
365,
7437,
2997,
367,
2295,
14,
199,
624,
199,
199,
646,
6485,
199,
3,
6944,
8,
20791,
23235,
66,
304,
2136,
22543,
2934,
370,
675,
2022,
12,
440,
4154,
5705,
18705,
14,
199,
3,
18705,
965,
2005,
2402,
9661,
370,
5847,
3957,
2251,
370,
18944,
199,
3,
2943,
880,
626,
2985,
883,
506,
6380,
14,
221,
2136,
2934,
370,
8579,
1006,
5560,
2382,
199,
3,
2222,
13,
16161,
2943,
1852,
652,
1901,
642,
1233,
436,
14312,
652,
465,
376,
1125,
14,
199,
646,
2022,
199,
646,
900,
199,
199,
646,
21819,
199,
199,
504,
8224,
14,
8512,
14,
2330,
14,
4354,
492,
2863,
465,
8985,
63,
2330,
199,
199,
1864,
13285,
3960,
275,
1052,
421,
199,
533,
820,
2352,
2998,
8,
4354,
63,
2330,
14,
7844,
15569,
2998,
304,
272,
347,
636,
826,
721,
277,
12,
1011,
958,
304,
267,
1613,
8,
15569,
2998,
12,
291,
2843,
826,
14155,
958,
9,
267,
291,
423,
1310,
275,
942,
267,
291,
423,
4456,
275,
756,
339,
347,
14800,
8,
277,
304,
267,
1338,
275,
291,
14,
475,
63,
807,
342,
267,
892,
63,
3615,
275,
291,
855,
533,
14155,
1459,
9,
267,
892,
63,
3615,
423,
1310,
275,
291,
423,
1310,
267,
892,
63,
3615,
423,
4456,
275,
291,
423,
4456,
267,
372,
892,
63,
3615,
339,
347,
9351,
8,
277,
12,
9351,
29,
403,
12,
5988,
29,
403,
12,
13401,
29,
797,
304,
267,
340,
13401,
26,
288,
291,
423,
4456,
275,
715,
267,
340,
440,
291,
423,
4456,
26,
288,
291,
423,
1310,
14,
740,
1332,
8102,
12,
5988,
430,
421,
199,
533,
1448,
5391,
8,
785,
304,
272,
347,
636,
826,
721,
277,
12,
7482,
12,
4566,
304,
267,
291,
14,
5746,
275,
7482,
267,
291,
14,
3280,
275,
4566,
339,
347,
1240,
8,
277,
12,
1067,
12,
1015,
12,
1083,
12,
3231,
12,
1249,
12,
2653,
304,
267,
4224,
275,
21819,
14,
1430,
14,
2390,
342,
398,
347,
485,
5216,
837,
288,
11216,
275,
820,
2352,
2998,
14,
504,
63,
807,
8,
1100,
14,
475,
63,
807,
1012,
288,
862,
26,
355,
15010,
275,
291,
14,
3280,
14,
6052,
8,
1100,
12,
1015,
12,
1083,
12,
5644,
3231,
12,
1011,
589,
9,
355,
522,
275,
942,
355,
327,
8256,
1435,
5594,
1172,
2797,
11216,
14,
8102,
342,
10250,
355,
367,
334,
8102,
12,
5988,
9,
315,
11216,
423,
1310,
26,
490,
340,
5988,
26,
717,
746,
5988,
59,
16,
467,
5988,
59,
17,
467,
5988,
59,
18,
61,
490,
522,
14,
740,
8,
8102,
9,
355,
327,
340,
13401,
440,
283,
1150,
7,
1396,
1129,
5594,
1172,
1655,
666,
370,
355,
327,
372,
687,
314,
805,
6337,
355,
340,
440,
11216,
423,
4456,
26,
490,
340,
6485,
14,
374,
4679,
8,
24530,
304,
717,
367,
1139,
315,
15010,
26,
1169,
522,
14,
740,
8,
637,
9,
490,
587,
26,
717,
522,
14,
740,
8,
24530,
9,
355,
4224,
14,
2254,
8,
470,
9,
288,
871,
8985,
63,
2330,
14,
3041,
1726,
465,
325,
26,
355,
4224,
14,
2254,
63,
1971,
8,
69,
423,
2804,
63,
815,
59,
17,
566,
288,
871,
2186,
465,
325,
26,
355,
4224,
14,
2254,
63,
1971,
8,
69,
9,
398,
2462,
275,
21819,
14,
7731,
2671,
14,
10212,
1547,
5216,
9,
398,
340,
2653,
26,
288,
1343,
63,
521,
275,
900,
14,
521,
342,
288,
1830,
440,
4224,
14,
2179,
837,
355,
21819,
14,
7731,
2671,
14,
4532,
8,
17,
9,
355,
1094,
63,
521,
275,
900,
14,
521,
342,
355,
340,
334,
895,
63,
521,
446,
1343,
63,
521,
9,
690,
2653,
26,
490,
2462,
14,
8997,
342,
490,
746,
8985,
63,
2330,
14,
6372,
342,
398,
372,
4224,
14,
2573,
342,
421,
199,
533,
8113,
8,
785,
304,
272,
408,
3225,
909,
1041,
339,
347,
636,
826,
721,
277,
304,
267,
291,
14,
10235,
2393,
275,
942,
339,
347,
1218,
63,
8542,
8,
277,
12,
7482,
12,
4566,
12,
13758,
548,
29,
797,
304,
267,
9790,
275,
1448,
5391,
8,
5746,
12,
4566,
9,
267,
291,
14,
10235,
2393,
14,
740,
8,
8542,
9,
267,
340,
7482,
440,
315,
1868,
13285,
3960,
26,
288,
1868,
13285,
3960,
59,
5746,
61,
275,
942,
267,
1868,
13285,
3960,
59,
5746,
1055,
740,
8,
8542,
9,
339,
347,
4002,
8,
277,
304,
267,
367,
9790,
315,
291,
14,
10235,
2393,
26,
288,
1868,
13285,
3960,
59,
8542,
14,
5746,
1055,
2168,
8,
8542,
9,
267,
291,
14,
10235,
2393,
275,
942,
339,
347,
9451,
63,
262,
63,
2671,
8,
277,
304,
267,
986,
421,
199,
318,
1218,
63,
2105,
8,
2190,
12,
892,
29,
549,
304,
272,
408,
2499,
282,
1950,
1041,
272,
372,
8113,
342,
421,
199,
318,
1104,
63,
3549,
8,
1328,
304,
272,
408,
5483,
3238,
282,
1245,
11619,
367,
8985,
883,
506,
6380,
1041,
272,
2022,
14,
4180,
8,
1328,
9,
421,
199,
318,
19207,
764,
452,
8,
2190,
12,
1067,
12,
7482,
12,
1499,
12,
2653,
29,
403,
304,
272,
408,
5483,
282,
1240,
626,
2529,
3663,
5431,
1041,
339,
1104,
63,
3549,
8,
1328,
9,
339,
1083,
275,
1499
] |
[
6695,
26,
20849,
29,
20,
20105,
29,
20,
25966,
29,
20,
199,
199,
3,
259,
1898,
7760,
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,
199,
624,
8249,
11785,
4514,
1314,
4882,
4566,
3102,
5370,
543,
949,
199,
18849,
14,
221,
445,
1810,
83,
911,
1853,
12,
1325,
642,
365,
7437,
2997,
367,
2295,
14,
199,
624,
199,
199,
646,
6485,
199,
3,
6944,
8,
20791,
23235,
66,
304,
2136,
22543,
2934,
370,
675,
2022,
12,
440,
4154,
5705,
18705,
14,
199,
3,
18705,
965,
2005,
2402,
9661,
370,
5847,
3957,
2251,
370,
18944,
199,
3,
2943,
880,
626,
2985,
883,
506,
6380,
14,
221,
2136,
2934,
370,
8579,
1006,
5560,
2382,
199,
3,
2222,
13,
16161,
2943,
1852,
652,
1901,
642,
1233,
436,
14312,
652,
465,
376,
1125,
14,
199,
646,
2022,
199,
646,
900,
199,
199,
646,
21819,
199,
199,
504,
8224,
14,
8512,
14,
2330,
14,
4354,
492,
2863,
465,
8985,
63,
2330,
199,
199,
1864,
13285,
3960,
275,
1052,
421,
199,
533,
820,
2352,
2998,
8,
4354,
63,
2330,
14,
7844,
15569,
2998,
304,
272,
347,
636,
826,
721,
277,
12,
1011,
958,
304,
267,
1613,
8,
15569,
2998,
12,
291,
2843,
826,
14155,
958,
9,
267,
291,
423,
1310,
275,
942,
267,
291,
423,
4456,
275,
756,
339,
347,
14800,
8,
277,
304,
267,
1338,
275,
291,
14,
475,
63,
807,
342,
267,
892,
63,
3615,
275,
291,
855,
533,
14155,
1459,
9,
267,
892,
63,
3615,
423,
1310,
275,
291,
423,
1310,
267,
892,
63,
3615,
423,
4456,
275,
291,
423,
4456,
267,
372,
892,
63,
3615,
339,
347,
9351,
8,
277,
12,
9351,
29,
403,
12,
5988,
29,
403,
12,
13401,
29,
797,
304,
267,
340,
13401,
26,
288,
291,
423,
4456,
275,
715,
267,
340,
440,
291,
423,
4456,
26,
288,
291,
423,
1310,
14,
740,
1332,
8102,
12,
5988,
430,
421,
199,
533,
1448,
5391,
8,
785,
304,
272,
347,
636,
826,
721,
277,
12,
7482,
12,
4566,
304,
267,
291,
14,
5746,
275,
7482,
267,
291,
14,
3280,
275,
4566,
339,
347,
1240,
8,
277,
12,
1067,
12,
1015,
12,
1083,
12,
3231,
12,
1249,
12,
2653,
304,
267,
4224,
275,
21819,
14,
1430,
14,
2390,
342,
398,
347,
485,
5216,
837,
288,
11216,
275,
820,
2352,
2998,
14,
504,
63,
807,
8,
1100,
14,
475,
63,
807,
1012,
288,
862,
26,
355,
15010,
275,
291,
14,
3280,
14,
6052,
8,
1100,
12,
1015,
12,
1083,
12,
5644,
3231,
12,
1011,
589,
9,
355,
522,
275,
942,
355,
327,
8256,
1435,
5594,
1172,
2797,
11216,
14,
8102,
342,
10250,
355,
367,
334,
8102,
12,
5988,
9,
315,
11216,
423,
1310,
26,
490,
340,
5988,
26,
717,
746,
5988,
59,
16,
467,
5988,
59,
17,
467,
5988,
59,
18,
61,
490,
522,
14,
740,
8,
8102,
9,
355,
327,
340,
13401,
440,
283,
1150,
7,
1396,
1129,
5594,
1172,
1655,
666,
370,
355,
327,
372,
687,
314,
805,
6337,
355,
340,
440,
11216,
423,
4456,
26,
490,
340,
6485,
14,
374,
4679,
8,
24530,
304,
717,
367,
1139,
315,
15010,
26,
1169,
522,
14,
740,
8,
637,
9,
490,
587,
26,
717,
522,
14,
740,
8,
24530,
9,
355,
4224,
14,
2254,
8,
470,
9,
288,
871,
8985,
63,
2330,
14,
3041,
1726,
465,
325,
26,
355,
4224,
14,
2254,
63,
1971,
8,
69,
423,
2804,
63,
815,
59,
17,
566,
288,
871,
2186,
465,
325,
26,
355,
4224,
14,
2254,
63,
1971,
8,
69,
9,
398,
2462,
275,
21819,
14,
7731,
2671,
14,
10212,
1547,
5216,
9,
398,
340,
2653,
26,
288,
1343,
63,
521,
275,
900,
14,
521,
342,
288,
1830,
440,
4224,
14,
2179,
837,
355,
21819,
14,
7731,
2671,
14,
4532,
8,
17,
9,
355,
1094,
63,
521,
275,
900,
14,
521,
342,
355,
340,
334,
895,
63,
521,
446,
1343,
63,
521,
9,
690,
2653,
26,
490,
2462,
14,
8997,
342,
490,
746,
8985,
63,
2330,
14,
6372,
342,
398,
372,
4224,
14,
2573,
342,
421,
199,
533,
8113,
8,
785,
304,
272,
408,
3225,
909,
1041,
339,
347,
636,
826,
721,
277,
304,
267,
291,
14,
10235,
2393,
275,
942,
339,
347,
1218,
63,
8542,
8,
277,
12,
7482,
12,
4566,
12,
13758,
548,
29,
797,
304,
267,
9790,
275,
1448,
5391,
8,
5746,
12,
4566,
9,
267,
291,
14,
10235,
2393,
14,
740,
8,
8542,
9,
267,
340,
7482,
440,
315,
1868,
13285,
3960,
26,
288,
1868,
13285,
3960,
59,
5746,
61,
275,
942,
267,
1868,
13285,
3960,
59,
5746,
1055,
740,
8,
8542,
9,
339,
347,
4002,
8,
277,
304,
267,
367,
9790,
315,
291,
14,
10235,
2393,
26,
288,
1868,
13285,
3960,
59,
8542,
14,
5746,
1055,
2168,
8,
8542,
9,
267,
291,
14,
10235,
2393,
275,
942,
339,
347,
9451,
63,
262,
63,
2671,
8,
277,
304,
267,
986,
421,
199,
318,
1218,
63,
2105,
8,
2190,
12,
892,
29,
549,
304,
272,
408,
2499,
282,
1950,
1041,
272,
372,
8113,
342,
421,
199,
318,
1104,
63,
3549,
8,
1328,
304,
272,
408,
5483,
3238,
282,
1245,
11619,
367,
8985,
883,
506,
6380,
1041,
272,
2022,
14,
4180,
8,
1328,
9,
421,
199,
318,
19207,
764,
452,
8,
2190,
12,
1067,
12,
7482,
12,
1499,
12,
2653,
29,
403,
304,
272,
408,
5483,
282,
1240,
626,
2529,
3663,
5431,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
repotvsupertuga/repo
|
plugin.program.super.favourites/yt.py
|
19
|
16890
|
#
# Copyright (C) 2013 Sean Poyser
#
#
# This code is a derivative of the YouTube plugin for XBMC
# released under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3
# Copyright (C) 2010-2012 Tobias Ussing And Henrik Mosgaard Jensen
#
# 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 3, 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 XBMC; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
#
# 5: "240p h263 flv container",
# 18: "360p h264 mp4 container | 270 for rtmpe?",
# 22: "720p h264 mp4 container",
# 26: "???",
# 33: "???",
# 34: "360p h264 flv container",
# 35: "480p h264 flv container",
# 37: "1080p h264 mp4 container",
# 38: "720p vp8 webm container",
# 43: "360p h264 flv container",
# 44: "480p vp8 webm container",
# 45: "720p vp8 webm container",
# 46: "520p vp8 webm stereo",
# 59: "480 for rtmpe",
# 78: "seems to be around 400 for rtmpe",
# 82: "360p h264 stereo",
# 83: "240p h264 stereo",
# 84: "720p h264 stereo",
# 85: "520p h264 stereo",
# 100: "360p vp8 webm stereo",
# 101: "480p vp8 webm stereo",
# 102: "720p vp8 webm stereo",
# 120: "hd720",
# 121: "hd1080"
import re
import urllib2
import urllib
import cgi
import HTMLParser
try: import simplejson as json
except ImportError: import json
MAX_REC_DEPTH = 5
def Clean(text):
text = text.replace('–', '-')
text = text.replace('’', '\'')
text = text.replace('“', '"')
text = text.replace('”', '"')
text = text.replace(''', '\'')
text = text.replace('<b>', '')
text = text.replace('</b>', '')
text = text.replace('&', '&')
text = text.replace('\ufeff', '')
return text
def PlayVideo(id):
import xbmcgui
import sys
import utils
busy = utils.showBusy()
video, links = GetVideoInformation(id)
if busy:
busy.close()
if 'best' not in video:
return False
url = video['best']
title = video['title']
image = video['thumbnail']
liz = xbmcgui.ListItem(title, iconImage=image, thumbnailImage=image)
liz.setInfo( type="Video", infoLabels={ "Title": title} )
if len(sys.argv) < 2 or int(sys.argv[1]) == -1:
import xbmc
pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
pl.clear()
pl.add(url, liz)
xbmc.Player().play(pl)
else:
import xbmcplugin
liz.setPath(url)
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
return True
def GetVideoInformation(id):
#id = 'H7iQ4sAf0OE' #test for HLSVP
#id = 'ofHlUJuw8Ak' #test for stereo
#id = 'ifZkeuSrNRc' #account closed
#id = 'M7FIvfx5J10'
#id = 'n-D1EB74Ckg' #vevo
#id = 'lVMWEheQ2hU' #vevo
video = {}
links = []
try: video, links = GetVideoInfo(id)
except : pass
return video, links
def GetVideoInfo(id):
url = 'http://www.youtube.com/watch?v=%s&safeSearch=none' % id
html = FetchPage(url)
video, links = Scrape(html)
video['videoid'] = id
video['thumbnail'] = "http://i.ytimg.com/vi/%s/0.jpg" % video['videoid']
video['title'] = GetVideoTitle(html)
if len(links) == 0:
if 'hlsvp' in video:
video['best'] = video['hlsvp']
else:
video['best'] = links[0][1]
return video, links
def GetVideoTitle(html):
try: return Clean(re.compile('<meta name="title" content="(.+?)">').search(html).groups(1)[0])
except: pass
return 'YouTube Video'
def Scrape(html):
stereo = [82, 83, 84, 85, 100, 101, 102]
video = {}
links = []
flashvars = ExtractFlashVars(html)
if not flashvars.has_key(u"url_encoded_fmt_stream_map"):
return video, links
if flashvars.has_key(u"ttsurl"):
video[u"ttsurl"] = flashvars[u"ttsurl"]
if flashvars.has_key(u"hlsvp"):
video[u"hlsvp"] = flashvars[u"hlsvp"]
for url_desc in flashvars[u"url_encoded_fmt_stream_map"].split(u","):
url_desc_map = cgi.parse_qs(url_desc)
if not (url_desc_map.has_key(u"url") or url_desc_map.has_key(u"stream")):
continue
key = int(url_desc_map[u"itag"][0])
url = u""
if url_desc_map.has_key(u"url"):
url = urllib.unquote(url_desc_map[u"url"][0])
elif url_desc_map.has_key(u"conn") and url_desc_map.has_key(u"stream"):
url = urllib.unquote(url_desc_map[u"conn"][0])
if url.rfind("/") < len(url) -1:
url = url + "/"
url = url + urllib.unquote(url_desc_map[u"stream"][0])
elif url_desc_map.has_key(u"stream") and not url_desc_map.has_key(u"conn"):
url = urllib.unquote(url_desc_map[u"stream"][0])
if url_desc_map.has_key(u"sig"):
url = url + u"&signature=" + url_desc_map[u"sig"][0]
elif url_desc_map.has_key(u"s"):
sig = url_desc_map[u"s"][0]
#url = url + u"&signature=" + DecryptSignature(sig)
flashvars = ExtractFlashVars(html, assets=True)
js = flashvars[u"js"]
url += u"&signature=" + DecryptSignatureNew(sig, js)
if key not in stereo:
links.append([key, url])
#links.sort(reverse=True)
return video, links
def DecryptSignature(s):
''' use decryption solution by Youtube-DL project '''
if len(s) == 88:
return s[48] + s[81:67:-1] + s[82] + s[66:62:-1] + s[85] + s[61:48:-1] + s[67] + s[47:12:-1] + s[3] + s[11:3:-1] + s[2] + s[12]
elif len(s) == 87:
return s[62] + s[82:62:-1] + s[83] + s[61:52:-1] + s[0] + s[51:2:-1]
elif len(s) == 86:
return s[2:63] + s[82] + s[64:82] + s[63]
elif len(s) == 85:
return s[76] + s[82:76:-1] + s[83] + s[75:60:-1] + s[0] + s[59:50:-1] + s[1] + s[49:2:-1]
elif len(s) == 84:
return s[83:36:-1] + s[2] + s[35:26:-1] + s[3] + s[25:3:-1] + s[26]
elif len(s) == 83:
return s[6] + s[3:6] + s[33] + s[7:24] + s[0] + s[25:33] + s[53] + s[34:53] + s[24] + s[54:]
elif len(s) == 82:
return s[36] + s[79:67:-1] + s[81] + s[66:40:-1] + s[33] + s[39:36:-1] + s[40] + s[35] + s[0] + s[67] + s[32:0:-1] + s[34]
elif len(s) == 81:
return s[6] + s[3:6] + s[33] + s[7:24] + s[0] + s[25:33] + s[2] + s[34:53] + s[24] + s[54:81]
elif len(s) == 92:
return s[25] + s[3:25] + s[0] + s[26:42] + s[79] + s[43:79] + s[91] + s[80:83];
#else:
# print ('Unable to decrypt signature, key length %d not supported; retrying might work' % (len(s)))
def ExtractFlashVars(data, assets=False):
flashvars = {}
found = False
for line in data.split("\n"):
if line.strip().find(";ytplayer.config = ") > 0:
found = True
p1 = line.find(";ytplayer.config = ") + len(";ytplayer.config = ") - 1
p2 = line.rfind(";")
if p1 <= 0 or p2 <= 0:
continue
data = line[p1 + 1:p2]
break
data = RemoveAdditionalEndingDelimiter(data)
if found:
data = json.loads(data)
if assets:
flashvars = data['assets']
else:
flashvars = data['args']
return flashvars
def FetchPage(url):
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
req.add_header('Referer', 'http://www.youtube.com/')
return urllib2.urlopen(req).read().decode("utf-8")
def replaceHTMLCodes(txt):
# Fix missing ; in &#<number>;
txt = re.sub("(&#[0-9]+)([^;^0-9]+)", "\\1;\\2", txt)
txt = HTMLParser.HTMLParser().unescape(txt)
txt = txt.replace("&", "&")
return txt
def RemoveAdditionalEndingDelimiter(data):
pos = data.find("};")
if pos != -1:
data = data[:pos + 1]
return data
####################################################
global playerData
global allLocalFunNamesTab
global allLocalVarNamesTab
def _extractVarLocalFuns(match):
varName, objBody = match.groups()
output = ''
for func in objBody.split( '},' ):
output += re.sub(
r'^([^:]+):function\(([^)]*)\)',
r'function %s__\1(\2,*args)' % varName,
func
) + '\n'
return output
def _jsToPy(jsFunBody):
pythonFunBody = re.sub(r'var ([^=]+)={(.*?)}};', _extractVarLocalFuns, jsFunBody)
pythonFunBody = re.sub(r'function (\w*)\$(\w*)', r'function \1_S_\2', pythonFunBody)
pythonFunBody = pythonFunBody.replace('function', 'def').replace('{', ':\n\t').replace('}', '').replace(';', '\n\t').replace('var ', '')
pythonFunBody = pythonFunBody.replace('.reverse()', '[::-1]')
lines = pythonFunBody.split('\n')
for i in range(len(lines)):
# a.split("") -> list(a)
match = re.search('(\w+?)\.split\(""\)', lines[i])
if match:
lines[i] = lines[i].replace( match.group(0), 'list(' + match.group(1) + ')')
# a.length -> len(a)
match = re.search('(\w+?)\.length', lines[i])
if match:
lines[i] = lines[i].replace( match.group(0), 'len(' + match.group(1) + ')')
# a.slice(3) -> a[3:]
match = re.search('(\w+?)\.slice\((\w+?)\)', lines[i])
if match:
lines[i] = lines[i].replace( match.group(0), match.group(1) + ('[%s:]' % match.group(2)) )
# a.join("") -> "".join(a)
match = re.search('(\w+?)\.join\(("[^"]*?")\)', lines[i])
if match:
lines[i] = lines[i].replace( match.group(0), match.group(2) + '.join(' + match.group(1) + ')' )
# a.splice(b,c) -> del a[b:c]
match = re.search('(\w+?)\.splice\(([^,]+),([^)]+)\)', lines[i])
if match:
lines[i] = lines[i].replace( match.group(0), 'del ' + match.group(1) + '[' + match.group(2) + ':' + match.group(3) + ']' )
pythonFunBody = "\n".join(lines)
pythonFunBody = re.sub(r'(\w+)\.(\w+)\(', r'\1__\2(', pythonFunBody)
pythonFunBody = re.sub(r'([^=])(\w+)\[::-1\]', r'\1\2.reverse()', pythonFunBody)
return pythonFunBody
def _jsToPy1(jsFunBody):
pythonFunBody = jsFunBody.replace('function', 'def').replace('{', ':\n\t').replace('}', '').replace(';', '\n\t').replace('var ', '')
pythonFunBody = pythonFunBody.replace('.reverse()', '[::-1]')
lines = pythonFunBody.split('\n')
for i in range(len(lines)):
# a.split("") -> list(a)
match = re.search('(\w+?)\.split\(""\)', lines[i])
if match:
lines[i] = lines[i].replace( match.group(0), 'list(' + match.group(1) + ')')
# a.length -> len(a)
match = re.search('(\w+?)\.length', lines[i])
if match:
lines[i] = lines[i].replace( match.group(0), 'len(' + match.group(1) + ')')
# a.slice(3) -> a[3:]
match = re.search('(\w+?)\.slice\(([0-9]+?)\)', lines[i])
if match:
lines[i] = lines[i].replace( match.group(0), match.group(1) + ('[%s:]' % match.group(2)) )
# a.join("") -> "".join(a)
match = re.search('(\w+?)\.join\(("[^"]*?")\)', lines[i])
if match:
lines[i] = lines[i].replace( match.group(0), match.group(2) + '.join(' + match.group(1) + ')' )
return "\n".join(lines)
def _getLocalFunBody(funName):
# get function body
funName = funName.replace('$', '\\$')
match = re.search('(function %s\([^)]+?\){[^}]+?})' % funName, playerData)
if match:
return match.group(1)
return ''
def _getAllLocalSubFunNames(mainFunBody):
match = re.compile('[ =(,](\w+?)\([^)]*?\)').findall( mainFunBody )
if len(match):
# first item is name of main function, so omit it
funNameTab = set( match[1:] )
return funNameTab
return set()
def _extractLocalVarNames(mainFunBody):
valid_funcs = ( 'reverse', 'split', 'splice', 'slice', 'join' )
match = re.compile( r'[; =(,](\w+)\.(\w+)\(' ).findall( mainFunBody )
local_vars = []
for name in match:
if name[1] not in valid_funcs:
local_vars.append( name[0] )
return set(local_vars)
def _getLocalVarObjBody(varName):
match = re.search( r'var %s={.*?}};' % varName, playerData )
if match:
return match.group(0)
return ''
def DecryptSignatureNew(s, playerUrl):
if not playerUrl.startswith('http:'):
playerUrl = 'http:' + playerUrl
#print "Decrypt_signature sign_len[%d] playerUrl[%s]" % (len(s), playerUrl)
global allLocalFunNamesTab
global allLocalVarNamesTab
global playerData
allLocalFunNamesTab = []
allLocalVarNamesTab = []
playerData = ''
request = urllib2.Request(playerUrl)
#res = core._fetchPage({u"link": playerUrl})
#playerData = res["content"]
try:
playerData = urllib2.urlopen(request).read()
playerData = playerData.decode('utf-8', 'ignore')
except Exception, e:
#print str(e)
print 'Failed to decode playerData'
return ''
# get main function name
match = re.search("signature=([$a-zA-Z]+)\([^)]\)", playerData)
if match:
mainFunName = match.group(1)
else:
print('Failed to get main signature function name')
return ''
_mainFunName = mainFunName.replace('$','_S_')
fullAlgoCode = _getfullAlgoCode(mainFunName)
# wrap all local algo function into one function extractedSignatureAlgo()
algoLines = fullAlgoCode.split('\n')
for i in range(len(algoLines)):
algoLines[i] = '\t' + algoLines[i]
fullAlgoCode = 'def extractedSignatureAlgo(param):'
fullAlgoCode += '\n'.join(algoLines)
fullAlgoCode += '\n\treturn %s(param)' % _mainFunName
fullAlgoCode += '\noutSignature = extractedSignatureAlgo( inSignature )\n'
# after this function we should have all needed code in fullAlgoCode
#print '---------------------------------------'
#print '| ALGO FOR SIGNATURE DECRYPTION |'
#print '---------------------------------------'
#print fullAlgoCode
#print '---------------------------------------'
try:
algoCodeObj = compile(fullAlgoCode, '', 'exec')
except:
print 'Failed to obtain decryptSignature code'
return ''
# for security allow only flew python global function in algo code
vGlobals = {"__builtins__": None, 'len': len, 'list': list}
# local variable to pass encrypted sign and get decrypted sign
vLocals = { 'inSignature': s, 'outSignature': '' }
# execute prepared code
try:
exec(algoCodeObj, vGlobals, vLocals)
except:
print 'decryptSignature code failed to exceute correctly'
return ''
#print 'Decrypted signature = [%s]' % vLocals['outSignature']
return vLocals['outSignature']
# Note, this method is using a recursion
def _getfullAlgoCode(mainFunName, recDepth=0):
global playerData
global allLocalFunNamesTab
global allLocalVarNamesTab
if MAX_REC_DEPTH <= recDepth:
print '_getfullAlgoCode: Maximum recursion depth exceeded'
return
funBody = _getLocalFunBody(mainFunName)
if funBody != '':
funNames = _getAllLocalSubFunNames(funBody)
if len(funNames):
for funName in funNames:
funName_ = funName.replace('$','_S_')
if funName not in allLocalFunNamesTab:
funBody=funBody.replace(funName,funName_)
allLocalFunNamesTab.append(funName)
#print 'Add local function %s to known functions' % mainFunName
funbody = _getfullAlgoCode(funName, recDepth+1) + "\n" + funBody
varNames = _extractLocalVarNames(funBody)
if len(varNames):
for varName in varNames:
if varName not in allLocalVarNamesTab:
allLocalVarNamesTab.append(varName)
funBody = _getLocalVarObjBody(varName) + "\n" + funBody
# convert code from javascript to python
funBody = _jsToPy(funBody)
return '\n' + funBody + '\n'
return funBody
|
gpl-2.0
|
[
199,
3,
199,
3,
221,
1898,
334,
35,
9,
6171,
3240,
290,
4376,
89,
332,
199,
3,
199,
3,
199,
3,
221,
961,
1233,
365,
282,
18883,
402,
314,
23534,
3589,
367,
1323,
28994,
199,
3,
221,
14286,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
221,
314,
2868,
2290,
2752,
27,
1015,
650,
199,
3,
221,
1898,
334,
35,
9,
7129,
13,
7409,
377,
2873,
2241,
738,
385,
316,
6061,
20855,
25844,
603,
736,
5294,
1005,
1603,
677,
78,
199,
3,
199,
3,
221,
961,
18841,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
221,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
221,
314,
2868,
2290,
2752,
27,
1902,
1015,
650,
12,
503,
334,
292,
2195,
945,
9,
199,
3,
221,
1263,
2945,
1015,
14,
199,
3,
199,
3,
221,
961,
18841,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
221,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
221,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
1666,
314,
199,
3,
221,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
221,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
3,
221,
3180,
543,
1323,
28994,
27,
1937,
314,
570,
9685,
14,
221,
982,
440,
12,
2218,
370,
199,
3,
221,
314,
2868,
2290,
2752,
12,
1227,
2194,
603,
405,
437,
432,
12,
445,
455,
9528,
12,
4828,
12497,
7491,
12,
8217,
14,
199,
3,
221,
1455,
921,
1544,
14,
3689,
14,
1308,
15,
1574,
3039,
15,
11692,
14,
1360,
199,
3,
421,
199,
3,
263,
959,
26,
298,
9873,
80,
394,
14622,
2717,
86,
3970,
401,
199,
3,
263,
6155,
26,
298,
11197,
80,
394,
9408,
6118,
20,
3970,
1204,
27632,
367,
519,
2791,
69,
15583,
199,
3,
263,
6928,
26,
298,
18386,
80,
394,
9408,
6118,
20,
3970,
401,
199,
3,
263,
7875,
26,
298,
10674,
15583,
199,
3,
263,
9404,
26,
298,
10674,
15583,
199,
3,
263,
8177,
26,
298,
11197,
80,
394,
9408,
2717,
86,
3970,
401,
199,
3,
263,
8685,
26,
298,
21853,
80,
394,
9408,
2717,
86,
3970,
401,
199,
3,
263,
6877,
26,
298,
23514,
80,
394,
9408,
6118,
20,
3970,
401,
199,
3,
263,
10448,
26,
298,
18386,
80,
373,
80,
24,
3330,
77,
3970,
401,
199,
3,
263,
11851,
26,
298,
11197,
80,
394,
9408,
2717,
86,
3970,
401,
199,
3,
263,
10868,
26,
298,
21853,
80,
373,
80,
24,
3330,
77,
3970,
401,
199,
3,
263,
10416,
26,
298,
18386,
80,
373,
80,
24,
3330,
77,
3970,
401,
199,
3,
263,
12426,
26,
298,
24224,
80,
373,
80,
24,
3330,
77,
20345,
13322,
401,
199,
3,
263,
8155,
26,
298,
21853,
367,
519,
2791,
69,
401,
199,
3,
263,
14679,
26,
298,
3239,
706,
370,
506,
6818,
8290,
367,
519,
2791,
69,
401,
199,
3,
263,
18051,
26,
298,
11197,
80,
394,
9408,
20345,
13322,
401,
199,
3,
263,
20582,
26,
298,
9873,
80,
394,
9408,
20345,
13322,
401,
199,
3,
263,
8264,
26,
298,
18386,
80,
394,
9408,
20345,
13322,
401,
199,
3,
263,
16412,
26,
298,
24224,
80,
394,
9408,
20345,
13322,
401,
199,
3,
263,
2948,
26,
298,
11197,
80,
373,
80,
24,
3330,
77,
20345,
13322,
401,
199,
3,
263,
14313,
26,
298,
21853,
80,
373,
80,
24,
3330,
77,
20345,
13322,
401,
199,
3,
263,
12996,
26,
298,
18386,
80,
373,
80,
24,
3330,
77,
20345,
13322,
401,
199,
3,
263,
13960,
26,
298,
7952,
18386,
401,
199,
3,
263,
26228,
26,
298,
7952,
23514,
2,
421,
199,
646,
295,
199,
646,
4011,
18,
199,
646,
4011,
199,
646,
16004,
199,
646,
24581,
199,
199,
893,
26,
492,
13804,
465,
2022,
199,
2590,
3545,
26,
492,
2022,
199,
199,
4283,
63,
9481,
63,
19715,
275,
959,
421,
199,
318,
12762,
8,
505,
304,
272,
1318,
275,
1318,
14,
1814,
360,
7997,
2564,
845,
10805,
26942,
272,
1318,
275,
1318,
14,
1814,
360,
7997,
2564,
1196,
10805,
1557,
17483,
272,
1318,
275,
1318,
14,
1814,
360,
7997,
10228,
16,
10805,
5522,
358,
272,
1318,
275,
1318,
14,
1814,
360,
7997,
10228,
17,
10805,
5522,
358,
272,
1318,
275,
1318,
14,
1814,
360,
7997,
1355,
10805,
257,
1557,
17483,
272,
1318,
275,
1318,
14,
1814,
4827,
66,
4206,
258,
4074,
272,
1318,
275,
1318,
14,
1814,
14264,
66,
4206,
259,
4074,
272,
1318,
275,
1318,
14,
1814,
20040,
5282,
10805,
257,
7673,
358,
272,
1318,
275,
1318,
14,
1814,
2258,
7224,
556,
297,
4074,
272,
372,
1318,
421,
199,
318,
16527,
9166,
8,
344,
304,
272,
492,
26418,
272,
492,
984,
272,
492,
3778,
339,
10414,
89,
275,
3778,
14,
2384,
28759,
342,
339,
3991,
12,
6220,
275,
2372,
9166,
4935,
8,
344,
9,
339,
340,
10414,
89,
26,
267,
10414,
89,
14,
1600,
342,
339,
340,
283,
7010,
7,
440,
315,
3991,
26,
267,
372,
756,
339,
1166,
257,
275,
3991,
459,
7010,
418,
3698,
272,
2538,
275,
3991,
459,
1213,
418,
272,
1834,
275,
3991,
459,
8311,
418,
339,
1212,
90,
275,
26418,
14,
24229,
8,
1213,
12,
7016,
3491,
29,
1569,
12,
10062,
3491,
29,
1569,
9,
339,
1212,
90,
14,
409,
2354,
8,
730,
628,
9166,
401,
2256,
14016,
3126,
298,
6888,
582,
2538,
93,
776,
339,
340,
822,
8,
1274,
14,
3020,
9,
665,
499,
503,
1109,
8,
1274,
14,
3020,
59,
17,
566,
508,
446,
17,
26,
267,
492,
11709,
267,
1620,
275,
11709,
14,
9651,
1296,
8,
21382,
14,
11625,
4924,
63,
20142,
9,
267,
1620,
14,
3584,
342,
267,
1620,
14,
525,
8,
633,
12,
1212,
90,
9,
267,
11709,
14,
10921,
1252,
2802,
8,
1168,
9,
272,
587,
26,
267,
492,
11709,
2718,
267,
1212,
90,
14,
409,
2042,
8,
633,
9,
267,
11709,
2718,
14,
409,
1322,
7064,
6417,
8,
442,
8,
1274,
14,
3020,
59,
17,
2522,
715,
12,
1212,
90,
9,
339,
372,
715,
421,
199,
318,
2372,
9166,
4935,
8,
344,
304,
272,
327,
344,
275,
283,
40,
23,
73,
49,
20,
83,
14799,
16,
27588,
7,
327
] |
[
3,
199,
3,
221,
1898,
334,
35,
9,
6171,
3240,
290,
4376,
89,
332,
199,
3,
199,
3,
199,
3,
221,
961,
1233,
365,
282,
18883,
402,
314,
23534,
3589,
367,
1323,
28994,
199,
3,
221,
14286,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
221,
314,
2868,
2290,
2752,
27,
1015,
650,
199,
3,
221,
1898,
334,
35,
9,
7129,
13,
7409,
377,
2873,
2241,
738,
385,
316,
6061,
20855,
25844,
603,
736,
5294,
1005,
1603,
677,
78,
199,
3,
199,
3,
221,
961,
18841,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
221,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
199,
3,
221,
314,
2868,
2290,
2752,
27,
1902,
1015,
650,
12,
503,
334,
292,
2195,
945,
9,
199,
3,
221,
1263,
2945,
1015,
14,
199,
3,
199,
3,
221,
961,
18841,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
3,
221,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
3,
221,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
1666,
314,
199,
3,
221,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
3,
199,
3,
221,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
3,
221,
3180,
543,
1323,
28994,
27,
1937,
314,
570,
9685,
14,
221,
982,
440,
12,
2218,
370,
199,
3,
221,
314,
2868,
2290,
2752,
12,
1227,
2194,
603,
405,
437,
432,
12,
445,
455,
9528,
12,
4828,
12497,
7491,
12,
8217,
14,
199,
3,
221,
1455,
921,
1544,
14,
3689,
14,
1308,
15,
1574,
3039,
15,
11692,
14,
1360,
199,
3,
421,
199,
3,
263,
959,
26,
298,
9873,
80,
394,
14622,
2717,
86,
3970,
401,
199,
3,
263,
6155,
26,
298,
11197,
80,
394,
9408,
6118,
20,
3970,
1204,
27632,
367,
519,
2791,
69,
15583,
199,
3,
263,
6928,
26,
298,
18386,
80,
394,
9408,
6118,
20,
3970,
401,
199,
3,
263,
7875,
26,
298,
10674,
15583,
199,
3,
263,
9404,
26,
298,
10674,
15583,
199,
3,
263,
8177,
26,
298,
11197,
80,
394,
9408,
2717,
86,
3970,
401,
199,
3,
263,
8685,
26,
298,
21853,
80,
394,
9408,
2717,
86,
3970,
401,
199,
3,
263,
6877,
26,
298,
23514,
80,
394,
9408,
6118,
20,
3970,
401,
199,
3,
263,
10448,
26,
298,
18386,
80,
373,
80,
24,
3330,
77,
3970,
401,
199,
3,
263,
11851,
26,
298,
11197,
80,
394,
9408,
2717,
86,
3970,
401,
199,
3,
263,
10868,
26,
298,
21853,
80,
373,
80,
24,
3330,
77,
3970,
401,
199,
3,
263,
10416,
26,
298,
18386,
80,
373,
80,
24,
3330,
77,
3970,
401,
199,
3,
263,
12426,
26,
298,
24224,
80,
373,
80,
24,
3330,
77,
20345,
13322,
401,
199,
3,
263,
8155,
26,
298,
21853,
367,
519,
2791,
69,
401,
199,
3,
263,
14679,
26,
298,
3239,
706,
370,
506,
6818,
8290,
367,
519,
2791,
69,
401,
199,
3,
263,
18051,
26,
298,
11197,
80,
394,
9408,
20345,
13322,
401,
199,
3,
263,
20582,
26,
298,
9873,
80,
394,
9408,
20345,
13322,
401,
199,
3,
263,
8264,
26,
298,
18386,
80,
394,
9408,
20345,
13322,
401,
199,
3,
263,
16412,
26,
298,
24224,
80,
394,
9408,
20345,
13322,
401,
199,
3,
263,
2948,
26,
298,
11197,
80,
373,
80,
24,
3330,
77,
20345,
13322,
401,
199,
3,
263,
14313,
26,
298,
21853,
80,
373,
80,
24,
3330,
77,
20345,
13322,
401,
199,
3,
263,
12996,
26,
298,
18386,
80,
373,
80,
24,
3330,
77,
20345,
13322,
401,
199,
3,
263,
13960,
26,
298,
7952,
18386,
401,
199,
3,
263,
26228,
26,
298,
7952,
23514,
2,
421,
199,
646,
295,
199,
646,
4011,
18,
199,
646,
4011,
199,
646,
16004,
199,
646,
24581,
199,
199,
893,
26,
492,
13804,
465,
2022,
199,
2590,
3545,
26,
492,
2022,
199,
199,
4283,
63,
9481,
63,
19715,
275,
959,
421,
199,
318,
12762,
8,
505,
304,
272,
1318,
275,
1318,
14,
1814,
360,
7997,
2564,
845,
10805,
26942,
272,
1318,
275,
1318,
14,
1814,
360,
7997,
2564,
1196,
10805,
1557,
17483,
272,
1318,
275,
1318,
14,
1814,
360,
7997,
10228,
16,
10805,
5522,
358,
272,
1318,
275,
1318,
14,
1814,
360,
7997,
10228,
17,
10805,
5522,
358,
272,
1318,
275,
1318,
14,
1814,
360,
7997,
1355,
10805,
257,
1557,
17483,
272,
1318,
275,
1318,
14,
1814,
4827,
66,
4206,
258,
4074,
272,
1318,
275,
1318,
14,
1814,
14264,
66,
4206,
259,
4074,
272,
1318,
275,
1318,
14,
1814,
20040,
5282,
10805,
257,
7673,
358,
272,
1318,
275,
1318,
14,
1814,
2258,
7224,
556,
297,
4074,
272,
372,
1318,
421,
199,
318,
16527,
9166,
8,
344,
304,
272,
492,
26418,
272,
492,
984,
272,
492,
3778,
339,
10414,
89,
275,
3778,
14,
2384,
28759,
342,
339,
3991,
12,
6220,
275,
2372,
9166,
4935,
8,
344,
9,
339,
340,
10414,
89,
26,
267,
10414,
89,
14,
1600,
342,
339,
340,
283,
7010,
7,
440,
315,
3991,
26,
267,
372,
756,
339,
1166,
257,
275,
3991,
459,
7010,
418,
3698,
272,
2538,
275,
3991,
459,
1213,
418,
272,
1834,
275,
3991,
459,
8311,
418,
339,
1212,
90,
275,
26418,
14,
24229,
8,
1213,
12,
7016,
3491,
29,
1569,
12,
10062,
3491,
29,
1569,
9,
339,
1212,
90,
14,
409,
2354,
8,
730,
628,
9166,
401,
2256,
14016,
3126,
298,
6888,
582,
2538,
93,
776,
339,
340,
822,
8,
1274,
14,
3020,
9,
665,
499,
503,
1109,
8,
1274,
14,
3020,
59,
17,
566,
508,
446,
17,
26,
267,
492,
11709,
267,
1620,
275,
11709,
14,
9651,
1296,
8,
21382,
14,
11625,
4924,
63,
20142,
9,
267,
1620,
14,
3584,
342,
267,
1620,
14,
525,
8,
633,
12,
1212,
90,
9,
267,
11709,
14,
10921,
1252,
2802,
8,
1168,
9,
272,
587,
26,
267,
492,
11709,
2718,
267,
1212,
90,
14,
409,
2042,
8,
633,
9,
267,
11709,
2718,
14,
409,
1322,
7064,
6417,
8,
442,
8,
1274,
14,
3020,
59,
17,
2522,
715,
12,
1212,
90,
9,
339,
372,
715,
421,
199,
318,
2372,
9166,
4935,
8,
344,
304,
272,
327,
344,
275,
283,
40,
23,
73,
49,
20,
83,
14799,
16,
27588,
7,
327,
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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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
] |
mazimm/AliPhysics
|
PWGJE/EMCALJetTasks/Tracks/analysis/Draw/DrawMCtrueSpectrum.py
|
41
|
5799
|
#**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors are mentioned in the code where appropriate. *
#* *
#* Permission to use, copy, modify and distribute this software and its *
#* documentation strictly for non-commercial purposes is hereby granted *
#* without fee, provided that the above copyright notice appears in all *
#* copies and that both the copyright notice and this permission notice *
#* appear in the supporting documentation. The authors make no claims *
#* about the suitability of this software for any purpose. It is *
#* provided "as is" without express or implied warranty. *
#**************************************************************************
from PWG.PWGJE.EMCALJetTasks.Tracks.analysis.base.MonteCarloFileHandler import MonteCarloFileHandler
from PWG.PWGJE.EMCALJetTasks.Tracks.analysis.base.Graphics import Style
from PWG.PWGJE.EMCALJetTasks.Tracks.analysis.base.Helper import NormaliseBinWidth
from os import getcwd
from PWG.PWGJE.EMCALJetTasks.Tracks.analysis.plots.MCTruthPlot import MCTrueSpectrumPlot, MCRecSpectrumPlot, MCWeightPlot
from ROOT import kRed, kBlue, kBlack, kGreen, kMagenta, kViolet, kOrange, kTeal, kYellow, kGray, kCyan
class PtHatBinDrawer(object):
def __init__(self, plotter = None):
self.__handler = MonteCarloFileHandler(True)
self.__plotter = plotter
self.__nbins = 1
self._datacol = None
def SetNumberOfPtHatBins(self, nbins):
self.__nbins = nbins
def SetBaseDirectory(self, path):
for i in range(1, self.__nbins + 1):
self.__handler.AddFile("%s/%02d/AnalysisResults.root" %(path, i), i)
def CreatePlot(self):
self._datacol = self.__handler.GetCollection()
styles = [Style(kGreen-2, 24), Style(kBlue, 25), Style(kRed, 26), Style(kGreen, 27), Style(kMagenta, 28), Style(kOrange, 29), \
Style(kTeal, 30), Style(kViolet, 31), Style(kGray, 32), Style(kYellow + 2, 33), Style(kCyan+3, 34), Style(kRed-9, 35)]
for i in range(1, self.__nbins + 1):
spectrum = self._SpectrumForPtHatBin(i)
self._datacol.GetWeigthHandler().ReweightSpectrum(i, spectrum)
self.__plotter.AddMCSpectrum(i, spectrum, styles[i])
self.__plotter.Create()
return self.__plotter
def _SpectrumForPtHatBin(self, pthatbin):
return None
class MCTrueDrawer(PtHatBinDrawer):
def __init__(self):
PtHatBinDrawer.__init__(self, MCTrueSpectrumPlot())
def _SpectrumForPtHatBin(self, pthatbin):
cont = self._datacol.GetData(pthatbin).GetMCTruth()
spectrum = cont.ProjectToDimension(0,"MCtruth%d" %(pthatbin))
spectrum.Sumw2()
NormaliseBinWidth(spectrum)
trackCont = self._datacol.GetData(pthatbin).GetData("MinBias").FindTrackContainer("tracksAll")
spectrum.Scale(1./trackCont.GetEventCount())
return spectrum
class MCRecDrawer(PtHatBinDrawer):
def __init__(self, trigger):
PtHatBinDrawer.__init__(self, MCRecSpectrumPlot(trigger))
self.__trigger = trigger
self.__trackcontname = "tracksAll"
def SelectContainer(self, contname):
self.__trackcontname = contname
def __MakeNormalisedSpectrum(self, container, pthatbin):
container.SetVertexRange(-10., 10.)
container.SetPileupRejection(True)
if container.__class__ == "TrackContainer":
container.SelectTrackCuts(1)
return container.MakeProjection(0, "ptSpectrum%d%s" %(pthatbin, self.__trigger), "p_{#rm{t}} (GeV/c)", "1/N_{event} 1/(#Delta p_{#rm t}) dN/dp_{#rm{t}} ((GeV/c)^{-2}", doNorm = True)
def _SpectrumForPtHatBin(self, pthatbin):
trackCont = self._datacol.GetData(pthatbin).GetData(self.__trigger).FindTrackContainer(self.__trackcontname)
return self.__MakeNormalisedSpectrum(trackCont, pthatbin)
class WeightPlotter():
def __init__(self):
self.__handler = MonteCarloFileHandler(True)
self.__plotter = None
self.__nbins = 1
def SetNumberOfPtHatBins(self, nbins):
self.__nbins = nbins
def SetBaseDirectory(self, path):
for i in range(1, self.__nbins + 1):
self.__handler.AddFile("%s/%02d/AnalysisResults.root" %(path, i), i)
def CreatePlot(self):
self.__plotter = MCWeightPlot(self.__handler.GetCollection().GetWeigthHandler())
self.__plotter.Create()
return self.__plotter
def DrawWeights(basedir = None):
drawer = WeightPlotter()
drawer.SetNumberOfPtHatBins(9)
if not basedir:
basedir = getcwd()
print "Using results from directory %s" %(basedir)
drawer.SetBaseDirectory(basedir)
return drawer.CreatePlot()
def DrawMCtrue(basedir = None):
drawer = MCTrueDrawer()
#drawer.SetNumberOfPtHatBins(9)
drawer.SetNumberOfPtHatBins(2)
if not basedir:
basedir = getcwd()
print "Using results from directory %s" %(basedir)
drawer.SetBaseDirectory(basedir)
return drawer.CreatePlot()
def DrawMCrec(trigger, trackcont = "tracksAll", basedir = None):
drawer = MCRecDrawer(trigger)
drawer.SetNumberOfPtHatBins(9)
drawer.SelectContainer(trackcont)
if not basedir:
basedir = getcwd()
print "Using results from directory %s" %(basedir)
drawer.SetBaseDirectory(basedir)
return drawer.CreatePlot()
|
bsd-3-clause
|
[
3,
14355,
538,
199,
15002,
1898,
8,
67,
9,
19960,
13,
7280,
12,
437,
2507,
37,
23997,
737,
24354,
12,
2900,
4481,
4644,
14,
627,
199,
15002,
6208,
263,
627,
199,
15002,
6529,
26,
710,
437,
2507,
37,
28856,
13,
604,
7290,
14,
27503,
627,
199,
15002,
23212,
787,
26239,
315,
314,
1233,
2382,
5827,
14,
4519,
627,
199,
15002,
6208,
263,
627,
199,
15002,
8779,
370,
675,
12,
1331,
12,
2811,
436,
11207,
642,
2032,
436,
2399,
257,
627,
199,
15002,
3794,
22699,
367,
2222,
13,
957,
23012,
12901,
365,
11882,
10009,
257,
627,
199,
15002,
1928,
14751,
12,
2741,
626,
314,
3432,
4248,
4245,
11337,
315,
1006,
257,
627,
199,
15002,
6866,
436,
626,
3865,
314,
4248,
4245,
436,
642,
4983,
4245,
257,
627,
199,
15002,
7468,
315,
314,
21038,
3794,
14,
710,
11462,
1852,
949,
6108,
11171,
258,
627,
199,
15002,
3595,
314,
308,
4993,
3616,
402,
642,
2032,
367,
1263,
12016,
14,
2779,
365,
3515,
627,
199,
15002,
2741,
298,
305,
365,
2,
1928,
4056,
503,
2478,
3750,
14,
8295,
627,
199,
3,
14355,
538,
199,
504,
510,
55,
39,
14,
10780,
39,
25074,
14,
2769,
13329,
42,
386,
19295,
14,
2437,
5618,
14,
10466,
14,
1095,
14,
6671,
266,
16034,
320,
21982,
492,
10953,
266,
16034,
320,
21982,
199,
504,
510,
55,
39,
14,
10780,
39,
25074,
14,
2769,
13329,
42,
386,
19295,
14,
2437,
5618,
14,
10466,
14,
1095,
14,
18859,
492,
19442,
199,
504,
510,
55,
39,
14,
10780,
39,
25074,
14,
2769,
13329,
42,
386,
19295,
14,
2437,
5618,
14,
10466,
14,
1095,
14,
4433,
492,
11514,
572,
13394,
6216,
199,
504,
747,
492,
664,
6525,
199,
504,
510,
55,
39,
14,
10780,
39,
25074,
14,
2769,
13329,
42,
386,
19295,
14,
2437,
5618,
14,
10466,
14,
13701,
14,
45,
1028,
82,
762,
10711,
492,
32685,
549,
16684,
10711,
12,
32685,
21561,
16684,
10711,
12,
32685,
16359,
10711,
199,
504,
16547,
492,
1022,
10858,
12,
1022,
15617,
12,
1022,
23405,
12,
1022,
19456,
12,
1022,
45,
4054,
65,
12,
1022,
2201,
79,
2723,
12,
1022,
47,
1842,
12,
1022,
6301,
279,
12,
1022,
57,
10723,
12,
1022,
39,
803,
12,
1022,
9156,
290,
199,
199,
533,
510,
84,
40,
292,
13394,
9654,
281,
8,
785,
304,
339,
347,
636,
826,
721,
277,
12,
5137,
351,
275,
488,
304,
267,
291,
855,
2232,
275,
10953,
266,
16034,
320,
21982,
8,
549,
9,
267,
291,
855,
2798,
351,
275,
5137,
351,
267,
291,
855,
78,
11329,
275,
413,
267,
291,
423,
576,
761,
275,
488,
339,
347,
2494,
16030,
19886,
40,
292,
34,
3617,
8,
277,
12,
302,
11329,
304,
267,
291,
855,
78,
11329,
275,
302,
11329,
5493,
347,
2494,
1563,
6231,
8,
277,
12,
931,
304,
267,
367,
284,
315,
1425,
8,
17,
12,
291,
855,
78,
11329,
435,
413,
304,
288,
291,
855,
2232,
14,
1123,
1173,
3647,
83,
3149,
996,
68,
15,
13182,
6579,
14,
1231,
2,
2818,
515,
12,
284,
395,
284,
9,
339,
347,
2790,
10711,
8,
277,
304,
267,
291,
423,
576,
761,
275,
291,
855,
2232,
14,
1002,
7768,
342,
267,
15725,
275,
359,
6609,
8,
75,
19456,
13,
18,
12,
5504,
395,
19442,
8,
75,
15617,
12,
5661,
395,
19442,
8,
75,
10858,
12,
7875,
395,
19442,
8,
75,
19456,
12,
8087,
395,
19442,
8,
75,
45,
4054,
65,
12,
7294,
395,
19442,
8,
75,
47,
1842,
12,
7349,
395,
971,
2116,
19442,
8,
75,
6301,
279,
12,
4233,
395,
19442,
8,
75,
2201,
79,
2723,
12,
7105,
395,
19442,
8,
75,
39,
803,
12,
4337,
395,
19442,
8,
75,
57,
10723,
435,
499,
12,
9404,
395,
19442,
8,
75,
9156,
290,
11,
19,
12,
8177,
395,
19442,
8,
75,
10858,
13,
25,
12,
8685,
1874,
267,
367,
284,
315,
1425,
8,
17,
12,
291,
855,
78,
11329,
435,
413,
304,
288,
20645,
275,
291,
423,
16684,
1858,
19886,
40,
292,
13394,
8,
73,
9,
288,
291,
423,
576,
761,
14,
1002,
6004,
528,
273,
2461,
1252,
497,
3463,
16684,
8,
73,
12,
20645,
9,
288,
291,
855,
2798,
351,
14,
1123,
45,
3298,
9120,
8,
73,
12,
20645,
12,
15725,
59,
73,
566,
267,
291,
855,
2798,
351,
14,
2499,
342,
267,
372,
291,
855,
2798,
351,
2286,
347,
485,
16684,
1858,
19886,
40,
292,
13394,
8,
277,
12,
299,
9099,
1393,
304,
267,
372,
488,
199,
199,
533,
32685,
549,
9654,
281,
8,
19886,
40,
292,
13394,
9654,
281,
304,
2286,
347,
636,
826,
721,
277,
304,
267,
510,
84,
40,
292,
13394,
9654,
281,
855,
826,
721,
277,
12,
32685,
549,
16684,
10711,
1012,
2286,
347,
485,
16684,
1858,
19886,
40,
292,
13394,
8,
277,
12,
299,
9099,
1393,
304,
267,
13770,
275,
291,
423,
576,
761,
14,
25702,
8,
80,
9099,
1393,
680,
20404,
1028,
82,
762,
342,
267,
20645,
275,
13770,
14,
4761,
1378,
17905,
8,
16,
4589,
7608,
17167,
5,
68,
2,
2818,
80,
9099,
1393,
430,
267,
20645,
14,
6959,
87,
18,
342,
267,
11514,
572,
13394,
6216,
8,
18142,
9,
267,
4426,
714,
84,
275,
291,
423,
576,
761,
14,
25702,
8,
80,
9099,
1393,
680,
25702,
480,
4649,
34,
2241,
3471,
6591,
7927,
4076,
480,
16274,
2422,
531,
267,
20645,
14,
9944,
8,
17,
13186,
3885,
714,
84,
14,
1002,
2390,
2353,
1012,
267,
372,
20645,
272,
199,
533,
32685,
21561,
9654,
281,
8,
19886,
40,
292,
13394,
9654,
281,
304,
2286,
347,
636,
826,
721,
277,
12,
6804,
304,
267,
510,
84,
40,
292,
13394,
9654,
281,
855,
826,
721,
277,
12,
32685,
21561,
16684,
10711,
8,
7631,
430,
267,
291,
855,
7631,
275,
6804,
267,
291,
855,
3885,
11096,
354,
275,
298,
16274,
2422,
2,
5493,
347,
9496,
4076,
8,
277,
12,
13770,
354,
304,
267,
291,
855,
3885,
11096,
354,
275,
13770,
354,
5493,
347,
636,
5483,
6241,
9096,
16684,
8,
277,
12,
3970,
12,
299,
9099,
1393,
304,
267,
3970,
14,
1084,
9787,
4709,
2801,
709,
2020,
1616,
4959,
267,
3970,
14,
1084,
48,
441,
384,
497,
8923,
8,
549,
9,
267,
340,
3970,
855,
533,
363,
508,
298,
7927,
4076,
582,
288,
3970,
14,
5446,
7927,
35,
14608,
8,
17,
9,
267,
372,
3970,
14
] |
[
14355,
538,
199,
15002,
1898,
8,
67,
9,
19960,
13,
7280,
12,
437,
2507,
37,
23997,
737,
24354,
12,
2900,
4481,
4644,
14,
627,
199,
15002,
6208,
263,
627,
199,
15002,
6529,
26,
710,
437,
2507,
37,
28856,
13,
604,
7290,
14,
27503,
627,
199,
15002,
23212,
787,
26239,
315,
314,
1233,
2382,
5827,
14,
4519,
627,
199,
15002,
6208,
263,
627,
199,
15002,
8779,
370,
675,
12,
1331,
12,
2811,
436,
11207,
642,
2032,
436,
2399,
257,
627,
199,
15002,
3794,
22699,
367,
2222,
13,
957,
23012,
12901,
365,
11882,
10009,
257,
627,
199,
15002,
1928,
14751,
12,
2741,
626,
314,
3432,
4248,
4245,
11337,
315,
1006,
257,
627,
199,
15002,
6866,
436,
626,
3865,
314,
4248,
4245,
436,
642,
4983,
4245,
257,
627,
199,
15002,
7468,
315,
314,
21038,
3794,
14,
710,
11462,
1852,
949,
6108,
11171,
258,
627,
199,
15002,
3595,
314,
308,
4993,
3616,
402,
642,
2032,
367,
1263,
12016,
14,
2779,
365,
3515,
627,
199,
15002,
2741,
298,
305,
365,
2,
1928,
4056,
503,
2478,
3750,
14,
8295,
627,
199,
3,
14355,
538,
199,
504,
510,
55,
39,
14,
10780,
39,
25074,
14,
2769,
13329,
42,
386,
19295,
14,
2437,
5618,
14,
10466,
14,
1095,
14,
6671,
266,
16034,
320,
21982,
492,
10953,
266,
16034,
320,
21982,
199,
504,
510,
55,
39,
14,
10780,
39,
25074,
14,
2769,
13329,
42,
386,
19295,
14,
2437,
5618,
14,
10466,
14,
1095,
14,
18859,
492,
19442,
199,
504,
510,
55,
39,
14,
10780,
39,
25074,
14,
2769,
13329,
42,
386,
19295,
14,
2437,
5618,
14,
10466,
14,
1095,
14,
4433,
492,
11514,
572,
13394,
6216,
199,
504,
747,
492,
664,
6525,
199,
504,
510,
55,
39,
14,
10780,
39,
25074,
14,
2769,
13329,
42,
386,
19295,
14,
2437,
5618,
14,
10466,
14,
13701,
14,
45,
1028,
82,
762,
10711,
492,
32685,
549,
16684,
10711,
12,
32685,
21561,
16684,
10711,
12,
32685,
16359,
10711,
199,
504,
16547,
492,
1022,
10858,
12,
1022,
15617,
12,
1022,
23405,
12,
1022,
19456,
12,
1022,
45,
4054,
65,
12,
1022,
2201,
79,
2723,
12,
1022,
47,
1842,
12,
1022,
6301,
279,
12,
1022,
57,
10723,
12,
1022,
39,
803,
12,
1022,
9156,
290,
199,
199,
533,
510,
84,
40,
292,
13394,
9654,
281,
8,
785,
304,
339,
347,
636,
826,
721,
277,
12,
5137,
351,
275,
488,
304,
267,
291,
855,
2232,
275,
10953,
266,
16034,
320,
21982,
8,
549,
9,
267,
291,
855,
2798,
351,
275,
5137,
351,
267,
291,
855,
78,
11329,
275,
413,
267,
291,
423,
576,
761,
275,
488,
339,
347,
2494,
16030,
19886,
40,
292,
34,
3617,
8,
277,
12,
302,
11329,
304,
267,
291,
855,
78,
11329,
275,
302,
11329,
5493,
347,
2494,
1563,
6231,
8,
277,
12,
931,
304,
267,
367,
284,
315,
1425,
8,
17,
12,
291,
855,
78,
11329,
435,
413,
304,
288,
291,
855,
2232,
14,
1123,
1173,
3647,
83,
3149,
996,
68,
15,
13182,
6579,
14,
1231,
2,
2818,
515,
12,
284,
395,
284,
9,
339,
347,
2790,
10711,
8,
277,
304,
267,
291,
423,
576,
761,
275,
291,
855,
2232,
14,
1002,
7768,
342,
267,
15725,
275,
359,
6609,
8,
75,
19456,
13,
18,
12,
5504,
395,
19442,
8,
75,
15617,
12,
5661,
395,
19442,
8,
75,
10858,
12,
7875,
395,
19442,
8,
75,
19456,
12,
8087,
395,
19442,
8,
75,
45,
4054,
65,
12,
7294,
395,
19442,
8,
75,
47,
1842,
12,
7349,
395,
971,
2116,
19442,
8,
75,
6301,
279,
12,
4233,
395,
19442,
8,
75,
2201,
79,
2723,
12,
7105,
395,
19442,
8,
75,
39,
803,
12,
4337,
395,
19442,
8,
75,
57,
10723,
435,
499,
12,
9404,
395,
19442,
8,
75,
9156,
290,
11,
19,
12,
8177,
395,
19442,
8,
75,
10858,
13,
25,
12,
8685,
1874,
267,
367,
284,
315,
1425,
8,
17,
12,
291,
855,
78,
11329,
435,
413,
304,
288,
20645,
275,
291,
423,
16684,
1858,
19886,
40,
292,
13394,
8,
73,
9,
288,
291,
423,
576,
761,
14,
1002,
6004,
528,
273,
2461,
1252,
497,
3463,
16684,
8,
73,
12,
20645,
9,
288,
291,
855,
2798,
351,
14,
1123,
45,
3298,
9120,
8,
73,
12,
20645,
12,
15725,
59,
73,
566,
267,
291,
855,
2798,
351,
14,
2499,
342,
267,
372,
291,
855,
2798,
351,
2286,
347,
485,
16684,
1858,
19886,
40,
292,
13394,
8,
277,
12,
299,
9099,
1393,
304,
267,
372,
488,
199,
199,
533,
32685,
549,
9654,
281,
8,
19886,
40,
292,
13394,
9654,
281,
304,
2286,
347,
636,
826,
721,
277,
304,
267,
510,
84,
40,
292,
13394,
9654,
281,
855,
826,
721,
277,
12,
32685,
549,
16684,
10711,
1012,
2286,
347,
485,
16684,
1858,
19886,
40,
292,
13394,
8,
277,
12,
299,
9099,
1393,
304,
267,
13770,
275,
291,
423,
576,
761,
14,
25702,
8,
80,
9099,
1393,
680,
20404,
1028,
82,
762,
342,
267,
20645,
275,
13770,
14,
4761,
1378,
17905,
8,
16,
4589,
7608,
17167,
5,
68,
2,
2818,
80,
9099,
1393,
430,
267,
20645,
14,
6959,
87,
18,
342,
267,
11514,
572,
13394,
6216,
8,
18142,
9,
267,
4426,
714,
84,
275,
291,
423,
576,
761,
14,
25702,
8,
80,
9099,
1393,
680,
25702,
480,
4649,
34,
2241,
3471,
6591,
7927,
4076,
480,
16274,
2422,
531,
267,
20645,
14,
9944,
8,
17,
13186,
3885,
714,
84,
14,
1002,
2390,
2353,
1012,
267,
372,
20645,
272,
199,
533,
32685,
21561,
9654,
281,
8,
19886,
40,
292,
13394,
9654,
281,
304,
2286,
347,
636,
826,
721,
277,
12,
6804,
304,
267,
510,
84,
40,
292,
13394,
9654,
281,
855,
826,
721,
277,
12,
32685,
21561,
16684,
10711,
8,
7631,
430,
267,
291,
855,
7631,
275,
6804,
267,
291,
855,
3885,
11096,
354,
275,
298,
16274,
2422,
2,
5493,
347,
9496,
4076,
8,
277,
12,
13770,
354,
304,
267,
291,
855,
3885,
11096,
354,
275,
13770,
354,
5493,
347,
636,
5483,
6241,
9096,
16684,
8,
277,
12,
3970,
12,
299,
9099,
1393,
304,
267,
3970,
14,
1084,
9787,
4709,
2801,
709,
2020,
1616,
4959,
267,
3970,
14,
1084,
48,
441,
384,
497,
8923,
8,
549,
9,
267,
340,
3970,
855,
533,
363,
508,
298,
7927,
4076,
582,
288,
3970,
14,
5446,
7927,
35,
14608,
8,
17,
9,
267,
372,
3970,
14,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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os_group.py
|
34
|
4758
|
#!/usr/bin/python
# Copyright (c) 2016 IBM
# 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: os_group
short_description: Manage OpenStack Identity Groups
extends_documentation_fragment: openstack
version_added: "2.1"
author: "Monty Taylor (@emonty), David Shrewsbury (@Shrews)"
description:
- Manage OpenStack Identity Groups. Groups can be created, deleted or
updated. Only the I(description) value can be updated.
options:
name:
description:
- Group name
required: true
description:
description:
- Group description
domain_id:
description:
- Domain id to create the group in if the cloud supports domains.
version_added: "2.3"
state:
description:
- Should the resource be present or absent.
choices: [present, absent]
default: present
availability_zone:
description:
- Ignored. Present for backwards compatibility
requirements:
- "python >= 2.7"
- "openstacksdk"
'''
EXAMPLES = '''
# Create a group named "demo"
- os_group:
cloud: mycloud
state: present
name: demo
description: "Demo Group"
domain_id: demoid
# Update the description on existing "demo" group
- os_group:
cloud: mycloud
state: present
name: demo
description: "Something else"
domain_id: demoid
# Delete group named "demo"
- os_group:
cloud: mycloud
state: absent
name: demo
'''
RETURN = '''
group:
description: Dictionary describing the group.
returned: On success when I(state) is 'present'.
type: complex
contains:
id:
description: Unique group ID
type: string
sample: "ee6156ff04c645f481a6738311aea0b0"
name:
description: Group name
type: string
sample: "demo"
description:
description: Group description
type: string
sample: "Demo Group"
domain_id:
description: Domain for the group
type: string
sample: "default"
'''
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs, openstack_cloud_from_module
def _system_state_change(state, description, group):
if state == 'present' and not group:
return True
if state == 'present' and description is not None and group.description != description:
return True
if state == 'absent' and group:
return True
return False
def main():
argument_spec = openstack_full_argument_spec(
name=dict(required=True),
description=dict(required=False, default=None),
domain_id=dict(required=False, default=None),
state=dict(default='present', choices=['absent', 'present']),
)
module_kwargs = openstack_module_kwargs()
module = AnsibleModule(argument_spec,
supports_check_mode=True,
**module_kwargs)
name = module.params.get('name')
description = module.params.get('description')
state = module.params.get('state')
domain_id = module.params.pop('domain_id')
sdk, cloud = openstack_cloud_from_module(module)
try:
if domain_id:
group = cloud.get_group(name, filters={'domain_id': domain_id})
else:
group = cloud.get_group(name)
if module.check_mode:
module.exit_json(changed=_system_state_change(state, description, group))
if state == 'present':
if group is None:
group = cloud.create_group(
name=name, description=description, domain=domain_id)
changed = True
else:
if description is not None and group.description != description:
group = cloud.update_group(
group.id, description=description)
changed = True
else:
changed = False
module.exit_json(changed=changed, group=group)
elif state == 'absent':
if group is None:
changed = False
else:
cloud.delete_group(group.id)
changed = True
module.exit_json(changed=changed)
except sdk.exceptions.OpenStackCloudException as e:
module.fail_json(msg=str(e))
if __name__ == '__main__':
main()
|
gpl-3.0
|
[
3381,
2647,
15,
1393,
15,
1548,
199,
3,
1898,
334,
67,
9,
7800,
26202,
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,
421,
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,
421,
199,
8948,
275,
1449,
199,
2595,
199,
578,
26,
747,
63,
923,
199,
3612,
63,
1802,
26,
14944,
14260,
22034,
25031,
199,
11036,
63,
9970,
63,
7677,
26,
13869,
199,
1023,
63,
3270,
26,
298,
18,
14,
17,
2,
199,
2502,
26,
298,
6671,
369,
377,
1187,
25339,
8593,
69,
2106,
369,
395,
20232,
5244,
264,
3569,
66,
18359,
8593,
2662,
264,
3569,
2924,
199,
1802,
26,
272,
446,
14944,
14260,
22034,
25031,
14,
25031,
883,
506,
2737,
12,
5463,
503,
489,
4588,
14,
5972,
314,
473,
8,
1802,
9,
574,
883,
506,
4588,
14,
199,
1419,
26,
2043,
536,
26,
1362,
1369,
26,
267,
446,
5611,
536,
1362,
1415,
26,
2549,
2043,
1369,
26,
1362,
1369,
26,
267,
446,
5611,
1369,
2043,
2881,
63,
344,
26,
1362,
1369,
26,
267,
446,
14061,
1305,
370,
1218,
314,
1572,
315,
340,
314,
8002,
5171,
14006,
14,
1362,
1015,
63,
3270,
26,
298,
18,
14,
19,
2,
2043,
1174,
26,
1362,
1369,
26,
2126,
446,
7719,
314,
2073,
506,
3451,
503,
9552,
14,
1362,
3415,
26,
359,
1881,
12,
9552,
61,
1362,
849,
26,
3451,
2043,
14962,
63,
2619,
26,
1362,
1369,
26,
2126,
446,
27662,
14,
5543,
1150,
367,
8552,
7163,
199,
7538,
26,
272,
446,
298,
1548,
2356,
499,
14,
23,
2,
272,
446,
298,
8512,
9277,
2,
199,
2344,
199,
199,
8918,
275,
1449,
199,
3,
2790,
282,
1572,
4310,
298,
8768,
2,
199,
13,
747,
63,
923,
26,
272,
8002,
26,
3002,
4091,
272,
1174,
26,
3451,
272,
536,
26,
14779,
272,
1369,
26,
298,
21493,
5611,
2,
272,
2881,
63,
344,
26,
477,
14356,
199,
199,
3,
6162,
314,
1369,
641,
3411,
298,
8768,
2,
1572,
199,
13,
747,
63,
923,
26,
272,
8002,
26,
3002,
4091,
272,
1174,
26,
3451,
272,
536,
26,
14779,
272,
1369,
26,
298,
20641,
587,
2,
272,
2881,
63,
344,
26,
477,
14356,
199,
199,
3,
8496,
1572,
4310,
298,
8768,
2,
199,
13,
747,
63,
923,
26,
272,
8002,
26,
3002,
4091,
272,
1174,
26,
9552,
272,
536,
26,
14779,
199,
2344,
199,
199,
9677,
275,
1449,
199,
923,
26,
272,
1369,
26,
11932,
13660,
314,
1572,
14,
272,
2138,
26,
4068,
3182,
1380,
473,
8,
929,
9,
365,
283,
1881,
1370,
272,
730,
26,
6114,
272,
3509,
26,
267,
1305,
26,
288,
1369,
26,
18276,
1572,
2870,
288,
730,
26,
1059,
288,
2690,
26,
298,
1024,
22,
11309,
556,
966,
67,
13067,
70,
24923,
65,
1822,
15504,
845,
31881,
16,
66,
16,
2,
267,
536,
26,
288,
1369,
26,
5611,
536,
288,
730,
26,
1059,
288,
2690,
26,
298,
8768,
2,
267,
1369,
26,
288,
1369,
26,
5611,
1369,
288,
730,
26,
1059,
288,
2690,
26,
298,
21493,
5611,
2,
267,
2881,
63,
344,
26,
288,
1369,
26,
14061,
367,
314,
1572,
288,
730,
26,
1059,
288,
2690,
26,
298,
885,
2,
199,
2344,
199,
199,
504,
3242,
14,
578,
63,
1208,
14,
4316,
492,
6953,
199,
504,
3242,
14,
578,
63,
1208,
14,
8512,
492,
13869,
63,
2861,
63,
2094,
63,
1650,
12,
13869,
63,
578,
63,
958,
12,
13869,
63,
4091,
63,
504,
63,
578,
421,
199,
318,
485,
2253,
63,
929,
63,
1461,
8,
929,
12,
1369,
12,
1572,
304,
272,
340,
1174,
508,
283,
1881,
7,
436,
440,
1572,
26,
267,
372,
715,
272,
340,
1174,
508,
283,
1881,
7,
436,
1369,
365,
440,
488,
436,
1572,
14,
1802,
1137,
1369,
26,
267,
372,
715,
272,
340,
1174,
508,
283,
5575,
7,
436,
1572,
26,
267,
372,
715,
272,
372,
756,
421,
199,
318,
2446,
837,
272,
1423,
63,
1650,
275,
13869,
63,
2861,
63,
2094,
63,
1650,
8,
267,
536,
29,
807,
8,
2427,
29,
549,
395,
267,
1369,
29,
807,
8,
2427,
29,
797,
12,
849,
29,
403,
395,
267,
2881,
63,
344,
29,
807,
8,
2427,
29,
797,
12,
849,
29,
403,
395,
267,
1174,
29,
807,
8,
885,
534,
1881,
297,
3415,
2968,
5575,
297,
283,
1881,
3815,
272,
776,
339,
859,
63,
958,
275,
13869,
63,
578,
63,
958,
342,
272,
859,
275,
6953,
8,
2094,
63,
1650,
12,
2574,
5171,
63,
1074,
63,
632,
29,
549,
12,
2574,
1011,
578,
63,
958,
9,
339,
536,
275,
859,
14,
1162,
14,
362,
360,
354,
358,
272,
1369,
275,
859,
14,
1162,
14,
362,
360,
1802,
358,
272,
1174,
275,
859,
14,
1162,
14,
362,
360,
929,
358,
339,
2881,
63,
344,
275,
859,
14,
1162,
14,
1935,
360,
2261,
63,
344,
358,
339,
13628,
12,
8002,
275,
13869,
63,
4091,
63,
504,
63,
578,
8,
578,
9,
272,
862,
26,
267,
340,
2881,
63,
344,
26,
288,
1572,
275,
8002,
14,
362,
63,
923,
8,
354,
12,
4766,
3713,
2261,
63,
344,
356,
2881,
63,
344,
1552,
267,
587,
26,
288,
1572,
275,
8002,
14,
362,
63,
923,
8,
354,
9,
398,
340,
859,
14,
1074,
63,
632,
26,
288,
859,
14,
2224,
63,
1001,
8,
2489,
3699,
2253,
63,
929,
63,
1461,
8,
929,
12,
1369,
12,
1572,
430,
398,
340,
1174,
508,
283,
1881,
356,
288,
340,
1572,
365,
488,
26,
355,
1572,
275,
8002,
14,
981,
63,
923,
8,
490,
536,
29,
354,
12,
1369,
29,
1802,
12,
2881,
29,
2261,
63,
344,
9,
355,
2896,
275,
715,
288,
587,
26,
355,
340,
1369,
365,
440,
488,
436,
1572,
14,
1802,
1137,
1369,
26,
490,
1572,
275,
8002,
14,
873,
63,
923,
8,
717,
1572,
14,
344,
12,
1369,
29,
1802,
9,
490,
2896,
275,
715,
355,
587,
26,
490,
2896,
275,
756,
288,
859,
14,
2224,
63,
1001
] |
[
2647,
15,
1393,
15,
1548,
199,
3,
1898,
334,
67,
9,
7800,
26202,
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,
421,
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,
421,
199,
8948,
275,
1449,
199,
2595,
199,
578,
26,
747,
63,
923,
199,
3612,
63,
1802,
26,
14944,
14260,
22034,
25031,
199,
11036,
63,
9970,
63,
7677,
26,
13869,
199,
1023,
63,
3270,
26,
298,
18,
14,
17,
2,
199,
2502,
26,
298,
6671,
369,
377,
1187,
25339,
8593,
69,
2106,
369,
395,
20232,
5244,
264,
3569,
66,
18359,
8593,
2662,
264,
3569,
2924,
199,
1802,
26,
272,
446,
14944,
14260,
22034,
25031,
14,
25031,
883,
506,
2737,
12,
5463,
503,
489,
4588,
14,
5972,
314,
473,
8,
1802,
9,
574,
883,
506,
4588,
14,
199,
1419,
26,
2043,
536,
26,
1362,
1369,
26,
267,
446,
5611,
536,
1362,
1415,
26,
2549,
2043,
1369,
26,
1362,
1369,
26,
267,
446,
5611,
1369,
2043,
2881,
63,
344,
26,
1362,
1369,
26,
267,
446,
14061,
1305,
370,
1218,
314,
1572,
315,
340,
314,
8002,
5171,
14006,
14,
1362,
1015,
63,
3270,
26,
298,
18,
14,
19,
2,
2043,
1174,
26,
1362,
1369,
26,
2126,
446,
7719,
314,
2073,
506,
3451,
503,
9552,
14,
1362,
3415,
26,
359,
1881,
12,
9552,
61,
1362,
849,
26,
3451,
2043,
14962,
63,
2619,
26,
1362,
1369,
26,
2126,
446,
27662,
14,
5543,
1150,
367,
8552,
7163,
199,
7538,
26,
272,
446,
298,
1548,
2356,
499,
14,
23,
2,
272,
446,
298,
8512,
9277,
2,
199,
2344,
199,
199,
8918,
275,
1449,
199,
3,
2790,
282,
1572,
4310,
298,
8768,
2,
199,
13,
747,
63,
923,
26,
272,
8002,
26,
3002,
4091,
272,
1174,
26,
3451,
272,
536,
26,
14779,
272,
1369,
26,
298,
21493,
5611,
2,
272,
2881,
63,
344,
26,
477,
14356,
199,
199,
3,
6162,
314,
1369,
641,
3411,
298,
8768,
2,
1572,
199,
13,
747,
63,
923,
26,
272,
8002,
26,
3002,
4091,
272,
1174,
26,
3451,
272,
536,
26,
14779,
272,
1369,
26,
298,
20641,
587,
2,
272,
2881,
63,
344,
26,
477,
14356,
199,
199,
3,
8496,
1572,
4310,
298,
8768,
2,
199,
13,
747,
63,
923,
26,
272,
8002,
26,
3002,
4091,
272,
1174,
26,
9552,
272,
536,
26,
14779,
199,
2344,
199,
199,
9677,
275,
1449,
199,
923,
26,
272,
1369,
26,
11932,
13660,
314,
1572,
14,
272,
2138,
26,
4068,
3182,
1380,
473,
8,
929,
9,
365,
283,
1881,
1370,
272,
730,
26,
6114,
272,
3509,
26,
267,
1305,
26,
288,
1369,
26,
18276,
1572,
2870,
288,
730,
26,
1059,
288,
2690,
26,
298,
1024,
22,
11309,
556,
966,
67,
13067,
70,
24923,
65,
1822,
15504,
845,
31881,
16,
66,
16,
2,
267,
536,
26,
288,
1369,
26,
5611,
536,
288,
730,
26,
1059,
288,
2690,
26,
298,
8768,
2,
267,
1369,
26,
288,
1369,
26,
5611,
1369,
288,
730,
26,
1059,
288,
2690,
26,
298,
21493,
5611,
2,
267,
2881,
63,
344,
26,
288,
1369,
26,
14061,
367,
314,
1572,
288,
730,
26,
1059,
288,
2690,
26,
298,
885,
2,
199,
2344,
199,
199,
504,
3242,
14,
578,
63,
1208,
14,
4316,
492,
6953,
199,
504,
3242,
14,
578,
63,
1208,
14,
8512,
492,
13869,
63,
2861,
63,
2094,
63,
1650,
12,
13869,
63,
578,
63,
958,
12,
13869,
63,
4091,
63,
504,
63,
578,
421,
199,
318,
485,
2253,
63,
929,
63,
1461,
8,
929,
12,
1369,
12,
1572,
304,
272,
340,
1174,
508,
283,
1881,
7,
436,
440,
1572,
26,
267,
372,
715,
272,
340,
1174,
508,
283,
1881,
7,
436,
1369,
365,
440,
488,
436,
1572,
14,
1802,
1137,
1369,
26,
267,
372,
715,
272,
340,
1174,
508,
283,
5575,
7,
436,
1572,
26,
267,
372,
715,
272,
372,
756,
421,
199,
318,
2446,
837,
272,
1423,
63,
1650,
275,
13869,
63,
2861,
63,
2094,
63,
1650,
8,
267,
536,
29,
807,
8,
2427,
29,
549,
395,
267,
1369,
29,
807,
8,
2427,
29,
797,
12,
849,
29,
403,
395,
267,
2881,
63,
344,
29,
807,
8,
2427,
29,
797,
12,
849,
29,
403,
395,
267,
1174,
29,
807,
8,
885,
534,
1881,
297,
3415,
2968,
5575,
297,
283,
1881,
3815,
272,
776,
339,
859,
63,
958,
275,
13869,
63,
578,
63,
958,
342,
272,
859,
275,
6953,
8,
2094,
63,
1650,
12,
2574,
5171,
63,
1074,
63,
632,
29,
549,
12,
2574,
1011,
578,
63,
958,
9,
339,
536,
275,
859,
14,
1162,
14,
362,
360,
354,
358,
272,
1369,
275,
859,
14,
1162,
14,
362,
360,
1802,
358,
272,
1174,
275,
859,
14,
1162,
14,
362,
360,
929,
358,
339,
2881,
63,
344,
275,
859,
14,
1162,
14,
1935,
360,
2261,
63,
344,
358,
339,
13628,
12,
8002,
275,
13869,
63,
4091,
63,
504,
63,
578,
8,
578,
9,
272,
862,
26,
267,
340,
2881,
63,
344,
26,
288,
1572,
275,
8002,
14,
362,
63,
923,
8,
354,
12,
4766,
3713,
2261,
63,
344,
356,
2881,
63,
344,
1552,
267,
587,
26,
288,
1572,
275,
8002,
14,
362,
63,
923,
8,
354,
9,
398,
340,
859,
14,
1074,
63,
632,
26,
288,
859,
14,
2224,
63,
1001,
8,
2489,
3699,
2253,
63,
929,
63,
1461,
8,
929,
12,
1369,
12,
1572,
430,
398,
340,
1174,
508,
283,
1881,
356,
288,
340,
1572,
365,
488,
26,
355,
1572,
275,
8002,
14,
981,
63,
923,
8,
490,
536,
29,
354,
12,
1369,
29,
1802,
12,
2881,
29,
2261,
63,
344,
9,
355,
2896,
275,
715,
288,
587,
26,
355,
340,
1369,
365,
440,
488,
436,
1572,
14,
1802,
1137,
1369,
26,
490,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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
] |
vimagick/youtube-dl
|
youtube_dl/extractor/canal13cl.py
|
154
|
1912
|
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class Canal13clIE(InfoExtractor):
_VALID_URL = r'^http://(?:www\.)?13\.cl/(?:[^/?#]+/)*(?P<id>[^/?#]+)'
_TEST = {
'url': 'http://www.13.cl/t13/nacional/el-circulo-de-hierro-de-michelle-bachelet-en-su-regreso-a-la-moneda',
'md5': '4cb1fa38adcad8fea88487a078831755',
'info_dict': {
'id': '1403022125',
'display_id': 'el-circulo-de-hierro-de-michelle-bachelet-en-su-regreso-a-la-moneda',
'ext': 'mp4',
'title': 'El "círculo de hierro" de Michelle Bachelet en su regreso a La Moneda',
'description': '(Foto: Agencia Uno) En nueve días más, Michelle Bachelet va a asumir por segunda vez como presidenta de la República. Entre aquellos que la acompañarán hay caras que se repiten y otras que se consolidan en su entorno de colaboradores más cercanos.',
}
}
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
display_id = mobj.group('id')
webpage = self._download_webpage(url, display_id)
title = self._html_search_meta(
'twitter:title', webpage, 'title', fatal=True)
description = self._html_search_meta(
'twitter:description', webpage, 'description')
url = self._html_search_regex(
r'articuloVideo = \"(.*?)\"', webpage, 'url')
real_id = self._search_regex(
r'[^0-9]([0-9]{7,})[^0-9]', url, 'id', default=display_id)
thumbnail = self._html_search_regex(
r'articuloImagen = \"(.*?)\"', webpage, 'thumbnail')
return {
'id': real_id,
'display_id': display_id,
'url': url,
'title': title,
'description': description,
'ext': 'mp4',
'thumbnail': thumbnail,
}
|
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,
421,
199,
533,
6855,
279,
969,
429,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
4289,
1014,
921,
5169,
1544,
20316,
969,
4537,
429,
32576,
4735,
10197,
3,
2807,
15,
3342,
2229,
48,
28,
344,
13489,
10197,
3,
29716,
272,
485,
2864,
275,
469,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
969,
14,
429,
15,
84,
969,
15,
3540,
559,
8125,
15,
352,
13,
6092,
13957,
13,
271,
13,
31184,
293,
13,
271,
13,
77,
1158,
352,
274,
13,
2470,
595,
2723,
13,
287,
13,
9648,
13,
1135,
470,
79,
13,
65,
13,
416,
13,
77,
368,
983,
297,
267,
283,
1064,
21,
356,
283,
20,
2894,
17,
667,
1703,
21246,
350,
24,
29838,
16303,
1555,
65,
1780,
16456,
1196,
1229,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
1079,
1644,
16348,
6889,
297,
288,
283,
2918,
63,
344,
356,
283,
352,
13,
6092,
13957,
13,
271,
13,
31184,
293,
13,
271,
13,
77,
1158,
352,
274,
13,
2470,
595,
2723,
13,
287,
13,
9648,
13,
1135,
470,
79,
13,
65,
13,
416,
13,
77,
368,
983,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
10420,
298,
67,
13676,
1195,
13957,
477,
394,
4446,
293,
2,
477,
603,
1158,
352,
274,
699,
21481,
2723,
655,
18741,
1295,
470,
79,
282,
7964,
603,
368,
983,
297,
288,
283,
1802,
356,
8189,
38,
3459,
26,
437,
2268,
16521,
738,
889,
9,
3447,
302,
310,
432,
366,
13676,
305,
333,
11302,
83,
12,
603,
1158,
352,
274,
699,
21481,
2723,
25819,
282,
465,
453,
723,
8706,
8812,
725,
65,
11199,
90,
512,
573,
876,
338,
1326,
65,
477,
1127,
16000,
24602,
66,
7518,
14,
23450,
264,
282,
544,
76,
11560,
17414,
1127,
282,
863,
65,
22692,
285,
11302,
78,
394,
1187,
9590,
305,
17414,
542,
295,
1038,
724,
612,
312,
454,
305,
17414,
542,
406,
18533,
290,
655,
18741,
15992,
269,
889,
477,
1048,
371,
269,
5129,
470,
333,
11302,
83,
3361,
2425,
736,
3130,
267,
789,
272,
789,
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,
2929,
63,
344,
275,
14208,
14,
923,
360,
344,
358,
398,
9248,
275,
291,
423,
4249,
63,
12022,
8,
633,
12,
2929,
63,
344,
9,
398,
2538,
275,
291,
423,
1360,
63,
1733,
63,
2024,
8,
288,
283,
13746,
26,
1213,
297,
9248,
12,
283,
1213,
297,
14294,
29,
549,
9,
267,
1369,
275,
291,
423,
1360,
63,
1733,
63,
2024,
8,
288,
283,
13746,
26,
1802,
297,
9248,
12,
283,
1802,
358,
267,
1166,
275,
291,
423,
1360,
63,
1733,
63,
3821,
8,
288,
519,
7,
285,
764,
13957,
9166,
275,
8441,
17140,
2862,
6949,
9248,
12,
283,
633,
358,
267,
3363,
63,
344,
275,
291,
423,
1733,
63,
3821,
8,
288,
519,
16122,
16,
13,
25,
61,
779,
16,
13,
25,
8194,
23,
12,
1552,
4735,
16,
13,
25,
4300,
1166,
12,
283,
344,
297,
849,
29,
2918,
63,
344,
9,
267,
10062,
275,
291,
423,
1360,
63,
1733,
63,
3821,
8,
288,
519,
7,
285,
764,
13957,
32023,
2268,
275,
8441,
17140,
2862,
6949,
9248,
12,
283,
8311,
358,
398,
372,
469,
288,
283,
344,
356,
3363,
63,
344,
12,
288,
283,
2918,
63,
344,
356,
2929,
63,
344,
12,
288,
283,
633,
356,
1166,
12,
288,
283,
1213,
356,
2538,
12,
288,
283,
1802,
356,
1369,
12,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
8311,
356,
10062,
12,
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,
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,
421,
199,
533,
6855,
279,
969,
429,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
4289,
1014,
921,
5169,
1544,
20316,
969,
4537,
429,
32576,
4735,
10197,
3,
2807,
15,
3342,
2229,
48,
28,
344,
13489,
10197,
3,
29716,
272,
485,
2864,
275,
469,
267,
283,
633,
356,
283,
1014,
921,
1544,
14,
969,
14,
429,
15,
84,
969,
15,
3540,
559,
8125,
15,
352,
13,
6092,
13957,
13,
271,
13,
31184,
293,
13,
271,
13,
77,
1158,
352,
274,
13,
2470,
595,
2723,
13,
287,
13,
9648,
13,
1135,
470,
79,
13,
65,
13,
416,
13,
77,
368,
983,
297,
267,
283,
1064,
21,
356,
283,
20,
2894,
17,
667,
1703,
21246,
350,
24,
29838,
16303,
1555,
65,
1780,
16456,
1196,
1229,
297,
267,
283,
815,
63,
807,
356,
469,
288,
283,
344,
356,
283,
1079,
1644,
16348,
6889,
297,
288,
283,
2918,
63,
344,
356,
283,
352,
13,
6092,
13957,
13,
271,
13,
31184,
293,
13,
271,
13,
77,
1158,
352,
274,
13,
2470,
595,
2723,
13,
287,
13,
9648,
13,
1135,
470,
79,
13,
65,
13,
416,
13,
77,
368,
983,
297,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
1213,
356,
283,
10420,
298,
67,
13676,
1195,
13957,
477,
394,
4446,
293,
2,
477,
603,
1158,
352,
274,
699,
21481,
2723,
655,
18741,
1295,
470,
79,
282,
7964,
603,
368,
983,
297,
288,
283,
1802,
356,
8189,
38,
3459,
26,
437,
2268,
16521,
738,
889,
9,
3447,
302,
310,
432,
366,
13676,
305,
333,
11302,
83,
12,
603,
1158,
352,
274,
699,
21481,
2723,
25819,
282,
465,
453,
723,
8706,
8812,
725,
65,
11199,
90,
512,
573,
876,
338,
1326,
65,
477,
1127,
16000,
24602,
66,
7518,
14,
23450,
264,
282,
544,
76,
11560,
17414,
1127,
282,
863,
65,
22692,
285,
11302,
78,
394,
1187,
9590,
305,
17414,
542,
295,
1038,
724,
612,
312,
454,
305,
17414,
542,
406,
18533,
290,
655,
18741,
15992,
269,
889,
477,
1048,
371,
269,
5129,
470,
333,
11302,
83,
3361,
2425,
736,
3130,
267,
789,
272,
789,
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,
2929,
63,
344,
275,
14208,
14,
923,
360,
344,
358,
398,
9248,
275,
291,
423,
4249,
63,
12022,
8,
633,
12,
2929,
63,
344,
9,
398,
2538,
275,
291,
423,
1360,
63,
1733,
63,
2024,
8,
288,
283,
13746,
26,
1213,
297,
9248,
12,
283,
1213,
297,
14294,
29,
549,
9,
267,
1369,
275,
291,
423,
1360,
63,
1733,
63,
2024,
8,
288,
283,
13746,
26,
1802,
297,
9248,
12,
283,
1802,
358,
267,
1166,
275,
291,
423,
1360,
63,
1733,
63,
3821,
8,
288,
519,
7,
285,
764,
13957,
9166,
275,
8441,
17140,
2862,
6949,
9248,
12,
283,
633,
358,
267,
3363,
63,
344,
275,
291,
423,
1733,
63,
3821,
8,
288,
519,
16122,
16,
13,
25,
61,
779,
16,
13,
25,
8194,
23,
12,
1552,
4735,
16,
13,
25,
4300,
1166,
12,
283,
344,
297,
849,
29,
2918,
63,
344,
9,
267,
10062,
275,
291,
423,
1360,
63,
1733,
63,
3821,
8,
288,
519,
7,
285,
764,
13957,
32023,
2268,
275,
8441,
17140,
2862,
6949,
9248,
12,
283,
8311,
358,
398,
372,
469,
288,
283,
344,
356,
3363,
63,
344,
12,
288,
283,
2918,
63,
344,
356,
2929,
63,
344,
12,
288,
283,
633,
356,
1166,
12,
288,
283,
1213,
356,
2538,
12,
288,
283,
1802,
356,
1369,
12,
288,
283,
832,
356,
283,
311,
20,
297,
288,
283,
8311,
356,
10062,
12,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32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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
] |
coolbombom/CouchPotato
|
library/imdb/parser/http/companyParser.py
|
143
|
3439
|
"""
parser.http.companyParser module (imdb package).
This module provides the classes (and the instances), used to parse
the IMDb pages on the akas.imdb.com server about a company.
E.g., for "Columbia Pictures [us]" the referred page would be:
main details: http://akas.imdb.com/company/co0071509/
Copyright 2008-2009 Davide Alberani <da@erlug.linux.it>
2008 H. Turgut Uyar <uyar@tekir.org>
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
"""
import re
from utils import build_movie, Attribute, Extractor, DOMParserBase, \
analyze_imdbid
from imdb.utils import analyze_company_name
class DOMCompanyParser(DOMParserBase):
"""Parser for the main page of a given company.
The page should be provided as a string, as taken from
the akas.imdb.com server. The final result will be a
dictionary, with a key for every relevant section.
Example:
cparser = DOMCompanyParser()
result = cparser.parse(company_html_string)
"""
_containsObjects = True
extractors = [
Extractor(label='name',
path="//title",
attrs=Attribute(key='name',
path="./text()",
postprocess=lambda x: \
analyze_company_name(x, stripNotes=True))),
Extractor(label='filmography',
group="//b/a[@name]",
group_key="./text()",
group_key_normalize=lambda x: x.lower(),
path="../following-sibling::ol[1]/li",
attrs=Attribute(key=None,
multi=True,
path={
'link': "./a[1]/@href",
'title': "./a[1]/text()",
'year': "./text()[1]"
},
postprocess=lambda x:
build_movie(u'%s %s' % \
(x.get('title'), x.get('year').strip()),
movieID=analyze_imdbid(x.get('link') or u''),
_parsingCompany=True))),
]
preprocessors = [
(re.compile('(<b><a name=)', re.I), r'</p>\1')
]
def postprocess_data(self, data):
for key in data.keys():
new_key = key.replace('company', 'companies')
new_key = new_key.replace('other', 'miscellaneous')
new_key = new_key.replace('distributor', 'distributors')
if new_key != key:
data[new_key] = data[key]
del data[key]
return data
_OBJECTS = {
'company_main_parser': ((DOMCompanyParser,), None)
}
|
gpl-3.0
|
[
624,
199,
2087,
14,
1014,
14,
4627,
2842,
859,
334,
17117,
2559,
680,
199,
199,
2765,
859,
6571,
314,
3992,
334,
460,
314,
4454,
395,
1202,
370,
2198,
199,
1589,
473,
5127,
66,
6497,
641,
314,
282,
75,
305,
14,
17117,
14,
957,
1654,
3595,
282,
7233,
14,
199,
37,
14,
71,
2020,
367,
298,
2001,
4295,
4674,
19835,
22004,
359,
527,
8480,
314,
25713,
2034,
3955,
506,
26,
272,
2446,
2436,
26,
257,
1455,
921,
1151,
305,
14,
17117,
14,
957,
15,
4627,
15,
331,
8255,
1046,
1643,
15,
199,
199,
7384,
9079,
13,
8664,
577,
65,
5624,
4580,
605,
26455,
665,
983,
32,
281,
32047,
14,
5135,
14,
390,
30,
881,
9079,
869,
14,
377,
17629,
337,
738,
89,
285,
665,
29514,
285,
32,
266,
75,
723,
14,
1308,
30,
199,
199,
2765,
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,
2765,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
7911,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
31461,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
17732,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
199,
5556,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
21632,
543,
642,
2240,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
199,
30216,
12,
3277,
2020,
8155,
15630,
10902,
12,
14453,
13540,
12,
8226,
12,
4828,
221,
15673,
13,
13421,
221,
8217,
199,
624,
199,
199,
646,
295,
199,
504,
3778,
492,
1900,
63,
10888,
12,
3882,
12,
18925,
12,
14316,
2842,
1563,
12,
971,
490,
19897,
63,
17117,
344,
199,
199,
504,
18232,
14,
1208,
492,
19897,
63,
4627,
63,
354,
421,
199,
533,
14316,
16063,
2842,
8,
10462,
2842,
1563,
304,
272,
408,
2842,
367,
314,
2446,
2034,
402,
282,
1627,
7233,
14,
272,
710,
2034,
1077,
506,
2741,
465,
282,
1059,
12,
465,
9394,
687,
272,
314,
282,
75,
305,
14,
17117,
14,
957,
1654,
14,
221,
710,
4242,
754,
911,
506,
282,
272,
2600,
12,
543,
282,
790,
367,
4036,
12082,
3420,
14,
339,
5679,
26,
267,
286,
2087,
275,
14316,
16063,
2842,
342,
267,
754,
275,
286,
2087,
14,
1122,
8,
4627,
63,
1360,
63,
875,
9,
272,
408,
272,
485,
6134,
11188,
275,
715,
339,
2402,
13451,
275,
359,
288,
18925,
8,
1302,
534,
354,
297,
717,
931,
628,
501,
1213,
401,
717,
3290,
29,
1646,
8,
498,
534,
354,
297,
1169,
931,
628,
13186,
505,
24017,
717,
2963,
1412,
29,
2734,
671,
26,
971,
1816,
19897,
63,
4627,
63,
354,
8,
88,
12,
6202,
18685,
29,
549,
11508,
953,
18925,
8,
1302,
534,
1289,
573,
9773,
297,
717,
1572,
628,
501,
66,
15,
65,
14251,
354,
11472,
717,
1572,
63,
498,
628,
13186,
505,
24017,
717,
1572,
63,
498,
63,
7721,
29,
2734,
671,
26,
671,
14,
2325,
1062,
717,
931,
628,
5093,
21589,
13,
17285,
447,
393,
59,
17,
12978,
317,
401,
717,
3290,
29,
1646,
8,
498,
29,
403,
12,
1169,
3510,
29,
549,
12,
1169,
931,
3126,
1816,
283,
1073,
356,
26069,
65,
59,
17,
12978,
32,
6399,
401,
1816,
283,
1213,
356,
26069,
65,
59,
17,
12978,
505,
24017,
1816,
283,
3403,
356,
26069,
505,
3430,
17,
8480,
1816,
1660,
1169,
2963,
1412,
29,
2734,
671,
26,
1816,
1900,
63,
10888,
8,
85,
5956,
83,
450,
83,
7,
450,
971,
1816,
334,
88,
14,
362,
360,
1213,
659,
671,
14,
362,
360,
3403,
1959,
1913,
4000,
1816,
14360,
998,
29,
21184,
63,
17117,
344,
8,
88,
14,
362,
360,
1073,
358,
503,
399,
7,
659,
1816,
485,
11059,
16063,
29,
549,
11508,
288,
1622,
339,
876,
10547,
275,
359,
267,
334,
264,
14,
2014,
14097,
28,
66,
2535,
65,
536,
29,
3196,
295,
14,
41,
395,
519,
29477,
80,
3072,
17,
358,
267,
1622,
339,
347,
2963,
1412,
63,
576,
8,
277,
12,
666,
304,
267,
367,
790,
315,
666,
14,
1612,
837,
288,
892,
63,
498,
275,
790,
14,
1814,
360,
4627,
297,
283,
863,
23461,
358,
288,
892,
63,
498,
275,
892,
63,
498,
14,
1814,
360,
1848,
297,
283,
1292,
19549,
358,
288,
892,
63,
498,
275,
892,
63,
498,
14,
1814,
360,
20231,
4139,
297,
283,
20231,
6622,
358,
288,
340,
892,
63,
498,
1137,
790,
26,
355,
666,
59,
1222,
63,
498,
61,
275,
666,
59,
498,
61,
355,
2150,
666,
59,
498,
61,
267,
372,
666,
421,
199,
63,
9868,
51,
275,
469,
272,
283,
4627,
63,
973,
63,
2087,
356,
3666,
10462,
16063,
2842,
4706,
488,
9,
199,
93,
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
] |
[
199,
2087,
14,
1014,
14,
4627,
2842,
859,
334,
17117,
2559,
680,
199,
199,
2765,
859,
6571,
314,
3992,
334,
460,
314,
4454,
395,
1202,
370,
2198,
199,
1589,
473,
5127,
66,
6497,
641,
314,
282,
75,
305,
14,
17117,
14,
957,
1654,
3595,
282,
7233,
14,
199,
37,
14,
71,
2020,
367,
298,
2001,
4295,
4674,
19835,
22004,
359,
527,
8480,
314,
25713,
2034,
3955,
506,
26,
272,
2446,
2436,
26,
257,
1455,
921,
1151,
305,
14,
17117,
14,
957,
15,
4627,
15,
331,
8255,
1046,
1643,
15,
199,
199,
7384,
9079,
13,
8664,
577,
65,
5624,
4580,
605,
26455,
665,
983,
32,
281,
32047,
14,
5135,
14,
390,
30,
881,
9079,
869,
14,
377,
17629,
337,
738,
89,
285,
665,
29514,
285,
32,
266,
75,
723,
14,
1308,
30,
199,
199,
2765,
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,
2765,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
199,
7911,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
199,
31461,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
199,
17732,
1696,
1684,
844,
367,
1655,
2436,
14,
199,
199,
5556,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
199,
21632,
543,
642,
2240,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
199,
30216,
12,
3277,
2020,
8155,
15630,
10902,
12,
14453,
13540,
12,
8226,
12,
4828,
221,
15673,
13,
13421,
221,
8217,
199,
624,
199,
199,
646,
295,
199,
504,
3778,
492,
1900,
63,
10888,
12,
3882,
12,
18925,
12,
14316,
2842,
1563,
12,
971,
490,
19897,
63,
17117,
344,
199,
199,
504,
18232,
14,
1208,
492,
19897,
63,
4627,
63,
354,
421,
199,
533,
14316,
16063,
2842,
8,
10462,
2842,
1563,
304,
272,
408,
2842,
367,
314,
2446,
2034,
402,
282,
1627,
7233,
14,
272,
710,
2034,
1077,
506,
2741,
465,
282,
1059,
12,
465,
9394,
687,
272,
314,
282,
75,
305,
14,
17117,
14,
957,
1654,
14,
221,
710,
4242,
754,
911,
506,
282,
272,
2600,
12,
543,
282,
790,
367,
4036,
12082,
3420,
14,
339,
5679,
26,
267,
286,
2087,
275,
14316,
16063,
2842,
342,
267,
754,
275,
286,
2087,
14,
1122,
8,
4627,
63,
1360,
63,
875,
9,
272,
408,
272,
485,
6134,
11188,
275,
715,
339,
2402,
13451,
275,
359,
288,
18925,
8,
1302,
534,
354,
297,
717,
931,
628,
501,
1213,
401,
717,
3290,
29,
1646,
8,
498,
534,
354,
297,
1169,
931,
628,
13186,
505,
24017,
717,
2963,
1412,
29,
2734,
671,
26,
971,
1816,
19897,
63,
4627,
63,
354,
8,
88,
12,
6202,
18685,
29,
549,
11508,
953,
18925,
8,
1302,
534,
1289,
573,
9773,
297,
717,
1572,
628,
501,
66,
15,
65,
14251,
354,
11472,
717,
1572,
63,
498,
628,
13186,
505,
24017,
717,
1572,
63,
498,
63,
7721,
29,
2734,
671,
26,
671,
14,
2325,
1062,
717,
931,
628,
5093,
21589,
13,
17285,
447,
393,
59,
17,
12978,
317,
401,
717,
3290,
29,
1646,
8,
498,
29,
403,
12,
1169,
3510,
29,
549,
12,
1169,
931,
3126,
1816,
283,
1073,
356,
26069,
65,
59,
17,
12978,
32,
6399,
401,
1816,
283,
1213,
356,
26069,
65,
59,
17,
12978,
505,
24017,
1816,
283,
3403,
356,
26069,
505,
3430,
17,
8480,
1816,
1660,
1169,
2963,
1412,
29,
2734,
671,
26,
1816,
1900,
63,
10888,
8,
85,
5956,
83,
450,
83,
7,
450,
971,
1816,
334,
88,
14,
362,
360,
1213,
659,
671,
14,
362,
360,
3403,
1959,
1913,
4000,
1816,
14360,
998,
29,
21184,
63,
17117,
344,
8,
88,
14,
362,
360,
1073,
358,
503,
399,
7,
659,
1816,
485,
11059,
16063,
29,
549,
11508,
288,
1622,
339,
876,
10547,
275,
359,
267,
334,
264,
14,
2014,
14097,
28,
66,
2535,
65,
536,
29,
3196,
295,
14,
41,
395,
519,
29477,
80,
3072,
17,
358,
267,
1622,
339,
347,
2963,
1412,
63,
576,
8,
277,
12,
666,
304,
267,
367,
790,
315,
666,
14,
1612,
837,
288,
892,
63,
498,
275,
790,
14,
1814,
360,
4627,
297,
283,
863,
23461,
358,
288,
892,
63,
498,
275,
892,
63,
498,
14,
1814,
360,
1848,
297,
283,
1292,
19549,
358,
288,
892,
63,
498,
275,
892,
63,
498,
14,
1814,
360,
20231,
4139,
297,
283,
20231,
6622,
358,
288,
340,
892,
63,
498,
1137,
790,
26,
355,
666,
59,
1222,
63,
498,
61,
275,
666,
59,
498,
61,
355,
2150,
666,
59,
498,
61,
267,
372,
666,
421,
199,
63,
9868,
51,
275,
469,
272,
283,
4627,
63,
973,
63,
2087,
356,
3666,
10462,
16063,
2842,
4706,
488,
9,
199,
93,
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,
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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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
SUSE/kiwi
|
test/unit/tasks/base_test.py
|
1
|
2767
|
import sys
from mock import patch
from pytest import (
raises, fixture
)
import logging
from ..test_helper import argv_kiwi_tests
import kiwi.xml_parse
from kiwi.tasks.base import CliTask
from kiwi.exceptions import KiwiConfigFileNotFound
class TestCliTask:
@fixture(autouse=True)
def inject_fixtures(self, caplog):
self._caplog = caplog
@patch('kiwi.logger.Logger.setLogLevel')
@patch('kiwi.logger.Logger.set_logfile')
@patch('kiwi.logger.Logger.set_color_format')
@patch('kiwi.cli.Cli.show_and_exit_on_help_request')
@patch('kiwi.cli.Cli.load_command')
@patch('kiwi.cli.Cli.get_command_args')
@patch('kiwi.cli.Cli.get_global_args')
@patch('kiwi.tasks.base.RuntimeConfig')
def setup(
self, mock_runtime_config, mock_global_args, mock_command_args,
mock_load_command, mock_help_check, mock_color,
mock_setlog, mock_setlevel
):
mock_global_args.return_value = {
'--debug': True,
'--logfile': 'log',
'--color-output': True,
'--profile': ['vmxFlavour'],
'--type': None
}
mock_command_args.return_value = {
'system': True,
'prepare': True,
'--description': 'description',
'--root': 'directory'
}
self.task = CliTask()
mock_help_check.assert_called_once_with()
mock_load_command.assert_called_once_with()
mock_command_args.assert_called_once_with()
mock_global_args.assert_called_once_with()
mock_setlevel.assert_called_once_with(logging.DEBUG)
mock_setlog.assert_called_once_with('log')
mock_color.assert_called_once_with()
mock_runtime_config.assert_called_once_with()
def test_quadruple_token(self):
assert self.task.quadruple_token('a,b') == ['a', 'b', None, None]
@patch('kiwi.tasks.base.RuntimeChecker')
def test_load_xml_description(self, mock_runtime_checker):
self.task.load_xml_description('../data/description')
mock_runtime_checker.assert_called_once_with(self.task.xml_state)
assert self.task.config_file == '../data/description/config.xml'
assert isinstance(self.task.xml_data, kiwi.xml_parse.image)
assert self.task.xml_state.profiles == ['vmxFlavour']
def test_load_xml_description_buildservice(self):
self.task.load_xml_description('../data/description.buildservice')
assert self.task.config_file == \
'../data/description.buildservice/appliance.kiwi'
def test_load_xml_description_raises(self):
with raises(KiwiConfigFileNotFound):
self.task.load_xml_description('foo')
def teardown(self):
sys.argv = argv_kiwi_tests
|
gpl-3.0
|
[
646,
984,
199,
504,
1683,
492,
3371,
199,
504,
4613,
492,
334,
272,
6534,
12,
10949,
199,
9,
199,
646,
2050,
199,
199,
504,
2508,
396,
63,
3676,
492,
9238,
63,
8810,
14249,
63,
2219,
199,
199,
646,
1022,
73,
14249,
14,
1652,
63,
1122,
199,
504,
1022,
73,
14249,
14,
5054,
14,
1095,
492,
445,
317,
4476,
199,
199,
504,
1022,
73,
14249,
14,
3924,
492,
1804,
73,
14249,
2028,
1173,
4667,
421,
199,
533,
1379,
20653,
4476,
26,
272,
768,
5997,
8,
6898,
7130,
29,
549,
9,
272,
347,
16182,
63,
8769,
8,
277,
12,
32297,
304,
267,
291,
423,
2874,
793,
275,
32297,
339,
768,
2068,
360,
8810,
14249,
14,
2921,
14,
4455,
14,
409,
2445,
4670,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2921,
14,
4455,
14,
409,
63,
12804,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2921,
14,
4455,
14,
409,
63,
2326,
63,
908,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2764,
14,
20653,
14,
2384,
63,
460,
63,
2224,
63,
265,
63,
3437,
63,
1069,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2764,
14,
20653,
14,
912,
63,
1531,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2764,
14,
20653,
14,
362,
63,
1531,
63,
589,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2764,
14,
20653,
14,
362,
63,
2966,
63,
589,
358,
272,
768,
2068,
360,
8810,
14249,
14,
5054,
14,
1095,
14,
14357,
2028,
358,
272,
347,
3272,
8,
267,
291,
12,
1683,
63,
7726,
63,
888,
12,
1683,
63,
2966,
63,
589,
12,
1683,
63,
1531,
63,
589,
12,
267,
1683,
63,
912,
63,
1531,
12,
1683,
63,
3437,
63,
1074,
12,
1683,
63,
2326,
12,
267,
1683,
63,
409,
793,
12,
1683,
63,
409,
1896,
272,
3461,
267,
1683,
63,
2966,
63,
589,
14,
1107,
63,
585,
275,
469,
288,
2850,
1757,
356,
715,
12,
288,
2850,
12804,
356,
283,
793,
297,
288,
2850,
2326,
13,
1199,
356,
715,
12,
288,
2850,
2913,
356,
788,
2611,
6287,
3783,
567,
995,
288,
2850,
466,
356,
488,
267,
789,
267,
1683,
63,
1531,
63,
589,
14,
1107,
63,
585,
275,
469,
288,
283,
2253,
356,
715,
12,
288,
283,
6726,
356,
715,
12,
288,
2850,
1802,
356,
283,
1802,
297,
288,
2850,
1231,
356,
283,
3619,
7,
267,
789,
398,
291,
14,
1765,
275,
445,
317,
4476,
342,
398,
1683,
63,
3437,
63,
1074,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
267,
1683,
63,
912,
63,
1531,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
267,
1683,
63,
1531,
63,
589,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
267,
1683,
63,
2966,
63,
589,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
267,
1683,
63,
409,
1896,
14,
479,
63,
3527,
63,
5089,
63,
1045,
8,
4806,
14,
5287,
9,
267,
1683,
63,
409,
793,
14,
479,
63,
3527,
63,
5089,
63,
1045,
360,
793,
358,
267,
1683,
63,
2326,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
267,
1683,
63,
7726,
63,
888,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
339,
347,
511,
63,
14567,
82,
1363,
63,
1418,
8,
277,
304,
267,
702,
291,
14,
1765,
14,
14567,
82,
1363,
63,
1418,
360,
65,
12,
66,
358,
508,
788,
65,
297,
283,
66,
297,
488,
12,
488,
61,
339,
768,
2068,
360,
8810,
14249,
14,
5054,
14,
1095,
14,
14357,
3048,
358,
272,
347,
511,
63,
912,
63,
1652,
63,
1802,
8,
277,
12,
1683,
63,
7726,
63,
6743,
304,
267,
291,
14,
1765,
14,
912,
63,
1652,
63,
1802,
24592,
576,
15,
1802,
358,
267,
1683,
63,
7726,
63,
6743,
14,
479,
63,
3527,
63,
5089,
63,
1045,
8,
277,
14,
1765,
14,
1652,
63,
929,
9,
267,
702,
291,
14,
1765,
14,
888,
63,
493,
508,
20644,
576,
15,
1802,
15,
888,
14,
1652,
7,
267,
702,
1228,
8,
277,
14,
1765,
14,
1652,
63,
576,
12,
1022,
73,
14249,
14,
1652,
63,
1122,
14,
1569,
9,
267,
702,
291,
14,
1765,
14,
1652,
63,
929,
14,
11225,
508,
788,
2611,
6287,
3783,
567,
418,
339,
347,
511,
63,
912,
63,
1652,
63,
1802,
63,
1506,
1364,
8,
277,
304,
267,
291,
14,
1765,
14,
912,
63,
1652,
63,
1802,
24592,
576,
15,
1802,
14,
1506,
1364,
358,
267,
702,
291,
14,
1765,
14,
888,
63,
493,
508,
971,
288,
20644,
576,
15,
1802,
14,
1506,
1364,
15,
19858,
14,
8810,
14249,
7,
339,
347,
511,
63,
912,
63,
1652,
63,
1802,
63,
3536,
8,
277,
304,
267,
543,
6534,
8,
32198,
14249,
2028,
1173,
4667,
304,
288,
291,
14,
1765,
14,
912,
63,
1652,
63,
1802,
360,
1421,
358,
339,
347,
17558,
8,
277,
304,
267,
984,
14,
3020,
275,
9238,
63,
8810,
14249,
63,
2219,
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
] |
[
984,
199,
504,
1683,
492,
3371,
199,
504,
4613,
492,
334,
272,
6534,
12,
10949,
199,
9,
199,
646,
2050,
199,
199,
504,
2508,
396,
63,
3676,
492,
9238,
63,
8810,
14249,
63,
2219,
199,
199,
646,
1022,
73,
14249,
14,
1652,
63,
1122,
199,
504,
1022,
73,
14249,
14,
5054,
14,
1095,
492,
445,
317,
4476,
199,
199,
504,
1022,
73,
14249,
14,
3924,
492,
1804,
73,
14249,
2028,
1173,
4667,
421,
199,
533,
1379,
20653,
4476,
26,
272,
768,
5997,
8,
6898,
7130,
29,
549,
9,
272,
347,
16182,
63,
8769,
8,
277,
12,
32297,
304,
267,
291,
423,
2874,
793,
275,
32297,
339,
768,
2068,
360,
8810,
14249,
14,
2921,
14,
4455,
14,
409,
2445,
4670,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2921,
14,
4455,
14,
409,
63,
12804,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2921,
14,
4455,
14,
409,
63,
2326,
63,
908,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2764,
14,
20653,
14,
2384,
63,
460,
63,
2224,
63,
265,
63,
3437,
63,
1069,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2764,
14,
20653,
14,
912,
63,
1531,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2764,
14,
20653,
14,
362,
63,
1531,
63,
589,
358,
272,
768,
2068,
360,
8810,
14249,
14,
2764,
14,
20653,
14,
362,
63,
2966,
63,
589,
358,
272,
768,
2068,
360,
8810,
14249,
14,
5054,
14,
1095,
14,
14357,
2028,
358,
272,
347,
3272,
8,
267,
291,
12,
1683,
63,
7726,
63,
888,
12,
1683,
63,
2966,
63,
589,
12,
1683,
63,
1531,
63,
589,
12,
267,
1683,
63,
912,
63,
1531,
12,
1683,
63,
3437,
63,
1074,
12,
1683,
63,
2326,
12,
267,
1683,
63,
409,
793,
12,
1683,
63,
409,
1896,
272,
3461,
267,
1683,
63,
2966,
63,
589,
14,
1107,
63,
585,
275,
469,
288,
2850,
1757,
356,
715,
12,
288,
2850,
12804,
356,
283,
793,
297,
288,
2850,
2326,
13,
1199,
356,
715,
12,
288,
2850,
2913,
356,
788,
2611,
6287,
3783,
567,
995,
288,
2850,
466,
356,
488,
267,
789,
267,
1683,
63,
1531,
63,
589,
14,
1107,
63,
585,
275,
469,
288,
283,
2253,
356,
715,
12,
288,
283,
6726,
356,
715,
12,
288,
2850,
1802,
356,
283,
1802,
297,
288,
2850,
1231,
356,
283,
3619,
7,
267,
789,
398,
291,
14,
1765,
275,
445,
317,
4476,
342,
398,
1683,
63,
3437,
63,
1074,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
267,
1683,
63,
912,
63,
1531,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
267,
1683,
63,
1531,
63,
589,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
267,
1683,
63,
2966,
63,
589,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
267,
1683,
63,
409,
1896,
14,
479,
63,
3527,
63,
5089,
63,
1045,
8,
4806,
14,
5287,
9,
267,
1683,
63,
409,
793,
14,
479,
63,
3527,
63,
5089,
63,
1045,
360,
793,
358,
267,
1683,
63,
2326,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
267,
1683,
63,
7726,
63,
888,
14,
479,
63,
3527,
63,
5089,
63,
1045,
342,
339,
347,
511,
63,
14567,
82,
1363,
63,
1418,
8,
277,
304,
267,
702,
291,
14,
1765,
14,
14567,
82,
1363,
63,
1418,
360,
65,
12,
66,
358,
508,
788,
65,
297,
283,
66,
297,
488,
12,
488,
61,
339,
768,
2068,
360,
8810,
14249,
14,
5054,
14,
1095,
14,
14357,
3048,
358,
272,
347,
511,
63,
912,
63,
1652,
63,
1802,
8,
277,
12,
1683,
63,
7726,
63,
6743,
304,
267,
291,
14,
1765,
14,
912,
63,
1652,
63,
1802,
24592,
576,
15,
1802,
358,
267,
1683,
63,
7726,
63,
6743,
14,
479,
63,
3527,
63,
5089,
63,
1045,
8,
277,
14,
1765,
14,
1652,
63,
929,
9,
267,
702,
291,
14,
1765,
14,
888,
63,
493,
508,
20644,
576,
15,
1802,
15,
888,
14,
1652,
7,
267,
702,
1228,
8,
277,
14,
1765,
14,
1652,
63,
576,
12,
1022,
73,
14249,
14,
1652,
63,
1122,
14,
1569,
9,
267,
702,
291,
14,
1765,
14,
1652,
63,
929,
14,
11225,
508,
788,
2611,
6287,
3783,
567,
418,
339,
347,
511,
63,
912,
63,
1652,
63,
1802,
63,
1506,
1364,
8,
277,
304,
267,
291,
14,
1765,
14,
912,
63,
1652,
63,
1802,
24592,
576,
15,
1802,
14,
1506,
1364,
358,
267,
702,
291,
14,
1765,
14,
888,
63,
493,
508,
971,
288,
20644,
576,
15,
1802,
14,
1506,
1364,
15,
19858,
14,
8810,
14249,
7,
339,
347,
511,
63,
912,
63,
1652,
63,
1802,
63,
3536,
8,
277,
304,
267,
543,
6534,
8,
32198,
14249,
2028,
1173,
4667,
304,
288,
291,
14,
1765,
14,
912,
63,
1652,
63,
1802,
360,
1421,
358,
339,
347,
17558,
8,
277,
304,
267,
984,
14,
3020,
275,
9238,
63,
8810,
14249,
63,
2219,
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,
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,
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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
] |
fxfitz/ansible
|
lib/ansible/plugins/lookup/password.py
|
8
|
12096
|
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2013, Javier Candeira <javier@candeira.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2017 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
DOCUMENTATION = """
lookup: password
version_added: "1.1"
author:
- Daniel Hokka Zakrisson <daniel@hozac.com>
- Javier Candeira <javier@candeira.com>
- Maykel Moya <mmoya@speedyrails.com>
short_description: retrieve or generate a random password, stored in a file
description:
- Generates a random plaintext password and stores it in a file at a given filepath.
- If the file exists previously, it will retrieve its contents, behaving just like with_file.
- 'Usage of variables like C("{{ inventory_hostname }}") in the filepath can be used to set up random passwords per host,
which simplifies password management in C("host_vars") variables.'
- A special case is using /dev/null as a path. The password lookup will generate a new random password each time,
but will not write it to /dev/null. This can be used when you need a password without storing it on the controller.
options:
_terms:
description:
- path to the file that stores/will store the passwords
required: True
encrypt:
description:
- Whether the user requests that this password is returned encrypted or in plain text.
- Note that the password is always stored as plain text.
- Encrypt also forces saving the salt value for idempotence.
type: boolean
default: True
chars:
version_added: "1.4"
description:
- Define comma separated list of names that compose a custom character set in the generated passwords.
- 'By default generated passwords contain a random mix of upper and lowercase ASCII letters, the numbers 0-9 and punctuation (". , : - _").'
- "They can be either parts of Python's string module attributes (ascii_letters,digits, etc) or are used literally ( :, -)."
- "To enter comma use two commas ',,' somewhere - preferably at the end. Quotes and double quotes are not supported."
type: string
length:
description: The length of the generated password.
default: 20
type: integer
notes:
- A great alternative to the password lookup plugin,
if you don't need to generate random passwords on a per-host basis,
would be to use Vault in playbooks.
Read the documentation there and consider using it first,
it will be more desirable for most applications.
- If the file already exists, no data will be written to it.
If the file has contents, those contents will be read in as the password.
Empty files cause the password to return as an empty string.
- 'As all lookups, this runs on the Ansible host as the user running the playbook, and "become" does not apply,
the target file must be readable by the playbook user, or, if it does not exist,
the playbook user must have sufficient privileges to create it.
(So, for example, attempts to write into areas such as /etc will fail unless the entire playbook is being run as root).'
"""
EXAMPLES = """
- name: create a mysql user with a random password
mysql_user:
name: "{{ client }}"
password: "{{ lookup('password', 'credentials/' + client + '/' + tier + '/' + role + '/mysqlpassword length=15') }}"
priv: "{{ client }}_{{ tier }}_{{ role }}.*:ALL"
- name: create a mysql user with a random password using only ascii letters
mysql_user: name={{ client }} password="{{ lookup('password', '/tmp/passwordfile chars=ascii_letters') }}" priv='{{ client }}_{{ tier }}_{{ role }}.*:ALL'
- name: create a mysql user with a random password using only digits
mysql_user:
name: "{{ client }}"
password: "{{ lookup('password', '/tmp/passwordfile chars=digits') }}"
priv: "{{ client }}_{{ tier }}_{{ role }}.*:ALL"
- name: create a mysql user with a random password using many different char sets
mysql_user:
name: "{{ client }}"
password: "{{ lookup('password', '/tmp/passwordfile chars=ascii_letters,digits,hexdigits,punctuation') }}"
priv: "{{ client }}_{{ tier }}_{{ role }}.*:ALL"
"""
RETURN = """
_raw:
description:
- a password
"""
import os
import string
from ansible.errors import AnsibleError, AnsibleAssertionError
from ansible.module_utils._text import to_bytes, to_native, to_text
from ansible.parsing.splitter import parse_kv
from ansible.plugins.lookup import LookupBase
from ansible.utils.encrypt import do_encrypt, random_password
from ansible.utils.path import makedirs_safe
DEFAULT_LENGTH = 20
VALID_PARAMS = frozenset(('length', 'encrypt', 'chars'))
def _parse_parameters(term):
"""Hacky parsing of params
See https://github.com/ansible/ansible-modules-core/issues/1968#issuecomment-136842156
and the first_found lookup For how we want to fix this later
"""
first_split = term.split(' ', 1)
if len(first_split) <= 1:
# Only a single argument given, therefore it's a path
relpath = term
params = dict()
else:
relpath = first_split[0]
params = parse_kv(first_split[1])
if '_raw_params' in params:
# Spaces in the path?
relpath = u' '.join((relpath, params['_raw_params']))
del params['_raw_params']
# Check that we parsed the params correctly
if not term.startswith(relpath):
# Likely, the user had a non parameter following a parameter.
# Reject this as a user typo
raise AnsibleError('Unrecognized value after key=value parameters given to password lookup')
# No _raw_params means we already found the complete path when
# we split it initially
# Check for invalid parameters. Probably a user typo
invalid_params = frozenset(params.keys()).difference(VALID_PARAMS)
if invalid_params:
raise AnsibleError('Unrecognized parameter(s) given to password lookup: %s' % ', '.join(invalid_params))
# Set defaults
params['length'] = int(params.get('length', DEFAULT_LENGTH))
params['encrypt'] = params.get('encrypt', None)
params['chars'] = params.get('chars', None)
if params['chars']:
tmp_chars = []
if u',,' in params['chars']:
tmp_chars.append(u',')
tmp_chars.extend(c for c in params['chars'].replace(u',,', u',').split(u',') if c)
params['chars'] = tmp_chars
else:
# Default chars for password
params['chars'] = [u'ascii_letters', u'digits', u".,:-_"]
return relpath, params
def _read_password_file(b_path):
"""Read the contents of a password file and return it
:arg b_path: A byte string containing the path to the password file
:returns: a text string containing the contents of the password file or
None if no password file was present.
"""
content = None
if os.path.exists(b_path):
with open(b_path, 'rb') as f:
b_content = f.read().rstrip()
content = to_text(b_content, errors='surrogate_or_strict')
return content
def _gen_candidate_chars(characters):
'''Generate a string containing all valid chars as defined by ``characters``
:arg characters: A list of character specs. The character specs are
shorthand names for sets of characters like 'digits', 'ascii_letters',
or 'punctuation' or a string to be included verbatim.
The values of each char spec can be:
* a name of an attribute in the 'strings' module ('digits' for example).
The value of the attribute will be added to the candidate chars.
* a string of characters. If the string isn't an attribute in 'string'
module, the string will be directly added to the candidate chars.
For example::
characters=['digits', '?|']``
will match ``string.digits`` and add all ascii digits. ``'?|'`` will add
the question mark and pipe characters directly. Return will be the string::
u'0123456789?|'
'''
chars = []
for chars_spec in characters:
# getattr from string expands things like "ascii_letters" and "digits"
# into a set of characters.
chars.append(to_text(getattr(string, to_native(chars_spec), chars_spec),
errors='strict'))
chars = u''.join(chars).replace(u'"', u'').replace(u"'", u'')
return chars
def _random_salt():
"""Return a text string suitable for use as a salt for the hash functions we use to encrypt passwords.
"""
# Note passlib salt values must be pure ascii so we can't let the user
# configure this
salt_chars = _gen_candidate_chars(['ascii_letters', 'digits', './'])
return random_password(length=8, chars=salt_chars)
def _parse_content(content):
'''parse our password data format into password and salt
:arg content: The data read from the file
:returns: password and salt
'''
password = content
salt = None
salt_slug = u' salt='
try:
sep = content.rindex(salt_slug)
except ValueError:
# No salt
pass
else:
salt = password[sep + len(salt_slug):]
password = content[:sep]
return password, salt
def _format_content(password, salt, encrypt=True):
"""Format the password and salt for saving
:arg password: the plaintext password to save
:arg salt: the salt to use when encrypting a password
:arg encrypt: Whether the user requests that this password is encrypted.
Note that the password is saved in clear. Encrypt just tells us if we
must save the salt value for idempotence. Defaults to True.
:returns: a text string containing the formatted information
.. warning:: Passwords are saved in clear. This is because the playbooks
expect to get cleartext passwords from this lookup.
"""
if not encrypt and not salt:
return password
# At this point, the calling code should have assured us that there is a salt value.
if not salt:
raise AnsibleAssertionError('_format_content was called with encryption requested but no salt value')
return u'%s salt=%s' % (password, salt)
def _write_password_file(b_path, content):
b_pathdir = os.path.dirname(b_path)
makedirs_safe(b_pathdir, mode=0o700)
with open(b_path, 'wb') as f:
os.chmod(b_path, 0o600)
b_content = to_bytes(content, errors='surrogate_or_strict') + b'\n'
f.write(b_content)
class LookupModule(LookupBase):
def run(self, terms, variables, **kwargs):
ret = []
for term in terms:
relpath, params = _parse_parameters(term)
path = self._loader.path_dwim(relpath)
b_path = to_bytes(path, errors='surrogate_or_strict')
chars = _gen_candidate_chars(params['chars'])
changed = False
content = _read_password_file(b_path)
if content is None or b_path == to_bytes('/dev/null'):
plaintext_password = random_password(params['length'], chars)
salt = None
changed = True
else:
plaintext_password, salt = _parse_content(content)
if params['encrypt'] and not salt:
changed = True
salt = _random_salt()
if changed and b_path != to_bytes('/dev/null'):
content = _format_content(plaintext_password, salt, encrypt=params['encrypt'])
_write_password_file(b_path, content)
if params['encrypt']:
password = do_encrypt(plaintext_password, params['encrypt'], salt=salt)
ret.append(password)
else:
ret.append(plaintext_password)
return ret
|
gpl-3.0
|
[
3,
334,
67,
9,
6029,
12,
24747,
14769,
869,
745,
7351,
3107,
1151,
322,
385,
265,
665,
24863,
14769,
32,
526,
90,
645,
14,
957,
30,
199,
3,
334,
67,
9,
6171,
12,
1603,
7194,
281,
6855,
271,
20936,
665,
3387,
26645,
32,
2425,
271,
20936,
14,
957,
30,
199,
3,
334,
67,
9,
6171,
12,
10162,
75,
352,
3930,
11552,
665,
77,
573,
11552,
32,
7625,
89,
345,
17841,
14,
957,
30,
199,
3,
334,
67,
9,
9708,
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,
504,
636,
2443,
363,
492,
334,
6116,
63,
646,
12,
4629,
12,
870,
63,
1593,
9,
199,
363,
6577,
363,
275,
730,
199,
199,
8948,
275,
408,
272,
4237,
26,
2505,
272,
1015,
63,
3270,
26,
298,
17,
14,
17,
2,
272,
4132,
26,
489,
446,
24747,
14769,
869,
745,
7351,
3107,
1151,
322,
385,
265,
665,
24863,
14769,
32,
526,
90,
645,
14,
957,
30,
489,
446,
1603,
7194,
281,
6855,
271,
20936,
665,
3387,
26645,
32,
2425,
271,
20936,
14,
957,
30,
489,
446,
10162,
75,
352,
3930,
11552,
665,
77,
573,
11552,
32,
7625,
89,
345,
17841,
14,
957,
30,
272,
3974,
63,
1802,
26,
8044,
503,
3550,
282,
2196,
2505,
12,
5489,
315,
282,
570,
272,
1369,
26,
489,
446,
21687,
282,
2196,
18577,
2505,
436,
14086,
652,
315,
282,
570,
737,
282,
1627,
9911,
14,
489,
446,
982,
314,
570,
3495,
10889,
12,
652,
911,
8044,
2399,
4072,
12,
15179,
5519,
2951,
2839,
543,
63,
493,
14,
489,
446,
283,
7692,
402,
2860,
2839,
445,
480,
3638,
8200,
63,
4269,
3586,
531,
315,
314,
9911,
883,
506,
1202,
370,
663,
1536,
2196,
19572,
1126,
1591,
12,
267,
1314,
17553,
5604,
2505,
10041,
315,
445,
480,
1102,
63,
2936,
531,
2860,
3530,
489,
446,
437,
4539,
1930,
365,
1808,
1182,
2374,
15,
2307,
465,
282,
931,
14,
710,
2505,
4237,
911,
3550,
282,
892,
2196,
2505,
1924,
900,
12,
267,
1325,
911,
440,
2218,
652,
370,
1182,
2374,
15,
2307,
14,
961,
883,
506,
1202,
1380,
1265,
1929,
282,
2505,
1928,
16915,
652,
641,
314,
7614,
14,
272,
1511,
26,
489,
485,
9187,
26,
268,
1369,
26,
1779,
446,
931,
370,
314,
570,
626,
14086,
15,
14117,
3877,
314,
19572,
268,
1415,
26,
715,
489,
14645,
26,
267,
1369,
26,
1779,
446,
7480,
314,
922,
4145,
626,
642,
2505,
365,
2138,
14862,
503,
315,
8971,
1318,
14,
1779,
446,
3390,
626,
314,
2505,
365,
3544,
5489,
465,
8971,
1318,
14,
1779,
446,
3447,
4997,
2597,
25983,
13369,
314,
10105,
574,
367,
9979,
9613,
6692,
14,
267,
730,
26,
5046,
267,
849,
26,
715,
489,
8365,
26,
267,
1015,
63,
3270,
26,
298,
17,
14,
20,
2,
267,
1369,
26,
881,
446,
13930,
10029,
11673,
769,
402,
1561,
626,
23366,
282,
3537,
4528,
663,
315,
314,
4046,
19572,
14,
881,
446,
283,
2175,
849,
4046,
19572,
1395,
282,
2196,
13667,
402,
7008,
436,
12141,
10485,
14435,
12,
314,
5579,
378,
13,
25,
436,
22929,
334,
1674,
2360,
520,
446,
485,
3471,
7,
881,
446,
298,
1918,
89,
883,
506,
1902,
4184,
402,
2018,
1159,
1059,
859,
3004,
334,
4371,
63,
16415,
12,
7022,
12,
5423,
9,
503,
787,
1202,
7142,
1183,
334,
13785,
446,
17617,
881,
446,
298,
1378,
9509,
10029,
675,
2877,
24476,
1656,
2584,
23430,
446,
16602,
6665,
737,
314,
1284,
14,
5843,
6510,
436,
4270,
9344,
787,
440,
3748,
2122,
267,
730,
26,
1059,
489,
2582,
26,
267,
1369,
26,
710,
2582,
402,
314,
4046,
2505,
14,
267,
849,
26,
3388,
267,
730,
26,
3000,
272,
12681,
26,
489,
446,
437,
27254,
13943,
370,
314,
2505,
4237,
3589,
12,
267,
340,
1265,
2793,
1133,
1929,
370,
3550,
2196,
19572,
641,
282,
1126,
13,
1102,
5597,
12,
267,
3955,
506,
370,
675,
812,
558,
315,
5232,
8858,
14,
267,
5574,
314,
3794,
2337,
436,
11201,
1808,
652,
1642,
12,
267,
652,
911,
506,
1655,
477,
338,
6842,
367,
4750,
13103,
14,
489,
446,
982,
314,
570,
2575,
3495,
12,
949,
666,
911,
506,
5313,
370,
652,
14,
267,
982,
314,
570,
965,
4072,
12,
5204,
4072,
911,
506,
1586,
315,
465,
314,
2505,
14,
267,
9630,
1584,
7675,
314,
2505,
370,
372,
465,
376,
2701,
1059,
14,
489,
446,
283,
2822,
1006,
16807,
12,
642,
7858,
641,
314,
2622,
1591,
465,
314,
922,
3879,
314,
15695,
12,
436,
298,
13970,
2,
1630,
440,
4838,
12,
267,
314,
1347,
570,
1471,
506,
12701,
701,
314,
15695,
922,
12,
503,
12,
340,
652,
1630,
440,
2187,
12,
267,
314,
15695,
922,
1471,
1172,
19258,
20001,
370,
1218,
652,
14,
267,
334,
5158,
12,
367,
2893,
12,
12454,
370,
2218,
1901,
787,
305,
4066,
465,
1182,
6839,
911,
2449,
7444,
314,
8039,
15695,
365,
3769,
1255,
465,
1738,
28823,
199,
624,
199,
199,
8918,
275,
408,
199,
13,
536,
26,
1218,
282,
12896,
922,
543,
282,
2196,
2505,
523,
12896,
63,
751,
26,
272,
536,
26,
7370,
1890,
7820,
272,
2505,
26,
7370,
4237,
360,
2060,
297,
283,
6942,
4805,
435,
1890,
435,
7324,
435,
31800,
435,
7324,
435,
4719,
435,
1994,
8644,
2060,
2582,
29,
1046,
358,
7820,
272,
16254,
26,
7370,
1890,
3586,
63,
3638,
31800,
3586,
63,
3638,
4719,
3586,
2795,
26,
1761,
2,
199,
199,
13,
536,
26,
1218,
282,
12896,
922,
543,
282,
2196,
2505,
1808,
1454,
13294,
14435,
523,
12896,
63,
751,
26,
536,
3126,
91,
1890,
3586,
2505,
628,
3638,
4237,
360,
2060,
297,
1994,
2791,
15,
2060,
493,
8365,
29,
4371,
63,
16415,
358,
7820,
16254,
534,
3638,
1890,
3586,
63,
3638,
31800,
3586,
63,
3638,
4719,
3586,
2795,
26,
1761,
7,
199,
199,
13,
536,
26,
1218,
282,
12896,
922,
543,
282,
2196,
2505,
1808,
1454,
7576,
523,
12896,
63,
751,
26,
272,
536,
26,
7370,
1890,
7820,
272,
2505,
26,
7370,
4237,
360,
2060,
297,
1994,
2791,
15,
2060,
493,
8365,
29,
7022,
358,
7820,
272,
16254,
26,
7370,
1890,
3586,
63,
3638,
31800,
3586,
63,
3638,
4719,
3586,
2795,
26,
1761,
2,
199,
199,
13,
536
] |
[
334,
67,
9,
6029,
12,
24747,
14769,
869,
745,
7351,
3107,
1151,
322,
385,
265,
665,
24863,
14769,
32,
526,
90,
645,
14,
957,
30,
199,
3,
334,
67,
9,
6171,
12,
1603,
7194,
281,
6855,
271,
20936,
665,
3387,
26645,
32,
2425,
271,
20936,
14,
957,
30,
199,
3,
334,
67,
9,
6171,
12,
10162,
75,
352,
3930,
11552,
665,
77,
573,
11552,
32,
7625,
89,
345,
17841,
14,
957,
30,
199,
3,
334,
67,
9,
9708,
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,
504,
636,
2443,
363,
492,
334,
6116,
63,
646,
12,
4629,
12,
870,
63,
1593,
9,
199,
363,
6577,
363,
275,
730,
199,
199,
8948,
275,
408,
272,
4237,
26,
2505,
272,
1015,
63,
3270,
26,
298,
17,
14,
17,
2,
272,
4132,
26,
489,
446,
24747,
14769,
869,
745,
7351,
3107,
1151,
322,
385,
265,
665,
24863,
14769,
32,
526,
90,
645,
14,
957,
30,
489,
446,
1603,
7194,
281,
6855,
271,
20936,
665,
3387,
26645,
32,
2425,
271,
20936,
14,
957,
30,
489,
446,
10162,
75,
352,
3930,
11552,
665,
77,
573,
11552,
32,
7625,
89,
345,
17841,
14,
957,
30,
272,
3974,
63,
1802,
26,
8044,
503,
3550,
282,
2196,
2505,
12,
5489,
315,
282,
570,
272,
1369,
26,
489,
446,
21687,
282,
2196,
18577,
2505,
436,
14086,
652,
315,
282,
570,
737,
282,
1627,
9911,
14,
489,
446,
982,
314,
570,
3495,
10889,
12,
652,
911,
8044,
2399,
4072,
12,
15179,
5519,
2951,
2839,
543,
63,
493,
14,
489,
446,
283,
7692,
402,
2860,
2839,
445,
480,
3638,
8200,
63,
4269,
3586,
531,
315,
314,
9911,
883,
506,
1202,
370,
663,
1536,
2196,
19572,
1126,
1591,
12,
267,
1314,
17553,
5604,
2505,
10041,
315,
445,
480,
1102,
63,
2936,
531,
2860,
3530,
489,
446,
437,
4539,
1930,
365,
1808,
1182,
2374,
15,
2307,
465,
282,
931,
14,
710,
2505,
4237,
911,
3550,
282,
892,
2196,
2505,
1924,
900,
12,
267,
1325,
911,
440,
2218,
652,
370,
1182,
2374,
15,
2307,
14,
961,
883,
506,
1202,
1380,
1265,
1929,
282,
2505,
1928,
16915,
652,
641,
314,
7614,
14,
272,
1511,
26,
489,
485,
9187,
26,
268,
1369,
26,
1779,
446,
931,
370,
314,
570,
626,
14086,
15,
14117,
3877,
314,
19572,
268,
1415,
26,
715,
489,
14645,
26,
267,
1369,
26,
1779,
446,
7480,
314,
922,
4145,
626,
642,
2505,
365,
2138,
14862,
503,
315,
8971,
1318,
14,
1779,
446,
3390,
626,
314,
2505,
365,
3544,
5489,
465,
8971,
1318,
14,
1779,
446,
3447,
4997,
2597,
25983,
13369,
314,
10105,
574,
367,
9979,
9613,
6692,
14,
267,
730,
26,
5046,
267,
849,
26,
715,
489,
8365,
26,
267,
1015,
63,
3270,
26,
298,
17,
14,
20,
2,
267,
1369,
26,
881,
446,
13930,
10029,
11673,
769,
402,
1561,
626,
23366,
282,
3537,
4528,
663,
315,
314,
4046,
19572,
14,
881,
446,
283,
2175,
849,
4046,
19572,
1395,
282,
2196,
13667,
402,
7008,
436,
12141,
10485,
14435,
12,
314,
5579,
378,
13,
25,
436,
22929,
334,
1674,
2360,
520,
446,
485,
3471,
7,
881,
446,
298,
1918,
89,
883,
506,
1902,
4184,
402,
2018,
1159,
1059,
859,
3004,
334,
4371,
63,
16415,
12,
7022,
12,
5423,
9,
503,
787,
1202,
7142,
1183,
334,
13785,
446,
17617,
881,
446,
298,
1378,
9509,
10029,
675,
2877,
24476,
1656,
2584,
23430,
446,
16602,
6665,
737,
314,
1284,
14,
5843,
6510,
436,
4270,
9344,
787,
440,
3748,
2122,
267,
730,
26,
1059,
489,
2582,
26,
267,
1369,
26,
710,
2582,
402,
314,
4046,
2505,
14,
267,
849,
26,
3388,
267,
730,
26,
3000,
272,
12681,
26,
489,
446,
437,
27254,
13943,
370,
314,
2505,
4237,
3589,
12,
267,
340,
1265,
2793,
1133,
1929,
370,
3550,
2196,
19572,
641,
282,
1126,
13,
1102,
5597,
12,
267,
3955,
506,
370,
675,
812,
558,
315,
5232,
8858,
14,
267,
5574,
314,
3794,
2337,
436,
11201,
1808,
652,
1642,
12,
267,
652,
911,
506,
1655,
477,
338,
6842,
367,
4750,
13103,
14,
489,
446,
982,
314,
570,
2575,
3495,
12,
949,
666,
911,
506,
5313,
370,
652,
14,
267,
982,
314,
570,
965,
4072,
12,
5204,
4072,
911,
506,
1586,
315,
465,
314,
2505,
14,
267,
9630,
1584,
7675,
314,
2505,
370,
372,
465,
376,
2701,
1059,
14,
489,
446,
283,
2822,
1006,
16807,
12,
642,
7858,
641,
314,
2622,
1591,
465,
314,
922,
3879,
314,
15695,
12,
436,
298,
13970,
2,
1630,
440,
4838,
12,
267,
314,
1347,
570,
1471,
506,
12701,
701,
314,
15695,
922,
12,
503,
12,
340,
652,
1630,
440,
2187,
12,
267,
314,
15695,
922,
1471,
1172,
19258,
20001,
370,
1218,
652,
14,
267,
334,
5158,
12,
367,
2893,
12,
12454,
370,
2218,
1901,
787,
305,
4066,
465,
1182,
6839,
911,
2449,
7444,
314,
8039,
15695,
365,
3769,
1255,
465,
1738,
28823,
199,
624,
199,
199,
8918,
275,
408,
199,
13,
536,
26,
1218,
282,
12896,
922,
543,
282,
2196,
2505,
523,
12896,
63,
751,
26,
272,
536,
26,
7370,
1890,
7820,
272,
2505,
26,
7370,
4237,
360,
2060,
297,
283,
6942,
4805,
435,
1890,
435,
7324,
435,
31800,
435,
7324,
435,
4719,
435,
1994,
8644,
2060,
2582,
29,
1046,
358,
7820,
272,
16254,
26,
7370,
1890,
3586,
63,
3638,
31800,
3586,
63,
3638,
4719,
3586,
2795,
26,
1761,
2,
199,
199,
13,
536,
26,
1218,
282,
12896,
922,
543,
282,
2196,
2505,
1808,
1454,
13294,
14435,
523,
12896,
63,
751,
26,
536,
3126,
91,
1890,
3586,
2505,
628,
3638,
4237,
360,
2060,
297,
1994,
2791,
15,
2060,
493,
8365,
29,
4371,
63,
16415,
358,
7820,
16254,
534,
3638,
1890,
3586,
63,
3638,
31800,
3586,
63,
3638,
4719,
3586,
2795,
26,
1761,
7,
199,
199,
13,
536,
26,
1218,
282,
12896,
922,
543,
282,
2196,
2505,
1808,
1454,
7576,
523,
12896,
63,
751,
26,
272,
536,
26,
7370,
1890,
7820,
272,
2505,
26,
7370,
4237,
360,
2060,
297,
1994,
2791,
15,
2060,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
apocquet/django
|
django/utils/ipv6.py
|
225
|
7971
|
# This code was mostly based on ipaddr-py
# Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/
# Licensed under the Apache License, Version 2.0 (the "License").
from django.core.exceptions import ValidationError
from django.utils.six.moves import range
from django.utils.translation import ugettext_lazy as _
def clean_ipv6_address(ip_str, unpack_ipv4=False,
error_message=_("This is not a valid IPv6 address.")):
"""
Cleans an IPv6 address string.
Validity is checked by calling is_valid_ipv6_address() - if an
invalid address is passed, ValidationError is raised.
Replaces the longest continuous zero-sequence with "::" and
removes leading zeroes and makes sure all hextets are lowercase.
Args:
ip_str: A valid IPv6 address.
unpack_ipv4: if an IPv4-mapped address is found,
return the plain IPv4 address (default=False).
error_message: An error message used in the ValidationError.
Returns:
A compressed IPv6 address, or the same value
"""
best_doublecolon_start = -1
best_doublecolon_len = 0
doublecolon_start = -1
doublecolon_len = 0
if not is_valid_ipv6_address(ip_str):
raise ValidationError(error_message, code='invalid')
# This algorithm can only handle fully exploded
# IP strings
ip_str = _explode_shorthand_ip_string(ip_str)
ip_str = _sanitize_ipv4_mapping(ip_str)
# If needed, unpack the IPv4 and return straight away
# - no need in running the rest of the algorithm
if unpack_ipv4:
ipv4_unpacked = _unpack_ipv4(ip_str)
if ipv4_unpacked:
return ipv4_unpacked
hextets = ip_str.split(":")
for index in range(len(hextets)):
# Remove leading zeroes
hextets[index] = hextets[index].lstrip('0')
if not hextets[index]:
hextets[index] = '0'
# Determine best hextet to compress
if hextets[index] == '0':
doublecolon_len += 1
if doublecolon_start == -1:
# Start of a sequence of zeros.
doublecolon_start = index
if doublecolon_len > best_doublecolon_len:
# This is the longest sequence of zeros so far.
best_doublecolon_len = doublecolon_len
best_doublecolon_start = doublecolon_start
else:
doublecolon_len = 0
doublecolon_start = -1
# Compress the most suitable hextet
if best_doublecolon_len > 1:
best_doublecolon_end = (best_doublecolon_start +
best_doublecolon_len)
# For zeros at the end of the address.
if best_doublecolon_end == len(hextets):
hextets += ['']
hextets[best_doublecolon_start:best_doublecolon_end] = ['']
# For zeros at the beginning of the address.
if best_doublecolon_start == 0:
hextets = [''] + hextets
result = ":".join(hextets)
return result.lower()
def _sanitize_ipv4_mapping(ip_str):
"""
Sanitize IPv4 mapping in an expanded IPv6 address.
This converts ::ffff:0a0a:0a0a to ::ffff:10.10.10.10.
If there is nothing to sanitize, returns an unchanged
string.
Args:
ip_str: A string, the expanded IPv6 address.
Returns:
The sanitized output string, if applicable.
"""
if not ip_str.lower().startswith('0000:0000:0000:0000:0000:ffff:'):
# not an ipv4 mapping
return ip_str
hextets = ip_str.split(':')
if '.' in hextets[-1]:
# already sanitized
return ip_str
ipv4_address = "%d.%d.%d.%d" % (
int(hextets[6][0:2], 16),
int(hextets[6][2:4], 16),
int(hextets[7][0:2], 16),
int(hextets[7][2:4], 16),
)
result = ':'.join(hextets[0:6])
result += ':' + ipv4_address
return result
def _unpack_ipv4(ip_str):
"""
Unpack an IPv4 address that was mapped in a compressed IPv6 address.
This converts 0000:0000:0000:0000:0000:ffff:10.10.10.10 to 10.10.10.10.
If there is nothing to sanitize, returns None.
Args:
ip_str: A string, the expanded IPv6 address.
Returns:
The unpacked IPv4 address, or None if there was nothing to unpack.
"""
if not ip_str.lower().startswith('0000:0000:0000:0000:0000:ffff:'):
return None
return ip_str.rsplit(':', 1)[1]
def is_valid_ipv6_address(ip_str):
"""
Ensure we have a valid IPv6 address.
Args:
ip_str: A string, the IPv6 address.
Returns:
A boolean, True if this is a valid IPv6 address.
"""
from django.core.validators import validate_ipv4_address
# We need to have at least one ':'.
if ':' not in ip_str:
return False
# We can only have one '::' shortener.
if ip_str.count('::') > 1:
return False
# '::' should be encompassed by start, digits or end.
if ':::' in ip_str:
return False
# A single colon can neither start nor end an address.
if ((ip_str.startswith(':') and not ip_str.startswith('::')) or
(ip_str.endswith(':') and not ip_str.endswith('::'))):
return False
# We can never have more than 7 ':' (1::2:3:4:5:6:7:8 is invalid)
if ip_str.count(':') > 7:
return False
# If we have no concatenation, we need to have 8 fields with 7 ':'.
if '::' not in ip_str and ip_str.count(':') != 7:
# We might have an IPv4 mapped address.
if ip_str.count('.') != 3:
return False
ip_str = _explode_shorthand_ip_string(ip_str)
# Now that we have that all squared away, let's check that each of the
# hextets are between 0x0 and 0xFFFF.
for hextet in ip_str.split(':'):
if hextet.count('.') == 3:
# If we have an IPv4 mapped address, the IPv4 portion has to
# be at the end of the IPv6 portion.
if not ip_str.split(':')[-1] == hextet:
return False
try:
validate_ipv4_address(hextet)
except ValidationError:
return False
else:
try:
# a value error here means that we got a bad hextet,
# something like 0xzzzz
if int(hextet, 16) < 0x0 or int(hextet, 16) > 0xFFFF:
return False
except ValueError:
return False
return True
def _explode_shorthand_ip_string(ip_str):
"""
Expand a shortened IPv6 address.
Args:
ip_str: A string, the IPv6 address.
Returns:
A string, the expanded IPv6 address.
"""
if not _is_shorthand_ip(ip_str):
# We've already got a longhand ip_str.
return ip_str
new_ip = []
hextet = ip_str.split('::')
# If there is a ::, we need to expand it with zeroes
# to get to 8 hextets - unless there is a dot in the last hextet,
# meaning we're doing v4-mapping
if '.' in ip_str.split(':')[-1]:
fill_to = 7
else:
fill_to = 8
if len(hextet) > 1:
sep = len(hextet[0].split(':')) + len(hextet[1].split(':'))
new_ip = hextet[0].split(':')
for __ in range(fill_to - sep):
new_ip.append('0000')
new_ip += hextet[1].split(':')
else:
new_ip = ip_str.split(':')
# Now need to make sure every hextet is 4 lower case characters.
# If a hextet is < 4 characters, we've got missing leading 0's.
ret_ip = []
for hextet in new_ip:
ret_ip.append(('0' * (4 - len(hextet)) + hextet).lower())
return ':'.join(ret_ip)
def _is_shorthand_ip(ip_str):
"""Determine if the address is shortened.
Args:
ip_str: A string, the IPv6 address.
Returns:
A boolean, True if the address is shortened.
"""
if ip_str.count('::') == 1:
return True
if any(len(x) < 4 for x in ip_str.split(':')):
return True
return False
|
bsd-3-clause
|
[
3,
961,
1233,
1990,
19762,
4079,
641,
21249,
13,
647,
199,
3,
1898,
10219,
4475,
3277,
14,
1455,
921,
600,
14,
3098,
14,
957,
15,
80,
15,
22623,
13,
647,
15,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3471,
199,
504,
1639,
14,
1018,
14,
3924,
492,
8505,
199,
504,
1639,
14,
1208,
14,
4174,
14,
4912,
492,
1425,
199,
504,
1639,
14,
1208,
14,
6893,
492,
10366,
63,
6395,
465,
485,
421,
199,
318,
3633,
63,
4774,
22,
63,
1562,
8,
711,
63,
495,
12,
7787,
63,
4774,
20,
29,
797,
12,
267,
1125,
63,
1188,
9384,
2765,
365,
440,
282,
1686,
6509,
22,
2287,
2685,
304,
272,
408,
272,
445,
274,
796,
376,
6509,
22,
2287,
1059,
14,
339,
26263,
12783,
365,
7923,
701,
6358,
365,
63,
1078,
63,
4774,
22,
63,
1562,
342,
446,
340,
376,
272,
3866,
2287,
365,
3032,
12,
8505,
365,
4915,
14,
339,
799,
10696,
314,
21303,
19922,
4697,
13,
4041,
543,
27472,
2,
436,
272,
14185,
9186,
4697,
397,
436,
7704,
3238,
1006,
6318,
16476,
787,
12141,
14,
339,
3033,
26,
267,
3384,
63,
495,
26,
437,
1686,
6509,
22,
2287,
14,
267,
7787,
63,
4774,
20,
26,
340,
376,
6509,
20,
13,
11663,
2287,
365,
1911,
12,
267,
372,
314,
8971,
6509,
20,
2287,
334,
885,
29,
797,
680,
267,
1125,
63,
1188,
26,
1626,
1125,
1245,
1202,
315,
314,
8505,
14,
339,
1803,
26,
267,
437,
12335,
6509,
22,
2287,
12,
503,
314,
2011,
574,
339,
408,
272,
5526,
63,
3157,
12167,
63,
928,
275,
446,
17,
272,
5526,
63,
3157,
12167,
63,
552,
275,
378,
272,
4270,
12167,
63,
928,
275,
446,
17,
272,
4270,
12167,
63,
552,
275,
378,
339,
340,
440,
365,
63,
1078,
63,
4774,
22,
63,
1562,
8,
711,
63,
495,
304,
267,
746,
8505,
8,
705,
63,
1188,
12,
1233,
534,
3197,
358,
339,
327,
961,
5563,
883,
1454,
2429,
9999,
15868,
770,
272,
327,
3531,
3326,
272,
3384,
63,
495,
275,
485,
16971,
271,
63,
609,
23999,
63,
711,
63,
875,
8,
711,
63,
495,
9,
339,
3384,
63,
495,
275,
485,
18177,
63,
4774,
20,
63,
4745,
8,
711,
63,
495,
9,
339,
327,
982,
4346,
12,
7787,
314,
6509,
20,
436,
372,
23669,
13437,
272,
327,
446,
949,
1929,
315,
3879,
314,
4618,
402,
314,
5563,
272,
340,
7787,
63,
4774,
20,
26,
267,
3278,
20,
63,
24497,
275,
485,
5301,
63,
4774,
20,
8,
711,
63,
495,
9,
398,
340,
3278,
20,
63,
24497,
26,
288,
372,
3278,
20,
63,
24497,
339,
6318,
16476,
275,
3384,
63,
495,
14,
1294,
20063,
339,
367,
1478,
315,
1425,
8,
552,
8,
4097,
16476,
2298,
267,
327,
5852,
9186,
4697,
397,
267,
6318,
16476,
59,
1080,
61,
275,
6318,
16476,
59,
1080,
1055,
10124,
360,
16,
358,
267,
340,
440,
6318,
16476,
59,
1080,
2189,
288,
6318,
16476,
59,
1080,
61,
275,
283,
16,
7,
398,
327,
14703,
5526,
6318,
10288,
370,
11029,
267,
340,
6318,
16476,
59,
1080,
61,
508,
283,
16,
356,
288,
4270,
12167,
63,
552,
847,
413,
288,
340,
4270,
12167,
63,
928,
508,
446,
17,
26,
355,
327,
7707,
402,
282,
3414,
402,
10136,
14,
355,
4270,
12167,
63,
928,
275,
1478,
288,
340,
4270,
12167,
63,
552,
690,
5526,
63,
3157,
12167,
63,
552,
26,
355,
327,
961,
365,
314,
21303,
3414,
402,
10136,
880,
12474,
14,
355,
5526,
63,
3157,
12167,
63,
552,
275,
4270,
12167,
63,
552,
355,
5526,
63,
3157,
12167,
63,
928,
275,
4270,
12167,
63,
928,
267,
587,
26,
288,
4270,
12167,
63,
552,
275,
378,
288,
4270,
12167,
63,
928,
275,
446,
17,
339,
327,
3599,
753,
314,
4750,
11233,
6318,
10288,
272,
340,
5526,
63,
3157,
12167,
63,
552,
690,
413,
26,
267,
5526,
63,
3157,
12167,
63,
500,
275,
334,
7010,
63,
3157,
12167,
63,
928,
435,
1816,
5526,
63,
3157,
12167,
63,
552,
9,
267,
327,
2104,
10136,
737,
314,
1284,
402,
314,
2287,
14,
267,
340,
5526,
63,
3157,
12167,
63,
500,
508,
822,
8,
4097,
16476,
304,
288,
6318,
16476,
847,
24506,
267,
6318,
16476,
59,
7010,
63,
3157,
12167,
63,
928,
26,
7010,
63,
3157,
12167,
63,
500,
61,
275,
24506,
267,
327,
2104,
10136,
737,
314,
9608,
402,
314,
2287,
14,
267,
340,
5526,
63,
3157,
12167,
63,
928,
508,
378,
26,
288,
6318,
16476,
275,
24506,
435,
6318,
16476,
339,
754,
275,
7244,
1674,
904,
8,
4097,
16476,
9,
339,
372,
754,
14,
2325,
342,
421,
199,
318,
485,
18177,
63,
4774,
20,
63,
4745,
8,
711,
63,
495,
304,
272,
408,
272,
428,
12531,
6509,
20,
4412,
315,
376,
11507,
6509,
22,
2287,
14,
339,
961,
15373,
3800,
4717,
26,
16,
65,
16,
65,
26,
16,
65,
16,
65,
370,
3800,
4717,
26,
709,
14,
709,
14,
709,
14,
709,
14,
272,
982,
2337,
365,
6548,
370,
21077,
12,
2529,
376,
14874,
272,
1059,
14,
339,
3033,
26,
267,
3384,
63,
495,
26,
437,
1059,
12,
314,
11507,
6509,
22,
2287,
14,
339,
1803,
26,
267,
710,
31734,
1072,
1059,
12,
340,
3964,
14,
272,
408,
272,
340,
440,
3384,
63,
495,
14,
2325,
1252,
2460,
360,
993,
26,
993,
26,
993,
26,
993,
26,
993,
26,
4717,
23117,
267,
327,
440,
376,
3278,
20,
4412,
267,
372,
3384,
63,
495,
339,
6318,
16476,
275,
3384,
63,
495,
14,
1294,
11633,
339,
340,
7815,
315,
6318,
16476,
1988,
17,
2189,
267,
327,
2575,
31734,
267,
372,
3384,
63,
495,
339,
3278,
20,
63,
1562,
275,
2071,
68,
4111,
68,
4111,
68,
4111,
68,
2,
450,
334,
267,
1109,
8,
4097,
16476,
59,
22,
1527,
16,
26,
18,
467,
3193,
395,
267,
1109,
8,
4097,
16476,
59,
22,
1527,
18,
26,
20,
467,
3193,
395,
267,
1109,
8,
4097,
16476,
59,
23,
1527,
16,
26,
18,
467,
3193,
395,
267,
1109,
8,
4097,
16476,
59,
23,
1527,
18,
26,
20,
467,
3193,
395,
272,
776,
339,
754,
275,
29010,
904,
8,
4097,
16476,
59,
16,
26,
22,
566,
272,
754,
847,
10871,
435,
3278,
20,
63,
1562,
339,
372,
754,
421,
199,
318,
485,
5301,
63,
4774,
20
] |
[
961,
1233,
1990,
19762,
4079,
641,
21249,
13,
647,
199,
3,
1898,
10219,
4475,
3277,
14,
1455,
921,
600,
14,
3098,
14,
957,
15,
80,
15,
22623,
13,
647,
15,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
298,
3761,
3471,
199,
504,
1639,
14,
1018,
14,
3924,
492,
8505,
199,
504,
1639,
14,
1208,
14,
4174,
14,
4912,
492,
1425,
199,
504,
1639,
14,
1208,
14,
6893,
492,
10366,
63,
6395,
465,
485,
421,
199,
318,
3633,
63,
4774,
22,
63,
1562,
8,
711,
63,
495,
12,
7787,
63,
4774,
20,
29,
797,
12,
267,
1125,
63,
1188,
9384,
2765,
365,
440,
282,
1686,
6509,
22,
2287,
2685,
304,
272,
408,
272,
445,
274,
796,
376,
6509,
22,
2287,
1059,
14,
339,
26263,
12783,
365,
7923,
701,
6358,
365,
63,
1078,
63,
4774,
22,
63,
1562,
342,
446,
340,
376,
272,
3866,
2287,
365,
3032,
12,
8505,
365,
4915,
14,
339,
799,
10696,
314,
21303,
19922,
4697,
13,
4041,
543,
27472,
2,
436,
272,
14185,
9186,
4697,
397,
436,
7704,
3238,
1006,
6318,
16476,
787,
12141,
14,
339,
3033,
26,
267,
3384,
63,
495,
26,
437,
1686,
6509,
22,
2287,
14,
267,
7787,
63,
4774,
20,
26,
340,
376,
6509,
20,
13,
11663,
2287,
365,
1911,
12,
267,
372,
314,
8971,
6509,
20,
2287,
334,
885,
29,
797,
680,
267,
1125,
63,
1188,
26,
1626,
1125,
1245,
1202,
315,
314,
8505,
14,
339,
1803,
26,
267,
437,
12335,
6509,
22,
2287,
12,
503,
314,
2011,
574,
339,
408,
272,
5526,
63,
3157,
12167,
63,
928,
275,
446,
17,
272,
5526,
63,
3157,
12167,
63,
552,
275,
378,
272,
4270,
12167,
63,
928,
275,
446,
17,
272,
4270,
12167,
63,
552,
275,
378,
339,
340,
440,
365,
63,
1078,
63,
4774,
22,
63,
1562,
8,
711,
63,
495,
304,
267,
746,
8505,
8,
705,
63,
1188,
12,
1233,
534,
3197,
358,
339,
327,
961,
5563,
883,
1454,
2429,
9999,
15868,
770,
272,
327,
3531,
3326,
272,
3384,
63,
495,
275,
485,
16971,
271,
63,
609,
23999,
63,
711,
63,
875,
8,
711,
63,
495,
9,
339,
3384,
63,
495,
275,
485,
18177,
63,
4774,
20,
63,
4745,
8,
711,
63,
495,
9,
339,
327,
982,
4346,
12,
7787,
314,
6509,
20,
436,
372,
23669,
13437,
272,
327,
446,
949,
1929,
315,
3879,
314,
4618,
402,
314,
5563,
272,
340,
7787,
63,
4774,
20,
26,
267,
3278,
20,
63,
24497,
275,
485,
5301,
63,
4774,
20,
8,
711,
63,
495,
9,
398,
340,
3278,
20,
63,
24497,
26,
288,
372,
3278,
20,
63,
24497,
339,
6318,
16476,
275,
3384,
63,
495,
14,
1294,
20063,
339,
367,
1478,
315,
1425,
8,
552,
8,
4097,
16476,
2298,
267,
327,
5852,
9186,
4697,
397,
267,
6318,
16476,
59,
1080,
61,
275,
6318,
16476,
59,
1080,
1055,
10124,
360,
16,
358,
267,
340,
440,
6318,
16476,
59,
1080,
2189,
288,
6318,
16476,
59,
1080,
61,
275,
283,
16,
7,
398,
327,
14703,
5526,
6318,
10288,
370,
11029,
267,
340,
6318,
16476,
59,
1080,
61,
508,
283,
16,
356,
288,
4270,
12167,
63,
552,
847,
413,
288,
340,
4270,
12167,
63,
928,
508,
446,
17,
26,
355,
327,
7707,
402,
282,
3414,
402,
10136,
14,
355,
4270,
12167,
63,
928,
275,
1478,
288,
340,
4270,
12167,
63,
552,
690,
5526,
63,
3157,
12167,
63,
552,
26,
355,
327,
961,
365,
314,
21303,
3414,
402,
10136,
880,
12474,
14,
355,
5526,
63,
3157,
12167,
63,
552,
275,
4270,
12167,
63,
552,
355,
5526,
63,
3157,
12167,
63,
928,
275,
4270,
12167,
63,
928,
267,
587,
26,
288,
4270,
12167,
63,
552,
275,
378,
288,
4270,
12167,
63,
928,
275,
446,
17,
339,
327,
3599,
753,
314,
4750,
11233,
6318,
10288,
272,
340,
5526,
63,
3157,
12167,
63,
552,
690,
413,
26,
267,
5526,
63,
3157,
12167,
63,
500,
275,
334,
7010,
63,
3157,
12167,
63,
928,
435,
1816,
5526,
63,
3157,
12167,
63,
552,
9,
267,
327,
2104,
10136,
737,
314,
1284,
402,
314,
2287,
14,
267,
340,
5526,
63,
3157,
12167,
63,
500,
508,
822,
8,
4097,
16476,
304,
288,
6318,
16476,
847,
24506,
267,
6318,
16476,
59,
7010,
63,
3157,
12167,
63,
928,
26,
7010,
63,
3157,
12167,
63,
500,
61,
275,
24506,
267,
327,
2104,
10136,
737,
314,
9608,
402,
314,
2287,
14,
267,
340,
5526,
63,
3157,
12167,
63,
928,
508,
378,
26,
288,
6318,
16476,
275,
24506,
435,
6318,
16476,
339,
754,
275,
7244,
1674,
904,
8,
4097,
16476,
9,
339,
372,
754,
14,
2325,
342,
421,
199,
318,
485,
18177,
63,
4774,
20,
63,
4745,
8,
711,
63,
495,
304,
272,
408,
272,
428,
12531,
6509,
20,
4412,
315,
376,
11507,
6509,
22,
2287,
14,
339,
961,
15373,
3800,
4717,
26,
16,
65,
16,
65,
26,
16,
65,
16,
65,
370,
3800,
4717,
26,
709,
14,
709,
14,
709,
14,
709,
14,
272,
982,
2337,
365,
6548,
370,
21077,
12,
2529,
376,
14874,
272,
1059,
14,
339,
3033,
26,
267,
3384,
63,
495,
26,
437,
1059,
12,
314,
11507,
6509,
22,
2287,
14,
339,
1803,
26,
267,
710,
31734,
1072,
1059,
12,
340,
3964,
14,
272,
408,
272,
340,
440,
3384,
63,
495,
14,
2325,
1252,
2460,
360,
993,
26,
993,
26,
993,
26,
993,
26,
993,
26,
4717,
23117,
267,
327,
440,
376,
3278,
20,
4412,
267,
372,
3384,
63,
495,
339,
6318,
16476,
275,
3384,
63,
495,
14,
1294,
11633,
339,
340,
7815,
315,
6318,
16476,
1988,
17,
2189,
267,
327,
2575,
31734,
267,
372,
3384,
63,
495,
339,
3278,
20,
63,
1562,
275,
2071,
68,
4111,
68,
4111,
68,
4111,
68,
2,
450,
334,
267,
1109,
8,
4097,
16476,
59,
22,
1527,
16,
26,
18,
467,
3193,
395,
267,
1109,
8,
4097,
16476,
59,
22,
1527,
18,
26,
20,
467,
3193,
395,
267,
1109,
8,
4097,
16476,
59,
23,
1527,
16,
26,
18,
467,
3193,
395,
267,
1109,
8,
4097,
16476,
59,
23,
1527,
18,
26,
20,
467,
3193,
395,
272,
776,
339,
754,
275,
29010,
904,
8,
4097,
16476,
59,
16,
26,
22,
566,
272,
754,
847,
10871,
435,
3278,
20,
63,
1562,
339,
372,
754,
421,
199,
318,
485,
5301,
63,
4774,
20,
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,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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
] |
openstates/openstates.org
|
dashboards/models.py
|
1
|
1807
|
from django.db import models
from openstates.data.models import LegislativeSession
class DataQualityReport(models.Model):
chamber = models.CharField(max_length=20)
session = models.ForeignKey(LegislativeSession, on_delete=models.CASCADE)
total_bills = models.PositiveIntegerField()
latest_bill_created_date = models.DateTimeField(null=True)
latest_action_date = models.DateTimeField(null=True)
earliest_action_date = models.DateTimeField(null=True)
average_sponsors_per_bill = models.PositiveIntegerField()
min_sponsors_per_bill = models.PositiveIntegerField()
max_sponsors_per_bill = models.PositiveIntegerField()
average_actions_per_bill = models.PositiveIntegerField()
min_actions_per_bill = models.PositiveIntegerField()
max_actions_per_bill = models.PositiveIntegerField()
average_votes_per_bill = models.PositiveIntegerField()
min_votes_per_bill = models.PositiveIntegerField()
max_votes_per_bill = models.PositiveIntegerField()
average_documents_per_bill = models.PositiveIntegerField()
min_documents_per_bill = models.PositiveIntegerField()
max_documents_per_bill = models.PositiveIntegerField()
average_versions_per_bill = models.PositiveIntegerField()
min_versions_per_bill = models.PositiveIntegerField()
max_versions_per_bill = models.PositiveIntegerField()
total_bills_no_sources = models.PositiveIntegerField()
total_votes_no_sources = models.PositiveIntegerField()
number_of_subjects_in_chamber = models.PositiveIntegerField()
number_of_bills_without_subjects = models.PositiveIntegerField()
total_bills_without_versions = models.PositiveIntegerField()
total_votes_without_voters = models.PositiveIntegerField()
total_votes_bad_counts = models.PositiveIntegerField()
|
mit
|
[
504,
1639,
14,
697,
492,
1709,
199,
504,
1551,
4981,
14,
576,
14,
992,
492,
7005,
5668,
3026,
4434,
421,
199,
533,
3918,
19436,
7457,
8,
992,
14,
1685,
304,
339,
682,
455,
605,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1165,
9,
272,
2351,
275,
1709,
14,
3190,
8,
2553,
5668,
3026,
4434,
12,
641,
63,
1807,
29,
992,
14,
10855,
9,
339,
3141,
63,
66,
15350,
275,
1709,
14,
8591,
342,
272,
8839,
63,
19815,
63,
3966,
63,
602,
275,
1709,
14,
4626,
8,
2307,
29,
549,
9,
272,
8839,
63,
1287,
63,
602,
275,
1709,
14,
4626,
8,
2307,
29,
549,
9,
272,
8413,
24951,
63,
1287,
63,
602,
275,
1709,
14,
4626,
8,
2307,
29,
549,
9,
339,
8095,
63,
83,
678,
83,
1384,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1748,
63,
83,
678,
83,
1384,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1390,
63,
83,
678,
83,
1384,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
339,
8095,
63,
3723,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1748,
63,
3723,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1390,
63,
3723,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
339,
8095,
63,
16660,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1748,
63,
16660,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1390,
63,
16660,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
339,
8095,
63,
12233,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1748,
63,
12233,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1390,
63,
12233,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
339,
8095,
63,
6234,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1748,
63,
6234,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1390,
63,
6234,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
339,
3141,
63,
66,
15350,
63,
889,
63,
4553,
275,
1709,
14,
8591,
342,
272,
3141,
63,
16660,
63,
889,
63,
4553,
275,
1709,
14,
8591,
342,
339,
1329,
63,
1618,
63,
25660,
63,
262,
63,
335,
455,
605,
275,
1709,
14,
8591,
342,
272,
1329,
63,
1618,
63,
66,
15350,
63,
7395,
63,
25660,
275,
1709,
14,
8591,
342,
339,
3141,
63,
66,
15350,
63,
7395,
63,
6234,
275,
1709,
14,
8591,
342,
339,
3141,
63,
16660,
63,
7395,
63,
2392,
878,
275,
1709,
14,
8591,
342,
272,
3141,
63,
16660,
63,
4087,
63,
6851,
275,
1709,
14,
8591,
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
] |
[
1639,
14,
697,
492,
1709,
199,
504,
1551,
4981,
14,
576,
14,
992,
492,
7005,
5668,
3026,
4434,
421,
199,
533,
3918,
19436,
7457,
8,
992,
14,
1685,
304,
339,
682,
455,
605,
275,
1709,
14,
2183,
8,
988,
63,
1267,
29,
1165,
9,
272,
2351,
275,
1709,
14,
3190,
8,
2553,
5668,
3026,
4434,
12,
641,
63,
1807,
29,
992,
14,
10855,
9,
339,
3141,
63,
66,
15350,
275,
1709,
14,
8591,
342,
272,
8839,
63,
19815,
63,
3966,
63,
602,
275,
1709,
14,
4626,
8,
2307,
29,
549,
9,
272,
8839,
63,
1287,
63,
602,
275,
1709,
14,
4626,
8,
2307,
29,
549,
9,
272,
8413,
24951,
63,
1287,
63,
602,
275,
1709,
14,
4626,
8,
2307,
29,
549,
9,
339,
8095,
63,
83,
678,
83,
1384,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1748,
63,
83,
678,
83,
1384,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1390,
63,
83,
678,
83,
1384,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
339,
8095,
63,
3723,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1748,
63,
3723,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1390,
63,
3723,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
339,
8095,
63,
16660,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1748,
63,
16660,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1390,
63,
16660,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
339,
8095,
63,
12233,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1748,
63,
12233,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1390,
63,
12233,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
339,
8095,
63,
6234,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1748,
63,
6234,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
272,
1390,
63,
6234,
63,
529,
63,
19815,
275,
1709,
14,
8591,
342,
339,
3141,
63,
66,
15350,
63,
889,
63,
4553,
275,
1709,
14,
8591,
342,
272,
3141,
63,
16660,
63,
889,
63,
4553,
275,
1709,
14,
8591,
342,
339,
1329,
63,
1618,
63,
25660,
63,
262,
63,
335,
455,
605,
275,
1709,
14,
8591,
342,
272,
1329,
63,
1618,
63,
66,
15350,
63,
7395,
63,
25660,
275,
1709,
14,
8591,
342,
339,
3141,
63,
66,
15350,
63,
7395,
63,
6234,
275,
1709,
14,
8591,
342,
339,
3141,
63,
16660,
63,
7395,
63,
2392,
878,
275,
1709,
14,
8591,
342,
272,
3141,
63,
16660,
63,
4087,
63,
6851,
275,
1709,
14,
8591,
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,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
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py
|
334
|
14776
|
from __future__ import unicode_literals
import hashlib
import json
import os
import posixpath
import re
from collections import OrderedDict
from django.conf import settings
from django.contrib.staticfiles.utils import check_settings, matches_patterns
from django.core.cache import (
InvalidCacheBackendError, cache as default_cache, caches,
)
from django.core.exceptions import ImproperlyConfigured
from django.core.files.base import ContentFile
from django.core.files.storage import FileSystemStorage, get_storage_class
from django.utils.encoding import force_bytes, force_text
from django.utils.functional import LazyObject
from django.utils.six.moves.urllib.parse import (
unquote, urldefrag, urlsplit, urlunsplit,
)
class StaticFilesStorage(FileSystemStorage):
"""
Standard file system storage for static files.
The defaults for ``location`` and ``base_url`` are
``STATIC_ROOT`` and ``STATIC_URL``.
"""
def __init__(self, location=None, base_url=None, *args, **kwargs):
if location is None:
location = settings.STATIC_ROOT
if base_url is None:
base_url = settings.STATIC_URL
check_settings(base_url)
super(StaticFilesStorage, self).__init__(location, base_url,
*args, **kwargs)
# FileSystemStorage fallbacks to MEDIA_ROOT when location
# is empty, so we restore the empty value.
if not location:
self.base_location = None
self.location = None
def path(self, name):
if not self.location:
raise ImproperlyConfigured("You're using the staticfiles app "
"without having set the STATIC_ROOT "
"setting to a filesystem path.")
return super(StaticFilesStorage, self).path(name)
class HashedFilesMixin(object):
default_template = """url("%s")"""
patterns = (
("*.css", (
r"""(url\(['"]{0,1}\s*(.*?)["']{0,1}\))""",
(r"""(@import\s*["']\s*(.*?)["'])""", """@import url("%s")"""),
)),
)
def __init__(self, *args, **kwargs):
super(HashedFilesMixin, self).__init__(*args, **kwargs)
self._patterns = OrderedDict()
self.hashed_files = {}
for extension, patterns in self.patterns:
for pattern in patterns:
if isinstance(pattern, (tuple, list)):
pattern, template = pattern
else:
template = self.default_template
compiled = re.compile(pattern, re.IGNORECASE)
self._patterns.setdefault(extension, []).append((compiled, template))
def file_hash(self, name, content=None):
"""
Returns a hash of the file with the given name and optional content.
"""
if content is None:
return None
md5 = hashlib.md5()
for chunk in content.chunks():
md5.update(chunk)
return md5.hexdigest()[:12]
def hashed_name(self, name, content=None):
parsed_name = urlsplit(unquote(name))
clean_name = parsed_name.path.strip()
opened = False
if content is None:
if not self.exists(clean_name):
raise ValueError("The file '%s' could not be found with %r." %
(clean_name, self))
try:
content = self.open(clean_name)
except IOError:
# Handle directory paths and fragments
return name
opened = True
try:
file_hash = self.file_hash(clean_name, content)
finally:
if opened:
content.close()
path, filename = os.path.split(clean_name)
root, ext = os.path.splitext(filename)
if file_hash is not None:
file_hash = ".%s" % file_hash
hashed_name = os.path.join(path, "%s%s%s" %
(root, file_hash, ext))
unparsed_name = list(parsed_name)
unparsed_name[2] = hashed_name
# Special casing for a @font-face hack, like url(myfont.eot?#iefix")
# http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax
if '?#' in name and not unparsed_name[3]:
unparsed_name[2] += '?'
return urlunsplit(unparsed_name)
def url(self, name, force=False):
"""
Returns the real URL in DEBUG mode.
"""
if settings.DEBUG and not force:
hashed_name, fragment = name, ''
else:
clean_name, fragment = urldefrag(name)
if urlsplit(clean_name).path.endswith('/'): # don't hash paths
hashed_name = name
else:
hashed_name = self.stored_name(clean_name)
final_url = super(HashedFilesMixin, self).url(hashed_name)
# Special casing for a @font-face hack, like url(myfont.eot?#iefix")
# http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax
query_fragment = '?#' in name # [sic!]
if fragment or query_fragment:
urlparts = list(urlsplit(final_url))
if fragment and not urlparts[4]:
urlparts[4] = fragment
if query_fragment and not urlparts[3]:
urlparts[2] += '?'
final_url = urlunsplit(urlparts)
return unquote(final_url)
def url_converter(self, name, template=None):
"""
Returns the custom URL converter for the given file name.
"""
if template is None:
template = self.default_template
def converter(matchobj):
"""
Converts the matched URL depending on the parent level (`..`)
and returns the normalized and hashed URL using the url method
of the storage.
"""
matched, url = matchobj.groups()
# Completely ignore http(s) prefixed URLs,
# fragments and data-uri URLs
if url.startswith(('#', 'http:', 'https:', 'data:', '//')):
return matched
name_parts = name.split(os.sep)
# Using posix normpath here to remove duplicates
url = posixpath.normpath(url)
url_parts = url.split('/')
parent_level, sub_level = url.count('..'), url.count('/')
if url.startswith('/'):
sub_level -= 1
url_parts = url_parts[1:]
if parent_level or not url.startswith('/'):
start, end = parent_level + 1, parent_level
else:
if sub_level:
if sub_level == 1:
parent_level -= 1
start, end = parent_level, 1
else:
start, end = 1, sub_level - 1
joined_result = '/'.join(name_parts[:-start] + url_parts[end:])
hashed_url = self.url(unquote(joined_result), force=True)
file_name = hashed_url.split('/')[-1:]
relative_url = '/'.join(url.split('/')[:-1] + file_name)
# Return the hashed version to the file
return template % unquote(relative_url)
return converter
def post_process(self, paths, dry_run=False, **options):
"""
Post process the given OrderedDict of files (called from collectstatic).
Processing is actually two separate operations:
1. renaming files to include a hash of their content for cache-busting,
and copying those files to the target storage.
2. adjusting files which contain references to other files so they
refer to the cache-busting filenames.
If either of these are performed on a file, then that file is considered
post-processed.
"""
# don't even dare to process the files if we're in dry run mode
if dry_run:
return
# where to store the new paths
hashed_files = OrderedDict()
# build a list of adjustable files
matches = lambda path: matches_patterns(path, self._patterns.keys())
adjustable_paths = [path for path in paths if matches(path)]
# then sort the files by the directory level
path_level = lambda name: len(name.split(os.sep))
for name in sorted(paths.keys(), key=path_level, reverse=True):
# use the original, local file, not the copied-but-unprocessed
# file, which might be somewhere far away, like S3
storage, path = paths[name]
with storage.open(path) as original_file:
# generate the hash with the original content, even for
# adjustable files.
hashed_name = self.hashed_name(name, original_file)
# then get the original's file content..
if hasattr(original_file, 'seek'):
original_file.seek(0)
hashed_file_exists = self.exists(hashed_name)
processed = False
# ..to apply each replacement pattern to the content
if name in adjustable_paths:
content = original_file.read().decode(settings.FILE_CHARSET)
for patterns in self._patterns.values():
for pattern, template in patterns:
converter = self.url_converter(name, template)
try:
content = pattern.sub(converter, content)
except ValueError as exc:
yield name, None, exc
if hashed_file_exists:
self.delete(hashed_name)
# then save the processed result
content_file = ContentFile(force_bytes(content))
saved_name = self._save(hashed_name, content_file)
hashed_name = force_text(self.clean_name(saved_name))
processed = True
else:
# or handle the case in which neither processing nor
# a change to the original file happened
if not hashed_file_exists:
processed = True
saved_name = self._save(hashed_name, original_file)
hashed_name = force_text(self.clean_name(saved_name))
# and then set the cache accordingly
hashed_files[self.hash_key(name)] = hashed_name
yield name, hashed_name, processed
# Finally store the processed paths
self.hashed_files.update(hashed_files)
def clean_name(self, name):
return name.replace('\\', '/')
def hash_key(self, name):
return name
def stored_name(self, name):
hash_key = self.hash_key(name)
cache_name = self.hashed_files.get(hash_key)
if cache_name is None:
cache_name = self.clean_name(self.hashed_name(name))
# store the hashed name if there was a miss, e.g.
# when the files are still processed
self.hashed_files[hash_key] = cache_name
return cache_name
class ManifestFilesMixin(HashedFilesMixin):
manifest_version = '1.0' # the manifest format standard
manifest_name = 'staticfiles.json'
def __init__(self, *args, **kwargs):
super(ManifestFilesMixin, self).__init__(*args, **kwargs)
self.hashed_files = self.load_manifest()
def read_manifest(self):
try:
with self.open(self.manifest_name) as manifest:
return manifest.read().decode('utf-8')
except IOError:
return None
def load_manifest(self):
content = self.read_manifest()
if content is None:
return OrderedDict()
try:
stored = json.loads(content, object_pairs_hook=OrderedDict)
except ValueError:
pass
else:
version = stored.get('version')
if version == '1.0':
return stored.get('paths', OrderedDict())
raise ValueError("Couldn't load manifest '%s' (version %s)" %
(self.manifest_name, self.manifest_version))
def post_process(self, *args, **kwargs):
self.hashed_files = OrderedDict()
all_post_processed = super(ManifestFilesMixin,
self).post_process(*args, **kwargs)
for post_processed in all_post_processed:
yield post_processed
self.save_manifest()
def save_manifest(self):
payload = {'paths': self.hashed_files, 'version': self.manifest_version}
if self.exists(self.manifest_name):
self.delete(self.manifest_name)
contents = json.dumps(payload).encode('utf-8')
self._save(self.manifest_name, ContentFile(contents))
class _MappingCache(object):
"""
A small dict-like wrapper for a given cache backend instance.
"""
def __init__(self, cache):
self.cache = cache
def __setitem__(self, key, value):
self.cache.set(key, value)
def __getitem__(self, key):
value = self.cache.get(key)
if value is None:
raise KeyError("Couldn't find a file name '%s'" % key)
return value
def clear(self):
self.cache.clear()
def update(self, data):
self.cache.set_many(data)
def get(self, key, default=None):
try:
return self[key]
except KeyError:
return default
class CachedFilesMixin(HashedFilesMixin):
def __init__(self, *args, **kwargs):
super(CachedFilesMixin, self).__init__(*args, **kwargs)
try:
self.hashed_files = _MappingCache(caches['staticfiles'])
except InvalidCacheBackendError:
# Use the default backend
self.hashed_files = _MappingCache(default_cache)
def hash_key(self, name):
key = hashlib.md5(force_bytes(self.clean_name(name))).hexdigest()
return 'staticfiles:%s' % key
class CachedStaticFilesStorage(CachedFilesMixin, StaticFilesStorage):
"""
A static file system storage backend which also saves
hashed copies of the files it saves.
"""
pass
class ManifestStaticFilesStorage(ManifestFilesMixin, StaticFilesStorage):
"""
A static file system storage backend which also saves
hashed copies of the files it saves.
"""
pass
class ConfiguredStorage(LazyObject):
def _setup(self):
self._wrapped = get_storage_class(settings.STATICFILES_STORAGE)()
staticfiles_storage = ConfiguredStorage()
|
bsd-3-clause
|
[
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
8337,
199,
646,
2022,
199,
646,
747,
199,
646,
15454,
199,
646,
295,
199,
504,
5055,
492,
8773,
199,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
2828,
14,
18373,
14,
1208,
492,
1104,
63,
1751,
12,
4450,
63,
7435,
199,
504,
1639,
14,
1018,
14,
1637,
492,
334,
272,
6378,
4437,
8447,
547,
12,
2581,
465,
849,
63,
1637,
12,
18014,
12,
199,
9,
199,
504,
1639,
14,
1018,
14,
3924,
492,
11897,
199,
504,
1639,
14,
1018,
14,
1725,
14,
1095,
492,
6646,
1173,
199,
504,
1639,
14,
1018,
14,
1725,
14,
3494,
492,
23754,
6408,
12,
664,
63,
3494,
63,
533,
199,
504,
1639,
14,
1208,
14,
2991,
492,
3542,
63,
2394,
12,
3542,
63,
505,
199,
504,
1639,
14,
1208,
14,
15481,
492,
22373,
1692,
199,
504,
1639,
14,
1208,
14,
4174,
14,
4912,
14,
4078,
14,
1122,
492,
334,
272,
14342,
12,
1166,
318,
2527,
12,
29596,
12,
1166,
30038,
12,
199,
9,
421,
199,
533,
13599,
5535,
6408,
8,
17521,
6408,
304,
272,
408,
272,
9739,
570,
2656,
4887,
367,
2955,
1584,
14,
339,
710,
4243,
367,
1124,
1985,
1040,
436,
1124,
1095,
63,
633,
1040,
787,
272,
1124,
10449,
63,
5441,
1040,
436,
1124,
10449,
63,
2632,
4345,
272,
408,
272,
347,
636,
826,
721,
277,
12,
2909,
29,
403,
12,
1300,
63,
633,
29,
403,
12,
627,
589,
12,
1011,
958,
304,
267,
340,
2909,
365,
488,
26,
288,
2909,
275,
2202,
14,
10449,
63,
5441,
267,
340,
1300,
63,
633,
365,
488,
26,
288,
1300,
63,
633,
275,
2202,
14,
10449,
63,
2632,
267,
1104,
63,
1751,
8,
1095,
63,
633,
9,
267,
1613,
8,
9278,
5535,
6408,
12,
291,
2843,
826,
721,
1985,
12,
1300,
63,
633,
12,
1740,
627,
589,
12,
1011,
958,
9,
267,
327,
23754,
6408,
9567,
83,
370,
31460,
63,
5441,
1380,
2909,
267,
327,
365,
2701,
12,
880,
781,
9066,
314,
2701,
574,
14,
267,
340,
440,
2909,
26,
288,
291,
14,
1095,
63,
1985,
275,
488,
288,
291,
14,
1985,
275,
488,
339,
347,
931,
8,
277,
12,
536,
304,
267,
340,
440,
291,
14,
1985,
26,
288,
746,
11897,
480,
5556,
3984,
1808,
314,
2955,
1725,
1145,
298,
4318,
298,
7395,
9445,
663,
314,
27815,
63,
5441,
298,
4318,
298,
6031,
370,
282,
10036,
931,
2685,
267,
372,
1613,
8,
9278,
5535,
6408,
12,
291,
680,
515,
8,
354,
9,
421,
199,
533,
16101,
379,
5535,
4256,
8,
785,
304,
272,
849,
63,
1160,
275,
408,
633,
3647,
83,
531,
624,
272,
7970,
275,
334,
267,
1689,
4856,
3919,
401,
334,
288,
519,
624,
8,
633,
60,
2941,
937,
91,
16,
12,
17,
4988,
83,
5830,
6697,
26332,
418,
91,
16,
12,
17,
4988,
430,
7208,
288,
334,
82,
624,
8,
32,
646,
60,
83,
10,
905,
418,
60,
83,
5830,
6697,
26332,
1105,
7208,
408,
32,
646,
1166,
3647,
83,
531,
624,
395,
267,
22583,
272,
776,
339,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
1613,
8,
3476,
379,
5535,
4256,
12,
291,
2843,
826,
9308,
589,
12,
1011,
958,
9,
267,
291,
423,
7435,
275,
8773,
342,
267,
291,
14,
26368,
63,
1725,
275,
1052,
267,
367,
3329,
12,
7970,
315,
291,
14,
7435,
26,
288,
367,
3851,
315,
7970,
26,
355,
340,
1228,
8,
3401,
12,
334,
2960,
12,
769,
2298,
490,
3851,
12,
1978,
275,
3851,
355,
587,
26,
490,
1978,
275,
291,
14,
885,
63,
1160,
355,
10311,
275,
295,
14,
2014,
8,
3401,
12,
295,
14,
15434,
9,
355,
291,
423,
7435,
14,
5486,
8,
3435,
12,
15364,
740,
1332,
8427,
12,
1978,
430,
339,
347,
570,
63,
2227,
8,
277,
12,
536,
12,
1564,
29,
403,
304,
267,
408,
267,
1803,
282,
2631,
402,
314,
570,
543,
314,
1627,
536,
436,
2716,
1564,
14,
267,
408,
267,
340,
1564,
365,
488,
26,
288,
372,
488,
267,
6128,
21,
275,
8337,
14,
1064,
21,
342,
267,
367,
3728,
315,
1564,
14,
10660,
837,
288,
6128,
21,
14,
873,
8,
4604,
9,
267,
372,
6128,
21,
14,
11453,
20523,
713,
61,
339,
347,
19871,
63,
354,
8,
277,
12,
536,
12,
1564,
29,
403,
304,
267,
4565,
63,
354,
275,
29596,
8,
12240,
8,
354,
430,
267,
3633,
63,
354,
275,
4565,
63,
354,
14,
515,
14,
1913,
342,
267,
12123,
275,
756,
267,
340,
1564,
365,
488,
26,
288,
340,
440,
291,
14,
2444,
8,
3118,
63,
354,
304,
355,
746,
1722,
480,
1918,
570,
1543,
83,
7,
4293,
440,
506,
1911,
543,
450,
82,
2122,
450,
639,
334,
3118,
63,
354,
12,
291,
430,
288,
862,
26,
355,
1564,
275,
291,
14,
1490,
8,
3118,
63,
354,
9,
288,
871,
5925,
26,
355,
327,
8690,
2082,
3792,
436,
21495,
355,
372,
536,
288,
12123,
275,
715,
267,
862,
26,
288,
570,
63,
2227,
275,
291,
14,
493,
63,
2227,
8,
3118,
63,
354,
12,
1564,
9,
267,
3753,
26,
288,
340,
12123,
26,
355,
1564,
14,
1600,
342,
267,
931,
12,
1788,
275,
747,
14,
515,
14,
1294,
8,
3118,
63,
354,
9,
267,
1738,
12,
1599,
275,
747,
14,
515,
14,
7973,
8,
1501,
9,
267,
340,
570,
63,
2227,
365,
440,
488,
26,
288,
570,
63,
2227,
275,
3680,
5,
83,
2,
450,
570,
63,
2227,
267,
19871,
63,
354,
275,
747,
14,
515,
14,
904,
8,
515,
12,
2071,
83,
5,
83,
5,
83,
2,
450,
3521,
334,
1231,
12,
570,
63,
2227,
12,
1599,
430,
267,
31857,
63,
354,
275,
769,
8,
6751,
63,
354,
9,
267,
31857,
63,
354,
59,
18,
61,
275,
19871,
63,
354,
267,
327,
12568,
286,
11571,
367,
282,
768,
4246,
13,
1409,
11176,
12,
2839,
1166,
8,
1662,
4246,
14,
69,
357,
31,
3,
1873,
970,
531,
267,
327,
1455,
921,
1544,
14,
4246,
26008,
14,
957,
15,
11486,
15,
1589,
13,
1222,
13,
20520,
496,
1618,
13,
4246,
13,
1409,
13,
7093,
267,
340,
8720,
19367,
315,
536,
436,
440,
31857,
63,
354,
59,
19,
2189,
288,
31857,
63,
354,
59,
18,
61,
847,
15539,
267,
372,
1166,
30038
] |
[
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
8337,
199,
646,
2022,
199,
646,
747,
199,
646,
15454,
199,
646,
295,
199,
504,
5055,
492,
8773,
199,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
2828,
14,
18373,
14,
1208,
492,
1104,
63,
1751,
12,
4450,
63,
7435,
199,
504,
1639,
14,
1018,
14,
1637,
492,
334,
272,
6378,
4437,
8447,
547,
12,
2581,
465,
849,
63,
1637,
12,
18014,
12,
199,
9,
199,
504,
1639,
14,
1018,
14,
3924,
492,
11897,
199,
504,
1639,
14,
1018,
14,
1725,
14,
1095,
492,
6646,
1173,
199,
504,
1639,
14,
1018,
14,
1725,
14,
3494,
492,
23754,
6408,
12,
664,
63,
3494,
63,
533,
199,
504,
1639,
14,
1208,
14,
2991,
492,
3542,
63,
2394,
12,
3542,
63,
505,
199,
504,
1639,
14,
1208,
14,
15481,
492,
22373,
1692,
199,
504,
1639,
14,
1208,
14,
4174,
14,
4912,
14,
4078,
14,
1122,
492,
334,
272,
14342,
12,
1166,
318,
2527,
12,
29596,
12,
1166,
30038,
12,
199,
9,
421,
199,
533,
13599,
5535,
6408,
8,
17521,
6408,
304,
272,
408,
272,
9739,
570,
2656,
4887,
367,
2955,
1584,
14,
339,
710,
4243,
367,
1124,
1985,
1040,
436,
1124,
1095,
63,
633,
1040,
787,
272,
1124,
10449,
63,
5441,
1040,
436,
1124,
10449,
63,
2632,
4345,
272,
408,
272,
347,
636,
826,
721,
277,
12,
2909,
29,
403,
12,
1300,
63,
633,
29,
403,
12,
627,
589,
12,
1011,
958,
304,
267,
340,
2909,
365,
488,
26,
288,
2909,
275,
2202,
14,
10449,
63,
5441,
267,
340,
1300,
63,
633,
365,
488,
26,
288,
1300,
63,
633,
275,
2202,
14,
10449,
63,
2632,
267,
1104,
63,
1751,
8,
1095,
63,
633,
9,
267,
1613,
8,
9278,
5535,
6408,
12,
291,
2843,
826,
721,
1985,
12,
1300,
63,
633,
12,
1740,
627,
589,
12,
1011,
958,
9,
267,
327,
23754,
6408,
9567,
83,
370,
31460,
63,
5441,
1380,
2909,
267,
327,
365,
2701,
12,
880,
781,
9066,
314,
2701,
574,
14,
267,
340,
440,
2909,
26,
288,
291,
14,
1095,
63,
1985,
275,
488,
288,
291,
14,
1985,
275,
488,
339,
347,
931,
8,
277,
12,
536,
304,
267,
340,
440,
291,
14,
1985,
26,
288,
746,
11897,
480,
5556,
3984,
1808,
314,
2955,
1725,
1145,
298,
4318,
298,
7395,
9445,
663,
314,
27815,
63,
5441,
298,
4318,
298,
6031,
370,
282,
10036,
931,
2685,
267,
372,
1613,
8,
9278,
5535,
6408,
12,
291,
680,
515,
8,
354,
9,
421,
199,
533,
16101,
379,
5535,
4256,
8,
785,
304,
272,
849,
63,
1160,
275,
408,
633,
3647,
83,
531,
624,
272,
7970,
275,
334,
267,
1689,
4856,
3919,
401,
334,
288,
519,
624,
8,
633,
60,
2941,
937,
91,
16,
12,
17,
4988,
83,
5830,
6697,
26332,
418,
91,
16,
12,
17,
4988,
430,
7208,
288,
334,
82,
624,
8,
32,
646,
60,
83,
10,
905,
418,
60,
83,
5830,
6697,
26332,
1105,
7208,
408,
32,
646,
1166,
3647,
83,
531,
624,
395,
267,
22583,
272,
776,
339,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
1613,
8,
3476,
379,
5535,
4256,
12,
291,
2843,
826,
9308,
589,
12,
1011,
958,
9,
267,
291,
423,
7435,
275,
8773,
342,
267,
291,
14,
26368,
63,
1725,
275,
1052,
267,
367,
3329,
12,
7970,
315,
291,
14,
7435,
26,
288,
367,
3851,
315,
7970,
26,
355,
340,
1228,
8,
3401,
12,
334,
2960,
12,
769,
2298,
490,
3851,
12,
1978,
275,
3851,
355,
587,
26,
490,
1978,
275,
291,
14,
885,
63,
1160,
355,
10311,
275,
295,
14,
2014,
8,
3401,
12,
295,
14,
15434,
9,
355,
291,
423,
7435,
14,
5486,
8,
3435,
12,
15364,
740,
1332,
8427,
12,
1978,
430,
339,
347,
570,
63,
2227,
8,
277,
12,
536,
12,
1564,
29,
403,
304,
267,
408,
267,
1803,
282,
2631,
402,
314,
570,
543,
314,
1627,
536,
436,
2716,
1564,
14,
267,
408,
267,
340,
1564,
365,
488,
26,
288,
372,
488,
267,
6128,
21,
275,
8337,
14,
1064,
21,
342,
267,
367,
3728,
315,
1564,
14,
10660,
837,
288,
6128,
21,
14,
873,
8,
4604,
9,
267,
372,
6128,
21,
14,
11453,
20523,
713,
61,
339,
347,
19871,
63,
354,
8,
277,
12,
536,
12,
1564,
29,
403,
304,
267,
4565,
63,
354,
275,
29596,
8,
12240,
8,
354,
430,
267,
3633,
63,
354,
275,
4565,
63,
354,
14,
515,
14,
1913,
342,
267,
12123,
275,
756,
267,
340,
1564,
365,
488,
26,
288,
340,
440,
291,
14,
2444,
8,
3118,
63,
354,
304,
355,
746,
1722,
480,
1918,
570,
1543,
83,
7,
4293,
440,
506,
1911,
543,
450,
82,
2122,
450,
639,
334,
3118,
63,
354,
12,
291,
430,
288,
862,
26,
355,
1564,
275,
291,
14,
1490,
8,
3118,
63,
354,
9,
288,
871,
5925,
26,
355,
327,
8690,
2082,
3792,
436,
21495,
355,
372,
536,
288,
12123,
275,
715,
267,
862,
26,
288,
570,
63,
2227,
275,
291,
14,
493,
63,
2227,
8,
3118,
63,
354,
12,
1564,
9,
267,
3753,
26,
288,
340,
12123,
26,
355,
1564,
14,
1600,
342,
267,
931,
12,
1788,
275,
747,
14,
515,
14,
1294,
8,
3118,
63,
354,
9,
267,
1738,
12,
1599,
275,
747,
14,
515,
14,
7973,
8,
1501,
9,
267,
340,
570,
63,
2227,
365,
440,
488,
26,
288,
570,
63,
2227,
275,
3680,
5,
83,
2,
450,
570,
63,
2227,
267,
19871,
63,
354,
275,
747,
14,
515,
14,
904,
8,
515,
12,
2071,
83,
5,
83,
5,
83,
2,
450,
3521,
334,
1231,
12,
570,
63,
2227,
12,
1599,
430,
267,
31857,
63,
354,
275,
769,
8,
6751,
63,
354,
9,
267,
31857,
63,
354,
59,
18,
61,
275,
19871,
63,
354,
267,
327,
12568,
286,
11571,
367,
282,
768,
4246,
13,
1409,
11176,
12,
2839,
1166,
8,
1662,
4246,
14,
69,
357,
31,
3,
1873,
970,
531,
267,
327,
1455,
921,
1544,
14,
4246,
26008,
14,
957,
15,
11486,
15,
1589,
13,
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
] |
dhmncivichacks/timewebsite
|
tests/test_events.py
|
2
|
1294
|
import unittest
from base import BaseTestCase
from flask.ext.login import current_user
class TestEvents(BaseTestCase):
# Ensure route was set up correctly
def test_events_route(self):
response = self.client.get('/events', content_type='html/text')
self.assertEqual(response.status_code, 200)
# Ensure that new entries can be made
def test_add_event(self):
with self.client:
response = self.client.post(
'/login',
data=dict(username="admin", password="admin"),
follow_redirects=True
)
response = self.client.post('/events', data=dict(
title='An Event', description='Here is the description.',
url_handle="an_event"
), follow_redirects=True)
self.assertIn(b'An Event', response.data)
self.assertTrue(current_user.is_active())
# Ensure invalid form conveys errors
def test_invalid_form_error(self):
with self.client:
response = self.client.post('events/', data=dict(
title=None,
description=None
), follow_redirects=True)
self.assertIn(b'FIXME ERROR', response.data)
if __name__ == '__main__':
unittest.main()
|
isc
|
[
646,
2882,
199,
199,
504,
1300,
492,
3523,
1746,
199,
504,
7209,
14,
832,
14,
2886,
492,
1453,
63,
751,
421,
199,
533,
1379,
11770,
8,
20760,
304,
339,
327,
7523,
7475,
1990,
663,
1536,
6657,
272,
347,
511,
63,
4368,
63,
4449,
8,
277,
304,
267,
1177,
275,
291,
14,
1258,
14,
362,
2336,
4368,
297,
1564,
63,
466,
534,
1360,
15,
505,
358,
267,
291,
14,
629,
8,
1310,
14,
1205,
63,
600,
12,
1926,
9,
339,
327,
7523,
626,
892,
4811,
883,
506,
6326,
272,
347,
511,
63,
525,
63,
1430,
8,
277,
304,
267,
543,
291,
14,
1258,
26,
288,
1177,
275,
291,
14,
1258,
14,
1932,
8,
355,
1994,
2886,
297,
355,
666,
29,
807,
8,
2473,
628,
2113,
401,
2505,
628,
2113,
1288,
355,
2035,
63,
13607,
29,
549,
288,
776,
288,
1177,
275,
291,
14,
1258,
14,
1932,
2336,
4368,
297,
666,
29,
807,
8,
355,
2538,
534,
2493,
6763,
297,
1369,
534,
21741,
365,
314,
1369,
3130,
355,
1166,
63,
2479,
628,
290,
63,
1430,
2,
288,
2318,
2035,
63,
13607,
29,
549,
9,
288,
291,
14,
4080,
8,
66,
7,
2493,
6763,
297,
1177,
14,
576,
9,
288,
291,
14,
1815,
8,
1818,
63,
751,
14,
374,
63,
2682,
1012,
339,
327,
7523,
3866,
1824,
406,
432,
588,
2552,
272,
347,
511,
63,
3197,
63,
964,
63,
705,
8,
277,
304,
267,
543,
291,
14,
1258,
26,
288,
1177,
275,
291,
14,
1258,
14,
1932,
360,
4368,
3678,
666,
29,
807,
8,
355,
2538,
29,
403,
12,
355,
1369,
29,
403,
288,
2318,
2035,
63,
13607,
29,
549,
9,
288,
291,
14,
4080,
8,
66,
7,
31779,
12539,
297,
1177,
14,
576,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
199,
199,
504,
1300,
492,
3523,
1746,
199,
504,
7209,
14,
832,
14,
2886,
492,
1453,
63,
751,
421,
199,
533,
1379,
11770,
8,
20760,
304,
339,
327,
7523,
7475,
1990,
663,
1536,
6657,
272,
347,
511,
63,
4368,
63,
4449,
8,
277,
304,
267,
1177,
275,
291,
14,
1258,
14,
362,
2336,
4368,
297,
1564,
63,
466,
534,
1360,
15,
505,
358,
267,
291,
14,
629,
8,
1310,
14,
1205,
63,
600,
12,
1926,
9,
339,
327,
7523,
626,
892,
4811,
883,
506,
6326,
272,
347,
511,
63,
525,
63,
1430,
8,
277,
304,
267,
543,
291,
14,
1258,
26,
288,
1177,
275,
291,
14,
1258,
14,
1932,
8,
355,
1994,
2886,
297,
355,
666,
29,
807,
8,
2473,
628,
2113,
401,
2505,
628,
2113,
1288,
355,
2035,
63,
13607,
29,
549,
288,
776,
288,
1177,
275,
291,
14,
1258,
14,
1932,
2336,
4368,
297,
666,
29,
807,
8,
355,
2538,
534,
2493,
6763,
297,
1369,
534,
21741,
365,
314,
1369,
3130,
355,
1166,
63,
2479,
628,
290,
63,
1430,
2,
288,
2318,
2035,
63,
13607,
29,
549,
9,
288,
291,
14,
4080,
8,
66,
7,
2493,
6763,
297,
1177,
14,
576,
9,
288,
291,
14,
1815,
8,
1818,
63,
751,
14,
374,
63,
2682,
1012,
339,
327,
7523,
3866,
1824,
406,
432,
588,
2552,
272,
347,
511,
63,
3197,
63,
964,
63,
705,
8,
277,
304,
267,
543,
291,
14,
1258,
26,
288,
1177,
275,
291,
14,
1258,
14,
1932,
360,
4368,
3678,
666,
29,
807,
8,
355,
2538,
29,
403,
12,
355,
1369,
29,
403,
288,
2318,
2035,
63,
13607,
29,
549,
9,
288,
291,
14,
4080,
8,
66,
7,
31779,
12539,
297,
1177,
14,
576,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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
] |
siddhartharay007/PCV
|
PCV/classifiers/bayes.py
|
21
|
1884
|
from numpy import *
class BayesClassifier(object):
def __init__(self):
""" Initialize classifier with training data. """
self.labels = [] # class labels
self.mean = [] # class mean
self.var = [] # class variances
self.n = 0 # nbr of classes
def train(self,data,labels=None):
""" Train on data (list of arrays n*dim).
Labels are optional, default is 0...n-1. """
if labels==None:
labels = range(len(data))
self.labels = labels
self.n = len(labels)
for c in data:
self.mean.append(mean(c,axis=0))
self.var.append(var(c,axis=0))
def classify(self,points):
""" Classify the points by computing probabilities
for each class and return most probable label. """
# compute probabilities for each class
est_prob = array([gauss(m,v,points) for m,v in zip(self.mean,self.var)])
print 'est prob',est_prob.shape,self.labels
# get index of highest probability, this gives class label
ndx = est_prob.argmax(axis=0)
est_labels = array([self.labels[n] for n in ndx])
return est_labels, est_prob
def gauss(m,v,x):
""" Evaluate Gaussian in d-dimensions with independent
mean m and variance v at the points in (the rows of) x.
http://en.wikipedia.org/wiki/Multivariate_normal_distribution """
if len(x.shape)==1:
n,d = 1,x.shape[0]
else:
n,d = x.shape
# covariance matrix, subtract mean
S = diag(1/v)
x = x-m
# product of probabilities
y = exp(-0.5*diag(dot(x,dot(S,x.T))))
# normalize and return
return y * (2*pi)**(-d/2.0) / ( sqrt(prod(v)) + 1e-6)
|
bsd-2-clause
|
[
504,
2680,
492,
627,
221,
421,
199,
533,
29434,
397,
8508,
8,
785,
304,
2286,
347,
636,
826,
721,
277,
304,
267,
408,
11578,
12429,
543,
6093,
666,
14,
408,
2728,
291,
14,
3512,
275,
942,
259,
327,
1021,
3628,
267,
291,
14,
3670,
275,
942,
263,
327,
1021,
4615,
267,
291,
14,
1391,
275,
942,
263,
327,
1021,
11773,
83,
267,
291,
14,
78,
275,
378,
3322,
327,
31646,
402,
3992,
5493,
347,
3560,
8,
277,
12,
576,
12,
3512,
29,
403,
304,
267,
408,
16732,
641,
666,
334,
513,
402,
6572,
302,
10,
3572,
680,
7205,
10354,
83,
787,
2716,
12,
849,
365,
378,
1396,
78,
13,
17,
14,
408,
2728,
340,
3628,
389,
403,
26,
288,
3628,
275,
1425,
8,
552,
8,
576,
430,
267,
291,
14,
3512,
275,
3628,
267,
291,
14,
78,
275,
822,
8,
3512,
9,
21695,
367,
286,
315,
666,
26,
288,
291,
14,
3670,
14,
740,
8,
3670,
8,
67,
12,
3127,
29,
16,
430,
288,
291,
14,
1391,
14,
740,
8,
1391,
8,
67,
12,
3127,
29,
16,
430,
5493,
347,
28837,
8,
277,
12,
3438,
304,
267,
408,
8465,
2608,
1399,
314,
4501,
701,
17226,
19555,
7205,
367,
1924,
1021,
436,
372,
4750,
5128,
461,
1768,
14,
408,
2728,
327,
4526,
19555,
367,
1924,
1021,
267,
4347,
63,
6101,
275,
1625,
779,
25898,
8,
77,
12,
86,
12,
3438,
9,
367,
333,
12,
86,
315,
3482,
8,
277,
14,
3670,
12,
277,
14,
1391,
3948,
21695,
870,
283,
597,
5128,
297,
597,
63,
6101,
14,
1392,
12,
277,
14,
3512,
267,
327,
664,
1478,
402,
15356,
12224,
12,
642,
10557,
1021,
1768,
267,
5222,
88,
275,
4347,
63,
6101,
14,
16383,
8,
3127,
29,
16,
9,
2728,
4347,
63,
3512,
275,
1625,
779,
277,
14,
3512,
59,
78,
61,
367,
302,
315,
5222,
88,
566,
2728,
372,
4347,
63,
3512,
12,
4347,
63,
6101,
421,
199,
318,
486,
23822,
8,
77,
12,
86,
12,
88,
304,
272,
408,
27450,
17131,
315,
366,
13,
13320,
543,
12717,
4960,
4615,
333,
436,
11773,
373,
737,
314,
4501,
315,
334,
1589,
4730,
402,
9,
671,
14,
4960,
1455,
921,
287,
14,
13961,
14,
1308,
15,
6797,
15,
3947,
13805,
63,
3302,
63,
4972,
408,
2286,
340,
822,
8,
88,
14,
1392,
12694,
17,
26,
267,
302,
12,
68,
275,
413,
12,
88,
14,
1392,
59,
16,
61,
272,
587,
26,
267,
302,
12,
68,
275,
671,
14,
1392,
15567,
327,
13263,
3634,
12,
24129,
4615,
272,
428,
275,
8348,
8,
17,
15,
86,
9,
272,
671,
275,
671,
13,
77,
272,
327,
3336,
402,
19555,
272,
612,
275,
1437,
2801,
16,
14,
21,
10,
6706,
8,
3287,
8,
88,
12,
3287,
8,
51,
12,
88,
14,
52,
7845,
2286,
327,
7666,
436,
372,
272,
372,
612,
627,
334,
18,
10,
1038,
6422,
2801,
68,
15,
18,
14,
16,
9,
1182,
334,
7452,
8,
8788,
8,
86,
430,
435,
413,
69,
13,
22,
9,
6905,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
492,
627,
221,
421,
199,
533,
29434,
397,
8508,
8,
785,
304,
2286,
347,
636,
826,
721,
277,
304,
267,
408,
11578,
12429,
543,
6093,
666,
14,
408,
2728,
291,
14,
3512,
275,
942,
259,
327,
1021,
3628,
267,
291,
14,
3670,
275,
942,
263,
327,
1021,
4615,
267,
291,
14,
1391,
275,
942,
263,
327,
1021,
11773,
83,
267,
291,
14,
78,
275,
378,
3322,
327,
31646,
402,
3992,
5493,
347,
3560,
8,
277,
12,
576,
12,
3512,
29,
403,
304,
267,
408,
16732,
641,
666,
334,
513,
402,
6572,
302,
10,
3572,
680,
7205,
10354,
83,
787,
2716,
12,
849,
365,
378,
1396,
78,
13,
17,
14,
408,
2728,
340,
3628,
389,
403,
26,
288,
3628,
275,
1425,
8,
552,
8,
576,
430,
267,
291,
14,
3512,
275,
3628,
267,
291,
14,
78,
275,
822,
8,
3512,
9,
21695,
367,
286,
315,
666,
26,
288,
291,
14,
3670,
14,
740,
8,
3670,
8,
67,
12,
3127,
29,
16,
430,
288,
291,
14,
1391,
14,
740,
8,
1391,
8,
67,
12,
3127,
29,
16,
430,
5493,
347,
28837,
8,
277,
12,
3438,
304,
267,
408,
8465,
2608,
1399,
314,
4501,
701,
17226,
19555,
7205,
367,
1924,
1021,
436,
372,
4750,
5128,
461,
1768,
14,
408,
2728,
327,
4526,
19555,
367,
1924,
1021,
267,
4347,
63,
6101,
275,
1625,
779,
25898,
8,
77,
12,
86,
12,
3438,
9,
367,
333,
12,
86,
315,
3482,
8,
277,
14,
3670,
12,
277,
14,
1391,
3948,
21695,
870,
283,
597,
5128,
297,
597,
63,
6101,
14,
1392,
12,
277,
14,
3512,
267,
327,
664,
1478,
402,
15356,
12224,
12,
642,
10557,
1021,
1768,
267,
5222,
88,
275,
4347,
63,
6101,
14,
16383,
8,
3127,
29,
16,
9,
2728,
4347,
63,
3512,
275,
1625,
779,
277,
14,
3512,
59,
78,
61,
367,
302,
315,
5222,
88,
566,
2728,
372,
4347,
63,
3512,
12,
4347,
63,
6101,
421,
199,
318,
486,
23822,
8,
77,
12,
86,
12,
88,
304,
272,
408,
27450,
17131,
315,
366,
13,
13320,
543,
12717,
4960,
4615,
333,
436,
11773,
373,
737,
314,
4501,
315,
334,
1589,
4730,
402,
9,
671,
14,
4960,
1455,
921,
287,
14,
13961,
14,
1308,
15,
6797,
15,
3947,
13805,
63,
3302,
63,
4972,
408,
2286,
340,
822,
8,
88,
14,
1392,
12694,
17,
26,
267,
302,
12,
68,
275,
413,
12,
88,
14,
1392,
59,
16,
61,
272,
587,
26,
267,
302,
12,
68,
275,
671,
14,
1392,
15567,
327,
13263,
3634,
12,
24129,
4615,
272,
428,
275,
8348,
8,
17,
15,
86,
9,
272,
671,
275,
671,
13,
77,
272,
327,
3336,
402,
19555,
272,
612,
275,
1437,
2801,
16,
14,
21,
10,
6706,
8,
3287,
8,
88,
12,
3287,
8,
51,
12,
88,
14,
52,
7845,
2286,
327,
7666,
436,
372,
272,
372,
612,
627,
334,
18,
10,
1038,
6422,
2801,
68,
15,
18,
14,
16,
9,
1182,
334,
7452,
8,
8788,
8,
86,
430,
435,
413,
69,
13,
22,
9,
6905,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,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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
] |
theguardian/headphones
|
lib/unidecode/x089.py
|
252
|
4628
|
data = (
'Ji ', # 0x00
'Zhi ', # 0x01
'Gua ', # 0x02
'Ken ', # 0x03
'Che ', # 0x04
'Ti ', # 0x05
'Ti ', # 0x06
'Fu ', # 0x07
'Chong ', # 0x08
'Xie ', # 0x09
'Bian ', # 0x0a
'Die ', # 0x0b
'Kun ', # 0x0c
'Duan ', # 0x0d
'Xiu ', # 0x0e
'Xiu ', # 0x0f
'He ', # 0x10
'Yuan ', # 0x11
'Bao ', # 0x12
'Bao ', # 0x13
'Fu ', # 0x14
'Yu ', # 0x15
'Tuan ', # 0x16
'Yan ', # 0x17
'Hui ', # 0x18
'Bei ', # 0x19
'Chu ', # 0x1a
'Lu ', # 0x1b
'Ena ', # 0x1c
'Hitoe ', # 0x1d
'Yun ', # 0x1e
'Da ', # 0x1f
'Gou ', # 0x20
'Da ', # 0x21
'Huai ', # 0x22
'Rong ', # 0x23
'Yuan ', # 0x24
'Ru ', # 0x25
'Nai ', # 0x26
'Jiong ', # 0x27
'Suo ', # 0x28
'Ban ', # 0x29
'Tun ', # 0x2a
'Chi ', # 0x2b
'Sang ', # 0x2c
'Niao ', # 0x2d
'Ying ', # 0x2e
'Jie ', # 0x2f
'Qian ', # 0x30
'Huai ', # 0x31
'Ku ', # 0x32
'Lian ', # 0x33
'Bao ', # 0x34
'Li ', # 0x35
'Zhe ', # 0x36
'Shi ', # 0x37
'Lu ', # 0x38
'Yi ', # 0x39
'Die ', # 0x3a
'Xie ', # 0x3b
'Xian ', # 0x3c
'Wei ', # 0x3d
'Biao ', # 0x3e
'Cao ', # 0x3f
'Ji ', # 0x40
'Jiang ', # 0x41
'Sen ', # 0x42
'Bao ', # 0x43
'Xiang ', # 0x44
'Chihaya ', # 0x45
'Pu ', # 0x46
'Jian ', # 0x47
'Zhuan ', # 0x48
'Jian ', # 0x49
'Zui ', # 0x4a
'Ji ', # 0x4b
'Dan ', # 0x4c
'Za ', # 0x4d
'Fan ', # 0x4e
'Bo ', # 0x4f
'Xiang ', # 0x50
'Xin ', # 0x51
'Bie ', # 0x52
'Rao ', # 0x53
'Man ', # 0x54
'Lan ', # 0x55
'Ao ', # 0x56
'Duo ', # 0x57
'Gui ', # 0x58
'Cao ', # 0x59
'Sui ', # 0x5a
'Nong ', # 0x5b
'Chan ', # 0x5c
'Lian ', # 0x5d
'Bi ', # 0x5e
'Jin ', # 0x5f
'Dang ', # 0x60
'Shu ', # 0x61
'Tan ', # 0x62
'Bi ', # 0x63
'Lan ', # 0x64
'Pu ', # 0x65
'Ru ', # 0x66
'Zhi ', # 0x67
'[?] ', # 0x68
'Shu ', # 0x69
'Wa ', # 0x6a
'Shi ', # 0x6b
'Bai ', # 0x6c
'Xie ', # 0x6d
'Bo ', # 0x6e
'Chen ', # 0x6f
'Lai ', # 0x70
'Long ', # 0x71
'Xi ', # 0x72
'Xian ', # 0x73
'Lan ', # 0x74
'Zhe ', # 0x75
'Dai ', # 0x76
'Tasuki ', # 0x77
'Zan ', # 0x78
'Shi ', # 0x79
'Jian ', # 0x7a
'Pan ', # 0x7b
'Yi ', # 0x7c
'Ran ', # 0x7d
'Ya ', # 0x7e
'Xi ', # 0x7f
'Xi ', # 0x80
'Yao ', # 0x81
'Feng ', # 0x82
'Tan ', # 0x83
'[?] ', # 0x84
'Biao ', # 0x85
'Fu ', # 0x86
'Ba ', # 0x87
'He ', # 0x88
'Ji ', # 0x89
'Ji ', # 0x8a
'Jian ', # 0x8b
'Guan ', # 0x8c
'Bian ', # 0x8d
'Yan ', # 0x8e
'Gui ', # 0x8f
'Jue ', # 0x90
'Pian ', # 0x91
'Mao ', # 0x92
'Mi ', # 0x93
'Mi ', # 0x94
'Mie ', # 0x95
'Shi ', # 0x96
'Si ', # 0x97
'Zhan ', # 0x98
'Luo ', # 0x99
'Jue ', # 0x9a
'Mi ', # 0x9b
'Tiao ', # 0x9c
'Lian ', # 0x9d
'Yao ', # 0x9e
'Zhi ', # 0x9f
'Jun ', # 0xa0
'Xi ', # 0xa1
'Shan ', # 0xa2
'Wei ', # 0xa3
'Xi ', # 0xa4
'Tian ', # 0xa5
'Yu ', # 0xa6
'Lan ', # 0xa7
'E ', # 0xa8
'Du ', # 0xa9
'Qin ', # 0xaa
'Pang ', # 0xab
'Ji ', # 0xac
'Ming ', # 0xad
'Ying ', # 0xae
'Gou ', # 0xaf
'Qu ', # 0xb0
'Zhan ', # 0xb1
'Jin ', # 0xb2
'Guan ', # 0xb3
'Deng ', # 0xb4
'Jian ', # 0xb5
'Luo ', # 0xb6
'Qu ', # 0xb7
'Jian ', # 0xb8
'Wei ', # 0xb9
'Jue ', # 0xba
'Qu ', # 0xbb
'Luo ', # 0xbc
'Lan ', # 0xbd
'Shen ', # 0xbe
'Di ', # 0xbf
'Guan ', # 0xc0
'Jian ', # 0xc1
'Guan ', # 0xc2
'Yan ', # 0xc3
'Gui ', # 0xc4
'Mi ', # 0xc5
'Shi ', # 0xc6
'Zhan ', # 0xc7
'Lan ', # 0xc8
'Jue ', # 0xc9
'Ji ', # 0xca
'Xi ', # 0xcb
'Di ', # 0xcc
'Tian ', # 0xcd
'Yu ', # 0xce
'Gou ', # 0xcf
'Jin ', # 0xd0
'Qu ', # 0xd1
'Jiao ', # 0xd2
'Jiu ', # 0xd3
'Jin ', # 0xd4
'Cu ', # 0xd5
'Jue ', # 0xd6
'Zhi ', # 0xd7
'Chao ', # 0xd8
'Ji ', # 0xd9
'Gu ', # 0xda
'Dan ', # 0xdb
'Zui ', # 0xdc
'Di ', # 0xdd
'Shang ', # 0xde
'Hua ', # 0xdf
'Quan ', # 0xe0
'Ge ', # 0xe1
'Chi ', # 0xe2
'Jie ', # 0xe3
'Gui ', # 0xe4
'Gong ', # 0xe5
'Hong ', # 0xe6
'Jie ', # 0xe7
'Hun ', # 0xe8
'Qiu ', # 0xe9
'Xing ', # 0xea
'Su ', # 0xeb
'Ni ', # 0xec
'Ji ', # 0xed
'Lu ', # 0xee
'Zhi ', # 0xef
'Zha ', # 0xf0
'Bi ', # 0xf1
'Xing ', # 0xf2
'Hu ', # 0xf3
'Shang ', # 0xf4
'Gong ', # 0xf5
'Zhi ', # 0xf6
'Xue ', # 0xf7
'Chu ', # 0xf8
'Xi ', # 0xf9
'Yi ', # 0xfa
'Lu ', # 0xfb
'Jue ', # 0xfc
'Xi ', # 0xfd
'Yan ', # 0xfe
'Xi ', # 0xff
)
|
gpl-3.0
|
[
576,
275,
334,
199,
7,
16911,
1656,
259,
327,
378,
88,
383,
199,
7,
58,
5812,
1656,
259,
327,
378,
88,
614,
199,
7,
39,
1458,
1656,
259,
327,
378,
88,
996,
199,
7,
43,
287,
1656,
259,
327,
378,
88,
1644,
199,
7,
20335,
1656,
259,
327,
378,
88,
966,
199,
7,
22731,
1656,
259,
327,
378,
88,
1717,
199,
7,
22731,
1656,
259,
327,
378,
88,
1690,
199,
7,
19590,
1656,
259,
327,
378,
88,
1780,
199,
7,
1049,
951,
1656,
259,
327,
378,
88,
2036,
199,
7,
56,
1873,
1656,
259,
327,
378,
88,
1643,
199,
7,
34,
5653,
1656,
259,
327,
378,
88,
16,
65,
199,
7,
1341,
69,
1656,
259,
327,
378,
88,
16,
66,
199,
7,
43,
324,
1656,
259,
327,
378,
88,
16,
67,
199,
7,
36,
7856,
1656,
259,
327,
378,
88,
16,
68,
199,
7,
14828,
85,
1656,
259,
327,
378,
88,
16,
69,
199,
7,
14828,
85,
1656,
259,
327,
378,
88,
16,
70,
199,
7,
1966,
1656,
259,
327,
378,
88,
709,
199,
7,
57,
7856,
1656,
259,
327,
378,
88,
845,
199,
7,
34,
8035,
1656,
259,
327,
378,
88,
713,
199,
7,
34,
8035,
1656,
259,
327,
378,
88,
969,
199,
7,
19590,
1656,
259,
327,
378,
88,
1079,
199,
7,
24388,
1656,
259,
327,
378,
88,
1046,
199,
7,
52,
7856,
1656,
259,
327,
378,
88,
975,
199,
7,
26797,
1656,
259,
327,
378,
88,
1196,
199,
7,
40,
1907,
1656,
259,
327,
378,
88,
1085,
199,
7,
3655,
73,
1656,
259,
327,
378,
88,
1167,
199,
7,
1049,
85,
1656,
259,
327,
378,
88,
17,
65,
199,
7,
18176,
1656,
259,
327,
378,
88,
17,
66,
199,
7,
1327,
65,
1656,
259,
327,
378,
88,
17,
67,
199,
7,
26852,
13361,
1656,
259,
327,
378,
88,
17,
68,
199,
7,
57,
324,
1656,
259,
327,
378,
88,
17,
69,
199,
7,
25014,
1656,
259,
327,
378,
88,
17,
70,
199,
7,
39,
810,
1656,
259,
327,
378,
88,
1165,
199,
7,
25014,
1656,
259,
327,
378,
88,
2025,
199,
7,
40,
1458,
73,
1656,
259,
327,
378,
88,
1081,
199,
7,
50,
951,
1656,
259,
327,
378,
88,
1789,
199,
7,
57,
7856,
1656,
259,
327,
378,
88,
1194,
199,
7,
50,
85,
1656,
259,
327,
378,
88,
821,
199,
7,
46,
5789,
1656,
259,
327,
378,
88,
1479,
199,
7,
16911,
951,
1656,
259,
327,
378,
88,
1465,
199,
7,
51,
13780,
1656,
259,
327,
378,
88,
1651,
199,
7,
28018,
1656,
259,
327,
378,
88,
1398,
199,
7,
22664,
1656,
259,
327,
378,
88,
18,
65,
199,
7,
29218,
1656,
259,
327,
378,
88,
18,
66,
199,
7,
51,
621,
1656,
259,
327,
378,
88,
18,
67,
199,
7,
46,
18939,
1656,
259,
327,
378,
88,
18,
68,
199,
7,
57,
316,
1656,
259,
327,
378,
88,
18,
69,
199,
7,
42,
1873,
1656,
259,
327,
378,
88,
18,
70,
199,
7,
49,
5653,
1656,
259,
327,
378,
88,
1216,
199,
7,
40,
1458,
73,
1656,
259,
327,
378,
88,
2192,
199,
7,
31487,
1656,
259,
327,
378,
88,
708,
199,
7,
44,
5653,
1656,
259,
327,
378,
88,
1153,
199,
7,
34,
8035,
1656,
259,
327,
378,
88,
1082,
199,
7,
13009,
1656,
259,
327,
378,
88,
1276,
199,
7,
58,
426,
1656,
259,
327,
378,
88,
1344,
199,
7,
2662,
73,
1656,
259,
327,
378,
88,
1401,
199,
7,
18176,
1656,
259,
327,
378,
88,
1703,
199,
7,
21001,
1656,
259,
327,
378,
88,
1355,
199,
7,
1341,
69,
1656,
259,
327,
378,
88,
19,
65,
199,
7,
56,
1873,
1656,
259,
327,
378,
88,
19,
66,
199,
7,
56,
5653,
1656,
259,
327,
378,
88,
19,
67,
199,
7,
6004,
73,
1656,
259,
327,
378,
88,
19,
68,
199,
7,
34,
18939,
1656,
259,
327,
378,
88,
19,
69,
199,
7,
3630,
79,
1656,
259,
327,
378,
88,
19,
70,
199,
7,
16911,
1656,
259,
327,
378,
88,
2167,
199,
7,
16911,
621,
1656,
259,
327,
378,
88,
2953,
199,
7,
18569,
1656,
259,
327,
378,
88,
2260,
199,
7,
34,
8035,
1656,
259,
327,
378,
88,
2824,
199,
7,
14828,
621,
1656,
259,
327,
378,
88,
1602,
199,
7,
1049,
24278,
1187,
65,
1656,
259,
327,
378,
88,
2322,
199,
7,
26607,
1656,
259,
327,
378,
88,
2466,
199,
7,
42,
5653,
1656,
259,
327,
378,
88,
2417,
199,
7,
12674,
7856,
1656,
259,
327,
378,
88,
2006,
199,
7,
42,
5653,
1656,
259,
327,
378,
88,
1887,
199,
7,
58,
1907,
1656,
259,
327,
378,
88,
20,
65,
199,
7,
16911,
1656,
259,
327,
378,
88,
20,
66,
199,
7,
29336,
1656,
259,
327,
378,
88,
20,
67,
199,
7,
13163,
1656,
259,
327,
378,
88,
20,
68,
199,
7,
29745,
1656,
259,
327,
378,
88,
20,
69,
199,
7,
2208,
1656,
259,
327,
378,
88,
20,
70,
199,
7,
14828,
621,
1656,
259,
327,
378,
88,
1400,
199,
7,
56,
262,
1656,
259,
327,
378,
88,
2869,
199,
7,
34,
1873,
1656,
259,
327,
378,
88,
2528,
199,
7,
1537,
79,
1656,
259,
327,
378,
88,
2481,
199,
7,
2395,
1656,
259,
327,
378,
88,
1477,
199,
7,
44,
290,
1656,
259,
327,
378,
88,
1229,
199,
7,
31707,
1656,
259,
327,
378,
88,
1367,
199,
7,
36,
13780,
1656,
259,
327,
378,
88,
1641,
199,
7,
4324,
1656,
259,
327,
378,
88,
2010,
199,
7,
3630,
79,
1656,
259,
327,
378,
88,
1427,
199,
7,
51,
1907,
1656,
259,
327,
378,
88,
21,
65,
199,
7,
46,
951,
1656,
259,
327,
378,
88,
21,
66,
199,
7,
27039,
1656,
259,
327,
378,
88,
21,
67,
199,
7,
44,
5653,
1656,
259,
327,
378,
88,
21,
68,
199,
7,
17975,
1656,
259,
327,
378,
88,
21,
69,
199,
7,
42,
262,
1656,
259,
327,
378,
88,
21,
70,
199,
7,
36,
621,
1656,
259,
327,
378,
88,
2259,
199,
7,
2662,
85,
1656,
259,
327,
378,
88,
2976,
199,
7,
52,
290,
1656,
259,
327,
378,
88,
2789,
199,
7,
17975,
1656,
259,
327,
378,
88,
2766,
199,
7,
44,
290,
1656,
259,
327,
378,
88,
772,
199,
7,
26607,
1656
] |
[
275,
334,
199,
7,
16911,
1656,
259,
327,
378,
88,
383,
199,
7,
58,
5812,
1656,
259,
327,
378,
88,
614,
199,
7,
39,
1458,
1656,
259,
327,
378,
88,
996,
199,
7,
43,
287,
1656,
259,
327,
378,
88,
1644,
199,
7,
20335,
1656,
259,
327,
378,
88,
966,
199,
7,
22731,
1656,
259,
327,
378,
88,
1717,
199,
7,
22731,
1656,
259,
327,
378,
88,
1690,
199,
7,
19590,
1656,
259,
327,
378,
88,
1780,
199,
7,
1049,
951,
1656,
259,
327,
378,
88,
2036,
199,
7,
56,
1873,
1656,
259,
327,
378,
88,
1643,
199,
7,
34,
5653,
1656,
259,
327,
378,
88,
16,
65,
199,
7,
1341,
69,
1656,
259,
327,
378,
88,
16,
66,
199,
7,
43,
324,
1656,
259,
327,
378,
88,
16,
67,
199,
7,
36,
7856,
1656,
259,
327,
378,
88,
16,
68,
199,
7,
14828,
85,
1656,
259,
327,
378,
88,
16,
69,
199,
7,
14828,
85,
1656,
259,
327,
378,
88,
16,
70,
199,
7,
1966,
1656,
259,
327,
378,
88,
709,
199,
7,
57,
7856,
1656,
259,
327,
378,
88,
845,
199,
7,
34,
8035,
1656,
259,
327,
378,
88,
713,
199,
7,
34,
8035,
1656,
259,
327,
378,
88,
969,
199,
7,
19590,
1656,
259,
327,
378,
88,
1079,
199,
7,
24388,
1656,
259,
327,
378,
88,
1046,
199,
7,
52,
7856,
1656,
259,
327,
378,
88,
975,
199,
7,
26797,
1656,
259,
327,
378,
88,
1196,
199,
7,
40,
1907,
1656,
259,
327,
378,
88,
1085,
199,
7,
3655,
73,
1656,
259,
327,
378,
88,
1167,
199,
7,
1049,
85,
1656,
259,
327,
378,
88,
17,
65,
199,
7,
18176,
1656,
259,
327,
378,
88,
17,
66,
199,
7,
1327,
65,
1656,
259,
327,
378,
88,
17,
67,
199,
7,
26852,
13361,
1656,
259,
327,
378,
88,
17,
68,
199,
7,
57,
324,
1656,
259,
327,
378,
88,
17,
69,
199,
7,
25014,
1656,
259,
327,
378,
88,
17,
70,
199,
7,
39,
810,
1656,
259,
327,
378,
88,
1165,
199,
7,
25014,
1656,
259,
327,
378,
88,
2025,
199,
7,
40,
1458,
73,
1656,
259,
327,
378,
88,
1081,
199,
7,
50,
951,
1656,
259,
327,
378,
88,
1789,
199,
7,
57,
7856,
1656,
259,
327,
378,
88,
1194,
199,
7,
50,
85,
1656,
259,
327,
378,
88,
821,
199,
7,
46,
5789,
1656,
259,
327,
378,
88,
1479,
199,
7,
16911,
951,
1656,
259,
327,
378,
88,
1465,
199,
7,
51,
13780,
1656,
259,
327,
378,
88,
1651,
199,
7,
28018,
1656,
259,
327,
378,
88,
1398,
199,
7,
22664,
1656,
259,
327,
378,
88,
18,
65,
199,
7,
29218,
1656,
259,
327,
378,
88,
18,
66,
199,
7,
51,
621,
1656,
259,
327,
378,
88,
18,
67,
199,
7,
46,
18939,
1656,
259,
327,
378,
88,
18,
68,
199,
7,
57,
316,
1656,
259,
327,
378,
88,
18,
69,
199,
7,
42,
1873,
1656,
259,
327,
378,
88,
18,
70,
199,
7,
49,
5653,
1656,
259,
327,
378,
88,
1216,
199,
7,
40,
1458,
73,
1656,
259,
327,
378,
88,
2192,
199,
7,
31487,
1656,
259,
327,
378,
88,
708,
199,
7,
44,
5653,
1656,
259,
327,
378,
88,
1153,
199,
7,
34,
8035,
1656,
259,
327,
378,
88,
1082,
199,
7,
13009,
1656,
259,
327,
378,
88,
1276,
199,
7,
58,
426,
1656,
259,
327,
378,
88,
1344,
199,
7,
2662,
73,
1656,
259,
327,
378,
88,
1401,
199,
7,
18176,
1656,
259,
327,
378,
88,
1703,
199,
7,
21001,
1656,
259,
327,
378,
88,
1355,
199,
7,
1341,
69,
1656,
259,
327,
378,
88,
19,
65,
199,
7,
56,
1873,
1656,
259,
327,
378,
88,
19,
66,
199,
7,
56,
5653,
1656,
259,
327,
378,
88,
19,
67,
199,
7,
6004,
73,
1656,
259,
327,
378,
88,
19,
68,
199,
7,
34,
18939,
1656,
259,
327,
378,
88,
19,
69,
199,
7,
3630,
79,
1656,
259,
327,
378,
88,
19,
70,
199,
7,
16911,
1656,
259,
327,
378,
88,
2167,
199,
7,
16911,
621,
1656,
259,
327,
378,
88,
2953,
199,
7,
18569,
1656,
259,
327,
378,
88,
2260,
199,
7,
34,
8035,
1656,
259,
327,
378,
88,
2824,
199,
7,
14828,
621,
1656,
259,
327,
378,
88,
1602,
199,
7,
1049,
24278,
1187,
65,
1656,
259,
327,
378,
88,
2322,
199,
7,
26607,
1656,
259,
327,
378,
88,
2466,
199,
7,
42,
5653,
1656,
259,
327,
378,
88,
2417,
199,
7,
12674,
7856,
1656,
259,
327,
378,
88,
2006,
199,
7,
42,
5653,
1656,
259,
327,
378,
88,
1887,
199,
7,
58,
1907,
1656,
259,
327,
378,
88,
20,
65,
199,
7,
16911,
1656,
259,
327,
378,
88,
20,
66,
199,
7,
29336,
1656,
259,
327,
378,
88,
20,
67,
199,
7,
13163,
1656,
259,
327,
378,
88,
20,
68,
199,
7,
29745,
1656,
259,
327,
378,
88,
20,
69,
199,
7,
2208,
1656,
259,
327,
378,
88,
20,
70,
199,
7,
14828,
621,
1656,
259,
327,
378,
88,
1400,
199,
7,
56,
262,
1656,
259,
327,
378,
88,
2869,
199,
7,
34,
1873,
1656,
259,
327,
378,
88,
2528,
199,
7,
1537,
79,
1656,
259,
327,
378,
88,
2481,
199,
7,
2395,
1656,
259,
327,
378,
88,
1477,
199,
7,
44,
290,
1656,
259,
327,
378,
88,
1229,
199,
7,
31707,
1656,
259,
327,
378,
88,
1367,
199,
7,
36,
13780,
1656,
259,
327,
378,
88,
1641,
199,
7,
4324,
1656,
259,
327,
378,
88,
2010,
199,
7,
3630,
79,
1656,
259,
327,
378,
88,
1427,
199,
7,
51,
1907,
1656,
259,
327,
378,
88,
21,
65,
199,
7,
46,
951,
1656,
259,
327,
378,
88,
21,
66,
199,
7,
27039,
1656,
259,
327,
378,
88,
21,
67,
199,
7,
44,
5653,
1656,
259,
327,
378,
88,
21,
68,
199,
7,
17975,
1656,
259,
327,
378,
88,
21,
69,
199,
7,
42,
262,
1656,
259,
327,
378,
88,
21,
70,
199,
7,
36,
621,
1656,
259,
327,
378,
88,
2259,
199,
7,
2662,
85,
1656,
259,
327,
378,
88,
2976,
199,
7,
52,
290,
1656,
259,
327,
378,
88,
2789,
199,
7,
17975,
1656,
259,
327,
378,
88,
2766,
199,
7,
44,
290,
1656,
259,
327,
378,
88,
772,
199,
7,
26607,
1656,
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,
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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
] |
Javiercerna/MissionPlanner
|
Lib/chunk.py
|
65
|
5539
|
"""Simple class to read IFF chunks.
An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
Format)) has the following structure:
+----------------+
| ID (4 bytes) |
+----------------+
| size (4 bytes) |
+----------------+
| data |
| ... |
+----------------+
The ID is a 4-byte string which identifies the type of chunk.
The size field (a 32-bit value, encoded using big-endian byte order)
gives the size of the whole chunk, including the 8-byte header.
Usually an IFF-type file consists of one or more chunks. The proposed
usage of the Chunk class defined here is to instantiate an instance at
the start of each chunk and read from the instance until it reaches
the end, after which a new instance can be instantiated. At the end
of the file, creating a new instance will fail with a EOFError
exception.
Usage:
while True:
try:
chunk = Chunk(file)
except EOFError:
break
chunktype = chunk.getname()
while True:
data = chunk.read(nbytes)
if not data:
pass
# do something with data
The interface is file-like. The implemented methods are:
read, close, seek, tell, isatty.
Extra methods are: skip() (called by close, skips to the end of the chunk),
getname() (returns the name (ID) of the chunk)
The __init__ method has one required argument, a file-like object
(including a chunk instance), and one optional argument, a flag which
specifies whether or not chunks are aligned on 2-byte boundaries. The
default is 1, i.e. aligned.
"""
class Chunk:
def __init__(self, file, align=True, bigendian=True, inclheader=False):
import struct
self.closed = False
self.align = align # whether to align to word (2-byte) boundaries
if bigendian:
strflag = '>'
else:
strflag = '<'
self.file = file
self.chunkname = file.read(4)
if len(self.chunkname) < 4:
raise EOFError
try:
self.chunksize = struct.unpack(strflag+'L', file.read(4))[0]
except struct.error:
raise EOFError
if inclheader:
self.chunksize = self.chunksize - 8 # subtract header
self.size_read = 0
try:
self.offset = self.file.tell()
except (AttributeError, IOError):
self.seekable = False
else:
self.seekable = True
def getname(self):
"""Return the name (ID) of the current chunk."""
return self.chunkname
def getsize(self):
"""Return the size of the current chunk."""
return self.chunksize
def close(self):
if not self.closed:
self.skip()
self.closed = True
def isatty(self):
if self.closed:
raise ValueError, "I/O operation on closed file"
return False
def seek(self, pos, whence=0):
"""Seek to specified position into the chunk.
Default position is 0 (start of chunk).
If the file is not seekable, this will result in an error.
"""
if self.closed:
raise ValueError, "I/O operation on closed file"
if not self.seekable:
raise IOError, "cannot seek"
if whence == 1:
pos = pos + self.size_read
elif whence == 2:
pos = pos + self.chunksize
if pos < 0 or pos > self.chunksize:
raise RuntimeError
self.file.seek(self.offset + pos, 0)
self.size_read = pos
def tell(self):
if self.closed:
raise ValueError, "I/O operation on closed file"
return self.size_read
def read(self, size=-1):
"""Read at most size bytes from the chunk.
If size is omitted or negative, read until the end
of the chunk.
"""
if self.closed:
raise ValueError, "I/O operation on closed file"
if self.size_read >= self.chunksize:
return ''
if size < 0:
size = self.chunksize - self.size_read
if size > self.chunksize - self.size_read:
size = self.chunksize - self.size_read
data = self.file.read(size)
self.size_read = self.size_read + len(data)
if self.size_read == self.chunksize and \
self.align and \
(self.chunksize & 1):
dummy = self.file.read(1)
self.size_read = self.size_read + len(dummy)
return data
def skip(self):
"""Skip the rest of the chunk.
If you are not interested in the contents of the chunk,
this method should be called so that the file points to
the start of the next chunk.
"""
if self.closed:
raise ValueError, "I/O operation on closed file"
if self.seekable:
try:
n = self.chunksize - self.size_read
# maybe fix alignment
if self.align and (self.chunksize & 1):
n = n + 1
self.file.seek(n, 1)
self.size_read = self.size_read + n
return
except IOError:
pass
while self.size_read < self.chunksize:
n = min(8192, self.chunksize - self.size_read)
dummy = self.read(n)
if not dummy:
raise EOFError
|
gpl-3.0
|
[
624,
3184,
1021,
370,
1586,
473,
1665,
8291,
14,
2999,
199,
2493,
473,
1665,
3728,
334,
2972,
315,
6752,
4066,
465,
437,
24150,
12,
377,
24150,
12,
820,
45,
1665,
334,
10099,
11398,
3814,
202,
199,
3484,
430,
965,
314,
2569,
5523,
26,
2999,
199,
26106,
11,
202,
199,
92,
2870,
334,
20,
2783,
9,
257,
1204,
202,
199,
26106,
11,
202,
199,
92,
1568,
334,
20,
2783,
9,
1204,
202,
199,
26106,
11,
202,
199,
92,
666,
3698,
1204,
202,
199,
92,
2263,
3322,
1204,
202,
199,
26106,
11,
2999,
199,
1918,
2870,
365,
282,
841,
13,
4414,
1059,
1314,
22975,
314,
730,
402,
3728,
14,
2999,
199,
1918,
1568,
901,
334,
65,
4337,
13,
2075,
574,
12,
5737,
1808,
7282,
13,
15009,
3696,
1865,
9,
202,
199,
71,
7602,
314,
1568,
402,
314,
8852,
3728,
12,
5893,
314,
1695,
13,
4414,
1406,
14,
2999,
199,
23642,
3163,
376,
473,
1665,
13,
466,
570,
18581,
402,
1373,
503,
1655,
8291,
14,
221,
710,
14075,
202,
199,
3807,
402,
314,
25246,
1021,
3247,
2348,
365,
370,
17321,
376,
1256,
737,
202,
199,
1589,
1343,
402,
1924,
3728,
436,
1586,
687,
314,
1256,
5133,
652,
12276,
397,
202,
199,
1589,
1284,
12,
2410,
1314,
282,
892,
1256,
883,
506,
17544,
14,
221,
2854,
314,
1284,
202,
199,
1618,
314,
570,
12,
6425,
282,
892,
1256,
911,
2449,
543,
282,
21157,
202,
199,
1971,
14,
2999,
199,
7692,
26,
202,
199,
6710,
715,
26,
1128,
862,
26,
1039,
3728,
275,
25246,
8,
493,
9,
1128,
871,
21157,
26,
1039,
2059,
1128,
3728,
466,
275,
3728,
14,
362,
354,
342,
1128,
1830,
715,
26,
1039,
666,
275,
3728,
14,
739,
8,
31417,
9,
1039,
340,
440,
666,
26,
1675,
986,
1039,
327,
886,
6020,
543,
666,
2999,
199,
1918,
3217,
365,
570,
13,
2930,
14,
221,
710,
6366,
3102,
787,
26,
202,
199,
739,
12,
4002,
12,
12005,
12,
11480,
12,
365,
16623,
14,
202,
199,
7426,
3102,
787,
26,
3372,
342,
334,
3527,
701,
4002,
12,
30505,
370,
314,
1284,
402,
314,
3728,
395,
202,
199,
362,
354,
342,
334,
5808,
314,
536,
334,
998,
9,
402,
314,
3728,
9,
2999,
199,
1918,
636,
826,
363,
1083,
965,
1373,
1415,
1423,
12,
282,
570,
13,
2930,
909,
202,
199,
8,
15768,
282,
3728,
1256,
395,
436,
1373,
2716,
1423,
12,
282,
3305,
1314,
202,
199,
3017,
5604,
3775,
503,
440,
8291,
787,
22569,
641,
499,
13,
4414,
18135,
14,
221,
710,
202,
199,
885,
365,
413,
12,
284,
14,
69,
14,
22569,
14,
202,
199,
624,
2999,
199,
533,
25246,
26,
1128,
347,
636,
826,
721,
277,
12,
570,
12,
6998,
29,
549,
12,
7282,
15009,
29,
549,
12,
315,
429,
1291,
29,
797,
304,
1039,
492,
2702,
1039,
291,
14,
5938,
275,
756,
1039,
291,
14,
5743,
275,
6998,
420,
327,
3775,
370,
6998,
370,
4349,
334,
18,
13,
4414,
9,
18135,
1039,
340,
7282,
15009,
26,
1675,
620,
4173,
275,
21770,
1039,
587,
26,
1675,
620,
4173,
275,
24958,
1039,
291,
14,
493,
275,
570,
1039,
291,
14,
4604,
354,
275,
570,
14,
739,
8,
20,
9,
1039,
340,
822,
8,
277,
14,
4604,
354,
9,
665,
841,
26,
1675,
746,
21157,
1039,
862,
26,
1675,
291,
14,
30617,
275,
2702,
14,
5301,
8,
495,
4173,
4786,
44,
297,
570,
14,
739,
8,
20,
11515,
16,
61,
1039,
871,
2702,
14,
705,
26,
1675,
746,
21157,
1039,
340,
315,
429,
1291,
26,
1675,
291,
14,
30617,
275,
291,
14,
30617,
446,
1695,
327,
24129,
1406,
1039,
291,
14,
890,
63,
739,
275,
378,
1039,
862,
26,
1675,
291,
14,
2743,
275,
291,
14,
493,
14,
9974,
342,
1039,
871,
334,
10227,
12,
5925,
304,
1675,
291,
14,
25895,
275,
756,
1039,
587,
26,
1675,
291,
14,
25895,
275,
715,
2958,
347,
664,
354,
8,
277,
304,
1039,
408,
1767,
314,
536,
334,
998,
9,
402,
314,
1453,
3728,
1041,
1039,
372,
291,
14,
4604,
354,
2958,
347,
664,
890,
8,
277,
304,
1039,
408,
1767,
314,
1568,
402,
314,
1453,
3728,
1041,
1039,
372,
291,
14,
30617,
2958,
347,
4002,
8,
277,
304,
1039,
340,
440,
291,
14,
5938,
26,
1675,
291,
14,
2759,
342,
1675,
291,
14,
5938,
275,
715,
2958,
347,
365,
16623,
8,
277,
304,
1039,
340,
291,
14,
5938,
26,
1675,
746,
1722,
12,
298,
41,
15,
47,
3439,
641,
6876,
570,
2,
1039,
372,
756,
2958,
347,
12005,
8,
277,
12,
2086,
12,
23328,
29,
16,
304,
1039,
408,
19168,
370,
2013,
3421,
1901,
314,
3728,
14,
1039,
3758,
3421,
365,
378,
334,
928,
402,
3728,
680,
1039,
982,
314,
570,
365,
440,
12005,
461,
12,
642,
911,
754,
315,
376,
1125,
14,
1039,
408,
4341,
340,
291,
14,
5938,
26,
1675,
746,
1722,
12,
298,
41,
15,
47,
3439,
641,
6876,
570,
2,
1039,
340,
440,
291,
14,
25895,
26,
1675,
746,
5925,
12,
298,
11250,
12005,
2,
1039,
340,
23328,
508,
413,
26,
1675,
2086,
275,
2086,
435,
291,
14,
890,
63,
739,
1039,
916,
23328,
508,
499,
26,
1675,
2086,
275,
2086,
435,
291,
14,
30617,
1039,
340,
2086,
665,
378,
503,
2086,
690,
291,
14,
30617,
26,
1675,
746,
6064,
1039,
291,
14,
493,
14,
5507,
8,
277,
14,
2743,
435,
2086,
12,
378,
9,
1039,
291,
14,
890,
63,
739,
275,
2086,
2958,
347,
11480,
8,
277,
304,
1039,
340,
291,
14,
5938,
26,
1675,
746,
1722,
12,
298,
41,
15,
47,
3439,
641,
6876,
570,
2,
1039,
372,
291,
14,
890,
63,
739,
2958,
347,
1586,
8,
277,
12,
1568,
4022,
17,
304,
1039,
408,
3284,
737,
4750,
1568,
2783,
687,
314,
3728,
14,
1039,
982,
1568,
365,
11684,
503,
6946,
12,
1586,
5133,
314,
1284,
1039,
402,
314,
3728,
14,
1039,
408,
4341,
340,
291,
14,
5938,
26,
1675,
746,
1722,
12,
298,
41,
15,
47,
3439,
641,
6876,
570,
2,
1039,
340,
291,
14,
890,
63,
739,
2356,
291,
14,
30617,
26,
1675,
372,
2125,
1039,
340,
1568,
665,
378,
26,
1675,
1568,
275,
291,
14,
30617,
446,
291,
14,
890,
63,
739,
1039,
340,
1568,
690,
291,
14,
30617,
446,
291,
14,
890,
63,
739,
26,
1675,
1568,
275,
291
] |
[
3184,
1021,
370,
1586,
473,
1665,
8291,
14,
2999,
199,
2493,
473,
1665,
3728,
334,
2972,
315,
6752,
4066,
465,
437,
24150,
12,
377,
24150,
12,
820,
45,
1665,
334,
10099,
11398,
3814,
202,
199,
3484,
430,
965,
314,
2569,
5523,
26,
2999,
199,
26106,
11,
202,
199,
92,
2870,
334,
20,
2783,
9,
257,
1204,
202,
199,
26106,
11,
202,
199,
92,
1568,
334,
20,
2783,
9,
1204,
202,
199,
26106,
11,
202,
199,
92,
666,
3698,
1204,
202,
199,
92,
2263,
3322,
1204,
202,
199,
26106,
11,
2999,
199,
1918,
2870,
365,
282,
841,
13,
4414,
1059,
1314,
22975,
314,
730,
402,
3728,
14,
2999,
199,
1918,
1568,
901,
334,
65,
4337,
13,
2075,
574,
12,
5737,
1808,
7282,
13,
15009,
3696,
1865,
9,
202,
199,
71,
7602,
314,
1568,
402,
314,
8852,
3728,
12,
5893,
314,
1695,
13,
4414,
1406,
14,
2999,
199,
23642,
3163,
376,
473,
1665,
13,
466,
570,
18581,
402,
1373,
503,
1655,
8291,
14,
221,
710,
14075,
202,
199,
3807,
402,
314,
25246,
1021,
3247,
2348,
365,
370,
17321,
376,
1256,
737,
202,
199,
1589,
1343,
402,
1924,
3728,
436,
1586,
687,
314,
1256,
5133,
652,
12276,
397,
202,
199,
1589,
1284,
12,
2410,
1314,
282,
892,
1256,
883,
506,
17544,
14,
221,
2854,
314,
1284,
202,
199,
1618,
314,
570,
12,
6425,
282,
892,
1256,
911,
2449,
543,
282,
21157,
202,
199,
1971,
14,
2999,
199,
7692,
26,
202,
199,
6710,
715,
26,
1128,
862,
26,
1039,
3728,
275,
25246,
8,
493,
9,
1128,
871,
21157,
26,
1039,
2059,
1128,
3728,
466,
275,
3728,
14,
362,
354,
342,
1128,
1830,
715,
26,
1039,
666,
275,
3728,
14,
739,
8,
31417,
9,
1039,
340,
440,
666,
26,
1675,
986,
1039,
327,
886,
6020,
543,
666,
2999,
199,
1918,
3217,
365,
570,
13,
2930,
14,
221,
710,
6366,
3102,
787,
26,
202,
199,
739,
12,
4002,
12,
12005,
12,
11480,
12,
365,
16623,
14,
202,
199,
7426,
3102,
787,
26,
3372,
342,
334,
3527,
701,
4002,
12,
30505,
370,
314,
1284,
402,
314,
3728,
395,
202,
199,
362,
354,
342,
334,
5808,
314,
536,
334,
998,
9,
402,
314,
3728,
9,
2999,
199,
1918,
636,
826,
363,
1083,
965,
1373,
1415,
1423,
12,
282,
570,
13,
2930,
909,
202,
199,
8,
15768,
282,
3728,
1256,
395,
436,
1373,
2716,
1423,
12,
282,
3305,
1314,
202,
199,
3017,
5604,
3775,
503,
440,
8291,
787,
22569,
641,
499,
13,
4414,
18135,
14,
221,
710,
202,
199,
885,
365,
413,
12,
284,
14,
69,
14,
22569,
14,
202,
199,
624,
2999,
199,
533,
25246,
26,
1128,
347,
636,
826,
721,
277,
12,
570,
12,
6998,
29,
549,
12,
7282,
15009,
29,
549,
12,
315,
429,
1291,
29,
797,
304,
1039,
492,
2702,
1039,
291,
14,
5938,
275,
756,
1039,
291,
14,
5743,
275,
6998,
420,
327,
3775,
370,
6998,
370,
4349,
334,
18,
13,
4414,
9,
18135,
1039,
340,
7282,
15009,
26,
1675,
620,
4173,
275,
21770,
1039,
587,
26,
1675,
620,
4173,
275,
24958,
1039,
291,
14,
493,
275,
570,
1039,
291,
14,
4604,
354,
275,
570,
14,
739,
8,
20,
9,
1039,
340,
822,
8,
277,
14,
4604,
354,
9,
665,
841,
26,
1675,
746,
21157,
1039,
862,
26,
1675,
291,
14,
30617,
275,
2702,
14,
5301,
8,
495,
4173,
4786,
44,
297,
570,
14,
739,
8,
20,
11515,
16,
61,
1039,
871,
2702,
14,
705,
26,
1675,
746,
21157,
1039,
340,
315,
429,
1291,
26,
1675,
291,
14,
30617,
275,
291,
14,
30617,
446,
1695,
327,
24129,
1406,
1039,
291,
14,
890,
63,
739,
275,
378,
1039,
862,
26,
1675,
291,
14,
2743,
275,
291,
14,
493,
14,
9974,
342,
1039,
871,
334,
10227,
12,
5925,
304,
1675,
291,
14,
25895,
275,
756,
1039,
587,
26,
1675,
291,
14,
25895,
275,
715,
2958,
347,
664,
354,
8,
277,
304,
1039,
408,
1767,
314,
536,
334,
998,
9,
402,
314,
1453,
3728,
1041,
1039,
372,
291,
14,
4604,
354,
2958,
347,
664,
890,
8,
277,
304,
1039,
408,
1767,
314,
1568,
402,
314,
1453,
3728,
1041,
1039,
372,
291,
14,
30617,
2958,
347,
4002,
8,
277,
304,
1039,
340,
440,
291,
14,
5938,
26,
1675,
291,
14,
2759,
342,
1675,
291,
14,
5938,
275,
715,
2958,
347,
365,
16623,
8,
277,
304,
1039,
340,
291,
14,
5938,
26,
1675,
746,
1722,
12,
298,
41,
15,
47,
3439,
641,
6876,
570,
2,
1039,
372,
756,
2958,
347,
12005,
8,
277,
12,
2086,
12,
23328,
29,
16,
304,
1039,
408,
19168,
370,
2013,
3421,
1901,
314,
3728,
14,
1039,
3758,
3421,
365,
378,
334,
928,
402,
3728,
680,
1039,
982,
314,
570,
365,
440,
12005,
461,
12,
642,
911,
754,
315,
376,
1125,
14,
1039,
408,
4341,
340,
291,
14,
5938,
26,
1675,
746,
1722,
12,
298,
41,
15,
47,
3439,
641,
6876,
570,
2,
1039,
340,
440,
291,
14,
25895,
26,
1675,
746,
5925,
12,
298,
11250,
12005,
2,
1039,
340,
23328,
508,
413,
26,
1675,
2086,
275,
2086,
435,
291,
14,
890,
63,
739,
1039,
916,
23328,
508,
499,
26,
1675,
2086,
275,
2086,
435,
291,
14,
30617,
1039,
340,
2086,
665,
378,
503,
2086,
690,
291,
14,
30617,
26,
1675,
746,
6064,
1039,
291,
14,
493,
14,
5507,
8,
277,
14,
2743,
435,
2086,
12,
378,
9,
1039,
291,
14,
890,
63,
739,
275,
2086,
2958,
347,
11480,
8,
277,
304,
1039,
340,
291,
14,
5938,
26,
1675,
746,
1722,
12,
298,
41,
15,
47,
3439,
641,
6876,
570,
2,
1039,
372,
291,
14,
890,
63,
739,
2958,
347,
1586,
8,
277,
12,
1568,
4022,
17,
304,
1039,
408,
3284,
737,
4750,
1568,
2783,
687,
314,
3728,
14,
1039,
982,
1568,
365,
11684,
503,
6946,
12,
1586,
5133,
314,
1284,
1039,
402,
314,
3728,
14,
1039,
408,
4341,
340,
291,
14,
5938,
26,
1675,
746,
1722,
12,
298,
41,
15,
47,
3439,
641,
6876,
570,
2,
1039,
340,
291,
14,
890,
63,
739,
2356,
291,
14,
30617,
26,
1675,
372,
2125,
1039,
340,
1568,
665,
378,
26,
1675,
1568,
275,
291,
14,
30617,
446,
291,
14,
890,
63,
739,
1039,
340,
1568,
690,
291,
14,
30617,
446,
291,
14,
890,
63,
739,
26,
1675,
1568,
275,
291,
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,
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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
] |
tmpgit/intellij-community
|
python/testData/inspections/PyNumpyType/Empty.py
|
69
|
1456
|
def empty(shape, dtype=None, order='C'): # real signature unknown; restored from __doc__
"""
empty(shape, dtype=float, order='C')
Return a new array of given shape and type, without initializing entries.
Parameters
----------
shape : int or tuple of int
Shape of the empty array
dtype : data-type, optional
Desired output data-type.
order : {'C', 'F'}, optional
Whether to store multi-dimensional data in C (row-major) or
Fortran (column-major) order in memory.
Returns
-------
out : ndarray
Array of uninitialized (arbitrary) data with the given
shape, dtype, and order.
See Also
--------
empty_like, zeros, ones
Notes
-----
`empty`, unlike `zeros`, does not set the array values to zero,
and may therefore be marginally faster. On the other hand, it requires
the user to manually set all the values in the array, and should be
used with caution.
Examples
--------
>>> np.empty([2, 2])
array([[ -9.74499359e+001, 6.69583040e-309],
[ 2.13182611e-314, 3.06959433e-309]]) #random
>>> np.empty([2, 2], dtype=int)
array([[-1073741821, -1067949133],
[ 496041986, 19249760]]) #random
"""
pass
empty([2, 2])
|
apache-2.0
|
[
318,
2701,
8,
1392,
12,
2152,
29,
403,
12,
1865,
534,
35,
735,
327,
3363,
4955,
5809,
27,
14429,
687,
636,
1301,
363,
272,
408,
272,
2701,
8,
1392,
12,
2152,
29,
1609,
12,
1865,
534,
35,
358,
398,
1432,
282,
892,
1625,
402,
1627,
2215,
436,
730,
12,
1928,
29141,
4811,
14,
398,
3897,
267,
4143,
267,
2215,
520,
1109,
503,
2008,
402,
1109,
288,
16528,
402,
314,
2701,
1625,
267,
2152,
520,
666,
13,
466,
12,
2716,
288,
1487,
5381,
1072,
666,
13,
466,
14,
267,
1865,
520,
791,
35,
297,
283,
38,
2267,
2716,
288,
7480,
370,
3877,
3510,
13,
13014,
666,
315,
445,
334,
1143,
13,
8452,
9,
503,
288,
19998,
334,
2301,
13,
8452,
9,
1865,
315,
4402,
14,
398,
1803,
267,
5514,
267,
734,
520,
6800,
288,
8725,
402,
625,
12486,
334,
285,
8734,
9,
666,
543,
314,
1627,
288,
2215,
12,
2152,
12,
436,
1865,
14,
398,
1666,
6121,
267,
3001,
267,
2701,
63,
2930,
12,
10136,
12,
7869,
398,
8144,
267,
9063,
267,
658,
1667,
3559,
29750,
658,
4250,
3559,
1630,
440,
663,
314,
1625,
1338,
370,
4697,
12,
267,
436,
1443,
16119,
506,
11042,
1183,
12930,
14,
221,
4068,
314,
1163,
4926,
12,
652,
5074,
267,
314,
922,
370,
10250,
663,
1006,
314,
1338,
315,
314,
1625,
12,
436,
1077,
506,
267,
1202,
543,
1704,
2206,
14,
398,
6058,
267,
3001,
267,
1306,
980,
14,
1667,
779,
18,
12,
499,
566,
267,
1625,
4038,
446,
25,
14,
15839,
1020,
11444,
69,
11,
4587,
12,
257,
1227,
14,
1876,
2010,
8533,
16,
69,
13,
10556,
467,
2049,
359,
221,
499,
14,
969,
1085,
1479,
845,
69,
13,
8988,
12,
257,
650,
14,
18264,
15667,
1153,
69,
13,
10556,
3934,
260,
327,
2355,
398,
1306,
980,
14,
1667,
779,
18,
12,
499,
467,
2152,
29,
442,
9,
267,
1625,
22844,
709,
28403,
1085,
2025,
12,
446,
709,
1822,
15674,
10456,
467,
2049,
359,
221,
841,
2534,
966,
1167,
1184,
12,
259,
5851,
11032,
19036,
3934,
9326,
327,
2355,
272,
408,
272,
986,
199,
199,
1667,
779,
18,
12,
499,
566,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2701,
8,
1392,
12,
2152,
29,
403,
12,
1865,
534,
35,
735,
327,
3363,
4955,
5809,
27,
14429,
687,
636,
1301,
363,
272,
408,
272,
2701,
8,
1392,
12,
2152,
29,
1609,
12,
1865,
534,
35,
358,
398,
1432,
282,
892,
1625,
402,
1627,
2215,
436,
730,
12,
1928,
29141,
4811,
14,
398,
3897,
267,
4143,
267,
2215,
520,
1109,
503,
2008,
402,
1109,
288,
16528,
402,
314,
2701,
1625,
267,
2152,
520,
666,
13,
466,
12,
2716,
288,
1487,
5381,
1072,
666,
13,
466,
14,
267,
1865,
520,
791,
35,
297,
283,
38,
2267,
2716,
288,
7480,
370,
3877,
3510,
13,
13014,
666,
315,
445,
334,
1143,
13,
8452,
9,
503,
288,
19998,
334,
2301,
13,
8452,
9,
1865,
315,
4402,
14,
398,
1803,
267,
5514,
267,
734,
520,
6800,
288,
8725,
402,
625,
12486,
334,
285,
8734,
9,
666,
543,
314,
1627,
288,
2215,
12,
2152,
12,
436,
1865,
14,
398,
1666,
6121,
267,
3001,
267,
2701,
63,
2930,
12,
10136,
12,
7869,
398,
8144,
267,
9063,
267,
658,
1667,
3559,
29750,
658,
4250,
3559,
1630,
440,
663,
314,
1625,
1338,
370,
4697,
12,
267,
436,
1443,
16119,
506,
11042,
1183,
12930,
14,
221,
4068,
314,
1163,
4926,
12,
652,
5074,
267,
314,
922,
370,
10250,
663,
1006,
314,
1338,
315,
314,
1625,
12,
436,
1077,
506,
267,
1202,
543,
1704,
2206,
14,
398,
6058,
267,
3001,
267,
1306,
980,
14,
1667,
779,
18,
12,
499,
566,
267,
1625,
4038,
446,
25,
14,
15839,
1020,
11444,
69,
11,
4587,
12,
257,
1227,
14,
1876,
2010,
8533,
16,
69,
13,
10556,
467,
2049,
359,
221,
499,
14,
969,
1085,
1479,
845,
69,
13,
8988,
12,
257,
650,
14,
18264,
15667,
1153,
69,
13,
10556,
3934,
260,
327,
2355,
398,
1306,
980,
14,
1667,
779,
18,
12,
499,
467,
2152,
29,
442,
9,
267,
1625,
22844,
709,
28403,
1085,
2025,
12,
446,
709,
1822,
15674,
10456,
467,
2049,
359,
221,
841,
2534,
966,
1167,
1184,
12,
259,
5851,
11032,
19036,
3934,
9326,
327,
2355,
272,
408,
272,
986,
199,
199,
1667,
779,
18,
12,
499,
566,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,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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
] |
ngageoint/voxel-globe
|
voxel_globe/meta/tools.py
|
2
|
2031
|
import numpy
import voxel_globe.meta.models
import inspect
def projectPoint(K, T, llh_xyz, xs, ys, distances=None, zs=None):
''' Project a set of points xs, ys (Nx1 numpy array each) through the K (3x3) T (4x4)
model at llh_xyz (3x1). You must either specify the distances to project
(scalar) or the z intersection planes (scalar)
returns dictionary with lon, lat, h'''
import voxel_globe.tools.enu as enu
debug = 0
if debug:
print 'xyz', xs,ys,zs
R = T[0:3, 0:3]
t = T[0:3, 3:]; #Extract 3x1, which is why the : is necessary
cam_center = -R.T.dot(t)
if debug:
print 'Cam_center', cam_center
P = K.dot(numpy.concatenate((R,t), axis=1))
Pi = numpy.matrix(P).I
if debug:
print 'P'
print repr(P)
print numpy.linalg.pinv(P)
print 'Pi', Pi
print [xs,ys,numpy.ones(xs.shape)]
ray = numpy.array(Pi).dot([xs,ys,numpy.ones(xs.shape)])
if debug:
print 'ray is currently', ray
if abs(ray[3,0]) < 1e-6:
ray = cam_center + ray[0:3,0:]
else:
ray = ray[0:,:]/ray[3,:]; #dehomoginize
if debug:
print llh_xyz
print 'ray was', ray
#dp = (P[2:3,:].T * ray[:]).sum(axis=0)
# Principal plane dot ray
# NOT WORKING
#if ray[3] < 0:
# dp *= -1
#print 'dot',dp
ray = cam_center-ray[0:3,:]
for c in range(ray.shape[1]):
if distances is None:
t = (zs - llh_xyz[2] - cam_center[2])/ray[2,c]; #project to sea level
else:
t = -distances / numpy.linalg.norm(ray[:,c])
#WHY is that minus sign there? Tried the dot product test above, didn't help
if debug:
print 't', t
print 'cam_center', cam_center
ray[:,c:c+1] = ray[:,c:c+1] * t + cam_center
if debug:
print 'ray is now', ray
llh2_xyz = enu.enu2llh(lon_origin=llh_xyz[0],
lat_origin=llh_xyz[1],
h_origin=llh_xyz[2],
east=ray[0,:],
north=ray[1,:],
up=ray[2,:])
return llh2_xyz
|
mit
|
[
646,
2680,
199,
646,
14164,
31418,
63,
6463,
69,
14,
2024,
14,
992,
199,
646,
6485,
199,
199,
318,
2199,
3428,
8,
43,
12,
377,
12,
18338,
72,
63,
8568,
12,
12965,
12,
19205,
12,
15108,
29,
403,
12,
1315,
83,
29,
403,
304,
523,
1449,
7290,
282,
663,
402,
4501,
12965,
12,
19205,
334,
46,
88,
17,
2680,
1625,
1924,
9,
4012,
314,
1804,
334,
19,
88,
19,
9,
377,
334,
20,
88,
20,
9,
15166,
1402,
737,
18338,
72,
63,
8568,
334,
19,
88,
17,
680,
2047,
1471,
1902,
4165,
314,
15108,
370,
2199,
489,
334,
7033,
9,
503,
314,
1315,
16223,
8683,
397,
334,
7033,
9,
32115,
2529,
2600,
543,
6132,
12,
8396,
12,
394,
2344,
523,
492,
14164,
31418,
63,
6463,
69,
14,
2537,
14,
5467,
465,
655,
85,
12244,
3105,
275,
378,
12244,
340,
3105,
26,
272,
870,
283,
8568,
297,
12965,
12,
588,
12,
31765,
819,
820,
275,
377,
59,
16,
26,
19,
12,
378,
26,
19,
61,
523,
307,
275,
377,
59,
16,
26,
19,
12,
650,
2938,
27,
327,
12147,
650,
88,
17,
12,
1314,
365,
10842,
314,
520,
365,
5784,
523,
27570,
63,
4218,
275,
446,
50,
14,
52,
14,
3287,
8,
84,
9,
523,
340,
3105,
26,
272,
870,
283,
30524,
63,
4218,
297,
27570,
63,
4218,
523,
510,
275,
1804,
14,
3287,
8,
4714,
14,
13433,
1332,
50,
12,
84,
395,
3114,
29,
17,
430,
523,
19835,
275,
2680,
14,
3642,
8,
48,
680,
41,
523,
340,
3105,
26,
272,
870,
283,
48,
7,
272,
870,
4700,
8,
48,
9,
272,
870,
2680,
14,
10096,
14,
80,
5350,
8,
48,
9,
272,
870,
283,
10542,
297,
19835,
272,
870,
359,
7977,
12,
588,
12,
4714,
14,
4548,
8,
7977,
14,
1392,
1874,
523,
22059,
275,
2680,
14,
1144,
8,
10542,
680,
3287,
779,
7977,
12,
588,
12,
4714,
14,
4548,
8,
7977,
14,
1392,
3948,
523,
340,
3105,
26,
272,
870,
283,
803,
365,
5544,
297,
22059,
2043,
8330,
340,
2853,
8,
803,
59,
19,
12,
16,
566,
665,
413,
69,
13,
22,
26,
272,
22059,
275,
27570,
63,
4218,
435,
22059,
59,
16,
26,
19,
12,
16,
2938,
523,
587,
26,
272,
22059,
275,
22059,
59,
16,
11941,
2938,
15,
803,
59,
19,
21063,
27,
327,
271,
526,
573,
903,
794,
12244,
340,
3105,
26,
272,
870,
18338,
72,
63,
8568,
272,
870,
283,
803,
1990,
297,
22059,
12244,
327,
5780,
275,
334,
48,
59,
18,
26,
19,
12,
11455,
52,
627,
22059,
1491,
6575,
1838,
8,
3127,
29,
16,
9,
523,
327,
25716,
11590,
16388,
6308,
22059,
523,
327,
2845,
29557,
43,
1206,
523,
327,
692,
22059,
59,
19,
61,
665,
378,
26,
523,
327,
221,
12392,
9000,
446,
17,
523,
327,
1361,
283,
3287,
297,
5780,
221,
819,
22059,
275,
27570,
63,
4218,
13,
803,
59,
16,
26,
19,
21063,
8330,
367,
286,
315,
1425,
8,
803,
14,
1392,
59,
17,
4682,
272,
340,
15108,
365,
488,
26,
489,
307,
275,
334,
31765,
446,
18338,
72,
63,
8568,
59,
18,
61,
446,
27570,
63,
4218,
59,
18,
23067,
803,
59,
18,
12,
67,
11566,
327,
1715,
370,
29894,
2166,
272,
587,
26,
489,
307,
275,
446,
15482,
1182,
2680,
14,
10096,
14,
4791,
8,
803,
3981,
67,
566,
489,
327,
9792,
57,
365,
626,
21357,
2070,
2337,
31,
12480,
379,
314,
6308,
3336,
511,
3432,
12,
9980,
1133,
1720,
272,
340,
3105,
26,
489,
870,
283,
84,
297,
307,
489,
870,
283,
15176,
63,
4218,
297,
27570,
63,
4218,
272,
22059,
3981,
67,
26,
67,
11,
17,
61,
275,
22059,
3981,
67,
26,
67,
11,
17,
61,
627,
307,
435,
27570,
63,
4218,
523,
340,
3105,
26,
272,
870,
283,
803,
365,
3063,
297,
22059,
221,
819,
18338,
72,
18,
63,
8568,
275,
655,
85,
14,
5467,
18,
914,
72,
8,
5298,
63,
6493,
29,
914,
72,
63,
8568,
59,
16,
467,
221,
586,
8396,
63,
6493,
29,
914,
72,
63,
8568,
59,
17,
467,
221,
586,
394,
63,
6493,
29,
914,
72,
63,
8568,
59,
18,
467,
221,
586,
30254,
29,
803,
59,
16,
12,
8429,
221,
586,
6590,
273,
29,
803,
59,
17,
12,
8429,
221,
586,
1536,
29,
803,
59,
18,
12,
5728,
523,
372,
18338,
72,
18,
63,
8568,
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
] |
[
2680,
199,
646,
14164,
31418,
63,
6463,
69,
14,
2024,
14,
992,
199,
646,
6485,
199,
199,
318,
2199,
3428,
8,
43,
12,
377,
12,
18338,
72,
63,
8568,
12,
12965,
12,
19205,
12,
15108,
29,
403,
12,
1315,
83,
29,
403,
304,
523,
1449,
7290,
282,
663,
402,
4501,
12965,
12,
19205,
334,
46,
88,
17,
2680,
1625,
1924,
9,
4012,
314,
1804,
334,
19,
88,
19,
9,
377,
334,
20,
88,
20,
9,
15166,
1402,
737,
18338,
72,
63,
8568,
334,
19,
88,
17,
680,
2047,
1471,
1902,
4165,
314,
15108,
370,
2199,
489,
334,
7033,
9,
503,
314,
1315,
16223,
8683,
397,
334,
7033,
9,
32115,
2529,
2600,
543,
6132,
12,
8396,
12,
394,
2344,
523,
492,
14164,
31418,
63,
6463,
69,
14,
2537,
14,
5467,
465,
655,
85,
12244,
3105,
275,
378,
12244,
340,
3105,
26,
272,
870,
283,
8568,
297,
12965,
12,
588,
12,
31765,
819,
820,
275,
377,
59,
16,
26,
19,
12,
378,
26,
19,
61,
523,
307,
275,
377,
59,
16,
26,
19,
12,
650,
2938,
27,
327,
12147,
650,
88,
17,
12,
1314,
365,
10842,
314,
520,
365,
5784,
523,
27570,
63,
4218,
275,
446,
50,
14,
52,
14,
3287,
8,
84,
9,
523,
340,
3105,
26,
272,
870,
283,
30524,
63,
4218,
297,
27570,
63,
4218,
523,
510,
275,
1804,
14,
3287,
8,
4714,
14,
13433,
1332,
50,
12,
84,
395,
3114,
29,
17,
430,
523,
19835,
275,
2680,
14,
3642,
8,
48,
680,
41,
523,
340,
3105,
26,
272,
870,
283,
48,
7,
272,
870,
4700,
8,
48,
9,
272,
870,
2680,
14,
10096,
14,
80,
5350,
8,
48,
9,
272,
870,
283,
10542,
297,
19835,
272,
870,
359,
7977,
12,
588,
12,
4714,
14,
4548,
8,
7977,
14,
1392,
1874,
523,
22059,
275,
2680,
14,
1144,
8,
10542,
680,
3287,
779,
7977,
12,
588,
12,
4714,
14,
4548,
8,
7977,
14,
1392,
3948,
523,
340,
3105,
26,
272,
870,
283,
803,
365,
5544,
297,
22059,
2043,
8330,
340,
2853,
8,
803,
59,
19,
12,
16,
566,
665,
413,
69,
13,
22,
26,
272,
22059,
275,
27570,
63,
4218,
435,
22059,
59,
16,
26,
19,
12,
16,
2938,
523,
587,
26,
272,
22059,
275,
22059,
59,
16,
11941,
2938,
15,
803,
59,
19,
21063,
27,
327,
271,
526,
573,
903,
794,
12244,
340,
3105,
26,
272,
870,
18338,
72,
63,
8568,
272,
870,
283,
803,
1990,
297,
22059,
12244,
327,
5780,
275,
334,
48,
59,
18,
26,
19,
12,
11455,
52,
627,
22059,
1491,
6575,
1838,
8,
3127,
29,
16,
9,
523,
327,
25716,
11590,
16388,
6308,
22059,
523,
327,
2845,
29557,
43,
1206,
523,
327,
692,
22059,
59,
19,
61,
665,
378,
26,
523,
327,
221,
12392,
9000,
446,
17,
523,
327,
1361,
283,
3287,
297,
5780,
221,
819,
22059,
275,
27570,
63,
4218,
13,
803,
59,
16,
26,
19,
21063,
8330,
367,
286,
315,
1425,
8,
803,
14,
1392,
59,
17,
4682,
272,
340,
15108,
365,
488,
26,
489,
307,
275,
334,
31765,
446,
18338,
72,
63,
8568,
59,
18,
61,
446,
27570,
63,
4218,
59,
18,
23067,
803,
59,
18,
12,
67,
11566,
327,
1715,
370,
29894,
2166,
272,
587,
26,
489,
307,
275,
446,
15482,
1182,
2680,
14,
10096,
14,
4791,
8,
803,
3981,
67,
566,
489,
327,
9792,
57,
365,
626,
21357,
2070,
2337,
31,
12480,
379,
314,
6308,
3336,
511,
3432,
12,
9980,
1133,
1720,
272,
340,
3105,
26,
489,
870,
283,
84,
297,
307,
489,
870,
283,
15176,
63,
4218,
297,
27570,
63,
4218,
272,
22059,
3981,
67,
26,
67,
11,
17,
61,
275,
22059,
3981,
67,
26,
67,
11,
17,
61,
627,
307,
435,
27570,
63,
4218,
523,
340,
3105,
26,
272,
870,
283,
803,
365,
3063,
297,
22059,
221,
819,
18338,
72,
18,
63,
8568,
275,
655,
85,
14,
5467,
18,
914,
72,
8,
5298,
63,
6493,
29,
914,
72,
63,
8568,
59,
16,
467,
221,
586,
8396,
63,
6493,
29,
914,
72,
63,
8568,
59,
17,
467,
221,
586,
394,
63,
6493,
29,
914,
72,
63,
8568,
59,
18,
467,
221,
586,
30254,
29,
803,
59,
16,
12,
8429,
221,
586,
6590,
273,
29,
803,
59,
17,
12,
8429,
221,
586,
1536,
29,
803,
59,
18,
12,
5728,
523,
372,
18338,
72,
18,
63,
8568,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
leimaohui/dnf-yocto
|
dnf/subject.py
|
2
|
5147
|
# subject.py
# Implements Subject.
#
# Copyright (C) 2012-2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY expressed or implied, including the implied warranties 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. Any Red Hat trademarks that are incorporated in the
# source code or documentation are not subject to the GNU General Public
# License and may only be used or replicated with the express permission of
# Red Hat, Inc.
#
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from dnf.util import first, is_glob_pattern
import dnf.selector
import hawkey
import re
class Subject(object):
# :api
def __init__(self, pkg_spec, ignore_case=False):
self.subj = hawkey.Subject(pkg_spec) # internal subject
self.icase = ignore_case
def _nevra_to_filters(self, query, nevra):
nevra_attrs = [("name", True), ("epoch", False),
("version", False), ("release", False),
("arch", False)]
for (name, add_flags) in nevra_attrs:
attr = getattr(nevra, name)
flags = []
if attr is not None:
if add_flags:
flags = self._query_flags
query._filterm(*flags, **{name + '__glob': attr})
return query
@property
def _query_flags(self):
flags = []
if self.icase:
flags.append(hawkey.ICASE)
return flags
@property
def _filename_pattern(self):
return re.search(r"^\*?/", self.subj.pattern)
@property
def _pattern(self):
return self.subj.pattern
def _is_arch_specified(self, sack):
nevra = first(
self.subj.nevra_possibilities_real(sack, allow_globs=True))
if nevra and nevra.arch:
return is_glob_pattern(nevra.arch)
return False
def _has_nevra_just_name(self, sack, forms=None):
kwargs = {'allow_globs': True,
'icase': self.icase}
if forms is not None:
kwargs['form'] = forms
nevra = first(self.subj.nevra_possibilities_real(sack, **kwargs))
if nevra:
return nevra._has_just_name()
return False
def get_best_query(self, sack, with_provides=True, forms=None):
# :api
pat = self._pattern
kwargs = {'allow_globs': True,
'icase': self.icase}
if forms:
kwargs['form'] = forms
nevra = first(self.subj.nevra_possibilities_real(sack, **kwargs))
if nevra:
q = self._nevra_to_filters(sack.query(), nevra)
if q:
return q
if not forms:
if with_provides:
q = sack.query()._filterm(provides__glob=self._pattern)
if q:
return q
if self._filename_pattern:
return sack.query().filter(file__glob=pat)
return sack.query().filter(empty=True)
def get_best_selector(self, sack, forms=None):
# :api
kwargs = {'allow_globs': True}
if forms:
kwargs['form'] = forms
nevra = first(self.subj.nevra_possibilities_real(sack, **kwargs))
sltr = dnf.selector.Selector(sack)
if nevra:
q = self._nevra_to_filters(sack.query(), nevra)
if q:
if nevra._has_just_name():
q = q.union(sack.query().filter(obsoletes=q))
return sltr.set(pkg=q)
if not forms:
q = sack.query()._filterm(provides__glob=self._pattern)
if q:
return sltr.set(pkg=q)
if self._filename_pattern:
return sltr.set(pkg=sack.query()._filterm(file__glob=self._pattern))
return sltr
def _get_best_selectors(self, sack, forms=None):
if not self._filename_pattern and is_glob_pattern(self._pattern):
with_obsoletes = False
if self._has_nevra_just_name(sack, forms=forms):
with_obsoletes = True
q = self.get_best_query(sack, forms=forms)
sltrs = []
for name, pkgs_list in q._name_dict().items():
sltr = dnf.selector.Selector(sack)
if with_obsoletes:
pkgs_list = pkgs_list + sack.query().filter(
obsoletes=pkgs_list).run()
sltr.set(pkg=pkgs_list)
sltrs.append(sltr)
return sltrs
return [self.get_best_selector(sack, forms)]
|
gpl-2.0
|
[
3,
5420,
14,
647,
199,
3,
24664,
26793,
14,
199,
3,
199,
3,
1898,
334,
35,
9,
6029,
13,
9261,
9572,
13002,
12,
3277,
14,
199,
3,
199,
3,
961,
1331,
31816,
471,
6285,
365,
6326,
2808,
370,
29165,
13809,
316,
370,
675,
12,
199,
3,
2811,
12,
1331,
12,
503,
3604,
652,
5420,
370,
314,
2895,
436,
3704,
402,
199,
3,
314,
1664,
1696,
1684,
844,
373,
14,
18,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
1325,
2428,
199,
3,
1821,
3408,
19147,
503,
2478,
12,
5893,
314,
2478,
3712,
1417,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
1696,
199,
3,
1684,
844,
367,
1655,
2436,
14,
221,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
199,
3,
1664,
1696,
1684,
844,
3180,
543,
642,
2240,
27,
340,
440,
12,
2218,
370,
314,
199,
3,
2868,
2290,
2752,
12,
3277,
2020,
8026,
11236,
14259,
12,
12066,
11844,
12,
8226,
12,
4828,
199,
3,
11315,
13,
10067,
12,
8217,
14,
221,
6184,
9572,
13002,
21032,
10375,
626,
787,
30147,
972,
315,
314,
199,
3,
1350,
1233,
503,
3794,
787,
440,
5420,
370,
314,
1664,
1696,
1684,
199,
3,
844,
436,
1443,
1454,
506,
1202,
503,
32436,
543,
314,
4056,
4983,
402,
199,
3,
9572,
13002,
12,
3277,
14,
199,
3,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
504,
28215,
14,
1974,
492,
1642,
12,
365,
63,
6463,
63,
3401,
199,
199,
646,
28215,
14,
6662,
199,
646,
394,
10084,
498,
199,
646,
295,
421,
199,
533,
26793,
8,
785,
304,
272,
327,
520,
1246,
339,
347,
636,
826,
721,
277,
12,
5496,
63,
1650,
12,
3686,
63,
2546,
29,
797,
304,
267,
291,
14,
954,
74,
275,
394,
10084,
498,
14,
13528,
8,
4600,
63,
1650,
9,
221,
327,
5007,
5420,
267,
291,
14,
530,
482,
275,
3686,
63,
2546,
339,
347,
485,
685,
86,
345,
63,
475,
63,
4273,
8,
277,
12,
1827,
12,
1279,
86,
345,
304,
267,
1279,
86,
345,
63,
3288,
275,
10003,
354,
401,
715,
395,
1689,
7367,
401,
756,
395,
2432,
1689,
1023,
401,
756,
395,
1689,
3221,
401,
756,
395,
2432,
1689,
1047,
401,
756,
1874,
398,
367,
334,
354,
12,
1050,
63,
2469,
9,
315,
1279,
86,
345,
63,
3288,
26,
288,
1921,
275,
2519,
8,
685,
86,
345,
12,
536,
9,
288,
3285,
275,
942,
288,
340,
1921,
365,
440,
488,
26,
355,
340,
1050,
63,
2469,
26,
490,
3285,
275,
291,
423,
1131,
63,
2469,
355,
1827,
423,
1541,
77,
2031,
2469,
12,
31159,
354,
435,
2560,
6463,
356,
1921,
1552,
398,
372,
1827,
339,
768,
1829,
272,
347,
485,
1131,
63,
2469,
8,
277,
304,
267,
3285,
275,
942,
267,
340,
291,
14,
530,
482,
26,
288,
3285,
14,
740,
8,
2411,
87,
498,
14,
948,
8162,
9,
267,
372,
3285,
339,
768,
1829,
272,
347,
485,
1501,
63,
3401,
8,
277,
304,
267,
372,
295,
14,
1733,
8,
82,
2,
12773,
15279,
10665,
291,
14,
954,
74,
14,
3401,
9,
339,
768,
1829,
272,
347,
485,
3401,
8,
277,
304,
267,
372,
291,
14,
954,
74,
14,
3401,
339,
347,
485,
374,
63,
1047,
63,
10085,
8,
277,
12,
308,
564,
304,
267,
1279,
86,
345,
275,
1642,
8,
288,
291,
14,
954,
74,
14,
685,
86,
345,
63,
1712,
23422,
63,
3093,
8,
83,
564,
12,
2040,
63,
15581,
29,
549,
430,
267,
340,
1279,
86,
345,
436,
1279,
86,
345,
14,
1047,
26,
288,
372,
365,
63,
6463,
63,
3401,
8,
685,
86,
345,
14,
1047,
9,
267,
372,
756,
339,
347,
485,
1989,
63,
685,
86,
345,
63,
4764,
63,
354,
8,
277,
12,
308,
564,
12,
4513,
29,
403,
304,
267,
2074,
275,
791,
3306,
63,
15581,
356,
715,
12,
2116,
283,
530,
482,
356,
291,
14,
530,
482,
93,
267,
340,
4513,
365,
440,
488,
26,
288,
2074,
459,
964,
418,
275,
4513,
267,
1279,
86,
345,
275,
1642,
8,
277,
14,
954,
74,
14,
685,
86,
345,
63,
1712,
23422,
63,
3093,
8,
83,
564,
12,
1011,
958,
430,
267,
340,
1279,
86,
345,
26,
288,
372,
1279,
86,
345,
423,
1989,
63,
4764,
63,
354,
342,
267,
372,
756,
339,
347,
664,
63,
7010,
63,
1131,
8,
277,
12,
308,
564,
12,
543,
63,
20121,
29,
549,
12,
4513,
29,
403,
304,
267,
327,
520,
1246,
398,
12713,
275,
291,
423,
3401,
267,
2074,
275,
791,
3306,
63,
15581,
356,
715,
12,
2116,
283,
530,
482,
356,
291,
14,
530,
482,
93,
267,
340,
4513,
26,
288,
2074,
459,
964,
418,
275,
4513,
267,
1279,
86,
345,
275,
1642,
8,
277,
14,
954,
74,
14,
685,
86,
345,
63,
1712,
23422,
63,
3093,
8,
83,
564,
12,
1011,
958,
430,
267,
340,
1279,
86,
345,
26,
288,
1894,
275,
291,
423,
685,
86,
345,
63,
475,
63,
4273,
8,
83,
564,
14,
1131,
1062,
1279,
86,
345,
9,
288,
340,
1894,
26,
355,
372,
1894,
398,
340,
440,
4513,
26,
288,
340,
543,
63,
20121,
26,
355,
1894,
275,
308,
564,
14,
1131,
19050,
1541,
77,
8,
20121,
363,
6463,
29,
277,
423,
3401,
9,
355,
340,
1894,
26,
490,
372,
1894,
953,
340,
291,
423,
1501,
63,
3401,
26,
355,
372,
308,
564,
14,
1131,
1252,
1541,
8,
493,
363,
6463,
29,
10853,
9,
398,
372,
308,
564,
14,
1131,
1252,
1541,
8,
1667,
29,
549,
9,
339,
347,
664,
63,
7010,
63,
6662,
8,
277,
12,
308,
564,
12,
4513,
29,
403,
304,
267,
327,
520,
1246,
398,
2074,
275,
791,
3306,
63,
15581,
356,
715,
93,
267,
340,
4513,
26,
288,
2074,
459,
964,
418,
275,
4513,
267,
1279,
86,
345,
275,
1642,
8,
277,
14,
954,
74,
14,
685,
86,
345,
63,
1712,
23422,
63,
3093,
8,
83,
564,
12,
1011,
958,
430,
267,
5340,
454,
275,
28215,
14,
6662,
14,
11212,
8,
83,
564,
9,
267,
340,
1279,
86,
345,
26
] |
[
5420,
14,
647,
199,
3,
24664,
26793,
14,
199,
3,
199,
3,
1898,
334,
35,
9,
6029,
13,
9261,
9572,
13002,
12,
3277,
14,
199,
3,
199,
3,
961,
1331,
31816,
471,
6285,
365,
6326,
2808,
370,
29165,
13809,
316,
370,
675,
12,
199,
3,
2811,
12,
1331,
12,
503,
3604,
652,
5420,
370,
314,
2895,
436,
3704,
402,
199,
3,
314,
1664,
1696,
1684,
844,
373,
14,
18,
12,
503,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
199,
3,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
1325,
2428,
199,
3,
1821,
3408,
19147,
503,
2478,
12,
5893,
314,
2478,
3712,
1417,
402,
199,
3,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
1664,
1696,
199,
3,
1684,
844,
367,
1655,
2436,
14,
221,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
199,
3,
1664,
1696,
1684,
844,
3180,
543,
642,
2240,
27,
340,
440,
12,
2218,
370,
314,
199,
3,
2868,
2290,
2752,
12,
3277,
2020,
8026,
11236,
14259,
12,
12066,
11844,
12,
8226,
12,
4828,
199,
3,
11315,
13,
10067,
12,
8217,
14,
221,
6184,
9572,
13002,
21032,
10375,
626,
787,
30147,
972,
315,
314,
199,
3,
1350,
1233,
503,
3794,
787,
440,
5420,
370,
314,
1664,
1696,
1684,
199,
3,
844,
436,
1443,
1454,
506,
1202,
503,
32436,
543,
314,
4056,
4983,
402,
199,
3,
9572,
13002,
12,
3277,
14,
199,
3,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
504,
28215,
14,
1974,
492,
1642,
12,
365,
63,
6463,
63,
3401,
199,
199,
646,
28215,
14,
6662,
199,
646,
394,
10084,
498,
199,
646,
295,
421,
199,
533,
26793,
8,
785,
304,
272,
327,
520,
1246,
339,
347,
636,
826,
721,
277,
12,
5496,
63,
1650,
12,
3686,
63,
2546,
29,
797,
304,
267,
291,
14,
954,
74,
275,
394,
10084,
498,
14,
13528,
8,
4600,
63,
1650,
9,
221,
327,
5007,
5420,
267,
291,
14,
530,
482,
275,
3686,
63,
2546,
339,
347,
485,
685,
86,
345,
63,
475,
63,
4273,
8,
277,
12,
1827,
12,
1279,
86,
345,
304,
267,
1279,
86,
345,
63,
3288,
275,
10003,
354,
401,
715,
395,
1689,
7367,
401,
756,
395,
2432,
1689,
1023,
401,
756,
395,
1689,
3221,
401,
756,
395,
2432,
1689,
1047,
401,
756,
1874,
398,
367,
334,
354,
12,
1050,
63,
2469,
9,
315,
1279,
86,
345,
63,
3288,
26,
288,
1921,
275,
2519,
8,
685,
86,
345,
12,
536,
9,
288,
3285,
275,
942,
288,
340,
1921,
365,
440,
488,
26,
355,
340,
1050,
63,
2469,
26,
490,
3285,
275,
291,
423,
1131,
63,
2469,
355,
1827,
423,
1541,
77,
2031,
2469,
12,
31159,
354,
435,
2560,
6463,
356,
1921,
1552,
398,
372,
1827,
339,
768,
1829,
272,
347,
485,
1131,
63,
2469,
8,
277,
304,
267,
3285,
275,
942,
267,
340,
291,
14,
530,
482,
26,
288,
3285,
14,
740,
8,
2411,
87,
498,
14,
948,
8162,
9,
267,
372,
3285,
339,
768,
1829,
272,
347,
485,
1501,
63,
3401,
8,
277,
304,
267,
372,
295,
14,
1733,
8,
82,
2,
12773,
15279,
10665,
291,
14,
954,
74,
14,
3401,
9,
339,
768,
1829,
272,
347,
485,
3401,
8,
277,
304,
267,
372,
291,
14,
954,
74,
14,
3401,
339,
347,
485,
374,
63,
1047,
63,
10085,
8,
277,
12,
308,
564,
304,
267,
1279,
86,
345,
275,
1642,
8,
288,
291,
14,
954,
74,
14,
685,
86,
345,
63,
1712,
23422,
63,
3093,
8,
83,
564,
12,
2040,
63,
15581,
29,
549,
430,
267,
340,
1279,
86,
345,
436,
1279,
86,
345,
14,
1047,
26,
288,
372,
365,
63,
6463,
63,
3401,
8,
685,
86,
345,
14,
1047,
9,
267,
372,
756,
339,
347,
485,
1989,
63,
685,
86,
345,
63,
4764,
63,
354,
8,
277,
12,
308,
564,
12,
4513,
29,
403,
304,
267,
2074,
275,
791,
3306,
63,
15581,
356,
715,
12,
2116,
283,
530,
482,
356,
291,
14,
530,
482,
93,
267,
340,
4513,
365,
440,
488,
26,
288,
2074,
459,
964,
418,
275,
4513,
267,
1279,
86,
345,
275,
1642,
8,
277,
14,
954,
74,
14,
685,
86,
345,
63,
1712,
23422,
63,
3093,
8,
83,
564,
12,
1011,
958,
430,
267,
340,
1279,
86,
345,
26,
288,
372,
1279,
86,
345,
423,
1989,
63,
4764,
63,
354,
342,
267,
372,
756,
339,
347,
664,
63,
7010,
63,
1131,
8,
277,
12,
308,
564,
12,
543,
63,
20121,
29,
549,
12,
4513,
29,
403,
304,
267,
327,
520,
1246,
398,
12713,
275,
291,
423,
3401,
267,
2074,
275,
791,
3306,
63,
15581,
356,
715,
12,
2116,
283,
530,
482,
356,
291,
14,
530,
482,
93,
267,
340,
4513,
26,
288,
2074,
459,
964,
418,
275,
4513,
267,
1279,
86,
345,
275,
1642,
8,
277,
14,
954,
74,
14,
685,
86,
345,
63,
1712,
23422,
63,
3093,
8,
83,
564,
12,
1011,
958,
430,
267,
340,
1279,
86,
345,
26,
288,
1894,
275,
291,
423,
685,
86,
345,
63,
475,
63,
4273,
8,
83,
564,
14,
1131,
1062,
1279,
86,
345,
9,
288,
340,
1894,
26,
355,
372,
1894,
398,
340,
440,
4513,
26,
288,
340,
543,
63,
20121,
26,
355,
1894,
275,
308,
564,
14,
1131,
19050,
1541,
77,
8,
20121,
363,
6463,
29,
277,
423,
3401,
9,
355,
340,
1894,
26,
490,
372,
1894,
953,
340,
291,
423,
1501,
63,
3401,
26,
355,
372,
308,
564,
14,
1131,
1252,
1541,
8,
493,
363,
6463,
29,
10853,
9,
398,
372,
308,
564,
14,
1131,
1252,
1541,
8,
1667,
29,
549,
9,
339,
347,
664,
63,
7010,
63,
6662,
8,
277,
12,
308,
564,
12,
4513,
29,
403,
304,
267,
327,
520,
1246,
398,
2074,
275,
791,
3306,
63,
15581,
356,
715,
93,
267,
340,
4513,
26,
288,
2074,
459,
964,
418,
275,
4513,
267,
1279,
86,
345,
275,
1642,
8,
277,
14,
954,
74,
14,
685,
86,
345,
63,
1712,
23422,
63,
3093,
8,
83,
564,
12,
1011,
958,
430,
267,
5340,
454,
275,
28215,
14,
6662,
14,
11212,
8,
83,
564,
9,
267,
340,
1279,
86,
345,
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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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
] |
patriciolobos/desa8
|
openerp/addons/mass_mailing/wizard/mail_compose_message.py
|
308
|
3066
|
# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class MailComposeMessage(osv.TransientModel):
"""Add concept of mass mailing campaign to the mail.compose.message wizard
"""
_inherit = 'mail.compose.message'
_columns = {
'mass_mailing_campaign_id': fields.many2one(
'mail.mass_mailing.campaign', 'Mass Mailing Campaign',
),
'mass_mailing_id': fields.many2one(
'mail.mass_mailing', 'Mass Mailing'
),
'mass_mailing_name': fields.char('Mass Mailing'),
'mailing_list_ids': fields.many2many(
'mail.mass_mailing.list', string='Mailing List'
),
}
def get_mail_values(self, cr, uid, wizard, res_ids, context=None):
""" Override method that generated the mail content by creating the
mail.mail.statistics values in the o2m of mail_mail, when doing pure
email mass mailing. """
res = super(MailComposeMessage, self).get_mail_values(cr, uid, wizard, res_ids, context=context)
# use only for allowed models in mass mailing
if wizard.composition_mode == 'mass_mail' and \
(wizard.mass_mailing_name or wizard.mass_mailing_id) and \
wizard.model in [item[0] for item in self.pool['mail.mass_mailing']._get_mailing_model(cr, uid, context=context)]:
mass_mailing = wizard.mass_mailing_id
if not mass_mailing:
reply_to_mode = wizard.no_auto_thread and 'email' or 'thread'
reply_to = wizard.no_auto_thread and wizard.reply_to or False
mass_mailing_id = self.pool['mail.mass_mailing'].create(
cr, uid, {
'mass_mailing_campaign_id': wizard.mass_mailing_campaign_id and wizard.mass_mailing_campaign_id.id or False,
'name': wizard.mass_mailing_name,
'template_id': wizard.template_id and wizard.template_id.id or False,
'state': 'done',
'reply_to_mode': reply_to_mode,
'reply_to': reply_to,
'sent_date': fields.datetime.now(),
'body_html': wizard.body,
'mailing_model': wizard.model,
'mailing_domain': wizard.active_domain,
}, context=context)
mass_mailing = self.pool['mail.mass_mailing'].browse(cr, uid, mass_mailing_id, context=context)
for res_id in res_ids:
res[res_id].update({
'mailing_id': mass_mailing.id,
'statistics_ids': [(0, 0, {
'model': wizard.model,
'res_id': res_id,
'mass_mailing_id': mass_mailing.id,
})],
# email-mode: keep original message for routing
'notification': mass_mailing.reply_to_mode == 'thread',
'auto_delete': True,
})
return res
|
agpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
504,
5166,
14,
4795,
492,
9506,
12,
1504,
421,
199,
533,
18027,
2404,
3362,
2209,
8,
4795,
14,
14612,
14928,
1685,
304,
272,
408,
1123,
19834,
402,
12250,
30939,
22166,
370,
314,
6016,
14,
12607,
14,
1188,
12262,
272,
408,
272,
485,
6486,
275,
283,
1198,
14,
12607,
14,
1188,
7,
339,
485,
3406,
275,
469,
267,
283,
11535,
63,
22989,
63,
17368,
63,
344,
356,
1504,
14,
3479,
18,
368,
8,
288,
283,
1198,
14,
11535,
63,
22989,
14,
17368,
297,
283,
27218,
18027,
316,
24569,
65,
1030,
297,
267,
2318,
267,
283,
11535,
63,
22989,
63,
344,
356,
1504,
14,
3479,
18,
368,
8,
288,
283,
1198,
14,
11535,
63,
22989,
297,
283,
27218,
18027,
316,
7,
267,
2318,
267,
283,
11535,
63,
22989,
63,
354,
356,
1504,
14,
1560,
360,
27218,
18027,
316,
659,
267,
283,
22989,
63,
513,
63,
1580,
356,
1504,
14,
3479,
18,
3479,
8,
288,
283,
1198,
14,
11535,
63,
22989,
14,
513,
297,
1059,
534,
13681,
316,
3820,
7,
267,
2318,
272,
789,
339,
347,
664,
63,
1198,
63,
1459,
8,
277,
12,
2467,
12,
1747,
12,
12262,
12,
522,
63,
1580,
12,
1067,
29,
403,
304,
267,
408,
11041,
1083,
626,
4046,
314,
6016,
1564,
701,
6425,
314,
267,
6016,
14,
1198,
14,
13724,
1338,
315,
314,
312,
18,
77,
402,
6016,
63,
1198,
12,
1380,
9689,
15111,
267,
3031,
12250,
30939,
14,
408,
267,
522,
275,
1613,
8,
13681,
2404,
3362,
2209,
12,
291,
680,
362,
63,
1198,
63,
1459,
8,
1556,
12,
1747,
12,
12262,
12,
522,
63,
1580,
12,
1067,
29,
1100,
9,
267,
327,
675,
1454,
367,
4370,
1709,
315,
12250,
30939,
267,
340,
12262,
14,
13000,
63,
632,
508,
283,
11535,
63,
1198,
7,
436,
971,
355,
334,
9819,
14,
11535,
63,
22989,
63,
354,
503,
12262,
14,
11535,
63,
22989,
63,
344,
9,
436,
971,
355,
12262,
14,
1238,
315,
359,
1053,
59,
16,
61,
367,
1242,
315,
291,
14,
2293,
459,
1198,
14,
11535,
63,
22989,
26099,
362,
63,
22989,
63,
1238,
8,
1556,
12,
1747,
12,
1067,
29,
1100,
19532,
288,
12250,
63,
22989,
275,
12262,
14,
11535,
63,
22989,
63,
344,
288,
340,
440,
12250,
63,
22989,
26,
355,
9351,
63,
475,
63,
632,
275,
12262,
14,
889,
63,
2495,
63,
2671,
436,
283,
2123,
7,
503,
283,
2671,
7,
355,
9351,
63,
475,
275,
12262,
14,
889,
63,
2495,
63,
2671,
436,
12262,
14,
8102,
63,
475,
503,
756,
355,
12250,
63,
22989,
63,
344,
275,
291,
14,
2293,
459,
1198,
14,
11535,
63,
22989,
2278,
981,
8,
490,
2467,
12,
1747,
12,
469,
717,
283,
11535,
63,
22989,
63,
17368,
63,
344,
356,
12262,
14,
11535,
63,
22989,
63,
17368,
63,
344,
436,
12262,
14,
11535,
63,
22989,
63,
17368,
63,
344,
14,
344,
503,
756,
12,
717,
283,
354,
356,
12262,
14,
11535,
63,
22989,
63,
354,
12,
717,
283,
1160,
63,
344,
356,
12262,
14,
1160,
63,
344,
436,
12262,
14,
1160,
63,
344,
14,
344,
503,
756,
12,
717,
283,
929,
356,
283,
4456,
297,
717,
283,
8102,
63,
475,
63,
632,
356,
9351,
63,
475,
63,
632,
12,
717,
283,
8102,
63,
475,
356,
9351,
63,
475,
12,
717,
283,
1150,
63,
602,
356,
1504,
14,
2083,
14,
2131,
1062,
717,
283,
2030,
63,
1360,
356,
12262,
14,
2030,
12,
717,
283,
22989,
63,
1238,
356,
12262,
14,
1238,
12,
717,
283,
22989,
63,
2261,
356,
12262,
14,
2682,
63,
2261,
12,
490,
1660,
1067,
29,
1100,
9,
355,
12250,
63,
22989,
275,
291,
14,
2293,
459,
1198,
14,
11535,
63,
22989,
2278,
4570,
8,
1556,
12,
1747,
12,
12250,
63,
22989,
63,
344,
12,
1067,
29,
1100,
9,
288,
367,
522,
63,
344,
315,
522,
63,
1580,
26,
355,
522,
59,
470,
63,
344,
1055,
873,
2561,
490,
283,
22989,
63,
344,
356,
221,
12250,
63,
22989,
14,
344,
12,
490,
283,
13724,
63,
1580,
356,
3842,
16,
12,
378,
12,
469,
717,
283,
1238,
356,
12262,
14,
1238,
12,
717,
283,
470,
63,
344,
356,
522,
63,
344,
12,
717,
283,
11535,
63,
22989,
63,
344,
356,
12250,
63,
22989,
14,
344,
12,
490,
3828,
467,
490,
327,
3031,
13,
632,
26,
4215,
3379,
1245,
367,
14870,
490,
283,
6761,
356,
12250,
63,
22989,
14,
8102,
63,
475,
63,
632,
508,
283,
2671,
297,
490,
283,
2495,
63,
1807,
356,
715,
12,
355,
3828,
267,
372,
522,
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
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
504,
5166,
14,
4795,
492,
9506,
12,
1504,
421,
199,
533,
18027,
2404,
3362,
2209,
8,
4795,
14,
14612,
14928,
1685,
304,
272,
408,
1123,
19834,
402,
12250,
30939,
22166,
370,
314,
6016,
14,
12607,
14,
1188,
12262,
272,
408,
272,
485,
6486,
275,
283,
1198,
14,
12607,
14,
1188,
7,
339,
485,
3406,
275,
469,
267,
283,
11535,
63,
22989,
63,
17368,
63,
344,
356,
1504,
14,
3479,
18,
368,
8,
288,
283,
1198,
14,
11535,
63,
22989,
14,
17368,
297,
283,
27218,
18027,
316,
24569,
65,
1030,
297,
267,
2318,
267,
283,
11535,
63,
22989,
63,
344,
356,
1504,
14,
3479,
18,
368,
8,
288,
283,
1198,
14,
11535,
63,
22989,
297,
283,
27218,
18027,
316,
7,
267,
2318,
267,
283,
11535,
63,
22989,
63,
354,
356,
1504,
14,
1560,
360,
27218,
18027,
316,
659,
267,
283,
22989,
63,
513,
63,
1580,
356,
1504,
14,
3479,
18,
3479,
8,
288,
283,
1198,
14,
11535,
63,
22989,
14,
513,
297,
1059,
534,
13681,
316,
3820,
7,
267,
2318,
272,
789,
339,
347,
664,
63,
1198,
63,
1459,
8,
277,
12,
2467,
12,
1747,
12,
12262,
12,
522,
63,
1580,
12,
1067,
29,
403,
304,
267,
408,
11041,
1083,
626,
4046,
314,
6016,
1564,
701,
6425,
314,
267,
6016,
14,
1198,
14,
13724,
1338,
315,
314,
312,
18,
77,
402,
6016,
63,
1198,
12,
1380,
9689,
15111,
267,
3031,
12250,
30939,
14,
408,
267,
522,
275,
1613,
8,
13681,
2404,
3362,
2209,
12,
291,
680,
362,
63,
1198,
63,
1459,
8,
1556,
12,
1747,
12,
12262,
12,
522,
63,
1580,
12,
1067,
29,
1100,
9,
267,
327,
675,
1454,
367,
4370,
1709,
315,
12250,
30939,
267,
340,
12262,
14,
13000,
63,
632,
508,
283,
11535,
63,
1198,
7,
436,
971,
355,
334,
9819,
14,
11535,
63,
22989,
63,
354,
503,
12262,
14,
11535,
63,
22989,
63,
344,
9,
436,
971,
355,
12262,
14,
1238,
315,
359,
1053,
59,
16,
61,
367,
1242,
315,
291,
14,
2293,
459,
1198,
14,
11535,
63,
22989,
26099,
362,
63,
22989,
63,
1238,
8,
1556,
12,
1747,
12,
1067,
29,
1100,
19532,
288,
12250,
63,
22989,
275,
12262,
14,
11535,
63,
22989,
63,
344,
288,
340,
440,
12250,
63,
22989,
26,
355,
9351,
63,
475,
63,
632,
275,
12262,
14,
889,
63,
2495,
63,
2671,
436,
283,
2123,
7,
503,
283,
2671,
7,
355,
9351,
63,
475,
275,
12262,
14,
889,
63,
2495,
63,
2671,
436,
12262,
14,
8102,
63,
475,
503,
756,
355,
12250,
63,
22989,
63,
344,
275,
291,
14,
2293,
459,
1198,
14,
11535,
63,
22989,
2278,
981,
8,
490,
2467,
12,
1747,
12,
469,
717,
283,
11535,
63,
22989,
63,
17368,
63,
344,
356,
12262,
14,
11535,
63,
22989,
63,
17368,
63,
344,
436,
12262,
14,
11535,
63,
22989,
63,
17368,
63,
344,
14,
344,
503,
756,
12,
717,
283,
354,
356,
12262,
14,
11535,
63,
22989,
63,
354,
12,
717,
283,
1160,
63,
344,
356,
12262,
14,
1160,
63,
344,
436,
12262,
14,
1160,
63,
344,
14,
344,
503,
756,
12,
717,
283,
929,
356,
283,
4456,
297,
717,
283,
8102,
63,
475,
63,
632,
356,
9351,
63,
475,
63,
632,
12,
717,
283,
8102,
63,
475,
356,
9351,
63,
475,
12,
717,
283,
1150,
63,
602,
356,
1504,
14,
2083,
14,
2131,
1062,
717,
283,
2030,
63,
1360,
356,
12262,
14,
2030,
12,
717,
283,
22989,
63,
1238,
356,
12262,
14,
1238,
12,
717,
283,
22989,
63,
2261,
356,
12262,
14,
2682,
63,
2261,
12,
490,
1660,
1067,
29,
1100,
9,
355,
12250,
63,
22989,
275,
291,
14,
2293,
459,
1198,
14,
11535,
63,
22989,
2278,
4570,
8,
1556,
12,
1747,
12,
12250,
63,
22989,
63,
344,
12,
1067,
29,
1100,
9,
288,
367,
522,
63,
344,
315,
522,
63,
1580,
26,
355,
522,
59,
470,
63,
344,
1055,
873,
2561,
490,
283,
22989,
63,
344,
356,
221,
12250,
63,
22989,
14,
344,
12,
490,
283,
13724,
63,
1580,
356,
3842,
16,
12,
378,
12,
469,
717,
283,
1238,
356,
12262,
14,
1238,
12,
717,
283,
470,
63,
344,
356,
522,
63,
344,
12,
717,
283,
11535,
63,
22989,
63,
344,
356,
12250,
63,
22989,
14,
344,
12,
490,
3828,
467,
490,
327,
3031,
13,
632,
26,
4215,
3379,
1245,
367,
14870,
490,
283,
6761,
356,
12250,
63,
22989,
14,
8102,
63,
475,
63,
632,
508,
283,
2671,
297,
490,
283,
2495,
63,
1807,
356,
715,
12,
355,
3828,
267,
372,
522,
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,
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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_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class BucketList(ListResource):
def __init__(self, version, service_sid, rate_limit_sid):
"""
Initialize the BucketList
:param Version version: Version that contains the resource
:param service_sid: The SID of the Service that the resource is associated with
:param rate_limit_sid: Rate Limit Sid.
:returns: twilio.rest.verify.v2.service.rate_limit.bucket.BucketList
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketList
"""
super(BucketList, self).__init__(version)
# Path Solution
self._solution = {'service_sid': service_sid, 'rate_limit_sid': rate_limit_sid, }
self._uri = '/Services/{service_sid}/RateLimits/{rate_limit_sid}/Buckets'.format(**self._solution)
def create(self, max, interval):
"""
Create the BucketInstance
:param unicode max: Max number of requests.
:param unicode interval: Number of seconds that the rate limit will be enforced over.
:returns: The created BucketInstance
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketInstance
"""
data = values.of({'Max': max, 'Interval': interval, })
payload = self._version.create(method='POST', uri=self._uri, data=data, )
return BucketInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
rate_limit_sid=self._solution['rate_limit_sid'],
)
def stream(self, limit=None, page_size=None):
"""
Streams BucketInstance records from the API as a generator stream.
This operation lazily loads records as efficiently as possible until the limit
is reached.
The results are returned as a generator, so this operation is memory efficient.
:param int limit: Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
the default value of 50 records. If no page_size is defined
but a limit is defined, stream() will attempt to read the
limit with the most efficient page size, i.e. min(limit, 1000)
:returns: Generator that will yield up to limit results
:rtype: list[twilio.rest.verify.v2.service.rate_limit.bucket.BucketInstance]
"""
limits = self._version.read_limits(limit, page_size)
page = self.page(page_size=limits['page_size'], )
return self._version.stream(page, limits['limit'])
def list(self, limit=None, page_size=None):
"""
Lists BucketInstance records from the API as a list.
Unlike stream(), this operation is eager and will load `limit` records into
memory before returning.
:param int limit: Upper limit for the number of records to return. list() guarantees
never to return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
the default value of 50 records. If no page_size is defined
but a limit is defined, list() will attempt to read the limit
with the most efficient page size, i.e. min(limit, 1000)
:returns: Generator that will yield up to limit results
:rtype: list[twilio.rest.verify.v2.service.rate_limit.bucket.BucketInstance]
"""
return list(self.stream(limit=limit, page_size=page_size, ))
def page(self, page_token=values.unset, page_number=values.unset,
page_size=values.unset):
"""
Retrieve a single page of BucketInstance records from the API.
Request is executed immediately
:param str page_token: PageToken provided by the API
:param int page_number: Page Number, this value is simply for client state
:param int page_size: Number of records to return, defaults to 50
:returns: Page of BucketInstance
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketPage
"""
data = values.of({'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, })
response = self._version.page(method='GET', uri=self._uri, params=data, )
return BucketPage(self._version, response, self._solution)
def get_page(self, target_url):
"""
Retrieve a specific page of BucketInstance records from the API.
Request is executed immediately
:param str target_url: API-generated URL for the requested results page
:returns: Page of BucketInstance
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketPage
"""
response = self._version.domain.twilio.request(
'GET',
target_url,
)
return BucketPage(self._version, response, self._solution)
def get(self, sid):
"""
Constructs a BucketContext
:param sid: A string that uniquely identifies this Bucket.
:returns: twilio.rest.verify.v2.service.rate_limit.bucket.BucketContext
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketContext
"""
return BucketContext(
self._version,
service_sid=self._solution['service_sid'],
rate_limit_sid=self._solution['rate_limit_sid'],
sid=sid,
)
def __call__(self, sid):
"""
Constructs a BucketContext
:param sid: A string that uniquely identifies this Bucket.
:returns: twilio.rest.verify.v2.service.rate_limit.bucket.BucketContext
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketContext
"""
return BucketContext(
self._version,
service_sid=self._solution['service_sid'],
rate_limit_sid=self._solution['rate_limit_sid'],
sid=sid,
)
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
return '<Twilio.Verify.V2.BucketList>'
class BucketPage(Page):
def __init__(self, version, response, solution):
"""
Initialize the BucketPage
:param Version version: Version that contains the resource
:param Response response: Response from the API
:param service_sid: The SID of the Service that the resource is associated with
:param rate_limit_sid: Rate Limit Sid.
:returns: twilio.rest.verify.v2.service.rate_limit.bucket.BucketPage
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketPage
"""
super(BucketPage, self).__init__(version, response)
# Path Solution
self._solution = solution
def get_instance(self, payload):
"""
Build an instance of BucketInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.verify.v2.service.rate_limit.bucket.BucketInstance
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketInstance
"""
return BucketInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
rate_limit_sid=self._solution['rate_limit_sid'],
)
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
return '<Twilio.Verify.V2.BucketPage>'
class BucketContext(InstanceContext):
def __init__(self, version, service_sid, rate_limit_sid, sid):
"""
Initialize the BucketContext
:param Version version: Version that contains the resource
:param service_sid: The SID of the Service that the resource is associated with
:param rate_limit_sid: Rate Limit Sid.
:param sid: A string that uniquely identifies this Bucket.
:returns: twilio.rest.verify.v2.service.rate_limit.bucket.BucketContext
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketContext
"""
super(BucketContext, self).__init__(version)
# Path Solution
self._solution = {'service_sid': service_sid, 'rate_limit_sid': rate_limit_sid, 'sid': sid, }
self._uri = '/Services/{service_sid}/RateLimits/{rate_limit_sid}/Buckets/{sid}'.format(**self._solution)
def update(self, max=values.unset, interval=values.unset):
"""
Update the BucketInstance
:param unicode max: Max number of requests.
:param unicode interval: Number of seconds that the rate limit will be enforced over.
:returns: The updated BucketInstance
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketInstance
"""
data = values.of({'Max': max, 'Interval': interval, })
payload = self._version.update(method='POST', uri=self._uri, data=data, )
return BucketInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
rate_limit_sid=self._solution['rate_limit_sid'],
sid=self._solution['sid'],
)
def fetch(self):
"""
Fetch the BucketInstance
:returns: The fetched BucketInstance
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketInstance
"""
payload = self._version.fetch(method='GET', uri=self._uri, )
return BucketInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
rate_limit_sid=self._solution['rate_limit_sid'],
sid=self._solution['sid'],
)
def delete(self):
"""
Deletes the BucketInstance
:returns: True if delete succeeds, False otherwise
:rtype: bool
"""
return self._version.delete(method='DELETE', uri=self._uri, )
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
return '<Twilio.Verify.V2.BucketContext {}>'.format(context)
class BucketInstance(InstanceResource):
def __init__(self, version, payload, service_sid, rate_limit_sid, sid=None):
"""
Initialize the BucketInstance
:returns: twilio.rest.verify.v2.service.rate_limit.bucket.BucketInstance
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketInstance
"""
super(BucketInstance, self).__init__(version)
# Marshaled Properties
self._properties = {
'sid': payload.get('sid'),
'rate_limit_sid': payload.get('rate_limit_sid'),
'service_sid': payload.get('service_sid'),
'account_sid': payload.get('account_sid'),
'max': deserialize.integer(payload.get('max')),
'interval': deserialize.integer(payload.get('interval')),
'date_created': deserialize.iso8601_datetime(payload.get('date_created')),
'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')),
'url': payload.get('url'),
}
# Context
self._context = None
self._solution = {
'service_sid': service_sid,
'rate_limit_sid': rate_limit_sid,
'sid': sid or self._properties['sid'],
}
@property
def _proxy(self):
"""
Generate an instance context for the instance, the context is capable of
performing various actions. All instance actions are proxied to the context
:returns: BucketContext for this BucketInstance
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketContext
"""
if self._context is None:
self._context = BucketContext(
self._version,
service_sid=self._solution['service_sid'],
rate_limit_sid=self._solution['rate_limit_sid'],
sid=self._solution['sid'],
)
return self._context
@property
def sid(self):
"""
:returns: A string that uniquely identifies this Bucket.
:rtype: unicode
"""
return self._properties['sid']
@property
def rate_limit_sid(self):
"""
:returns: Rate Limit Sid.
:rtype: unicode
"""
return self._properties['rate_limit_sid']
@property
def service_sid(self):
"""
:returns: The SID of the Service that the resource is associated with
:rtype: unicode
"""
return self._properties['service_sid']
@property
def account_sid(self):
"""
:returns: The SID of the Account that created the resource
:rtype: unicode
"""
return self._properties['account_sid']
@property
def max(self):
"""
:returns: Max number of requests.
:rtype: unicode
"""
return self._properties['max']
@property
def interval(self):
"""
:returns: Number of seconds that the rate limit will be enforced over.
:rtype: unicode
"""
return self._properties['interval']
@property
def date_created(self):
"""
:returns: The RFC 2822 date and time in GMT when the resource was created
:rtype: datetime
"""
return self._properties['date_created']
@property
def date_updated(self):
"""
:returns: The RFC 2822 date and time in GMT when the resource was last updated
:rtype: datetime
"""
return self._properties['date_updated']
@property
def url(self):
"""
:returns: The URL of this resource.
:rtype: unicode
"""
return self._properties['url']
def update(self, max=values.unset, interval=values.unset):
"""
Update the BucketInstance
:param unicode max: Max number of requests.
:param unicode interval: Number of seconds that the rate limit will be enforced over.
:returns: The updated BucketInstance
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketInstance
"""
return self._proxy.update(max=max, interval=interval, )
def fetch(self):
"""
Fetch the BucketInstance
:returns: The fetched BucketInstance
:rtype: twilio.rest.verify.v2.service.rate_limit.bucket.BucketInstance
"""
return self._proxy.fetch()
def delete(self):
"""
Deletes the BucketInstance
:returns: True if delete succeeds, False otherwise
:rtype: bool
"""
return self._proxy.delete()
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
return '<Twilio.Verify.V2.BucketInstance {}>'.format(context)
|
gpl-3.0
|
[
3,
2803,
29,
1624,
13,
24,
199,
82,
624,
199,
2765,
1233,
1990,
4046,
701,
199,
60,
1182,
485,
259,
485,
221,
485,
92,
257,
485,
221,
485,
199,
1204,
6110,
2862,
15,
1547,
9,
1547,
6113,
15,
92,
1204,
8,
15607,
221,
373,
17,
14,
16,
14,
16,
489,
1182,
755,
1182,
199,
624,
199,
199,
504,
8900,
23533,
14,
1095,
492,
22920,
199,
504,
8900,
23533,
14,
1095,
492,
1338,
199,
504,
8900,
23533,
14,
1095,
14,
842,
63,
1100,
492,
10066,
2998,
199,
504,
8900,
23533,
14,
1095,
14,
842,
63,
1927,
492,
10066,
4031,
199,
504,
8900,
23533,
14,
1095,
14,
513,
63,
1927,
492,
3820,
4031,
199,
504,
8900,
23533,
14,
1095,
14,
1606,
492,
10331,
421,
199,
533,
31479,
1296,
8,
1296,
4031,
304,
339,
347,
636,
826,
721,
277,
12,
1015,
12,
2435,
63,
4148,
12,
6634,
63,
3097,
63,
4148,
304,
267,
408,
267,
11578,
314,
31479,
1296,
398,
520,
635,
3394,
1015,
26,
3394,
626,
3509,
314,
2073,
267,
520,
635,
2435,
63,
4148,
26,
710,
428,
998,
402,
314,
7591,
626,
314,
2073,
365,
4568,
543,
267,
520,
635,
6634,
63,
3097,
63,
4148,
26,
26311,
22672,
428,
344,
14,
398,
520,
5808,
26,
8900,
23533,
14,
3911,
14,
4712,
14,
86,
18,
14,
1364,
14,
1866,
63,
3097,
14,
4623,
14,
12311,
1296,
267,
520,
4500,
26,
8900,
23533,
14,
3911,
14,
4712,
14,
86,
18,
14,
1364,
14,
1866,
63,
3097,
14,
4623,
14,
12311,
1296,
267,
408,
267,
1613,
8,
12311,
1296,
12,
291,
2843,
826,
721,
1023,
9,
398,
327,
6912,
9274,
267,
291,
423,
14458,
275,
791,
1364,
63,
4148,
356,
2435,
63,
4148,
12,
283,
1866,
63,
3097,
63,
4148,
356,
6634,
63,
3097,
63,
4148,
12,
789,
267,
291,
423,
2302,
275,
1994,
15803,
5321,
1364,
63,
4148,
5995,
6621,
24480,
5321,
1866,
63,
3097,
63,
4148,
5995,
12311,
83,
1370,
908,
3682,
277,
423,
14458,
9,
339,
347,
1218,
8,
277,
12,
1390,
12,
6252,
304,
267,
408,
267,
2790,
314,
31479,
3244,
398,
520,
635,
2649,
1390,
26,
8228,
1329,
402,
4145,
14,
267,
520,
635,
2649,
6252,
26,
4860,
402,
4696,
626,
314,
6634,
2304,
911,
506,
30163,
1806,
14,
398,
520,
5808,
26,
710,
2737,
31479,
3244,
267,
520,
4500,
26,
8900,
23533,
14,
3911,
14,
4712,
14,
86,
18,
14,
1364,
14,
1866,
63,
3097,
14,
4623,
14,
12311,
3244,
267,
408,
267,
666,
275,
1338,
14,
1618,
3252,
4261,
356,
1390,
12,
283,
8227,
356,
6252,
12,
3828,
398,
4886,
275,
291,
423,
1023,
14,
981,
8,
765,
534,
4030,
297,
5108,
29,
277,
423,
2302,
12,
666,
29,
576,
12,
776,
398,
372,
31479,
3244,
8,
288,
291,
423,
1023,
12,
288,
4886,
12,
288,
2435,
63,
4148,
29,
277,
423,
14458,
459,
1364,
63,
4148,
995,
288,
6634,
63,
3097,
63,
4148,
29,
277,
423,
14458,
459,
1866,
63,
3097,
63,
4148,
995,
267,
776,
339,
347,
2547,
8,
277,
12,
2304,
29,
403,
12,
2034,
63,
890,
29,
403,
304,
267,
408,
267,
8271,
83,
31479,
3244,
5767,
687,
314,
3261,
465,
282,
4306,
2547,
14,
267,
961,
3439,
29667,
3444,
14404,
5767,
465,
30427,
465,
3962,
5133,
314,
2304,
267,
365,
13075,
14,
267,
710,
2058,
787,
2138,
465,
282,
4306,
12,
880,
642,
3439,
365,
4402,
13402,
14,
398,
520,
635,
1109,
2304,
26,
4949,
529,
2304,
367,
314,
1329,
402,
5767,
370,
372,
14,
2547,
342,
2079,
12072,
397,
370,
7078,
372,
1655,
2419,
2304,
14,
221,
3758,
365,
949,
2304,
267,
520,
635,
1109,
2034,
63,
890,
26,
4860,
402,
5767,
370,
5267,
1126,
1056,
12,
1380,
440,
663,
911,
675,
2892,
314,
849,
574,
402,
5238,
5767,
14,
221,
982,
949,
2034,
63,
890,
365,
3247,
2892,
1325,
282,
2304,
365,
3247,
12,
2547,
342,
911,
7427,
370,
1586,
314,
2892,
2304,
543,
314,
4750,
13402,
2034,
1568,
12,
284,
14,
69,
14,
1748,
8,
3097,
12,
5198,
9,
398,
520,
5808,
26,
15042,
626,
911,
1995,
1536,
370,
2304,
2058,
267,
520,
4500,
26,
769,
59,
8122,
23533,
14,
3911,
14,
4712,
14,
86,
18,
14,
1364,
14,
1866,
63,
3097,
14,
4623,
14,
12311,
3244,
61,
267,
408,
267,
10976,
275,
291,
423,
1023,
14,
739,
63,
9368,
8,
3097,
12,
2034,
63,
890,
9,
398,
2034,
275,
291,
14,
1606,
8,
1606,
63,
890,
29,
9368,
459,
1606,
63,
890,
995,
776,
398,
372,
291,
423,
1023,
14,
1745,
8,
1606,
12,
10976,
459,
3097,
1105,
339,
347,
769,
8,
277,
12,
2304,
29,
403,
12,
2034,
63,
890,
29,
403,
304,
267,
408,
267,
31289,
31479,
3244,
5767,
687,
314,
3261,
465,
282,
769,
14,
267,
25059,
2547,
1062,
642,
3439,
365,
21719,
436,
911,
2248,
658,
3097,
64,
5767,
1901,
267,
4402,
2544,
8152,
14,
398,
520,
635,
1109,
2304,
26,
4949,
529,
2304,
367,
314,
1329,
402,
5767,
370,
372,
14,
769,
342,
12072,
397,
2079,
7078,
370,
372,
1655,
2419,
2304,
14,
221,
3758,
365,
949,
2304,
267,
520,
635,
1109,
2034,
63,
890,
26,
4860,
402,
5767,
370,
5267,
1126,
1056,
12,
1380,
440,
663,
911,
675,
2892,
314,
849,
574,
402,
5238,
5767,
14,
221,
982,
949,
2034,
63,
890,
365,
3247,
2892,
1325,
282,
2304,
365,
3247,
12,
769,
342,
911,
7427,
370,
1586,
314,
2304,
2892,
543,
314,
4750,
13402,
2034,
1568,
12,
284,
14,
69,
14,
1748,
8,
3097,
12,
5198,
9,
398,
520,
5808,
26,
15042,
626,
911,
1995,
1536,
370,
2304,
2058,
267,
520,
4500,
26,
769,
59,
8122,
23533,
14,
3911,
14,
4712,
14,
86,
18,
14,
1364,
14,
1866,
63,
3097,
14,
4623,
14,
12311,
3244,
61,
267,
408,
267,
372,
769,
8,
277,
14,
1745,
8,
3097,
29,
3097,
12,
2034,
63,
890,
29,
1606,
63,
890,
12,
5082,
339,
347,
2034,
8,
277,
12,
2034,
63,
1418,
29,
1459,
14,
16787,
12,
2034,
63,
1955,
29,
1459,
14,
16787,
12,
1467,
2034,
63,
890,
29,
1459,
14,
16787,
304,
267,
408,
267,
13939,
282,
2849,
2034,
402,
31479,
3244,
5767,
687,
314,
3261,
14,
267,
4784,
365,
7934,
9939,
398,
520,
635,
620,
2034,
63
] |
[
2803,
29,
1624,
13,
24,
199,
82,
624,
199,
2765,
1233,
1990,
4046,
701,
199,
60,
1182,
485,
259,
485,
221,
485,
92,
257,
485,
221,
485,
199,
1204,
6110,
2862,
15,
1547,
9,
1547,
6113,
15,
92,
1204,
8,
15607,
221,
373,
17,
14,
16,
14,
16,
489,
1182,
755,
1182,
199,
624,
199,
199,
504,
8900,
23533,
14,
1095,
492,
22920,
199,
504,
8900,
23533,
14,
1095,
492,
1338,
199,
504,
8900,
23533,
14,
1095,
14,
842,
63,
1100,
492,
10066,
2998,
199,
504,
8900,
23533,
14,
1095,
14,
842,
63,
1927,
492,
10066,
4031,
199,
504,
8900,
23533,
14,
1095,
14,
513,
63,
1927,
492,
3820,
4031,
199,
504,
8900,
23533,
14,
1095,
14,
1606,
492,
10331,
421,
199,
533,
31479,
1296,
8,
1296,
4031,
304,
339,
347,
636,
826,
721,
277,
12,
1015,
12,
2435,
63,
4148,
12,
6634,
63,
3097,
63,
4148,
304,
267,
408,
267,
11578,
314,
31479,
1296,
398,
520,
635,
3394,
1015,
26,
3394,
626,
3509,
314,
2073,
267,
520,
635,
2435,
63,
4148,
26,
710,
428,
998,
402,
314,
7591,
626,
314,
2073,
365,
4568,
543,
267,
520,
635,
6634,
63,
3097,
63,
4148,
26,
26311,
22672,
428,
344,
14,
398,
520,
5808,
26,
8900,
23533,
14,
3911,
14,
4712,
14,
86,
18,
14,
1364,
14,
1866,
63,
3097,
14,
4623,
14,
12311,
1296,
267,
520,
4500,
26,
8900,
23533,
14,
3911,
14,
4712,
14,
86,
18,
14,
1364,
14,
1866,
63,
3097,
14,
4623,
14,
12311,
1296,
267,
408,
267,
1613,
8,
12311,
1296,
12,
291,
2843,
826,
721,
1023,
9,
398,
327,
6912,
9274,
267,
291,
423,
14458,
275,
791,
1364,
63,
4148,
356,
2435,
63,
4148,
12,
283,
1866,
63,
3097,
63,
4148,
356,
6634,
63,
3097,
63,
4148,
12,
789,
267,
291,
423,
2302,
275,
1994,
15803,
5321,
1364,
63,
4148,
5995,
6621,
24480,
5321,
1866,
63,
3097,
63,
4148,
5995,
12311,
83,
1370,
908,
3682,
277,
423,
14458,
9,
339,
347,
1218,
8,
277,
12,
1390,
12,
6252,
304,
267,
408,
267,
2790,
314,
31479,
3244,
398,
520,
635,
2649,
1390,
26,
8228,
1329,
402,
4145,
14,
267,
520,
635,
2649,
6252,
26,
4860,
402,
4696,
626,
314,
6634,
2304,
911,
506,
30163,
1806,
14,
398,
520,
5808,
26,
710,
2737,
31479,
3244,
267,
520,
4500,
26,
8900,
23533,
14,
3911,
14,
4712,
14,
86,
18,
14,
1364,
14,
1866,
63,
3097,
14,
4623,
14,
12311,
3244,
267,
408,
267,
666,
275,
1338,
14,
1618,
3252,
4261,
356,
1390,
12,
283,
8227,
356,
6252,
12,
3828,
398,
4886,
275,
291,
423,
1023,
14,
981,
8,
765,
534,
4030,
297,
5108,
29,
277,
423,
2302,
12,
666,
29,
576,
12,
776,
398,
372,
31479,
3244,
8,
288,
291,
423,
1023,
12,
288,
4886,
12,
288,
2435,
63,
4148,
29,
277,
423,
14458,
459,
1364,
63,
4148,
995,
288,
6634,
63,
3097,
63,
4148,
29,
277,
423,
14458,
459,
1866,
63,
3097,
63,
4148,
995,
267,
776,
339,
347,
2547,
8,
277,
12,
2304,
29,
403,
12,
2034,
63,
890,
29,
403,
304,
267,
408,
267,
8271,
83,
31479,
3244,
5767,
687,
314,
3261,
465,
282,
4306,
2547,
14,
267,
961,
3439,
29667,
3444,
14404,
5767,
465,
30427,
465,
3962,
5133,
314,
2304,
267,
365,
13075,
14,
267,
710,
2058,
787,
2138,
465,
282,
4306,
12,
880,
642,
3439,
365,
4402,
13402,
14,
398,
520,
635,
1109,
2304,
26,
4949,
529,
2304,
367,
314,
1329,
402,
5767,
370,
372,
14,
2547,
342,
2079,
12072,
397,
370,
7078,
372,
1655,
2419,
2304,
14,
221,
3758,
365,
949,
2304,
267,
520,
635,
1109,
2034,
63,
890,
26,
4860,
402,
5767,
370,
5267,
1126,
1056,
12,
1380,
440,
663,
911,
675,
2892,
314,
849,
574,
402,
5238,
5767,
14,
221,
982,
949,
2034,
63,
890,
365,
3247,
2892,
1325,
282,
2304,
365,
3247,
12,
2547,
342,
911,
7427,
370,
1586,
314,
2892,
2304,
543,
314,
4750,
13402,
2034,
1568,
12,
284,
14,
69,
14,
1748,
8,
3097,
12,
5198,
9,
398,
520,
5808,
26,
15042,
626,
911,
1995,
1536,
370,
2304,
2058,
267,
520,
4500,
26,
769,
59,
8122,
23533,
14,
3911,
14,
4712,
14,
86,
18,
14,
1364,
14,
1866,
63,
3097,
14,
4623,
14,
12311,
3244,
61,
267,
408,
267,
10976,
275,
291,
423,
1023,
14,
739,
63,
9368,
8,
3097,
12,
2034,
63,
890,
9,
398,
2034,
275,
291,
14,
1606,
8,
1606,
63,
890,
29,
9368,
459,
1606,
63,
890,
995,
776,
398,
372,
291,
423,
1023,
14,
1745,
8,
1606,
12,
10976,
459,
3097,
1105,
339,
347,
769,
8,
277,
12,
2304,
29,
403,
12,
2034,
63,
890,
29,
403,
304,
267,
408,
267,
31289,
31479,
3244,
5767,
687,
314,
3261,
465,
282,
769,
14,
267,
25059,
2547,
1062,
642,
3439,
365,
21719,
436,
911,
2248,
658,
3097,
64,
5767,
1901,
267,
4402,
2544,
8152,
14,
398,
520,
635,
1109,
2304,
26,
4949,
529,
2304,
367,
314,
1329,
402,
5767,
370,
372,
14,
769,
342,
12072,
397,
2079,
7078,
370,
372,
1655,
2419,
2304,
14,
221,
3758,
365,
949,
2304,
267,
520,
635,
1109,
2034,
63,
890,
26,
4860,
402,
5767,
370,
5267,
1126,
1056,
12,
1380,
440,
663,
911,
675,
2892,
314,
849,
574,
402,
5238,
5767,
14,
221,
982,
949,
2034,
63,
890,
365,
3247,
2892,
1325,
282,
2304,
365,
3247,
12,
769,
342,
911,
7427,
370,
1586,
314,
2304,
2892,
543,
314,
4750,
13402,
2034,
1568,
12,
284,
14,
69,
14,
1748,
8,
3097,
12,
5198,
9,
398,
520,
5808,
26,
15042,
626,
911,
1995,
1536,
370,
2304,
2058,
267,
520,
4500,
26,
769,
59,
8122,
23533,
14,
3911,
14,
4712,
14,
86,
18,
14,
1364,
14,
1866,
63,
3097,
14,
4623,
14,
12311,
3244,
61,
267,
408,
267,
372,
769,
8,
277,
14,
1745,
8,
3097,
29,
3097,
12,
2034,
63,
890,
29,
1606,
63,
890,
12,
5082,
339,
347,
2034,
8,
277,
12,
2034,
63,
1418,
29,
1459,
14,
16787,
12,
2034,
63,
1955,
29,
1459,
14,
16787,
12,
1467,
2034,
63,
890,
29,
1459,
14,
16787,
304,
267,
408,
267,
13939,
282,
2849,
2034,
402,
31479,
3244,
5767,
687,
314,
3261,
14,
267,
4784,
365,
7934,
9939,
398,
520,
635,
620,
2034,
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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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
] |
vnsofthe/odoo
|
addons/website/models/website.py
|
25
|
35943
|
# -*- coding: utf-8 -*-
import cStringIO
import contextlib
import datetime
import hashlib
import inspect
import logging
import math
import mimetypes
import unicodedata
import os
import re
import time
import urlparse
from PIL import Image
from sys import maxint
import werkzeug
# optional python-slugify import (https://github.com/un33k/python-slugify)
try:
import slugify as slugify_lib
except ImportError:
slugify_lib = None
import openerp
from openerp.osv import orm, osv, fields
from openerp.tools import html_escape as escape, ustr, image_resize_and_sharpen, image_save_for_web
from openerp.tools.safe_eval import safe_eval
from openerp.addons.web.http import request
logger = logging.getLogger(__name__)
def url_for(path_or_uri, lang=None):
if isinstance(path_or_uri, unicode):
path_or_uri = path_or_uri.encode('utf-8')
current_path = request.httprequest.path
if isinstance(current_path, unicode):
current_path = current_path.encode('utf-8')
location = path_or_uri.strip()
force_lang = lang is not None
url = urlparse.urlparse(location)
if request and not url.netloc and not url.scheme and (url.path or force_lang):
location = urlparse.urljoin(current_path, location)
lang = lang or request.context.get('lang')
langs = [lg[0] for lg in request.website.get_languages()]
if (len(langs) > 1 or force_lang) and is_multilang_url(location, langs):
ps = location.split('/')
if ps[1] in langs:
# Replace the language only if we explicitly provide a language to url_for
if force_lang:
ps[1] = lang
# Remove the default language unless it's explicitly provided
elif ps[1] == request.website.default_lang_code:
ps.pop(1)
# Insert the context language or the provided language
elif lang != request.website.default_lang_code or force_lang:
ps.insert(1, lang)
location = '/'.join(ps)
return location.decode('utf-8')
def is_multilang_url(local_url, langs=None):
if not langs:
langs = [lg[0] for lg in request.website.get_languages()]
spath = local_url.split('/')
# if a language is already in the path, remove it
if spath[1] in langs:
spath.pop(1)
local_url = '/'.join(spath)
try:
# Try to match an endpoint in werkzeug's routing table
url = local_url.split('?')
path = url[0]
query_string = url[1] if len(url) > 1 else None
router = request.httprequest.app.get_db_router(request.db).bind('')
# Force to check method to POST. Odoo uses methods : ['POST'] and ['GET', 'POST']
func = router.match(path, method='POST', query_args=query_string)[0]
return (func.routing.get('website', False) and
func.routing.get('multilang', func.routing['type'] == 'http'))
except Exception:
return False
def slugify(s, max_length=None):
""" Transform a string to a slug that can be used in a url path.
This method will first try to do the job with python-slugify if present.
Otherwise it will process string by stripping leading and ending spaces,
converting unicode chars to ascii, lowering all chars and replacing spaces
and underscore with hyphen "-".
:param s: str
:param max_length: int
:rtype: str
"""
s = ustr(s)
if slugify_lib:
# There are 2 different libraries only python-slugify is supported
try:
return slugify_lib.slugify(s, max_length=max_length)
except TypeError:
pass
uni = unicodedata.normalize('NFKD', s).encode('ascii', 'ignore').decode('ascii')
slug = re.sub('[\W_]', ' ', uni).strip().lower()
slug = re.sub('[-\s]+', '-', slug)
return slug[:max_length]
def slug(value):
if isinstance(value, orm.browse_record):
# [(id, name)] = value.name_get()
id, name = value.id, value.display_name
else:
# assume name_search result tuple
id, name = value
slugname = slugify(name or '').strip().strip('-')
if not slugname:
return str(id)
return "%s-%d" % (slugname, id)
# NOTE: as the pattern is used as it for the ModelConverter (ir_http.py), do not use any flags
_UNSLUG_RE = re.compile(r'(?:(\w{1,2}|\w[A-Za-z0-9-_]+?\w)-)?(-?\d+)(?=$|/)')
def unslug(s):
"""Extract slug and id from a string.
Always return un 2-tuple (str|None, int|None)
"""
m = _UNSLUG_RE.match(s)
if not m:
return None, None
return m.group(1), int(m.group(2))
def urlplus(url, params):
return werkzeug.Href(url)(params or None)
class website(osv.osv):
def _get_menu_website(self, cr, uid, ids, context=None):
# IF a menu is changed, update all websites
return self.search(cr, uid, [], context=context)
def _get_menu(self, cr, uid, ids, name, arg, context=None):
root_domain = [('parent_id', '=', False)]
menus = self.pool.get('website.menu').search(cr, uid, root_domain, order='id', context=context)
menu = menus and menus[0] or False
return dict( map(lambda x: (x, menu), ids) )
_name = "website" # Avoid website.website convention for conciseness (for new api). Got a special authorization from xmo and rco
_description = "Website"
_columns = {
'name': fields.char('Domain'),
'company_id': fields.many2one('res.company', string="Company"),
'language_ids': fields.many2many('res.lang', 'website_lang_rel', 'website_id', 'lang_id', 'Languages'),
'default_lang_id': fields.many2one('res.lang', string="Default language", required=True),
'default_lang_code': fields.related('default_lang_id', 'code', type="char", string="Default language code", store=True),
'social_twitter': fields.char('Twitter Account'),
'social_facebook': fields.char('Facebook Account'),
'social_github': fields.char('GitHub Account'),
'social_linkedin': fields.char('LinkedIn Account'),
'social_youtube': fields.char('Youtube Account'),
'social_googleplus': fields.char('Google+ Account'),
'google_analytics_key': fields.char('Google Analytics Key'),
'user_id': fields.many2one('res.users', string='Public User'),
'partner_id': fields.related('user_id','partner_id', type='many2one', relation='res.partner', string='Public Partner'),
'menu_id': fields.function(_get_menu, relation='website.menu', type='many2one', string='Main Menu',
store= {
'website.menu': (_get_menu_website, ['sequence','parent_id','website_id'], 10)
})
}
_defaults = {
'company_id': lambda self,cr,uid,c: self.pool['ir.model.data'].xmlid_to_res_id(cr, openerp.SUPERUSER_ID, 'base.main_company'),
}
# cf. Wizard hack in website_views.xml
def noop(self, *args, **kwargs):
pass
def write(self, cr, uid, ids, vals, context=None):
self._get_languages.clear_cache(self)
return super(website, self).write(cr, uid, ids, vals, context)
def new_page(self, cr, uid, name, template='website.default_page', ispage=True, context=None):
context = context or {}
imd = self.pool.get('ir.model.data')
view = self.pool.get('ir.ui.view')
template_module, template_name = template.split('.')
# completely arbitrary max_length
page_name = slugify(name, max_length=50)
page_xmlid = "%s.%s" % (template_module, page_name)
try:
# existing page
imd.get_object_reference(cr, uid, template_module, page_name)
except ValueError:
# new page
_, template_id = imd.get_object_reference(cr, uid, template_module, template_name)
page_id = view.copy(cr, uid, template_id, context=context)
page = view.browse(cr, uid, page_id, context=context)
page.write({
'arch': page.arch.replace(template, page_xmlid),
'name': page_name,
'page': ispage,
})
imd.create(cr, uid, {
'name': page_name,
'module': template_module,
'model': 'ir.ui.view',
'res_id': page_id,
'noupdate': True
}, context=context)
return page_xmlid
def page_for_name(self, cr, uid, ids, name, module='website', context=None):
# whatever
return '%s.%s' % (module, slugify(name, max_length=50))
def page_exists(self, cr, uid, ids, name, module='website', context=None):
try:
name = (name or "").replace("/page/website.", "").replace("/page/", "")
if not name:
return False
return self.pool["ir.model.data"].get_object_reference(cr, uid, module, name)
except:
return False
@openerp.tools.ormcache(skiparg=3)
def _get_languages(self, cr, uid, id):
website = self.browse(cr, uid, id)
return [(lg.code, lg.name) for lg in website.language_ids]
def get_languages(self, cr, uid, ids, context=None):
return self._get_languages(cr, uid, ids[0])
def get_alternate_languages(self, cr, uid, ids, req=None, context=None):
langs = []
if req is None:
req = request.httprequest
default = self.get_current_website(cr, uid, context=context).default_lang_code
shorts = []
def get_url_localized(router, lang):
arguments = dict(request.endpoint_arguments)
for k, v in arguments.items():
if isinstance(v, orm.browse_record):
arguments[k] = v.with_context(lang=lang)
return router.build(request.endpoint, arguments)
router = request.httprequest.app.get_db_router(request.db).bind('')
for code, name in self.get_languages(cr, uid, ids, context=context):
lg_path = ('/' + code) if code != default else ''
lg = code.split('_')
shorts.append(lg[0])
uri = request.endpoint and get_url_localized(router, code) or request.httprequest.path
if req.query_string:
uri += '?' + req.query_string
lang = {
'hreflang': ('-'.join(lg)).lower(),
'short': lg[0],
'href': req.url_root[0:-1] + lg_path + uri,
}
langs.append(lang)
for lang in langs:
if shorts.count(lang['short']) == 1:
lang['hreflang'] = lang['short']
return langs
def get_current_website(self, cr, uid, context=None):
# TODO: Select website, currently hard coded
return self.pool['website'].browse(cr, uid, 1, context=context)
def is_publisher(self, cr, uid, ids, context=None):
Access = self.pool['ir.model.access']
is_website_publisher = Access.check(cr, uid, 'ir.ui.view', 'write', False, context=context)
return is_website_publisher
def is_user(self, cr, uid, ids, context=None):
Access = self.pool['ir.model.access']
return Access.check(cr, uid, 'ir.ui.menu', 'read', False, context=context)
def get_template(self, cr, uid, ids, template, context=None):
if isinstance(template, (int, long)):
view_id = template
else:
if '.' not in template:
template = 'website.%s' % template
module, xmlid = template.split('.', 1)
model, view_id = request.registry["ir.model.data"].get_object_reference(cr, uid, module, xmlid)
return self.pool["ir.ui.view"].browse(cr, uid, view_id, context=context)
def _render(self, cr, uid, ids, template, values=None, context=None):
# TODO: remove this. (just kept for backward api compatibility for saas-3)
return self.pool['ir.ui.view'].render(cr, uid, template, values=values, context=context)
def render(self, cr, uid, ids, template, values=None, status_code=None, context=None):
# TODO: remove this. (just kept for backward api compatibility for saas-3)
return request.render(template, values, uid=uid)
def pager(self, cr, uid, ids, url, total, page=1, step=30, scope=5, url_args=None, context=None):
# Compute Pager
page_count = int(math.ceil(float(total) / step))
page = max(1, min(int(page if str(page).isdigit() else 1), page_count))
scope -= 1
pmin = max(page - int(math.floor(scope/2)), 1)
pmax = min(pmin + scope, page_count)
if pmax - pmin < scope:
pmin = pmax - scope if pmax - scope > 0 else 1
def get_url(page):
_url = "%s/page/%s" % (url, page) if page > 1 else url
if url_args:
_url = "%s?%s" % (_url, werkzeug.url_encode(url_args))
return _url
return {
"page_count": page_count,
"offset": (page - 1) * step,
"page": {
'url': get_url(page),
'num': page
},
"page_start": {
'url': get_url(pmin),
'num': pmin
},
"page_previous": {
'url': get_url(max(pmin, page - 1)),
'num': max(pmin, page - 1)
},
"page_next": {
'url': get_url(min(pmax, page + 1)),
'num': min(pmax, page + 1)
},
"page_end": {
'url': get_url(pmax),
'num': pmax
},
"pages": [
{'url': get_url(page), 'num': page}
for page in xrange(pmin, pmax+1)
]
}
def rule_is_enumerable(self, rule):
""" Checks that it is possible to generate sensible GET queries for
a given rule (if the endpoint matches its own requirements)
:type rule: werkzeug.routing.Rule
:rtype: bool
"""
endpoint = rule.endpoint
methods = endpoint.routing.get('methods') or ['GET']
converters = rule._converters.values()
if not ('GET' in methods
and endpoint.routing['type'] == 'http'
and endpoint.routing['auth'] in ('none', 'public')
and endpoint.routing.get('website', False)
and all(hasattr(converter, 'generate') for converter in converters)
and endpoint.routing.get('website')):
return False
# dont't list routes without argument having no default value or converter
spec = inspect.getargspec(endpoint.method.original_func)
# remove self and arguments having a default value
defaults_count = len(spec.defaults or [])
args = spec.args[1:(-defaults_count or None)]
# check that all args have a converter
return all( (arg in rule._converters) for arg in args)
def enumerate_pages(self, cr, uid, ids, query_string=None, context=None):
""" Available pages in the website/CMS. This is mostly used for links
generation and can be overridden by modules setting up new HTML
controllers for dynamic pages (e.g. blog).
By default, returns template views marked as pages.
:param str query_string: a (user-provided) string, fetches pages
matching the string
:returns: a list of mappings with two keys: ``name`` is the displayable
name of the resource (page), ``url`` is the absolute URL
of the same.
:rtype: list({name: str, url: str})
"""
router = request.httprequest.app.get_db_router(request.db)
# Force enumeration to be performed as public user
url_set = set()
for rule in router.iter_rules():
if not self.rule_is_enumerable(rule):
continue
converters = rule._converters or {}
if query_string and not converters and (query_string not in rule.build([{}], append_unknown=False)[1]):
continue
values = [{}]
convitems = converters.items()
# converters with a domain are processed after the other ones
gd = lambda x: hasattr(x[1], 'domain') and (x[1].domain <> '[]')
convitems.sort(lambda x, y: cmp(gd(x), gd(y)))
for (i,(name, converter)) in enumerate(convitems):
newval = []
for val in values:
query = i==(len(convitems)-1) and query_string
for v in converter.generate(request.cr, uid, query=query, args=val, context=context):
newval.append( val.copy() )
v[name] = v['loc']
del v['loc']
newval[-1].update(v)
values = newval
for value in values:
domain_part, url = rule.build(value, append_unknown=False)
page = {'loc': url}
for key,val in value.items():
if key.startswith('__'):
page[key[2:]] = val
if url in ('/sitemap.xml',):
continue
if url in url_set:
continue
url_set.add(url)
yield page
def search_pages(self, cr, uid, ids, needle=None, limit=None, context=None):
name = (needle or "").replace("/page/website.", "").replace("/page/", "")
name = slugify(name, max_length=50)
res = []
for page in self.enumerate_pages(cr, uid, ids, query_string=name, context=context):
res.append(page)
if len(res) == limit:
break
return res
def kanban(self, cr, uid, ids, model, domain, column, template, step=None, scope=None, orderby=None, context=None):
step = step and int(step) or 10
scope = scope and int(scope) or 5
orderby = orderby or "name"
get_args = dict(request.httprequest.args or {})
model_obj = self.pool[model]
relation = model_obj._columns.get(column)._obj
relation_obj = self.pool[relation]
get_args.setdefault('kanban', "")
kanban = get_args.pop('kanban')
kanban_url = "?%s&kanban=" % werkzeug.url_encode(get_args)
pages = {}
for col in kanban.split(","):
if col:
col = col.split("-")
pages[int(col[0])] = int(col[1])
objects = []
for group in model_obj.read_group(cr, uid, domain, ["id", column], groupby=column):
obj = {}
# browse column
relation_id = group[column][0]
obj['column_id'] = relation_obj.browse(cr, uid, relation_id)
obj['kanban_url'] = kanban_url
for k, v in pages.items():
if k != relation_id:
obj['kanban_url'] += "%s-%s" % (k, v)
# pager
number = model_obj.search(cr, uid, group['__domain'], count=True)
obj['page_count'] = int(math.ceil(float(number) / step))
obj['page'] = pages.get(relation_id) or 1
if obj['page'] > obj['page_count']:
obj['page'] = obj['page_count']
offset = (obj['page']-1) * step
obj['page_start'] = max(obj['page'] - int(math.floor((scope-1)/2)), 1)
obj['page_end'] = min(obj['page_start'] + (scope-1), obj['page_count'])
# view data
obj['domain'] = group['__domain']
obj['model'] = model
obj['step'] = step
obj['orderby'] = orderby
# browse objects
object_ids = model_obj.search(cr, uid, group['__domain'], limit=step, offset=offset, order=orderby)
obj['object_ids'] = model_obj.browse(cr, uid, object_ids)
objects.append(obj)
values = {
'objects': objects,
'range': range,
'template': template,
}
return request.website._render("website.kanban_contain", values)
def kanban_col(self, cr, uid, ids, model, domain, page, template, step, orderby, context=None):
html = ""
model_obj = self.pool[model]
domain = safe_eval(domain)
step = int(step)
offset = (int(page)-1) * step
object_ids = model_obj.search(cr, uid, domain, limit=step, offset=offset, order=orderby)
object_ids = model_obj.browse(cr, uid, object_ids)
for object_id in object_ids:
html += request.website._render(template, {'object_id': object_id})
return html
def _image_placeholder(self, response):
# file_open may return a StringIO. StringIO can be closed but are
# not context managers in Python 2 though that is fixed in 3
with contextlib.closing(openerp.tools.misc.file_open(
os.path.join('web', 'static', 'src', 'img', 'placeholder.png'),
mode='rb')) as f:
response.data = f.read()
return response.make_conditional(request.httprequest)
def _image(self, cr, uid, model, id, field, response, max_width=maxint, max_height=maxint, cache=None, context=None):
""" Fetches the requested field and ensures it does not go above
(max_width, max_height), resizing it if necessary.
Resizing is bypassed if the object provides a $field_big, which will
be interpreted as a pre-resized version of the base field.
If the record is not found or does not have the requested field,
returns a placeholder image via :meth:`~._image_placeholder`.
Sets and checks conditional response parameters:
* :mailheader:`ETag` is always set (and checked)
* :mailheader:`Last-Modified is set iif the record has a concurrency
field (``__last_update``)
The requested field is assumed to be base64-encoded image data in
all cases.
"""
Model = self.pool[model]
id = int(id)
ids = None
if Model.check_access_rights(cr, uid, 'read', raise_exception=False):
ids = Model.search(cr, uid,
[('id', '=', id)], context=context)
if not ids and 'website_published' in Model._fields:
ids = Model.search(cr, openerp.SUPERUSER_ID,
[('id', '=', id), ('website_published', '=', True)], context=context)
if not ids:
return self._image_placeholder(response)
concurrency = '__last_update'
[record] = Model.read(cr, openerp.SUPERUSER_ID, [id],
[concurrency, field],
context=context)
if concurrency in record:
server_format = openerp.tools.misc.DEFAULT_SERVER_DATETIME_FORMAT
try:
response.last_modified = datetime.datetime.strptime(
record[concurrency], server_format + '.%f')
except ValueError:
# just in case we have a timestamp without microseconds
response.last_modified = datetime.datetime.strptime(
record[concurrency], server_format)
# Field does not exist on model or field set to False
if not record.get(field):
# FIXME: maybe a field which does not exist should be a 404?
return self._image_placeholder(response)
response.set_etag(hashlib.sha1(record[field]).hexdigest())
response.make_conditional(request.httprequest)
if cache:
response.cache_control.max_age = cache
response.expires = int(time.time() + cache)
# conditional request match
if response.status_code == 304:
return response
data = record[field].decode('base64')
image = Image.open(cStringIO.StringIO(data))
response.mimetype = Image.MIME[image.format]
filename = '%s_%s.%s' % (model.replace('.', '_'), id, str(image.format).lower())
response.headers['Content-Disposition'] = 'inline; filename="%s"' % filename
if (not max_width) and (not max_height):
response.data = data
return response
w, h = image.size
max_w = int(max_width) if max_width else maxint
max_h = int(max_height) if max_height else maxint
if w < max_w and h < max_h:
response.data = data
else:
size = (max_w, max_h)
img = image_resize_and_sharpen(image, size, preserve_aspect_ratio=True)
image_save_for_web(img, response.stream, format=image.format)
# invalidate content-length computed by make_conditional as
# writing to response.stream does not do it (as of werkzeug 0.9.3)
del response.headers['Content-Length']
return response
def image_url(self, cr, uid, record, field, size=None, context=None):
"""Returns a local url that points to the image field of a given browse record."""
model = record._name
sudo_record = record.sudo()
id = '%s_%s' % (record.id, hashlib.sha1(sudo_record.write_date or sudo_record.create_date or '').hexdigest()[0:7])
size = '' if size is None else '/%s' % size
return '/website/image/%s/%s/%s%s' % (model, id, field, size)
class website_menu(osv.osv):
_name = "website.menu"
_description = "Website Menu"
_columns = {
'name': fields.char('Menu', required=True, translate=True),
'url': fields.char('Url'),
'new_window': fields.boolean('New Window'),
'sequence': fields.integer('Sequence'),
# TODO: support multiwebsite once done for ir.ui.views
'website_id': fields.many2one('website', 'Website'),
'parent_id': fields.many2one('website.menu', 'Parent Menu', select=True, ondelete="cascade"),
'child_id': fields.one2many('website.menu', 'parent_id', string='Child Menus'),
'parent_left': fields.integer('Parent Left', select=True),
'parent_right': fields.integer('Parent Right', select=True),
}
def __defaults_sequence(self, cr, uid, context):
menu = self.search_read(cr, uid, [(1,"=",1)], ["sequence"], limit=1, order="sequence DESC", context=context)
return menu and menu[0]["sequence"] or 0
_defaults = {
'url': '',
'sequence': __defaults_sequence,
'new_window': False,
}
_parent_store = True
_parent_order = 'sequence'
_order = "sequence"
# would be better to take a menu_id as argument
def get_tree(self, cr, uid, website_id, context=None):
def make_tree(node):
menu_node = dict(
id=node.id,
name=node.name,
url=node.url,
new_window=node.new_window,
sequence=node.sequence,
parent_id=node.parent_id.id,
children=[],
)
for child in node.child_id:
menu_node['children'].append(make_tree(child))
return menu_node
menu = self.pool.get('website').browse(cr, uid, website_id, context=context).menu_id
return make_tree(menu)
def save(self, cr, uid, website_id, data, context=None):
def replace_id(old_id, new_id):
for menu in data['data']:
if menu['id'] == old_id:
menu['id'] = new_id
if menu['parent_id'] == old_id:
menu['parent_id'] = new_id
to_delete = data['to_delete']
if to_delete:
self.unlink(cr, uid, to_delete, context=context)
for menu in data['data']:
mid = menu['id']
if isinstance(mid, str):
new_id = self.create(cr, uid, {'name': menu['name']}, context=context)
replace_id(mid, new_id)
for menu in data['data']:
self.write(cr, uid, [menu['id']], menu, context=context)
return True
class ir_attachment(osv.osv):
_inherit = "ir.attachment"
def _website_url_get(self, cr, uid, ids, name, arg, context=None):
result = {}
for attach in self.browse(cr, uid, ids, context=context):
if attach.url:
result[attach.id] = attach.url
else:
result[attach.id] = self.pool['website'].image_url(cr, uid, attach, 'datas')
return result
def _datas_checksum(self, cr, uid, ids, name, arg, context=None):
result = dict.fromkeys(ids, False)
attachments = self.read(cr, uid, ids, ['res_model'], context=context)
view_attachment_ids = [attachment['id'] for attachment in attachments if attachment['res_model'] == 'ir.ui.view']
for attach in self.read(cr, uid, view_attachment_ids, ['res_model', 'res_id', 'type', 'datas'], context=context):
result[attach['id']] = self._compute_checksum(attach)
return result
def _compute_checksum(self, attachment_dict):
if attachment_dict.get('res_model') == 'ir.ui.view'\
and not attachment_dict.get('res_id') and not attachment_dict.get('url')\
and attachment_dict.get('type', 'binary') == 'binary'\
and attachment_dict.get('datas'):
return hashlib.new('sha1', attachment_dict['datas']).hexdigest()
return None
def _datas_big(self, cr, uid, ids, name, arg, context=None):
result = dict.fromkeys(ids, False)
if context and context.get('bin_size'):
return result
for record in self.browse(cr, uid, ids, context=context):
if record.res_model != 'ir.ui.view' or not record.datas: continue
try:
result[record.id] = openerp.tools.image_resize_image_big(record.datas)
except IOError: # apparently the error PIL.Image.open raises
pass
return result
_columns = {
'datas_checksum': fields.function(_datas_checksum, size=40,
string="Datas checksum", type='char', store=True, select=True),
'website_url': fields.function(_website_url_get, string="Attachment URL", type='char'),
'datas_big': fields.function (_datas_big, type='binary', store=True,
string="Resized file content"),
'mimetype': fields.char('Mime Type', readonly=True),
}
def _add_mimetype_if_needed(self, values):
if values.get('datas_fname'):
values['mimetype'] = mimetypes.guess_type(values.get('datas_fname'))[0] or 'application/octet-stream'
def create(self, cr, uid, values, context=None):
chk = self._compute_checksum(values)
if chk:
match = self.search(cr, uid, [('datas_checksum', '=', chk)], context=context)
if match:
return match[0]
self._add_mimetype_if_needed(values)
return super(ir_attachment, self).create(
cr, uid, values, context=context)
def write(self, cr, uid, ids, values, context=None):
self._add_mimetype_if_needed(values)
return super(ir_attachment, self).write(cr, uid, ids, values, context=context)
def try_remove(self, cr, uid, ids, context=None):
""" Removes a web-based image attachment if it is used by no view
(template)
Returns a dict mapping attachments which would not be removed (if any)
mapped to the views preventing their removal
"""
Views = self.pool['ir.ui.view']
attachments_to_remove = []
# views blocking removal of the attachment
removal_blocked_by = {}
for attachment in self.browse(cr, uid, ids, context=context):
# in-document URLs are html-escaped, a straight search will not
# find them
url = escape(attachment.website_url)
ids = Views.search(cr, uid, ["|", ('arch', 'like', '"%s"' % url), ('arch', 'like', "'%s'" % url)], context=context)
if ids:
removal_blocked_by[attachment.id] = Views.read(
cr, uid, ids, ['name'], context=context)
else:
attachments_to_remove.append(attachment.id)
if attachments_to_remove:
self.unlink(cr, uid, attachments_to_remove, context=context)
return removal_blocked_by
class res_partner(osv.osv):
_inherit = "res.partner"
def google_map_img(self, cr, uid, ids, zoom=8, width=298, height=298, context=None):
partner = self.browse(cr, uid, ids[0], context=context)
params = {
'center': '%s, %s %s, %s' % (partner.street or '', partner.city or '', partner.zip or '', partner.country_id and partner.country_id.name_get()[0][1] or ''),
'size': "%sx%s" % (height, width),
'zoom': zoom,
'sensor': 'false',
}
return urlplus('//maps.googleapis.com/maps/api/staticmap' , params)
def google_map_link(self, cr, uid, ids, zoom=10, context=None):
partner = self.browse(cr, uid, ids[0], context=context)
params = {
'q': '%s, %s %s, %s' % (partner.street or '', partner.city or '', partner.zip or '', partner.country_id and partner.country_id.name_get()[0][1] or ''),
'z': zoom,
}
return urlplus('https://maps.google.com/maps' , params)
class res_company(osv.osv):
_inherit = "res.company"
def google_map_img(self, cr, uid, ids, zoom=8, width=298, height=298, context=None):
partner = self.browse(cr, openerp.SUPERUSER_ID, ids[0], context=context).partner_id
return partner and partner.google_map_img(zoom, width, height, context=context) or None
def google_map_link(self, cr, uid, ids, zoom=8, context=None):
partner = self.browse(cr, openerp.SUPERUSER_ID, ids[0], context=context).partner_id
return partner and partner.google_map_link(zoom, context=context) or None
class base_language_install(osv.osv_memory):
_inherit = "base.language.install"
_columns = {
'website_ids': fields.many2many('website', string='Websites to translate'),
}
def default_get(self, cr, uid, fields, context=None):
if context is None:
context = {}
defaults = super(base_language_install, self).default_get(cr, uid, fields, context)
website_id = context.get('params', {}).get('website_id')
if website_id:
if 'website_ids' not in defaults:
defaults['website_ids'] = []
defaults['website_ids'].append(website_id)
return defaults
def lang_install(self, cr, uid, ids, context=None):
if context is None:
context = {}
action = super(base_language_install, self).lang_install(cr, uid, ids, context)
language_obj = self.browse(cr, uid, ids)[0]
website_ids = [website.id for website in language_obj['website_ids']]
lang_id = self.pool['res.lang'].search(cr, uid, [('code', '=', language_obj['lang'])])
if website_ids and lang_id:
data = {'language_ids': [(4, lang_id[0])]}
self.pool['website'].write(cr, uid, website_ids, data)
params = context.get('params', {})
if 'url_return' in params:
return {
'url': params['url_return'].replace('[lang]', language_obj['lang']),
'type': 'ir.actions.act_url',
'target': 'self'
}
return action
class website_seo_metadata(osv.Model):
_name = 'website.seo.metadata'
_description = 'SEO metadata'
_columns = {
'website_meta_title': fields.char("Website meta title", translate=True),
'website_meta_description': fields.text("Website meta description", translate=True),
'website_meta_keywords': fields.char("Website meta keywords", translate=True),
}
# vim:et:
|
agpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
646,
15073,
199,
646,
15502,
199,
646,
2197,
199,
646,
8337,
199,
646,
6485,
199,
646,
2050,
199,
646,
3473,
199,
646,
13290,
199,
646,
23128,
199,
646,
747,
199,
646,
295,
199,
646,
900,
199,
646,
7097,
199,
199,
504,
14937,
492,
6047,
199,
504,
984,
492,
1390,
442,
199,
199,
646,
10380,
199,
3,
2716,
2366,
13,
5464,
2021,
492,
334,
2859,
921,
5031,
14,
957,
15,
324,
1153,
75,
15,
1548,
13,
5464,
2021,
9,
199,
893,
26,
272,
492,
29864,
465,
29864,
63,
773,
199,
2590,
3545,
26,
272,
29864,
63,
773,
275,
488,
199,
199,
646,
5166,
199,
504,
5166,
14,
4795,
492,
9813,
12,
9506,
12,
1504,
199,
504,
5166,
14,
2537,
492,
3517,
63,
3765,
465,
4772,
12,
399,
495,
12,
1834,
63,
8709,
63,
460,
63,
609,
285,
897,
12,
1834,
63,
2117,
63,
509,
63,
2520,
199,
504,
5166,
14,
2537,
14,
3489,
63,
2579,
492,
5048,
63,
2579,
199,
504,
5166,
14,
10788,
14,
2520,
14,
1014,
492,
1056,
199,
199,
2921,
275,
2050,
14,
5572,
3460,
354,
3368,
199,
199,
318,
1166,
63,
509,
8,
515,
63,
269,
63,
2302,
12,
6339,
29,
403,
304,
272,
340,
1228,
8,
515,
63,
269,
63,
2302,
12,
2649,
304,
267,
931,
63,
269,
63,
2302,
275,
931,
63,
269,
63,
2302,
14,
2143,
360,
1624,
13,
24,
358,
272,
1453,
63,
515,
275,
1056,
14,
16916,
26762,
14,
515,
272,
340,
1228,
8,
1818,
63,
515,
12,
2649,
304,
267,
1453,
63,
515,
275,
1453,
63,
515,
14,
2143,
360,
1624,
13,
24,
358,
272,
2909,
275,
931,
63,
269,
63,
2302,
14,
1913,
342,
272,
3542,
63,
4159,
275,
6339,
365,
440,
488,
272,
1166,
275,
7097,
14,
10290,
8,
1985,
9,
339,
340,
1056,
436,
440,
1166,
14,
12652,
436,
440,
1166,
14,
5512,
436,
334,
633,
14,
515,
503,
3542,
63,
4159,
304,
267,
2909,
275,
7097,
14,
17755,
8,
1818,
63,
515,
12,
2909,
9,
398,
6339,
275,
6339,
503,
1056,
14,
1100,
14,
362,
360,
4159,
358,
267,
31769,
275,
359,
9783,
59,
16,
61,
367,
634,
71,
315,
1056,
14,
7360,
14,
362,
63,
13209,
5106,
398,
340,
334,
552,
8,
28182,
9,
690,
413,
503,
3542,
63,
4159,
9,
436,
365,
63,
3029,
4159,
63,
633,
8,
1985,
12,
31769,
304,
288,
7347,
275,
2909,
14,
1294,
7825,
288,
340,
7347,
59,
17,
61,
315,
31769,
26,
355,
327,
14402,
314,
2637,
1454,
340,
781,
7662,
5647,
282,
2637,
370,
1166,
63,
509,
355,
340,
3542,
63,
4159,
26,
490,
7347,
59,
17,
61,
275,
6339,
355,
327,
5852,
314,
849,
2637,
7444,
652,
1159,
7662,
2741,
355,
916,
7347,
59,
17,
61,
508,
1056,
14,
7360,
14,
885,
63,
4159,
63,
600,
26,
490,
7347,
14,
1935,
8,
17,
9,
288,
327,
15496,
314,
1067,
2637,
503,
314,
2741,
2637,
288,
916,
6339,
1137,
1056,
14,
7360,
14,
885,
63,
4159,
63,
600,
503,
3542,
63,
4159,
26,
355,
7347,
14,
3176,
8,
17,
12,
6339,
9,
288,
2909,
275,
20538,
904,
8,
1190,
9,
339,
372,
2909,
14,
2708,
360,
1624,
13,
24,
358,
199,
199,
318,
365,
63,
3029,
4159,
63,
633,
8,
1832,
63,
633,
12,
31769,
29,
403,
304,
272,
340,
440,
31769,
26,
267,
31769,
275,
359,
9783,
59,
16,
61,
367,
634,
71,
315,
1056,
14,
7360,
14,
362,
63,
13209,
5106,
272,
308,
515,
275,
2257,
63,
633,
14,
1294,
7825,
272,
327,
340,
282,
2637,
365,
2575,
315,
314,
931,
12,
2813,
652,
272,
340,
308,
515,
59,
17,
61,
315,
31769,
26,
267,
308,
515,
14,
1935,
8,
17,
9,
267,
2257,
63,
633,
275,
20538,
904,
8,
83,
515,
9,
272,
862,
26,
267,
327,
7649,
370,
1336,
376,
6037,
315,
10380,
1159,
14870,
1817,
267,
1166,
275,
2257,
63,
633,
14,
1294,
360,
18478,
267,
931,
275,
1166,
59,
16,
61,
267,
1827,
63,
875,
275,
1166,
59,
17,
61,
340,
822,
8,
633,
9,
690,
413,
587,
488,
267,
6197,
275,
1056,
14,
16916,
26762,
14,
571,
14,
362,
63,
697,
63,
4995,
8,
1069,
14,
697,
680,
3409,
8355,
267,
327,
18771,
370,
1104,
1083,
370,
8761,
14,
28935,
4440,
3102,
520,
788,
4030,
418,
436,
788,
2970,
297,
283,
4030,
418,
267,
2562,
275,
6197,
14,
1431,
8,
515,
12,
1083,
534,
4030,
297,
1827,
63,
589,
29,
1131,
63,
875,
2788,
16,
61,
267,
372,
334,
1532,
14,
9492,
14,
362,
360,
7360,
297,
756,
9,
436,
355,
2562,
14,
9492,
14,
362,
360,
3029,
4159,
297,
2562,
14,
9492,
459,
466,
418,
508,
283,
1014,
1333,
272,
871,
2186,
26,
267,
372,
756,
199,
199,
318,
29864,
8,
83,
12,
1390,
63,
1267,
29,
403,
304,
272,
408,
19463,
282,
1059,
370,
282,
8889,
626,
883,
506,
1202,
315,
282,
1166,
931,
14,
339,
961,
1083,
911,
1642,
862,
370,
886,
314,
3906,
543,
2366,
13,
5464,
2021,
340,
3451,
14,
272,
6630,
652,
911,
2112,
1059,
701,
4024,
3637,
9186,
436,
13401,
7883,
12,
272,
13806,
2649,
8365,
370,
13294,
12,
5117,
316,
1006,
8365,
436,
15810,
7883,
272,
436,
18888,
543,
7188,
17579,
3905,
1674,
339,
520,
635,
308,
26,
620,
272,
520,
635,
1390,
63,
1267,
26,
1109,
272,
520,
4500,
26,
620,
272,
408,
272,
308,
275,
399,
495,
8,
83,
9,
272,
340,
29864,
63,
773,
26,
267,
327,
6006,
787,
499,
3365,
8363,
1454,
2366,
13,
5464,
2021,
365,
3748,
267,
862,
26,
288,
372,
29864,
63,
773,
14,
5464,
2021,
8,
83,
12,
1390,
63,
1267,
29,
988,
63,
1267,
9,
267,
871,
3146,
26,
288,
986,
272,
15439,
275,
23128,
14,
7721,
360,
19749,
13368,
297,
308,
680,
2143,
360,
4371,
297,
283,
4247,
1959,
2708,
360,
4371,
358,
272,
8889,
275,
295,
14,
954,
360,
7023,
55,
63,
4300,
283,
1656,
15439,
680,
1913,
1252,
2325,
342,
272,
8889,
275,
295,
14,
954,
360,
1988,
60,
83,
11529,
17525,
8889,
9,
339,
372,
8889,
1491,
988,
63,
1267,
61,
199,
199,
318,
8889,
8,
585,
304,
272,
340,
1228,
8,
585,
12,
9813
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
646,
15073,
199,
646,
15502,
199,
646,
2197,
199,
646,
8337,
199,
646,
6485,
199,
646,
2050,
199,
646,
3473,
199,
646,
13290,
199,
646,
23128,
199,
646,
747,
199,
646,
295,
199,
646,
900,
199,
646,
7097,
199,
199,
504,
14937,
492,
6047,
199,
504,
984,
492,
1390,
442,
199,
199,
646,
10380,
199,
3,
2716,
2366,
13,
5464,
2021,
492,
334,
2859,
921,
5031,
14,
957,
15,
324,
1153,
75,
15,
1548,
13,
5464,
2021,
9,
199,
893,
26,
272,
492,
29864,
465,
29864,
63,
773,
199,
2590,
3545,
26,
272,
29864,
63,
773,
275,
488,
199,
199,
646,
5166,
199,
504,
5166,
14,
4795,
492,
9813,
12,
9506,
12,
1504,
199,
504,
5166,
14,
2537,
492,
3517,
63,
3765,
465,
4772,
12,
399,
495,
12,
1834,
63,
8709,
63,
460,
63,
609,
285,
897,
12,
1834,
63,
2117,
63,
509,
63,
2520,
199,
504,
5166,
14,
2537,
14,
3489,
63,
2579,
492,
5048,
63,
2579,
199,
504,
5166,
14,
10788,
14,
2520,
14,
1014,
492,
1056,
199,
199,
2921,
275,
2050,
14,
5572,
3460,
354,
3368,
199,
199,
318,
1166,
63,
509,
8,
515,
63,
269,
63,
2302,
12,
6339,
29,
403,
304,
272,
340,
1228,
8,
515,
63,
269,
63,
2302,
12,
2649,
304,
267,
931,
63,
269,
63,
2302,
275,
931,
63,
269,
63,
2302,
14,
2143,
360,
1624,
13,
24,
358,
272,
1453,
63,
515,
275,
1056,
14,
16916,
26762,
14,
515,
272,
340,
1228,
8,
1818,
63,
515,
12,
2649,
304,
267,
1453,
63,
515,
275,
1453,
63,
515,
14,
2143,
360,
1624,
13,
24,
358,
272,
2909,
275,
931,
63,
269,
63,
2302,
14,
1913,
342,
272,
3542,
63,
4159,
275,
6339,
365,
440,
488,
272,
1166,
275,
7097,
14,
10290,
8,
1985,
9,
339,
340,
1056,
436,
440,
1166,
14,
12652,
436,
440,
1166,
14,
5512,
436,
334,
633,
14,
515,
503,
3542,
63,
4159,
304,
267,
2909,
275,
7097,
14,
17755,
8,
1818,
63,
515,
12,
2909,
9,
398,
6339,
275,
6339,
503,
1056,
14,
1100,
14,
362,
360,
4159,
358,
267,
31769,
275,
359,
9783,
59,
16,
61,
367,
634,
71,
315,
1056,
14,
7360,
14,
362,
63,
13209,
5106,
398,
340,
334,
552,
8,
28182,
9,
690,
413,
503,
3542,
63,
4159,
9,
436,
365,
63,
3029,
4159,
63,
633,
8,
1985,
12,
31769,
304,
288,
7347,
275,
2909,
14,
1294,
7825,
288,
340,
7347,
59,
17,
61,
315,
31769,
26,
355,
327,
14402,
314,
2637,
1454,
340,
781,
7662,
5647,
282,
2637,
370,
1166,
63,
509,
355,
340,
3542,
63,
4159,
26,
490,
7347,
59,
17,
61,
275,
6339,
355,
327,
5852,
314,
849,
2637,
7444,
652,
1159,
7662,
2741,
355,
916,
7347,
59,
17,
61,
508,
1056,
14,
7360,
14,
885,
63,
4159,
63,
600,
26,
490,
7347,
14,
1935,
8,
17,
9,
288,
327,
15496,
314,
1067,
2637,
503,
314,
2741,
2637,
288,
916,
6339,
1137,
1056,
14,
7360,
14,
885,
63,
4159,
63,
600,
503,
3542,
63,
4159,
26,
355,
7347,
14,
3176,
8,
17,
12,
6339,
9,
288,
2909,
275,
20538,
904,
8,
1190,
9,
339,
372,
2909,
14,
2708,
360,
1624,
13,
24,
358,
199,
199,
318,
365,
63,
3029,
4159,
63,
633,
8,
1832,
63,
633,
12,
31769,
29,
403,
304,
272,
340,
440,
31769,
26,
267,
31769,
275,
359,
9783,
59,
16,
61,
367,
634,
71,
315,
1056,
14,
7360,
14,
362,
63,
13209,
5106,
272,
308,
515,
275,
2257,
63,
633,
14,
1294,
7825,
272,
327,
340,
282,
2637,
365,
2575,
315,
314,
931,
12,
2813,
652,
272,
340,
308,
515,
59,
17,
61,
315,
31769,
26,
267,
308,
515,
14,
1935,
8,
17,
9,
267,
2257,
63,
633,
275,
20538,
904,
8,
83,
515,
9,
272,
862,
26,
267,
327,
7649,
370,
1336,
376,
6037,
315,
10380,
1159,
14870,
1817,
267,
1166,
275,
2257,
63,
633,
14,
1294,
360,
18478,
267,
931,
275,
1166,
59,
16,
61,
267,
1827,
63,
875,
275,
1166,
59,
17,
61,
340,
822,
8,
633,
9,
690,
413,
587,
488,
267,
6197,
275,
1056,
14,
16916,
26762,
14,
571,
14,
362,
63,
697,
63,
4995,
8,
1069,
14,
697,
680,
3409,
8355,
267,
327,
18771,
370,
1104,
1083,
370,
8761,
14,
28935,
4440,
3102,
520,
788,
4030,
418,
436,
788,
2970,
297,
283,
4030,
418,
267,
2562,
275,
6197,
14,
1431,
8,
515,
12,
1083,
534,
4030,
297,
1827,
63,
589,
29,
1131,
63,
875,
2788,
16,
61,
267,
372,
334,
1532,
14,
9492,
14,
362,
360,
7360,
297,
756,
9,
436,
355,
2562,
14,
9492,
14,
362,
360,
3029,
4159,
297,
2562,
14,
9492,
459,
466,
418,
508,
283,
1014,
1333,
272,
871,
2186,
26,
267,
372,
756,
199,
199,
318,
29864,
8,
83,
12,
1390,
63,
1267,
29,
403,
304,
272,
408,
19463,
282,
1059,
370,
282,
8889,
626,
883,
506,
1202,
315,
282,
1166,
931,
14,
339,
961,
1083,
911,
1642,
862,
370,
886,
314,
3906,
543,
2366,
13,
5464,
2021,
340,
3451,
14,
272,
6630,
652,
911,
2112,
1059,
701,
4024,
3637,
9186,
436,
13401,
7883,
12,
272,
13806,
2649,
8365,
370,
13294,
12,
5117,
316,
1006,
8365,
436,
15810,
7883,
272,
436,
18888,
543,
7188,
17579,
3905,
1674,
339,
520,
635,
308,
26,
620,
272,
520,
635,
1390,
63,
1267,
26,
1109,
272,
520,
4500,
26,
620,
272,
408,
272,
308,
275,
399,
495,
8,
83,
9,
272,
340,
29864,
63,
773,
26,
267,
327,
6006,
787,
499,
3365,
8363,
1454,
2366,
13,
5464,
2021,
365,
3748,
267,
862,
26,
288,
372,
29864,
63,
773,
14,
5464,
2021,
8,
83,
12,
1390,
63,
1267,
29,
988,
63,
1267,
9,
267,
871,
3146,
26,
288,
986,
272,
15439,
275,
23128,
14,
7721,
360,
19749,
13368,
297,
308,
680,
2143,
360,
4371,
297,
283,
4247,
1959,
2708,
360,
4371,
358,
272,
8889,
275,
295,
14,
954,
360,
7023,
55,
63,
4300,
283,
1656,
15439,
680,
1913,
1252,
2325,
342,
272,
8889,
275,
295,
14,
954,
360,
1988,
60,
83,
11529,
17525,
8889,
9,
339,
372,
8889,
1491,
988,
63,
1267,
61,
199,
199,
318,
8889,
8,
585,
304,
272,
340,
1228,
8,
585,
12,
9813,
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,
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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
] |
WoLpH/CouchPotatoServer
|
couchpotato/core/providers/info/couchpotatoapi/main.py
|
1
|
3986
|
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.info.base import MovieProvider
from couchpotato.environment import Env
import base64
import time
log = CPLog(__name__)
class CouchPotatoApi(MovieProvider):
urls = {
'validate': 'https://api.couchpota.to/validate/%s/',
'search': 'https://api.couchpota.to/search/%s/',
'info': 'https://api.couchpota.to/info/%s/',
'is_movie': 'https://api.couchpota.to/ismovie/%s/',
'eta': 'https://api.couchpota.to/eta/%s/',
'suggest': 'https://api.couchpota.to/suggest/',
'updater': 'https://api.couchpota.to/updater/?%s',
'messages': 'https://api.couchpota.to/messages/?%s',
}
http_time_between_calls = 0
api_version = 1
def __init__(self):
addEvent('movie.info', self.getInfo, priority = 1)
addEvent('info.search', self.search, priority = 1)
addEvent('movie.search', self.search, priority = 1)
addEvent('movie.release_date', self.getReleaseDate)
addEvent('movie.suggest', self.getSuggestions)
addEvent('movie.is_movie', self.isMovie)
addEvent('release.validate', self.validate)
addEvent('cp.source_url', self.getSourceUrl)
addEvent('cp.messages', self.getMessages)
def getMessages(self, last_check = 0):
data = self.getJsonData(self.urls['messages'] % tryUrlencode({
'last_check': last_check,
}), headers = self.getRequestHeaders(), cache_timeout = 10)
return data
def getSourceUrl(self, repo = None, repo_name = None, branch = None):
return self.getJsonData(self.urls['updater'] % tryUrlencode({
'repo': repo,
'name': repo_name,
'branch': branch,
}), headers = self.getRequestHeaders())
def search(self, q, limit = 5):
return self.getJsonData(self.urls['search'] % tryUrlencode(q) + ('?limit=%s' % limit), headers = self.getRequestHeaders())
def validate(self, name = None):
if not name:
return
name_enc = base64.b64encode(name)
return self.getJsonData(self.urls['validate'] % name_enc, headers = self.getRequestHeaders())
def isMovie(self, identifier = None):
if not identifier:
return
data = self.getJsonData(self.urls['is_movie'] % identifier, headers = self.getRequestHeaders())
if data:
return data.get('is_movie', True)
return True
def getInfo(self, identifier = None):
if not identifier:
return
result = self.getJsonData(self.urls['info'] % identifier, headers = self.getRequestHeaders())
if result:
return dict((k, v) for k, v in result.iteritems() if v)
return {}
def getReleaseDate(self, identifier = None):
if identifier is None: return {}
dates = self.getJsonData(self.urls['eta'] % identifier, headers = self.getRequestHeaders())
log.debug('Found ETA for %s: %s', (identifier, dates))
return dates
def getSuggestions(self, movies = None, ignore = None):
if not ignore: ignore = []
if not movies: movies = []
suggestions = self.getJsonData(self.urls['suggest'], params = {
'movies': ','.join(movies),
'ignore': ','.join(ignore),
}, headers = self.getRequestHeaders())
log.info('Found suggestions for %s movies, %s ignored', (len(movies), len(ignore)))
return suggestions
def getRequestHeaders(self):
return {
'X-CP-Version': fireEvent('app.version', single = True),
'X-CP-API': self.api_version,
'X-CP-Time': time.time(),
'X-CP-Identifier': '+%s' % Env.setting('api_key', 'core')[:10], # Use first 10 as identifier, so we don't need to use IP address in api stats
}
|
gpl-3.0
|
[
504,
28877,
30780,
14,
1018,
14,
1430,
492,
1050,
2390,
12,
8344,
2390,
199,
504,
28877,
30780,
14,
1018,
14,
7546,
14,
2991,
492,
862,
21867,
8324,
199,
504,
28877,
30780,
14,
1018,
14,
2921,
492,
19701,
2445,
199,
504,
28877,
30780,
14,
1018,
14,
9710,
14,
815,
14,
1095,
492,
31248,
6663,
199,
504,
28877,
30780,
14,
5418,
492,
31543,
199,
646,
1300,
772,
199,
646,
900,
199,
199,
793,
275,
19701,
2445,
3460,
354,
3368,
421,
199,
533,
445,
13087,
48,
357,
11318,
7394,
8,
19088,
6663,
304,
339,
8187,
275,
469,
267,
283,
3502,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
3502,
3149,
83,
3678,
267,
283,
1733,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
1733,
3149,
83,
3678,
267,
283,
815,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
815,
3149,
83,
3678,
267,
283,
374,
63,
10888,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
374,
10888,
3149,
83,
3678,
267,
283,
1841,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
1841,
3149,
83,
3678,
267,
283,
19957,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
19957,
3678,
267,
283,
29645,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
29645,
10197,
5,
83,
297,
267,
283,
3431,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
3431,
10197,
5,
83,
297,
272,
789,
272,
1455,
63,
521,
63,
13007,
63,
5352,
275,
378,
272,
2986,
63,
1023,
275,
413,
339,
347,
636,
826,
721,
277,
304,
267,
1050,
2390,
360,
10888,
14,
815,
297,
291,
14,
362,
2354,
12,
7464,
275,
413,
9,
267,
1050,
2390,
360,
815,
14,
1733,
297,
291,
14,
1733,
12,
7464,
275,
413,
9,
267,
1050,
2390,
360,
10888,
14,
1733,
297,
291,
14,
1733,
12,
7464,
275,
413,
9,
267,
1050,
2390,
360,
10888,
14,
3221,
63,
602,
297,
291,
14,
362,
9625,
2506,
9,
267,
1050,
2390,
360,
10888,
14,
19957,
297,
291,
14,
362,
51,
11914,
15293,
9,
267,
1050,
2390,
360,
10888,
14,
374,
63,
10888,
297,
291,
14,
374,
19088,
9,
398,
1050,
2390,
360,
3221,
14,
3502,
297,
291,
14,
3502,
9,
398,
1050,
2390,
360,
1850,
14,
1365,
63,
633,
297,
291,
14,
362,
2980,
6417,
9,
267,
1050,
2390,
360,
1850,
14,
3431,
297,
291,
14,
362,
14508,
9,
339,
347,
664,
14508,
8,
277,
12,
2061,
63,
1074,
275,
378,
304,
398,
666,
275,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
3431,
418,
450,
862,
21867,
8324,
2561,
288,
283,
2019,
63,
1074,
356,
2061,
63,
1074,
12,
267,
9998,
2323,
275,
291,
14,
362,
2017,
9883,
1062,
2581,
63,
2593,
275,
1616,
9,
398,
372,
666,
339,
347,
664,
2980,
6417,
8,
277,
12,
3831,
275,
488,
12,
3831,
63,
354,
275,
488,
12,
5246,
275,
488,
304,
267,
372,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
29645,
418,
450,
862,
21867,
8324,
2561,
288,
283,
3417,
356,
3831,
12,
288,
283,
354,
356,
3831,
63,
354,
12,
288,
283,
4694,
356,
5246,
12,
267,
9998,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
339,
347,
2754,
8,
277,
12,
1894,
12,
2304,
275,
959,
304,
267,
372,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
1733,
418,
450,
862,
21867,
8324,
8,
81,
9,
435,
661,
31,
3097,
2458,
83,
7,
450,
2304,
395,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
339,
347,
4107,
8,
277,
12,
536,
275,
488,
304,
398,
340,
440,
536,
26,
288,
372,
398,
536,
63,
10945,
275,
1300,
772,
14,
66,
772,
2143,
8,
354,
9,
267,
372,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
3502,
418,
450,
536,
63,
10945,
12,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
339,
347,
365,
19088,
8,
277,
12,
5148,
275,
488,
304,
398,
340,
440,
5148,
26,
288,
372,
398,
666,
275,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
374,
63,
10888,
418,
450,
5148,
12,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
267,
340,
666,
26,
288,
372,
666,
14,
362,
360,
374,
63,
10888,
297,
715,
9,
398,
372,
715,
339,
347,
664,
2354,
8,
277,
12,
5148,
275,
488,
304,
398,
340,
440,
5148,
26,
288,
372,
398,
754,
275,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
815,
418,
450,
5148,
12,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
267,
340,
754,
26,
288,
372,
1211,
1332,
75,
12,
373,
9,
367,
1022,
12,
373,
315,
754,
14,
4611,
342,
340,
373,
9,
398,
372,
1052,
339,
347,
664,
9625,
2506,
8,
277,
12,
5148,
275,
488,
304,
267,
340,
5148,
365,
488,
26,
372,
1052,
398,
10831,
275,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
1841,
418,
450,
5148,
12,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
267,
943,
14,
1757,
360,
3601,
662,
6166,
367,
450,
83,
26,
450,
83,
297,
334,
5364,
12,
10831,
430,
398,
372,
10831,
339,
347,
664,
51,
11914,
15293,
8,
277,
12,
1303,
14484,
275,
488,
12,
3686,
275,
488,
304,
267,
340,
440,
3686,
26,
3686,
275,
942,
267,
340,
440,
1303,
14484,
26,
1303,
14484,
275,
942,
398,
18453,
15293,
275,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
19957,
995,
1862,
275,
469,
288,
283,
20888,
356,
12814,
904,
8,
20888,
395,
288,
283,
4247,
356,
12814,
904,
8,
4247,
395,
267,
1660,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
267,
943,
14,
815,
360,
3601,
18453,
15293,
367,
450,
83,
1303,
14484,
12,
450,
83,
5525,
297,
334,
552,
8,
20888,
395,
822,
8,
4247,
1724,
398,
372,
18453,
15293,
339,
347,
664,
2017,
9883,
8,
277,
304,
267,
372,
469,
288,
283,
56,
13,
2890,
13,
3353,
356,
8344,
2390,
360,
571,
14,
1023,
297,
2849,
275,
715,
395,
288,
283,
56,
13,
2890,
13,
3735,
356,
291,
14,
1246,
63,
1023,
12,
288
] |
[
28877,
30780,
14,
1018,
14,
1430,
492,
1050,
2390,
12,
8344,
2390,
199,
504,
28877,
30780,
14,
1018,
14,
7546,
14,
2991,
492,
862,
21867,
8324,
199,
504,
28877,
30780,
14,
1018,
14,
2921,
492,
19701,
2445,
199,
504,
28877,
30780,
14,
1018,
14,
9710,
14,
815,
14,
1095,
492,
31248,
6663,
199,
504,
28877,
30780,
14,
5418,
492,
31543,
199,
646,
1300,
772,
199,
646,
900,
199,
199,
793,
275,
19701,
2445,
3460,
354,
3368,
421,
199,
533,
445,
13087,
48,
357,
11318,
7394,
8,
19088,
6663,
304,
339,
8187,
275,
469,
267,
283,
3502,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
3502,
3149,
83,
3678,
267,
283,
1733,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
1733,
3149,
83,
3678,
267,
283,
815,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
815,
3149,
83,
3678,
267,
283,
374,
63,
10888,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
374,
10888,
3149,
83,
3678,
267,
283,
1841,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
1841,
3149,
83,
3678,
267,
283,
19957,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
19957,
3678,
267,
283,
29645,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
29645,
10197,
5,
83,
297,
267,
283,
3431,
356,
283,
2859,
921,
1246,
14,
331,
2133,
80,
12041,
14,
475,
15,
3431,
10197,
5,
83,
297,
272,
789,
272,
1455,
63,
521,
63,
13007,
63,
5352,
275,
378,
272,
2986,
63,
1023,
275,
413,
339,
347,
636,
826,
721,
277,
304,
267,
1050,
2390,
360,
10888,
14,
815,
297,
291,
14,
362,
2354,
12,
7464,
275,
413,
9,
267,
1050,
2390,
360,
815,
14,
1733,
297,
291,
14,
1733,
12,
7464,
275,
413,
9,
267,
1050,
2390,
360,
10888,
14,
1733,
297,
291,
14,
1733,
12,
7464,
275,
413,
9,
267,
1050,
2390,
360,
10888,
14,
3221,
63,
602,
297,
291,
14,
362,
9625,
2506,
9,
267,
1050,
2390,
360,
10888,
14,
19957,
297,
291,
14,
362,
51,
11914,
15293,
9,
267,
1050,
2390,
360,
10888,
14,
374,
63,
10888,
297,
291,
14,
374,
19088,
9,
398,
1050,
2390,
360,
3221,
14,
3502,
297,
291,
14,
3502,
9,
398,
1050,
2390,
360,
1850,
14,
1365,
63,
633,
297,
291,
14,
362,
2980,
6417,
9,
267,
1050,
2390,
360,
1850,
14,
3431,
297,
291,
14,
362,
14508,
9,
339,
347,
664,
14508,
8,
277,
12,
2061,
63,
1074,
275,
378,
304,
398,
666,
275,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
3431,
418,
450,
862,
21867,
8324,
2561,
288,
283,
2019,
63,
1074,
356,
2061,
63,
1074,
12,
267,
9998,
2323,
275,
291,
14,
362,
2017,
9883,
1062,
2581,
63,
2593,
275,
1616,
9,
398,
372,
666,
339,
347,
664,
2980,
6417,
8,
277,
12,
3831,
275,
488,
12,
3831,
63,
354,
275,
488,
12,
5246,
275,
488,
304,
267,
372,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
29645,
418,
450,
862,
21867,
8324,
2561,
288,
283,
3417,
356,
3831,
12,
288,
283,
354,
356,
3831,
63,
354,
12,
288,
283,
4694,
356,
5246,
12,
267,
9998,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
339,
347,
2754,
8,
277,
12,
1894,
12,
2304,
275,
959,
304,
267,
372,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
1733,
418,
450,
862,
21867,
8324,
8,
81,
9,
435,
661,
31,
3097,
2458,
83,
7,
450,
2304,
395,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
339,
347,
4107,
8,
277,
12,
536,
275,
488,
304,
398,
340,
440,
536,
26,
288,
372,
398,
536,
63,
10945,
275,
1300,
772,
14,
66,
772,
2143,
8,
354,
9,
267,
372,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
3502,
418,
450,
536,
63,
10945,
12,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
339,
347,
365,
19088,
8,
277,
12,
5148,
275,
488,
304,
398,
340,
440,
5148,
26,
288,
372,
398,
666,
275,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
374,
63,
10888,
418,
450,
5148,
12,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
267,
340,
666,
26,
288,
372,
666,
14,
362,
360,
374,
63,
10888,
297,
715,
9,
398,
372,
715,
339,
347,
664,
2354,
8,
277,
12,
5148,
275,
488,
304,
398,
340,
440,
5148,
26,
288,
372,
398,
754,
275,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
815,
418,
450,
5148,
12,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
267,
340,
754,
26,
288,
372,
1211,
1332,
75,
12,
373,
9,
367,
1022,
12,
373,
315,
754,
14,
4611,
342,
340,
373,
9,
398,
372,
1052,
339,
347,
664,
9625,
2506,
8,
277,
12,
5148,
275,
488,
304,
267,
340,
5148,
365,
488,
26,
372,
1052,
398,
10831,
275,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
1841,
418,
450,
5148,
12,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
267,
943,
14,
1757,
360,
3601,
662,
6166,
367,
450,
83,
26,
450,
83,
297,
334,
5364,
12,
10831,
430,
398,
372,
10831,
339,
347,
664,
51,
11914,
15293,
8,
277,
12,
1303,
14484,
275,
488,
12,
3686,
275,
488,
304,
267,
340,
440,
3686,
26,
3686,
275,
942,
267,
340,
440,
1303,
14484,
26,
1303,
14484,
275,
942,
398,
18453,
15293,
275,
291,
14,
362,
9653,
1451,
8,
277,
14,
3603,
459,
19957,
995,
1862,
275,
469,
288,
283,
20888,
356,
12814,
904,
8,
20888,
395,
288,
283,
4247,
356,
12814,
904,
8,
4247,
395,
267,
1660,
2323,
275,
291,
14,
362,
2017,
9883,
1012,
267,
943,
14,
815,
360,
3601,
18453,
15293,
367,
450,
83,
1303,
14484,
12,
450,
83,
5525,
297,
334,
552,
8,
20888,
395,
822,
8,
4247,
1724,
398,
372,
18453,
15293,
339,
347,
664,
2017,
9883,
8,
277,
304,
267,
372,
469,
288,
283,
56,
13,
2890,
13,
3353,
356,
8344,
2390,
360,
571,
14,
1023,
297,
2849,
275,
715,
395,
288,
283,
56,
13,
2890,
13,
3735,
356,
291,
14,
1246,
63,
1023,
12,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
Eyeless95/samsung_g531_kernel
|
scripts/tracing/draw_functrace.py
|
14676
|
3560
|
#!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call stack by drawing textual but hierarchical tree of
calls. Only the functions's names and the the call time are provided.
Usage:
Be sure that you have CONFIG_FUNCTION_TRACER
# mount -t debugfs nodev /sys/kernel/debug
# echo function > /sys/kernel/debug/tracing/current_tracer
$ cat /sys/kernel/debug/tracing/trace_pipe > ~/raw_trace_func
Wait some times but not too much, the script is a bit slow.
Break the pipe (Ctrl + Z)
$ scripts/draw_functrace.py < raw_trace_func > draw_functrace
Then you have your drawn trace in draw_functrace
"""
import sys, re
class CallTree:
""" This class provides a tree representation of the functions
call stack. If a function has no parent in the kernel (interrupt,
syscall, kernel thread...) then it is attached to a virtual parent
called ROOT.
"""
ROOT = None
def __init__(self, func, time = None, parent = None):
self._func = func
self._time = time
if parent is None:
self._parent = CallTree.ROOT
else:
self._parent = parent
self._children = []
def calls(self, func, calltime):
""" If a function calls another one, call this method to insert it
into the tree at the appropriate place.
@return: A reference to the newly created child node.
"""
child = CallTree(func, calltime, self)
self._children.append(child)
return child
def getParent(self, func):
""" Retrieve the last parent of the current node that
has the name given by func. If this function is not
on a parent, then create it as new child of root
@return: A reference to the parent.
"""
tree = self
while tree != CallTree.ROOT and tree._func != func:
tree = tree._parent
if tree == CallTree.ROOT:
child = CallTree.ROOT.calls(func, None)
return child
return tree
def __repr__(self):
return self.__toString("", True)
def __toString(self, branch, lastChild):
if self._time is not None:
s = "%s----%s (%s)\n" % (branch, self._func, self._time)
else:
s = "%s----%s\n" % (branch, self._func)
i = 0
if lastChild:
branch = branch[:-1] + " "
while i < len(self._children):
if i != len(self._children) - 1:
s += "%s" % self._children[i].__toString(branch +\
" |", False)
else:
s += "%s" % self._children[i].__toString(branch +\
" |", True)
i += 1
return s
class BrokenLineException(Exception):
"""If the last line is not complete because of the pipe breakage,
we want to stop the processing and ignore this line.
"""
pass
class CommentLineException(Exception):
""" If the line is a comment (as in the beginning of the trace file),
just ignore it.
"""
pass
def parseLine(line):
line = line.strip()
if line.startswith("#"):
raise CommentLineException
m = re.match("[^]]+?\\] +([0-9.]+): (\\w+) <-(\\w+)", line)
if m is None:
raise BrokenLineException
return (m.group(1), m.group(2), m.group(3))
def main():
CallTree.ROOT = CallTree("Root (Nowhere)", None, None)
tree = CallTree.ROOT
for line in sys.stdin:
try:
calltime, callee, caller = parseLine(line)
except BrokenLineException:
break
except CommentLineException:
continue
tree = tree.getParent(caller)
tree = tree.calls(callee, calltime)
print CallTree.ROOT
if __name__ == "__main__":
main()
|
gpl-2.0
|
[
3381,
2647,
15,
1393,
15,
1548,
199,
199,
624,
199,
7384,
9079,
334,
67,
9,
481,
21919,
1567,
2136,
374,
1235,
22043,
665,
70,
1129,
374,
24554,
32,
6799,
14,
957,
30,
199,
31661,
1334,
314,
2895,
402,
314,
1664,
14629,
844,
1015,
499,
199,
199,
2765,
2884,
19953,
282,
3307,
2741,
701,
314,
805,
29140,
315,
199,
4989,
15,
3446,
15,
3446,
63,
5777,
14,
67,
199,
1918,
522,
30355,
3307,
365,
7686,
1901,
282,
3123,
370,
7389,
282,
1655,
11779,
199,
1345,
402,
314,
1240,
3464,
701,
17455,
25884,
1325,
24787,
3123,
402,
199,
5352,
14,
5972,
314,
3423,
1159,
1561,
436,
314,
314,
1240,
900,
787,
2741,
14,
199,
199,
7692,
26,
199,
198,
3655,
3238,
626,
1265,
1172,
15869,
63,
15476,
63,
1766,
1348,
540,
199,
198,
3,
10760,
446,
84,
3105,
2319,
1031,
86,
1182,
1274,
15,
4989,
15,
1757,
199,
198,
3,
11343,
805,
690,
1182,
1274,
15,
4989,
15,
1757,
15,
21635,
15,
1818,
63,
16825,
199,
198,
4,
6230,
1182,
1274,
15,
4989,
15,
1757,
15,
21635,
15,
3446,
63,
4990,
690,
6146,
15,
1773,
63,
3446,
63,
1532,
199,
198,
7536,
2005,
5431,
1325,
440,
4634,
8298,
12,
314,
2884,
365,
282,
4546,
11999,
14,
199,
198,
13948,
314,
5200,
334,
9778,
435,
3107,
9,
199,
198,
4,
10554,
15,
5485,
63,
31939,
5986,
14,
647,
665,
3066,
63,
3446,
63,
1532,
690,
5954,
63,
31939,
5986,
199,
198,
28226,
1265,
1172,
2195,
19341,
3307,
315,
5954,
63,
31939,
5986,
199,
624,
421,
199,
646,
984,
12,
295,
199,
199,
533,
23491,
26,
199,
198,
624,
961,
1021,
6571,
282,
3123,
6025,
402,
314,
3423,
507,
198,
1250,
3464,
14,
982,
282,
805,
965,
949,
1676,
315,
314,
5114,
334,
20172,
12,
507,
198,
19444,
12,
5114,
2462,
11965,
2066,
652,
365,
10102,
370,
282,
5791,
1676,
507,
198,
3527,
16547,
14,
199,
198,
624,
199,
198,
5441,
275,
488,
421,
198,
318,
636,
826,
721,
277,
12,
2562,
12,
900,
275,
488,
12,
1676,
275,
488,
304,
507,
198,
277,
423,
1532,
275,
2562,
507,
198,
277,
423,
521,
275,
900,
507,
198,
692,
1676,
365,
488,
26,
686,
198,
277,
423,
1708,
275,
23491,
14,
5441,
507,
198,
2836,
26,
686,
198,
277,
423,
1708,
275,
1676,
507,
198,
277,
423,
3223,
275,
942,
421,
198,
318,
4882,
8,
277,
12,
2562,
12,
1240,
521,
304,
507,
198,
624,
982,
282,
805,
4882,
4573,
1373,
12,
1240,
642,
1083,
370,
5518,
652,
686,
198,
9924,
314,
3123,
737,
314,
5827,
4192,
14,
686,
198,
32,
1107,
26,
437,
3659,
370,
314,
13903,
2737,
1982,
1031,
14,
507,
198,
624,
507,
198,
1739,
275,
23491,
8,
1532,
12,
1240,
521,
12,
291,
9,
507,
198,
277,
423,
3223,
14,
740,
8,
1739,
9,
507,
198,
1107,
1982,
421,
198,
318,
664,
6652,
8,
277,
12,
2562,
304,
507,
198,
624,
13939,
314,
2061,
1676,
402,
314,
1453,
1031,
626,
686,
198,
1989,
314,
536,
1627,
701,
2562,
14,
982,
642,
805,
365,
440,
686,
198,
265,
282,
1676,
12,
2066,
1218,
652,
465,
892,
1982,
402,
1738,
686,
198,
32,
1107,
26,
437,
3659,
370,
314,
1676,
14,
507,
198,
624,
507,
198,
2350,
275,
291,
507,
198,
6710,
3123,
1137,
23491,
14,
5441,
436,
3123,
423,
1532,
1137,
2562,
26,
686,
198,
2350,
275,
3123,
423,
1708,
507,
198,
692,
3123,
508,
23491,
14,
5441,
26,
686,
198,
1739,
275,
23491,
14,
5441,
14,
5352,
8,
1532,
12,
488,
9,
686,
198,
1107,
1982,
507,
198,
1107,
3123,
421,
198,
318,
636,
2722,
721,
277,
304,
507,
198,
1107,
291,
855,
16695,
12398,
715,
9,
421,
198,
318,
636,
16695,
8,
277,
12,
5246,
12,
2061,
3493,
304,
507,
198,
692,
291,
423,
521,
365,
440,
488,
26,
686,
198,
83,
275,
2071,
83,
375,
5,
83,
4366,
83,
2862,
78,
2,
450,
334,
4694,
12,
291,
423,
1532,
12,
291,
423,
521,
9,
507,
198,
2836,
26,
686,
198,
83,
275,
2071,
83,
375,
5,
83,
60,
78,
2,
450,
334,
4694,
12,
291,
423,
1532,
9,
2742,
198,
73,
275,
378,
507,
198,
692,
2061,
3493,
26,
686,
198,
4694,
275,
5246,
4439,
17,
61,
435,
298,
298,
507,
198,
6710,
284,
665,
822,
8,
277,
423,
3223,
304,
686,
198,
692,
284,
1137,
822,
8,
277,
423,
3223,
9,
446,
413,
26,
1585,
198,
83,
847,
2071,
83,
2,
450,
291,
423,
3223,
59,
73,
17979,
16695,
8,
4694,
17992,
11674,
198,
2,
259,
1204,
401,
756,
9,
686,
198,
2836,
26,
1585,
198,
83,
847,
2071,
83,
2,
450,
291,
423,
3223,
59,
73,
17979,
16695,
8,
4694,
17992,
11674,
198,
2,
259,
1204,
401,
715,
9,
686,
198,
73,
847,
413,
507,
198,
1107,
308,
199,
199,
533,
23804,
29969,
8,
1726,
304,
199,
198,
624,
3917,
314,
2061,
1004,
365,
440,
4890,
2952,
402,
314,
5200,
2059,
474,
12,
21979,
781,
2934,
370,
3631,
314,
6661,
436,
3686,
642,
1004,
14,
199,
198,
624,
199,
198,
1529,
199,
199,
533,
6819,
29969,
8,
1726,
304,
199,
198,
624,
982,
314,
1004,
365,
282,
3721,
334,
305,
315,
314,
9608,
402,
314,
3307,
570,
395,
6722,
2951,
3686,
652,
14,
199,
198,
624,
199,
198,
1529,
421,
199,
318,
2198,
3049,
8,
604,
304,
199,
198,
604,
275,
1004,
14,
1913,
342,
199,
198,
692,
1004,
14,
2460,
10064,
2349,
507,
198,
3730,
6819,
29969,
199,
198,
77,
275,
295,
14,
1431,
480,
4735,
2677,
23778,
1103,
61,
435,
779,
16,
13,
25,
32455,
304,
334,
1103,
87,
8771,
665,
15426,
1103,
87,
11,
4186,
1004,
9,
199,
198,
692,
333,
365,
488,
26,
507,
198,
3730,
23804,
29969,
199,
198,
1107,
334,
77,
14,
923,
8,
17,
395,
333,
14,
923,
8,
18,
395,
333,
14,
923,
8,
19,
430,
421,
199,
318,
2446,
837,
199,
198,
2176,
3987,
14,
5441,
275,
23491,
480,
6405,
334,
14351,
1681,
4186,
488,
12,
488,
9,
199,
198,
2350,
275,
23491,
14,
5441,
421,
198,
509,
1004,
315,
984,
14,
6626,
26,
507,
198,
893,
26,
686,
198,
1250,
521,
12,
3213,
18387,
12,
8025,
275,
2198,
3049,
8,
604
] |
[
2647,
15,
1393,
15,
1548,
199,
199,
624,
199,
7384,
9079,
334,
67,
9,
481,
21919,
1567,
2136,
374,
1235,
22043,
665,
70,
1129,
374,
24554,
32,
6799,
14,
957,
30,
199,
31661,
1334,
314,
2895,
402,
314,
1664,
14629,
844,
1015,
499,
199,
199,
2765,
2884,
19953,
282,
3307,
2741,
701,
314,
805,
29140,
315,
199,
4989,
15,
3446,
15,
3446,
63,
5777,
14,
67,
199,
1918,
522,
30355,
3307,
365,
7686,
1901,
282,
3123,
370,
7389,
282,
1655,
11779,
199,
1345,
402,
314,
1240,
3464,
701,
17455,
25884,
1325,
24787,
3123,
402,
199,
5352,
14,
5972,
314,
3423,
1159,
1561,
436,
314,
314,
1240,
900,
787,
2741,
14,
199,
199,
7692,
26,
199,
198,
3655,
3238,
626,
1265,
1172,
15869,
63,
15476,
63,
1766,
1348,
540,
199,
198,
3,
10760,
446,
84,
3105,
2319,
1031,
86,
1182,
1274,
15,
4989,
15,
1757,
199,
198,
3,
11343,
805,
690,
1182,
1274,
15,
4989,
15,
1757,
15,
21635,
15,
1818,
63,
16825,
199,
198,
4,
6230,
1182,
1274,
15,
4989,
15,
1757,
15,
21635,
15,
3446,
63,
4990,
690,
6146,
15,
1773,
63,
3446,
63,
1532,
199,
198,
7536,
2005,
5431,
1325,
440,
4634,
8298,
12,
314,
2884,
365,
282,
4546,
11999,
14,
199,
198,
13948,
314,
5200,
334,
9778,
435,
3107,
9,
199,
198,
4,
10554,
15,
5485,
63,
31939,
5986,
14,
647,
665,
3066,
63,
3446,
63,
1532,
690,
5954,
63,
31939,
5986,
199,
198,
28226,
1265,
1172,
2195,
19341,
3307,
315,
5954,
63,
31939,
5986,
199,
624,
421,
199,
646,
984,
12,
295,
199,
199,
533,
23491,
26,
199,
198,
624,
961,
1021,
6571,
282,
3123,
6025,
402,
314,
3423,
507,
198,
1250,
3464,
14,
982,
282,
805,
965,
949,
1676,
315,
314,
5114,
334,
20172,
12,
507,
198,
19444,
12,
5114,
2462,
11965,
2066,
652,
365,
10102,
370,
282,
5791,
1676,
507,
198,
3527,
16547,
14,
199,
198,
624,
199,
198,
5441,
275,
488,
421,
198,
318,
636,
826,
721,
277,
12,
2562,
12,
900,
275,
488,
12,
1676,
275,
488,
304,
507,
198,
277,
423,
1532,
275,
2562,
507,
198,
277,
423,
521,
275,
900,
507,
198,
692,
1676,
365,
488,
26,
686,
198,
277,
423,
1708,
275,
23491,
14,
5441,
507,
198,
2836,
26,
686,
198,
277,
423,
1708,
275,
1676,
507,
198,
277,
423,
3223,
275,
942,
421,
198,
318,
4882,
8,
277,
12,
2562,
12,
1240,
521,
304,
507,
198,
624,
982,
282,
805,
4882,
4573,
1373,
12,
1240,
642,
1083,
370,
5518,
652,
686,
198,
9924,
314,
3123,
737,
314,
5827,
4192,
14,
686,
198,
32,
1107,
26,
437,
3659,
370,
314,
13903,
2737,
1982,
1031,
14,
507,
198,
624,
507,
198,
1739,
275,
23491,
8,
1532,
12,
1240,
521,
12,
291,
9,
507,
198,
277,
423,
3223,
14,
740,
8,
1739,
9,
507,
198,
1107,
1982,
421,
198,
318,
664,
6652,
8,
277,
12,
2562,
304,
507,
198,
624,
13939,
314,
2061,
1676,
402,
314,
1453,
1031,
626,
686,
198,
1989,
314,
536,
1627,
701,
2562,
14,
982,
642,
805,
365,
440,
686,
198,
265,
282,
1676,
12,
2066,
1218,
652,
465,
892,
1982,
402,
1738,
686,
198,
32,
1107,
26,
437,
3659,
370,
314,
1676,
14,
507,
198,
624,
507,
198,
2350,
275,
291,
507,
198,
6710,
3123,
1137,
23491,
14,
5441,
436,
3123,
423,
1532,
1137,
2562,
26,
686,
198,
2350,
275,
3123,
423,
1708,
507,
198,
692,
3123,
508,
23491,
14,
5441,
26,
686,
198,
1739,
275,
23491,
14,
5441,
14,
5352,
8,
1532,
12,
488,
9,
686,
198,
1107,
1982,
507,
198,
1107,
3123,
421,
198,
318,
636,
2722,
721,
277,
304,
507,
198,
1107,
291,
855,
16695,
12398,
715,
9,
421,
198,
318,
636,
16695,
8,
277,
12,
5246,
12,
2061,
3493,
304,
507,
198,
692,
291,
423,
521,
365,
440,
488,
26,
686,
198,
83,
275,
2071,
83,
375,
5,
83,
4366,
83,
2862,
78,
2,
450,
334,
4694,
12,
291,
423,
1532,
12,
291,
423,
521,
9,
507,
198,
2836,
26,
686,
198,
83,
275,
2071,
83,
375,
5,
83,
60,
78,
2,
450,
334,
4694,
12,
291,
423,
1532,
9,
2742,
198,
73,
275,
378,
507,
198,
692,
2061,
3493,
26,
686,
198,
4694,
275,
5246,
4439,
17,
61,
435,
298,
298,
507,
198,
6710,
284,
665,
822,
8,
277,
423,
3223,
304,
686,
198,
692,
284,
1137,
822,
8,
277,
423,
3223,
9,
446,
413,
26,
1585,
198,
83,
847,
2071,
83,
2,
450,
291,
423,
3223,
59,
73,
17979,
16695,
8,
4694,
17992,
11674,
198,
2,
259,
1204,
401,
756,
9,
686,
198,
2836,
26,
1585,
198,
83,
847,
2071,
83,
2,
450,
291,
423,
3223,
59,
73,
17979,
16695,
8,
4694,
17992,
11674,
198,
2,
259,
1204,
401,
715,
9,
686,
198,
73,
847,
413,
507,
198,
1107,
308,
199,
199,
533,
23804,
29969,
8,
1726,
304,
199,
198,
624,
3917,
314,
2061,
1004,
365,
440,
4890,
2952,
402,
314,
5200,
2059,
474,
12,
21979,
781,
2934,
370,
3631,
314,
6661,
436,
3686,
642,
1004,
14,
199,
198,
624,
199,
198,
1529,
199,
199,
533,
6819,
29969,
8,
1726,
304,
199,
198,
624,
982,
314,
1004,
365,
282,
3721,
334,
305,
315,
314,
9608,
402,
314,
3307,
570,
395,
6722,
2951,
3686,
652,
14,
199,
198,
624,
199,
198,
1529,
421,
199,
318,
2198,
3049,
8,
604,
304,
199,
198,
604,
275,
1004,
14,
1913,
342,
199,
198,
692,
1004,
14,
2460,
10064,
2349,
507,
198,
3730,
6819,
29969,
199,
198,
77,
275,
295,
14,
1431,
480,
4735,
2677,
23778,
1103,
61,
435,
779,
16,
13,
25,
32455,
304,
334,
1103,
87,
8771,
665,
15426,
1103,
87,
11,
4186,
1004,
9,
199,
198,
692,
333,
365,
488,
26,
507,
198,
3730,
23804,
29969,
199,
198,
1107,
334,
77,
14,
923,
8,
17,
395,
333,
14,
923,
8,
18,
395,
333,
14,
923,
8,
19,
430,
421,
199,
318,
2446,
837,
199,
198,
2176,
3987,
14,
5441,
275,
23491,
480,
6405,
334,
14351,
1681,
4186,
488,
12,
488,
9,
199,
198,
2350,
275,
23491,
14,
5441,
421,
198,
509,
1004,
315,
984,
14,
6626,
26,
507,
198,
893,
26,
686,
198,
1250,
521,
12,
3213,
18387,
12,
8025,
275,
2198,
3049,
8,
604,
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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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
] |
OpenPymeMx/OCB
|
addons/account_followup/report/__init__.py
|
447
|
1108
|
# -*- 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 account_followup_print
import account_followup_report
# 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,
2933,
63,
25872,
63,
1361,
199,
646,
2933,
63,
25872,
63,
3070,
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,
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,
2933,
63,
25872,
63,
1361,
199,
646,
2933,
63,
25872,
63,
3070,
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,
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,
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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
] |
gtko/CouchPotatoServer
|
libs/suds/bindings/multiref.py
|
209
|
4181
|
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) 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 Library Lesser General Public License for more details at
# ( http://www.gnu.org/licenses/lgpl.html ).
#
# You should have received a copy of the GNU Lesser 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.
# written by: Jeff Ortel ( jortel@redhat.com )
"""
Provides classes for handling soap multirefs.
"""
from logging import getLogger
from suds import *
from suds.sax.element import Element
log = getLogger(__name__)
soapenc = (None, 'http://schemas.xmlsoap.org/soap/encoding/')
class MultiRef:
"""
Resolves and replaces multirefs.
@ivar nodes: A list of non-multiref nodes.
@type nodes: list
@ivar catalog: A dictionary of multiref nodes by id.
@type catalog: dict
"""
def __init__(self):
self.nodes = []
self.catalog = {}
def process(self, body):
"""
Process the specified soap envelope body and replace I{multiref} node
references with the contents of the referenced node.
@param body: A soap envelope body node.
@type body: L{Element}
@return: The processed I{body}
@rtype: L{Element}
"""
self.nodes = []
self.catalog = {}
self.build_catalog(body)
self.update(body)
body.children = self.nodes
return body
def update(self, node):
"""
Update the specified I{node} by replacing the I{multiref} references with
the contents of the referenced nodes and remove the I{href} attribute.
@param node: A node to update.
@type node: L{Element}
@return: The updated node
@rtype: L{Element}
"""
self.replace_references(node)
for c in node.children:
self.update(c)
return node
def replace_references(self, node):
"""
Replacing the I{multiref} references with the contents of the
referenced nodes and remove the I{href} attribute. Warning: since
the I{ref} is not cloned,
@param node: A node to update.
@type node: L{Element}
"""
href = node.getAttribute('href')
if href is None:
return
id = href.getValue()
ref = self.catalog.get(id)
if ref is None:
log.error('soap multiref: %s, not-resolved', id)
return
node.append(ref.children)
node.setText(ref.getText())
for a in ref.attributes:
if a.name != 'id':
node.append(a)
node.remove(href)
def build_catalog(self, body):
"""
Create the I{catalog} of multiref nodes by id and the list of
non-multiref nodes.
@param body: A soap envelope body node.
@type body: L{Element}
"""
for child in body.children:
if self.soaproot(child):
self.nodes.append(child)
id = child.get('id')
if id is None: continue
key = '#%s' % id
self.catalog[key] = child
def soaproot(self, node):
"""
Get whether the specified I{node} is a soap encoded root.
This is determined by examining @soapenc:root='1'.
The node is considered to be a root when the attribute
is not specified.
@param node: A node to evaluate.
@type node: L{Element}
@return: True if a soap encoded root.
@rtype: bool
"""
root = node.getAttribute('root', ns=soapenc)
if root is None:
return True
else:
return ( root.value == '1' )
|
gpl-3.0
|
[
3,
961,
2240,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
334,
44,
12006,
9,
1664,
6401,
1696,
1684,
844,
465,
199,
3,
3267,
701,
314,
2868,
2290,
2752,
27,
1902,
1015,
650,
402,
314,
221,
199,
3,
844,
12,
503,
334,
292,
2195,
945,
9,
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,
11243,
6401,
1696,
1684,
844,
367,
1655,
2436,
737,
199,
3,
334,
1455,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
15,
9783,
1168,
14,
1360,
7092,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
844,
199,
3,
3180,
543,
642,
2240,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
199,
3,
2752,
12,
3277,
2020,
8155,
15630,
10902,
446,
14453,
13540,
12,
8226,
12,
4828,
15673,
13,
13421,
12,
8217,
14,
199,
3,
5313,
701,
26,
1603,
3609,
4236,
14146,
334,
1335,
269,
14146,
32,
17164,
14,
957,
776,
199,
199,
624,
199,
17473,
3992,
367,
7252,
880,
439,
3510,
7655,
14,
199,
624,
199,
199,
504,
2050,
492,
28138,
199,
504,
30713,
492,
627,
199,
504,
30713,
14,
14338,
14,
2108,
492,
6566,
199,
199,
793,
275,
28138,
3460,
354,
3368,
199,
199,
21818,
10945,
275,
334,
403,
12,
283,
1014,
921,
9482,
14,
10198,
5770,
439,
14,
1308,
15,
21818,
15,
2991,
6217,
199,
199,
533,
6879,
2891,
26,
272,
408,
272,
3591,
393,
2310,
436,
19058,
3510,
7655,
14,
272,
768,
7725,
3380,
26,
437,
769,
402,
2222,
13,
3029,
1121,
3380,
14,
272,
768,
466,
3380,
26,
769,
272,
768,
7725,
10594,
26,
437,
2600,
402,
3510,
1121,
3380,
701,
1305,
14,
272,
768,
466,
10594,
26,
1211,
5591,
408,
2286,
347,
636,
826,
721,
277,
304,
267,
291,
14,
2415,
275,
942,
267,
291,
14,
7959,
275,
1052,
2286,
347,
2112,
8,
277,
12,
2396,
304,
267,
408,
267,
7132,
314,
2013,
880,
439,
24631,
2396,
436,
3350,
473,
91,
3029,
1121,
93,
1031,
267,
6941,
543,
314,
4072,
402,
314,
11812,
1031,
14,
267,
768,
635,
2396,
26,
437,
880,
439,
24631,
2396,
1031,
14,
267,
768,
466,
2396,
26,
491,
91,
2162,
93,
267,
768,
1107,
26,
710,
7686,
473,
91,
2030,
93,
267,
768,
4500,
26,
491,
91,
2162,
93,
267,
408,
267,
291,
14,
2415,
275,
942,
267,
291,
14,
7959,
275,
1052,
267,
291,
14,
1506,
63,
7959,
8,
2030,
9,
267,
291,
14,
873,
8,
2030,
9,
267,
2396,
14,
3223,
275,
291,
14,
2415,
267,
372,
2396,
2286,
347,
1678,
8,
277,
12,
1031,
304,
267,
408,
267,
6162,
314,
2013,
473,
91,
932,
93,
701,
15810,
314,
473,
91,
3029,
1121,
93,
6941,
543,
267,
314,
4072,
402,
314,
11812,
3380,
436,
2813,
314,
473,
91,
6399,
93,
2225,
14,
267,
768,
635,
1031,
26,
437,
1031,
370,
1678,
14,
267,
768,
466,
1031,
26,
491,
91,
2162,
93,
267,
768,
1107,
26,
710,
4588,
1031,
267,
768,
4500,
26,
491,
91,
2162,
93,
267,
408,
267,
291,
14,
1814,
63,
12635,
8,
932,
9,
267,
367,
286,
315,
1031,
14,
3223,
26,
288,
291,
14,
873,
8,
67,
9,
267,
372,
1031,
15567,
347,
3350,
63,
12635,
8,
277,
12,
1031,
304,
267,
408,
267,
16000,
13121,
314,
473,
91,
3029,
1121,
93,
6941,
543,
314,
4072,
402,
314,
4960,
11812,
3380,
436,
2813,
314,
473,
91,
6399,
93,
2225,
14,
221,
15902,
26,
221,
3967,
267,
314,
473,
91,
1121,
93,
365,
440,
26210,
12,
4960,
768,
635,
1031,
26,
437,
1031,
370,
1678,
14,
267,
768,
466,
1031,
26,
491,
91,
2162,
93,
267,
408,
267,
4369,
275,
1031,
14,
12956,
360,
6399,
358,
267,
340,
4369,
365,
488,
26,
288,
372,
267,
1305,
275,
4369,
14,
17186,
342,
267,
2984,
275,
291,
14,
7959,
14,
362,
8,
344,
9,
267,
340,
2984,
365,
488,
26,
288,
943,
14,
705,
360,
21818,
3510,
1121,
26,
450,
83,
12,
440,
13,
13697,
297,
1305,
9,
288,
372,
267,
1031,
14,
740,
8,
1121,
14,
3223,
9,
267,
1031,
14,
8341,
8,
1121,
14,
25506,
1012,
267,
367,
282,
315,
2984,
14,
2987,
26,
288,
340,
282,
14,
354,
1137,
283,
344,
356,
355,
1031,
14,
740,
8,
65,
9,
267,
1031,
14,
2168,
8,
6399,
9,
15567,
347,
1900,
63,
7959,
8,
277,
12,
2396,
304,
267,
408,
267,
2790,
314,
473,
91,
7959,
93,
402,
3510,
1121,
3380,
701,
1305,
436,
314,
769,
402,
267,
2222,
13,
3029,
1121,
3380,
14,
267,
768,
635,
2396,
26,
437,
880,
439,
24631,
2396,
1031,
14,
267,
768,
466,
2396,
26,
491,
91,
2162,
93,
267,
408,
267,
367,
1982,
315,
2396,
14,
3223,
26,
288,
340,
291,
14,
21818,
1231,
8,
1739,
304,
355,
291,
14,
2415,
14,
740,
8,
1739,
9,
288,
1305,
275,
1982,
14,
362,
360,
344,
358,
288,
340,
1305,
365,
488,
26,
1980,
288,
790,
275,
3943,
5,
83,
7,
450,
1305,
288,
291,
14,
7959,
59,
498,
61,
275,
1982,
339,
347,
880,
439,
1231,
8,
277,
12,
1031,
304,
267,
408,
267,
2372,
3775,
314,
2013,
473,
91,
932,
93,
365,
282,
880,
439,
5737,
1738,
14,
267,
961,
365,
12037,
701,
15735,
7969,
768,
21818,
10945,
26,
1231,
534,
17,
1370,
267,
710,
1031,
365,
8652,
370,
506,
282,
1738,
1380,
314,
2225,
267,
365,
440,
2013,
14,
267,
768,
635,
1031,
26,
437,
1031,
370,
9352,
14,
267,
768,
466,
1031,
26,
491,
91,
2162,
93,
267,
768,
1107,
26,
715,
340,
282,
880,
439,
5737,
1738,
14,
267,
768,
4500,
26,
2155,
267,
408,
267,
1738,
275,
1031,
14,
12956,
360,
1231,
297,
700,
29,
21818,
10945,
9,
267,
340,
1738,
365,
488,
26,
288,
372,
715,
267,
587,
26,
288,
372,
334,
1738,
14,
585,
508,
283,
17,
7,
776,
268,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
961,
2240,
365,
2867,
2032,
27,
1265,
883,
3604,
652,
436,
15,
269,
2811,
199,
3,
652,
1334,
314,
2895,
402,
314,
334,
44,
12006,
9,
1664,
6401,
1696,
1684,
844,
465,
199,
3,
3267,
701,
314,
2868,
2290,
2752,
27,
1902,
1015,
650,
402,
314,
221,
199,
3,
844,
12,
503,
334,
292,
2195,
945,
9,
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,
11243,
6401,
1696,
1684,
844,
367,
1655,
2436,
737,
199,
3,
334,
1455,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
15,
9783,
1168,
14,
1360,
7092,
199,
3,
199,
3,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
6401,
1696,
1684,
844,
199,
3,
3180,
543,
642,
2240,
27,
340,
440,
12,
2218,
370,
314,
2868,
2290,
199,
3,
2752,
12,
3277,
2020,
8155,
15630,
10902,
446,
14453,
13540,
12,
8226,
12,
4828,
15673,
13,
13421,
12,
8217,
14,
199,
3,
5313,
701,
26,
1603,
3609,
4236,
14146,
334,
1335,
269,
14146,
32,
17164,
14,
957,
776,
199,
199,
624,
199,
17473,
3992,
367,
7252,
880,
439,
3510,
7655,
14,
199,
624,
199,
199,
504,
2050,
492,
28138,
199,
504,
30713,
492,
627,
199,
504,
30713,
14,
14338,
14,
2108,
492,
6566,
199,
199,
793,
275,
28138,
3460,
354,
3368,
199,
199,
21818,
10945,
275,
334,
403,
12,
283,
1014,
921,
9482,
14,
10198,
5770,
439,
14,
1308,
15,
21818,
15,
2991,
6217,
199,
199,
533,
6879,
2891,
26,
272,
408,
272,
3591,
393,
2310,
436,
19058,
3510,
7655,
14,
272,
768,
7725,
3380,
26,
437,
769,
402,
2222,
13,
3029,
1121,
3380,
14,
272,
768,
466,
3380,
26,
769,
272,
768,
7725,
10594,
26,
437,
2600,
402,
3510,
1121,
3380,
701,
1305,
14,
272,
768,
466,
10594,
26,
1211,
5591,
408,
2286,
347,
636,
826,
721,
277,
304,
267,
291,
14,
2415,
275,
942,
267,
291,
14,
7959,
275,
1052,
2286,
347,
2112,
8,
277,
12,
2396,
304,
267,
408,
267,
7132,
314,
2013,
880,
439,
24631,
2396,
436,
3350,
473,
91,
3029,
1121,
93,
1031,
267,
6941,
543,
314,
4072,
402,
314,
11812,
1031,
14,
267,
768,
635,
2396,
26,
437,
880,
439,
24631,
2396,
1031,
14,
267,
768,
466,
2396,
26,
491,
91,
2162,
93,
267,
768,
1107,
26,
710,
7686,
473,
91,
2030,
93,
267,
768,
4500,
26,
491,
91,
2162,
93,
267,
408,
267,
291,
14,
2415,
275,
942,
267,
291,
14,
7959,
275,
1052,
267,
291,
14,
1506,
63,
7959,
8,
2030,
9,
267,
291,
14,
873,
8,
2030,
9,
267,
2396,
14,
3223,
275,
291,
14,
2415,
267,
372,
2396,
2286,
347,
1678,
8,
277,
12,
1031,
304,
267,
408,
267,
6162,
314,
2013,
473,
91,
932,
93,
701,
15810,
314,
473,
91,
3029,
1121,
93,
6941,
543,
267,
314,
4072,
402,
314,
11812,
3380,
436,
2813,
314,
473,
91,
6399,
93,
2225,
14,
267,
768,
635,
1031,
26,
437,
1031,
370,
1678,
14,
267,
768,
466,
1031,
26,
491,
91,
2162,
93,
267,
768,
1107,
26,
710,
4588,
1031,
267,
768,
4500,
26,
491,
91,
2162,
93,
267,
408,
267,
291,
14,
1814,
63,
12635,
8,
932,
9,
267,
367,
286,
315,
1031,
14,
3223,
26,
288,
291,
14,
873,
8,
67,
9,
267,
372,
1031,
15567,
347,
3350,
63,
12635,
8,
277,
12,
1031,
304,
267,
408,
267,
16000,
13121,
314,
473,
91,
3029,
1121,
93,
6941,
543,
314,
4072,
402,
314,
4960,
11812,
3380,
436,
2813,
314,
473,
91,
6399,
93,
2225,
14,
221,
15902,
26,
221,
3967,
267,
314,
473,
91,
1121,
93,
365,
440,
26210,
12,
4960,
768,
635,
1031,
26,
437,
1031,
370,
1678,
14,
267,
768,
466,
1031,
26,
491,
91,
2162,
93,
267,
408,
267,
4369,
275,
1031,
14,
12956,
360,
6399,
358,
267,
340,
4369,
365,
488,
26,
288,
372,
267,
1305,
275,
4369,
14,
17186,
342,
267,
2984,
275,
291,
14,
7959,
14,
362,
8,
344,
9,
267,
340,
2984,
365,
488,
26,
288,
943,
14,
705,
360,
21818,
3510,
1121,
26,
450,
83,
12,
440,
13,
13697,
297,
1305,
9,
288,
372,
267,
1031,
14,
740,
8,
1121,
14,
3223,
9,
267,
1031,
14,
8341,
8,
1121,
14,
25506,
1012,
267,
367,
282,
315,
2984,
14,
2987,
26,
288,
340,
282,
14,
354,
1137,
283,
344,
356,
355,
1031,
14,
740,
8,
65,
9,
267,
1031,
14,
2168,
8,
6399,
9,
15567,
347,
1900,
63,
7959,
8,
277,
12,
2396,
304,
267,
408,
267,
2790,
314,
473,
91,
7959,
93,
402,
3510,
1121,
3380,
701,
1305,
436,
314,
769,
402,
267,
2222,
13,
3029,
1121,
3380,
14,
267,
768,
635,
2396,
26,
437,
880,
439,
24631,
2396,
1031,
14,
267,
768,
466,
2396,
26,
491,
91,
2162,
93,
267,
408,
267,
367,
1982,
315,
2396,
14,
3223,
26,
288,
340,
291,
14,
21818,
1231,
8,
1739,
304,
355,
291,
14,
2415,
14,
740,
8,
1739,
9,
288,
1305,
275,
1982,
14,
362,
360,
344,
358,
288,
340,
1305,
365,
488,
26,
1980,
288,
790,
275,
3943,
5,
83,
7,
450,
1305,
288,
291,
14,
7959,
59,
498,
61,
275,
1982,
339,
347,
880,
439,
1231,
8,
277,
12,
1031,
304,
267,
408,
267,
2372,
3775,
314,
2013,
473,
91,
932,
93,
365,
282,
880,
439,
5737,
1738,
14,
267,
961,
365,
12037,
701,
15735,
7969,
768,
21818,
10945,
26,
1231,
534,
17,
1370,
267,
710,
1031,
365,
8652,
370,
506,
282,
1738,
1380,
314,
2225,
267,
365,
440,
2013,
14,
267,
768,
635,
1031,
26,
437,
1031,
370,
9352,
14,
267,
768,
466,
1031,
26,
491,
91,
2162,
93,
267,
768,
1107,
26,
715,
340,
282,
880,
439,
5737,
1738,
14,
267,
768,
4500,
26,
2155,
267,
408,
267,
1738,
275,
1031,
14,
12956,
360,
1231,
297,
700,
29,
21818,
10945,
9,
267,
340,
1738,
365,
488,
26,
288,
372,
715,
267,
587,
26,
288,
372,
334,
1738,
14,
585,
508,
283,
17,
7,
776,
268,
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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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
cherez/youtube-dl
|
youtube_dl/extractor/dropbox.py
|
236
|
1299
|
# coding: utf-8
from __future__ import unicode_literals
import os.path
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import url_basename
class DropboxIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?dropbox[.]com/sh?/(?P<id>[a-zA-Z0-9]{15})/.*'
_TESTS = [
{
'url': 'https://www.dropbox.com/s/nelirfsxnmcfbfh/youtube-dl%20test%20video%20%27%C3%A4%22BaW_jenozKc.mp4?dl=0',
'info_dict': {
'id': 'nelirfsxnmcfbfh',
'ext': 'mp4',
'title': 'youtube-dl test video \'ä"BaW_jenozKc'
}
}, {
'url': 'https://www.dropbox.com/sh/662glsejgzoj9sr/AAByil3FGH9KFNZ13e08eSa1a/Pregame%20Ceremony%20Program%20PA%2020140518.m4v',
'only_matching': True,
},
]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
fn = compat_urllib_parse_unquote(url_basename(url))
title = os.path.splitext(fn)[0]
video_url = re.sub(r'[?&]dl=0', '', url)
video_url += ('?' if '?' not in video_url else '&') + 'dl=1'
return {
'id': video_id,
'title': title,
'url': video_url,
}
|
unlicense
|
[
3,
2803,
26,
2774,
13,
24,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
747,
14,
515,
199,
646,
295,
199,
199,
504,
1275,
2330,
492,
21298,
199,
504,
2508,
5819,
492,
8434,
63,
4078,
63,
1122,
63,
12240,
199,
504,
2508,
1208,
492,
1166,
63,
4846,
421,
199,
533,
18110,
1977,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
2859,
24524,
1544,
20316,
32118,
59,
19784,
957,
15,
609,
31,
9448,
48,
28,
344,
9514,
65,
13,
6353,
13,
58,
16,
13,
25,
8194,
1046,
1552,
15,
25737,
272,
485,
7569,
275,
359,
267,
469,
288,
283,
633,
356,
283,
2859,
921,
1544,
14,
32118,
14,
957,
15,
83,
15,
685,
317,
82,
2319,
5032,
77,
2177,
4361,
72,
15,
9788,
13,
5030,
5,
1165,
396,
5,
1165,
3722,
5,
1165,
5,
1465,
5,
35,
19,
5,
33,
20,
5,
1081,
13864,
55,
63,
74,
287,
26051,
43,
67,
14,
311,
20,
31,
5030,
29,
16,
297,
288,
283,
815,
63,
807,
356,
469,
355,
283,
344,
356,
283,
685,
317,
82,
2319,
5032,
77,
2177,
4361,
72,
297,
355,
283,
832,
356,
283,
311,
20,
297,
355,
283,
1213,
356,
283,
9788,
13,
5030,
511,
3991,
8891,
13733,
2,
13864,
55,
63,
74,
287,
26051,
43,
67,
7,
288,
789,
267,
1660,
469,
288,
283,
633,
356,
283,
2859,
921,
1544,
14,
32118,
14,
957,
15,
609,
15,
19243,
3528,
261,
74,
6838,
79,
74,
25,
5474,
15,
33,
1217,
89,
382,
19,
27453,
40,
25,
43,
4963,
58,
969,
69,
2036,
69,
12226,
17,
65,
15,
48,
1135,
313,
5,
1165,
24417,
264,
2106,
89,
5,
1165,
9184,
5,
1165,
8470,
5,
4999,
10752,
1717,
1085,
14,
77,
20,
86,
297,
288,
283,
2118,
63,
9467,
356,
715,
12,
267,
1660,
272,
1622,
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,
267,
4325,
275,
8434,
63,
4078,
63,
1122,
63,
12240,
8,
633,
63,
4846,
8,
633,
430,
267,
2538,
275,
747,
14,
515,
14,
7973,
8,
2324,
2788,
16,
61,
267,
3991,
63,
633,
275,
295,
14,
954,
8,
82,
6167,
6,
61,
5030,
29,
16,
297,
3260,
1166,
9,
267,
3991,
63,
633,
847,
661,
14069,
340,
15539,
440,
315,
3991,
63,
633,
587,
7673,
358,
435,
283,
5030,
29,
17,
7,
398,
372,
469,
288,
283,
344,
356,
3991,
63,
344,
12,
288,
283,
1213,
356,
2538,
12,
288,
283,
633,
356,
3991,
63,
633,
12,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
747,
14,
515,
199,
646,
295,
199,
199,
504,
1275,
2330,
492,
21298,
199,
504,
2508,
5819,
492,
8434,
63,
4078,
63,
1122,
63,
12240,
199,
504,
2508,
1208,
492,
1166,
63,
4846,
421,
199,
533,
18110,
1977,
4332,
8,
18283,
304,
272,
485,
5600,
63,
2632,
275,
519,
7,
2859,
24524,
1544,
20316,
32118,
59,
19784,
957,
15,
609,
31,
9448,
48,
28,
344,
9514,
65,
13,
6353,
13,
58,
16,
13,
25,
8194,
1046,
1552,
15,
25737,
272,
485,
7569,
275,
359,
267,
469,
288,
283,
633,
356,
283,
2859,
921,
1544,
14,
32118,
14,
957,
15,
83,
15,
685,
317,
82,
2319,
5032,
77,
2177,
4361,
72,
15,
9788,
13,
5030,
5,
1165,
396,
5,
1165,
3722,
5,
1165,
5,
1465,
5,
35,
19,
5,
33,
20,
5,
1081,
13864,
55,
63,
74,
287,
26051,
43,
67,
14,
311,
20,
31,
5030,
29,
16,
297,
288,
283,
815,
63,
807,
356,
469,
355,
283,
344,
356,
283,
685,
317,
82,
2319,
5032,
77,
2177,
4361,
72,
297,
355,
283,
832,
356,
283,
311,
20,
297,
355,
283,
1213,
356,
283,
9788,
13,
5030,
511,
3991,
8891,
13733,
2,
13864,
55,
63,
74,
287,
26051,
43,
67,
7,
288,
789,
267,
1660,
469,
288,
283,
633,
356,
283,
2859,
921,
1544,
14,
32118,
14,
957,
15,
609,
15,
19243,
3528,
261,
74,
6838,
79,
74,
25,
5474,
15,
33,
1217,
89,
382,
19,
27453,
40,
25,
43,
4963,
58,
969,
69,
2036,
69,
12226,
17,
65,
15,
48,
1135,
313,
5,
1165,
24417,
264,
2106,
89,
5,
1165,
9184,
5,
1165,
8470,
5,
4999,
10752,
1717,
1085,
14,
77,
20,
86,
297,
288,
283,
2118,
63,
9467,
356,
715,
12,
267,
1660,
272,
1622,
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,
267,
4325,
275,
8434,
63,
4078,
63,
1122,
63,
12240,
8,
633,
63,
4846,
8,
633,
430,
267,
2538,
275,
747,
14,
515,
14,
7973,
8,
2324,
2788,
16,
61,
267,
3991,
63,
633,
275,
295,
14,
954,
8,
82,
6167,
6,
61,
5030,
29,
16,
297,
3260,
1166,
9,
267,
3991,
63,
633,
847,
661,
14069,
340,
15539,
440,
315,
3991,
63,
633,
587,
7673,
358,
435,
283,
5030,
29,
17,
7,
398,
372,
469,
288,
283,
344,
356,
3991,
63,
344,
12,
288,
283,
1213,
356,
2538,
12,
288,
283,
633,
356,
3991,
63,
633,
12,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
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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
] |
andyzsf/edx
|
lms/djangoapps/bulk_email/tests/test_course_optout.py
|
4
|
4827
|
# -*- coding: utf-8 -*-
"""
Unit tests for student optouts from course email
"""
import json
from mock import patch
from django.core import mail
from django.core.management import call_command
from django.core.urlresolvers import reverse
from django.conf import settings
from django.test.utils import override_settings
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
from student.tests.factories import UserFactory, AdminFactory, CourseEnrollmentFactory
from student.models import CourseEnrollment
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
@override_settings(MODULESTORE=TEST_DATA_MOCK_MODULESTORE)
class TestOptoutCourseEmails(ModuleStoreTestCase):
"""
Test that optouts are referenced in sending course email.
"""
def setUp(self):
course_title = u"ẗëṡẗ title イ乇丂イ ᄊ乇丂丂ムg乇 キo尺 ムレレ тэѕт мэѕѕаБэ"
self.course = CourseFactory.create(display_name=course_title)
self.instructor = AdminFactory.create()
self.student = UserFactory.create()
CourseEnrollmentFactory.create(user=self.student, course_id=self.course.id)
# load initial content (since we don't run migrations as part of tests):
call_command("loaddata", "course_email_template.json")
self.client.login(username=self.student.username, password="test")
self.send_mail_url = reverse('send_email', kwargs={'course_id': self.course.id.to_deprecated_string()})
self.success_content = {
'course_id': self.course.id.to_deprecated_string(),
'success': True,
}
def tearDown(self):
"""
Undo all patches.
"""
patch.stopall()
def navigate_to_email_view(self):
"""Navigate to the instructor dash's email view"""
# Pull up email view on instructor dashboard
url = reverse('instructor_dashboard', kwargs={'course_id': self.course.id.to_deprecated_string()})
response = self.client.get(url)
email_section = '<div class="vert-left send-email" id="section-send-email">'
# If this fails, it is likely because ENABLE_INSTRUCTOR_EMAIL is set to False
self.assertTrue(email_section in response.content)
@patch.dict(settings.FEATURES, {'ENABLE_INSTRUCTOR_EMAIL': True, 'REQUIRE_COURSE_EMAIL_AUTH': False})
def test_optout_course(self):
"""
Make sure student does not receive course email after opting out.
"""
url = reverse('change_email_settings')
# This is a checkbox, so on the post of opting out (that is, an Un-check of the box),
# the Post that is sent will not contain 'receive_emails'
response = self.client.post(url, {'course_id': self.course.id.to_deprecated_string()})
self.assertEquals(json.loads(response.content), {'success': True})
self.client.logout()
self.client.login(username=self.instructor.username, password="test")
self.navigate_to_email_view()
test_email = {
'action': 'Send email',
'send_to': 'all',
'subject': 'test subject for all',
'message': 'test message for all'
}
response = self.client.post(self.send_mail_url, test_email)
self.assertEquals(json.loads(response.content), self.success_content)
# Assert that self.student.email not in mail.to, outbox should be empty
self.assertEqual(len(mail.outbox), 0)
@patch.dict(settings.FEATURES, {'ENABLE_INSTRUCTOR_EMAIL': True, 'REQUIRE_COURSE_EMAIL_AUTH': False})
def test_optin_course(self):
"""
Make sure student receives course email after opting in.
"""
url = reverse('change_email_settings')
response = self.client.post(url, {'course_id': self.course.id.to_deprecated_string(), 'receive_emails': 'on'})
self.assertEquals(json.loads(response.content), {'success': True})
self.client.logout()
self.assertTrue(CourseEnrollment.is_enrolled(self.student, self.course.id))
self.client.login(username=self.instructor.username, password="test")
self.navigate_to_email_view()
test_email = {
'action': 'Send email',
'send_to': 'all',
'subject': 'test subject for all',
'message': 'test message for all'
}
response = self.client.post(self.send_mail_url, test_email)
self.assertEquals(json.loads(response.content), self.success_content)
# Assert that self.student.email in mail.to
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(len(mail.outbox[0].to), 1)
self.assertEquals(mail.outbox[0].to[0], self.student.email)
|
agpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
624,
199,
5072,
2295,
367,
6474,
1687,
475,
14608,
687,
2518,
3031,
199,
624,
199,
646,
2022,
199,
504,
1683,
492,
3371,
199,
199,
504,
1639,
14,
1018,
492,
6016,
199,
504,
1639,
14,
1018,
14,
8110,
492,
1240,
63,
1531,
199,
504,
1639,
14,
1018,
14,
16522,
492,
3837,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
396,
14,
1208,
492,
4278,
63,
1751,
199,
199,
504,
9872,
14,
10012,
14,
2219,
14,
1176,
63,
1208,
492,
7393,
63,
3998,
63,
17749,
63,
27011,
199,
504,
6474,
14,
2219,
14,
15406,
492,
16047,
12,
9516,
2927,
12,
18946,
2927,
199,
504,
6474,
14,
992,
492,
18946,
199,
504,
9872,
14,
10012,
14,
2219,
14,
1176,
63,
1208,
492,
17996,
1746,
199,
504,
9872,
14,
10012,
14,
2219,
14,
15406,
492,
17862,
421,
199,
32,
4415,
63,
1751,
8,
27011,
29,
2864,
63,
3998,
63,
17749,
63,
27011,
9,
199,
533,
1379,
4619,
475,
337,
6979,
7035,
83,
8,
27863,
304,
339,
408,
272,
1379,
626,
1687,
475,
14608,
787,
11812,
315,
10209,
2518,
3031,
14,
272,
408,
339,
347,
3613,
8,
277,
304,
267,
2518,
63,
1213,
275,
399,
2,
158,
119,
246,
128,
105,
158,
118,
95,
158,
119,
246,
2538,
221,
172,
122,
111,
17837,
230,
4344,
225,
172,
122,
111,
221,
172,
123,
115,
17837,
230,
4344,
225,
4344,
225,
172,
123,
240,
71,
17837,
230,
221,
172,
122,
116,
79,
15348,
119,
221,
172,
123,
240,
172,
123,
249,
172,
123,
249,
221,
7413,
142,
236,
142,
244,
7413,
7038,
121,
142,
236,
142,
244,
142,
244,
13111,
240,
142,
236,
2,
267,
291,
14,
1972,
275,
17862,
14,
981,
8,
2918,
63,
354,
29,
1972,
63,
1213,
9,
267,
291,
14,
14891,
275,
9516,
2927,
14,
981,
342,
267,
291,
14,
5500,
275,
16047,
14,
981,
342,
267,
18946,
2927,
14,
981,
8,
751,
29,
277,
14,
5500,
12,
2518,
63,
344,
29,
277,
14,
1972,
14,
344,
9,
398,
327,
2248,
2536,
1564,
334,
8585,
781,
2793,
1133,
1255,
6180,
465,
1777,
402,
2295,
304,
267,
1240,
63,
1531,
480,
320,
525,
419,
401,
298,
1972,
63,
2123,
63,
1160,
14,
1001,
531,
398,
291,
14,
1258,
14,
2886,
8,
2473,
29,
277,
14,
5500,
14,
2473,
12,
2505,
628,
396,
531,
398,
291,
14,
2254,
63,
1198,
63,
633,
275,
3837,
360,
2254,
63,
2123,
297,
2074,
3713,
1972,
63,
344,
356,
291,
14,
1972,
14,
344,
14,
475,
63,
6667,
63,
875,
22804,
267,
291,
14,
3742,
63,
1317,
275,
469,
288,
283,
1972,
63,
344,
356,
291,
14,
1972,
14,
344,
14,
475,
63,
6667,
63,
875,
1062,
288,
283,
3742,
356,
715,
12,
267,
789,
339,
347,
6766,
8,
277,
304,
267,
408,
267,
738,
21175,
1006,
12385,
14,
267,
408,
267,
3371,
14,
2379,
452,
342,
339,
347,
20850,
63,
475,
63,
2123,
63,
1345,
8,
277,
304,
267,
408,
31914,
370,
314,
17724,
11847,
1159,
3031,
2455,
624,
267,
327,
27705,
1536,
3031,
2455,
641,
17724,
17216,
267,
1166,
275,
3837,
360,
14891,
63,
9743,
297,
2074,
3713,
1972,
63,
344,
356,
291,
14,
1972,
14,
344,
14,
475,
63,
6667,
63,
875,
22804,
267,
1177,
275,
291,
14,
1258,
14,
362,
8,
633,
9,
267,
3031,
63,
2792,
275,
2650,
3015,
1021,
628,
1884,
13,
3039,
3222,
13,
2123,
2,
1305,
628,
2792,
13,
2254,
13,
2123,
15603,
267,
327,
982,
642,
6918,
12,
652,
365,
12060,
2952,
27926,
63,
568,
8893,
726,
63,
10089,
365,
663,
370,
756,
267,
291,
14,
1815,
8,
2123,
63,
2792,
315,
1177,
14,
1317,
9,
339,
768,
2068,
14,
807,
8,
1751,
14,
13313,
12,
791,
8898,
63,
568,
8893,
726,
63,
10089,
356,
715,
12,
283,
29168,
63,
15552,
63,
10089,
63,
5580,
356,
756,
1552,
272,
347,
511,
63,
411,
475,
337,
63,
1972,
8,
277,
304,
267,
408,
267,
4155,
3238,
6474,
1630,
440,
9128,
2518,
3031,
2410,
2450,
316,
734,
14,
267,
408,
267,
1166,
275,
3837,
360,
1461,
63,
2123,
63,
1751,
358,
267,
327,
961,
365,
282,
24190,
12,
880,
641,
314,
2963,
402,
2450,
316,
734,
334,
9099,
365,
12,
376,
1910,
13,
1074,
402,
314,
5689,
395,
267,
327,
314,
7711,
626,
365,
4847,
911,
440,
1395,
283,
9391,
63,
14170,
7,
267,
1177,
275,
291,
14,
1258,
14,
1932,
8,
633,
12,
791,
1972,
63,
344,
356,
291,
14,
1972,
14,
344,
14,
475,
63,
6667,
63,
875,
22804,
267,
291,
14,
2947,
8,
1001,
14,
3640,
8,
1310,
14,
1317,
395,
791,
3742,
356,
715,
1552,
398,
291,
14,
1258,
14,
11646,
342,
398,
291,
14,
1258,
14,
2886,
8,
2473,
29,
277,
14,
14891,
14,
2473,
12,
2505,
628,
396,
531,
267,
291,
14,
15595,
3237,
63,
475,
63,
2123,
63,
1345,
342,
398,
511,
63,
2123,
275,
469,
288,
283,
1287,
356,
283,
6795,
3031,
297,
288,
283,
2254,
63,
475,
356,
283,
452,
297,
288,
283,
5875,
356,
283,
396,
5420,
367,
1006,
297,
288,
283,
1188,
356,
283,
396,
1245,
367,
1006,
7,
267,
789,
267,
1177,
275,
291,
14,
1258,
14,
1932,
8,
277,
14,
2254,
63,
1198,
63,
633,
12,
511,
63,
2123,
9,
267,
291,
14,
2947,
8,
1001,
14,
3640,
8,
1310,
14,
1317,
395,
291,
14,
3742,
63,
1317,
9,
398,
327,
10716,
626,
291,
14,
5500,
14,
2123,
440,
315,
6016,
14,
475,
12,
734,
1977,
1077,
506,
2701,
267,
291,
14,
629,
8,
552,
8,
1198,
14,
17244,
395,
378,
9,
339,
768,
2068,
14,
807,
8,
1751,
14,
13313,
12,
791,
8898,
63,
568,
8893,
726,
63,
10089,
356,
715,
12,
283,
29168,
63,
15552,
63,
10089,
63,
5580,
356,
756,
1552,
272,
347,
511,
63,
411,
1346,
63,
1972,
8,
277,
304,
267,
408,
267,
4155,
3238,
6474,
23192,
2518,
3031,
2410,
2450,
316,
315,
14,
267,
408,
267,
1166,
275,
3837,
360,
1461,
63,
2123,
63,
1751,
358,
267,
1177,
275,
291,
14,
1258,
14,
1932,
8,
633,
12,
791,
1972,
63,
344,
356,
291,
14,
1972,
14,
344,
14,
475,
63,
6667,
63,
875,
1062,
283
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
624,
199,
5072,
2295,
367,
6474,
1687,
475,
14608,
687,
2518,
3031,
199,
624,
199,
646,
2022,
199,
504,
1683,
492,
3371,
199,
199,
504,
1639,
14,
1018,
492,
6016,
199,
504,
1639,
14,
1018,
14,
8110,
492,
1240,
63,
1531,
199,
504,
1639,
14,
1018,
14,
16522,
492,
3837,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
396,
14,
1208,
492,
4278,
63,
1751,
199,
199,
504,
9872,
14,
10012,
14,
2219,
14,
1176,
63,
1208,
492,
7393,
63,
3998,
63,
17749,
63,
27011,
199,
504,
6474,
14,
2219,
14,
15406,
492,
16047,
12,
9516,
2927,
12,
18946,
2927,
199,
504,
6474,
14,
992,
492,
18946,
199,
504,
9872,
14,
10012,
14,
2219,
14,
1176,
63,
1208,
492,
17996,
1746,
199,
504,
9872,
14,
10012,
14,
2219,
14,
15406,
492,
17862,
421,
199,
32,
4415,
63,
1751,
8,
27011,
29,
2864,
63,
3998,
63,
17749,
63,
27011,
9,
199,
533,
1379,
4619,
475,
337,
6979,
7035,
83,
8,
27863,
304,
339,
408,
272,
1379,
626,
1687,
475,
14608,
787,
11812,
315,
10209,
2518,
3031,
14,
272,
408,
339,
347,
3613,
8,
277,
304,
267,
2518,
63,
1213,
275,
399,
2,
158,
119,
246,
128,
105,
158,
118,
95,
158,
119,
246,
2538,
221,
172,
122,
111,
17837,
230,
4344,
225,
172,
122,
111,
221,
172,
123,
115,
17837,
230,
4344,
225,
4344,
225,
172,
123,
240,
71,
17837,
230,
221,
172,
122,
116,
79,
15348,
119,
221,
172,
123,
240,
172,
123,
249,
172,
123,
249,
221,
7413,
142,
236,
142,
244,
7413,
7038,
121,
142,
236,
142,
244,
142,
244,
13111,
240,
142,
236,
2,
267,
291,
14,
1972,
275,
17862,
14,
981,
8,
2918,
63,
354,
29,
1972,
63,
1213,
9,
267,
291,
14,
14891,
275,
9516,
2927,
14,
981,
342,
267,
291,
14,
5500,
275,
16047,
14,
981,
342,
267,
18946,
2927,
14,
981,
8,
751,
29,
277,
14,
5500,
12,
2518,
63,
344,
29,
277,
14,
1972,
14,
344,
9,
398,
327,
2248,
2536,
1564,
334,
8585,
781,
2793,
1133,
1255,
6180,
465,
1777,
402,
2295,
304,
267,
1240,
63,
1531,
480,
320,
525,
419,
401,
298,
1972,
63,
2123,
63,
1160,
14,
1001,
531,
398,
291,
14,
1258,
14,
2886,
8,
2473,
29,
277,
14,
5500,
14,
2473,
12,
2505,
628,
396,
531,
398,
291,
14,
2254,
63,
1198,
63,
633,
275,
3837,
360,
2254,
63,
2123,
297,
2074,
3713,
1972,
63,
344,
356,
291,
14,
1972,
14,
344,
14,
475,
63,
6667,
63,
875,
22804,
267,
291,
14,
3742,
63,
1317,
275,
469,
288,
283,
1972,
63,
344,
356,
291,
14,
1972,
14,
344,
14,
475,
63,
6667,
63,
875,
1062,
288,
283,
3742,
356,
715,
12,
267,
789,
339,
347,
6766,
8,
277,
304,
267,
408,
267,
738,
21175,
1006,
12385,
14,
267,
408,
267,
3371,
14,
2379,
452,
342,
339,
347,
20850,
63,
475,
63,
2123,
63,
1345,
8,
277,
304,
267,
408,
31914,
370,
314,
17724,
11847,
1159,
3031,
2455,
624,
267,
327,
27705,
1536,
3031,
2455,
641,
17724,
17216,
267,
1166,
275,
3837,
360,
14891,
63,
9743,
297,
2074,
3713,
1972,
63,
344,
356,
291,
14,
1972,
14,
344,
14,
475,
63,
6667,
63,
875,
22804,
267,
1177,
275,
291,
14,
1258,
14,
362,
8,
633,
9,
267,
3031,
63,
2792,
275,
2650,
3015,
1021,
628,
1884,
13,
3039,
3222,
13,
2123,
2,
1305,
628,
2792,
13,
2254,
13,
2123,
15603,
267,
327,
982,
642,
6918,
12,
652,
365,
12060,
2952,
27926,
63,
568,
8893,
726,
63,
10089,
365,
663,
370,
756,
267,
291,
14,
1815,
8,
2123,
63,
2792,
315,
1177,
14,
1317,
9,
339,
768,
2068,
14,
807,
8,
1751,
14,
13313,
12,
791,
8898,
63,
568,
8893,
726,
63,
10089,
356,
715,
12,
283,
29168,
63,
15552,
63,
10089,
63,
5580,
356,
756,
1552,
272,
347,
511,
63,
411,
475,
337,
63,
1972,
8,
277,
304,
267,
408,
267,
4155,
3238,
6474,
1630,
440,
9128,
2518,
3031,
2410,
2450,
316,
734,
14,
267,
408,
267,
1166,
275,
3837,
360,
1461,
63,
2123,
63,
1751,
358,
267,
327,
961,
365,
282,
24190,
12,
880,
641,
314,
2963,
402,
2450,
316,
734,
334,
9099,
365,
12,
376,
1910,
13,
1074,
402,
314,
5689,
395,
267,
327,
314,
7711,
626,
365,
4847,
911,
440,
1395,
283,
9391,
63,
14170,
7,
267,
1177,
275,
291,
14,
1258,
14,
1932,
8,
633,
12,
791,
1972,
63,
344,
356,
291,
14,
1972,
14,
344,
14,
475,
63,
6667,
63,
875,
22804,
267,
291,
14,
2947,
8,
1001,
14,
3640,
8,
1310,
14,
1317,
395,
791,
3742,
356,
715,
1552,
398,
291,
14,
1258,
14,
11646,
342,
398,
291,
14,
1258,
14,
2886,
8,
2473,
29,
277,
14,
14891,
14,
2473,
12,
2505,
628,
396,
531,
267,
291,
14,
15595,
3237,
63,
475,
63,
2123,
63,
1345,
342,
398,
511,
63,
2123,
275,
469,
288,
283,
1287,
356,
283,
6795,
3031,
297,
288,
283,
2254,
63,
475,
356,
283,
452,
297,
288,
283,
5875,
356,
283,
396,
5420,
367,
1006,
297,
288,
283,
1188,
356,
283,
396,
1245,
367,
1006,
7,
267,
789,
267,
1177,
275,
291,
14,
1258,
14,
1932,
8,
277,
14,
2254,
63,
1198,
63,
633,
12,
511,
63,
2123,
9,
267,
291,
14,
2947,
8,
1001,
14,
3640,
8,
1310,
14,
1317,
395,
291,
14,
3742,
63,
1317,
9,
398,
327,
10716,
626,
291,
14,
5500,
14,
2123,
440,
315,
6016,
14,
475,
12,
734,
1977,
1077,
506,
2701,
267,
291,
14,
629,
8,
552,
8,
1198,
14,
17244,
395,
378,
9,
339,
768,
2068,
14,
807,
8,
1751,
14,
13313,
12,
791,
8898,
63,
568,
8893,
726,
63,
10089,
356,
715,
12,
283,
29168,
63,
15552,
63,
10089,
63,
5580,
356,
756,
1552,
272,
347,
511,
63,
411,
1346,
63,
1972,
8,
277,
304,
267,
408,
267,
4155,
3238,
6474,
23192,
2518,
3031,
2410,
2450,
316,
315,
14,
267,
408,
267,
1166,
275,
3837,
360,
1461,
63,
2123,
63,
1751,
358,
267,
1177,
275,
291,
14,
1258,
14,
1932,
8,
633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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
] |
navycrow/Sick-Beard
|
lib/configobj.py
|
145
|
86447
|
# configobj.py
# A config file reader/writer that supports nested sections in config files.
# Copyright (C) 2005-2009 Michael Foord, Nicola Larosa
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# nico AT tekNico DOT net
# ConfigObj 4
# http://www.voidspace.org.uk/python/configobj.html
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts maintained at http://www.voidspace.org.uk/python/index.shtml
# For information about bugfixes, updates and support, please join the
# ConfigObj mailing list:
# http://lists.sourceforge.net/lists/listinfo/configobj-develop
# Comments, suggestions and bug reports welcome.
from __future__ import generators
import sys
import os
import re
compiler = None
try:
import compiler
except ImportError:
# for IronPython
pass
try:
from codecs import BOM_UTF8, BOM_UTF16, BOM_UTF16_BE, BOM_UTF16_LE
except ImportError:
# Python 2.2 does not have these
# UTF-8
BOM_UTF8 = '\xef\xbb\xbf'
# UTF-16, little endian
BOM_UTF16_LE = '\xff\xfe'
# UTF-16, big endian
BOM_UTF16_BE = '\xfe\xff'
if sys.byteorder == 'little':
# UTF-16, native endianness
BOM_UTF16 = BOM_UTF16_LE
else:
# UTF-16, native endianness
BOM_UTF16 = BOM_UTF16_BE
# A dictionary mapping BOM to
# the encoding to decode with, and what to set the
# encoding attribute to.
BOMS = {
BOM_UTF8: ('utf_8', None),
BOM_UTF16_BE: ('utf16_be', 'utf_16'),
BOM_UTF16_LE: ('utf16_le', 'utf_16'),
BOM_UTF16: ('utf_16', 'utf_16'),
}
# All legal variants of the BOM codecs.
# TODO: the list of aliases is not meant to be exhaustive, is there a
# better way ?
BOM_LIST = {
'utf_16': 'utf_16',
'u16': 'utf_16',
'utf16': 'utf_16',
'utf-16': 'utf_16',
'utf16_be': 'utf16_be',
'utf_16_be': 'utf16_be',
'utf-16be': 'utf16_be',
'utf16_le': 'utf16_le',
'utf_16_le': 'utf16_le',
'utf-16le': 'utf16_le',
'utf_8': 'utf_8',
'u8': 'utf_8',
'utf': 'utf_8',
'utf8': 'utf_8',
'utf-8': 'utf_8',
}
# Map of encodings to the BOM to write.
BOM_SET = {
'utf_8': BOM_UTF8,
'utf_16': BOM_UTF16,
'utf16_be': BOM_UTF16_BE,
'utf16_le': BOM_UTF16_LE,
None: BOM_UTF8
}
def match_utf8(encoding):
return BOM_LIST.get(encoding.lower()) == 'utf_8'
# Quote strings used for writing values
squot = "'%s'"
dquot = '"%s"'
noquot = "%s"
wspace_plus = ' \r\n\v\t\'"'
tsquot = '"""%s"""'
tdquot = "'''%s'''"
try:
enumerate
except NameError:
def enumerate(obj):
"""enumerate for Python 2.2."""
i = -1
for item in obj:
i += 1
yield i, item
# Sentinel for use in getattr calls to replace hasattr
MISSING = object()
__version__ = '4.6.0'
__revision__ = '$Id: configobj.py 156 2006-01-31 14:57:08Z fuzzyman $'
__docformat__ = "restructuredtext en"
__all__ = (
'__version__',
'DEFAULT_INDENT_TYPE',
'DEFAULT_INTERPOLATION',
'ConfigObjError',
'NestingError',
'ParseError',
'DuplicateError',
'ConfigspecError',
'ConfigObj',
'SimpleVal',
'InterpolationError',
'InterpolationLoopError',
'MissingInterpolationOption',
'RepeatSectionError',
'ReloadError',
'UnreprError',
'UnknownType',
'__docformat__',
'flatten_errors',
)
DEFAULT_INTERPOLATION = 'configparser'
DEFAULT_INDENT_TYPE = ' '
MAX_INTERPOL_DEPTH = 10
OPTION_DEFAULTS = {
'interpolation': True,
'raise_errors': False,
'list_values': True,
'create_empty': False,
'file_error': False,
'configspec': None,
'stringify': True,
# option may be set to one of ('', ' ', '\t')
'indent_type': None,
'encoding': None,
'default_encoding': None,
'unrepr': False,
'write_empty_values': False,
}
def getObj(s):
s = "a=" + s
if compiler is None:
raise ImportError('compiler module not available')
p = compiler.parse(s)
return p.getChildren()[1].getChildren()[0].getChildren()[1]
class UnknownType(Exception):
pass
class Builder(object):
def build(self, o):
m = getattr(self, 'build_' + o.__class__.__name__, None)
if m is None:
raise UnknownType(o.__class__.__name__)
return m(o)
def build_List(self, o):
return map(self.build, o.getChildren())
def build_Const(self, o):
return o.value
def build_Dict(self, o):
d = {}
i = iter(map(self.build, o.getChildren()))
for el in i:
d[el] = i.next()
return d
def build_Tuple(self, o):
return tuple(self.build_List(o))
def build_Name(self, o):
if o.name == 'None':
return None
if o.name == 'True':
return True
if o.name == 'False':
return False
# An undefined Name
raise UnknownType('Undefined Name')
def build_Add(self, o):
real, imag = map(self.build_Const, o.getChildren())
try:
real = float(real)
except TypeError:
raise UnknownType('Add')
if not isinstance(imag, complex) or imag.real != 0.0:
raise UnknownType('Add')
return real + imag
def build_Getattr(self, o):
parent = self.build(o.expr)
return getattr(parent, o.attrname)
def build_UnarySub(self, o):
return - self.build_Const(o.getChildren()[0])
def build_UnaryAdd(self, o):
return self.build_Const(o.getChildren()[0])
_builder = Builder()
def unrepr(s):
if not s:
return s
return _builder.build(getObj(s))
class ConfigObjError(SyntaxError):
"""
This is the base class for all errors that ConfigObj raises.
It is a subclass of SyntaxError.
"""
def __init__(self, message='', line_number=None, line=''):
self.line = line
self.line_number = line_number
SyntaxError.__init__(self, message)
class NestingError(ConfigObjError):
"""
This error indicates a level of nesting that doesn't match.
"""
class ParseError(ConfigObjError):
"""
This error indicates that a line is badly written.
It is neither a valid ``key = value`` line,
nor a valid section marker line.
"""
class ReloadError(IOError):
"""
A 'reload' operation failed.
This exception is a subclass of ``IOError``.
"""
def __init__(self):
IOError.__init__(self, 'reload failed, filename is not set.')
class DuplicateError(ConfigObjError):
"""
The keyword or section specified already exists.
"""
class ConfigspecError(ConfigObjError):
"""
An error occured whilst parsing a configspec.
"""
class InterpolationError(ConfigObjError):
"""Base class for the two interpolation errors."""
class InterpolationLoopError(InterpolationError):
"""Maximum interpolation depth exceeded in string interpolation."""
def __init__(self, option):
InterpolationError.__init__(
self,
'interpolation loop detected in value "%s".' % option)
class RepeatSectionError(ConfigObjError):
"""
This error indicates additional sections in a section with a
``__many__`` (repeated) section.
"""
class MissingInterpolationOption(InterpolationError):
"""A value specified for interpolation was missing."""
def __init__(self, option):
InterpolationError.__init__(
self,
'missing option "%s" in interpolation.' % option)
class UnreprError(ConfigObjError):
"""An error parsing in unrepr mode."""
class InterpolationEngine(object):
"""
A helper class to help perform string interpolation.
This class is an abstract base class; its descendants perform
the actual work.
"""
# compiled regexp to use in self.interpolate()
_KEYCRE = re.compile(r"%\(([^)]*)\)s")
def __init__(self, section):
# the Section instance that "owns" this engine
self.section = section
def interpolate(self, key, value):
def recursive_interpolate(key, value, section, backtrail):
"""The function that does the actual work.
``value``: the string we're trying to interpolate.
``section``: the section in which that string was found
``backtrail``: a dict to keep track of where we've been,
to detect and prevent infinite recursion loops
This is similar to a depth-first-search algorithm.
"""
# Have we been here already?
if backtrail.has_key((key, section.name)):
# Yes - infinite loop detected
raise InterpolationLoopError(key)
# Place a marker on our backtrail so we won't come back here again
backtrail[(key, section.name)] = 1
# Now start the actual work
match = self._KEYCRE.search(value)
while match:
# The actual parsing of the match is implementation-dependent,
# so delegate to our helper function
k, v, s = self._parse_match(match)
if k is None:
# That's the signal that no further interpolation is needed
replacement = v
else:
# Further interpolation may be needed to obtain final value
replacement = recursive_interpolate(k, v, s, backtrail)
# Replace the matched string with its final value
start, end = match.span()
value = ''.join((value[:start], replacement, value[end:]))
new_search_start = start + len(replacement)
# Pick up the next interpolation key, if any, for next time
# through the while loop
match = self._KEYCRE.search(value, new_search_start)
# Now safe to come back here again; remove marker from backtrail
del backtrail[(key, section.name)]
return value
# Back in interpolate(), all we have to do is kick off the recursive
# function with appropriate starting values
value = recursive_interpolate(key, value, self.section, {})
return value
def _fetch(self, key):
"""Helper function to fetch values from owning section.
Returns a 2-tuple: the value, and the section where it was found.
"""
# switch off interpolation before we try and fetch anything !
save_interp = self.section.main.interpolation
self.section.main.interpolation = False
# Start at section that "owns" this InterpolationEngine
current_section = self.section
while True:
# try the current section first
val = current_section.get(key)
if val is not None:
break
# try "DEFAULT" next
val = current_section.get('DEFAULT', {}).get(key)
if val is not None:
break
# move up to parent and try again
# top-level's parent is itself
if current_section.parent is current_section:
# reached top level, time to give up
break
current_section = current_section.parent
# restore interpolation to previous value before returning
self.section.main.interpolation = save_interp
if val is None:
raise MissingInterpolationOption(key)
return val, current_section
def _parse_match(self, match):
"""Implementation-dependent helper function.
Will be passed a match object corresponding to the interpolation
key we just found (e.g., "%(foo)s" or "$foo"). Should look up that
key in the appropriate config file section (using the ``_fetch()``
helper function) and return a 3-tuple: (key, value, section)
``key`` is the name of the key we're looking for
``value`` is the value found for that key
``section`` is a reference to the section where it was found
``key`` and ``section`` should be None if no further
interpolation should be performed on the resulting value
(e.g., if we interpolated "$$" and returned "$").
"""
raise NotImplementedError()
class ConfigParserInterpolation(InterpolationEngine):
"""Behaves like ConfigParser."""
_KEYCRE = re.compile(r"%\(([^)]*)\)s")
def _parse_match(self, match):
key = match.group(1)
value, section = self._fetch(key)
return key, value, section
class TemplateInterpolation(InterpolationEngine):
"""Behaves like string.Template."""
_delimiter = '$'
_KEYCRE = re.compile(r"""
\$(?:
(?P<escaped>\$) | # Two $ signs
(?P<named>[_a-z][_a-z0-9]*) | # $name format
{(?P<braced>[^}]*)} # ${name} format
)
""", re.IGNORECASE | re.VERBOSE)
def _parse_match(self, match):
# Valid name (in or out of braces): fetch value from section
key = match.group('named') or match.group('braced')
if key is not None:
value, section = self._fetch(key)
return key, value, section
# Escaped delimiter (e.g., $$): return single delimiter
if match.group('escaped') is not None:
# Return None for key and section to indicate it's time to stop
return None, self._delimiter, None
# Anything else: ignore completely, just return it unchanged
return None, match.group(), None
interpolation_engines = {
'configparser': ConfigParserInterpolation,
'template': TemplateInterpolation,
}
def __newobj__(cls, *args):
# Hack for pickle
return cls.__new__(cls, *args)
class Section(dict):
"""
A dictionary-like object that represents a section in a config file.
It does string interpolation if the 'interpolation' attribute
of the 'main' object is set to True.
Interpolation is tried first from this object, then from the 'DEFAULT'
section of this object, next from the parent and its 'DEFAULT' section,
and so on until the main object is reached.
A Section will behave like an ordered dictionary - following the
order of the ``scalars`` and ``sections`` attributes.
You can use this to change the order of members.
Iteration follows the order: scalars, then sections.
"""
def __setstate__(self, state):
dict.update(self, state[0])
self.__dict__.update(state[1])
def __reduce__(self):
state = (dict(self), self.__dict__)
return (__newobj__, (self.__class__,), state)
def __init__(self, parent, depth, main, indict=None, name=None):
"""
* parent is the section above
* depth is the depth level of this section
* main is the main ConfigObj
* indict is a dictionary to initialise the section with
"""
if indict is None:
indict = {}
dict.__init__(self)
# used for nesting level *and* interpolation
self.parent = parent
# used for the interpolation attribute
self.main = main
# level of nesting depth of this Section
self.depth = depth
# purely for information
self.name = name
#
self._initialise()
# we do this explicitly so that __setitem__ is used properly
# (rather than just passing to ``dict.__init__``)
for entry, value in indict.iteritems():
self[entry] = value
def _initialise(self):
# the sequence of scalar values in this Section
self.scalars = []
# the sequence of sections in this Section
self.sections = []
# for comments :-)
self.comments = {}
self.inline_comments = {}
# the configspec
self.configspec = None
# for defaults
self.defaults = []
self.default_values = {}
def _interpolate(self, key, value):
try:
# do we already have an interpolation engine?
engine = self._interpolation_engine
except AttributeError:
# not yet: first time running _interpolate(), so pick the engine
name = self.main.interpolation
if name == True: # note that "if name:" would be incorrect here
# backwards-compatibility: interpolation=True means use default
name = DEFAULT_INTERPOLATION
name = name.lower() # so that "Template", "template", etc. all work
class_ = interpolation_engines.get(name, None)
if class_ is None:
# invalid value for self.main.interpolation
self.main.interpolation = False
return value
else:
# save reference to engine so we don't have to do this again
engine = self._interpolation_engine = class_(self)
# let the engine do the actual work
return engine.interpolate(key, value)
def __getitem__(self, key):
"""Fetch the item and do string interpolation."""
val = dict.__getitem__(self, key)
if self.main.interpolation and isinstance(val, basestring):
return self._interpolate(key, val)
return val
def __setitem__(self, key, value, unrepr=False):
"""
Correctly set a value.
Making dictionary values Section instances.
(We have to special case 'Section' instances - which are also dicts)
Keys must be strings.
Values need only be strings (or lists of strings) if
``main.stringify`` is set.
``unrepr`` must be set when setting a value to a dictionary, without
creating a new sub-section.
"""
if not isinstance(key, basestring):
raise ValueError('The key "%s" is not a string.' % key)
# add the comment
if not self.comments.has_key(key):
self.comments[key] = []
self.inline_comments[key] = ''
# remove the entry from defaults
if key in self.defaults:
self.defaults.remove(key)
#
if isinstance(value, Section):
if not self.has_key(key):
self.sections.append(key)
dict.__setitem__(self, key, value)
elif isinstance(value, dict) and not unrepr:
# First create the new depth level,
# then create the section
if not self.has_key(key):
self.sections.append(key)
new_depth = self.depth + 1
dict.__setitem__(
self,
key,
Section(
self,
new_depth,
self.main,
indict=value,
name=key))
else:
if not self.has_key(key):
self.scalars.append(key)
if not self.main.stringify:
if isinstance(value, basestring):
pass
elif isinstance(value, (list, tuple)):
for entry in value:
if not isinstance(entry, basestring):
raise TypeError('Value is not a string "%s".' % entry)
else:
raise TypeError('Value is not a string "%s".' % value)
dict.__setitem__(self, key, value)
def __delitem__(self, key):
"""Remove items from the sequence when deleting."""
dict. __delitem__(self, key)
if key in self.scalars:
self.scalars.remove(key)
else:
self.sections.remove(key)
del self.comments[key]
del self.inline_comments[key]
def get(self, key, default=None):
"""A version of ``get`` that doesn't bypass string interpolation."""
try:
return self[key]
except KeyError:
return default
def update(self, indict):
"""
A version of update that uses our ``__setitem__``.
"""
for entry in indict:
self[entry] = indict[entry]
def pop(self, key, *args):
"""
'D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised'
"""
val = dict.pop(self, key, *args)
if key in self.scalars:
del self.comments[key]
del self.inline_comments[key]
self.scalars.remove(key)
elif key in self.sections:
del self.comments[key]
del self.inline_comments[key]
self.sections.remove(key)
if self.main.interpolation and isinstance(val, basestring):
return self._interpolate(key, val)
return val
def popitem(self):
"""Pops the first (key,val)"""
sequence = (self.scalars + self.sections)
if not sequence:
raise KeyError(": 'popitem(): dictionary is empty'")
key = sequence[0]
val = self[key]
del self[key]
return key, val
def clear(self):
"""
A version of clear that also affects scalars/sections
Also clears comments and configspec.
Leaves other attributes alone :
depth/main/parent are not affected
"""
dict.clear(self)
self.scalars = []
self.sections = []
self.comments = {}
self.inline_comments = {}
self.configspec = None
def setdefault(self, key, default=None):
"""A version of setdefault that sets sequence if appropriate."""
try:
return self[key]
except KeyError:
self[key] = default
return self[key]
def items(self):
"""D.items() -> list of D's (key, value) pairs, as 2-tuples"""
return zip((self.scalars + self.sections), self.values())
def keys(self):
"""D.keys() -> list of D's keys"""
return (self.scalars + self.sections)
def values(self):
"""D.values() -> list of D's values"""
return [self[key] for key in (self.scalars + self.sections)]
def iteritems(self):
"""D.iteritems() -> an iterator over the (key, value) items of D"""
return iter(self.items())
def iterkeys(self):
"""D.iterkeys() -> an iterator over the keys of D"""
return iter((self.scalars + self.sections))
__iter__ = iterkeys
def itervalues(self):
"""D.itervalues() -> an iterator over the values of D"""
return iter(self.values())
def __repr__(self):
"""x.__repr__() <==> repr(x)"""
return '{%s}' % ', '.join([('%s: %s' % (repr(key), repr(self[key])))
for key in (self.scalars + self.sections)])
__str__ = __repr__
__str__.__doc__ = "x.__str__() <==> str(x)"
# Extra methods - not in a normal dictionary
def dict(self):
"""
Return a deepcopy of self as a dictionary.
All members that are ``Section`` instances are recursively turned to
ordinary dictionaries - by calling their ``dict`` method.
>>> n = a.dict()
>>> n == a
1
>>> n is a
0
"""
newdict = {}
for entry in self:
this_entry = self[entry]
if isinstance(this_entry, Section):
this_entry = this_entry.dict()
elif isinstance(this_entry, list):
# create a copy rather than a reference
this_entry = list(this_entry)
elif isinstance(this_entry, tuple):
# create a copy rather than a reference
this_entry = tuple(this_entry)
newdict[entry] = this_entry
return newdict
def merge(self, indict):
"""
A recursive update - useful for merging config files.
>>> a = '''[section1]
... option1 = True
... [[subsection]]
... more_options = False
... # end of file'''.splitlines()
>>> b = '''# File is user.ini
... [section1]
... option1 = False
... # end of file'''.splitlines()
>>> c1 = ConfigObj(b)
>>> c2 = ConfigObj(a)
>>> c2.merge(c1)
>>> c2
ConfigObj({'section1': {'option1': 'False', 'subsection': {'more_options': 'False'}}})
"""
for key, val in indict.items():
if (key in self and isinstance(self[key], dict) and
isinstance(val, dict)):
self[key].merge(val)
else:
self[key] = val
def rename(self, oldkey, newkey):
"""
Change a keyname to another, without changing position in sequence.
Implemented so that transformations can be made on keys,
as well as on values. (used by encode and decode)
Also renames comments.
"""
if oldkey in self.scalars:
the_list = self.scalars
elif oldkey in self.sections:
the_list = self.sections
else:
raise KeyError('Key "%s" not found.' % oldkey)
pos = the_list.index(oldkey)
#
val = self[oldkey]
dict.__delitem__(self, oldkey)
dict.__setitem__(self, newkey, val)
the_list.remove(oldkey)
the_list.insert(pos, newkey)
comm = self.comments[oldkey]
inline_comment = self.inline_comments[oldkey]
del self.comments[oldkey]
del self.inline_comments[oldkey]
self.comments[newkey] = comm
self.inline_comments[newkey] = inline_comment
def walk(self, function, raise_errors=True,
call_on_sections=False, **keywargs):
"""
Walk every member and call a function on the keyword and value.
Return a dictionary of the return values
If the function raises an exception, raise the errror
unless ``raise_errors=False``, in which case set the return value to
``False``.
Any unrecognised keyword arguments you pass to walk, will be pased on
to the function you pass in.
Note: if ``call_on_sections`` is ``True`` then - on encountering a
subsection, *first* the function is called for the *whole* subsection,
and then recurses into it's members. This means your function must be
able to handle strings, dictionaries and lists. This allows you
to change the key of subsections as well as for ordinary members. The
return value when called on the whole subsection has to be discarded.
See the encode and decode methods for examples, including functions.
.. admonition:: caution
You can use ``walk`` to transform the names of members of a section
but you mustn't add or delete members.
>>> config = '''[XXXXsection]
... XXXXkey = XXXXvalue'''.splitlines()
>>> cfg = ConfigObj(config)
>>> cfg
ConfigObj({'XXXXsection': {'XXXXkey': 'XXXXvalue'}})
>>> def transform(section, key):
... val = section[key]
... newkey = key.replace('XXXX', 'CLIENT1')
... section.rename(key, newkey)
... if isinstance(val, (tuple, list, dict)):
... pass
... else:
... val = val.replace('XXXX', 'CLIENT1')
... section[newkey] = val
>>> cfg.walk(transform, call_on_sections=True)
{'CLIENT1section': {'CLIENT1key': None}}
>>> cfg
ConfigObj({'CLIENT1section': {'CLIENT1key': 'CLIENT1value'}})
"""
out = {}
# scalars first
for i in range(len(self.scalars)):
entry = self.scalars[i]
try:
val = function(self, entry, **keywargs)
# bound again in case name has changed
entry = self.scalars[i]
out[entry] = val
except Exception:
if raise_errors:
raise
else:
entry = self.scalars[i]
out[entry] = False
# then sections
for i in range(len(self.sections)):
entry = self.sections[i]
if call_on_sections:
try:
function(self, entry, **keywargs)
except Exception:
if raise_errors:
raise
else:
entry = self.sections[i]
out[entry] = False
# bound again in case name has changed
entry = self.sections[i]
# previous result is discarded
out[entry] = self[entry].walk(
function,
raise_errors=raise_errors,
call_on_sections=call_on_sections,
**keywargs)
return out
def as_bool(self, key):
"""
Accepts a key as input. The corresponding value must be a string or
the objects (``True`` or 1) or (``False`` or 0). We allow 0 and 1 to
retain compatibility with Python 2.2.
If the string is one of ``True``, ``On``, ``Yes``, or ``1`` it returns
``True``.
If the string is one of ``False``, ``Off``, ``No``, or ``0`` it returns
``False``.
``as_bool`` is not case sensitive.
Any other input will raise a ``ValueError``.
>>> a = ConfigObj()
>>> a['a'] = 'fish'
>>> a.as_bool('a')
Traceback (most recent call last):
ValueError: Value "fish" is neither True nor False
>>> a['b'] = 'True'
>>> a.as_bool('b')
1
>>> a['b'] = 'off'
>>> a.as_bool('b')
0
"""
val = self[key]
if val == True:
return True
elif val == False:
return False
else:
try:
if not isinstance(val, basestring):
# TODO: Why do we raise a KeyError here?
raise KeyError()
else:
return self.main._bools[val.lower()]
except KeyError:
raise ValueError('Value "%s" is neither True nor False' % val)
def as_int(self, key):
"""
A convenience method which coerces the specified value to an integer.
If the value is an invalid literal for ``int``, a ``ValueError`` will
be raised.
>>> a = ConfigObj()
>>> a['a'] = 'fish'
>>> a.as_int('a')
Traceback (most recent call last):
ValueError: invalid literal for int() with base 10: 'fish'
>>> a['b'] = '1'
>>> a.as_int('b')
1
>>> a['b'] = '3.2'
>>> a.as_int('b')
Traceback (most recent call last):
ValueError: invalid literal for int() with base 10: '3.2'
"""
return int(self[key])
def as_float(self, key):
"""
A convenience method which coerces the specified value to a float.
If the value is an invalid literal for ``float``, a ``ValueError`` will
be raised.
>>> a = ConfigObj()
>>> a['a'] = 'fish'
>>> a.as_float('a')
Traceback (most recent call last):
ValueError: invalid literal for float(): fish
>>> a['b'] = '1'
>>> a.as_float('b')
1.0
>>> a['b'] = '3.2'
>>> a.as_float('b')
3.2000000000000002
"""
return float(self[key])
def as_list(self, key):
"""
A convenience method which fetches the specified value, guaranteeing
that it is a list.
>>> a = ConfigObj()
>>> a['a'] = 1
>>> a.as_list('a')
[1]
>>> a['a'] = (1,)
>>> a.as_list('a')
[1]
>>> a['a'] = [1]
>>> a.as_list('a')
[1]
"""
result = self[key]
if isinstance(result, (tuple, list)):
return list(result)
return [result]
def restore_default(self, key):
"""
Restore (and return) default value for the specified key.
This method will only work for a ConfigObj that was created
with a configspec and has been validated.
If there is no default value for this key, ``KeyError`` is raised.
"""
default = self.default_values[key]
dict.__setitem__(self, key, default)
if key not in self.defaults:
self.defaults.append(key)
return default
def restore_defaults(self):
"""
Recursively restore default values to all members
that have them.
This method will only work for a ConfigObj that was created
with a configspec and has been validated.
It doesn't delete or modify entries without default values.
"""
for key in self.default_values:
self.restore_default(key)
for section in self.sections:
self[section].restore_defaults()
class ConfigObj(Section):
"""An object to read, create, and write config files."""
_keyword = re.compile(r'''^ # line start
(\s*) # indentation
( # keyword
(?:".*?")| # double quotes
(?:'.*?')| # single quotes
(?:[^'"=].*?) # no quotes
)
\s*=\s* # divider
(.*) # value (including list values and comments)
$ # line end
''',
re.VERBOSE)
_sectionmarker = re.compile(r'''^
(\s*) # 1: indentation
((?:\[\s*)+) # 2: section marker open
( # 3: section name open
(?:"\s*\S.*?\s*")| # at least one non-space with double quotes
(?:'\s*\S.*?\s*')| # at least one non-space with single quotes
(?:[^'"\s].*?) # at least one non-space unquoted
) # section name close
((?:\s*\])+) # 4: section marker close
\s*(\#.*)? # 5: optional comment
$''',
re.VERBOSE)
# this regexp pulls list values out as a single string
# or single values and comments
# FIXME: this regex adds a '' to the end of comma terminated lists
# workaround in ``_handle_value``
_valueexp = re.compile(r'''^
(?:
(?:
(
(?:
(?:
(?:".*?")| # double quotes
(?:'.*?')| # single quotes
(?:[^'",\#][^,\#]*?) # unquoted
)
\s*,\s* # comma
)* # match all list items ending in a comma (if any)
)
(
(?:".*?")| # double quotes
(?:'.*?')| # single quotes
(?:[^'",\#\s][^,]*?)| # unquoted
(?:(?<!,)) # Empty value
)? # last item in a list - or string value
)|
(,) # alternatively a single comma - empty list
)
\s*(\#.*)? # optional comment
$''',
re.VERBOSE)
# use findall to get the members of a list value
_listvalueexp = re.compile(r'''
(
(?:".*?")| # double quotes
(?:'.*?')| # single quotes
(?:[^'",\#].*?) # unquoted
)
\s*,\s* # comma
''',
re.VERBOSE)
# this regexp is used for the value
# when lists are switched off
_nolistvalue = re.compile(r'''^
(
(?:".*?")| # double quotes
(?:'.*?')| # single quotes
(?:[^'"\#].*?)| # unquoted
(?:) # Empty value
)
\s*(\#.*)? # optional comment
$''',
re.VERBOSE)
# regexes for finding triple quoted values on one line
_single_line_single = re.compile(r"^'''(.*?)'''\s*(#.*)?$")
_single_line_double = re.compile(r'^"""(.*?)"""\s*(#.*)?$')
_multi_line_single = re.compile(r"^(.*?)'''\s*(#.*)?$")
_multi_line_double = re.compile(r'^(.*?)"""\s*(#.*)?$')
_triple_quote = {
"'''": (_single_line_single, _multi_line_single),
'"""': (_single_line_double, _multi_line_double),
}
# Used by the ``istrue`` Section method
_bools = {
'yes': True, 'no': False,
'on': True, 'off': False,
'1': True, '0': False,
'true': True, 'false': False,
}
def __init__(self, infile=None, options=None, _inspec=False, **kwargs):
"""
Parse a config file or create a config file object.
``ConfigObj(infile=None, options=None, **kwargs)``
"""
self._inspec = _inspec
# init the superclass
Section.__init__(self, self, 0, self)
infile = infile or []
options = dict(options or {})
# keyword arguments take precedence over an options dictionary
options.update(kwargs)
if _inspec:
options['list_values'] = False
defaults = OPTION_DEFAULTS.copy()
# TODO: check the values too.
for entry in options:
if entry not in defaults:
raise TypeError('Unrecognised option "%s".' % entry)
# Add any explicit options to the defaults
defaults.update(options)
self._initialise(defaults)
configspec = defaults['configspec']
self._original_configspec = configspec
self._load(infile, configspec)
def _load(self, infile, configspec):
if isinstance(infile, basestring):
self.filename = infile
if os.path.isfile(infile):
h = open(infile, 'rb')
infile = h.read() or []
h.close()
elif self.file_error:
# raise an error if the file doesn't exist
raise IOError('Config file not found: "%s".' % self.filename)
else:
# file doesn't already exist
if self.create_empty:
# this is a good test that the filename specified
# isn't impossible - like on a non-existent device
h = open(infile, 'w')
h.write('')
h.close()
infile = []
elif isinstance(infile, (list, tuple)):
infile = list(infile)
elif isinstance(infile, dict):
# initialise self
# the Section class handles creating subsections
if isinstance(infile, ConfigObj):
# get a copy of our ConfigObj
infile = infile.dict()
for entry in infile:
self[entry] = infile[entry]
del self._errors
if configspec is not None:
self._handle_configspec(configspec)
else:
self.configspec = None
return
elif getattr(infile, 'read', MISSING) is not MISSING:
# This supports file like objects
infile = infile.read() or []
# needs splitting into lines - but needs doing *after* decoding
# in case it's not an 8 bit encoding
else:
raise TypeError('infile must be a filename, file like object, or list of lines.')
if infile:
# don't do it for the empty ConfigObj
infile = self._handle_bom(infile)
# infile is now *always* a list
#
# Set the newlines attribute (first line ending it finds)
# and strip trailing '\n' or '\r' from lines
for line in infile:
if (not line) or (line[-1] not in ('\r', '\n', '\r\n')):
continue
for end in ('\r\n', '\n', '\r'):
if line.endswith(end):
self.newlines = end
break
break
infile = [line.rstrip('\r\n') for line in infile]
self._parse(infile)
# if we had any errors, now is the time to raise them
if self._errors:
info = "at line %s." % self._errors[0].line_number
if len(self._errors) > 1:
msg = "Parsing failed with several errors.\nFirst error %s" % info
error = ConfigObjError(msg)
else:
error = self._errors[0]
# set the errors attribute; it's a list of tuples:
# (error_type, message, line_number)
error.errors = self._errors
# set the config attribute
error.config = self
raise error
# delete private attributes
del self._errors
if configspec is None:
self.configspec = None
else:
self._handle_configspec(configspec)
def _initialise(self, options=None):
if options is None:
options = OPTION_DEFAULTS
# initialise a few variables
self.filename = None
self._errors = []
self.raise_errors = options['raise_errors']
self.interpolation = options['interpolation']
self.list_values = options['list_values']
self.create_empty = options['create_empty']
self.file_error = options['file_error']
self.stringify = options['stringify']
self.indent_type = options['indent_type']
self.encoding = options['encoding']
self.default_encoding = options['default_encoding']
self.BOM = False
self.newlines = None
self.write_empty_values = options['write_empty_values']
self.unrepr = options['unrepr']
self.initial_comment = []
self.final_comment = []
self.configspec = None
if self._inspec:
self.list_values = False
# Clear section attributes as well
Section._initialise(self)
def __repr__(self):
return ('ConfigObj({%s})' %
', '.join([('%s: %s' % (repr(key), repr(self[key])))
for key in (self.scalars + self.sections)]))
def _handle_bom(self, infile):
"""
Handle any BOM, and decode if necessary.
If an encoding is specified, that *must* be used - but the BOM should
still be removed (and the BOM attribute set).
(If the encoding is wrongly specified, then a BOM for an alternative
encoding won't be discovered or removed.)
If an encoding is not specified, UTF8 or UTF16 BOM will be detected and
removed. The BOM attribute will be set. UTF16 will be decoded to
unicode.
NOTE: This method must not be called with an empty ``infile``.
Specifying the *wrong* encoding is likely to cause a
``UnicodeDecodeError``.
``infile`` must always be returned as a list of lines, but may be
passed in as a single string.
"""
if ((self.encoding is not None) and
(self.encoding.lower() not in BOM_LIST)):
# No need to check for a BOM
# the encoding specified doesn't have one
# just decode
return self._decode(infile, self.encoding)
if isinstance(infile, (list, tuple)):
line = infile[0]
else:
line = infile
if self.encoding is not None:
# encoding explicitly supplied
# And it could have an associated BOM
# TODO: if encoding is just UTF16 - we ought to check for both
# TODO: big endian and little endian versions.
enc = BOM_LIST[self.encoding.lower()]
if enc == 'utf_16':
# For UTF16 we try big endian and little endian
for BOM, (encoding, final_encoding) in BOMS.items():
if not final_encoding:
# skip UTF8
continue
if infile.startswith(BOM):
### BOM discovered
##self.BOM = True
# Don't need to remove BOM
return self._decode(infile, encoding)
# If we get this far, will *probably* raise a DecodeError
# As it doesn't appear to start with a BOM
return self._decode(infile, self.encoding)
# Must be UTF8
BOM = BOM_SET[enc]
if not line.startswith(BOM):
return self._decode(infile, self.encoding)
newline = line[len(BOM):]
# BOM removed
if isinstance(infile, (list, tuple)):
infile[0] = newline
else:
infile = newline
self.BOM = True
return self._decode(infile, self.encoding)
# No encoding specified - so we need to check for UTF8/UTF16
for BOM, (encoding, final_encoding) in BOMS.items():
if not line.startswith(BOM):
continue
else:
# BOM discovered
self.encoding = final_encoding
if not final_encoding:
self.BOM = True
# UTF8
# remove BOM
newline = line[len(BOM):]
if isinstance(infile, (list, tuple)):
infile[0] = newline
else:
infile = newline
# UTF8 - don't decode
if isinstance(infile, basestring):
return infile.splitlines(True)
else:
return infile
# UTF16 - have to decode
return self._decode(infile, encoding)
# No BOM discovered and no encoding specified, just return
if isinstance(infile, basestring):
# infile read from a file will be a single string
return infile.splitlines(True)
return infile
def _a_to_u(self, aString):
"""Decode ASCII strings to unicode if a self.encoding is specified."""
if self.encoding:
return aString.decode('ascii')
else:
return aString
def _decode(self, infile, encoding):
"""
Decode infile to unicode. Using the specified encoding.
if is a string, it also needs converting to a list.
"""
if isinstance(infile, basestring):
# can't be unicode
# NOTE: Could raise a ``UnicodeDecodeError``
return infile.decode(encoding).splitlines(True)
for i, line in enumerate(infile):
if not isinstance(line, unicode):
# NOTE: The isinstance test here handles mixed lists of unicode/string
# NOTE: But the decode will break on any non-string values
# NOTE: Or could raise a ``UnicodeDecodeError``
infile[i] = line.decode(encoding)
return infile
def _decode_element(self, line):
"""Decode element to unicode if necessary."""
if not self.encoding:
return line
if isinstance(line, str) and self.default_encoding:
return line.decode(self.default_encoding)
return line
def _str(self, value):
"""
Used by ``stringify`` within validate, to turn non-string values
into strings.
"""
if not isinstance(value, basestring):
return str(value)
else:
return value
def _parse(self, infile):
"""Actually parse the config file."""
temp_list_values = self.list_values
if self.unrepr:
self.list_values = False
comment_list = []
done_start = False
this_section = self
maxline = len(infile) - 1
cur_index = -1
reset_comment = False
while cur_index < maxline:
if reset_comment:
comment_list = []
cur_index += 1
line = infile[cur_index]
sline = line.strip()
# do we have anything on the line ?
if not sline or sline.startswith('#'):
reset_comment = False
comment_list.append(line)
continue
if not done_start:
# preserve initial comment
self.initial_comment = comment_list
comment_list = []
done_start = True
reset_comment = True
# first we check if it's a section marker
mat = self._sectionmarker.match(line)
if mat is not None:
# is a section line
(indent, sect_open, sect_name, sect_close, comment) = mat.groups()
if indent and (self.indent_type is None):
self.indent_type = indent
cur_depth = sect_open.count('[')
if cur_depth != sect_close.count(']'):
self._handle_error("Cannot compute the section depth at line %s.",
NestingError, infile, cur_index)
continue
if cur_depth < this_section.depth:
# the new section is dropping back to a previous level
try:
parent = self._match_depth(this_section,
cur_depth).parent
except SyntaxError:
self._handle_error("Cannot compute nesting level at line %s.",
NestingError, infile, cur_index)
continue
elif cur_depth == this_section.depth:
# the new section is a sibling of the current section
parent = this_section.parent
elif cur_depth == this_section.depth + 1:
# the new section is a child the current section
parent = this_section
else:
self._handle_error("Section too nested at line %s.",
NestingError, infile, cur_index)
sect_name = self._unquote(sect_name)
if parent.has_key(sect_name):
self._handle_error('Duplicate section name at line %s.',
DuplicateError, infile, cur_index)
continue
# create the new section
this_section = Section(
parent,
cur_depth,
self,
name=sect_name)
parent[sect_name] = this_section
parent.inline_comments[sect_name] = comment
parent.comments[sect_name] = comment_list
continue
#
# it's not a section marker,
# so it should be a valid ``key = value`` line
mat = self._keyword.match(line)
if mat is None:
# it neither matched as a keyword
# or a section marker
self._handle_error(
'Invalid line at line "%s".',
ParseError, infile, cur_index)
else:
# is a keyword value
# value will include any inline comment
(indent, key, value) = mat.groups()
if indent and (self.indent_type is None):
self.indent_type = indent
# check for a multiline value
if value[:3] in ['"""', "'''"]:
try:
(value, comment, cur_index) = self._multiline(
value, infile, cur_index, maxline)
except SyntaxError:
self._handle_error(
'Parse error in value at line %s.',
ParseError, infile, cur_index)
continue
else:
if self.unrepr:
comment = ''
try:
value = unrepr(value)
except Exception, e:
if type(e) == UnknownType:
msg = 'Unknown name or type in value at line %s.'
else:
msg = 'Parse error in value at line %s.'
self._handle_error(msg, UnreprError, infile,
cur_index)
continue
else:
if self.unrepr:
comment = ''
try:
value = unrepr(value)
except Exception, e:
if isinstance(e, UnknownType):
msg = 'Unknown name or type in value at line %s.'
else:
msg = 'Parse error in value at line %s.'
self._handle_error(msg, UnreprError, infile,
cur_index)
continue
else:
# extract comment and lists
try:
(value, comment) = self._handle_value(value)
except SyntaxError:
self._handle_error(
'Parse error in value at line %s.',
ParseError, infile, cur_index)
continue
#
key = self._unquote(key)
if this_section.has_key(key):
self._handle_error(
'Duplicate keyword name at line %s.',
DuplicateError, infile, cur_index)
continue
# add the key.
# we set unrepr because if we have got this far we will never
# be creating a new section
this_section.__setitem__(key, value, unrepr=True)
this_section.inline_comments[key] = comment
this_section.comments[key] = comment_list
continue
#
if self.indent_type is None:
# no indentation used, set the type accordingly
self.indent_type = ''
# preserve the final comment
if not self and not self.initial_comment:
self.initial_comment = comment_list
elif not reset_comment:
self.final_comment = comment_list
self.list_values = temp_list_values
def _match_depth(self, sect, depth):
"""
Given a section and a depth level, walk back through the sections
parents to see if the depth level matches a previous section.
Return a reference to the right section,
or raise a SyntaxError.
"""
while depth < sect.depth:
if sect is sect.parent:
# we've reached the top level already
raise SyntaxError()
sect = sect.parent
if sect.depth == depth:
return sect
# shouldn't get here
raise SyntaxError()
def _handle_error(self, text, ErrorClass, infile, cur_index):
"""
Handle an error according to the error settings.
Either raise the error or store it.
The error will have occured at ``cur_index``
"""
line = infile[cur_index]
cur_index += 1
message = text % cur_index
error = ErrorClass(message, cur_index, line)
if self.raise_errors:
# raise the error - parsing stops here
raise error
# store the error
# reraise when parsing has finished
self._errors.append(error)
def _unquote(self, value):
"""Return an unquoted version of a value"""
if (value[0] == value[-1]) and (value[0] in ('"', "'")):
value = value[1:-1]
return value
def _quote(self, value, multiline=True):
"""
Return a safely quoted version of a value.
Raise a ConfigObjError if the value cannot be safely quoted.
If multiline is ``True`` (default) then use triple quotes
if necessary.
* Don't quote values that don't need it.
* Recursively quote members of a list and return a comma joined list.
* Multiline is ``False`` for lists.
* Obey list syntax for empty and single member lists.
If ``list_values=False`` then the value is only quoted if it contains
a ``\\n`` (is multiline) or '#'.
If ``write_empty_values`` is set, and the value is an empty string, it
won't be quoted.
"""
if multiline and self.write_empty_values and value == '':
# Only if multiline is set, so that it is used for values not
# keys, and not values that are part of a list
return ''
if multiline and isinstance(value, (list, tuple)):
if not value:
return ','
elif len(value) == 1:
return self._quote(value[0], multiline=False) + ','
return ', '.join([self._quote(val, multiline=False)
for val in value])
if not isinstance(value, basestring):
if self.stringify:
value = str(value)
else:
raise TypeError('Value "%s" is not a string.' % value)
if not value:
return '""'
no_lists_no_quotes = not self.list_values and '\n' not in value and '#' not in value
need_triple = multiline and ((("'" in value) and ('"' in value)) or ('\n' in value))
hash_triple_quote = multiline and not need_triple and ("'" in value) and ('"' in value) and ('#' in value)
check_for_single = (no_lists_no_quotes or not need_triple) and not hash_triple_quote
if check_for_single:
if not self.list_values:
# we don't quote if ``list_values=False``
quot = noquot
# for normal values either single or double quotes will do
elif '\n' in value:
# will only happen if multiline is off - e.g. '\n' in key
raise ConfigObjError('Value "%s" cannot be safely quoted.' % value)
elif ((value[0] not in wspace_plus) and
(value[-1] not in wspace_plus) and
(',' not in value)):
quot = noquot
else:
quot = self._get_single_quote(value)
else:
# if value has '\n' or "'" *and* '"', it will need triple quotes
quot = self._get_triple_quote(value)
if quot == noquot and '#' in value and self.list_values:
quot = self._get_single_quote(value)
return quot % value
def _get_single_quote(self, value):
if ("'" in value) and ('"' in value):
raise ConfigObjError('Value "%s" cannot be safely quoted.' % value)
elif '"' in value:
quot = squot
else:
quot = dquot
return quot
def _get_triple_quote(self, value):
if (value.find('"""') != -1) and (value.find("'''") != -1):
raise ConfigObjError('Value "%s" cannot be safely quoted.' % value)
if value.find('"""') == -1:
quot = tdquot
else:
quot = tsquot
return quot
def _handle_value(self, value):
"""
Given a value string, unquote, remove comment,
handle lists. (including empty and single member lists)
"""
if self._inspec:
# Parsing a configspec so don't handle comments
return (value, '')
# do we look for lists in values ?
if not self.list_values:
mat = self._nolistvalue.match(value)
if mat is None:
raise SyntaxError()
# NOTE: we don't unquote here
return mat.groups()
#
mat = self._valueexp.match(value)
if mat is None:
# the value is badly constructed, probably badly quoted,
# or an invalid list
raise SyntaxError()
(list_values, single, empty_list, comment) = mat.groups()
if (list_values == '') and (single is None):
# change this if you want to accept empty values
raise SyntaxError()
# NOTE: note there is no error handling from here if the regex
# is wrong: then incorrect values will slip through
if empty_list is not None:
# the single comma - meaning an empty list
return ([], comment)
if single is not None:
# handle empty values
if list_values and not single:
# FIXME: the '' is a workaround because our regex now matches
# '' at the end of a list if it has a trailing comma
single = None
else:
single = single or '""'
single = self._unquote(single)
if list_values == '':
# not a list value
return (single, comment)
the_list = self._listvalueexp.findall(list_values)
the_list = [self._unquote(val) for val in the_list]
if single is not None:
the_list += [single]
return (the_list, comment)
def _multiline(self, value, infile, cur_index, maxline):
"""Extract the value, where we are in a multiline situation."""
quot = value[:3]
newvalue = value[3:]
single_line = self._triple_quote[quot][0]
multi_line = self._triple_quote[quot][1]
mat = single_line.match(value)
if mat is not None:
retval = list(mat.groups())
retval.append(cur_index)
return retval
elif newvalue.find(quot) != -1:
# somehow the triple quote is missing
raise SyntaxError()
#
while cur_index < maxline:
cur_index += 1
newvalue += '\n'
line = infile[cur_index]
if line.find(quot) == -1:
newvalue += line
else:
# end of multiline, process it
break
else:
# we've got to the end of the config, oops...
raise SyntaxError()
mat = multi_line.match(line)
if mat is None:
# a badly formed line
raise SyntaxError()
(value, comment) = mat.groups()
return (newvalue + value, comment, cur_index)
def _handle_configspec(self, configspec):
"""Parse the configspec."""
# FIXME: Should we check that the configspec was created with the
# correct settings ? (i.e. ``list_values=False``)
if not isinstance(configspec, ConfigObj):
try:
configspec = ConfigObj(configspec,
raise_errors=True,
file_error=True,
_inspec=True)
except ConfigObjError, e:
# FIXME: Should these errors have a reference
# to the already parsed ConfigObj ?
raise ConfigspecError('Parsing configspec failed: %s' % e)
except IOError, e:
raise IOError('Reading configspec failed: %s' % e)
self.configspec = configspec
def _set_configspec(self, section, copy):
"""
Called by validate. Handles setting the configspec on subsections
including sections to be validated by __many__
"""
configspec = section.configspec
many = configspec.get('__many__')
if isinstance(many, dict):
for entry in section.sections:
if entry not in configspec:
section[entry].configspec = many
for entry in configspec.sections:
if entry == '__many__':
continue
if entry not in section:
section[entry] = {}
if copy:
# copy comments
section.comments[entry] = configspec.comments.get(entry, [])
section.inline_comments[entry] = configspec.inline_comments.get(entry, '')
# Could be a scalar when we expect a section
if isinstance(section[entry], Section):
section[entry].configspec = configspec[entry]
def _write_line(self, indent_string, entry, this_entry, comment):
"""Write an individual line, for the write method"""
# NOTE: the calls to self._quote here handles non-StringType values.
if not self.unrepr:
val = self._decode_element(self._quote(this_entry))
else:
val = repr(this_entry)
return '%s%s%s%s%s' % (indent_string,
self._decode_element(self._quote(entry, multiline=False)),
self._a_to_u(' = '),
val,
self._decode_element(comment))
def _write_marker(self, indent_string, depth, entry, comment):
"""Write a section marker line"""
return '%s%s%s%s%s' % (indent_string,
self._a_to_u('[' * depth),
self._quote(self._decode_element(entry), multiline=False),
self._a_to_u(']' * depth),
self._decode_element(comment))
def _handle_comment(self, comment):
"""Deal with a comment."""
if not comment:
return ''
start = self.indent_type
if not comment.startswith('#'):
start += self._a_to_u(' # ')
return (start + comment)
# Public methods
def write(self, outfile=None, section=None):
"""
Write the current ConfigObj as a file
tekNico: FIXME: use StringIO instead of real files
>>> filename = a.filename
>>> a.filename = 'test.ini'
>>> a.write()
>>> a.filename = filename
>>> a == ConfigObj('test.ini', raise_errors=True)
1
"""
if self.indent_type is None:
# this can be true if initialised from a dictionary
self.indent_type = DEFAULT_INDENT_TYPE
out = []
cs = self._a_to_u('#')
csp = self._a_to_u('# ')
if section is None:
int_val = self.interpolation
self.interpolation = False
section = self
for line in self.initial_comment:
line = self._decode_element(line)
stripped_line = line.strip()
if stripped_line and not stripped_line.startswith(cs):
line = csp + line
out.append(line)
indent_string = self.indent_type * section.depth
for entry in (section.scalars + section.sections):
if entry in section.defaults:
# don't write out default values
continue
for comment_line in section.comments[entry]:
comment_line = self._decode_element(comment_line.lstrip())
if comment_line and not comment_line.startswith(cs):
comment_line = csp + comment_line
out.append(indent_string + comment_line)
this_entry = section[entry]
comment = self._handle_comment(section.inline_comments[entry])
if isinstance(this_entry, dict):
# a section
out.append(self._write_marker(
indent_string,
this_entry.depth,
entry,
comment))
out.extend(self.write(section=this_entry))
else:
out.append(self._write_line(
indent_string,
entry,
this_entry,
comment))
if section is self:
for line in self.final_comment:
line = self._decode_element(line)
stripped_line = line.strip()
if stripped_line and not stripped_line.startswith(cs):
line = csp + line
out.append(line)
self.interpolation = int_val
if section is not self:
return out
if (self.filename is None) and (outfile is None):
# output a list of lines
# might need to encode
# NOTE: This will *screw* UTF16, each line will start with the BOM
if self.encoding:
out = [l.encode(self.encoding) for l in out]
if (self.BOM and ((self.encoding is None) or
(BOM_LIST.get(self.encoding.lower()) == 'utf_8'))):
# Add the UTF8 BOM
if not out:
out.append('')
out[0] = BOM_UTF8 + out[0]
return out
# Turn the list to a string, joined with correct newlines
newline = self.newlines or os.linesep
output = self._a_to_u(newline).join(out)
if self.encoding:
output = output.encode(self.encoding)
if self.BOM and ((self.encoding is None) or match_utf8(self.encoding)):
# Add the UTF8 BOM
output = BOM_UTF8 + output
if not output.endswith(newline):
output += newline
if outfile is not None:
outfile.write(output)
else:
h = open(self.filename, 'wb')
h.write(output)
h.close()
def validate(self, validator, preserve_errors=False, copy=False,
section=None):
"""
Test the ConfigObj against a configspec.
It uses the ``validator`` object from *validate.py*.
To run ``validate`` on the current ConfigObj, call: ::
test = config.validate(validator)
(Normally having previously passed in the configspec when the ConfigObj
was created - you can dynamically assign a dictionary of checks to the
``configspec`` attribute of a section though).
It returns ``True`` if everything passes, or a dictionary of
pass/fails (True/False). If every member of a subsection passes, it
will just have the value ``True``. (It also returns ``False`` if all
members fail).
In addition, it converts the values from strings to their native
types if their checks pass (and ``stringify`` is set).
If ``preserve_errors`` is ``True`` (``False`` is default) then instead
of a marking a fail with a ``False``, it will preserve the actual
exception object. This can contain info about the reason for failure.
For example the ``VdtValueTooSmallError`` indicates that the value
supplied was too small. If a value (or section) is missing it will
still be marked as ``False``.
You must have the validate module to use ``preserve_errors=True``.
You can then use the ``flatten_errors`` function to turn your nested
results dictionary into a flattened list of failures - useful for
displaying meaningful error messages.
"""
if section is None:
if self.configspec is None:
raise ValueError('No configspec supplied.')
if preserve_errors:
# We do this once to remove a top level dependency on the validate module
# Which makes importing configobj faster
from validate import VdtMissingValue
self._vdtMissingValue = VdtMissingValue
section = self
if copy:
section.initial_comment = section.configspec.initial_comment
section.final_comment = section.configspec.final_comment
section.encoding = section.configspec.encoding
section.BOM = section.configspec.BOM
section.newlines = section.configspec.newlines
section.indent_type = section.configspec.indent_type
#
configspec = section.configspec
self._set_configspec(section, copy)
def validate_entry(entry, spec, val, missing, ret_true, ret_false):
try:
check = validator.check(spec,
val,
missing=missing
)
except validator.baseErrorClass, e:
if not preserve_errors or isinstance(e, self._vdtMissingValue):
out[entry] = False
else:
# preserve the error
out[entry] = e
ret_false = False
ret_true = False
else:
try:
section.default_values.pop(entry, None)
except AttributeError:
# For Python 2.2 compatibility
try:
del section.default_values[entry]
except KeyError:
pass
try:
section.default_values[entry] = validator.get_default_value(configspec[entry])
except (KeyError, AttributeError):
# No default or validator has no 'get_default_value' (e.g. SimpleVal)
pass
ret_false = False
out[entry] = True
if self.stringify or missing:
# if we are doing type conversion
# or the value is a supplied default
if not self.stringify:
if isinstance(check, (list, tuple)):
# preserve lists
check = [self._str(item) for item in check]
elif missing and check is None:
# convert the None from a default to a ''
check = ''
else:
check = self._str(check)
if (check != val) or missing:
section[entry] = check
if not copy and missing and entry not in section.defaults:
section.defaults.append(entry)
return ret_true, ret_false
#
out = {}
ret_true = True
ret_false = True
unvalidated = [k for k in section.scalars if k not in configspec]
incorrect_sections = [k for k in configspec.sections if k in section.scalars]
incorrect_scalars = [k for k in configspec.scalars if k in section.sections]
for entry in configspec.scalars:
if entry in ('__many__', '___many___'):
# reserved names
continue
if (not entry in section.scalars) or (entry in section.defaults):
# missing entries
# or entries from defaults
missing = True
val = None
if copy and not entry in section.scalars:
# copy comments
section.comments[entry] = (
configspec.comments.get(entry, []))
section.inline_comments[entry] = (
configspec.inline_comments.get(entry, ''))
#
else:
missing = False
val = section[entry]
ret_true, ret_false = validate_entry(entry, configspec[entry], val,
missing, ret_true, ret_false)
many = None
if '__many__' in configspec.scalars:
many = configspec['__many__']
elif '___many___' in configspec.scalars:
many = configspec['___many___']
if many is not None:
for entry in unvalidated:
val = section[entry]
ret_true, ret_false = validate_entry(entry, many, val, False,
ret_true, ret_false)
for entry in incorrect_scalars:
ret_true = False
if not preserve_errors:
out[entry] = False
else:
ret_false = False
msg = 'Value %r was provided as a section' % entry
out[entry] = validator.baseErrorClass(msg)
for entry in incorrect_sections:
ret_true = False
if not preserve_errors:
out[entry] = False
else:
ret_false = False
msg = 'Section %r was provided as a single value' % entry
out[entry] = validator.baseErrorClass(msg)
# Missing sections will have been created as empty ones when the
# configspec was read.
for entry in section.sections:
# FIXME: this means DEFAULT is not copied in copy mode
if section is self and entry == 'DEFAULT':
continue
if section[entry].configspec is None:
continue
if copy:
section.comments[entry] = configspec.comments.get(entry, [])
section.inline_comments[entry] = configspec.inline_comments.get(entry, '')
check = self.validate(validator, preserve_errors=preserve_errors, copy=copy, section=section[entry])
out[entry] = check
if check == False:
ret_true = False
elif check == True:
ret_false = False
else:
ret_true = False
ret_false = False
#
if ret_true:
return True
elif ret_false:
return False
return out
def reset(self):
"""Clear ConfigObj instance and restore to 'freshly created' state."""
self.clear()
self._initialise()
# FIXME: Should be done by '_initialise', but ConfigObj constructor (and reload)
# requires an empty dictionary
self.configspec = None
# Just to be sure ;-)
self._original_configspec = None
def reload(self):
"""
Reload a ConfigObj from file.
This method raises a ``ReloadError`` if the ConfigObj doesn't have
a filename attribute pointing to a file.
"""
if not isinstance(self.filename, basestring):
raise ReloadError()
filename = self.filename
current_options = {}
for entry in OPTION_DEFAULTS:
if entry == 'configspec':
continue
current_options[entry] = getattr(self, entry)
configspec = self._original_configspec
current_options['configspec'] = configspec
self.clear()
self._initialise(current_options)
self._load(filename, configspec)
class SimpleVal(object):
"""
A simple validator.
Can be used to check that all members expected are present.
To use it, provide a configspec with all your members in (the value given
will be ignored). Pass an instance of ``SimpleVal`` to the ``validate``
method of your ``ConfigObj``. ``validate`` will return ``True`` if all
members are present, or a dictionary with True/False meaning
present/missing. (Whole missing sections will be replaced with ``False``)
"""
def __init__(self):
self.baseErrorClass = ConfigObjError
def check(self, check, member, missing=False):
"""A dummy check method, always returns the value unchanged."""
if missing:
raise self.baseErrorClass()
return member
# Check / processing functions for options
def flatten_errors(cfg, res, levels=None, results=None):
"""
An example function that will turn a nested dictionary of results
(as returned by ``ConfigObj.validate``) into a flat list.
``cfg`` is the ConfigObj instance being checked, ``res`` is the results
dictionary returned by ``validate``.
(This is a recursive function, so you shouldn't use the ``levels`` or
``results`` arguments - they are used by the function.)
Returns a list of keys that failed. Each member of the list is a tuple :
::
([list of sections...], key, result)
If ``validate`` was called with ``preserve_errors=False`` (the default)
then ``result`` will always be ``False``.
*list of sections* is a flattened list of sections that the key was found
in.
If the section was missing (or a section was expected and a scalar provided
- or vice-versa) then key will be ``None``.
If the value (or section) was missing then ``result`` will be ``False``.
If ``validate`` was called with ``preserve_errors=True`` and a value
was present, but failed the check, then ``result`` will be the exception
object returned. You can use this as a string that describes the failure.
For example *The value "3" is of the wrong type*.
>>> import validate
>>> vtor = validate.Validator()
>>> my_ini = '''
... option1 = True
... [section1]
... option1 = True
... [section2]
... another_option = Probably
... [section3]
... another_option = True
... [[section3b]]
... value = 3
... value2 = a
... value3 = 11
... '''
>>> my_cfg = '''
... option1 = boolean()
... option2 = boolean()
... option3 = boolean(default=Bad_value)
... [section1]
... option1 = boolean()
... option2 = boolean()
... option3 = boolean(default=Bad_value)
... [section2]
... another_option = boolean()
... [section3]
... another_option = boolean()
... [[section3b]]
... value = integer
... value2 = integer
... value3 = integer(0, 10)
... [[[section3b-sub]]]
... value = string
... [section4]
... another_option = boolean()
... '''
>>> cs = my_cfg.split('\\n')
>>> ini = my_ini.split('\\n')
>>> cfg = ConfigObj(ini, configspec=cs)
>>> res = cfg.validate(vtor, preserve_errors=True)
>>> errors = []
>>> for entry in flatten_errors(cfg, res):
... section_list, key, error = entry
... section_list.insert(0, '[root]')
... if key is not None:
... section_list.append(key)
... else:
... section_list.append('[missing]')
... section_string = ', '.join(section_list)
... errors.append((section_string, ' = ', error))
>>> errors.sort()
>>> for entry in errors:
... print entry[0], entry[1], (entry[2] or 0)
[root], option2 = 0
[root], option3 = the value "Bad_value" is of the wrong type.
[root], section1, option2 = 0
[root], section1, option3 = the value "Bad_value" is of the wrong type.
[root], section2, another_option = the value "Probably" is of the wrong type.
[root], section3, section3b, section3b-sub, [missing] = 0
[root], section3, section3b, value2 = the value "a" is of the wrong type.
[root], section3, section3b, value3 = the value "11" is too big.
[root], section4, [missing] = 0
"""
if levels is None:
# first time called
levels = []
results = []
if res is True:
return results
if res is False or isinstance(res, Exception):
results.append((levels[:], None, res))
if levels:
levels.pop()
return results
for (key, val) in res.items():
if val == True:
continue
if isinstance(cfg.get(key), dict):
# Go down one level
levels.append(key)
flatten_errors(cfg[key], val, levels, results)
continue
results.append((levels[:], key, val))
#
# Go up one level
if levels:
levels.pop()
#
return results
"""*A programming language is a medium of expression.* - Paul Graham"""
|
gpl-3.0
|
[
3,
1101,
1113,
14,
647,
199,
3,
437,
1101,
570,
7002,
15,
5491,
626,
5171,
6032,
10189,
315,
1101,
1584,
14,
199,
3,
1898,
334,
35,
9,
11811,
13,
8664,
16922,
481,
79,
2181,
12,
653,
12802,
416,
491,
285,
29295,
199,
3,
662,
13,
1198,
26,
24101,
1237,
15059,
2309,
2638,
15854,
5981,
15854,
399,
75,
199,
3,
260,
302,
12802,
15059,
1565,
75,
46,
12802,
15854,
1851,
199,
199,
3,
4094,
5665,
841,
199,
3,
1455,
921,
1544,
14,
1647,
2638,
14,
1308,
14,
3210,
15,
1548,
15,
888,
1113,
14,
1360,
199,
199,
3,
17646,
68,
5420,
370,
314,
6289,
844,
199,
3,
7754,
1937,
1455,
921,
1544,
14,
1647,
2638,
14,
1308,
14,
3210,
15,
1548,
15,
1682,
14,
83,
1360,
199,
199,
3,
14914,
83,
26391,
737,
1455,
921,
1544,
14,
1647,
2638,
14,
1308,
14,
3210,
15,
1548,
15,
1080,
14,
83,
1360,
199,
3,
2104,
2556,
3595,
6519,
26205,
12,
7029,
436,
2291,
12,
8749,
4263,
314,
199,
3,
4094,
5665,
30939,
769,
26,
199,
3,
1455,
921,
6717,
14,
22943,
14,
846,
15,
6717,
15,
513,
815,
15,
888,
1113,
13,
32176,
199,
3,
5429,
1470,
12,
18453,
15293,
436,
6519,
13924,
336,
14628,
14,
421,
199,
504,
636,
2443,
363,
492,
16952,
199,
199,
646,
984,
199,
646,
747,
199,
646,
295,
199,
199,
5772,
275,
488,
199,
893,
26,
272,
492,
6365,
199,
2590,
3545,
26,
272,
327,
367,
473,
2641,
4718,
272,
986,
421,
199,
893,
26,
272,
687,
6010,
492,
17720,
63,
6610,
24,
12,
17720,
63,
6610,
975,
12,
17720,
63,
6610,
975,
63,
6773,
12,
17720,
63,
6610,
975,
63,
906,
199,
2590,
3545,
26,
272,
327,
2018,
499,
14,
18,
1630,
440,
1172,
3520,
272,
327,
9094,
13,
24,
272,
17720,
63,
6610,
24,
275,
1557,
9532,
60,
9932,
60,
9566,
7,
272,
327,
9094,
13,
975,
12,
12050,
17638,
272,
17720,
63,
6610,
975,
63,
906,
275,
1557,
3581,
60,
8371,
7,
272,
327,
9094,
13,
975,
12,
7282,
17638,
272,
17720,
63,
6610,
975,
63,
6773,
275,
1557,
8371,
60,
3581,
7,
272,
340,
984,
14,
19415,
508,
283,
10182,
356,
267,
327,
9094,
13,
975,
12,
5438,
17638,
4171,
267,
17720,
63,
6610,
975,
275,
17720,
63,
6610,
975,
63,
906,
272,
587,
26,
267,
327,
9094,
13,
975,
12,
5438,
17638,
4171,
267,
17720,
63,
6610,
975,
275,
17720,
63,
6610,
975,
63,
6773,
199,
199,
3,
437,
2600,
4412,
17720,
370,
199,
3,
314,
2644,
370,
4849,
543,
12,
436,
4052,
370,
663,
314,
199,
3,
2644,
2225,
370,
14,
199,
3973,
3053,
275,
469,
272,
17720,
63,
6610,
24,
26,
661,
1624,
63,
24,
297,
488,
395,
272,
17720,
63,
6610,
975,
63,
6773,
26,
661,
1624,
975,
63,
1235,
297,
283,
1624,
63,
975,
659,
272,
17720,
63,
6610,
975,
63,
906,
26,
661,
1624,
975,
63,
274,
297,
283,
1624,
63,
975,
659,
272,
17720,
63,
6610,
975,
26,
661,
1624,
63,
975,
297,
283,
1624,
63,
975,
659,
272,
789,
199,
3,
2900,
18393,
21169,
402,
314,
17720,
6010,
14,
199,
3,
3254,
26,
314,
769,
402,
5481,
365,
440,
18329,
370,
506,
21354,
833,
1912,
12,
365,
2337,
282,
199,
3,
257,
8034,
4340,
5805,
199,
19550,
63,
4924,
275,
469,
272,
283,
1624,
63,
975,
356,
283,
1624,
63,
975,
297,
272,
283,
85,
975,
356,
283,
1624,
63,
975,
297,
272,
283,
1624,
975,
356,
283,
1624,
63,
975,
297,
272,
283,
1624,
13,
975,
356,
283,
1624,
63,
975,
297,
272,
283,
1624,
975,
63,
1235,
356,
283,
1624,
975,
63,
1235,
297,
272,
283,
1624,
63,
975,
63,
1235,
356,
283,
1624,
975,
63,
1235,
297,
272,
283,
1624,
13,
975,
1235,
356,
283,
1624,
975,
63,
1235,
297,
272,
283,
1624,
975,
63,
274,
356,
283,
1624,
975,
63,
274,
297,
272,
283,
1624,
63,
975,
63,
274,
356,
283,
1624,
975,
63,
274,
297,
272,
283,
1624,
13,
975,
274,
356,
283,
1624,
975,
63,
274,
297,
272,
283,
1624,
63,
24,
356,
283,
1624,
63,
24,
297,
272,
283,
85,
24,
356,
283,
1624,
63,
24,
297,
272,
283,
1624,
356,
283,
1624,
63,
24,
297,
272,
283,
1624,
24,
356,
283,
1624,
63,
24,
297,
272,
283,
1624,
13,
24,
356,
283,
1624,
63,
24,
297,
272,
789,
199,
199,
3,
9672,
402,
14134,
370,
314,
17720,
370,
2218,
14,
199,
19550,
63,
3597,
275,
469,
272,
283,
1624,
63,
24,
356,
17720,
63,
6610,
24,
12,
272,
283,
1624,
63,
975,
356,
17720,
63,
6610,
975,
12,
272,
283,
1624,
975,
63,
1235,
356,
17720,
63,
6610,
975,
63,
6773,
12,
272,
283,
1624,
975,
63,
274,
356,
17720,
63,
6610,
975,
63,
906,
12,
272,
488,
26,
17720,
63,
6610,
24,
272,
789,
421,
199,
318,
1336,
63,
1624,
24,
8,
2991,
304,
272,
372,
17720,
63,
4924,
14,
362,
8,
2991,
14,
2325,
1012,
508,
283,
1624,
63,
24,
7,
421,
199,
3,
29335,
3326,
1202,
367,
3575,
1338,
199,
83,
5184,
275,
17648,
83,
4065,
199,
68,
5184,
275,
18253,
83,
4507,
199,
889,
5184,
275,
2071,
83,
2,
199,
87,
2638,
63,
6666,
275,
283,
971,
82,
60,
78,
60,
86,
60,
84,
3985,
4507,
199,
1086,
5184,
275,
283,
624,
5,
83,
624,
7,
199,
2076,
5184,
275,
298,
2344,
5,
83,
2344,
2,
199,
199,
893,
26,
272,
3874,
199,
2590,
12746,
26,
272,
347,
3874,
8,
1113,
304,
267,
408,
26318,
367,
2018,
499,
14,
18,
1041,
267,
284,
275,
446,
17,
267,
367,
1242,
315,
1559,
26,
288,
284,
847,
413,
288,
1995,
284,
12,
1242,
199,
199,
3,
428,
484,
8395,
367,
675,
315,
2519,
4882,
370,
3350,
2688,
199,
18701,
275,
909,
342,
199,
199,
363,
1023,
363,
275,
283,
20,
14,
22,
14,
16,
7,
199,
199,
363,
5792,
363,
275,
4505,
1304,
26,
1101,
1113,
14,
647,
32609,
8315,
13,
614,
13,
2192,
4329,
26,
1641,
26,
2036,
58,
24101,
1237,
2672,
7,
199,
199,
363,
21841,
363,
275,
298,
26854,
655,
2,
9948,
199,
363,
452,
363,
275,
334,
272,
2560,
1023,
7500,
272,
283,
3472,
63
] |
[
1101,
1113,
14,
647,
199,
3,
437,
1101,
570,
7002,
15,
5491,
626,
5171,
6032,
10189,
315,
1101,
1584,
14,
199,
3,
1898,
334,
35,
9,
11811,
13,
8664,
16922,
481,
79,
2181,
12,
653,
12802,
416,
491,
285,
29295,
199,
3,
662,
13,
1198,
26,
24101,
1237,
15059,
2309,
2638,
15854,
5981,
15854,
399,
75,
199,
3,
260,
302,
12802,
15059,
1565,
75,
46,
12802,
15854,
1851,
199,
199,
3,
4094,
5665,
841,
199,
3,
1455,
921,
1544,
14,
1647,
2638,
14,
1308,
14,
3210,
15,
1548,
15,
888,
1113,
14,
1360,
199,
199,
3,
17646,
68,
5420,
370,
314,
6289,
844,
199,
3,
7754,
1937,
1455,
921,
1544,
14,
1647,
2638,
14,
1308,
14,
3210,
15,
1548,
15,
1682,
14,
83,
1360,
199,
199,
3,
14914,
83,
26391,
737,
1455,
921,
1544,
14,
1647,
2638,
14,
1308,
14,
3210,
15,
1548,
15,
1080,
14,
83,
1360,
199,
3,
2104,
2556,
3595,
6519,
26205,
12,
7029,
436,
2291,
12,
8749,
4263,
314,
199,
3,
4094,
5665,
30939,
769,
26,
199,
3,
1455,
921,
6717,
14,
22943,
14,
846,
15,
6717,
15,
513,
815,
15,
888,
1113,
13,
32176,
199,
3,
5429,
1470,
12,
18453,
15293,
436,
6519,
13924,
336,
14628,
14,
421,
199,
504,
636,
2443,
363,
492,
16952,
199,
199,
646,
984,
199,
646,
747,
199,
646,
295,
199,
199,
5772,
275,
488,
199,
893,
26,
272,
492,
6365,
199,
2590,
3545,
26,
272,
327,
367,
473,
2641,
4718,
272,
986,
421,
199,
893,
26,
272,
687,
6010,
492,
17720,
63,
6610,
24,
12,
17720,
63,
6610,
975,
12,
17720,
63,
6610,
975,
63,
6773,
12,
17720,
63,
6610,
975,
63,
906,
199,
2590,
3545,
26,
272,
327,
2018,
499,
14,
18,
1630,
440,
1172,
3520,
272,
327,
9094,
13,
24,
272,
17720,
63,
6610,
24,
275,
1557,
9532,
60,
9932,
60,
9566,
7,
272,
327,
9094,
13,
975,
12,
12050,
17638,
272,
17720,
63,
6610,
975,
63,
906,
275,
1557,
3581,
60,
8371,
7,
272,
327,
9094,
13,
975,
12,
7282,
17638,
272,
17720,
63,
6610,
975,
63,
6773,
275,
1557,
8371,
60,
3581,
7,
272,
340,
984,
14,
19415,
508,
283,
10182,
356,
267,
327,
9094,
13,
975,
12,
5438,
17638,
4171,
267,
17720,
63,
6610,
975,
275,
17720,
63,
6610,
975,
63,
906,
272,
587,
26,
267,
327,
9094,
13,
975,
12,
5438,
17638,
4171,
267,
17720,
63,
6610,
975,
275,
17720,
63,
6610,
975,
63,
6773,
199,
199,
3,
437,
2600,
4412,
17720,
370,
199,
3,
314,
2644,
370,
4849,
543,
12,
436,
4052,
370,
663,
314,
199,
3,
2644,
2225,
370,
14,
199,
3973,
3053,
275,
469,
272,
17720,
63,
6610,
24,
26,
661,
1624,
63,
24,
297,
488,
395,
272,
17720,
63,
6610,
975,
63,
6773,
26,
661,
1624,
975,
63,
1235,
297,
283,
1624,
63,
975,
659,
272,
17720,
63,
6610,
975,
63,
906,
26,
661,
1624,
975,
63,
274,
297,
283,
1624,
63,
975,
659,
272,
17720,
63,
6610,
975,
26,
661,
1624,
63,
975,
297,
283,
1624,
63,
975,
659,
272,
789,
199,
3,
2900,
18393,
21169,
402,
314,
17720,
6010,
14,
199,
3,
3254,
26,
314,
769,
402,
5481,
365,
440,
18329,
370,
506,
21354,
833,
1912,
12,
365,
2337,
282,
199,
3,
257,
8034,
4340,
5805,
199,
19550,
63,
4924,
275,
469,
272,
283,
1624,
63,
975,
356,
283,
1624,
63,
975,
297,
272,
283,
85,
975,
356,
283,
1624,
63,
975,
297,
272,
283,
1624,
975,
356,
283,
1624,
63,
975,
297,
272,
283,
1624,
13,
975,
356,
283,
1624,
63,
975,
297,
272,
283,
1624,
975,
63,
1235,
356,
283,
1624,
975,
63,
1235,
297,
272,
283,
1624,
63,
975,
63,
1235,
356,
283,
1624,
975,
63,
1235,
297,
272,
283,
1624,
13,
975,
1235,
356,
283,
1624,
975,
63,
1235,
297,
272,
283,
1624,
975,
63,
274,
356,
283,
1624,
975,
63,
274,
297,
272,
283,
1624,
63,
975,
63,
274,
356,
283,
1624,
975,
63,
274,
297,
272,
283,
1624,
13,
975,
274,
356,
283,
1624,
975,
63,
274,
297,
272,
283,
1624,
63,
24,
356,
283,
1624,
63,
24,
297,
272,
283,
85,
24,
356,
283,
1624,
63,
24,
297,
272,
283,
1624,
356,
283,
1624,
63,
24,
297,
272,
283,
1624,
24,
356,
283,
1624,
63,
24,
297,
272,
283,
1624,
13,
24,
356,
283,
1624,
63,
24,
297,
272,
789,
199,
199,
3,
9672,
402,
14134,
370,
314,
17720,
370,
2218,
14,
199,
19550,
63,
3597,
275,
469,
272,
283,
1624,
63,
24,
356,
17720,
63,
6610,
24,
12,
272,
283,
1624,
63,
975,
356,
17720,
63,
6610,
975,
12,
272,
283,
1624,
975,
63,
1235,
356,
17720,
63,
6610,
975,
63,
6773,
12,
272,
283,
1624,
975,
63,
274,
356,
17720,
63,
6610,
975,
63,
906,
12,
272,
488,
26,
17720,
63,
6610,
24,
272,
789,
421,
199,
318,
1336,
63,
1624,
24,
8,
2991,
304,
272,
372,
17720,
63,
4924,
14,
362,
8,
2991,
14,
2325,
1012,
508,
283,
1624,
63,
24,
7,
421,
199,
3,
29335,
3326,
1202,
367,
3575,
1338,
199,
83,
5184,
275,
17648,
83,
4065,
199,
68,
5184,
275,
18253,
83,
4507,
199,
889,
5184,
275,
2071,
83,
2,
199,
87,
2638,
63,
6666,
275,
283,
971,
82,
60,
78,
60,
86,
60,
84,
3985,
4507,
199,
1086,
5184,
275,
283,
624,
5,
83,
624,
7,
199,
2076,
5184,
275,
298,
2344,
5,
83,
2344,
2,
199,
199,
893,
26,
272,
3874,
199,
2590,
12746,
26,
272,
347,
3874,
8,
1113,
304,
267,
408,
26318,
367,
2018,
499,
14,
18,
1041,
267,
284,
275,
446,
17,
267,
367,
1242,
315,
1559,
26,
288,
284,
847,
413,
288,
1995,
284,
12,
1242,
199,
199,
3,
428,
484,
8395,
367,
675,
315,
2519,
4882,
370,
3350,
2688,
199,
18701,
275,
909,
342,
199,
199,
363,
1023,
363,
275,
283,
20,
14,
22,
14,
16,
7,
199,
199,
363,
5792,
363,
275,
4505,
1304,
26,
1101,
1113,
14,
647,
32609,
8315,
13,
614,
13,
2192,
4329,
26,
1641,
26,
2036,
58,
24101,
1237,
2672,
7,
199,
199,
363,
21841,
363,
275,
298,
26854,
655,
2,
9948,
199,
363,
452,
363,
275,
334,
272,
2560,
1023,
7500,
272,
283,
3472,
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,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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
] |
dhutty/ansible
|
plugins/inventory/docker.py
|
132
|
12104
|
#!/usr/bin/env python
# (c) 2013, Paul Durivage <paul.durivage@gmail.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/>.
#
#
# Author: Paul Durivage <paul.durivage@gmail.com>
#
# Description:
# This module queries local or remote Docker daemons and generates
# inventory information.
#
# This plugin does not support targeting of specific hosts using the --host
# flag. Instead, it queries the Docker API for each container, running
# or not, and returns this data all once.
#
# The plugin returns the following custom attributes on Docker containers:
# docker_args
# docker_config
# docker_created
# docker_driver
# docker_exec_driver
# docker_host_config
# docker_hostname_path
# docker_hosts_path
# docker_id
# docker_image
# docker_name
# docker_network_settings
# docker_path
# docker_resolv_conf_path
# docker_state
# docker_volumes
# docker_volumes_rw
#
# Requirements:
# The docker-py module: https://github.com/dotcloud/docker-py
#
# Notes:
# A config file can be used to configure this inventory module, and there
# are several environment variables that can be set to modify the behavior
# of the plugin at runtime:
# DOCKER_CONFIG_FILE
# DOCKER_HOST
# DOCKER_VERSION
# DOCKER_TIMEOUT
# DOCKER_PRIVATE_SSH_PORT
# DOCKER_DEFAULT_IP
#
# Environment Variables:
# environment variable: DOCKER_CONFIG_FILE
# description:
# - A path to a Docker inventory hosts/defaults file in YAML format
# - A sample file has been provided, colocated with the inventory
# file called 'docker.yml'
# required: false
# default: Uses docker.docker.Client constructor defaults
# environment variable: DOCKER_HOST
# description:
# - The socket on which to connect to a Docker daemon API
# required: false
# default: Uses docker.docker.Client constructor defaults
# environment variable: DOCKER_VERSION
# description:
# - Version of the Docker API to use
# default: Uses docker.docker.Client constructor defaults
# required: false
# environment variable: DOCKER_TIMEOUT
# description:
# - Timeout in seconds for connections to Docker daemon API
# default: Uses docker.docker.Client constructor defaults
# required: false
# environment variable: DOCKER_PRIVATE_SSH_PORT
# description:
# - The private port (container port) on which SSH is listening
# for connections
# default: 22
# required: false
# environment variable: DOCKER_DEFAULT_IP
# description:
# - This environment variable overrides the container SSH connection
# IP address (aka, 'ansible_ssh_host')
#
# This option allows one to override the ansible_ssh_host whenever
# Docker has exercised its default behavior of binding private ports
# to all interfaces of the Docker host. This behavior, when dealing
# with remote Docker hosts, does not allow Ansible to determine
# a proper host IP address on which to connect via SSH to containers.
# By default, this inventory module assumes all 0.0.0.0-exposed
# ports to be bound to localhost:<port>. To override this
# behavior, for example, to bind a container's SSH port to the public
# interface of its host, one must manually set this IP.
#
# It is preferable to begin to launch Docker containers with
# ports exposed on publicly accessible IP addresses, particularly
# if the containers are to be targeted by Ansible for remote
# configuration, not accessible via localhost SSH connections.
#
# Docker containers can be explicitly exposed on IP addresses by
# a) starting the daemon with the --ip argument
# b) running containers with the -P/--publish ip::containerPort
# argument
# default: 127.0.0.1 if port exposed on 0.0.0.0 by Docker
# required: false
#
# Examples:
# Use the config file:
# DOCKER_CONFIG_FILE=./docker.yml docker.py --list
#
# Connect to docker instance on localhost port 4243
# DOCKER_HOST=tcp://localhost:4243 docker.py --list
#
# Any container's ssh port exposed on 0.0.0.0 will mapped to
# another IP address (where Ansible will attempt to connect via SSH)
# DOCKER_DEFAULT_IP=1.2.3.4 docker.py --list
import os
import sys
import json
import argparse
from UserDict import UserDict
from collections import defaultdict
import yaml
from requests import HTTPError, ConnectionError
# Manipulation of the path is needed because the docker-py
# module is imported by the name docker, and because this file
# is also named docker
for path in [os.getcwd(), '', os.path.dirname(os.path.abspath(__file__))]:
try:
del sys.path[sys.path.index(path)]
except:
pass
try:
import docker
except ImportError:
print('docker-py is required for this module')
sys.exit(1)
class HostDict(UserDict):
def __setitem__(self, key, value):
if value is not None:
self.data[key] = value
def update(self, dict=None, **kwargs):
if dict is None:
pass
elif isinstance(dict, UserDict):
for k, v in dict.data.items():
self[k] = v
else:
for k, v in dict.items():
self[k] = v
if len(kwargs):
for k, v in kwargs.items():
self[k] = v
def write_stderr(string):
sys.stderr.write('%s\n' % string)
def setup():
config = dict()
config_file = os.environ.get('DOCKER_CONFIG_FILE')
if config_file:
try:
config_file = os.path.abspath(config_file)
except Exception as e:
write_stderr(e)
sys.exit(1)
with open(config_file) as f:
try:
config = yaml.safe_load(f.read())
except Exception as e:
write_stderr(e)
sys.exit(1)
# Environment Variables
env_base_url = os.environ.get('DOCKER_HOST')
env_version = os.environ.get('DOCKER_VERSION')
env_timeout = os.environ.get('DOCKER_TIMEOUT')
env_ssh_port = os.environ.get('DOCKER_PRIVATE_SSH_PORT', '22')
env_default_ip = os.environ.get('DOCKER_DEFAULT_IP', '127.0.0.1')
# Config file defaults
defaults = config.get('defaults', dict())
def_host = defaults.get('host')
def_version = defaults.get('version')
def_timeout = defaults.get('timeout')
def_default_ip = defaults.get('default_ip')
def_ssh_port = defaults.get('private_ssh_port')
hosts = list()
if config:
hosts_list = config.get('hosts', list())
# Look to the config file's defined hosts
if hosts_list:
for host in hosts_list:
baseurl = host.get('host') or def_host or env_base_url
version = host.get('version') or def_version or env_version
timeout = host.get('timeout') or def_timeout or env_timeout
default_ip = host.get('default_ip') or def_default_ip or env_default_ip
ssh_port = host.get('private_ssh_port') or def_ssh_port or env_ssh_port
hostdict = HostDict(
base_url=baseurl,
version=version,
timeout=timeout,
default_ip=default_ip,
private_ssh_port=ssh_port,
)
hosts.append(hostdict)
# Look to the defaults
else:
hostdict = HostDict(
base_url=def_host,
version=def_version,
timeout=def_timeout,
default_ip=def_default_ip,
private_ssh_port=def_ssh_port,
)
hosts.append(hostdict)
# Look to the environment
else:
hostdict = HostDict(
base_url=env_base_url,
version=env_version,
timeout=env_timeout,
default_ip=env_default_ip,
private_ssh_port=env_ssh_port,
)
hosts.append(hostdict)
return hosts
def list_groups():
hosts = setup()
groups = defaultdict(list)
hostvars = defaultdict(dict)
for host in hosts:
ssh_port = host.pop('private_ssh_port', None)
default_ip = host.pop('default_ip', None)
hostname = host.get('base_url')
try:
client = docker.Client(**host)
containers = client.containers(all=True)
except (HTTPError, ConnectionError) as e:
write_stderr(e)
sys.exit(1)
for container in containers:
id = container.get('Id')
short_id = id[:13]
try:
name = container.get('Names', list()).pop(0).lstrip('/')
except IndexError:
name = short_id
if not id:
continue
inspect = client.inspect_container(id)
running = inspect.get('State', dict()).get('Running')
groups[id].append(name)
groups[name].append(name)
if not short_id in groups.keys():
groups[short_id].append(name)
groups[hostname].append(name)
if running is True:
groups['running'].append(name)
else:
groups['stopped'].append(name)
try:
port = client.port(container, ssh_port)[0]
except (IndexError, AttributeError, TypeError):
port = dict()
try:
ip = default_ip if port['HostIp'] == '0.0.0.0' else port['HostIp']
except KeyError:
ip = ''
container_info = dict(
ansible_ssh_host=ip,
ansible_ssh_port=port.get('HostPort', int()),
docker_args=inspect.get('Args'),
docker_config=inspect.get('Config'),
docker_created=inspect.get('Created'),
docker_driver=inspect.get('Driver'),
docker_exec_driver=inspect.get('ExecDriver'),
docker_host_config=inspect.get('HostConfig'),
docker_hostname_path=inspect.get('HostnamePath'),
docker_hosts_path=inspect.get('HostsPath'),
docker_id=inspect.get('ID'),
docker_image=inspect.get('Image'),
docker_name=name,
docker_network_settings=inspect.get('NetworkSettings'),
docker_path=inspect.get('Path'),
docker_resolv_conf_path=inspect.get('ResolvConfPath'),
docker_state=inspect.get('State'),
docker_volumes=inspect.get('Volumes'),
docker_volumes_rw=inspect.get('VolumesRW'),
)
hostvars[name].update(container_info)
groups['docker_hosts'] = [host.get('base_url') for host in hosts]
groups['_meta'] = dict()
groups['_meta']['hostvars'] = hostvars
print json.dumps(groups, sort_keys=True, indent=4)
sys.exit(0)
def parse_args():
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--list', action='store_true')
group.add_argument('--host', action='store_true')
return parser.parse_args()
def main():
args = parse_args()
if args.list:
list_groups()
elif args.host:
write_stderr('This option is not supported.')
sys.exit(1)
sys.exit(0)
main()
|
gpl-3.0
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
199,
3,
334,
67,
9,
6171,
12,
28574,
577,
300,
1003,
474,
665,
387,
348,
14,
30695,
1003,
474,
32,
6799,
14,
957,
30,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
2622,
14,
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,
3,
199,
3,
6529,
26,
28574,
577,
300,
1003,
474,
665,
387,
348,
14,
30695,
1003,
474,
32,
6799,
14,
957,
30,
199,
3,
199,
3,
11994,
26,
199,
3,
961,
859,
9212,
2257,
503,
3982,
22067,
11128,
83,
436,
12821,
199,
3,
8200,
2556,
14,
199,
3,
199,
3,
961,
3589,
1630,
440,
2291,
1347,
316,
402,
2488,
7057,
1808,
314,
1553,
1102,
199,
3,
3305,
14,
15345,
12,
652,
9212,
314,
22067,
3261,
367,
1924,
3970,
12,
3879,
199,
3,
503,
440,
12,
436,
2529,
642,
666,
1006,
5403,
14,
199,
3,
199,
3,
710,
3589,
2529,
314,
2569,
3537,
3004,
641,
22067,
15333,
26,
199,
3,
259,
12424,
63,
589,
199,
3,
259,
12424,
63,
888,
199,
3,
259,
12424,
63,
3966,
199,
3,
259,
12424,
63,
3090,
199,
3,
259,
12424,
63,
1628,
63,
3090,
199,
3,
259,
12424,
63,
1102,
63,
888,
199,
3,
259,
12424,
63,
4269,
63,
515,
199,
3,
259,
12424,
63,
5146,
63,
515,
199,
3,
259,
12424,
63,
344,
199,
3,
259,
12424,
63,
1569,
199,
3,
259,
12424,
63,
354,
199,
3,
259,
12424,
63,
1200,
63,
1751,
199,
3,
259,
12424,
63,
515,
199,
3,
259,
12424,
63,
26702,
86,
63,
2190,
63,
515,
199,
3,
259,
12424,
63,
929,
199,
3,
259,
12424,
63,
8838,
199,
3,
259,
12424,
63,
8838,
63,
13057,
199,
3,
199,
3,
18513,
1470,
26,
199,
3,
710,
12424,
13,
647,
859,
26,
4178,
921,
5031,
14,
957,
15,
3287,
4091,
15,
9991,
13,
647,
199,
3,
199,
3,
8144,
26,
199,
3,
437,
1101,
570,
883,
506,
1202,
370,
7908,
642,
8200,
859,
12,
436,
2337,
199,
3,
787,
9978,
3734,
2860,
626,
883,
506,
663,
370,
2811,
314,
5953,
199,
3,
402,
314,
3589,
737,
8836,
26,
199,
3,
259,
3506,
2504,
540,
63,
5569,
63,
3817,
199,
3,
259,
3506,
2504,
540,
63,
5449,
199,
3,
259,
3506,
2504,
540,
63,
4612,
199,
3,
259,
3506,
2504,
540,
63,
8899,
199,
3,
259,
3506,
2504,
540,
63,
18748,
63,
13716,
63,
3657,
199,
3,
259,
3506,
2504,
540,
63,
3472,
63,
1772,
199,
3,
199,
3,
9711,
17198,
26,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
5569,
63,
3817,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
437,
931,
370,
282,
22067,
8200,
7057,
15,
4322,
570,
315,
18916,
1475,
199,
3,
260,
446,
437,
2690,
570,
965,
2757,
2741,
12,
512,
13340,
543,
314,
8200,
199,
3,
3698,
570,
2797,
283,
9991,
14,
11714,
7,
199,
3,
258,
1415,
26,
3055,
199,
3,
258,
849,
26,
14911,
12424,
14,
9991,
14,
3041,
3787,
4243,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
5449,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
710,
2838,
641,
1314,
370,
4907,
370,
282,
22067,
11128,
3261,
199,
3,
258,
1415,
26,
3055,
199,
3,
258,
849,
26,
14911,
12424,
14,
9991,
14,
3041,
3787,
4243,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
4612,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
3394,
402,
314,
22067,
3261,
370,
675,
199,
3,
258,
849,
26,
14911,
12424,
14,
9991,
14,
3041,
3787,
4243,
199,
3,
258,
1415,
26,
3055,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
8899,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
12878,
315,
4696,
367,
6947,
370,
22067,
11128,
3261,
199,
3,
258,
849,
26,
14911,
12424,
14,
9991,
14,
3041,
3787,
4243,
199,
3,
258,
1415,
26,
3055,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
18748,
63,
13716,
63,
3657,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
710,
5726,
1844,
334,
3600,
1844,
9,
641,
1314,
12027,
365,
22721,
199,
3,
3698,
367,
6947,
199,
3,
258,
849,
26,
6928,
199,
3,
258,
1415,
26,
3055,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
3472,
63,
1772,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
961,
3734,
1750,
10580,
314,
3970,
12027,
1950,
199,
3,
3698,
3531,
2287,
334,
24685,
12,
283,
4853,
63,
5510,
63,
1102,
358,
199,
3,
199,
3,
3698,
961,
945,
6127,
1373,
370,
4278,
314,
3242,
63,
5510,
63,
1102,
18119,
199,
3,
3698,
22067,
965,
444,
281,
559,
939,
2399,
849,
5953,
402,
11696,
5726,
8873,
199,
3,
3698,
370,
1006,
8386,
402,
314,
22067,
1591,
14,
221,
961,
5953,
12,
1380,
23654,
199,
3,
3698,
543,
3982,
22067,
7057,
12,
1630,
440,
2040,
2622,
370,
6705,
199,
3,
3698,
282,
5576,
1591,
3531,
2287,
641,
1314,
370,
4907,
4799,
12027,
370,
15333,
14,
199,
3,
3698,
4885,
849,
12,
642,
8200,
859,
15194,
1006,
378,
14,
16,
14,
16,
14,
16,
13,
26717,
199,
3,
3698,
8873,
370,
506,
3914,
370,
11667,
16875,
719,
10827,
221,
4005,
4278,
642,
199,
3,
3698,
5953,
12,
367,
2893,
12,
370,
5398,
282,
3970,
1159,
12027,
1844,
370,
314,
4575,
199,
3,
3698,
3217,
402,
2399,
1591,
12,
1373,
1471,
10250,
663,
642,
3531,
14,
199,
3,
199
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
199,
3,
334,
67,
9,
6171,
12,
28574,
577,
300,
1003,
474,
665,
387,
348,
14,
30695,
1003,
474,
32,
6799,
14,
957,
30,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
2622,
14,
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,
3,
199,
3,
6529,
26,
28574,
577,
300,
1003,
474,
665,
387,
348,
14,
30695,
1003,
474,
32,
6799,
14,
957,
30,
199,
3,
199,
3,
11994,
26,
199,
3,
961,
859,
9212,
2257,
503,
3982,
22067,
11128,
83,
436,
12821,
199,
3,
8200,
2556,
14,
199,
3,
199,
3,
961,
3589,
1630,
440,
2291,
1347,
316,
402,
2488,
7057,
1808,
314,
1553,
1102,
199,
3,
3305,
14,
15345,
12,
652,
9212,
314,
22067,
3261,
367,
1924,
3970,
12,
3879,
199,
3,
503,
440,
12,
436,
2529,
642,
666,
1006,
5403,
14,
199,
3,
199,
3,
710,
3589,
2529,
314,
2569,
3537,
3004,
641,
22067,
15333,
26,
199,
3,
259,
12424,
63,
589,
199,
3,
259,
12424,
63,
888,
199,
3,
259,
12424,
63,
3966,
199,
3,
259,
12424,
63,
3090,
199,
3,
259,
12424,
63,
1628,
63,
3090,
199,
3,
259,
12424,
63,
1102,
63,
888,
199,
3,
259,
12424,
63,
4269,
63,
515,
199,
3,
259,
12424,
63,
5146,
63,
515,
199,
3,
259,
12424,
63,
344,
199,
3,
259,
12424,
63,
1569,
199,
3,
259,
12424,
63,
354,
199,
3,
259,
12424,
63,
1200,
63,
1751,
199,
3,
259,
12424,
63,
515,
199,
3,
259,
12424,
63,
26702,
86,
63,
2190,
63,
515,
199,
3,
259,
12424,
63,
929,
199,
3,
259,
12424,
63,
8838,
199,
3,
259,
12424,
63,
8838,
63,
13057,
199,
3,
199,
3,
18513,
1470,
26,
199,
3,
710,
12424,
13,
647,
859,
26,
4178,
921,
5031,
14,
957,
15,
3287,
4091,
15,
9991,
13,
647,
199,
3,
199,
3,
8144,
26,
199,
3,
437,
1101,
570,
883,
506,
1202,
370,
7908,
642,
8200,
859,
12,
436,
2337,
199,
3,
787,
9978,
3734,
2860,
626,
883,
506,
663,
370,
2811,
314,
5953,
199,
3,
402,
314,
3589,
737,
8836,
26,
199,
3,
259,
3506,
2504,
540,
63,
5569,
63,
3817,
199,
3,
259,
3506,
2504,
540,
63,
5449,
199,
3,
259,
3506,
2504,
540,
63,
4612,
199,
3,
259,
3506,
2504,
540,
63,
8899,
199,
3,
259,
3506,
2504,
540,
63,
18748,
63,
13716,
63,
3657,
199,
3,
259,
3506,
2504,
540,
63,
3472,
63,
1772,
199,
3,
199,
3,
9711,
17198,
26,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
5569,
63,
3817,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
437,
931,
370,
282,
22067,
8200,
7057,
15,
4322,
570,
315,
18916,
1475,
199,
3,
260,
446,
437,
2690,
570,
965,
2757,
2741,
12,
512,
13340,
543,
314,
8200,
199,
3,
3698,
570,
2797,
283,
9991,
14,
11714,
7,
199,
3,
258,
1415,
26,
3055,
199,
3,
258,
849,
26,
14911,
12424,
14,
9991,
14,
3041,
3787,
4243,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
5449,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
710,
2838,
641,
1314,
370,
4907,
370,
282,
22067,
11128,
3261,
199,
3,
258,
1415,
26,
3055,
199,
3,
258,
849,
26,
14911,
12424,
14,
9991,
14,
3041,
3787,
4243,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
4612,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
3394,
402,
314,
22067,
3261,
370,
675,
199,
3,
258,
849,
26,
14911,
12424,
14,
9991,
14,
3041,
3787,
4243,
199,
3,
258,
1415,
26,
3055,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
8899,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
12878,
315,
4696,
367,
6947,
370,
22067,
11128,
3261,
199,
3,
258,
849,
26,
14911,
12424,
14,
9991,
14,
3041,
3787,
4243,
199,
3,
258,
1415,
26,
3055,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
18748,
63,
13716,
63,
3657,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
710,
5726,
1844,
334,
3600,
1844,
9,
641,
1314,
12027,
365,
22721,
199,
3,
3698,
367,
6947,
199,
3,
258,
849,
26,
6928,
199,
3,
258,
1415,
26,
3055,
199,
3,
3734,
1750,
26,
3506,
2504,
540,
63,
3472,
63,
1772,
199,
3,
258,
1369,
26,
199,
3,
260,
446,
961,
3734,
1750,
10580,
314,
3970,
12027,
1950,
199,
3,
3698,
3531,
2287,
334,
24685,
12,
283,
4853,
63,
5510,
63,
1102,
358,
199,
3,
199,
3,
3698,
961,
945,
6127,
1373,
370,
4278,
314,
3242,
63,
5510,
63,
1102,
18119,
199,
3,
3698,
22067,
965,
444,
281,
559,
939,
2399,
849,
5953,
402,
11696,
5726,
8873,
199,
3,
3698,
370,
1006,
8386,
402,
314,
22067,
1591,
14,
221,
961,
5953,
12,
1380,
23654,
199,
3,
3698,
543,
3982,
22067,
7057,
12,
1630,
440,
2040,
2622,
370,
6705,
199,
3,
3698,
282,
5576,
1591,
3531,
2287,
641,
1314,
370,
4907,
4799,
12027,
370,
15333,
14,
199,
3,
3698,
4885,
849,
12,
642,
8200,
859,
15194,
1006,
378,
14,
16,
14,
16,
14,
16,
13,
26717,
199,
3,
3698,
8873,
370,
506,
3914,
370,
11667,
16875,
719,
10827,
221,
4005,
4278,
642,
199,
3,
3698,
5953,
12,
367,
2893,
12,
370,
5398,
282,
3970,
1159,
12027,
1844,
370,
314,
4575,
199,
3,
3698,
3217,
402,
2399,
1591,
12,
1373,
1471,
10250,
663,
642,
3531,
14,
199,
3,
199,
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,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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
] |
kernow/ansible-modules-core
|
system/setup.py
|
40
|
5577
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.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/>.
DOCUMENTATION = '''
---
module: setup
version_added: historical
short_description: Gathers facts about remote hosts
options:
gather_subset:
version_added: "2.1"
description:
- "if supplied, restrict the additional facts collected to the given subset.
Possible values: all, hardware, network, virtual, ohai, and
facter Can specify a list of values to specify a larger subset.
Values can also be used with an initial C(!) to specify that
that specific subset should not be collected. For instance:
!hardware, !network, !virtual, !ohai, !facter. Note that a few
facts are always collected. Use the filter parameter if you do
not want to display those."
required: false
default: 'all'
gather_timeout:
version_added: "2.2"
description:
- "Set the default timeout in seconds for individual fact gathering"
required: false
default: 10
filter:
version_added: "1.1"
description:
- if supplied, only return facts that match this shell-style (fnmatch) wildcard.
required: false
default: '*'
fact_path:
version_added: "1.3"
description:
- path used for local ansible facts (*.fact) - files in this dir
will be run (if executable) and their results be added to ansible_local facts
if a file is not executable it is read. Check notes for Windows options. (from 2.1 on)
File/results format can be json or ini-format
required: false
default: '/etc/ansible/facts.d'
description:
- This module is automatically called by playbooks to gather useful
variables about remote hosts that can be used in playbooks. It can also be
executed directly by C(/usr/bin/ansible) to check what variables are
available to a host. Ansible provides many I(facts) about the system,
automatically.
notes:
- More ansible facts will be added with successive releases. If I(facter) or
I(ohai) are installed, variables from these programs will also be snapshotted
into the JSON file for usage in templating. These variables are prefixed
with C(facter_) and C(ohai_) so it's easy to tell their source. All variables are
bubbled up to the caller. Using the ansible facts and choosing to not
install I(facter) and I(ohai) means you can avoid Ruby-dependencies on your
remote systems. (See also M(facter) and M(ohai).)
- The filter option filters only the first level subkey below ansible_facts.
- If the target host is Windows, you will not currently have the ability to use
C(filter) as this is provided by a simpler implementation of the module.
- If the target host is Windows you can now use C(fact_path). Make sure that this path
exists on the target host. Files in this path MUST be PowerShell scripts (``*.ps1``) and
their output must be formattable in JSON (Ansible will take care of this). Test the
output of your scripts.
This option was added in Ansible 2.1.
author:
- "Ansible Core Team"
- "Michael DeHaan"
- "David O'Brien @david_obrien davidobrien1985"
'''
EXAMPLES = """
# Display facts from all hosts and store them indexed by I(hostname) at C(/tmp/facts).
ansible all -m setup --tree /tmp/facts
# Display only facts regarding memory found by ansible on all hosts and output them.
ansible all -m setup -a 'filter=ansible_*_mb'
# Display only facts returned by facter.
ansible all -m setup -a 'filter=facter_*'
# Display only facts about certain interfaces.
ansible all -m setup -a 'filter=ansible_eth[0-2]'
# Restrict additional gathered facts to network and virtual.
ansible all -m setup -a 'gather_subset=network,virtual'
# Do not call puppet facter or ohai even if present.
ansible all -m setup -a 'gather_subset=!facter,!ohai'
# Only collect the minimum amount of facts:
ansible all -m setup -a 'gather_subset=!all'
# Display facts from Windows hosts with custom facts stored in C(C:\\custom_facts).
ansible windows -m setup -a "fact_path='c:\\custom_facts'"
"""
def main():
module = AnsibleModule(
argument_spec = dict(
gather_subset=dict(default=["all"], required=False, type='list'),
gather_timeout=dict(default=10, required=False, type='int'),
filter=dict(default="*", required=False),
fact_path=dict(default='/etc/ansible/facts.d', required=False),
),
supports_check_mode = True,
)
data = get_all_facts(module)
module.exit_json(**data)
# import module snippets
from ansible.module_utils.basic import *
from ansible.module_utils.facts import *
if __name__ == '__main__':
main()
|
gpl-3.0
|
[
3381,
2647,
15,
1393,
15,
1548,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
334,
67,
9,
6029,
12,
16922,
22453,
665,
22333,
14,
24247,
32,
6799,
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,
8948,
275,
1449,
199,
2595,
199,
578,
26,
3272,
199,
1023,
63,
3270,
26,
32530,
199,
3612,
63,
1802,
26,
19634,
83,
9036,
3595,
3982,
7057,
199,
1419,
26,
272,
13082,
63,
9401,
26,
267,
1015,
63,
3270,
26,
298,
18,
14,
17,
2,
267,
1369,
26,
288,
446,
298,
692,
6841,
12,
18152,
314,
4722,
9036,
13736,
370,
314,
1627,
10026,
14,
1598,
18558,
1338,
26,
1006,
12,
14991,
12,
2784,
12,
5791,
12,
312,
17945,
12,
436,
1598,
289,
6747,
6855,
4165,
282,
769,
402,
1338,
370,
4165,
282,
12142,
10026,
14,
1598,
13468,
883,
2597,
506,
1202,
543,
376,
2536,
445,
8,
21866,
370,
4165,
626,
1598,
626,
2488,
10026,
1077,
440,
506,
13736,
14,
221,
2104,
1256,
26,
1598,
8546,
16529,
12,
8546,
1200,
12,
8546,
2065,
12,
8546,
79,
17945,
12,
8546,
70,
6747,
14,
221,
3390,
626,
282,
9284,
1598,
9036,
787,
3544,
13736,
14,
221,
3645,
314,
2457,
2725,
340,
1265,
886,
1598,
440,
2934,
370,
2929,
5204,
2122,
267,
1415,
26,
3055,
267,
849,
26,
283,
452,
7,
272,
13082,
63,
2593,
26,
267,
1015,
63,
3270,
26,
298,
18,
14,
18,
2,
267,
1369,
26,
288,
446,
298,
1084,
314,
849,
2653,
315,
4696,
367,
8212,
10572,
13082,
316,
2,
267,
1415,
26,
3055,
267,
849,
26,
1616,
272,
2457,
26,
267,
1015,
63,
3270,
26,
298,
17,
14,
17,
2,
267,
1369,
26,
288,
446,
340,
6841,
12,
1454,
372,
9036,
626,
1336,
642,
5218,
13,
2487,
334,
15359,
9,
16792,
14,
267,
1415,
26,
3055,
267,
849,
26,
13626,
272,
10572,
63,
515,
26,
267,
1015,
63,
3270,
26,
298,
17,
14,
19,
2,
267,
1369,
26,
288,
446,
931,
1202,
367,
2257,
3242,
9036,
334,
4856,
7783,
9,
446,
1584,
315,
642,
2935,
1598,
911,
506,
1255,
334,
692,
7286,
9,
436,
3932,
2058,
506,
3483,
370,
3242,
63,
1832,
9036,
1598,
340,
282,
570,
365,
440,
7286,
652,
365,
1586,
14,
2670,
12681,
367,
5417,
1511,
14,
334,
504,
499,
14,
17,
641,
9,
1598,
3814,
15,
2604,
1475,
883,
506,
2022,
503,
20364,
13,
908,
267,
1415,
26,
3055,
267,
849,
26,
1994,
6839,
15,
4853,
15,
5047,
14,
68,
7,
199,
1802,
26,
1362,
446,
961,
859,
365,
5847,
2797,
701,
5232,
8858,
370,
13082,
2997,
2126,
2860,
3595,
3982,
7057,
626,
883,
506,
1202,
315,
5232,
8858,
14,
2779,
883,
2597,
506,
2126,
7934,
5370,
701,
445,
29478,
2647,
15,
1393,
15,
4853,
9,
370,
1104,
4052,
2860,
787,
2126,
2808,
370,
282,
1591,
14,
2622,
6571,
5002,
473,
8,
5047,
9,
3595,
314,
2656,
12,
2126,
5847,
14,
199,
5983,
26,
272,
446,
16917,
3242,
9036,
911,
506,
3483,
543,
27028,
3398,
19015,
14,
982,
473,
8,
70,
6747,
9,
503,
489,
473,
8,
79,
17945,
9,
787,
4903,
12,
2860,
687,
3520,
18572,
911,
2597,
506,
5740,
471,
489,
1901,
314,
4840,
570,
367,
4503,
315,
2388,
24615,
14,
5723,
2860,
787,
18239,
489,
543,
445,
8,
70,
6747,
4602,
436,
445,
8,
79,
17945,
4602,
880,
652,
1159,
8837,
370,
11480,
3932,
1350,
14,
2900,
2860,
787,
489,
330,
21749,
68,
1536,
370,
314,
8025,
14,
11719,
314,
3242,
9036,
436,
2468,
26056,
370,
440,
489,
3907,
473,
8,
70,
6747,
9,
436,
473,
8,
79,
17945,
9,
4910,
1265,
883,
5126,
820,
10972,
13,
5714,
641,
2195,
489,
3982,
10460,
14,
334,
9295,
2597,
603,
8,
70,
6747,
9,
436,
603,
8,
79,
17945,
680,
9,
272,
446,
710,
2457,
945,
4766,
1454,
314,
1642,
2166,
1007,
498,
5084,
3242,
63,
5047,
14,
272,
446,
982,
314,
1347,
1591,
365,
5417,
12,
1265,
911,
440,
5544,
1172,
314,
21255,
370,
675,
489,
445,
8,
1541,
9,
465,
642,
365,
2741,
701,
282,
28293,
4514,
402,
314,
859,
14,
272,
446,
982,
314,
1347,
1591,
365,
5417,
1265,
883,
3063,
675,
445,
8,
7783,
63,
515,
680,
4155,
3238,
626,
642,
931,
15166,
3495,
641,
314,
1347,
1591,
14,
16920,
315,
642,
931,
18095,
506,
18879,
8529,
10554,
15693,
4856,
1190,
17,
16580,
436,
15166,
3932,
1072,
1471,
506,
1475,
1224,
315,
4840,
334,
10047,
911,
5452,
10296,
402,
642,
680,
1379,
314,
15166,
1072,
402,
2195,
10554,
14,
489,
961,
945,
1990,
3483,
315,
2622,
499,
14,
17,
14,
199,
2502,
26,
272,
446,
298,
10047,
11672,
11682,
2,
272,
446,
298,
45,
11781,
22453,
2,
272,
446,
298,
36,
17204,
593,
7,
34,
322,
287,
768,
983,
5017,
63,
2873,
322,
287,
366,
17204,
2873,
322,
287,
1167,
2426,
2,
199,
2344,
199,
199,
8918,
275,
408,
199,
3,
12175,
9036,
687,
1006,
7057,
436,
3877,
3062,
15235,
701,
473,
8,
4269,
9,
737,
445,
29478,
2791,
15,
5047,
680,
199,
4853,
1006,
446,
77,
3272,
1553,
2350,
1182,
2791,
15,
5047,
199,
199,
3,
12175,
1454,
9036,
12602,
4402,
1911,
701,
3242,
641,
1006,
7057,
436,
1072,
3062,
14,
199,
4853,
1006,
446,
77,
3272,
446,
65,
283,
1541,
29,
4853,
15192,
63,
887,
7,
199,
199,
3
] |
[
2647,
15,
1393,
15,
1548,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
334,
67,
9,
6029,
12,
16922,
22453,
665,
22333,
14,
24247,
32,
6799,
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,
8948,
275,
1449,
199,
2595,
199,
578,
26,
3272,
199,
1023,
63,
3270,
26,
32530,
199,
3612,
63,
1802,
26,
19634,
83,
9036,
3595,
3982,
7057,
199,
1419,
26,
272,
13082,
63,
9401,
26,
267,
1015,
63,
3270,
26,
298,
18,
14,
17,
2,
267,
1369,
26,
288,
446,
298,
692,
6841,
12,
18152,
314,
4722,
9036,
13736,
370,
314,
1627,
10026,
14,
1598,
18558,
1338,
26,
1006,
12,
14991,
12,
2784,
12,
5791,
12,
312,
17945,
12,
436,
1598,
289,
6747,
6855,
4165,
282,
769,
402,
1338,
370,
4165,
282,
12142,
10026,
14,
1598,
13468,
883,
2597,
506,
1202,
543,
376,
2536,
445,
8,
21866,
370,
4165,
626,
1598,
626,
2488,
10026,
1077,
440,
506,
13736,
14,
221,
2104,
1256,
26,
1598,
8546,
16529,
12,
8546,
1200,
12,
8546,
2065,
12,
8546,
79,
17945,
12,
8546,
70,
6747,
14,
221,
3390,
626,
282,
9284,
1598,
9036,
787,
3544,
13736,
14,
221,
3645,
314,
2457,
2725,
340,
1265,
886,
1598,
440,
2934,
370,
2929,
5204,
2122,
267,
1415,
26,
3055,
267,
849,
26,
283,
452,
7,
272,
13082,
63,
2593,
26,
267,
1015,
63,
3270,
26,
298,
18,
14,
18,
2,
267,
1369,
26,
288,
446,
298,
1084,
314,
849,
2653,
315,
4696,
367,
8212,
10572,
13082,
316,
2,
267,
1415,
26,
3055,
267,
849,
26,
1616,
272,
2457,
26,
267,
1015,
63,
3270,
26,
298,
17,
14,
17,
2,
267,
1369,
26,
288,
446,
340,
6841,
12,
1454,
372,
9036,
626,
1336,
642,
5218,
13,
2487,
334,
15359,
9,
16792,
14,
267,
1415,
26,
3055,
267,
849,
26,
13626,
272,
10572,
63,
515,
26,
267,
1015,
63,
3270,
26,
298,
17,
14,
19,
2,
267,
1369,
26,
288,
446,
931,
1202,
367,
2257,
3242,
9036,
334,
4856,
7783,
9,
446,
1584,
315,
642,
2935,
1598,
911,
506,
1255,
334,
692,
7286,
9,
436,
3932,
2058,
506,
3483,
370,
3242,
63,
1832,
9036,
1598,
340,
282,
570,
365,
440,
7286,
652,
365,
1586,
14,
2670,
12681,
367,
5417,
1511,
14,
334,
504,
499,
14,
17,
641,
9,
1598,
3814,
15,
2604,
1475,
883,
506,
2022,
503,
20364,
13,
908,
267,
1415,
26,
3055,
267,
849,
26,
1994,
6839,
15,
4853,
15,
5047,
14,
68,
7,
199,
1802,
26,
1362,
446,
961,
859,
365,
5847,
2797,
701,
5232,
8858,
370,
13082,
2997,
2126,
2860,
3595,
3982,
7057,
626,
883,
506,
1202,
315,
5232,
8858,
14,
2779,
883,
2597,
506,
2126,
7934,
5370,
701,
445,
29478,
2647,
15,
1393,
15,
4853,
9,
370,
1104,
4052,
2860,
787,
2126,
2808,
370,
282,
1591,
14,
2622,
6571,
5002,
473,
8,
5047,
9,
3595,
314,
2656,
12,
2126,
5847,
14,
199,
5983,
26,
272,
446,
16917,
3242,
9036,
911,
506,
3483,
543,
27028,
3398,
19015,
14,
982,
473,
8,
70,
6747,
9,
503,
489,
473,
8,
79,
17945,
9,
787,
4903,
12,
2860,
687,
3520,
18572,
911,
2597,
506,
5740,
471,
489,
1901,
314,
4840,
570,
367,
4503,
315,
2388,
24615,
14,
5723,
2860,
787,
18239,
489,
543,
445,
8,
70,
6747,
4602,
436,
445,
8,
79,
17945,
4602,
880,
652,
1159,
8837,
370,
11480,
3932,
1350,
14,
2900,
2860,
787,
489,
330,
21749,
68,
1536,
370,
314,
8025,
14,
11719,
314,
3242,
9036,
436,
2468,
26056,
370,
440,
489,
3907,
473,
8,
70,
6747,
9,
436,
473,
8,
79,
17945,
9,
4910,
1265,
883,
5126,
820,
10972,
13,
5714,
641,
2195,
489,
3982,
10460,
14,
334,
9295,
2597,
603,
8,
70,
6747,
9,
436,
603,
8,
79,
17945,
680,
9,
272,
446,
710,
2457,
945,
4766,
1454,
314,
1642,
2166,
1007,
498,
5084,
3242,
63,
5047,
14,
272,
446,
982,
314,
1347,
1591,
365,
5417,
12,
1265,
911,
440,
5544,
1172,
314,
21255,
370,
675,
489,
445,
8,
1541,
9,
465,
642,
365,
2741,
701,
282,
28293,
4514,
402,
314,
859,
14,
272,
446,
982,
314,
1347,
1591,
365,
5417,
1265,
883,
3063,
675,
445,
8,
7783,
63,
515,
680,
4155,
3238,
626,
642,
931,
15166,
3495,
641,
314,
1347,
1591,
14,
16920,
315,
642,
931,
18095,
506,
18879,
8529,
10554,
15693,
4856,
1190,
17,
16580,
436,
15166,
3932,
1072,
1471,
506,
1475,
1224,
315,
4840,
334,
10047,
911,
5452,
10296,
402,
642,
680,
1379,
314,
15166,
1072,
402,
2195,
10554,
14,
489,
961,
945,
1990,
3483,
315,
2622,
499,
14,
17,
14,
199,
2502,
26,
272,
446,
298,
10047,
11672,
11682,
2,
272,
446,
298,
45,
11781,
22453,
2,
272,
446,
298,
36,
17204,
593,
7,
34,
322,
287,
768,
983,
5017,
63,
2873,
322,
287,
366,
17204,
2873,
322,
287,
1167,
2426,
2,
199,
2344,
199,
199,
8918,
275,
408,
199,
3,
12175,
9036,
687,
1006,
7057,
436,
3877,
3062,
15235,
701,
473,
8,
4269,
9,
737,
445,
29478,
2791,
15,
5047,
680,
199,
4853,
1006,
446,
77,
3272,
1553,
2350,
1182,
2791,
15,
5047,
199,
199,
3,
12175,
1454,
9036,
12602,
4402,
1911,
701,
3242,
641,
1006,
7057,
436,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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
] |
alexlo03/ansible
|
lib/ansible/modules/cloud/rackspace/rax_mon_check.py
|
77
|
10762
|
#!/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: rax_mon_check
short_description: Create or delete a Rackspace Cloud Monitoring check for an
existing entity.
description:
- Create or delete a Rackspace Cloud Monitoring check associated with an
existing rax_mon_entity. A check is a specific test or measurement that is
performed, possibly from different monitoring zones, on the systems you
monitor. Rackspace monitoring module flow | rax_mon_entity ->
*rax_mon_check* -> rax_mon_notification -> rax_mon_notification_plan ->
rax_mon_alarm
version_added: "2.0"
options:
state:
description:
- Ensure that a check with this C(label) exists or does not exist.
choices: ["present", "absent"]
entity_id:
description:
- ID of the rax_mon_entity to target with this check.
required: true
label:
description:
- Defines a label for this check, between 1 and 64 characters long.
required: true
check_type:
description:
- The type of check to create. C(remote.) checks may be created on any
rax_mon_entity. C(agent.) checks may only be created on rax_mon_entities
that have a non-null C(agent_id).
choices:
- remote.dns
- remote.ftp-banner
- remote.http
- remote.imap-banner
- remote.mssql-banner
- remote.mysql-banner
- remote.ping
- remote.pop3-banner
- remote.postgresql-banner
- remote.smtp-banner
- remote.smtp
- remote.ssh
- remote.tcp
- remote.telnet-banner
- agent.filesystem
- agent.memory
- agent.load_average
- agent.cpu
- agent.disk
- agent.network
- agent.plugin
required: true
monitoring_zones_poll:
description:
- Comma-separated list of the names of the monitoring zones the check should
run from. Available monitoring zones include mzdfw, mzhkg, mziad, mzlon,
mzord and mzsyd. Required for remote.* checks; prohibited for agent.* checks.
target_hostname:
description:
- One of `target_hostname` and `target_alias` is required for remote.* checks,
but prohibited for agent.* checks. The hostname this check should target.
Must be a valid IPv4, IPv6, or FQDN.
target_alias:
description:
- One of `target_alias` and `target_hostname` is required for remote.* checks,
but prohibited for agent.* checks. Use the corresponding key in the entity's
`ip_addresses` hash to resolve an IP address to target.
details:
description:
- Additional details specific to the check type. Must be a hash of strings
between 1 and 255 characters long, or an array or object containing 0 to
256 items.
disabled:
description:
- If "yes", ensure the check is created, but don't actually use it yet.
type: bool
metadata:
description:
- Hash of arbitrary key-value pairs to accompany this check if it fires.
Keys and values must be strings between 1 and 255 characters long.
period:
description:
- The number of seconds between each time the check is performed. Must be
greater than the minimum period set on your account.
timeout:
description:
- The number of seconds this check will wait when attempting to collect
results. Must be less than the period.
author: Ash Wilson (@smashwilson)
extends_documentation_fragment: rackspace.openstack
'''
EXAMPLES = '''
- name: Create a monitoring check
gather_facts: False
hosts: local
connection: local
tasks:
- name: Associate a check with an existing entity.
rax_mon_check:
credentials: ~/.rax_pub
state: present
entity_id: "{{ the_entity['entity']['id'] }}"
label: the_check
check_type: remote.ping
monitoring_zones_poll: mziad,mzord,mzdfw
details:
count: 10
meta:
hurf: durf
register: the_check
'''
try:
import pyrax
HAS_PYRAX = True
except ImportError:
HAS_PYRAX = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.rax import rax_argument_spec, rax_required_together, setup_rax_module
def cloud_check(module, state, entity_id, label, check_type,
monitoring_zones_poll, target_hostname, target_alias, details,
disabled, metadata, period, timeout):
# Coerce attributes.
if monitoring_zones_poll and not isinstance(monitoring_zones_poll, list):
monitoring_zones_poll = [monitoring_zones_poll]
if period:
period = int(period)
if timeout:
timeout = int(timeout)
changed = False
check = None
cm = pyrax.cloud_monitoring
if not cm:
module.fail_json(msg='Failed to instantiate client. This typically '
'indicates an invalid region or an incorrectly '
'capitalized region name.')
entity = cm.get_entity(entity_id)
if not entity:
module.fail_json(msg='Failed to instantiate entity. "%s" may not be'
' a valid entity id.' % entity_id)
existing = [e for e in entity.list_checks() if e.label == label]
if existing:
check = existing[0]
if state == 'present':
if len(existing) > 1:
module.fail_json(msg='%s existing checks have a label of %s.' %
(len(existing), label))
should_delete = False
should_create = False
should_update = False
if check:
# Details may include keys set to default values that are not
# included in the initial creation.
#
# Only force a recreation of the check if one of the *specified*
# keys is missing or has a different value.
if details:
for (key, value) in details.items():
if key not in check.details:
should_delete = should_create = True
elif value != check.details[key]:
should_delete = should_create = True
should_update = label != check.label or \
(target_hostname and target_hostname != check.target_hostname) or \
(target_alias and target_alias != check.target_alias) or \
(disabled != check.disabled) or \
(metadata and metadata != check.metadata) or \
(period and period != check.period) or \
(timeout and timeout != check.timeout) or \
(monitoring_zones_poll and monitoring_zones_poll != check.monitoring_zones_poll)
if should_update and not should_delete:
check.update(label=label,
disabled=disabled,
metadata=metadata,
monitoring_zones_poll=monitoring_zones_poll,
timeout=timeout,
period=period,
target_alias=target_alias,
target_hostname=target_hostname)
changed = True
else:
# The check doesn't exist yet.
should_create = True
if should_delete:
check.delete()
if should_create:
check = cm.create_check(entity,
label=label,
check_type=check_type,
target_hostname=target_hostname,
target_alias=target_alias,
monitoring_zones_poll=monitoring_zones_poll,
details=details,
disabled=disabled,
metadata=metadata,
period=period,
timeout=timeout)
changed = True
elif state == 'absent':
if check:
check.delete()
changed = True
else:
module.fail_json(msg='state must be either present or absent.')
if check:
check_dict = {
"id": check.id,
"label": check.label,
"type": check.type,
"target_hostname": check.target_hostname,
"target_alias": check.target_alias,
"monitoring_zones_poll": check.monitoring_zones_poll,
"details": check.details,
"disabled": check.disabled,
"metadata": check.metadata,
"period": check.period,
"timeout": check.timeout
}
module.exit_json(changed=changed, check=check_dict)
else:
module.exit_json(changed=changed)
def main():
argument_spec = rax_argument_spec()
argument_spec.update(
dict(
entity_id=dict(required=True),
label=dict(required=True),
check_type=dict(required=True),
monitoring_zones_poll=dict(),
target_hostname=dict(),
target_alias=dict(),
details=dict(type='dict', default={}),
disabled=dict(type='bool', default=False),
metadata=dict(type='dict', default={}),
period=dict(type='int'),
timeout=dict(type='int'),
state=dict(default='present', choices=['present', 'absent'])
)
)
module = AnsibleModule(
argument_spec=argument_spec,
required_together=rax_required_together()
)
if not HAS_PYRAX:
module.fail_json(msg='pyrax is required for this module')
entity_id = module.params.get('entity_id')
label = module.params.get('label')
check_type = module.params.get('check_type')
monitoring_zones_poll = module.params.get('monitoring_zones_poll')
target_hostname = module.params.get('target_hostname')
target_alias = module.params.get('target_alias')
details = module.params.get('details')
disabled = module.boolean(module.params.get('disabled'))
metadata = module.params.get('metadata')
period = module.params.get('period')
timeout = module.params.get('timeout')
state = module.params.get('state')
setup_rax_module(module, pyrax)
cloud_check(module, state, entity_id, label, check_type,
monitoring_zones_poll, target_hostname, target_alias, details,
disabled, metadata, period, timeout)
if __name__ == '__main__':
main()
|
gpl-3.0
|
[
3381,
2647,
15,
1393,
15,
1548,
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,
421,
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,
421,
199,
8948,
275,
1449,
199,
2595,
199,
578,
26,
16937,
63,
2106,
63,
1074,
199,
3612,
63,
1802,
26,
2790,
503,
3145,
282,
32679,
8142,
26504,
316,
1104,
367,
376,
673,
3411,
4642,
14,
199,
1802,
26,
199,
13,
2790,
503,
3145,
282,
32679,
8142,
26504,
316,
1104,
4568,
543,
376,
523,
3411,
16937,
63,
2106,
63,
4502,
14,
437,
1104,
365,
282,
2488,
511,
503,
18216,
626,
365,
523,
10585,
12,
12570,
687,
3365,
20391,
18666,
12,
641,
314,
10460,
1265,
523,
8372,
14,
32679,
20391,
859,
6369,
1204,
16937,
63,
2106,
63,
4502,
1035,
523,
627,
14495,
63,
2106,
63,
1074,
10,
1035,
16937,
63,
2106,
63,
6761,
1035,
16937,
63,
2106,
63,
6761,
63,
5140,
1035,
523,
16937,
63,
2106,
63,
14160,
199,
1023,
63,
3270,
26,
298,
18,
14,
16,
2,
199,
1419,
26,
523,
1174,
26,
272,
1369,
26,
272,
446,
7523,
626,
282,
1104,
543,
642,
445,
8,
1302,
9,
3495,
503,
1630,
440,
2187,
14,
272,
3415,
26,
2097,
1881,
401,
298,
5575,
937,
523,
4642,
63,
344,
26,
272,
1369,
26,
272,
446,
2870,
402,
314,
16937,
63,
2106,
63,
4502,
370,
1347,
543,
642,
1104,
14,
272,
1415,
26,
2549,
523,
1768,
26,
272,
1369,
26,
272,
446,
25022,
282,
1768,
367,
642,
1104,
12,
3382,
413,
436,
5049,
4110,
1846,
14,
272,
1415,
26,
2549,
523,
1104,
63,
466,
26,
272,
1369,
26,
272,
446,
710,
730,
402,
1104,
370,
1218,
14,
445,
8,
3846,
4959,
5920,
1443,
506,
2737,
641,
1263,
489,
16937,
63,
2106,
63,
4502,
14,
445,
8,
4054,
4959,
5920,
1443,
1454,
506,
2737,
641,
16937,
63,
2106,
63,
8327,
489,
626,
1172,
282,
2222,
13,
2307,
445,
8,
4054,
63,
344,
680,
272,
3415,
26,
272,
446,
3982,
14,
5797,
272,
446,
3982,
14,
8915,
13,
13066,
272,
446,
3982,
14,
1014,
272,
446,
3982,
14,
15311,
13,
13066,
272,
446,
3982,
14,
30230,
13,
13066,
272,
446,
3982,
14,
8644,
13,
13066,
272,
446,
3982,
14,
4073,
272,
446,
3982,
14,
1935,
19,
13,
13066,
272,
446,
3982,
14,
15437,
13,
13066,
272,
446,
3982,
14,
15592,
13,
13066,
272,
446,
3982,
14,
15592,
272,
446,
3982,
14,
5510,
272,
446,
3982,
14,
8815,
272,
446,
3982,
14,
31085,
13,
13066,
272,
446,
6631,
14,
11381,
272,
446,
6631,
14,
4844,
272,
446,
6631,
14,
912,
63,
8536,
272,
446,
6631,
14,
3541,
272,
446,
6631,
14,
4032,
272,
446,
6631,
14,
1200,
272,
446,
6631,
14,
2718,
272,
1415,
26,
2549,
523,
20391,
63,
13325,
63,
6843,
26,
272,
1369,
26,
272,
446,
5429,
391,
13,
12794,
769,
402,
314,
1561,
402,
314,
20391,
18666,
314,
1104,
1077,
489,
1255,
687,
14,
23840,
20391,
18666,
2387,
333,
90,
1587,
87,
12,
333,
3951,
9761,
12,
333,
16079,
350,
12,
333,
90,
5298,
12,
489,
333,
90,
2181,
436,
333,
90,
1786,
68,
14,
11105,
367,
3982,
2795,
5920,
27,
557,
20215,
5703,
367,
6631,
2795,
5920,
14,
523,
1347,
63,
4269,
26,
272,
1369,
26,
272,
446,
7309,
402,
658,
1375,
63,
4269,
64,
436,
658,
1375,
63,
3620,
64,
365,
1415,
367,
3982,
2795,
5920,
12,
489,
1325,
557,
20215,
5703,
367,
6631,
2795,
5920,
14,
710,
6246,
642,
1104,
1077,
1347,
14,
489,
9498,
506,
282,
1686,
6509,
20,
12,
6509,
22,
12,
503,
481,
49,
10872,
14,
523,
1347,
63,
3620,
26,
272,
1369,
26,
272,
446,
7309,
402,
658,
1375,
63,
3620,
64,
436,
658,
1375,
63,
4269,
64,
365,
1415,
367,
3982,
2795,
5920,
12,
489,
1325,
557,
20215,
5703,
367,
6631,
2795,
5920,
14,
3645,
314,
5226,
790,
315,
314,
4642,
1159,
489,
658,
711,
63,
7423,
64,
2631,
370,
7512,
376,
3531,
2287,
370,
1347,
14,
523,
2436,
26,
272,
1369,
26,
272,
446,
10961,
2436,
2488,
370,
314,
1104,
730,
14,
9498,
506,
282,
2631,
402,
3326,
489,
3382,
413,
436,
5450,
4110,
1846,
12,
503,
376,
1625,
503,
909,
3035,
378,
370,
489,
7633,
2974,
14,
523,
6980,
26,
272,
1369,
26,
272,
446,
982,
298,
5066,
401,
4868,
314,
1104,
365,
2737,
12,
1325,
2793,
1133,
5965,
675,
652,
5966,
14,
272,
730,
26,
2155,
523,
3341,
26,
272,
1369,
26,
272,
446,
16101,
402,
9697,
790,
13,
585,
6342,
370,
21727,
642,
1104,
340,
652,
28887,
14,
489,
17276,
436,
1338,
1471,
506,
3326,
3382,
413,
436,
5450,
4110,
1846,
14,
523,
6247,
26,
272,
1369,
26,
272,
446,
710,
1329,
402,
4696,
3382,
1924,
900,
314,
1104,
365,
10585,
14,
9498,
506,
489,
8932,
2419,
314,
7481,
6247,
663,
641,
2195,
2933,
14,
523,
2653,
26,
272,
1369,
26,
272,
446,
710,
1329,
402,
4696,
642,
1104,
911,
3618,
1380,
19595,
370,
8775,
489,
2058,
14,
9498,
506,
6656,
2419,
314,
6247,
14,
199,
2502,
26,
437,
609,
644,
382,
834,
8593,
3300,
1119,
87,
382,
834,
9,
199,
11036,
63,
9970,
63,
7677,
26,
660,
346,
2638,
14,
8512,
199,
2344,
199,
199,
8918,
275,
1449,
199,
13,
536,
26,
2790,
282,
20391,
1104,
523,
13082,
63,
5047,
26,
756,
523,
7057,
26,
2257,
523,
1950,
26,
2257,
523,
6527,
26,
523,
446,
536,
26,
24207,
323,
282,
1104,
543,
376,
3411,
4642,
14,
272,
16937,
63,
2106,
63,
1074,
26,
489,
6235,
26,
25975,
14495,
63,
5645,
489,
1174,
26,
3451,
489,
4642,
63,
344,
26,
7370,
314,
63,
4502,
459,
4502,
2545,
344,
418,
7820,
489,
1768,
26,
314,
63,
1074,
489,
1104,
63,
466,
26,
3982,
14,
4073,
489,
20391,
63,
13325,
63,
6843,
26,
333,
16079,
350,
12,
28808,
2181
] |
[
2647,
15,
1393,
15,
1548,
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,
421,
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,
421,
199,
8948,
275,
1449,
199,
2595,
199,
578,
26,
16937,
63,
2106,
63,
1074,
199,
3612,
63,
1802,
26,
2790,
503,
3145,
282,
32679,
8142,
26504,
316,
1104,
367,
376,
673,
3411,
4642,
14,
199,
1802,
26,
199,
13,
2790,
503,
3145,
282,
32679,
8142,
26504,
316,
1104,
4568,
543,
376,
523,
3411,
16937,
63,
2106,
63,
4502,
14,
437,
1104,
365,
282,
2488,
511,
503,
18216,
626,
365,
523,
10585,
12,
12570,
687,
3365,
20391,
18666,
12,
641,
314,
10460,
1265,
523,
8372,
14,
32679,
20391,
859,
6369,
1204,
16937,
63,
2106,
63,
4502,
1035,
523,
627,
14495,
63,
2106,
63,
1074,
10,
1035,
16937,
63,
2106,
63,
6761,
1035,
16937,
63,
2106,
63,
6761,
63,
5140,
1035,
523,
16937,
63,
2106,
63,
14160,
199,
1023,
63,
3270,
26,
298,
18,
14,
16,
2,
199,
1419,
26,
523,
1174,
26,
272,
1369,
26,
272,
446,
7523,
626,
282,
1104,
543,
642,
445,
8,
1302,
9,
3495,
503,
1630,
440,
2187,
14,
272,
3415,
26,
2097,
1881,
401,
298,
5575,
937,
523,
4642,
63,
344,
26,
272,
1369,
26,
272,
446,
2870,
402,
314,
16937,
63,
2106,
63,
4502,
370,
1347,
543,
642,
1104,
14,
272,
1415,
26,
2549,
523,
1768,
26,
272,
1369,
26,
272,
446,
25022,
282,
1768,
367,
642,
1104,
12,
3382,
413,
436,
5049,
4110,
1846,
14,
272,
1415,
26,
2549,
523,
1104,
63,
466,
26,
272,
1369,
26,
272,
446,
710,
730,
402,
1104,
370,
1218,
14,
445,
8,
3846,
4959,
5920,
1443,
506,
2737,
641,
1263,
489,
16937,
63,
2106,
63,
4502,
14,
445,
8,
4054,
4959,
5920,
1443,
1454,
506,
2737,
641,
16937,
63,
2106,
63,
8327,
489,
626,
1172,
282,
2222,
13,
2307,
445,
8,
4054,
63,
344,
680,
272,
3415,
26,
272,
446,
3982,
14,
5797,
272,
446,
3982,
14,
8915,
13,
13066,
272,
446,
3982,
14,
1014,
272,
446,
3982,
14,
15311,
13,
13066,
272,
446,
3982,
14,
30230,
13,
13066,
272,
446,
3982,
14,
8644,
13,
13066,
272,
446,
3982,
14,
4073,
272,
446,
3982,
14,
1935,
19,
13,
13066,
272,
446,
3982,
14,
15437,
13,
13066,
272,
446,
3982,
14,
15592,
13,
13066,
272,
446,
3982,
14,
15592,
272,
446,
3982,
14,
5510,
272,
446,
3982,
14,
8815,
272,
446,
3982,
14,
31085,
13,
13066,
272,
446,
6631,
14,
11381,
272,
446,
6631,
14,
4844,
272,
446,
6631,
14,
912,
63,
8536,
272,
446,
6631,
14,
3541,
272,
446,
6631,
14,
4032,
272,
446,
6631,
14,
1200,
272,
446,
6631,
14,
2718,
272,
1415,
26,
2549,
523,
20391,
63,
13325,
63,
6843,
26,
272,
1369,
26,
272,
446,
5429,
391,
13,
12794,
769,
402,
314,
1561,
402,
314,
20391,
18666,
314,
1104,
1077,
489,
1255,
687,
14,
23840,
20391,
18666,
2387,
333,
90,
1587,
87,
12,
333,
3951,
9761,
12,
333,
16079,
350,
12,
333,
90,
5298,
12,
489,
333,
90,
2181,
436,
333,
90,
1786,
68,
14,
11105,
367,
3982,
2795,
5920,
27,
557,
20215,
5703,
367,
6631,
2795,
5920,
14,
523,
1347,
63,
4269,
26,
272,
1369,
26,
272,
446,
7309,
402,
658,
1375,
63,
4269,
64,
436,
658,
1375,
63,
3620,
64,
365,
1415,
367,
3982,
2795,
5920,
12,
489,
1325,
557,
20215,
5703,
367,
6631,
2795,
5920,
14,
710,
6246,
642,
1104,
1077,
1347,
14,
489,
9498,
506,
282,
1686,
6509,
20,
12,
6509,
22,
12,
503,
481,
49,
10872,
14,
523,
1347,
63,
3620,
26,
272,
1369,
26,
272,
446,
7309,
402,
658,
1375,
63,
3620,
64,
436,
658,
1375,
63,
4269,
64,
365,
1415,
367,
3982,
2795,
5920,
12,
489,
1325,
557,
20215,
5703,
367,
6631,
2795,
5920,
14,
3645,
314,
5226,
790,
315,
314,
4642,
1159,
489,
658,
711,
63,
7423,
64,
2631,
370,
7512,
376,
3531,
2287,
370,
1347,
14,
523,
2436,
26,
272,
1369,
26,
272,
446,
10961,
2436,
2488,
370,
314,
1104,
730,
14,
9498,
506,
282,
2631,
402,
3326,
489,
3382,
413,
436,
5450,
4110,
1846,
12,
503,
376,
1625,
503,
909,
3035,
378,
370,
489,
7633,
2974,
14,
523,
6980,
26,
272,
1369,
26,
272,
446,
982,
298,
5066,
401,
4868,
314,
1104,
365,
2737,
12,
1325,
2793,
1133,
5965,
675,
652,
5966,
14,
272,
730,
26,
2155,
523,
3341,
26,
272,
1369,
26,
272,
446,
16101,
402,
9697,
790,
13,
585,
6342,
370,
21727,
642,
1104,
340,
652,
28887,
14,
489,
17276,
436,
1338,
1471,
506,
3326,
3382,
413,
436,
5450,
4110,
1846,
14,
523,
6247,
26,
272,
1369,
26,
272,
446,
710,
1329,
402,
4696,
3382,
1924,
900,
314,
1104,
365,
10585,
14,
9498,
506,
489,
8932,
2419,
314,
7481,
6247,
663,
641,
2195,
2933,
14,
523,
2653,
26,
272,
1369,
26,
272,
446,
710,
1329,
402,
4696,
642,
1104,
911,
3618,
1380,
19595,
370,
8775,
489,
2058,
14,
9498,
506,
6656,
2419,
314,
6247,
14,
199,
2502,
26,
437,
609,
644,
382,
834,
8593,
3300,
1119,
87,
382,
834,
9,
199,
11036,
63,
9970,
63,
7677,
26,
660,
346,
2638,
14,
8512,
199,
2344,
199,
199,
8918,
275,
1449,
199,
13,
536,
26,
2790,
282,
20391,
1104,
523,
13082,
63,
5047,
26,
756,
523,
7057,
26,
2257,
523,
1950,
26,
2257,
523,
6527,
26,
523,
446,
536,
26,
24207,
323,
282,
1104,
543,
376,
3411,
4642,
14,
272,
16937,
63,
2106,
63,
1074,
26,
489,
6235,
26,
25975,
14495,
63,
5645,
489,
1174,
26,
3451,
489,
4642,
63,
344,
26,
7370,
314,
63,
4502,
459,
4502,
2545,
344,
418,
7820,
489,
1768,
26,
314,
63,
1074,
489,
1104,
63,
466,
26,
3982,
14,
4073,
489,
20391,
63,
13325,
63,
6843,
26,
333,
16079,
350,
12,
28808,
2181,
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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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
] |
tomkrus007/Arduino
|
arduino-core/src/processing/app/i18n/python/requests/packages/charade/euckrfreq.py
|
3121
|
45978
|
######################## 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 #########################
# Sampling from about 20M text materials include literature and computer technology
# 128 --> 0.79
# 256 --> 0.92
# 512 --> 0.986
# 1024 --> 0.99944
# 2048 --> 0.99999
#
# Idea Distribution Ratio = 0.98653 / (1-0.98653) = 73.24
# Random Distribution Ration = 512 / (2350-512) = 0.279.
#
# Typical Distribution Ratio
EUCKR_TYPICAL_DISTRIBUTION_RATIO = 6.0
EUCKR_TABLE_SIZE = 2352
# Char to FreqOrder table ,
EUCKRCharToFreqOrder = ( \
13, 130, 120,1396, 481,1719,1720, 328, 609, 212,1721, 707, 400, 299,1722, 87,
1397,1723, 104, 536,1117,1203,1724,1267, 685,1268, 508,1725,1726,1727,1728,1398,
1399,1729,1730,1731, 141, 621, 326,1057, 368,1732, 267, 488, 20,1733,1269,1734,
945,1400,1735, 47, 904,1270,1736,1737, 773, 248,1738, 409, 313, 786, 429,1739,
116, 987, 813,1401, 683, 75,1204, 145,1740,1741,1742,1743, 16, 847, 667, 622,
708,1744,1745,1746, 966, 787, 304, 129,1747, 60, 820, 123, 676,1748,1749,1750,
1751, 617,1752, 626,1753,1754,1755,1756, 653,1757,1758,1759,1760,1761,1762, 856,
344,1763,1764,1765,1766, 89, 401, 418, 806, 905, 848,1767,1768,1769, 946,1205,
709,1770,1118,1771, 241,1772,1773,1774,1271,1775, 569,1776, 999,1777,1778,1779,
1780, 337, 751,1058, 28, 628, 254,1781, 177, 906, 270, 349, 891,1079,1782, 19,
1783, 379,1784, 315,1785, 629, 754,1402, 559,1786, 636, 203,1206,1787, 710, 567,
1788, 935, 814,1789,1790,1207, 766, 528,1791,1792,1208,1793,1794,1795,1796,1797,
1403,1798,1799, 533,1059,1404,1405,1156,1406, 936, 884,1080,1800, 351,1801,1802,
1803,1804,1805, 801,1806,1807,1808,1119,1809,1157, 714, 474,1407,1810, 298, 899,
885,1811,1120, 802,1158,1812, 892,1813,1814,1408, 659,1815,1816,1121,1817,1818,
1819,1820,1821,1822, 319,1823, 594, 545,1824, 815, 937,1209,1825,1826, 573,1409,
1022,1827,1210,1828,1829,1830,1831,1832,1833, 556, 722, 807,1122,1060,1834, 697,
1835, 900, 557, 715,1836,1410, 540,1411, 752,1159, 294, 597,1211, 976, 803, 770,
1412,1837,1838, 39, 794,1413, 358,1839, 371, 925,1840, 453, 661, 788, 531, 723,
544,1023,1081, 869, 91,1841, 392, 430, 790, 602,1414, 677,1082, 457,1415,1416,
1842,1843, 475, 327,1024,1417, 795, 121,1844, 733, 403,1418,1845,1846,1847, 300,
119, 711,1212, 627,1848,1272, 207,1849,1850, 796,1213, 382,1851, 519,1852,1083,
893,1853,1854,1855, 367, 809, 487, 671,1856, 663,1857,1858, 956, 471, 306, 857,
1859,1860,1160,1084,1861,1862,1863,1864,1865,1061,1866,1867,1868,1869,1870,1871,
282, 96, 574,1872, 502,1085,1873,1214,1874, 907,1875,1876, 827, 977,1419,1420,
1421, 268,1877,1422,1878,1879,1880, 308,1881, 2, 537,1882,1883,1215,1884,1885,
127, 791,1886,1273,1423,1887, 34, 336, 404, 643,1888, 571, 654, 894, 840,1889,
0, 886,1274, 122, 575, 260, 908, 938,1890,1275, 410, 316,1891,1892, 100,1893,
1894,1123, 48,1161,1124,1025,1895, 633, 901,1276,1896,1897, 115, 816,1898, 317,
1899, 694,1900, 909, 734,1424, 572, 866,1425, 691, 85, 524,1010, 543, 394, 841,
1901,1902,1903,1026,1904,1905,1906,1907,1908,1909, 30, 451, 651, 988, 310,1910,
1911,1426, 810,1216, 93,1912,1913,1277,1217,1914, 858, 759, 45, 58, 181, 610,
269,1915,1916, 131,1062, 551, 443,1000, 821,1427, 957, 895,1086,1917,1918, 375,
1919, 359,1920, 687,1921, 822,1922, 293,1923,1924, 40, 662, 118, 692, 29, 939,
887, 640, 482, 174,1925, 69,1162, 728,1428, 910,1926,1278,1218,1279, 386, 870,
217, 854,1163, 823,1927,1928,1929,1930, 834,1931, 78,1932, 859,1933,1063,1934,
1935,1936,1937, 438,1164, 208, 595,1938,1939,1940,1941,1219,1125,1942, 280, 888,
1429,1430,1220,1431,1943,1944,1945,1946,1947,1280, 150, 510,1432,1948,1949,1950,
1951,1952,1953,1954,1011,1087,1955,1433,1043,1956, 881,1957, 614, 958,1064,1065,
1221,1958, 638,1001, 860, 967, 896,1434, 989, 492, 553,1281,1165,1959,1282,1002,
1283,1222,1960,1961,1962,1963, 36, 383, 228, 753, 247, 454,1964, 876, 678,1965,
1966,1284, 126, 464, 490, 835, 136, 672, 529, 940,1088,1435, 473,1967,1968, 467,
50, 390, 227, 587, 279, 378, 598, 792, 968, 240, 151, 160, 849, 882,1126,1285,
639,1044, 133, 140, 288, 360, 811, 563,1027, 561, 142, 523,1969,1970,1971, 7,
103, 296, 439, 407, 506, 634, 990,1972,1973,1974,1975, 645,1976,1977,1978,1979,
1980,1981, 236,1982,1436,1983,1984,1089, 192, 828, 618, 518,1166, 333,1127,1985,
818,1223,1986,1987,1988,1989,1990,1991,1992,1993, 342,1128,1286, 746, 842,1994,
1995, 560, 223,1287, 98, 8, 189, 650, 978,1288,1996,1437,1997, 17, 345, 250,
423, 277, 234, 512, 226, 97, 289, 42, 167,1998, 201,1999,2000, 843, 836, 824,
532, 338, 783,1090, 182, 576, 436,1438,1439, 527, 500,2001, 947, 889,2002,2003,
2004,2005, 262, 600, 314, 447,2006, 547,2007, 693, 738,1129,2008, 71,1440, 745,
619, 688,2009, 829,2010,2011, 147,2012, 33, 948,2013,2014, 74, 224,2015, 61,
191, 918, 399, 637,2016,1028,1130, 257, 902,2017,2018,2019,2020,2021,2022,2023,
2024,2025,2026, 837,2027,2028,2029,2030, 179, 874, 591, 52, 724, 246,2031,2032,
2033,2034,1167, 969,2035,1289, 630, 605, 911,1091,1168,2036,2037,2038,1441, 912,
2039, 623,2040,2041, 253,1169,1290,2042,1442, 146, 620, 611, 577, 433,2043,1224,
719,1170, 959, 440, 437, 534, 84, 388, 480,1131, 159, 220, 198, 679,2044,1012,
819,1066,1443, 113,1225, 194, 318,1003,1029,2045,2046,2047,2048,1067,2049,2050,
2051,2052,2053, 59, 913, 112,2054, 632,2055, 455, 144, 739,1291,2056, 273, 681,
499,2057, 448,2058,2059, 760,2060,2061, 970, 384, 169, 245,1132,2062,2063, 414,
1444,2064,2065, 41, 235,2066, 157, 252, 877, 568, 919, 789, 580,2067, 725,2068,
2069,1292,2070,2071,1445,2072,1446,2073,2074, 55, 588, 66,1447, 271,1092,2075,
1226,2076, 960,1013, 372,2077,2078,2079,2080,2081,1293,2082,2083,2084,2085, 850,
2086,2087,2088,2089,2090, 186,2091,1068, 180,2092,2093,2094, 109,1227, 522, 606,
2095, 867,1448,1093, 991,1171, 926, 353,1133,2096, 581,2097,2098,2099,1294,1449,
1450,2100, 596,1172,1014,1228,2101,1451,1295,1173,1229,2102,2103,1296,1134,1452,
949,1135,2104,2105,1094,1453,1454,1455,2106,1095,2107,2108,2109,2110,2111,2112,
2113,2114,2115,2116,2117, 804,2118,2119,1230,1231, 805,1456, 405,1136,2120,2121,
2122,2123,2124, 720, 701,1297, 992,1457, 927,1004,2125,2126,2127,2128,2129,2130,
22, 417,2131, 303,2132, 385,2133, 971, 520, 513,2134,1174, 73,1096, 231, 274,
962,1458, 673,2135,1459,2136, 152,1137,2137,2138,2139,2140,1005,1138,1460,1139,
2141,2142,2143,2144, 11, 374, 844,2145, 154,1232, 46,1461,2146, 838, 830, 721,
1233, 106,2147, 90, 428, 462, 578, 566,1175, 352,2148,2149, 538,1234, 124,1298,
2150,1462, 761, 565,2151, 686,2152, 649,2153, 72, 173,2154, 460, 415,2155,1463,
2156,1235, 305,2157,2158,2159,2160,2161,2162, 579,2163,2164,2165,2166,2167, 747,
2168,2169,2170,2171,1464, 669,2172,2173,2174,2175,2176,1465,2177, 23, 530, 285,
2178, 335, 729,2179, 397,2180,2181,2182,1030,2183,2184, 698,2185,2186, 325,2187,
2188, 369,2189, 799,1097,1015, 348,2190,1069, 680,2191, 851,1466,2192,2193, 10,
2194, 613, 424,2195, 979, 108, 449, 589, 27, 172, 81,1031, 80, 774, 281, 350,
1032, 525, 301, 582,1176,2196, 674,1045,2197,2198,1467, 730, 762,2199,2200,2201,
2202,1468,2203, 993,2204,2205, 266,1070, 963,1140,2206,2207,2208, 664,1098, 972,
2209,2210,2211,1177,1469,1470, 871,2212,2213,2214,2215,2216,1471,2217,2218,2219,
2220,2221,2222,2223,2224,2225,2226,2227,1472,1236,2228,2229,2230,2231,2232,2233,
2234,2235,1299,2236,2237, 200,2238, 477, 373,2239,2240, 731, 825, 777,2241,2242,
2243, 521, 486, 548,2244,2245,2246,1473,1300, 53, 549, 137, 875, 76, 158,2247,
1301,1474, 469, 396,1016, 278, 712,2248, 321, 442, 503, 767, 744, 941,1237,1178,
1475,2249, 82, 178,1141,1179, 973,2250,1302,2251, 297,2252,2253, 570,2254,2255,
2256, 18, 450, 206,2257, 290, 292,1142,2258, 511, 162, 99, 346, 164, 735,2259,
1476,1477, 4, 554, 343, 798,1099,2260,1100,2261, 43, 171,1303, 139, 215,2262,
2263, 717, 775,2264,1033, 322, 216,2265, 831,2266, 149,2267,1304,2268,2269, 702,
1238, 135, 845, 347, 309,2270, 484,2271, 878, 655, 238,1006,1478,2272, 67,2273,
295,2274,2275, 461,2276, 478, 942, 412,2277,1034,2278,2279,2280, 265,2281, 541,
2282,2283,2284,2285,2286, 70, 852,1071,2287,2288,2289,2290, 21, 56, 509, 117,
432,2291,2292, 331, 980, 552,1101, 148, 284, 105, 393,1180,1239, 755,2293, 187,
2294,1046,1479,2295, 340,2296, 63,1047, 230,2297,2298,1305, 763,1306, 101, 800,
808, 494,2299,2300,2301, 903,2302, 37,1072, 14, 5,2303, 79, 675,2304, 312,
2305,2306,2307,2308,2309,1480, 6,1307,2310,2311,2312, 1, 470, 35, 24, 229,
2313, 695, 210, 86, 778, 15, 784, 592, 779, 32, 77, 855, 964,2314, 259,2315,
501, 380,2316,2317, 83, 981, 153, 689,1308,1481,1482,1483,2318,2319, 716,1484,
2320,2321,2322,2323,2324,2325,1485,2326,2327, 128, 57, 68, 261,1048, 211, 170,
1240, 31,2328, 51, 435, 742,2329,2330,2331, 635,2332, 264, 456,2333,2334,2335,
425,2336,1486, 143, 507, 263, 943,2337, 363, 920,1487, 256,1488,1102, 243, 601,
1489,2338,2339,2340,2341,2342,2343,2344, 861,2345,2346,2347,2348,2349,2350, 395,
2351,1490,1491, 62, 535, 166, 225,2352,2353, 668, 419,1241, 138, 604, 928,2354,
1181,2355,1492,1493,2356,2357,2358,1143,2359, 696,2360, 387, 307,1309, 682, 476,
2361,2362, 332, 12, 222, 156,2363, 232,2364, 641, 276, 656, 517,1494,1495,1035,
416, 736,1496,2365,1017, 586,2366,2367,2368,1497,2369, 242,2370,2371,2372,1498,
2373, 965, 713,2374,2375,2376,2377, 740, 982,1499, 944,1500,1007,2378,2379,1310,
1501,2380,2381,2382, 785, 329,2383,2384,1502,2385,2386,2387, 932,2388,1503,2389,
2390,2391,2392,1242,2393,2394,2395,2396,2397, 994, 950,2398,2399,2400,2401,1504,
1311,2402,2403,2404,2405,1049, 749,2406,2407, 853, 718,1144,1312,2408,1182,1505,
2409,2410, 255, 516, 479, 564, 550, 214,1506,1507,1313, 413, 239, 444, 339,1145,
1036,1508,1509,1314,1037,1510,1315,2411,1511,2412,2413,2414, 176, 703, 497, 624,
593, 921, 302,2415, 341, 165,1103,1512,2416,1513,2417,2418,2419, 376,2420, 700,
2421,2422,2423, 258, 768,1316,2424,1183,2425, 995, 608,2426,2427,2428,2429, 221,
2430,2431,2432,2433,2434,2435,2436,2437, 195, 323, 726, 188, 897, 983,1317, 377,
644,1050, 879,2438, 452,2439,2440,2441,2442,2443,2444, 914,2445,2446,2447,2448,
915, 489,2449,1514,1184,2450,2451, 515, 64, 427, 495,2452, 583,2453, 483, 485,
1038, 562, 213,1515, 748, 666,2454,2455,2456,2457, 334,2458, 780, 996,1008, 705,
1243,2459,2460,2461,2462,2463, 114,2464, 493,1146, 366, 163,1516, 961,1104,2465,
291,2466,1318,1105,2467,1517, 365,2468, 355, 951,1244,2469,1319,2470, 631,2471,
2472, 218,1320, 364, 320, 756,1518,1519,1321,1520,1322,2473,2474,2475,2476, 997,
2477,2478,2479,2480, 665,1185,2481, 916,1521,2482,2483,2484, 584, 684,2485,2486,
797,2487,1051,1186,2488,2489,2490,1522,2491,2492, 370,2493,1039,1187, 65,2494,
434, 205, 463,1188,2495, 125, 812, 391, 402, 826, 699, 286, 398, 155, 781, 771,
585,2496, 590, 505,1073,2497, 599, 244, 219, 917,1018, 952, 646,1523,2498,1323,
2499,2500, 49, 984, 354, 741,2501, 625,2502,1324,2503,1019, 190, 357, 757, 491,
95, 782, 868,2504,2505,2506,2507,2508,2509, 134,1524,1074, 422,1525, 898,2510,
161,2511,2512,2513,2514, 769,2515,1526,2516,2517, 411,1325,2518, 472,1527,2519,
2520,2521,2522,2523,2524, 985,2525,2526,2527,2528,2529,2530, 764,2531,1245,2532,
2533, 25, 204, 311,2534, 496,2535,1052,2536,2537,2538,2539,2540,2541,2542, 199,
704, 504, 468, 758, 657,1528, 196, 44, 839,1246, 272, 750,2543, 765, 862,2544,
2545,1326,2546, 132, 615, 933,2547, 732,2548,2549,2550,1189,1529,2551, 283,1247,
1053, 607, 929,2552,2553,2554, 930, 183, 872, 616,1040,1147,2555,1148,1020, 441,
249,1075,2556,2557,2558, 466, 743,2559,2560,2561, 92, 514, 426, 420, 526,2562,
2563,2564,2565,2566,2567,2568, 185,2569,2570,2571,2572, 776,1530, 658,2573, 362,
2574, 361, 922,1076, 793,2575,2576,2577,2578,2579,2580,1531, 251,2581,2582,2583,
2584,1532, 54, 612, 237,1327,2585,2586, 275, 408, 647, 111,2587,1533,1106, 465,
3, 458, 9, 38,2588, 107, 110, 890, 209, 26, 737, 498,2589,1534,2590, 431,
202, 88,1535, 356, 287,1107, 660,1149,2591, 381,1536, 986,1150, 445,1248,1151,
974,2592,2593, 846,2594, 446, 953, 184,1249,1250, 727,2595, 923, 193, 883,2596,
2597,2598, 102, 324, 539, 817,2599, 421,1041,2600, 832,2601, 94, 175, 197, 406,
2602, 459,2603,2604,2605,2606,2607, 330, 555,2608,2609,2610, 706,1108, 389,2611,
2612,2613,2614, 233,2615, 833, 558, 931, 954,1251,2616,2617,1537, 546,2618,2619,
1009,2620,2621,2622,1538, 690,1328,2623, 955,2624,1539,2625,2626, 772,2627,2628,
2629,2630,2631, 924, 648, 863, 603,2632,2633, 934,1540, 864, 865,2634, 642,1042,
670,1190,2635,2636,2637,2638, 168,2639, 652, 873, 542,1054,1541,2640,2641,2642, # 512, 256
#Everything below is of no interest for detection purpose
2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,
2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,
2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,
2691,2692,2693,2694,2695,2696,2697,2698,2699,1542, 880,2700,2701,2702,2703,2704,
2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,
2721,2722,2723,2724,2725,1543,2726,2727,2728,2729,2730,2731,2732,1544,2733,2734,
2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,
2751,2752,2753,2754,1545,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,
2766,1546,2767,1547,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,
2780,2781,2782,2783,2784,2785,2786,1548,2787,2788,2789,1109,2790,2791,2792,2793,
2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,
2810,2811,2812,1329,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,
2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,
2841,2842,2843,2844,2845,2846,2847,2848,2849,2850,2851,2852,2853,2854,2855,2856,
1549,2857,2858,2859,2860,1550,2861,2862,1551,2863,2864,2865,2866,2867,2868,2869,
2870,2871,2872,2873,2874,1110,1330,2875,2876,2877,2878,2879,2880,2881,2882,2883,
2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,
2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,
2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,1331,
2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,1552,2944,2945,
2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,
2962,2963,2964,1252,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,
2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,
2993,2994,2995,2996,2997,2998,2999,3000,3001,3002,3003,3004,3005,3006,3007,3008,
3009,3010,3011,3012,1553,3013,3014,3015,3016,3017,1554,3018,1332,3019,3020,3021,
3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,
3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,1555,3051,3052,
3053,1556,1557,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,
3067,1558,3068,3069,3070,3071,3072,3073,3074,3075,3076,1559,3077,3078,3079,3080,
3081,3082,3083,1253,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,
3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,3108,1152,3109,3110,
3111,3112,3113,1560,3114,3115,3116,3117,1111,3118,3119,3120,3121,3122,3123,3124,
3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,
3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,
3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,
3173,3174,3175,3176,1333,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,
3188,3189,1561,3190,3191,1334,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,
3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,
3218,3219,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3231,3232,3233,
3234,1562,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,
3249,3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,
3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,1563,3278,3279,
3280,3281,3282,3283,3284,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,
3296,3297,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,
3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,
3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,
3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,
3360,3361,3362,3363,3364,1335,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,
3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,1336,3388,3389,
3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,3400,3401,3402,3403,3404,3405,
3406,3407,3408,3409,3410,3411,3412,3413,3414,1337,3415,3416,3417,3418,3419,1338,
3420,3421,3422,1564,1565,3423,3424,3425,3426,3427,3428,3429,3430,3431,1254,3432,
3433,3434,1339,3435,3436,3437,3438,3439,1566,3440,3441,3442,3443,3444,3445,3446,
3447,3448,3449,3450,3451,3452,3453,3454,1255,3455,3456,3457,3458,3459,1567,1191,
3460,1568,1569,3461,3462,3463,1570,3464,3465,3466,3467,3468,1571,3469,3470,3471,
3472,3473,1572,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,
1340,3487,3488,3489,3490,3491,3492,1021,3493,3494,3495,3496,3497,3498,1573,3499,
1341,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,1342,3512,3513,
3514,3515,3516,1574,1343,3517,3518,3519,1575,3520,1576,3521,3522,3523,3524,3525,
3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,
3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,
3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,
3574,3575,3576,3577,3578,3579,3580,1577,3581,3582,1578,3583,3584,3585,3586,3587,
3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,
3604,1579,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,
3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,1580,3630,3631,1581,3632,
3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,
3649,3650,3651,3652,3653,3654,3655,3656,1582,3657,3658,3659,3660,3661,3662,3663,
3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,
3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,
3696,3697,3698,3699,3700,1192,3701,3702,3703,3704,1256,3705,3706,3707,3708,1583,
1257,3709,3710,3711,3712,3713,3714,3715,3716,1584,3717,3718,3719,3720,3721,3722,
3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,
3739,3740,3741,3742,3743,3744,3745,1344,3746,3747,3748,3749,3750,3751,3752,3753,
3754,3755,3756,1585,3757,3758,3759,3760,3761,3762,3763,3764,3765,3766,1586,3767,
3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,1345,3779,3780,3781,3782,
3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,1346,1587,3796,
3797,1588,3798,3799,3800,3801,3802,3803,3804,3805,3806,1347,3807,3808,3809,3810,
3811,1589,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,1590,3822,3823,1591,
1348,3824,3825,3826,3827,3828,3829,3830,1592,3831,3832,1593,3833,3834,3835,3836,
3837,3838,3839,3840,3841,3842,3843,3844,1349,3845,3846,3847,3848,3849,3850,3851,
3852,3853,3854,3855,3856,3857,3858,1594,3859,3860,3861,3862,3863,3864,3865,3866,
3867,3868,3869,1595,3870,3871,3872,3873,1596,3874,3875,3876,3877,3878,3879,3880,
3881,3882,3883,3884,3885,3886,1597,3887,3888,3889,3890,3891,3892,3893,3894,3895,
1598,3896,3897,3898,1599,1600,3899,1350,3900,1351,3901,3902,1352,3903,3904,3905,
3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919,3920,3921,
3922,3923,3924,1258,3925,3926,3927,3928,3929,3930,3931,1193,3932,1601,3933,3934,
3935,3936,3937,3938,3939,3940,3941,3942,3943,1602,3944,3945,3946,3947,3948,1603,
3949,3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,
3965,1604,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,1353,3978,
3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,1354,3992,3993,
3994,3995,3996,3997,3998,3999,4000,4001,4002,4003,4004,4005,4006,4007,4008,4009,
4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,1355,4024,
4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,
1605,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,
4056,4057,4058,4059,4060,1606,4061,4062,4063,4064,1607,4065,4066,4067,4068,4069,
4070,4071,4072,4073,4074,4075,4076,1194,4077,4078,1608,4079,4080,4081,4082,4083,
4084,4085,4086,4087,1609,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,
4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,1259,4109,4110,4111,4112,4113,
4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,1195,4125,4126,4127,1610,
4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,1356,4138,4139,4140,4141,4142,
4143,4144,1611,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,
4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,
4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,
4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,
4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,1612,4220,
4221,4222,4223,4224,4225,4226,4227,1357,4228,1613,4229,4230,4231,4232,4233,4234,
4235,4236,4237,4238,4239,4240,4241,4242,4243,1614,4244,4245,4246,4247,4248,4249,
4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,
4266,4267,4268,4269,4270,1196,1358,4271,4272,4273,4274,4275,4276,4277,4278,4279,
4280,4281,4282,4283,4284,4285,4286,4287,1615,4288,4289,4290,4291,4292,4293,4294,
4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,
4311,4312,4313,4314,4315,4316,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,
4327,4328,4329,4330,4331,4332,4333,4334,1616,4335,4336,4337,4338,4339,4340,4341,
4342,4343,4344,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,
4358,4359,4360,1617,4361,4362,4363,4364,4365,1618,4366,4367,4368,4369,4370,4371,
4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,
4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,
4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416,1619,4417,4418,
4419,4420,4421,4422,4423,4424,4425,1112,4426,4427,4428,4429,4430,1620,4431,4432,
4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,1260,1261,4443,4444,4445,4446,
4447,4448,4449,4450,4451,4452,4453,4454,4455,1359,4456,4457,4458,4459,4460,4461,
4462,4463,4464,4465,1621,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,
4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,1055,4490,4491,
4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,
4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,1622,4519,4520,4521,1623,
4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,1360,4536,
4537,4538,4539,4540,4541,4542,4543, 975,4544,4545,4546,4547,4548,4549,4550,4551,
4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,
4568,4569,4570,4571,1624,4572,4573,4574,4575,4576,1625,4577,4578,4579,4580,4581,
4582,4583,4584,1626,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,1627,
4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,
4612,4613,4614,4615,1628,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,
4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,
4643,4644,4645,4646,4647,4648,4649,1361,4650,4651,4652,4653,4654,4655,4656,4657,
4658,4659,4660,4661,1362,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,
4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,1629,4683,4684,4685,4686,4687,
1630,4688,4689,4690,4691,1153,4692,4693,4694,1113,4695,4696,4697,4698,4699,4700,
4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,1197,4712,4713,4714,4715,
4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,
4732,4733,4734,4735,1631,4736,1632,4737,4738,4739,4740,4741,4742,4743,4744,1633,
4745,4746,4747,4748,4749,1262,4750,4751,4752,4753,4754,1363,4755,4756,4757,4758,
4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,1634,4769,4770,4771,4772,4773,
4774,4775,4776,4777,4778,1635,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,
4789,1636,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,
4804,4805,4806,1637,4807,4808,4809,1638,4810,4811,4812,4813,4814,4815,4816,4817,
4818,1639,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,
4833,1077,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,
4848,4849,4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862,4863,
4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,
4880,4881,4882,4883,1640,4884,4885,1641,4886,4887,4888,4889,4890,4891,4892,4893,
4894,4895,4896,4897,4898,4899,4900,4901,4902,4903,4904,4905,4906,4907,4908,4909,
4910,4911,1642,4912,4913,4914,1364,4915,4916,4917,4918,4919,4920,4921,4922,4923,
4924,4925,4926,4927,4928,4929,4930,4931,1643,4932,4933,4934,4935,4936,4937,4938,
4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,4950,4951,4952,4953,4954,
4955,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,
4971,4972,4973,4974,4975,4976,4977,4978,4979,4980,1644,4981,4982,4983,4984,1645,
4985,4986,1646,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,
5000,5001,5002,5003,5004,5005,1647,5006,1648,5007,5008,5009,5010,5011,5012,1078,
5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,
1365,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,1649,5040,5041,5042,
5043,5044,5045,1366,5046,5047,5048,5049,5050,5051,5052,5053,5054,5055,1650,5056,
5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072,
5073,5074,5075,5076,5077,1651,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,
5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,
5104,5105,5106,5107,5108,5109,5110,1652,5111,5112,5113,5114,5115,5116,5117,5118,
1367,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,1653,5130,5131,5132,
5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,
5149,1368,5150,1654,5151,1369,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,
5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,
5178,1370,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,
5193,5194,5195,5196,5197,5198,1655,5199,5200,5201,5202,1656,5203,5204,5205,5206,
1371,5207,1372,5208,5209,5210,5211,1373,5212,5213,1374,5214,5215,5216,5217,5218,
5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,
5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,1657,5248,5249,
5250,5251,1658,1263,5252,5253,5254,5255,5256,1375,5257,5258,5259,5260,5261,5262,
5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,
5279,5280,5281,5282,5283,1659,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,
5294,5295,5296,5297,5298,5299,5300,1660,5301,5302,5303,5304,5305,5306,5307,5308,
5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,1376,5322,5323,
5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,1198,5334,5335,5336,5337,5338,
5339,5340,5341,5342,5343,1661,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,
5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,
5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,
5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,1264,5399,5400,
5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,1662,5413,5414,5415,
5416,1663,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,
5431,5432,5433,5434,5435,5436,5437,5438,1664,5439,5440,5441,5442,5443,5444,5445,
5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,
5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,
5478,1154,5479,5480,5481,5482,5483,5484,5485,1665,5486,5487,5488,5489,5490,5491,
5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,
5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,
5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,
5540,5541,5542,5543,5544,5545,5546,5547,5548,1377,5549,5550,5551,5552,5553,5554,
5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,
1114,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,
5586,5587,5588,5589,5590,5591,5592,1378,5593,5594,5595,5596,5597,5598,5599,5600,
5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,1379,5615,
5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,
5632,5633,5634,1380,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,
5647,5648,5649,1381,1056,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,
1666,5661,5662,5663,5664,5665,5666,5667,5668,1667,5669,1668,5670,5671,5672,5673,
5674,5675,5676,5677,5678,1155,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,
5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,1669,5699,5700,5701,5702,5703,
5704,5705,1670,5706,5707,5708,5709,5710,1671,5711,5712,5713,5714,1382,5715,5716,
5717,5718,5719,5720,5721,5722,5723,5724,5725,1672,5726,5727,1673,1674,5728,5729,
5730,5731,5732,5733,5734,5735,5736,1675,5737,5738,5739,5740,5741,5742,5743,5744,
1676,5745,5746,5747,5748,5749,5750,5751,1383,5752,5753,5754,5755,5756,5757,5758,
5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,1677,5769,5770,5771,5772,5773,
1678,5774,5775,5776, 998,5777,5778,5779,5780,5781,5782,5783,5784,5785,1384,5786,
5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,1679,5801,
5802,5803,1115,1116,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,
5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,
5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,
5848,5849,5850,5851,5852,5853,5854,5855,1680,5856,5857,5858,5859,5860,5861,5862,
5863,5864,1681,5865,5866,5867,1682,5868,5869,5870,5871,5872,5873,5874,5875,5876,
5877,5878,5879,1683,5880,1684,5881,5882,5883,5884,1685,5885,5886,5887,5888,5889,
5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,
5906,5907,1686,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,
5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,1687,
5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,
5952,1688,1689,5953,1199,5954,5955,5956,5957,5958,5959,5960,5961,1690,5962,5963,
5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,
5980,5981,1385,5982,1386,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,
5994,5995,5996,5997,5998,5999,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,
6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,
6026,6027,1265,6028,6029,1691,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,
6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,
6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,
6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,1692,6085,6086,
6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,
6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,
6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,1693,6132,6133,
6134,6135,6136,1694,6137,6138,6139,6140,6141,1695,6142,6143,6144,6145,6146,6147,
6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,
6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,
6180,6181,6182,6183,6184,6185,1696,6186,6187,6188,6189,6190,6191,6192,6193,6194,
6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,
6211,6212,6213,6214,6215,6216,6217,6218,6219,1697,6220,6221,6222,6223,6224,6225,
6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,
6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,1698,6254,6255,6256,
6257,6258,6259,6260,6261,6262,6263,1200,6264,6265,6266,6267,6268,6269,6270,6271, #1024
6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,
6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,1699,
6303,6304,1700,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,
6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,
6334,6335,6336,6337,6338,6339,1701,6340,6341,6342,6343,6344,1387,6345,6346,6347,
6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,
6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,
6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,
6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,
6412,6413,1702,6414,6415,6416,6417,6418,6419,6420,6421,6422,1703,6423,6424,6425,
6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,1704,6439,6440,
6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,
6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,
6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,
6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,1266,
6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,
6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,
6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,
1705,1706,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,
6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,
6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,
6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,
6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,
6630,6631,6632,6633,6634,6635,6636,6637,1388,6638,6639,6640,6641,6642,6643,6644,
1707,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,
6660,6661,6662,6663,1708,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,
1201,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,
6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,
6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,
6722,6723,6724,6725,1389,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,
1390,1709,6737,6738,6739,6740,6741,6742,1710,6743,6744,6745,6746,1391,6747,6748,
6749,6750,6751,6752,6753,6754,6755,6756,6757,1392,6758,6759,6760,6761,6762,6763,
6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,
6780,1202,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,
6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,1711,
6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,
6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,1393,6837,6838,6839,6840,
6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,
6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,
6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,
6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,1712,6903,
6904,6905,6906,6907,6908,6909,6910,1713,6911,6912,6913,6914,6915,6916,6917,6918,
6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,
6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,
6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,
6967,6968,6969,6970,6971,6972,6973,6974,1714,6975,6976,6977,6978,6979,6980,6981,
6982,6983,6984,6985,6986,6987,6988,1394,6989,6990,6991,6992,6993,6994,6995,6996,
6997,6998,6999,7000,1715,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,
7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,
7028,1716,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,
7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,
7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,
7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,
7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,
7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,
7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,
7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,
7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,
7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,
7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,
7203,7204,7205,7206,7207,1395,7208,7209,7210,7211,7212,7213,1717,7214,7215,7216,
7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,
7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,
7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,
7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,
7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,
7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,
7313,1718,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,
7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,
7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,
7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,
7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,
7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,
7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,
7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,
7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,
7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,
7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,
7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,7503,
7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,
7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,
7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,
7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,
7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,
7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,
7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,
7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,
7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,
7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,
7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,
7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,
7696,7697,7698,7699,7700,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,
7712,7713,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,
7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,
7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7754,7755,7756,7757,7758,7759,
7760,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,
7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,
7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,
7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,
7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,
7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,
7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,
7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,
7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,
7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,
7920,7921,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,
7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,
7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,
7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,
7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,
8000,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,
8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,
8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,
8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,
8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,
8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,
8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,
8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,
8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,
8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,
8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,
8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,
8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,
8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,
8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,
8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,
8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,
8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,
8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,
8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,
8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,
8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,
8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,
8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,
8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,
8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,
8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,
8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,
8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,
8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,
8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,
8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,
8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,
8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,
8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,
8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,
8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,
8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,
8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,
8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,
8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,
8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,
8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,
8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,
8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,
8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,
8736,8737,8738,8739,8740,8741)
# flake8: noqa
|
lgpl-2.1
|
[
6565,
16427,
5113,
8068,
11945,
199,
3,
710,
12769,
5495,
365,
17728,
13338,
707,
1890,
1233,
14,
199,
3,
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,
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,
3,
428,
23144,
687,
3595,
3388,
45,
1318,
8418,
2387,
7142,
1463,
436,
24189,
1565,
24731,
199,
199,
3,
7960,
221,
10541,
378,
14,
1965,
199,
3,
7633,
221,
10541,
378,
14,
2942,
199,
3,
10574,
221,
10541,
378,
14,
30292,
199,
3,
6619,
10541,
378,
14,
5637,
1602,
199,
3,
18427,
10541,
378,
14,
27055,
199,
3,
199,
3,
473,
25395,
11839,
820,
32736,
275,
378,
14,
30292,
2481,
1182,
334,
17,
13,
16,
14,
30292,
2481,
9,
275,
18525,
14,
1194,
199,
3,
9571,
11839,
820,
425,
275,
10574,
1182,
334,
8276,
16,
13,
7736,
9,
275,
378,
14,
12987,
14,
199,
3,
221,
199,
3,
29267,
11839,
820,
32736,
257,
199,
199,
23539,
27373,
63,
7034,
5974,
63,
24580,
26601,
63,
26566,
275,
1227,
14,
16,
199,
199,
23539,
27373,
63,
8723,
63,
4305,
275,
499,
15139,
199,
199,
3,
6659,
370,
481,
2103,
4738,
1817,
2360,
221,
199,
23539,
27373,
18139,
13875,
4738,
275,
334,
971,
523,
4944,
12,
21334,
12,
13960,
12,
969,
2534,
12,
841,
2835,
12,
1196,
1167,
12,
1196,
1165,
12,
650,
1651,
12,
1227,
1643,
12,
29532,
12,
1196,
2025,
12,
1520,
1780,
12,
8290,
12,
32730,
12,
1196,
1081,
12,
221,
10513,
12,
199,
969,
2576,
12,
1196,
1789,
12,
21083,
12,
959,
1344,
12,
845,
1196,
12,
713,
1644,
12,
1196,
1194,
12,
713,
1822,
12,
1227,
2426,
12,
713,
2333,
12,
959,
2036,
12,
1196,
821,
12,
1196,
1479,
12,
1196,
1465,
12,
1196,
1651,
12,
969,
2905,
12,
199,
969,
1020,
12,
1196,
1398,
12,
1196,
1216,
12,
1196,
2192,
12,
413,
2953,
12,
1227,
2025,
12,
650,
1479,
12,
709,
1641,
12,
650,
2333,
12,
1196,
708,
12,
499,
1822,
12,
841,
1299,
12,
221,
3388,
12,
1196,
1153,
12,
713,
1876,
12,
1196,
1082,
12,
199,
1749,
2322,
12,
1079,
383,
12,
1196,
1276,
12,
221,
10954,
12,
1749,
966,
12,
713,
2760,
12,
1196,
1344,
12,
1196,
1401,
12,
8375,
19,
12,
499,
2006,
12,
1196,
1703,
12,
21292,
12,
650,
969,
12,
1520,
1184,
12,
17640,
12,
1196,
1355,
12,
199,
25186,
12,
1749,
1555,
12,
1695,
969,
12,
1079,
614,
12,
1227,
2658,
12,
221,
13098,
12,
713,
966,
12,
28818,
12,
1196,
2167,
12,
1196,
2953,
12,
1196,
2260,
12,
1196,
2824,
12,
221,
3193,
12,
8264,
23,
12,
1227,
1822,
12,
1227,
1081,
12,
199,
1520,
2036,
12,
1196,
1602,
12,
1196,
2322,
12,
1196,
2466,
12,
1749,
1272,
12,
1520,
1555,
12,
20398,
12,
25454,
12,
1196,
2417,
12,
221,
5212,
12,
1695,
1165,
12,
11869,
12,
1227,
2114,
12,
1196,
2006,
12,
1196,
1887,
12,
1196,
1400,
12,
199,
1196,
2869,
12,
1227,
1196,
12,
1196,
2528,
12,
1227,
1479,
12,
1196,
2481,
12,
1196,
1477,
12,
1196,
1229,
12,
1196,
1367,
12,
1227,
2481,
12,
1196,
1641,
12,
1196,
2010,
12,
1196,
1427,
12,
1196,
2259,
12,
1196,
2976,
12,
1196,
2789,
12,
1695,
1367,
12,
199,
650,
1602,
12,
1196,
2766,
12,
1196,
772,
12,
1196,
2182,
12,
1196,
1272,
12,
221,
17838,
12,
13952,
12,
841,
1085,
12,
5939,
22,
12,
1749,
1717,
12,
8264,
24,
12,
1196,
1822,
12,
1196,
2333,
12,
1196,
1876,
12,
1749,
2466,
12,
713,
1717,
12,
199,
1520,
1643,
12,
8881,
16,
12,
845,
1085,
12,
8881,
17,
12,
499,
2953,
12,
8881,
18,
12,
8881,
19,
12,
8881,
20,
12,
713,
3172,
12,
8881,
21,
12,
959,
1876,
12,
8881,
22,
12,
22291,
12,
8881,
23,
12,
8881,
24,
12,
8881,
25,
12,
199,
1196,
1257,
12,
650,
1401,
12,
1520,
2869,
12,
709,
2010,
12,
221,
7294,
12,
1227,
1651,
12,
22540,
12,
1196,
2835,
12,
413,
1138,
12,
1749,
1690,
12,
27632,
12,
650,
1887,
12,
221,
15601,
12,
709,
1965,
12,
1196,
2564,
12,
221,
5851,
12,
199,
1196,
2658,
12,
650,
1965,
12,
1196,
1349,
12,
650,
1046,
12,
1196,
2426,
12,
1227,
1398,
12,
1520,
1477,
12,
29840,
12,
959,
1427,
12,
1196,
1184,
12,
1227,
1344,
12,
29202,
12,
713,
1690,
12,
1196,
1555,
12,
1520,
709,
12,
959,
1822,
12,
199,
1196,
1299,
12,
1749,
1276,
12,
1695,
1079,
12,
1196,
1407,
12,
1196,
2710,
12,
713,
1780,
12,
1520,
1272,
12,
959,
1651,
12,
1196,
3328,
12,
1196,
2942,
12,
713,
2036,
12,
1196,
3129,
12,
1196,
2635,
12,
1196,
2720,
12,
1196,
2534,
12,
1196,
2576,
12,
199,
1079,
1644,
12,
1196,
2905,
12,
1196,
1020,
12,
959,
1153,
12,
709,
1427,
12,
1079,
966,
12,
1079,
1717,
12,
845,
1367,
12,
1079,
1690,
12,
1749,
1344,
12,
10523,
20,
12,
23514,
12,
1085,
383,
12
] |
[
16427,
5113,
8068,
11945,
199,
3,
710,
12769,
5495,
365,
17728,
13338,
707,
1890,
1233,
14,
199,
3,
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,
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,
3,
428,
23144,
687,
3595,
3388,
45,
1318,
8418,
2387,
7142,
1463,
436,
24189,
1565,
24731,
199,
199,
3,
7960,
221,
10541,
378,
14,
1965,
199,
3,
7633,
221,
10541,
378,
14,
2942,
199,
3,
10574,
221,
10541,
378,
14,
30292,
199,
3,
6619,
10541,
378,
14,
5637,
1602,
199,
3,
18427,
10541,
378,
14,
27055,
199,
3,
199,
3,
473,
25395,
11839,
820,
32736,
275,
378,
14,
30292,
2481,
1182,
334,
17,
13,
16,
14,
30292,
2481,
9,
275,
18525,
14,
1194,
199,
3,
9571,
11839,
820,
425,
275,
10574,
1182,
334,
8276,
16,
13,
7736,
9,
275,
378,
14,
12987,
14,
199,
3,
221,
199,
3,
29267,
11839,
820,
32736,
257,
199,
199,
23539,
27373,
63,
7034,
5974,
63,
24580,
26601,
63,
26566,
275,
1227,
14,
16,
199,
199,
23539,
27373,
63,
8723,
63,
4305,
275,
499,
15139,
199,
199,
3,
6659,
370,
481,
2103,
4738,
1817,
2360,
221,
199,
23539,
27373,
18139,
13875,
4738,
275,
334,
971,
523,
4944,
12,
21334,
12,
13960,
12,
969,
2534,
12,
841,
2835,
12,
1196,
1167,
12,
1196,
1165,
12,
650,
1651,
12,
1227,
1643,
12,
29532,
12,
1196,
2025,
12,
1520,
1780,
12,
8290,
12,
32730,
12,
1196,
1081,
12,
221,
10513,
12,
199,
969,
2576,
12,
1196,
1789,
12,
21083,
12,
959,
1344,
12,
845,
1196,
12,
713,
1644,
12,
1196,
1194,
12,
713,
1822,
12,
1227,
2426,
12,
713,
2333,
12,
959,
2036,
12,
1196,
821,
12,
1196,
1479,
12,
1196,
1465,
12,
1196,
1651,
12,
969,
2905,
12,
199,
969,
1020,
12,
1196,
1398,
12,
1196,
1216,
12,
1196,
2192,
12,
413,
2953,
12,
1227,
2025,
12,
650,
1479,
12,
709,
1641,
12,
650,
2333,
12,
1196,
708,
12,
499,
1822,
12,
841,
1299,
12,
221,
3388,
12,
1196,
1153,
12,
713,
1876,
12,
1196,
1082,
12,
199,
1749,
2322,
12,
1079,
383,
12,
1196,
1276,
12,
221,
10954,
12,
1749,
966,
12,
713,
2760,
12,
1196,
1344,
12,
1196,
1401,
12,
8375,
19,
12,
499,
2006,
12,
1196,
1703,
12,
21292,
12,
650,
969,
12,
1520,
1184,
12,
17640,
12,
1196,
1355,
12,
199,
25186,
12,
1749,
1555,
12,
1695,
969,
12,
1079,
614,
12,
1227,
2658,
12,
221,
13098,
12,
713,
966,
12,
28818,
12,
1196,
2167,
12,
1196,
2953,
12,
1196,
2260,
12,
1196,
2824,
12,
221,
3193,
12,
8264,
23,
12,
1227,
1822,
12,
1227,
1081,
12,
199,
1520,
2036,
12,
1196,
1602,
12,
1196,
2322,
12,
1196,
2466,
12,
1749,
1272,
12,
1520,
1555,
12,
20398,
12,
25454,
12,
1196,
2417,
12,
221,
5212,
12,
1695,
1165,
12,
11869,
12,
1227,
2114,
12,
1196,
2006,
12,
1196,
1887,
12,
1196,
1400,
12,
199,
1196,
2869,
12,
1227,
1196,
12,
1196,
2528,
12,
1227,
1479,
12,
1196,
2481,
12,
1196,
1477,
12,
1196,
1229,
12,
1196,
1367,
12,
1227,
2481,
12,
1196,
1641,
12,
1196,
2010,
12,
1196,
1427,
12,
1196,
2259,
12,
1196,
2976,
12,
1196,
2789,
12,
1695,
1367,
12,
199,
650,
1602,
12,
1196,
2766,
12,
1196,
772,
12,
1196,
2182,
12,
1196,
1272,
12,
221,
17838,
12,
13952,
12,
841,
1085,
12,
5939,
22,
12,
1749,
1717,
12,
8264,
24,
12,
1196,
1822,
12,
1196,
2333,
12,
1196,
1876,
12,
1749,
2466,
12,
713,
1717,
12,
199,
1520,
1643,
12,
8881,
16,
12,
845,
1085,
12,
8881,
17,
12,
499,
2953,
12,
8881,
18,
12,
8881,
19,
12,
8881,
20,
12,
713,
3172,
12,
8881,
21,
12,
959,
1876,
12,
8881,
22,
12,
22291,
12,
8881,
23,
12,
8881,
24,
12,
8881,
25,
12,
199,
1196,
1257,
12,
650,
1401,
12,
1520,
2869,
12,
709,
2010,
12,
221,
7294,
12,
1227,
1651,
12,
22540,
12,
1196,
2835,
12,
413,
1138,
12,
1749,
1690,
12,
27632,
12,
650,
1887,
12,
221,
15601,
12,
709,
1965,
12,
1196,
2564,
12,
221,
5851,
12,
199,
1196,
2658,
12,
650,
1965,
12,
1196,
1349,
12,
650,
1046,
12,
1196,
2426,
12,
1227,
1398,
12,
1520,
1477,
12,
29840,
12,
959,
1427,
12,
1196,
1184,
12,
1227,
1344,
12,
29202,
12,
713,
1690,
12,
1196,
1555,
12,
1520,
709,
12,
959,
1822,
12,
199,
1196,
1299,
12,
1749,
1276,
12,
1695,
1079,
12,
1196,
1407,
12,
1196,
2710,
12,
713,
1780,
12,
1520,
1272,
12,
959,
1651,
12,
1196,
3328,
12,
1196,
2942,
12,
713,
2036,
12,
1196,
3129,
12,
1196,
2635,
12,
1196,
2720,
12,
1196,
2534,
12,
1196,
2576,
12,
199,
1079,
1644,
12,
1196,
2905,
12,
1196,
1020,
12,
959,
1153,
12,
709,
1427,
12,
1079,
966,
12,
1079,
1717,
12,
845,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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
] |
chadnetzer/numpy-gaurdro
|
numpy/doc/ufuncs.py
|
6
|
5520
|
"""
===================
Universal Functions
===================
Ufuncs are, generally speaking, mathematical functions or operations that are
applied element-by-element to the contents of an array. That is, the result
in each output array element only depends on the value in the corresponding
input array (or arrays) and on no other array elements. Numpy comes with a
large suite of ufuncs, and scipy extends that suite substantially. The simplest
example is the addition operator: ::
>>> np.array([0,2,3,4]) + np.array([1,1,-1,2])
array([1, 3, 2, 6])
The unfunc module lists all the available ufuncs in numpy. Additional ufuncts
available in xxx in scipy. Documentation on the specific ufuncs may be found
in those modules. This documentation is intended to address the more general
aspects of unfuncs common to most of them. All of the ufuncs that make use of
Python operators (e.g., +, -, etc.) have equivalent functions defined
(e.g. add() for +)
Type coercion
=============
What happens when a binary operator (e.g., +,-,\\*,/, etc) deals with arrays of
two different types? What is the type of the result? Typically, the result is
the higher of the two types. For example: ::
float32 + float64 -> float64
int8 + int32 -> int32
int16 + float32 -> float32
float32 + complex64 -> complex64
There are some less obvious cases generally involving mixes of types
(e.g. uints, ints and floats) where equal bit sizes for each are not
capable of saving all the information in a different type of equivalent
bit size. Some examples are int32 vs float32 or uint32 vs int32.
Generally, the result is the higher type of larger size than both
(if available). So: ::
int32 + float32 -> float64
uint32 + int32 -> int64
Finally, the type coercion behavior when expressions involve Python
scalars is different than that seen for arrays. Since Python has a
limited number of types, combining a Python int with a dtype=np.int8
array does not coerce to the higher type but instead, the type of the
array prevails. So the rules for Python scalars combined with arrays is
that the result will be that of the array equivalent the Python scalar
if the Python scalar is of a higher 'kind' than the array (e.g., float
vs. int), otherwise the resultant type will be that of the array.
For example: ::
Python int + int8 -> int8
Python float + int8 -> float64
ufunc methods
=============
Binary ufuncs support 4 methods. These methods are explained in detail in xxx
(or are they, I don't see anything in the ufunc docstring that is useful?).
**.reduce(arr)** applies the binary operator to elements of the array in sequence. For example: ::
>>> np.add.reduce(np.arange(10)) # adds all elements of array
45
For multidimensional arrays, the first dimension is reduced by default: ::
>>> np.add.reduce(np.arange(10).reshape(2,5))
array([ 5, 7, 9, 11, 13])
The axis keyword can be used to specify different axes to reduce: ::
>>> np.add.reduce(np.arange(10).reshape(2,5),axis=1)
array([10, 35])
**.accumulate(arr)** applies the binary operator and generates an an equivalently
shaped array that includes the accumulated amount for each element of the
array. A couple examples: ::
>>> np.add.accumulate(np.arange(10))
array([ 0, 1, 3, 6, 10, 15, 21, 28, 36, 45])
>>> np.multiply.accumulate(np.arange(1,9))
array([ 1, 2, 6, 24, 120, 720, 5040, 40320])
The behavior for multidimensional arrays is the same as for .reduce(), as is the use of the axis keyword).
**.reduceat(arr,indices)** allows one to apply reduce to selected parts of an array.
It is a difficult method to understand. See the documentation at:
**.outer(arr1,arr2)** generates an outer operation on the two arrays arr1 and arr2. It will work on multidimensional arrays (the shape of the result is the
concatenation of the two input shapes.: ::
>>> np.multiply.outer(np.arange(3),np.arange(4))
array([[0, 0, 0, 0],
[0, 1, 2, 3],
[0, 2, 4, 6]])
Output arguments
================
All ufuncs accept an optional output array. The array must be of the expected output shape. Beware that if the type of the output array is of a
different (and lower) type than the output result, the results may be silently
truncated or otherwise corrupted in the downcast to the lower type. This usage
is useful when one wants to avoid creating large temporary arrays and instead
allows one to reuse the same array memory repeatedly (at the expense of not
being able to use more convenient operator notation in expressions). Note that
when the output argument is used, the ufunc still returns a reference to the
result.
>>> x = np.arange(2)
>>> np.add(np.arange(2),np.arange(2.),x)
array([0, 2])
>>> x
array([0, 2])
and & or as ufuncs
==================
Invariably people try to use the python 'and' and 'or' as logical operators
(and quite understandably). But these operators do not behave as normal
operators since Python treats these quite differently. They cannot be
overloaded with array equivalents. Thus using 'and' or 'or' with an array
results in an error. There are two alternatives:
1) use the ufunc functions logical_and() and logical_or().
2) use the bitwise operators & and \\|. The drawback of these is that if
the arguments to these operators are not boolean arrays, the result is
likely incorrect. On the other hand, most usages of logical_and and
logical_or are with boolean arrays. As long as one is careful, this is
a convenient way to apply these operators.
"""
|
bsd-3-clause
|
[
624,
199,
1280,
5918,
199,
1358,
10959,
17471,
199,
1280,
5918,
199,
199,
53,
9204,
787,
12,
16711,
308,
8556,
316,
12,
610,
28491,
3423,
503,
5331,
626,
787,
199,
17250,
1819,
13,
991,
13,
2108,
370,
314,
4072,
402,
376,
1625,
14,
10314,
365,
12,
314,
754,
199,
262,
1924,
1072,
1625,
1819,
1454,
8350,
641,
314,
574,
315,
314,
5226,
199,
1210,
1625,
334,
269,
6572,
9,
436,
641,
949,
1163,
1625,
4008,
14,
20535,
12477,
543,
282,
199,
9629,
5241,
402,
399,
9204,
12,
436,
7026,
16879,
626,
5241,
27321,
4466,
1183,
14,
710,
3486,
270,
199,
2694,
365,
314,
10234,
4182,
26,
3800,
421,
1306,
980,
14,
1144,
779,
16,
12,
18,
12,
19,
12,
20,
566,
435,
980,
14,
1144,
779,
17,
12,
17,
3057,
17,
12,
18,
566,
199,
1625,
779,
17,
12,
650,
12,
499,
12,
1227,
566,
199,
199,
1918,
625,
1532,
859,
5548,
1006,
314,
2808,
399,
9204,
315,
2680,
14,
10961,
399,
7036,
3021,
199,
4561,
315,
26571,
315,
7026,
14,
15249,
641,
314,
2488,
399,
9204,
1443,
506,
1911,
199,
262,
5204,
4621,
14,
961,
3794,
365,
11619,
370,
2287,
314,
1655,
8605,
199,
18658,
83,
402,
625,
9204,
2863,
370,
4750,
402,
3062,
14,
2900,
402,
314,
399,
9204,
626,
1852,
675,
402,
199,
4718,
10211,
334,
69,
14,
71,
2020,
435,
12,
446,
12,
5423,
4959,
1172,
7353,
3423,
3247,
199,
8,
69,
14,
71,
14,
1050,
342,
367,
435,
9,
199,
199,
804,
32021,
199,
9152,
199,
199,
21015,
10986,
1380,
282,
3366,
4182,
334,
69,
14,
71,
2020,
435,
3057,
12,
1103,
10381,
15,
12,
5423,
9,
477,
2551,
543,
6572,
402,
199,
5601,
3365,
2943,
31,
14791,
365,
314,
730,
402,
314,
754,
31,
26914,
12,
314,
754,
365,
199,
1589,
10948,
402,
314,
2877,
2943,
14,
2104,
2893,
26,
3800,
421,
2069,
708,
435,
2069,
772,
1035,
2069,
772,
199,
1109,
24,
435,
1109,
708,
1035,
1109,
708,
199,
1109,
975,
435,
2069,
708,
1035,
2069,
708,
199,
2069,
708,
435,
6114,
772,
1035,
6114,
772,
199,
199,
10924,
787,
2005,
6656,
25259,
5560,
16711,
25613,
4007,
13667,
397,
402,
2943,
199,
8,
69,
14,
71,
14,
3152,
83,
12,
14526,
436,
15657,
9,
2382,
4472,
4546,
10627,
367,
1924,
787,
440,
199,
2874,
461,
402,
13369,
1006,
314,
2556,
315,
282,
3365,
730,
402,
7353,
199,
2075,
1568,
14,
6601,
7251,
787,
1109,
708,
8118,
2069,
708,
503,
3152,
708,
8118,
1109,
708,
14,
199,
3139,
1183,
12,
314,
754,
365,
314,
10948,
730,
402,
12142,
1568,
2419,
3865,
199,
8,
692,
2808,
680,
2002,
26,
3800,
421,
1109,
708,
435,
2069,
708,
1035,
2069,
772,
199,
3152,
708,
435,
1109,
708,
1035,
1109,
772,
199,
199,
8694,
1183,
12,
314,
730,
32021,
5953,
1380,
8455,
4572,
3344,
2018,
199,
4732,
4291,
365,
3365,
2419,
626,
6775,
367,
6572,
14,
9336,
2018,
965,
282,
199,
14136,
1329,
402,
2943,
12,
29391,
282,
2018,
1109,
543,
282,
2152,
29,
1590,
14,
442,
24,
199,
1144,
1630,
440,
19874,
370,
314,
10948,
730,
1325,
3140,
12,
314,
730,
402,
314,
199,
1144,
5071,
1054,
83,
14,
2002,
314,
4713,
367,
2018,
19945,
12149,
543,
6572,
365,
199,
9099,
314,
754,
911,
506,
626,
402,
314,
1625,
7353,
314,
2018,
6917,
199,
692,
314,
2018,
6917,
365,
402,
282,
10948,
283,
5091,
7,
2419,
314,
1625,
334,
69,
14,
71,
2020,
2069,
199,
3122,
14,
1109,
395,
4257,
314,
754,
867,
730,
911,
506,
626,
402,
314,
1625,
14,
199,
1858,
2893,
26,
3800,
819,
2018,
1109,
435,
1109,
24,
1035,
1109,
24,
523,
2018,
2069,
435,
1109,
24,
1035,
2069,
772,
199,
199,
18810,
3102,
199,
9152,
199,
199,
6636,
399,
9204,
2291,
841,
3102,
14,
5723,
3102,
787,
1437,
23918,
315,
10093,
315,
26571,
199,
8,
269,
787,
2985,
12,
473,
2793,
1133,
1937,
7003,
315,
314,
30149,
9214,
626,
365,
2997,
31,
680,
199,
199,
538,
14,
5270,
8,
5250,
6422,
12966,
314,
3366,
4182,
370,
4008,
402,
314,
1625,
315,
3414,
14,
2104,
2893,
26,
3800,
421,
1306,
980,
14,
525,
14,
5270,
8,
1590,
14,
5605,
8,
709,
430,
221,
327,
9584,
1006,
4008,
402,
1625,
199,
10416,
199,
199,
1858,
3510,
13014,
6572,
12,
314,
1642,
6240,
365,
14953,
701,
849,
26,
3800,
421,
1306,
980,
14,
525,
14,
5270,
8,
1590,
14,
5605,
8,
709,
680,
5217,
8,
18,
12,
21,
430,
1362,
1625,
779,
959,
12,
221,
1520,
12,
221,
1749,
12,
4119,
12,
4944,
566,
199,
199,
1918,
3114,
4252,
883,
506,
1202,
370,
4165,
3365,
7824,
370,
7114,
26,
3800,
421,
1306,
980,
14,
525,
14,
5270,
8,
1590,
14,
5605,
8,
709,
680,
5217,
8,
18,
12,
21,
395,
3127,
29,
17,
9,
199,
1625,
779,
709,
12,
8685,
566,
199,
199,
538,
14,
13223,
5434,
8,
5250,
6422,
12966,
314,
3366,
4182,
436,
12821,
376,
376,
7353,
590,
199,
1392,
68,
1625,
626,
6952,
314,
29845,
5982,
367,
1924,
1819,
402,
314,
199,
1144,
14,
437,
17535,
7251,
26,
3800,
421,
1306,
980,
14,
525,
14,
13223,
5434,
8,
1590,
14,
5605,
8,
709,
430,
199,
1625,
779,
378,
12,
221,
413,
12,
221,
650,
12,
221,
1227,
12,
1616,
12,
4114,
12,
7829,
12,
7294,
12,
8780,
12,
10416,
566,
199,
1306,
221,
980,
14,
13710,
14,
13223,
5434,
8,
1590,
14,
5605,
8,
17,
12,
25,
430,
199,
1625,
779,
259,
413,
12,
258,
499,
12,
258,
1227,
12,
259,
5504,
12,
257,
13960,
12,
257,
29692,
12,
221,
959,
11189,
12,
6335,
12122,
566,
199,
199,
1918,
5953,
367,
3510,
13014,
6572,
365,
314,
2011,
465,
367,
1275,
5270,
1062,
465,
365,
314,
675,
402,
314,
3114,
4252,
680,
199,
199,
538,
14,
5270,
292,
8,
5250,
12,
4108,
6422,
6127,
1373,
370,
4838,
7114,
370,
4895,
4184,
402,
376,
1625,
14,
199,
7940,
365,
282,
29870,
1083,
370,
20647,
14,
1666,
314,
3794,
737,
26,
199,
199,
538,
14,
7837,
8,
5250,
17,
12,
5250,
18,
6422,
12821,
376,
6890,
3439,
641,
314,
2877,
6572,
7953,
17,
436,
7953,
18,
14,
2779,
911,
1736,
641,
3510,
13014,
6572,
334,
1589,
2215,
402,
314
] |
[
199,
1280,
5918,
199,
1358,
10959,
17471,
199,
1280,
5918,
199,
199,
53,
9204,
787,
12,
16711,
308,
8556,
316,
12,
610,
28491,
3423,
503,
5331,
626,
787,
199,
17250,
1819,
13,
991,
13,
2108,
370,
314,
4072,
402,
376,
1625,
14,
10314,
365,
12,
314,
754,
199,
262,
1924,
1072,
1625,
1819,
1454,
8350,
641,
314,
574,
315,
314,
5226,
199,
1210,
1625,
334,
269,
6572,
9,
436,
641,
949,
1163,
1625,
4008,
14,
20535,
12477,
543,
282,
199,
9629,
5241,
402,
399,
9204,
12,
436,
7026,
16879,
626,
5241,
27321,
4466,
1183,
14,
710,
3486,
270,
199,
2694,
365,
314,
10234,
4182,
26,
3800,
421,
1306,
980,
14,
1144,
779,
16,
12,
18,
12,
19,
12,
20,
566,
435,
980,
14,
1144,
779,
17,
12,
17,
3057,
17,
12,
18,
566,
199,
1625,
779,
17,
12,
650,
12,
499,
12,
1227,
566,
199,
199,
1918,
625,
1532,
859,
5548,
1006,
314,
2808,
399,
9204,
315,
2680,
14,
10961,
399,
7036,
3021,
199,
4561,
315,
26571,
315,
7026,
14,
15249,
641,
314,
2488,
399,
9204,
1443,
506,
1911,
199,
262,
5204,
4621,
14,
961,
3794,
365,
11619,
370,
2287,
314,
1655,
8605,
199,
18658,
83,
402,
625,
9204,
2863,
370,
4750,
402,
3062,
14,
2900,
402,
314,
399,
9204,
626,
1852,
675,
402,
199,
4718,
10211,
334,
69,
14,
71,
2020,
435,
12,
446,
12,
5423,
4959,
1172,
7353,
3423,
3247,
199,
8,
69,
14,
71,
14,
1050,
342,
367,
435,
9,
199,
199,
804,
32021,
199,
9152,
199,
199,
21015,
10986,
1380,
282,
3366,
4182,
334,
69,
14,
71,
2020,
435,
3057,
12,
1103,
10381,
15,
12,
5423,
9,
477,
2551,
543,
6572,
402,
199,
5601,
3365,
2943,
31,
14791,
365,
314,
730,
402,
314,
754,
31,
26914,
12,
314,
754,
365,
199,
1589,
10948,
402,
314,
2877,
2943,
14,
2104,
2893,
26,
3800,
421,
2069,
708,
435,
2069,
772,
1035,
2069,
772,
199,
1109,
24,
435,
1109,
708,
1035,
1109,
708,
199,
1109,
975,
435,
2069,
708,
1035,
2069,
708,
199,
2069,
708,
435,
6114,
772,
1035,
6114,
772,
199,
199,
10924,
787,
2005,
6656,
25259,
5560,
16711,
25613,
4007,
13667,
397,
402,
2943,
199,
8,
69,
14,
71,
14,
3152,
83,
12,
14526,
436,
15657,
9,
2382,
4472,
4546,
10627,
367,
1924,
787,
440,
199,
2874,
461,
402,
13369,
1006,
314,
2556,
315,
282,
3365,
730,
402,
7353,
199,
2075,
1568,
14,
6601,
7251,
787,
1109,
708,
8118,
2069,
708,
503,
3152,
708,
8118,
1109,
708,
14,
199,
3139,
1183,
12,
314,
754,
365,
314,
10948,
730,
402,
12142,
1568,
2419,
3865,
199,
8,
692,
2808,
680,
2002,
26,
3800,
421,
1109,
708,
435,
2069,
708,
1035,
2069,
772,
199,
3152,
708,
435,
1109,
708,
1035,
1109,
772,
199,
199,
8694,
1183,
12,
314,
730,
32021,
5953,
1380,
8455,
4572,
3344,
2018,
199,
4732,
4291,
365,
3365,
2419,
626,
6775,
367,
6572,
14,
9336,
2018,
965,
282,
199,
14136,
1329,
402,
2943,
12,
29391,
282,
2018,
1109,
543,
282,
2152,
29,
1590,
14,
442,
24,
199,
1144,
1630,
440,
19874,
370,
314,
10948,
730,
1325,
3140,
12,
314,
730,
402,
314,
199,
1144,
5071,
1054,
83,
14,
2002,
314,
4713,
367,
2018,
19945,
12149,
543,
6572,
365,
199,
9099,
314,
754,
911,
506,
626,
402,
314,
1625,
7353,
314,
2018,
6917,
199,
692,
314,
2018,
6917,
365,
402,
282,
10948,
283,
5091,
7,
2419,
314,
1625,
334,
69,
14,
71,
2020,
2069,
199,
3122,
14,
1109,
395,
4257,
314,
754,
867,
730,
911,
506,
626,
402,
314,
1625,
14,
199,
1858,
2893,
26,
3800,
819,
2018,
1109,
435,
1109,
24,
1035,
1109,
24,
523,
2018,
2069,
435,
1109,
24,
1035,
2069,
772,
199,
199,
18810,
3102,
199,
9152,
199,
199,
6636,
399,
9204,
2291,
841,
3102,
14,
5723,
3102,
787,
1437,
23918,
315,
10093,
315,
26571,
199,
8,
269,
787,
2985,
12,
473,
2793,
1133,
1937,
7003,
315,
314,
30149,
9214,
626,
365,
2997,
31,
680,
199,
199,
538,
14,
5270,
8,
5250,
6422,
12966,
314,
3366,
4182,
370,
4008,
402,
314,
1625,
315,
3414,
14,
2104,
2893,
26,
3800,
421,
1306,
980,
14,
525,
14,
5270,
8,
1590,
14,
5605,
8,
709,
430,
221,
327,
9584,
1006,
4008,
402,
1625,
199,
10416,
199,
199,
1858,
3510,
13014,
6572,
12,
314,
1642,
6240,
365,
14953,
701,
849,
26,
3800,
421,
1306,
980,
14,
525,
14,
5270,
8,
1590,
14,
5605,
8,
709,
680,
5217,
8,
18,
12,
21,
430,
1362,
1625,
779,
959,
12,
221,
1520,
12,
221,
1749,
12,
4119,
12,
4944,
566,
199,
199,
1918,
3114,
4252,
883,
506,
1202,
370,
4165,
3365,
7824,
370,
7114,
26,
3800,
421,
1306,
980,
14,
525,
14,
5270,
8,
1590,
14,
5605,
8,
709,
680,
5217,
8,
18,
12,
21,
395,
3127,
29,
17,
9,
199,
1625,
779,
709,
12,
8685,
566,
199,
199,
538,
14,
13223,
5434,
8,
5250,
6422,
12966,
314,
3366,
4182,
436,
12821,
376,
376,
7353,
590,
199,
1392,
68,
1625,
626,
6952,
314,
29845,
5982,
367,
1924,
1819,
402,
314,
199,
1144,
14,
437,
17535,
7251,
26,
3800,
421,
1306,
980,
14,
525,
14,
13223,
5434,
8,
1590,
14,
5605,
8,
709,
430,
199,
1625,
779,
378,
12,
221,
413,
12,
221,
650,
12,
221,
1227,
12,
1616,
12,
4114,
12,
7829,
12,
7294,
12,
8780,
12,
10416,
566,
199,
1306,
221,
980,
14,
13710,
14,
13223,
5434,
8,
1590,
14,
5605,
8,
17,
12,
25,
430,
199,
1625,
779,
259,
413,
12,
258,
499,
12,
258,
1227,
12,
259,
5504,
12,
257,
13960,
12,
257,
29692,
12,
221,
959,
11189,
12,
6335,
12122,
566,
199,
199,
1918,
5953,
367,
3510,
13014,
6572,
365,
314,
2011,
465,
367,
1275,
5270,
1062,
465,
365,
314,
675,
402,
314,
3114,
4252,
680,
199,
199,
538,
14,
5270,
292,
8,
5250,
12,
4108,
6422,
6127,
1373,
370,
4838,
7114,
370,
4895,
4184,
402,
376,
1625,
14,
199,
7940,
365,
282,
29870,
1083,
370,
20647,
14,
1666,
314,
3794,
737,
26,
199,
199,
538,
14,
7837,
8,
5250,
17,
12,
5250,
18,
6422,
12821,
376,
6890,
3439,
641,
314,
2877,
6572,
7953,
17,
436,
7953,
18,
14,
2779,
911,
1736,
641,
3510,
13014,
6572,
334,
1589,
2215,
402,
314,
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,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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
] |
alacritythief/django-allauth
|
allauth/socialaccount/south_migrations/0008_client_id.py
|
78
|
6323
|
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
for app in orm.SocialApp.objects.all():
app.client_id = app.key
app.key = ''
app.save()
def backwards(self, orm):
"Write your backwards methods here."
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 12, 22, 12, 51, 18, 10544)'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 12, 22, 12, 51, 18, 10426)'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'sites.site': {
'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'socialaccount.socialaccount': {
'Meta': {'unique_together': "(('provider', 'uid'),)", 'object_name': 'SocialAccount'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'extra_data': ('allauth.socialaccount.fields.JSONField', [], {'default': "'{}'"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'provider': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
'uid': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'socialaccount.socialapp': {
'Meta': {'object_name': 'SocialApp'},
'client_id': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'key': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
'provider': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
'secret': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'sites': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sites.Site']", 'symmetrical': 'False', 'blank': 'True'})
},
'socialaccount.socialtoken': {
'Meta': {'unique_together': "(('app', 'account'),)", 'object_name': 'SocialToken'},
'account': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['socialaccount.SocialAccount']"}),
'app': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['socialaccount.SocialApp']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'token': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'token_secret': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'})
}
}
complete_apps = ['socialaccount']
|
mit
|
[
3,
2644,
26,
2774,
13,
24,
199,
646,
2197,
199,
504,
12919,
14,
697,
492,
1592,
199,
504,
12919,
14,
86,
18,
492,
3918,
9816,
199,
504,
1639,
14,
697,
492,
1709,
199,
199,
533,
12090,
8,
1451,
9816,
304,
339,
347,
17465,
8,
277,
12,
9813,
304,
267,
298,
3534,
2195,
17465,
3102,
2348,
2122,
267,
367,
1145,
315,
9813,
14,
31356,
2640,
14,
1462,
14,
452,
837,
288,
1145,
14,
1258,
63,
344,
275,
1145,
14,
498,
288,
1145,
14,
498,
275,
2125,
288,
1145,
14,
2117,
342,
339,
347,
8552,
8,
277,
12,
9813,
304,
267,
298,
3534,
2195,
8552,
3102,
2348,
2122,
2378,
1709,
275,
469,
267,
283,
1178,
14,
923,
356,
469,
288,
283,
3396,
356,
791,
785,
63,
354,
356,
283,
2448,
2267,
288,
283,
344,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
297,
990,
791,
3327,
63,
498,
356,
283,
549,
1604,
288,
283,
354,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
3235,
356,
283,
549,
297,
283,
988,
63,
1267,
356,
283,
1257,
1604,
288,
283,
6060,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
7624,
297,
990,
791,
475,
356,
298,
1025,
459,
1178,
14,
7980,
6256,
283,
10247,
356,
283,
797,
297,
283,
2500,
356,
283,
549,
3071,
267,
1660,
267,
283,
1178,
14,
5693,
356,
469,
288,
283,
3396,
356,
791,
7128,
356,
16111,
1317,
63,
466,
363,
571,
63,
1302,
297,
283,
1317,
63,
466,
363,
1238,
297,
283,
11879,
18106,
283,
3235,
63,
6314,
356,
9510,
1317,
63,
466,
297,
283,
11879,
9878,
283,
785,
63,
354,
356,
283,
7980,
2267,
288,
283,
11879,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1960,
1604,
288,
283,
1317,
63,
466,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
3190,
297,
990,
791,
475,
356,
298,
1025,
459,
10778,
14,
11282,
6097,
288,
283,
344,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
297,
990,
791,
3327,
63,
498,
356,
283,
549,
1604,
288,
283,
354,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1400,
3071,
267,
1660,
267,
283,
1178,
14,
751,
356,
469,
288,
283,
3396,
356,
791,
785,
63,
354,
356,
283,
1899,
2267,
288,
283,
602,
63,
11806,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4626,
297,
990,
791,
885,
356,
283,
2083,
14,
2083,
8,
7409,
12,
3144,
12,
6928,
12,
3144,
12,
8026,
12,
6155,
12,
1616,
16298,
9,
1604,
288,
283,
2123,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
16577,
297,
990,
791,
988,
63,
1267,
356,
283,
2194,
297,
283,
2500,
356,
283,
549,
1604,
288,
283,
2246,
63,
354,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1216,
297,
283,
2500,
356,
283,
549,
1604,
288,
283,
2634,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
7624,
297,
990,
791,
475,
356,
298,
1025,
459,
1178,
14,
2448,
6256,
283,
10247,
356,
283,
797,
297,
283,
2500,
356,
283,
549,
1604,
288,
283,
344,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
297,
990,
791,
3327,
63,
498,
356,
283,
549,
1604,
288,
283,
374,
63,
2682,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
5036,
297,
990,
791,
885,
356,
283,
549,
1604,
288,
283,
374,
63,
7018,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
5036,
297,
990,
791,
885,
356,
283,
797,
1604,
288,
283,
374,
63,
11434,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
5036,
297,
990,
791,
885,
356,
283,
797,
1604,
288,
283,
2019,
63,
2886,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4626,
297,
990,
791,
885,
356,
283,
2083,
14,
2083,
8,
7409,
12,
3144,
12,
6928,
12,
3144,
12,
8026,
12,
6155,
12,
21083,
1479,
9,
1604,
288,
283,
2019,
63,
354,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1216,
297,
283,
2500,
356,
283,
549,
1604,
288,
283,
2060,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
3933,
1604,
288,
283,
751,
63,
6060,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
7624,
297,
990,
791,
475,
356,
298,
1025,
459,
1178,
14,
7980,
6256,
283,
10247,
356,
283,
797,
297,
283,
2500,
356,
283,
549,
1604,
288,
283,
2473,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
3235,
356,
283,
549,
297,
283,
988,
63,
1267,
356,
283,
1216,
3071,
267,
1660,
267,
283,
10778,
14,
20735,
356,
469,
288,
283,
3396,
356,
791,
7128,
356,
16111,
354,
21099,
283,
3235,
63,
6314,
356,
9510,
571,
63,
1302,
297,
283,
1238,
9878,
283,
785,
63,
354,
356,
283,
11282,
297,
283,
697,
63,
1224,
356,
3546,
1176,
63,
1317,
63,
466,
15208,
288,
283,
571,
63,
1302,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1960,
1604,
288,
283,
344,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
297,
990,
791,
3327,
63,
498,
356,
283,
549,
1604,
288,
283,
1238,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1960,
1604,
288,
283,
354,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1960,
3071,
267,
1660,
267,
283,
8619,
14,
2124,
356,
469,
288,
283,
3396,
356,
791,
7128,
356,
16111,
2261,
21099,
283,
785,
63,
354,
356,
283,
8972,
297,
283,
697,
63,
1224,
356,
3546,
1176,
63,
2124,
15208,
288,
283,
2261,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1960,
1604,
288
] |
[
2644,
26,
2774,
13,
24,
199,
646,
2197,
199,
504,
12919,
14,
697,
492,
1592,
199,
504,
12919,
14,
86,
18,
492,
3918,
9816,
199,
504,
1639,
14,
697,
492,
1709,
199,
199,
533,
12090,
8,
1451,
9816,
304,
339,
347,
17465,
8,
277,
12,
9813,
304,
267,
298,
3534,
2195,
17465,
3102,
2348,
2122,
267,
367,
1145,
315,
9813,
14,
31356,
2640,
14,
1462,
14,
452,
837,
288,
1145,
14,
1258,
63,
344,
275,
1145,
14,
498,
288,
1145,
14,
498,
275,
2125,
288,
1145,
14,
2117,
342,
339,
347,
8552,
8,
277,
12,
9813,
304,
267,
298,
3534,
2195,
8552,
3102,
2348,
2122,
2378,
1709,
275,
469,
267,
283,
1178,
14,
923,
356,
469,
288,
283,
3396,
356,
791,
785,
63,
354,
356,
283,
2448,
2267,
288,
283,
344,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
297,
990,
791,
3327,
63,
498,
356,
283,
549,
1604,
288,
283,
354,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
3235,
356,
283,
549,
297,
283,
988,
63,
1267,
356,
283,
1257,
1604,
288,
283,
6060,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
7624,
297,
990,
791,
475,
356,
298,
1025,
459,
1178,
14,
7980,
6256,
283,
10247,
356,
283,
797,
297,
283,
2500,
356,
283,
549,
3071,
267,
1660,
267,
283,
1178,
14,
5693,
356,
469,
288,
283,
3396,
356,
791,
7128,
356,
16111,
1317,
63,
466,
363,
571,
63,
1302,
297,
283,
1317,
63,
466,
363,
1238,
297,
283,
11879,
18106,
283,
3235,
63,
6314,
356,
9510,
1317,
63,
466,
297,
283,
11879,
9878,
283,
785,
63,
354,
356,
283,
7980,
2267,
288,
283,
11879,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1960,
1604,
288,
283,
1317,
63,
466,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
3190,
297,
990,
791,
475,
356,
298,
1025,
459,
10778,
14,
11282,
6097,
288,
283,
344,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
297,
990,
791,
3327,
63,
498,
356,
283,
549,
1604,
288,
283,
354,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1400,
3071,
267,
1660,
267,
283,
1178,
14,
751,
356,
469,
288,
283,
3396,
356,
791,
785,
63,
354,
356,
283,
1899,
2267,
288,
283,
602,
63,
11806,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4626,
297,
990,
791,
885,
356,
283,
2083,
14,
2083,
8,
7409,
12,
3144,
12,
6928,
12,
3144,
12,
8026,
12,
6155,
12,
1616,
16298,
9,
1604,
288,
283,
2123,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
16577,
297,
990,
791,
988,
63,
1267,
356,
283,
2194,
297,
283,
2500,
356,
283,
549,
1604,
288,
283,
2246,
63,
354,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1216,
297,
283,
2500,
356,
283,
549,
1604,
288,
283,
2634,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
7624,
297,
990,
791,
475,
356,
298,
1025,
459,
1178,
14,
2448,
6256,
283,
10247,
356,
283,
797,
297,
283,
2500,
356,
283,
549,
1604,
288,
283,
344,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
297,
990,
791,
3327,
63,
498,
356,
283,
549,
1604,
288,
283,
374,
63,
2682,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
5036,
297,
990,
791,
885,
356,
283,
549,
1604,
288,
283,
374,
63,
7018,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
5036,
297,
990,
791,
885,
356,
283,
797,
1604,
288,
283,
374,
63,
11434,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
5036,
297,
990,
791,
885,
356,
283,
797,
1604,
288,
283,
2019,
63,
2886,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4626,
297,
990,
791,
885,
356,
283,
2083,
14,
2083,
8,
7409,
12,
3144,
12,
6928,
12,
3144,
12,
8026,
12,
6155,
12,
21083,
1479,
9,
1604,
288,
283,
2019,
63,
354,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1216,
297,
283,
2500,
356,
283,
549,
1604,
288,
283,
2060,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
3933,
1604,
288,
283,
751,
63,
6060,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
7624,
297,
990,
791,
475,
356,
298,
1025,
459,
1178,
14,
7980,
6256,
283,
10247,
356,
283,
797,
297,
283,
2500,
356,
283,
549,
1604,
288,
283,
2473,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
3235,
356,
283,
549,
297,
283,
988,
63,
1267,
356,
283,
1216,
3071,
267,
1660,
267,
283,
10778,
14,
20735,
356,
469,
288,
283,
3396,
356,
791,
7128,
356,
16111,
354,
21099,
283,
3235,
63,
6314,
356,
9510,
571,
63,
1302,
297,
283,
1238,
9878,
283,
785,
63,
354,
356,
283,
11282,
297,
283,
697,
63,
1224,
356,
3546,
1176,
63,
1317,
63,
466,
15208,
288,
283,
571,
63,
1302,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1960,
1604,
288,
283,
344,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
297,
990,
791,
3327,
63,
498,
356,
283,
549,
1604,
288,
283,
1238,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1960,
1604,
288,
283,
354,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1960,
3071,
267,
1660,
267,
283,
8619,
14,
2124,
356,
469,
288,
283,
3396,
356,
791,
7128,
356,
16111,
2261,
21099,
283,
785,
63,
354,
356,
283,
8972,
297,
283,
697,
63,
1224,
356,
3546,
1176,
63,
2124,
15208,
288,
283,
2261,
356,
661,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
297,
990,
791,
988,
63,
1267,
356,
283,
1960,
1604,
288,
0
] |
[
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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r/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de>
#
# 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: vmware_dvswitch_pvlans
short_description: Manage Private VLAN configuration of a Distributed Switch
description:
- This module can be used to configure Private VLANs (PVLANs) on a Distributed Switch.
version_added: 2.8
author:
- Christian Kotte (@ckotte)
notes:
- Tested on vSphere 6.5 and 6.7
requirements:
- "python >= 2.6"
- PyVmomi
options:
switch:
description:
- The name of the Distributed Switch.
type: str
required: True
aliases: ['dvswitch']
primary_pvlans:
description:
- A list of VLAN IDs that should be configured as Primary PVLANs.
- If C(primary_pvlans) isn't specified, all PVLANs will be deleted if present.
- Each member of the list requires primary_pvlan_id (int) set.
- The secondary promiscuous PVLAN will be created automatically.
- If C(secondary_pvlans) isn't specified, the primary PVLANs and each secondary promiscuous PVLAN will be created.
- Please see examples for more information.
type: list
default: []
secondary_pvlans:
description:
- A list of VLAN IDs that should be configured as Secondary PVLANs.
- 'C(primary_pvlans) need to be specified to create any Secondary PVLAN.'
- If C(primary_pvlans) isn't specified, all PVLANs will be deleted if present.
- Each member of the list requires primary_pvlan_id (int), secondary_pvlan_id (int), and pvlan_type (str) to be set.
- The type of the secondary PVLAN can be isolated or community. The secondary promiscuous PVLAN will be created automatically.
- Please see examples for more information.
type: list
default: []
extends_documentation_fragment: vmware.documentation
'''
EXAMPLES = '''
- name: Create PVLANs on a Distributed Switch
vmware_dvswitch_pvlans:
hostname: '{{ inventory_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
switch: dvSwitch
primary_pvlans:
- primary_pvlan_id: 1
- primary_pvlan_id: 4
secondary_pvlans:
- primary_pvlan_id: 1
secondary_pvlan_id: 2
pvlan_type: isolated
- primary_pvlan_id: 1
secondary_pvlan_id: 3
pvlan_type: community
- primary_pvlan_id: 4
secondary_pvlan_id: 5
pvlan_type: community
delegate_to: localhost
- name: Create primary PVLAN and secondary promiscuous PVLAN on a Distributed Switch
vmware_dvswitch_pvlans:
hostname: '{{ inventory_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
switch: dvSwitch
primary_pvlans:
- primary_pvlan_id: 1
delegate_to: localhost
- name: Remove all PVLANs from a Distributed Switch
vmware_dvswitch_pvlans:
hostname: '{{ inventory_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
switch: dvSwitch
primary_pvlans: []
secondary_pvlans: []
delegate_to: localhost
'''
RETURN = """
result:
description: information about performed operation
returned: always
type: str
sample: {
"changed": true,
"dvswitch": "dvSwitch",
"private_vlans": [
{
"primary_pvlan_id": 1,
"pvlan_type": "promiscuous",
"secondary_pvlan_id": 1
},
{
"primary_pvlan_id": 1,
"pvlan_type": "isolated",
"secondary_pvlan_id": 2
},
{
"primary_pvlan_id": 1,
"pvlan_type": "community",
"secondary_pvlan_id": 3
}
],
"private_vlans_previous": [],
"result": "All private VLANs added"
}
"""
try:
from pyVmomi import vim
except ImportError:
pass
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_native
from ansible.module_utils.vmware import (
PyVmomi, TaskError, find_dvs_by_name, vmware_argument_spec, wait_for_task
)
class VMwareDvSwitchPvlans(PyVmomi):
"""Class to manage Private VLANs on a Distributed Virtual Switch"""
def __init__(self, module):
super(VMwareDvSwitchPvlans, self).__init__(module)
self.switch_name = self.module.params['switch']
if self.module.params['primary_pvlans']:
self.primary_pvlans = self.module.params['primary_pvlans']
if self.module.params['secondary_pvlans']:
self.secondary_pvlans = self.module.params['secondary_pvlans']
else:
self.secondary_pvlans = None
self.do_pvlan_sanity_checks()
else:
self.primary_pvlans = None
self.secondary_pvlans = None
self.dvs = find_dvs_by_name(self.content, self.switch_name)
if self.dvs is None:
self.module.fail_json(msg="Failed to find DVS %s" % self.switch_name)
def do_pvlan_sanity_checks(self):
"""Do sanity checks for primary and secondary PVLANs"""
# Check if primary PVLANs are unique
for primary_vlan in self.primary_pvlans:
count = 0
primary_pvlan_id = self.get_primary_pvlan_option(primary_vlan)
for primary_vlan_2 in self.primary_pvlans:
primary_pvlan_id_2 = self.get_primary_pvlan_option(primary_vlan_2)
if primary_pvlan_id == primary_pvlan_id_2:
count += 1
if count > 1:
self.module.fail_json(
msg="The primary PVLAN ID '%s' must be unique!" % primary_pvlan_id
)
if self.secondary_pvlans:
# Check if secondary PVLANs are unique
for secondary_pvlan in self.secondary_pvlans:
count = 0
result = self.get_secondary_pvlan_options(secondary_pvlan)
for secondary_pvlan_2 in self.secondary_pvlans:
result_2 = self.get_secondary_pvlan_options(secondary_pvlan_2)
if result[0] == result_2[0]:
count += 1
if count > 1:
self.module.fail_json(
msg="The secondary PVLAN ID '%s' must be unique!" % result[0]
)
# Check if secondary PVLANs are already used as primary PVLANs
for primary_vlan in self.primary_pvlans:
primary_pvlan_id = self.get_primary_pvlan_option(primary_vlan)
for secondary_pvlan in self.secondary_pvlans:
result = self.get_secondary_pvlan_options(secondary_pvlan)
if primary_pvlan_id == result[0]:
self.module.fail_json(
msg="The secondary PVLAN ID '%s' is already used as a primary PVLAN!" %
result[0]
)
# Check if a primary PVLAN is present for every secondary PVLANs
for secondary_pvlan in self.secondary_pvlans:
primary_pvlan_found = False
result = self.get_secondary_pvlan_options(secondary_pvlan)
for primary_vlan in self.primary_pvlans:
primary_pvlan_id = self.get_primary_pvlan_option(primary_vlan)
if result[1] == primary_pvlan_id:
primary_pvlan_found = True
break
if not primary_pvlan_found:
self.module.fail_json(
msg="The primary PVLAN ID '%s' isn't defined for the secondary PVLAN ID '%s'!" %
(result[1], result[0])
)
def ensure(self):
"""Manage Private VLANs"""
changed = False
results = dict(changed=changed)
results['dvswitch'] = self.switch_name
changed_list_add = []
changed_list_remove = []
config_spec = vim.dvs.VmwareDistributedVirtualSwitch.ConfigSpec()
# Use the same version in the new spec; The version will be increased by one by the API automatically
config_spec.configVersion = self.dvs.config.configVersion
# Check Private VLANs
results['private_vlans'] = None
if self.primary_pvlans:
desired_pvlan_list = []
for primary_vlan in self.primary_pvlans:
primary_pvlan_id = self.get_primary_pvlan_option(primary_vlan)
temp_pvlan = dict()
temp_pvlan['primary_pvlan_id'] = primary_pvlan_id
temp_pvlan['secondary_pvlan_id'] = primary_pvlan_id
temp_pvlan['pvlan_type'] = 'promiscuous'
desired_pvlan_list.append(temp_pvlan)
if self.secondary_pvlans:
for secondary_pvlan in self.secondary_pvlans:
(secondary_pvlan_id,
secondary_vlan_primary_vlan_id,
pvlan_type) = self.get_secondary_pvlan_options(secondary_pvlan)
temp_pvlan = dict()
temp_pvlan['primary_pvlan_id'] = secondary_vlan_primary_vlan_id
temp_pvlan['secondary_pvlan_id'] = secondary_pvlan_id
temp_pvlan['pvlan_type'] = pvlan_type
desired_pvlan_list.append(temp_pvlan)
results['private_vlans'] = desired_pvlan_list
if self.dvs.config.pvlanConfig:
pvlan_spec_list = []
# Check if desired PVLANs are configured
for primary_vlan in self.primary_pvlans:
primary_pvlan_id = self.get_primary_pvlan_option(primary_vlan)
promiscuous_found = other_found = False
for pvlan_object in self.dvs.config.pvlanConfig:
if pvlan_object.primaryVlanId == primary_pvlan_id and pvlan_object.pvlanType == 'promiscuous':
promiscuous_found = True
break
if not promiscuous_found:
changed = True
changed_list_add.append('promiscuous (%s, %s)' % (primary_pvlan_id, primary_pvlan_id))
pvlan_spec_list.append(
self.create_pvlan_config_spec(
operation='add',
primary_pvlan_id=primary_pvlan_id,
secondary_pvlan_id=primary_pvlan_id,
pvlan_type='promiscuous'
)
)
if self.secondary_pvlans:
for secondary_pvlan in self.secondary_pvlans:
(secondary_pvlan_id,
secondary_vlan_primary_vlan_id,
pvlan_type) = self.get_secondary_pvlan_options(secondary_pvlan)
if primary_pvlan_id == secondary_vlan_primary_vlan_id:
for pvlan_object_2 in self.dvs.config.pvlanConfig:
if (pvlan_object_2.primaryVlanId == secondary_vlan_primary_vlan_id
and pvlan_object_2.secondaryVlanId == secondary_pvlan_id
and pvlan_object_2.pvlanType == pvlan_type):
other_found = True
break
if not other_found:
changed = True
changed_list_add.append(
'%s (%s, %s)' % (pvlan_type, primary_pvlan_id, secondary_pvlan_id)
)
pvlan_spec_list.append(
self.create_pvlan_config_spec(
operation='add',
primary_pvlan_id=primary_pvlan_id,
secondary_pvlan_id=secondary_pvlan_id,
pvlan_type=pvlan_type
)
)
# Check if a PVLAN needs to be removed
for pvlan_object in self.dvs.config.pvlanConfig:
promiscuous_found = other_found = False
if (pvlan_object.primaryVlanId == pvlan_object.secondaryVlanId
and pvlan_object.pvlanType == 'promiscuous'):
for primary_vlan in self.primary_pvlans:
primary_pvlan_id = self.get_primary_pvlan_option(primary_vlan)
if pvlan_object.primaryVlanId == primary_pvlan_id and pvlan_object.pvlanType == 'promiscuous':
promiscuous_found = True
break
if not promiscuous_found:
changed = True
changed_list_remove.append(
'promiscuous (%s, %s)' % (pvlan_object.primaryVlanId, pvlan_object.secondaryVlanId)
)
pvlan_spec_list.append(
self.create_pvlan_config_spec(
operation='remove',
primary_pvlan_id=pvlan_object.primaryVlanId,
secondary_pvlan_id=pvlan_object.secondaryVlanId,
pvlan_type='promiscuous'
)
)
elif self.secondary_pvlans:
for secondary_pvlan in self.secondary_pvlans:
(secondary_pvlan_id,
secondary_vlan_primary_vlan_id,
pvlan_type) = self.get_secondary_pvlan_options(secondary_pvlan)
if (pvlan_object.primaryVlanId == secondary_vlan_primary_vlan_id
and pvlan_object.secondaryVlanId == secondary_pvlan_id
and pvlan_object.pvlanType == pvlan_type):
other_found = True
break
if not other_found:
changed = True
changed_list_remove.append(
'%s (%s, %s)' % (
pvlan_object.pvlanType, pvlan_object.primaryVlanId, pvlan_object.secondaryVlanId
)
)
pvlan_spec_list.append(
self.create_pvlan_config_spec(
operation='remove',
primary_pvlan_id=pvlan_object.primaryVlanId,
secondary_pvlan_id=pvlan_object.secondaryVlanId,
pvlan_type=pvlan_object.pvlanType
)
)
else:
changed = True
changed_list_remove.append(
'%s (%s, %s)' % (
pvlan_object.pvlanType, pvlan_object.primaryVlanId, pvlan_object.secondaryVlanId
)
)
pvlan_spec_list.append(
self.create_pvlan_config_spec(
operation='remove',
primary_pvlan_id=pvlan_object.primaryVlanId,
secondary_pvlan_id=pvlan_object.secondaryVlanId,
pvlan_type=pvlan_object.pvlanType
)
)
else:
changed = True
changed_list_add.append('All private VLANs')
pvlan_spec_list = []
for primary_vlan in self.primary_pvlans:
# the first secondary VLAN's type is always promiscuous
primary_pvlan_id = self.get_primary_pvlan_option(primary_vlan)
pvlan_spec_list.append(
self.create_pvlan_config_spec(
operation='add',
primary_pvlan_id=primary_pvlan_id,
secondary_pvlan_id=primary_pvlan_id,
pvlan_type='promiscuous'
)
)
if self.secondary_pvlans:
for secondary_pvlan in self.secondary_pvlans:
(secondary_pvlan_id,
secondary_vlan_primary_vlan_id,
pvlan_type) = self.get_secondary_pvlan_options(secondary_pvlan)
if primary_pvlan_id == secondary_vlan_primary_vlan_id:
pvlan_spec_list.append(
self.create_pvlan_config_spec(
operation='add',
primary_pvlan_id=primary_pvlan_id,
secondary_pvlan_id=secondary_pvlan_id,
pvlan_type=pvlan_type
)
)
else:
# Remove PVLAN configuration if present
if self.dvs.config.pvlanConfig:
changed = True
changed_list_remove.append('All private VLANs')
pvlan_spec_list = []
for pvlan_object in self.dvs.config.pvlanConfig:
pvlan_spec_list.append(
self.create_pvlan_config_spec(
operation='remove',
primary_pvlan_id=pvlan_object.primaryVlanId,
secondary_pvlan_id=pvlan_object.secondaryVlanId,
pvlan_type=pvlan_object.pvlanType
)
)
if changed:
message_add = message_remove = None
if changed_list_add:
message_add = self.build_change_message('add', changed_list_add)
if changed_list_remove:
message_remove = self.build_change_message('remove', changed_list_remove)
if message_add and message_remove:
message = message_add + '. ' + message_remove + '.'
elif message_add:
message = message_add
elif message_remove:
message = message_remove
current_pvlan_list = []
for pvlan_object in self.dvs.config.pvlanConfig:
temp_pvlan = dict()
temp_pvlan['primary_pvlan_id'] = pvlan_object.primaryVlanId
temp_pvlan['secondary_pvlan_id'] = pvlan_object.secondaryVlanId
temp_pvlan['pvlan_type'] = pvlan_object.pvlanType
current_pvlan_list.append(temp_pvlan)
results['private_vlans_previous'] = current_pvlan_list
config_spec.pvlanConfigSpec = pvlan_spec_list
if not self.module.check_mode:
try:
task = self.dvs.ReconfigureDvs_Task(config_spec)
wait_for_task(task)
except TaskError as invalid_argument:
self.module.fail_json(
msg="Failed to update DVS : %s" % to_native(invalid_argument)
)
else:
message = "PVLANs already configured properly"
results['changed'] = changed
results['result'] = message
self.module.exit_json(**results)
def get_primary_pvlan_option(self, primary_vlan):
"""Get Primary PVLAN option"""
primary_pvlan_id = primary_vlan.get('primary_pvlan_id', None)
if primary_pvlan_id is None:
self.module.fail_json(
msg="Please specify primary_pvlan_id in primary_pvlans options as it's a required parameter"
)
if primary_pvlan_id in (0, 4095):
self.module.fail_json(msg="The VLAN IDs of 0 and 4095 are reserved and cannot be used as a primary PVLAN.")
return primary_pvlan_id
def get_secondary_pvlan_options(self, secondary_pvlan):
"""Get Secondary PVLAN option"""
secondary_pvlan_id = secondary_pvlan.get('secondary_pvlan_id', None)
if secondary_pvlan_id is None:
self.module.fail_json(
msg="Please specify secondary_pvlan_id in secondary_pvlans options as it's a required parameter"
)
primary_pvlan_id = secondary_pvlan.get('primary_pvlan_id', None)
if primary_pvlan_id is None:
self.module.fail_json(
msg="Please specify primary_pvlan_id in secondary_pvlans options as it's a required parameter"
)
if secondary_pvlan_id in (0, 4095) or primary_pvlan_id in (0, 4095):
self.module.fail_json(
msg="The VLAN IDs of 0 and 4095 are reserved and cannot be used as a primary or secondary PVLAN."
)
pvlan_type = secondary_pvlan.get('pvlan_type', None)
supported_pvlan_types = ['isolated', 'community']
if pvlan_type is None:
self.module.fail_json(msg="Please specify pvlan_type in secondary_pvlans options as it's a required parameter")
elif pvlan_type not in supported_pvlan_types:
self.module.fail_json(msg="The specified PVLAN type '%s' isn't supported!" % pvlan_type)
return secondary_pvlan_id, primary_pvlan_id, pvlan_type
@staticmethod
def create_pvlan_config_spec(operation, primary_pvlan_id, secondary_pvlan_id, pvlan_type):
"""
Create PVLAN config spec
operation: add, edit, or remove
Returns: PVLAN config spec
"""
pvlan_spec = vim.dvs.VmwareDistributedVirtualSwitch.PvlanConfigSpec()
pvlan_spec.operation = operation
pvlan_spec.pvlanEntry = vim.dvs.VmwareDistributedVirtualSwitch.PvlanMapEntry()
pvlan_spec.pvlanEntry.primaryVlanId = primary_pvlan_id
pvlan_spec.pvlanEntry.secondaryVlanId = secondary_pvlan_id
pvlan_spec.pvlanEntry.pvlanType = pvlan_type
return pvlan_spec
def build_change_message(self, operation, changed_list):
"""Build the changed message"""
if operation == 'add':
changed_operation = 'added'
elif operation == 'remove':
changed_operation = 'removed'
if self.module.check_mode:
changed_suffix = ' would be %s' % changed_operation
else:
changed_suffix = ' %s' % changed_operation
if len(changed_list) > 2:
message = ', '.join(changed_list[:-1]) + ', and ' + str(changed_list[-1])
elif len(changed_list) == 2:
message = ' and '.join(changed_list)
elif len(changed_list) == 1:
message = changed_list[0]
message += changed_suffix
return message
def main():
"""Main"""
argument_spec = vmware_argument_spec()
argument_spec.update(
dict(
switch=dict(required=True, aliases=['dvswitch']),
primary_pvlans=dict(type='list', default=list(), required=False),
secondary_pvlans=dict(type='list', default=list(), required=False),
)
)
module = AnsibleModule(
argument_spec=argument_spec,
supports_check_mode=True,
)
vmware_dvswitch_pvlans = VMwareDvSwitchPvlans(module)
vmware_dvswitch_pvlans.ensure()
if __name__ == '__main__':
main()
|
gpl-3.0
|
[
3381,
2647,
15,
1393,
15,
1548,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
1898,
26,
334,
67,
9,
14894,
12,
2799,
18824,
5653,
1804,
357,
266,
665,
335,
18824,
5653,
14,
75,
357,
266,
32,
71,
9457,
14,
271,
30,
199,
3,
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,
469,
272,
283,
2343,
63,
1023,
356,
283,
17,
14,
17,
297,
272,
283,
1205,
356,
788,
7780,
995,
272,
283,
4946,
63,
991,
356,
283,
9387,
7,
199,
93,
199,
199,
8948,
275,
1449,
199,
2595,
199,
578,
26,
19365,
63,
68,
23201,
63,
1381,
76,
796,
199,
3612,
63,
1802,
26,
14944,
18551,
17591,
2897,
402,
282,
17484,
17711,
199,
1802,
26,
272,
446,
961,
859,
883,
506,
1202,
370,
7908,
18551,
17591,
83,
334,
48,
22716,
83,
9,
641,
282,
17484,
17711,
14,
199,
1023,
63,
3270,
26,
499,
14,
24,
199,
2502,
26,
199,
13,
2799,
18824,
5653,
1804,
357,
266,
8593,
346,
357,
266,
9,
199,
5983,
26,
272,
446,
30568,
641,
373,
22385,
1227,
14,
21,
436,
1227,
14,
23,
199,
7538,
26,
272,
446,
298,
1548,
2356,
499,
14,
22,
2,
272,
446,
1611,
54,
28603,
199,
1419,
26,
272,
6258,
26,
267,
1369,
26,
288,
446,
710,
536,
402,
314,
17484,
17711,
14,
267,
730,
26,
620,
267,
1415,
26,
715,
267,
5481,
26,
788,
68,
23201,
418,
272,
5062,
63,
1381,
76,
796,
26,
267,
1369,
26,
288,
446,
437,
769,
402,
17591,
11449,
626,
1077,
506,
7526,
465,
26710,
510,
22716,
83,
14,
288,
446,
982,
445,
8,
3327,
63,
1381,
76,
796,
9,
5712,
1133,
2013,
12,
1006,
510,
22716,
83,
911,
506,
5463,
340,
3451,
14,
288,
446,
7048,
3653,
402,
314,
769,
5074,
5062,
63,
1381,
1502,
63,
344,
334,
442,
9,
663,
14,
288,
446,
710,
13851,
8023,
27641,
510,
22716,
911,
506,
2737,
5847,
14,
288,
446,
982,
445,
8,
12371,
63,
1381,
76,
796,
9,
5712,
1133,
2013,
12,
314,
5062,
510,
22716,
83,
436,
1924,
13851,
8023,
27641,
510,
22716,
911,
506,
2737,
14,
288,
446,
7754,
1937,
7251,
367,
1655,
2556,
14,
267,
730,
26,
769,
267,
849,
26,
942,
272,
13851,
63,
1381,
76,
796,
26,
267,
1369,
26,
288,
446,
437,
769,
402,
17591,
11449,
626,
1077,
506,
7526,
465,
16707,
695,
510,
22716,
83,
14,
288,
446,
283,
35,
8,
3327,
63,
1381,
76,
796,
9,
1929,
370,
506,
2013,
370,
1218,
1263,
16707,
695,
510,
22716,
3530,
288,
446,
982,
445,
8,
3327,
63,
1381,
76,
796,
9,
5712,
1133,
2013,
12,
1006,
510,
22716,
83,
911,
506,
5463,
340,
3451,
14,
288,
446,
7048,
3653,
402,
314,
769,
5074,
5062,
63,
1381,
1502,
63,
344,
334,
442,
395,
13851,
63,
1381,
1502,
63,
344,
334,
442,
395,
436,
299,
7175,
63,
466,
334,
495,
9,
370,
506,
663,
14,
288,
446,
710,
730,
402,
314,
13851,
510,
22716,
883,
506,
23348,
503,
23633,
14,
710,
13851,
8023,
27641,
510,
22716,
911,
506,
2737,
5847,
14,
288,
446,
7754,
1937,
7251,
367,
1655,
2556,
14,
267,
730,
26,
769,
267,
849,
26,
942,
199,
11036,
63,
9970,
63,
7677,
26,
19365,
14,
9970,
199,
2344,
199,
199,
8918,
275,
1449,
199,
13,
536,
26,
2790,
510,
22716,
83,
641,
282,
17484,
17711,
523,
19365,
63,
68,
23201,
63,
1381,
76,
796,
26,
272,
6246,
26,
11400,
8200,
63,
4269,
16339,
272,
3434,
26,
11400,
27127,
63,
2473,
16339,
272,
2505,
26,
11400,
27127,
63,
2060,
16339,
272,
6258,
26,
26869,
10167,
272,
5062,
63,
1381,
76,
796,
26,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
413,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
841,
272,
13851,
63,
1381,
76,
796,
26,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
413,
267,
13851,
63,
1381,
1502,
63,
344,
26,
499,
267,
299,
7175,
63,
466,
26,
23348,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
413,
267,
13851,
63,
1381,
1502,
63,
344,
26,
650,
267,
299,
7175,
63,
466,
26,
23633,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
841,
267,
13851,
63,
1381,
1502,
63,
344,
26,
959,
267,
299,
7175,
63,
466,
26,
23633,
523,
13080,
63,
475,
26,
11667,
199,
199,
13,
536,
26,
2790,
5062,
510,
22716,
436,
13851,
8023,
27641,
510,
22716,
641,
282,
17484,
17711,
523,
19365,
63,
68,
23201,
63,
1381,
76,
796,
26,
272,
6246,
26,
11400,
8200,
63,
4269,
16339,
272,
3434,
26,
11400,
27127,
63,
2473,
16339,
272,
2505,
26,
11400,
27127,
63,
2060,
16339,
272,
6258,
26,
26869,
10167,
272,
5062,
63,
1381,
76,
796,
26,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
413,
523,
13080,
63,
475,
26,
11667,
199,
199,
13,
536,
26,
5852,
1006,
510,
22716,
83,
687,
282,
17484,
17711,
523,
19365,
63,
68,
23201,
63,
1381,
76,
796,
26,
272,
6246,
26,
11400,
8200,
63,
4269,
16339,
272,
3434,
26,
11400,
27127,
63,
2473,
16339,
272,
2505,
26,
11400,
27127,
63,
2060,
16339,
272,
6258,
26,
26869,
10167,
272,
5062,
63,
1381,
76,
796,
26,
942,
272,
13851,
63,
1381,
76,
796,
26,
942,
523,
13080,
63,
475,
26,
11667,
199,
2344,
199,
199,
9677,
275,
408,
199,
1099,
26,
272,
1369,
26,
2556,
3595,
10585,
3439,
272,
2138,
26,
3544,
272,
730,
26,
620,
272,
2690,
26,
469,
267,
298,
2489,
582,
2549,
12,
267,
298,
68,
23201,
582,
298,
8398,
10167,
401,
267,
298,
4239,
63,
18424,
582,
359,
288,
469,
355,
298,
3327,
63,
1381,
1502,
63,
344,
582,
413,
12,
355,
298,
1381,
1502,
63,
466,
582,
298,
12741,
27641,
401,
355,
298,
12371,
63,
1381,
1502,
63,
344,
582,
413,
288,
1660,
288,
469,
355,
298,
3327,
63,
1381,
1502,
63,
344,
582,
413,
12,
355,
298,
1381,
1502,
63,
466,
582,
298
] |
[
2647,
15,
1393,
15,
1548,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
1898,
26,
334,
67,
9,
14894,
12,
2799,
18824,
5653,
1804,
357,
266,
665,
335,
18824,
5653,
14,
75,
357,
266,
32,
71,
9457,
14,
271,
30,
199,
3,
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,
469,
272,
283,
2343,
63,
1023,
356,
283,
17,
14,
17,
297,
272,
283,
1205,
356,
788,
7780,
995,
272,
283,
4946,
63,
991,
356,
283,
9387,
7,
199,
93,
199,
199,
8948,
275,
1449,
199,
2595,
199,
578,
26,
19365,
63,
68,
23201,
63,
1381,
76,
796,
199,
3612,
63,
1802,
26,
14944,
18551,
17591,
2897,
402,
282,
17484,
17711,
199,
1802,
26,
272,
446,
961,
859,
883,
506,
1202,
370,
7908,
18551,
17591,
83,
334,
48,
22716,
83,
9,
641,
282,
17484,
17711,
14,
199,
1023,
63,
3270,
26,
499,
14,
24,
199,
2502,
26,
199,
13,
2799,
18824,
5653,
1804,
357,
266,
8593,
346,
357,
266,
9,
199,
5983,
26,
272,
446,
30568,
641,
373,
22385,
1227,
14,
21,
436,
1227,
14,
23,
199,
7538,
26,
272,
446,
298,
1548,
2356,
499,
14,
22,
2,
272,
446,
1611,
54,
28603,
199,
1419,
26,
272,
6258,
26,
267,
1369,
26,
288,
446,
710,
536,
402,
314,
17484,
17711,
14,
267,
730,
26,
620,
267,
1415,
26,
715,
267,
5481,
26,
788,
68,
23201,
418,
272,
5062,
63,
1381,
76,
796,
26,
267,
1369,
26,
288,
446,
437,
769,
402,
17591,
11449,
626,
1077,
506,
7526,
465,
26710,
510,
22716,
83,
14,
288,
446,
982,
445,
8,
3327,
63,
1381,
76,
796,
9,
5712,
1133,
2013,
12,
1006,
510,
22716,
83,
911,
506,
5463,
340,
3451,
14,
288,
446,
7048,
3653,
402,
314,
769,
5074,
5062,
63,
1381,
1502,
63,
344,
334,
442,
9,
663,
14,
288,
446,
710,
13851,
8023,
27641,
510,
22716,
911,
506,
2737,
5847,
14,
288,
446,
982,
445,
8,
12371,
63,
1381,
76,
796,
9,
5712,
1133,
2013,
12,
314,
5062,
510,
22716,
83,
436,
1924,
13851,
8023,
27641,
510,
22716,
911,
506,
2737,
14,
288,
446,
7754,
1937,
7251,
367,
1655,
2556,
14,
267,
730,
26,
769,
267,
849,
26,
942,
272,
13851,
63,
1381,
76,
796,
26,
267,
1369,
26,
288,
446,
437,
769,
402,
17591,
11449,
626,
1077,
506,
7526,
465,
16707,
695,
510,
22716,
83,
14,
288,
446,
283,
35,
8,
3327,
63,
1381,
76,
796,
9,
1929,
370,
506,
2013,
370,
1218,
1263,
16707,
695,
510,
22716,
3530,
288,
446,
982,
445,
8,
3327,
63,
1381,
76,
796,
9,
5712,
1133,
2013,
12,
1006,
510,
22716,
83,
911,
506,
5463,
340,
3451,
14,
288,
446,
7048,
3653,
402,
314,
769,
5074,
5062,
63,
1381,
1502,
63,
344,
334,
442,
395,
13851,
63,
1381,
1502,
63,
344,
334,
442,
395,
436,
299,
7175,
63,
466,
334,
495,
9,
370,
506,
663,
14,
288,
446,
710,
730,
402,
314,
13851,
510,
22716,
883,
506,
23348,
503,
23633,
14,
710,
13851,
8023,
27641,
510,
22716,
911,
506,
2737,
5847,
14,
288,
446,
7754,
1937,
7251,
367,
1655,
2556,
14,
267,
730,
26,
769,
267,
849,
26,
942,
199,
11036,
63,
9970,
63,
7677,
26,
19365,
14,
9970,
199,
2344,
199,
199,
8918,
275,
1449,
199,
13,
536,
26,
2790,
510,
22716,
83,
641,
282,
17484,
17711,
523,
19365,
63,
68,
23201,
63,
1381,
76,
796,
26,
272,
6246,
26,
11400,
8200,
63,
4269,
16339,
272,
3434,
26,
11400,
27127,
63,
2473,
16339,
272,
2505,
26,
11400,
27127,
63,
2060,
16339,
272,
6258,
26,
26869,
10167,
272,
5062,
63,
1381,
76,
796,
26,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
413,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
841,
272,
13851,
63,
1381,
76,
796,
26,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
413,
267,
13851,
63,
1381,
1502,
63,
344,
26,
499,
267,
299,
7175,
63,
466,
26,
23348,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
413,
267,
13851,
63,
1381,
1502,
63,
344,
26,
650,
267,
299,
7175,
63,
466,
26,
23633,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
841,
267,
13851,
63,
1381,
1502,
63,
344,
26,
959,
267,
299,
7175,
63,
466,
26,
23633,
523,
13080,
63,
475,
26,
11667,
199,
199,
13,
536,
26,
2790,
5062,
510,
22716,
436,
13851,
8023,
27641,
510,
22716,
641,
282,
17484,
17711,
523,
19365,
63,
68,
23201,
63,
1381,
76,
796,
26,
272,
6246,
26,
11400,
8200,
63,
4269,
16339,
272,
3434,
26,
11400,
27127,
63,
2473,
16339,
272,
2505,
26,
11400,
27127,
63,
2060,
16339,
272,
6258,
26,
26869,
10167,
272,
5062,
63,
1381,
76,
796,
26,
489,
446,
5062,
63,
1381,
1502,
63,
344,
26,
413,
523,
13080,
63,
475,
26,
11667,
199,
199,
13,
536,
26,
5852,
1006,
510,
22716,
83,
687,
282,
17484,
17711,
523,
19365,
63,
68,
23201,
63,
1381,
76,
796,
26,
272,
6246,
26,
11400,
8200,
63,
4269,
16339,
272,
3434,
26,
11400,
27127,
63,
2473,
16339,
272,
2505,
26,
11400,
27127,
63,
2060,
16339,
272,
6258,
26,
26869,
10167,
272,
5062,
63,
1381,
76,
796,
26,
942,
272,
13851,
63,
1381,
76,
796,
26,
942,
523,
13080,
63,
475,
26,
11667,
199,
2344,
199,
199,
9677,
275,
408,
199,
1099,
26,
272,
1369,
26,
2556,
3595,
10585,
3439,
272,
2138,
26,
3544,
272,
730,
26,
620,
272,
2690,
26,
469,
267,
298,
2489,
582,
2549,
12,
267,
298,
68,
23201,
582,
298,
8398,
10167,
401,
267,
298,
4239,
63,
18424,
582,
359,
288,
469,
355,
298,
3327,
63,
1381,
1502,
63,
344,
582,
413,
12,
355,
298,
1381,
1502,
63,
466,
582,
298,
12741,
27641,
401,
355,
298,
12371,
63,
1381,
1502,
63,
344,
582,
413,
288,
1660,
288,
469,
355,
298,
3327,
63,
1381,
1502,
63,
344,
582,
413,
12,
355,
298,
1381,
1502,
63,
466,
582,
298,
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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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
] |
PaulDeStefano/pythonsamples
|
sbf2PVTGeo.py
|
1
|
7187
|
#!/usr/local/bin/python2.7
""" sbf2offset.py
Reads SBF binary data files and produces plain text file
containing PVTGeoblock data
Copyright (C) 2013 Paul R. DeStefano
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 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import pysbf
import argparse
from datetime import datetime
from sys import stderr
# this is the UNIX time (epoch 1/1/1970) of the start of GNSS epoch (1/6/1980)
#GNSSepochInUNIXepoch = 315964819
GNSSepochInUNIXepoch = 315964800
TAIvsUTCin1972 = 10
#leapSecSince1972 = 25
leapSecSince1972 = 16
# one formula is this
#epochDiffNow = GNSSepochInUNIXepoch + TAIvsUTCin1972 - leapSecSince1972
# but, I can only understand this one, so far, and it seems to match
epochDiffNow = float(GNSSepochInUNIXepoch - 16)
class t2kSBFDataError(Exception):
""" exception class to raise errors in SBF data """
pass
class t2kSeptPVTTime:
"""Helps convert GNSS time to other times
"""
def __init__(self, WNc=None, TOW=None, timeSystem=None):
if timeSystem == None:
raise Exception("ERROR: init of class t2kSeptPVTTime requires three parameters")
if timeSystem == 0:
# GNSS timestamps on SBF blocks
#print("DEBUG: SBF block uses GNSS timeSystem")
epochDiffNow = float( GNSSepochInUNIXepoch - leapSecSince1972 )
elif timeSystem == 1:
# Galileo timestamps on SBF blocks
#print("DEBUG: SBF block uses UTC timeSystem")
raise Exception("ERROR: SBF block uses GLONASS time, not yet implimented.")
elif timeSystem == 255 :
# GLONASS timestamps on SBF blocks
raise t2kSBFDataError("ERROR: SBF block has error code for TimeSystem value: 255")
else:
raise t2kSBFDataError("ERROR: SBF timeSystem unrecognized: {}".format(timeSystem) )
self.error = 0
self.WNc=WNc
self.TOW=TOW
#print("Week number:{0}; ToW:{1}".format(WNc,TOW))
secIntoYr = self.WNc*60*60*24*7
secIntoWk = float(self.TOW)/1000
self.s_GPSepoch = float( secIntoYr + secIntoWk )
#print(s_GPSepoch)
#print(epochDiffNow)
self.unixtime = float( self.s_GPSepoch + epochDiffNow )
self.dt = datetime.utcfromtimestamp(self.unixtime)
def getTuple(self):
"""Returns useful bits
"""
iso8601 = datetime.isoformat(self.dt)
dayOfYear = datetime.utctimetuple(self.dt).tm_yday
unixDays = float(self.unixtime)/86400
# Juliain date, 2456401.5=JD of unix epoch
jd = unixDays + 2440587.5
# Modified Juliain date, JD - 2400000.5
mjd = jd - 2400000.5
return (iso8601, self.unixtime, self.WNc, self.TOW, jd, mjd, dayOfYear)
def doStuff(f) :
"""
This function opens the given file, assuming it's a SBF file.
It extracts the PVTGeodetic values from every PVTGeo block,
and prints the results with ASCII and UNIX timestamps
"""
#print('do stuff on file '+f+'...\n')
with open(f,'r') as sbf_fobj:
#for blockName, block in pysbf.load(sbf_fobj, blocknames={'xPPSOffset'},limit=10):
for blockName, block in pysbf.load(sbf_fobj, blocknames={'PVTGeodetic_v2'}):
errCode=block['Error']
phi=block['Phi']
lmbd=block['Lambda']
h=block['h']
rxClkBias=block['RxClkBias']
rxClkDrift=block['RxClkDrift']
nrSV=block['NrSV']
mode=block['Mode']
signalInfo=block['SignalInfo']
alertFlag=block['AlertFlag']
WNc=block['WNc']
TOW=block['TOW']
timeSystem=block['TimeSystem']
try:
if (errCode > 0):
raise t2kSBFDataError('WARNING: Unknown block error code: {}'.format(errCode))
rcvrTime = t2kSeptPVTTime(WNc,TOW,timeSystem)
except t2kSBFDataError as e:
stderr.write(str(e)+', skipping block (WNc={},TOW={},NrSV={},SignalInfo={},AlertFlag={})'.format(errCode,WNc,TOW,nrSV,signalInfo,alertFlag )+'\n')
continue
iso8601, unixtime, WNc, TOW, jd, mjd, dayOfYear = rcvrTime.getTuple()
print("{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}".format(
iso8601, unixtime,
errCode,
phi, lmbd, h,
rxClkBias, rxClkDrift,
nrSV,
WNc, TOW, jd, mjd, dayOfYear,
mode, signalInfo, alertFlag ) )
if __name__ == "__main__" :
#print('hi\n')
#print(sys.argv)
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter
,description='Prints all PVTGeo values it finds in given files.'
,epilog='''
This program reads the files given on the command line. They must be binary
SBF formated files. It locates any and all PVTGeo blocks and prints the
ISO8601 date, and UNIX time, & other data from each block.
output format:
<isoDate>,<UNIXtime>,<SBF blk errCode>,<phi>,<lambda>,<height>,<rxClkBias>,<rxClkDrift>,<# Satellites in PVT>,<WNc>,<TOW>,<JulianDay>,<MJD>,<dayOfYear>,Mode,SignalInfo,AlertFlag
For validation purposes, the output data also includes the GNSS Week Number
(WNc) and Time of Week (TOW).
WNc = number of weeks since GNSS epoch time (Jan 1 1980)
TOW = number of miliseconds since start of the current week
phi = Phi angle measurement, Geodetic coordinates
lmbd = Lambda angle measurement, Geodetic coordinates
h = height above Geodetic datum surface
RxClkBias = Measured time difference (ns) between internal clock (and external Freq Source) and Time System Time
RxClkDrift = Calculated error in frequncy of internal clock (and ext. FS)
# of Satellites in PVT
'''
)
parser.add_argument('fileList',help='Positional arguments are assumed to be input filenames',nargs='+')
#parser.add_argument('--outfile',nargs='?',help='output file')
parser.add_argument('--header',action='store_true',default=True,help='produce column description strings as first line of output (default)')
parser.add_argument('--noheader',dest='header',action='store_false',default=True,help='omit header at beginning of output')
args = parser.parse_args()
#print(args.fileList)
fileList = args.fileList
header = args.header
#outfile = args.outfile
#print('working on files:'+str(fileList)+'\n')
if (header):
print 'ISO_Date,UNIX_time,SBFblkErrCode,phi,lambda,height,rxClkBias,rxClkDrift,nrSV,WNc,TOW,julianDay,modifiedJulianDay,dayOfYear,Mode,SignalInfo,AlertFlag'
for f in fileList :
#print('working on file: '+f)
doStuff(f)
|
gpl-3.0
|
[
3381,
2647,
15,
1832,
15,
1393,
15,
1548,
18,
14,
23,
199,
624,
308,
4361,
18,
2743,
14,
647,
272,
26129,
428,
12659,
3366,
666,
1584,
436,
16904,
8971,
1318,
570,
272,
3035,
510,
8156,
10748,
1457,
666,
339,
1898,
334,
35,
9,
6171,
28574,
820,
14,
1487,
26696,
70,
8143,
339,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
272,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
272,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
272,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
339,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
272,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
272,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
272,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
339,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
272,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
624,
199,
646,
10382,
4361,
199,
646,
7534,
199,
504,
2197,
492,
2197,
199,
504,
984,
492,
4635,
199,
199,
3,
642,
365,
314,
22242,
900,
334,
7367,
413,
15,
17,
15,
21740,
9,
402,
314,
1343,
402,
27650,
2300,
9463,
334,
17,
15,
22,
15,
26981,
9,
199,
3,
39,
2709,
1513,
5132,
607,
19584,
7367,
275,
650,
9327,
10552,
1167,
199,
39,
2709,
1513,
5132,
607,
19584,
7367,
275,
650,
9327,
772,
6718,
199,
6166,
41,
3122,
11288,
262,
1167,
2819,
275,
1616,
199,
3,
28764,
4933,
24430,
1167,
2819,
275,
5661,
199,
28764,
4933,
24430,
1167,
2819,
275,
3193,
199,
3,
1373,
15723,
365,
642,
199,
3,
7367,
10746,
14351,
275,
598,
2709,
1513,
5132,
607,
19584,
7367,
435,
377,
7730,
3122,
11288,
262,
1167,
2819,
446,
29487,
4933,
24430,
1167,
2819,
199,
3,
1325,
12,
473,
883,
1454,
20647,
642,
1373,
12,
880,
12474,
12,
436,
652,
12237,
370,
1336,
199,
7367,
10746,
14351,
275,
2069,
8,
39,
2709,
1513,
5132,
607,
19584,
7367,
446,
3193,
9,
199,
199,
533,
307,
18,
75,
12463,
38,
1451,
547,
8,
1726,
304,
272,
408,
1919,
1021,
370,
746,
2552,
315,
428,
12659,
666,
408,
272,
986,
199,
199,
533,
307,
18,
75,
1513,
541,
48,
8156,
1366,
26,
272,
408,
40,
352,
1190,
3957,
27650,
2300,
900,
370,
1163,
5431,
272,
408,
339,
347,
636,
826,
721,
277,
12,
644,
46,
67,
29,
403,
12,
2296,
55,
29,
403,
12,
900,
3989,
29,
403,
304,
267,
340,
900,
3989,
508,
488,
26,
288,
746,
2186,
480,
3170,
26,
4205,
402,
1021,
307,
18,
75,
1513,
541,
48,
8156,
1366,
5074,
7795,
2633,
531,
398,
340,
900,
3989,
508,
378,
26,
288,
327,
27650,
2300,
22496,
641,
428,
12659,
5664,
288,
327,
1361,
480,
5287,
26,
428,
12659,
1853,
4440,
27650,
2300,
900,
3989,
531,
288,
9463,
10746,
14351,
275,
2069,
8,
598,
2709,
1513,
5132,
607,
19584,
7367,
446,
29487,
4933,
24430,
1167,
2819,
776,
267,
916,
900,
3989,
508,
413,
26,
288,
327,
598,
279,
441,
79,
22496,
641,
428,
12659,
5664,
288,
327,
1361,
480,
5287,
26,
428,
12659,
1853,
4440,
12174,
900,
3989,
531,
288,
746,
2186,
480,
3170,
26,
428,
12659,
1853,
4440,
3563,
615,
3755,
900,
12,
440,
5966,
1742,
317,
2509,
2685,
267,
916,
900,
3989,
508,
5450,
520,
288,
327,
3563,
615,
3755,
22496,
641,
428,
12659,
5664,
288,
746,
307,
18,
75,
12463,
38,
1451,
547,
480,
3170,
26,
428,
12659,
1853,
965,
1125,
1233,
367,
4703,
3989,
574,
26,
5450,
531,
267,
587,
26,
288,
746,
307,
18,
75,
12463,
38,
1451,
547,
480,
3170,
26,
428,
12659,
900,
3989,
24718,
26,
8352,
908,
8,
521,
3989,
9,
776,
398,
291,
14,
705,
275,
378,
267,
291,
14,
3705,
67,
29,
3705,
67,
267,
291,
14,
2566,
55,
29,
2566,
55,
267,
327,
1361,
480,
20995,
1329,
14534,
16,
12084,
4005,
55,
14534,
17,
5469,
908,
8,
3705,
67,
12,
2566,
55,
430,
267,
6513,
19448,
57,
82,
275,
291,
14,
3705,
67,
10,
2259,
10,
2259,
10,
1194,
10,
23,
267,
6513,
19448,
55,
75,
275,
2069,
8,
277,
14,
2566,
55,
2447,
5279,
267,
291,
14,
83,
63,
8225,
1513,
5132,
275,
2069,
8,
6513,
19448,
57,
82,
435,
6513,
19448,
55,
75,
776,
267,
327,
1361,
8,
83,
63,
8225,
1513,
5132,
9,
267,
327,
1361,
8,
7367,
10746,
14351,
9,
267,
291,
14,
11864,
521,
275,
2069,
8,
291,
14,
83,
63,
8225,
1513,
5132,
435,
9463,
10746,
14351,
776,
267,
291,
14,
3583,
275,
2197,
14,
5834,
18531,
8,
277,
14,
11864,
521,
9,
339,
347,
664,
7075,
8,
277,
304,
267,
408,
3407,
2997,
5821,
267,
408,
267,
11601,
15363,
275,
2197,
14,
17070,
8,
277,
14,
3583,
9,
267,
5382,
3466,
15731,
275,
2197,
14,
5834,
22309,
8,
277,
14,
3583,
680,
7574,
63,
89,
2977,
267,
16572,
25589,
275,
2069,
8,
277,
14,
11864,
521,
2447,
24,
20543,
267,
327,
1603,
13987,
1581,
1434,
12,
32102,
772,
614,
14,
21,
29,
42,
36,
402,
16572,
9463,
267,
1335,
68,
275,
16572,
25589,
435,
499,
1602,
1717,
1555,
14,
21,
267,
327,
22016,
1603,
13987,
1581,
1434,
12,
1603,
36,
446,
5504,
5345,
14,
21,
267,
333,
17694,
275,
1335,
68,
446,
5504,
5345,
14,
21,
267,
372,
334,
4595,
15363,
12,
291,
14,
11864,
521,
12,
291,
14,
3705,
67,
12,
291,
14,
2566,
55,
12,
1335,
68,
12,
333,
17694,
12,
5382,
3466,
15731,
9,
199,
199,
318,
886,
933,
3043,
8,
70,
9,
520,
272,
408,
272,
961,
805,
30848,
314,
1627,
570,
12,
18002,
652,
1159,
282,
428,
12659,
570,
14,
272,
2779,
5536,
83,
314,
510,
8156,
4240,
32230,
1338,
687,
4036,
510,
8156,
10748,
1853,
12,
272,
436,
14767,
314,
2058,
543,
10485,
436,
22242,
22496,
272,
408,
339,
327,
1361,
360,
1117,
8292,
641,
570,
6681,
70,
4786,
29279,
78,
358,
272,
543,
1551,
8,
70,
2584,
82,
358,
465,
308,
4361,
63,
32755,
26,
489,
327,
509,
1853,
985,
12,
1853
] |
[
2647,
15,
1832,
15,
1393,
15,
1548,
18,
14,
23,
199,
624,
308,
4361,
18,
2743,
14,
647,
272,
26129,
428,
12659,
3366,
666,
1584,
436,
16904,
8971,
1318,
570,
272,
3035,
510,
8156,
10748,
1457,
666,
339,
1898,
334,
35,
9,
6171,
28574,
820,
14,
1487,
26696,
70,
8143,
339,
961,
2240,
365,
2867,
2032,
26,
1265,
883,
3604,
652,
436,
15,
269,
2811,
272,
652,
1334,
314,
2895,
402,
314,
1664,
1696,
1684,
844,
465,
3267,
701,
272,
314,
2868,
2290,
2752,
12,
1902,
1015,
650,
402,
314,
844,
12,
503,
272,
334,
292,
2195,
945,
9,
1263,
2945,
1015,
14,
339,
961,
2240,
365,
1854,
315,
314,
3661,
626,
652,
911,
506,
2997,
12,
272,
1325,
2428,
1821,
3408,
27,
1928,
2755,
314,
2478,
3750,
402,
272,
3169,
503,
3092,
2381,
437,
3115,
3104,
14,
221,
1666,
314,
272,
1664,
1696,
1684,
844,
367,
1655,
2436,
14,
339,
2047,
1077,
1172,
3086,
282,
1331,
402,
314,
1664,
1696,
1684,
844,
272,
3180,
543,
642,
2240,
14,
221,
982,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
624,
199,
646,
10382,
4361,
199,
646,
7534,
199,
504,
2197,
492,
2197,
199,
504,
984,
492,
4635,
199,
199,
3,
642,
365,
314,
22242,
900,
334,
7367,
413,
15,
17,
15,
21740,
9,
402,
314,
1343,
402,
27650,
2300,
9463,
334,
17,
15,
22,
15,
26981,
9,
199,
3,
39,
2709,
1513,
5132,
607,
19584,
7367,
275,
650,
9327,
10552,
1167,
199,
39,
2709,
1513,
5132,
607,
19584,
7367,
275,
650,
9327,
772,
6718,
199,
6166,
41,
3122,
11288,
262,
1167,
2819,
275,
1616,
199,
3,
28764,
4933,
24430,
1167,
2819,
275,
5661,
199,
28764,
4933,
24430,
1167,
2819,
275,
3193,
199,
3,
1373,
15723,
365,
642,
199,
3,
7367,
10746,
14351,
275,
598,
2709,
1513,
5132,
607,
19584,
7367,
435,
377,
7730,
3122,
11288,
262,
1167,
2819,
446,
29487,
4933,
24430,
1167,
2819,
199,
3,
1325,
12,
473,
883,
1454,
20647,
642,
1373,
12,
880,
12474,
12,
436,
652,
12237,
370,
1336,
199,
7367,
10746,
14351,
275,
2069,
8,
39,
2709,
1513,
5132,
607,
19584,
7367,
446,
3193,
9,
199,
199,
533,
307,
18,
75,
12463,
38,
1451,
547,
8,
1726,
304,
272,
408,
1919,
1021,
370,
746,
2552,
315,
428,
12659,
666,
408,
272,
986,
199,
199,
533,
307,
18,
75,
1513,
541,
48,
8156,
1366,
26,
272,
408,
40,
352,
1190,
3957,
27650,
2300,
900,
370,
1163,
5431,
272,
408,
339,
347,
636,
826,
721,
277,
12,
644,
46,
67,
29,
403,
12,
2296,
55,
29,
403,
12,
900,
3989,
29,
403,
304,
267,
340,
900,
3989,
508,
488,
26,
288,
746,
2186,
480,
3170,
26,
4205,
402,
1021,
307,
18,
75,
1513,
541,
48,
8156,
1366,
5074,
7795,
2633,
531,
398,
340,
900,
3989,
508,
378,
26,
288,
327,
27650,
2300,
22496,
641,
428,
12659,
5664,
288,
327,
1361,
480,
5287,
26,
428,
12659,
1853,
4440,
27650,
2300,
900,
3989,
531,
288,
9463,
10746,
14351,
275,
2069,
8,
598,
2709,
1513,
5132,
607,
19584,
7367,
446,
29487,
4933,
24430,
1167,
2819,
776,
267,
916,
900,
3989,
508,
413,
26,
288,
327,
598,
279,
441,
79,
22496,
641,
428,
12659,
5664,
288,
327,
1361,
480,
5287,
26,
428,
12659,
1853,
4440,
12174,
900,
3989,
531,
288,
746,
2186,
480,
3170,
26,
428,
12659,
1853,
4440,
3563,
615,
3755,
900,
12,
440,
5966,
1742,
317,
2509,
2685,
267,
916,
900,
3989,
508,
5450,
520,
288,
327,
3563,
615,
3755,
22496,
641,
428,
12659,
5664,
288,
746,
307,
18,
75,
12463,
38,
1451,
547,
480,
3170,
26,
428,
12659,
1853,
965,
1125,
1233,
367,
4703,
3989,
574,
26,
5450,
531,
267,
587,
26,
288,
746,
307,
18,
75,
12463,
38,
1451,
547,
480,
3170,
26,
428,
12659,
900,
3989,
24718,
26,
8352,
908,
8,
521,
3989,
9,
776,
398,
291,
14,
705,
275,
378,
267,
291,
14,
3705,
67,
29,
3705,
67,
267,
291,
14,
2566,
55,
29,
2566,
55,
267,
327,
1361,
480,
20995,
1329,
14534,
16,
12084,
4005,
55,
14534,
17,
5469,
908,
8,
3705,
67,
12,
2566,
55,
430,
267,
6513,
19448,
57,
82,
275,
291,
14,
3705,
67,
10,
2259,
10,
2259,
10,
1194,
10,
23,
267,
6513,
19448,
55,
75,
275,
2069,
8,
277,
14,
2566,
55,
2447,
5279,
267,
291,
14,
83,
63,
8225,
1513,
5132,
275,
2069,
8,
6513,
19448,
57,
82,
435,
6513,
19448,
55,
75,
776,
267,
327,
1361,
8,
83,
63,
8225,
1513,
5132,
9,
267,
327,
1361,
8,
7367,
10746,
14351,
9,
267,
291,
14,
11864,
521,
275,
2069,
8,
291,
14,
83,
63,
8225,
1513,
5132,
435,
9463,
10746,
14351,
776,
267,
291,
14,
3583,
275,
2197,
14,
5834,
18531,
8,
277,
14,
11864,
521,
9,
339,
347,
664,
7075,
8,
277,
304,
267,
408,
3407,
2997,
5821,
267,
408,
267,
11601,
15363,
275,
2197,
14,
17070,
8,
277,
14,
3583,
9,
267,
5382,
3466,
15731,
275,
2197,
14,
5834,
22309,
8,
277,
14,
3583,
680,
7574,
63,
89,
2977,
267,
16572,
25589,
275,
2069,
8,
277,
14,
11864,
521,
2447,
24,
20543,
267,
327,
1603,
13987,
1581,
1434,
12,
32102,
772,
614,
14,
21,
29,
42,
36,
402,
16572,
9463,
267,
1335,
68,
275,
16572,
25589,
435,
499,
1602,
1717,
1555,
14,
21,
267,
327,
22016,
1603,
13987,
1581,
1434,
12,
1603,
36,
446,
5504,
5345,
14,
21,
267,
333,
17694,
275,
1335,
68,
446,
5504,
5345,
14,
21,
267,
372,
334,
4595,
15363,
12,
291,
14,
11864,
521,
12,
291,
14,
3705,
67,
12,
291,
14,
2566,
55,
12,
1335,
68,
12,
333,
17694,
12,
5382,
3466,
15731,
9,
199,
199,
318,
886,
933,
3043,
8,
70,
9,
520,
272,
408,
272,
961,
805,
30848,
314,
1627,
570,
12,
18002,
652,
1159,
282,
428,
12659,
570,
14,
272,
2779,
5536,
83,
314,
510,
8156,
4240,
32230,
1338,
687,
4036,
510,
8156,
10748,
1853,
12,
272,
436,
14767,
314,
2058,
543,
10485,
436,
22242,
22496,
272,
408,
339,
327,
1361,
360,
1117,
8292,
641,
570,
6681,
70,
4786,
29279,
78,
358,
272,
543,
1551,
8,
70,
2584,
82,
358,
465,
308,
4361,
63,
32755,
26,
489,
327,
509,
1853,
985,
12,
1853,
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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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
] |
benpatterson/edx-platform
|
common/djangoapps/student/tests/test_recent_enrollments.py
|
63
|
7937
|
"""
Tests for the recently enrolled messaging within the Dashboard.
"""
import datetime
from django.conf import settings
from django.core.urlresolvers import reverse
from opaque_keys.edx import locator
from pytz import UTC
import unittest
import ddt
from shoppingcart.models import DonationConfiguration
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from course_modes.tests.factories import CourseModeFactory
from student.models import CourseEnrollment, DashboardConfiguration
from student.views import get_course_enrollments, _get_recently_enrolled_courses # pylint: disable=protected-access
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
@ddt.ddt
class TestRecentEnrollments(ModuleStoreTestCase):
"""
Unit tests for getting the list of courses for a logged in user
"""
PASSWORD = 'test'
def setUp(self):
"""
Add a student
"""
super(TestRecentEnrollments, self).setUp()
self.student = UserFactory()
self.student.set_password(self.PASSWORD)
self.student.save()
# Old Course
old_course_location = locator.CourseLocator('Org0', 'Course0', 'Run0')
course, enrollment = self._create_course_and_enrollment(old_course_location)
enrollment.created = datetime.datetime(1900, 12, 31, 0, 0, 0, 0)
enrollment.save()
# New Course
course_location = locator.CourseLocator('Org1', 'Course1', 'Run1')
self.course, self.enrollment = self._create_course_and_enrollment(course_location)
def _create_course_and_enrollment(self, course_location):
""" Creates a course and associated enrollment. """
course = CourseFactory.create(
org=course_location.org,
number=course_location.course,
run=course_location.run
)
enrollment = CourseEnrollment.enroll(self.student, course.id)
return course, enrollment
def _configure_message_timeout(self, timeout):
"""Configure the amount of time the enrollment message will be displayed. """
config = DashboardConfiguration(recent_enrollment_time_delta=timeout)
config.save()
def test_recently_enrolled_courses(self):
"""
Test if the function for filtering recent enrollments works appropriately.
"""
self._configure_message_timeout(60)
# get courses through iterating all courses
courses_list = list(get_course_enrollments(self.student, None, []))
self.assertEqual(len(courses_list), 2)
recent_course_list = _get_recently_enrolled_courses(courses_list)
self.assertEqual(len(recent_course_list), 1)
def test_zero_second_delta(self):
"""
Tests that the recent enrollment list is empty if configured to zero seconds.
"""
self._configure_message_timeout(0)
courses_list = list(get_course_enrollments(self.student, None, []))
self.assertEqual(len(courses_list), 2)
recent_course_list = _get_recently_enrolled_courses(courses_list)
self.assertEqual(len(recent_course_list), 0)
def test_enrollments_sorted_most_recent(self):
"""
Test that the list of newly created courses are properly sorted to show the most
recent enrollments first.
"""
self._configure_message_timeout(600)
# Create a number of new enrollments and courses, and force their creation behind
# the first enrollment
courses = []
for idx, seconds_past in zip(range(2, 6), [5, 10, 15, 20]):
course_location = locator.CourseLocator(
'Org{num}'.format(num=idx),
'Course{num}'.format(num=idx),
'Run{num}'.format(num=idx)
)
course, enrollment = self._create_course_and_enrollment(course_location)
enrollment.created = datetime.datetime.now(UTC) - datetime.timedelta(seconds=seconds_past)
enrollment.save()
courses.append(course)
courses_list = list(get_course_enrollments(self.student, None, []))
self.assertEqual(len(courses_list), 6)
recent_course_list = _get_recently_enrolled_courses(courses_list)
self.assertEqual(len(recent_course_list), 5)
self.assertEqual(recent_course_list[1].course.id, courses[0].id)
self.assertEqual(recent_course_list[2].course.id, courses[1].id)
self.assertEqual(recent_course_list[3].course.id, courses[2].id)
self.assertEqual(recent_course_list[4].course.id, courses[3].id)
def test_dashboard_rendering(self):
"""
Tests that the dashboard renders the recent enrollment messages appropriately.
"""
self._configure_message_timeout(600)
self.client.login(username=self.student.username, password=self.PASSWORD)
response = self.client.get(reverse("dashboard"))
self.assertContains(response, "Thank you for enrolling in")
@ddt.data(
#Register as an honor in any course modes with no payment option
([('audit', 0), ('honor', 0)], 'honor', True),
([('honor', 0)], 'honor', True),
([], 'honor', True),
#Register as an honor in any course modes which has payment option
([('honor', 10)], 'honor', False), # This is a paid course
([('audit', 0), ('honor', 0), ('professional', 20)], 'honor', True),
([('audit', 0), ('honor', 0), ('verified', 20)], 'honor', True),
([('audit', 0), ('honor', 0), ('verified', 20), ('professional', 20)], 'honor', True),
([], 'honor', True),
#Register as an audit in any course modes with no payment option
([('audit', 0), ('honor', 0)], 'audit', True),
([('audit', 0)], 'audit', True),
#Register as an audit in any course modes which has no payment option
([('audit', 0), ('honor', 0), ('verified', 10)], 'audit', True),
#Register as a verified in any course modes which has payment option
([('professional', 20)], 'professional', False),
([('verified', 20)], 'verified', False),
([('professional', 20), ('verified', 20)], 'verified', False),
([('audit', 0), ('honor', 0), ('verified', 20)], 'verified', False)
)
@ddt.unpack
def test_donate_button(self, course_modes, enrollment_mode, show_donate):
# Enable the enrollment success message
self._configure_message_timeout(10000)
# Enable donations
DonationConfiguration(enabled=True).save()
# Create the course mode(s)
for mode, min_price in course_modes:
CourseModeFactory(mode_slug=mode, course_id=self.course.id, min_price=min_price)
self.enrollment.mode = enrollment_mode
self.enrollment.save()
# Check that the donate button is or is not displayed
self.client.login(username=self.student.username, password=self.PASSWORD)
response = self.client.get(reverse("dashboard"))
if show_donate:
self.assertContains(response, "donate-container")
else:
self.assertNotContains(response, "donate-container")
def test_donate_button_honor_with_price(self):
# Enable the enrollment success message and donations
self._configure_message_timeout(10000)
DonationConfiguration(enabled=True).save()
# Create a white-label course mode
# (honor mode with a price set)
CourseModeFactory(mode_slug="honor", course_id=self.course.id, min_price=100)
# Check that the donate button is NOT displayed
self.client.login(username=self.student.username, password=self.PASSWORD)
response = self.client.get(reverse("dashboard"))
self.assertNotContains(response, "donate-container")
|
agpl-3.0
|
[
624,
199,
2925,
367,
314,
23568,
26802,
30429,
4453,
314,
577,
1119,
3576,
14,
199,
624,
199,
646,
2197,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
1018,
14,
16522,
492,
3837,
199,
504,
15058,
63,
1612,
14,
8268,
492,
14067,
199,
504,
15444,
492,
12174,
199,
646,
2882,
199,
646,
366,
3583,
199,
504,
25630,
4073,
8153,
14,
992,
492,
7529,
425,
5688,
199,
199,
504,
6474,
14,
2219,
14,
15406,
492,
16047,
199,
504,
9872,
14,
10012,
14,
2219,
14,
1176,
63,
1208,
492,
17996,
1746,
199,
504,
9872,
14,
10012,
14,
2219,
14,
15406,
492,
17862,
199,
504,
2518,
63,
10433,
14,
2219,
14,
15406,
492,
27312,
2927,
199,
504,
6474,
14,
992,
492,
18946,
12,
577,
1119,
3576,
5688,
199,
504,
6474,
14,
4196,
492,
664,
63,
1972,
63,
14695,
1470,
12,
485,
362,
63,
14951,
590,
63,
22428,
63,
11653,
221,
327,
4287,
26,
3507,
29,
6798,
13,
2732,
421,
199,
32,
2796,
14,
11278,
8,
1751,
14,
5441,
63,
18125,
508,
283,
15807,
14,
3603,
297,
283,
774,
1454,
1686,
315,
21577,
358,
199,
32,
11138,
14,
11138,
199,
533,
1379,
29574,
1327,
2827,
1470,
8,
27863,
304,
272,
408,
272,
12008,
2295,
367,
10232,
314,
769,
402,
13588,
367,
282,
10367,
315,
922,
272,
408,
272,
21705,
5172,
275,
283,
396,
7,
339,
347,
3613,
8,
277,
304,
267,
408,
267,
2654,
282,
6474,
267,
408,
267,
1613,
8,
774,
29574,
1327,
2827,
1470,
12,
291,
680,
5996,
342,
267,
291,
14,
5500,
275,
16047,
342,
267,
291,
14,
5500,
14,
409,
63,
2060,
8,
277,
14,
9032,
9,
267,
291,
14,
5500,
14,
2117,
342,
398,
327,
21238,
5531,
267,
2269,
63,
1972,
63,
1985,
275,
14067,
14,
6979,
10725,
360,
11014,
16,
297,
283,
6979,
16,
297,
283,
2540,
16,
358,
267,
2518,
12,
14869,
275,
291,
423,
981,
63,
1972,
63,
460,
63,
12214,
8,
1753,
63,
1972,
63,
1985,
9,
267,
14869,
14,
3966,
275,
2197,
14,
2083,
8,
26631,
12,
3144,
12,
7105,
12,
378,
12,
378,
12,
378,
12,
378,
9,
267,
14869,
14,
2117,
342,
398,
327,
7053,
5531,
267,
2518,
63,
1985,
275,
14067,
14,
6979,
10725,
360,
11014,
17,
297,
283,
6979,
17,
297,
283,
2540,
17,
358,
267,
291,
14,
1972,
12,
291,
14,
12214,
275,
291,
423,
981,
63,
1972,
63,
460,
63,
12214,
8,
1972,
63,
1985,
9,
339,
347,
485,
981,
63,
1972,
63,
460,
63,
12214,
8,
277,
12,
2518,
63,
1985,
304,
267,
408,
10560,
282,
2518,
436,
4568,
14869,
14,
408,
267,
2518,
275,
17862,
14,
981,
8,
288,
5981,
29,
1972,
63,
1985,
14,
1308,
12,
288,
1329,
29,
1972,
63,
1985,
14,
1972,
12,
288,
1255,
29,
1972,
63,
1985,
14,
1065,
267,
776,
267,
14869,
275,
18946,
14,
14695,
8,
277,
14,
5500,
12,
2518,
14,
344,
9,
267,
372,
2518,
12,
14869,
339,
347,
485,
6472,
63,
1188,
63,
2593,
8,
277,
12,
2653,
304,
267,
408,
17324,
314,
5982,
402,
900,
314,
14869,
1245,
911,
506,
9080,
14,
408,
267,
1101,
275,
577,
1119,
3576,
5688,
8,
14951,
63,
12214,
63,
521,
63,
3136,
29,
2593,
9,
267,
1101,
14,
2117,
342,
339,
347,
511,
63,
14951,
590,
63,
22428,
63,
11653,
8,
277,
304,
267,
408,
267,
1379,
340,
314,
805,
367,
14545,
8058,
26361,
1470,
5419,
22497,
14,
267,
408,
267,
291,
423,
6472,
63,
1188,
63,
2593,
8,
2259,
9,
398,
327,
664,
13588,
4012,
25012,
1006,
13588,
267,
13588,
63,
513,
275,
769,
8,
362,
63,
1972,
63,
14695,
1470,
8,
277,
14,
5500,
12,
488,
12,
15927,
267,
291,
14,
629,
8,
552,
8,
11653,
63,
513,
395,
499,
9,
398,
8058,
63,
1972,
63,
513,
275,
485,
362,
63,
14951,
590,
63,
22428,
63,
11653,
8,
11653,
63,
513,
9,
267,
291,
14,
629,
8,
552,
8,
14951,
63,
1972,
63,
513,
395,
413,
9,
339,
347,
511,
63,
4262,
63,
4375,
63,
3136,
8,
277,
304,
267,
408,
267,
6496,
626,
314,
8058,
14869,
769,
365,
2701,
340,
7526,
370,
4697,
4696,
14,
267,
408,
267,
291,
423,
6472,
63,
1188,
63,
2593,
8,
16,
9,
267,
13588,
63,
513,
275,
769,
8,
362,
63,
1972,
63,
14695,
1470,
8,
277,
14,
5500,
12,
488,
12,
15927,
267,
291,
14,
629,
8,
552,
8,
11653,
63,
513,
395,
499,
9,
398,
8058,
63,
1972,
63,
513,
275,
485,
362,
63,
14951,
590,
63,
22428,
63,
11653,
8,
11653,
63,
513,
9,
267,
291,
14,
629,
8,
552,
8,
14951,
63,
1972,
63,
513,
395,
378,
9,
339,
347,
511,
63,
14695,
1470,
63,
5917,
63,
2786,
63,
14951,
8,
277,
304,
267,
408,
267,
1379,
626,
314,
769,
402,
13903,
2737,
13588,
787,
7684,
3355,
370,
2498,
314,
4750,
267,
8058,
26361,
1470,
1642,
14,
398,
408,
267,
291,
423,
6472,
63,
1188,
63,
2593,
8,
6683,
9,
398,
327,
2790,
282,
1329,
402,
892,
26361,
1470,
436,
13588,
12,
436,
3542,
3932,
7143,
22172,
267,
327,
314,
1642,
14869,
267,
13588,
275,
942,
267,
367,
4280,
12,
4696,
63,
18597,
315,
3482,
8,
1842,
8,
18,
12,
1227,
395,
359,
21,
12,
1616,
12,
4114,
12,
3388,
4682,
288,
2518,
63,
1985,
275,
14067,
14,
6979,
10725,
8,
355,
283,
11014,
91,
1507,
5285,
908,
8,
1507,
29,
2996,
395,
355,
283,
6979,
91,
1507,
5285,
908,
8,
1507,
29,
2996,
395,
355,
283,
2540,
91,
1507,
5285,
908,
8,
1507,
29,
2996,
9,
288,
776,
288,
2518,
12,
14869,
275,
291,
423,
981,
63,
1972,
63,
460,
63,
12214,
8,
1972,
63,
1985,
9,
288,
14869,
14,
3966,
275,
2197,
14,
2083,
14,
2131,
8,
11288,
9,
446,
2197,
14,
7473,
8,
4515,
29,
4515,
63,
18597,
9,
288,
14869,
14,
2117,
342,
288,
13588,
14,
740,
8,
1972,
9,
398,
13588,
63,
513,
275,
769,
8,
362,
63,
1972,
63,
14695,
1470,
8,
277,
14,
5500,
12,
488,
12,
15927,
267,
291,
14,
629,
8,
552,
8,
11653,
63,
513,
395,
1227,
9,
398,
8058,
63,
1972,
63,
513,
275,
485,
362,
63,
14951,
590,
63,
22428,
63,
11653,
8,
11653,
63,
513
] |
[
199,
2925,
367,
314,
23568,
26802,
30429,
4453,
314,
577,
1119,
3576,
14,
199,
624,
199,
646,
2197,
199,
504,
1639,
14,
2190,
492,
2202,
199,
504,
1639,
14,
1018,
14,
16522,
492,
3837,
199,
504,
15058,
63,
1612,
14,
8268,
492,
14067,
199,
504,
15444,
492,
12174,
199,
646,
2882,
199,
646,
366,
3583,
199,
504,
25630,
4073,
8153,
14,
992,
492,
7529,
425,
5688,
199,
199,
504,
6474,
14,
2219,
14,
15406,
492,
16047,
199,
504,
9872,
14,
10012,
14,
2219,
14,
1176,
63,
1208,
492,
17996,
1746,
199,
504,
9872,
14,
10012,
14,
2219,
14,
15406,
492,
17862,
199,
504,
2518,
63,
10433,
14,
2219,
14,
15406,
492,
27312,
2927,
199,
504,
6474,
14,
992,
492,
18946,
12,
577,
1119,
3576,
5688,
199,
504,
6474,
14,
4196,
492,
664,
63,
1972,
63,
14695,
1470,
12,
485,
362,
63,
14951,
590,
63,
22428,
63,
11653,
221,
327,
4287,
26,
3507,
29,
6798,
13,
2732,
421,
199,
32,
2796,
14,
11278,
8,
1751,
14,
5441,
63,
18125,
508,
283,
15807,
14,
3603,
297,
283,
774,
1454,
1686,
315,
21577,
358,
199,
32,
11138,
14,
11138,
199,
533,
1379,
29574,
1327,
2827,
1470,
8,
27863,
304,
272,
408,
272,
12008,
2295,
367,
10232,
314,
769,
402,
13588,
367,
282,
10367,
315,
922,
272,
408,
272,
21705,
5172,
275,
283,
396,
7,
339,
347,
3613,
8,
277,
304,
267,
408,
267,
2654,
282,
6474,
267,
408,
267,
1613,
8,
774,
29574,
1327,
2827,
1470,
12,
291,
680,
5996,
342,
267,
291,
14,
5500,
275,
16047,
342,
267,
291,
14,
5500,
14,
409,
63,
2060,
8,
277,
14,
9032,
9,
267,
291,
14,
5500,
14,
2117,
342,
398,
327,
21238,
5531,
267,
2269,
63,
1972,
63,
1985,
275,
14067,
14,
6979,
10725,
360,
11014,
16,
297,
283,
6979,
16,
297,
283,
2540,
16,
358,
267,
2518,
12,
14869,
275,
291,
423,
981,
63,
1972,
63,
460,
63,
12214,
8,
1753,
63,
1972,
63,
1985,
9,
267,
14869,
14,
3966,
275,
2197,
14,
2083,
8,
26631,
12,
3144,
12,
7105,
12,
378,
12,
378,
12,
378,
12,
378,
9,
267,
14869,
14,
2117,
342,
398,
327,
7053,
5531,
267,
2518,
63,
1985,
275,
14067,
14,
6979,
10725,
360,
11014,
17,
297,
283,
6979,
17,
297,
283,
2540,
17,
358,
267,
291,
14,
1972,
12,
291,
14,
12214,
275,
291,
423,
981,
63,
1972,
63,
460,
63,
12214,
8,
1972,
63,
1985,
9,
339,
347,
485,
981,
63,
1972,
63,
460,
63,
12214,
8,
277,
12,
2518,
63,
1985,
304,
267,
408,
10560,
282,
2518,
436,
4568,
14869,
14,
408,
267,
2518,
275,
17862,
14,
981,
8,
288,
5981,
29,
1972,
63,
1985,
14,
1308,
12,
288,
1329,
29,
1972,
63,
1985,
14,
1972,
12,
288,
1255,
29,
1972,
63,
1985,
14,
1065,
267,
776,
267,
14869,
275,
18946,
14,
14695,
8,
277,
14,
5500,
12,
2518,
14,
344,
9,
267,
372,
2518,
12,
14869,
339,
347,
485,
6472,
63,
1188,
63,
2593,
8,
277,
12,
2653,
304,
267,
408,
17324,
314,
5982,
402,
900,
314,
14869,
1245,
911,
506,
9080,
14,
408,
267,
1101,
275,
577,
1119,
3576,
5688,
8,
14951,
63,
12214,
63,
521,
63,
3136,
29,
2593,
9,
267,
1101,
14,
2117,
342,
339,
347,
511,
63,
14951,
590,
63,
22428,
63,
11653,
8,
277,
304,
267,
408,
267,
1379,
340,
314,
805,
367,
14545,
8058,
26361,
1470,
5419,
22497,
14,
267,
408,
267,
291,
423,
6472,
63,
1188,
63,
2593,
8,
2259,
9,
398,
327,
664,
13588,
4012,
25012,
1006,
13588,
267,
13588,
63,
513,
275,
769,
8,
362,
63,
1972,
63,
14695,
1470,
8,
277,
14,
5500,
12,
488,
12,
15927,
267,
291,
14,
629,
8,
552,
8,
11653,
63,
513,
395,
499,
9,
398,
8058,
63,
1972,
63,
513,
275,
485,
362,
63,
14951,
590,
63,
22428,
63,
11653,
8,
11653,
63,
513,
9,
267,
291,
14,
629,
8,
552,
8,
14951,
63,
1972,
63,
513,
395,
413,
9,
339,
347,
511,
63,
4262,
63,
4375,
63,
3136,
8,
277,
304,
267,
408,
267,
6496,
626,
314,
8058,
14869,
769,
365,
2701,
340,
7526,
370,
4697,
4696,
14,
267,
408,
267,
291,
423,
6472,
63,
1188,
63,
2593,
8,
16,
9,
267,
13588,
63,
513,
275,
769,
8,
362,
63,
1972,
63,
14695,
1470,
8,
277,
14,
5500,
12,
488,
12,
15927,
267,
291,
14,
629,
8,
552,
8,
11653,
63,
513,
395,
499,
9,
398,
8058,
63,
1972,
63,
513,
275,
485,
362,
63,
14951,
590,
63,
22428,
63,
11653,
8,
11653,
63,
513,
9,
267,
291,
14,
629,
8,
552,
8,
14951,
63,
1972,
63,
513,
395,
378,
9,
339,
347,
511,
63,
14695,
1470,
63,
5917,
63,
2786,
63,
14951,
8,
277,
304,
267,
408,
267,
1379,
626,
314,
769,
402,
13903,
2737,
13588,
787,
7684,
3355,
370,
2498,
314,
4750,
267,
8058,
26361,
1470,
1642,
14,
398,
408,
267,
291,
423,
6472,
63,
1188,
63,
2593,
8,
6683,
9,
398,
327,
2790,
282,
1329,
402,
892,
26361,
1470,
436,
13588,
12,
436,
3542,
3932,
7143,
22172,
267,
327,
314,
1642,
14869,
267,
13588,
275,
942,
267,
367,
4280,
12,
4696,
63,
18597,
315,
3482,
8,
1842,
8,
18,
12,
1227,
395,
359,
21,
12,
1616,
12,
4114,
12,
3388,
4682,
288,
2518,
63,
1985,
275,
14067,
14,
6979,
10725,
8,
355,
283,
11014,
91,
1507,
5285,
908,
8,
1507,
29,
2996,
395,
355,
283,
6979,
91,
1507,
5285,
908,
8,
1507,
29,
2996,
395,
355,
283,
2540,
91,
1507,
5285,
908,
8,
1507,
29,
2996,
9,
288,
776,
288,
2518,
12,
14869,
275,
291,
423,
981,
63,
1972,
63,
460,
63,
12214,
8,
1972,
63,
1985,
9,
288,
14869,
14,
3966,
275,
2197,
14,
2083,
14,
2131,
8,
11288,
9,
446,
2197,
14,
7473,
8,
4515,
29,
4515,
63,
18597,
9,
288,
14869,
14,
2117,
342,
288,
13588,
14,
740,
8,
1972,
9,
398,
13588,
63,
513,
275,
769,
8,
362,
63,
1972,
63,
14695,
1470,
8,
277,
14,
5500,
12,
488,
12,
15927,
267,
291,
14,
629,
8,
552,
8,
11653,
63,
513,
395,
1227,
9,
398,
8058,
63,
1972,
63,
513,
275,
485,
362,
63,
14951,
590,
63,
22428,
63,
11653,
8,
11653,
63,
513,
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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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
] |
rockstor/rockstor-core
|
src/rockstor/storageadmin/south_migrations/0022_auto__add_dvolume__add_unique_dvolume_container_dest_dir__add_containe.py
|
9
|
35685
|
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'DVolume'
db.create_table(u'storageadmin_dvolume', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('container', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['storageadmin.DContainer'])),
('share', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['storageadmin.Share'], null=True)),
('dest_dir', self.gf('django.db.models.fields.CharField')(max_length=1024)),
('uservol', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal('storageadmin', ['DVolume'])
# Adding unique constraint on 'DVolume', fields ['container', 'dest_dir']
db.create_unique(u'storageadmin_dvolume', ['container_id', 'dest_dir'])
# Adding model 'ContainerOption'
db.create_table(u'storageadmin_containeroption', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('container', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['storageadmin.DContainer'])),
('name', self.gf('django.db.models.fields.CharField')(max_length=1024)),
('val', self.gf('django.db.models.fields.CharField')(max_length=1024)),
))
db.send_create_signal('storageadmin', ['ContainerOption'])
# Adding model 'DImage'
db.create_table(u'storageadmin_dimage', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(max_length=1024)),
('tag', self.gf('django.db.models.fields.CharField')(max_length=1024)),
('repo', self.gf('django.db.models.fields.CharField')(max_length=1024)),
))
db.send_create_signal('storageadmin', ['DImage'])
# Adding model 'DPort'
db.create_table(u'storageadmin_dport', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('hostp', self.gf('django.db.models.fields.IntegerField')(unique=True)),
('containerp', self.gf('django.db.models.fields.IntegerField')()),
('container', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['storageadmin.DContainer'])),
('protocol', self.gf('django.db.models.fields.CharField')(max_length=32, null=True)),
))
db.send_create_signal('storageadmin', ['DPort'])
# Adding unique constraint on 'DPort', fields ['container', 'containerp']
db.create_unique(u'storageadmin_dport', ['container_id', 'containerp'])
# Adding model 'RockOn'
db.create_table(u'storageadmin_rockon', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(max_length=1024)),
('description', self.gf('django.db.models.fields.CharField')(max_length=2048)),
('version', self.gf('django.db.models.fields.CharField')(max_length=32)),
('state', self.gf('django.db.models.fields.CharField')(max_length=32)),
('status', self.gf('django.db.models.fields.CharField')(max_length=32)),
('link', self.gf('django.db.models.fields.CharField')(max_length=1024, null=True)),
('website', self.gf('django.db.models.fields.CharField')(max_length=2048, null=True)),
))
db.send_create_signal('storageadmin', ['RockOn'])
# Adding model 'DContainer'
db.create_table(u'storageadmin_dcontainer', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('rockon', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['storageadmin.RockOn'])),
('dimage', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['storageadmin.DImage'])),
('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=1024)),
('link', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['storageadmin.DContainer'], null=True)),
))
db.send_create_signal('storageadmin', ['DContainer'])
# Adding model 'DCustomConfig'
db.create_table(u'storageadmin_dcustomconfig', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('rockon', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['storageadmin.RockOn'])),
('key', self.gf('django.db.models.fields.CharField')(max_length=1024)),
('val', self.gf('django.db.models.fields.CharField')(max_length=1024, null=True)),
('description', self.gf('django.db.models.fields.CharField')(max_length=2048, null=True)),
))
db.send_create_signal('storageadmin', ['DCustomConfig'])
# Adding unique constraint on 'DCustomConfig', fields ['rockon', 'key']
db.create_unique(u'storageadmin_dcustomconfig', ['rockon_id', 'key'])
def backwards(self, orm):
# Removing unique constraint on 'DCustomConfig', fields ['rockon', 'key']
db.delete_unique(u'storageadmin_dcustomconfig', ['rockon_id', 'key'])
# Removing unique constraint on 'DPort', fields ['container', 'containerp']
db.delete_unique(u'storageadmin_dport', ['container_id', 'containerp'])
# Removing unique constraint on 'DVolume', fields ['container', 'dest_dir']
db.delete_unique(u'storageadmin_dvolume', ['container_id', 'dest_dir'])
# Deleting model 'DVolume'
db.delete_table(u'storageadmin_dvolume')
# Deleting model 'ContainerOption'
db.delete_table(u'storageadmin_containeroption')
# Deleting model 'DImage'
db.delete_table(u'storageadmin_dimage')
# Deleting model 'DPort'
db.delete_table(u'storageadmin_dport')
# Deleting model 'RockOn'
db.delete_table(u'storageadmin_rockon')
# Deleting model 'DContainer'
db.delete_table(u'storageadmin_dcontainer')
# Deleting model 'DCustomConfig'
db.delete_table(u'storageadmin_dcustomconfig')
models = {
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
u'oauth2_provider.application': {
'Meta': {'object_name': 'Application'},
'authorization_grant_type': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'client_id': ('django.db.models.fields.CharField', [], {'default': "u'ERc4-YE3.qaZ_rD6xEyZr4s;.e3DqqGGj=7Zv!nx'", 'unique': 'True', 'max_length': '100'}),
'client_secret': ('django.db.models.fields.CharField', [], {'default': "u'HAwZOvbLVvo5c@dloYrw92NwnCh@YS?d.yu@5T5e_JJOW5mQLz2RAXcnJ3:-x;uIrUKykS4k!m-eS7cdmh2.RX:Xn;jK-!3xWz0e3=oqydH0Xm9Q3=GwpyRxJR3@XPIw'", 'max_length': '255', 'blank': 'True'}),
'client_type': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'redirect_uris': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"})
},
'storageadmin.advancednfsexport': {
'Meta': {'object_name': 'AdvancedNFSExport'},
'export_str': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
'storageadmin.apikeys': {
'Meta': {'object_name': 'APIKeys'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '10'}),
'user': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '8'})
},
'storageadmin.appliance': {
'Meta': {'object_name': 'Appliance'},
'client_id': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
'client_secret': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
'current_appliance': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'hostname': ('django.db.models.fields.CharField', [], {'default': "'Rockstor'", 'max_length': '128'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ip': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '4096'}),
'mgmt_port': ('django.db.models.fields.IntegerField', [], {'default': '443'}),
'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'})
},
'storageadmin.containeroption': {
'Meta': {'object_name': 'ContainerOption'},
'container': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.DContainer']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
'val': ('django.db.models.fields.CharField', [], {'max_length': '1024'})
},
'storageadmin.dashboardconfig': {
'Meta': {'object_name': 'DashboardConfig'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'unique': 'True'}),
'widgets': ('django.db.models.fields.CharField', [], {'max_length': '4096'})
},
'storageadmin.dcontainer': {
'Meta': {'object_name': 'DContainer'},
'dimage': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.DImage']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'link': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.DContainer']", 'null': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '1024'}),
'rockon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.RockOn']"})
},
'storageadmin.dcustomconfig': {
'Meta': {'unique_together': "(('rockon', 'key'),)", 'object_name': 'DCustomConfig'},
'description': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'key': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
'rockon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.RockOn']"}),
'val': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'})
},
'storageadmin.dimage': {
'Meta': {'object_name': 'DImage'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
'repo': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
'tag': ('django.db.models.fields.CharField', [], {'max_length': '1024'})
},
'storageadmin.disk': {
'Meta': {'object_name': 'Disk'},
'btrfs_uuid': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '10'}),
'offline': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'parted': ('django.db.models.fields.BooleanField', [], {}),
'pool': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.Pool']", 'null': 'True', 'on_delete': 'models.SET_NULL'}),
'serial': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
'size': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}),
'transport': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
'vendor': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'})
},
'storageadmin.dport': {
'Meta': {'unique_together': "(('container', 'containerp'),)", 'object_name': 'DPort'},
'container': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.DContainer']"}),
'containerp': ('django.db.models.fields.IntegerField', [], {}),
'hostp': ('django.db.models.fields.IntegerField', [], {'unique': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'protocol': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'})
},
'storageadmin.dvolume': {
'Meta': {'unique_together': "(('container', 'dest_dir'),)", 'object_name': 'DVolume'},
'container': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.DContainer']"}),
'dest_dir': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'share': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.Share']", 'null': 'True'}),
'uservol': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
},
'storageadmin.group': {
'Meta': {'object_name': 'Group'},
'admin': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'gid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'}),
'groupname': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
'storageadmin.installedplugin': {
'Meta': {'object_name': 'InstalledPlugin'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'install_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'plugin_meta': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.Plugin']"})
},
'storageadmin.iscsitarget': {
'Meta': {'object_name': 'IscsiTarget'},
'dev_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
'dev_size': ('django.db.models.fields.IntegerField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'share': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.Share']"}),
'tid': ('django.db.models.fields.IntegerField', [], {'unique': 'True'}),
'tname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'})
},
'storageadmin.netatalkshare': {
'Meta': {'object_name': 'NetatalkShare'},
'description': ('django.db.models.fields.CharField', [], {'default': "'afp on rockstor'", 'max_length': '1024'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '4096'}),
'share': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'netatalkshare'", 'unique': 'True', 'to': "orm['storageadmin.Share']"}),
'time_machine': ('django.db.models.fields.CharField', [], {'default': "'yes'", 'max_length': '3'})
},
'storageadmin.networkinterface': {
'Meta': {'object_name': 'NetworkInterface'},
'alias': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
'boot_proto': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
'dns_servers': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
'domain': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
'gateway': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ipaddr': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
'itype': ('django.db.models.fields.CharField', [], {'default': "'io'", 'max_length': '100'}),
'mac': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'netmask': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
'network': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}),
'onboot': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
},
'storageadmin.nfsexport': {
'Meta': {'object_name': 'NFSExport'},
'export_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.NFSExportGroup']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'mount': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
'share': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.Share']"})
},
'storageadmin.nfsexportgroup': {
'Meta': {'object_name': 'NFSExportGroup'},
'admin_host': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
'editable': ('django.db.models.fields.CharField', [], {'default': "'rw'", 'max_length': '2'}),
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'host_str': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'mount_security': ('django.db.models.fields.CharField', [], {'default': "'insecure'", 'max_length': '8'}),
'nohide': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'syncable': ('django.db.models.fields.CharField', [], {'default': "'async'", 'max_length': '5'})
},
'storageadmin.oauthapp': {
'Meta': {'object_name': 'OauthApp'},
'application': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['oauth2_provider.Application']", 'unique': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.User']"})
},
'storageadmin.plugin': {
'Meta': {'object_name': 'Plugin'},
'css_file_name': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
'description': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '4096'}),
'display_name': ('django.db.models.fields.CharField', [], {'default': "''", 'unique': 'True', 'max_length': '4096'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'js_file_name': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '4096'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '4096'})
},
'storageadmin.pool': {
'Meta': {'object_name': 'Pool'},
'compression': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'mnt_options': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '4096'}),
'raid': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'size': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}),
'toc': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'uuid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
},
'storageadmin.poolbalance': {
'Meta': {'object_name': 'PoolBalance'},
'end_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'percent_done': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'pid': ('django.db.models.fields.IntegerField', [], {}),
'pool': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.Pool']"}),
'start_time': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '10'})
},
'storageadmin.poolscrub': {
'Meta': {'object_name': 'PoolScrub'},
'corrected_errors': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'csum_discards': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'csum_errors': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'data_extents_scrubbed': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}),
'end_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'kb_scrubbed': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
'last_physical': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}),
'malloc_errors': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'no_csum': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'pid': ('django.db.models.fields.IntegerField', [], {}),
'pool': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.Pool']"}),
'read_errors': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'start_time': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'status': ('django.db.models.fields.CharField', [], {'default': "'started'", 'max_length': '10'}),
'super_errors': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'tree_bytes_scrubbed': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}),
'tree_extents_scrubbed': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}),
'uncorrectable_errors': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'unverified_errors': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'verify_errors': ('django.db.models.fields.IntegerField', [], {'default': '0'})
},
'storageadmin.posixacls': {
'Meta': {'object_name': 'PosixACLs'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'owner': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'perms': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
'smb_share': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.SambaShare']"})
},
'storageadmin.rockon': {
'Meta': {'object_name': 'RockOn'},
'description': ('django.db.models.fields.CharField', [], {'max_length': '2048'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'link': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
'state': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'status': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'version': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'website': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True'})
},
'storageadmin.sambacustomconfig': {
'Meta': {'object_name': 'SambaCustomConfig'},
'custom_config': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'smb_share': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.SambaShare']"})
},
'storageadmin.sambashare': {
'Meta': {'object_name': 'SambaShare'},
'browsable': ('django.db.models.fields.CharField', [], {'default': "'yes'", 'max_length': '3'}),
'comment': ('django.db.models.fields.CharField', [], {'default': "'foo bar'", 'max_length': '100'}),
'guest_ok': ('django.db.models.fields.CharField', [], {'default': "'no'", 'max_length': '3'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '4096'}),
'read_only': ('django.db.models.fields.CharField', [], {'default': "'no'", 'max_length': '3'}),
'share': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'sambashare'", 'unique': 'True', 'to': "orm['storageadmin.Share']"})
},
'storageadmin.setup': {
'Meta': {'object_name': 'Setup'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'setup_disks': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'setup_network': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'setup_system': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'setup_user': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
},
'storageadmin.sftp': {
'Meta': {'object_name': 'SFTP'},
'editable': ('django.db.models.fields.CharField', [], {'default': "'ro'", 'max_length': '2'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'share': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['storageadmin.Share']", 'unique': 'True'})
},
'storageadmin.share': {
'Meta': {'object_name': 'Share'},
'compression_algo': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
'group': ('django.db.models.fields.CharField', [], {'default': "'root'", 'max_length': '4096'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '4096'}),
'owner': ('django.db.models.fields.CharField', [], {'default': "'root'", 'max_length': '4096'}),
'perms': ('django.db.models.fields.CharField', [], {'default': "'755'", 'max_length': '9'}),
'pool': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.Pool']"}),
'qgroup': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'replica': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'size': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}),
'subvol_name': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
'toc': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'uuid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'})
},
'storageadmin.snapshot': {
'Meta': {'unique_together': "(('share', 'name'),)", 'object_name': 'Snapshot'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
'qgroup': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'real_name': ('django.db.models.fields.CharField', [], {'default': "'unknownsnap'", 'max_length': '4096'}),
'share': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.Share']"}),
'size': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}),
'snap_type': ('django.db.models.fields.CharField', [], {'default': "'admin'", 'max_length': '64'}),
'toc': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'uvisible': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'writable': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
},
'storageadmin.supportcase': {
'Meta': {'object_name': 'SupportCase'},
'case_type': ('django.db.models.fields.CharField', [], {'max_length': '6'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'notes': ('django.db.models.fields.TextField', [], {}),
'status': ('django.db.models.fields.CharField', [], {'max_length': '9'}),
'zipped_log': ('django.db.models.fields.CharField', [], {'max_length': '128'})
},
'storageadmin.user': {
'Meta': {'object_name': 'User'},
'admin': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'email': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
'gid': ('django.db.models.fields.IntegerField', [], {'default': '5000'}),
'group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['storageadmin.Group']", 'null': 'True'}),
'homedir': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'public_key': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}),
'shell': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True'}),
'smb_shares': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'admin_users'", 'null': 'True', 'to': "orm['storageadmin.SambaShare']"}),
'uid': ('django.db.models.fields.IntegerField', [], {'default': '5000'}),
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'suser'", 'unique': 'True', 'null': 'True', 'to': u"orm['auth.User']"}),
'username': ('django.db.models.fields.CharField', [], {'default': "''", 'unique': 'True', 'max_length': '4096'})
}
}
complete_apps = ['storageadmin']
|
gpl-3.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
504,
12919,
14,
1208,
492,
2197,
63,
1208,
465,
2197,
199,
504,
12919,
14,
697,
492,
1592,
199,
504,
12919,
14,
86,
18,
492,
24765,
199,
504,
1639,
14,
697,
492,
1709,
421,
199,
533,
12090,
8,
24822,
304,
339,
347,
17465,
8,
277,
12,
9813,
304,
267,
327,
12934,
1402,
283,
36,
6464,
7,
267,
1592,
14,
981,
63,
1224,
8,
85,
1159,
84,
2128,
2113,
63,
68,
2405,
297,
334,
288,
334,
85,
7,
344,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
7533,
3327,
63,
498,
29,
549,
1826,
288,
661,
3600,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
3190,
7533,
475,
29,
1025,
459,
3494,
2113,
14,
36,
4076,
16607,
288,
661,
6251,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
3190,
7533,
475,
29,
1025,
459,
3494,
2113,
14,
18713,
995,
2973,
29,
549,
1826,
288,
661,
2614,
63,
694,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
288,
661,
751,
5650,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
5036,
7533,
885,
29,
797,
1826,
267,
5082,
267,
1592,
14,
2254,
63,
981,
63,
4653,
360,
3494,
2113,
297,
788,
36,
6464,
1105,
398,
327,
12934,
3747,
5828,
641,
283,
36,
6464,
297,
1504,
788,
3600,
297,
283,
2614,
63,
694,
418,
267,
1592,
14,
981,
63,
3235,
8,
85,
1159,
84,
2128,
2113,
63,
68,
2405,
297,
788,
3600,
63,
344,
297,
283,
2614,
63,
694,
1105,
398,
327,
12934,
1402,
283,
4076,
2602,
7,
267,
1592,
14,
981,
63,
1224,
8,
85,
1159,
84,
2128,
2113,
63,
3600,
1422,
297,
334,
288,
334,
85,
7,
344,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
7533,
3327,
63,
498,
29,
549,
1826,
288,
661,
3600,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
3190,
7533,
475,
29,
1025,
459,
3494,
2113,
14,
36,
4076,
16607,
288,
661,
354,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
288,
661,
637,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
267,
5082,
267,
1592,
14,
2254,
63,
981,
63,
4653,
360,
3494,
2113,
297,
788,
4076,
2602,
1105,
398,
327,
12934,
1402,
283,
1914,
960,
7,
267,
1592,
14,
981,
63,
1224,
8,
85,
1159,
84,
2128,
2113,
63,
23335,
297,
334,
288,
334,
85,
7,
344,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
7533,
3327,
63,
498,
29,
549,
1826,
288,
661,
354,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
288,
661,
1450,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
288,
661,
3417,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
267,
5082,
267,
1592,
14,
2254,
63,
981,
63,
4653,
360,
3494,
2113,
297,
788,
1914,
960,
1105,
398,
327,
12934,
1402,
283,
36,
4313,
7,
267,
1592,
14,
981,
63,
1224,
8,
85,
1159,
84,
2128,
2113,
63,
68,
719,
297,
334,
288,
334,
85,
7,
344,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
7533,
3327,
63,
498,
29,
549,
1826,
288,
661,
1102,
80,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
3901,
7533,
3235,
29,
549,
1826,
288,
661,
3600,
80,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
3901,
358,
4000,
288,
661,
3600,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
3190,
7533,
475,
29,
1025,
459,
3494,
2113,
14,
36,
4076,
16607,
288,
661,
3922,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
708,
12,
2973,
29,
549,
1826,
267,
5082,
267,
1592,
14,
2254,
63,
981,
63,
4653,
360,
3494,
2113,
297,
788,
36,
4313,
1105,
398,
327,
12934,
3747,
5828,
641,
283,
36,
4313,
297,
1504,
788,
3600,
297,
283,
3600,
80,
418,
267,
1592,
14,
981,
63,
3235,
8,
85,
1159,
84,
2128,
2113,
63,
68,
719,
297,
788,
3600,
63,
344,
297,
283,
3600,
80,
1105,
398,
327,
12934,
1402,
283,
50,
766,
3314,
7,
267,
1592,
14,
981,
63,
1224,
8,
85,
1159,
84,
2128,
2113,
63,
24892,
265,
297,
334,
288,
334,
85,
7,
344,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
7533,
3327,
63,
498,
29,
549,
1826,
288,
661,
354,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
288,
661,
1802,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
18343,
1826,
288,
661,
1023,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
708,
1826,
288,
661,
929,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
708,
1826,
288,
661,
1205,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
708,
1826,
288,
661,
1073,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
12,
2973,
29,
549,
1826,
288,
661,
7360,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
18343,
12,
2973,
29,
549,
1826,
267,
5082,
267,
1592,
14,
2254,
63,
981,
63,
4653,
360,
3494,
2113,
297
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
504,
12919,
14,
1208,
492,
2197,
63,
1208,
465,
2197,
199,
504,
12919,
14,
697,
492,
1592,
199,
504,
12919,
14,
86,
18,
492,
24765,
199,
504,
1639,
14,
697,
492,
1709,
421,
199,
533,
12090,
8,
24822,
304,
339,
347,
17465,
8,
277,
12,
9813,
304,
267,
327,
12934,
1402,
283,
36,
6464,
7,
267,
1592,
14,
981,
63,
1224,
8,
85,
1159,
84,
2128,
2113,
63,
68,
2405,
297,
334,
288,
334,
85,
7,
344,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
7533,
3327,
63,
498,
29,
549,
1826,
288,
661,
3600,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
3190,
7533,
475,
29,
1025,
459,
3494,
2113,
14,
36,
4076,
16607,
288,
661,
6251,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
3190,
7533,
475,
29,
1025,
459,
3494,
2113,
14,
18713,
995,
2973,
29,
549,
1826,
288,
661,
2614,
63,
694,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
288,
661,
751,
5650,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
5036,
7533,
885,
29,
797,
1826,
267,
5082,
267,
1592,
14,
2254,
63,
981,
63,
4653,
360,
3494,
2113,
297,
788,
36,
6464,
1105,
398,
327,
12934,
3747,
5828,
641,
283,
36,
6464,
297,
1504,
788,
3600,
297,
283,
2614,
63,
694,
418,
267,
1592,
14,
981,
63,
3235,
8,
85,
1159,
84,
2128,
2113,
63,
68,
2405,
297,
788,
3600,
63,
344,
297,
283,
2614,
63,
694,
1105,
398,
327,
12934,
1402,
283,
4076,
2602,
7,
267,
1592,
14,
981,
63,
1224,
8,
85,
1159,
84,
2128,
2113,
63,
3600,
1422,
297,
334,
288,
334,
85,
7,
344,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
7533,
3327,
63,
498,
29,
549,
1826,
288,
661,
3600,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
3190,
7533,
475,
29,
1025,
459,
3494,
2113,
14,
36,
4076,
16607,
288,
661,
354,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
288,
661,
637,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
267,
5082,
267,
1592,
14,
2254,
63,
981,
63,
4653,
360,
3494,
2113,
297,
788,
4076,
2602,
1105,
398,
327,
12934,
1402,
283,
1914,
960,
7,
267,
1592,
14,
981,
63,
1224,
8,
85,
1159,
84,
2128,
2113,
63,
23335,
297,
334,
288,
334,
85,
7,
344,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
7533,
3327,
63,
498,
29,
549,
1826,
288,
661,
354,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
288,
661,
1450,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
288,
661,
3417,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
267,
5082,
267,
1592,
14,
2254,
63,
981,
63,
4653,
360,
3494,
2113,
297,
788,
1914,
960,
1105,
398,
327,
12934,
1402,
283,
36,
4313,
7,
267,
1592,
14,
981,
63,
1224,
8,
85,
1159,
84,
2128,
2113,
63,
68,
719,
297,
334,
288,
334,
85,
7,
344,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
7533,
3327,
63,
498,
29,
549,
1826,
288,
661,
1102,
80,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
3901,
7533,
3235,
29,
549,
1826,
288,
661,
3600,
80,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
3901,
358,
4000,
288,
661,
3600,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2407,
14,
3190,
7533,
475,
29,
1025,
459,
3494,
2113,
14,
36,
4076,
16607,
288,
661,
3922,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
708,
12,
2973,
29,
549,
1826,
267,
5082,
267,
1592,
14,
2254,
63,
981,
63,
4653,
360,
3494,
2113,
297,
788,
36,
4313,
1105,
398,
327,
12934,
3747,
5828,
641,
283,
36,
4313,
297,
1504,
788,
3600,
297,
283,
3600,
80,
418,
267,
1592,
14,
981,
63,
3235,
8,
85,
1159,
84,
2128,
2113,
63,
68,
719,
297,
788,
3600,
63,
344,
297,
283,
3600,
80,
1105,
398,
327,
12934,
1402,
283,
50,
766,
3314,
7,
267,
1592,
14,
981,
63,
1224,
8,
85,
1159,
84,
2128,
2113,
63,
24892,
265,
297,
334,
288,
334,
85,
7,
344,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
4378,
7533,
3327,
63,
498,
29,
549,
1826,
288,
661,
354,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
1826,
288,
661,
1802,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
18343,
1826,
288,
661,
1023,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
708,
1826,
288,
661,
929,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
708,
1826,
288,
661,
1205,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
708,
1826,
288,
661,
1073,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
7727,
12,
2973,
29,
549,
1826,
288,
661,
7360,
297,
291,
14,
7102,
360,
1176,
14,
697,
14,
992,
14,
955,
14,
2183,
7533,
988,
63,
1267,
29,
18343,
12,
2973,
29,
549,
1826,
267,
5082,
267,
1592,
14,
2254,
63,
981,
63,
4653,
360,
3494,
2113,
297,
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,
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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
] |
webOS-ports/qtwebkit
|
Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py
|
130
|
1524
|
#
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# 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; see the file COPYING.LIB. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
def func1():
def func2():
return
def func3():
# comment
return
# def funcInsideComment():
def func4(a):
return
def func5(a, b, c):
return
def func6(a, b, \
c, d):
return
def funcOverloaded(a):
return
def funcOverloaded(a, b):
return
def funcOverloaded(a, b, c=100):
return
def func7():
pass
def func8():
pass
def func9():
pass
pass
pass
class Class1:
pass
class Class2:
pass
class Class3:
pass
class Class4:
pass
pass
pass
class Class5:
pass
def func10():
pass
pass
def func11():
pass
pass
|
gpl-2.0
|
[
3,
199,
3,
1898,
334,
35,
9,
7760,
4475,
3277,
14,
221,
2900,
4481,
4644,
14,
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,
844,
199,
3,
3180,
543,
642,
3555,
27,
1937,
314,
570,
9685,
14,
5617,
14,
221,
982,
440,
12,
2218,
370,
199,
3,
314,
2868,
2290,
2752,
12,
3277,
2020,
8026,
11236,
14259,
12,
12066,
11844,
12,
199,
3,
8226,
12,
4828,
11315,
13,
10067,
12,
8217,
14,
199,
3,
421,
199,
318,
2562,
17,
837,
421,
199,
318,
2562,
18,
837,
272,
372,
421,
199,
318,
2562,
19,
837,
272,
327,
3721,
272,
372,
199,
199,
3,
347,
2562,
607,
2441,
7488,
837,
421,
199,
318,
2562,
20,
8,
65,
304,
272,
372,
421,
199,
318,
2562,
21,
8,
65,
12,
330,
12,
286,
304,
272,
372,
421,
199,
318,
2562,
22,
8,
65,
12,
330,
12,
971,
881,
286,
12,
366,
304,
272,
372,
421,
199,
318,
2562,
5674,
4591,
8,
65,
304,
272,
372,
421,
199,
318,
2562,
5674,
4591,
8,
65,
12,
330,
304,
272,
372,
421,
199,
318,
2562,
5674,
4591,
8,
65,
12,
330,
12,
286,
29,
1960,
304,
272,
372,
421,
199,
318,
2562,
23,
837,
272,
986,
339,
347,
2562,
24,
837,
267,
986,
398,
347,
2562,
25,
837,
288,
986,
267,
986,
272,
986,
421,
199,
533,
8089,
17,
26,
272,
986,
421,
199,
533,
8089,
18,
26,
272,
986,
339,
1021,
8089,
19,
26,
267,
986,
398,
1021,
8089,
20,
26,
288,
986,
267,
986,
272,
986,
421,
199,
533,
8089,
21,
26,
272,
986,
339,
347,
2562,
709,
837,
267,
986,
272,
986,
339,
347,
2562,
845,
837,
267,
986,
272,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
3,
1898,
334,
35,
9,
7760,
4475,
3277,
14,
221,
2900,
4481,
4644,
14,
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,
844,
199,
3,
3180,
543,
642,
3555,
27,
1937,
314,
570,
9685,
14,
5617,
14,
221,
982,
440,
12,
2218,
370,
199,
3,
314,
2868,
2290,
2752,
12,
3277,
2020,
8026,
11236,
14259,
12,
12066,
11844,
12,
199,
3,
8226,
12,
4828,
11315,
13,
10067,
12,
8217,
14,
199,
3,
421,
199,
318,
2562,
17,
837,
421,
199,
318,
2562,
18,
837,
272,
372,
421,
199,
318,
2562,
19,
837,
272,
327,
3721,
272,
372,
199,
199,
3,
347,
2562,
607,
2441,
7488,
837,
421,
199,
318,
2562,
20,
8,
65,
304,
272,
372,
421,
199,
318,
2562,
21,
8,
65,
12,
330,
12,
286,
304,
272,
372,
421,
199,
318,
2562,
22,
8,
65,
12,
330,
12,
971,
881,
286,
12,
366,
304,
272,
372,
421,
199,
318,
2562,
5674,
4591,
8,
65,
304,
272,
372,
421,
199,
318,
2562,
5674,
4591,
8,
65,
12,
330,
304,
272,
372,
421,
199,
318,
2562,
5674,
4591,
8,
65,
12,
330,
12,
286,
29,
1960,
304,
272,
372,
421,
199,
318,
2562,
23,
837,
272,
986,
339,
347,
2562,
24,
837,
267,
986,
398,
347,
2562,
25,
837,
288,
986,
267,
986,
272,
986,
421,
199,
533,
8089,
17,
26,
272,
986,
421,
199,
533,
8089,
18,
26,
272,
986,
339,
1021,
8089,
19,
26,
267,
986,
398,
1021,
8089,
20,
26,
288,
986,
267,
986,
272,
986,
421,
199,
533,
8089,
21,
26,
272,
986,
339,
347,
2562,
709,
837,
267,
986,
272,
986,
339,
347,
2562,
845,
837,
267,
986,
272,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
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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
] |
khendarg/ubi
|
filter_sps.py
|
1
|
6189
|
#!/usr/bin/env python2
from __future__ import print_function
import argparse, json, sys, time, os
import yaml
VERBOSITY = 1
def info(*substrs):
print('[INFO]: ', end='', file=sys.stderr)
print(*substrs, file=sys.stderr)
def warn(*substrs):
print('[WARNING]: ', end='', file=sys.stderr)
print(*substrs, file=sys.stderr)
def main(*infiles, **kwargs):
try: rmsd_max = float(kwargs['rmsd_max'])
except KeyError: rmsd_max = 5.
except TypeError: rmsd_max = None
try: length_min = int(kwargs['length_min'])
except KeyError: length_min = 60
except TypeError: length_min = None
try: deficit_max = int(kwargs['deficit_max'])
except KeyError: deficit_max = 15
except TypeError: deficit_max = None
try: out = kwargs['out']
except KeyError: out = '/dev/stdout'
try:
tms_min = kwargs['tms_min']
if tms_min is not None:
if 'p1d' in kwargs: p1d = kwargs['p1d']
else: raise TypeError('Expected argument p1d')
except KeyError:
tms_min = None
if tms_min is None: p1d = None
try: tms_threshold = kwargs['tms_threshold']
except KeyError: tms_threshold = 10
try:
purge_reciprocals = kwargs['purge_reciprocals']
if purge_reciprocals:
if 'p2d' in kwargs: p2d = kwargs['p2d']
else: raise TypeError('Expected argument p2d')
with open('{0}/deuterocol2.yaml'.format(p2d)) as f:
d2data = yaml.load_all(f).next()
b2a = {}
for pdbc in d2data['b2a']: b2a[pdbc] = sorted(d2data['b2a'][pdbc])[0]
#print(d2data)
#for section in d2data:
# try: print(section, section.tag, section.value)
# except AttributeError: pass
except KeyError:
purge_reciprocals = None
p2d = None
if purge_reciprocals is None: p2d = None
# if VERBOSITY:
# info('rmsd_max = {0}'.format(rmsd_max))
# info('length_min = {0}'.format(length_min))
# info('deficit_max = {0}'.format(deficit_max))
# info('tms_min = {0}'.format(tms_min))
# info('tms_threshold = {0}'.format(tms_threshold))
# info('p1d = {0}'.format(p1d))
# info('p2d = {0}'.format(p2d))
# info('purge_reciprocals = {0}'.format(purge_reciprocals))
with open(out, 'w') as fout:
for fn in infiles:
with open(fn) as f:
n = 0
last_t = time.time()
for l in f:
n += 1
if VERBOSITY and not (n % 10000):
info('%d lines parsed (%0.2f)' % (n, time.time() - last_t))
last_t = time.time()
if not l.strip(): continue
elif l.lstrip().startswith('#'): continue
else:
sl = l.split('\t')
try: obj = json.loads(sl[1])
except IndexError:
if VERBOSITY > 1: warn('No alignment found for %s' % l.rstrip())
continue
except ValueError:
if VERBOSITY > 1: warn('No alignment found for %s' % l.rstrip())
continue
if (rmsd_max is not None) and (obj['rmsd'] > rmsd_max):
if VERBOSITY > 1: info('Rejected: High RMSD')
continue
elif (length_min is not None) and (obj['length'] < length_min):
if VERBOSITY > 1: info('Rejected: Low length')
continue
elif (deficit_max is not None) and ((len(obj['qpresent']) - len(obj['qaligned'])) > deficit_max):
if VERBOSITY > 1: info('Rejected: High deficit in q')
continue
elif (deficit_max is not None) and ((len(obj['tpresent']) - len(obj['taligned'])) > deficit_max):
if VERBOSITY > 1: info('Rejected: High deficit in t')
continue
elif (tms_min is not None) and tms_min and not has_n_tmss(obj, tms_min, tms_threshold, p1d):
if VERBOSITY > 1: info('Rejected: Not enough TMSs')
continue
elif purge_reciprocals and not in_order(obj, b2a):
if VERBOSITY > 1: info('Rejected: In reciprocal order')
continue
else:
fout.write(l)
def in_order(obj, b2a):
qpdbc = os.path.splitext(os.path.basename(obj['query']))[0]
tpdbc = os.path.splitext(os.path.basename(obj['target']))[0]
if b2a[qpdbc] <= b2a[tpdbc]: return True
else: return False
def has_n_tmss(obj, tms_min, threshold, p1d):
qpdbc = os.path.splitext(os.path.basename(obj['query']))[0]
tpdbc = os.path.splitext(os.path.basename(obj['target']))[0]
#if os.path.isfile('{p1d}/derp/{qpdbc}.derp'
qaligned = set(obj['qaligned'])
taligned = set(obj['taligned'])
qcount = 0
tcount = 0
with open('{0}/derp/{1}.derp'.format(p1d, qpdbc)) as f:
for l in f:
if not l.strip(): continue
sl = l.split()
cov = qaligned.intersection(set(range(int(sl[1]), int(sl[2])+1)))
if len(cov) >= threshold: qcount += 1
with open('{0}/derp/{1}.derp'.format(p1d, tpdbc)) as f:
for l in f:
if not l.strip(): continue
sl = l.split()
cov = taligned.intersection(set(range(int(sl[1]), int(sl[2])+1)))
if len(cov) >= threshold: tcount += 1
if min(qcount, tcount) >= tms_min: return True
else: return False
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--rmsd-max', type=float)
parser.add_argument('--length-min', type=int)
parser.add_argument('--deficit-max', type=int, help='maximum residues in *present but not in *aligned')
parser.add_argument('--p1d', help='Deuterocol1 directory. Only required if counting TMSs')
parser.add_argument('--tms-min', type=int, help='require this many TMSs')
parser.add_argument('--tms-threshold', type=int, default=10, help='require this many aligned residues to count a TMS')
parser.add_argument('--p2d', help='Deuterocol2 directory. Only required if purging reciprocals')
parser.add_argument('--purge-reciprocals', action='store_true', help='retain only alignments where the first family is less than the second')
parser.add_argument('-o', '--outfile', default='/dev/stdout')
parser.add_argument('infile', nargs='+')
parser.add_argument('-v', action='store_true')
args = parser.parse_args()
if args.tms_min is not None and args.p1d is None:
parser.print_help()
exit()
if args.purge_reciprocals and args.p2d is None:
parser.print_help()
exit()
if args.v: VERBOSITY = 2
main(*args.infile, \
out=args.outfile, \
rmsd_max=args.rmsd_max, \
length_min=args.length_min, \
deficit_max=args.deficit_max, \
p1d=args.p1d, \
tms_min=args.tms_min, \
tms_threshold=args.tms_threshold, \
p2d=args.p2d, \
purge_reciprocals=args.purge_reciprocals \
)
|
bsd-3-clause
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
18,
199,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
646,
7534,
12,
2022,
12,
984,
12,
900,
12,
747,
199,
199,
646,
8864,
199,
199,
2111,
34,
3100,
1922,
275,
413,
199,
199,
318,
2256,
2031,
954,
16144,
304,
9948,
198,
1361,
11894,
4531,
2189,
1656,
1284,
4581,
570,
29,
1274,
14,
3083,
9,
199,
198,
1361,
2031,
954,
16144,
12,
570,
29,
1274,
14,
3083,
9,
199,
199,
318,
7987,
2031,
954,
16144,
304,
9948,
198,
1361,
11894,
9171,
2189,
1656,
1284,
4581,
570,
29,
1274,
14,
3083,
9,
199,
198,
1361,
2031,
954,
16144,
12,
570,
29,
1274,
14,
3083,
9,
199,
199,
318,
2446,
2031,
262,
1725,
12,
1011,
958,
304,
199,
198,
893,
26,
519,
28982,
63,
988,
275,
2069,
8,
958,
459,
24444,
68,
63,
988,
1105,
199,
198,
2590,
4067,
26,
519,
28982,
63,
988,
275,
959,
14,
199,
198,
2590,
3146,
26,
519,
28982,
63,
988,
275,
488,
421,
198,
893,
26,
2582,
63,
827,
275,
1109,
8,
958,
459,
1267,
63,
827,
1105,
199,
198,
2590,
4067,
26,
2582,
63,
827,
275,
5212,
199,
198,
2590,
3146,
26,
2582,
63,
827,
275,
488,
421,
198,
893,
26,
347,
530,
390,
63,
988,
275,
1109,
8,
958,
459,
318,
530,
390,
63,
988,
1105,
199,
198,
2590,
4067,
26,
347,
530,
390,
63,
988,
275,
4114,
199,
198,
2590,
3146,
26,
347,
530,
390,
63,
988,
275,
488,
421,
198,
893,
26,
734,
275,
2074,
459,
548,
418,
199,
198,
2590,
4067,
26,
734,
275,
1994,
2374,
15,
2703,
7,
421,
198,
893,
26,
11083,
198,
84,
706,
63,
827,
275,
2074,
459,
84,
706,
63,
827,
418,
507,
198,
692,
307,
706,
63,
827,
365,
440,
488,
26,
686,
198,
692,
283,
80,
17,
68,
7,
315,
2074,
26,
299,
17,
68,
275,
2074,
459,
80,
17,
68,
418,
686,
198,
2836,
26,
746,
3146,
360,
6964,
1423,
299,
17,
68,
358,
199,
198,
2590,
4067,
26,
11083,
198,
84,
706,
63,
827,
275,
488,
199,
198,
692,
307,
706,
63,
827,
365,
488,
26,
299,
17,
68,
275,
488,
421,
198,
893,
26,
307,
706,
63,
7227,
275,
2074,
459,
84,
706,
63,
7227,
418,
199,
198,
2590,
4067,
26,
307,
706,
63,
7227,
275,
1616,
421,
198,
893,
26,
11083,
198,
18254,
63,
264,
31846,
83,
275,
2074,
459,
18254,
63,
264,
31846,
83,
418,
507,
198,
692,
18503,
63,
264,
31846,
83,
26,
686,
198,
692,
283,
80,
18,
68,
7,
315,
2074,
26,
299,
18,
68,
275,
2074,
459,
80,
18,
68,
418,
686,
198,
2836,
26,
746,
3146,
360,
6964,
1423,
299,
18,
68,
358,
6319,
198,
1045,
1551,
11117,
16,
5995,
271,
938,
293,
761,
18,
14,
5963,
1370,
908,
8,
80,
18,
68,
430,
465,
289,
26,
28932,
198,
68,
18,
576,
275,
8864,
14,
912,
63,
452,
8,
70,
680,
2184,
342,
1585,
198,
66,
18,
65,
275,
1052,
1585,
198,
509,
10543,
67,
315,
366,
18,
576,
459,
66,
18,
65,
2565,
330,
18,
65,
59,
10511,
67,
61,
275,
3355,
8,
68,
18,
576,
459,
66,
18,
65,
3488,
10511,
67,
11057,
16,
61,
1585,
198,
3,
1361,
8,
68,
18,
576,
9,
1585,
198,
3,
509,
3420,
315,
366,
18,
576,
26,
28932,
198,
3,
198,
893,
26,
870,
8,
2792,
12,
3420,
14,
1450,
12,
3420,
14,
585,
9,
1585,
198,
3,
198,
2590,
4281,
26,
986,
421,
198,
2590,
4067,
26,
11083,
198,
18254,
63,
264,
31846,
83,
275,
488,
507,
198,
80,
18,
68,
275,
488,
199,
198,
692,
18503,
63,
264,
31846,
83,
365,
488,
26,
299,
18,
68,
275,
488,
199,
199,
3,
198,
692,
12348,
34,
3100,
1922,
26,
199,
3,
198,
198,
815,
360,
24444,
68,
63,
988,
275,
469,
16,
5285,
908,
8,
24444,
68,
63,
988,
430,
199,
3,
198,
198,
815,
360,
1267,
63,
827,
275,
469,
16,
5285,
908,
8,
1267,
63,
827,
430,
199,
3,
198,
198,
815,
360,
318,
530,
390,
63,
988,
275,
469,
16,
5285,
908,
8,
318,
530,
390,
63,
988,
430,
199,
3,
198,
198,
815,
360,
84,
706,
63,
827,
275,
469,
16,
5285,
908,
8,
84,
706,
63,
827,
430,
199,
3,
198,
198,
815,
360,
84,
706,
63,
7227,
275,
469,
16,
5285,
908,
8,
84,
706,
63,
7227,
430,
199,
3,
198,
198,
815,
360,
80,
17,
68,
275,
469,
16,
5285,
908,
8,
80,
17,
68,
430,
199,
3,
198,
198,
815,
360,
80,
18,
68,
275,
469,
16,
5285,
908,
8,
80,
18,
68,
430,
199,
3,
198,
198,
815,
360,
18254,
63,
264,
31846,
83,
275,
469,
16,
5285,
908,
8,
18254,
63,
264,
31846,
83,
430,
421,
198,
1045,
1551,
8,
548,
12,
283,
87,
358,
465,
17863,
26,
507,
198,
509,
4325,
315,
315,
1725,
26,
686,
198,
1045,
1551,
8,
2324,
9,
465,
289,
26,
1585,
198,
78,
275,
378,
1585,
198,
2019,
63,
84,
275,
900,
14,
521,
342,
1585,
198,
509,
634,
315,
289,
26,
1871,
198,
78,
847,
413,
1871,
198,
692,
12348,
34,
3100,
1922,
436,
440,
334,
78,
450,
11630,
304,
221,
4671,
198,
815,
3508,
68,
2385,
4565,
4366,
16,
14,
18,
70,
3171,
450,
334,
78,
12,
900,
14,
521,
342,
446,
2061,
63,
84,
430,
4671,
198,
2019,
63,
84,
275,
900,
14,
521,
342,
1871,
198,
692,
440,
634,
14,
1913,
837,
1980,
1871,
198,
4164,
634,
14,
10124,
1252,
2460,
7863,
735,
1980,
1871,
198,
2836,
26,
4671,
198,
2482,
275,
634,
14,
1294,
2258,
84,
358,
4671,
198,
893,
26,
1559,
275,
2022,
14,
3640,
8,
2482,
59,
17,
566,
4671,
198,
2590,
7888,
26,
221,
5264,
198,
692,
12348,
34,
3100,
1922,
690,
413,
26,
7987,
360,
1944,
13177,
1911,
367,
450,
83,
7,
450,
634,
14,
6735,
1012,
5264,
198,
6958,
4671,
198,
2590,
1722,
26,
5264,
198,
692,
12348,
34,
3100,
1922,
690,
413,
26,
7987,
360,
1944,
13177,
1911,
367,
450,
83,
7,
450,
634,
14,
6735,
1012,
5264,
198,
6958,
4671,
198,
692,
334,
24444,
68,
63,
988,
365,
440,
488,
9
] |
[
2647,
15,
1393,
15,
1813,
2366,
18,
199,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
646,
7534,
12,
2022,
12,
984,
12,
900,
12,
747,
199,
199,
646,
8864,
199,
199,
2111,
34,
3100,
1922,
275,
413,
199,
199,
318,
2256,
2031,
954,
16144,
304,
9948,
198,
1361,
11894,
4531,
2189,
1656,
1284,
4581,
570,
29,
1274,
14,
3083,
9,
199,
198,
1361,
2031,
954,
16144,
12,
570,
29,
1274,
14,
3083,
9,
199,
199,
318,
7987,
2031,
954,
16144,
304,
9948,
198,
1361,
11894,
9171,
2189,
1656,
1284,
4581,
570,
29,
1274,
14,
3083,
9,
199,
198,
1361,
2031,
954,
16144,
12,
570,
29,
1274,
14,
3083,
9,
199,
199,
318,
2446,
2031,
262,
1725,
12,
1011,
958,
304,
199,
198,
893,
26,
519,
28982,
63,
988,
275,
2069,
8,
958,
459,
24444,
68,
63,
988,
1105,
199,
198,
2590,
4067,
26,
519,
28982,
63,
988,
275,
959,
14,
199,
198,
2590,
3146,
26,
519,
28982,
63,
988,
275,
488,
421,
198,
893,
26,
2582,
63,
827,
275,
1109,
8,
958,
459,
1267,
63,
827,
1105,
199,
198,
2590,
4067,
26,
2582,
63,
827,
275,
5212,
199,
198,
2590,
3146,
26,
2582,
63,
827,
275,
488,
421,
198,
893,
26,
347,
530,
390,
63,
988,
275,
1109,
8,
958,
459,
318,
530,
390,
63,
988,
1105,
199,
198,
2590,
4067,
26,
347,
530,
390,
63,
988,
275,
4114,
199,
198,
2590,
3146,
26,
347,
530,
390,
63,
988,
275,
488,
421,
198,
893,
26,
734,
275,
2074,
459,
548,
418,
199,
198,
2590,
4067,
26,
734,
275,
1994,
2374,
15,
2703,
7,
421,
198,
893,
26,
11083,
198,
84,
706,
63,
827,
275,
2074,
459,
84,
706,
63,
827,
418,
507,
198,
692,
307,
706,
63,
827,
365,
440,
488,
26,
686,
198,
692,
283,
80,
17,
68,
7,
315,
2074,
26,
299,
17,
68,
275,
2074,
459,
80,
17,
68,
418,
686,
198,
2836,
26,
746,
3146,
360,
6964,
1423,
299,
17,
68,
358,
199,
198,
2590,
4067,
26,
11083,
198,
84,
706,
63,
827,
275,
488,
199,
198,
692,
307,
706,
63,
827,
365,
488,
26,
299,
17,
68,
275,
488,
421,
198,
893,
26,
307,
706,
63,
7227,
275,
2074,
459,
84,
706,
63,
7227,
418,
199,
198,
2590,
4067,
26,
307,
706,
63,
7227,
275,
1616,
421,
198,
893,
26,
11083,
198,
18254,
63,
264,
31846,
83,
275,
2074,
459,
18254,
63,
264,
31846,
83,
418,
507,
198,
692,
18503,
63,
264,
31846,
83,
26,
686,
198,
692,
283,
80,
18,
68,
7,
315,
2074,
26,
299,
18,
68,
275,
2074,
459,
80,
18,
68,
418,
686,
198,
2836,
26,
746,
3146,
360,
6964,
1423,
299,
18,
68,
358,
6319,
198,
1045,
1551,
11117,
16,
5995,
271,
938,
293,
761,
18,
14,
5963,
1370,
908,
8,
80,
18,
68,
430,
465,
289,
26,
28932,
198,
68,
18,
576,
275,
8864,
14,
912,
63,
452,
8,
70,
680,
2184,
342,
1585,
198,
66,
18,
65,
275,
1052,
1585,
198,
509,
10543,
67,
315,
366,
18,
576,
459,
66,
18,
65,
2565,
330,
18,
65,
59,
10511,
67,
61,
275,
3355,
8,
68,
18,
576,
459,
66,
18,
65,
3488,
10511,
67,
11057,
16,
61,
1585,
198,
3,
1361,
8,
68,
18,
576,
9,
1585,
198,
3,
509,
3420,
315,
366,
18,
576,
26,
28932,
198,
3,
198,
893,
26,
870,
8,
2792,
12,
3420,
14,
1450,
12,
3420,
14,
585,
9,
1585,
198,
3,
198,
2590,
4281,
26,
986,
421,
198,
2590,
4067,
26,
11083,
198,
18254,
63,
264,
31846,
83,
275,
488,
507,
198,
80,
18,
68,
275,
488,
199,
198,
692,
18503,
63,
264,
31846,
83,
365,
488,
26,
299,
18,
68,
275,
488,
199,
199,
3,
198,
692,
12348,
34,
3100,
1922,
26,
199,
3,
198,
198,
815,
360,
24444,
68,
63,
988,
275,
469,
16,
5285,
908,
8,
24444,
68,
63,
988,
430,
199,
3,
198,
198,
815,
360,
1267,
63,
827,
275,
469,
16,
5285,
908,
8,
1267,
63,
827,
430,
199,
3,
198,
198,
815,
360,
318,
530,
390,
63,
988,
275,
469,
16,
5285,
908,
8,
318,
530,
390,
63,
988,
430,
199,
3,
198,
198,
815,
360,
84,
706,
63,
827,
275,
469,
16,
5285,
908,
8,
84,
706,
63,
827,
430,
199,
3,
198,
198,
815,
360,
84,
706,
63,
7227,
275,
469,
16,
5285,
908,
8,
84,
706,
63,
7227,
430,
199,
3,
198,
198,
815,
360,
80,
17,
68,
275,
469,
16,
5285,
908,
8,
80,
17,
68,
430,
199,
3,
198,
198,
815,
360,
80,
18,
68,
275,
469,
16,
5285,
908,
8,
80,
18,
68,
430,
199,
3,
198,
198,
815,
360,
18254,
63,
264,
31846,
83,
275,
469,
16,
5285,
908,
8,
18254,
63,
264,
31846,
83,
430,
421,
198,
1045,
1551,
8,
548,
12,
283,
87,
358,
465,
17863,
26,
507,
198,
509,
4325,
315,
315,
1725,
26,
686,
198,
1045,
1551,
8,
2324,
9,
465,
289,
26,
1585,
198,
78,
275,
378,
1585,
198,
2019,
63,
84,
275,
900,
14,
521,
342,
1585,
198,
509,
634,
315,
289,
26,
1871,
198,
78,
847,
413,
1871,
198,
692,
12348,
34,
3100,
1922,
436,
440,
334,
78,
450,
11630,
304,
221,
4671,
198,
815,
3508,
68,
2385,
4565,
4366,
16,
14,
18,
70,
3171,
450,
334,
78,
12,
900,
14,
521,
342,
446,
2061,
63,
84,
430,
4671,
198,
2019,
63,
84,
275,
900,
14,
521,
342,
1871,
198,
692,
440,
634,
14,
1913,
837,
1980,
1871,
198,
4164,
634,
14,
10124,
1252,
2460,
7863,
735,
1980,
1871,
198,
2836,
26,
4671,
198,
2482,
275,
634,
14,
1294,
2258,
84,
358,
4671,
198,
893,
26,
1559,
275,
2022,
14,
3640,
8,
2482,
59,
17,
566,
4671,
198,
2590,
7888,
26,
221,
5264,
198,
692,
12348,
34,
3100,
1922,
690,
413,
26,
7987,
360,
1944,
13177,
1911,
367,
450,
83,
7,
450,
634,
14,
6735,
1012,
5264,
198,
6958,
4671,
198,
2590,
1722,
26,
5264,
198,
692,
12348,
34,
3100,
1922,
690,
413,
26,
7987,
360,
1944,
13177,
1911,
367,
450,
83,
7,
450,
634,
14,
6735,
1012,
5264,
198,
6958,
4671,
198,
692,
334,
24444,
68,
63,
988,
365,
440,
488,
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,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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
] |
eadgarchen/tensorflow
|
tensorflow/examples/saved_model/saved_model_half_plus_two.py
|
56
|
9383
|
## 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.
# ==============================================================================
r"""Exports an example linear regression inference graph.
Exports a TensorFlow graph to `/tmp/saved_model/half_plus_two/` based on the
`SavedModel` format.
This graph calculates,
\\(
y = a*x + b
\\)
and/or, independently,
\\(
y2 = a*x2 + c
\\)
where `a`, `b` and `c` are variables with `a=0.5` and `b=2` and `c=3`.
Output from this program is typically used to exercise SavedModel load and
execution code.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import sys
import tensorflow as tf
from tensorflow.python.lib.io import file_io
FLAGS = None
def _write_assets(assets_directory, assets_filename):
"""Writes asset files to be used with SavedModel for half plus two.
Args:
assets_directory: The directory to which the assets should be written.
assets_filename: Name of the file to which the asset contents should be
written.
Returns:
The path to which the assets file was written.
"""
if not file_io.file_exists(assets_directory):
file_io.recursive_create_dir(assets_directory)
path = os.path.join(
tf.compat.as_bytes(assets_directory), tf.compat.as_bytes(assets_filename))
file_io.write_string_to_file(path, "asset-file-contents")
return path
def _build_regression_signature(input_tensor, output_tensor):
"""Helper function for building a regression SignatureDef."""
input_tensor_info = tf.saved_model.utils.build_tensor_info(input_tensor)
signature_inputs = {
tf.saved_model.signature_constants.REGRESS_INPUTS: input_tensor_info
}
output_tensor_info = tf.saved_model.utils.build_tensor_info(output_tensor)
signature_outputs = {
tf.saved_model.signature_constants.REGRESS_OUTPUTS: output_tensor_info
}
return tf.saved_model.signature_def_utils.build_signature_def(
signature_inputs, signature_outputs,
tf.saved_model.signature_constants.REGRESS_METHOD_NAME)
# Possibly extend this to allow passing in 'classes', but for now this is
# sufficient for testing purposes.
def _build_classification_signature(input_tensor, scores_tensor):
"""Helper function for building a classification SignatureDef."""
input_tensor_info = tf.saved_model.utils.build_tensor_info(input_tensor)
signature_inputs = {
tf.saved_model.signature_constants.CLASSIFY_INPUTS: input_tensor_info
}
output_tensor_info = tf.saved_model.utils.build_tensor_info(scores_tensor)
signature_outputs = {
tf.saved_model.signature_constants.CLASSIFY_OUTPUT_SCORES:
output_tensor_info
}
return tf.saved_model.signature_def_utils.build_signature_def(
signature_inputs, signature_outputs,
tf.saved_model.signature_constants.CLASSIFY_METHOD_NAME)
def _generate_saved_model_for_half_plus_two(export_dir,
as_text=False,
use_main_op=False):
"""Generates SavedModel for half plus two.
Args:
export_dir: The directory to which the SavedModel should be written.
as_text: Writes the SavedModel protocol buffer in text format to disk.
use_main_op: Whether to supply a main op during SavedModel build time.
"""
builder = tf.saved_model.builder.SavedModelBuilder(export_dir)
with tf.Session(graph=tf.Graph()) as sess:
# Set up the model parameters as variables to exercise variable loading
# functionality upon restore.
a = tf.Variable(0.5, name="a")
b = tf.Variable(2.0, name="b")
c = tf.Variable(3.0, name="c")
# Create a placeholder for serialized tensorflow.Example messages to be fed.
serialized_tf_example = tf.placeholder(tf.string, name="tf_example")
# Parse the tensorflow.Example looking for a feature named "x" with a single
# floating point value.
feature_configs = {
"x": tf.FixedLenFeature(
[1], dtype=tf.float32),
"x2": tf.FixedLenFeature(
[1], dtype=tf.float32, default_value=[0.0])
}
tf_example = tf.parse_example(serialized_tf_example, feature_configs)
# Use tf.identity() to assign name
x = tf.identity(tf_example["x"], name="x")
y = tf.add(tf.multiply(a, x), b, name="y")
y2 = tf.add(tf.multiply(a, x), c, name="y2")
x2 = tf.identity(tf_example["x2"], name="x2")
y3 = tf.add(tf.multiply(a, x2), c, name="y3")
# Create an assets file that can be saved and restored as part of the
# SavedModel.
original_assets_directory = "/tmp/original/export/assets"
original_assets_filename = "foo.txt"
original_assets_filepath = _write_assets(original_assets_directory,
original_assets_filename)
# Set up the assets collection.
assets_filepath = tf.constant(original_assets_filepath)
tf.add_to_collection(tf.GraphKeys.ASSET_FILEPATHS, assets_filepath)
filename_tensor = tf.Variable(
original_assets_filename,
name="filename_tensor",
trainable=False,
collections=[])
assign_filename_op = filename_tensor.assign(original_assets_filename)
# Set up the signature for Predict with input and output tensor
# specification.
predict_input_tensor = tf.saved_model.utils.build_tensor_info(x)
predict_signature_inputs = {"x": predict_input_tensor}
predict_output_tensor = tf.saved_model.utils.build_tensor_info(y)
predict_signature_outputs = {"y": predict_output_tensor}
predict_signature_def = (
tf.saved_model.signature_def_utils.build_signature_def(
predict_signature_inputs, predict_signature_outputs,
tf.saved_model.signature_constants.PREDICT_METHOD_NAME))
signature_def_map = {
"regress_x_to_y":
_build_regression_signature(serialized_tf_example, y),
"regress_x_to_y2":
_build_regression_signature(serialized_tf_example, y2),
"regress_x2_to_y3":
_build_regression_signature(x2, y3),
"classify_x_to_y":
_build_classification_signature(serialized_tf_example, y),
tf.saved_model.signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY:
predict_signature_def
}
# Initialize all variables and then save the SavedModel.
sess.run(tf.global_variables_initializer())
signature_def_map = {
"regress_x_to_y":
_build_regression_signature(serialized_tf_example, y),
"regress_x_to_y2":
_build_regression_signature(serialized_tf_example, y2),
"regress_x2_to_y3":
_build_regression_signature(x2, y3),
"classify_x_to_y":
_build_classification_signature(serialized_tf_example, y),
"classify_x2_to_y3":
_build_classification_signature(x2, y3),
tf.saved_model.signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY:
predict_signature_def
}
if use_main_op:
builder.add_meta_graph_and_variables(
sess, [tf.saved_model.tag_constants.SERVING],
signature_def_map=signature_def_map,
assets_collection=tf.get_collection(tf.GraphKeys.ASSET_FILEPATHS),
main_op=tf.group(tf.saved_model.main_op.main_op(),
assign_filename_op))
else:
builder.add_meta_graph_and_variables(
sess, [tf.saved_model.tag_constants.SERVING],
signature_def_map=signature_def_map,
assets_collection=tf.get_collection(tf.GraphKeys.ASSET_FILEPATHS),
legacy_init_op=tf.group(assign_filename_op))
builder.save(as_text)
def main(_):
_generate_saved_model_for_half_plus_two(FLAGS.output_dir)
print("SavedModel generated at: %s" % FLAGS.output_dir)
_generate_saved_model_for_half_plus_two(FLAGS.output_dir_pbtxt, as_text=True)
print("SavedModel generated at: %s" % FLAGS.output_dir_pbtxt)
_generate_saved_model_for_half_plus_two(
FLAGS.output_dir_main_op, use_main_op=True)
print("SavedModel generated at: %s" % FLAGS.output_dir_main_op)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--output_dir",
type=str,
default="/tmp/saved_model_half_plus_two",
help="Directory where to output SavedModel.")
parser.add_argument(
"--output_dir_pbtxt",
type=str,
default="/tmp/saved_model_half_plus_two_pbtxt",
help="Directory where to output the text format of SavedModel.")
parser.add_argument(
"--output_dir_main_op",
type=str,
default="/tmp/saved_model_half_plus_two_main_op",
help="Directory where to output the SavedModel with a main op.")
FLAGS, unparsed = parser.parse_known_args()
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
|
apache-2.0
|
[
309,
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,
82,
624,
920,
5203,
376,
2893,
7798,
10864,
17353,
3343,
14,
199,
199,
920,
5203,
282,
9134,
3343,
370,
658,
15,
2791,
15,
8420,
63,
1238,
15,
10220,
63,
6666,
63,
5601,
15,
64,
4079,
641,
314,
199,
64,
21969,
1685,
64,
1475,
14,
199,
199,
2765,
3343,
6966,
2335,
12,
199,
199,
1103,
8,
523,
612,
275,
282,
10,
88,
435,
330,
199,
1103,
9,
199,
199,
460,
15,
269,
12,
30426,
12,
199,
199,
1103,
8,
523,
612,
18,
275,
282,
10,
88,
18,
435,
286,
199,
1103,
9,
199,
199,
4509,
658,
65,
3559,
658,
66,
64,
436,
658,
67,
64,
787,
2860,
543,
658,
65,
29,
16,
14,
21,
64,
436,
658,
66,
29,
18,
64,
436,
658,
67,
29,
19,
2313,
199,
199,
2959,
687,
642,
2240,
365,
13609,
1202,
370,
26511,
29026,
1685,
2248,
436,
199,
9416,
1233,
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,
646,
7534,
199,
646,
747,
199,
646,
984,
199,
199,
646,
3228,
465,
2833,
199,
199,
504,
3228,
14,
1548,
14,
773,
14,
2308,
492,
570,
63,
2308,
199,
199,
4831,
275,
488,
421,
199,
318,
485,
952,
63,
12186,
8,
12186,
63,
3619,
12,
17202,
63,
1501,
304,
523,
408,
20908,
8977,
1584,
370,
506,
1202,
543,
29026,
1685,
367,
12995,
12254,
2877,
14,
819,
3033,
26,
272,
17202,
63,
3619,
26,
710,
2082,
370,
1314,
314,
17202,
1077,
506,
5313,
14,
272,
17202,
63,
1501,
26,
2812,
402,
314,
570,
370,
1314,
314,
8977,
4072,
1077,
506,
267,
5313,
14,
819,
1803,
26,
272,
710,
931,
370,
1314,
314,
17202,
570,
1990,
5313,
14,
523,
408,
523,
340,
440,
570,
63,
2308,
14,
493,
63,
2444,
8,
12186,
63,
3619,
304,
272,
570,
63,
2308,
14,
9931,
63,
981,
63,
694,
8,
12186,
63,
3619,
9,
819,
931,
275,
747,
14,
515,
14,
904,
8,
489,
2833,
14,
5819,
14,
305,
63,
2394,
8,
12186,
63,
3619,
395,
2833,
14,
5819,
14,
305,
63,
2394,
8,
12186,
63,
1501,
430,
523,
570,
63,
2308,
14,
952,
63,
875,
63,
475,
63,
493,
8,
515,
12,
298,
6562,
13,
493,
13,
4407,
531,
523,
372,
931,
421,
199,
318,
485,
1506,
63,
12513,
63,
5233,
8,
1210,
63,
3128,
12,
1072,
63,
3128,
304,
523,
408,
4433,
805,
367,
10015,
282,
10864,
18603,
6172,
1041,
523,
1324,
63,
3128,
63,
815,
275,
2833,
14,
8420,
63,
1238,
14,
1208,
14,
1506,
63,
3128,
63,
815,
8,
1210,
63,
3128,
9,
523,
4955,
63,
3711,
275,
469,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
907,
19568,
63,
7321,
51,
26,
1324,
63,
3128,
63,
815,
523,
789,
523,
1072,
63,
3128,
63,
815,
275,
2833,
14,
8420,
63,
1238,
14,
1208,
14,
1506,
63,
3128,
63,
815,
8,
1199,
63,
3128,
9,
523,
4955,
63,
4467,
275,
469,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
907,
19568,
63,
8414,
51,
26,
1072,
63,
3128,
63,
815,
523,
789,
523,
372,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
318,
63,
1208,
14,
1506,
63,
5233,
63,
318,
8,
489,
4955,
63,
3711,
12,
4955,
63,
4467,
12,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
907,
19568,
63,
9977,
63,
2339,
9,
421,
199,
3,
25987,
9312,
12247,
642,
370,
2040,
9476,
315,
283,
2888,
297,
1325,
367,
3063,
642,
365,
199,
3,
19258,
367,
5343,
12901,
14,
199,
318,
485,
1506,
63,
14368,
63,
5233,
8,
1210,
63,
3128,
12,
9342,
63,
3128,
304,
523,
408,
4433,
805,
367,
10015,
282,
12505,
18603,
6172,
1041,
523,
1324,
63,
3128,
63,
815,
275,
2833,
14,
8420,
63,
1238,
14,
1208,
14,
1506,
63,
3128,
63,
815,
8,
1210,
63,
3128,
9,
523,
4955,
63,
3711,
275,
469,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
31163,
18114,
63,
7321,
51,
26,
1324,
63,
3128,
63,
815,
523,
789,
523,
1072,
63,
3128,
63,
815,
275,
2833,
14,
8420,
63,
1238,
14,
1208,
14,
1506,
63,
3128,
63,
815,
8,
7107,
63,
3128,
9,
523,
4955,
63,
4467,
275,
469,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
31163,
18114,
63,
8414,
63,
5153,
726,
654,
26,
881,
1072,
63,
3128,
63,
815,
523,
789,
523,
372,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
318,
63,
1208,
14,
1506,
63,
5233,
63,
318,
8,
489,
4955,
63,
3711,
12,
4955,
63,
4467,
12,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
31163,
18114,
63,
9977,
63,
2339,
9,
421,
199,
318,
485,
4208,
63,
8420,
63,
1238,
63,
509,
63,
10220,
63,
6666,
63,
5601,
8,
3790,
63,
694,
12,
4490,
465,
63,
505,
29,
797,
12,
4490,
675,
63,
973,
63,
411,
29,
797,
304,
523,
408,
20551,
29026,
1685,
367,
12995,
12254,
2877,
14,
819,
3033,
26,
272,
4843,
63,
694,
26,
710,
2082,
370,
1314,
314,
29026,
1685,
1077,
506,
5313,
14,
272,
465,
63,
505,
26,
30753,
314,
29026,
1685,
4113,
3335,
315,
1318,
1475,
370,
4543,
14,
272,
675,
63,
973,
63,
411,
26,
7480,
370,
17169,
282
] |
[
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,
82,
624,
920,
5203,
376,
2893,
7798,
10864,
17353,
3343,
14,
199,
199,
920,
5203,
282,
9134,
3343,
370,
658,
15,
2791,
15,
8420,
63,
1238,
15,
10220,
63,
6666,
63,
5601,
15,
64,
4079,
641,
314,
199,
64,
21969,
1685,
64,
1475,
14,
199,
199,
2765,
3343,
6966,
2335,
12,
199,
199,
1103,
8,
523,
612,
275,
282,
10,
88,
435,
330,
199,
1103,
9,
199,
199,
460,
15,
269,
12,
30426,
12,
199,
199,
1103,
8,
523,
612,
18,
275,
282,
10,
88,
18,
435,
286,
199,
1103,
9,
199,
199,
4509,
658,
65,
3559,
658,
66,
64,
436,
658,
67,
64,
787,
2860,
543,
658,
65,
29,
16,
14,
21,
64,
436,
658,
66,
29,
18,
64,
436,
658,
67,
29,
19,
2313,
199,
199,
2959,
687,
642,
2240,
365,
13609,
1202,
370,
26511,
29026,
1685,
2248,
436,
199,
9416,
1233,
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,
646,
7534,
199,
646,
747,
199,
646,
984,
199,
199,
646,
3228,
465,
2833,
199,
199,
504,
3228,
14,
1548,
14,
773,
14,
2308,
492,
570,
63,
2308,
199,
199,
4831,
275,
488,
421,
199,
318,
485,
952,
63,
12186,
8,
12186,
63,
3619,
12,
17202,
63,
1501,
304,
523,
408,
20908,
8977,
1584,
370,
506,
1202,
543,
29026,
1685,
367,
12995,
12254,
2877,
14,
819,
3033,
26,
272,
17202,
63,
3619,
26,
710,
2082,
370,
1314,
314,
17202,
1077,
506,
5313,
14,
272,
17202,
63,
1501,
26,
2812,
402,
314,
570,
370,
1314,
314,
8977,
4072,
1077,
506,
267,
5313,
14,
819,
1803,
26,
272,
710,
931,
370,
1314,
314,
17202,
570,
1990,
5313,
14,
523,
408,
523,
340,
440,
570,
63,
2308,
14,
493,
63,
2444,
8,
12186,
63,
3619,
304,
272,
570,
63,
2308,
14,
9931,
63,
981,
63,
694,
8,
12186,
63,
3619,
9,
819,
931,
275,
747,
14,
515,
14,
904,
8,
489,
2833,
14,
5819,
14,
305,
63,
2394,
8,
12186,
63,
3619,
395,
2833,
14,
5819,
14,
305,
63,
2394,
8,
12186,
63,
1501,
430,
523,
570,
63,
2308,
14,
952,
63,
875,
63,
475,
63,
493,
8,
515,
12,
298,
6562,
13,
493,
13,
4407,
531,
523,
372,
931,
421,
199,
318,
485,
1506,
63,
12513,
63,
5233,
8,
1210,
63,
3128,
12,
1072,
63,
3128,
304,
523,
408,
4433,
805,
367,
10015,
282,
10864,
18603,
6172,
1041,
523,
1324,
63,
3128,
63,
815,
275,
2833,
14,
8420,
63,
1238,
14,
1208,
14,
1506,
63,
3128,
63,
815,
8,
1210,
63,
3128,
9,
523,
4955,
63,
3711,
275,
469,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
907,
19568,
63,
7321,
51,
26,
1324,
63,
3128,
63,
815,
523,
789,
523,
1072,
63,
3128,
63,
815,
275,
2833,
14,
8420,
63,
1238,
14,
1208,
14,
1506,
63,
3128,
63,
815,
8,
1199,
63,
3128,
9,
523,
4955,
63,
4467,
275,
469,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
907,
19568,
63,
8414,
51,
26,
1072,
63,
3128,
63,
815,
523,
789,
523,
372,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
318,
63,
1208,
14,
1506,
63,
5233,
63,
318,
8,
489,
4955,
63,
3711,
12,
4955,
63,
4467,
12,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
907,
19568,
63,
9977,
63,
2339,
9,
421,
199,
3,
25987,
9312,
12247,
642,
370,
2040,
9476,
315,
283,
2888,
297,
1325,
367,
3063,
642,
365,
199,
3,
19258,
367,
5343,
12901,
14,
199,
318,
485,
1506,
63,
14368,
63,
5233,
8,
1210,
63,
3128,
12,
9342,
63,
3128,
304,
523,
408,
4433,
805,
367,
10015,
282,
12505,
18603,
6172,
1041,
523,
1324,
63,
3128,
63,
815,
275,
2833,
14,
8420,
63,
1238,
14,
1208,
14,
1506,
63,
3128,
63,
815,
8,
1210,
63,
3128,
9,
523,
4955,
63,
3711,
275,
469,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
31163,
18114,
63,
7321,
51,
26,
1324,
63,
3128,
63,
815,
523,
789,
523,
1072,
63,
3128,
63,
815,
275,
2833,
14,
8420,
63,
1238,
14,
1208,
14,
1506,
63,
3128,
63,
815,
8,
7107,
63,
3128,
9,
523,
4955,
63,
4467,
275,
469,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
31163,
18114,
63,
8414,
63,
5153,
726,
654,
26,
881,
1072,
63,
3128,
63,
815,
523,
789,
523,
372,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
318,
63,
1208,
14,
1506,
63,
5233,
63,
318,
8,
489,
4955,
63,
3711,
12,
4955,
63,
4467,
12,
489,
2833,
14,
8420,
63,
1238,
14,
5233,
63,
5559,
14,
31163,
18114,
63,
9977,
63,
2339,
9,
421,
199,
318,
485,
4208,
63,
8420,
63,
1238,
63,
509,
63,
10220,
63,
6666,
63,
5601,
8,
3790,
63,
694,
12,
4490,
465,
63,
505,
29,
797,
12,
4490,
675,
63,
973,
63,
411,
29,
797,
304,
523,
408,
20551,
29026,
1685,
367,
12995,
12254,
2877,
14,
819,
3033,
26,
272,
4843,
63,
694,
26,
710,
2082,
370,
1314,
314,
29026,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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
] |
mapr/sahara
|
sahara/plugins/mapr/domain/service.py
|
1
|
8580
|
# Copyright (c) 2015, MapR Technologies
#
# 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 json
import logging
from sahara import context
from sahara.i18n import _LI
import sahara.plugins.general.exceptions as ex
import sahara.plugins.provisioning as p
from sahara.utils import files as files
_INSTALL_PACKAGES_TIMEOUT = 3600
LOG = logging.getLogger(__name__)
class Service(object):
def __init__(self):
self._name = None
self._ui_name = None
self._node_processes = frozenset()
self._version = None
self._dependencies = {}
self._ui_info = []
self._cluster_defaults = []
self._node_defaults = []
self._validation_rules = []
@property
def name(self):
return self._name
@name.setter
def name(self, name):
self._name = name
@property
def ui_name(self):
return self._ui_name
@ui_name.setter
def ui_name(self, value):
self._ui_name = value
@property
def version(self):
return self._version
@version.setter
def version(self, value):
self._version = value
@property
def node_processes(self):
return self._node_processes
@node_processes.setter
def node_processes(self, iterable):
def set_service(node_process):
node_process.service = self
return node_process
self._node_processes = frozenset(map(set_service, iterable))
@property
def dependencies(self):
return self._dependencies
@dependencies.setter
def dependencies(self, value):
self._dependencies = value
@property
def ui_info(self):
return self._ui_info
@ui_info.setter
def ui_info(self, iterable):
self._ui_info = iterable
@property
def cluster_defaults(self):
return self._cluster_defaults
@cluster_defaults.setter
def cluster_defaults(self, defaults):
self._cluster_defaults = defaults
@property
def node_defaults(self):
return self._node_defaults
@node_defaults.setter
def node_defaults(self, defaults):
self._node_defaults = defaults
def get_node_processes(self):
return self.node_processes
def get_versions(self):
return self._version
@property
def validation_rules(self):
return self._validation_rules
def install(self, cluster_context, instances):
LOG.info(
_LI('START: Installing %(service)s on cluster=%(cluster)s'),
{'service': self._ui_name, 'cluster': cluster_context.cluster.name}
)
with context.ThreadGroup() as tg:
for instance in instances:
tg.spawn('install-packages-%s' % instance.id,
self._install_packages_on_instance, cluster_context,
instance)
LOG.info(_LI('END: Installing packages on cluster=%s'),
cluster_context.cluster.name)
def _install_packages_on_instance(self, cluster_context, instance):
processes = [p for p in self.get_node_processes() if
p.get_ui_name() in instance.node_group.node_processes]
if processes is not None and len(processes) > 0:
LOG.info(
_LI('START: Installing %(service)s on %(instance)s'),
{'service': self.ui_name, 'instance': instance.management_ip}
)
packages = self._get_packages(processes)
cmd = cluster_context.distro.create_install_cmd(packages)
with instance.remote() as r:
r.execute_command(cmd, run_as_root=True,
timeout=_INSTALL_PACKAGES_TIMEOUT,
raise_when_error=False)
LOG.info(_LI('END: Installing packages on instance=%s'),
instance.management_ip)
def _get_packages(self, node_processes):
result = []
result += self.dependencies
result += [(np.get_package(), self.version) for np in node_processes]
return result
def post_install(self, cluster_context, instances):
pass
def post_start(self, cluster_context, instances):
pass
def configure(self, cluster_context, instances=None):
pass
def update(self, cluster_context, instances=None):
pass
def get_file_path(self, file_name):
template = 'plugins/mapr/services/%(service)s/resources/%(file_name)s'
args = {'service': self.name, 'file_name': file_name}
return template % args
def get_configs(self):
result = []
for d_file in self.cluster_defaults:
data = self._load_config_file(self.get_file_path(d_file))
result += [self._create_config_obj(c, self.ui_name) for c in data]
for d_file in self.node_defaults:
data = self._load_config_file(self.get_file_path(d_file))
result += [self._create_config_obj(c, self.ui_name, scope='node')
for c in data]
return result
def get_configs_dict(self):
result = dict()
for conf_obj in self.get_configs():
result.update({conf_obj.name: conf_obj.default_value})
return {self.ui_name: result}
def _load_config_file(self, file_path=None):
return json.loads(files.get_file_text(file_path))
def get_config_files(self, cluster_context, configs, instance=None):
return []
def _create_config_obj(self, item, target='general', scope='cluster',
high_priority=False):
def _prepare_value(value):
if isinstance(value, str):
return value.strip().lower()
return value
conf_name = _prepare_value(item.get('name', None))
conf_value = _prepare_value(item.get('value', None))
if not conf_name:
raise ex.HadoopProvisionError(_LI("Config missing 'name'"))
if conf_value is None:
raise ValueError(
"Config '%s' missing 'value'" % conf_name)
if high_priority or item.get('priority', 2) == 1:
priority = 1
else:
priority = 2
return p.Config(
name=conf_name,
applicable_target=target,
scope=scope,
config_type=item.get('config_type', "string"),
config_values=item.get('config_values', None),
default_value=conf_value,
is_optional=item.get('is_optional', True),
description=item.get('description', None),
priority=priority)
def get_version_config(self, versions):
return p.Config(
name='%s Version' % self._ui_name,
applicable_target=self.ui_name,
scope='cluster',
config_type='dropdown',
config_values=[(v, v) for v in sorted(versions, reverse=True)],
is_optional=False,
description=_LI('Specify the version of the service'),
priority=1)
def __eq__(self, other):
if isinstance(other, self.__class__):
version_eq = self.version == other.version
name_eq = self.name == other.name
ui_name_eq = self.ui_name == other.ui_name
return version_eq and name_eq and ui_name_eq
return NotImplemented
def __repr__(self):
return '<Service %s>' % self.ui_name
def restart(self, instances):
for node_process in self.node_processes:
node_process.restart(instances)
def home_dir(self, cluster_context):
args = {
'mapr_home': cluster_context.mapr_home,
'name': self.name,
'version': self.version,
}
return '%(mapr_home)s/%(name)s/%(name)s-%(version)s' % args
class Single(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Single, cls).__call__(*args, **kwargs)
return cls._instances[cls]
|
apache-2.0
|
[
3,
1898,
334,
67,
9,
6900,
12,
9672,
50,
19215,
199,
3,
199,
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,
755,
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,
421,
199,
646,
2022,
199,
646,
2050,
199,
199,
504,
2937,
27314,
492,
1067,
199,
504,
2937,
27314,
14,
73,
1085,
78,
492,
485,
2673,
199,
646,
2937,
27314,
14,
5265,
14,
10706,
14,
3924,
465,
444,
199,
646,
2937,
27314,
14,
5265,
14,
19639,
465,
299,
199,
504,
2937,
27314,
14,
1208,
492,
1584,
465,
1584,
421,
199,
63,
16811,
63,
6961,
5383,
63,
8899,
275,
15751,
199,
199,
4947,
275,
2050,
14,
5572,
3460,
354,
3368,
421,
199,
533,
7591,
8,
785,
304,
272,
347,
636,
826,
721,
277,
304,
267,
291,
423,
354,
275,
488,
267,
291,
423,
1907,
63,
354,
275,
488,
267,
291,
423,
932,
63,
11816,
275,
9522,
342,
267,
291,
423,
1023,
275,
488,
267,
291,
423,
5714,
275,
1052,
267,
291,
423,
1907,
63,
815,
275,
942,
267,
291,
423,
4201,
63,
4322,
275,
942,
267,
291,
423,
932,
63,
4322,
275,
942,
267,
291,
423,
6136,
63,
4423,
275,
942,
339,
768,
1829,
272,
347,
536,
8,
277,
304,
267,
372,
291,
423,
354,
339,
768,
354,
14,
8345,
272,
347,
536,
8,
277,
12,
536,
304,
267,
291,
423,
354,
275,
536,
339,
768,
1829,
272,
347,
8574,
63,
354,
8,
277,
304,
267,
372,
291,
423,
1907,
63,
354,
339,
768,
1907,
63,
354,
14,
8345,
272,
347,
8574,
63,
354,
8,
277,
12,
574,
304,
267,
291,
423,
1907,
63,
354,
275,
574,
339,
768,
1829,
272,
347,
1015,
8,
277,
304,
267,
372,
291,
423,
1023,
339,
768,
1023,
14,
8345,
272,
347,
1015,
8,
277,
12,
574,
304,
267,
291,
423,
1023,
275,
574,
339,
768,
1829,
272,
347,
1031,
63,
11816,
8,
277,
304,
267,
372,
291,
423,
932,
63,
11816,
339,
768,
932,
63,
11816,
14,
8345,
272,
347,
1031,
63,
11816,
8,
277,
12,
6076,
304,
267,
347,
663,
63,
1364,
8,
932,
63,
1412,
304,
288,
1031,
63,
1412,
14,
1364,
275,
291,
288,
372,
1031,
63,
1412,
398,
291,
423,
932,
63,
11816,
275,
9522,
8,
1130,
8,
409,
63,
1364,
12,
6076,
430,
339,
768,
1829,
272,
347,
5124,
8,
277,
304,
267,
372,
291,
423,
5714,
339,
768,
5714,
14,
8345,
272,
347,
5124,
8,
277,
12,
574,
304,
267,
291,
423,
5714,
275,
574,
339,
768,
1829,
272,
347,
8574,
63,
815,
8,
277,
304,
267,
372,
291,
423,
1907,
63,
815,
339,
768,
1907,
63,
815,
14,
8345,
272,
347,
8574,
63,
815,
8,
277,
12,
6076,
304,
267,
291,
423,
1907,
63,
815,
275,
6076,
339,
768,
1829,
272,
347,
4350,
63,
4322,
8,
277,
304,
267,
372,
291,
423,
4201,
63,
4322,
339,
768,
4201,
63,
4322,
14,
8345,
272,
347,
4350,
63,
4322,
8,
277,
12,
4243,
304,
267,
291,
423,
4201,
63,
4322,
275,
4243,
339,
768,
1829,
272,
347,
1031,
63,
4322,
8,
277,
304,
267,
372,
291,
423,
932,
63,
4322,
339,
768,
932,
63,
4322,
14,
8345,
272,
347,
1031,
63,
4322,
8,
277,
12,
4243,
304,
267,
291,
423,
932,
63,
4322,
275,
4243,
339,
347,
664,
63,
932,
63,
11816,
8,
277,
304,
267,
372,
291,
14,
932,
63,
11816,
339,
347,
664,
63,
6234,
8,
277,
304,
267,
372,
291,
423,
1023,
339,
768,
1829,
272,
347,
6411,
63,
4423,
8,
277,
304,
267,
372,
291,
423,
6136,
63,
4423,
339,
347,
3907,
8,
277,
12,
4350,
63,
1100,
12,
4454,
304,
267,
5051,
14,
815,
8,
288,
485,
2673,
360,
7363,
26,
13276,
316,
2818,
1364,
9,
83,
641,
4350,
15438,
4201,
9,
83,
659,
288,
791,
1364,
356,
291,
423,
1907,
63,
354,
12,
283,
4201,
356,
4350,
63,
1100,
14,
4201,
14,
354,
93,
267,
776,
267,
543,
1067,
14,
4436,
2448,
342,
465,
22387,
26,
288,
367,
1256,
315,
4454,
26,
355,
22387,
14,
10212,
360,
3174,
13,
5154,
3295,
83,
7,
450,
1256,
14,
344,
12,
586,
291,
423,
3174,
63,
5154,
63,
265,
63,
842,
12,
4350,
63,
1100,
12,
586,
1256,
9,
267,
5051,
14,
815,
1547,
2673,
360,
3902,
26,
13276,
316,
6117,
641,
4350,
2458,
83,
659,
326,
4350,
63,
1100,
14,
4201,
14,
354,
9,
339,
347,
485,
3174,
63,
5154,
63,
265,
63,
842,
8,
277,
12,
4350,
63,
1100,
12,
1256,
304,
267,
10358,
275,
359,
80,
367,
299,
315,
291,
14,
362,
63,
932,
63,
11816,
342,
340,
2151,
299,
14,
362,
63,
1907,
63,
354,
342,
315,
1256,
14,
932,
63,
923,
14,
932,
63,
11816,
61,
267,
340,
10358,
365,
440,
488,
436,
822,
8,
11816,
9,
690,
378,
26,
288,
5051,
14,
815,
8,
355,
485,
2673,
360,
7363,
26,
13276,
316,
2818,
1364,
9,
83,
641,
2818,
842,
9,
83,
659,
355,
791,
1364,
356,
291,
14,
1907,
63,
354,
12,
283,
842,
356,
1256,
14,
8110,
63,
711,
93,
288,
776,
288,
6117,
275,
291,
423,
362,
63,
5154,
8,
11816,
9,
288,
2088,
275,
4350,
63,
1100,
14,
18371,
14,
981,
63,
3174,
63,
1760,
8,
5154,
9,
288,
543,
1256,
14,
3846,
342,
465,
519,
26,
355,
519,
14,
2526,
63,
1531,
8,
1760,
12,
1255,
63,
305,
63,
1231,
29,
549,
12,
3303,
2653,
3699,
16811,
63,
6961,
5383,
63,
8899,
12,
3303,
746,
63,
6526,
63,
705,
29,
797,
9,
288,
5051,
14,
815,
1547,
2673,
360,
3902
] |
[
1898,
334,
67,
9,
6900,
12,
9672,
50,
19215,
199,
3,
199,
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,
755,
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,
421,
199,
646,
2022,
199,
646,
2050,
199,
199,
504,
2937,
27314,
492,
1067,
199,
504,
2937,
27314,
14,
73,
1085,
78,
492,
485,
2673,
199,
646,
2937,
27314,
14,
5265,
14,
10706,
14,
3924,
465,
444,
199,
646,
2937,
27314,
14,
5265,
14,
19639,
465,
299,
199,
504,
2937,
27314,
14,
1208,
492,
1584,
465,
1584,
421,
199,
63,
16811,
63,
6961,
5383,
63,
8899,
275,
15751,
199,
199,
4947,
275,
2050,
14,
5572,
3460,
354,
3368,
421,
199,
533,
7591,
8,
785,
304,
272,
347,
636,
826,
721,
277,
304,
267,
291,
423,
354,
275,
488,
267,
291,
423,
1907,
63,
354,
275,
488,
267,
291,
423,
932,
63,
11816,
275,
9522,
342,
267,
291,
423,
1023,
275,
488,
267,
291,
423,
5714,
275,
1052,
267,
291,
423,
1907,
63,
815,
275,
942,
267,
291,
423,
4201,
63,
4322,
275,
942,
267,
291,
423,
932,
63,
4322,
275,
942,
267,
291,
423,
6136,
63,
4423,
275,
942,
339,
768,
1829,
272,
347,
536,
8,
277,
304,
267,
372,
291,
423,
354,
339,
768,
354,
14,
8345,
272,
347,
536,
8,
277,
12,
536,
304,
267,
291,
423,
354,
275,
536,
339,
768,
1829,
272,
347,
8574,
63,
354,
8,
277,
304,
267,
372,
291,
423,
1907,
63,
354,
339,
768,
1907,
63,
354,
14,
8345,
272,
347,
8574,
63,
354,
8,
277,
12,
574,
304,
267,
291,
423,
1907,
63,
354,
275,
574,
339,
768,
1829,
272,
347,
1015,
8,
277,
304,
267,
372,
291,
423,
1023,
339,
768,
1023,
14,
8345,
272,
347,
1015,
8,
277,
12,
574,
304,
267,
291,
423,
1023,
275,
574,
339,
768,
1829,
272,
347,
1031,
63,
11816,
8,
277,
304,
267,
372,
291,
423,
932,
63,
11816,
339,
768,
932,
63,
11816,
14,
8345,
272,
347,
1031,
63,
11816,
8,
277,
12,
6076,
304,
267,
347,
663,
63,
1364,
8,
932,
63,
1412,
304,
288,
1031,
63,
1412,
14,
1364,
275,
291,
288,
372,
1031,
63,
1412,
398,
291,
423,
932,
63,
11816,
275,
9522,
8,
1130,
8,
409,
63,
1364,
12,
6076,
430,
339,
768,
1829,
272,
347,
5124,
8,
277,
304,
267,
372,
291,
423,
5714,
339,
768,
5714,
14,
8345,
272,
347,
5124,
8,
277,
12,
574,
304,
267,
291,
423,
5714,
275,
574,
339,
768,
1829,
272,
347,
8574,
63,
815,
8,
277,
304,
267,
372,
291,
423,
1907,
63,
815,
339,
768,
1907,
63,
815,
14,
8345,
272,
347,
8574,
63,
815,
8,
277,
12,
6076,
304,
267,
291,
423,
1907,
63,
815,
275,
6076,
339,
768,
1829,
272,
347,
4350,
63,
4322,
8,
277,
304,
267,
372,
291,
423,
4201,
63,
4322,
339,
768,
4201,
63,
4322,
14,
8345,
272,
347,
4350,
63,
4322,
8,
277,
12,
4243,
304,
267,
291,
423,
4201,
63,
4322,
275,
4243,
339,
768,
1829,
272,
347,
1031,
63,
4322,
8,
277,
304,
267,
372,
291,
423,
932,
63,
4322,
339,
768,
932,
63,
4322,
14,
8345,
272,
347,
1031,
63,
4322,
8,
277,
12,
4243,
304,
267,
291,
423,
932,
63,
4322,
275,
4243,
339,
347,
664,
63,
932,
63,
11816,
8,
277,
304,
267,
372,
291,
14,
932,
63,
11816,
339,
347,
664,
63,
6234,
8,
277,
304,
267,
372,
291,
423,
1023,
339,
768,
1829,
272,
347,
6411,
63,
4423,
8,
277,
304,
267,
372,
291,
423,
6136,
63,
4423,
339,
347,
3907,
8,
277,
12,
4350,
63,
1100,
12,
4454,
304,
267,
5051,
14,
815,
8,
288,
485,
2673,
360,
7363,
26,
13276,
316,
2818,
1364,
9,
83,
641,
4350,
15438,
4201,
9,
83,
659,
288,
791,
1364,
356,
291,
423,
1907,
63,
354,
12,
283,
4201,
356,
4350,
63,
1100,
14,
4201,
14,
354,
93,
267,
776,
267,
543,
1067,
14,
4436,
2448,
342,
465,
22387,
26,
288,
367,
1256,
315,
4454,
26,
355,
22387,
14,
10212,
360,
3174,
13,
5154,
3295,
83,
7,
450,
1256,
14,
344,
12,
586,
291,
423,
3174,
63,
5154,
63,
265,
63,
842,
12,
4350,
63,
1100,
12,
586,
1256,
9,
267,
5051,
14,
815,
1547,
2673,
360,
3902,
26,
13276,
316,
6117,
641,
4350,
2458,
83,
659,
326,
4350,
63,
1100,
14,
4201,
14,
354,
9,
339,
347,
485,
3174,
63,
5154,
63,
265,
63,
842,
8,
277,
12,
4350,
63,
1100,
12,
1256,
304,
267,
10358,
275,
359,
80,
367,
299,
315,
291,
14,
362,
63,
932,
63,
11816,
342,
340,
2151,
299,
14,
362,
63,
1907,
63,
354,
342,
315,
1256,
14,
932,
63,
923,
14,
932,
63,
11816,
61,
267,
340,
10358,
365,
440,
488,
436,
822,
8,
11816,
9,
690,
378,
26,
288,
5051,
14,
815,
8,
355,
485,
2673,
360,
7363,
26,
13276,
316,
2818,
1364,
9,
83,
641,
2818,
842,
9,
83,
659,
355,
791,
1364,
356,
291,
14,
1907,
63,
354,
12,
283,
842,
356,
1256,
14,
8110,
63,
711,
93,
288,
776,
288,
6117,
275,
291,
423,
362,
63,
5154,
8,
11816,
9,
288,
2088,
275,
4350,
63,
1100,
14,
18371,
14,
981,
63,
3174,
63,
1760,
8,
5154,
9,
288,
543,
1256,
14,
3846,
342,
465,
519,
26,
355,
519,
14,
2526,
63,
1531,
8,
1760,
12,
1255,
63,
305,
63,
1231,
29,
549,
12,
3303,
2653,
3699,
16811,
63,
6961,
5383,
63,
8899,
12,
3303,
746,
63,
6526,
63,
705,
29,
797,
9,
288,
5051,
14,
815,
1547,
2673,
360,
3902,
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
] |
aivarsk/scrapy
|
setup.py
|
83
|
1605
|
from os.path import dirname, join
from setuptools import setup, find_packages
with open(join(dirname(__file__), 'scrapy/VERSION'), 'rb') as f:
version = f.read().decode('ascii').strip()
setup(
name='Scrapy',
version=version,
url='http://scrapy.org',
description='A high-level Web Crawling and Web Scraping framework',
long_description=open('README.rst').read(),
author='Scrapy developers',
maintainer='Pablo Hoffman',
maintainer_email='pablo@pablohoffman.com',
license='BSD',
packages=find_packages(exclude=('tests', 'tests.*')),
include_package_data=True,
zip_safe=False,
entry_points={
'console_scripts': ['scrapy = scrapy.cmdline:execute']
},
classifiers=[
'Framework :: Scrapy',
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=[
'Twisted>=10.0.0',
'w3lib>=1.8.0',
'queuelib',
'lxml',
'pyOpenSSL',
'cssselect>=0.9',
'six>=1.5.2',
'parsel>=0.9.3',
'PyDispatcher>=2.0.5',
'service_identity',
],
)
|
bsd-3-clause
|
[
504,
747,
14,
515,
492,
9017,
12,
4263,
199,
504,
9116,
492,
3272,
12,
2342,
63,
5154,
421,
199,
1045,
1551,
8,
904,
8,
3475,
3460,
493,
10139,
283,
26442,
15,
4612,
659,
283,
4848,
358,
465,
289,
26,
272,
1015,
275,
289,
14,
739,
1252,
2708,
360,
4371,
1959,
1913,
342,
421,
199,
2758,
8,
272,
536,
534,
7181,
345,
647,
297,
272,
1015,
29,
1023,
12,
272,
1166,
534,
1014,
921,
26442,
14,
1308,
297,
272,
1369,
534,
33,
4721,
13,
1896,
6001,
445,
1773,
2983,
436,
6001,
13916,
1330,
316,
10059,
297,
272,
1846,
63,
1802,
29,
1490,
360,
18195,
14,
8332,
1959,
739,
1062,
272,
4132,
534,
7181,
345,
647,
19782,
297,
272,
11075,
281,
534,
48,
371,
320,
869,
1997,
1237,
297,
272,
11075,
281,
63,
2123,
534,
80,
371,
320,
32,
80,
371,
320,
526,
556,
1237,
14,
957,
297,
272,
4190,
534,
15400,
297,
272,
6117,
29,
1623,
63,
5154,
8,
5473,
7782,
2219,
297,
283,
2219,
2795,
3855,
272,
2387,
63,
2491,
63,
576,
29,
549,
12,
272,
3482,
63,
3489,
29,
797,
12,
272,
2397,
63,
3438,
3126,
267,
283,
6614,
63,
6429,
356,
788,
26442,
275,
18918,
14,
15612,
26,
2526,
418,
272,
1660,
272,
19137,
1524,
267,
283,
16442,
3800,
13916,
345,
647,
297,
267,
283,
23753,
9795,
3800,
959,
446,
24114,
15,
933,
461,
297,
267,
283,
8263,
3800,
19809,
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,
23,
297,
267,
283,
12157,
3800,
22026,
3800,
644,
11178,
15,
2856,
297,
267,
283,
12157,
3800,
2290,
15290,
3800,
31454,
3800,
13515,
11726,
12243,
297,
267,
283,
12157,
3800,
2290,
15290,
3800,
31454,
3800,
2018,
18167,
297,
272,
2156,
272,
3907,
63,
6537,
1524,
267,
283,
52,
5221,
8119,
709,
14,
16,
14,
16,
297,
267,
283,
87,
19,
773,
8119,
17,
14,
24,
14,
16,
297,
267,
283,
1825,
773,
297,
267,
283,
22899,
297,
267,
283,
647,
22791,
297,
267,
283,
3919,
2416,
8119,
16,
14,
25,
297,
267,
283,
4174,
8119,
17,
14,
21,
14,
18,
297,
267,
283,
1122,
76,
8119,
16,
14,
25,
14,
19,
297,
267,
283,
2713,
15461,
8119,
18,
14,
16,
14,
21,
297,
267,
283,
1364,
63,
5582,
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
] |
[
747,
14,
515,
492,
9017,
12,
4263,
199,
504,
9116,
492,
3272,
12,
2342,
63,
5154,
421,
199,
1045,
1551,
8,
904,
8,
3475,
3460,
493,
10139,
283,
26442,
15,
4612,
659,
283,
4848,
358,
465,
289,
26,
272,
1015,
275,
289,
14,
739,
1252,
2708,
360,
4371,
1959,
1913,
342,
421,
199,
2758,
8,
272,
536,
534,
7181,
345,
647,
297,
272,
1015,
29,
1023,
12,
272,
1166,
534,
1014,
921,
26442,
14,
1308,
297,
272,
1369,
534,
33,
4721,
13,
1896,
6001,
445,
1773,
2983,
436,
6001,
13916,
1330,
316,
10059,
297,
272,
1846,
63,
1802,
29,
1490,
360,
18195,
14,
8332,
1959,
739,
1062,
272,
4132,
534,
7181,
345,
647,
19782,
297,
272,
11075,
281,
534,
48,
371,
320,
869,
1997,
1237,
297,
272,
11075,
281,
63,
2123,
534,
80,
371,
320,
32,
80,
371,
320,
526,
556,
1237,
14,
957,
297,
272,
4190,
534,
15400,
297,
272,
6117,
29,
1623,
63,
5154,
8,
5473,
7782,
2219,
297,
283,
2219,
2795,
3855,
272,
2387,
63,
2491,
63,
576,
29,
549,
12,
272,
3482,
63,
3489,
29,
797,
12,
272,
2397,
63,
3438,
3126,
267,
283,
6614,
63,
6429,
356,
788,
26442,
275,
18918,
14,
15612,
26,
2526,
418,
272,
1660,
272,
19137,
1524,
267,
283,
16442,
3800,
13916,
345,
647,
297,
267,
283,
23753,
9795,
3800,
959,
446,
24114,
15,
933,
461,
297,
267,
283,
8263,
3800,
19809,
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,
23,
297,
267,
283,
12157,
3800,
22026,
3800,
644,
11178,
15,
2856,
297,
267,
283,
12157,
3800,
2290,
15290,
3800,
31454,
3800,
13515,
11726,
12243,
297,
267,
283,
12157,
3800,
2290,
15290,
3800,
31454,
3800,
2018,
18167,
297,
272,
2156,
272,
3907,
63,
6537,
1524,
267,
283,
52,
5221,
8119,
709,
14,
16,
14,
16,
297,
267,
283,
87,
19,
773,
8119,
17,
14,
24,
14,
16,
297,
267,
283,
1825,
773,
297,
267,
283,
22899,
297,
267,
283,
647,
22791,
297,
267,
283,
3919,
2416,
8119,
16,
14,
25,
297,
267,
283,
4174,
8119,
17,
14,
21,
14,
18,
297,
267,
283,
1122,
76,
8119,
16,
14,
25,
14,
19,
297,
267,
283,
2713,
15461,
8119,
18,
14,
16,
14,
21,
297,
267,
283,
1364,
63,
5582,
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,
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,
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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
] |
phlax/translate
|
translate/misc/multistring.py
|
2
|
4223
|
# -*- coding: utf-8 -*-
#
# Copyright 2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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.
#
# translate 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, see <http://www.gnu.org/licenses/>.
"""Supports a hybrid Unicode string that can also have a list of alternate
strings in the strings attribute
"""
import warnings
import six
from .deprecation import RemovedInTTK2Warning
def _create_text_type(newtype, string, encoding):
"""Helper to construct a text type out of characters or bytes. Required to
temporarily preserve backwards compatibility. Must be removed in TTK2.
"""
if isinstance(string, six.text_type):
return six.text_type.__new__(newtype, string)
warnings.warn(
'Passing non-ASCII bytes as well as the `encoding` argument to '
'`multistring` is deprecated. Always pass unicode characters instead.',
RemovedInTTK2Warning, stacklevel=2,
)
return six.text_type.__new__(newtype, string or six.binary_type(), encoding)
class multistring(six.text_type):
def __new__(newtype, string=u"", *args, **kwargs):
encoding = kwargs.pop('encoding', 'utf-8')
if isinstance(string, list):
if not string:
raise ValueError("multistring must contain at least one string")
newstring = _create_text_type(newtype, string[0], encoding)
newstring.strings = [newstring] + [multistring.__new__(newtype, altstring) for altstring in string[1:]]
else:
newstring = _create_text_type(newtype, string, encoding)
newstring.strings = [newstring]
return newstring
def __init__(self, *args, **kwargs):
super(multistring, self).__init__()
if not hasattr(self, "strings"):
self.strings = []
def __cmp__(self, otherstring):
def cmp_compat(s1, s2):
# Python 3 compatible cmp() equivalent
return (s1 > s2) - (s1 < s2)
if isinstance(otherstring, multistring):
parentcompare = cmp_compat(six.text_type(self), otherstring)
if parentcompare:
return parentcompare
else:
return cmp_compat(self.strings[1:], otherstring.strings[1:])
elif isinstance(otherstring, six.text_type):
return cmp_compat(six.text_type(self), otherstring)
elif isinstance(otherstring, bytes):
return cmp_compat(self.encode('utf-8'), otherstring)
elif isinstance(otherstring, list) and otherstring:
return cmp_compat(self, multistring(otherstring))
else:
return cmp_compat(str(type(self)), str(type(otherstring)))
def __hash__(self):
return hash(str(self))
def __ne__(self, otherstring):
return self.__cmp__(otherstring) != 0
def __eq__(self, otherstring):
return self.__cmp__(otherstring) == 0
def __repr__(self):
_repr = u"multistring(%r)" % (
[six.text_type(item) for item in self.strings]
)
return _repr.encode('utf-8') if six.PY2 else _repr
def __str__(self):
if six.PY2:
return self.encode('utf-8')
return super(multistring, self).__str__()
def replace(self, old, new, count=None):
if count is None:
newstr = multistring(super(multistring, self).replace(old, new))
else:
newstr = multistring(super(multistring, self).replace(old, new, count))
for s in self.strings[1:]:
if count is None:
newstr.strings.append(s.replace(old, new))
else:
newstr.strings.append(s.replace(old, new, count))
return newstr
|
gpl-2.0
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
1898,
8315,
3107,
85,
8076,
2290,
2752,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
9028,
14,
199,
3,
199,
3,
9028,
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,
9028,
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,
642,
2240,
27,
340,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
199,
624,
31373,
282,
7188,
14601,
6140,
1059,
626,
883,
2597,
1172,
282,
769,
402,
18034,
199,
5465,
315,
314,
3326,
2225,
199,
624,
199,
199,
646,
3598,
199,
199,
646,
3816,
199,
199,
504,
1275,
15383,
492,
799,
17920,
1481,
43,
18,
3849,
421,
199,
318,
485,
981,
63,
505,
63,
466,
8,
1222,
466,
12,
1059,
12,
2644,
304,
272,
408,
4433,
370,
6982,
282,
1318,
730,
734,
402,
4110,
503,
2783,
14,
11105,
370,
272,
22256,
11211,
8552,
7163,
14,
9498,
506,
4829,
315,
377,
15263,
18,
14,
272,
408,
272,
340,
1228,
8,
875,
12,
3816,
14,
505,
63,
466,
304,
267,
372,
3816,
14,
505,
63,
466,
855,
1222,
721,
1222,
466,
12,
1059,
9,
339,
3598,
14,
4050,
8,
267,
283,
4986,
316,
2222,
13,
12292,
2783,
465,
5521,
465,
314,
658,
2991,
64,
1423,
370,
283,
267,
26144,
3029,
875,
64,
365,
5906,
14,
16763,
986,
2649,
4110,
3140,
3130,
267,
799,
17920,
1481,
43,
18,
3849,
12,
13232,
29,
18,
12,
272,
776,
272,
372,
3816,
14,
505,
63,
466,
855,
1222,
721,
1222,
466,
12,
1059,
503,
3816,
14,
3008,
63,
466,
1062,
2644,
9,
421,
199,
533,
3510,
875,
8,
4174,
14,
505,
63,
466,
304,
339,
347,
636,
1222,
721,
1222,
466,
12,
1059,
29,
85,
5151,
627,
589,
12,
1011,
958,
304,
267,
2644,
275,
2074,
14,
1935,
360,
2991,
297,
283,
1624,
13,
24,
358,
267,
340,
1228,
8,
875,
12,
769,
304,
288,
340,
440,
1059,
26,
355,
746,
1722,
480,
3029,
875,
1471,
1395,
737,
5210,
1373,
1059,
531,
288,
892,
875,
275,
485,
981,
63,
505,
63,
466,
8,
1222,
466,
12,
1059,
59,
16,
467,
2644,
9,
288,
892,
875,
14,
5465,
275,
359,
1222,
875,
61,
435,
359,
3029,
875,
855,
1222,
721,
1222,
466,
12,
8791,
875,
9,
367,
8791,
875,
315,
1059,
59,
17,
21316,
267,
587,
26,
288,
892,
875,
275,
485,
981,
63,
505,
63,
466,
8,
1222,
466,
12,
1059,
12,
2644,
9,
288,
892,
875,
14,
5465,
275,
359,
1222,
875,
61,
267,
372,
892,
875,
339,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
1613,
8,
3029,
875,
12,
291,
2843,
826,
4533,
267,
340,
440,
2688,
8,
277,
12,
298,
5465,
2349,
288,
291,
14,
5465,
275,
942,
339,
347,
636,
5730,
721,
277,
12,
1163,
875,
304,
267,
347,
10467,
63,
5819,
8,
83,
17,
12,
308,
18,
304,
288,
327,
2018,
650,
9025,
10467,
342,
7353,
288,
372,
334,
83,
17,
690,
308,
18,
9,
446,
334,
83,
17,
665,
308,
18,
9,
267,
340,
1228,
8,
1848,
875,
12,
3510,
875,
304,
288,
1676,
5785,
275,
10467,
63,
5819,
8,
4174,
14,
505,
63,
466,
8,
277,
395,
1163,
875,
9,
288,
340,
1676,
5785,
26,
355,
372,
1676,
5785,
288,
587,
26,
355,
372,
10467,
63,
5819,
8,
277,
14,
5465,
59,
17,
8429,
1163,
875,
14,
5465,
59,
17,
5728,
267,
916,
1228,
8,
1848,
875,
12,
3816,
14,
505,
63,
466,
304,
288,
372,
10467,
63,
5819,
8,
4174,
14,
505,
63,
466,
8,
277,
395,
1163,
875,
9,
267,
916,
1228,
8,
1848,
875,
12,
2783,
304,
288,
372,
10467,
63,
5819,
8,
277,
14,
2143,
360,
1624,
13,
24,
659,
1163,
875,
9,
267,
916,
1228,
8,
1848,
875,
12,
769,
9,
436,
1163,
875,
26,
288,
372,
10467,
63,
5819,
8,
277,
12,
3510,
875,
8,
1848,
875,
430,
267,
587,
26,
288,
372,
10467,
63,
5819,
8,
495,
8,
466,
8,
277,
1826,
620,
8,
466,
8,
1848,
875,
1724,
339,
347,
636,
2227,
721,
277,
304,
267,
372,
2631,
8,
495,
8,
277,
430,
339,
347,
636,
685,
721,
277,
12,
1163,
875,
304,
267,
372,
291,
855,
5730,
721,
1848,
875,
9,
1137,
378,
339,
347,
636,
4077,
721,
277,
12,
1163,
875,
304,
267,
372,
291,
855,
5730,
721,
1848,
875,
9,
508,
378,
339,
347,
636,
2722,
721,
277,
304,
267,
485,
2722,
275,
399,
2,
3029,
875,
4042,
82,
2924,
450,
334,
288,
359,
4174,
14,
505,
63,
466,
8,
1053,
9,
367,
1242,
315,
291,
14,
5465,
61,
267,
776,
267,
372,
485,
2722,
14,
2143,
360,
1624,
13,
24,
358,
340,
3816,
14,
4521,
18,
587,
485,
2722,
339,
347,
636,
495,
721,
277,
304,
267,
340,
3816,
14,
4521,
18,
26,
288,
372,
291,
14,
2143,
360,
1624,
13,
24,
358,
267,
372,
1613,
8,
3029,
875,
12,
291,
2843,
495,
4533,
339,
347,
3350,
8,
277,
12,
2269,
12,
892,
12,
2338,
29,
403,
304,
267,
340,
2338,
365,
488,
26,
288,
892,
495,
275,
3510,
875,
8,
4792,
8,
3029,
875,
12,
291,
680,
1814,
8,
1753,
12,
892,
430,
267,
587,
26,
288,
892,
495,
275,
3510,
875,
8,
4792,
8,
3029,
875,
12,
291,
680,
1814,
8,
1753,
12,
892,
12,
2338,
430,
267,
367,
308,
315,
291,
14,
5465,
59,
17,
10688,
288,
340,
2338,
365,
488,
26,
355,
892,
495,
14,
5465,
14,
740,
8,
83,
14,
1814,
8,
1753
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
3,
199,
3,
1898,
8315,
3107,
85,
8076,
2290,
2752,
199,
3,
199,
3,
961,
570,
365,
1777,
402,
9028,
14,
199,
3,
199,
3,
9028,
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,
9028,
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,
642,
2240,
27,
340,
440,
12,
1937,
665,
1014,
921,
1544,
14,
3689,
14,
1308,
15,
2383,
4743,
199,
199,
624,
31373,
282,
7188,
14601,
6140,
1059,
626,
883,
2597,
1172,
282,
769,
402,
18034,
199,
5465,
315,
314,
3326,
2225,
199,
624,
199,
199,
646,
3598,
199,
199,
646,
3816,
199,
199,
504,
1275,
15383,
492,
799,
17920,
1481,
43,
18,
3849,
421,
199,
318,
485,
981,
63,
505,
63,
466,
8,
1222,
466,
12,
1059,
12,
2644,
304,
272,
408,
4433,
370,
6982,
282,
1318,
730,
734,
402,
4110,
503,
2783,
14,
11105,
370,
272,
22256,
11211,
8552,
7163,
14,
9498,
506,
4829,
315,
377,
15263,
18,
14,
272,
408,
272,
340,
1228,
8,
875,
12,
3816,
14,
505,
63,
466,
304,
267,
372,
3816,
14,
505,
63,
466,
855,
1222,
721,
1222,
466,
12,
1059,
9,
339,
3598,
14,
4050,
8,
267,
283,
4986,
316,
2222,
13,
12292,
2783,
465,
5521,
465,
314,
658,
2991,
64,
1423,
370,
283,
267,
26144,
3029,
875,
64,
365,
5906,
14,
16763,
986,
2649,
4110,
3140,
3130,
267,
799,
17920,
1481,
43,
18,
3849,
12,
13232,
29,
18,
12,
272,
776,
272,
372,
3816,
14,
505,
63,
466,
855,
1222,
721,
1222,
466,
12,
1059,
503,
3816,
14,
3008,
63,
466,
1062,
2644,
9,
421,
199,
533,
3510,
875,
8,
4174,
14,
505,
63,
466,
304,
339,
347,
636,
1222,
721,
1222,
466,
12,
1059,
29,
85,
5151,
627,
589,
12,
1011,
958,
304,
267,
2644,
275,
2074,
14,
1935,
360,
2991,
297,
283,
1624,
13,
24,
358,
267,
340,
1228,
8,
875,
12,
769,
304,
288,
340,
440,
1059,
26,
355,
746,
1722,
480,
3029,
875,
1471,
1395,
737,
5210,
1373,
1059,
531,
288,
892,
875,
275,
485,
981,
63,
505,
63,
466,
8,
1222,
466,
12,
1059,
59,
16,
467,
2644,
9,
288,
892,
875,
14,
5465,
275,
359,
1222,
875,
61,
435,
359,
3029,
875,
855,
1222,
721,
1222,
466,
12,
8791,
875,
9,
367,
8791,
875,
315,
1059,
59,
17,
21316,
267,
587,
26,
288,
892,
875,
275,
485,
981,
63,
505,
63,
466,
8,
1222,
466,
12,
1059,
12,
2644,
9,
288,
892,
875,
14,
5465,
275,
359,
1222,
875,
61,
267,
372,
892,
875,
339,
347,
636,
826,
721,
277,
12,
627,
589,
12,
1011,
958,
304,
267,
1613,
8,
3029,
875,
12,
291,
2843,
826,
4533,
267,
340,
440,
2688,
8,
277,
12,
298,
5465,
2349,
288,
291,
14,
5465,
275,
942,
339,
347,
636,
5730,
721,
277,
12,
1163,
875,
304,
267,
347,
10467,
63,
5819,
8,
83,
17,
12,
308,
18,
304,
288,
327,
2018,
650,
9025,
10467,
342,
7353,
288,
372,
334,
83,
17,
690,
308,
18,
9,
446,
334,
83,
17,
665,
308,
18,
9,
267,
340,
1228,
8,
1848,
875,
12,
3510,
875,
304,
288,
1676,
5785,
275,
10467,
63,
5819,
8,
4174,
14,
505,
63,
466,
8,
277,
395,
1163,
875,
9,
288,
340,
1676,
5785,
26,
355,
372,
1676,
5785,
288,
587,
26,
355,
372,
10467,
63,
5819,
8,
277,
14,
5465,
59,
17,
8429,
1163,
875,
14,
5465,
59,
17,
5728,
267,
916,
1228,
8,
1848,
875,
12,
3816,
14,
505,
63,
466,
304,
288,
372,
10467,
63,
5819,
8,
4174,
14,
505,
63,
466,
8,
277,
395,
1163,
875,
9,
267,
916,
1228,
8,
1848,
875,
12,
2783,
304,
288,
372,
10467,
63,
5819,
8,
277,
14,
2143,
360,
1624,
13,
24,
659,
1163,
875,
9,
267,
916,
1228,
8,
1848,
875,
12,
769,
9,
436,
1163,
875,
26,
288,
372,
10467,
63,
5819,
8,
277,
12,
3510,
875,
8,
1848,
875,
430,
267,
587,
26,
288,
372,
10467,
63,
5819,
8,
495,
8,
466,
8,
277,
1826,
620,
8,
466,
8,
1848,
875,
1724,
339,
347,
636,
2227,
721,
277,
304,
267,
372,
2631,
8,
495,
8,
277,
430,
339,
347,
636,
685,
721,
277,
12,
1163,
875,
304,
267,
372,
291,
855,
5730,
721,
1848,
875,
9,
1137,
378,
339,
347,
636,
4077,
721,
277,
12,
1163,
875,
304,
267,
372,
291,
855,
5730,
721,
1848,
875,
9,
508,
378,
339,
347,
636,
2722,
721,
277,
304,
267,
485,
2722,
275,
399,
2,
3029,
875,
4042,
82,
2924,
450,
334,
288,
359,
4174,
14,
505,
63,
466,
8,
1053,
9,
367,
1242,
315,
291,
14,
5465,
61,
267,
776,
267,
372,
485,
2722,
14,
2143,
360,
1624,
13,
24,
358,
340,
3816,
14,
4521,
18,
587,
485,
2722,
339,
347,
636,
495,
721,
277,
304,
267,
340,
3816,
14,
4521,
18,
26,
288,
372,
291,
14,
2143,
360,
1624,
13,
24,
358,
267,
372,
1613,
8,
3029,
875,
12,
291,
2843,
495,
4533,
339,
347,
3350,
8,
277,
12,
2269,
12,
892,
12,
2338,
29,
403,
304,
267,
340,
2338,
365,
488,
26,
288,
892,
495,
275,
3510,
875,
8,
4792,
8,
3029,
875,
12,
291,
680,
1814,
8,
1753,
12,
892,
430,
267,
587,
26,
288,
892,
495,
275,
3510,
875,
8,
4792,
8,
3029,
875,
12,
291,
680,
1814,
8,
1753,
12,
892,
12,
2338,
430,
267,
367,
308,
315,
291,
14,
5465,
59,
17,
10688,
288,
340,
2338,
365,
488,
26,
355,
892,
495,
14,
5465,
14,
740,
8,
83,
14,
1814,
8,
1753,
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,
1
] |
w1ll1am23/home-assistant
|
homeassistant/components/totalconnect/alarm_control_panel.py
|
3
|
5026
|
"""Interfaces with TotalConnect alarm control panels."""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
SUPPORT_ALARM_ARM_NIGHT,
)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_CUSTOM_BYPASS,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_ARMING,
STATE_ALARM_DISARMED,
STATE_ALARM_DISARMING,
STATE_ALARM_TRIGGERED,
)
from homeassistant.exceptions import HomeAssistantError
from .const import DOMAIN
async def async_setup_entry(hass, entry, async_add_entities) -> None:
"""Set up TotalConnect alarm panels based on a config entry."""
alarms = []
client = hass.data[DOMAIN][entry.entry_id]
for location_id, location in client.locations.items():
location_name = location.location_name
alarms.append(TotalConnectAlarm(location_name, location_id, client))
async_add_entities(alarms, True)
class TotalConnectAlarm(alarm.AlarmControlPanelEntity):
"""Represent an TotalConnect status."""
def __init__(self, name, location_id, client):
"""Initialize the TotalConnect status."""
self._name = name
self._location_id = location_id
self._client = client
self._state = None
self._extra_state_attributes = {}
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def state(self):
"""Return the state of the device."""
return self._state
@property
def supported_features(self) -> int:
"""Return the list of supported features."""
return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_NIGHT
@property
def extra_state_attributes(self):
"""Return the state attributes of the device."""
return self._extra_state_attributes
def update(self):
"""Return the state of the device."""
self._client.get_armed_status(self._location_id)
attr = {
"location_name": self._name,
"location_id": self._location_id,
"ac_loss": self._client.locations[self._location_id].ac_loss,
"low_battery": self._client.locations[self._location_id].low_battery,
"cover_tampered": self._client.locations[
self._location_id
].is_cover_tampered(),
"triggered_source": None,
"triggered_zone": None,
}
if self._client.locations[self._location_id].is_disarmed():
state = STATE_ALARM_DISARMED
elif self._client.locations[self._location_id].is_armed_home():
state = STATE_ALARM_ARMED_HOME
elif self._client.locations[self._location_id].is_armed_night():
state = STATE_ALARM_ARMED_NIGHT
elif self._client.locations[self._location_id].is_armed_away():
state = STATE_ALARM_ARMED_AWAY
elif self._client.locations[self._location_id].is_armed_custom_bypass():
state = STATE_ALARM_ARMED_CUSTOM_BYPASS
elif self._client.locations[self._location_id].is_arming():
state = STATE_ALARM_ARMING
elif self._client.locations[self._location_id].is_disarming():
state = STATE_ALARM_DISARMING
elif self._client.locations[self._location_id].is_triggered_police():
state = STATE_ALARM_TRIGGERED
attr["triggered_source"] = "Police/Medical"
elif self._client.locations[self._location_id].is_triggered_fire():
state = STATE_ALARM_TRIGGERED
attr["triggered_source"] = "Fire/Smoke"
elif self._client.locations[self._location_id].is_triggered_gas():
state = STATE_ALARM_TRIGGERED
attr["triggered_source"] = "Carbon Monoxide"
else:
logging.info("Total Connect Client returned unknown status")
state = None
self._state = state
self._extra_state_attributes = attr
def alarm_disarm(self, code=None):
"""Send disarm command."""
if self._client.disarm(self._location_id) is not True:
raise HomeAssistantError(f"TotalConnect failed to disarm {self._name}.")
def alarm_arm_home(self, code=None):
"""Send arm home command."""
if self._client.arm_stay(self._location_id) is not True:
raise HomeAssistantError(f"TotalConnect failed to arm home {self._name}.")
def alarm_arm_away(self, code=None):
"""Send arm away command."""
if self._client.arm_away(self._location_id) is not True:
raise HomeAssistantError(f"TotalConnect failed to arm away {self._name}.")
def alarm_arm_night(self, code=None):
"""Send arm night command."""
if self._client.arm_stay_night(self._location_id) is not True:
raise HomeAssistantError(f"TotalConnect failed to arm night {self._name}.")
|
apache-2.0
|
[
624,
18680,
543,
19271,
8631,
17987,
3304,
12748,
83,
1041,
199,
646,
2050,
199,
199,
646,
8846,
14,
4608,
14,
14160,
63,
2785,
63,
7885,
465,
17987,
199,
504,
8846,
14,
4608,
14,
14160,
63,
2785,
63,
7885,
14,
1297,
492,
334,
272,
13756,
63,
748,
12482,
63,
12482,
63,
15088,
3448,
12,
272,
13756,
63,
748,
12482,
63,
12482,
63,
9524,
12,
272,
13756,
63,
748,
12482,
63,
12482,
63,
46,
2830,
12,
199,
9,
199,
504,
8846,
14,
1297,
492,
334,
272,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
15088,
3448,
12,
272,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
20519,
63,
8285,
6909,
12,
272,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
9524,
12,
272,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
46,
2830,
12,
272,
11377,
63,
748,
12482,
63,
12482,
1206,
12,
272,
11377,
63,
748,
12482,
63,
6178,
12482,
1149,
12,
272,
11377,
63,
748,
12482,
63,
6178,
12482,
1206,
12,
272,
11377,
63,
748,
12482,
63,
30073,
1149,
12,
199,
9,
199,
504,
8846,
14,
3924,
492,
29913,
547,
199,
199,
504,
1275,
1297,
492,
15265,
421,
199,
4146,
347,
5316,
63,
2758,
63,
2373,
8,
5387,
12,
2397,
12,
5316,
63,
525,
63,
8327,
9,
1035,
488,
26,
272,
408,
1084,
1536,
19271,
8631,
17987,
12748,
83,
4079,
641,
282,
1101,
2397,
1041,
272,
741,
25005,
275,
942,
339,
1890,
275,
6298,
14,
576,
59,
7378,
1527,
2373,
14,
2373,
63,
344,
61,
339,
367,
2909,
63,
344,
12,
2909,
315,
1890,
14,
8022,
14,
1744,
837,
267,
2909,
63,
354,
275,
2909,
14,
1985,
63,
354,
267,
741,
25005,
14,
740,
8,
7316,
8631,
30655,
8,
1985,
63,
354,
12,
2909,
63,
344,
12,
1890,
430,
339,
5316,
63,
525,
63,
8327,
8,
279,
25005,
12,
715,
9,
421,
199,
533,
19271,
8631,
30655,
8,
14160,
14,
30655,
3717,
10185,
7302,
304,
272,
408,
10755,
376,
19271,
8631,
2004,
1041,
339,
347,
636,
826,
721,
277,
12,
536,
12,
2909,
63,
344,
12,
1890,
304,
267,
408,
9345,
314,
19271,
8631,
2004,
1041,
267,
291,
423,
354,
275,
536,
267,
291,
423,
1985,
63,
344,
275,
2909,
63,
344,
267,
291,
423,
1258,
275,
1890,
267,
291,
423,
929,
275,
488,
267,
291,
423,
2911,
63,
929,
63,
2987,
275,
1052,
339,
768,
1829,
272,
347,
536,
8,
277,
304,
267,
408,
1767,
314,
536,
402,
314,
2243,
1041,
267,
372,
291,
423,
354,
339,
768,
1829,
272,
347,
1174,
8,
277,
304,
267,
408,
1767,
314,
1174,
402,
314,
2243,
1041,
267,
372,
291,
423,
929,
339,
768,
1829,
272,
347,
3748,
63,
3179,
8,
277,
9,
1035,
1109,
26,
267,
408,
1767,
314,
769,
402,
3748,
4534,
1041,
267,
372,
13756,
63,
748,
12482,
63,
12482,
63,
9524,
1204,
13756,
63,
748,
12482,
63,
12482,
63,
15088,
3448,
1204,
13756,
63,
748,
12482,
63,
12482,
63,
46,
2830,
339,
768,
1829,
272,
347,
2402,
63,
929,
63,
2987,
8,
277,
304,
267,
408,
1767,
314,
1174,
3004,
402,
314,
2243,
1041,
267,
372,
291,
423,
2911,
63,
929,
63,
2987,
339,
347,
1678,
8,
277,
304,
267,
408,
1767,
314,
1174,
402,
314,
2243,
1041,
267,
291,
423,
1258,
14,
362,
63,
285,
3594,
63,
1205,
8,
277,
423,
1985,
63,
344,
9,
267,
1921,
275,
469,
288,
298,
1985,
63,
354,
582,
291,
423,
354,
12,
288,
298,
1985,
63,
344,
582,
291,
423,
1985,
63,
344,
12,
288,
298,
645,
63,
4358,
582,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
645,
63,
4358,
12,
288,
298,
674,
63,
21113,
582,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
674,
63,
21113,
12,
288,
298,
5899,
63,
502,
311,
16179,
582,
291,
423,
1258,
14,
8022,
59,
355,
291,
423,
1985,
63,
344,
288,
221,
1055,
374,
63,
5899,
63,
502,
311,
16179,
1062,
288,
298,
21142,
63,
1365,
582,
488,
12,
288,
298,
21142,
63,
2619,
582,
488,
12,
267,
789,
398,
340,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
2297,
285,
3594,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
6178,
12482,
1149,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
285,
3594,
63,
4219,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
9524,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
285,
3594,
63,
14873,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
46,
2830,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
285,
3594,
63,
22703,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
15088,
3448,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
285,
3594,
63,
4229,
63,
20605,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
20519,
63,
8285,
6909,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
5362,
316,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
12482,
1206,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
2297,
5362,
316,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
6178,
12482,
1206,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
21142,
63,
555,
3037,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
30073,
1149,
288,
1921,
905,
21142,
63,
1365,
937,
275,
298,
1575,
3037,
15,
1352,
328,
915,
2,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
21142,
63,
8935,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
30073,
1149,
288,
1921,
905,
21142,
63,
1365,
937,
275,
298,
13081,
15,
51,
17767,
2,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
21142,
63,
24364,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
30073,
1149,
288,
1921,
905,
21142,
63,
1365
] |
[
18680,
543,
19271,
8631,
17987,
3304,
12748,
83,
1041,
199,
646,
2050,
199,
199,
646,
8846,
14,
4608,
14,
14160,
63,
2785,
63,
7885,
465,
17987,
199,
504,
8846,
14,
4608,
14,
14160,
63,
2785,
63,
7885,
14,
1297,
492,
334,
272,
13756,
63,
748,
12482,
63,
12482,
63,
15088,
3448,
12,
272,
13756,
63,
748,
12482,
63,
12482,
63,
9524,
12,
272,
13756,
63,
748,
12482,
63,
12482,
63,
46,
2830,
12,
199,
9,
199,
504,
8846,
14,
1297,
492,
334,
272,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
15088,
3448,
12,
272,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
20519,
63,
8285,
6909,
12,
272,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
9524,
12,
272,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
46,
2830,
12,
272,
11377,
63,
748,
12482,
63,
12482,
1206,
12,
272,
11377,
63,
748,
12482,
63,
6178,
12482,
1149,
12,
272,
11377,
63,
748,
12482,
63,
6178,
12482,
1206,
12,
272,
11377,
63,
748,
12482,
63,
30073,
1149,
12,
199,
9,
199,
504,
8846,
14,
3924,
492,
29913,
547,
199,
199,
504,
1275,
1297,
492,
15265,
421,
199,
4146,
347,
5316,
63,
2758,
63,
2373,
8,
5387,
12,
2397,
12,
5316,
63,
525,
63,
8327,
9,
1035,
488,
26,
272,
408,
1084,
1536,
19271,
8631,
17987,
12748,
83,
4079,
641,
282,
1101,
2397,
1041,
272,
741,
25005,
275,
942,
339,
1890,
275,
6298,
14,
576,
59,
7378,
1527,
2373,
14,
2373,
63,
344,
61,
339,
367,
2909,
63,
344,
12,
2909,
315,
1890,
14,
8022,
14,
1744,
837,
267,
2909,
63,
354,
275,
2909,
14,
1985,
63,
354,
267,
741,
25005,
14,
740,
8,
7316,
8631,
30655,
8,
1985,
63,
354,
12,
2909,
63,
344,
12,
1890,
430,
339,
5316,
63,
525,
63,
8327,
8,
279,
25005,
12,
715,
9,
421,
199,
533,
19271,
8631,
30655,
8,
14160,
14,
30655,
3717,
10185,
7302,
304,
272,
408,
10755,
376,
19271,
8631,
2004,
1041,
339,
347,
636,
826,
721,
277,
12,
536,
12,
2909,
63,
344,
12,
1890,
304,
267,
408,
9345,
314,
19271,
8631,
2004,
1041,
267,
291,
423,
354,
275,
536,
267,
291,
423,
1985,
63,
344,
275,
2909,
63,
344,
267,
291,
423,
1258,
275,
1890,
267,
291,
423,
929,
275,
488,
267,
291,
423,
2911,
63,
929,
63,
2987,
275,
1052,
339,
768,
1829,
272,
347,
536,
8,
277,
304,
267,
408,
1767,
314,
536,
402,
314,
2243,
1041,
267,
372,
291,
423,
354,
339,
768,
1829,
272,
347,
1174,
8,
277,
304,
267,
408,
1767,
314,
1174,
402,
314,
2243,
1041,
267,
372,
291,
423,
929,
339,
768,
1829,
272,
347,
3748,
63,
3179,
8,
277,
9,
1035,
1109,
26,
267,
408,
1767,
314,
769,
402,
3748,
4534,
1041,
267,
372,
13756,
63,
748,
12482,
63,
12482,
63,
9524,
1204,
13756,
63,
748,
12482,
63,
12482,
63,
15088,
3448,
1204,
13756,
63,
748,
12482,
63,
12482,
63,
46,
2830,
339,
768,
1829,
272,
347,
2402,
63,
929,
63,
2987,
8,
277,
304,
267,
408,
1767,
314,
1174,
3004,
402,
314,
2243,
1041,
267,
372,
291,
423,
2911,
63,
929,
63,
2987,
339,
347,
1678,
8,
277,
304,
267,
408,
1767,
314,
1174,
402,
314,
2243,
1041,
267,
291,
423,
1258,
14,
362,
63,
285,
3594,
63,
1205,
8,
277,
423,
1985,
63,
344,
9,
267,
1921,
275,
469,
288,
298,
1985,
63,
354,
582,
291,
423,
354,
12,
288,
298,
1985,
63,
344,
582,
291,
423,
1985,
63,
344,
12,
288,
298,
645,
63,
4358,
582,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
645,
63,
4358,
12,
288,
298,
674,
63,
21113,
582,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
674,
63,
21113,
12,
288,
298,
5899,
63,
502,
311,
16179,
582,
291,
423,
1258,
14,
8022,
59,
355,
291,
423,
1985,
63,
344,
288,
221,
1055,
374,
63,
5899,
63,
502,
311,
16179,
1062,
288,
298,
21142,
63,
1365,
582,
488,
12,
288,
298,
21142,
63,
2619,
582,
488,
12,
267,
789,
398,
340,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
2297,
285,
3594,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
6178,
12482,
1149,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
285,
3594,
63,
4219,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
9524,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
285,
3594,
63,
14873,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
46,
2830,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
285,
3594,
63,
22703,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
15088,
3448,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
285,
3594,
63,
4229,
63,
20605,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
12482,
1149,
63,
20519,
63,
8285,
6909,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
5362,
316,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
12482,
1206,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
2297,
5362,
316,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
6178,
12482,
1206,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
21142,
63,
555,
3037,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
30073,
1149,
288,
1921,
905,
21142,
63,
1365,
937,
275,
298,
1575,
3037,
15,
1352,
328,
915,
2,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
21142,
63,
8935,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
30073,
1149,
288,
1921,
905,
21142,
63,
1365,
937,
275,
298,
13081,
15,
51,
17767,
2,
267,
916,
291,
423,
1258,
14,
8022,
59,
277,
423,
1985,
63,
344,
1055,
374,
63,
21142,
63,
24364,
837,
288,
1174,
275,
11377,
63,
748,
12482,
63,
30073,
1149,
288,
1921,
905,
21142,
63,
1365,
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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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
] |
nrz/ylikuutio
|
external/bullet3/examples/pybullet/numpy/humanoid_running.py
|
4
|
494200
|
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
os.sys.path.insert(0, parentdir)
import sys
import numpy as np
import argparse
import pybullet as p
import time
gui = True
cid = p.connect(p.SHARED_MEMORY)
#DIRECT is much faster, but GUI shows the running gait
if (cid < 0):
if (gui):
cid = p.connect(p.GUI)
else:
cid = p.connect(p.DIRECT)
#p.setGravity(1,2,-9.8)
#p.setDefaultContactERP (0.4)
p.setGravity(0, 0, -9.8)
#numSubSteps=4 and fixedTimeStep=1.0/60. is an effective internal fixed step of 1./240
#recommended to not go below 50 solver iterations
p.setPhysicsEngineParameter(fixedTimeStep=1.0 / 60., numSolverIterations=550, numSubSteps=8)
#this mp4 recording requires ffmpeg installed
#mp4log = p.startStateLogging(p.STATE_LOGGING_VIDEO_MP4,"humanoid.mp4")
#p.loadSDF("stadium.sdf")
p.loadURDF("plane_implicit.urdf")
objs = p.loadMJCF("mjcf/humanoid_symmetric_no_ground.xml",
flags=p.URDF_USE_SELF_COLLISION_EXCLUDE_ALL_PARENTS)
human = objs[0]
for j in range(p.getNumJoints(human)):
jointInfo = p.getJointInfo(human, j)
print("joint(", j, "qIndex=", jointInfo[3], "uIndex=", jointInfo[4], ")=", jointInfo)
ordered_joints = []
ordered_joint_indices = []
parser = argparse.ArgumentParser()
parser.add_argument('--profile')
jdict = {}
for j in range(p.getNumJoints(human)):
info = p.getJointInfo(human, j)
link_name = info[12].decode("ascii")
if link_name == "left_foot": left_foot = j
if link_name == "right_foot": right_foot = j
ordered_joint_indices.append(j)
if info[2] != p.JOINT_REVOLUTE: continue
jname = info[1].decode("ascii")
jdict[jname] = j
lower, upper = (info[8], info[9])
ordered_joints.append((j, lower, upper))
p.setJointMotorControl2(human, j, controlMode=p.VELOCITY_CONTROL, force=0)
motor_names = ["abdomen_z", "abdomen_y", "abdomen_x"]
motor_power = [100, 100, 100]
motor_names += ["right_hip_x", "right_hip_z", "right_hip_y", "right_knee"]
motor_power += [100, 100, 300, 200]
motor_names += ["left_hip_x", "left_hip_z", "left_hip_y", "left_knee"]
motor_power += [100, 100, 300, 200]
motor_names += ["right_shoulder1", "right_shoulder2", "right_elbow"]
motor_power += [75, 75, 75]
motor_names += ["left_shoulder1", "left_shoulder2", "left_elbow"]
motor_power += [75, 75, 75]
motors = [jdict[n] for n in motor_names]
class Dummy:
pass
dummy = Dummy()
dummy.initial_z = None
def current_relative_position(jointStates, human, j, lower, upper):
#print("j")
#print(j)
#print (len(jointStates))
#print(j)
temp = jointStates[j]
pos = temp[0]
vel = temp[1]
#print("pos")
#print(pos)
#print("vel")
#print(vel)
pos_mid = 0.5 * (lower + upper)
return (2 * (pos - pos_mid) / (upper - lower), 0.1 * vel)
def collect_observations(human):
#print("ordered_joint_indices")
#print(ordered_joint_indices)
jointStates = p.getJointStates(human, ordered_joint_indices)
j = np.array([
current_relative_position(jointStates, human, *jtuple) for jtuple in ordered_joints
]).flatten()
#print("j")
#print(j)
body_xyz, (qx, qy, qz, qw) = p.getBasePositionAndOrientation(human)
#print("body_xyz")
#print(body_xyz, qx,qy,qz,qw)
z = body_xyz[2]
dummy.distance = body_xyz[0]
if dummy.initial_z == None:
dummy.initial_z = z
(vx, vy, vz), _ = p.getBaseVelocity(human)
more = np.array([z - dummy.initial_z, 0.1 * vx, 0.1 * vy, 0.1 * vz, qx, qy, qz, qw])
rcont = p.getContactPoints(human, -1, right_foot, -1)
#print("rcont")
#print(rcont)
lcont = p.getContactPoints(human, -1, left_foot, -1)
#print("lcont")
#print(lcont)
feet_contact = np.array([len(rcont) > 0, len(lcont) > 0])
return np.clip(np.concatenate([more] + [j] + [feet_contact]), -5, +5)
def relu(x):
return np.maximum(x, 0)
class SmallReactivePolicy:
"Simple multi-layer perceptron policy, no internal state"
def __init__(self): #, observation_space, action_space):
#assert weights_dense1_w.shape == (observation_space.shape[0], 256)
#assert weights_dense2_w.shape == (256, 128)
#assert weights_final_w.shape == (128, action_space.shape[0])
pass
def act(self, ob):
#ob[0] += -1.4 + 0.8
x = ob
x = relu(np.dot(x, weights_dense1_w) + weights_dense1_b)
x = relu(np.dot(x, weights_dense2_w) + weights_dense2_b)
x = np.dot(x, weights_final_w) + weights_final_b
return x
def demo_run():
pi = SmallReactivePolicy()
t1 = time.time()
timinglog = p.startStateLogging(p.STATE_LOGGING_PROFILE_TIMINGS, "humanoidTimings.json")
frame = 0
while 1:
obs = collect_observations(human)
actions = pi.act(obs)
#print(" ".join(["%+0.2f"%x for x in obs]))
#print("Motors")
#print(motors)
#for m in range(len(motors)):
#print("motor_power")
#print(motor_power[m])
#print("actions[m]")
#print(actions[m])
#p.setJointMotorControl2(human, motors[m], controlMode=p.TORQUE_CONTROL, force=motor_power[m]*actions[m]*0.082)
#p.setJointMotorControl2(human1, motors[m], controlMode=p.TORQUE_CONTROL, force=motor_power[m]*actions[m]*0.082)
forces = [0.] * len(motors)
batch = True
for m in range(len(motors)):
forces[m] = motor_power[m] * actions[m] * 0.082
if (not batch):
p.setJointMotorControl2(human, motors[m], controlMode=p.TORQUE_CONTROL, force=forces[m])
if (batch):
p.setJointMotorControlArray(human, motors, controlMode=p.TORQUE_CONTROL, forces=forces)
p.stepSimulation()
humanPos, humanOrn = p.getBasePositionAndOrientation(human)
if (gui):
time.sleep(1. / 60.)
print("frame=", frame)
camInfo = p.getDebugVisualizerCamera()
curTargetPos = camInfo[11]
distance = camInfo[10]
yaw = camInfo[8]
pitch = camInfo[9]
targetPos = [
0.95 * curTargetPos[0] + 0.05 * humanPos[0], 0.95 * curTargetPos[1] + 0.05 * humanPos[1],
curTargetPos[2]
]
p.resetDebugVisualizerCamera(distance, yaw, pitch, targetPos)
frame += 1
#if frame==1000: break
t2 = time.time()
print("############################### distance = %0.2f meters" % dummy.distance)
print("############################### FPS = ", 1000 / (t2 - t1))
#print("Starting benchmark")
#logId = p.startStateLogging(p.STATE_LOGGING_PROFILE_TIMINGS,"pybullet_humanoid_timings.json")
#p.stopStateLogging(logId)
print("ended benchmark")
print(frame)
p.stopStateLogging(timinglog)
# yapf: disable
weights_dense1_w = np.array(
[[
-0.3857, -0.7450, +0.1473, +0.1996, +0.0570, +0.4522, +0.1172, +0.7558,
-0.2530, -0.7948, +0.3120, +0.6216, +0.1044, -0.4347, +0.0921, +0.0187,
+0.2030, +0.2042, -0.2928, +0.2717, +0.5117, +0.1115, -0.0278, -0.0675,
-0.2967, +0.3128, -0.1434, -0.0476, +0.0561, -0.1874, +0.1675, -0.1028,
+0.0712, +0.8653, -0.5565, -0.1207, +0.0982, -0.2875, -0.0755, -0.3057,
-0.0841, +0.5336, +0.2068, -0.0132, -0.2131, -0.5910, +0.1329, +0.2789,
+0.0036, +0.0048, +0.2655, +0.3585, +0.2861, -0.2288, -0.0646, +0.0569,
-0.4701, -0.0116, +0.4616, +0.0947, -0.1013, -0.0256, +0.2854, +0.3382,
+0.0822, +0.1160, -0.4913, +0.3991, +0.0121, -0.3392, +0.2515, +0.7188,
+0.3412, +0.1247, +0.1422, +0.0420, +0.1401, +0.5830, +0.0226, +0.6080,
+0.3019, -0.7696, -0.0580, +0.2104, +0.3786, +0.2968, -0.3726, +0.2792,
+0.3572, -0.4362, +0.5368, +0.0068, +0.4366, -0.4799, +0.2688, +0.1115,
+0.0251, +0.4107, -0.0358, +0.0198, +0.2563, +0.0315, -0.1143, +0.6191,
+0.1694, +0.4175, +0.1873, +0.0678, +0.1324, +0.3038, +0.0610, +0.2491,
-0.2730, +0.2933, +0.1704, +0.1746, +0.1444, -0.2578, +0.3743, +0.3837,
+0.3294, +0.0433, +0.5242, -0.3465, +0.1618, -0.5255, -0.1703, +0.0420,
+0.5505, +0.4046, +0.1596, +0.3973, -0.5158, -0.2922, +0.3183, -0.0244,
+0.3496, +0.4069, -0.1961, +0.2705, -0.1008, -0.4008, -0.1443, -0.2113,
+0.2064, -0.3466, +0.2565, +0.0279, +0.5785, -0.2918, +0.7262, +0.0285,
-0.1779, +0.2811, -0.2066, +0.5471, -0.7668, +0.1909, -0.5684, -0.0002,
+0.2291, -0.0631, +0.0823, +0.5520, -0.3267, +0.0143, +0.4295, +0.2594,
+0.3523, -0.1266, +0.4412, -0.2685, +0.0863, +0.1779, +0.1280, +0.5087,
+0.0809, +0.1118, -0.5754, -0.3300, -0.0032, +0.7060, -0.5172, -0.6553,
-0.0951, -0.0129, +0.1382, -0.0504, -0.2634, +0.2659, -0.1932, -0.3762,
+0.3072, +0.1612, +0.2942, -0.1438, -0.0850, +0.1877, +0.4726, +0.2751,
-0.0787, +0.3128, -0.1351, +0.2552, -0.4833, -0.0322, +0.3641, +0.3715,
-0.1938, +0.5040, -0.0598, +0.0341, +0.6252, -0.2977, +0.2694, +0.0525,
+0.6295, -0.1007, -0.0406, +0.1028, +0.5181, +0.2201, +0.2269, +0.3724,
-0.1985, -0.1614, +0.0093, +0.2851, +0.0191, +0.0620, +0.1989, +0.5905,
+0.5589, +0.1896, +0.3859, +0.1207, -0.0323, +0.3912, +0.2950, +0.3255,
+0.2765, -0.3384, +0.4286, +0.2692, +0.2889, +0.5955, +0.0918, -0.3228,
+0.3828, -0.0196, -0.0484, +0.3256, -0.1361, +0.5124, -0.1782, +0.2984
],
[
-0.3305, -0.5427, +0.1033, -0.8093, -0.6948, +1.0265, +0.2688,
-0.4297, -0.3887, -0.0335, -0.4224, +0.0902, -0.0416, -0.3621,
+0.4824, -0.5138, -0.6160, +0.0404, -1.0360, +0.2734, +0.3415,
-0.7259, -0.3395, -0.2803, +0.6166, +0.3448, +0.3657, +0.0495,
+0.8924, +0.1673, +0.2726, +1.2509, -0.0482, +0.2982, -0.0817,
-0.6190, -0.7550, -0.6310, +0.1912, +0.2475, -0.4001, +0.2715,
-1.3571, -1.2735, +0.4491, +0.0965, +0.3893, -0.1449, +0.5919,
-0.7355, -0.2579, -0.6447, -0.8400, -1.0339, -0.7232, +0.2704,
-0.2094, -0.9082, +0.0719, -0.9922, +0.7732, -0.1924, -0.7696,
-0.3170, -0.3350, -0.3462, +0.3686, +0.7608, -0.3624, +0.0222,
+0.0152, +0.0056, -0.6305, +0.3649, +0.4987, -0.2182, -0.6930,
-0.0010, -0.2901, -0.1365, -0.4998, +0.2176, +0.4334, -0.2511,
+0.5084, -0.4405, +0.8559, -0.4784, +0.0126, -0.1106, +0.8800,
-0.7713, +0.2210, +0.1882, +0.0233, -0.0679, +0.0100, -0.6957,
+0.4229, +0.4257, +0.1985, +0.9668, -1.0394, +0.1009, -1.1962,
-0.6810, -0.8522, -0.9797, -0.4765, +0.6148, -0.1001, +0.1577,
-0.5535, -0.6540, -0.0717, -1.4224, -0.4940, +0.3266, -0.3978,
+0.2954, +0.2281, -0.5369, +0.2422, -0.2924, +0.2163, +0.7444,
+0.4338, -0.5244, +0.2214, +0.5298, -0.1770, -0.3549, +0.0541,
-0.1783, -0.1656, +0.9927, -0.9395, +0.6691, -0.2921, -1.1986,
-0.2086, +0.1251, +0.3633, -0.1052, -0.4214, +0.1419, +0.7749,
-0.0831, -0.8905, +0.5360, +0.0565, -2.0616, -1.4039, -0.7739,
+0.2181, +0.3649, +0.2573, -0.1620, -0.2045, -0.4774, +0.4206,
+0.4216, +0.0844, -0.3038, +0.2918, -1.4121, -1.0846, -0.5310,
+0.2190, +0.3286, -0.1058, -0.8251, -0.0417, -0.3994, -0.0012,
+0.4315, +0.1682, -1.1433, +0.2849, -0.5689, -0.3473, +0.6981,
-0.1699, -0.1203, -1.3225, -0.2436, -0.2331, +0.2366, +0.0377,
-0.4367, -0.0645, -1.3493, -0.3995, -0.4136, +0.4007, -0.4532,
+0.1397, -0.4860, +0.7116, -1.0520, -0.7300, +0.9354, +0.2490,
-0.0118, -0.6467, +1.0208, -0.0185, -0.1010, +0.0259, -0.4621,
-0.5824, -0.5307, -0.3225, +0.1271, -0.0694, -0.0902, +0.4922,
+0.2764, -0.1927, -0.2009, -0.8424, +0.0237, -0.0958, +0.3260,
-1.3182, -0.7006, +0.2267, -0.9277, +0.1478, +0.1729, +0.3861,
-0.6517, -0.3447, +0.4089, +0.1253, -0.3610, +0.7556, -0.5048,
-0.8110, +0.1085, -0.9362, -0.8233, +0.4134, -0.0085, -1.5413,
-0.4102, +0.7793, -1.2224, -0.7392, -0.3367, -0.0849, +0.0131,
+0.8377, +0.4575, +0.8130, -2.0800
],
[
-0.5030, +0.4311, -1.1143, -0.2571, +0.0500, +0.6580, +0.1807,
+0.3972, +1.0069, -1.9235, -0.4153, +1.2305, -0.0986, +1.6550,
-2.0094, -0.5650, +0.1596, +2.2019, +0.1256, +1.7433, -1.8320,
+1.2385, +0.2217, +1.9671, -0.0651, -1.5623, +0.6551, -1.0514,
-0.2327, -0.7264, +1.1247, +0.7084, -3.1100, +2.5875, -0.6701,
+0.5488, +0.2897, +0.3663, +0.0783, -0.2380, -0.9809, -1.4906,
-0.0467, -0.3069, -1.3131, -1.1489, +0.4462, -0.0183, -0.7812,
-1.0135, -0.8092, -0.3989, -0.0717, -2.4097, -0.4086, -1.3601,
+0.4654, -1.2662, +0.9914, -1.6910, -0.4650, -1.1016, +0.0476,
+0.4011, +0.1599, -0.2772, +0.1293, -0.1329, +2.4128, +0.3290,
-0.0782, -1.8737, -2.1851, -0.2125, +1.0481, -2.0785, -0.7290,
-0.7160, -0.0253, -0.7524, +0.2129, -0.2267, -0.8073, +0.1843,
+0.7838, +1.0147, +0.1327, -0.0788, +0.3903, +2.0292, +2.5541,
+1.6453, -0.1778, -2.1681, -0.1496, -0.3376, +0.4545, +0.2194,
-1.5197, -1.2230, +3.2199, +1.0545, +0.1571, +0.8699, -4.2024,
+0.9999, +1.8670, +0.3410, +2.0595, -0.1076, +1.5986, -0.3768,
-0.7450, -1.0840, -0.0150, -3.7617, +1.4254, +0.8361, +0.2078,
-0.8808, -0.2463, -3.4380, +1.4160, -1.9439, -1.0356, +2.8675,
+0.9860, -3.6350, -0.8313, +0.2089, +1.3341, -2.8791, +0.4524,
+0.4555, -0.9851, +0.6086, +0.7343, +1.3275, +1.0979, -2.4916,
+0.0722, -0.7323, +0.9880, +1.5356, +0.5431, -0.3248, -0.9631,
+0.7564, +0.7160, -0.0709, -1.5644, +1.2694, +2.5064, -2.5448,
-1.7748, -1.1803, -1.1250, -0.2383, -1.1826, -1.1312, +1.7279,
-0.3852, +0.0540, -0.9594, -0.7022, -2.7155, +1.2207, -0.4283,
+0.2370, -1.1960, +1.0917, -0.3953, -0.5567, -2.5472, -2.0418,
-0.6104, +3.4862, -0.4001, +0.9669, -0.7622, +0.1008, -1.7957,
+1.0803, -0.3787, -0.5001, -0.8955, +0.8044, +2.5939, +1.5200,
+0.9680, +0.4177, -0.2482, +2.2624, -1.1416, -1.5353, +2.2794,
-1.8803, +0.2573, -0.3707, +2.0442, +2.7544, +1.6080, -0.6924,
-0.8825, +2.8865, -0.7160, -1.4308, -0.0376, +0.3018, +1.8101,
+0.3378, -0.3874, -0.3636, -0.5764, -1.0234, +2.6209, +1.1319,
+1.4093, +0.6829, -1.3812, +1.8284, +0.1921, -0.0356, -2.3225,
-0.8761, +1.8518, -1.0584, -0.8935, -0.6575, +0.3690, -0.9779,
+0.2513, +0.4220, +1.2618, +2.0158, +0.1686, +1.9862, +0.6183,
-1.2881, -1.7737, +0.0968, -0.8762, -0.9781, -1.3425, -2.6438,
+0.8928, +0.3356, +0.1711, +1.9928, +0.5683, +2.1339, -0.5671,
-0.2999, +0.2771, +1.8581, -0.7244
],
[
-0.8237, -2.4723, -0.0093, -1.0811, +0.5365, +0.6595, -0.5366,
+1.1555, -0.8875, -1.3330, +1.4121, -0.0944, -0.0463, -0.9496,
-2.8476, -0.7136, +0.6020, -0.0054, -1.4527, +0.9208, +0.3012,
-0.1480, -0.8642, +0.1982, +0.1088, +1.2782, -0.7724, -1.3168,
-0.9594, -1.1935, -0.3237, -0.6884, -0.1389, +0.7907, -2.4444,
-0.4292, -0.1315, -1.2616, -0.0916, -1.7440, -1.5036, +0.1978,
+1.2539, +0.7862, +0.0931, -1.4788, +0.1313, -0.0527, -1.4072,
+0.4968, -0.2224, +0.3658, +1.6503, -0.2057, -0.6812, -0.2703,
-1.6274, +1.0684, +1.2275, +0.1127, -2.2420, -0.1408, -0.2346,
-0.1119, +0.1498, -0.0589, -1.4065, -0.1043, +1.4940, -0.2420,
-0.2223, -0.0973, +0.5512, -1.6769, +0.3286, +0.5443, -0.1542,
+0.9522, -0.8605, +1.4236, +1.6691, -1.5443, -1.4476, -0.2985,
+0.5213, -0.6793, -1.4328, -0.4417, -0.0097, -0.3373, -0.0559,
-0.3530, +0.5015, -2.2177, -0.8512, -1.4107, -0.2278, +1.0842,
-0.6454, -0.6701, +0.2807, -2.3556, +0.6937, -0.1830, +0.2528,
+1.4582, +0.9585, +0.7474, -0.2290, -0.3547, -0.0505, +0.8672,
-1.3728, +0.3593, -1.5079, +1.2051, +0.1671, +0.1287, -0.1089,
+0.9447, +0.2902, -0.0274, +2.6386, -0.4357, -1.0866, -0.7725,
-0.7474, -0.2920, -0.7512, +0.2729, -0.2291, +0.4386, -0.2122,
-1.0203, +0.5233, -0.3802, -0.1169, +0.1006, -0.5432, -0.2080,
+0.6461, -1.4341, +0.0192, -1.2795, +0.8708, -0.3168, -0.4657,
+0.5388, +0.8268, -0.9466, -0.4054, +1.5877, +0.1454, +0.5291,
-0.8998, +1.3563, -1.8375, -1.0953, -1.6413, +0.2750, +1.0708,
-0.9597, -0.3052, -0.0953, -2.2925, -0.0300, +1.2808, +1.3430,
-0.0976, -0.7264, +1.1371, -0.7336, +0.1982, -0.6328, -0.0308,
+0.8406, -0.1227, -0.1331, -2.1831, -0.5677, +0.4565, -0.1594,
-1.8026, -0.1020, +1.3437, -0.2881, +1.0612, -0.9352, -0.2676,
+0.2737, +0.6647, -0.4582, -0.3532, -0.2741, -0.5150, -0.2847,
+0.3100, +1.0055, +0.6360, +1.2014, -1.0370, +0.3126, +0.2799,
+1.4690, +0.2299, -0.9563, +0.1604, +1.0580, -0.0236, +0.5362,
-1.1913, -1.6834, -0.5451, -0.2479, +0.5986, +0.9416, +0.8835,
-0.8778, -1.5741, +0.2702, +0.9200, -1.2569, -0.0010, +0.7474,
+1.0404, +0.0567, +0.7431, -0.5104, +0.2774, -0.3255, +0.0748,
+0.5445, +2.7912, +0.1370, +0.0845, -0.2513, -0.2607, +0.5337,
-0.9225, +1.1601, +0.3889, -1.9067, +0.0405, +0.8032, +0.3716,
+1.0054, -0.1264, -1.2699, +1.0490, -0.4518, -0.4633, +0.2149,
-0.0493, +0.4784, -0.4567, -1.1741
],
[
-0.0944, +0.0480, +1.3354, +0.4432, +0.4545, +0.3836, +0.7112,
-1.3257, -0.6328, -0.0922, +0.1074, +0.9008, +0.8560, -0.7031,
+0.6321, -0.5160, -0.0619, -2.3403, +0.1938, -1.3679, -0.0181,
-0.1057, -0.2195, -1.2982, +0.9032, +0.4164, -0.7188, -0.5110,
+0.6287, +1.9699, -1.0438, -0.3658, +0.3573, -1.1268, +0.8508,
-0.2637, +0.4056, +0.0488, -0.1575, -0.0724, +1.3003, +0.7745,
-1.0815, -0.1154, +0.3653, +0.4608, -0.6923, +0.1087, +0.1252,
+1.0462, -0.8961, +0.3603, -0.5450, +1.1358, -0.2845, +0.3265,
-0.8838, +1.1137, -0.6003, -0.6661, +0.6010, +0.3586, +0.8275,
+0.7424, +0.8698, +0.4970, +0.5513, +1.1435, -0.3027, -0.6154,
-0.1741, +1.3238, +0.2132, -0.2333, -0.1694, +0.7055, -0.8932,
-0.0664, +0.3277, -0.5222, -0.3499, -0.3942, -0.4391, +0.0751,
-0.7457, -1.1832, -0.4438, -0.3663, -1.0466, +0.1051, -1.1153,
+0.4985, -0.2054, -0.0507, +0.3941, -0.1353, -0.4284, +0.2639,
+0.4999, +0.8301, -0.7917, -0.3978, -0.0342, +0.1796, +0.3845,
-1.4847, -0.4932, -0.1793, -0.9531, +0.5409, -0.7341, +0.7626,
+0.3836, +0.5465, +0.1335, -0.2535, -0.4195, -0.7734, -0.0282,
+0.0965, +0.0656, +0.9656, -0.8877, +0.8172, -0.1439, -1.4527,
-0.0562, +1.5419, +0.0539, -0.5125, +0.5689, +0.1007, -1.2620,
+0.3370, -0.1986, -0.2692, -1.2472, -0.7832, -0.6892, +0.6072,
+0.0229, +0.4541, -0.4522, +0.0858, -0.8327, -0.0613, +0.3183,
-0.3064, -1.0261, +0.5405, +1.0349, -0.2815, -0.6725, +0.4688,
+1.6724, -0.0363, -0.0079, -0.0928, +0.3130, -0.2153, -0.5456,
-0.0559, -0.2529, +0.3921, +0.3518, +0.2280, -0.1720, +1.0129,
+0.7512, +0.6854, -0.4686, -0.1534, +0.8615, +0.8109, +0.7310,
+0.3680, -1.4893, -0.7378, -0.4477, +0.0875, -0.4890, +1.8208,
-0.0533, -0.3616, +0.4427, +0.3344, -1.6178, -0.3798, -1.3912,
-0.4389, -0.6612, +0.0819, -1.6541, +0.8210, +0.3600, -0.7912,
+0.8786, -0.6454, -0.3264, -1.2999, -1.7624, +0.1224, -0.1934,
+0.5783, -1.7141, +0.8077, +1.2373, -0.6583, -0.5147, -0.3372,
+0.4648, +0.9727, +0.6322, -1.1757, +0.0907, -0.7186, -0.0748,
+0.5319, -0.7838, +0.7031, -1.4109, -0.2312, +0.0961, +1.0103,
-0.3424, -0.2508, +0.4101, +0.7785, +0.6908, +0.1522, +0.8434,
-0.3437, -0.1315, -0.5243, +0.1131, -0.0426, -0.4195, +0.5145,
+0.4746, -0.1487, +0.3564, +0.6381, +0.7912, -0.5876, +0.4997,
-0.0617, -0.3899, +0.5708, -1.2090, +0.4058, -0.7794, +0.3661,
+0.4308, -0.3041, -0.0436, -0.7230
],
[
-0.1693, +0.2109, +0.3784, -0.0080, +0.5547, +0.4148, +0.3266,
-1.0521, +0.3823, -0.1225, -0.8964, -0.1654, -1.3043, +0.2666,
-0.0568, -0.1568, -0.0791, -0.4838, -0.8760, +0.4993, +0.6268,
-0.7398, -0.6804, -0.2253, +1.2625, -0.2067, +0.0057, +0.9870,
+0.8815, +1.1994, +0.3070, +1.1701, -0.3489, -0.0767, +0.2292,
-0.4519, -2.2981, -1.1613, -0.1678, -0.6078, +0.2043, -0.5179,
-0.5619, -0.2558, -0.9022, +1.1423, +0.1024, +0.6167, +0.3965,
-0.8278, -0.2011, -0.8241, -1.6596, +0.0758, -0.0408, +0.2526,
+0.1655, -1.0185, +0.4132, -0.4839, +1.2156, -1.1229, -1.2566,
+0.7611, +0.5421, -1.0482, +0.8612, +0.9921, -1.1233, +1.7774,
-0.1655, -0.2706, -1.0794, +0.9931, -0.1433, -0.3584, +0.0190,
-0.3132, +0.0309, +0.1503, -0.3054, +0.9918, +0.3700, -0.7727,
+0.1072, -1.0991, +0.4594, -0.7141, +0.6146, -0.0139, +0.8529,
+0.5119, +0.7132, +0.4453, +0.5105, +0.0267, -0.4190, -0.7954,
+0.8213, +0.6556, +0.5070, +0.6732, -0.2794, +0.9429, -0.3095,
-0.5547, -0.4120, -1.4048, +0.2273, +0.4487, +0.3343, +0.7247,
+0.3450, -0.6724, +0.6049, -0.3514, +0.3779, -0.6072, -1.0495,
+0.5256, +1.0763, -0.2961, +0.1332, -0.5312, +0.1100, +0.3449,
+1.6291, +0.2253, +0.2368, +0.0290, -0.2767, -1.1455, -0.2682,
+0.1284, -1.4564, +0.6327, -0.1539, +1.2590, -0.3506, -0.9105,
-0.1498, +0.1575, +0.6813, -0.2192, -0.2872, +0.1151, +0.8868,
+0.1692, -0.6037, +0.4819, +0.3007, -1.5199, -0.8464, -1.0408,
+0.4265, +0.7844, +0.8532, -0.0920, +0.1953, -0.5603, -0.4884,
+0.5512, -1.2749, -0.2217, +0.3123, -0.9690, -1.2862, +0.7008,
+0.7091, +0.3228, -0.4245, -0.4376, +0.6493, -0.2635, -1.2255,
-0.1248, -0.1569, +0.9362, +1.1395, -0.2800, +0.0824, +1.1488,
+1.2098, -0.4093, -0.9025, +0.0509, +0.0269, +0.1081, +0.3318,
+0.3225, +0.1275, -0.0008, -1.0040, -1.1738, +0.7737, -0.3590,
-0.2654, -0.4784, +1.0984, -1.1707, -0.6749, +0.8187, -1.0614,
-0.1445, -0.4563, +0.0654, +0.2446, -0.5677, +1.0999, -0.1202,
-0.8633, -0.2968, +0.2704, -1.0857, +0.1737, -0.5571, +1.1680,
+0.8176, +0.7732, -0.8523, +0.1559, +1.4784, -0.9508, +0.2607,
-0.4858, -0.4288, +0.3398, -0.2658, +0.4940, -0.1560, -0.4237,
-1.1838, -0.5357, +0.7169, +0.2918, +0.4518, +0.1140, -0.7701,
+0.4624, -1.1948, +0.0489, -0.2978, +0.4910, -0.1722, -1.0723,
-1.0176, +1.2704, +0.5973, -0.0866, -0.1371, +0.0481, -0.3902,
+0.0107, +0.3683, +0.4267, -1.4834
],
[
+0.5232, -0.8558, +0.5185, -0.1749, +0.1769, -0.5573, -0.0458,
-0.4127, +1.3763, +2.5431, -0.5299, +0.3071, -0.5284, -0.4808,
+0.2318, -0.0218, -0.1686, -0.1167, -0.0031, -0.3821, +0.9205,
+0.0218, +0.7872, -0.5842, +0.0058, +0.2999, -0.2260, -0.1462,
+1.3377, +0.5496, -0.3178, -0.8289, +1.1450, +1.0358, -0.7660,
-0.5572, +0.3902, -1.2106, -0.1539, +0.2933, +0.6901, -1.1992,
+0.5752, +0.0957, -0.2819, -0.5681, +0.2146, +0.0067, -0.9133,
+0.9878, -0.1733, -0.3514, -0.8065, +0.9410, +0.2219, +0.3498,
-0.5299, +0.3124, -0.8900, +0.6115, +0.2797, +0.9970, +0.3009,
-0.0738, -0.3954, -0.4603, +0.7079, +0.2928, -0.5789, -1.0670,
+0.7549, -0.7836, +0.4045, +0.3377, -0.4876, +1.7466, +1.9039,
-0.5488, -0.4373, -0.2601, -0.3506, -0.0796, +1.1116, +0.0505,
-0.1337, -0.2355, -1.6805, +0.1413, -0.3198, -1.0743, +0.5475,
-0.8052, +0.8536, +1.1319, -0.0467, -0.6715, +0.2528, -0.3115,
-0.5555, +0.4093, -0.1936, -0.3740, +0.2118, +0.0130, +0.1481,
+0.8102, +0.8727, -0.4478, -0.1795, -1.2396, +0.5329, +0.7156,
-0.1103, +0.9139, +0.2145, +0.7780, -0.1246, -0.9007, +0.5015,
-1.2858, +0.5447, +1.3758, -0.5856, +0.4267, -0.1301, -0.9774,
-0.6882, -0.1422, +0.6529, -0.5675, -0.5422, +0.9215, -0.2504,
+0.3921, +0.9338, +0.0692, +0.4588, +0.0834, -0.4489, +0.0373,
+0.3061, +0.0813, -1.3657, -0.2746, -0.3013, -1.1962, +0.1209,
+0.9623, +0.0926, +0.0567, +0.0956, -0.2540, -0.0818, +0.0936,
+1.1011, -0.6436, -0.8282, -0.5360, -0.2208, +0.5188, -0.3779,
+0.3434, -0.0911, +0.6764, +0.2386, +0.0013, -0.9257, +0.6741,
-0.1466, +0.2445, +0.1111, +0.3185, +1.1240, +0.8707, +0.0378,
-0.9029, -0.9465, -0.6231, -1.4129, +0.3802, -1.5123, +1.3141,
+0.1999, +0.4264, -1.0309, -0.0267, -0.5697, +0.4476, -2.1773,
-0.5022, -0.5318, -0.1031, -0.4144, +0.2167, +1.0164, -1.5997,
-0.1081, -0.3293, -0.2674, -0.7626, -1.0667, -0.8751, +0.0664,
+0.4146, -1.3921, +0.5493, -0.7975, +0.0980, -0.5029, -0.1264,
-0.7898, +0.2919, +0.0012, -0.2293, +1.3743, -0.1972, -1.3811,
-0.0774, -1.0635, -0.3949, +1.1958, +0.3768, -0.2495, +0.8773,
-0.3418, -0.6583, +1.2778, -1.6794, +0.1734, -0.0181, +0.2225,
+0.6471, +0.2625, -0.6214, -0.3865, +1.0985, -0.8866, +0.4487,
+0.1762, +1.0691, +0.7759, +0.5970, +0.2840, -0.7712, +0.1730,
+0.0925, -0.1487, +0.0576, +0.0686, -0.1030, +0.6999, -0.3605,
-0.6520, -0.1534, +0.5036, -0.0735
],
[
-0.2289, -0.5922, -0.3208, -0.1333, -0.0326, -0.0578, +0.0332,
+0.0471, -0.1084, -0.4932, -0.0932, -0.0906, -0.0260, -0.2126,
-0.4305, -0.0188, +0.1235, -0.2268, +0.0852, -0.2105, +0.0018,
-0.0488, +0.1105, +0.0611, -0.3910, -0.0054, +0.1663, +0.0056,
+0.0980, -0.0026, +0.1730, -0.0223, -0.1192, +0.0819, -0.0443,
+0.1055, +0.2771, +0.1749, -0.4834, +0.0447, -0.4144, +0.1763,
+0.2071, +0.1313, -0.1478, -0.3675, -0.4603, -0.0393, -0.1476,
-0.4405, +0.2786, +0.0533, -0.0090, -0.1548, -0.3037, -0.0474,
-0.2303, +0.1435, -0.4198, -0.2340, -0.3181, +0.0761, -0.1041,
-0.0830, +0.0821, +0.0260, -0.3217, +0.0803, +0.1699, -0.4164,
-0.1374, -0.1893, +0.0264, -0.2450, +0.1259, -0.6180, -0.1789,
+0.1294, -0.2350, -0.1580, +0.2364, +0.0720, -0.1429, -0.0719,
-0.3570, -0.0641, -0.2126, +0.1802, -0.1192, +0.0961, -0.0488,
-0.3722, -0.1681, -0.1850, -0.1174, -0.0995, -0.0689, -0.1762,
+0.2204, -0.4273, -0.3115, +0.0453, -0.1812, +0.0243, -0.1017,
-0.0409, -0.0154, -0.0384, +0.0726, +0.5732, -0.1037, -0.2238,
-0.0214, -0.0157, -0.0765, -0.1075, -0.0497, -0.0572, +0.3680,
-0.2548, -0.1833, -0.1734, -0.0024, -0.0409, -0.2650, -0.3656,
-0.2709, -0.4396, +0.0812, +0.0568, -0.3316, -0.1572, -0.2154,
-0.1327, -0.1297, -0.3840, -0.4213, -0.3873, +0.3184, -0.1843,
-0.5567, -0.2090, -0.2135, +0.0507, -0.0770, -0.4947, -0.3724,
+0.0858, +0.0379, -0.2661, +0.0211, -0.1906, +0.2820, +0.1454,
+0.0023, -0.2778, -0.2379, -0.0416, -0.2564, +0.1671, -0.2432,
-0.1838, -0.1781, -0.3161, -0.3932, +0.1783, +0.1303, +0.1332,
+0.0891, -0.1433, +0.0342, +0.0357, -0.1301, -0.0396, +0.0971,
+0.0341, +0.0115, -0.3819, +0.2581, -0.4620, +0.3078, -0.0279,
-0.2815, +0.0667, -0.1623, -0.1194, -0.0260, -0.2250, +0.1046,
-0.3312, -0.2797, +0.0327, -0.0621, -0.2257, -0.0914, +0.1443,
+0.0216, +0.2057, -0.1393, +0.4458, +0.2710, +0.3774, -0.1885,
+0.0797, -0.0635, -0.3876, +0.1444, -0.0729, -0.2443, -0.1203,
+0.4256, -0.0877, +0.0331, -0.3111, -0.1889, -0.0357, +0.1845,
-0.1711, +0.0514, -0.1889, +0.0969, -0.0028, -0.1255, -0.1160,
-0.0326, -0.1921, -0.4856, +0.4974, -0.2119, -0.1067, +0.2061,
-0.0208, -0.3160, -0.1110, -0.2838, -0.2922, +0.1144, +0.0072,
-0.0288, +0.1297, -0.0054, +0.2679, -0.3201, -0.2886, +0.0570,
+0.1230, +0.0826, -0.1899, -0.0796, -0.1337, +0.0620, -0.4111,
-0.4262, +0.1163, -0.0294, -0.0575
],
[
-0.0622, +0.1620, +0.1952, -0.1080, +0.4558, +0.2408, -0.3618,
-0.4013, +0.7836, +1.3814, -0.2123, -0.3030, +0.1139, +0.1433,
+0.2230, -0.0583, -0.1621, +0.4591, -0.4137, +0.4395, -0.3145,
+0.1856, -0.4073, +0.2994, +0.1968, +0.5244, +0.3641, -0.0631,
+0.6546, +0.1779, +0.1935, -0.1469, +0.9319, -0.0075, +0.0064,
+0.1900, +0.5569, +0.0826, +0.0453, -0.0783, +0.4028, +0.0221,
-0.0692, +0.4296, -0.2226, +0.3554, -0.0285, -0.4677, -0.1184,
+0.3233, +0.1011, +0.1190, +0.5385, +0.1720, -0.5215, -0.2803,
+0.2099, -0.0718, -0.1586, +0.1376, +0.0903, +0.1490, +0.4136,
+0.2823, +0.5320, +0.1268, -0.3858, +0.6468, -0.0144, +0.4940,
-0.1289, +0.1769, +0.1861, +0.0321, -0.0865, +0.4818, +0.3785,
+0.0222, -0.0553, -0.3994, -0.2557, +0.2507, -0.0072, +0.0473,
-0.4798, +0.0217, +0.5227, +0.2150, +0.0384, -0.2661, +0.2132,
-0.1044, +0.5976, -0.2044, +0.1120, -0.0102, -0.2942, -0.3944,
+0.4103, -0.1596, -0.1556, +0.0462, -1.0610, +0.5723, +0.4564,
-0.2365, +0.3736, +0.1133, +0.1969, -0.2941, +0.5913, -0.0584,
+0.3066, +0.0832, -0.3040, +0.4964, -0.1276, +0.0732, +0.0802,
-0.7690, +0.2472, -0.1118, -0.4396, +0.4151, -0.1141, -0.2248,
+0.2854, +0.3040, +0.3152, +0.6751, -0.2495, -0.1024, +1.0877,
+0.2063, +0.1743, -0.2615, +0.6156, +0.0471, -0.5015, +0.6820,
-0.1908, +0.3957, -0.0110, -0.2385, -0.5311, +0.4914, +0.0466,
+0.2728, +0.1332, +0.0846, +0.2048, -0.2136, -0.2074, +0.2046,
+0.0061, +0.2663, +0.0967, +0.0476, +0.0986, +0.3985, +0.5587,
-0.5540, +0.0154, +0.4506, -0.0422, +0.0927, +0.2275, +0.3403,
+0.5497, +0.0195, -0.2267, -0.0105, -0.0707, +0.4026, +0.0864,
+0.3935, +0.3245, +0.6428, -0.3807, -0.0543, +0.5879, +0.0241,
+0.6732, -0.2620, +0.1640, -0.0437, -0.1938, +0.5656, -0.3021,
+0.8425, -0.0940, +0.8219, -0.0001, +0.2326, +0.1968, -0.0967,
+0.1712, -0.1926, +0.0581, -0.4711, -0.1671, +0.2421, +0.3986,
+0.1873, -0.6380, +0.1934, +0.1938, -0.4676, +0.3012, +0.0563,
-0.1293, -0.3734, -0.2708, -0.2509, -0.3866, +0.3017, -0.5500,
+0.6813, -0.0220, +0.4279, -0.0009, +0.7408, +0.1708, -0.1965,
+0.4782, -0.0380, -0.5077, +0.0028, +0.5409, +0.4656, -0.0188,
+0.2003, -0.1777, -0.1324, +0.5119, +0.5334, -0.0911, -0.0135,
-0.3527, +0.3077, -0.1689, -0.6573, -0.2195, -0.3638, +0.0081,
+0.1452, +0.3054, -0.6117, -0.5621, +0.3031, +0.0552, +0.3948,
+0.5129, -0.2373, +0.0839, +0.5478
],
[
-0.2677, -0.3924, -0.1111, -0.0630, +0.0402, +0.8159, -0.7826,
-0.3290, +0.4201, -0.3960, -1.1485, +0.5117, +0.2460, -1.0035,
+0.1106, -0.6896, +0.9486, -0.3650, -1.0935, -0.3699, +0.3832,
-0.5691, -0.6172, +0.7244, -0.1093, +0.4114, +0.5099, -0.6623,
+0.6719, +0.3053, +0.8786, -0.3956, -0.6784, -0.2966, -0.1117,
-0.3018, +0.2616, -0.4997, +0.2619, +0.5151, +0.4021, +1.0451,
-0.1027, -1.5431, -0.0887, +0.0385, +0.2563, +0.8701, +0.0441,
-0.2206, -1.3057, -0.4979, +0.9920, +0.4251, -0.5946, -0.6684,
-0.0290, -0.8045, -0.1703, +0.3256, -0.2287, -0.1461, +0.0372,
-0.0408, +1.7013, -0.7573, -0.4167, +0.8182, -0.1155, -0.2996,
-1.2980, +0.4730, -0.5008, +0.6145, -0.2813, -0.0028, -0.1076,
+0.0624, +0.5987, -0.4668, +0.3587, -0.1747, +0.1252, +1.1977,
-0.2709, +0.2823, -0.1866, +0.3410, -0.5528, +0.2268, +0.5243,
-0.4282, -0.5827, -0.4805, -0.5156, -0.0079, -0.1744, -0.7665,
-0.0406, -0.5617, -0.0789, +0.2851, -0.8815, -0.0942, -0.0398,
-0.5599, +0.8206, -0.4598, +0.1249, +0.0113, +0.3342, +0.4045,
+1.0031, +0.0616, -0.7941, -0.5623, -0.5799, -0.3538, +1.4136,
-0.0132, +0.0433, +0.0970, +0.4327, -0.6650, -0.3680, +0.0627,
+0.6853, +0.0673, +0.4382, -0.0087, -0.1974, -0.4244, -0.7625,
+0.6924, -0.1693, -1.1118, -0.2853, -0.2515, -0.1511, -0.0270,
-0.1421, -0.4663, +0.3691, -0.4666, -0.7505, +0.6488, -0.4772,
-0.0213, +1.2589, -0.2793, +1.1358, -0.5494, +0.0434, +0.5151,
+0.0317, -0.4004, -0.2366, +0.6840, +0.1423, +0.2131, -0.8648,
+0.2816, +0.0387, -0.4625, -0.1181, -0.2421, -0.8358, +0.0494,
+0.7998, -0.1886, -0.8349, +0.5409, +0.0161, +0.8034, +1.4518,
+0.3666, +0.7202, +0.4448, -0.5884, -0.3133, +0.7557, +0.0059,
+0.8145, -0.2922, +0.2949, +0.7668, +0.9744, -0.1347, -0.2402,
+0.9782, +0.3939, -0.1655, -0.1001, -0.3705, -0.0666, -0.1012,
+0.8532, -0.2305, -0.4295, -0.2271, +0.0515, +0.2608, -0.6333,
+0.8459, -0.1468, +0.9393, +0.3433, +0.3040, +0.0816, -1.2577,
-0.0702, -1.1087, -0.0060, -0.7152, -1.0524, +0.6505, -0.7323,
+0.3990, -0.5519, +0.6579, +0.1630, +0.9545, -0.2553, -0.6284,
+0.3982, -0.2823, +0.5572, +0.5401, -0.2477, +0.2319, -0.5750,
+0.7342, +0.0408, +0.5492, -0.2967, +1.4490, +0.3361, -0.2268,
-0.7317, +0.6182, -0.1477, -0.4826, +0.0556, -0.3748, +0.6668,
-0.0177, -0.5986, -0.7161, -0.6142, -0.2449, -1.2808, +0.8982,
-0.7086, -0.7748, -0.5544, +0.5172
],
[
+0.3264, -0.3646, -0.2821, +0.2518, -0.2395, +0.4445, +0.1520,
-0.6761, +0.0477, -0.0257, -0.1895, +0.3927, -0.2809, -0.9354,
+0.2936, -0.3648, -0.3078, +0.1713, -1.5407, -0.1606, +0.0767,
-0.1158, -0.8929, -0.2041, -0.1796, -0.1950, +0.0282, +0.1191,
-0.4838, +0.1555, +0.8111, +0.6948, -0.2704, +0.2824, +0.3988,
+0.2703, +0.0469, -0.2392, +0.0474, -0.1288, +0.4766, +0.4855,
-0.4078, -0.5256, +0.1170, +0.0866, +0.4342, -0.0211, -0.0795,
-0.0084, -0.2736, +0.2599, -0.0845, -0.2772, +0.5235, -0.2618,
-0.2152, -0.0467, +0.1013, -0.5947, +0.5272, +0.0357, +0.4374,
+0.1216, -0.3292, -0.9619, -0.2307, +0.4286, -0.3531, -0.2730,
-0.1754, +0.2060, +0.4299, +0.0241, -0.0986, -0.0976, -0.5591,
-1.1694, -0.3214, +0.5812, -0.3629, -0.3911, +0.6738, -0.7340,
+0.3937, +0.0766, +0.2025, -1.3811, +0.3293, +0.1468, +0.2015,
-0.0419, -0.4160, +0.2073, +0.0666, -0.2161, -0.6732, -0.2642,
+0.1835, +0.3544, +0.3416, +0.0349, -0.4627, -0.1447, -0.9931,
-0.0727, -0.2949, -0.2648, +0.2203, -0.6087, +0.3623, +0.3079,
-1.2249, +0.7935, +0.0456, -0.3232, -0.7579, -0.3691, -0.3644,
-0.3231, -0.5396, -0.4050, -0.0730, -0.4963, -0.0114, +0.2249,
-0.3597, +0.7511, +0.2707, +0.5135, -0.1835, -0.5691, +0.2467,
-0.6838, +0.1932, +0.5926, -0.9298, -0.1595, +0.0481, +0.4326,
-0.0335, -0.3318, +0.2815, -0.0922, -0.2933, -0.0080, +0.5774,
-0.0885, -0.4674, -0.2266, +0.0717, -0.6698, -0.4830, +0.1746,
+0.1206, +0.0057, +0.4676, +0.8745, +0.1639, -0.4449, +0.1793,
-0.3137, +0.6698, +0.9404, -0.1441, +0.0394, -0.6488, -0.3911,
-0.5945, +0.3869, -0.5025, -1.2525, -1.1017, +0.6362, +0.4449,
+0.2157, -0.1160, -1.1086, +0.7340, -0.0693, -0.5617, +0.4067,
+0.0116, +0.4172, -0.3053, +0.0775, -0.0651, +0.2388, -0.1879,
-0.4723, -0.1241, -0.4346, +0.0472, -0.0284, -0.1501, -0.2792,
-0.3968, -0.7242, -0.4812, -0.5336, +0.2079, -0.3344, -0.3619,
-0.5222, -0.3702, -0.0723, -0.0517, -0.4299, -0.0198, -0.1965,
-0.6650, -0.1824, -0.2982, +0.1540, -0.1657, -0.1400, +0.1720,
-0.2381, -0.7029, -0.0878, +0.0376, +0.0026, +0.3682, +0.5348,
-0.4287, -0.1807, -0.1908, -0.4586, -0.0709, +0.2970, -0.0811,
+0.0257, -0.2661, -0.6801, +0.5421, -0.3208, +0.3125, +0.1977,
-0.1810, -0.3915, -0.5920, +0.3147, +0.7049, +0.9834, +0.3962,
-0.8117, -0.2904, -0.7984, +0.4009, -0.5159, -0.1035, +0.1518,
+0.0063, -0.3525, +0.0744, -0.1268
],
[
+0.0625, +0.2454, -0.1680, -1.0803, -0.9500, +0.2996, +0.3217,
+0.0085, -0.0059, -0.3208, +0.5185, +0.1062, +0.3422, -0.3999,
+0.5857, -0.0080, -0.8149, -0.0158, -0.3960, +0.4506, +0.3388,
-0.3658, -0.2523, +0.6703, +0.5079, +0.1302, -0.4467, -0.5027,
-0.0643, +0.0363, +0.2143, +0.0472, +0.2093, +0.4312, -0.1742,
+0.4757, +0.0191, +0.4348, +0.1218, +0.3021, +0.3486, +0.2348,
-0.1680, +0.7838, +0.2344, -0.4433, -0.3828, -0.0978, -0.1935,
+0.4506, +0.2706, -0.8820, -0.1456, -0.0464, +1.2349, +0.3701,
-0.0550, -0.0462, +0.0159, -0.1349, +0.5415, -0.2748, +0.7589,
-0.7571, -0.2683, -0.2130, -0.2549, -0.0779, +0.1291, -0.0558,
-0.4440, +0.2060, -0.3370, +0.0437, +0.0959, -0.3270, -0.3595,
+0.4739, -0.6070, +0.3405, -0.6890, -0.3997, +0.9429, -0.2491,
-0.4467, -0.1436, +0.1208, +0.0807, +0.8200, -0.5003, +0.1874,
-0.4556, -0.1118, +0.1554, -0.1637, -0.6165, +0.0985, -0.6718,
+0.1694, +0.0411, +0.4699, -0.6709, -1.1974, -0.4875, -0.1075,
-0.3117, +0.6738, -0.0284, +0.4542, -0.9254, +0.3416, +0.5329,
-1.0175, +0.4751, -0.0045, -0.3945, -0.4542, +0.1306, +0.1225,
+0.2302, -0.5529, -1.3256, -0.0214, -0.2178, +0.8287, -0.0749,
-0.2770, -0.0777, -0.3252, +0.1128, -0.3628, +0.7585, -0.0378,
-0.2960, +0.6577, +0.3493, -0.0804, -0.1532, -0.5900, -0.0800,
+0.6437, -0.6141, +0.6726, -0.7391, +0.2646, +0.0756, +0.6011,
-0.0260, -0.8565, -0.1149, +0.2192, +0.4871, +0.0104, +0.2024,
-0.5196, -0.7092, +0.4307, -0.3232, +0.1580, +0.0137, -0.0342,
-0.2374, +1.0388, +0.7055, +0.4224, +0.0823, +0.8568, +0.4611,
+0.1539, +0.6464, +0.2207, -0.1220, -0.6761, +0.3361, +0.5564,
+0.6674, -0.3938, -0.2722, +0.3716, -0.3942, -0.2741, -0.0643,
+0.0216, +0.0490, -0.4106, +0.8186, +0.1605, -0.0186, +0.0375,
-0.6412, -0.0754, -0.9746, +0.6032, +0.2447, -0.3215, +0.8977,
-0.0854, +0.5343, -0.4140, -0.2407, -0.1262, -0.4800, +0.4799,
-0.4230, -0.2194, +0.2363, -0.4803, -0.2196, +0.0986, -0.7099,
-0.3558, -1.0284, -0.9217, -0.3823, +0.5392, -0.0932, -0.1111,
-0.0598, -0.7438, +0.2199, +0.6413, -0.2135, +0.3571, +0.3792,
-0.4850, -0.2320, -0.6774, -0.0164, +0.4418, +0.2769, +0.3637,
+0.0232, +0.8487, -0.9506, -0.1698, -0.5427, -0.2042, -0.5941,
+0.2801, -0.4724, -1.5630, -0.5589, +0.7907, +1.0127, -0.6128,
+0.3578, -0.5873, -0.3068, -0.0814, -0.0631, -0.0210, +0.9920,
+0.3312, -0.4430, +0.6246, +0.6557
],
[
+0.1172, -0.2783, -0.7095, -0.1262, +0.1530, -0.4792, +0.4528,
+0.4891, -0.0607, -0.0569, -0.6220, +0.0542, -0.6498, -0.2800,
+0.6819, +0.3944, +0.5009, -0.9332, -0.2285, -0.7853, -0.6265,
+0.1337, +1.1938, -0.1144, -0.3300, -0.0133, +0.5468, -0.2664,
-0.0629, +0.0819, -0.2319, -0.4802, +0.2619, -0.7073, +0.1089,
-0.0294, +0.1425, -0.2403, -0.0213, +0.8602, +0.0572, +0.1639,
+0.3086, -0.6500, +0.1558, +0.1301, +0.2429, -0.2941, -0.1814,
-0.3338, -0.6974, +0.3184, -0.5866, -0.1422, +0.2782, +0.0576,
+0.2659, -0.2389, -0.5860, +1.3488, -0.1118, -0.4311, -0.1720,
-0.2200, +0.1286, -0.1911, -1.0148, -0.0483, -0.3248, +0.3650,
-0.0782, -0.1176, +0.3009, -0.1670, -1.2346, -0.4646, +0.1518,
-0.8071, -0.3581, +0.4864, -0.3260, -0.3035, -0.2051, -0.6271,
+0.4720, -0.5316, -0.8055, +0.6693, +0.5715, -0.7599, -0.2398,
+0.1251, +1.0183, +0.2211, -0.9324, +1.5669, -0.3032, -0.0371,
-0.0379, -0.2408, +0.5500, -0.4923, -0.1783, -0.5724, +0.1722,
+0.2496, -0.0764, +0.5859, -0.1657, +0.2223, -0.2168, -0.0718,
+0.0140, -0.5691, +0.1387, +0.7260, -0.1042, +0.0874, +0.5520,
-0.6215, +0.5677, -0.1417, +0.1505, -0.1036, -0.6195, -0.5452,
-0.0128, +0.2492, -1.2844, +0.2443, +0.1171, +0.6839, +0.8262,
+0.6484, -0.0565, +1.0374, +0.3303, -0.5101, -0.2423, -0.4095,
+0.1344, +0.6334, +0.2040, +0.5704, +0.0024, -0.0590, +0.2815,
+0.4398, -0.0049, +0.0402, +0.1377, +0.1521, -0.2131, +0.0969,
+0.0767, +0.3693, -0.0257, +0.2920, -0.0683, -0.1724, +0.5336,
-0.2084, +0.2234, -0.5008, +0.4164, +0.7633, -0.0421, -0.1122,
+0.4551, +0.3941, +0.0674, +0.9635, -0.0118, +0.3610, -0.2044,
-0.0694, -0.6825, +0.3749, +0.1638, +0.5919, +1.0967, +0.1926,
+0.2287, -0.0137, -0.2464, +0.1192, +0.4823, -0.7307, -0.1790,
+0.7419, -0.4121, -0.7841, -0.5308, -0.1830, -0.7204, +0.0274,
+0.3211, +0.4353, -0.5871, -0.4515, +0.7361, +0.3886, -0.2943,
+0.1441, -0.0550, +0.4522, -0.0730, +0.1857, -0.0623, -0.0710,
+0.8215, +0.6196, +1.3767, +0.2375, +0.3282, -0.7874, +0.3915,
+0.3988, -0.5452, -0.0948, -0.8480, -0.6538, +0.6593, +0.1014,
+0.0919, -0.6544, -0.1404, +0.7558, +0.0326, -0.2532, +0.2364,
-0.3909, +0.4244, +0.0179, +0.1291, +0.7988, -0.1690, -1.0113,
+0.1032, +0.2351, -0.5359, +0.2737, +0.4163, +0.1660, -0.3177,
-0.8316, +0.4132, -0.6683, -0.0579, -0.5545, +0.1057, -0.0281,
-0.0024, -0.4894, +0.2741, +0.3701
],
[
-0.0647, +0.6531, -0.1032, -0.4992, +0.5037, -0.5282, -0.2488,
-0.1359, -0.2810, -0.1751, -0.7607, +0.1065, -0.9882, +1.0841,
+0.3367, -0.4327, -0.3151, -0.4300, +0.8063, -0.7392, -0.4708,
+0.2053, -0.0891, -0.1977, -0.3533, +0.6672, +1.0239, +0.2179,
-0.0560, -0.1074, -0.6713, +0.2259, -0.4024, -0.7552, +0.0620,
-0.2045, -0.1162, -0.1587, -0.0859, +0.1280, -0.0673, +0.1809,
+0.7352, -0.0873, -0.3025, -0.0806, +0.4108, -0.1462, +0.8900,
+0.0117, -0.9559, +0.2582, +0.3579, -0.1051, +0.1183, +0.1419,
+0.0427, -0.4753, -0.1908, +0.1446, -0.7479, -0.6421, -1.1942,
-0.3313, +0.6718, -0.2275, -0.0107, -0.6022, -0.5933, +1.5015,
-0.3277, -0.8475, -0.3529, -0.1143, -1.2357, -0.0210, -0.8484,
-0.4511, -0.4182, +0.0266, +0.8972, -1.0084, +0.2561, +0.2466,
+0.9909, -0.2399, -0.3424, +1.0800, -0.0557, -1.0021, -0.2742,
-0.7683, -0.3469, -0.8045, +0.3725, +0.8353, +0.6543, +0.3471,
+0.1389, -0.2780, +0.8554, +0.0150, +0.3343, +0.1361, +0.5095,
+0.4998, +0.3005, +0.0996, +0.0335, -0.3677, -1.0182, -0.2247,
-0.6468, -1.1545, +0.7807, -0.9215, -0.3781, +0.4275, -0.6639,
-0.4142, +0.8174, +0.0859, +0.1202, -0.1684, -0.2050, +0.2585,
+0.3646, -0.8418, -1.2981, +0.2840, +0.1240, +0.4204, +0.5400,
+0.3127, -0.2068, +0.2112, +0.4278, +0.0198, -0.5277, -0.7125,
-0.1634, -0.6394, +0.6822, +0.1249, -0.5505, -0.1739, -0.1031,
-0.2829, +0.2146, +0.3009, +0.5936, -0.0538, -0.5024, -0.3015,
+0.0261, -0.1504, +0.4943, +0.5050, +0.4151, -0.1256, -0.6758,
-0.6859, +0.8435, -0.8839, +0.0378, -0.6141, +0.3176, -0.2099,
+0.4002, +0.8110, +0.0505, +0.3271, -0.6036, +0.3374, +0.0504,
-0.3805, -0.6931, -0.1313, +0.0039, -0.3990, -0.6584, -0.5678,
-0.4761, -0.3674, -0.5052, +1.3493, +0.9539, +0.3604, -0.5794,
+0.6608, -0.4635, -1.5371, -0.6674, +0.2887, -0.7866, -0.6152,
-0.0875, -0.2175, -0.3096, -0.1594, -0.2646, -0.2216, -0.4797,
+0.9517, -0.3274, +0.0285, +0.6995, -0.2708, -0.5643, +1.2240,
+0.0139, +0.7940, +0.1366, +1.1820, -0.2451, -0.0172, -0.1148,
+0.4907, -0.2293, -0.5941, +0.1354, +0.6113, -0.0891, +0.2567,
+0.2524, -0.5225, -0.0711, +0.3287, +0.7458, -0.5293, -0.2398,
-0.2208, +1.0366, +0.6547, +0.5174, -0.0728, +0.1773, -0.6946,
+0.0987, +0.0746, +0.4341, +0.8016, +0.6499, +0.2621, -0.4212,
-0.2207, +0.8608, -0.0083, +0.2800, +0.2154, +0.0722, +0.5301,
+0.3713, -0.0081, +0.2663, +0.1345
],
[
+0.3130, -0.0585, -0.1601, -0.1024, -0.3747, -0.4581, -0.2575,
+0.1997, +0.5295, +0.0490, -0.2800, -1.0577, -0.0588, -0.0160,
-0.1494, +0.0341, +0.0715, -0.0382, +0.1771, +0.1815, -0.0765,
+0.2010, -0.1023, +0.5555, -0.4700, +0.0106, +0.1853, +0.4241,
+0.5859, -0.2705, +0.3113, -0.3753, -0.3432, -0.2268, -0.2882,
+0.0709, -0.0510, -0.1118, +0.1877, +0.3823, +0.1815, +0.3125,
+0.2013, -0.1324, -0.8493, -1.1203, +0.0683, +0.1163, -0.1035,
+0.1080, -0.5283, -0.4333, +0.1647, -0.5032, +0.0462, -0.2156,
+0.4899, -0.3746, -0.2878, -0.1702, +0.2101, -0.2306, -0.2466,
+0.0105, +0.2818, -0.2101, -0.4292, -0.0190, -0.2841, -0.0979,
+0.0887, +0.6823, -0.5044, +0.1998, -0.4433, +0.1215, +0.1917,
-0.2307, -0.1198, -0.0065, -0.3293, -0.4149, -0.1700, -0.2872,
+0.3405, -0.0418, +0.0654, +0.1995, +0.8670, -0.2927, +0.1775,
+0.0614, +0.3018, -0.2374, +0.0618, -0.3852, +0.0395, +0.2544,
+0.0949, -0.2742, -0.3114, -0.0646, +0.0232, -0.0231, -1.5945,
-0.2847, -0.1796, +0.3372, +0.2968, -0.1711, +0.0107, -0.3552,
+0.1396, +0.2219, -0.4459, -0.5304, +0.0420, +0.2320, -0.2626,
-0.2587, +0.1755, +0.1605, +0.3022, +0.1686, +0.2614, -0.1657,
+0.0606, +0.3014, -0.1068, -0.2048, -0.6107, -0.1257, -0.1822,
+0.3166, +0.2270, -0.0117, -0.7933, +0.1176, -0.0666, -0.1363,
-0.0265, +0.1240, -0.6695, +0.0981, +0.1127, +0.3905, +0.2705,
-0.4131, -0.4401, +0.2276, +0.3034, -0.0891, -0.4392, +0.0877,
-0.0618, +0.3465, +0.0433, -0.0895, -0.2266, -0.1432, -0.2860,
-0.3363, -0.2260, -0.0956, -0.2604, -0.2610, +0.1076, -0.1004,
+0.0107, +0.0907, -0.1411, -0.5052, +0.0195, +0.5423, +0.2808,
-0.6256, +0.3389, +0.0530, +0.0222, -0.0686, +0.5507, +0.0523,
-0.4677, -0.2825, +0.3375, -0.5367, +0.4671, +0.5011, -0.0104,
+0.0006, +0.4560, -0.1539, -0.1961, -0.0134, -0.3079, -0.0018,
-0.1379, -0.3216, +0.1171, +0.4003, -0.8743, -0.4253, -0.1950,
+0.2639, +0.2655, +0.3551, +0.1033, +0.1134, -1.0368, +0.0362,
+0.0625, +0.0248, -0.1044, -0.5546, -0.3031, +0.2400, -0.0652,
-0.0214, +0.0618, -0.0641, -0.2360, -0.0096, +0.0669, +0.1070,
+0.4031, +0.1504, -0.0330, +0.4363, +0.0873, +0.2462, -0.0825,
+0.2503, +0.0775, -0.0813, -0.4761, -0.5802, +0.0291, -0.2824,
-0.7243, -0.0158, +0.0532, -0.5854, -0.1676, +0.0203, -0.7103,
+0.3987, +0.3179, -0.0535, +0.1871, -0.4414, -0.3198, -0.1166,
-0.2955, +0.2740, +0.2244, +0.3489
],
[
-1.5291, +0.7509, -0.0074, -0.7377, -1.1521, -0.0855, -0.0966,
-1.1100, -0.0266, +0.4928, -1.3361, -0.7886, +0.1070, +0.4873,
-0.7260, +1.1879, -0.2253, +0.2718, -0.1084, -0.0427, -1.2677,
-0.6730, -0.3085, +0.5077, -0.2227, -1.7757, +0.3039, +0.5841,
+0.1047, +0.0855, +1.0019, -0.6676, +0.0868, -0.5888, -0.4921,
-1.9100, +0.2842, +0.8124, +0.3632, -0.6278, +0.2443, +0.3960,
+0.6543, -0.5543, +0.1428, -1.4196, +0.3199, +0.3195, +0.9092,
+0.2958, +0.7929, +0.3910, -1.2143, +0.9585, +0.0838, +0.2479,
+0.6162, -1.7836, -0.5629, +0.7295, +0.0387, +0.0682, +0.1486,
-0.4095, +0.5116, +0.5360, +0.3109, -0.7139, +1.7474, +0.3068,
-0.1707, -0.2102, -0.4153, +0.1328, -0.4242, +0.8287, +0.4251,
-0.1067, -0.0917, -0.4040, -0.0577, -1.4141, -0.4519, +1.0870,
+0.3584, -0.2708, -0.5739, +0.1603, +0.4197, -0.1262, -1.2906,
+1.2730, -0.4890, +0.1423, -0.3007, -0.1097, +0.0113, +1.2365,
+0.0550, -0.3075, +0.0122, +0.4935, -0.5145, -0.2649, +0.1376,
+0.4116, +0.2533, +0.1799, -0.3758, -1.1299, +0.0371, -1.0792,
+0.5395, -0.2699, +0.1940, +0.4513, +0.4543, -0.0455, -1.3227,
+0.6893, -1.0421, -0.0902, +0.0099, -0.5710, +0.0049, +0.1784,
-0.2424, +1.0698, -0.4470, -1.6596, +1.3418, +0.7313, -0.0859,
-0.0128, -0.0812, +0.0355, -0.6078, +0.3808, -1.0758, +0.1621,
+0.3418, +0.3347, -1.1316, +0.2234, -0.6019, +0.5632, -0.4485,
+0.4843, -0.5448, +0.4000, +0.8122, -0.1500, -0.7165, +0.1042,
-0.3117, +1.0720, +0.7967, -0.7584, +0.8979, -0.1655, -1.1808,
-0.3785, -0.2499, +0.1837, +0.2004, -0.9096, -0.2102, -0.2760,
-1.5241, -0.1974, +0.1111, +0.3633, -0.1225, -0.2235, -0.4475,
-0.5283, -0.2199, +1.0813, -0.3643, -0.8134, +0.2379, -0.5054,
-0.3266, +0.6273, -0.0715, -0.1116, +0.4867, -0.2660, -0.0761,
-0.0847, +0.4224, -0.7916, +0.3691, +0.0447, -0.1773, -1.0054,
-0.5019, +0.5543, -1.3049, +0.3457, -1.0282, +0.0240, -0.6582,
-1.2401, -0.4293, -0.3723, +0.3960, -0.0613, -0.0244, -1.3904,
+1.2358, +0.7765, -0.4009, -0.0309, -0.7966, -0.2476, -0.6584,
+0.6055, -0.2617, -1.0294, -1.8422, -1.2904, +0.2408, +0.0069,
-0.5984, -0.1944, -0.6952, -0.0202, -0.2899, +0.4219, -0.4417,
-0.5361, +0.6666, -0.9856, -0.7815, -1.3829, -0.3073, -0.2199,
-1.1877, +0.8324, -1.7394, -0.7193, -0.2104, -0.7743, -0.8404,
+0.6159, +0.6948, -0.4127, -0.3222, -0.9054, -0.9808, -0.1008,
-0.1919, -0.1492, -0.2286, -0.4747
],
[
-0.2811, +0.1011, -0.0610, +0.1050, +0.0698, +0.3638, -0.6212,
-0.7514, +0.6360, +0.3330, +0.1242, +0.0861, +0.1506, -0.1573,
-0.1668, -0.1629, +0.0568, -0.0068, -0.1079, -0.2086, -0.0798,
+0.3590, -0.0907, +0.2449, +0.0255, -0.8407, +0.1177, -0.4512,
-0.0412, -0.3018, -0.4712, -0.4733, -0.5295, -0.0837, -0.2969,
+0.5147, -0.6457, +0.2246, +0.4988, +0.2238, +0.1222, +0.3123,
-0.2500, -0.5234, -0.1785, -0.0682, +0.5842, -0.8358, +0.5900,
-0.4114, -0.7249, -0.2819, +0.0768, +0.1637, -0.3317, -0.0877,
+0.4097, +0.5530, +0.3368, +0.2629, -0.5228, -0.3268, +0.0520,
-0.5589, +0.3444, -0.2139, -0.7170, -0.4311, +0.5924, -0.1573,
-0.2035, -1.1198, -0.8246, +0.0195, -0.5881, -0.0686, -0.0860,
-0.2957, -0.2666, +0.0974, -0.5724, -0.8344, +0.3288, -0.1264,
+0.0128, -0.0728, +0.2257, +0.2318, +0.0079, -0.4364, -0.2328,
+0.2227, -0.4731, +0.2063, -0.4602, +0.3852, +0.1137, +0.4837,
-0.0091, +0.4234, +0.6562, -0.0626, -0.6597, -0.0398, -0.0536,
+0.3562, -0.5488, -0.6842, +0.0974, +0.0361, +0.4993, +0.1175,
+0.3602, +0.1439, -0.6109, -0.4640, +0.1863, -0.7654, -0.2980,
+0.2690, -0.2946, -0.1190, -0.4721, -0.2476, +0.1443, -0.0955,
+0.1548, -0.1863, -0.0491, -0.2371, +0.0805, +0.3213, -0.0869,
-0.4615, -0.4175, -0.4486, +0.3961, -0.1400, -0.5382, +0.0238,
+0.1956, +0.0548, -0.3000, +0.0894, -0.1157, -0.2935, -0.0645,
-0.4242, +0.0501, -0.4838, -0.1142, +0.4003, -0.5963, +0.1655,
+0.4490, +0.1399, -0.4131, +0.7218, +0.0651, -0.1533, +0.3304,
-0.1523, -0.3286, +0.5715, -0.1760, -0.5536, +0.9708, -0.0695,
-0.1759, +0.2954, -0.0463, +0.4200, -0.6787, +0.1121, -0.0979,
+0.7546, +0.0308, -0.4884, -0.0656, -0.5207, -0.4658, -0.1859,
+0.5848, +0.1012, -0.6946, +0.2289, -0.3811, -0.2526, +0.3721,
-0.1001, +0.0271, -0.3716, +0.6291, -0.0850, +0.6132, +0.0041,
+0.3856, -0.0917, +0.5693, -0.1875, -0.1611, +0.2646, -0.1155,
-0.0618, +0.2702, -0.1550, +0.3912, -0.2428, +0.5281, -0.5046,
-0.1638, -0.0070, +0.2807, +0.2511, +0.9921, +0.3561, -0.5066,
-0.2131, +0.0024, +0.7692, -0.0259, -0.1815, -1.1148, -0.2950,
-0.0485, -0.5774, +0.1976, +0.2171, -0.1562, -0.0544, -0.5389,
-0.5517, -0.2927, -0.4904, +0.4556, +0.2309, -0.8640, -0.7473,
-0.2229, +0.7439, +0.2569, +0.1446, +0.2150, -0.0239, +0.3427,
+0.1103, -0.2397, -0.3290, -0.2605, +0.6977, -0.0860, -0.7998,
-0.2629, -0.0009, +0.5513, -0.1890
],
[
-0.6315, -0.9363, +0.5395, +0.5106, +0.3953, +0.2615, -0.4221,
-0.4210, +0.4084, -0.3708, -0.8895, -0.7031, -0.2397, -0.0047,
-0.0392, -0.9907, -0.0518, -0.2610, -0.1791, +0.3649, -0.4118,
+0.5682, -0.4480, +0.6911, -0.8780, +0.2294, +0.4313, -0.6176,
+0.1673, +0.3952, -0.5156, -0.2230, -0.1931, +0.4439, +0.1103,
+0.3786, -0.2360, +0.2698, +1.0768, -0.2860, +0.3186, -0.3953,
-0.0972, +0.0864, -1.4468, -1.0603, +0.0658, -1.2611, +1.3845,
+1.1612, +0.0940, -0.0551, +0.7263, +0.6747, +0.0263, -0.3770,
-0.5943, +0.1021, +0.4164, +0.5683, -0.3671, -0.2409, +0.3109,
+1.0640, -1.0311, +0.5001, -0.1592, -0.1081, -0.2889, +0.6021,
-0.3917, -0.3445, -0.2361, +0.4034, -0.4031, -0.5691, -0.3715,
-0.4639, -0.7814, -0.9862, -0.4163, +0.1789, +0.3550, -0.0066,
-0.1438, -0.1465, -0.6079, +0.7529, -1.2862, +0.5823, +0.0574,
-0.5088, -0.5231, +0.0124, -0.1859, +0.4937, -0.7876, -0.6860,
-0.4469, -0.3876, +0.3195, -0.3171, -0.9781, -0.6090, -0.1717,
+0.2865, -0.6920, -0.1219, +0.1502, +0.5604, -0.3207, +0.0759,
+0.1306, -0.3244, +0.1978, +0.3598, +0.2209, +0.5365, +0.5977,
+0.6504, -0.7021, +0.2033, -0.1353, -0.2584, -0.5924, -0.3167,
-0.0117, +0.6623, +0.0350, +0.5381, +0.1891, +0.6693, +0.7502,
-0.4372, +0.5079, -0.0811, +1.2352, -0.4580, -0.5438, +0.4481,
-0.4331, +0.7399, +0.2847, -0.1288, -0.1061, +0.3820, +0.0009,
-0.7364, -0.0127, -0.5112, -0.2881, -0.4204, -0.3917, +0.5281,
+0.0792, +0.1718, -0.8185, +0.5843, +0.0028, +0.8819, +0.4506,
+0.5220, +0.8724, +0.9187, +0.0321, +0.5469, -0.2751, +1.0228,
-1.2236, +0.1936, -0.9670, -0.1699, +0.1720, +0.0485, +0.2123,
+0.8600, -0.2548, -0.4831, -0.0137, +0.6477, +0.9001, -0.3948,
-0.2098, +0.6062, -0.8639, -0.2834, -0.2457, -0.1975, +0.2417,
-1.0677, +0.0405, +0.1193, +0.6034, -0.2025, +0.1993, -0.4663,
+0.4749, -0.4462, +0.9196, -0.1786, +0.2205, +0.4837, +0.0870,
+0.7167, +0.2900, +0.1003, +0.2930, +0.4127, -0.1221, -0.1679,
+0.0162, +0.2090, +0.0474, +0.6412, +0.7725, +0.0576, -0.0105,
-0.1292, +0.2671, +0.6288, +0.0149, +0.1800, -0.2455, -0.0688,
+0.3809, -1.0889, -0.2251, -0.1113, +0.4618, +0.2450, -0.6848,
-0.8293, +0.3566, -0.0628, +0.0873, -0.4762, -0.8713, -0.9663,
-0.4618, +0.8200, +0.4479, -0.1278, +0.4284, +1.0482, -0.1372,
+0.3498, +0.0962, +0.1740, +0.7217, +0.2614, +1.2404, +0.2340,
+0.1609, -0.3998, -0.2072, +1.2226
],
[
+0.3659, -0.3277, +0.2886, -0.6295, +0.2202, +0.1956, +0.2046,
-1.0997, -0.3790, -0.2504, -0.2179, +0.4310, -0.0257, -0.5886,
-0.2192, +0.5606, +0.5691, +0.3139, -0.3161, +0.1774, +0.4663,
-0.4175, +0.1008, +0.1057, -0.1205, +0.2663, -0.8731, +0.5174,
-0.0934, -0.2885, -0.4381, -0.5083, -0.2518, -0.1219, -0.6879,
-0.0831, +0.3837, -1.2419, -0.5405, -0.2546, +0.7046, +0.3395,
+0.5555, -0.3908, +0.1154, -0.0987, +0.2476, +0.3723, +0.0672,
-0.5928, +0.0105, +0.1161, -0.2884, -0.0896, -0.4600, +0.0441,
-0.6273, -0.1487, +0.2347, +0.1172, +0.2784, -1.1121, +0.0912,
-0.0353, +0.0231, -0.3515, +0.2365, -0.4356, -0.0845, +0.2015,
-0.1389, +0.2026, -0.6346, +0.2443, +0.4571, -0.1172, -0.3613,
-0.4059, -0.7775, -0.7386, -0.1742, -0.4192, +0.1514, -0.1638,
+0.0724, +0.0156, -0.3456, +0.1126, -0.1153, -0.2124, +0.7085,
+0.4719, +0.3253, +0.3380, +0.9501, +0.4256, +0.1533, -0.6508,
+0.7624, +0.0468, -0.1102, -0.3088, +0.0204, -0.4028, +0.4368,
-0.4793, -0.0175, +0.0985, -0.9569, -0.0340, -0.1244, +0.3770,
-0.2597, +0.2212, +0.2798, +0.4668, -0.4196, +0.0917, -0.2541,
-0.2862, +0.5804, -0.3658, -0.5237, -0.7544, +0.5569, -0.4648,
-0.5293, +0.7809, +0.7766, -0.5682, +0.1964, -0.8185, -0.1124,
-0.2674, +0.0967, -0.1906, +0.2630, +0.1404, -0.1758, +0.1631,
+0.1065, -0.3872, +0.0061, -0.9510, -0.1729, -0.4610, +0.2472,
+0.1792, +0.0699, +0.3596, -0.1982, +0.2670, +0.2600, -0.4795,
-0.2844, -0.2111, -0.0606, -0.8002, -0.4567, -0.1884, -0.0098,
-0.2961, +0.2176, -0.0458, -0.0488, -0.6393, -0.5504, -0.2651,
+0.0190, -0.2114, -0.0548, -0.6148, +0.9049, -0.1097, -0.9733,
+0.0583, -0.4493, -0.0165, -0.0770, +0.0710, -0.4033, -0.4281,
-0.4991, -0.3947, -0.4954, -0.9631, +0.0378, -0.4770, +0.1315,
-0.3187, -0.7582, +0.3062, -0.5525, +0.7319, -0.2604, +0.0441,
-0.1059, +0.2834, +0.3660, -0.8329, +0.3057, -0.4196, +0.4101,
-0.1431, -0.0602, +0.0972, -0.4246, +0.0750, -0.2165, -0.0929,
-0.5216, -0.0272, +0.2421, -0.1263, +0.3659, -0.6390, +0.4958,
-0.0563, +0.1865, +0.4631, -0.7523, -0.1715, +0.5228, +0.0712,
+0.0542, +0.0209, -0.1205, +0.0727, +0.2380, +0.2908, -0.3024,
-0.6805, +0.0372, -0.2433, -0.0941, -0.2936, -0.4086, -0.2987,
+0.0643, -0.2925, -0.1958, -0.1803, +0.5245, +0.3150, +0.0475,
-0.7125, -0.0838, -0.0100, +0.1168, +0.0011, -0.1571, +0.1697,
+0.4557, -0.0282, -0.8599, +0.3087
],
[
+0.5293, +0.5316, -0.0075, +0.2349, -0.1925, -0.3699, +0.7133,
-0.4346, -0.3532, -0.5599, +0.6772, +1.0476, +0.1895, -0.1390,
+0.4312, +0.2892, +0.3951, +0.0404, +0.4593, -0.3496, +0.0116,
-0.6154, -0.0422, +0.3318, -0.3554, -0.1510, -0.1144, +0.3037,
+0.2126, -0.2470, -0.3374, -0.5273, -0.4472, -0.1286, +0.2244,
-0.3495, +0.3391, -0.1282, +0.0407, -0.0645, +0.2085, +0.2341,
+0.0162, -0.0732, -0.8081, +0.4448, +0.4809, +0.1450, -0.0442,
-0.0492, -0.5167, +0.5533, +0.1572, -0.1957, +0.1203, +0.5138,
-0.0965, +0.8614, -0.3152, +0.0709, +0.4340, -0.5613, +0.1492,
+0.1472, +0.1821, +0.1713, +0.1056, -0.6941, +0.4367, +0.2689,
+0.1627, +0.0061, -0.4394, +0.0959, +0.0825, -0.5954, -0.0809,
-0.5548, +0.4909, -0.2199, -0.1998, -0.2514, +0.0983, -0.0957,
-0.0226, +0.2085, -0.2957, -0.0954, +0.1584, -0.3026, +0.1529,
+0.2377, +0.4984, -0.1790, +0.3467, -0.4972, -0.1265, +0.1861,
+0.5680, -0.4604, +0.2749, +0.0564, +0.1688, -0.1455, +0.1582,
-0.7147, -0.1668, +0.7087, -0.6417, +0.2222, +0.2567, -0.3951,
+0.0252, -0.5056, -0.5749, -0.0059, +0.0058, -0.1503, -0.0303,
-0.1436, -0.1979, +0.0134, -0.1827, -0.5967, +0.1955, -0.3377,
-0.4552, +0.2332, +0.4630, -0.4029, +0.1100, -0.3156, +0.3175,
+0.1121, +0.6988, -0.1980, +0.2492, -0.1373, -0.0736, +0.0154,
+0.1906, +0.3765, -0.5100, -0.2742, -0.2842, -0.2733, +0.4817,
+0.6092, +0.1535, -0.0521, +0.6241, +0.6618, +0.0321, -0.5597,
-0.6581, +0.2474, +0.4140, -0.1778, -0.7715, -0.3870, +0.3461,
+0.2471, -0.0063, +0.0640, +0.0977, -0.5769, +1.1693, +0.3004,
+0.0837, +0.3198, +0.8379, -0.5325, -0.3676, +0.0443, -0.5164,
-0.5141, -0.3037, +0.4722, +0.0488, +0.8697, -0.1157, -0.2020,
-0.1556, -0.3323, +0.0794, -0.4998, -0.3284, +0.1285, +0.2727,
+0.6930, -0.1084, +0.4371, -0.1270, +1.1286, -0.5242, +0.2965,
+0.6526, +0.3987, +0.1444, -0.4337, -0.1283, -0.0356, +0.0632,
-0.0329, +0.0984, +0.3490, -0.0315, -0.4110, -0.3036, -0.3578,
-0.0063, +0.4834, +0.2061, +0.2501, +0.0401, -0.6852, -0.3525,
-0.4835, +0.1745, +0.3534, +0.0782, -0.1772, +0.5503, +0.2279,
+0.0390, -0.4885, +0.3623, +0.0601, -0.3582, +0.1909, +0.1955,
-0.9959, +0.1046, -0.7885, -0.1006, +0.4565, -0.2528, -0.5783,
-0.0917, -0.0401, +1.0514, +0.2831, +0.3431, +0.3726, -0.2791,
+0.5676, -0.3964, +0.2246, +0.1321, -0.0372, +0.4953, +0.1855,
-0.2201, +0.4205, -0.2678, +0.3705
],
[
-0.4383, +0.3767, -0.1398, -1.2589, -0.0351, +0.8848, -0.3821,
+0.7381, -0.1629, -0.2208, -0.0231, -0.1089, +0.2688, -0.1913,
-0.1701, -0.8031, -0.7192, +0.2047, +0.3901, +0.6492, -0.6799,
+0.2456, +0.0256, +0.1402, -0.8989, -0.3148, -0.3743, +0.1524,
-0.5692, +0.0725, +0.2199, +0.2573, +0.2630, -0.0155, -0.8638,
-0.3227, -0.0941, +0.0170, +0.4481, -0.0033, -0.3460, -0.4853,
-0.2198, +0.3081, -0.5793, +0.2964, -0.4996, +0.3581, -0.4945,
-1.0241, +0.3134, +0.0406, -0.3108, -0.0937, -0.6398, -0.4360,
-0.3965, -0.1980, +0.2188, +0.1330, -0.1319, -0.2892, +0.1846,
-0.2287, -0.3640, +1.3056, -0.7990, +0.0514, -0.1256, -0.0869,
-0.5219, -0.4011, -0.0828, -1.3749, +0.4000, +0.0481, +0.0219,
-0.1074, +0.2081, -0.0452, +0.4307, -0.8420, -0.9887, +0.6651,
-0.3451, -0.4989, -0.2157, +0.1838, -0.2326, -0.5271, -1.0106,
+0.0422, +0.1659, -0.6790, -0.4370, +0.0993, -0.4219, +0.2926,
-1.4655, +0.3299, -0.4630, -0.4127, +0.0650, -0.0907, -0.5557,
+0.5449, +0.2549, -0.8462, -0.4960, -0.2910, -0.1676, +0.3139,
-0.3498, -0.1617, +0.1417, -0.0890, +0.4634, -0.3460, -0.1623,
+0.3784, +0.2638, -0.0517, +0.0446, +1.2269, -0.2161, +0.0567,
+0.1503, -0.5337, -0.1629, +0.5830, +0.0807, -0.1728, -0.0075,
+0.5278, -0.7841, +0.4637, -0.2269, +0.1374, -0.3859, -0.9908,
-0.1801, +0.0038, +0.2798, +0.3467, -0.3097, -0.3130, +0.1028,
+0.0310, +0.0803, -0.3599, -0.1481, -0.4712, -0.1677, -0.8620,
+0.1360, -0.3232, -0.6546, -0.3307, -0.1443, +0.4429, +0.0644,
-1.0791, -0.3051, -0.1541, -0.4603, +0.1506, -0.0511, +0.1952,
-0.0245, -0.0150, +0.2477, -0.0090, -0.1937, -0.4797, +1.0447,
+0.0411, -0.2671, -0.0387, -0.8022, +0.2201, -0.3823, -0.3047,
+0.1043, -0.4240, -0.0245, +0.3587, -0.2156, -0.1411, -0.3159,
-0.0002, +0.0291, +0.0051, +0.5761, -0.4807, +0.6089, -0.2353,
+0.0092, -0.6888, +0.2516, +0.8081, +0.1554, +0.7692, +0.3867,
-0.2633, -0.2482, -0.3817, +0.2199, +0.5334, +0.3730, +0.1608,
+1.2073, -0.7426, +0.1119, -0.6921, -0.4162, +0.0102, -0.1226,
+0.2965, -0.6047, -0.4760, +0.2470, -0.1461, -0.2106, -0.1756,
-0.4781, -0.8994, -0.2296, -0.0045, -0.1405, +0.1110, +0.1516,
+0.4299, +0.1353, +0.3075, -0.1090, -0.3561, -0.4872, +0.1200,
+0.1690, +0.0664, +0.0576, -0.6695, -0.2393, -0.1848, -0.5203,
+0.0431, +0.0627, +0.1742, +0.2262, +0.3209, +0.3629, -0.2562,
+0.1898, -0.1370, +1.1583, +0.2679
],
[
+0.3879, -0.2526, +0.5881, +0.3189, +0.2070, +0.6931, -0.3306,
+0.0660, +0.1093, -0.4855, -0.0718, -0.3554, +0.3417, +0.2194,
-0.0519, -0.8023, -0.6628, +0.0588, -0.4819, +0.3613, -0.3590,
+0.1909, +0.1917, +0.2438, +1.0631, -0.6014, +0.0911, -0.5642,
-0.4269, +0.0198, +0.5636, +0.2587, +0.1228, +0.1936, +0.0986,
-0.2277, +0.0956, -0.0331, -0.2739, +0.9812, -0.7628, -0.6546,
-0.0186, +0.4016, -0.5244, +0.6846, +0.2533, -0.1366, -0.1932,
+0.3941, -0.2001, -0.6538, -0.1762, +0.1094, +0.0883, -0.1340,
-0.6598, +0.1996, +0.3834, +0.5194, -0.2248, -0.2921, -0.0777,
+0.2306, +0.0241, +0.1826, +0.0310, +0.4689, +0.1437, +0.0393,
-0.1703, -0.4118, +0.2480, -0.2397, +0.3582, -0.2542, -0.6081,
-0.0572, +1.3444, +0.0118, +0.2765, -0.6030, -0.2835, -0.0242,
-0.1264, -0.2328, +0.3599, +0.2655, +0.3077, -0.0469, +0.4283,
-0.4493, -0.0542, -0.0127, -0.2526, +0.5933, -0.4638, +0.3775,
-0.7117, -0.6042, -0.2770, -0.1601, +0.0737, +0.0611, +0.5926,
+0.6737, +0.0839, -0.3346, -0.1312, -0.0318, -0.1617, -0.0336,
-0.9100, -0.2009, +0.2274, +0.0688, -0.7166, +0.1150, -0.8140,
+0.1184, -0.5295, +0.0943, +0.4650, +0.8789, -0.0656, +0.1492,
-0.4394, +0.0036, -0.3073, +0.2290, -0.5697, +0.4223, +0.2011,
+0.2196, -0.1706, +0.4915, -0.8992, +0.0736, +0.3837, -0.4251,
-0.2159, +0.3671, -0.1270, +0.0207, +0.2042, -0.1387, -0.0351,
-0.1776, -0.1136, +0.0430, -0.0738, +0.0864, -0.5124, -0.5529,
+0.6100, +0.4673, -0.0771, -0.2835, +0.3972, +0.0485, +1.1983,
-0.1951, -0.6381, -0.0974, -0.4182, -0.3271, -0.2248, +0.3219,
+0.3027, -0.0334, +0.0823, -0.1266, -0.1004, -0.3568, +0.4390,
+0.6042, -0.4685, +0.9686, -0.1652, +0.4926, -0.2821, +0.3147,
+0.7419, -0.7130, +0.8363, +0.1439, -0.2505, -0.8304, -0.0077,
+0.0359, -0.3370, +0.0313, +0.3718, -1.3662, +0.3167, -0.4004,
-0.8605, -0.1397, -0.0067, +0.0608, +0.0011, +0.5468, +0.7826,
-0.7418, -0.5643, -0.3295, -0.3556, +0.9552, +0.0878, -0.7521,
-0.0417, -0.0411, +0.5019, +0.4218, +0.1044, +0.2018, +0.7178,
+0.0425, -0.5157, -0.4186, +0.1644, +0.0227, +0.1145, +0.0584,
-0.6852, -1.0077, +0.4781, +0.0082, -0.2462, +0.2854, +0.7114,
-0.4493, +0.6272, +0.4718, -0.7225, +0.4412, +0.2769, +0.0257,
+0.4356, -0.1177, -0.2400, -0.5487, +0.0604, +0.4203, -1.2504,
-0.5002, -0.1294, -0.1064, +0.4515, -0.0592, +0.4579, -0.5153,
+0.1722, +0.0011, -0.2838, -0.0426
],
[
-0.5000, +0.0939, +0.2115, +0.1138, -0.2612, -0.2688, +0.1126,
-0.1978, +0.0107, -0.0291, -0.6198, -0.3804, +0.3689, -0.5019,
-0.2919, +0.2962, -0.0346, +0.2433, +0.0477, -0.2796, +0.2503,
+0.2574, +0.1043, -0.1736, +0.0486, -0.2836, -0.1299, -0.4129,
+0.3905, -0.0475, +0.1315, +0.0154, +0.0612, +0.0488, +0.1056,
-0.3194, +0.0503, +0.0915, +0.1376, -0.0937, +0.2009, +0.1034,
+0.2468, +0.0418, -0.6219, -0.0482, -0.2431, -0.2583, +0.3053,
+0.6434, +0.5343, -0.1449, -0.3486, -0.3343, +0.4435, +0.3061,
+0.5672, -0.0846, +0.3410, -0.2485, +0.2576, +0.0540, -0.4661,
-0.3009, -0.1271, +0.1216, -0.2006, -0.2457, -0.4119, -0.5092,
+0.1415, +0.0494, -0.0872, -0.0839, +0.0892, +0.3253, +0.5367,
+0.1022, +0.1056, +0.0895, -0.1332, -0.3175, -0.4450, +0.1273,
-0.3015, +0.3787, -0.0738, +0.1450, -0.0459, -0.1222, +0.0501,
-0.4743, -0.0633, -0.1730, -0.0526, +0.1144, +0.1252, +0.0175,
+0.2888, +0.2878, -0.0642, -0.4326, -0.0421, +0.5604, -0.1325,
+0.1343, +0.4688, +0.3642, -0.3168, -0.3097, +0.1854, -0.1056,
-0.0041, -0.1558, -0.4009, -0.0136, -0.0572, -1.4377, -0.1642,
-0.0893, -0.1262, +0.5482, -0.1530, -0.1314, -0.1865, +0.1544,
+0.2510, -0.2994, +0.2177, +0.1859, +0.3517, -0.3309, -0.1467,
-0.2601, -0.0053, +0.2824, -0.0076, -0.1656, +0.5284, -0.2198,
-0.5152, -0.4911, -0.0592, -0.3420, +0.0482, +0.0769, -0.2824,
+0.1832, +0.3256, +0.2028, -0.1730, +0.0780, +0.1358, +0.1322,
-0.2479, +0.0363, -0.1282, +0.3515, +0.2663, -0.2877, +0.2531,
+0.0901, +0.4157, +0.2200, -0.0936, -0.4784, +0.1988, -0.1421,
+0.0299, +0.3992, -0.5075, +0.1705, -0.4994, -0.4354, -0.2757,
-0.3260, +0.1986, -0.0314, -0.2276, -0.0841, +0.1922, +0.0777,
-0.3740, -0.8162, -0.3210, +0.2908, -0.0066, +0.3830, -0.0275,
-0.0054, -0.5686, -0.3304, +0.2550, -0.1482, -0.1277, +0.1528,
+0.0152, +0.3266, -0.1639, -0.2498, +0.1536, -0.1135, -0.1109,
-0.0162, -0.1373, -0.3185, -0.1413, -0.4320, +0.0198, +0.0807,
-0.3152, -0.1504, +0.3467, -0.0254, +0.1652, -0.0769, -0.2225,
+0.2389, +0.1408, +0.5036, -0.1342, +0.3223, +0.5522, -0.5153,
+0.1950, -0.5411, +0.1289, -1.3593, -0.1572, +0.1246, +0.2857,
-0.5160, -0.0212, +0.1755, +0.2012, -0.1534, +0.0277, +0.0755,
-0.4493, +0.1839, +0.2857, -0.2879, -0.0920, -0.0917, +0.2131,
+0.5900, -0.4697, +0.2854, -0.7325, -0.0251, -0.5607, -0.5852,
+0.0302, -0.5642, -0.7150, +0.0296
],
[
-0.5366, -0.0531, +0.1124, -0.2017, -0.1809, -0.4269, +0.6671,
-1.3134, +0.0068, -0.3639, +0.6549, +0.0154, -0.0122, +0.7394,
-0.1614, +0.4954, -0.7794, +0.8172, -0.7611, -0.0067, +0.1521,
+0.1350, +0.3450, -0.1466, -0.0309, +0.7165, +0.4891, -0.1217,
-0.4430, +0.1883, -0.1012, -0.0586, +0.9688, -0.5793, -0.7512,
-0.7491, +0.3468, +0.2876, +0.3349, +0.1740, +0.4537, +0.4894,
+0.1092, +0.0501, +0.0156, +0.5487, +1.0158, -0.3966, -0.2654,
-0.0724, +0.5067, -1.0364, +0.3480, -1.2098, +0.1811, +0.1189,
-0.1088, -0.4454, +0.2028, -1.8978, +0.5481, +0.6970, -1.6196,
-1.6491, -0.3147, +1.4683, -0.9395, +0.1823, -0.3368, -0.0161,
+0.3138, +0.5338, -1.0571, -0.6651, +0.8359, +0.6429, -1.0306,
+0.1145, -0.1924, -0.8384, -0.5674, +0.2337, +0.2191, -0.0808,
+0.4547, +0.2254, +0.7611, +0.2956, +0.4412, +0.2042, -0.3485,
-0.8579, -0.0360, +0.4043, +0.2869, +0.2893, -0.6088, -0.0838,
-0.0675, +0.6638, -1.3170, -0.6425, +0.1490, +1.0714, +1.4623,
+0.1846, +0.8732, +0.1235, +0.0416, -0.6125, -0.4323, -0.4897,
+0.1530, -0.8170, +0.1582, +1.4972, +0.5751, -0.9646, -0.3476,
-0.8966, +0.0913, -0.2005, -0.0103, -0.3659, +0.1734, +0.7632,
-1.1119, -0.0537, +0.0060, -1.3084, -0.4407, -0.0468, -0.4416,
+1.1417, +0.4995, +0.2502, -0.3735, -0.2458, +1.3448, -0.8585,
+0.0501, -0.0543, +0.2666, -0.8573, +1.4857, +0.7025, -0.0231,
-1.3243, -0.4544, -0.2274, +0.4979, +0.3006, +0.6793, -0.1725,
-0.0746, +0.3645, +0.1898, -0.5180, +0.5533, -0.5042, +0.2358,
+0.4967, -0.2988, +0.1609, -0.0783, -1.1282, -0.2522, -0.6260,
-0.2272, +0.0970, -0.3885, -0.1422, -0.4530, -0.9385, +0.0407,
-0.7700, -0.2531, +0.5047, -0.3739, +0.6096, +0.0805, -0.3859,
-0.0817, +0.8843, -0.3196, -0.8929, -0.2564, +0.2006, +0.2478,
+0.3182, +0.7476, -0.7697, +0.9693, +0.2046, +0.3687, +0.1164,
+0.4698, -1.7755, -1.1123, +0.2230, -0.7335, -0.0206, -0.2223,
+0.3990, +0.5648, -0.9936, -0.8622, -0.1690, -1.1837, +0.6950,
-0.6163, +0.7241, -0.2630, +0.4631, +0.3327, +0.4036, -0.7987,
+0.4207, +0.4984, +0.2982, -1.2386, +0.4749, +0.4591, -0.7422,
+1.0875, +0.5354, -0.6738, +0.0386, +0.7613, +0.0585, +0.1570,
-0.7002, -0.5231, +0.4646, +0.3237, +0.6031, +0.2195, +0.8915,
-0.4667, +0.3789, +0.2301, +0.2010, -0.5623, +0.4832, +0.1143,
+0.7928, -0.3460, -0.0472, -0.2626, +0.6499, -0.8235, -0.2990,
-1.1168, -0.1905, -0.7103, +0.5388
],
[
+0.3133, -0.6316, +0.2023, +0.6097, -0.5400, +0.1520, +0.0771,
+0.1700, +0.5944, -0.1067, +0.0666, -0.0254, -0.4327, +0.2285,
+0.4536, -0.5574, +0.0504, +0.7510, +0.0809, +0.3838, -0.8439,
-0.1147, -0.1345, +0.0099, +0.1836, +0.3595, -0.2420, -0.0407,
-0.1447, +0.2181, -0.7152, +0.1702, +0.7404, +0.2821, +0.0276,
-0.9614, -0.4581, -0.5366, -0.2125, +0.0668, -0.0150, -0.2005,
-0.3165, +0.3662, -0.1285, -0.3924, -0.6074, -1.2115, -0.0836,
+0.3740, +0.0347, -0.5316, -0.4051, +0.4834, +0.4039, +0.5063,
-0.6241, -0.8050, +0.2015, -0.4484, -0.2013, -0.6292, -1.1865,
-0.8314, -0.0588, -0.3668, +0.2977, +0.3386, -0.1837, +0.0628,
+0.3704, +0.5527, +0.3007, +0.2247, +0.0288, +0.4336, -0.4317,
+0.1014, -0.0536, -0.1351, -0.0964, -0.5354, -0.2087, +0.1205,
-0.0931, +1.2910, -0.4756, +0.5848, -0.3123, +0.4850, -0.7045,
+0.2975, +0.4772, -0.5417, -0.6282, +0.2288, +0.3505, -0.4983,
-0.3921, -0.8337, +0.6614, -0.8303, -0.0417, -0.0454, +0.3398,
+0.5071, -0.2283, +0.8284, +0.8516, +0.1268, -0.1436, -0.7265,
-0.0281, -0.4421, -0.6513, +0.3358, -0.0248, +0.3102, -0.0737,
+0.1734, -0.0482, -0.3296, +0.1719, -0.0633, -0.1005, -0.2895,
+0.3284, +0.5012, +0.4542, +0.4629, -0.2717, -1.0846, +0.4166,
+0.5448, +0.0183, -0.2270, +0.3915, +0.3580, -0.2457, -0.2945,
+0.1370, -0.0692, -0.0832, +0.7713, -0.5414, +0.7029, -0.0502,
-0.2691, -0.2321, -0.0533, -0.1938, -0.1868, -0.0738, +0.6259,
-0.9198, +0.7292, -0.8877, -0.2662, -0.1584, -0.4681, -0.1216,
+0.0493, -0.5111, +0.2386, +0.3455, -0.4765, -0.9506, -0.5355,
-0.4193, -0.1604, -0.2862, +0.6543, +0.0157, +0.2146, -0.1735,
-0.3411, +0.2515, +0.0945, +0.2771, -0.8631, +0.8575, -0.1875,
+0.1667, -0.1624, -0.2783, -0.1305, +0.4377, -0.0527, +0.1919,
+0.2666, -0.5505, +0.2840, -0.3974, +0.1018, +0.2978, -0.3643,
+0.1362, +0.0297, +0.3011, +0.1747, -0.0179, -0.4801, +0.8440,
-0.6682, +0.4672, +0.6367, -0.1213, +0.3026, +0.4612, -0.1369,
-0.3340, +0.0787, -0.2030, -0.4573, +0.3517, +0.4259, -0.0845,
+0.1546, -0.2297, -0.2969, -0.0824, +0.1241, -0.4702, +0.0363,
+0.0921, +0.3557, -0.8600, -0.3158, +0.3729, +0.0638, -1.1007,
-0.2081, -0.2055, +0.1172, +0.0916, -0.0058, +0.1816, +0.0123,
+0.1429, -0.5018, -0.3023, -0.4876, -0.0388, -0.1106, -0.3108,
-0.8963, -0.6240, +0.6068, -0.1200, -0.3523, -0.5510, +0.2055,
+1.1523, +0.5612, -0.4251, -0.4462
],
[
-0.2078, +0.2159, -0.6899, +1.1732, -0.5647, -0.0560, -0.0740,
+0.1268, -0.0523, +0.3479, +1.4624, -0.4836, +0.7700, -0.5258,
+0.7166, -0.1354, -0.3892, +0.3247, +0.3710, -0.4606, -0.5177,
-0.0647, -0.1316, +0.0905, +0.1431, +0.7916, -0.0960, +0.7971,
-0.0478, -0.0183, -0.1254, +0.3246, +0.3927, +0.7055, -0.1469,
-0.0563, -0.5129, -1.2095, -0.4517, -0.3763, -0.2522, -0.6434,
-0.0896, +0.0748, +0.1881, +0.2351, -0.2307, -0.3198, +0.2472,
-0.6252, +1.0733, -0.9754, +0.9886, +1.6223, -0.0218, -0.0685,
-0.6506, -0.6508, +0.6577, +0.1807, -0.3100, -0.0847, +0.5665,
+0.1520, -0.4894, +0.1449, +1.0282, +0.3099, +0.3025, +0.0711,
+0.5635, +0.1188, +0.4385, +0.3915, -0.1982, +0.3720, -0.0862,
-0.3462, -0.3721, -0.1543, +0.1193, +0.5861, -0.0313, -0.1667,
+1.1074, +0.7065, -0.5241, +0.5442, +0.2790, -0.1370, +0.1128,
-0.5967, +0.0350, +0.0144, -0.6178, +0.2484, +0.2531, -0.6824,
+0.0965, +0.2046, +0.4401, -0.1291, +0.6294, -0.2014, -0.2637,
+0.1229, -0.9164, +0.0964, +0.9267, +0.1048, +0.8069, -0.8321,
-0.5052, -0.0693, +0.4893, -0.0462, +0.0229, -1.0707, +0.1171,
+0.5665, -0.8612, -0.0277, -0.2675, -0.2062, -0.3403, -0.2790,
+0.1097, -0.1200, +0.0495, +0.4543, -1.1329, +0.0464, -0.7925,
-0.7417, +0.7223, -0.0427, -0.0673, -0.0399, -0.9868, +0.1529,
+0.5369, +0.3171, -0.3458, +0.5491, -0.0901, +0.5131, +0.0404,
-0.2901, -1.0743, -0.4129, -0.7517, +0.2465, -0.4845, +0.1737,
-0.6957, +0.4938, -0.3270, +0.2558, +0.7118, -0.6806, -0.4913,
+0.3811, +0.5939, -0.0987, +0.4408, -0.6064, +0.4788, -0.3907,
+0.7597, +0.5543, +0.4437, +0.0443, -0.1223, -0.0524, -0.1103,
+0.7907, +0.3542, +0.8101, +0.4851, +0.4546, +0.0818, -0.4959,
+0.7695, -0.2585, -1.6009, +0.1457, +0.3954, +0.8016, -0.2011,
-0.8105, +0.7025, -0.7162, +0.4712, +0.4286, +0.6986, -0.6297,
+0.2641, +0.9476, +0.2917, +0.0902, -0.4511, -0.4805, +0.4719,
-0.5469, +0.5991, +0.3369, -0.9000, +0.7184, -0.3536, -0.1188,
-0.1574, -0.2844, +0.2864, +0.6465, +0.4639, +0.7739, +0.0324,
-0.0467, -0.0402, -0.0269, +0.4416, -0.0577, -0.5605, +0.2913,
-0.3087, -0.2643, -0.9488, +0.0121, -0.5815, -0.6524, -0.1886,
+0.9885, -0.3186, -0.0408, +0.7183, -0.0352, -0.2070, -1.0671,
+0.1828, +0.0276, -0.2088, -0.0692, +0.1481, +0.4491, -0.2706,
-0.5036, +0.3425, +0.3358, -0.3577, -0.1041, -0.5428, +0.5906,
-0.8141, +0.4981, +0.4530, -0.0505
],
[
+0.0883, +0.5745, +0.1241, +0.0386, -1.3220, +0.1391, -0.7444,
+0.1266, -0.4752, -0.0622, -0.0086, +0.4961, -0.9183, +0.2870,
-0.0505, -0.0834, -0.4600, -1.2942, +0.4397, -0.9405, -0.2526,
+0.0333, -0.5344, +0.0062, -0.3627, -0.0152, +0.1844, +0.4362,
-0.3528, -0.6949, -0.7837, +0.4124, -0.4609, +0.3771, -0.0652,
+0.1978, -1.2737, +0.0702, -0.9126, +0.4987, -0.3259, +0.3806,
-1.2165, +0.1094, -0.1793, +0.2912, +0.5028, -0.3525, +0.3053,
-0.1895, -0.3082, -0.4153, -1.0049, -0.2444, -0.0007, -0.6810,
-0.4850, -0.5223, -0.2507, +0.1435, -0.3542, +0.2929, -0.5005,
-0.3632, +0.2116, +0.6687, +0.0826, -0.0506, -0.2402, -0.4810,
-0.3074, -0.1164, +0.2267, -0.1956, -0.0909, -0.0020, +0.0059,
+0.7786, +0.1430, -0.0885, +0.0162, +0.1277, +0.4625, +0.3426,
+0.3616, -0.5267, +0.2048, +0.4234, -0.0988, -0.4840, +0.8986,
+0.3059, +0.1044, -0.0221, +0.1213, +0.2799, +0.2168, -0.3360,
+0.0820, -0.2899, +0.5913, +0.0276, +0.6040, -0.7100, +0.1102,
-0.7610, -0.9273, +0.2782, -0.4118, -0.5615, +0.3015, -0.3658,
+0.0120, -0.4225, -0.9050, -0.5561, -0.1952, -0.2364, -0.2842,
-0.4078, +0.4831, -0.3532, +0.2448, -0.1562, -0.2250, +0.1278,
-0.3951, -0.3186, -0.3552, +0.2271, -0.6228, +0.1711, +0.1144,
+0.5876, -0.0525, +0.1323, -0.1743, +0.4941, +0.2175, +0.1452,
-0.6939, -0.3579, -0.2105, +0.0473, +0.1207, -0.2609, +0.7277,
-0.6756, -0.9064, +0.3227, -0.2519, +0.3097, +0.2882, +0.0695,
-0.1104, -0.0890, +0.2658, -0.1416, +0.0912, +0.3849, +0.0381,
+0.1393, +0.2570, -0.1948, -0.0091, -0.3471, +0.4512, -0.9123,
+0.3797, -0.2508, +0.3012, +0.5242, +0.1647, -0.0376, -0.1543,
+0.1072, +0.3013, +0.3925, -0.5150, +0.3293, -0.4495, -0.5439,
+0.1226, -0.0503, +0.3166, +0.0229, -0.1003, +0.0704, -0.7325,
-0.4725, -0.1982, -0.0686, +0.2250, -0.5051, -0.1548, +0.7555,
-0.1745, -0.4507, +0.0182, +0.0478, -0.1299, -0.0160, +0.2467,
-0.1570, -0.0555, +0.4546, -0.0208, +0.6012, -0.5317, -0.3977,
+0.1079, +0.2253, -0.4173, -0.0367, +0.0345, -0.5867, +0.3191,
-0.0608, -0.2514, +0.3111, +0.5135, +0.8052, -0.4308, -0.1522,
-0.8264, +0.1884, +0.0839, +0.2944, -0.2407, +0.6267, -0.1679,
+0.7118, -0.3055, -0.0245, +0.4895, +0.0072, +0.8225, -0.1348,
+0.0345, -0.3597, +0.1860, +0.0213, +0.8171, +0.4510, -0.1827,
-0.2858, -1.2174, -0.3189, +0.0268, +0.6681, +0.4480, +0.3994,
-0.1562, -0.9024, -0.2326, +0.1346
],
[
+0.3084, +0.3326, +0.1054, +0.5372, -0.4462, +0.3715, -0.4384,
+0.4350, +0.4069, -0.1899, -0.2812, +0.3302, -0.5307, -0.0522,
+0.4385, -0.5310, -0.8525, -0.3197, +0.0000, -0.1851, +0.2713,
-0.1222, -0.0797, +0.1402, +0.1150, -0.3401, -0.5592, -0.0257,
-0.3595, -0.2370, +0.6668, +0.3255, -0.3060, +1.0412, -0.3289,
-0.0084, -0.7253, +0.5238, -0.2928, -0.0062, -0.4224, +0.4303,
-0.2587, +0.3176, -0.5448, +0.4752, +0.7116, -0.1239, +0.4182,
-0.5606, -0.0119, -0.4950, -0.1067, +0.5279, -0.0342, -0.8565,
-0.4620, -0.1194, -0.0360, +0.5641, +0.1143, +0.5987, -0.3046,
+0.3763, +0.3809, +0.0488, +0.2096, +0.3724, -0.1403, -0.1926,
-0.5922, +0.1727, +0.4608, -0.5037, +0.0887, +0.0214, +0.2735,
+0.5127, +0.1420, +0.8844, -0.3324, +0.2358, +0.7508, +0.1167,
+0.0459, -0.4334, -0.0198, +0.5772, +0.4406, -0.1656, +0.2223,
+0.2519, -0.3324, +0.4001, -0.3142, -0.1051, +0.3291, -0.0687,
+0.0978, +0.0169, +0.2624, -0.0020, -0.0262, -0.6117, +0.2776,
-0.2481, -0.7874, +0.0241, +0.4585, -0.3711, +0.3154, -0.4785,
+0.7140, +0.3236, -0.8819, +0.0408, -0.3777, -0.4275, -0.1939,
-0.5276, +0.1249, -0.6084, +0.0583, -0.0348, +0.7692, -0.1150,
-0.0375, -0.0562, -0.1039, +0.0838, -0.5024, +0.5375, +0.0474,
+0.3641, +0.6234, +0.2684, +0.4376, -0.0756, +0.1711, -0.1052,
-0.6423, -0.0710, +0.0612, -0.3986, +0.2754, -0.2364, +0.6701,
-0.1358, -0.1000, +0.7136, -0.1151, -0.5315, -0.2194, +0.6152,
+0.4980, +0.2460, -0.3362, -0.2858, -0.3295, -0.2964, +0.1795,
+0.0117, +0.3812, +0.3558, +0.3506, -0.2463, +0.3887, -0.3427,
+0.3082, +0.1121, -0.1937, +0.3812, -0.1235, +0.3321, +0.1251,
-0.0890, +0.4140, +0.5447, +0.3223, +0.1721, +0.4238, -0.0615,
+0.6814, +0.2036, -0.3634, +0.6447, -0.3903, +0.4421, -0.6876,
+0.4155, -0.1082, +0.3378, +0.2087, -0.6629, -0.5236, +0.9171,
-0.5905, -0.2467, -0.1317, +0.1906, -0.0160, +0.0688, +0.0536,
-0.3821, -0.0679, +0.2156, +0.3244, +0.3768, -0.2809, -0.0848,
-0.0698, +0.0940, -0.8873, +0.4357, +0.0218, +0.4299, +0.3018,
+0.1461, -0.4344, +0.2483, +0.4554, -0.0151, +0.4039, +0.3796,
-0.3374, -0.1993, -0.1437, -0.2406, +0.1328, +0.6773, -0.4468,
+0.4858, -0.7805, -0.0731, +0.4331, +0.4372, +0.3843, -0.1971,
+0.5076, +0.3756, +0.9754, +0.1496, +0.5236, +0.2684, -0.1820,
-0.5176, -0.3597, +0.1541, +0.1695, +0.6111, -0.1462, -0.4114,
+0.0234, +0.0209, +0.5436, +0.5810
],
[
-0.2500, +0.3077, +0.1558, +0.3010, +0.6922, +0.4368, +1.2611,
+0.4390, -0.2915, -0.0442, -0.0027, +0.3695, -0.1254, -0.5003,
-0.8550, -0.0819, +0.6677, +0.7455, -0.0776, -1.2166, +0.0246,
-0.8068, +0.1458, +0.1168, +0.3775, -0.0366, -0.4019, -1.0362,
+0.0472, -0.9426, -0.0675, -0.6501, +0.2171, -0.2521, +0.2897,
+0.0093, +0.7755, -0.1403, -0.0516, +0.2505, +0.2692, -0.1350,
+0.2832, -0.1298, -0.3193, +0.3324, +0.1854, -0.0759, -0.7190,
-0.2470, +0.1966, -0.4939, -0.1859, -0.2846, -0.9652, +0.5937,
-0.3156, +0.1543, +0.3539, -0.7877, -0.4272, +0.3107, +0.0315,
+0.5174, -0.0162, -0.0552, +0.1052, -1.0040, -0.2154, +0.8140,
+0.8001, -0.1447, +0.2047, +0.5197, -0.0189, +0.2863, -0.3463,
-0.2873, +0.1687, -0.3446, +0.2374, -0.1005, +0.0379, +0.3568,
+0.1127, +0.6150, +0.2781, +0.1287, -0.3984, -0.0689, +0.1423,
-0.4591, -0.1348, -0.8668, +1.0449, +0.1205, -0.7809, -0.4016,
+0.0480, -1.3975, -0.3335, +0.1350, -0.1440, +0.4579, +0.2722,
+0.2101, +0.2482, -0.0158, +0.0860, -0.4599, -0.5761, -0.1191,
+0.0220, -0.6415, +0.1869, +0.1274, +0.2244, -0.6932, +0.3727,
+0.1536, +0.3592, +0.1398, +0.0148, +0.4021, -0.1487, +0.1267,
-0.0019, +0.5425, +0.3965, +0.2555, +0.1843, +0.4653, -0.8533,
-0.0198, +0.0784, -0.6288, +0.1757, -0.0479, -0.3504, -0.2092,
+1.4140, -0.0574, -0.3833, -0.6488, -0.8540, -0.2835, -0.9608,
+0.5502, +0.6005, -1.5338, -0.1230, -0.9029, -1.3107, -0.1371,
-1.2359, +0.1221, +0.0265, +0.1265, -1.0465, +0.0593, -0.6191,
-0.2046, +0.3733, -0.0338, -0.6591, +0.1019, -0.0270, -0.2339,
-0.0395, -0.6103, -0.2356, +0.0017, +0.4525, +0.5458, +0.0776,
-0.2577, -0.0378, +0.2578, -0.4619, +0.3851, +0.0819, +0.0461,
-0.4399, -0.1668, -0.3137, -0.0088, -0.5462, -0.5962, +0.6968,
+0.2002, +0.3099, -0.3296, -0.0797, -0.1906, +0.3054, -0.4745,
+0.6503, +0.0542, +0.2144, -0.5482, -0.7552, -0.4890, -0.2945,
-0.2794, -1.2685, -0.0533, -0.8263, -0.7473, +0.5711, -0.1414,
+0.0348, -0.2394, +0.7934, +0.3019, +0.0283, -0.2052, -0.2160,
-1.2565, +0.1837, -0.5952, +0.2728, -0.4365, -0.0053, +0.3223,
+0.0588, -0.4739, +0.2493, +0.5917, -0.3267, -1.0887, +0.4630,
+0.2037, +0.4404, -0.3157, -0.3922, -0.2117, +0.0694, -0.3869,
+0.1015, +0.0267, +0.0393, -0.2944, -0.5654, +0.0621, -0.1336,
+0.1256, +0.1415, -0.5144, -0.8333, -0.5362, -0.2697, +0.1414,
-0.4653, +1.0042, +0.0541, -0.2995
],
[
-0.3617, +0.6119, +0.1803, -0.7268, +0.1873, +0.1849, +0.3978,
-0.2046, -0.4021, -0.0068, -0.4464, +0.1547, -0.1373, -0.0781,
-0.7765, -0.3411, +0.4319, -0.0365, -0.2461, +0.0698, -0.1267,
-0.8131, +0.1605, +1.1406, -0.0785, -0.1109, +0.0651, -0.1175,
+0.2334, +0.0754, -0.1100, -0.2610, +0.1067, -0.4293, +0.6595,
+0.0901, +0.4231, +0.0030, +0.4254, -0.3673, -0.1324, -0.0250,
+0.4087, -0.2628, -0.5321, -0.7347, +0.7819, -0.0667, -0.3807,
+0.2666, -0.1121, +0.3202, -0.3344, +0.5674, -0.0790, +0.3794,
-0.2026, +0.5088, +0.4095, -0.0543, -0.1254, +0.0291, +0.8022,
+0.9585, +0.2550, -0.9030, -0.1392, -0.2231, +0.2384, +0.3346,
+0.4932, +0.5478, -0.4844, +0.5016, +0.0050, -0.3516, -0.1467,
-0.3614, -0.3191, +0.0918, -0.6497, -0.8179, -0.1203, +0.2838,
-0.8380, -0.2386, +0.2764, +0.2012, +0.2537, -0.2596, -0.1523,
-0.2144, -0.4428, -0.2279, +0.3967, -0.0666, +0.4540, +0.1012,
-0.1424, -0.2584, -0.4035, +0.3236, +0.0341, -0.1242, +0.3707,
-0.0029, -0.0806, -0.4114, +0.6835, -0.2080, -0.3752, +0.4889,
-0.7170, +0.4745, -0.4807, -0.6897, -0.8512, +0.1095, -0.5387,
+0.2555, -0.3730, -0.2401, +0.3897, +0.1526, +0.4394, -0.0330,
-0.0074, -0.2117, +0.0445, +0.5541, -0.4439, +0.6947, +0.5867,
+0.0232, -0.3013, -0.4952, -0.0544, +0.5246, -0.4008, -0.8797,
+0.7381, -0.7058, +0.2255, -0.0161, -0.7893, -0.1669, -0.3674,
+0.2584, +0.0972, -0.6752, -0.0116, -0.4167, -0.1269, -0.5116,
-0.3789, +0.1586, +0.3960, +0.2958, -0.6671, -0.2630, -0.6302,
+0.3825, +0.0924, -0.4380, -0.4249, -0.5170, +0.3245, +0.4881,
-0.7935, -0.5931, +0.2993, -0.5733, -0.7339, +0.1648, +0.3424,
+0.4922, +0.3099, +0.1607, -0.1968, -0.0296, -0.1659, -0.2224,
-0.8748, +0.6691, +0.2408, -0.4505, -0.2609, +0.5525, +0.5123,
+0.1637, +0.9391, -0.2949, +0.5058, -0.0878, +0.7430, -0.5601,
+0.1722, -0.1415, +0.2439, -0.2886, -1.1566, +0.2533, -0.4539,
-0.2170, -0.0570, +0.3258, +0.0173, -0.3232, +0.1866, -0.8982,
-0.4922, -0.4564, -0.3910, +0.1259, -0.2820, -0.3271, -0.0819,
-0.4024, -0.3912, -0.1096, -0.0386, -0.1337, +0.4817, +0.5591,
+0.3636, +0.1442, +0.2077, +0.2385, +0.0564, -0.8489, +0.4890,
-0.5965, +0.4944, +0.7034, +0.2359, +0.9821, -0.2933, +0.4627,
-1.0236, +0.1961, -0.0180, +0.0697, -0.1304, -0.0903, -0.2365,
-0.4505, -0.5489, -0.4525, +0.3125, -0.7338, -0.6284, +0.9569,
-0.1139, +0.1486, -0.3127, -0.4513
],
[
+0.1374, -0.5428, -0.8100, -1.0265, -0.2423, +0.1350, -0.1682,
+0.0583, -0.2582, +0.1550, +0.0280, -0.2915, +0.3467, +0.3599,
+0.0055, +0.1305, -0.1833, -0.1642, +0.1030, -0.2892, +0.0507,
-0.3570, +0.2098, -0.1168, +0.0693, +0.1814, +0.0658, -0.0190,
-0.4673, +0.0659, -0.4218, +0.0543, -0.4458, -0.2527, +0.4815,
-0.0955, +0.0052, -0.0228, -0.3353, -0.3469, -0.6349, -0.1985,
+0.1107, -0.1253, +0.2029, -0.3126, -0.1510, -0.1179, -0.1855,
-0.1230, -0.3620, -0.0249, +0.1285, -0.2405, +0.3999, -0.1774,
-0.0395, +0.5645, -0.2328, +0.0150, -0.3253, -0.0695, -0.6269,
-0.3334, +0.0779, -0.0437, +0.1131, -0.1575, +0.3053, -0.1468,
+0.0352, -0.3982, +0.1718, -0.2638, -0.0177, +0.2462, -0.1478,
-0.2315, +0.0713, -0.1853, -0.0738, +0.0536, +0.2119, +0.2691,
+0.0546, -0.5131, +0.4333, -0.4216, -0.3035, -0.1188, -0.4189,
-0.2094, -0.1047, +0.1408, +0.0974, -0.2719, -0.1249, +0.1946,
-0.0849, -0.1044, -0.0510, +0.1056, +0.0175, +0.0413, +0.1502,
-0.0845, -0.4606, +0.0749, +0.5350, +0.0060, +0.0318, -0.3788,
+0.1055, -0.3184, -0.2421, -0.1276, -0.1251, +0.2900, +0.2509,
-0.3171, -0.6557, -0.2008, -0.5711, -0.1254, +0.0869, +0.3087,
-0.1056, -0.1393, -0.2747, -0.0783, -0.4774, -0.4621, +0.1936,
+0.0284, +0.5479, -0.5869, -0.2269, -0.0711, -0.2774, +0.0409,
+0.1552, +0.1656, +0.2633, +0.1758, +0.0518, -0.3006, -0.0855,
-0.0324, +0.1547, +0.3259, -0.1615, -0.0038, +0.0764, -0.2870,
+0.1677, -0.1411, -0.6105, -0.2463, -0.2647, +0.2542, +0.1947,
+0.0514, -0.3308, -0.3148, +0.1937, +0.0342, -0.2227, +0.0185,
-0.0816, -0.0406, -0.2300, -0.1025, -0.3797, -0.3689, +0.0250,
-0.1930, +0.1759, -0.0086, -0.2773, -0.1413, -0.2596, -0.1380,
-0.0023, -0.0578, -0.1519, +0.2800, -0.0472, +0.1733, +0.0858,
-0.4109, -0.1821, -0.2069, -0.0812, -0.0292, -0.1067, -0.1145,
-0.7581, +0.0988, -0.1573, -0.0543, -0.0192, +0.1357, +0.1829,
-0.3401, +0.1644, +0.0492, -0.5190, +0.0267, -0.3055, +0.1544,
-0.0713, +0.1133, -0.4940, -0.2757, -0.2218, -0.4367, -0.0063,
+0.0133, -0.1323, -0.0167, -0.1582, -0.0865, -0.3382, +0.5587,
+0.0266, +0.0899, -0.4496, -0.4377, -0.3201, +0.0885, -0.1241,
-0.2890, +0.1006, +0.0440, +0.0513, -0.5927, -0.2212, -0.1547,
-0.3500, +0.3094, -0.4577, +0.0900, +0.2294, +0.2151, +0.1440,
-0.2790, -0.1258, -0.3533, -0.1199, +0.5167, -0.0921, -0.0455,
-0.1775, +0.2137, -0.2639, +0.1466
],
[
-0.5276, -1.3438, +0.3831, -0.9253, +0.8576, +0.0124, -0.2658,
-0.2487, -0.1611, +0.3085, -0.5858, +0.5871, -0.9179, +0.5947,
+0.7145, +0.6081, -0.7345, -0.4929, -0.1306, +0.6165, +1.1511,
-1.1945, -0.7667, -0.3825, -0.0375, +0.1871, +0.7079, -0.0321,
-0.0640, -0.4706, +1.0184, +0.6239, +0.2742, -0.5054, +0.2348,
+0.4013, +0.5829, +1.2272, -0.0240, +0.1746, -0.1047, +0.8335,
-0.0198, -0.0762, -0.5627, -0.1122, +0.3310, +0.1170, +0.2169,
-0.0871, +0.0091, -0.3329, +0.5467, -0.5080, +0.5069, +0.5804,
-0.8041, +0.9737, -0.3245, +0.1729, -1.0782, -0.3868, +0.2157,
-1.2449, -0.7842, +0.0555, -1.1963, -0.5074, +0.0428, +0.6962,
-0.1599, +0.4788, -0.2649, +0.8472, +0.4923, +0.3957, +0.2921,
+0.8468, +1.2065, +1.0259, +0.3230, -0.3249, +0.1635, -0.0607,
-0.4183, +0.3428, +1.2379, +0.6218, -0.0018, -0.6459, -0.0654,
+0.6206, +1.1501, +0.5924, +0.0803, -0.4396, +0.1987, +0.7395,
+0.0809, +0.3726, +0.7010, +0.4642, +0.0059, -0.8903, +0.4905,
+0.7753, +0.2928, +0.1696, +1.1438, -0.6232, -0.8458, -0.5917,
+0.8345, -1.1192, +0.4379, -0.0981, -0.6179, +1.0763, -0.1587,
-0.0143, -0.3366, +0.3584, +0.6000, -1.7890, +1.5939, +0.5541,
-0.8919, -0.3719, +0.1024, +0.0394, -0.2871, +0.1840, +0.4360,
+0.3877, +0.7105, -0.5494, -0.2323, -0.8096, -1.4210, -0.0810,
-0.4973, +0.8591, +0.3779, +0.4127, -0.1358, -1.2560, +0.0892,
+0.0455, -0.2307, +1.3972, +1.4152, -1.0996, -0.0079, +0.1609,
+0.1529, +1.2245, -0.7034, -0.0371, +1.0239, -0.1093, -1.2783,
-0.1734, -0.1558, -1.2371, +1.1509, +0.2892, +0.3994, +1.4772,
+0.2275, -0.1904, +0.1494, -0.6271, -0.2104, -0.6753, +1.2702,
-0.6296, -0.3667, +0.1936, -0.5729, +0.0596, -0.9871, -1.0458,
+0.1219, +0.0623, -1.0077, +0.3999, +0.2206, -0.6258, -0.7348,
-1.5555, -0.3696, +0.3870, +0.0152, +0.1681, -1.2091, -0.3437,
-0.8404, +0.9248, -0.1502, +0.4254, -0.5557, -0.3428, +0.3771,
-0.3366, +0.1037, +0.3911, -1.4632, +0.1639, -0.8553, +0.3079,
-0.0169, +2.2567, -1.9198, +0.3675, -0.4832, +0.4359, +0.6070,
-0.7928, -0.0742, -0.5579, -0.1285, +0.1660, -1.0886, +1.1281,
-0.2143, +0.9417, +0.3212, -0.0355, +1.6218, -0.5859, -0.1306,
-0.6681, +1.0604, -0.5643, -0.5695, -0.8043, -0.8766, -0.4868,
+0.9869, +0.9962, +0.3336, -1.1848, -0.3094, -0.3334, +0.2218,
-0.4546, -0.5356, -0.8120, -0.6476, -0.6687, -0.5322, +0.1139,
+1.3689, -0.0917, -0.0398, +0.9746
],
[
+0.4746, +0.6490, -0.0563, +0.6347, -0.1950, -0.1855, -0.0127,
-0.1160, +1.1050, +0.0292, -0.1313, +0.7417, +0.0635, +0.5027,
-0.4095, +0.5781, +0.3729, +0.1721, +0.3567, +1.1599, -0.5712,
-0.6483, -0.4589, -0.5270, +0.1732, -1.2591, +0.4863, -0.9328,
+0.0039, +0.2550, +1.4603, -0.7980, -0.3856, +0.0379, -0.2163,
+0.6541, -0.4396, +0.5536, -0.0282, -0.4969, +0.2063, -0.8435,
+0.3136, -0.6127, -0.1036, +1.1152, +0.5326, -0.6026, +0.2343,
-0.3199, -0.3462, -0.2891, +0.3153, -0.4382, +0.2658, +0.5144,
-0.1004, +0.5722, +0.6198, -0.1634, +0.6600, -0.3581, -0.5464,
-0.2069, +0.2790, -0.0548, -0.2250, +0.5619, -0.3516, +0.5768,
+0.0918, -0.0851, -0.1171, -0.4577, +0.2275, -0.0844, +0.9257,
-0.0400, -0.1302, -0.2833, -0.2913, +0.3435, -0.6581, -0.5410,
-0.1167, +0.1244, +0.9532, +0.3339, -0.1696, -1.0204, -0.8628,
+0.4471, +0.6016, -0.0928, -0.5537, +0.9510, +0.2470, -0.0080,
-0.1268, +0.7720, -0.0184, -0.3384, +0.2185, -0.8863, -0.0140,
+0.0291, -0.3500, +0.1724, +0.7346, -0.5315, +0.5823, +0.2847,
+0.1213, +0.5961, -0.5800, -0.4652, -0.7573, +0.1346, +0.0915,
-0.5366, +0.1836, +0.8365, -0.5010, +0.0161, -0.4858, +0.2502,
+0.8965, -0.2293, -0.1035, -1.1650, +1.1383, +0.0969, -1.4010,
-0.0933, +0.4967, +0.4204, -0.6597, +0.1957, +0.5147, +0.3877,
-1.0364, +1.7310, -0.7283, -0.5552, -0.9958, +0.1301, -0.2359,
-0.6026, +0.8743, -0.0038, -0.8864, -0.6011, -0.9583, -1.2237,
-0.5029, -0.0788, +0.6273, -0.1550, +0.0569, +1.0592, -1.0994,
-1.3958, +0.7132, -0.3483, +0.0321, +0.2592, +0.6079, +0.1530,
+0.8406, +0.3430, -0.0344, -0.1821, +1.5350, -0.2418, -0.5004,
-0.1613, -1.2243, +0.3113, +0.5512, -0.1078, +0.2478, -1.0035,
-0.4421, +0.2409, +0.2840, +0.0553, +0.5921, +0.5255, +0.7057,
-0.1598, +0.9546, +0.0526, +0.3708, +0.2987, -0.2607, -0.3898,
+0.6809, -0.3427, -0.6318, -0.2139, -1.0395, +0.5142, +0.3191,
-0.5015, +0.3427, -0.8764, +0.2258, -0.6226, -0.3563, -0.0095,
+0.1180, -0.0894, -0.0828, +0.4943, -0.9282, -0.6606, -0.4134,
+0.1086, -0.0555, -1.1844, +0.6912, +0.4039, -0.1119, +0.0709,
-0.0453, -0.7530, +0.0188, -0.2012, +1.1507, -0.4265, -0.1570,
-0.5780, +0.5714, +0.7797, +0.1656, -0.4177, -0.2286, +0.3263,
+0.3342, -1.0660, +0.9417, +0.0318, +0.4741, +0.0620, -0.3524,
-0.3416, -0.5109, -0.0235, +0.4831, +0.0348, +0.3290, +0.8699,
-0.1673, -0.3973, +0.4861, -0.4140
],
[
+0.9079, +0.7905, -0.8778, -0.6168, -0.6697, -0.0622, +0.7345,
-0.0286, +0.8464, -0.5082, -0.0811, +0.6639, +1.0680, +0.1035,
-0.2131, +1.1516, -0.2689, -0.6938, +0.8596, +0.0857, -0.8148,
+0.3525, -0.6048, -0.9561, -0.4924, -0.0850, +0.1967, -0.7057,
-1.1881, +0.8330, +0.2124, -0.7318, -0.1144, +0.2397, +0.3227,
+0.9644, -0.4401, -1.3300, +0.3038, +0.2791, +0.3383, +0.5044,
+0.6904, -0.6599, -0.6532, -0.6436, +0.6976, +1.3793, -0.3978,
+0.7100, -0.2195, -0.3812, +0.3690, -0.1254, -1.0735, +1.2677,
-0.2901, +0.0035, +1.6962, -0.6103, +0.6258, -0.9371, -0.7765,
+0.0440, +1.6579, +0.1763, +0.5664, +0.5588, +1.0481, +0.6091,
-0.0223, -0.9908, -0.4076, -0.2800, -0.0961, +0.1303, +0.0567,
+0.2445, +0.0284, +0.5881, +0.5713, +0.5311, -1.2043, +0.3325,
+0.7527, +0.2728, +0.7195, +1.2142, -1.3905, -1.0492, -0.4155,
-0.5728, +1.0382, -0.3996, -0.1396, +0.5156, -0.2043, -0.6742,
-0.5733, +0.2610, +0.4607, -1.3460, +0.1924, +0.3357, +0.5231,
+1.0669, -0.5209, -1.6138, -0.0863, +0.7761, -0.9102, +0.1233,
-0.9402, +1.2671, +0.4664, -1.2182, +0.2402, -0.7552, +1.8687,
+0.0714, +0.9773, +0.8177, -0.3350, -0.0919, -0.5721, -0.8396,
+1.1060, -0.1265, +0.0583, +0.4129, +0.5108, +0.2976, -0.6591,
-1.6417, +0.7939, +0.5756, -0.7724, -0.5524, +0.5851, -0.5469,
+0.1929, +1.2866, -1.1102, -0.6085, -0.2798, +0.3116, -0.3718,
-1.3797, +1.5620, -0.1876, +0.6959, -1.3734, +0.3470, -0.6543,
-0.1204, +0.8051, +1.1058, -0.2433, +1.0471, +1.3998, -0.6581,
-1.3997, -0.1491, -1.2863, -0.5144, -0.0742, -0.9420, -0.5590,
-0.8803, -0.3925, +0.3924, +1.0412, -0.6053, +1.0904, -0.7781,
+0.2669, -1.2796, -0.3787, +1.4656, +1.0314, -0.2491, -0.8925,
-0.0463, +0.6171, +0.8608, -0.3372, +0.5386, -0.9977, +0.4165,
+0.2014, +0.8115, +0.0647, -0.2797, +0.2055, +0.3337, +0.8143,
-0.1816, -0.2726, -0.7037, -0.0720, +0.0258, -0.5450, -0.6288,
+0.8187, -0.3132, -0.3859, -0.8743, -0.2493, -1.5649, +1.1263,
+0.2945, +0.3289, -0.4554, -0.1755, -0.4170, -0.8453, -0.1841,
+0.7881, +0.6946, +0.2777, +0.1883, +0.2721, -1.1722, -0.4219,
-1.4592, +0.6907, -0.6756, -0.2404, +1.1636, -0.0088, -0.4367,
+0.1144, +0.6787, +0.4052, +0.4296, -0.1470, -1.3242, +0.0790,
-0.3254, -0.5657, +0.5947, -1.4787, -0.0701, +0.9545, +0.6431,
-0.6002, -1.3457, +0.8740, +1.3852, +0.1384, -0.8537, +0.2547,
+0.7683, +0.2669, +0.5810, +0.2507
],
[
+0.7794, -0.3995, +1.0293, +0.2487, -0.1426, -0.0694, -0.4230,
+0.5372, -0.8684, -0.2010, +0.6707, -0.0952, -0.3988, +0.3726,
-0.4713, +0.8838, +0.1794, +0.0997, +0.4971, -0.0439, +0.5980,
-1.1781, +0.7389, +0.2720, +0.6640, +0.9361, +0.5272, -0.9933,
+0.5313, +0.6200, -0.5337, -0.3758, +0.7092, +0.3955, -0.5755,
+0.4248, +0.1049, -0.1665, -1.3629, -0.8256, +0.1741, -0.4460,
-0.0687, +0.2652, +0.0616, -0.3573, -0.3689, +0.2120, -0.3601,
+0.0945, -0.3972, +0.6231, -0.9564, +0.0331, -0.0692, +0.8024,
+0.8491, -0.4224, +0.2185, -1.0869, +1.0811, -0.4962, +0.2517,
+0.6918, -0.9458, -0.8809, -0.0807, +0.8267, -0.8325, -0.6024,
-0.6169, -0.4712, -0.5702, +0.5511, +0.6871, -0.2050, +0.3387,
+0.5156, +0.0601, -0.5919, -0.0874, -0.2232, -0.5864, +0.5779,
-0.9416, -0.1933, -0.1205, -0.3783, -0.1681, +0.7948, +0.5512,
-0.8296, -1.2560, -0.5598, -0.7089, +0.5243, -1.2546, +0.0505,
+0.0337, -0.0770, +0.5568, +0.8405, -0.3165, +0.1296, +0.0145,
+0.1948, +0.3414, -1.0293, -0.3926, +0.3601, +0.5924, -0.0225,
+0.2293, +0.5509, -0.4721, +1.0890, +0.0656, -0.8053, -0.4318,
-0.2686, -0.3589, +0.3525, -1.6364, +0.1975, -1.2318, -0.0322,
-0.0529, -0.1288, -0.5292, +0.8793, -0.3240, +0.4082, +0.8765,
-0.1184, -0.2652, +0.4349, -0.1954, -0.9002, -0.1542, +0.1900,
-0.3657, +0.6107, -1.3319, +0.3832, -0.7073, -1.0964, +0.0979,
-0.0593, +0.2025, -0.7053, +0.8264, -0.5835, +1.0835, -0.2843,
-0.0467, -0.2718, -0.8686, -0.9170, +0.2143, -0.2596, -0.3218,
+0.2698, -1.1382, -0.3152, +1.2738, +0.4709, -0.4124, -0.0938,
-0.1260, +0.1779, -0.1146, +0.5035, +0.1219, -0.5944, -0.7660,
-0.0158, -0.6721, -0.4598, +0.3024, -0.6472, +0.2719, -0.3481,
+0.1938, +0.5082, -0.1786, +0.6289, -0.1406, -0.4831, +0.0925,
+1.3774, +0.2169, +0.6540, +0.5974, -0.2561, -0.3918, +0.2433,
+0.4119, -0.4269, +0.6912, +0.1498, -0.2791, +0.2986, -0.7919,
+0.4985, +0.1458, +1.0800, -0.0015, -0.1555, -1.0081, +0.1507,
-0.8582, -0.0885, +0.1456, +0.2427, -0.3740, +0.2295, -0.6934,
-0.6045, -0.3527, +0.7148, +0.3243, -0.5983, -1.0345, +0.2636,
-0.5150, +0.2554, +0.7108, -0.3012, -0.5825, +0.9396, -0.3506,
+0.6580, +0.3133, -1.0601, +0.0265, +1.2558, -0.8227, -0.6875,
+0.5125, +0.3614, +0.3186, +0.3714, +0.1321, +0.2640, -0.3857,
+0.2002, -0.0581, -0.1428, -0.3079, -0.1789, -0.2079, -0.4076,
-0.3201, +0.6586, +0.1977, +0.3799
],
[
+1.0152, -0.4272, +1.5968, +0.6085, +0.0382, -0.0320, -0.1601,
+0.2294, -0.5811, +0.3067, +0.3063, +0.5515, -0.1223, -0.7526,
+0.2072, -0.4560, +0.1842, +0.0665, +0.0936, -0.3308, +0.1486,
+0.1245, -0.2952, -0.3373, +0.5287, +0.2801, -0.3682, -0.2865,
+0.1819, +0.0894, +0.2098, -0.1739, +0.9808, -0.0154, +0.8304,
-0.1405, +0.2339, -0.4588, -0.1539, +0.2594, -0.4761, +0.4449,
-0.6506, -0.9120, +0.9332, +0.3959, +0.5257, -0.2585, -0.0116,
-0.0331, -0.5957, -0.3119, -0.1755, -0.3625, -0.0883, +0.1531,
+0.5778, +0.2146, +0.9642, +1.1435, +0.5163, -0.1991, -0.8677,
+0.8288, -0.2488, +0.6972, +0.2705, -0.1435, +0.0735, +0.8515,
-0.5041, +0.1183, +0.8504, +0.2412, +0.5877, -0.1952, -0.8772,
+0.5466, -0.3558, -0.9457, +1.2632, -0.7621, -0.0547, -0.1342,
+0.0964, -0.5433, -0.4726, +0.0467, -0.2131, -0.2369, -0.2428,
-0.9630, -0.4432, -0.0143, -0.2546, -0.0641, +0.5841, -0.7195,
+0.0329, -0.3998, +0.1326, -0.1076, -0.0649, +0.1647, -0.0183,
+0.4472, -0.2438, -0.7648, -0.4508, -0.4282, +1.1088, +0.4030,
+0.0970, -0.3259, -1.3072, +0.0813, -1.1233, +0.6596, +1.3132,
-0.0910, -1.4535, +0.1034, -0.6101, -0.5647, -0.1968, -0.1917,
-0.3228, +0.4269, -0.0175, +0.1723, +0.7586, +0.2725, +0.2984,
+0.0471, +0.3097, +0.5126, -0.0390, -0.2827, +0.1326, -0.5409,
+0.2052, +0.1947, -1.2951, -0.1683, +0.0238, +0.0519, +0.2857,
+0.3279, -0.0465, -0.2380, +0.6940, +0.0863, +0.7705, +0.0415,
-0.1736, -0.0368, +0.0479, -0.4177, +0.6509, -0.7612, -0.4984,
-0.2082, -0.0499, -0.4223, +0.1914, -0.9028, -1.0545, +0.5095,
-0.1387, -0.3916, -1.0241, -0.2819, +0.6037, +0.5648, -0.0705,
+0.0947, +0.6769, +0.0673, +0.2948, -1.3944, -0.6531, -0.4202,
-0.1783, +0.0268, +0.0839, +0.1930, +1.2632, -0.1694, +0.1956,
+0.0704, +0.1328, +1.1654, -0.0036, -0.2800, -0.1723, +0.1906,
+0.6107, -0.7420, -0.1529, -0.0184, +0.3008, -0.3166, -0.4631,
+0.8368, +0.0610, +0.5651, +0.3451, +0.1413, +0.4791, +0.7318,
-0.4487, +0.5503, -0.1893, -0.9050, -0.0371, +1.0320, -0.2752,
-0.2402, +0.1983, +0.1691, -0.1743, +0.0262, -0.3012, -0.2686,
-0.5917, +0.4833, +0.2275, -1.0397, -0.7766, +0.1059, +0.9856,
-0.7496, +0.0454, -0.1811, -0.5061, -0.2086, +0.4762, -0.0301,
+0.3655, -0.8493, -0.3589, +0.2206, -0.1718, +0.4509, -0.6658,
-0.1114, +0.4450, +0.1507, -0.7038, +0.1654, +0.1350, -0.1161,
-0.6521, +0.4614, -0.2002, +0.7790
],
[
+0.2031, +0.3577, +0.0810, +0.3648, -0.4617, +0.3751, -0.1235,
-0.1538, +0.2726, +0.1242, -0.1705, +0.1270, +0.2021, -0.2672,
+0.0658, -0.1336, +0.1313, +0.3237, +0.4461, +0.1122, +0.1621,
-0.1401, +0.2924, +0.5848, +0.0638, -0.3302, +0.1234, +0.2454,
-0.1130, +0.1128, +0.1852, +0.0273, -0.1360, +0.1931, +0.0309,
-0.0501, +0.0395, +0.2461, +0.0056, +0.8994, +0.2007, +0.0656,
+0.1160, -0.5716, -0.3491, -0.3657, +0.3145, -0.1593, -0.1912,
-0.0888, +0.4174, +0.1221, +0.3682, +0.0124, +0.4657, +0.2084,
+0.1841, +0.1167, -0.0739, -0.2235, -0.1317, -0.1059, +0.0005,
-0.3553, +0.0478, -0.2670, -0.3048, -0.0239, -0.3234, +0.2460,
-0.1938, +0.0174, -0.1066, +0.0227, -0.0453, -0.2925, +0.2515,
-0.0553, +0.6641, +0.1934, -0.0582, -0.0747, +0.1598, -0.0864,
+0.6230, -0.2330, +0.1452, +0.0687, +0.3855, -0.0319, +0.0463,
+0.3423, -0.1462, -0.5494, -0.2447, +0.2213, +0.2288, -0.0392,
+0.1759, +0.1252, +0.2653, -0.2289, +0.2565, -0.2434, -0.3535,
-0.1131, -0.3191, +0.0205, -0.0284, +0.0183, +0.0784, -0.2673,
+0.1299, -0.0790, -0.1518, -0.0730, +0.1813, +0.3683, -0.1695,
+0.1237, +0.3745, +0.3690, -0.6881, -0.1880, +0.0629, -0.0592,
-0.0248, -0.0414, +0.4730, +0.1303, -0.0482, +0.0112, -0.1361,
+0.1190, -0.0087, +0.1654, +0.0218, +0.3632, +0.4050, +0.0237,
-0.1225, -0.0510, +0.2677, +0.1058, -0.4330, -0.2446, +0.0680,
+0.0084, -0.1428, -0.0318, -0.3880, -0.0480, +0.1241, -0.2249,
-0.0057, +0.3902, +0.0009, +0.4903, -0.0056, +0.0552, +0.0670,
+0.2352, -0.3515, +0.2444, +0.1034, +0.1594, +0.1691, +0.1958,
-0.0890, +0.4285, -0.4465, +0.2052, +0.1434, +0.0566, -0.1894,
-0.1330, +0.3394, -0.0723, -0.2799, +0.5040, +0.3874, +0.2093,
+0.1213, +0.4494, +0.0671, +0.2415, -0.0311, +0.1968, +0.1401,
+0.2103, -0.2451, +0.0012, +0.3245, -0.1060, +0.5344, -0.0518,
+0.0953, +0.1246, -0.0098, +0.0767, +0.1818, -0.2596, +0.0499,
-0.1394, +0.2061, +0.0765, -0.3988, -0.1717, -0.1285, +0.3542,
-0.0598, +0.0791, +0.2980, -0.1230, -0.0267, -0.1042, +0.0878,
+0.0063, -0.0769, -0.6503, +0.3040, +0.5716, +0.0099, +0.4971,
-0.1512, -0.1700, +0.0815, +0.3126, +0.1712, +0.2337, -0.0923,
+0.3189, +0.0818, +0.1253, +0.3160, -0.0565, +0.1453, +0.1487,
+0.1412, -0.0413, +0.1806, +0.3415, -0.2231, +0.1603, -0.0205,
+0.0133, -0.1991, -0.0934, -0.2162, +0.1570, +0.5228, +0.0982,
+0.1629, -0.0007, +0.0671, +0.6305
],
[
-0.2587, +1.4717, -1.2581, +1.1689, -0.8211, +0.7375, -0.5318,
+0.7533, +0.9086, +0.5498, +0.4367, +0.4467, +0.7623, -0.5282,
+0.1765, +0.3681, +0.5341, -0.1767, +0.1712, +0.0251, +1.2736,
+0.3875, +0.4250, +1.0980, -0.9987, -0.7445, +1.4084, -0.1555,
-0.0065, +0.7734, -0.0383, -0.7819, -0.5530, +1.3777, +0.1985,
-0.1046, +0.7596, -0.5529, -0.7634, +1.6740, +0.6101, +0.9633,
-0.5998, -0.5364, -0.5572, +0.4762, +0.6979, -0.3609, +0.1236,
+1.5710, +0.1581, +0.2865, -0.6993, +0.0855, +0.3278, +0.3518,
-0.0146, -0.6892, -1.5353, -0.0312, +0.1722, -1.0445, -0.1581,
-1.0708, +0.3866, +0.7016, -0.6134, -0.6641, +1.1412, +1.3183,
-1.6420, -0.2347, -1.0429, +0.7793, +1.1163, +0.3310, +1.1847,
+0.1195, -0.4370, +2.6725, +1.7559, -0.0730, +0.1806, +0.8852,
+0.4111, -0.0167, -1.1111, -0.2998, +0.6224, +0.8074, -0.6231,
-1.3434, -0.1981, -0.3998, +0.5584, +2.2487, +0.8766, +0.3173,
+0.1901, +0.4814, -0.2815, +0.2213, +0.1415, -0.1233, -0.8500,
+0.5884, +0.7851, +0.3084, -1.3487, +0.5780, +0.2632, +0.0860,
+0.6677, +0.4589, +0.5602, +1.3973, +0.1368, -0.5945, +0.3506,
+0.4958, +0.1421, -0.0624, -1.9660, -0.1511, +0.0767, +0.1952,
-0.7139, -0.1675, -0.2837, +0.3031, -0.8060, +0.4746, +0.9971,
+0.9237, -0.6620, -0.4858, -0.0629, +1.3183, +0.0561, -0.6683,
-0.0898, +0.8873, -0.4117, +1.0612, +0.3377, +0.6326, -0.0532,
-1.0591, +1.4041, +0.7255, +0.2089, -0.3014, +0.4921, +0.0062,
+0.3732, -0.8475, +0.6848, +0.0985, +0.3710, -0.2956, -0.4557,
-0.1119, -0.3930, -1.0178, -0.8864, -1.1830, +0.0800, -1.2098,
+0.0087, +1.1755, +0.1675, +0.9011, +0.2116, -0.6979, +0.3733,
-0.4422, +0.4411, -0.2016, +0.0778, +0.5067, +0.7934, -0.6171,
-0.3097, +1.4559, -0.1367, -0.2373, +1.1098, -0.6761, +0.6733,
+0.3182, -1.1651, -0.8602, -0.0873, -0.1958, +1.1926, -0.2270,
+0.7515, -0.0983, -0.8228, +0.4345, +1.0731, +0.5583, +0.7641,
-0.9911, -0.9689, +0.9484, -1.5987, -0.7247, +1.2311, -0.0236,
+0.3943, -0.1350, +0.3385, -1.1370, +0.0704, -1.0800, +2.6736,
-0.3049, +0.3406, +0.3617, +0.2617, -0.4761, -0.2080, -0.7092,
-1.1429, -1.1093, +0.6757, -0.7916, -1.6909, +0.1712, -1.2448,
-0.0885, -1.1596, -0.9892, +1.1010, -0.1438, -1.1564, -1.1641,
+0.8402, +0.4540, +0.3659, +0.5764, -0.6388, +1.3488, -0.1266,
-0.1939, +0.7784, -0.8709, -1.7219, +0.5963, +0.2587, +0.7790,
+0.8252, +0.2516, -0.6644, +1.2204
],
[
+0.3592, -0.5473, -0.3097, -0.1018, -0.2525, +0.2532, +0.1852,
-0.0088, +0.0655, -0.1855, +0.5385, -0.3589, +0.1838, +0.0969,
-0.2628, +0.5441, -0.5624, +0.5361, -0.0491, -0.7181, +0.1281,
+0.8338, -0.5089, +0.1088, +0.2301, +0.7786, +0.2525, -0.1566,
+0.1209, -0.0165, -0.5423, -0.0324, -0.4267, +0.1346, +0.5207,
+0.3439, +0.2450, -0.3079, +0.3215, -0.2746, -0.0576, +0.3982,
+0.2115, +0.5541, +0.0766, -0.4200, +0.3545, -0.6151, +0.3697,
-0.4220, -0.9963, -0.0358, +0.4634, -0.5239, +0.4562, +0.6207,
-0.3370, +0.2265, +0.3755, +0.3904, -0.2075, -0.2598, -0.0633,
-0.4194, +0.5470, +0.5681, +0.1983, -0.0904, +0.5055, -0.6471,
-0.0167, -0.0303, +0.2334, -0.0423, +0.2169, +0.6253, -0.6199,
+0.2927, +0.5569, +0.5446, -0.5548, -0.4428, -0.1779, -0.6061,
+0.3867, -0.0211, +0.4600, +0.3529, +0.1077, -0.4499, +0.0824,
+0.7483, -0.0086, -0.4067, +0.9282, -0.1023, -0.1676, +0.1965,
+0.3254, -0.1279, -0.1506, +0.1424, +0.1603, +0.8137, -0.3727,
-0.4988, +0.1526, -0.2360, +0.3461, -0.0394, +0.4962, +0.0610,
+0.1735, -0.0205, +0.7807, +0.1340, +0.5147, +0.0883, +0.3427,
-0.2549, +0.0896, -0.1998, +0.3312, +0.2516, -0.0669, +0.4445,
+0.1057, +0.2584, +0.0754, +0.9614, -0.2724, +0.0970, +0.3488,
-0.2546, -0.1988, -0.2053, +0.2207, -0.6095, +0.1199, -0.1256,
-0.7693, +0.0747, +0.0203, +0.1841, +0.3277, -0.0653, +0.5064,
-0.0817, +0.0032, +0.0842, -0.0084, +0.1438, +0.4430, +0.0838,
+0.4066, -0.5317, -0.4929, -0.7820, +0.6759, -0.0047, +0.0779,
+0.1832, +0.7314, -0.1949, -0.2592, -0.1778, +0.2129, -0.1953,
+0.2811, -0.3692, -0.8135, -0.1123, -0.3494, +0.3097, -0.0034,
-0.0640, +0.3743, -0.1830, +0.3457, -0.2519, +0.1464, +0.2380,
+0.9953, +0.1149, +0.2285, +0.3024, +0.1707, +0.4957, -0.0838,
+0.2673, -0.1883, +0.5624, -0.3179, +0.1476, -0.3644, -0.1482,
-0.3382, +0.5344, +0.3742, -0.2313, +0.0031, +0.3530, +0.6537,
-0.6092, -0.2391, -0.1602, -0.0471, -0.4469, -0.2055, +0.0156,
+0.4789, -0.1673, -0.4586, +0.0224, +0.6343, -0.5151, +0.5684,
-0.2783, -0.4272, +0.0596, +0.3467, -0.5315, -0.3208, +0.7246,
-0.2494, -0.5467, +0.5609, +0.6399, -0.0605, -0.4482, -0.3522,
-0.2714, +0.0103, +0.1283, -0.3618, +0.4830, +0.2682, -0.3372,
-0.9003, +0.3099, +0.5265, -0.1855, +0.3999, +0.2228, +0.2785,
+0.2410, +0.3890, +0.1071, +0.4037, +0.0730, -0.1131, -0.5232,
-0.0883, +0.4060, +0.5556, +0.8502
],
[
-0.1343, -0.2508, +0.4466, +0.1928, -1.3764, +0.5608, +0.5246,
+0.1057, -0.5098, -0.2481, +0.3235, +0.5815, +0.6031, -1.3475,
+0.3300, -0.4184, -0.6097, +0.1800, -0.2128, +0.8702, -0.3855,
+0.8850, -1.2823, +1.7465, +0.1154, +0.3326, +1.5720, +0.3796,
+0.6865, +0.3970, -0.4212, -0.6553, +1.1901, +0.1061, +0.4295,
-0.2777, +0.7180, -0.3106, -0.1774, -0.1792, -0.7945, +0.5230,
+0.3777, -1.5737, +0.5463, -1.1414, -0.3024, -0.2935, +1.6658,
+0.1355, -0.3055, +0.1280, +1.0071, +0.6983, -0.1000, +0.8603,
-0.4452, -0.0920, -0.0800, +0.4033, -1.3896, +0.3404, +0.3678,
-0.8422, +0.9925, +0.6851, -0.1356, -0.8242, +1.6621, -0.2808,
-0.1091, +0.4584, +0.2921, -0.7004, +0.8090, +0.1422, -0.8455,
-1.1053, +0.0825, +1.1285, -1.2245, -1.0105, -0.3434, -1.6341,
-0.5537, -0.8407, -0.2705, -0.1580, +1.3811, +0.7322, -0.2809,
+0.6630, +0.0622, -0.9919, -0.2476, -0.5338, -1.0355, -0.4306,
+1.2108, -0.7038, -0.8522, -0.4159, -0.4341, -0.9691, -0.4149,
+0.2669, +0.1698, +0.6613, -0.5911, -0.0239, +0.2033, -0.0434,
-0.1534, +0.0713, -0.2211, -0.6775, -0.5210, -0.7939, -0.9760,
-0.3736, +0.4148, -0.0374, -0.5101, +0.2733, +0.1276, +1.1739,
+1.0531, +0.1120, -0.2605, -0.3248, -1.3695, +0.5495, -0.3836,
-1.2904, +0.0924, +0.1732, +0.7190, -1.8944, +0.5771, -0.7028,
-1.3076, +0.3683, +1.0602, +0.9195, +0.5505, +2.1586, -0.1119,
+0.2749, +0.0851, +0.1625, -0.5860, +0.7156, +1.0821, +0.6278,
+0.6332, +1.0299, +0.7335, -0.6378, -1.1269, -1.3456, -0.3317,
+0.2087, +0.2395, -1.2800, +1.3199, +0.8713, -0.1688, +0.7461,
+2.3621, -1.8532, -1.1558, -0.8474, -0.8858, +1.1107, -0.6988,
+0.5648, +0.5592, +0.0090, +0.9274, +0.0033, -0.2176, -0.2460,
-0.4024, -0.5599, +0.1274, +0.0351, +1.7716, -1.3724, +0.2129,
-0.5534, -0.2584, -0.2184, +0.1280, +0.2762, -0.8356, -0.1989,
+0.6781, +0.7678, -0.0635, -0.8494, -0.5063, +1.4836, +0.9417,
-0.8640, -0.9373, -0.0647, -0.4305, +0.3043, -1.3472, -0.6325,
+1.0122, -0.9094, -0.3081, +0.2821, +1.9533, -0.4383, -0.0838,
-0.4351, -0.2311, +0.6239, +1.3051, +0.9572, -1.2479, +0.5177,
+0.9639, +0.3607, +1.8729, +1.3819, +0.5825, -0.5135, -1.0385,
-0.9116, -0.0064, +1.0256, -2.7996, -0.2395, +0.7472, -1.3705,
+0.2986, -0.6054, +0.6847, +0.0719, -0.8614, +0.2998, +0.1512,
-0.6667, +0.2468, +0.6496, -1.2415, +0.8087, +0.6789, -0.2141,
+1.5373, +0.1668, +0.4588, +0.7919
],
[
+0.4301, -0.0051, -0.0875, +0.3149, +0.1445, -0.2641, -0.1754,
+0.5335, -0.0157, -0.2217, -0.0377, +0.1612, -0.0294, +0.3743,
-0.2604, +0.1637, -0.1160, +0.0079, -0.0766, +0.0414, -0.0153,
+0.2402, +0.3822, -0.3192, -0.6855, -0.4405, -0.4147, +1.1371,
+0.3184, -0.1308, +0.0473, +0.4313, -0.0454, +0.1781, +0.4002,
-0.8131, -0.3910, +0.2740, -0.0340, +0.7894, -0.0778, +0.1756,
-0.0962, -0.1095, +0.3778, -0.1233, +0.3710, -0.0951, +0.1384,
-0.1220, -0.0544, -0.9435, +0.2298, -0.2771, -0.3243, +0.0912,
-0.1642, -0.0708, +0.0869, -0.1744, +0.4446, -0.0291, +0.7510,
+0.8012, -0.3125, +0.5270, +0.2996, +0.4207, +0.6451, +0.4491,
+0.4604, -0.3475, -0.6101, +0.1729, -0.4379, -0.1075, +0.1705,
-0.3692, +0.8727, -0.0143, -0.3038, -0.0700, +0.3822, +0.6457,
-0.0217, +0.5809, +0.2763, -0.2581, +0.2419, -0.4404, +0.1733,
+0.0276, +0.6988, +0.8704, +0.1141, -0.3121, +0.3798, +0.2060,
-0.1407, +0.1235, -0.3681, -0.2431, +0.6762, +0.5232, -0.5515,
+0.5500, -0.3355, -0.4603, +0.4862, -0.1196, +0.0621, +0.5295,
+0.6918, +0.2692, +0.1853, -0.0964, +1.0014, +0.3324, +0.3988,
+0.5131, +0.2976, -0.2324, +0.5504, -0.0915, +0.2536, +0.0679,
+0.2896, +0.3822, +0.2914, -0.0889, -0.2608, -0.2823, +0.2455,
-0.1054, -0.2823, -0.0489, +0.7225, -0.5020, -0.1037, +0.4323,
-0.0741, -0.3735, -0.2149, +0.1601, -0.7872, -0.9418, -0.5975,
+0.5669, -0.1317, -0.1543, -0.1119, +0.7635, -0.2892, +0.2267,
-0.2927, +0.6342, -0.7640, +0.1373, +0.2916, -0.2643, +0.2569,
-0.3059, -0.0311, -0.3020, -0.6296, +0.0174, +0.0450, +1.0147,
+0.4829, +0.5843, -0.3074, +0.4011, -0.0653, +0.1264, +0.4231,
-0.5560, +0.1051, +0.1399, +0.2078, +0.3617, +0.3190, +0.1993,
-0.2986, -0.3466, -0.4155, -0.0597, +0.3793, +0.4466, +0.3959,
-0.3023, +0.0040, -0.2326, -0.4952, +0.0890, -0.0792, +0.0179,
-0.4617, -0.3461, -0.0826, -0.1708, +0.2706, +0.5588, +0.4019,
+0.3551, -0.4609, +0.3649, -0.1232, -0.1674, -0.1038, +0.1348,
-0.0660, +0.0727, +0.7005, +0.0865, -0.1129, +0.3601, -0.0603,
-0.1414, -0.0705, -0.0303, +0.6423, +0.1803, +0.4151, +0.0681,
+0.5287, +0.5347, -0.0853, +0.9422, +1.1476, -0.0179, +0.2478,
+0.0933, +0.2639, +0.2103, +0.4472, -0.1852, -0.4093, -0.3714,
-0.3393, -0.0699, +0.7782, -0.4494, +0.5415, +0.7094, +0.1251,
+0.5135, -0.4087, -0.2527, +0.4463, -0.0505, -0.2852, -0.8556,
+0.3942, +0.0987, -0.0077, +0.5979
],
[
+0.2845, +1.0812, -0.7494, +0.7928, +0.1685, +0.1597, +0.1420,
+0.0782, +0.0160, -0.1429, -0.3610, -0.6243, -0.1857, -0.3799,
-0.1864, -0.7237, +0.1977, -0.0277, +0.2529, -0.6009, +0.1861,
+1.2845, +0.0113, -0.1965, -0.4988, +0.9524, -1.1362, +0.0979,
+0.0978, +0.5577, -0.5694, +0.1245, -0.0096, +0.2110, +0.9419,
-0.9761, -0.1216, +0.1184, +0.6906, +0.0689, -0.2717, -0.1839,
+0.4812, +0.8658, -0.3780, -0.9149, -0.1993, +0.4785, -0.4723,
-1.1146, -0.4531, -0.8288, +0.8131, +0.3287, -0.3474, +0.0937,
-0.7731, -0.3929, -0.2429, +0.2462, +0.4287, -0.2803, -0.8852,
+0.5022, +0.1806, +0.0863, -0.1661, -0.9738, +0.7656, +0.4123,
+0.0462, -0.6986, -0.6324, +0.2546, -0.1041, -0.3495, +0.3546,
-0.2854, -0.0838, +0.1096, +0.1486, +0.4535, +0.5963, +0.5115,
-1.1775, -0.0183, +0.3368, -1.0411, -0.1538, -0.1992, -0.0637,
-0.4965, +1.3624, +0.0774, -0.1885, -0.1917, -0.1281, -1.5518,
+0.0393, +0.3687, -0.2982, +0.0824, +0.6070, +0.4407, +0.4273,
+0.3254, -0.0359, +0.0932, +0.0982, -0.1779, -0.4939, +0.4630,
-0.0588, -0.0963, -0.0445, +0.0383, -0.9067, -0.4780, -0.8662,
+0.6478, +0.1210, -0.0671, -0.0488, -0.4615, +0.5291, +0.0794,
-0.3347, +0.7754, -0.1222, +0.4951, +0.1517, +0.1694, -0.6412,
-0.0738, -0.2780, -0.2456, +0.2203, +0.0484, +0.0835, +0.6804,
-0.4793, -0.8170, -0.0797, -0.3415, -0.3049, +0.1274, -0.6019,
+1.2989, -0.2131, -0.0808, -0.4516, +0.4898, -0.2154, -0.0225,
+0.0655, +0.3478, +0.0185, -0.3479, +0.4347, +0.0999, +0.0793,
-0.9525, -0.0407, -0.0925, +0.6913, +1.4525, -0.4044, +0.0837,
-0.2553, +0.4982, -0.4324, -0.1525, -0.1488, -0.6428, +0.1974,
-0.5170, +0.2185, -1.3480, -0.0615, -1.3151, +0.3056, -0.1194,
+0.2072, -0.6148, -0.5407, -0.5680, +0.2053, -0.2356, -0.1255,
+0.6072, +0.2077, +0.1942, -0.3421, -0.0024, -0.0669, -0.1494,
+0.3493, -1.0341, +0.0665, +0.3289, +0.2825, +0.0613, -0.0985,
+0.1094, +0.3992, +0.0906, -0.2558, -0.0444, -0.2922, -0.2714,
+0.0269, +0.2303, -0.8004, -0.2422, -0.1758, +0.1609, -0.1121,
+0.0069, -0.2658, -0.0016, +0.4041, -0.4815, -0.1375, -0.3767,
+0.0661, +0.6412, -0.0630, +0.7240, +0.0774, +0.4729, +0.4779,
-0.6123, -0.4901, +0.0965, +0.2687, +0.6720, -0.7838, -0.8790,
-0.5969, +0.1599, -0.0727, +0.3581, +0.2928, -0.4210, +0.1209,
+0.5134, +0.8239, -0.2588, +0.5264, +1.4808, +0.2310, -1.1862,
+1.1727, -0.0640, +0.1582, +0.3120
],
[
+0.0172, -1.1238, -0.5016, -1.1918, +0.3910, +0.1795, +0.0503,
-0.4863, +0.1703, +0.1462, -0.1386, +0.3944, -0.6998, +0.2394,
+0.3020, +0.0680, +0.0091, -0.3455, -0.7739, -0.5416, -0.1543,
+0.0340, -0.5541, -0.4612, +0.0488, -0.1452, -0.3268, -0.0772,
-0.1545, -0.3110, -0.0585, +0.0679, +0.0346, +0.0893, +0.0122,
-0.6993, +0.0531, +0.1817, +0.0834, -0.1794, -0.0571, -0.4912,
+0.0552, -0.3705, -0.1491, -0.5484, +0.3888, +0.0526, -0.1392,
-0.3859, -0.3149, +0.1368, +0.0454, -0.2472, +0.0746, -0.2081,
-0.3802, -0.2701, -0.7529, +0.5921, -0.1139, +0.5151, +0.4211,
+0.2626, -0.1105, -0.5061, -0.4920, +0.2586, -0.0108, -0.1262,
-0.0240, +0.3779, -0.7462, +0.3654, -0.3487, -0.2882, +0.2652,
+0.4255, +0.1863, +0.5477, -0.5843, -0.3706, +0.1130, -0.3929,
-0.1854, -0.3030, +0.2220, -0.0894, -0.7535, -0.7834, -0.0204,
-0.5167, -0.2607, +0.3052, +0.0319, -0.2919, -0.1374, -0.1339,
+0.2415, +0.1194, +0.1944, +0.0716, +0.6676, -0.8269, -0.0466,
+0.1289, +0.1831, +0.3119, +0.3629, -0.5299, -0.0872, +0.3453,
+0.2217, -0.4897, -0.2563, -0.1342, -0.0896, +0.2592, -0.4204,
-0.0450, -0.6944, +0.0078, +0.0787, +0.0199, +0.4863, +0.1886,
+0.3215, -0.2611, -0.1486, +0.2414, -0.1718, +0.4281, -0.6486,
-0.4176, -0.3029, +0.4823, +0.8132, +0.1277, +0.0055, +0.3228,
-0.1253, -0.3521, -0.5403, -0.1949, -0.2421, -0.2463, +0.1556,
-0.3001, +0.1514, +0.0274, -0.7368, +0.0907, +0.1133, -0.1469,
+0.1039, +0.1180, +0.2917, +0.2558, +0.0316, -0.3933, -0.4351,
+0.4973, -0.2582, -0.2405, +0.3755, -0.1156, -0.2276, +0.2097,
-1.0808, -0.8002, +0.0366, -0.0562, -0.4894, -0.0145, -0.6245,
+0.4986, +0.5006, +0.2602, -0.0508, -0.3204, +0.1924, -0.0899,
+0.3825, +0.5341, +0.7027, +0.1131, +0.1199, +0.0252, +0.0072,
+0.6830, +0.1546, +0.2466, +0.1135, +0.0015, -0.0177, -0.4254,
-0.0954, +0.0434, -0.0305, -0.1784, +0.2699, +0.2957, -0.2150,
-0.0487, -0.2437, -0.2200, +0.0523, -0.2779, -0.6089, +0.1060,
-0.2136, -0.2251, -0.3129, -0.0839, -0.2522, +0.1036, -0.2146,
-0.0584, +0.5832, -0.3026, -0.5945, +0.2099, +0.1080, +0.4115,
-0.0818, +0.2817, +0.0098, -0.3738, -0.0005, -0.2097, -0.7590,
-0.0630, +0.2055, +0.2783, -1.5297, -0.3210, -0.3086, -0.1355,
+0.0386, -0.3155, +0.1009, +0.1150, -0.3786, -0.4136, +0.4385,
-0.2626, +0.0942, +0.0446, +0.1205, -0.1513, -0.2796, +0.1553,
-0.0969, +0.0511, -0.1249, -0.2802
],
[
-0.1034, +0.2357, -0.4203, +0.1591, +0.3585, +0.1246, -0.0421,
+0.1255, -0.2100, +0.0055, -0.0512, +0.6803, -0.6657, +0.0623,
-0.0359, -0.2987, -0.6500, +0.0916, +0.1569, +0.5246, -0.2630,
+0.2165, -0.5772, +0.1229, +0.0293, -0.6651, -0.4447, +0.1485,
+0.2914, +0.3376, -0.3570, +0.1639, +0.1711, +0.2401, -0.3681,
-0.6154, -0.2828, -0.9889, +0.4287, +0.4902, -1.0063, -0.0716,
-0.2519, +0.2374, +0.0735, -0.0310, -0.0960, -0.3189, -0.0257,
-0.3756, -0.1699, -0.6484, -0.2126, -0.0991, +0.2516, +0.2817,
-0.2249, -0.5916, +0.0468, +0.1980, +0.2723, -0.2368, -0.1617,
-0.4406, -0.0696, -0.2598, -0.2409, -0.4176, -0.8485, +0.2568,
-0.1216, +0.2768, -0.3487, +0.0511, -0.1213, -0.5023, -0.3206,
-0.2718, -0.0845, -0.5767, +0.2253, +0.4208, -0.3365, -0.1327,
-0.3217, -0.6869, +0.0320, -0.2220, -0.1256, +0.0224, +0.5940,
+0.0939, +0.1967, -0.2259, -0.0278, -0.5220, -0.6105, +0.0110,
+0.0768, -0.2414, -0.0436, +0.1692, +0.1113, -0.9959, -0.0885,
-0.0330, +0.0898, -0.2107, -0.3087, -0.0716, -0.7209, -0.5470,
+0.1603, +0.0911, -0.3636, +0.2226, +0.5098, +0.0130, -1.0301,
-0.2137, -0.5319, +0.1819, +0.0335, +0.4514, -0.2537, -0.1274,
-0.2860, -0.2903, +0.1763, -0.7967, +0.1072, +0.0330, -0.0080,
-0.0305, +0.1275, -0.0920, +0.1267, -0.9726, -0.5605, -1.0906,
+0.0436, -0.1351, +0.2924, -0.0994, +0.1213, -0.0452, -0.1222,
+0.0212, -0.3013, +0.2962, +0.2039, +0.7498, +0.2355, -0.4564,
+0.0400, +0.4825, -0.2935, +0.4372, +0.6510, -0.2114, +0.4234,
+0.0511, -0.0598, -0.1777, -0.5762, -1.0183, +0.1683, -0.9535,
+0.0247, +0.0302, -0.1133, +0.2441, -0.2464, +0.3237, +0.0242,
+0.5588, -0.4974, +0.0399, -0.0217, -0.0068, +0.0193, +0.0620,
+0.6197, -0.9937, -0.0499, -0.1407, -0.1001, -1.1461, -0.3159,
-0.6738, +0.1658, +0.1644, -0.5083, -0.0085, +0.1327, +0.1629,
+0.4424, +0.0172, -0.3822, -0.0851, -0.2080, +0.3361, -0.1089,
+0.1334, +0.1965, +0.2532, -0.7738, +0.1240, +0.1797, +0.1834,
-0.7705, -0.0152, -0.7457, +0.6776, -0.2594, +0.0591, -0.0137,
+0.6278, +0.0465, -0.3670, +0.0655, -0.8144, -0.5686, +0.0183,
+0.0477, -0.0919, +0.0162, -1.1542, +0.4707, +0.2479, -0.2166,
-0.1802, +0.3401, -0.6682, -0.3063, -0.1307, +0.1714, -2.4957,
-0.1072, -0.3282, -0.7105, -0.8619, +0.3392, -0.3000, -0.1363,
-0.0181, -0.1055, +0.2948, +0.3553, +0.2409, +0.4209, +0.3848,
-0.7700, -0.5748, +0.0001, +0.3585
]])
weights_dense1_b = np.array([
-0.0562, -0.1282, -0.3753, -0.1119, -0.0136, -0.2313, -0.0345, +0.0894,
-0.0010, -0.0601, -0.0762, -0.1205, -0.1190, +0.0179, -0.0906, -0.0572,
+0.0797, -0.2050, -0.0318, -0.2306, -0.0182, -0.0847, +0.0607, -0.1987,
-0.1262, -0.1896, -0.0226, -0.0034, -0.0809, +0.0404, +0.0756, -0.1168,
-0.0733, -0.0739, +0.0161, -0.0528, +0.0067, +0.0332, -0.2382, -0.0745,
-0.0184, -0.0287, +0.1160, -0.0248, -0.1523, -0.0589, -0.3165, -0.0986,
-0.0604, -0.0633, +0.0549, -0.0209, -0.0474, -0.2358, -0.0890, -0.1201,
-0.0595, +0.1562, -0.1967, -0.0995, -0.1231, +0.0500, +0.0962, -0.1140,
+0.0393, -0.1390, -0.1273, -0.0866, +0.0868, -0.0849, -0.1148, -0.2904,
+0.0706, -0.1821, -0.1143, -0.2196, -0.0112, -0.0375, -0.1567, -0.0589,
+0.1257, +0.1125, -0.1020, +0.0818, -0.2838, -0.1653, -0.1676, -0.0244,
-0.0784, -0.0181, -0.0429, -0.0966, +0.0494, +0.0093, -0.0858, -0.0919,
-0.1196, -0.2181, +0.0292, -0.2283, -0.2595, -0.0925, -0.0134, -0.0093,
+0.0310, +0.0078, -0.0172, -0.0803, -0.0386, +0.1367, -0.1948, -0.0290,
+0.0785, -0.0464, +0.0371, -0.0128, -0.0377, -0.0724, +0.1637, -0.1972,
-0.1093, -0.1634, -0.0691, -0.0834, -0.2310, -0.2676, -0.0683, -0.0024,
-0.1401, -0.0378, -0.1633, -0.1665, -0.1098, -0.0746, -0.0684, -0.1914,
-0.1284, -0.0998, +0.0577, -0.0638, -0.0885, -0.0445, -0.0384, -0.1012,
+0.0067, -0.2128, -0.1312, +0.0526, +0.1238, +0.0742, +0.0261, +0.0444,
+0.0614, +0.1223, +0.1232, -0.1827, -0.1289, -0.0469, -0.1420, +0.0705,
-0.2220, -0.2401, -0.1121, -0.1697, -0.1621, +0.0688, +0.0688, -0.0040,
-0.0048, -0.0416, -0.1265, +0.0311, +0.0280, +0.0287, -0.1893, -0.0966,
-0.0876, -0.1778, +0.0000, +0.0074, -0.0978, -0.1932, -0.0790, +0.0037,
-0.1398, -0.1006, -0.0532, -0.1227, +0.1148, -0.1254, -0.1134, +0.1205,
-0.1588, +0.1093, -0.2470, -0.0915, -0.1715, -0.0036, -0.2943, +0.1375,
+0.1075, -0.0339, -0.0491, +0.0060, +0.0145, -0.1867, +0.0646, -0.1327,
-0.0529, -0.0830, +0.1433, -0.1924, -0.0285, -0.2420, -0.2244, -0.1451,
-0.1009, -0.1149, +0.0846, +0.0473, +0.1568, -0.0062, -0.1289, -0.2085,
+0.0600, -0.1314, -0.1569, +0.2043, -0.0302, -0.1666, +0.0473, -0.0075,
-0.2825, -0.0696, -0.2223, -0.2911, -0.0567, -0.0510, +0.0184, -0.2132,
-0.0371, +0.1715, -0.1301, -0.0310, +0.1523, -0.0142, +0.0185, -0.0030,
-0.0725, -0.1011, -0.0923, -0.1991, -0.1686, -0.1198, -0.2226, -0.1094
])
weights_dense2_w = np.array(
[[
+0.0445, +0.3258, -0.3897, -0.9250, -0.1552, +0.0457, -0.1724, -0.0763,
-1.4100, +0.1473, -0.1446, -0.3841, +0.1477, -0.0290, +0.1949, +0.3805,
-0.0565, +0.0721, +0.4733, -0.8596, +0.1278, -0.7788, +0.2252, +0.5076,
+0.3259, -0.4569, +0.0218, -1.1651, -0.6023, +0.5247, -0.0698, -0.5287,
-0.4980, -0.3742, -0.3540, +0.2404, -0.2737, -0.0001, -0.2909, -0.6940,
+0.1236, -0.4878, -0.2978, -0.0255, -0.2776, -0.0096, -0.0926, +0.3629,
+0.1967, -1.4511, +0.0184, -0.0039, -0.0859, -0.3284, +0.1288, -0.2185,
-0.4335, -0.0137, -0.4161, -0.1739, +0.1742, +0.1686, -0.7623, -0.4584,
+0.0873, -0.1496, -0.2064, -0.2601, -0.0554, +0.1165, -0.1830, +0.3370,
-0.3273, -0.0035, -0.5173, -0.4919, -0.5520, +0.4621, -0.3296, +0.2683,
-0.2363, +0.2684, +0.5559, -0.0760, -0.3864, -0.5297, -1.1667, -0.1952,
+0.1237, -0.0796, -0.2315, -0.1927, +0.0855, +0.1945, +0.2481, +0.3408,
+0.5076, +0.2756, +0.2805, +0.2590, +0.0864, +0.1665, +0.7472, +0.0074,
+0.1091, -0.7141, -0.1676, +0.0718, -0.2115, -0.1887, -0.4651, +0.3149,
+0.1988, -0.4582, -0.0331, -0.0648, +0.1369, -0.3698, +0.3056, +0.6038,
-0.4791, -0.8684, -0.3822, -0.4373, -0.3103, +0.1921, -1.2456, -0.1832
],
[
-0.1644, +0.0559, -1.1163, +0.4768, +0.0837, +0.1339, -0.7792,
-0.9042, +0.3480, -0.7278, -0.1942, -0.3883, +0.2595, +0.4492,
-0.2603, +0.2858, -0.5011, -0.4032, -0.5475, +0.4062, +0.3066,
+0.2421, +0.3979, -0.0046, -1.0351, -0.6019, +0.3501, +0.3352,
+0.4175, -0.5266, -0.6269, -0.5685, -0.3698, +0.5508, -0.4117,
-1.1622, -0.9162, +0.2534, +0.0436, -0.8803, +0.3523, +0.0850,
+0.3050, +0.8887, -0.3365, -0.3370, +0.1841, -0.4630, -1.1252,
+0.1474, -0.3641, -0.2109, -0.6057, +0.1948, +0.2263, -0.0045,
-0.0550, +0.6555, -0.3998, -0.4963, -0.5501, -0.2589, -0.4759,
-0.9856, -0.4430, -0.9262, +0.1264, -0.4759, -0.5656, +0.7274,
+0.6485, +0.7692, +0.5744, -0.1457, +0.1298, +0.1832, +0.3575,
-0.5757, -0.1918, +0.4286, -1.0246, -0.6236, +0.2141, -0.1002,
-0.3561, -0.3934, +0.7368, -0.2440, +0.1372, +0.1610, -1.0551,
-0.8087, -0.3633, -0.2956, -0.1642, -0.9371, -0.3696, -0.5521,
+0.0405, +0.0178, -0.5200, -1.3731, -1.1641, -0.9716, -0.9021,
-0.5449, -0.8470, +0.3427, -0.5285, +0.4033, +0.3367, -0.9577,
-0.3523, -0.2851, +0.7887, -0.2403, +0.0766, +0.6234, -0.4794,
+1.1367, +0.1354, -0.5252, +0.2428, -0.3933, +0.2007, +0.0248,
+0.3071, +0.0446
],
[
+0.0672, -1.0581, +0.3253, +0.3608, +0.4397, +0.4099, -0.1706,
-1.4956, +0.1242, -0.0741, -0.0724, -0.8454, +0.1054, -0.3769,
+0.0595, -0.8427, +0.1487, +0.1021, +0.0235, +0.2057, -0.3067,
+0.0910, -0.0292, -0.4893, +0.0259, +0.1918, -0.4798, -0.1641,
+0.2843, +0.6346, -0.1970, +0.4576, +0.1711, -0.7762, -0.9540,
-0.1866, -0.0695, -0.2133, -0.4258, -0.1893, -0.3393, -0.2800,
-0.4166, -0.4609, -0.1899, -0.0236, +0.1991, -0.2867, -0.3952,
+0.1985, -1.1685, -0.4137, -0.3359, -0.5354, -0.2031, +0.4196,
-0.6850, -0.1369, -0.2796, -0.5954, -0.1591, +0.0054, -0.0236,
-0.0944, +0.2996, -0.3397, +0.3878, -0.3327, -0.5361, +0.3334,
-0.5441, +0.0895, -0.6604, -0.1568, -0.4287, -0.6188, -0.4958,
-0.8847, -0.2318, +0.0979, -0.1458, +0.6555, -0.2316, -0.8410,
-0.1204, -0.5653, -0.7725, -1.4690, -0.0659, -0.6189, -0.8568,
+0.1092, -0.3853, -0.1022, -0.4768, +0.0461, -1.2451, +0.4257,
-0.3797, -0.8929, +0.0062, -0.1235, +0.7245, +0.3688, -0.4415,
-0.3380, -2.0255, -0.4822, -0.6014, -0.4930, +0.4081, -0.1571,
+0.3983, +0.1135, -0.3538, -1.1742, +0.4119, -0.2515, +0.2638,
-0.9096, -0.7660, -0.5376, +0.4075, -0.8097, +0.0791, +0.2727,
-0.1079, -0.9154
],
[
+0.3015, -0.0740, +0.4066, -0.5555, +0.5124, +0.3837, +0.2981,
-0.9054, +0.1914, -0.5646, +0.8334, -0.3740, -0.0627, +0.1642,
-0.6534, +0.6830, -0.2664, -0.8940, -0.0617, -0.0839, -0.6640,
-0.2262, +0.1927, +0.2503, -1.0157, +0.3276, +0.0375, +0.8604,
+0.0385, -0.0106, -0.1545, +0.6813, +0.5188, +0.0947, +0.0471,
+0.9269, +0.8989, -0.2302, -1.3604, -0.2539, +0.5975, -0.2451,
+0.3136, -0.6545, -0.5904, +0.6794, -0.7342, -0.2178, -1.0867,
+0.3340, -1.2048, -0.2076, -0.0349, +0.1764, -0.1004, -0.1311,
-0.2428, +0.4325, +0.1302, +0.0019, -0.0881, +0.3566, +0.0503,
-0.0759, +0.0366, -1.0691, +0.1273, -0.2615, -0.0779, +0.6359,
-0.6128, -0.4660, -0.3794, +0.1681, -0.3744, +0.0897, +0.3767,
+0.3950, +0.6027, +0.6578, -0.2572, -0.3049, -0.5333, -0.4376,
-1.8317, -0.9671, -0.4943, -0.3099, +0.2941, +0.1555, +0.3129,
-0.3870, -1.6067, +0.1901, +0.3682, -0.2147, -0.4661, +0.3253,
+0.0028, -0.9932, -0.7515, +0.3019, -0.3932, -0.1185, -0.1441,
+0.5607, -1.2272, -0.1169, +0.1525, -0.4974, +0.4858, -0.1839,
-0.3725, -0.1979, +0.2342, -0.0696, -0.0034, +0.1385, +0.9345,
+0.6038, -0.5267, +0.1343, +0.2124, +0.3444, +0.0326, +0.3010,
+0.1535, +0.8926
],
[
-0.6132, -0.0626, +0.1836, -0.0017, +0.3117, -1.2901, +0.2260,
-0.3219, +0.0400, -0.2747, +0.2144, -0.3827, +0.3195, +0.2954,
-0.3256, -0.3032, +0.6317, +0.4147, -0.2002, -0.1467, -0.9987,
-0.5831, -0.6824, +0.0135, +0.0619, +0.0365, -1.1740, -0.5402,
+0.1055, -0.4065, +0.2682, -0.7483, -0.0056, -1.5943, -0.6814,
-0.1541, -0.1458, -2.2840, +0.6172, -0.5811, -0.0055, -0.6315,
+0.3828, -0.2704, +0.5921, -0.1200, -0.1509, -0.2821, +0.1405,
-1.3506, -0.2311, +0.0215, -0.0361, +0.0953, +0.3615, +0.3187,
-0.3967, -0.0055, -0.1907, -0.0275, +0.0199, -0.5271, +0.0952,
-0.2753, -0.1653, +0.1166, +0.0769, -0.1883, -0.6950, +0.1223,
+0.5596, +0.1561, -0.3390, +0.2991, -2.3407, +0.0940, -1.1829,
+0.1751, +0.0089, +0.2114, -0.1418, -0.0711, -0.0123, -0.9252,
+0.5315, -0.5255, -0.1498, +0.6514, +0.0192, -0.7630, -0.2391,
-0.5887, -0.2899, -0.3057, +0.4777, -0.0072, -1.2469, -0.3501,
+0.1416, -0.3820, -0.0205, -0.5110, +0.0706, -1.0889, -0.3870,
+0.1781, -1.2873, +0.1878, -0.0433, -0.7868, -0.4801, -0.0985,
-0.4878, +0.0957, +0.1303, +0.2984, +0.1435, +0.4211, +0.5997,
-0.5081, -0.3256, -0.4320, -0.9251, -0.4870, -0.7026, +0.0313,
+0.1807, +0.3195
],
[
-0.4618, -0.1217, -1.4947, +0.6432, -0.0286, -0.0113, -0.1610,
+0.3059, +0.1557, -0.3754, -0.2707, +0.1685, +0.0389, -0.3181,
+0.5652, -0.1861, -0.1956, +0.4189, +0.1113, +0.1597, -0.0383,
+0.3372, +0.2067, +0.0350, +0.3312, -0.2489, -0.4308, -0.4614,
-0.4210, +0.1451, -0.1855, -0.4838, +0.4251, +0.2819, +0.0486,
+0.2659, -0.0646, +0.3865, +0.2074, +0.0339, +0.4180, -0.0953,
+0.0472, +0.0316, -0.2890, +0.4763, +0.5133, +0.2853, -0.4433,
+0.2192, +0.3042, -0.1120, +0.0379, -0.6806, +0.0723, +0.0475,
+0.0077, -0.0484, -0.5169, +0.3545, -0.2064, +0.0259, +0.2864,
+0.0194, +0.1699, -0.0441, -0.1463, +0.1760, +0.3086, -0.4820,
-0.2502, -0.4887, +0.0559, +0.4278, +0.1996, +0.1614, +0.2339,
+0.0800, -0.6270, -0.2786, -0.4181, -0.1674, -0.2827, -0.4783,
+0.1192, -0.0594, -0.6800, -0.0548, -0.1755, -0.1158, +0.3345,
+0.2706, -0.3446, +0.0566, -0.6105, +0.1354, -0.3801, -0.0385,
-0.2697, -0.0631, -0.1239, -0.1411, +0.0484, -0.6900, -0.2176,
-0.1499, +0.0073, -0.3549, -0.4897, -0.0909, -0.0063, +0.1598,
+0.2158, -0.9459, -0.2283, +0.3218, +0.1076, +0.0235, +0.4750,
-0.1916, -0.0259, -0.3111, +0.1156, +0.0414, +0.0901, -0.2362,
+0.2898, +0.3987
],
[
+0.1194, +0.2215, -0.7395, -0.6066, -0.2603, -0.6324, +0.0280,
-0.0233, +0.2191, -0.0356, +0.1409, -0.0238, -0.3462, +0.5912,
+0.0531, -0.2901, +0.0148, +0.2699, -0.1726, -0.1041, +0.1550,
+0.3988, -0.1391, +0.0865, -0.1727, -0.0615, -0.3390, -0.2071,
+0.5588, -0.1679, -0.6875, +0.1969, -0.0317, +0.0969, +0.4025,
+0.2154, -1.1675, +0.3348, +0.3878, -0.1976, +0.4689, +0.1378,
+0.2840, +0.3174, +0.3507, +0.0292, +0.4537, +0.1683, +0.3744,
+0.0121, -0.0917, +0.0866, +0.3034, -0.5841, +0.2858, -0.6695,
-0.4560, +0.6588, +0.4572, +0.0193, +0.3867, -0.6039, -0.0019,
+0.2913, +0.0934, +0.4742, +0.0944, -0.3412, +0.3524, +0.0335,
-0.6695, +0.7083, +0.5825, -0.1013, -0.0832, +0.6263, +0.5189,
-0.3299, -0.0619, +0.2237, +0.0813, -0.0122, +0.2237, +0.9135,
+0.3399, +0.1430, -0.0912, -0.0395, +0.3444, -0.6128, -0.0136,
+0.0827, +0.2395, -0.5342, +0.0654, +0.0967, -0.1721, -0.1917,
+0.1808, -0.1465, -0.1908, +0.2995, -0.1450, +0.3075, +0.5168,
+0.7156, -0.0292, -0.2514, -0.1955, -0.4305, +0.2834, -1.6873,
+0.3317, -0.2397, -0.5233, -0.1526, -0.2658, +0.1916, -0.0949,
+0.2834, -0.1353, +0.2761, +0.3861, -0.1116, -0.7916, -0.0785,
+0.1260, -0.0051
],
[
-0.4166, -0.6567, +0.2667, +0.1786, +0.3510, -0.0422, +0.7925,
-0.0154, -0.1518, -0.0187, +0.0379, -0.1076, +0.3849, -0.2907,
+0.0690, +0.3741, +0.5237, +0.2914, -0.4741, +0.5339, +0.2658,
+0.3419, +0.6672, -0.0275, +0.1312, +0.2843, +0.5785, -0.5382,
-0.9244, +0.3275, +0.1660, +0.0649, -0.0301, -0.7872, +0.3756,
+0.3165, -1.1756, -0.3764, +0.3109, -0.2525, -0.1304, +0.1871,
-0.3203, +0.7052, -0.1682, -0.2009, +0.1683, +0.3273, +1.6270,
+0.2042, +0.1354, -0.2825, +0.1715, -1.6118, +0.1005, -0.0738,
-0.1032, +0.3228, +0.2159, -0.3190, -0.5356, +0.3108, +0.0485,
+0.4706, +0.3739, -1.1787, +0.3236, -0.6023, +0.1504, +0.1740,
+0.2444, -0.3717, -1.2288, -0.2562, -0.0348, -0.0171, -0.5948,
-0.9390, +0.0392, -0.7069, -0.2203, +0.3624, -0.2812, -0.2286,
-0.0412, +0.0528, -0.3069, -0.0803, -1.6197, +0.8269, +0.1908,
+0.8159, +0.3059, +0.1064, -0.5850, +0.4684, +0.2937, -0.0045,
-0.1077, -0.7226, -0.0540, -1.5225, -0.2574, +0.8567, +0.1914,
+0.6329, -0.5773, +0.0707, -0.4777, +0.0377, -0.0070, -0.1626,
-0.5968, -0.2404, -1.2759, -0.2537, +0.1132, -0.1214, -0.9898,
-0.2443, -0.6741, -0.6288, +0.1556, -0.3358, +0.1861, -0.5565,
+0.7699, -0.1238
],
[
-0.9355, +0.9826, +0.1094, +0.6101, +0.5008, -0.0418, +0.3574,
-0.4915, -1.0313, -0.2750, +0.4640, +0.1685, +0.1614, -0.5493,
-0.0395, +0.0826, -0.4272, -0.2077, +0.7788, -0.4189, +0.0903,
-0.4165, -0.1848, +0.0345, -0.3355, +0.0290, -0.2494, +0.2498,
+0.2195, -0.3544, +0.3827, +0.5353, +0.3030, -0.3058, +0.1684,
+0.0712, +0.1870, +0.0772, -0.6504, +0.1901, +0.1617, -0.0998,
-0.1492, -0.5738, +0.2446, +0.0092, -0.5506, -0.2370, +0.1765,
-0.1482, +0.5713, +0.0210, +0.0355, +0.1140, -0.7140, -0.0040,
+0.4767, +0.2202, -0.3633, +0.1525, -0.1511, +0.5307, +0.5185,
+0.3934, -0.1424, +0.4631, -0.3201, -1.2858, -0.0077, -0.1245,
-0.0614, -0.4914, -0.4229, +0.3751, +0.0951, -0.4626, +0.0338,
+0.0951, -0.1898, -0.0954, -0.0744, -0.5868, +0.3834, -0.8412,
+0.3414, -0.4893, +0.2224, -0.6829, -0.2101, -0.4551, +0.6793,
+0.1760, -0.4434, +0.3216, +0.1542, +0.0045, +0.4077, -0.4215,
-0.2623, +0.0514, +0.0329, -0.1839, -0.4462, -0.2559, -0.1739,
-0.0286, +0.0429, -0.7608, -0.4764, -0.1833, +0.2059, -0.9402,
-0.3059, -0.0848, -0.3453, -0.3135, +0.1000, -0.0187, +0.7457,
-0.8470, +0.1928, +0.4921, -0.1373, +0.4402, +0.4008, -0.3943,
-0.1944, +0.1398
],
[
+0.1872, +0.9816, +0.0851, +0.1390, -0.8130, -0.1898, -0.3910,
+0.3106, -0.2167, +0.6273, +0.5541, -0.0014, +0.2877, -0.1589,
-0.2232, -0.1208, -0.2884, -0.9505, +0.4753, -1.7450, -0.3683,
-0.7012, +0.1969, -0.5218, -0.1690, +0.4793, -0.4462, +0.0265,
-0.2971, -0.0282, +0.3979, -0.7204, +0.0335, -0.6340, -0.4683,
+0.4272, -0.7263, -0.4165, +0.1131, -0.1232, -0.0161, -0.5044,
-0.3839, +0.0541, +0.5817, -0.2580, -1.3879, -0.1213, +0.3584,
+0.0509, -1.0074, -0.0474, -0.3855, +0.2602, -0.3497, -0.5726,
+0.5644, -0.1663, +0.3701, -0.5592, -1.5091, -0.3567, +0.4544,
+0.6069, -0.8949, +0.6127, -0.7491, +0.7633, -0.4563, -0.8731,
-0.4802, +0.1802, -0.8905, +0.1056, -0.2027, +0.1881, -0.3565,
-0.2124, -0.3840, +0.0482, +0.3754, -0.6157, -0.1367, -0.1701,
-0.2833, -0.5350, -0.4995, +0.2334, -0.7944, -0.9158, +0.0448,
-2.6868, -0.0335, -0.0847, +0.4522, -0.4106, +0.1345, -0.5642,
-0.8447, +0.4460, +0.4215, -0.1796, -0.0094, -0.6337, +0.4704,
-0.6282, -0.1135, +0.8338, +0.2184, -0.1924, -0.0502, -0.1903,
+0.2182, -0.1559, -0.5885, -0.4098, -0.0150, -0.6609, +0.5288,
-0.6010, -1.1834, +0.5740, -0.5148, +0.7980, +0.5594, -0.0867,
-1.3654, +0.6106
],
[
-0.4394, +0.2310, -0.3018, -0.3480, -0.9776, -0.2720, +0.1813,
+0.3134, +0.1339, -0.0724, -0.8018, +0.1788, -1.0079, -1.1364,
-0.8186, -0.1026, +0.2480, +0.0618, -0.0769, -0.2584, +0.4019,
-0.3211, -0.1836, -0.1351, -0.4099, -0.2835, -0.5408, -0.7063,
-0.2228, +0.0479, +0.2686, -0.3299, -0.7873, +0.0996, -2.0968,
+0.4859, +0.1783, -0.5059, -0.5944, +0.1206, +0.1465, -0.1475,
-1.4468, -1.1564, -1.9459, -0.0934, +0.5490, -0.1651, +0.3982,
-0.2141, -0.4545, -0.1564, -0.1334, +0.2570, +0.0896, -0.1352,
-0.5934, +0.3121, -0.6738, +0.0189, -0.1665, -0.8223, -0.0091,
-0.4308, +0.3138, -0.5113, -0.0708, -0.2009, -0.6023, -0.4238,
-0.1099, +0.3639, -0.0279, +0.1326, -0.1242, +0.0337, +0.2367,
+0.0850, -0.0917, -1.2237, -0.6782, +0.5698, +0.1095, -0.1615,
-0.8337, +0.2228, -0.5700, +0.0232, -0.0210, -0.3978, +0.4321,
-0.0272, -0.1537, -1.2350, -0.5124, -0.3720, -0.2994, +0.2628,
+0.4213, -0.7631, -0.2937, -0.0566, -0.3422, +0.2419, +0.0051,
-0.4876, +0.2640, +0.0167, -0.4600, +0.4592, -1.0462, -0.2274,
+0.0501, -1.3160, -0.6923, +0.2786, -0.3156, -0.4447, -0.3842,
+0.7620, -0.6217, +0.1690, -1.3204, -0.2791, -0.5546, -0.0060,
-0.0596, -0.1868
],
[
-0.5495, +0.3365, -0.7584, -0.2572, -0.2659, +0.4092, +0.1424,
-0.2120, +0.3421, +0.0521, -1.4783, -0.1153, +0.3200, +0.9175,
+0.5001, -0.2805, +0.2878, +0.3383, +0.0098, -0.7964, -0.0732,
+0.0894, +0.4826, +0.5428, +0.0961, +0.0482, -0.4127, -0.4349,
+0.1313, +0.5661, -0.5111, +0.3665, -0.3487, -0.2787, -0.8896,
+0.0938, -0.5667, +0.1014, -0.1201, -1.3133, -0.5152, +0.1094,
-0.2116, -0.3066, +0.3762, +0.7020, +0.9420, +0.5691, +0.0542,
-0.7900, -0.6320, -0.1268, +0.0348, +0.6443, -0.3499, -0.1280,
+0.4221, +0.0023, -0.8830, -0.9870, +0.5297, -0.0939, +0.4132,
-0.0311, +0.5731, -0.2274, -0.6287, -1.1691, -0.2294, +0.4159,
+0.2609, -0.1928, +0.1094, +0.1801, -0.0305, +0.1778, -1.4363,
-0.5287, -0.2018, +0.7580, -0.4102, +0.2158, -0.0664, +0.1027,
-0.0060, +0.5857, +0.1354, -0.0279, +0.2287, -0.3410, +0.1904,
-1.1251, +0.3415, -0.2569, -0.6138, -1.1146, +0.0824, +0.1870,
-0.6945, -0.7618, +0.3157, +0.3979, +0.1496, +0.2627, +0.0947,
-1.2781, +0.0487, +0.3630, -0.2052, -0.7007, -0.0074, +0.3732,
+0.4000, +0.0503, -0.3131, +0.4917, -0.3112, -0.2290, -0.1998,
+0.1941, -0.7223, +0.2580, -0.3792, -0.1586, -0.4023, -0.6316,
+0.0302, +0.3170
],
[
-0.2819, -0.1824, +0.5367, -0.5343, -0.6550, +0.3470, +0.3113,
+0.3216, +0.0234, +0.2092, +0.5161, +0.4814, -0.6742, +0.1774,
-0.4262, -0.1184, -0.3862, +0.3776, -0.0454, +0.3588, +0.2280,
+0.0591, -0.5632, -0.1272, -0.5212, -0.1646, -1.0133, -0.6814,
+0.3322, +0.2075, +0.6023, -0.6443, -0.5341, -0.2680, -0.0889,
-0.2357, -0.3847, -0.0124, -0.1986, +0.2168, +0.2596, -1.5922,
+0.0155, -0.4838, -1.1318, +0.0587, -1.1597, -0.3127, +0.0851,
-0.0218, -0.1821, +0.1180, +0.0146, -0.6130, -0.2081, -0.2196,
-0.7754, -0.0791, +0.4528, +0.0908, +0.3110, +0.2869, +0.4468,
+0.1967, +0.2325, -0.2844, +0.1799, +0.1444, +0.5616, -0.7208,
+0.4001, +0.3364, +0.3572, +0.3306, -0.1394, +0.0448, +0.0176,
-0.1806, +0.0376, -0.5749, -1.4323, -0.1710, -0.1247, -1.1199,
-0.0686, +0.3875, +0.0285, -0.1925, -0.6119, -0.3564, -0.2852,
+0.5464, -0.8385, -0.3253, -0.8248, -0.3679, -0.2737, +0.4797,
-0.5317, -0.0144, +0.1526, -0.1459, -0.3113, -0.1446, -0.0265,
-0.8188, +0.3409, +0.4165, -1.6213, +0.3362, -0.1435, +0.0679,
-0.3296, -1.2932, -0.1976, +0.0025, -0.3460, -0.2282, +0.0328,
+0.0128, -0.6903, -0.2594, +0.1898, -0.3305, +0.0718, -0.1354,
+0.3221, -0.2091
],
[
+0.7015, -0.0079, +0.0603, -0.1224, -0.0905, -0.0360, +0.1416,
+0.0313, -1.2110, -0.2915, -0.9822, +0.1289, -0.5388, -0.5899,
-0.3639, +0.1049, +0.2668, -0.6067, -0.0946, +0.2901, -0.6062,
+0.1575, -0.3185, +0.1406, -0.0531, +0.0853, +0.1109, +0.2724,
-0.9222, +0.0355, +0.4736, -0.4827, -0.7927, +0.0591, -0.3695,
-0.8606, -0.3656, -0.4858, +0.0656, -0.1895, -0.5924, -0.1785,
-0.0872, +0.0163, -0.3657, -0.1144, -0.7264, -0.0708, +0.3746,
-0.4169, +0.0849, +0.2061, +0.5279, +0.4709, -0.0896, -0.5886,
-0.1939, +0.1890, -0.1501, +0.2609, +0.2305, -0.2359, -0.4166,
-1.3491, +0.2312, +0.0627, -0.3370, -0.2057, -0.2985, +0.2800,
-0.0274, -0.4590, +0.2526, -0.3559, +0.1709, +0.2335, +0.3815,
-0.6601, +0.2350, -0.5104, -0.1831, +0.2343, +0.1400, -0.5159,
-0.0107, -1.0395, -0.1054, -0.5677, +0.1986, -0.5501, -0.7590,
+0.2544, +0.2979, -0.2088, +0.0723, +0.2322, +0.3433, -0.5151,
-0.1836, -0.2278, -0.3615, -0.0833, -0.4835, +0.5434, -0.1283,
+0.0631, -0.3564, +0.1727, +0.0701, -0.1985, +0.4197, +0.8758,
+0.1505, -0.7602, -0.1722, -0.3172, -0.1665, -0.0129, +0.1756,
+0.1746, -0.6835, -0.2638, -0.3309, -0.2754, +0.2760, -0.3245,
-0.4501, +0.1531
],
[
-0.5910, +0.4678, -0.8342, +0.0698, -0.3237, -0.1614, +0.3568,
+0.3391, -0.1352, -0.9422, +0.1731, +0.0649, +0.0359, +0.0780,
-0.0588, +0.1787, -0.2640, +0.1125, +0.1091, -0.9467, -0.1841,
-0.5780, +0.2515, -0.2598, +0.0299, +0.3900, -1.1704, -0.2194,
-0.5359, -0.0265, -0.0861, +0.4115, -1.0049, -0.0218, -0.2298,
+0.0651, +0.3290, +0.3422, -0.1790, -0.2639, +0.2790, -0.0778,
-0.0189, +0.5084, -0.5000, +0.1139, +0.3918, -0.6133, +0.0850,
-0.5195, +0.6430, +0.2377, +0.4246, -0.1079, +0.0031, -0.4855,
+0.1163, +0.1400, -0.8990, +0.0836, -0.1079, -0.1238, -0.8169,
-0.7508, +0.2860, -0.1766, -0.4766, -1.9178, -0.0434, -0.1472,
-0.1214, -0.4738, -0.4151, +0.1791, +0.4102, -0.3687, -0.4524,
+0.2226, -0.1458, +0.1435, -0.0020, +0.4678, +0.4075, -1.0137,
-0.3772, +0.0394, -0.2466, -0.7199, -0.0438, -1.0581, +0.2332,
-0.7536, -0.1882, -0.8108, -0.2119, -0.3047, -0.4887, +0.2553,
-0.2199, -0.7156, +0.1906, -0.0012, +0.0211, +0.1094, -0.2721,
-0.4634, -0.2296, -0.5068, +0.1374, +0.2166, +0.4215, -0.1778,
-0.0065, +0.6533, +0.0195, -0.2174, -0.8611, -0.0556, +0.3126,
-0.1544, -1.2263, +0.0302, -0.9812, +0.2193, +0.1708, -0.1093,
-0.2972, +0.1680
],
[
+0.3990, +0.0859, -0.1240, -0.8370, -0.4172, +0.2365, -0.0056,
+0.0501, -0.1428, -0.0168, +0.0601, -0.2195, -0.3317, -0.2262,
+0.1396, +0.1408, -0.3450, -0.3909, -0.2250, -0.5431, -0.9326,
-0.5343, -0.3074, -0.1953, -0.1808, +0.2521, -0.0151, +0.0151,
+0.3445, -0.0578, -0.2371, -0.1088, -0.0111, +0.0672, -0.1129,
-0.4050, -0.0916, +0.1445, -0.0713, -0.2679, +0.1176, -0.4107,
-0.1053, -0.2070, +0.7283, +0.0182, +0.0785, -0.3302, +0.4245,
+0.6522, -0.5767, -0.0863, -1.0398, -0.1261, +0.2347, -0.5232,
+0.2685, -0.1588, -0.4723, -0.3260, -0.4737, -0.7348, -0.4172,
+0.4803, -0.4773, -0.4487, +0.7380, -0.6768, -1.1271, -0.3248,
+0.2887, -0.0650, +0.8312, +0.4609, +0.2830, +0.0250, -0.1387,
-0.1422, +0.2407, -0.1626, -0.4312, -1.1603, +0.4189, +0.0939,
-0.3531, -0.2178, +0.2811, +0.1014, +0.3626, -0.0389, +0.3537,
-0.0242, +0.9483, +0.3594, -0.0648, -0.3060, +0.1765, -0.7881,
-0.1364, -0.4580, -0.0794, -0.2943, -0.5105, -0.1794, +0.1520,
-0.1179, -0.9498, +0.0333, +0.1983, -1.0507, +0.3775, +0.1208,
+0.1412, +0.2968, +0.2580, -0.1786, +0.3944, +0.0681, -0.8295,
+0.5816, -0.1301, -0.0029, -0.4506, +0.2168, -0.1471, +0.3748,
-0.1863, -0.0625
],
[
+0.1393, -0.3440, -0.1916, -0.6145, -1.0682, -0.0085, +0.0467,
-0.0013, -0.0962, -0.3870, -0.0871, -0.3778, +0.2254, +0.1940,
+0.1934, -0.7901, -0.4800, +0.2300, -0.6122, -0.5443, -0.2042,
+0.0812, +0.2239, +0.1593, +0.1071, -0.7654, +0.3019, -0.0838,
+0.4722, -0.2109, +0.2228, -0.2398, +0.1788, -0.0798, -0.3246,
+0.0000, -0.7649, +0.0329, +0.3764, -0.2840, -0.1474, -0.0116,
+0.3365, +0.5115, +0.5601, -0.7000, -0.2180, -0.0863, +0.2020,
-0.1458, -0.9690, -0.2748, -0.3088, -0.0826, +0.2325, +0.2183,
-0.1520, -0.1366, -0.3107, +0.2733, +0.4968, -0.0895, -0.1239,
+0.2910, -0.2267, -0.1839, -0.0321, -0.4823, +0.3016, +0.3723,
+0.3944, +0.1201, +0.3839, -0.0409, -0.2140, -0.0261, -0.2642,
+0.3141, +0.6421, +0.6582, +0.2082, -0.6195, +0.2912, +0.0357,
-0.5369, +0.0784, -0.1916, -0.1177, -0.1315, -0.3553, -0.0516,
+0.8580, -0.0791, -0.8106, -0.1678, -0.1375, -0.2407, -0.3142,
-0.1501, -1.1768, -0.0442, -0.2097, -0.7157, -0.3549, +0.0532,
-0.2223, -0.4742, +0.0961, -0.3822, -0.7533, +0.0197, -0.3242,
-0.7685, -0.4098, +0.4850, +0.1301, -0.5146, -0.2493, +0.0855,
+0.0385, +0.4716, +0.4514, +0.1462, -0.0489, -0.5990, +0.2224,
-0.3817, -0.0842
],
[
-0.3052, -0.1947, -0.2996, -0.0040, -0.1721, +0.2344, -0.3913,
+0.1915, -0.0813, +0.1120, +0.4848, +0.7501, -0.1336, +0.1784,
+0.2548, +0.0553, -0.2648, +0.5434, +0.1071, -0.7360, +0.4868,
-1.9705, +0.3370, -0.4066, -0.1121, +0.2190, -0.2057, -0.1045,
-0.3884, -0.1164, -0.3860, +0.3627, +0.0852, -0.0559, -0.0288,
+0.4844, -1.2247, -0.6384, -0.3676, -0.2889, +0.1286, -0.1623,
-0.4514, -0.9095, +0.3574, -0.8860, -0.1597, -0.0322, +0.3061,
-0.0241, -0.3640, +0.1712, +0.4706, -0.4074, -0.0463, +0.4842,
-0.2766, -0.1878, +0.2203, -0.0552, -0.5473, +0.3471, -0.4691,
-0.0022, +0.0363, +0.6001, +0.3843, +0.1338, +0.5381, +0.2268,
-0.3754, +0.2853, +0.1396, -0.2906, -0.5988, +0.6063, +0.3165,
+0.3628, +0.5851, -0.8569, -0.1414, -0.2864, -0.3541, +0.5733,
+0.1381, -0.7078, +0.4508, +0.0572, -0.6422, -0.2782, +0.4011,
+0.8227, +0.1561, -0.3120, -0.1448, -0.3317, +0.3289, -0.2140,
+0.0195, +0.6493, +0.0570, -0.4285, -0.4959, +0.4498, -0.2399,
-0.8054, -0.9527, +0.1554, -0.2333, -0.7512, -0.3255, +0.0679,
+1.1837, +0.4886, +0.0729, -0.6745, -0.2946, +0.4916, +0.0207,
+0.3546, -0.4189, -0.4255, -0.6069, -0.6768, +0.1386, -0.6672,
-0.6658, -0.8829
],
[
+0.0797, -0.5054, +0.0136, +0.1980, -0.1277, +0.0739, +0.2982,
+0.1720, +0.2600, -0.4211, -0.2309, -0.4136, +0.0334, +0.0354,
+0.5589, -0.1356, -0.1200, -1.5159, -0.3698, +0.4210, -0.7663,
-0.3039, -0.2075, +0.0265, +0.2961, -0.3017, +0.5159, -0.1434,
+0.2200, +0.1586, +0.2846, -0.0269, -0.0215, +0.3860, +0.2604,
-0.5857, +0.2478, -0.0333, -0.4322, -0.7724, -1.0079, +0.0702,
+0.0804, -0.2026, +0.2561, +0.1934, +0.0800, +0.6753, -0.5215,
+0.0715, -0.1621, +0.0212, -0.6631, -0.3874, -0.5760, -0.0029,
-0.0078, +0.1267, +0.2254, -0.3903, +0.0217, +0.6639, -0.0116,
-0.3764, -0.1426, -0.6670, +0.1575, +0.1441, +0.3506, -0.3192,
+0.4579, +0.2575, -0.3044, +0.1800, -0.7823, -0.2821, +0.0089,
+0.1812, +0.2162, +0.2755, -0.0168, -0.0375, -0.0799, +0.4972,
-0.0946, -0.4242, -0.5448, -0.4950, -1.1926, +0.1192, -0.1251,
-0.3178, -0.2847, -0.2470, -0.1367, -0.4373, -0.4606, -0.2024,
+0.0416, -0.6683, +0.3778, -0.5890, +0.0598, +0.6347, -0.4389,
-0.1130, +0.8578, -0.4276, +0.4702, +0.2074, +0.2512, -0.1159,
-0.3021, +0.4248, -0.4255, -0.1036, +0.5195, -0.3745, -0.2933,
+0.5167, -0.6131, +0.5847, +0.2629, -0.5066, -0.0528, -0.5667,
+0.5172, +0.4329
],
[
-0.0319, -0.0812, +0.1893, -0.0076, +0.0408, +0.9861, +0.1532,
+0.5791, +0.4635, -0.5317, +0.0360, +0.1377, +0.4940, -0.3670,
+0.0597, -0.2673, +0.4268, +0.5371, +0.9459, +0.6026, +0.3581,
+0.5822, -0.3556, -0.2087, +0.2368, -0.6264, -0.6553, -0.3130,
-0.0068, +0.0108, +0.6198, -0.1246, +0.4941, +0.0035, +1.1518,
-0.0484, -0.3501, -0.1881, -0.5316, +0.6341, -0.0666, -0.3592,
-0.8007, +0.0054, +0.4806, +0.3872, -0.1414, -0.1555, +0.1436,
-0.9244, -0.3463, +0.3656, +0.4359, +0.3659, +0.1684, -0.0401,
-0.2197, -0.1504, +0.4222, +0.1781, -0.1574, +0.2468, +0.2445,
-1.2630, -0.2287, +0.2540, -0.0357, -0.4610, -0.3447, +0.0243,
+0.4182, -0.1686, -0.1656, +0.0064, -0.1063, +0.0522, -0.2769,
+0.4825, +0.0400, -1.8240, -1.3218, -0.3842, -0.2491, +1.1058,
+0.3958, +0.0994, +0.0235, +0.4443, -0.3370, +0.4494, -0.2813,
+0.1513, -0.7493, -0.1674, -0.8722, +0.6108, -0.2310, -0.4216,
-0.6610, +0.0855, -0.3479, -0.1705, -0.0974, +0.0694, -0.2493,
-0.0780, -0.7308, -0.0663, +0.5153, -0.0797, +0.1073, -0.5629,
+0.0242, +0.1148, -0.2580, +0.0235, -0.1664, -0.4889, +0.1834,
-0.4821, -0.4944, -0.3256, +0.0020, -1.0169, -0.7666, +0.0411,
-0.4586, +0.1203
],
[
-0.5432, -0.8020, +0.0918, -0.1605, -0.3804, -0.2535, -0.4118,
+0.3286, -0.6496, +0.3496, -0.0343, -0.3351, +0.1318, +0.3702,
+0.4219, -0.1902, +0.3082, +0.0794, -0.8055, -0.1940, -0.7841,
+0.2015, +0.4231, -0.2529, -0.1225, +0.0647, +0.1334, -0.0605,
-0.0080, +0.4599, -0.0993, +0.2709, -0.5362, +0.2351, -0.0537,
-0.3275, -0.9580, +0.1666, +0.0469, -0.1855, +0.3882, +0.2301,
-0.0206, +0.1937, -0.3547, -0.0842, +0.0262, -0.1558, -0.2253,
-0.4692, -0.0289, -0.1977, -0.3126, +0.1086, -0.3525, +0.0515,
-0.7167, -0.1288, +0.0262, -0.0331, +0.1438, -0.2140, -0.2829,
+0.0953, +0.0114, -0.5833, +0.0937, +0.3545, -0.0935, -0.2859,
+0.0646, +0.2267, -0.3251, +0.3041, +0.0245, -0.0780, -0.4906,
-0.8082, -0.0172, +0.0940, +0.1477, +0.1898, -0.0042, +0.2624,
+0.2332, +0.2750, -0.2046, +0.0405, +0.2157, +0.2673, -0.8699,
+0.0976, +0.0859, -0.1087, -1.5906, -0.7188, +0.1202, -0.0439,
+0.1963, +0.1605, +0.0621, +0.0184, -0.0679, -0.6141, +0.3824,
-0.0532, -0.1961, +0.0858, +0.1383, -0.7507, -0.2177, +0.4552,
-0.1719, +0.1524, +0.0328, +0.2659, +0.1018, +0.1842, +0.0123,
-0.5312, -0.0575, -1.0402, +0.2488, -0.0787, +0.2566, +0.2899,
-0.3392, -0.1630
],
[
-0.1194, +0.3467, -0.2206, +0.1329, +0.0768, +0.6891, +0.0714,
-0.4637, -0.5310, -0.0903, +0.4664, +0.3078, -1.2855, +0.1329,
+0.0155, +0.0817, -0.3605, -0.8722, +0.0441, +0.5491, -0.1563,
-0.8174, +0.3046, +0.1270, +0.3098, -0.0151, -0.0045, -0.9193,
-0.1783, +0.1567, +0.5533, +0.0915, -0.6435, -0.3851, -0.4275,
-0.2248, +0.7145, +0.0099, -0.0457, -0.4532, +0.1251, -0.3843,
-0.1030, -0.0806, -0.5033, +0.2596, +0.3066, -0.5329, -0.4325,
+0.1346, +0.1403, -0.5028, -0.0000, +0.0686, -0.3853, +0.1682,
-0.1527, -0.0705, +0.4857, +0.3771, +0.0472, +0.2039, -0.1899,
+0.3069, -0.3187, +0.3162, +0.2182, -0.2863, -0.5433, -0.6458,
+0.3378, +0.3192, +0.1345, +0.0484, -0.0181, -0.1583, -0.9560,
-0.3627, -0.3025, -0.2251, -0.4278, -0.3376, +0.0789, -1.0522,
+0.0469, -0.6978, +0.1622, -1.1855, +0.1655, +0.0138, -0.8016,
-0.1230, +0.5485, +0.3558, +0.3172, +0.0599, +0.1526, -0.1669,
-1.0670, -0.3345, -0.3429, -0.8567, +0.5445, +0.5922, +0.2734,
-0.0315, -0.6848, -0.3854, -0.1927, -1.1359, -0.4998, +0.1007,
-0.3175, -0.5658, +0.4406, -0.0551, +0.4072, +0.1219, -0.5193,
-0.2507, -0.8700, +0.2308, +0.4804, -0.7289, +0.1062, +0.4289,
+0.4740, +0.5733
],
[
+0.4704, +0.0984, +0.5533, -0.1550, -0.7135, +0.3362, -0.1627,
+0.3920, -0.3064, -0.9689, -0.5753, -0.5526, -0.0743, +0.3165,
-1.3096, -0.0676, -0.1110, -0.0326, -0.7468, -0.0229, -0.2737,
-0.0090, -0.3595, -0.5636, -0.0341, -0.4081, +0.2472, -0.3242,
-0.1158, -0.6365, +0.1962, +0.2294, +0.1400, +0.5869, +0.1713,
+0.0023, +0.0232, -1.2354, +0.1584, -0.1950, -0.2557, -0.0327,
+0.1266, +0.2868, +0.2143, -0.1170, +0.3738, +0.2260, +0.1861,
+0.1461, -0.4707, +0.3385, -0.5547, -0.5667, +0.1489, +0.1197,
+0.1865, +0.1954, +0.3249, -0.0711, +0.1393, -0.1540, +0.1666,
-0.0516, +0.4031, +0.3465, +0.0516, +0.3941, -0.7685, -0.3348,
-0.2972, +0.2939, +0.3497, -0.6229, +0.0615, -0.2449, +0.3241,
-0.0620, +0.1183, +0.2582, +0.0633, -0.3186, -0.0816, +0.0410,
-0.4114, -0.0251, -0.1757, +0.2182, +0.0251, +0.7628, -0.0240,
-0.0525, +0.4578, +0.0557, +0.2615, +0.2159, +0.2395, +0.1016,
+0.0726, -0.4254, -0.0181, -0.6271, -0.6427, +0.0284, +0.4687,
+0.2167, -0.8132, +0.3172, +0.4417, -0.1187, -0.5183, -0.1523,
-0.1811, -0.8048, +0.4459, +0.4368, +0.4110, -0.3081, -0.3863,
+0.3325, +0.0145, +0.0293, -0.0961, -0.6588, -0.6577, -0.3175,
+0.0458, +0.1852
],
[
-0.3244, +0.3453, +0.4659, +0.1278, +0.0263, +0.3692, -0.1322,
+0.5408, +0.0223, -0.4064, -0.0329, +0.0427, +0.0518, +0.1526,
-0.6745, -0.6814, -0.2794, +0.0076, +0.4716, +0.0989, +0.2801,
+0.4726, +0.8755, -0.0468, -0.1572, +0.0386, -0.0018, +0.0436,
-0.7961, +0.5156, -0.0432, +0.3131, +0.1239, +0.4978, +0.0452,
-0.0287, -0.5577, +0.0747, +0.1409, +0.2401, +0.2333, +0.2038,
+0.0243, -1.4126, -0.0031, -0.5302, +0.1366, +0.4580, -0.9463,
+0.2064, -0.1316, -0.4320, -0.2185, +0.0589, +0.0850, -0.0792,
+0.1943, -0.2924, -0.1323, -0.2118, -0.4611, +0.4587, +0.0022,
+0.1149, -0.3412, +0.5380, +0.1929, +0.1675, -0.0647, -0.0765,
-0.4030, -0.8584, -0.1539, -0.0367, -0.5127, +0.1979, +0.0682,
-0.4566, -0.0323, -0.1059, -0.0351, -0.2856, -0.0800, -1.1048,
+0.1813, -1.0385, -0.2560, -0.5610, -0.8361, +0.7297, +0.3240,
+0.2591, -0.0883, +0.3069, -0.7018, -0.4564, -0.0893, -0.0577,
-0.3922, -0.2135, -0.0295, -0.2734, +0.2407, -0.5047, -0.1526,
-0.2218, +0.1511, -0.4272, -0.0752, +0.0014, +0.1558, -0.0979,
+0.2299, -0.4949, +0.0825, +0.2803, +0.2763, +0.3299, -1.4277,
-0.1536, +0.6685, -0.6775, -0.4354, -0.0490, +0.1724, +0.4184,
-0.9353, +0.0334
],
[
-0.0237, +0.1151, +0.3952, +0.0888, +0.2637, +0.0448, +0.0319,
-0.0838, +0.2934, +0.6864, -0.3903, +0.1003, -0.1447, -0.2490,
-0.1426, +0.3537, +0.0199, -0.1132, -0.2192, -0.2704, +0.0392,
+0.3247, -0.2443, +0.2803, -0.0727, +0.0282, -0.6015, +0.3304,
-0.1920, +0.1517, -0.0807, -0.3249, +0.2810, -0.1769, +0.1114,
-0.2788, +0.1025, +0.1887, +0.3154, -0.1968, +0.2691, -0.5229,
+0.2975, +0.2208, -0.6344, +0.1650, -1.2574, -0.6373, -0.5196,
+0.0786, -0.2593, +0.0290, -0.0111, -0.2176, -0.4665, +0.3046,
+0.1656, +0.0257, -1.1199, -0.3922, -0.8051, +0.5381, +0.3533,
-0.8867, +0.3014, +0.0465, -0.4772, +0.7044, +0.0911, +0.4027,
-0.6977, +0.6835, -0.1308, +0.2430, +0.0300, +0.6958, -0.3284,
+0.0979, -0.2630, +0.3343, -0.0862, +0.1222, -0.0311, +0.1402,
-0.0087, -1.2493, +0.0120, +0.4401, -0.2778, -0.1811, -0.4879,
-0.0948, +0.4839, -0.0848, -1.0303, -0.0772, -1.1900, -0.2582,
-1.0577, -0.0152, -0.5970, +0.2376, +0.3681, -0.2117, -0.3704,
-0.3580, -0.1064, +0.0134, +0.1705, +0.3112, -0.2077, +0.2380,
+0.3597, -0.2131, -0.1586, -0.0093, -1.0376, -0.1940, -0.0034,
-0.0930, +0.0630, -0.6793, -0.2775, -0.1766, -1.0874, -0.0242,
+0.1328, -0.1924
],
[
-1.1468, -0.5489, +0.6413, -0.2795, +0.2465, -0.4405, -0.4913,
-0.5075, -0.4153, +0.3906, -0.6549, +0.2271, -0.6259, -0.2240,
-0.4772, -0.1406, -0.4188, -0.8288, +0.0420, -0.2326, -0.0934,
-0.2890, -0.4452, +0.0712, -0.1635, -0.1321, -0.1832, -1.8540,
-0.1445, +0.5685, -0.3540, +0.3484, -0.2176, -0.5167, -0.3536,
+0.1132, +0.3618, -0.0910, +0.4795, -0.9537, -0.3972, -0.5818,
+0.0083, -0.0556, -0.4010, +0.0754, +0.1722, -0.7388, -0.2646,
-0.2676, -0.2518, -0.1411, +0.1569, -0.6923, +0.6213, +0.4417,
-0.4442, -0.3801, +0.1185, -0.2595, -0.2257, -0.6323, +0.5424,
-0.6875, +0.0820, -0.0442, +0.0114, -0.5173, -0.7365, +0.3089,
-0.4189, +0.1188, -0.8139, +0.4656, +0.3616, -0.2981, -0.8207,
-0.1880, -0.1042, -1.0588, -1.5954, -0.1536, +0.0503, -0.9106,
-0.9322, +0.2419, -0.1794, -0.0604, +0.0307, +0.0501, -0.4008,
+0.1348, -0.6489, -0.5990, +0.1142, +0.6489, +0.0001, -0.0647,
-0.2143, -0.3874, +0.1357, -0.5418, +0.5746, +0.1351, -0.0070,
-0.6785, -0.3209, +0.5239, -0.1253, +0.1702, -0.5094, +0.0634,
+0.2103, +0.7014, -0.2335, +0.3936, -0.2217, -0.0133, -1.0560,
+0.5696, +0.2297, -0.1418, +0.0136, -0.3143, -0.5973, +0.6279,
-0.3356, -0.9309
],
[
-0.5827, -0.0787, +0.3842, +0.6057, -0.3744, -0.1667, +0.2557,
+0.5199, +0.3724, -1.0853, -0.0962, +0.1177, +0.3746, -0.3622,
-0.6888, -0.1403, -0.3840, -0.4151, +0.3217, +0.3957, -0.1144,
+0.0298, -0.0959, +0.1055, -0.0409, +0.3927, -0.2206, +0.0536,
-2.3865, -0.2262, +0.3847, -0.1112, -0.3791, +0.2793, -0.0349,
-0.3009, +0.0038, -0.3509, +0.5816, +0.2646, -0.0839, -0.9176,
-0.2282, -0.5341, -0.3662, -0.9341, -1.9107, -0.0757, -0.8490,
-0.4928, +0.3568, -0.0798, +0.5515, -0.2662, +0.1106, +0.1013,
+0.0582, +0.3810, +0.0315, -0.0477, +0.2104, -0.3271, -0.2738,
-0.8973, +0.2263, -0.5105, +0.0182, -0.4493, +0.2752, +0.4808,
+0.2276, -1.3286, -0.0032, -0.4071, +0.5225, -0.0665, +0.2638,
-0.4450, +0.0857, +0.3098, +0.1059, +0.1158, +0.2210, -0.0440,
-0.1754, -0.9768, -0.1933, -1.1677, -0.1349, +0.1467, -0.3771,
+0.3430, +0.1020, +0.0143, -0.0550, -0.9697, -0.1434, -0.3386,
-0.9714, -0.0249, +0.0532, +0.0235, -0.0579, +0.2284, +0.4151,
-0.2941, -0.4709, -0.0016, -0.0338, +0.4262, +0.4149, +0.5157,
+0.3371, -0.1495, +0.4588, -0.3911, -0.4941, +0.2330, -0.5315,
+0.0509, -0.5540, +0.1312, -0.2170, +0.0867, +0.4329, -0.0276,
+0.5138, +0.3968
],
[
+0.1998, -0.6684, +0.2405, -0.2226, +0.0870, +0.1251, -0.4833,
-0.4312, -1.0778, -0.4821, +0.4113, +0.0560, +0.6275, +0.0820,
-0.0387, +0.0599, +0.4298, -0.1943, -0.1843, -0.0708, +0.0096,
-0.7072, +0.3246, +0.6720, -0.7070, +0.2634, +0.2187, +0.3547,
+0.0874, +0.0002, -0.6501, -0.6871, -0.2653, +0.0179, -0.0689,
+0.0401, -0.2196, +0.1604, -0.3960, -0.1868, -0.1688, -0.0027,
-0.1126, -0.2441, -0.4034, -0.1133, -0.3361, -0.3621, +0.3158,
-0.7948, -0.0176, -0.1477, +0.3512, +0.3682, +0.4621, +0.0704,
+0.3446, +0.0440, -0.4264, +0.3301, -0.3714, -0.5986, -0.6574,
+0.4734, -0.0074, +0.2797, -0.4191, -0.2061, +0.5278, -0.2210,
-0.0518, +0.5543, -0.0311, +0.2562, -0.1211, -0.4534, -0.9899,
+0.4539, -0.1718, +0.2690, -0.7115, +0.1055, -0.0716, +0.1627,
-0.1308, +0.1347, +0.7711, -0.6220, -0.7527, -0.5695, +0.0804,
-0.7078, +0.0921, -0.3860, +0.4700, -0.1721, -1.0485, +0.0481,
-0.0229, +0.0861, +0.4104, +0.2938, -0.5985, +0.6484, -0.0059,
-0.4095, +0.2968, +0.1489, +0.0121, -0.7843, -0.5046, -0.3111,
-0.1684, +0.0097, +0.5670, -0.0855, +0.3821, -0.0115, +0.2500,
-0.1258, -0.5862, -0.0663, -0.2129, +0.2693, +0.2945, -0.2954,
+0.2243, +0.0915
],
[
+0.1491, -0.4850, +0.0809, -0.2971, +1.0399, +0.3669, -0.0123,
-0.1522, +0.1059, +0.2378, +0.2477, -0.2592, +0.3836, -0.0857,
-0.3333, -0.6129, +0.0457, -0.0590, -0.0397, +0.1242, -0.5554,
+0.0273, -0.4591, +0.5780, -0.2889, +0.3091, +0.2659, +0.4226,
+0.4354, +0.2692, +0.4760, +0.3523, +0.0599, -0.2643, +0.1443,
-0.1300, +0.0442, +0.1209, +0.1833, -0.4734, +0.1125, -0.2706,
-0.1989, +0.2754, +0.1445, +0.0215, -0.4975, -0.2346, -0.2444,
-0.5111, -0.5242, -0.4954, +0.5329, +0.0265, +0.1177, +0.2493,
-0.4953, +0.0555, +0.0568, +0.2252, -0.1676, -0.1292, +0.1785,
+0.1137, -0.0854, +0.7888, -0.0573, +0.5062, -0.0035, +0.5743,
+0.4510, +0.3742, -0.4986, +0.1980, -0.1241, -0.0968, -0.8677,
-1.0860, -0.1191, +0.2507, +0.0636, +0.3880, -0.2442, -0.1665,
+0.3182, -0.3076, -0.1607, +0.6608, -0.2604, +0.0612, -0.1349,
-0.3337, -0.8032, -0.3801, +0.1673, -0.0237, -0.0209, +0.0583,
-0.1621, -0.0147, +0.2593, +0.0167, +0.1946, -0.6068, +0.2827,
-0.5656, +0.2463, -0.0721, +0.1951, -1.2302, -0.0800, -0.5759,
-0.5164, -0.2900, -0.2080, +0.0350, +0.0602, -0.1280, -0.0347,
-0.1066, +0.2023, +0.4489, +0.6241, +0.3711, +0.5918, +0.2161,
-0.4956, +0.1668
],
[
-0.1357, -0.1698, -0.7316, +0.3652, +0.0674, -1.2720, -0.0912,
-0.5569, +0.0930, -0.0845, +0.1653, +0.0734, -0.3262, +0.0146,
-0.4687, +0.1030, +0.1811, +0.1278, +0.2951, -0.4805, +0.1283,
-0.3634, -0.1027, +0.0652, -0.3734, +0.0178, +0.0866, -0.5421,
-0.2491, -0.0326, +0.1385, -0.8705, +0.2461, -0.0332, +0.4078,
+0.1592, +0.0401, -0.7436, +0.3928, +0.1498, +0.5691, -0.3048,
+0.0986, +0.2868, -0.5354, +0.1134, +0.4664, +0.0562, +0.2706,
-0.1634, +0.3235, +0.3488, -0.0153, -0.2665, -0.0167, -0.4450,
-0.4409, +0.2170, -0.1988, -0.2794, -0.0368, -0.2582, -0.1815,
+0.0439, -0.3384, +0.4003, -0.0865, -0.5755, -0.0364, +0.1403,
+0.0383, -0.1997, -0.1938, +0.0637, +0.2091, +0.3471, +0.0495,
-0.1602, +0.2309, +0.0595, -0.2814, -0.2176, +0.4826, -0.7634,
-0.0873, -0.1180, -0.1384, +0.1120, -0.2059, -0.2466, +0.1173,
-0.3572, -0.3572, -0.2505, -0.6559, +0.1643, +0.1230, +0.2162,
-0.6531, -0.8617, +0.4565, -0.1033, +0.5384, -0.8266, -0.3981,
+0.4561, +0.2701, +0.2100, -0.1536, +0.5401, -0.2075, -0.4098,
-0.4645, +0.1560, -0.2259, -0.3549, +0.4475, -0.1320, +0.2875,
-0.7113, -0.2840, +0.1135, -0.0461, -0.5452, -0.1279, -0.1301,
+0.2210, +0.1697
],
[
+0.6435, -0.5374, +0.7059, -1.2844, +0.3331, +0.1965, -0.0462,
-0.3113, -0.5450, +0.1836, -0.8688, +0.1490, +0.1404, +0.2400,
+0.5905, +0.6755, -0.4403, -0.3344, +0.6835, -0.2276, +0.4156,
-0.0392, +0.0920, -0.4069, +0.3981, +0.4558, -0.0543, +0.1275,
+0.6342, +0.2539, -0.0430, +0.3649, +0.5104, -1.1261, -0.0370,
+0.3103, +0.3421, -0.1283, +0.4646, +0.2611, +0.3789, +0.1872,
-0.7172, -0.7900, -0.1028, -0.3773, -0.3112, +0.3605, -0.0117,
+0.4345, +0.7488, +0.1943, +0.0338, -0.3219, -0.4089, -1.0467,
+0.3920, -0.0685, -0.0742, -0.6270, +0.4976, +0.4420, +0.2313,
-0.0729, -0.0655, -0.0379, +0.0229, +0.2117, +0.2947, -0.5324,
+0.3692, -0.4863, +0.6824, -0.3295, -0.1910, -0.1978, +0.5208,
+0.4267, +0.0503, -0.2036, +0.2884, +0.2474, -0.0536, +0.1046,
-0.0932, -0.1035, +0.0076, +0.2182, +0.0644, -0.0851, -0.2564,
+0.1322, +0.2937, +0.1040, -0.3049, +1.0216, -0.9281, +0.0380,
-0.1511, +0.4697, -0.1954, -0.3933, -0.2124, -0.3136, +0.6186,
+0.4962, +0.5756, -0.1871, -0.2659, +0.1281, +0.4317, +0.7874,
-0.0278, +0.2312, -0.3561, +0.1679, -0.4217, +0.2351, +0.2232,
+0.5258, -0.0928, +0.6838, -0.7248, +0.4629, +0.2531, +0.1841,
-0.1334, -0.0406
],
[
-0.3188, -0.0379, -0.7361, +0.3839, +0.4312, +0.1416, -0.6620,
-0.1834, +0.6492, +0.2045, +0.0918, +0.2239, -0.3887, -0.4778,
-0.2293, +0.2039, +0.6022, -0.3230, -0.0367, -0.0062, +0.5820,
-0.1047, -0.0389, -0.2042, +0.1448, +0.5953, +0.2238, -0.2452,
+0.0376, +0.4239, -0.0790, -0.1298, -0.4279, +0.1278, +0.2601,
+0.6771, +0.0499, +0.9155, -0.3233, +0.1631, +0.2057, -0.2145,
+0.3982, -0.0398, -0.7616, +0.2762, -0.0642, -1.2607, -0.4831,
+0.2535, +0.3595, +0.8134, -0.6300, -0.7384, -0.5111, +0.5001,
+0.0594, +0.0364, -0.1260, -0.0926, -0.0640, -0.1960, -0.1721,
-0.5651, +0.4040, +0.2053, -0.5327, +0.1512, +0.2509, -0.1374,
-0.0726, +0.3524, -0.3582, -0.2351, -0.2557, -0.0285, -0.1707,
+0.6744, +0.2174, -0.4556, +0.2178, +0.3446, -0.3666, +0.1903,
-0.2920, +0.3549, +0.2236, -0.0646, +0.5224, -0.1073, +0.1408,
-0.1009, +0.1210, -0.1780, +0.2569, +0.5953, +0.1192, -0.0251,
+0.4589, +0.3212, +0.0774, -0.2077, +0.1941, -0.0578, -0.0650,
+0.4753, -0.4224, +0.4952, +0.1230, -0.2847, +0.1758, -0.5142,
+0.4695, -0.3469, -0.3873, +0.5217, +0.0902, +0.7590, +0.0308,
-0.2582, -0.5947, +0.0503, +0.3442, -0.3170, +0.0445, -0.2957,
+0.5019, +0.2107
],
[
+0.1048, -0.0561, -0.0525, -0.7182, +0.0354, +0.3660, -1.1555,
-1.1208, -0.5165, -0.0398, +0.0327, -0.3179, +0.0262, -0.3808,
+0.0158, +0.0145, +0.4033, +0.3654, +0.5534, +0.4138, +0.0817,
-0.1434, -0.0530, -1.4958, +0.4055, +0.2290, +0.1861, +0.3552,
+0.1662, -0.3241, +0.0854, +0.1171, +0.0808, -0.1947, -0.2937,
-0.7268, -0.7695, +0.3824, +0.5217, +0.1133, -0.4979, -0.2852,
-0.4815, -0.4886, +0.3429, -0.2525, +0.5806, -0.2051, +0.3463,
-0.5691, -0.5052, -0.4976, +0.2206, -0.7014, -0.0586, -0.2747,
-0.8545, -0.0350, -0.3665, -1.5639, +0.0383, -0.4149, +0.1876,
-0.8109, -0.4667, +0.2656, -0.0170, -0.3138, -1.2522, +0.4170,
+0.0891, -0.1986, -0.7625, -0.6820, -0.3524, +0.3081, -0.1074,
-0.5283, +0.3158, +0.0359, +0.4437, +0.1540, -0.4941, +0.1000,
-0.1309, -0.2385, -0.9683, +0.5341, -0.0965, -0.1651, -0.1631,
+0.1685, +0.1192, -0.0842, +0.5338, +0.4437, +0.0736, +0.8859,
-0.5837, -1.0810, +0.5466, -0.6217, +0.2345, -0.2710, +0.0490,
-0.3720, -0.1459, -0.1457, -0.2499, -0.9045, +0.1468, -0.4773,
+0.4526, -0.1049, +0.4992, -0.8887, +0.5294, +0.0333, +0.3291,
-0.5449, -0.8528, -0.1049, -0.1040, -2.6816, +0.3526, +0.2408,
-0.9251, +0.0610
],
[
-0.2964, -0.2083, +0.0424, +0.0505, +0.1074, +0.3514, -0.0107,
-0.5381, -0.3241, -0.3222, +0.0024, +0.6921, -0.4159, -0.4654,
+0.2284, -0.7048, -0.6569, +0.0266, -0.1426, +0.0671, -0.0949,
+0.0700, +0.5167, +0.2447, +0.2482, +0.1973, -0.1360, +0.3100,
+0.2290, +0.4399, +0.1359, +0.0125, -0.1705, -0.6492, +0.0810,
+0.2847, +0.1981, -0.2366, -1.4675, -0.1468, +0.4505, +0.2943,
-0.5034, -0.5678, -0.0262, +0.2682, +0.4964, -0.6642, -1.1591,
+0.4420, +0.2433, -0.0938, +0.2768, -0.8135, -0.9967, +0.0143,
-0.2953, +0.1051, -0.5533, +0.0041, -0.6914, -0.1544, +0.3746,
+0.3854, +0.2449, -0.2513, -0.4268, -0.3551, -0.0974, -0.5500,
+0.0167, +0.2236, +0.3164, -0.1721, +0.1192, +0.3897, -0.4358,
-0.6739, -0.4272, -0.1869, -0.3346, -0.1730, -0.5168, -0.1763,
-0.5286, -0.0470, -0.0356, +0.0258, -1.1001, +0.0107, -0.1562,
+0.2231, -1.0873, -0.3293, -0.5195, +0.5809, +0.1942, -0.1022,
-0.2603, -0.1272, +0.1439, -0.2179, +0.2000, +0.0747, -0.4566,
+0.4470, +0.3608, -0.6655, +0.1031, -0.4562, +0.2097, -0.0302,
+0.3557, -0.9670, -0.4443, +0.2522, +0.3013, -0.2915, +0.0225,
-0.1372, -0.4500, -0.2117, -0.1959, -0.0600, +0.5294, -0.1705,
-0.1156, -0.0542
],
[
-0.0208, +0.7405, -0.4383, +0.5303, +0.2675, +0.0568, -0.4659,
-0.3365, +0.4135, +0.3779, +0.1938, -0.7019, -0.2156, -0.5470,
-0.7469, +0.1874, +0.0905, -0.5753, -0.7818, -0.1834, +0.4375,
-0.2027, -0.1311, -0.1083, -0.3591, +0.3264, +0.0091, -0.6734,
+0.3241, +0.2321, -0.1777, -0.0185, +0.2118, +0.0124, +0.1134,
+0.0124, -0.4860, -0.0174, +0.3886, -0.7700, +0.1497, +0.1214,
+0.2275, +0.0411, +0.1275, -0.4150, +0.0006, +0.7057, -0.9674,
-0.3909, +0.1516, -0.4077, -0.0694, +0.3073, -0.0010, -0.1849,
+0.7372, +0.0443, -0.1081, -0.0876, -0.3725, -0.2869, -0.4462,
-0.4792, +0.3107, -0.3265, -0.1656, -0.3827, -0.1651, +0.3184,
-0.2078, +0.0350, +0.1123, +0.0150, +0.0277, +0.2372, -0.4666,
+0.1226, -0.1048, +0.2568, -0.2841, -1.0603, +0.1028, +0.3149,
+0.5520, -1.8827, -0.3189, -0.2473, +0.2472, +0.0820, -0.4540,
+0.5905, +0.3832, -0.6837, +0.2165, +0.0537, -0.2796, -0.0364,
-1.2825, -0.3029, +0.3441, -0.2498, -0.2441, -0.2514, -0.4793,
+0.2179, +0.5167, +0.6067, -0.3378, -0.1064, +0.1996, -0.5619,
-0.4490, -0.1642, -0.1905, +0.0808, +0.2745, -0.2686, +0.1887,
-0.0947, -0.5427, +0.1202, +0.4490, -0.6860, -0.7833, +0.0671,
+0.2752, -0.7211
],
[
-0.2267, -0.4105, +0.0993, -0.8289, -0.0224, +0.0670, -0.0504,
-0.1812, -0.7614, +0.3466, -0.7155, +0.1835, -0.1513, +0.1975,
+0.0964, +0.0733, -0.1324, -0.1731, +0.5462, +0.0405, +0.4601,
+0.0706, +0.1772, -0.1179, +0.2340, +0.0641, +0.1571, -0.6174,
-1.5172, -0.0205, -0.3400, -0.1019, +0.1146, +0.2761, -0.7689,
-0.4238, -0.3081, +0.1397, -0.4290, -0.0428, +0.1390, -0.1651,
+0.0185, -0.4418, -0.0883, +0.4287, -0.5795, +0.0443, +0.0215,
+0.0641, +0.2475, +0.0211, -1.1612, -1.4932, -0.8886, +0.0467,
+0.1714, -0.2832, -0.3644, -0.0116, -0.3516, -0.5362, -0.2998,
-0.1456, -0.0855, +0.0317, +0.0449, +0.1793, +0.4453, -0.0510,
-0.3119, -0.4332, +0.1258, -0.2377, -0.0082, +0.0491, +0.7216,
+0.0419, +0.0119, +0.1955, +0.2907, -0.4195, +0.2496, +0.1890,
+0.0793, -0.3036, -0.2109, -1.3736, -0.3541, +0.1394, -0.9612,
-0.4894, -0.7474, +0.2959, -0.4060, +0.5467, -0.3859, -0.5294,
+0.2514, +0.1297, -0.4952, +0.0727, +0.5270, +0.0924, -0.4186,
+0.4920, -0.6645, +0.2551, -0.2143, -0.1432, -0.1560, +0.6847,
-0.0212, -0.8119, -0.1084, +0.0864, -0.4569, +0.1187, -0.1744,
-0.2312, -0.2499, -0.2763, -0.9371, +0.6095, +0.0696, -0.2863,
-0.3708, -0.5223
],
[
-0.0993, +0.1409, -0.1793, -0.2212, +0.4238, -0.0122, +0.6906,
+0.1833, -2.0175, +0.3794, +0.4159, +0.5124, +0.7251, +0.7544,
-0.4348, +0.1692, -0.3089, +0.7574, -0.0629, -1.1735, +0.2699,
-2.2604, -0.2160, -0.0578, -0.8138, +0.0195, +0.3376, -1.2619,
+0.3395, -0.1720, -0.6129, +0.0844, +0.3609, -0.1273, +0.2086,
+0.3600, -0.1894, -3.0401, +0.3955, -0.4007, -0.0204, -0.6748,
+0.0073, -0.8910, +0.2773, +0.1150, +0.8242, +0.7532, +0.1008,
-0.0217, -0.0444, +0.1562, +0.6075, -0.1385, +0.8037, -1.2225,
-1.0055, -0.3115, -1.3787, -0.6643, +0.3021, +0.1386, +0.2093,
-0.3072, +0.0422, +0.1009, +0.3473, +0.2925, +0.3533, +0.4157,
+0.4200, +0.2637, +0.0863, +0.4686, -1.2533, +0.3166, +0.9838,
-0.6280, +0.1329, -1.0853, -0.5044, -0.1253, +0.1313, -1.1326,
+0.1254, -0.1927, -0.1857, +0.1723, +0.0076, -1.2293, -0.2048,
+0.4640, -0.2034, -0.6014, -0.3775, -0.3859, +0.3363, -0.2945,
+0.0382, +0.5226, -0.1826, +0.6612, -0.3325, +0.1265, +0.3302,
+0.1980, -0.2690, +0.0844, -0.2510, -0.4544, -1.5446, +0.1948,
-0.1010, -0.0159, -0.1156, -0.3827, -0.1778, +0.0800, -0.8696,
+0.6485, -1.0103, -0.4169, -0.7944, +0.0499, -0.6260, -0.5471,
-0.4483, -0.5094
],
[
+0.5392, +0.1172, +0.0275, +0.1544, +1.1570, -0.3080, -0.5902,
-0.2057, -0.0664, -0.4454, +0.2383, +0.0378, +0.5122, -0.3850,
+0.3855, -1.8852, +0.1903, -0.2271, +0.1657, -0.0089, -0.7770,
-0.3977, +0.1360, -0.7773, -0.2348, +0.0727, +0.2212, -0.3639,
+0.6679, +0.2904, +0.1359, -0.2630, +0.1017, +0.3486, +0.0137,
-0.6607, +0.0223, -0.2305, +0.8595, -0.3969, -0.4659, -0.5061,
+0.0212, -0.1709, +0.0391, -0.2071, +0.4317, +0.4371, -0.2553,
+0.5389, +0.8191, +0.5738, -0.6220, -0.2034, -1.1353, -0.3365,
+0.4038, -0.3686, +0.2349, -0.6040, -0.4666, -1.0111, +0.2354,
-0.2390, -0.2813, +0.0137, -0.3303, +0.4529, -0.3076, -0.0214,
-0.3884, -0.1122, +0.7831, -1.2856, +0.2155, -0.5377, +0.2776,
-0.1138, -0.2114, +0.1813, +0.1368, -1.0741, +0.0916, +0.5912,
-0.2229, -1.0282, -0.1046, +0.4429, -0.4369, +0.2257, -0.1841,
-0.1243, -0.5969, +0.6227, +0.1674, -0.5557, +0.4748, -0.2929,
-0.7047, -0.2068, -0.1569, -0.6345, -0.1933, +0.1590, -0.2230,
-0.1560, +0.4469, -0.3296, -0.0643, -0.1517, -0.6115, -0.4458,
-0.8033, -0.7308, +0.3220, -0.2440, -0.3975, +0.9195, +0.0928,
+0.1867, +0.1243, -0.1109, -0.5436, -0.7016, +0.1229, -0.2620,
+0.0747, +0.0395
],
[
-0.0930, -0.3029, -0.8064, +0.0595, -0.0668, +0.1339, -0.0232,
+0.1940, -0.0714, -0.2307, +0.1003, +0.3736, -0.0819, -0.2503,
-0.2354, -0.0711, +0.1693, +0.0067, -0.4982, +0.3025, +0.0624,
-0.0853, -0.6454, +0.1086, +0.2843, -0.1772, -0.4409, -1.4024,
+0.3635, -0.0416, +0.0553, +0.4314, -0.6700, +0.1636, -0.3898,
+0.0493, +0.3268, -0.0700, +0.0769, -0.0717, +0.2101, -0.0093,
+0.2108, -1.5399, +0.2003, -0.4194, -0.8017, +0.1748, -0.8769,
-0.0063, +0.1513, +0.0150, -0.6772, +0.1734, +0.2375, +0.0514,
-0.1617, +0.3689, -0.5984, +0.1162, -0.1536, -0.0563, +0.2035,
-0.0057, -0.6710, +0.0289, +0.4487, +0.2953, -1.2650, -0.0297,
-0.5534, -0.6967, +0.0130, -0.1984, -0.7579, +0.5317, -0.0111,
+0.0940, -0.5060, -0.1077, -0.1284, +0.0490, -0.1276, -1.8656,
+0.3652, +0.0840, -0.1318, -0.1325, -0.3580, -0.2401, +0.0261,
+0.2243, +0.0091, +0.1637, +0.0901, +0.0508, -0.0459, -0.1134,
-0.8943, -0.1263, +0.3323, -0.0566, -0.3716, +0.2921, +0.0915,
-0.1310, -0.3878, -0.4224, -0.7798, -0.2240, -0.2051, -0.7585,
-0.5029, -0.0167, -0.1496, -0.0068, -0.1469, +0.3943, +0.3463,
-0.7880, +0.0019, +0.4755, -0.2236, -0.3436, +0.1817, -0.2543,
-0.2750, -0.6216
],
[
+0.2941, +0.5212, -0.5303, +0.2481, -0.1247, +0.2795, -1.5880,
-0.7743, +0.3191, -0.3844, +0.3387, -0.5577, -0.6174, +0.3974,
-0.4779, -0.7220, -0.0463, -0.0913, -1.3168, +0.0135, +0.1484,
-0.0498, +0.2259, +0.4178, -0.0876, -0.2693, +0.1369, +0.2502,
-0.0656, -0.5450, +0.2394, +0.7425, -0.1176, -0.6768, +0.3786,
+0.4059, -0.6969, -0.0171, +0.0904, -0.5270, -0.0360, -0.3437,
+0.4420, +0.2451, -0.6108, +0.2447, -0.9276, -0.1345, -0.4143,
+0.1865, +0.1812, +0.0931, -0.1564, -0.5130, -0.7225, -0.0157,
+0.1752, -0.4479, +0.0675, +0.5620, -0.4499, +0.3246, +0.0693,
+0.2682, +0.3500, -0.2140, -0.6988, -0.0295, -0.1263, -0.0159,
-0.2053, -0.4079, +0.4124, -0.0439, -0.4604, +0.1539, -0.0377,
+0.5189, -0.5679, +0.2178, -0.4457, -0.4877, +0.3757, +0.4720,
-0.9661, -0.1367, -0.0157, +0.4836, -0.1011, +0.1128, -0.4998,
+0.4024, +0.7681, +0.1909, -0.1169, -0.5119, -0.2230, +0.2154,
-0.1260, +0.2651, -0.7235, -0.3367, +0.0055, -0.4508, +0.4804,
-0.2347, -0.5094, -0.1651, +0.2996, -0.0992, +0.2322, +0.2990,
-0.3644, -0.6489, +0.3211, +0.3138, +0.0483, +0.0671, +0.5185,
-0.1174, +0.1915, -0.0306, -0.5184, +0.2785, -0.4954, +0.1726,
+0.6179, -0.0235
],
[
+0.2760, +0.3725, -0.0371, -0.5838, +0.2662, +0.1452, +0.3655,
+0.2378, -0.1644, -0.9611, +0.5298, -0.4268, -0.3355, +0.3852,
+0.4199, -0.3979, -0.3181, +0.3396, +0.3900, -0.5893, -0.2061,
-0.1745, +0.3943, +0.6097, -0.2366, +0.0709, -0.6992, +0.3411,
+0.4275, +0.0919, -0.0053, -0.3365, +0.4480, -0.1550, -0.8431,
+0.5171, -0.4993, +0.1273, -0.2844, -0.3381, +0.5470, -0.2013,
+0.2882, -0.9610, +0.1412, -0.0964, +0.0044, +0.0038, +0.2124,
-0.5394, -0.2606, -0.1058, +0.0822, -0.4766, -0.4265, -0.4760,
-0.0880, +0.0038, -0.3442, +0.0923, +0.0758, +0.2901, +0.0425,
+0.5120, +0.0898, +0.5336, -0.1097, -1.1518, +0.3573, +0.0061,
+0.1088, -0.5034, +0.4174, +0.2556, +0.1247, -0.1178, +0.1635,
-0.0455, +0.3008, +0.1288, -0.1310, -0.1485, +0.2552, -0.6359,
-0.0076, -0.1008, -0.3596, -0.2426, -0.2802, -0.3335, +0.0636,
+0.0919, -0.6020, -0.1037, +0.2003, -0.2811, +0.7944, +0.4460,
+0.6442, -0.0287, -0.3200, +0.4558, +0.2535, -0.2042, -0.1385,
+0.0802, -0.8761, +0.2059, +0.1495, -0.0019, -0.5408, +0.2027,
-0.4553, -0.4089, +0.0049, -0.5366, +0.1640, +0.3857, +0.3282,
-0.2697, -0.0992, +0.4844, -0.1067, -0.0197, -0.2498, +0.3069,
-0.0976, -0.7914
],
[
+0.0142, -0.0026, -0.5157, -0.4681, +0.0490, +0.1227, -0.2058,
-0.8495, +0.1658, -0.2885, +0.1190, +0.1598, +0.5551, -0.3939,
-0.6779, -0.1901, -0.6929, -0.4041, -0.0699, -0.0882, -0.0221,
+0.1317, +0.3063, +0.2556, +0.1287, -0.0917, -0.0125, -0.3015,
-0.3198, -0.1379, -0.2990, +0.3797, +0.1721, +0.5024, +0.2430,
+0.0677, +0.1688, +0.0327, -0.1941, -0.0533, -0.3133, +0.1973,
-0.2886, -0.3350, -0.0477, +0.2165, +0.3585, -0.1051, -0.1397,
-0.1625, -0.7361, -0.2345, +0.3849, -0.1586, -0.3379, +0.2672,
-0.0470, -0.1875, +0.2920, +0.2989, -0.2291, +0.6091, +0.0558,
+0.1342, -0.8134, -0.2803, -1.0841, -0.2406, -0.1681, -0.5506,
-0.2986, +0.2645, -0.0933, +0.1797, +0.0895, -0.2683, +0.4570,
-0.0242, +0.1440, -0.1492, -0.0114, -0.0047, +0.2500, +0.1609,
-0.0815, +0.5155, -0.8726, -0.3475, +0.2900, +0.2171, +0.8899,
+0.0279, -0.0639, -0.7957, -0.6067, -0.2539, +0.2562, -0.1503,
+0.2246, -0.4192, +0.2636, +0.3823, -0.0439, -0.1201, +0.7856,
-0.4672, -0.4431, -0.2572, -0.3309, +0.1956, +0.1299, -1.4765,
-0.5911, +0.2877, -0.1105, +0.0746, -0.4482, +0.5192, +0.0021,
+0.1777, -0.9104, -0.4471, -0.3169, +0.0379, +0.2301, -0.0664,
-0.3687, -0.3786
],
[
+0.1452, +0.4198, +0.0029, -0.0653, +0.1279, -0.6948, -0.1948,
-0.1250, -0.1105, -0.2747, +0.4042, +0.1690, -0.2262, +0.7211,
-0.4752, -0.4305, -0.4072, -0.2737, -0.5282, -0.8213, +0.4226,
-0.2642, -0.7944, +0.1969, -0.6681, -0.4189, +0.1181, -0.4910,
-0.2916, +0.0997, +0.0117, -0.0747, +0.1751, -0.3160, +0.2432,
+0.5472, -0.0317, -2.7381, +0.0325, +0.2137, -0.1013, +0.1664,
-0.0917, -0.9620, +0.5616, -0.2506, +0.2052, +0.2765, +0.2510,
+0.0808, -0.6145, -0.1196, -0.0933, +0.3694, +0.4940, -0.2804,
-0.2966, -0.0262, -0.8431, -0.1175, +0.0853, -0.0399, -0.0043,
+0.3427, -0.2527, +0.0856, +0.3868, +0.3824, -0.0973, +0.2683,
-0.4012, +0.2811, +0.1426, -0.0987, -0.1868, -0.1632, -0.6806,
+0.0187, -0.0480, -0.4748, +0.0284, -0.9966, +0.1995, +0.3622,
+0.4135, -0.4110, +0.1553, +0.1887, +0.1804, +0.0739, -0.1146,
+0.5380, -0.3272, -0.0136, -0.1157, +0.3098, +0.3483, -0.4912,
+0.2376, +0.3166, -0.1080, -0.2667, +0.3626, -0.0983, +0.2281,
+0.0979, +0.1868, +0.0387, +0.3307, -0.4710, -0.3623, +0.0682,
-0.0451, +0.1160, +0.8219, -0.7232, -0.0459, -0.0459, -0.3669,
-0.5020, +0.1200, +0.1164, -0.4330, -0.1329, +0.1223, +0.1938,
-0.3021, -0.0096
],
[
+0.0307, -0.1074, -0.5054, +0.1841, +0.3880, -0.4125, -0.0031,
-0.8579, +0.1511, -0.4849, +0.3685, -0.0198, -0.1758, -0.1953,
-0.0517, -0.6631, -0.2308, -1.0682, +0.0739, -0.6081, -0.0497,
+0.2496, +0.0853, +0.6000, +0.2825, +0.4384, +0.0759, -0.4724,
+0.4003, -0.3203, -0.2263, +0.3586, -0.1000, -0.6729, +0.3914,
+0.4385, -0.2797, -0.2717, -0.3915, +0.2754, -0.6234, +0.1709,
-0.5713, +0.0729, +0.0171, +0.3864, +0.1788, +0.7924, +0.4496,
+0.5952, -0.4405, +0.5408, -0.6600, -1.1460, -0.2819, -0.1166,
-0.4777, -0.2295, +0.5355, -1.2873, +0.1339, -0.2345, +0.0593,
-0.0066, +0.0373, -0.0773, +0.9912, +0.1974, -0.3827, -0.4358,
+0.2365, +0.2508, -0.2249, +0.0185, +0.0868, +0.0450, -0.0914,
-0.3509, -0.1456, +0.0433, -0.5912, -0.6836, -0.9345, +0.1830,
+0.4085, -0.5123, +0.0836, +0.2667, -0.4867, +0.1397, +0.8275,
-0.0913, -0.1340, +0.4561, +0.0949, +0.7140, -0.1231, -1.1192,
-0.7728, +0.0636, -0.8626, -0.3440, -0.0248, -0.3980, +0.2891,
+0.3982, -0.2360, +0.5865, +0.5816, -0.8450, +0.0182, -0.8395,
-0.4600, -0.0709, -0.6221, +0.3712, -0.1913, +0.3792, +0.0326,
+0.2845, +1.4206, -0.4405, +0.5666, -0.1124, -0.6945, -0.1388,
-0.4277, -0.0777
],
[
+0.1843, -0.1371, -1.4576, -0.0320, -0.2398, -0.3147, -0.8235,
-0.9139, -0.0446, +0.4619, -0.7615, -0.2812, +0.1924, -0.1018,
+0.1940, +0.3424, +0.0566, +0.2892, -0.4231, -0.6184, +0.2544,
-0.0587, +0.1673, -0.8947, -0.1791, +0.2497, -1.3585, +0.3457,
+0.1367, -0.0162, -0.2054, -0.2865, -1.2269, -0.0584, +0.2565,
+0.1843, -0.5112, +0.0977, +0.1516, -0.3964, -0.0925, -0.0725,
-0.6325, -0.0460, -0.9747, -0.2661, -0.6230, +0.4624, -0.1699,
+0.7612, -0.4710, -0.1355, -0.5187, +0.4608, -0.8770, +0.7354,
-0.3921, +0.6296, +0.5976, -0.6807, -0.4973, -0.0747, +0.2010,
-0.8008, +0.3282, -0.0850, +0.1498, -0.7899, -0.5724, +0.0551,
+0.0326, +0.8411, +0.1285, -0.2207, -0.0472, +0.1642, +0.0442,
-0.3305, +0.1524, -0.9644, -0.2065, +0.2000, +0.1004, +0.2642,
-0.5985, -0.2113, -0.2952, -0.0788, -0.1846, -0.6372, +0.4044,
-0.8786, -0.0542, +0.5890, +0.0451, -0.0903, -0.7676, +0.1204,
+0.3354, -0.4390, -0.3610, -0.3031, +0.2680, +0.0857, +0.6542,
+0.2660, -0.1265, +0.3335, -0.5802, +0.2781, -0.3541, +0.4898,
+0.1315, +0.7118, +0.0035, -0.0266, -0.3570, +0.3671, +0.0647,
-0.5382, -0.9323, -0.0421, -0.3779, -0.7472, +0.3330, -0.0476,
-0.3754, +0.0899
],
[
-0.2042, -0.0323, +0.3879, +0.5487, -1.6125, +0.4439, -0.1583,
-0.1561, +0.0041, -0.0937, +0.1418, +0.4048, -0.6339, -0.2292,
-0.4615, +0.1910, +1.1010, +0.2793, -0.1490, -0.1520, -0.4352,
-0.2968, +0.0764, -0.0107, +0.5407, +0.3415, -0.8503, -0.1676,
+0.1517, +0.2076, -0.3898, +0.0414, -0.3089, -0.4528, -0.1311,
-1.8980, +0.3833, -0.4061, +0.3816, -0.0483, +0.6989, +0.2631,
+0.0906, -0.3159, +0.4436, -0.4232, -0.1941, +0.0117, -0.5852,
-0.5719, +0.0158, +0.0229, -0.4120, -0.5200, -0.6199, +0.3683,
-0.0060, -0.2108, -1.0807, -0.6747, -0.1258, -0.5363, -0.1420,
-0.3519, -0.3312, +0.2380, -0.3571, -0.4272, -0.6733, -0.4430,
-0.0839, -0.2624, -0.9297, +0.4757, -1.1690, +0.5474, +0.3513,
+0.5209, +0.1999, -0.0798, -0.2623, +0.2463, -0.1697, -0.0553,
-0.8494, -0.0646, -0.7830, -0.1119, -0.6601, -0.0337, +0.0791,
-0.7605, -0.1590, -0.2137, +0.5531, -0.1455, -0.6184, +0.0261,
-0.2470, -0.1335, -0.0515, -1.1777, +0.5676, -0.3388, -0.9833,
-0.6877, -0.3134, +0.1848, +0.1014, +0.6343, -0.4910, +0.1301,
+0.1852, +0.5893, -0.1147, -0.1877, -0.3991, -2.2994, +0.3953,
+0.9315, -1.2463, -0.0389, -1.9675, +0.2797, -1.1813, -0.0691,
+0.0999, +0.2255
],
[
+0.0639, +0.2611, +0.0838, +0.0412, -0.7483, +0.2393, +0.0790,
-0.0965, -0.1130, +0.1024, -0.2223, -0.4675, +0.1104, -0.3107,
-0.0431, +0.4740, +0.2066, -0.2226, +0.1068, -0.1576, -0.2934,
+0.4886, -0.2895, +0.2457, -0.2344, -0.4610, -0.0189, -0.0641,
-0.6700, -0.3323, -0.3526, -0.0608, -0.2804, -0.2360, +0.2766,
-0.1703, -1.0815, -0.3406, -0.2445, -1.2578, -0.9418, +0.1628,
-0.2049, -2.1585, +0.3158, -0.4128, -0.0737, -0.3591, -0.1621,
+0.1021, -0.0658, -0.0335, -0.1421, +0.1696, -0.0457, +0.0978,
-0.1947, -0.5236, -0.2415, +0.5390, +0.0559, -0.4258, +0.0044,
+0.4105, -1.5538, -0.1270, -0.2763, +0.4124, +0.2169, -0.6059,
+0.1375, -0.5144, -0.4451, -0.5532, -0.5400, -0.6416, -0.6827,
-1.2415, -0.3844, +0.2479, -0.2285, +0.0698, -0.4980, -0.4911,
-0.2677, -0.4542, -0.4367, +0.1047, +0.4759, -0.0804, -0.3458,
+0.1239, -0.9496, +0.1120, -0.3820, -0.6315, -0.9806, +0.1917,
+0.0162, +0.2255, -0.3382, -0.2956, -0.3159, +0.1116, -0.3715,
+0.2648, -1.3455, -0.1177, -0.3607, +0.2901, -0.0607, +0.2687,
+0.2823, -0.0854, +0.1242, -0.5903, +0.3702, -0.2985, -0.8958,
-0.0392, +0.3378, -2.1146, +0.1999, -0.7328, -0.0326, +0.0213,
-0.4903, -0.6084
],
[
+0.4005, -0.3539, +0.0011, -1.1321, -0.0929, -0.1841, -0.0538,
-0.2418, -0.1983, +0.5027, -0.2828, -0.3017, +0.2616, -0.0047,
-0.4966, +0.5684, -0.3078, -0.0194, -0.0970, -0.5903, +0.0153,
-0.0594, +0.3514, +0.0435, -0.0569, -0.0351, -0.3814, -0.4379,
-0.0480, +0.2862, -0.3512, -0.3203, +0.1903, -0.0512, +0.2500,
-0.0621, -0.1596, +0.0077, -0.0288, +0.4258, +0.1465, +0.0066,
+0.3781, +0.2365, -0.2162, +0.1226, -0.2619, +0.3739, +0.4088,
+0.5015, +0.2144, -0.1472, -0.1681, +0.7557, +0.4556, -0.8190,
-0.7596, +0.0147, -0.9587, +0.3054, +0.3807, -0.2091, -0.0612,
-0.0192, -0.3241, -0.3563, +0.1805, -0.1966, +0.2087, -0.0979,
-0.2870, +0.0936, +0.4373, +0.2061, -0.8870, -0.3513, -0.3158,
-0.4968, -0.0804, +0.1094, -0.0568, -0.2142, +0.2822, +0.4175,
+0.1747, -0.4602, +0.0505, -0.0977, +0.0062, -0.5924, -1.1038,
+0.0881, -0.2514, +0.3786, -0.6522, -0.0987, +0.3761, -0.4479,
-0.2430, +0.3430, +0.0108, -0.2528, -0.2237, -0.3578, -0.4940,
-0.5558, +0.1648, -0.0010, +0.5309, +0.4639, -0.1798, +0.7006,
-0.0603, -1.2906, -0.4044, +0.2199, +0.1772, +0.3966, -0.0497,
+0.3213, +0.4042, +0.1926, +0.0290, -0.2981, -0.3246, -0.4370,
-1.1463, -0.4444
],
[
+0.3363, +0.0507, -0.2536, +0.0100, -0.0414, -0.0509, +0.0414,
-0.0734, -0.4132, -0.6428, +0.0566, -0.0504, +0.5851, +0.0472,
-0.2488, -0.9736, +0.4157, -0.4703, -0.4616, +0.1847, -0.2878,
-0.2250, -0.3208, +0.1068, -0.1276, -0.0589, -0.1503, -0.0336,
+0.1374, -0.2608, -0.3196, -0.3170, +0.3374, -0.1441, -0.2669,
-0.5909, +0.8994, +0.3808, -0.0591, +0.4503, -0.0050, +0.2127,
-0.0422, -0.5771, -0.0980, +0.0769, -0.3279, +0.1233, -1.0878,
+0.2904, +0.0990, -0.1093, +0.1928, -0.4382, +0.1245, -0.3089,
+0.1358, -0.0282, +0.2054, +0.2020, -0.0041, +0.5111, -0.1810,
-0.0360, -0.0613, +0.1710, -0.3795, +0.1224, +0.2107, +0.2086,
-0.4034, +0.3966, +0.2989, -0.2028, +0.0624, -0.4257, -0.0667,
-0.1747, +0.2471, -0.1497, +0.1393, -0.1737, +0.3902, -0.2525,
+0.2768, +0.3510, +0.7304, +0.0294, -1.1805, -0.3225, -0.6172,
-0.7072, -0.9334, -0.0625, -0.2341, -0.1015, -0.0004, +0.5904,
-0.2985, -0.4275, +0.2492, -0.3768, +0.4914, +0.5226, -0.3087,
-0.2044, +0.6708, -0.3427, -0.3538, +0.1439, -0.1679, -0.1714,
-0.0742, +0.2308, +0.2786, +0.3741, +0.1912, -0.2934, -0.4440,
-0.3034, -0.2523, +0.4034, +0.1184, +0.0691, +0.2607, -0.2009,
+0.2144, +0.0359
],
[
-1.0791, -0.6872, +0.6891, -0.8215, -0.0272, +0.1619, +0.1327,
-0.5389, -0.5439, +0.1500, +0.4166, -0.0599, +0.1693, +0.6353,
-0.5305, +0.3496, -0.1893, +0.1512, +0.2821, +0.5251, -0.2433,
+0.6280, -0.3474, -0.0719, -0.6998, -0.2908, -0.0741, -0.4300,
+0.0312, +0.0731, +0.1560, +0.2255, -0.0360, +0.3246, -0.5899,
+0.2137, -0.5356, -0.1725, +0.0803, +0.6945, -0.0740, +0.2914,
+0.1562, -0.1953, -0.0664, -0.1649, -0.1471, +0.2800, -0.7210,
-0.0192, -0.0773, +0.1419, -0.5461, -1.0192, +0.4102, -0.4465,
-0.5506, -0.0394, +0.2234, -0.1967, +0.3527, -0.3041, +0.4800,
+0.1482, -0.3358, -0.8865, +0.4729, +0.3006, -1.5214, +0.3571,
-0.1637, -0.3210, -0.3610, -0.0140, +0.1028, +0.2118, -0.8997,
+0.3469, +0.6706, +0.8076, -0.3839, +0.0217, +0.4903, +0.0804,
-0.4094, -0.4560, -0.3604, -0.6021, -0.5543, -0.2088, -1.1652,
-0.5443, -0.2383, +0.1295, -0.0840, -1.3197, -0.1383, -0.1171,
-1.2788, +0.6796, +0.2560, +0.3741, +0.4607, +0.2502, -0.9861,
+0.1005, -0.0201, -0.1667, -0.7721, +0.1416, -0.1328, -0.3513,
-0.5112, +0.5501, -0.5608, -0.0224, -0.6817, +0.3626, -0.7071,
-0.0967, -1.1760, -0.3415, -0.1030, -0.2168, -0.3978, +0.3884,
+0.0936, +0.4108
],
[
-0.2277, -0.0980, -0.0279, -0.0435, -0.6397, +0.4329, +0.0239,
+0.2381, +0.2800, -0.6969, +0.2404, +0.1888, -0.5496, -0.6255,
-0.1656, +0.0180, -1.1028, +0.2257, -0.2512, +0.2772, +0.2770,
-0.6592, +0.1774, +0.6097, -0.1839, -0.1900, -0.0550, +0.5695,
-0.1559, -0.4451, -0.2801, -0.0049, +0.2866, +0.3268, -0.5438,
+0.6265, -0.9367, -0.1937, -0.2782, -0.3756, +0.0420, -0.0782,
+0.0943, +0.5940, +0.2726, -0.0824, +0.4456, +0.3934, -0.4720,
-0.1995, +0.4892, -0.1421, +0.0174, -0.5084, -0.1167, -0.3024,
-0.0922, -0.3118, -0.0335, -0.0703, +0.2440, -0.9311, -0.0924,
-0.2168, -0.0706, -0.3731, +0.6529, -1.0958, -0.3929, -1.1930,
-0.4035, +0.4336, +0.1214, +0.5382, +0.7261, +0.1610, +0.2551,
+0.7774, +0.1628, -0.2756, -0.0601, +0.1143, -0.3179, +0.4815,
-0.1348, -0.1413, +0.1628, -0.1243, -0.0586, +0.3029, -0.5346,
+0.2212, -0.2135, +0.2941, +0.1778, +0.3688, -0.2048, -0.1424,
-1.0428, +0.5779, +0.3448, -0.8665, +0.1875, +0.1918, -0.4207,
+0.3115, -0.5152, -0.6870, +0.8070, -1.1151, +0.1282, +0.6629,
+0.4506, -0.1955, -0.0138, -0.2898, +0.0707, +0.3210, -0.8534,
-0.1408, -0.8929, -0.5922, -0.3174, +0.6164, +0.2929, -0.2424,
+0.0949, +0.3436
],
[
+0.3176, -0.3924, +0.0108, +0.0073, +0.0709, -0.7655, +0.5798,
-0.0885, -0.7087, +0.4234, +0.2339, -0.1536, -0.5395, +0.3095,
-1.2875, +0.0223, -0.0518, +0.1281, -0.1305, +0.2955, -0.4969,
+0.3210, +0.6567, -0.0472, +0.4891, +0.5844, +0.0608, +0.0588,
-0.0866, -0.3339, -0.0446, -0.1444, -0.0394, -0.5734, -1.1200,
+0.3550, +0.1063, -0.3921, +0.6259, +0.5534, -0.1268, +0.0167,
-0.2933, -0.0775, +0.3208, +0.3137, +0.1161, -0.5944, -0.4033,
-0.9224, -1.6031, -0.2286, +0.1156, -0.5235, +0.0071, -0.0999,
+0.2603, +0.2959, -0.3796, -0.1974, +0.6005, -0.1037, -0.5495,
-0.5030, -0.4202, -0.5696, +0.1623, +0.0398, -0.1173, +0.3304,
-0.1637, -0.2347, +0.6994, -0.5227, -0.9144, -0.2601, -0.4145,
+0.4540, +0.4762, -0.0762, +0.9777, +0.0984, -0.0808, -1.7371,
-0.0866, +0.2376, +0.1593, -0.2857, -0.0105, -0.8542, -0.3489,
+0.5299, +0.2855, +0.1606, -0.2741, -0.3969, +0.0376, -0.1196,
-0.3073, -0.5830, -0.2857, -0.0687, -0.3538, +0.0535, -0.1520,
-0.6600, +0.3730, -0.0237, +0.1413, -0.4994, -0.2943, +0.4360,
+0.0716, +0.0569, +0.0699, -0.0384, +0.1156, -0.1784, -0.2375,
-1.0747, +0.0669, +0.1220, -0.5153, +0.1585, -0.3345, +0.3933,
+0.4297, +0.1745
],
[
+0.0451, +0.1192, +0.1513, -0.4122, -0.4990, -0.3285, +0.0121,
+0.0996, -1.2994, +0.3913, -0.9270, +0.5467, -0.4719, +0.0201,
+0.5704, +0.5264, -0.0165, +0.0239, -0.0100, -1.1232, +0.0243,
+0.9827, -1.8897, -0.0513, -0.4016, -0.4913, -0.5011, -1.0531,
-0.7585, -0.8680, -0.3483, +0.6168, -0.6506, -0.1178, -0.2269,
-0.0077, +0.5145, -0.0643, +0.1179, +0.5522, +0.1897, -0.9912,
-0.3042, -1.2749, -0.0666, -0.8707, +0.1314, +0.0776, -0.3644,
-1.6311, +0.4315, +0.0053, -0.3322, -0.4387, +0.0335, +0.1827,
+0.4689, +0.1040, -1.2393, -0.4263, +0.0712, -1.5940, -0.0110,
+0.5220, -0.2696, +0.0326, +0.2011, -1.3511, +0.0776, +0.1381,
-0.9384, -0.2791, -0.7470, +0.3198, -0.0343, -0.3858, +0.7762,
-0.0530, +0.4048, -0.1381, +0.0476, +0.1951, +0.2237, -1.6044,
+0.2551, -0.4974, -1.8483, -0.7537, -1.6731, -1.0536, -0.1171,
+0.2709, -0.6349, +0.2810, +0.1560, +0.2926, -0.1911, +0.2209,
-0.7197, -0.0883, -0.0261, -0.3919, -0.2963, -0.2439, -0.6637,
-0.2337, -0.1216, -1.7968, -0.1052, -0.1832, -0.8489, -0.6524,
-0.2081, -0.1841, +0.2611, -0.4390, +0.7014, +0.1897, -0.4626,
+0.1440, +0.1534, +0.4789, +0.9003, +0.5775, +0.1325, -0.4038,
-1.6225, +0.5905
],
[
-0.3205, -0.4752, -0.4912, -0.4865, -0.0093, -0.8625, -0.7111,
+0.6141, +0.3583, -1.1199, -0.3957, +0.0922, -1.3333, +0.1549,
-0.0332, -0.1690, +0.0349, +0.0664, +0.1576, -0.9784, -0.0826,
+0.0687, -0.1124, -0.8914, -0.2932, -0.0694, -0.2219, +0.0341,
-0.1199, -0.3127, -0.2212, -0.1968, -0.1055, -0.1935, +0.1470,
-0.1760, -1.2864, -1.3588, -0.5615, +0.0230, +0.3473, -0.0310,
-0.0407, -0.9018, +0.3128, -0.2546, +0.1682, +0.1034, -0.9478,
-0.3190, -0.1191, -0.2102, -0.0530, -0.6558, +0.0063, -0.4495,
-0.0597, -0.1611, -0.5632, -0.0701, +0.3635, -0.2415, -0.1355,
-0.0856, -0.3443, +0.0222, +0.3314, -0.6737, -0.3053, -0.2678,
-0.4764, -0.1435, -0.6503, +0.1988, -0.9723, -0.0095, +0.4556,
+0.3001, -0.2753, +0.0375, -0.2730, -0.1158, -0.0386, -0.9331,
-0.2312, +0.0767, -0.0451, +0.4903, -0.9659, -0.5555, +0.3733,
-0.9485, -0.1633, +0.6562, +0.0532, +0.0032, -1.4373, +0.0468,
+0.1665, -0.8583, -0.1737, -0.8077, +0.0736, -0.2435, -0.0940,
+0.4364, +0.3262, -0.6249, +0.1925, -0.1501, +0.5031, -0.2871,
-0.0328, -1.5283, -1.2084, -0.6116, +0.1620, -0.6313, +0.0055,
-0.9072, +0.2416, -0.0478, -0.3839, -0.3438, +0.5106, -0.6303,
-0.0786, -0.1824
],
[
-1.0061, -0.1415, +0.5614, +0.1471, +0.2804, -0.2520, +0.2453,
+0.0006, -0.7605, +0.6590, -0.3647, +0.1825, +0.1384, -0.2187,
+0.6017, +0.3445, -0.2924, -0.0996, -0.4517, +0.0997, +0.2598,
-0.3217, -0.1636, -0.1402, -0.0688, +0.5085, +0.0841, +0.1102,
+0.2540, +0.0796, +0.2593, +0.1400, -0.7217, +0.2879, -0.2045,
+0.1075, +0.0661, -0.0931, -0.0124, -0.3172, -0.0032, -0.1647,
-0.2619, +0.0710, -0.0976, -0.0399, -0.4316, -0.4230, -0.3267,
-0.5921, +0.3123, +0.4273, -0.4458, -1.3337, -0.1572, -1.1379,
-0.4392, +0.2743, -0.4505, -0.2160, -0.5103, +0.3051, +0.3146,
-0.2750, +0.0965, -0.2486, +0.2757, -0.4422, -1.3708, +0.1642,
+0.4191, -0.2572, +0.1958, -0.0087, +0.3229, -0.5492, +0.0851,
+0.5151, -0.1987, -0.1567, -0.0296, +0.1179, +0.3395, +0.0261,
+0.0881, -1.2141, -0.6468, -1.9418, +0.3738, +0.1240, -0.1291,
+0.2193, +0.4126, +0.6854, +0.2690, -0.4613, +0.1831, +0.3535,
-0.0399, +0.0945, -0.0578, +0.5635, +0.0836, +0.0286, +0.0747,
+0.4220, -0.1242, -0.2479, -0.4533, +0.2856, -0.2348, -0.0885,
+0.4039, -0.6302, -0.2092, +0.1364, -0.7537, -0.1654, -0.0220,
-0.5586, -2.3927, +0.1004, -0.0423, -0.0261, -0.3384, +0.0462,
-0.7971, -0.9127
],
[
+0.0750, +0.2176, -0.4996, +0.1824, -0.0707, +0.1966, +0.0236,
-0.0692, -0.4960, +0.1383, +0.0373, -0.2026, -0.2008, +0.3046,
+0.3803, -0.0825, +0.1184, +0.4917, +0.2306, +0.0326, -0.3638,
-0.0580, -0.6834, +0.0438, -0.1417, -0.3357, -0.2336, -0.6334,
+0.3518, +0.1087, +0.3293, +0.0706, -0.1184, -0.2735, +0.2591,
-0.2327, -0.9828, -0.0540, -0.1303, -0.4909, +0.2748, +0.0293,
+0.0903, +0.1555, +0.5734, +0.0854, -0.7190, +0.3496, +0.0953,
-0.4672, -0.3598, -0.1305, +0.4157, -1.2690, -0.1589, -0.9937,
-0.0994, +0.2282, -0.4250, +0.1519, -0.1842, -0.2414, -0.0604,
-0.1126, -0.0335, +0.0520, +0.0182, -0.2505, +0.2693, -0.0057,
+0.5708, +0.1181, +0.3936, -0.1274, +0.1240, +0.3345, -0.5654,
-0.2478, -0.3554, -0.2807, +0.7255, -0.0021, -0.0572, +0.0135,
-0.0282, -0.2176, -0.0646, -0.8797, +0.0480, -0.5962, -0.3936,
-0.0989, -0.0082, -0.1741, -0.4116, -0.3323, +0.4336, +0.0306,
-0.3786, -0.3817, +0.2412, +0.3054, +0.3641, -0.2448, +0.1098,
+0.0840, -0.2574, +0.0844, +0.1103, -0.7323, +0.1966, -0.3377,
-0.0849, -0.0206, -0.4983, +0.3827, +0.0164, -0.3648, -0.0900,
-0.7235, -0.2408, -0.2687, +0.1033, +0.3813, -0.2013, +0.0816,
+0.0228, +0.2278
],
[
+0.4075, -0.4337, -0.1178, -0.2645, -0.3989, +0.3753, -0.4020,
+0.5258, -0.2696, +0.1506, +0.3436, +0.4036, +0.2138, +0.3263,
-0.5074, +0.0975, -0.6906, +0.2567, -0.3453, +0.1801, -0.2124,
-0.1523, +0.6583, +0.4003, +0.3154, +0.4761, +0.3418, +0.2095,
+0.5004, -0.1168, +0.5128, +0.2726, +0.4005, +0.5720, +0.4916,
-0.1016, +0.4738, +0.1282, +0.0060, +0.8116, +0.1077, -0.4063,
-0.2667, +0.0857, +0.1045, -0.5171, -0.5304, -0.2763, +0.2491,
-0.6936, +0.1619, +0.3061, -0.1143, -0.1346, -0.1540, +0.3273,
-0.1911, +0.3598, -0.2261, -0.0589, -0.0330, +0.7586, +0.0538,
-0.1769, -0.4478, +0.7072, +0.1733, +0.2620, +0.7263, +0.0611,
-0.5258, -0.2466, +0.2799, +0.2616, -0.0277, -0.1707, -0.3391,
-0.3818, +0.3912, +0.1183, +0.2835, -0.2168, +0.4314, +0.1513,
-0.5520, -1.1234, +0.6860, +0.5702, -0.1339, +0.0741, -0.5413,
-0.0858, -0.2133, +0.2737, -0.0825, -0.1390, -0.0584, -0.1054,
+0.0083, +0.3280, -0.2467, -0.3385, -0.3302, +0.1709, -0.0679,
-0.1004, -0.6046, -0.0236, +0.4449, +0.0112, -0.1172, +0.0051,
+0.1691, +0.3826, +0.2565, -0.0092, +0.2152, +0.7632, +0.3072,
-0.5973, -0.1711, +0.2336, +0.3417, -0.1362, -0.2016, +0.3892,
-0.2284, -0.7264
],
[
-0.5619, -0.6588, +0.2222, -0.7032, +0.3192, -0.7468, +0.0840,
-0.0085, -1.0928, +0.7917, -0.8584, -0.1583, +0.3086, +0.4438,
-0.6609, -0.4945, +0.0735, +0.2988, +0.0502, +0.1138, -0.4697,
-0.9869, -0.8634, -0.0310, +0.5568, -0.6586, +0.2718, -0.4758,
-0.2878, -0.2967, -0.3541, -0.2828, +0.1682, -0.3047, -0.6659,
-0.3369, -0.8593, -0.3854, +0.3200, +0.2052, +0.5943, +0.5155,
+0.1806, -0.3103, +0.1668, +0.4870, +0.1900, -0.2799, +0.1105,
+0.1297, -0.1050, -0.1574, -0.6901, +0.2987, -0.2892, -0.1965,
-0.2233, -0.1386, -0.3617, -0.2200, +0.2744, -0.1720, -0.0025,
-0.3192, +0.6888, -0.9526, +0.3419, +0.4704, -0.5047, +0.3867,
-0.2252, +0.4470, +0.1633, +0.3513, +0.3425, +0.0219, -0.4380,
-0.4013, -0.0750, -1.2795, +0.2330, +0.1879, +0.1886, -0.4729,
+0.0993, -0.3209, +0.1687, +0.0220, +0.3353, +0.4888, +0.7272,
-0.4622, +0.4032, +0.0962, +0.2044, +0.2351, -0.2522, +0.6231,
-0.1771, +0.2073, +0.1115, -0.0105, -0.4885, -0.1947, +0.0805,
-0.7077, +0.6541, -0.2168, -0.3990, +0.4405, -0.5269, +0.4340,
-0.0695, -0.6759, -0.2265, +0.2120, -0.9304, -0.1006, -0.4760,
-0.8165, -0.8547, -0.4625, +0.4114, +0.5815, +0.1176, -0.1204,
-0.0489, +0.0484
],
[
+0.3307, +0.4011, -0.1160, -0.2264, +0.1470, -0.2919, -0.7451,
-0.1501, -0.2051, -0.1858, -0.2368, -0.0166, +0.2410, -0.0673,
+0.2497, +0.3609, +0.0376, +0.3896, +0.5163, -0.2009, -0.0213,
-0.0858, -0.3649, -0.5694, +0.2950, -0.3715, -0.4091, +0.1047,
-0.2480, +0.2524, +0.0759, +0.3455, +0.1984, -0.2355, -0.0878,
-0.1322, -1.3433, -1.0194, -0.5226, -0.3194, -0.4891, +0.2655,
-0.2550, -0.1050, +0.1669, +0.0303, -0.0818, +0.0851, +0.0980,
+0.0502, -1.3712, -0.3609, +0.1263, -0.0160, -0.7327, +0.1758,
-1.4315, -0.3756, -0.4343, -0.7862, -0.1735, +0.6499, +0.3025,
-0.3268, +0.0232, -0.3298, +0.5586, -0.1262, -0.2705, -0.2214,
-0.4371, +0.0723, +0.8103, -0.3228, +0.0355, +0.3893, -1.1094,
-0.1664, +0.4552, -0.2732, +0.4157, +0.2128, -0.1776, -0.1176,
-0.3515, -0.0519, -1.4214, +0.3016, +0.0068, -0.2785, -0.0741,
+0.0472, -0.2149, -0.5563, -0.5599, +0.3389, -0.1509, +0.2100,
-0.6473, -0.0704, +0.0156, -1.0333, +0.1829, +0.1841, -0.0582,
+0.1230, -0.8259, +0.0747, -0.3466, -0.9991, +0.4214, -0.8522,
+0.6740, +0.0441, -0.3886, -0.0458, +0.0325, +0.3056, -0.3655,
+0.2377, -0.0662, -0.3979, +0.5509, -0.4970, +0.2473, +0.4498,
-0.0303, -0.1357
],
[
-0.1411, +0.3419, -0.5398, -0.5728, -0.2083, -0.7746, -1.6018,
+0.0830, -0.1589, +0.1139, -0.9158, -0.1886, -0.3481, -0.2742,
-0.6108, -0.4646, -0.1986, -0.2215, -0.0440, -0.2837, -0.6019,
+0.8197, -0.2571, -0.3325, +0.0778, +0.1455, -0.2286, -0.3149,
-0.1893, +0.1037, -0.0041, +0.1791, -0.0783, -0.9331, +0.3056,
+0.2097, +0.2735, -0.6685, +0.1896, -0.3313, +0.0086, +0.0904,
-0.3519, -0.1869, -0.2648, +0.4288, +0.5785, -0.1345, -0.4295,
+0.3263, -1.2706, -0.1486, -0.2965, +0.5303, +0.5528, +0.1091,
+0.5738, -0.3166, -0.4828, -1.0198, +0.1566, +0.0928, +0.3758,
-0.0311, -0.3368, +0.0728, -0.5817, -0.5760, +0.2071, +0.0976,
-0.1485, -0.5637, +0.0350, +0.0808, -1.4359, -1.0612, +0.8414,
-0.0146, -0.2197, +0.3973, +0.1252, -0.6162, -0.2415, +0.8750,
-0.0968, -0.1306, -0.9543, -0.1862, -1.5782, +0.3982, +0.4383,
-0.6786, -0.6033, +0.5087, -0.7869, +0.4946, +0.0823, +0.1406,
+0.9046, -0.3147, +0.3026, -0.5016, -0.0749, +0.0197, -0.0467,
+0.0819, -0.8144, -0.1670, -0.3128, +0.7011, -0.0116, +0.2329,
-0.0852, -0.9855, -0.2289, -0.4368, +0.1742, -0.4543, -0.1306,
-1.3917, -0.0987, -0.4074, -1.3360, +0.4082, +0.0751, +0.2841,
-0.3836, -0.0619
],
[
+0.5599, -0.1414, -0.4146, +0.3829, +0.1853, +0.4371, +0.1098,
-0.3408, -0.3087, +0.5215, +0.3125, -0.0436, -0.3835, +0.1165,
-0.0211, +0.7342, +0.3444, -0.2147, +0.0706, +0.1791, -0.2517,
+0.2504, +0.2694, +0.6347, +0.0294, +0.0789, -0.0674, -0.3697,
+0.4269, +0.4728, +0.2009, +0.4281, +0.3512, +0.1221, -0.6764,
+0.4082, -0.0088, +0.5336, +0.0043, -0.4289, +0.5984, -0.0283,
-0.3683, -0.0025, -0.2357, +0.3666, -0.6498, -0.0941, +0.5055,
-0.2962, -0.2996, +0.6271, +0.2199, -0.2913, -0.2883, +0.1686,
+0.0509, +0.3784, -0.2252, -0.2628, +0.1992, -0.2538, -0.7235,
-0.2512, -0.6292, +0.3317, -0.2750, -0.1492, -0.1254, -0.5303,
+0.4742, +0.2374, -0.0799, +0.3206, -0.1635, +0.2186, -1.5885,
-0.2624, -0.2078, +0.0618, +0.1017, -0.4087, +0.4021, -0.5257,
+0.1620, +0.0994, +0.1038, +0.3908, +0.7491, -0.2611, +0.4643,
-0.3850, -0.6188, +0.2157, +0.0873, -0.0726, -0.1172, +0.3000,
+0.1168, -0.7371, -0.0892, +0.5591, -0.1833, -0.1558, -0.1696,
-0.3287, +0.1759, +0.1962, +0.1898, -0.8243, -0.0589, -0.2871,
-0.1862, +0.3834, -0.4924, -0.9987, +0.4994, +0.1364, +0.2384,
-0.2542, -0.2244, +0.2779, +0.1243, -0.3323, -0.1065, +0.9858,
-0.1509, -0.3793
],
[
+0.1211, -0.3892, -0.2579, -0.0539, +0.3488, -0.4385, -0.0953,
-0.1475, -0.0085, -0.0146, -0.0385, -0.0863, +0.3296, +0.1033,
-0.7796, -1.0686, -0.4646, -0.9428, +0.1191, +0.5546, -0.2665,
-0.3790, -0.2799, -0.4635, +0.2681, +0.5384, +0.4331, +0.5839,
-0.1674, +0.1048, +0.2617, +0.2412, +0.2817, +0.3190, +0.0717,
+0.1469, -0.8842, -0.2001, -0.1666, +0.7128, -0.0140, +0.0970,
+0.4524, +0.1373, -0.1271, -1.0031, +0.4634, -0.9270, -0.6111,
+0.2023, +0.1047, -0.1319, -0.8178, +0.2046, -0.3841, -0.0014,
+0.0221, -0.3722, +0.3840, -0.2176, -0.7972, -0.9204, +0.1808,
+0.4128, -0.2148, +0.3167, -0.4500, -0.3328, +0.0039, -0.4873,
-0.3715, +0.1700, -0.8838, -0.2712, -0.0198, +0.2058, +0.0441,
-1.1947, -0.1763, -0.1705, +0.2709, +0.0692, +0.1217, +0.2196,
+0.7444, -0.5537, +0.5183, -1.1049, -0.7976, +0.4688, -1.2243,
-0.1406, -0.3925, +0.0298, +0.0430, +0.1307, +0.2235, -0.8780,
-0.4595, +0.6274, -0.8746, +0.1502, +0.1100, -0.3349, -0.3247,
+0.5027, -0.5859, +0.0378, +0.2973, -0.3859, -0.3021, +0.4116,
-0.0703, +0.8823, +0.0924, +0.0365, -0.5382, +0.1939, -0.6474,
-0.2411, +0.2754, -0.9982, +0.0524, -0.4023, +0.1290, +0.2443,
-0.4641, +0.1065
],
[
-0.8622, +0.1746, +0.0478, +0.2293, -0.5433, +0.7395, +0.0786,
-0.2146, +0.2212, +0.4695, +0.9859, -0.0263, +0.3056, -0.0288,
+0.6469, -0.7688, +0.1167, -0.1867, -0.7654, +0.0038, +0.5478,
-1.0341, +0.0961, -0.2939, +0.1562, -0.1333, -0.7247, +0.2685,
+0.5300, +0.1041, +0.2512, +0.2629, -0.1732, +0.5918, -0.3586,
-0.1235, +0.8831, +0.0805, +0.4253, -0.0225, +0.4928, -0.1960,
+0.0558, +0.7018, -0.5662, -0.3790, +0.2023, -0.1019, +0.0291,
-1.4159, +0.6631, -0.4778, -0.1910, +0.1474, -0.1357, +0.8589,
+0.6851, -0.2610, -0.7132, -0.2426, -0.3355, -0.6891, +0.4665,
+0.1988, -0.0993, -0.2685, +0.1827, -0.4094, +1.2800, +0.3095,
+0.0993, -0.0654, -0.2385, -0.1326, -0.8041, +0.1193, -0.7565,
-0.0409, -0.1184, -1.1444, +0.1374, +0.4981, +0.0891, -1.0196,
+0.2107, +0.5862, +0.4555, +0.2593, -0.4296, +0.1686, -0.0552,
-0.6144, -0.1157, -0.7372, -0.1982, -0.2709, -0.6923, -0.9942,
+0.1412, +0.2982, -0.0820, -0.4159, -0.8002, -1.0354, -1.1311,
-0.7153, +0.6903, -0.1778, +0.2467, +0.0600, -0.7793, -0.1700,
-0.5409, -0.0309, -0.5901, +0.1537, -0.5494, -0.1176, -1.7891,
-1.0237, -0.6773, -0.7804, +0.4489, -0.3772, -0.3757, -0.1479,
-0.4148, +0.0759
],
[
-0.2130, -1.1645, +0.3232, +0.3900, -0.5796, -0.4883, -0.0754,
-0.5800, -0.3135, -0.7695, +0.0458, -0.3120, -0.3763, +0.1087,
+0.6053, +0.7496, +0.2697, -0.4492, -0.4960, +0.0117, +0.0613,
+0.0936, -0.0581, +0.2946, +0.0277, +0.1042, -0.1424, -0.2893,
+0.6856, -0.0385, -0.0054, +0.2713, +0.3466, -1.0460, -0.6893,
-0.2328, +0.2178, -1.0084, -0.4262, -1.5063, -0.3900, -0.3777,
-0.4588, -0.7957, -0.1770, -0.2022, -0.3452, -0.0698, +1.0757,
+0.4649, +0.1002, +0.0709, -0.5472, -0.3277, -0.5591, +0.0326,
-0.6309, -0.7932, +0.3326, -1.0855, -1.2924, -0.9289, -0.0786,
-0.4831, -0.0025, -0.4642, -0.2356, -0.1564, -0.0782, -0.6758,
-0.5957, -0.2548, -0.5085, +0.4147, -0.4589, -0.7869, -0.2252,
-0.5512, -0.5648, +0.2208, +0.1798, +0.8284, -1.0848, +0.4015,
-0.1890, +0.2518, -2.7915, +0.2166, +0.0735, -0.2205, -0.1941,
-0.9020, -1.9251, -0.0926, +0.2323, -0.7674, -1.3656, -0.3813,
-0.0141, -0.0956, -0.5309, +0.0864, +0.3387, -0.0847, -1.7727,
+0.3071, -1.7860, -0.5097, -0.1783, -0.6700, -0.0269, -1.2584,
+0.0446, +0.0107, -1.2882, -0.7400, +0.0471, -1.3375, -0.3332,
+0.4684, -0.1211, -1.3073, +0.1311, -0.8196, +0.1702, -0.0472,
+0.1488, -0.3162
],
[
-0.4822, +0.1781, -0.5486, -0.3511, -0.6247, +0.0431, -0.6801,
-0.1866, +0.2514, -0.3799, +0.0273, +0.2231, +0.2796, -0.2793,
+0.1092, +0.0941, -0.2017, +0.3812, -0.0306, -0.6378, -0.0158,
+0.1661, +0.2605, +0.1764, -0.8942, -0.2745, +0.3173, +0.5745,
-1.2489, -0.1893, -0.6678, -0.7470, +0.1252, +0.1814, +0.2449,
-0.0477, -0.4136, -0.0115, -0.1523, +0.4298, -0.2459, +0.0294,
-0.4592, +0.2257, -0.1062, -0.3744, -0.0735, +0.6844, -0.2403,
+0.1384, -0.1363, -0.1945, -0.2138, -0.1837, +0.0862, +0.3144,
+0.1178, -0.2623, +0.1173, -0.4966, +0.0534, -0.0307, +0.4077,
-0.0290, -0.4554, -0.2460, -0.5608, +0.1067, +0.6111, -0.2582,
-0.2110, +0.0142, +0.0669, -0.3146, +0.0614, +0.2457, +0.5555,
-0.4073, +0.1069, +0.1074, -0.5879, -0.6752, +0.4640, -0.6362,
-0.8860, -0.2178, -0.1162, +0.0746, -0.1270, -0.2287, -0.0852,
-0.0441, -0.2772, -0.3746, -0.7997, -0.5596, -0.3286, -0.1993,
-1.1352, +0.3078, +0.2114, +0.4098, -0.2233, -0.5876, -0.5737,
-0.1624, -0.1678, -0.8670, -0.8843, +0.0697, +0.4886, -0.2260,
-0.0436, -0.6764, -0.2266, +0.2289, -0.2964, +0.1925, -0.2377,
-0.1030, -0.4171, +0.3580, +0.1054, +0.4303, -0.0084, -0.6212,
-0.2186, -0.1943
],
[
-0.2368, -0.3281, -0.2468, +0.6167, -0.8063, -0.0141, +0.4634,
+0.7047, +0.2760, -1.6134, -0.2726, -0.0294, +0.0873, -0.9213,
+0.0207, +0.5808, +0.4838, -0.4079, +0.1755, +0.2668, -0.4591,
+0.3907, +0.0266, -0.1942, +0.3317, -0.1848, -0.1486, -0.2302,
-0.2769, +0.6142, +0.0375, -0.1520, -0.5497, +0.2973, +0.3097,
-1.1093, +0.2989, -0.1326, -0.4286, -1.2209, -0.4974, -0.1208,
-0.9010, -0.6289, +0.3409, -0.1231, +0.8650, -0.2671, +0.6767,
+0.7254, +0.1158, -0.3425, +0.3165, -0.6184, +0.1867, -0.0042,
-0.4986, -0.4531, +0.4788, +0.3050, +0.0496, +0.4402, +0.3147,
-1.1178, +0.4522, -0.1048, -0.1525, +0.2907, +0.4481, -1.0584,
-0.0087, +0.3321, -0.4124, +0.3314, -0.2549, -0.5649, -0.0939,
+0.3508, -0.4372, +0.2062, -1.0781, +0.1715, -0.1390, -0.4017,
-2.0066, -1.1449, -0.1206, -0.3169, -0.9551, +0.0547, +0.3231,
+0.2871, -0.0780, +0.4857, +0.4933, +0.2082, -0.2030, +0.6173,
-0.5404, -0.0371, -0.4683, -0.2967, -0.0608, -0.3361, -0.5735,
+0.2297, -0.2957, -0.4493, +0.2015, +0.8652, -0.4828, -0.7838,
+0.1694, -0.3324, -0.2470, +0.2109, +0.4299, -0.3284, +0.4948,
+0.1671, -0.6183, -0.1987, +0.4212, +0.5936, +0.2322, -0.4222,
+0.1624, +0.8517
],
[
+0.1104, -0.4921, +0.0474, -0.7762, -1.1535, -0.2700, +0.3253,
-0.8367, +0.2960, +0.1246, -0.0578, +0.0235, -0.6222, -0.0553,
-0.8389, +0.2631, -0.6444, +0.0190, +0.0188, +0.1844, +0.3793,
+0.3827, +0.4708, +0.3743, -0.2069, +0.1266, -0.4388, +0.0426,
-0.3448, +0.2629, -0.0213, +0.6795, -0.0563, -0.3251, +0.3396,
+0.1987, +0.0749, +0.3789, -0.9001, -0.4680, -0.1956, +0.0772,
-0.7066, +0.2571, -0.6362, -0.0667, +0.0589, -1.0207, +0.2653,
+0.2805, -0.4010, -0.1658, -0.1780, +0.0457, -0.8765, +0.1537,
-0.7626, +0.2182, +0.0918, -0.0017, -0.2147, -0.6848, -0.1827,
-0.2736, +0.4772, +0.1851, +0.0148, -0.1144, +0.2520, -0.5352,
-0.0693, +0.6540, -0.0091, -0.2929, -0.6751, +0.3532, -0.2106,
+0.1118, +0.1222, -0.9654, -0.0066, +0.1840, +0.0129, -0.3222,
+0.3205, -0.0201, -0.3000, +0.1861, -0.3392, +0.0374, +0.1404,
-0.1935, -0.0747, -0.1133, -0.3540, -0.1466, -0.4392, +0.6757,
+0.2981, +0.2639, -0.1507, -0.1990, +0.1983, +0.5770, +0.4329,
+0.3249, +0.2107, -0.1458, +0.2654, -0.1229, +0.5379, -0.0903,
+0.1080, -0.2282, +0.1653, -0.2343, +0.4844, -0.8038, -0.6899,
+0.0414, -0.4948, -0.0860, -0.1432, -0.5109, +0.0398, -0.3908,
+0.2015, +0.4452
],
[
+0.4464, -0.1016, -0.2108, +0.6285, +0.7605, -0.0959, +0.6057,
+0.0765, -0.3599, -0.4701, -0.5980, +0.0008, +0.4155, +0.0650,
+0.1021, +0.2823, +0.3559, -0.2473, +0.3277, -0.1048, +0.1826,
-0.4503, +0.6390, +0.2877, -0.2585, +0.0565, -0.7396, -0.4097,
-1.1459, +0.5500, +0.4349, -0.3829, +0.5239, -0.3815, -0.8615,
-0.0339, +0.2943, -0.3213, -0.2750, -0.1061, -0.1573, -0.3898,
-0.0822, -0.2937, -0.1468, +0.1442, +0.1370, -0.8253, -0.5933,
-0.3806, +0.6324, -0.0170, +0.0879, -0.0069, +0.1753, -0.2524,
+0.2062, -0.4372, -0.0059, +0.1578, +0.2900, -0.3776, +0.2091,
+0.1612, +0.3661, +0.2404, -0.1718, -0.4438, -0.4260, -0.7568,
+0.4362, +0.0811, -0.7770, +0.2216, +0.0564, +0.4907, +0.3224,
+0.0886, -0.1049, -0.5407, -0.1025, -0.1982, -0.2967, -0.7103,
+0.2048, +0.0722, +0.5329, +0.0530, +0.2883, -0.1321, +0.3782,
-0.0988, +0.2376, -0.7593, +0.2411, -0.2622, -0.5329, +0.5309,
-0.2957, -0.9082, +0.2224, -0.4173, +0.0038, +0.1562, -0.5012,
+0.5892, -0.2013, -0.5368, +0.0320, +0.3389, -0.8605, -0.8244,
-0.4792, -0.0523, -0.0195, +0.0430, +0.1482, +0.0215, +0.4290,
-0.2574, -0.2047, -0.0628, -1.7579, -0.0751, +0.7376, -0.5738,
-0.1425, +0.4466
],
[
-0.2047, -0.2955, +0.4383, -0.2099, -0.3229, +0.0324, +0.1413,
+0.4679, +0.0618, -0.1480, -0.0718, +0.1261, -0.4324, -0.1585,
-0.5738, -0.8086, -1.2257, +0.1531, -1.1906, +0.0960, +0.0034,
-1.0042, -0.4898, -0.0569, -0.2377, -0.6157, -0.3313, -0.6325,
+0.5634, -0.2944, -0.5246, +0.1536, +0.2806, +0.0689, +0.0035,
-0.2231, +0.0330, -0.2128, +0.3271, -1.4344, -0.4247, -0.7055,
-0.3834, +0.0650, +0.3693, -0.2910, -0.1479, +0.2697, -0.3216,
+0.8833, -0.1711, -1.1387, +0.2106, -0.1236, -0.2836, -0.4468,
+0.0387, -0.1254, -1.8480, +0.1198, +0.3021, +0.2219, +0.7346,
-0.2258, +0.8582, -0.4501, +0.0066, -0.0058, +0.2466, +0.3448,
-0.0955, +0.1150, +0.1171, -0.0305, -0.7754, +0.2977, -0.3415,
+0.1446, +1.0973, -1.1663, -0.1010, -0.2815, +0.3744, -0.3839,
-0.2079, -1.8889, -0.5745, +0.0064, +0.1967, +0.0068, +0.0453,
+0.4830, +0.1987, +0.6962, -0.3831, +0.4901, -0.4959, +0.4123,
-0.4468, -0.0611, -0.1656, -0.4883, +0.6344, -0.1394, -0.0989,
-1.1268, +0.5392, -0.9870, -0.4727, +0.0362, -0.5664, -0.8200,
-0.1482, -0.4791, -0.2926, -0.5099, +0.6774, -0.1072, -0.0655,
+0.2952, -0.8458, -0.2151, -0.5641, +0.0376, +0.2182, +0.1099,
+0.2379, +0.1908
],
[
-0.1225, -0.1321, +0.7308, -1.1087, -0.5171, +0.0304, -0.8022,
-0.2931, +0.1665, -0.1050, -0.6631, -0.5912, +0.1576, +0.3605,
-0.1145, +0.5829, +0.3607, +0.3474, -0.2511, -0.7079, -0.2942,
+0.3808, +0.5294, -0.5013, +0.0238, +0.4688, -0.3788, +0.0730,
+0.0283, +0.6128, -0.3222, -0.4536, -0.9039, -0.6244, -0.5269,
-0.8876, +0.1430, +0.4378, -0.1609, -0.8150, -0.4497, +0.2789,
-0.2679, +0.7530, +0.3137, -0.8434, +0.4280, +0.1761, -0.8674,
-0.5673, +0.2236, -0.3403, -0.7646, -0.6555, +0.9779, +0.0927,
-0.4200, +0.0056, -0.8580, +0.1268, -0.1355, -0.4540, -0.2248,
+0.9954, +0.0536, +0.0595, +0.3436, -1.0771, +0.3269, +0.6748,
-0.2971, +0.3235, -0.1241, -0.0185, +0.2466, +0.3684, -0.9468,
-0.0591, -0.7956, -0.2100, -0.1989, +0.3475, -0.2810, -0.3435,
-0.3471, +0.0183, -0.8959, -0.6866, -0.4349, -0.1154, -0.3443,
-0.0657, +0.4922, +0.2964, +0.2669, +0.1446, -0.0485, -0.6028,
-0.9521, -0.0438, +0.4984, +0.3148, -0.7061, -0.0147, -0.4091,
-0.4603, -0.0370, -0.2918, -0.1455, -0.8047, +0.4455, +0.9899,
-0.1563, +0.1182, +0.2497, -0.9639, +0.4513, -0.1153, -0.2384,
-0.1501, +0.2620, -0.9036, -0.2327, -1.3314, +0.4013, -0.4306,
+0.2883, -1.2667
],
[
+0.2644, -0.1494, -0.4453, +0.1137, +0.0802, +0.1931, -0.1430,
-0.0241, +0.5387, +0.1517, +0.0854, -0.0698, -0.1889, +0.4570,
-0.1975, +0.3453, -0.2398, -0.4224, +0.1325, +0.2208, -0.0402,
+0.1095, -0.5577, +0.2867, -0.1122, +0.1830, +0.0217, -0.0430,
-0.0696, -0.1120, +0.0500, +0.0370, -0.4425, +0.1814, -0.1573,
+0.0998, -0.1730, -0.3537, -0.8194, +0.1510, -0.2713, -0.2499,
+0.0226, +0.1604, +0.3219, -0.2855, +0.0610, +0.3411, -0.0813,
+0.0378, -0.6988, -0.0412, +0.0657, -0.0841, +0.4532, +0.0441,
+0.1345, +0.1558, +0.2114, +0.3063, -0.1986, -0.0880, -0.0281,
+0.5160, +0.2705, -0.0413, +0.0352, +0.0696, -0.0719, -0.2414,
-0.3859, +0.4521, -0.1886, +0.2422, -0.1094, +0.2950, +0.0909,
-0.4692, -0.0058, +0.0013, +0.4307, +0.4305, +0.0478, +0.3528,
+0.5099, +0.2312, +0.3044, -1.1194, +0.0669, -0.3181, -0.2290,
+0.4461, +0.1198, -0.0438, +0.2953, +0.0438, -0.0518, -0.5190,
+0.2083, +0.4686, -0.1845, -0.2299, -0.3921, +0.4322, +0.2297,
+0.2758, -0.3691, +0.4775, +0.3972, -0.9253, +0.4109, -1.1842,
+0.3989, -0.4237, -0.6019, -0.2239, +0.0047, -0.0416, -0.6338,
-0.0119, +0.3457, +0.1080, +0.4905, +0.1786, -0.0777, +0.1234,
-0.2929, +0.3286
],
[
-0.1358, -0.5763, -0.9117, -0.5821, -0.1674, +0.4194, +0.3464,
-1.3516, +0.5387, -0.0086, -0.4016, +0.4349, +0.1220, -0.6551,
-0.6775, -0.4614, -0.5133, +0.3374, +0.2617, +0.0825, +0.1601,
+0.6206, +0.1189, +0.2517, -0.0462, +0.0175, -0.0761, +0.2331,
+0.3815, +0.2835, -0.2826, +0.5036, +0.0863, +0.1331, -0.2766,
-0.3673, +0.3852, -0.0354, +0.1149, +0.8184, -0.8265, -0.0190,
-0.4810, +0.0216, +0.0128, -0.0960, +0.2823, -0.8916, +0.4520,
-0.6486, -2.2243, -0.3405, +0.3947, +0.2003, +0.4490, +0.0508,
-0.3408, +0.2818, +0.0271, +0.2548, -0.8521, -0.2771, -0.3072,
+0.3251, -0.2674, -0.1178, +0.2249, -1.5805, -1.8331, -1.0409,
-0.1002, +0.1934, -0.0360, -0.2364, -0.0350, +0.0151, +0.2383,
-0.0633, +0.2490, -0.0642, -0.2854, +0.7608, -1.0875, +0.0126,
+0.1063, +0.4831, +0.1556, +0.3813, +0.1668, -0.2929, -0.6254,
+0.5186, -0.0166, -0.4155, -0.6734, +0.1663, -0.3398, -0.1092,
+0.1818, +0.2933, +0.1602, +0.5191, -0.2649, +0.2901, -0.1126,
+0.0552, -0.4307, -0.4647, -0.0786, -0.9300, +0.1249, +0.6485,
+0.0501, -0.5488, +0.6199, +0.2848, -0.2970, +0.1893, +0.7779,
-0.2323, +0.1798, -0.0726, +0.1871, -0.9195, -0.3217, +0.3426,
-0.3773, +0.2996
],
[
+0.1591, +0.5102, +0.2424, -0.3209, -0.5437, -0.6565, +0.3967,
-0.2887, +0.3699, +0.3665, +0.2700, -0.0879, +0.2999, -0.0883,
+0.2035, +0.2699, -0.1585, -0.4209, +0.3688, -0.1251, +0.0093,
-0.1950, +0.1031, +0.1462, +0.0963, -0.0132, +0.2962, +0.2199,
+0.0907, -0.1868, +0.0138, +0.0799, +0.4006, -0.8396, -1.5625,
+0.0963, -0.8820, -0.8120, -0.2451, +0.0646, +0.1316, -0.0886,
-0.6373, -0.4917, +0.4230, -0.4656, -0.0706, -0.1486, +0.3288,
-0.0991, -0.1230, -0.0042, -0.0949, -0.8593, +0.8234, -0.1525,
-0.6916, -0.2377, +0.6268, -0.7994, -0.4317, -0.9239, +0.1686,
-0.0160, +0.4368, -0.2227, +1.2948, -0.2040, +0.2399, +0.4261,
-0.6343, -0.4238, -0.0279, -0.3740, -0.0494, -0.2556, -1.0388,
-0.8581, -0.1656, -0.0359, +0.7224, -0.3739, -1.2194, +0.6395,
-0.1583, -0.3026, -0.1850, -0.1700, -1.8707, +0.2407, -0.4709,
-0.6156, +0.5196, -0.2519, -1.1860, -0.4825, +0.1446, +0.0457,
+0.5660, -0.9857, +0.2271, -0.6855, +0.2044, +0.3245, -0.7669,
+0.2010, +0.8049, +0.5283, +0.0931, -0.5368, +0.1922, -0.2671,
+0.0585, +0.0481, -0.1221, -0.2978, -0.2395, -1.3760, -0.3491,
-0.9191, +0.2586, -0.1832, -0.0098, -1.1076, +0.0029, -0.7639,
-0.3380, +0.3705
],
[
+0.0289, -0.4805, -0.1357, +0.1879, -0.5422, +0.2763, -0.0112,
-0.1107, +0.4688, +0.2981, -0.1360, -0.4712, -0.2914, -0.0272,
-0.6401, -0.0511, -0.1172, +0.0755, -0.5573, -0.2963, -0.0006,
+0.2621, +0.1875, +0.1875, -0.0846, +0.2546, -0.5560, -0.3267,
-0.1187, +0.3248, +0.3340, +0.0702, -0.0139, -0.1771, -0.0638,
-0.0986, -0.0267, +0.2829, +0.0948, -1.1968, +0.1601, -0.4763,
-0.4689, -0.1215, +0.1932, -0.9174, -0.0659, +0.4321, -0.1908,
-0.7125, -0.3206, -0.0359, -0.3748, +0.2235, +0.6466, -0.2252,
-0.2070, +0.3157, -1.2327, -0.0452, -0.2814, -0.6249, +0.0581,
+0.2075, -0.0165, -0.1580, +0.4082, -0.5096, -0.0861, +0.1971,
+0.0945, -0.0999, -0.5605, +0.2850, +0.2503, -0.2752, -1.1420,
+0.1810, +0.2212, -0.0055, +0.0991, +0.2571, +0.2492, -0.3627,
-0.1796, -0.6484, -0.5700, +0.0658, +0.4221, -0.4974, -1.0723,
-0.0637, +0.0172, -0.3979, +0.5588, -0.3942, +0.5263, -0.3237,
-1.2946, -0.7221, -0.4368, -0.1285, -0.4849, -0.0860, +0.2354,
-0.8339, +0.2524, +0.0469, -0.3501, -0.0119, +0.1499, +0.0355,
+0.0300, -0.1779, -0.2451, +0.0619, -0.0764, -0.1715, -0.1163,
-0.3817, -0.3149, -0.0202, +0.1961, -0.2986, -0.2575, +0.0752,
-0.8310, -0.1580
],
[
-0.3187, -0.6681, -0.1421, -0.4481, +0.1419, +0.3267, +0.0442,
+0.5460, +0.1549, +0.5221, +0.3236, +0.0272, -0.2433, -0.0965,
-0.0190, +0.2937, +0.1597, +0.1054, +0.3486, +0.4370, +0.3442,
+0.3670, -0.0690, -0.2773, +0.4176, +0.0272, -0.3902, -0.3398,
+0.3189, +0.3319, -0.0357, +0.3368, +0.3673, +0.1598, -0.7883,
+0.2557, -0.1954, -0.2160, +0.1178, +0.2254, +0.1501, -0.1296,
-0.4042, -0.3844, +0.2403, +0.3404, +0.4625, -0.4329, +0.2005,
+0.5049, -0.4352, -0.0119, -0.8480, -0.0911, -0.2687, +0.0486,
-0.3807, +0.0633, -0.3636, +0.1809, +0.1578, +0.0463, -0.4087,
+0.0168, +0.0967, -0.1952, +0.0402, +0.2730, -1.0654, -0.2688,
-0.1371, +0.0163, -0.0675, +0.2259, +0.0828, +0.5484, +0.3267,
-0.5555, +0.1474, -0.2014, -0.7283, -0.2138, +0.1367, +0.2919,
-0.2362, -0.1456, -0.4480, -0.2033, -0.0546, -0.0005, +0.5427,
+0.2188, -0.0197, -0.0850, -1.0038, -0.2540, +0.2578, +0.4207,
-0.1029, +0.2920, +0.1735, +0.4866, -0.1391, -0.0216, -1.0560,
-0.4210, +0.4035, -0.1627, +0.2446, +0.3247, -0.6063, +0.2979,
+0.5203, +0.6016, +0.1982, +0.2929, -0.1622, -0.2267, -0.1046,
+0.6733, -0.6183, -1.0064, +0.4085, -0.2986, +0.0815, -0.0446,
-0.0211, -0.1044
],
[
-0.0967, -0.4198, +0.0837, -0.6985, +0.6727, +0.2239, -0.2881,
+0.2889, -0.4438, +0.0474, +0.1777, -0.5039, +0.0721, +0.2901,
-0.1435, +0.2687, -1.2548, -0.1118, +0.4789, -0.2731, -0.0257,
-0.2657, +0.0613, -0.7471, +0.1597, +0.6435, -0.1961, +0.0205,
-0.3476, -0.1768, +0.1272, -0.3248, -0.1725, -0.0518, -0.1520,
-0.8646, -0.4568, -0.2900, +0.0804, +0.2874, -0.1601, -0.1218,
-0.0916, -0.3936, +0.0563, -0.5226, +0.7649, +0.2661, +0.1315,
+0.1456, -0.1783, -0.4065, +0.2313, +0.3206, -0.1751, +0.0491,
+0.6178, -0.4157, +0.5004, +0.4791, -0.8273, +0.3121, +0.5197,
-0.7075, +0.2732, +0.5617, -1.7903, -0.9306, -0.4015, -0.1448,
+0.1041, +0.0514, -0.5475, -0.3665, +0.0613, +0.3292, +0.5653,
-0.1457, +0.2908, -0.2775, +0.2372, +0.0219, -0.5245, -0.1014,
-0.7805, -0.2367, +0.0397, +0.3511, -0.4261, -0.0955, +0.0628,
+0.0939, +0.3141, +0.4996, +0.0211, -0.7560, +0.3572, +0.0311,
+0.4276, -0.6596, +0.2172, +0.0416, +0.3343, +0.1415, -0.3582,
-0.2764, -0.5064, -0.6150, +0.2117, -2.0168, -0.0036, -0.4181,
-0.0952, +0.3186, -0.4855, -0.5311, +0.2385, +0.4523, -0.0403,
-0.9055, +0.4183, +0.3096, -0.5405, +0.0984, +0.2680, -0.2033,
-0.5637, +0.3754
],
[
+0.0815, -0.4868, -0.3229, -0.1918, -0.7094, -0.4347, -0.4141,
+0.3582, -0.0272, -0.1804, +0.2254, -0.2479, +0.1649, -0.3197,
+0.2285, -0.0620, -0.4405, -0.1798, -0.7993, +0.2816, -0.3819,
-0.1264, +0.1136, +0.2591, -0.0338, +0.2426, +0.3092, +0.2532,
-0.1220, -0.5627, +0.4531, -0.5025, -0.0519, -0.0247, +0.0790,
+0.0817, +0.1633, -0.0444, -0.4636, -0.1700, +0.0939, -0.1771,
-0.0334, -0.9386, +0.3456, -0.2429, +0.0718, -0.0228, -1.7157,
-0.3157, -0.2158, -0.0453, -0.9205, -0.3201, +0.0152, +0.0439,
-0.0100, +0.0594, -0.0715, -0.8998, -0.6740, -0.0128, +0.2614,
+0.0946, +0.0080, +0.0540, -0.8912, -0.1545, -0.4753, -0.1118,
-0.8795, +0.1528, -0.9679, +0.5510, -0.4913, +0.0155, -0.7465,
-0.2269, -0.1916, -0.7147, -0.1364, -0.1825, -0.3343, -0.5667,
+0.3604, -0.3926, -0.1481, -0.0674, -1.1057, +0.2662, -0.4133,
+0.0483, -0.1386, +0.3793, -0.4958, -0.6745, -0.0975, -1.0668,
-0.6878, -0.8876, +0.0577, -0.1947, -0.8066, -0.1917, +0.0802,
+0.0349, -0.1140, -1.5906, +0.5666, -0.9585, +0.5123, -0.4561,
+0.1220, -1.2760, -0.2994, +0.5025, +0.1188, +0.0047, -0.7984,
-0.1449, -0.0897, +0.1967, -0.2902, +0.9205, +0.3216, +0.1896,
+0.0031, +0.0811
],
[
+0.1508, -1.1152, -0.4444, -0.1015, +0.2495, +0.3801, -0.1659,
+0.3051, -0.0344, +0.0685, +0.1417, -0.2961, +0.2852, -0.7454,
+0.2276, -0.6416, -0.6397, +0.0890, +0.2244, +0.0755, +0.2155,
+0.2553, +0.0755, -1.2678, +0.0580, +0.0448, +0.3109, -0.2716,
-0.2427, +0.0622, -0.1986, -0.0201, +0.1963, +0.1069, -0.0677,
-0.3124, -0.2603, -0.0496, +0.1603, +0.0779, -0.0491, +0.1279,
-0.1761, -0.1035, -0.0013, -0.2889, -0.0354, -0.2291, +0.1568,
+0.2295, -0.4736, +0.2320, -0.0130, -0.6341, +0.2555, +0.2521,
-0.8990, -0.0297, -0.4157, -0.8187, +0.3604, +0.3897, +0.2412,
-0.1096, -0.2729, -0.5034, -0.3382, +0.3082, +0.0280, -0.7055,
-0.1825, +0.0428, -0.2388, -0.5499, +0.6341, -0.1584, +0.3710,
-0.7945, +0.1762, +0.2580, -0.4087, -0.6248, -0.1134, -0.1217,
-0.0592, -0.6103, +0.5790, +0.0986, -0.4863, +0.3986, -1.6397,
+0.2345, -0.4191, -0.3749, -0.8363, -0.5947, -0.1273, -0.0475,
-0.7957, +0.2344, -0.2187, +0.0841, +0.1320, -0.0680, -0.8809,
+0.0584, -0.6072, -0.6798, +0.2180, -1.3019, -0.3872, +0.4067,
+0.3076, +0.7941, +0.8064, -0.4320, -0.4769, +0.0634, -1.0734,
-0.0873, -0.2996, -1.0084, -0.0319, -0.1943, -0.0330, -0.1190,
-0.3231, -0.2432
],
[
+0.8061, +0.0414, -0.5187, -1.8237, -0.1573, +0.3550, -0.0713,
+0.0761, +0.2378, +0.1792, -0.1353, -0.1836, +0.3602, +0.4975,
-0.3694, -0.9753, -0.8763, -0.6916, -0.6294, +0.3999, +0.5712,
-0.3162, -0.4714, -0.2927, +0.1412, +0.2313, +0.2226, +0.2106,
-0.2885, -0.0488, +0.2140, -0.4388, -0.6004, +0.2552, -0.5705,
-0.1103, -0.3916, -0.3245, +0.0148, +0.3116, -0.7406, -0.3943,
+0.3876, -0.2876, -0.6687, +0.1455, +0.2159, +0.3626, +0.1751,
+0.4169, +0.2423, +0.1283, +0.4872, +0.0035, +0.0388, +0.2582,
+0.4407, -0.8525, -0.4614, -0.4708, -0.0271, +0.3957, +0.2106,
-0.6293, -0.3893, -0.3817, -0.5386, -0.3784, -0.0756, -0.5606,
-0.2913, -0.2612, -0.7377, +0.2709, +0.0092, -0.2244, +0.7055,
-0.2901, +0.0308, +0.4058, -1.6255, -0.1924, -0.1218, -0.4762,
-0.1004, +0.5754, -0.2167, -0.9728, +0.1414, +0.0720, -0.4261,
+0.2407, +0.1644, -0.3591, -0.8870, -0.6904, -0.5330, +0.3033,
-0.1471, -0.3799, +0.0609, -0.0158, -0.1149, +0.0969, +0.3944,
-0.6251, +0.3801, -0.3275, -0.5975, -0.1105, -0.8845, +0.4784,
+0.6250, -0.5131, -0.1038, +0.7839, +0.0422, +0.0789, +0.3880,
+0.3156, -1.7372, -1.0678, +0.4849, -0.2369, +0.1520, -0.2966,
+0.0060, -0.3120
],
[
-0.2918, -0.2262, -0.3504, -0.0837, -0.4429, -0.8962, -0.4601,
+0.0141, -0.0975, -0.1129, +0.5787, +0.4863, -0.1125, -0.2147,
+0.4314, -0.1362, +0.2811, +0.8989, -0.9412, +0.3465, +0.4242,
-0.2377, +0.2412, +0.3327, +0.1597, +0.0798, +0.2373, -0.1421,
+0.0364, -0.9199, +0.0272, +0.0701, -0.2294, -0.3992, +0.0251,
-1.9692, -0.0399, -0.1494, +0.1042, +0.1043, +0.4137, -0.1997,
-0.3013, -0.5738, +0.2823, +0.3191, -0.2606, +0.1708, -0.9317,
-0.0394, +0.4235, +0.1541, -0.4125, -1.0192, -2.3828, -0.2181,
-0.2494, -0.3435, +0.3089, -0.9115, -0.1843, -2.0460, -0.1583,
+0.5973, -0.0500, -0.8085, -0.3261, -0.4273, -0.1561, -0.5951,
-0.2680, +0.3162, +0.2059, -0.6817, +0.1199, -0.2442, -0.0533,
+0.3222, -0.4804, -0.6010, -0.4073, +0.8277, +0.0078, -0.2969,
-0.4418, +0.3121, -0.0361, -0.5091, +0.4132, +0.3545, +0.4635,
-0.4379, +0.6498, +0.2989, -2.3967, -0.1776, +0.1242, -1.1995,
+0.4168, -1.4933, -0.0583, -1.2506, -0.3718, +0.3099, +0.1641,
+0.4878, -0.2551, +0.5048, -0.4897, -0.3886, +0.0833, +0.1213,
+0.0227, -0.8806, -0.6782, +0.5467, -0.1304, +0.3051, +0.4033,
+0.1663, -0.8800, -0.6483, +0.2446, +0.0204, +0.2517, -1.2316,
-0.0747, +0.5904
],
[
+0.2094, +0.4037, -0.8266, -0.2985, -0.9099, +0.0830, -0.6207,
+0.4955, +0.6387, -0.8040, +0.4625, -0.2901, -0.6773, +0.3770,
+0.7285, +0.3740, +0.0346, -0.0444, -0.0635, -0.1103, +0.2181,
+0.5463, +0.3262, -0.1519, +0.3058, +0.1327, -0.3031, -0.7194,
-0.5021, +0.0379, -0.0157, -0.0427, +0.1579, -0.1737, -0.2882,
+0.1571, +0.2838, +0.2221, -0.0288, -0.0749, -0.0014, -0.2073,
-0.5759, +0.5900, -0.3818, +0.1474, +0.4674, -0.0011, -0.1010,
-0.3498, +0.6558, -0.0812, -0.3489, +0.0398, -0.1400, -0.2533,
-0.6793, -0.0488, +0.2128, +0.0621, -0.0049, +0.9653, -1.1831,
-0.3126, +0.0806, -0.4907, +0.4353, +0.3233, +0.0632, -0.6646,
-0.4535, -0.0299, +0.6531, +0.0920, -0.2882, -0.2987, +0.4691,
-0.0792, +0.1770, -0.4178, -0.0450, +0.1346, +0.1328, +0.1063,
-0.5334, +0.0142, -1.1001, -0.5854, -0.0311, +0.5967, -1.1213,
+0.3408, +0.1359, +0.3228, -0.4258, -0.2816, +0.4218, -0.4707,
-1.0189, -0.2999, +0.1977, -0.3483, -0.0017, -0.2277, -0.0898,
-0.2637, -0.3317, -0.1012, -0.1405, -0.4500, -0.6260, +0.6423,
+0.2137, +0.5864, +0.0911, +0.2422, -0.5717, -0.5104, -0.5501,
+0.4084, -0.6578, -0.2792, -0.0373, +0.1023, -0.4588, -0.2065,
+0.4159, +0.0291
],
[
-0.0633, +0.1900, -0.0316, -0.6121, +0.0363, +0.0089, -0.1875,
-1.7498, +0.0125, -0.1088, +0.2785, +0.1229, +0.0286, +0.2072,
+0.0906, -0.1487, +0.0048, -0.6439, -0.8480, -0.1054, -0.3508,
+0.4092, +0.3682, +0.3626, -0.1944, +0.1335, +0.4123, -0.3110,
-0.7782, -0.0082, +0.5426, -0.9679, +0.3419, +0.2434, -0.4558,
+0.1008, +0.1001, +0.3073, -0.3161, -0.7719, -0.3348, +0.1857,
+0.6334, -1.0666, +0.1509, -0.0705, +0.3096, -0.6401, -0.0345,
+0.1606, -0.7597, +0.0135, -0.0459, -1.0242, -0.2522, +0.1098,
-0.7466, +0.2503, -0.7443, -1.0207, -0.5589, -0.4333, -0.3767,
-0.9047, +0.3236, -0.2105, +0.0718, -0.3654, +0.3875, +0.0695,
+0.3379, +0.5472, -0.0609, -0.0038, -0.5566, +0.4001, +0.0368,
+0.3434, +0.1840, -0.2020, -0.1040, -0.1571, +0.0542, +0.2845,
+0.3815, -0.6025, -0.0693, -1.2639, -0.9612, +0.2361, -1.5898,
-0.6602, -0.3257, -0.0902, -0.0034, -0.2451, -0.2921, -1.2953,
-0.3734, +0.2509, -0.3979, -0.5262, -0.8265, -0.6400, +0.0767,
+0.3744, -0.2818, -0.6876, +0.5142, +0.2778, -0.3917, -0.4421,
-0.4253, +0.7273, -0.4951, +0.3048, +0.3287, +0.1589, -0.3765,
+0.2310, +0.1045, +0.0334, -0.0645, -0.0329, +0.2335, +0.1058,
-0.4252, +0.2281
],
[
-0.4140, -0.4391, -0.5113, +0.0978, +0.1550, -0.1891, -0.1878,
-0.7209, +0.6270, -0.6307, -0.0813, -0.3831, +0.2939, -0.4056,
-0.0919, -1.0405, -0.4539, -0.5300, -0.8153, +0.1230, -0.2606,
-1.0893, +0.5740, -0.0727, -0.4035, +0.3717, +0.0811, +0.0787,
+0.0551, +0.0799, +0.0022, -0.0810, -0.1550, -0.0919, +0.0184,
+0.1899, +0.3246, +0.3190, -0.4321, -0.8694, +0.2681, -0.1237,
+0.0163, -0.4255, -0.6452, -0.5593, -0.4473, +0.2048, -0.4597,
+0.1990, +0.7002, +0.0012, -0.3186, +0.0787, -1.0031, +0.3690,
+0.3852, +0.2772, +0.2252, -0.1840, -0.6804, -0.6328, +0.2052,
-0.2431, -0.0694, -0.5177, -0.0266, -0.4128, -0.1556, +0.0945,
-0.1813, +0.1167, -0.3094, +0.3329, +0.2081, -0.6154, -0.3685,
+0.3549, -0.4292, +0.1615, +0.3999, +0.0454, +0.2819, +0.3528,
+0.3521, +0.0139, -0.7987, -0.4235, +0.2299, +0.0016, +0.5296,
+0.3507, +0.0363, -0.0489, +0.6135, -0.1952, +0.3045, -0.0518,
+0.0352, +0.0725, -1.1994, +0.2048, -0.2690, -0.0496, +0.4500,
-0.0757, +0.4166, +0.2138, -0.0075, -0.0621, +0.8098, -0.3943,
+0.1628, -0.8582, +0.2362, +0.3902, +0.3173, -0.1347, -0.4285,
-0.2000, +0.4943, -0.2492, -0.1656, +0.2132, -0.0433, +0.2884,
-0.2845, -0.4936
],
[
-0.4738, -0.0158, -0.2765, +0.1722, +0.3621, +0.5771, +0.1723,
-0.8243, +0.0913, -0.3469, +0.5777, -0.2210, -0.1961, -0.8988,
+0.5442, +0.2901, -0.2991, +0.6127, -0.2821, +0.3159, -0.8808,
-0.0491, -0.1903, +0.1704, +0.2932, -0.0118, +0.2040, -0.2998,
+0.4355, +0.1396, +0.0578, +0.2586, +0.2063, +0.1804, +0.0332,
+0.1979, +0.1810, -0.3074, -0.4613, -0.3067, +0.1214, -0.0493,
-0.0024, +0.4824, +0.2318, -0.0506, +0.3857, +0.3477, -0.8468,
+0.3712, -0.4446, -0.1276, -0.0269, +0.3221, -0.2202, +0.2256,
+0.0683, -0.2882, +0.2667, -0.3171, -0.1336, -0.0404, -0.0441,
+0.1958, +0.1474, -0.2557, -0.8337, +0.0171, +0.1839, -0.5242,
+0.1376, +0.7396, -0.2130, -0.0796, -0.3462, -0.1404, +0.0744,
-0.1832, +0.5701, +0.0777, +0.2206, +0.2120, +0.2066, -0.2115,
-0.2945, +0.2164, -0.3908, +0.2701, +0.2148, -0.0048, -0.1246,
+0.0619, -0.4415, +0.0907, -1.4013, -0.1996, +0.1082, +0.0862,
+0.1056, +0.6264, -0.0440, -0.7101, -0.7725, -0.8352, +0.1243,
-0.2385, -0.0286, -0.1492, -0.0639, +0.2705, +0.1741, -0.3408,
+0.3609, +0.7159, +0.3274, -0.3942, +0.2419, +0.3255, -0.0995,
-0.0738, -0.2326, -0.8728, -0.0007, -0.0530, +0.4491, +0.4334,
+0.2235, -0.5149
],
[
+0.3999, +0.4161, -0.5792, -0.1638, -0.0401, +0.2404, +0.2323,
+0.0217, -0.0647, -0.8051, -0.9147, +0.0337, -0.2957, +0.1351,
+0.0574, +0.1644, -0.3406, -0.1560, +0.3007, -0.2773, -0.2168,
+0.3504, -0.0845, -0.2320, +0.1636, -0.3549, -1.1003, +0.3613,
-0.8127, +0.1260, -0.1164, +0.2141, -0.9710, +0.8408, +0.3108,
+0.0717, -0.1734, -0.0426, +0.1837, +0.2777, +0.4342, +0.0072,
-0.7050, -0.2702, -0.7281, -0.1669, -1.3528, -0.8867, +0.2906,
+0.0970, -0.0789, +0.2028, -0.0715, -0.1935, -0.0710, -0.3757,
+0.7201, +0.0652, +0.1590, +0.5348, -0.0384, +0.3781, +0.1935,
+0.4964, -0.2404, -0.5474, +0.1082, +0.0798, -0.7492, -0.3952,
-0.4727, -0.4758, +0.1355, +0.1009, +0.1819, -0.3007, -0.0196,
+0.2785, -0.0800, +0.6883, +0.1986, +0.3387, -0.0251, +0.4226,
-0.0952, -0.7956, -1.0131, -0.8996, -0.0791, -0.1689, -0.6311,
+0.0509, +0.4836, -0.0825, -0.2963, -0.5650, +0.1117, -0.3100,
+0.1132, -0.8710, +0.2885, -0.2328, +0.5853, +0.1142, +0.1174,
+0.3191, +0.2894, +0.0455, -0.8276, -0.0121, -0.1303, -0.1764,
+0.3464, +0.5618, -0.0948, +0.3641, -0.6222, +0.0030, -0.2741,
-0.5782, -0.3197, +0.5524, -1.0324, +0.3513, -0.5829, -0.1195,
+0.0778, -0.4998
],
[
-0.3566, +0.0670, +0.3577, +0.5295, -0.2605, +0.4155, -0.0461,
+0.0135, +0.4739, -0.3473, +0.8062, -0.0381, -0.5666, -0.3236,
-0.6585, -0.2073, -0.7391, +0.1240, +0.0095, -0.0581, -0.1210,
-0.0318, -0.3297, -0.1456, -1.0478, -0.3795, -0.9441, +0.5343,
+0.0613, -0.1349, -0.3619, -0.2339, -0.6799, +0.7598, -0.4541,
+0.0684, -0.1045, -0.0131, -0.8898, -0.0297, +0.3299, -0.0869,
-0.0549, -1.5833, +0.3829, -0.0927, +0.1164, -0.2028, +0.6262,
-0.2578, -0.2788, +0.4153, +0.3932, -0.1627, +0.2694, +0.2254,
+0.0485, -0.1574, +0.0571, +0.3084, -0.1627, -0.0165, +0.5349,
+0.0071, +0.2080, +0.2899, +0.1979, +0.3030, +0.5253, +0.1890,
+0.1115, +0.0426, +0.3508, +0.3014, -0.1113, +0.4422, +0.5590,
+0.2923, +0.2363, -0.3012, -0.1984, -0.0192, -0.0310, -1.1952,
-0.3245, -0.0701, -0.0854, -0.8582, -0.2550, -0.3040, -0.1221,
+0.2037, -0.5178, -0.2820, +0.0618, +0.6848, -0.2248, -0.1200,
+0.4649, +0.0764, +0.2552, -0.2030, -0.3596, +0.1910, -0.3935,
+0.4110, -0.2730, +0.3675, -0.5421, -0.0933, +0.2148, +0.0517,
+0.3015, -0.1655, +0.1093, -0.2327, +0.0471, +0.0495, -0.3547,
+0.1874, -0.4726, -0.4709, -0.3212, +0.0643, +0.4104, -0.2445,
-0.2715, +0.3497
],
[
-0.3460, -0.0247, -0.3679, +0.2280, +0.5255, +0.1160, -0.2873,
+0.0290, +0.0658, -0.6741, +0.0203, -0.3913, -0.5221, -0.6916,
-0.1703, -0.8972, -0.3779, -0.1352, -0.1635, -0.1056, -0.1549,
+0.1882, -0.2525, +0.0203, -0.3930, +0.0924, +0.1071, -0.6681,
+0.3224, +0.0302, -0.5123, -0.3224, +0.2410, +0.2783, +0.3554,
+0.1055, +0.2246, +0.4666, -0.0120, -0.0394, -0.4212, -1.6024,
-0.3518, +0.0282, -0.1718, +0.2194, -0.4077, +0.4651, +0.0556,
+0.5885, +0.2617, +0.0363, -1.5114, +0.0687, -0.5579, -0.2032,
+0.8185, -0.3873, -0.2995, -0.4347, +0.4054, +0.3423, -0.2112,
-0.5053, +0.1885, -0.1289, +0.0005, +0.2305, +0.1113, +0.1777,
+0.4680, +0.3591, +0.1185, +0.1904, +0.0793, -0.0519, +0.6681,
-0.1187, +0.0313, +0.3139, +0.4099, -0.3367, +0.0264, +0.7315,
-0.4034, -0.2053, -0.0312, -0.4737, -0.4315, +0.1450, +0.2905,
+0.0513, +0.1233, +0.3458, -1.0577, -0.4384, +0.2307, -0.2988,
-0.1299, +0.0850, -0.6017, -0.3036, -0.8614, -0.1928, -0.9890,
-0.4472, +0.0402, -1.5595, -0.4688, +0.1330, -0.8697, -0.8565,
+0.1233, -0.6775, +0.0021, -0.0146, -0.0389, +0.6895, +0.6748,
-0.5974, +0.0158, +0.0060, +0.3573, +0.0680, -0.0926, -0.2050,
-0.4197, -0.1597
],
[
+0.1891, +0.1122, -0.5610, -0.8994, -0.5449, +0.5029, -0.3364,
-1.2799, -0.9692, -0.5666, -0.2846, +0.1047, +0.4240, -0.4109,
-0.4119, +0.0980, -0.6415, +0.1580, +0.5822, +0.1547, -0.3187,
-0.0076, -0.5339, -0.1303, +0.3331, -0.3424, +0.0772, +0.1627,
-0.9344, +0.0275, -0.3101, -0.3224, +0.3266, -0.5172, -0.3805,
+0.9751, -0.9742, -0.8692, -0.0544, -0.3695, -0.1767, +0.2266,
+0.3360, -0.3269, +0.1319, -0.1249, +0.3600, +0.7534, -1.9579,
+0.0168, -0.4798, +0.3251, +0.2135, -0.3825, -0.1489, -0.3484,
+0.0174, -0.6041, -0.0943, +0.4646, +0.1946, -0.3953, +0.0745,
-1.0481, -0.0381, -0.0483, -0.6462, +0.2311, +0.0149, -0.2660,
+0.3559, -0.3173, +0.3713, +0.0860, +0.5249, -0.4836, -0.1196,
+0.4732, -0.0573, +0.0751, -0.3692, -0.0531, -0.5510, -0.8530,
-0.0153, +0.1275, -0.3970, +0.2427, +0.3064, +0.2559, +0.2124,
+0.3455, +0.3750, -0.3621, -0.3717, -0.3938, +0.2608, -0.3003,
+0.3163, +0.8138, -0.3208, +0.4267, +0.1622, +0.0802, -0.2647,
+0.2078, -0.1138, -0.8264, -0.1568, -0.6197, +0.3754, -1.2493,
-0.0603, -1.7287, +0.6661, -0.2143, +0.2809, -0.7342, -0.2961,
+0.1394, +0.2656, +0.1807, +0.5828, -0.5450, +0.3207, +0.0057,
+0.0039, +0.3181
],
[
-0.0280, +0.4064, +0.7043, -1.0389, +0.1923, -0.0091, -0.6891,
-0.1993, +0.0138, +0.1689, +0.2214, -0.2040, +0.1393, +0.2917,
-0.1474, -0.0371, +0.0503, -0.4136, +0.7585, +0.0595, +0.3568,
-0.6041, +0.2441, -0.5409, +0.1036, +0.2503, +0.2190, +1.0548,
-0.4079, -0.1604, +0.3204, +0.8233, +0.1581, -0.2578, +0.8894,
-0.3164, -0.2615, +0.0106, -0.1043, -1.6156, +0.1678, -0.4879,
-0.5066, -0.9457, -0.0135, +0.0765, +0.3967, -0.2431, +0.2703,
+0.3481, +0.1127, -0.2120, +0.2531, -0.0420, +0.2590, -0.2827,
+0.0810, +0.1260, -0.5727, -0.2298, -0.9872, +0.2354, -0.0038,
+0.1316, -0.2633, +0.3596, -0.4560, +0.0477, +0.3235, -0.2541,
+0.7789, -0.1461, -0.5637, -0.2323, -0.5482, +0.1176, -0.1410,
-0.6329, -0.5649, +0.3793, -0.0715, -0.3250, -0.5338, -0.7280,
-0.4626, -0.2513, -0.3433, -0.0288, -0.0091, +0.6689, -0.1540,
-0.7026, +0.3719, -0.2011, +0.0463, -0.5744, -0.5172, +0.0868,
+0.1896, +0.1622, -0.0330, -0.4509, +0.8395, -0.1213, +0.2093,
-0.2008, -0.7906, +0.4472, -0.3448, +0.4654, +0.2722, -0.1167,
+0.3253, +0.3181, +0.1789, +0.3003, +0.1138, +0.2300, -0.7714,
+0.1366, -0.2502, +0.1757, -0.5757, +0.4775, -0.0934, -0.1466,
-0.2202, -0.0247
],
[
-0.2769, -0.4844, -0.3218, -0.3712, -0.7460, -0.1288, -0.0567,
-0.1479, -0.1536, +0.3630, +0.3212, +0.1854, -0.5243, -0.5611,
-0.6008, -0.5943, -0.3658, -0.4895, +0.1720, +0.4116, +0.0328,
-0.0545, +0.1886, -0.3732, -0.1733, +0.2179, -0.5173, +0.2468,
-0.2607, -0.0678, -0.0360, +0.4942, +0.0898, +0.6431, -0.2604,
-0.4927, -0.1629, +0.2905, -0.0363, -0.5312, +0.1221, -0.0275,
-0.6900, +0.0902, +0.2585, +0.0698, -0.4510, -1.0082, +0.0656,
+0.1257, -0.0968, +0.0258, -0.1017, -0.1600, -1.1350, -0.1891,
-0.1417, +0.0675, +0.1163, -0.0818, -0.0141, -0.4789, -0.8681,
-1.1096, -0.3683, -0.4197, +0.0667, +0.4919, +0.0937, +0.4707,
-0.4875, -0.1434, -0.1309, -0.1494, +0.4293, +0.5837, +0.4335,
-0.3542, +0.2858, -0.4738, -0.2478, +0.2231, +0.0185, +0.1273,
+0.4333, +0.4926, -0.5192, +0.1540, -0.6322, +0.3050, -0.0561,
+0.4242, -0.6576, -0.1632, -1.3002, +0.2911, -0.8649, +0.2074,
+0.4507, -0.5161, +0.1431, +0.0479, +0.1763, -0.2115, -0.1463,
+0.7066, -0.1477, -0.2690, -0.2031, +0.2401, -0.5833, +0.4310,
+0.2519, +0.0066, +0.5099, +0.2787, -0.5172, +0.1471, +0.4772,
+0.2075, -0.7542, -0.3488, +0.1534, -1.9077, +0.0053, +0.2767,
+0.2842, +0.3068
],
[
+0.1627, +0.0932, -0.0692, +0.0333, +0.3671, +0.0617, +0.1825,
+0.2126, -0.1105, -0.3398, -0.2716, -0.4564, +0.0132, +0.0497,
+0.5738, -0.8727, +0.1385, -0.3337, -0.1708, -0.1856, -0.1948,
+0.6282, +0.6461, +0.5056, -0.0936, +0.3556, -0.7145, +0.2956,
-0.1190, +0.4536, -0.2825, +0.3600, -0.1794, +0.8380, +0.3844,
-0.3455, -0.3925, +0.2874, -0.4389, +0.2259, +0.0381, -0.4052,
-0.0864, +0.3228, +0.2352, +0.2540, +0.4140, -0.1725, +0.3446,
+0.0663, +0.1490, -0.7661, +0.4594, +0.3423, +0.0742, +0.2266,
+0.2925, +0.0026, -0.4927, +0.2868, +0.0799, +0.6575, -0.6153,
+0.2773, -0.1182, +0.0802, -0.7272, +0.1809, -0.1299, +0.0545,
+0.0146, -0.1938, +0.4941, +0.3754, -0.1482, +0.4977, +0.0251,
-0.4961, -0.3299, -0.1679, +0.3145, +0.4671, -0.2297, -0.1446,
+0.1179, -0.1848, +0.5299, +0.6279, +0.7981, -0.0374, -0.4267,
-0.1548, +0.0680, -0.1861, +0.1613, +0.0075, -0.6424, -0.3829,
+0.2955, -0.2015, -0.8048, +0.4824, +0.1460, -0.2246, +0.5881,
-0.2222, +0.1126, +0.3343, +0.8536, -0.6848, +0.5377, -0.0368,
+0.1391, -0.1359, -0.3442, -0.3034, -0.4391, +0.1235, -0.0406,
+0.0089, +1.2666, +0.0973, -0.6750, +0.1518, +0.3950, +0.1489,
-0.0426, -0.3698
],
[
-0.1249, -0.2586, +0.5466, +0.5176, +0.3041, -1.0447, -0.1893,
-0.3644, -0.0254, +0.3762, +0.1505, +0.3849, +0.5096, -0.4326,
+0.0874, +0.3525, +0.0466, +0.3403, +0.0881, -0.4224, +0.3217,
+0.3785, -0.2631, +0.4593, -0.2674, -0.1998, -0.1385, +0.2314,
-0.4872, -0.2581, -0.4222, -0.3113, -0.1859, -0.0358, -0.1046,
-0.7881, +0.0959, +0.1361, -0.5511, -0.1600, -0.1596, +0.4817,
-0.4353, +0.0208, -0.5273, -0.1125, +0.4736, -1.0330, -0.1043,
+0.4457, -0.3403, -0.5466, -0.6678, +0.3428, +0.1688, -0.0121,
+0.2024, -0.0831, -0.6305, -0.1766, +0.4599, -0.4830, -0.6242,
-0.2924, +0.4737, -0.1717, -0.4773, -0.3370, +0.8250, +0.2123,
+0.3336, -0.5152, -0.1952, +0.0197, -0.1985, +0.0554, -0.7055,
+0.6239, -0.2258, -0.6815, -0.4525, -0.2257, +0.0849, +0.6123,
+0.3497, +0.2228, -0.0817, -1.1429, +0.3994, -0.3225, +0.3986,
-0.0081, +0.2777, -0.2004, -0.7202, -0.4120, +0.3846, -0.2532,
-0.8475, -0.8692, -0.0659, -0.6207, +0.2605, +0.0058, -1.5390,
-0.2211, -0.2353, +1.4223, +0.4847, +0.0080, +0.2586, +0.0283,
-0.3735, -1.1436, +0.3844, +0.7311, -0.5703, -0.1188, +0.0333,
-0.3770, -0.4160, -0.5079, -0.5831, -0.2401, -0.5277, +0.2274,
+0.0551, -0.0440
],
[
-0.2948, -0.2675, -0.3498, +0.0672, -0.6153, -0.3831, +0.2727,
-0.4699, -0.4750, +0.4319, +0.3771, +0.0785, +0.0081, -0.2131,
-0.3405, +0.0619, +0.4527, +0.1726, -0.1512, +0.1530, -0.2053,
-0.3135, -0.0249, +0.3128, -0.4377, +0.2800, +0.3620, -0.8843,
-0.6940, +0.2616, +0.2476, -1.4521, +0.1270, +0.2371, +0.1431,
-0.0657, +0.4752, -0.3677, -1.3756, -0.3213, +0.1166, -0.2154,
-0.5762, +0.0691, +0.4376, +0.1365, +0.4809, +0.0093, +0.0810,
-0.1205, +0.2233, -0.0932, -0.2922, +0.0394, -0.1762, +0.2118,
+0.2160, +0.1256, +0.0622, +0.6482, -0.1080, +1.0528, +0.4798,
+0.2713, +0.0338, -0.0506, -0.7699, -0.4552, +0.3653, +0.3004,
+0.3685, +0.2309, +0.0852, +0.3183, -1.8090, -0.1127, -0.3724,
+0.2288, -0.0874, +0.6633, +0.5991, -0.9262, +0.2167, +0.2694,
-0.0009, -0.3100, +0.1314, -0.6853, -0.6782, -0.1331, -0.5942,
-0.3491, +0.4602, +0.3154, +0.5430, -0.6382, +0.4787, -0.0395,
-0.4122, +0.0822, +0.1106, -0.2653, -0.1207, +0.2503, +0.0988,
-0.1648, +0.3514, +0.2168, -0.4024, -0.0270, +0.0449, -1.0198,
+0.0083, -0.1998, +0.2589, -0.8012, +0.6724, -0.8470, -0.8099,
-0.5403, -0.3611, -0.1546, -0.0373, +0.0279, -0.1776, -0.1399,
-0.2660, +0.2166
],
[
+0.1468, +0.1605, -0.7206, -0.1315, +0.1711, -0.0937, +0.1821,
-0.2529, +0.3596, +0.5021, +0.2899, -0.1337, -0.0562, -0.3750,
-0.0213, -0.3416, +0.1163, -0.3959, -0.1453, -0.0226, -0.2151,
-0.1230, -0.1099, +0.0746, -0.1753, +0.3563, -0.0813, +0.1116,
+0.0483, -0.0490, +0.1264, -0.4237, -0.3931, -0.0208, -0.4030,
-0.0314, -0.3142, +0.4447, -0.6161, -0.4919, -0.0185, +0.4071,
+0.1044, -0.8308, -0.2317, +0.1504, -0.5274, -0.3391, +0.1318,
-0.0589, -0.0422, +0.1590, -0.4159, +0.4971, -0.8429, +0.1896,
+0.4471, +0.5414, +0.2074, -0.1459, +0.1880, +0.3062, -0.2648,
+0.3391, -0.1389, +0.3524, -0.4327, -0.6014, +0.1049, -0.1632,
-0.2835, +0.4386, -0.1937, +0.4618, +0.0392, -0.0116, +0.0426,
+0.5406, -0.3774, +0.1741, +0.7146, -0.1920, +0.2511, -0.4769,
+0.4593, -0.7666, +0.2325, -0.4224, -0.1658, +0.0027, -0.0929,
-0.4411, +0.0945, +0.5415, +0.5139, +0.0461, +0.0246, +0.2496,
-0.0086, -0.0972, -0.1127, +0.5594, -0.3779, +0.3021, +0.7424,
-0.7742, +0.4401, +0.3576, +0.2463, +0.2575, +0.0405, +0.2020,
+0.0751, -0.8001, -0.0496, +0.0415, +0.9000, +0.1513, -1.0452,
-0.5526, +0.0345, +0.4193, -0.0346, -0.4692, +0.3855, +0.3223,
-0.0605, +0.2719
],
[
-0.3304, -0.5461, +0.1105, -0.4784, +0.8587, +0.2012, +0.2441,
+0.3844, -0.0353, +0.2197, -0.4514, -0.1174, -0.3371, +0.6193,
+0.5215, +0.0668, +0.2793, +0.0772, -0.3565, -0.7580, +0.0638,
-0.0688, -0.5527, +0.5006, +0.2147, +0.3336, -0.1883, -1.2293,
-0.3735, +0.2956, -0.8615, -0.1399, -0.5002, +0.2953, -0.4261,
+0.0643, -0.4822, +0.5314, +0.2076, -0.1544, -0.3966, -0.0563,
-0.2849, -0.1433, -0.1702, +0.3132, -0.2281, -0.4330, +0.4116,
+0.5219, -0.1308, -0.7934, +0.2316, +0.3169, +0.0822, -0.0786,
-0.2983, -0.2409, -0.4243, +0.0411, +0.3327, +0.0553, -0.1777,
+0.4661, -0.0095, -0.7174, +0.2346, +0.1966, +0.1853, +0.1936,
-0.1538, +0.0861, +0.1072, +0.4284, -0.4048, +0.2446, +0.0831,
-0.3847, +0.1770, +0.3220, +0.3967, +0.0473, +0.0293, +0.7619,
+0.6648, -0.0809, +0.2496, -0.5963, +0.6097, -0.0942, -0.8157,
+0.0398, +0.1286, -0.3510, -0.0276, -0.4275, +0.2023, +0.1366,
+0.7164, +0.2144, -0.4248, +0.3646, +0.2128, -0.2796, +0.4273,
-0.5062, +0.4408, +0.1130, -0.3957, -0.1383, +0.0493, +0.0144,
+0.2001, +0.1299, -0.1198, +0.2288, -0.3851, +0.2022, -0.8794,
+0.6381, -0.2271, +0.0757, +0.6264, +0.1603, +0.1398, -0.5992,
-0.5076, +0.4124
],
[
-0.4653, +0.2013, -0.6020, +0.2698, -0.1746, -0.0599, -0.8512,
+0.4460, -0.1568, -0.4250, +0.2001, -0.3419, +0.2083, +0.2165,
-0.5031, -0.0974, +0.3348, +0.1919, +0.1043, -0.4256, +0.1499,
+0.4606, -0.4713, +0.0558, -0.1333, -0.1562, +0.2721, -0.0773,
-0.2043, -0.3741, +0.0581, +0.4342, +0.2091, -0.0077, +0.0282,
+0.2841, -1.2537, -1.8891, +0.4342, -0.0602, -0.1319, +0.1746,
+0.2591, +0.1119, +0.3353, -0.0305, -0.3655, +0.1949, -0.1574,
+0.2060, -1.2330, +0.1509, -0.1390, -0.3126, -0.2878, +0.2268,
+0.0015, -1.0281, +0.2765, -1.6093, +0.1884, -0.1080, +0.2171,
+0.1133, -0.3212, +0.0263, +0.4069, -0.3031, +0.2118, +0.2243,
-0.2194, -0.4348, +0.5289, +0.2021, +0.2662, -0.4296, +0.5655,
-0.0506, +0.0327, +0.4667, -0.6388, -0.3863, +0.0791, -1.9748,
-0.7543, +0.1312, +0.3268, +0.0462, -0.3009, +0.1676, +0.6889,
-0.7325, +0.0110, +0.1539, +0.3882, -0.3300, -0.0346, -0.1716,
-0.1278, -0.3229, -0.2927, -0.5614, -0.2496, +0.1966, +0.2029,
-0.0382, -1.7907, +0.1786, +0.1333, +0.4529, +0.4298, +0.0186,
+0.1384, -0.1147, +0.1967, -0.7488, +0.2887, -0.5002, -0.7509,
+0.0944, -0.2133, +0.0350, +0.0661, -0.4390, -0.3448, +0.0407,
+0.4323, -0.2928
],
[
-0.0147, +0.4875, +0.8101, -0.4856, -0.0523, -0.3526, -0.6560,
+0.7529, +0.3859, -0.4544, +0.2600, -0.4286, +0.2637, +0.2107,
-0.1284, -0.1439, -0.1315, -0.8336, -0.1653, -0.3187, -0.2810,
+0.2348, -0.2626, -0.0338, -0.3902, -0.1839, -0.2207, +0.4949,
+0.3045, +0.1014, -0.0807, +0.2200, -0.2967, -0.9202, +0.1546,
-0.4144, -2.4271, -0.0263, +0.4327, -1.0839, -0.1580, +0.1715,
-0.0484, -0.3445, +0.0727, -0.0436, +0.2518, +0.1517, -0.3360,
-0.4268, +0.6681, -0.1279, -0.4185, +0.2538, -0.5804, -0.3471,
-1.3149, +0.2916, -0.2334, -0.3507, -0.2264, +0.2349, -0.0306,
-0.3034, +0.2636, +0.0868, -0.0179, -0.4565, -0.5344, -0.0175,
+0.4892, +0.3090, -0.0237, +0.0411, +0.4259, -0.0677, -2.6061,
+0.2379, +0.2025, -0.1072, +0.1846, -0.0507, -0.2904, +0.1787,
-0.3208, +0.3360, -0.4238, +0.0671, +0.2267, -0.5225, -0.0235,
+0.5066, +0.1909, +0.0754, -0.2492, -0.1392, +0.1230, -0.5220,
-0.1610, +0.4429, -0.4891, +0.1724, -0.4112, -0.1275, +0.1159,
-0.4529, +0.3007, +0.1971, +0.3724, +0.7879, +0.0329, +0.5699,
-0.0586, -0.5128, +0.0962, +0.8331, +0.2197, +0.1847, -0.9229,
+0.4521, -0.6595, -0.0474, +0.4472, -0.4547, +0.2102, -0.4422,
+0.1127, -0.0290
],
[
-0.2493, -0.1717, +0.8604, -0.7542, -0.4952, -0.4122, +0.3039,
-0.4902, -0.2674, -0.0523, -0.2816, +0.0923, +0.1304, -0.1094,
-1.1880, +0.2816, -0.6017, +0.0202, -0.0796, +0.0304, -0.3512,
+0.6504, -0.2099, -0.2257, +0.2124, +0.7719, -0.0650, -0.0281,
-1.1338, -0.5571, +0.1130, -0.1291, -0.7798, -0.2749, -0.5566,
-0.5531, -0.0331, +0.0040, +0.2884, +0.6961, -0.4286, +0.2904,
-0.7414, -0.6173, +0.2576, -0.0848, -0.2355, -0.4300, -0.0720,
-0.4600, -0.2441, -0.7780, +0.1823, +0.1500, +0.4750, -1.0978,
+0.2718, +0.0556, +0.2923, -0.6138, +0.3705, +0.4232, -0.2120,
+0.7972, -0.1092, -0.3228, +0.0125, +0.0879, -0.3939, -0.4144,
-0.3686, -0.6152, -0.3841, +0.0532, +0.0814, -1.0093, +0.1254,
-0.0881, +0.1689, +0.2619, -0.4825, +0.3082, -0.1236, -0.1613,
-0.0734, +0.2569, +0.5777, -0.5805, -0.2631, +0.2626, -0.4563,
+0.2758, +0.5379, +0.4217, +0.3193, -0.2149, +0.2140, -0.0421,
-0.4922, +0.2960, +0.3118, +0.2100, -0.2256, +0.2403, +0.5520,
-0.4115, +0.1593, -0.9762, -0.2154, -0.1241, -0.1680, -0.1556,
-0.1731, +0.1911, -0.1973, -0.4498, -0.3598, -0.5564, -0.5785,
-0.0956, +0.0273, -0.1774, -0.9415, +0.2808, -0.0721, +0.4881,
-0.1166, +0.6181
],
[
-0.0386, +0.1265, +0.0809, +0.3067, +0.2942, +0.6539, +0.3153,
+0.2100, -0.8135, -1.1951, -0.5475, -0.2480, +0.3113, -0.0350,
-0.1093, -0.0782, -0.0263, -0.0035, +0.5323, -0.0407, -0.1539,
-0.1074, +0.0438, +0.6214, -0.4991, +0.4022, +0.1268, +0.1501,
+0.5942, -0.0779, -0.0857, +0.0398, -0.2412, -0.2143, -0.5008,
+0.0085, -0.1958, +0.6470, +0.6039, -0.3274, -0.3645, +0.0357,
+0.0763, -0.0920, -0.1759, +0.1859, +0.5215, -0.1242, +0.0176,
-0.0861, -0.3552, +0.3534, +0.2396, -0.0521, +0.1086, +0.1892,
-0.3544, +0.1131, +0.2045, -0.1855, -0.0832, -1.3791, -0.3627,
+0.0419, -0.6307, -0.2916, +0.1963, -0.1953, -0.2043, +0.2270,
+0.2018, +0.0349, +0.0691, +0.4119, +0.0290, -0.3374, +0.0907,
-0.7810, -0.2323, +0.1644, +0.0718, +0.0805, +0.2973, +0.3208,
-0.1966, +0.1936, +0.1871, +0.3255, +0.1103, -0.0079, -0.3683,
+0.1853, +0.3867, -0.4835, -0.4310, -0.7948, +0.1171, +0.1882,
+0.4107, -0.2627, -0.0889, +0.1034, +0.2893, +0.0155, +0.0468,
-0.1663, +0.0111, +0.5293, +0.3996, -0.0184, +0.4669, -0.8742,
+0.0247, -0.1326, +0.2207, +0.2451, +0.1919, -0.2266, -0.3340,
+0.3490, -0.1676, +0.0994, -0.7257, +0.3689, -0.1808, +0.0645,
-0.1275, -0.5453
],
[
-0.4692, -0.1094, +0.0659, -0.0332, -0.6763, -0.1042, +0.2339,
+0.7994, -0.0650, -0.2682, -0.3786, -0.0333, +0.1062, +0.4097,
+0.2444, +0.0130, +0.0209, -0.1417, -0.1984, -0.2713, -0.0615,
-1.2190, +0.6678, +0.1132, -0.1875, -0.0167, -0.4101, -0.2796,
-0.0204, -0.1975, +0.5072, -0.0493, -0.0868, -0.1605, -0.1213,
+0.1540, +0.2977, +0.0866, -0.5916, -0.6326, +0.2374, +0.1011,
+0.4999, -0.2778, -0.3732, -0.2621, -0.0390, -0.8054, +0.2065,
+0.4601, +0.2876, +0.6231, -0.5389, -0.0494, -0.4927, -0.0118,
+0.3478, -0.0583, +0.4044, -0.6412, -0.0135, -0.2810, +0.3404,
-0.6886, +0.1874, +0.1197, -0.6534, -1.3675, +0.0585, -0.9163,
-0.0759, +0.1681, -0.2062, +0.1995, +0.3509, +0.1485, -0.1827,
-0.0109, -0.0520, -0.6026, -0.0309, +0.1481, +0.0998, -0.2491,
-0.1177, -0.0872, +0.3857, -0.0211, +0.1284, -0.1741, -0.2777,
-0.3062, -0.3271, +0.4802, +0.1352, -0.4759, -0.2406, +0.6412,
+0.5612, -0.1696, +0.2148, +0.1793, +0.0844, -0.0520, -0.0351,
-0.4822, +0.5715, +0.0096, -0.2875, -0.1981, -0.2082, -0.1329,
-0.3028, -0.3576, -0.7867, -0.0568, +0.4579, -0.2249, -0.1251,
-0.5290, -0.4751, +0.2220, -0.7200, +0.4872, +0.2924, +0.0189,
+0.2746, -0.4167
],
[
-0.2192, +0.0070, +0.6801, +0.0934, -0.7869, -0.0606, +0.2998,
+0.3192, -0.6894, +0.1938, -0.5750, -0.3213, +0.2864, -0.3018,
+0.5830, -0.0907, -0.6795, -0.1959, +0.0498, +0.0393, +0.0955,
+0.1378, -0.1448, -0.3244, +0.1325, -0.4948, -0.1462, +0.2279,
-0.1034, +0.5426, +0.2497, -0.4908, -0.7263, -0.6941, -0.2128,
+0.1560, +0.3640, +0.5246, -0.0872, -1.1948, +0.4199, -0.3246,
+0.5204, -0.2219, +0.5650, +0.1194, -0.7113, -0.7679, +0.0195,
-0.0896, +0.1393, +0.2413, -0.2315, -0.1455, -1.3670, +0.3861,
+0.4419, +0.0639, -0.4954, -0.1562, -0.0227, +0.5195, +0.0172,
+0.2498, -0.2056, +0.1355, -0.4583, -0.3596, +0.3332, +0.4399,
-0.5906, -0.0869, +0.3909, +0.2269, -0.1635, -0.5459, -1.0745,
+0.2837, -0.3212, +0.4923, +0.1431, +0.4467, +0.0149, +0.2936,
-0.2570, +0.3208, -0.3007, +0.3253, -1.0951, -0.2871, +0.2600,
+0.1508, -0.0872, +0.0481, -0.2920, +0.5201, -0.5000, -0.0068,
+0.0013, -0.9657, +0.1424, -0.0475, +0.1101, +0.5505, -0.5671,
+0.3893, -0.3366, +0.3850, -0.1474, +0.0822, +0.7856, -0.3526,
-0.0134, -0.2321, +0.0435, -0.8470, -0.2428, +0.4091, -0.3198,
-0.1435, -0.5942, +0.1096, -0.6466, -0.1988, -0.0292, +0.2447,
+0.0265, +0.0018
],
[
-0.0352, -0.2346, +0.0859, +0.1758, -0.3347, +0.1836, +0.0254,
+0.2248, +0.2209, +0.4463, +0.2712, -0.3749, +0.2835, -0.2375,
-0.3635, +0.2696, +0.1382, -0.3179, -0.1828, -0.0968, -0.2109,
+0.3391, +0.1696, -0.3930, +0.2445, +0.3224, +0.0135, +0.0054,
-0.1534, +0.3513, -0.0069, -0.3339, +0.0513, -0.0552, -0.3873,
-0.7594, -0.5288, +0.2727, +0.5225, -0.5971, -0.0917, -0.0256,
+0.1634, +0.1411, +0.0724, -0.0886, -0.2640, -0.4610, -0.2578,
-0.1688, +0.4008, -0.1871, +0.1569, +0.5000, -0.0814, +0.1857,
+0.3914, +0.2859, -0.6269, -0.0063, -0.3616, -0.4331, -0.2693,
+0.0870, +0.0893, -0.2255, +0.2131, +0.4674, +0.5417, +0.4653,
-0.0902, +0.2695, -0.5260, -0.1611, -0.3307, +0.1241, -0.1217,
-0.1343, +0.3153, +0.0153, +0.1986, -0.0012, +0.1353, +0.0304,
+0.1240, -1.3306, -0.3043, -0.1730, +0.2383, +0.1076, -0.4895,
-0.0328, +0.0427, -0.0550, +0.4644, +0.2662, +0.3317, -0.0916,
-0.2966, -0.8270, -0.0122, -0.1229, -0.1763, -0.2821, +0.1425,
-0.5055, +0.1814, -0.4447, -0.0676, -0.0509, -0.3788, -0.2959,
+0.3250, -1.3882, +0.0385, +0.2324, -0.0204, -0.1502, +0.4036,
+0.1506, +0.5967, -0.8639, +0.0580, -0.8099, +0.3450, -0.1774,
+0.0239, -0.1997
],
[
+0.5684, -0.0216, -0.5538, +0.2260, -0.2572, +0.4158, +0.0583,
-0.2957, -0.3397, +0.2123, -0.4795, -0.6243, -0.0550, -0.1616,
-0.2777, +0.4278, +0.1357, -0.5469, -0.8075, -0.0971, +0.5367,
+0.4817, +0.0394, +0.5311, -0.9895, -0.6751, +0.4951, +0.2023,
+0.3504, -0.1906, -0.0098, -0.3285, -0.3039, -0.0281, -0.1405,
-0.3270, +0.6313, -0.0546, -0.5070, -0.4210, -0.6010, +0.0226,
-1.0871, -0.3306, -0.0799, -0.2131, +0.1067, -0.1444, +0.5036,
+0.0780, -0.2379, +0.1027, +0.0106, +0.0445, +0.4597, -0.1717,
+0.0732, -0.1699, +0.0170, +0.3763, +0.1521, -0.1140, -0.0989,
+0.3150, -0.2521, -0.2231, +0.2822, +0.4532, -0.2959, +0.0680,
+0.0628, +0.5487, -0.4580, -0.2850, -0.8598, +0.2140, +0.0685,
-0.0025, -0.0184, -0.6549, -0.4093, -0.1550, +0.1699, -0.2195,
-0.3559, -0.0794, -0.2342, -0.8754, -0.0657, +0.1804, -0.7524,
-0.0975, +0.3923, -0.0837, -0.2477, +0.3972, -0.1719, -0.1009,
+0.4203, +0.1686, -0.0107, +0.0231, -0.4684, +0.8655, +0.3072,
-0.6401, -0.0229, +0.1848, +0.3838, +0.1357, -0.3682, -0.0991,
-0.0411, -0.3113, +0.0033, +0.5014, +0.6548, -0.5687, -0.8568,
+0.3984, -0.2581, -0.7770, +0.2297, -0.1984, -0.2011, -0.1527,
+0.2363, +0.5539
],
[
-0.1108, +0.0564, +0.4279, -0.2463, -0.0422, +0.0309, +0.4093,
-0.2905, +0.1476, +0.8005, -0.0774, +0.1371, -0.0529, -0.1442,
-0.0326, +0.5159, -0.1651, +0.1366, +0.1476, +0.2852, -0.4420,
-0.3403, -1.1074, +0.2820, -0.4842, -0.2464, -0.9850, +0.2316,
-0.7857, +0.5891, -0.1194, -0.3680, -0.6987, +0.4992, +0.5802,
-0.2089, -2.3145, -0.8983, +0.2000, +0.2328, +0.1504, -0.9694,
-0.0397, +0.5221, +0.2330, -0.5433, -0.5676, -1.0922, +0.3621,
-0.4841, +0.2218, -0.1468, -0.2117, -0.1497, -0.0331, -0.4497,
-0.3092, -0.4888, +0.4701, -0.6076, +0.2927, +0.2463, +0.0962,
+0.4161, +0.2268, -0.1202, +0.7343, +0.3379, +0.3461, -0.0830,
+0.0510, -0.1624, -0.2082, +0.5592, -0.1132, -0.0248, -0.3746,
+0.2488, -0.2618, -0.7138, -0.8501, -0.6333, +0.1322, -0.7100,
+0.1321, -0.7706, +0.2088, +0.0503, -0.0784, +0.2525, -1.4688,
+0.1988, -0.1214, -0.7245, +0.0321, +0.0732, -0.0386, +0.0683,
+0.3169, +0.1711, +0.1284, -0.3320, +0.0664, -0.2360, +0.2742,
+0.0370, +0.1123, +0.3008, +0.0063, -0.9690, -0.1391, -1.2992,
+0.2320, -0.8184, -0.0203, -1.3783, +0.1210, -0.0003, -0.5927,
+0.1050, -1.0701, -0.0294, +0.4847, -0.3004, +0.3503, -0.3461,
-0.0561, +0.2380
],
[
+0.3711, -0.5122, +0.3078, +0.0482, +0.6545, -0.8755, +0.6540,
+0.0361, -0.1457, +1.1641, +0.0596, -0.1890, +0.3317, +0.1001,
-0.2053, -0.4404, -1.2854, -1.4911, +0.2391, -1.8613, -0.0210,
+0.3602, -1.2691, -0.5337, -0.3914, +0.1565, -0.1174, -0.0831,
-0.4771, -0.0826, -0.0608, -0.3441, -0.1007, -0.8418, -0.5199,
-0.1941, -2.3056, +0.0221, +0.4960, -0.5980, -1.6187, -0.4539,
-0.0842, -1.0271, +0.5722, +0.1285, +0.0500, +0.3821, +0.2063,
+0.1320, -0.0600, -0.1402, -2.6885, +0.1343, +0.3053, -0.8118,
+0.2949, -0.2179, +0.0871, -0.2730, +0.5062, -1.1280, +0.0665,
-1.2273, -0.5753, -0.4810, +0.1590, +0.6403, -0.8059, +0.4987,
-1.2487, +0.1267, -0.1181, -1.5417, -0.2113, +0.0210, +0.4132,
-1.4785, -0.5953, +0.2741, +0.6321, +0.4405, -0.3417, +0.1373,
-0.2862, -0.5855, +1.0328, +0.2625, -0.2791, -0.8597, -0.3383,
+1.1336, -0.7141, +0.0972, -1.1505, -0.1554, +0.4601, -0.3757,
-0.1693, -0.5801, -0.1438, -1.8935, -0.0646, -0.5465, -0.4190,
-0.0872, +0.1621, -1.1848, -0.4613, -1.3268, +0.1992, -0.3329,
+0.3877, +0.4914, -0.2977, +0.0102, -0.0888, -1.0388, -0.3733,
-1.0903, -0.2616, +0.4798, -0.0164, -1.3258, -0.2859, -0.7703,
-0.0513, +0.1921
],
[
-0.4288, +0.4251, -0.8418, +0.2533, -0.2653, -0.3997, -1.4284,
+0.1745, -0.1872, -0.2045, +0.1453, +0.0717, -0.1374, +0.3480,
-0.1474, -0.0239, +0.3027, +0.1502, -0.0728, +0.1668, -0.1015,
-0.2752, -0.8042, -0.9138, +0.2101, -0.4770, +0.2333, -0.7844,
+0.1624, -0.2283, +0.4549, -0.1719, -0.6743, -0.2464, -0.0733,
+0.1715, -0.3638, -2.5636, +0.0812, -0.1348, +0.2581, +0.1219,
-0.0507, -0.4468, +0.7635, -0.3612, +0.3942, +0.2470, +0.2363,
+0.2047, -0.4177, +0.2005, -0.3347, -0.3090, -0.0926, -0.1653,
+0.1673, -0.7612, +0.5780, +0.0328, -0.2601, -0.0094, +0.2529,
+0.3364, -0.2499, +0.1589, +0.3585, -0.0452, -0.3698, +0.2585,
-0.5148, -0.0327, -0.3892, -0.6538, +0.0538, +0.0272, -0.0580,
+0.0795, -0.0597, -0.5941, +0.0464, -0.1051, -0.2354, -0.4521,
-0.2243, -0.2938, +0.0795, +0.0080, -0.2831, +0.0473, +0.2404,
+0.3361, +0.0059, +0.5983, +0.2747, +0.7289, +0.2341, -0.4635,
-0.4206, +0.4859, +0.0844, -0.9279, +0.4085, +0.2349, -0.0769,
+0.1156, -1.2277, +0.1506, -0.5583, +0.2217, -0.0559, +0.6840,
+0.1522, -0.2177, -0.2074, -1.2565, +0.4764, -0.2736, -0.8419,
+0.4239, -0.8196, -0.1434, +0.1341, -1.6368, -0.1080, -0.1508,
+0.3498, +0.0597
],
[
-0.3368, +0.2092, +0.5426, +0.2464, +0.4091, +0.1462, -0.2139,
-0.0042, +0.2487, -0.3703, +0.6684, +0.2895, -0.2406, -0.0249,
+0.1861, +0.8212, -0.3994, +0.2464, +0.3857, -0.2585, +0.5531,
-0.4998, -0.3836, +0.2367, +0.3707, +0.1389, -0.5142, +0.1372,
+0.4955, -0.4030, -0.2420, +0.0510, +0.0492, +0.1571, +0.0938,
+0.3084, -0.8010, -1.0584, +0.4347, -0.2451, -0.2941, -0.6722,
+0.1788, -0.1841, +0.1940, -0.1804, +0.1675, +0.4239, -0.0414,
-0.1289, +0.1509, -0.0777, +0.1962, +0.0061, +0.5778, -0.5213,
-1.1370, -0.3478, +0.7225, -0.5497, +0.1487, +0.5139, -0.1376,
-0.4082, -0.6474, +0.2995, +0.2718, -1.0549, -0.5648, +0.2498,
-0.0656, -0.6016, -0.0853, -0.0022, -0.9858, +0.5829, -0.2664,
-1.0040, -0.1400, -0.9499, -0.3189, -0.9519, +0.2420, -0.4990,
-0.1585, -0.2386, -0.3771, -0.4614, +0.3374, +0.9149, -0.1293,
+0.1826, +0.1705, -0.5659, +0.0785, -0.2180, +0.3528, -0.4823,
+0.4564, +0.4903, -0.4538, +0.4069, -0.1866, +0.0438, +0.0104,
+0.0877, -0.0139, +0.0428, +0.7354, -0.0088, -0.1079, -0.3406,
+0.0882, -0.2470, -0.3901, +0.0013, +0.3204, +0.0920, +0.0433,
-0.0745, -1.8448, +0.1017, -0.2950, -0.3807, -0.4693, -0.1578,
-0.0062, -0.9509
],
[
+0.0735, +0.1321, +0.3943, -0.1060, -0.2087, +0.0374, +0.2031,
+0.3275, -0.2623, -0.4766, -0.5651, -0.3270, +0.5977, -0.3862,
-1.0126, +0.8957, -0.4264, -0.2896, +0.3246, -0.1566, +0.2141,
-1.0416, +0.0665, +0.3242, -0.6463, +0.2869, -0.2468, +0.5867,
-0.3243, -0.6057, +0.1175, -0.3758, -0.8298, +0.2636, -0.3871,
+0.1890, +0.0788, -0.0283, -0.2311, -0.8094, -0.1637, -0.0869,
-0.6365, -0.0403, -0.0636, +0.4252, +0.0832, -0.4041, +0.2266,
+0.5261, -0.2208, +0.1190, +0.3236, -0.3321, +0.6679, +0.1548,
-0.2739, -0.2599, +0.8133, -0.5076, -0.2133, +0.3947, +0.2446,
+0.1589, -1.2893, -0.3493, +0.5011, -0.3098, -0.0777, -0.1097,
+0.1047, -0.5573, +0.4166, -0.0184, +0.0405, -0.1612, -0.0876,
+0.5153, +0.2051, +0.4426, +0.0784, +0.1342, +0.3865, -0.2819,
+0.2431, -1.7776, -0.0231, -0.2412, -0.1342, -0.4856, +0.2141,
+0.7703, +0.2504, +0.1393, -0.0915, +0.1368, -0.0667, +0.0242,
+0.3334, +0.0918, -0.2404, +0.3281, -0.4851, +0.2643, +0.1716,
+0.2915, -0.6321, -1.5506, +0.4295, +0.1463, +0.9801, -0.1069,
+0.4641, -0.1582, +0.0235, -0.0070, -0.3506, -0.1147, -0.1624,
+0.3232, -0.2713, +0.0645, -0.0997, +0.1111, -0.0303, -0.0156,
-0.3195, +0.1981
],
[
-0.3898, +0.4090, -0.2097, +0.1600, +0.9530, -0.0467, -0.5210,
-0.6534, +0.2393, -0.5750, +0.0579, +0.0129, +0.0012, -0.3364,
-0.6190, +0.4100, +0.4866, -0.1644, +0.3908, -0.2042, +0.6471,
+0.3077, -0.4285, -0.1191, -0.3428, +0.3255, +0.1868, +0.3541,
-0.3422, +0.0310, +0.0242, +0.3750, -0.6444, -0.1468, +0.5030,
+0.3276, +0.3054, -0.0126, -0.5548, +0.3717, +0.1292, +0.1356,
+0.0733, -1.4465, -0.2176, -0.1912, -0.4031, -0.1692, -0.8686,
+0.2757, -0.1966, +0.3493, -0.6788, -0.3001, -0.7071, +0.1474,
+0.1610, -0.5100, +0.1408, +0.0447, -1.2487, -1.2027, +0.5734,
-0.8365, +0.8718, -0.0544, +0.3266, -1.3697, +0.1424, +0.2102,
-0.4280, +0.2247, -0.2800, +0.4358, +0.2002, +0.3223, +0.0825,
+0.2227, +0.2776, -0.7352, +0.0881, +0.1030, +0.1458, -0.9093,
-0.4533, +0.3908, +0.2786, +0.0234, +0.0198, +0.1295, +0.1039,
-0.1075, -0.7748, +0.2882, -0.7246, +0.6064, +0.4672, -0.3293,
-0.8341, +0.4853, +0.1837, -0.0405, -0.2606, +0.8020, +0.5313,
+0.0470, -0.1615, +0.3864, -0.5154, +0.3749, -0.2012, -0.2818,
+0.4120, -0.3524, -0.3061, -0.0957, -0.2543, +0.1877, -0.9297,
-0.3793, -0.4868, +0.0211, -0.2999, +0.4195, +0.3744, -0.4142,
-0.1698, +0.4015
],
[
-0.0032, -0.1157, -0.7626, -0.0068, -0.1563, -0.2504, +0.2543,
+0.2672, -0.6115, -0.1193, -0.0808, +0.1192, -0.2597, +0.1511,
+0.3637, -0.3866, +0.5929, +0.4882, -0.2581, +0.1825, -0.4854,
-0.0445, +0.2782, +0.1469, -0.1412, -0.3135, -0.6042, -0.1404,
-0.0105, +0.0360, +0.3121, -0.8642, +0.6442, +0.7403, -0.1205,
-0.5401, +0.0028, -0.0572, +0.2258, -0.0124, +0.0772, +0.0219,
+0.3767, +0.4778, +0.2339, -0.0446, -0.1991, +0.4794, +0.1058,
-0.2104, -0.4589, +0.0639, +0.5277, -0.6294, -0.3231, +0.3277,
-0.0388, +0.1474, -0.5446, +0.3626, +0.7244, -0.2283, -1.0641,
-0.1651, +0.3294, -0.3860, +0.3972, +0.5262, +0.2624, +0.8364,
+0.0352, -0.0869, +0.0968, -0.2432, +0.3734, +0.2818, +0.1536,
-0.0855, +0.7703, -0.2547, -0.0042, +0.4066, +0.3864, -0.0546,
-0.1226, +0.4063, +0.0661, -0.0131, -0.9015, -0.3502, -0.3724,
+0.2265, -0.3302, -0.4852, +0.0126, +0.4551, -0.9050, +0.4911,
-0.2053, -0.0778, +0.1277, -0.5993, -0.0439, -0.0805, -0.2957,
+0.0837, -0.2367, -0.2302, -0.3742, +0.2723, -0.4829, -0.6283,
-0.0074, -0.1597, +0.7585, -0.1683, +0.1012, -0.5039, +0.1081,
+0.4095, -0.0830, +0.2724, -0.1499, +0.1271, -0.1143, +0.4757,
+0.7004, -0.0638
],
[
+0.5604, +0.1489, +0.7939, +0.0495, -1.6573, -0.0948, +0.0507,
-0.2181, -0.8301, +0.2946, -0.8348, +0.0103, -0.0534, -1.9317,
+0.3094, +0.4461, -0.5899, +0.0193, +0.8027, +0.2224, +0.3142,
-0.0909, +0.1901, +0.3415, -0.7243, +0.1823, +0.1726, +0.4332,
-0.1833, +0.0276, +0.4527, -0.4807, -0.2075, +0.1518, +0.4846,
+0.0998, +0.0544, -0.0686, -0.2238, -0.6958, -0.3039, -0.0180,
-0.8097, -0.0506, -0.0706, +0.0831, +0.1330, -0.4893, +0.3243,
+0.3210, +0.1427, -0.1627, +0.1470, -0.4862, -0.2567, +0.3008,
+0.0347, -0.1611, -0.7610, -0.2009, +0.1149, +0.2351, +0.4647,
-0.5399, -0.3643, +0.2018, -0.0247, +0.0455, +0.0261, +0.2084,
+0.2071, -0.0061, +0.5638, +0.4168, +0.1248, -0.0494, -0.5499,
+0.1191, -0.3897, -0.8652, -0.0281, -0.0855, -0.0485, -0.0882,
-0.3547, -0.2732, +0.5744, +0.3363, +0.2781, +0.1670, +0.2282,
+0.1124, -0.0644, +0.2288, -0.0276, -0.4266, +0.1707, -0.0295,
+0.0060, -0.0297, +0.0298, -0.0614, +0.0064, -0.0780, -0.1962,
-0.3330, +0.1126, -0.1496, -1.5588, -0.1446, +1.0634, +0.0322,
+0.0421, +0.2496, +0.0028, -0.3989, +0.2559, -1.1919, +0.4706,
+0.1022, +0.6683, -0.5075, +0.3810, +0.0101, -0.0736, +0.3099,
-0.1884, -0.0315
],
[
-0.1955, -0.5094, +0.1636, -0.1839, -0.8500, +0.0869, -0.3795,
-0.0824, +0.1572, +0.5188, +0.1795, -0.1984, +0.1677, +0.3621,
+0.1295, -0.3444, +0.6014, +0.1478, -0.0711, -0.2961, +0.0910,
+0.1848, +0.2503, -0.2125, -0.3327, +0.2299, -0.5543, -0.7245,
-0.2514, +0.3123, +0.2954, +0.0990, +0.2281, -0.0702, +0.2690,
-0.2279, -0.3561, -0.2342, -0.2415, +0.2229, +0.4394, -0.1579,
+0.2719, -0.1974, -0.0336, +0.2625, -0.5710, -0.0972, -0.3365,
+0.0324, +0.3265, +0.1474, -0.3497, +0.1704, -0.0507, -0.0087,
-0.8585, -0.0940, -0.6150, +0.2710, +0.6073, -0.6070, -0.2289,
-0.5282, +0.3340, -0.3444, -0.0644, -0.8340, -0.3540, -0.1502,
+0.2084, -0.3327, -0.0523, +0.1642, -0.7461, -0.1801, -1.0584,
-0.4991, -0.3224, +0.1219, -1.1949, -0.5131, -0.0919, -0.5761,
+0.0495, -0.2821, +0.1686, +0.0202, +0.2129, +0.2013, -0.9683,
-0.1908, -0.1073, +0.3261, +0.1326, -0.1326, -0.5122, -0.1264,
+0.0474, +0.0922, -0.2146, +0.1663, +0.1091, +0.0349, +0.1768,
+0.1695, -0.1796, +0.3195, -0.3877, -0.2224, -0.2449, +0.3745,
+0.1159, -1.2097, -0.0515, -0.3228, +0.2604, +0.2458, -0.5800,
-0.3306, -0.6286, -0.3607, -0.4681, -0.8831, -0.2818, -0.2989,
-0.3671, -1.1921
],
[
+0.1324, -0.4846, +0.3543, -0.4279, +0.0218, +0.2834, +0.1271,
-0.2439, -0.5697, +1.1672, +0.1293, -0.1005, +0.3387, -0.7602,
-0.4949, -0.1251, +0.2813, -0.1402, +0.0073, +0.4846, -2.0272,
-0.0837, -0.1081, -0.1338, -0.0291, -0.0520, +0.1935, +0.1562,
-0.4019, -0.2690, +0.1373, -0.2031, +0.1697, -0.0621, +0.1849,
-0.8227, +0.3108, +0.0454, +0.2020, -0.3821, -0.2381, -0.1363,
+0.0512, -0.5040, +0.1104, -0.3400, -0.5262, +0.5317, -0.4527,
-0.8015, -0.0089, +0.0263, +0.1689, +0.0380, -0.1424, +0.3908,
-0.0995, -0.1746, +0.4555, +0.2764, +0.2897, -0.1100, -0.4770,
-1.0901, +0.3817, +0.3746, -0.6783, +0.2379, +0.9173, -0.1580,
+0.1852, +0.6157, -0.1961, +0.1422, -0.9707, -0.4440, -0.0112,
-0.3850, -0.2027, -0.0332, -0.7040, -0.4630, +0.6232, -0.4129,
-0.3921, +0.2035, -0.0832, +0.5634, +0.0469, +0.0092, -0.1565,
-0.0481, -0.2951, -0.0111, -1.7074, +0.1362, +0.1502, +0.2415,
+0.0590, -0.0583, +0.3007, +0.2916, -1.0366, -0.1694, -0.5418,
-1.1429, +0.1295, +0.1362, +0.0207, +0.0179, -0.5855, -0.1739,
-1.1501, -0.1732, +0.6585, +0.3460, -0.4667, +0.0654, -0.3989,
-0.0483, -0.3596, -0.4865, -0.1731, +0.3521, +0.3019, -1.1546,
+0.1897, -0.0856
],
[
+0.0735, -0.0567, -0.8032, -0.4114, -0.6058, -0.2193, +0.6009,
+0.6099, +0.1714, +0.1384, +0.1317, +0.5786, +0.1662, -0.1301,
+0.6285, +0.2156, +0.0117, -0.5567, +0.0561, -1.0620, -0.1751,
+0.1477, +0.3508, +0.0661, -0.0849, +0.2782, -0.0713, -0.0370,
-0.3821, +0.1062, -0.0948, +0.0361, +0.3888, +0.4089, -0.4191,
-1.8165, -0.2541, -0.0063, -0.5197, +0.4507, +0.7076, +0.2521,
-0.1259, -0.1574, +0.0586, +0.3146, +0.1439, -0.4246, +0.4805,
-0.1064, +0.3108, -0.1860, -0.0510, -1.1670, +0.3645, +0.0356,
-0.2300, +0.2261, -0.4346, +0.3613, -0.8356, -0.4161, +0.0780,
+0.1070, +0.1950, -0.8652, -0.1801, -0.2838, -0.5130, -0.7402,
-0.4372, -0.3082, -0.1407, +0.0451, +0.4333, +0.5375, -1.4056,
-0.1902, -0.0910, -0.1582, -0.1891, -0.2806, -0.6402, -0.4763,
+0.2221, -0.2245, -0.5862, +0.2639, +0.3936, -0.3819, +0.3230,
-0.8123, -0.5992, -0.1648, +0.8798, +0.2127, -0.5322, -1.0589,
-1.3485, -0.6906, -0.0448, -1.2024, +0.1072, +0.2755, -0.5748,
+0.0877, +0.2745, +0.0640, +0.2661, -0.3139, +0.2355, +0.4331,
+0.3440, +0.4860, -0.3379, +0.5891, +0.2155, -0.3365, +0.3805,
+0.2537, -0.6251, -0.0326, +0.1532, -0.0125, +0.1749, -0.3645,
-0.9793, +0.0434
],
[
-1.1930, +0.5646, -0.9985, -0.2640, -0.1287, -1.0951, +0.0648,
+0.2532, -0.4144, -0.4100, -0.0835, +0.2912, -1.2506, +0.1132,
-1.2571, -0.0902, +0.6812, -0.3145, +0.0854, -0.5571, +0.0128,
+0.2900, -0.5539, +0.0010, -0.4862, +0.2361, -1.2377, -0.6221,
+0.1594, +0.1456, -0.0369, -0.6333, +0.1119, -0.1009, -0.0694,
+0.1564, +0.5584, -0.0073, -0.3532, +0.1511, -0.2448, +0.3191,
+0.0510, -0.7811, +0.0116, -1.3001, +0.0963, -0.2932, +0.2152,
+0.6290, -0.3466, -0.2318, -0.4833, -0.9795, +0.1221, -0.1789,
-0.4434, +0.3625, +0.1297, -0.2875, +0.1629, +0.2148, +0.3416,
+0.3896, +0.4758, -0.2505, +0.0288, +0.5394, +0.1399, -0.0757,
+0.1861, -0.4772, -0.2275, -0.4032, +0.2681, -0.2982, +1.1032,
-0.2331, -0.1047, +0.3253, -0.1822, -0.1980, +0.0089, +0.3273,
+0.0098, -1.1442, +0.0552, -0.8381, -0.4844, -1.0339, -0.0695,
+0.3731, +0.3991, -0.7210, -0.7972, +0.0382, -0.1339, -0.0447,
+0.0631, -0.0759, +0.3365, +0.2942, -0.5237, +0.1108, +0.2281,
+0.4007, -0.1869, -0.0529, -1.0671, -0.0356, -0.7960, +0.0457,
+0.2884, -1.2189, -0.0712, +0.6715, -0.1247, -0.5548, +0.0852,
+0.2519, +0.1606, +0.1365, +0.4946, -0.6133, +0.0761, -1.3449,
+0.5933, -1.1779
],
[
-0.2804, -0.5471, +0.0551, -0.9886, -0.3381, +0.0967, -0.1828,
+0.3549, +0.8853, -0.4441, -0.3885, -0.3878, -0.1378, -1.2579,
-0.5911, -0.0165, +0.4075, -0.2342, +0.1255, -0.4637, -1.2356,
+0.0905, +0.5726, -1.2384, +0.3039, -0.1166, +0.9449, -0.1286,
-0.1615, -0.6373, -0.6342, -0.7324, -0.4217, -0.2331, -0.1038,
-1.9344, +0.2348, -0.1012, +0.1137, -0.0832, -0.7858, -0.3082,
-0.1527, +0.0916, +0.0603, -0.5602, -0.3892, +0.4406, +0.0072,
+0.5934, -0.2114, -0.5871, +0.7619, +0.4133, -0.8720, -0.3605,
+0.0495, -0.0443, +0.0407, +0.0590, +0.0571, -0.9888, +0.5016,
+0.0917, -1.0617, -0.1703, +0.3349, -0.3760, -0.4340, +0.6685,
+0.3912, +0.2040, -0.1057, -0.1511, +0.2123, +0.4670, +0.1919,
-0.3246, -0.4883, -0.0083, -0.8998, -0.7696, +0.5723, +0.2926,
+0.2666, -0.2535, +0.2142, +0.2284, +0.8592, +0.1695, +0.1796,
+0.3706, +0.5187, +1.1045, -0.3000, +0.3547, -0.7726, +0.2280,
-1.3668, +1.2893, -0.2239, -0.2915, -0.9778, -0.0967, -0.2130,
+0.3331, +0.1535, +0.3457, -0.6926, +0.8179, -0.4072, +1.5560,
+0.2476, -0.0502, +0.5784, +0.6010, +0.2252, -1.1767, +0.0105,
-0.9442, -0.8745, +0.1999, -1.4982, +0.2176, -0.0420, -0.7675,
+0.0954, +0.8451
],
[
-0.4607, +0.9224, -0.0666, +0.2874, +0.0829, -0.2010, -0.0345,
-0.9402, +0.4678, -0.1414, -0.6691, -0.3298, -0.8264, -0.1855,
+0.1957, +0.0315, +0.3370, -0.0251, +0.2687, +0.2016, -0.8409,
+0.4957, -0.0033, -0.3533, -0.0471, +0.1057, +0.4238, -0.7189,
+0.2092, -0.5275, -0.1519, +0.8259, +0.1368, -0.0003, +0.6165,
+0.0160, +0.3227, -0.0074, -0.4793, -0.4458, -0.6210, +0.1793,
+0.0263, +0.6392, +0.0782, +0.1148, +0.1563, +0.6285, -0.0923,
-0.1974, -0.1243, -0.0663, -1.0275, +0.1073, -1.0154, -0.3729,
-0.0186, +0.1367, +0.3499, -0.1006, +0.3770, -0.4031, -0.6277,
-0.2577, -0.5225, -0.4877, +0.0720, -0.5231, -0.5414, +0.0301,
+0.1047, -0.2830, +0.5737, -0.2476, -0.5488, -0.5124, -0.1490,
+0.1823, +0.2839, -0.1406, -0.5689, -0.3808, -0.1889, -0.4013,
-0.4741, -0.3185, -0.1529, -0.7650, -0.2723, -0.5697, +0.4438,
-0.1550, +0.3837, +0.1311, -0.5736, +0.1836, -0.1597, +0.1093,
-0.4329, -0.6388, -0.4136, -0.0996, -0.5276, +0.1312, -0.1520,
+0.0417, -0.1222, +0.1583, -0.2679, -0.7778, -1.3841, +0.0280,
-0.4868, -0.3024, -0.0940, +0.2621, +0.1358, +0.3894, +0.1022,
-0.8691, -0.2127, +0.3902, -0.8880, +0.2733, -0.3573, -0.1029,
-0.2447, +0.1657
],
[
+0.1771, -1.0649, +0.1922, -0.4930, +0.2546, -1.6105, -0.1822,
+0.4909, -1.8516, -1.1523, -0.4807, +0.1944, -0.5609, -0.5628,
+0.0320, -0.8651, +0.5125, -0.1112, -0.7384, +0.4523, +0.0384,
+0.2800, +0.1029, -0.3131, +0.2663, +0.0665, +0.3445, +0.3239,
-2.2262, -0.7737, -0.4730, +0.1132, -0.2555, -0.4740, -0.8098,
-0.5930, +0.1079, -0.0022, -0.0244, +0.0345, -0.4886, -0.1646,
-0.7892, +0.2974, -0.0426, -0.3042, -0.9469, -0.8653, -0.2788,
-0.3556, -0.5344, +0.1168, -0.8683, +0.1483, +0.5287, +0.1890,
+0.0854, +0.0945, -1.1579, -0.1664, -0.0890, +0.1049, -0.7604,
-0.3063, +0.7497, -0.9224, +0.0295, -1.3473, -0.8716, +0.4510,
-0.4206, -0.0661, -0.6026, -0.0489, +0.1988, -0.9539, -0.0979,
+0.1267, +0.1407, -2.0032, +0.2541, +0.4513, +0.2627, -0.4517,
-0.1051, -0.5941, -0.5248, +0.0565, -0.0243, -0.9744, +0.5845,
+0.0379, +0.4668, -0.3622, +0.3820, +0.4215, -0.6691, +0.0417,
-1.6526, -0.4631, -0.4563, -0.2545, -0.2057, -0.0443, +0.4281,
-0.9920, -0.5481, -0.8264, +0.6692, +0.0857, -1.2917, +0.1586,
+0.0600, -1.4808, -0.1486, -0.1216, -1.2193, +0.4264, -0.8464,
-0.6857, -0.0517, +0.0287, -0.1867, -0.6775, -0.3675, +0.5128,
-1.5418, +0.2499
],
[
-0.1612, -0.4239, -0.3609, -0.4407, -1.8796, +0.1811, +0.1288,
-0.0542, -0.9194, +0.3582, +0.1502, +0.1751, -0.0533, -0.0531,
-0.0382, -1.2325, -1.2668, +0.6905, -0.0798, +0.1129, -0.3606,
-0.5942, +0.2636, -0.1080, -0.2369, -0.0980, -0.3586, +0.0497,
-0.6267, -0.2695, +0.7429, -0.0488, +0.5714, -0.6892, -0.8693,
+0.1249, -0.7356, -0.1495, +0.1155, +0.4590, +0.5223, -0.5127,
+0.1505, +0.2809, +0.2153, +0.7752, -0.1908, -0.6606, +0.2257,
+0.0174, +0.0978, -0.5091, -0.6323, +0.1803, -0.3168, -0.3116,
+0.0962, -0.0341, -0.0762, +0.6551, -0.3391, +0.4467, +0.3393,
-0.4190, +0.5773, -0.4536, -0.6370, +0.0585, +0.0999, -0.1559,
+0.5472, -1.2403, -0.1902, -0.0791, -0.3356, -0.0231, -0.3575,
-0.0715, +0.3344, +0.1620, -0.4599, -1.0161, -0.0755, +0.3601,
-0.6676, +0.2324, -0.4592, -0.2415, -0.4137, +0.0879, -0.0214,
-0.6427, -0.7533, -0.3647, -1.3776, -0.3563, +0.1488, +0.5039,
-0.7781, -0.0703, -0.6032, +0.0771, -0.1891, -0.5058, +0.1018,
+0.4503, -0.7568, -0.2828, -0.4956, +0.4676, -1.1091, +0.5466,
-0.5813, -0.6780, +0.3361, -0.6156, +0.2207, +0.3111, +0.0996,
-0.6625, +0.3951, -0.6766, +0.1181, +0.9436, +0.0373, -0.3188,
-0.2978, -0.5654
],
[
+0.0668, -0.3408, -0.1976, +0.4520, -0.7920, -0.0620, -0.5180,
+0.3705, +0.3587, -0.0448, -0.0541, -0.4324, -0.2409, +0.2633,
-0.1210, -0.5174, -0.0161, -0.2320, -0.5553, -0.0265, -0.0198,
+0.0403, -0.1374, -0.2721, -0.4634, -0.1764, -0.4010, -0.8389,
+0.0032, -0.2553, -0.0130, -0.3559, -0.3330, +0.4345, +0.0551,
-0.4100, +0.2560, +0.1938, -0.1803, -0.6254, +0.4951, -0.6375,
-0.0450, +0.2914, +0.2987, -0.4416, -0.6367, -0.0493, -0.2898,
-0.2539, -0.5301, -0.2232, -0.4586, -0.2803, +0.3026, +0.2851,
-0.3451, +0.3517, -0.6863, -0.1376, -0.6062, -0.7945, -0.0853,
-0.1367, +0.3939, +0.0591, +0.1730, +0.6343, +0.5698, +0.1005,
-0.3372, +0.3566, +0.2433, -0.4498, +0.1536, -0.3045, -0.4275,
+0.1514, +0.1296, -1.0830, -0.2265, +0.7224, -0.0265, -0.0444,
-0.4194, -1.2595, +0.0165, +0.3162, -0.3852, -0.3603, -0.3801,
+0.0952, -0.0012, +0.0985, -0.5196, +0.0584, +0.2641, -0.0625,
+0.1562, -0.6879, -0.5486, -0.6414, -0.3643, +0.0262, +0.0134,
-0.5337, -0.3427, -0.6458, -0.4454, +0.2579, -0.3257, -0.6284,
+0.2397, -0.2731, -0.0075, +0.1768, +0.5291, -0.1539, +0.1083,
+0.1832, -1.1263, +0.0974, +0.3043, -1.4778, -0.1009, +0.0417,
-0.5630, +0.4801
],
[
-0.6454, -0.7756, -0.4977, -0.8220, -1.1194, +0.0238, -0.4573,
-0.0432, +0.6942, -0.1904, -0.0429, -0.5213, -0.3837, -0.1483,
+0.1033, +0.3135, +0.4299, -0.1421, -0.6400, -0.0736, -0.4123,
+0.0786, -0.0591, +0.0877, -0.2312, +0.4058, +0.0759, -0.5178,
-0.7740, -0.4119, -0.2352, -0.6448, -0.2426, +0.6444, -0.0683,
-0.9792, -1.3938, -1.5029, -0.7095, -0.2758, +0.0554, +0.1728,
-0.1377, -0.2068, -0.3909, -0.4126, +0.5882, -0.2119, -0.2786,
+0.3562, -1.0845, -0.5862, +0.0659, -1.8884, -0.0195, -0.0630,
-0.0171, +0.3654, +0.2821, -1.0086, +0.3942, -0.0654, +0.1168,
+0.4569, +0.3138, -0.1170, +0.3250, -0.5120, -0.6833, -0.9898,
-0.2593, -0.2547, -0.4772, -0.4333, +0.0239, -0.1653, +0.2902,
-0.1610, +0.1376, +0.1103, -0.3598, -1.0606, -0.3341, -0.1726,
+0.2773, +0.5422, -0.1895, -0.4480, -0.2850, -0.3535, -0.6584,
+0.2745, +0.0285, -0.2066, +0.4448, -0.9888, -0.1846, -0.1153,
-0.1576, -0.1381, +0.3401, -0.7143, -0.3209, -0.0279, -0.3679,
+0.2760, -0.4931, -0.3817, +0.7612, +0.2598, -0.0127, -0.0994,
+0.4239, -0.8268, -0.5012, +0.2769, -0.6953, +0.1870, +0.2750,
-0.8051, +0.2195, +0.6554, -0.9753, -2.0387, -0.1231, -0.4834,
-0.4421, +0.5339
],
[
+0.4335, +0.1656, -0.9974, -0.1176, -0.3960, -0.0638, +0.2079,
+0.1231, -0.0854, -0.0827, +0.2503, -0.2978, -0.3204, +0.4953,
+0.1134, +0.5835, +0.3386, -0.1330, +0.2271, -0.2615, -0.2089,
-0.0507, -0.2240, +0.1935, +0.3242, -0.1012, -0.1488, -0.0782,
-1.1263, +0.1241, +0.3369, -0.3031, +0.1686, -0.3965, -0.3629,
+0.3934, +0.2049, -0.2970, +0.2818, -0.1164, -0.0679, -0.4821,
-0.1474, +0.3424, -0.5797, +0.1040, -0.3827, +0.0046, +0.3052,
-0.3735, +0.0795, +0.1228, -0.1774, -0.5957, -0.1294, +0.3470,
+0.2718, +0.0017, +0.2303, +0.1612, +0.2331, +0.1641, -0.1593,
-0.0877, -0.5581, +0.2669, -0.6158, +0.3496, +0.2728, -0.0912,
-0.5599, -0.1258, -0.0708, +0.0594, +0.1851, -0.1625, -0.1608,
+0.3045, +0.0633, -0.8487, +0.5131, +0.1964, +0.0798, -0.1822,
-0.1556, -0.2373, -0.0818, -0.1272, -0.7765, +0.0968, -1.2447,
-0.3894, +0.2402, +0.2558, -0.0405, -0.3095, +0.2425, +0.0121,
+0.2948, -0.7793, +0.2155, +0.3195, +0.0075, -0.6360, -0.2475,
+0.1176, +0.2035, -0.5655, -0.3994, -0.6486, -0.3726, -0.4562,
-0.7920, +0.9645, -0.3052, +0.5184, +0.2414, -0.7075, -0.0663,
+0.1578, +0.8090, +0.1994, +0.2978, +0.1654, +0.0228, +0.1505,
+0.1746, -0.3233
],
[
+0.3193, +0.0939, -0.2118, +0.6163, -0.0063, -1.3777, +0.0669,
-0.1254, +0.4310, +0.0861, -0.1759, +0.2185, -0.1819, -0.3422,
+0.1034, +0.2122, +0.1399, +0.1688, -0.4949, +0.0118, +0.6199,
+0.0669, +0.1229, +0.3465, +0.1135, -0.1835, +0.0139, +0.0407,
+0.3231, +0.2393, -0.0652, +0.6749, +0.0268, +0.1387, -0.2595,
+0.2993, -0.0990, -0.4262, -0.2514, +0.3848, -0.2463, -0.1556,
+0.1515, +0.1848, -0.4442, -0.2183, -1.3425, -0.2220, +0.4470,
+0.0889, -0.1207, -0.0777, +0.5244, -0.2950, -0.1844, -0.0176,
-0.0992, +0.0521, +0.3979, -0.9022, -0.0738, +0.5636, +0.2176,
+0.0760, +0.2633, -0.0544, +0.1360, -0.0387, -0.1706, -0.3108,
-0.8670, -0.3537, -0.3533, -0.6687, -0.2000, -0.3473, +0.1711,
+0.4867, +0.1795, -0.3960, +0.1990, -0.1117, -0.2524, +0.4683,
+0.7174, +0.1119, +0.5589, -1.3097, +0.8495, +0.1438, -0.4314,
-0.3728, -0.6224, -0.3955, +0.7276, +0.7996, -0.4632, -0.5398,
+0.3639, +0.3985, -0.0895, -0.3919, -0.2611, +0.1941, -0.0824,
+0.0592, +0.8058, -0.4699, -0.3778, -0.2650, +0.2874, -0.3255,
-0.2280, -0.1563, +0.4553, -0.1038, +0.7102, +0.2857, -0.6250,
-0.5684, +0.1135, -0.0182, +0.0845, -0.0283, -0.3868, -0.5412,
-0.2434, -0.1659
],
[
-0.0464, +0.5243, -0.4781, +0.2690, +0.1849, -0.3429, +0.3832,
-0.3084, -0.1094, -0.0967, +0.1260, -0.1243, -0.1423, -0.1049,
-0.2899, -0.3276, +0.6179, -0.1143, +0.2727, +0.4459, -0.0010,
+0.1593, +0.1067, -0.7444, +0.1892, -0.3649, +0.3654, +0.1727,
-0.3584, -0.4054, -0.0355, +0.0589, +0.3136, -0.6080, -0.4424,
-1.1500, -0.2929, -0.1218, +0.0851, +0.1286, -0.1481, -0.0944,
+0.0483, +0.3923, -0.6804, -0.2047, -0.1822, -0.3020, +0.4498,
-0.1132, +0.1351, -0.2379, +0.3005, -0.2661, -0.0353, -0.3425,
+0.1234, -0.3196, +0.3445, -0.6262, +0.2050, -0.4626, +0.2234,
+0.0922, +0.4025, +0.2875, -0.4980, +0.2534, +0.4041, -0.5816,
-0.3658, -0.3838, -0.2730, -0.8847, -0.5349, +0.4322, -0.2092,
+0.2194, -0.5464, -0.0687, -0.7599, -0.0938, -0.5080, -1.0531,
+0.5433, -0.4617, +0.3173, +0.4012, -0.0094, +0.3008, -0.1310,
+0.2291, -0.3119, -0.0245, -0.1378, -0.5103, +0.0308, -0.5093,
-0.0109, -0.8061, -0.5017, -0.3643, +0.5121, -0.8432, -0.7076,
+0.5774, +0.6549, -0.7813, -0.0083, -0.2012, +0.1741, -0.3110,
-0.2896, +0.2991, -0.6618, -0.0971, +0.1034, +0.1374, +0.8942,
+0.0567, -0.1838, +0.7772, -0.0397, -0.0103, -0.4255, -0.1541,
+0.3253, +0.1915
],
[
-0.2430, -0.4043, +0.1766, +0.0398, +0.0914, -0.3983, +0.1439,
+0.1795, +0.2706, +0.3679, +0.1778, -0.2966, +0.0740, -0.1158,
-0.1662, -1.3763, +0.0125, +0.1487, -0.3066, -0.2777, +0.0985,
+0.1373, +0.2813, +0.1631, +0.0871, -0.0837, -0.0411, -0.4317,
+0.5459, -0.2093, -0.5389, +0.1417, -0.4010, +0.0224, +0.1920,
+0.2597, -1.4467, +0.4732, -0.0835, -0.3698, +0.1804, +0.3861,
-0.8786, +0.0130, +0.0713, +0.1911, +0.0763, +0.1476, -0.3351,
+0.3152, +0.1109, +0.3021, +0.0581, +0.4585, -0.1141, +0.0913,
-0.3624, +0.2428, -0.1251, +0.0972, +0.1378, +0.1701, -0.3600,
-0.3366, +0.0519, +0.2137, -0.0586, -0.2494, -0.2853, +0.4357,
+0.0171, -0.2218, -0.7087, +0.2661, -0.3040, -0.1467, -0.4746,
-0.3447, -0.8009, +0.0269, -0.1932, -0.0666, -0.1277, -0.0639,
+0.4825, -0.8051, -0.0217, +0.1795, +0.0144, -0.4030, -0.2109,
-0.1861, +0.1756, +0.4672, -0.1331, +0.2954, +0.0176, +0.2001,
+0.0948, +0.4184, -0.9002, +0.3168, -0.3742, +0.2870, -0.1890,
-0.2389, +0.6784, -0.4299, -0.5234, -0.2825, +0.0168, -0.3289,
+0.5472, +0.0703, +0.2210, +0.3631, +0.4255, +0.2899, -0.3018,
-0.1029, +0.2479, +0.1401, -0.3799, -0.1869, +0.2482, -0.0682,
-0.3796, -0.0130
],
[
-0.4788, +0.2948, -0.0242, +0.0233, +0.2287, +0.0991, -0.4801,
+0.7143, +0.7220, -0.4549, +0.3487, -0.0855, -0.0851, -0.6122,
-1.1795, -0.0827, -0.0839, -0.6036, -0.9077, +0.0458, +0.2859,
+0.0758, -0.2018, -0.0300, +0.0544, +0.4906, +0.3798, -0.4791,
-0.1694, -0.0224, -0.4815, -0.1661, -0.5559, +0.3484, -0.0509,
+0.1270, +0.4359, -0.0170, +0.3239, +0.1996, -0.0626, -0.5734,
+0.0043, -0.0116, +0.2306, -0.2151, -0.8066, -0.6628, -0.2044,
-0.1113, +0.2094, +0.2780, -1.2293, +0.1742, -0.6659, +0.2707,
+0.2288, +0.5875, +0.0937, -0.0826, +0.1510, -0.0347, -0.2975,
-0.9115, +0.0580, +0.2950, +0.1988, +0.1708, +0.1293, +0.1360,
-0.2675, -0.3640, -0.0489, -0.3411, -0.0149, +0.0747, +0.4562,
-0.0167, -0.2461, +0.5418, +0.0244, -0.5008, +0.3172, +0.3555,
-0.0258, -1.2760, +0.0538, -0.5143, -0.1031, +0.2422, -0.0139,
+0.2600, +0.3610, +0.3186, +0.1357, -0.5968, +0.0320, +0.0657,
-0.1833, -0.0577, -0.0921, +0.1382, -0.0592, +0.0876, -0.0436,
-0.2665, -0.1702, -0.0775, -0.1017, -0.1287, +0.4811, -0.1845,
+0.3371, -0.7259, -0.0593, +0.2927, -0.1583, +0.1932, +0.1477,
+0.0772, -0.9719, -0.1581, +0.2555, -0.0088, +0.2792, -0.2661,
+0.0771, -0.0628
],
[
-0.1205, +0.0738, +0.5668, +0.3952, +0.2991, -0.2343, -0.2425,
+0.3841, +0.1064, -0.7505, +0.1889, +0.2206, +0.4329, -0.0102,
+0.5949, +0.1324, +0.1983, +0.5530, -0.0399, +0.0467, +0.3105,
+0.0241, +0.0438, -0.1896, -0.5775, +0.2109, +0.2776, -0.3537,
-0.6479, +0.2617, +0.5693, -0.0925, +0.3954, -0.1472, +0.4712,
+0.1076, +0.1822, +0.5363, -0.2732, -0.0041, +0.0766, +0.2539,
+0.2578, -0.0138, +0.2948, -0.0362, -0.0785, -0.2411, +0.2752,
-0.9657, +0.0666, +0.2308, -0.2310, +0.0951, -0.4527, -0.0697,
+0.0239, -0.0487, -0.4776, +0.3036, -0.0820, -0.4492, +0.3268,
-0.6473, -0.1562, -0.1372, -0.4948, -1.4579, +0.1958, +0.0605,
+0.2382, +0.0434, -0.3164, +0.0126, -0.1310, +0.1430, +0.1571,
-0.7431, +0.1440, -0.1454, -0.2756, +0.1328, -0.3722, -0.5365,
+0.1636, +0.4522, +0.6084, +0.2015, -0.7049, -0.8863, -0.8337,
-0.0482, +0.1404, -0.0012, -0.5127, -0.3220, -0.7337, -0.4108,
-0.0388, -0.7985, +0.3413, -0.8897, -0.0404, -0.3497, -0.1888,
-0.0018, -0.3787, -0.5566, -0.6240, +0.0503, +0.2438, -0.4712,
-0.3124, -1.2848, -0.2774, -0.3625, -0.0763, +0.0441, +0.5113,
-1.0048, +0.1605, +0.0592, -0.0083, +0.2849, -0.0818, -0.4153,
+0.4741, +0.0249
],
[
-0.3259, -0.0924, +0.2141, -0.6682, +0.0653, -0.3126, +0.2141,
-0.5372, +0.0619, +0.4928, +0.6802, -0.0303, -0.1073, -0.0185,
-0.1252, +0.4509, +0.0839, -0.1281, -0.3127, +0.2805, +0.2024,
-0.5651, +0.0838, +0.3462, -0.2815, -0.2832, -0.2357, -0.1275,
+0.6727, -0.1054, -0.2455, +0.1086, -0.2943, -0.2398, -0.4691,
+0.0847, +0.1380, -0.1887, +0.4670, -0.9059, +0.4327, -0.4259,
-0.2343, +0.2994, -0.0059, -0.3699, -0.4257, -0.2617, -0.0120,
-0.3947, +0.1851, -0.3750, -0.1081, -0.6665, +0.3328, -0.0758,
-0.5060, +0.2679, +0.3259, -0.4441, +0.0263, -0.9864, -0.3219,
+0.2595, -0.6472, +0.8043, -0.3170, -0.8339, -0.3836, -0.0252,
-0.0801, -0.1906, +0.2606, +0.8412, -0.1107, +0.0706, -0.0642,
-0.1641, +0.2282, -0.1386, -0.5176, +0.3356, +0.3406, -0.4221,
+0.0099, -0.3131, -0.1490, -0.2464, +0.9962, -0.4005, -0.2326,
-0.0511, +0.2822, -0.3473, -0.3058, -0.8731, +0.7910, +0.1322,
-0.8155, -0.0386, +0.2808, -0.1292, -0.3470, -0.5239, +1.1692,
-0.5421, -0.0557, -0.7708, -0.4259, +0.0206, -0.0570, -0.4799,
-0.1320, +0.5666, -0.0914, -0.3411, -0.2026, +0.0413, -0.3290,
+0.1876, -0.1087, -0.4253, -1.4439, -0.1898, -0.2367, +0.5706,
-0.0462, -0.2875
],
[
-0.5263, -0.5064, -0.4516, +0.2607, +0.0497, +0.4931, +0.2818,
+0.1744, -0.4092, -0.1174, +0.5896, +0.1405, -0.3963, +0.1237,
+0.2961, +0.2657, -0.0256, +0.3371, +0.0303, -0.4256, -0.3957,
-1.3833, +0.2552, +0.5481, -0.0588, -0.1626, -1.3412, +0.2287,
-0.0006, +0.3928, -0.4100, +0.2736, +0.4837, +0.2450, -0.6648,
+0.3226, -0.4540, +0.1576, +0.0255, +0.4007, +0.1668, -0.5768,
-0.5063, -0.7843, -0.2192, -0.1426, +0.0226, +0.0908, +0.3442,
-0.5859, -0.0460, -0.1415, +0.1459, +0.2539, +0.0692, +0.1603,
-0.9199, +0.1091, -0.5698, +0.3860, -0.2066, -0.2292, -0.0759,
+0.4949, +0.1564, +0.1298, +0.1323, -0.4606, +0.4239, -0.0202,
+0.4525, +0.0676, -0.0940, +0.7246, +0.1034, +0.4973, -0.0566,
+0.2889, +0.1821, -0.8860, -0.2605, +0.1120, +0.1359, -1.6559,
-0.0994, +0.1441, -0.2562, -0.0352, +0.2069, -0.2465, +0.7558,
+0.5875, -0.2769, -0.4353, -0.8551, +0.0189, -0.3636, +0.5614,
-0.1159, +0.6795, +0.2753, +0.1151, -0.0356, -0.3354, -0.8142,
+0.3002, -0.0226, -0.1470, -0.3682, -0.5422, -0.3524, -0.0762,
+0.3675, -0.1527, -0.0612, +0.2292, +0.5106, -0.1995, +0.2385,
-0.0520, +0.7068, -0.4076, -0.3832, +0.0323, +0.5738, -0.1864,
-0.4493, +0.1467
],
[
-0.4268, -0.5872, +0.1827, -0.0295, -0.5556, -0.7391, +0.7044,
+0.0806, +0.2893, -0.4276, +0.2567, -0.8649, +0.3852, +0.0466,
+0.4104, -0.3009, -0.2069, -0.4436, +0.3243, +0.4523, +0.1035,
-0.0934, +0.1396, -0.2971, +0.2776, +0.0283, -0.1412, -0.5667,
-0.7793, +0.3937, -0.0179, +0.2908, -0.6341, -0.4567, +0.2814,
-0.3609, -1.2294, -0.3265, -0.0420, +0.2264, +0.0654, -0.5900,
+0.1255, +0.0563, +0.2543, -0.1010, +0.3539, -0.0393, +0.1338,
-0.3963, +0.0427, -0.3492, -0.3314, -0.3047, -0.1329, +0.1481,
+0.1273, +0.1482, -0.1715, -0.4490, -0.6341, -0.1411, -0.1587,
-0.0418, +0.3699, -0.1815, +0.0967, -0.2825, -0.2781, +0.0213,
+0.0603, +0.1463, -0.1261, +0.0788, -0.2587, -0.0294, +0.1550,
+0.1917, -0.1985, +0.2772, -2.3317, -0.4041, -1.1275, +0.1741,
-0.3849, +0.1296, -0.0309, +0.1997, -0.4544, +0.0789, +0.4179,
+0.3871, +0.1782, +0.2553, -0.9304, -0.1356, -0.7131, -0.3142,
+0.3308, -0.2094, -0.1491, +0.6618, +0.1643, +0.3704, -0.1532,
+0.3060, -0.6095, +0.1046, -0.6198, -0.8268, -0.0314, +0.4699,
-0.0570, +0.0696, -0.2731, -0.6359, -0.3539, -0.0665, -1.4877,
-0.0778, -0.5318, -0.2568, -0.2785, +0.4667, -0.3807, +0.1290,
+0.4132, -0.2281
],
[
+0.4144, -0.2453, -0.6352, +0.0797, +0.4837, +0.1756, -0.1689,
-0.0407, -0.1641, +0.3902, +0.1434, -0.0858, -0.3018, -0.3788,
-0.4070, -0.4580, +0.5782, +0.1014, +0.0483, -0.4649, -0.8623,
-0.2727, -0.0816, -0.0794, +0.3690, +0.2358, +0.1840, -0.5061,
+0.4956, -0.0459, +0.1033, +0.1466, +0.4621, -0.2750, -0.5645,
-0.7397, +0.5092, -0.2278, -0.3908, -0.8516, +0.0498, -0.1350,
+0.0435, -0.7773, -0.0719, -0.3933, +0.3576, -1.1889, -0.1261,
-0.3057, -1.5315, -0.0822, -1.0068, -0.1458, +0.1108, +0.1728,
+0.6613, -0.0482, +0.1267, -1.9655, +0.2621, +0.6660, +0.1185,
-0.2526, -0.8080, -0.2140, -0.1064, -0.8375, +0.0504, -0.3653,
-0.4404, +0.1181, +0.4609, -0.3721, -0.6912, +0.4146, +0.6302,
+0.0670, +0.3416, -0.0533, +0.2287, -0.1202, -0.0853, -0.4180,
+0.6715, +0.0844, -0.2472, -0.6553, +0.0278, -0.1189, -0.5933,
-0.8400, -0.7732, -0.4495, -0.1789, +0.4419, +0.3583, +0.2423,
-0.3636, -0.5046, +0.0133, +0.1114, -0.2747, +0.4451, -0.2000,
-0.3484, -0.2960, +0.3360, -0.5738, +0.0549, +0.0452, -0.0862,
+0.0327, +0.9143, -0.0679, -0.5630, -0.3637, -0.5268, -0.2273,
+0.3010, -0.2710, -0.2692, +0.1983, -1.2048, -0.1386, +0.0690,
-0.0446, -0.4564
],
[
+0.1738, +0.1187, -0.3066, +0.4367, +0.1442, -0.3168, -0.5278,
+0.4796, -0.5142, +0.4568, -0.2377, -2.1440, +0.2173, -0.0282,
-1.2387, -0.2722, -0.2450, -0.9980, -0.1381, +0.3996, -0.3626,
-0.2866, -0.7293, +0.1695, -0.0305, -0.3145, +0.2440, -0.0217,
+0.2407, +0.1341, +0.4644, +0.0791, -0.0324, +0.8154, +0.2003,
-0.8524, -0.7770, -1.6000, -0.1595, -0.2486, +0.2989, +0.3587,
+0.1625, -0.0403, +0.4665, -1.1816, -0.7108, -0.1961, -0.3279,
+0.2137, -0.2674, -0.4244, -0.1972, +0.0484, -0.5213, +0.0114,
-0.5583, -1.1815, -0.2730, -2.4739, +0.0351, -0.9367, +0.4868,
-1.1313, -0.2428, -0.1098, +0.1168, +0.0097, -0.0091, -0.0988,
+0.6567, +0.2903, -1.1361, -0.0712, +0.5666, +0.5488, +0.0187,
+0.4147, -0.4554, -0.0554, -0.1015, -0.3783, -0.2677, +0.2319,
-0.0162, -0.3072, -0.0450, -1.5145, -0.3145, +0.2317, +0.0531,
+0.0717, -0.4312, -0.0905, +0.2989, +0.2484, +0.5011, -0.5255,
+0.2265, -1.6048, +0.0203, -0.3383, +0.2683, +0.3878, -1.3090,
+0.0639, +0.6891, -0.1080, -0.3280, -0.0528, -0.4217, +0.0452,
-0.4198, -0.1554, -0.0454, -1.4473, +0.6277, -0.1168, -1.7838,
+0.5812, -0.5257, -0.3076, -1.3098, -0.3146, +0.6357, +0.2521,
+0.3271, -0.3130
],
[
+0.0589, -0.6008, +0.6131, -0.0561, +0.1542, +0.2693, -0.6580,
-0.4314, +0.3777, +0.6637, +0.0180, -0.2727, -0.2689, -0.0286,
-0.1122, -1.1123, +0.4082, -0.6998, +0.3442, -0.5004, +0.7137,
-0.0825, +0.1974, +0.0429, +0.0050, -0.9253, +0.1016, +0.4778,
-0.1797, +0.1576, -0.4610, +0.1361, -0.2568, -0.3893, -0.5261,
-0.2596, -0.3747, -0.9947, +0.9117, +0.0450, -0.0129, -0.0390,
-0.2002, -0.6058, +0.4297, +0.8271, -0.3855, -0.3747, -0.1476,
+0.2770, +0.1003, +0.1974, +0.4767, -0.1774, -0.1524, -0.4341,
+0.3936, +0.3613, -0.1879, -0.5588, +0.1126, +0.0162, -0.0249,
-0.2132, +0.1565, +0.2099, +0.2711, +0.6800, +0.3956, +0.1056,
-0.1320, +0.3389, +0.6546, -0.2477, -0.7566, -0.6385, -0.8820,
-0.7212, +0.0082, -0.0972, -0.5484, -0.6205, +0.2054, -0.6334,
-0.1074, -0.4796, -0.2095, -0.3918, -0.0249, +0.0496, +0.6946,
-0.8485, -0.7488, +0.1659, +0.1668, -0.6838, +0.4973, +0.0243,
+0.3332, -0.6033, -0.0636, -0.2762, +0.3183, +0.0333, +0.0461,
-0.5229, +0.1616, +0.2639, -0.7256, +0.3384, +0.4716, -0.1737,
+0.2796, -1.0387, +0.5968, -0.3691, -0.2509, +0.1983, -0.5982,
-0.2095, -0.3888, -0.0593, -0.4660, +0.2009, -0.2723, -0.3105,
-0.0894, +0.0340
],
[
+0.0328, -0.4288, -0.4086, -0.0870, +0.0050, +0.2962, -0.5815,
-1.1317, +0.2684, -0.3838, +0.3732, -0.0419, +0.1006, -0.0332,
-0.4590, -0.0034, -0.1430, -0.0152, -0.4190, -0.2460, -0.1689,
+0.2852, -0.3491, -0.1469, +0.5112, -0.2610, +0.5671, +0.3549,
-0.1863, +0.1151, +0.0004, +0.1777, +0.0849, -0.0509, -0.0241,
-0.2225, +0.5380, -0.1528, +0.1736, -0.5529, -0.3402, -0.4931,
+0.1928, +0.2212, -0.1292, -0.1949, -0.6881, +0.2509, -0.4402,
-0.1828, +0.4146, +0.0894, +0.2925, -0.3445, -0.3955, +0.2638,
-0.4357, -0.4719, +0.3477, +0.2992, -0.1546, -0.5620, +0.0869,
+0.3226, +0.1604, +0.7277, -0.9342, -0.3394, -0.1522, -0.8674,
+0.1367, -0.1647, -0.2419, -0.9182, -0.0594, -0.7259, +0.3389,
+0.2066, +0.4865, +0.2865, -0.3317, -0.3533, +0.1510, -0.0408,
-0.2310, -0.1214, -0.7874, +0.0594, +0.0637, +0.1704, -0.0509,
+0.4279, +0.1456, +0.0183, +0.0084, -0.3207, +0.3121, -0.4553,
+0.3080, -0.0612, +0.2902, -0.4538, -0.2972, -0.4140, +0.3137,
-0.1422, -0.8175, -0.1954, +0.5369, -0.7929, +0.2202, -1.4705,
-0.1834, -0.1199, -0.1593, +0.2240, -0.3757, -0.3017, -0.0894,
-0.1868, +0.6420, -0.0309, +0.1543, -0.5357, -0.2081, -0.1984,
+0.0857, +0.3100
],
[
-0.2785, +0.1105, +0.4149, -1.5879, +0.0800, +0.2271, +0.2915,
-0.3843, -0.4893, -0.7819, +0.0453, +0.0527, -0.0760, -0.2994,
-0.2641, +0.3183, -0.6400, -0.1805, +0.4145, +0.2248, +0.0725,
+0.1895, -0.0617, -0.2392, -0.0425, -0.0769, -0.0557, +0.2105,
+0.0059, +0.0436, +0.0629, +0.1110, +0.1154, +0.0762, +0.4204,
+0.1830, +0.0864, -0.4372, -0.3877, +0.0984, +0.2884, -0.1137,
-0.2281, +0.4976, +0.0322, -0.3907, +0.1984, +0.4247, +0.4307,
+0.2986, +0.1207, -0.1555, +0.5228, -0.0764, -0.7537, -0.4695,
+0.1507, -0.2460, +0.6236, +0.0654, -0.3903, -0.1480, -0.2316,
-0.1298, -0.0985, -0.6067, +0.0898, -0.9388, -0.0253, -0.6018,
-0.1985, +0.3939, +0.0958, +0.4344, +0.0901, -0.1734, +0.0954,
-0.5844, -0.5133, +0.0663, +0.1024, +0.1432, +0.1262, +0.5046,
-0.8934, -0.0737, -0.2976, -0.0891, -0.1219, -0.4012, +0.4510,
-0.4059, -0.0357, +0.3248, -0.6301, -0.1376, +0.3172, -0.0587,
+0.8964, -0.1738, +0.1822, +0.4807, -0.3443, -0.2458, -0.2195,
+0.1496, +0.6157, -1.0314, +0.1581, +0.5302, +0.0455, +0.3477,
+0.0962, +0.5732, -0.0013, -0.4262, -0.1007, -0.5615, -0.9545,
+0.1694, -0.4215, +0.2925, -0.3688, +0.3731, -0.0066, +0.6691,
-0.4870, -0.3537
],
[
+0.4068, +0.5845, -0.8742, -0.0664, -0.3680, +0.4151, -0.7328,
+0.0857, -0.2333, +0.0135, -0.0799, +0.1949, -0.1770, -0.3081,
+0.3287, +0.2236, +0.1515, +0.1368, +0.2567, -0.0252, +0.0880,
-0.2675, -0.2043, -0.6968, +0.0936, -0.4986, +0.7414, +0.3489,
+0.6269, -0.0687, +0.1289, +0.2688, -0.4887, -0.3381, -0.4586,
-0.0715, -0.4161, -0.4189, +0.1545, +0.2416, +0.4395, -0.1713,
+0.2378, +0.1061, -0.0685, +0.2889, -0.2323, -0.4748, +0.0775,
-0.0366, -0.2849, +0.3293, +0.3429, -0.0311, -0.0716, -0.1996,
+0.2068, -0.0579, +0.0055, -0.4996, +0.5267, -0.2290, -0.0476,
+0.0717, -0.1189, +0.5376, -1.0262, +0.0645, -0.0771, -0.1288,
+0.1105, -0.1917, -0.1174, -0.9960, -0.0879, -0.2593, +0.1000,
-1.1075, -0.3571, -0.0944, +0.0719, -0.1795, +0.0898, +0.1515,
-0.1497, -0.0154, +0.6563, -0.3794, +0.5367, -0.0372, +0.2813,
-0.1864, +0.1888, +0.3343, +0.1813, +0.1186, -0.3605, -0.3599,
+0.0245, -0.1951, -0.2185, -0.3295, +0.4275, +0.5862, -0.3230,
+0.2030, -0.2806, +0.2977, -0.2020, -0.2393, +0.7133, +0.5259,
-0.2807, -0.0618, -0.2883, -0.7191, -0.0670, +0.2811, -0.5409,
-0.3810, -0.6504, +0.3010, -0.0262, -0.4714, -0.6627, +0.2988,
-0.0401, -0.4720
],
[
-0.2626, -1.0124, +0.5541, -0.4718, -0.4002, +1.0249, +0.7575,
-0.9172, +0.3645, +0.4410, -1.9788, -0.3823, -0.4584, -0.1375,
+0.1245, -1.9877, -0.0296, -0.7269, -0.3599, -0.1202, -0.1364,
-0.2387, -0.2567, -0.0231, -0.1633, -0.7615, -0.0839, +0.1308,
+0.3210, -0.0354, +0.1021, -0.5398, -1.2572, -0.3326, -1.0425,
-1.1440, -1.5605, +0.3467, -0.0568, +0.3251, +0.2199, -0.1133,
-1.1209, -0.7836, -0.1683, +0.1539, -0.6069, +0.1850, +0.3215,
+0.0858, -0.3703, -0.1263, -0.1525, -0.4650, -0.2361, -0.0552,
+0.0358, -0.1606, +0.3956, -0.6136, -0.3105, +1.1259, +0.2709,
-0.4181, +0.3087, -0.0557, +0.3173, -1.1064, +0.0733, +0.9819,
-0.6309, +0.0837, -0.1080, -1.0399, -0.5285, -0.1462, -0.5661,
-0.5493, -0.2285, +0.2912, -0.1998, +0.2417, +0.2161, -0.2585,
-0.2857, +0.6020, +0.2718, -0.8665, -0.0585, +0.0802, -0.4464,
-0.7278, -0.3143, -0.4762, +0.6787, +0.1115, +0.3620, -1.2068,
-0.0188, -1.3203, +0.1745, -0.5332, +0.3937, -0.0463, -1.4745,
-0.0737, +0.5788, -0.1706, -0.2145, +0.3874, -0.1163, +0.4487,
-0.0749, -1.4194, -0.0450, -0.4730, +0.2539, -0.4686, -0.3258,
-0.2435, -0.0529, +0.0138, -0.3011, -1.7579, -0.0738, -0.5660,
-0.2687, -0.1031
],
[
-0.1890, +0.1846, +0.1528, +0.1868, -1.0463, +0.1361, -0.6526,
+0.3472, +0.9501, +0.1137, -0.1338, -0.3032, -0.1089, -0.3156,
+0.4740, -0.1239, +0.0710, -0.3375, -0.3874, -0.0470, -0.0551,
+0.5221, +0.5352, +0.0590, +0.0157, -0.1133, +0.2564, +0.0972,
-0.1763, -0.0172, +0.2382, +0.3805, +0.3693, -0.1347, -0.4978,
-0.4696, +0.1159, +0.5663, +0.0888, +0.0899, -0.1063, -0.4584,
+0.3321, +0.4006, +0.1525, -0.2469, -0.2116, -0.4201, +0.1384,
+0.6111, +0.1410, -0.1235, +0.1201, -0.1482, +0.1087, +0.4535,
-0.0998, -0.0626, -0.3032, +0.4636, -0.6396, +0.3708, -0.0050,
+0.4596, +0.5721, +0.2259, +0.2125, +0.0627, +0.3765, -0.7187,
-0.7086, +0.2721, -0.0764, -0.0565, +0.0235, -0.3755, -0.2753,
+0.4597, +0.6486, +0.2965, +0.5531, -0.3629, +0.0782, -0.1587,
+0.0848, -0.1989, -0.3563, -1.4503, +0.2558, -0.2762, +0.5357,
+0.0858, +0.1913, -0.2766, +0.1420, -0.4243, -0.1676, -0.3365,
+0.0941, +0.0516, -1.1257, -0.4089, -0.8515, -0.2830, +0.4711,
+0.3335, -0.1440, -0.0064, +0.4255, -0.2008, +0.4499, -0.5755,
+0.1673, +0.2069, -0.2422, -0.0123, -0.2220, +0.1374, -0.0896,
+0.0227, +0.3576, -0.5969, +0.4685, +0.0131, +0.2259, +0.3857,
+0.2969, +0.5092
],
[
+0.2385, -0.0237, -0.2371, -0.9950, -0.7939, +0.1525, -0.6166,
-0.0463, +0.0723, +0.2182, +0.3742, +0.1939, -0.3690, -0.5012,
-1.2359, +0.2250, -0.2047, -0.7313, -0.3548, +0.0486, +0.3503,
+0.3015, +0.2342, +0.5576, +0.0184, -0.5800, +0.0429, +0.2196,
+0.2226, -0.1715, -0.1384, +0.3288, -0.1334, +0.3295, +0.6067,
-0.0384, +0.0176, +0.0138, -0.1203, +0.0863, -0.0909, -0.3321,
-0.0272, -0.0426, -0.1637, +0.1722, -0.6915, +0.0731, +0.2473,
+0.0653, -0.1243, -0.3751, -0.6515, +0.0765, +0.3489, +0.0208,
+0.3015, +0.0442, +0.1349, +0.1498, +0.6269, +0.8148, -0.4758,
+0.2989, -0.7103, -0.2501, -0.5741, -0.0260, -0.4906, -0.2687,
+0.5507, -1.0255, +0.1971, -0.4078, -0.1656, +0.7028, +0.3517,
-0.8417, +0.2221, -0.1728, -0.0505, -1.1888, +0.3255, +0.0383,
-0.8892, +0.0544, +0.3391, -0.1401, -0.9512, -0.0529, +0.2119,
-0.3345, -0.2999, -0.4352, -0.1427, -0.0157, -0.2630, +0.1494,
+0.3705, +0.4497, -0.4527, -0.1771, -0.3700, -0.2584, -0.5270,
+0.3196, -0.5018, -0.0420, +0.4243, +0.0048, -0.3724, -0.1658,
-0.0970, -0.5838, +0.2219, -0.2543, -0.3992, -0.0216, +0.5249,
+0.1735, +0.5442, -0.0929, +0.1333, +0.1425, -0.1071, -0.1370,
+0.1609, -0.3632
],
[
-0.6062, -0.0107, -0.5037, +0.0280, -0.7645, -0.3818, +0.0495,
-0.6663, -0.1796, +0.0424, -0.7120, -0.2048, +0.1505, +1.1172,
+0.1182, +0.7021, +0.0447, +0.2636, -0.0117, -0.6400, +0.1739,
-2.0563, +0.2643, +0.2216, -0.6307, -0.3034, -1.6683, +0.2710,
+0.5509, +0.0906, +0.1050, -0.6639, -0.1404, +0.0301, +0.8906,
+0.1874, +0.4052, -0.0841, -0.5191, -1.3543, +0.3044, +0.6129,
-0.1700, +0.0759, -1.0354, -0.7217, +0.2234, +0.8004, -0.4027,
-0.1250, +0.2738, -0.9314, -0.0443, -0.1532, -0.4836, +0.5214,
-1.4886, +0.0576, -0.3373, -0.5356, -0.2243, -0.1056, +0.5262,
+0.5279, -0.9975, -1.0158, -0.0009, -2.1319, -0.6019, -0.5193,
+0.8604, +0.5502, -0.1540, +0.2157, +0.2840, -0.1492, +0.0043,
+0.1732, -0.0667, +0.7070, +0.1044, +0.0107, +0.4892, -1.3223,
-0.1142, -1.0157, -0.0481, +0.5053, +0.2333, -0.1292, +0.2140,
+0.1220, -0.3557, -1.2828, -0.1046, -0.1504, -0.0380, -0.0526,
-0.7740, +0.1770, +0.4862, -0.7069, -0.6501, -0.2251, +0.6397,
+0.5812, -0.0295, -0.3300, -0.1545, -0.2888, -0.0862, -0.2176,
-0.1580, -0.9327, -0.3072, -0.2631, +0.3495, -0.8641, +0.4137,
+0.3080, +0.4942, -0.7215, -0.4081, -0.4022, +0.0381, +0.6014,
-0.9209, -0.0248
],
[
-0.0358, -0.2476, +0.0637, -0.2123, -0.9081, -0.0865, +0.3561,
-0.5554, +0.1656, +0.1798, -0.0769, -0.3535, -0.2186, +0.2111,
-0.2864, -0.1337, -0.4597, +0.3778, -0.2488, -0.0923, -0.1262,
-0.0262, +0.2277, -0.3163, -0.0397, +0.0646, -0.4947, -0.2864,
-0.5216, -0.7771, -0.5574, +0.1186, -0.0542, +0.0515, -0.2259,
+0.4735, -0.1975, -0.0630, +0.0789, -0.1683, +0.5125, -0.4719,
+0.6143, +0.0867, +0.6118, -0.0284, -0.2530, +0.3255, +0.2878,
-0.3443, -0.7612, +0.1266, +0.1155, -0.0903, +0.3597, -0.3959,
+0.0233, +0.0967, -0.7554, +0.2049, -0.4178, -0.1526, -0.0914,
+0.2557, +0.3241, +0.3012, +0.1893, +0.2647, +0.2142, -0.1623,
-1.2681, +0.4970, -0.2651, +0.2166, -0.1153, +0.0663, -0.7682,
+0.4426, +0.3446, +0.3132, +0.6882, +0.7522, -0.1070, -0.3160,
+0.1417, -0.4353, -0.3498, -0.2256, -0.1062, -0.4434, -0.3921,
-0.5221, +0.3964, -0.4258, +0.1572, +0.1609, -0.3845, -0.5640,
-0.3708, +0.4984, -1.0621, -0.2547, -0.1994, -0.0205, +0.3775,
-0.4878, +0.0006, -0.0061, +0.0959, +0.0843, -0.1139, -0.2873,
+0.3424, -0.1215, -0.8438, -0.6846, -0.0152, +0.2998, +0.4343,
-0.8696, +0.2929, +0.1009, -0.8495, -0.7728, -0.0976, +0.0524,
-0.2486, +0.0719
],
[
-0.3571, -0.4067, +0.5145, -0.6866, -1.0174, +0.0091, +0.1718,
-0.1745, -0.2513, +0.0362, +0.1269, +0.2780, -0.4117, +0.4818,
+0.3668, -0.1561, +0.1516, -0.8762, +0.1162, -0.0460, +0.6237,
-0.0380, -0.0423, +0.1929, +0.0457, -0.8398, -0.2828, +0.3374,
-0.4903, +0.1736, +0.5767, -1.4534, +0.3863, -0.9543, +0.2292,
-0.2237, +0.4655, -0.0044, +0.0677, -0.0377, +0.2746, -0.5696,
-0.0749, +0.3972, +0.1447, +0.1636, -0.0700, -0.2671, +0.2902,
+0.0804, +0.3041, -0.2553, -0.7488, -0.7124, +0.7484, -0.7365,
+0.3321, +0.4087, -0.4259, -0.2603, +0.5249, +0.2184, +0.3844,
-0.0441, +0.1161, +0.1279, -0.2196, -0.1223, -0.0356, -0.0484,
-0.3438, -0.1186, -0.3836, +0.0660, +0.3879, +0.2712, -0.2012,
+0.1470, +0.3385, -0.1620, -0.3034, -0.5461, -0.0432, +0.2796,
-0.8137, -1.3743, +0.4925, +0.2108, -0.1027, -0.2138, -0.7378,
-0.1209, -0.4294, -0.0851, -0.2624, -0.3597, -0.8611, +0.4464,
+0.0393, -0.9927, -0.0209, +0.1669, -0.1943, -0.0069, +0.2535,
-0.2320, +0.0523, -0.0387, +0.0736, +0.6659, +0.0430, -0.8271,
-0.5452, -1.2268, -0.2558, +0.1095, +0.1778, -0.0051, +0.3514,
+0.5244, +0.0645, +0.4827, -1.0049, -0.2551, -0.3863, +0.4874,
+0.5816, +0.1889
],
[
-1.1268, -0.0477, +0.6551, -0.2983, -0.7391, +0.0787, -0.0184,
-0.7897, -0.0595, +0.5084, +0.2580, +0.0430, -0.7676, -0.5418,
+0.3700, -0.8769, -0.2995, +0.1440, -0.0261, -0.4732, +0.0802,
-0.6458, -0.3006, +0.0732, +0.5992, +0.3819, -0.5000, -0.1366,
-1.0918, +0.0226, +0.1488, -0.0729, +0.1031, +0.1314, +0.2606,
-0.3808, -0.6380, -0.5858, -0.4060, +0.2601, +0.0668, -0.1249,
+0.1666, -0.5117, -0.4081, +0.2744, +0.2560, -0.8061, -0.9125,
-0.1472, +0.2233, +0.0335, -0.3542, -1.0575, -0.2591, -0.0555,
-0.3672, -0.0313, -0.1326, -0.4782, +0.0546, -0.0755, +0.1963,
-0.2694, +0.0272, -0.2004, -0.7292, -0.2204, +0.4913, -0.0399,
-0.6559, -0.0752, -0.2607, -0.0702, +0.2666, +0.2539, -1.0182,
+0.1792, +0.1817, -1.1582, -1.8026, +0.2342, -0.7006, -0.4952,
+0.1345, +0.2998, -0.2620, +0.1336, -0.0174, -0.4578, -0.1101,
-1.5142, -0.4791, -0.2391, -0.9607, +0.3614, +0.2139, +0.3459,
+0.7567, -0.1753, +0.1528, -1.0601, +0.2125, +0.2843, -0.0785,
+0.5537, -0.2362, -0.2993, +0.1568, -0.7571, +0.2312, -0.8912,
+0.2062, -0.3023, -0.2358, +0.5970, -0.5798, -0.5901, -0.1895,
-1.0248, -0.0076, +0.0373, -0.4598, -0.3706, -1.0179, -0.1707,
+0.4706, -0.4109
],
[
+0.5548, +0.0762, -0.9732, +0.4974, +0.0721, +0.0603, +0.0403,
-0.4016, -0.1278, -0.4030, +0.0751, -0.4352, +0.2306, -0.3200,
+0.2516, -0.4887, +0.0665, -0.2368, -0.2360, +0.4221, +0.1742,
-0.2811, -0.2135, -0.4115, -0.2981, +0.3318, +0.0242, +0.2272,
-0.3173, -0.1427, +0.2518, -0.3534, -0.4959, -0.2551, -0.0797,
-0.1724, -0.4159, -0.2069, -0.2414, -0.8762, -0.3802, -0.3595,
-0.1394, -0.0372, +0.0818, -0.1363, -0.8352, -0.4604, -0.1355,
+0.0200, -0.2153, +0.1949, +0.0538, -0.4498, -0.2186, -0.2281,
+0.0772, +0.0655, -0.5071, +0.1983, -0.8508, +0.0344, -0.0185,
+0.2695, +0.5237, +0.3735, -0.0424, +0.0236, +0.1312, +0.5737,
-0.2471, -0.2865, -0.0292, -0.5521, -0.0439, +0.0889, -0.5819,
+0.4158, +0.2471, -0.4975, -0.3082, +0.1817, -0.2181, +0.1859,
-0.3464, +0.1266, -0.1987, +0.0891, -0.8471, +0.2534, +0.0612,
+0.0998, +0.5045, +0.2724, +0.2775, +0.0461, -0.1714, +0.3437,
-0.0115, -0.6069, +0.3813, -0.3904, +0.2130, +0.5443, +0.5034,
+0.2294, -0.2291, +0.2235, -0.1319, -0.0598, -0.1721, +0.2250,
+0.1713, -0.0901, +0.7149, +0.0539, +0.0448, -0.5711, +0.1461,
+0.4580, -0.1875, +0.0457, -0.1837, -0.4180, +0.0479, -0.1208,
+0.1840, +0.4426
],
[
-0.2842, +0.2116, +0.0117, -0.6003, +0.0043, -0.2358, +0.4554,
+0.7943, +0.2894, -0.1744, -0.7563, +0.4605, -0.2773, -0.3848,
-0.5594, -0.3504, -0.2448, -0.0372, -0.3179, +0.1210, +0.1392,
-0.5565, +0.2361, -0.5027, +0.7456, -0.1703, -0.0240, +0.1292,
+0.2535, -0.3699, -0.3059, -0.5017, -0.2633, +0.1405, +0.0046,
-0.3354, -0.2708, -0.1274, +0.0338, +0.1981, -0.0836, +0.6965,
+0.0527, +0.0872, -0.1278, -0.4493, +0.4030, -1.5423, +0.5086,
+0.1008, -0.3396, +0.0430, -0.4026, -0.1746, -1.0235, +0.2083,
-0.2529, +0.4123, +0.2179, +0.1214, +0.6086, -0.0055, -0.5584,
-0.6812, -0.1916, -0.3864, +0.0741, +0.1077, +0.4114, +0.0345,
-0.1636, -2.1677, +0.6062, -0.1717, +0.0664, +0.1639, +0.4483,
-0.6986, -0.0163, -0.2069, +0.2554, -0.3096, -0.0139, +0.3088,
+0.0131, -0.3570, -0.1024, -0.1159, +0.2009, +0.2716, -0.1614,
+0.3146, +0.0674, +0.2829, -0.0565, +0.2379, +0.0764, +0.0750,
+0.0191, +0.0233, -0.1372, +0.2373, +0.2386, +0.0077, -0.2598,
+0.2932, -0.2208, -0.1869, +0.4116, +0.2577, -0.3386, +0.3720,
-0.0159, +0.3788, +0.3233, +0.2683, -0.4094, -0.2736, -0.2217,
-0.1135, +0.1307, +0.2497, -0.5941, +0.0363, -0.0517, +0.1772,
-0.1428, -0.1171
],
[
-0.0162, -0.0627, +0.1236, +0.4031, -0.2465, +0.1629, +0.0719,
+0.4211, +0.1920, -0.1312, +0.0193, +0.2175, -0.1819, -0.6242,
-1.0284, +0.2454, +0.0434, -0.1952, +0.1975, -0.1499, +0.0737,
-0.3134, -0.4515, +0.1174, -0.1765, -0.1006, -0.0569, -0.9097,
-0.7455, -0.4741, +0.2333, -0.3261, +0.3061, +0.1993, -0.2329,
+0.2430, +0.1176, +0.2400, +0.2129, +0.4918, -0.2546, -1.1784,
-0.6182, -0.1537, +0.1395, +0.5393, -0.7461, -0.2201, +0.1386,
-0.2714, -0.2729, -0.1344, -0.2892, -0.7805, +0.1870, -0.4685,
-0.1468, +0.3957, +0.0906, -0.0169, -0.1142, -1.1525, +0.4167,
-0.5574, +0.0122, -0.1523, +0.2502, -0.0223, -0.0227, +0.2885,
+0.0504, -1.7032, +0.0428, +0.3443, -0.4039, +0.2699, -0.0908,
-0.3298, -0.2390, -1.0043, -1.0324, +0.0237, +0.1503, +0.5633,
-0.4685, -0.3616, -0.8335, -1.0535, -0.6771, -0.0776, -0.3784,
+0.4398, -0.6072, -0.5504, -0.5404, -0.3614, -0.3855, +0.0132,
+0.1216, -0.3302, +0.3921, +0.1087, -0.2751, +0.3683, -0.8535,
-0.0739, -0.0324, -0.8358, +0.2640, +0.0494, +0.3263, -0.3085,
-0.0733, -1.1149, +0.2494, -0.1388, -0.3078, +0.1479, +0.6488,
+0.5278, -0.6395, -0.0259, -1.1560, -0.0320, +0.0748, -0.3467,
+0.5657, +0.5099
],
[
-0.1044, -0.6576, -0.0207, -0.2102, -0.2144, +0.0663, +0.3874,
+0.2177, -0.1430, -0.3068, -1.4322, +0.4873, +0.1080, -0.1987,
-0.1861, -0.0218, -0.0747, -0.0191, +0.6192, -0.2742, -0.1812,
+0.2117, +0.6730, +0.3359, +0.5871, +0.1320, +0.0645, +0.3662,
-0.9857, +0.0502, -0.0964, -0.0680, -0.2814, -0.4225, -0.6175,
+0.3815, +0.1500, +0.2513, +0.1783, -0.0825, +0.0526, +0.2218,
+0.2001, +0.1161, -0.1507, +0.2265, +0.1415, -0.6507, +0.2255,
-0.0120, +0.3568, +0.0921, +0.3392, +0.0370, -0.1990, -0.2535,
+0.1636, +0.3225, -0.4935, +0.2109, -0.0501, +0.0897, -1.0855,
+0.1237, +0.0788, +0.5188, -0.4567, +0.0116, -0.5196, -0.1994,
-0.2475, -0.6040, +0.0321, -0.1177, +0.0018, -0.4671, -0.5711,
+0.0513, -0.5653, +0.2688, -0.2311, +0.2756, -0.0531, +0.7042,
-0.3073, +0.3589, +0.3590, -0.1418, +0.5496, -0.4660, +0.5389,
-0.1360, +0.2775, +0.2597, -0.1089, -0.1900, +0.4253, +0.3885,
+0.4209, -0.3493, +0.0138, +0.5685, +0.1056, -0.1521, -0.5811,
-0.1916, -0.0096, +0.0435, +0.1461, +0.0400, +0.2125, -0.3966,
+0.4368, +0.0176, +0.2729, +0.0513, -0.4901, +0.0455, -0.0224,
-0.3494, +0.0116, +0.3173, -0.9230, +0.2972, +0.1613, +0.4970,
-0.2340, +0.0639
],
[
-0.1437, -0.7074, -0.0227, -0.1429, +0.5628, -0.1444, -0.4686,
-0.4664, +0.2558, +0.1615, +0.1201, -0.0562, -1.6423, +0.4704,
-0.6496, -0.7396, +0.1954, -0.1594, -0.5794, -2.0340, -0.0471,
+0.1209, +0.0230, -0.1971, -0.3795, +0.3395, -0.2557, -1.0066,
+0.1323, +0.3637, +0.1311, -0.2849, +0.0459, -0.0762, -0.0104,
+0.6315, -0.3362, -0.1927, +0.4068, +0.0825, +0.4061, +0.0420,
-0.1391, +0.0454, +0.0701, +0.2792, +0.2601, +0.1755, +0.4302,
+0.0462, -1.3625, +0.1624, +0.0497, -0.0207, +0.2457, +0.2754,
-0.4668, +0.1269, -0.0177, -0.0970, +0.0154, -0.5404, -0.0584,
+0.4238, +0.1016, +0.1083, -0.4236, +0.3165, +0.0311, -0.1969,
-0.1508, +0.1011, -0.4269, -0.0473, -1.4787, -0.0548, -2.0101,
+0.3298, -0.4169, -0.1667, -0.2075, -0.5669, +0.2357, -0.1768,
+0.2307, -0.0191, +0.6791, -0.0978, -0.4987, -0.2691, +0.0821,
-0.5149, +0.1673, -0.1167, -0.0717, +0.5303, +0.6750, +0.1378,
-0.1502, -0.4372, -0.0052, -0.0900, +0.0762, -0.4988, -0.2373,
-0.4635, -0.6370, +0.5504, +0.1706, -1.2182, -0.3613, -0.4645,
-0.1783, -0.8491, -0.1739, -0.3553, +0.2115, -0.1156, -1.3149,
-0.2067, +0.3576, -0.2588, -0.5707, -1.1997, +0.3510, -0.5910,
-0.0631, -0.0799
],
[
-0.7265, +0.8917, -0.0751, -1.3913, +0.3771, -0.1059, -0.0873,
+0.3571, -0.8270, -0.1692, +0.1868, -0.3708, +0.0788, +0.4810,
+0.7026, +0.3153, -0.2533, +0.0807, -0.4520, -0.6554, +0.2868,
-0.4496, +0.0535, -0.1686, -0.2701, -0.2813, -0.7436, +0.3309,
-0.2931, -0.4216, +0.3644, -0.1687, +0.5863, +0.8018, +0.6494,
+0.4601, -0.3677, -1.0434, +0.2167, +0.5227, +0.1440, -0.4096,
+0.1883, +0.5111, +0.5387, -0.1108, +0.3406, -0.1422, +0.1151,
-0.1370, -0.7487, -0.0985, -0.4278, -0.2114, +0.2810, -0.0622,
+0.2291, -0.3401, -0.4664, -0.1857, +0.4196, +0.0946, +0.4732,
-0.0479, -0.1954, -0.6938, +0.1261, +0.0103, -0.3667, -0.0102,
+0.1229, -0.2663, +0.2842, +0.2170, +0.0748, +0.3038, +0.6471,
+0.1502, +0.4311, +0.3652, -0.3753, -0.1012, +0.4648, -0.2373,
-0.5606, +0.1091, +0.3855, -0.1598, -0.4532, +0.0894, +0.0529,
+0.2738, +0.1630, +0.6182, -0.2206, -0.2195, -0.7492, -0.2194,
-0.3159, +0.7241, +0.0582, -0.5792, -0.6760, +0.0261, +0.3155,
+0.1989, +0.3230, +0.2225, -0.2388, -0.1559, -0.1574, +0.1876,
-0.2981, -0.0996, +0.0628, +0.1548, -0.1244, -0.9343, +0.0628,
+0.2718, +0.1845, -0.0582, -0.4112, +0.3589, -0.1315, -0.2060,
+0.1827, -0.1181
],
[
+0.3130, +0.1275, -0.4132, -0.4863, +0.2244, +0.2695, +0.4271,
+0.2023, -0.0472, +0.4431, -0.1568, +0.6265, +0.2728, +0.2451,
-0.2830, -0.0059, +0.2365, +0.3480, +0.2522, -0.7088, +0.0403,
-0.0386, +0.1891, -0.3917, +0.0114, +0.4899, +0.0924, +0.3148,
-0.5466, +0.1659, -0.1183, -0.1935, -0.1756, -0.1477, +0.1472,
-0.1724, +0.2143, +0.7332, +0.0079, +0.2761, -0.3160, +0.5058,
-0.0931, -0.1448, -0.0298, +0.7194, +0.1387, -0.6623, +0.0052,
+0.2097, -0.5607, +0.5945, -0.2575, +0.2782, -0.5959, +0.1211,
-0.0791, -0.2460, -0.7347, -0.2956, +0.1763, +0.6106, -0.4464,
+0.2316, -0.2995, +0.4528, -0.8791, -0.7911, -0.1451, -0.2947,
+0.2296, -0.1733, +0.2242, -0.0035, -0.4821, -0.6993, +0.3675,
+0.2964, +0.3193, +0.2363, +0.0551, -0.0624, +0.3850, +0.1241,
-0.1481, +0.2376, +0.0553, -0.3350, -0.1162, -0.2798, -0.1833,
+0.0958, -0.1838, -0.0980, -0.1692, -0.3936, +0.3211, -0.0617,
-0.0247, +0.0837, +0.7681, +0.3259, +0.0790, -0.0632, -0.4515,
-0.5924, +0.3167, -0.4388, +0.5271, +0.0197, -0.0969, -0.2817,
-0.0572, -0.0888, +0.2329, +0.2268, +0.2331, +0.1691, -0.4536,
-0.2887, -0.2485, +0.2667, +0.0362, +0.1168, +0.2150, -0.2858,
-0.0200, +0.4715
],
[
+0.1219, -0.0217, -0.5837, -0.3836, +0.4210, -0.5505, +0.1642,
-0.1091, -0.8230, -0.6983, +0.3176, -0.1022, +0.0676, +0.2756,
+0.4560, +0.2047, +0.1622, +0.1974, +0.3630, +0.2332, -0.2842,
+0.0591, -0.1309, +0.2992, +0.5811, +0.4116, -0.6022, -0.4205,
+0.2960, +0.0698, -0.4935, -0.8271, +0.3858, -0.0605, -0.1359,
-0.2071, +0.5370, -0.6949, +0.4987, -0.2968, -0.0380, -0.4235,
+0.1417, -0.5961, +0.3926, -0.1673, -0.4168, +0.7737, +0.0137,
-1.2432, +0.2691, +0.1803, +0.7565, +0.2014, +0.0604, -0.3547,
+0.0504, -0.1369, -0.7881, -0.2128, +0.0610, -0.0196, -0.1566,
+0.0030, -0.8292, -0.0454, +0.0377, -0.0885, +0.0579, -0.2501,
+0.0370, -0.9455, -0.0527, -0.2292, -0.5440, -0.0517, -0.0122,
-0.2071, -0.0758, +0.0947, +0.0308, +0.1070, +0.1017, -0.3191,
+0.1329, -0.3563, -0.1016, -0.8970, +0.4906, -0.2456, -0.3833,
-0.3038, -0.0509, -0.1365, +0.2201, -0.5577, +0.1567, -0.1963,
-0.4634, -0.0231, +0.1323, +0.4220, -0.4158, -0.6117, -0.1371,
-1.3515, -0.4502, -0.7084, +0.4100, +0.0979, -0.1893, -0.6622,
-0.2095, +0.1093, +0.3789, -0.3222, -0.4348, +0.3956, -0.1112,
-0.1735, +0.2460, +0.0870, -0.4405, +0.1579, -0.0126, +0.3663,
-0.1206, -0.4883
],
[
+0.4090, +0.3428, +0.2512, -1.5906, +0.6582, -0.8021, +0.1520,
-0.0569, -0.4027, +0.2248, +0.2477, -0.4910, -0.9947, -0.4317,
+0.2517, -0.3626, -1.3942, +0.2331, +0.5284, -0.4955, -0.1959,
+0.0347, -0.2575, -0.1463, -0.1766, +0.1963, -0.8659, +0.0555,
+0.4978, -0.9231, -0.4148, +0.5886, -0.3435, +0.3906, -0.2323,
-0.3572, -0.0199, -0.4587, -0.4683, -0.4979, -0.2390, +0.0564,
-0.6407, +0.2675, -0.7272, -0.2480, +0.4758, -0.7479, +0.1223,
+0.0275, +0.1572, +0.0790, +0.4834, -0.3260, +0.0827, -0.3243,
-0.4053, -0.2065, +0.8476, -0.4793, +0.7518, +0.0727, -0.2254,
-0.8287, -0.7180, -0.1953, +0.2458, -0.5847, -0.3380, -0.1605,
+0.0760, +0.8777, -0.0750, -0.2355, -0.3456, -0.5562, +0.0233,
+0.0654, -0.2250, -0.1257, +0.0755, +0.1061, +0.0183, -0.6314,
-0.0276, -0.5709, +0.1427, -0.9943, -0.2089, -0.1618, +0.1928,
+0.0366, -0.4056, +0.1872, +0.3670, +0.5268, -0.2949, +0.4297,
-0.6547, +0.0743, -0.7467, +0.4479, -0.7236, +0.4257, +0.0888,
-1.5198, +0.0594, -0.8880, -0.6984, -0.3094, -0.5483, -0.9416,
-0.1274, -0.4495, +0.5366, -0.4214, +0.2500, +0.3083, -0.6264,
+0.4781, -0.3504, -0.2692, -0.4077, +0.0213, -0.9375, +0.1823,
-0.7678, -0.6795
],
[
+0.4683, +0.4362, +0.3526, -0.0894, -0.2294, -1.1023, -0.3028,
+0.1758, -0.1920, +0.3107, -0.0442, +0.1234, -0.4052, -0.7556,
-1.4301, -0.0456, +0.2569, -1.0682, -0.1381, -0.1230, +0.1955,
-0.3330, +0.1838, -0.3458, -0.5642, +0.1428, +0.2405, +0.6010,
-0.1470, -0.3523, -0.0542, +0.1510, -0.3189, -0.5421, +0.3879,
-0.2164, -0.2662, +0.1630, -0.0339, -0.3344, -1.4772, +0.1192,
-0.6321, -0.0340, -0.0587, +0.3702, -0.8599, -2.0794, +0.4569,
-0.1700, +0.1769, +0.3511, -0.0855, +0.2822, +0.2336, +0.1616,
+0.5258, -0.1024, +0.4351, +0.1208, -0.2025, -0.6205, -0.4838,
-0.1901, -0.7711, -1.0001, +0.3786, +0.3819, -0.2563, +0.1972,
+0.4146, +0.0413, +0.6957, -0.4456, +0.3663, +0.7249, -0.5925,
-1.0268, +0.4177, -0.0087, +0.4056, -0.0701, +0.0594, +0.1083,
+0.2143, -0.4115, -0.0350, -0.0193, +0.3083, -0.7987, +0.1743,
-0.3390, +0.9210, -0.1339, -0.5012, -0.5543, +0.4410, +0.0627,
+0.3689, +0.2465, +0.1989, -0.0166, +0.3254, +0.3029, -0.3015,
+0.0947, -0.2871, +0.0143, -0.0860, +0.5374, -0.5375, -0.0836,
+0.5282, +0.0927, +0.3490, -0.4070, -0.4771, -0.1295, -0.4146,
+0.2507, -0.7222, -0.3260, +0.1335, +0.0136, -0.1393, +0.1429,
-0.2269, -0.2930
],
[
-0.0437, -0.2157, +0.4923, -0.6321, +0.0022, -0.0296, -0.9576,
-0.5569, +0.3181, +0.2091, +0.3334, +0.1503, +0.1709, -1.6208,
-0.4494, -0.8162, -0.7325, -0.9672, -0.3088, +0.3997, -0.1793,
-0.5785, -0.1168, -0.4739, -0.0540, +0.4712, -0.0863, +0.1757,
+0.0740, -0.1534, +0.0955, +0.0096, -0.1520, -0.3343, +0.3403,
-0.2325, -0.3957, -0.2039, -0.1898, +0.4041, +0.0474, +0.5879,
-0.1018, -0.3031, -0.1018, -0.1546, +0.3044, +0.0565, -0.3444,
-0.0236, +0.1412, +0.2696, -0.1557, -0.8822, -0.1266, +0.2104,
-1.0103, +0.1355, +0.6538, +0.3990, -0.8994, -0.2313, +0.4144,
-0.2434, -0.2434, -0.5452, -0.3693, -1.0065, -0.2526, +0.1606,
+0.1587, -0.0940, -0.7770, +0.2070, +0.5299, +0.1534, +0.0182,
-0.5653, -0.2528, -0.2816, +0.3887, +0.3633, -0.0236, +0.0537,
-0.3035, +0.0553, -0.3131, +0.2767, -0.6836, +0.2380, -0.3762,
+0.1924, +0.2998, -0.1018, -0.5629, +0.1175, -0.0172, -0.2261,
-0.1764, +0.2219, +0.0248, +0.0758, +0.4091, +0.5297, -0.1721,
+0.2416, -0.0586, -0.0440, +0.1363, -0.9104, -0.1781, +0.1013,
-0.6489, -0.0025, +0.4615, -0.0297, +0.0765, +0.2838, -0.4600,
-0.1713, -1.6520, -0.4385, +0.0017, -0.9159, +0.2006, -0.2593,
-0.2150, +0.1949
],
[
+0.0339, -0.0568, -0.5621, -0.0932, +0.0583, -0.9944, +0.0075,
+0.3368, -0.6028, +0.2755, +0.1404, +0.3316, +0.3873, +0.0802,
-1.0236, -0.0446, +0.4943, -0.2195, +0.2907, +0.2503, -0.7739,
-0.3247, +0.2905, +0.3955, +0.1023, +0.5193, +0.0899, -0.2487,
-0.4851, +0.0584, +0.0920, -0.6081, +0.1348, -0.1767, +0.0742,
-0.5411, -0.3979, -0.1991, +0.5524, +0.0053, +0.4063, +0.1606,
+0.2620, -0.1135, -0.5295, +0.2818, -0.3286, -0.4359, -0.3249,
-0.2776, +0.5612, +0.0728, -0.5318, +0.2386, -0.8625, +0.0792,
+0.3288, +0.3633, +0.3718, -0.2269, +0.7100, -0.3257, +0.3669,
-0.3163, +0.0914, +0.1124, -0.7857, +0.0114, +0.0858, +0.0580,
+0.0056, -0.7910, -0.3239, -0.0388, +0.2442, -0.1195, +0.3433,
-0.1431, -0.1119, +0.0972, +0.1949, -0.3508, +0.0935, -0.5958,
+0.7940, -0.7228, +0.6034, -0.4416, -0.0069, -0.0365, -0.0326,
-0.0376, +0.3765, +0.4202, -0.1681, -0.6389, +0.0301, +0.3833,
-0.0720, -0.6577, +0.3238, +0.5271, +0.6202, -0.1260, -0.6644,
-0.1715, +0.4823, +0.1443, -0.0962, +0.1568, -0.3111, +0.2790,
-0.7418, +0.2376, +0.2314, +0.8497, +0.0939, -0.1574, -0.3043,
-0.7649, +0.0571, +0.3874, -0.3846, -0.0944, +0.5540, -0.4897,
+0.0387, +0.5230
],
[
+0.4302, -0.2172, -0.6644, +0.5350, -0.6361, -0.1944, -0.8780,
-0.2447, +0.2381, -0.5389, -0.2404, +0.2404, -0.4202, -0.1248,
-0.3898, +0.3124, +0.1769, +0.3764, +0.3986, -0.5957, +0.3145,
+0.2409, -0.3809, +0.1314, -0.0018, -0.6858, +0.3517, +0.0978,
-1.3349, +0.0992, +0.1196, -0.2485, +0.2190, -0.5817, +0.1557,
-0.1075, -0.2156, +0.3588, -0.8234, +0.5031, +0.0244, +0.0619,
-0.3212, -1.0465, -0.0554, -0.0448, -0.6694, +0.1508, -0.9232,
-0.1322, -0.1564, -0.3022, -0.1517, -0.1223, -0.2044, +0.2124,
-1.0978, -0.1057, +0.0144, +0.1217, -0.3823, -0.0009, +0.1590,
+0.0353, -0.1922, +0.2753, -0.3672, -0.3458, -0.0228, -0.4366,
-0.5541, +0.1015, -0.4054, -0.0574, -0.7021, -0.3660, +0.4662,
+0.1551, +0.0294, -0.2665, -0.1404, -0.5847, -0.6307, -0.3790,
-0.2180, +0.1872, -0.6189, +0.1271, +0.0037, -0.3821, -0.5943,
-0.0343, -0.2771, +0.0432, -0.7665, +0.3099, -0.2629, -0.0641,
+0.0618, +0.6157, +0.2150, -0.1869, -0.8548, +0.0362, -0.3927,
+0.4267, +0.0765, -0.3128, +0.1172, -0.0424, +0.3030, -0.4808,
-0.0301, +0.5784, +0.2766, +0.1312, +0.1552, -0.5810, +0.1366,
+0.3775, -1.1347, -1.1573, +0.1438, +0.0798, +0.0821, +0.0965,
+0.2632, -0.1688
],
[
+0.0486, +0.4445, +0.8387, +0.2568, -1.1572, +0.4689, +0.1263,
+0.2519, -0.6219, -0.0639, -0.0465, -0.3888, +0.1773, -0.0798,
-0.3921, +0.1864, -0.2427, -0.6167, -0.2716, +0.3918, +0.1758,
-0.1026, -0.3277, -0.0350, -0.4220, +0.2290, -0.3666, +0.0481,
+0.1537, -0.1635, +0.2875, -0.1457, +0.3795, -0.1145, -0.3384,
+0.2957, -0.1083, +0.3636, +0.4398, -0.4989, +0.3521, +0.6306,
+0.3257, +0.8925, +0.0012, -0.3577, -0.4091, -0.2389, +0.3009,
+0.2426, -0.1863, -0.4598, -0.5801, +0.4239, +0.7071, -0.6306,
-0.0318, +0.7025, -0.6715, +0.1279, -0.1172, -0.4279, -0.3312,
+0.3969, +0.3163, +0.0021, +0.2250, -1.1076, +0.3326, -0.0329,
-0.7956, -0.2683, +0.3947, +0.1141, +0.3432, -0.3208, +0.4752,
-0.3115, -0.2513, +0.4078, +0.3549, -0.3452, +0.4530, +0.5450,
+0.3026, -0.2971, -0.3374, -0.7781, +0.1321, -0.4501, -1.0434,
-0.2007, +0.1588, +0.3823, -0.2005, -1.5922, -0.4523, -0.5334,
-0.4728, -0.7466, -0.1689, +0.3333, +0.9141, -0.2566, +0.1104,
-0.1154, +0.0838, -0.1758, +0.1811, +0.6251, +0.3063, +0.1442,
-0.3461, -0.0870, -0.3754, -0.2758, -0.5202, +0.3635, -0.8359,
-0.1352, -0.4679, +0.5761, -0.9381, +0.1186, -0.6600, -0.4856,
-0.1229, -1.3795
],
[
-0.4596, -0.4665, -0.7232, +0.4427, -0.5278, +0.2214, +0.1276,
-0.7940, -0.8310, +0.2893, +0.1474, -0.0802, +0.4358, -0.3326,
+0.4273, -0.2247, -0.0812, +0.1327, -0.4622, +0.5568, -0.1326,
-0.2577, -0.6547, -0.0465, +0.3134, +0.1999, -0.1509, -0.0916,
-0.7934, -0.5564, +0.2215, +0.1797, +0.4205, +0.0757, +0.0866,
+0.0747, -0.6790, +0.1504, -0.0331, -0.6397, +0.4036, -0.1117,
+0.7006, -0.8588, -0.1314, -0.2884, -0.6283, -1.0481, -0.9171,
-0.2741, +0.7294, +0.1341, -0.5690, -0.2267, -0.1509, -0.1553,
+0.4570, -0.0115, +0.1082, -0.0045, -0.0435, -0.0790, +0.1057,
+0.1385, +0.5353, -0.1467, +0.3976, -0.1944, +0.1313, +0.0635,
-0.0690, -0.0125, +0.3091, +0.1871, +0.2987, -0.1033, +0.0188,
+0.2802, +0.0149, -0.5585, +0.3224, +0.2919, +0.3109, -0.0414,
+0.1248, -0.4365, +0.3245, -0.0306, -0.0583, -0.2472, +0.0395,
-0.6055, +0.0278, +0.1616, +0.5013, -0.2901, -0.0443, -0.0004,
-0.4235, -0.6453, -0.2101, -0.2178, -0.1750, -0.2190, +0.0142,
+0.1256, -0.3123, +0.4291, -0.3367, +0.1954, +0.3119, +0.1210,
-0.5771, +0.0519, +0.1849, -0.1615, -0.0733, +0.3759, -0.1807,
-0.3813, -0.5297, -0.1774, -0.0199, +0.2418, +0.3511, -0.0563,
-0.1167, -0.4282
],
[
+0.0952, +0.2561, -0.2844, -0.2665, -0.0839, +0.7566, -0.1682,
+0.2183, -0.2247, -0.4824, -0.0646, -0.3158, -1.2641, -0.3514,
-1.0803, +0.5559, +0.4353, -0.4389, +0.2619, -0.3615, +0.2897,
-0.7813, -0.3570, -0.0004, +0.3873, +0.3192, +0.0727, -1.0953,
+0.0653, +0.1268, -0.0092, -0.1782, +0.0052, +0.2457, -0.8414,
+0.1563, +0.0886, +0.0362, +0.3103, -0.1490, -0.2650, -0.5943,
-0.2877, -0.0656, -0.5241, +0.2399, -0.7845, -0.2950, -0.3548,
-0.5025, +0.5442, -0.1611, -0.1232, -0.0572, +0.2483, -0.0855,
-0.3825, +0.0387, -0.2524, +0.2587, +0.6535, -0.0393, +0.0975,
-0.3105, +0.2879, +0.3140, -0.1188, -0.0446, +0.2561, -0.1164,
+0.3638, +0.0178, -0.3148, +0.3328, +0.5837, +0.0712, +0.1361,
+0.2261, -0.4964, +1.0193, -1.0342, +0.3773, +0.1262, -0.1145,
-0.4670, -1.0224, +0.0325, -0.4796, -0.1071, -0.0128, +0.2066,
+0.2780, -0.5035, -0.3934, -0.0626, +0.2125, +0.5664, +0.3072,
+0.4962, -0.7859, +0.4584, -0.1682, -0.4819, +0.0270, -0.0845,
-1.3404, +0.7211, +0.0027, +0.2755, -0.1331, -0.2127, -0.3678,
+0.0117, +0.2418, -0.2516, -0.2810, -0.4912, +0.0286, +0.1692,
+0.0112, -0.5188, -0.2282, -0.8814, -0.5661, +0.2812, +0.5454,
-0.4854, +0.3009
],
[
+0.1870, +0.3014, -0.5271, -0.1075, +0.0156, -0.3080, +0.1362,
-0.9902, -0.3459, -0.6937, -0.4316, +0.0986, +0.2262, +0.0075,
+0.6713, +0.5430, +0.0630, -0.3519, -0.1376, +0.0561, -0.0776,
+0.2371, +0.1225, -0.0702, -0.4031, -0.0734, +0.0244, -0.5890,
-0.6585, +0.0734, -0.1912, -0.2719, +0.4767, +0.2162, +0.0277,
+0.0434, +0.4320, -0.1501, +0.0798, +0.0340, +0.1550, +0.3855,
+0.0754, -0.0348, -0.1188, +0.1943, -0.0932, +0.4244, +0.2955,
+0.4376, -0.0588, -0.3101, +0.6338, -0.8185, -1.4382, +0.0284,
+0.1375, -0.2207, +0.3143, -0.3735, +0.4699, -0.2343, +0.3439,
+0.2575, +0.0560, -0.5537, +0.1837, -0.3537, +0.4204, -0.2469,
+0.4694, -0.4818, -0.0800, +0.1547, +0.1375, -0.3788, +0.1500,
+0.7913, -0.1740, +0.5279, +0.4443, -0.3273, +0.1345, -0.1566,
+0.1651, -1.1800, +0.4721, -1.2701, +0.1045, +0.0280, -0.9942,
-0.4377, -0.8253, +0.4465, -1.0180, -0.8197, -0.1882, -0.5531,
+0.1068, +0.5739, -1.6526, -0.4122, -0.4316, -0.6513, -0.7149,
+0.2063, -0.8572, -1.2181, -0.0730, +0.1810, +0.0309, +0.1499,
-0.7045, -0.2607, -0.7460, -0.3004, -0.4975, +0.1208, -0.0947,
-0.0603, +0.2271, -1.2883, -0.1305, +0.1314, +0.0737, +0.0324,
-0.1463, -0.3041
],
[
+0.0458, -0.0894, -0.2151, -0.6742, -0.2983, -0.6282, +0.1355,
-0.1223, +0.6234, +0.5262, -0.6218, +0.3284, +0.0273, +0.0397,
-0.7536, -0.2314, -0.1161, +0.4722, -0.5954, +0.0380, -0.0210,
+0.0786, -0.3814, -0.7529, +0.2928, -0.0075, -0.6387, -0.7448,
-0.8791, +0.2035, +0.2726, -0.3057, -0.3138, -1.4312, +0.3530,
-0.1899, -0.9923, -0.5255, +0.4026, -0.6432, -0.0311, +1.1196,
+0.5319, +0.0608, -0.4065, -0.3264, -0.0691, -0.4776, -0.0131,
-0.1747, -0.0769, -0.3585, -0.1498, +0.0016, -0.5073, +0.7675,
-0.6077, -0.5249, -0.3288, -0.7887, +0.0849, +0.2405, -0.2989,
-0.0863, +0.4390, +0.0930, -0.2713, +0.0888, -0.3606, -0.7837,
-0.7676, -0.2362, -0.4155, -0.2206, +0.7188, -0.5565, -0.2318,
-0.9128, -0.5840, -0.2630, -0.9346, +0.1868, -0.2590, -0.9223,
+0.2309, -0.0921, -0.0357, -0.3798, -0.0737, -0.7020, +0.0108,
+0.4331, -0.5297, -0.1514, +0.1932, +0.1644, -0.3387, +0.1624,
-0.0290, +0.3106, -0.1923, -0.5176, -0.1456, -0.9456, -0.0735,
-0.1717, -0.5372, -0.3042, -0.5604, -0.0275, -0.1044, -0.2694,
+0.1343, +0.2035, +0.0755, +0.2408, -0.3585, +0.3206, +0.0377,
-0.6399, -0.6233, -0.7337, -0.8767, +0.1049, -0.8633, -0.2215,
+0.1198, +0.0252
],
[
-0.3981, -0.9485, +0.1615, -0.1278, +0.3925, -0.1676, +0.1565,
-0.2447, -0.4455, +0.0189, -0.2803, +0.0478, -0.0118, -0.0795,
-1.2917, -1.3892, -0.7834, -0.2114, -0.5573, +0.2180, -0.0635,
+0.4844, +0.1714, -0.1521, +0.1799, +0.1737, +0.0494, +0.6905,
+0.0204, -0.1172, +0.0560, -0.1334, -0.5119, +0.0524, -0.3917,
-0.1034, +0.3487, -0.1477, +0.3384, +0.3475, -0.1820, -0.3406,
+0.1093, -0.1681, +0.6878, -0.2988, +0.6641, -1.0641, -0.1253,
-0.3916, -0.2225, +0.1199, -0.0494, -0.0510, -0.7834, +0.1818,
-0.3580, +0.1913, +0.2561, +0.1417, +0.1223, -0.8103, -1.1695,
+0.2879, +0.2757, +0.2811, +0.3511, -0.1775, -0.7569, +0.2796,
+0.0768, +0.1223, -0.1397, -0.1127, +0.2790, +0.2812, +0.0628,
-0.6584, +0.2361, -0.0339, +0.2359, +0.0154, +0.3348, +0.2586,
+0.3898, -0.1157, +0.1350, -1.0472, -0.3809, +0.0340, +0.1931,
-0.3670, +0.0556, -0.0287, +0.0381, -0.2873, +0.1255, +0.2827,
-0.4592, -0.1651, +0.0170, +0.0656, +0.4979, +0.0304, -0.5095,
-0.3564, -0.1532, -0.2341, +0.1253, +0.0679, +0.3635, -0.5372,
+0.5080, -1.3852, +0.2097, +0.1693, -0.4685, +0.0981, -0.3357,
-0.8061, +0.3398, +0.0947, -0.5268, -0.1303, +0.2309, +0.0951,
+0.3498, +0.2407
],
[
+0.2665, -0.0532, -0.0694, +0.0253, -0.3748, +0.0328, -0.4113,
+0.0673, -0.2931, -0.0414, +0.1795, -0.0323, -0.3450, -0.1150,
+0.2287, -0.2842, -0.7729, -0.3042, -0.2463, -0.0702, -0.2516,
-0.0768, -0.1726, +0.5449, +0.0152, -0.0060, -0.2021, +0.0711,
-0.2867, +0.0975, -0.3351, -0.0997, +0.0162, +0.1531, +0.3364,
-0.0450, -0.0111, +0.1189, -0.1334, -0.6545, -0.4830, +0.0474,
+0.3154, +0.4580, -0.1064, +0.2929, +0.4214, -0.2082, -0.6345,
+0.0035, +0.6610, -0.1338, +0.1163, +0.4461, -0.2158, -0.8791,
-0.3630, +0.0719, +0.1888, +0.5635, +0.0478, -0.1271, -0.0503,
-0.5142, -0.3326, -0.3739, -0.4792, -2.6695, +0.0054, -0.5449,
+0.4130, +0.1073, +0.1240, +0.6417, +0.0663, +0.3216, -0.7660,
-0.0552, -0.3331, +0.2927, +0.3266, +0.0314, -0.1650, +0.4794,
-0.0994, +0.6366, -0.1988, -0.2426, -0.4117, +0.0769, +0.0283,
-0.6750, -0.8874, -0.3598, -0.7254, +0.0542, -0.0244, -0.2915,
+0.2490, -0.5648, -0.1576, -0.8881, +0.1953, +0.4120, -0.7454,
+0.0790, +0.7552, -0.2105, +0.2571, -0.0879, +0.0528, -0.7195,
-0.2049, +0.2198, -0.8199, -0.2095, -0.1536, -0.2254, -0.3881,
-0.0710, -0.0862, -0.0728, -0.4765, +0.0377, -0.2601, +0.5323,
-0.4757, +0.0056
],
[
-0.5613, -0.0316, +0.5095, -0.3853, -0.1999, -0.2166, +0.2410,
-0.1814, -1.0522, +0.0969, +0.9236, +0.2533, +0.0451, -0.0508,
+0.0811, +0.3947, -0.3305, -0.2005, +0.0055, +0.4741, -0.6295,
-1.6430, +0.3491, +0.0489, +0.2295, +0.0272, -1.0309, +0.3897,
+0.0007, +0.2152, -0.6022, -0.1800, -0.9179, +0.0791, +0.0380,
-0.1480, +0.1407, -0.1113, +0.1436, -0.0275, -0.0495, -0.1882,
-0.0968, -0.5008, -0.5220, -0.0886, +0.3981, -0.1246, +0.0909,
+0.1886, +0.3237, -0.5167, +0.2581, +0.3119, -0.0412, +0.0391,
-0.2006, +0.1589, -0.0481, +0.0569, -0.3648, +0.6140, +0.0046,
+0.4178, -0.4773, +0.1720, +0.1110, -0.4165, -0.3226, -0.2994,
-0.1289, +0.0845, +0.3111, +0.2951, +0.4875, -0.6199, +0.1223,
+0.4922, -0.3103, -0.1180, +0.1047, +0.6244, -0.4275, -0.2973,
+0.1429, -0.6453, +0.1289, -0.7252, +0.1454, +0.6175, +0.3022,
+0.2301, -0.5072, -0.1339, +0.2775, -0.1535, -0.2081, +0.2216,
+0.1102, -0.1702, -0.1977, +0.2827, -0.0540, -0.0717, -1.2428,
-0.4476, -0.7154, -0.5406, -0.3560, -0.2525, -0.3185, -0.1646,
+0.0909, +0.6647, -0.1795, -0.1505, -0.1118, -0.3078, -0.0913,
-1.1243, +0.2496, +0.1140, -2.2075, -0.4422, +0.6752, +0.3675,
-0.5279, -0.3644
],
[
+0.4551, -0.0319, -0.1932, +0.2266, -0.1468, -0.3072, -0.1329,
+0.1246, -0.2067, -0.2614, +0.3834, -0.4731, -0.0135, +0.0497,
-0.6278, -0.1505, +0.3569, +0.1982, +0.5036, -0.6404, +0.4569,
-0.3846, -0.0121, +0.3326, -0.2668, +0.2187, +0.0431, +0.0004,
-0.1539, +0.2131, +0.1308, -0.0228, -0.7287, -0.5572, +0.6008,
+0.1236, +0.2499, +0.1608, +0.4676, -0.5957, -0.1967, -0.4873,
+0.2819, -0.0164, -0.1783, -0.0527, -0.1868, -0.1273, -0.2112,
+0.0099, -0.0311, +0.4071, +0.4450, -0.5066, +0.1030, +0.2545,
+0.6692, +0.3454, -0.5475, -0.7075, +0.2926, -0.0085, -0.2729,
-1.2123, -0.4895, +0.7207, -0.4900, -0.1653, +0.2227, +0.2817,
+0.0906, -0.3284, -0.5089, +0.2956, +0.5533, -0.1981, +0.0924,
-0.2792, +0.3144, +0.2213, -0.6193, +0.2680, +0.1391, +0.3618,
+0.0205, -0.1751, +0.5281, -0.4151, +0.0489, -0.0676, -0.1298,
-0.1577, +0.2879, -0.0986, -0.5174, -0.1008, +0.2711, +0.1748,
+0.2306, -0.9342, +0.1570, +0.3747, +0.2685, +0.0691, +0.1287,
-0.0570, +0.2586, +0.4351, -0.1724, +0.0868, +0.2339, +0.0590,
+0.3207, -1.0457, +0.1448, -0.4016, -0.3144, -0.3675, -0.1135,
+0.5790, -0.9001, +0.0850, -0.6078, -0.1776, -0.4906, +0.5657,
+0.3524, +0.4872
],
[
-0.7267, -0.3766, -0.7996, -0.8690, -0.1338, -0.5856, -0.9790,
-0.6182, -0.4302, -0.5680, +0.2210, +0.6662, -0.0394, +0.0189,
+0.0192, -0.0539, +0.5934, +0.7768, -0.1917, +0.5445, -0.4624,
+0.0003, -0.5339, -0.3818, -0.7532, +0.6063, -0.0766, -0.1849,
+0.1387, -0.1513, -0.2904, -0.4841, -0.8696, -0.6494, +0.3400,
-0.4493, +0.7742, -0.5473, +0.3086, -0.7270, -0.3335, +0.0908,
+0.0757, -0.4248, -1.3225, -1.2498, -0.5104, -0.1792, -0.0900,
-0.1979, -1.1543, -0.6224, +0.3853, -0.4153, -0.1675, +0.3672,
+0.0385, -0.2739, +0.3483, +0.1304, -0.2027, -1.0781, +0.0487,
+0.9165, +0.3448, +0.1050, +0.6307, -0.0179, -0.2644, -0.6719,
+0.8630, +0.2447, -0.7928, -0.7747, -0.4640, +0.3419, -0.3761,
+0.4682, -0.3551, -0.7790, -0.1836, -1.2261, +0.0014, -0.0157,
+0.7793, +0.0543, -0.0427, -1.2934, +0.4384, +0.6282, -0.4136,
-0.7120, -0.0312, -0.1617, +0.3792, +0.3923, +0.4131, -0.0939,
+0.0765, -0.0514, -0.6875, -0.6300, +0.0322, -0.1902, +0.0416,
-0.0501, -0.3586, -0.0728, +0.1699, +0.6857, -0.2486, +0.4669,
-0.8803, -0.7892, -0.0981, +0.1722, -0.9295, +0.4021, -0.8335,
-0.7050, +0.0081, -0.6816, +0.3777, +0.2073, -0.2389, -0.5322,
+0.1118, -0.0305
],
[
+0.1518, +0.5124, +0.2856, +0.3206, -1.0614, -0.7988, +0.6489,
-0.3330, +0.0626, -0.7497, -0.3054, -0.3453, +0.3817, -0.3338,
-0.5490, -0.6551, -0.2633, +0.8902, +1.0987, -0.1853, -0.5848,
+0.1062, +0.4732, -0.8558, +0.2518, -0.6830, +0.0990, +0.0484,
+0.6778, -0.6857, -0.2717, -0.0487, +0.2458, +0.0854, -0.5820,
-0.2739, +0.2974, -0.0806, +0.0331, -0.1789, +0.3143, -0.2483,
+0.3278, -0.8205, +0.2240, +0.2381, +0.4927, +0.5869, -0.0209,
+0.2602, +0.0947, -0.5313, +0.1366, +0.7339, +0.1222, -0.1071,
+0.3209, -0.6647, +0.3956, -1.1462, +0.1540, -0.6027, -0.6462,
-0.0196, -0.0257, +0.2174, +0.0618, -0.4277, -0.2348, -0.1575,
+0.0113, -0.1159, -0.2370, -0.7871, +0.6167, -0.5572, +0.3090,
-0.8006, -0.1515, -0.3669, +0.7213, -0.8533, -0.3268, +0.3503,
-0.3551, +0.2349, +0.5376, +0.2798, -0.2976, +0.0167, -1.5816,
+0.0884, -0.3257, -0.0122, +0.0005, +0.5181, +0.4005, +0.2125,
+0.0817, -0.1632, -1.3130, -1.2145, +0.1358, +0.5636, -0.3694,
-0.3336, -0.6762, +0.3142, +0.6745, -1.0468, +0.3761, -0.0945,
-0.0999, +0.1924, -0.0761, +0.4415, -1.3590, +0.4247, -0.8823,
-1.2536, -0.6982, -0.6742, -1.6875, +0.2924, -0.2236, -0.2251,
-0.0849, +0.1060
],
[
-0.2809, -0.5262, -0.2225, -0.2377, +0.4993, -0.6156, -0.4075,
-0.0431, -0.0557, +0.1105, -0.6226, +0.2642, +0.0313, -0.1356,
+0.2995, -0.1605, -0.2844, +0.0588, -0.7481, +0.3667, +0.3974,
-0.5936, -0.8852, +0.3301, +0.0846, -0.2080, +0.6778, -0.4275,
+0.5747, +0.1188, -0.1728, -0.6314, +0.1443, -0.5844, +0.4162,
-0.5322, -0.4064, -0.8819, +0.0508, +0.2179, +0.1001, +0.7090,
+0.4653, -0.9416, +0.0668, -0.2436, -0.2129, +0.3427, -0.5489,
-0.9096, -0.0917, +0.0727, -0.3989, +0.5349, +0.1648, -1.0449,
-0.4291, -0.1728, -0.2757, -0.1645, -0.0187, -0.4139, +0.4843,
-0.2568, -0.0983, -0.2277, +0.0900, -1.8861, -0.5909, +0.2268,
+0.0799, -0.2358, -0.3471, -0.0441, -0.3774, +0.0699, -1.4087,
-0.0041, -0.0716, -0.4921, -0.4239, +0.3420, -0.0662, +0.9081,
+0.1914, -0.1240, -0.3794, +0.5857, +0.0536, -0.0472, -0.3365,
-0.2709, -0.0922, +0.1280, +0.1297, +0.2072, -0.3271, -0.0874,
-1.2091, +0.2147, -0.1462, +0.0871, -0.8567, -0.2144, -0.6922,
-0.5972, -0.2472, -0.0717, -0.0147, +0.2899, +0.1847, -0.1391,
-0.5344, -0.6827, +0.4351, +0.0889, -0.9915, +0.4124, +0.0220,
-0.2009, -0.9442, +0.0113, -0.9631, -0.0650, -0.4303, +0.3435,
-1.2977, -0.2697
],
[
-0.9292, +0.2608, +0.1856, -0.2181, +0.2864, +0.4665, +0.1183,
-0.8772, +0.0637, -0.6156, +0.2125, +0.0861, +0.3298, +0.0282,
+0.1922, +0.1052, +0.2205, +0.0923, +0.0565, -0.5392, -0.2462,
+0.4160, +0.3582, -0.2283, -0.7549, +0.2029, +0.4387, +0.1588,
-0.3804, +0.3135, +0.0810, -0.5952, -0.7394, +0.1698, +0.4097,
-0.7306, -0.0494, +0.0300, +0.0150, -0.1442, +0.1094, -0.3293,
+0.3067, +0.3319, -0.0988, +0.3934, +0.1500, -0.5475, -0.1318,
-0.2197, -0.5067, -0.1792, +0.0558, +0.2852, -0.3734, +0.8150,
-0.1424, +0.0324, -0.6778, -0.8345, -1.0479, -0.0120, +0.1208,
-0.2252, -0.1481, -0.3718, +0.1413, -0.3404, -0.9226, +0.4955,
+0.3686, -0.8111, -0.1841, +0.0163, -1.0335, +0.6153, -0.2061,
+0.0014, -0.1898, +0.2517, -0.7933, -0.5624, +0.0223, -0.1111,
-0.7173, -0.5490, -0.0761, -0.2222, -0.0284, +0.1807, -0.4117,
-0.0473, -0.2069, -0.7928, -1.1569, -1.3606, +0.0030, +0.0516,
+0.0198, +0.6680, +0.2385, -0.2643, +0.5895, -0.7420, +0.4909,
+0.2861, -0.0732, +0.6386, -0.2367, -0.1159, +0.0837, -0.7266,
-0.4135, +0.0526, -0.3135, +0.1495, -0.0127, -2.0576, -0.0804,
+0.0785, -0.4744, +0.2081, -1.2179, +0.7396, -0.3955, +0.2333,
-0.0346, +0.2791
],
[
-0.2268, +0.2013, -0.5402, +0.2770, -0.0082, +0.4595, -0.1749,
-0.2543, -0.1718, +0.0961, +0.0349, +0.3766, +0.0737, +0.1959,
-0.3471, -0.1843, -0.0979, +0.1185, +0.3418, +0.1544, -0.1183,
-1.2213, -0.6225, +0.0391, -0.5351, +0.3344, -0.5902, -0.1954,
-0.0066, -0.4488, -0.0837, -0.2661, -0.6075, -0.4927, +0.0208,
+0.1308, +0.2957, -0.1448, -0.3114, -0.6437, -0.1392, +0.2135,
+0.5756, -0.4650, -0.0871, -0.0378, +0.0438, -0.7491, +0.1258,
+0.2093, +0.3463, +0.3314, -0.1335, -0.2222, -0.1071, +0.4345,
-0.2314, -0.4647, -0.6163, -0.7831, -0.2002, +0.3730, -0.2890,
+0.2425, -0.6488, +0.1770, -0.1440, -0.2539, -0.2734, +0.4355,
+0.6381, -0.3941, +0.1792, -0.2053, -0.5537, -0.1537, -0.5183,
+0.2566, -0.1217, +0.2459, +0.6899, -0.0281, +0.2930, -0.5520,
+0.2116, -0.1514, -0.2412, +0.2833, -0.1344, +0.1574, +0.0028,
-0.5203, -0.2195, -0.0272, +0.5438, -0.0241, -0.5652, +0.0420,
+0.2021, -0.0554, +0.1088, -0.4577, -0.4282, +0.0337, +0.3764,
-0.4121, -1.2664, +0.3727, -0.0548, -0.2052, +0.4138, -1.0687,
+0.1104, +0.3876, -0.0396, -0.2886, +0.2004, -0.1510, +0.0247,
-0.3260, -0.6714, +0.0787, -1.5699, +0.3883, -0.1314, +0.5150,
-0.3001, -0.2822
],
[
+0.1684, -0.1801, -0.3803, +0.3242, -1.3898, -0.0164, +0.3353,
-0.0684, -0.1274, -0.5869, -0.4406, -0.0327, -0.0911, -0.1410,
-0.0482, -0.4738, -1.2314, +0.2128, -0.0070, +0.1838, +0.0874,
+0.0349, +0.2578, +0.2648, +0.5699, -0.4537, -0.2206, +0.3551,
+0.3482, -0.3540, -0.1552, +0.1978, -0.9056, -0.3204, -0.2323,
-0.6219, -0.4323, -0.1937, -0.0836, +0.1794, -0.0247, +0.1785,
+0.1420, +0.0799, +0.2649, +0.3340, -0.0749, -0.3701, +0.3743,
+0.3156, -0.1766, -0.1078, +0.5056, +0.4657, +0.4107, +0.2601,
+0.6687, -0.0331, -0.2322, +0.2948, -0.1161, -0.0473, -0.7238,
-0.1265, -0.3066, -0.3860, +0.2964, -0.2473, -0.0809, -0.3711,
-0.7312, +0.0084, +0.3872, -0.0947, -0.6261, -0.0878, +0.1778,
-0.0130, +0.1784, -0.9601, +0.2736, +0.0141, -0.1347, -0.7251,
-0.2413, +0.3626, -0.1804, -1.2693, +0.1459, -0.6756, -0.2493,
+0.0932, +0.3681, -0.5659, -0.0836, +0.0400, +0.2949, -0.3150,
+0.2663, +0.1656, -0.6306, -0.0984, -1.2519, +0.6206, +0.0805,
+0.1215, +0.3839, -0.1390, +0.7582, +0.2061, -0.1455, -1.3268,
+0.3533, -1.6798, -0.5648, -0.4298, -0.8972, +0.3650, -0.6773,
-0.0183, +0.0872, +0.4950, -0.9771, +0.2133, +0.1443, -0.0497,
+0.4870, -0.2217
],
[
+0.6267, +0.1301, -0.3306, -1.0258, +0.2057, +0.4931, -0.2351,
-0.2018, -0.2368, -0.5251, +0.3094, -0.2823, +0.4636, -0.1351,
-0.1550, +0.1763, -0.8259, -0.6003, -0.3396, +0.1493, +0.4048,
+0.1490, +0.2579, -0.1343, -0.0206, -0.6311, +0.3482, -0.0913,
-0.8055, +0.0169, +0.7410, -0.1831, +0.2173, -0.1678, -0.0208,
+0.5627, -1.4239, -0.0164, -0.0073, -0.2144, -0.4044, +0.1796,
+0.2598, +0.2679, +0.4010, -0.2579, -0.3336, -0.0400, -1.3157,
-0.0357, -0.4101, -0.0237, -0.1238, +0.5636, -0.3515, +0.4706,
-0.2472, -0.7447, +0.1059, -0.2435, +0.4814, +0.5299, +0.4779,
-0.7503, -0.1554, -0.6424, -1.2135, -0.6341, +0.2854, +0.5496,
+0.8835, -0.1009, -0.4304, +0.2574, +0.2398, -0.1378, +0.1702,
-0.8172, +0.4276, +0.2123, -0.0892, -0.2800, +0.2954, -0.8317,
+0.2422, -0.0725, -0.0830, +0.3638, +0.0008, +0.1038, -0.3386,
-0.2826, +0.6363, +0.1712, -0.3421, -0.0179, +0.3188, -0.2417,
+0.0737, +0.4939, +0.1590, -0.4242, -0.2644, -0.2834, +0.1430,
-0.0259, -1.2540, +0.1671, +0.1528, +0.4099, +0.1172, -0.2910,
+0.2072, -1.3059, -0.9609, -0.5290, +0.0630, -0.0445, -0.9980,
-0.1157, -1.6957, +0.2090, +0.3895, -0.3709, +0.1529, +0.0459,
-0.2081, +0.5258
],
[
+0.4619, -0.5045, +0.0551, -0.9881, -0.8347, +0.2548, +0.1978,
-0.7792, -0.4077, +0.4406, +0.6625, -0.3996, +0.2176, -0.4900,
+0.2775, -0.5605, +0.0858, +0.0350, +0.0021, -1.0448, -0.4682,
+0.0814, +0.0182, -0.1981, +0.3167, -0.0874, -0.4012, -0.4910,
-0.9434, -0.7696, -0.1997, -0.2376, +0.1798, -0.6100, -0.9803,
-0.5586, -0.2755, +0.2490, -0.0105, -0.0703, -0.1876, -0.5880,
-0.6362, -0.0205, -0.3295, +0.1129, -0.5366, -0.1106, +0.4670,
+0.5399, -0.7514, +0.2281, +0.5209, -0.9634, -0.2351, +0.3960,
+0.0656, -0.2068, +0.0328, -0.3803, +0.4883, +0.7068, -0.0755,
+0.3051, -0.1799, +0.3548, +0.0245, -0.8406, +0.5388, -0.3920,
-0.0589, +0.2305, -0.0688, +0.3521, -0.1127, -0.5709, +0.7565,
+0.2302, +0.1326, +0.0851, +0.2450, -0.0791, -0.4171, +0.0232,
-0.2033, +0.0597, -0.1151, -0.0953, -1.1862, +0.1883, -1.5003,
-0.7315, -0.4973, +0.0377, -0.3782, -0.9304, -0.5009, -0.1716,
-0.3631, +1.0673, -0.1637, +0.0956, +0.1959, -0.1385, -0.3929,
+0.6728, -0.8928, -0.6624, +0.2334, -0.1005, -0.6072, +0.5098,
+0.2577, -0.8387, -0.0504, +0.0006, -0.4881, -0.2785, -0.6791,
+0.2444, -1.6745, +0.7535, +0.1534, -0.6352, -0.1115, -0.8862,
+0.4983, -0.3777
],
[
+0.0039, -0.2421, -0.6910, -0.3335, -0.0837, -0.2838, +0.2400,
-1.2017, -0.1120, -0.0139, -0.5140, -0.1658, +0.5439, +0.0746,
+0.0851, -0.1371, -0.7936, +0.1147, +0.5279, -0.0356, -0.2768,
-0.0167, +0.1016, -0.2588, -0.3150, +0.2725, -0.0054, +0.2662,
+0.0579, -0.1121, -0.0991, +0.2667, +0.7342, -0.7297, +0.4873,
-0.1084, -1.1444, +0.0317, -0.1765, -0.0591, -0.0372, +0.3193,
+0.0158, +0.3735, -0.1446, +0.2017, -0.1544, +0.4685, +0.0265,
-0.6809, -0.4011, -0.0152, +0.4425, -0.2115, -0.2186, -0.1628,
+0.1875, -0.0227, -0.3668, +0.1109, +0.2440, +0.0213, -0.2574,
-0.0887, -0.1618, +0.0969, -0.0538, -0.1107, +0.5406, +0.0602,
-0.2506, -0.5262, -0.4628, +0.0089, +0.2437, +0.1938, +0.2170,
-0.3531, -0.7044, +0.1436, +0.2583, +0.3916, -0.2783, -0.2629,
+0.0761, +0.0875, -0.9802, +0.0204, +0.1054, +0.2970, +0.7322,
-0.5680, -0.0099, -0.3184, -0.1267, -0.3843, -0.0616, -0.8026,
-0.2121, +0.2040, -0.3985, -0.0946, +0.1960, +0.1519, +0.4106,
-0.0654, +0.5344, -0.3274, -0.3358, -0.2711, +0.6550, +0.4539,
-0.7734, +0.1422, -0.2948, +0.1008, -0.0853, -0.2603, +0.7007,
-0.6726, +0.0125, +0.1267, -0.6258, +0.1602, -0.2965, -0.1978,
-0.6674, -0.4518
],
[
-0.9500, +0.5158, -1.1744, +0.0740, +0.0436, +0.0438, -0.4280,
-0.2762, +0.2074, -0.1028, +0.0739, -0.0115, -0.1277, -0.2505,
-0.4827, -0.2839, +0.1152, +0.1610, +0.3091, +0.6768, -0.2460,
-0.0686, -0.4819, -0.3605, +0.1447, +0.4809, -0.4239, -0.4925,
+0.5307, +0.0843, +0.1355, -0.0367, +0.2052, -0.3004, +0.1302,
+0.4693, +0.3006, -0.4246, +0.4669, +0.1178, +0.1144, -1.1948,
-0.1282, +0.4038, -0.4283, +0.1599, -0.4491, +0.2429, -1.0034,
+0.0174, +0.5517, +0.4962, -0.2714, -0.3836, -0.2347, -0.4319,
-0.1098, -0.6308, +0.9688, -0.2591, -0.8816, -0.7226, +0.4885,
-0.1887, +0.5752, +0.2882, +0.1037, -0.0317, +0.3730, -0.1366,
-0.4621, -0.2760, +0.0279, +0.5956, -0.9843, -0.4147, +0.0957,
+0.5332, -0.2361, -0.2058, -0.0305, -0.2593, -0.1523, -0.5416,
+0.2070, -0.0619, -0.0003, +0.1300, -0.4867, +0.6031, -0.6785,
+0.1582, -0.1877, +0.0956, +0.2111, -0.6048, +0.4825, -0.1882,
+0.0376, +0.2428, -0.1485, +0.1739, -0.3589, -0.4452, -0.3057,
-0.4095, -0.2261, -0.8174, -0.6000, +0.4134, -0.3563, +0.3176,
-0.0916, -0.0814, +0.5660, +0.0409, -0.7521, +0.6180, +0.2267,
-0.5896, -0.1423, +0.0642, -0.2697, -0.2845, +0.0757, +0.2297,
-0.2817, +0.6343
],
[
+0.3890, +0.0535, +0.3087, +0.2975, -0.7018, -0.0931, +0.4065,
+0.4104, -0.1657, +0.2489, +0.0326, +0.3264, +0.2226, -0.2367,
+0.5259, -0.3036, -0.9529, +0.4010, +0.1735, -0.0055, +0.1524,
-0.6000, +0.5753, +0.1844, -0.1587, -0.3337, -1.9309, -0.1105,
-0.4555, +0.4847, +0.0744, +0.0622, +0.2596, +0.5020, +0.2214,
+0.1037, +0.5817, +0.1068, -0.1771, +0.0581, +0.3138, -0.0515,
+0.3535, -0.8904, -0.5829, +0.2976, +0.2191, -0.0195, -0.8137,
-0.6905, +0.2786, -0.1527, -0.4237, +0.1000, +0.2552, +0.0808,
+1.0988, -0.1274, +0.2045, +0.4628, +0.1749, -0.3866, +0.6104,
-0.3980, -0.0178, -0.3929, -0.1803, -0.8545, -0.0878, -0.4427,
+0.3839, -0.5144, -0.3475, -0.0654, -0.1235, +0.2331, -1.4457,
-0.4737, -0.6052, +0.5628, -0.2034, +0.3515, -0.2301, -0.0919,
+0.3140, -0.3579, -0.6903, +0.3909, -0.9177, +0.2810, +0.0279,
-0.3726, +0.4125, +0.2434, +0.0410, +0.0660, -1.0987, -0.0353,
+0.2336, +0.1051, -0.4656, -0.4937, +0.0350, -0.2236, -0.0849,
+0.5482, -0.6291, -0.2668, -0.7553, +0.4446, -0.1521, +0.2322,
-0.0618, -0.7684, -0.0211, -0.7521, -0.4413, -0.2209, +0.1516,
-0.3465, -0.2536, -0.3436, -1.3926, -0.0055, -0.0946, -0.2139,
+0.4978, +0.1550
],
[
+0.1824, +0.0143, -0.1206, +0.3375, -0.3361, +0.3083, -0.0700,
+0.8453, +0.2253, +0.2099, -0.1996, -0.3395, +0.3576, -1.3679,
-0.0428, -0.7877, +0.3538, +0.4466, -0.0145, +0.5967, +0.1201,
+0.2372, -0.3292, -0.3154, -0.1127, +0.1202, -0.1974, +0.6890,
+0.3200, -0.0740, +0.1855, +0.0077, -0.0945, +0.2474, -0.1007,
+0.0700, -0.4022, +0.1296, +0.4136, +0.5564, -0.1594, -0.2018,
-1.2523, -1.2306, -0.1650, -0.0376, +0.0669, +0.0331, -0.0342,
-0.2498, -0.3276, +0.4391, +1.0456, +0.0483, -0.2005, +0.2550,
-0.6899, -0.0965, +0.4833, +0.3001, -0.6011, -0.0260, -0.2868,
-0.7893, -1.0207, -0.0175, -0.0952, -0.2876, -0.7890, +0.2103,
+0.4201, -0.4367, +0.4146, -0.3874, -0.2699, -0.2160, +0.1711,
-0.8880, -0.1532, -0.2323, -0.4310, -0.2285, -0.1300, -0.0841,
-0.6891, +0.2807, -0.0937, -0.3057, +0.6814, +0.2866, +0.5278,
+0.8035, -0.5203, -0.1778, -1.0515, +0.6584, +0.1471, -1.0273,
-0.2658, -0.5072, +0.0127, -0.0615, -0.2851, +0.0409, -0.3019,
+0.2049, -0.0702, -0.3491, +0.0534, +0.7843, +0.3878, -0.5921,
+0.5680, +0.2656, +0.5469, -0.1330, -0.0072, +0.1807, -0.4021,
+0.0038, +0.2884, -0.4720, +0.1204, +0.4983, -0.1370, -0.0990,
+0.7926, -0.3488
],
[
+0.2300, +0.6087, -0.0082, -1.2226, +0.1576, -0.4915, -0.3726,
-1.0621, -0.6511, +0.2293, -1.1797, +0.5666, -0.7113, +0.0993,
-0.2472, -0.4969, -0.9459, -0.0998, +0.1155, -0.3605, -0.3714,
-0.0703, -0.9070, -0.8149, +0.4075, +0.3847, +0.3870, -0.6099,
+0.3129, -0.5348, +0.2247, -1.0771, +0.5544, +0.3654, -0.5315,
-1.0543, -0.4763, -0.4465, -0.6050, -0.2096, -0.1478, +0.3596,
-0.3324, +0.3449, +0.2356, +0.0944, -0.2123, -0.2224, +0.2490,
-1.4370, -0.0835, -0.2723, +0.1200, -0.3455, +0.1009, -0.3616,
-0.3534, -1.7871, -0.3896, -0.2862, -0.2670, -0.3593, -0.5910,
+0.5745, -0.2602, +0.0340, +0.1708, -0.4089, +0.3851, -1.6957,
-0.2035, -0.6983, +0.0559, -0.5295, +0.4757, +0.2245, -1.7969,
-0.2094, +0.1555, +0.4289, -1.2022, +0.0317, -0.1430, -0.2117,
+0.4984, -0.4803, +0.7204, -0.3257, -0.6799, +0.0338, +0.3276,
+0.3263, -0.3260, -0.9453, -0.0989, +0.3106, -0.5899, +0.0706,
-0.0357, -0.1701, -0.4282, -0.4814, -0.8425, -1.0043, -0.2107,
+0.0957, -0.8044, -1.7443, +0.2266, +0.0735, +0.1612, -0.1467,
+0.0684, -0.8959, -0.7182, -1.7431, +0.0837, +0.2855, +0.2861,
-0.3948, -1.2593, -0.1133, +0.1008, +0.3739, -0.0448, -0.2614,
-1.0801, -0.0383
],
[
-0.0219, +0.4673, +0.0720, +0.1025, -0.1718, +0.4312, +0.3162,
+0.1224, -0.0772, -0.2335, +0.3989, +0.5195, +0.0886, +0.0311,
-0.9016, +0.4079, +0.3557, +0.0124, +0.2610, -0.0354, +1.1624,
+0.1489, +0.2329, +0.0525, -0.7647, +0.1217, -0.2150, -0.1314,
+0.1197, +0.2997, +0.0565, +0.6098, -0.0841, -0.0375, +0.6587,
-0.0039, -0.2714, +0.7896, -0.3866, -0.7326, +0.3856, +0.7797,
-0.0919, -0.1280, -0.2440, +0.5504, +0.2908, -0.2026, +0.1612,
+0.1853, -0.2838, +0.5732, -0.0413, -1.3385, -0.7872, -0.4109,
+0.6555, +1.0085, -0.6796, +0.1276, -0.0543, -0.6212, -0.4915,
-0.5643, +0.1743, +0.0960, +0.1293, +0.0850, +0.5357, +0.5093,
+0.4603, +0.2881, -0.1999, -0.4185, +0.1500, +0.4510, -0.4934,
-0.4103, -0.1194, -0.0130, +0.2831, -0.0871, +0.5230, +0.1946,
-0.4303, +0.7498, +0.4965, +0.0346, -0.3671, -0.7613, -0.2100,
-0.3338, -0.1799, -0.1297, -0.2704, +0.5702, -0.3001, +0.2092,
-0.4677, +0.0012, +0.4288, -0.2035, +0.1332, +1.0783, +0.0607,
+0.4426, +0.5940, +0.6015, -0.8767, +0.3162, +0.3726, -0.2623,
+0.1870, -0.0285, +0.1607, -0.0021, +0.0700, +0.2217, +0.3027,
+0.2830, -1.4722, -0.0339, +0.3761, -0.3429, -0.2930, -0.0237,
+0.1299, -0.4305
],
[
+0.1671, -0.2823, +0.1159, -0.7041, -0.5511, -0.4782, -0.4659,
-1.1058, +0.1460, -1.3718, +0.2498, +0.1930, -0.2512, -0.1289,
-0.2683, -0.5802, -0.0859, +0.0886, -0.0273, -0.0261, -0.4940,
+0.0258, -0.0169, +0.1049, +0.2472, +0.1351, +0.7329, -0.1584,
+0.1520, -0.3350, -0.6529, +0.1952, -0.9995, +0.0622, -0.4440,
+0.2660, -0.8487, +0.1427, +0.7882, +0.2495, +0.2777, +0.1706,
+0.0289, +0.6014, -0.7555, -0.3365, +0.3145, -0.5503, -1.6347,
-0.6634, +0.4050, -0.5163, -0.6031, +0.4128, -0.9969, -0.3725,
-0.1041, -0.7641, -0.1003, -0.3806, +0.2152, +0.0487, -0.0878,
-0.0076, +0.1628, -0.6543, +0.0234, -0.2593, -0.2289, +0.1173,
+0.1792, -1.0842, -0.9257, -0.4630, -0.3395, -0.6874, -0.0962,
-1.0616, -0.5033, +0.5055, -0.5397, -0.8901, +0.0775, -0.3459,
-0.3129, -0.0488, +0.3182, -0.2662, -0.7964, -0.1391, -0.2649,
+0.2875, +0.4105, -0.7456, -0.3695, +0.2845, -0.0605, -0.0508,
-0.2737, +0.1793, -0.5491, +0.4235, -0.0912, +0.3686, -0.7618,
-0.1382, -0.5352, -0.2718, +0.4649, +0.5763, +0.4316, -0.3403,
-0.0679, -0.4345, +0.2904, -0.3905, -0.9981, -0.2377, +0.2218,
-0.3052, -1.3612, -0.4851, +0.5302, +0.1600, -0.2865, -0.2246,
-0.4073, +0.3381
],
[
+0.0889, +0.0775, -0.6289, -0.1875, +0.4177, -0.2482, -1.6165,
-0.7609, -0.1220, +0.1504, +0.4350, +0.4812, +0.0481, -1.1510,
+0.2691, +0.3924, -0.5124, +0.2843, +0.0126, -0.1909, +0.2830,
+0.3845, -0.5436, +0.1834, -0.3164, +0.1342, +0.6956, +0.5842,
-0.2587, -0.6035, +0.4699, -0.4336, +0.0916, -0.7320, +0.1821,
-0.2561, +0.4985, +0.1053, -0.6610, +0.7626, -0.6151, -0.0714,
+0.4482, -1.2292, -0.1627, -0.2995, -0.7809, +0.2100, -0.5498,
-0.0004, -0.4434, -0.0608, +0.2343, -0.0094, +0.5446, +0.2986,
-1.0180, -0.0752, -0.3189, +0.1246, -0.8013, -0.5674, -0.1408,
+0.4468, +0.3148, -0.2493, +0.3091, -1.9250, -0.7569, +0.3410,
-1.9147, -0.2626, +0.1818, -0.2512, -0.2214, -0.3516, -0.0064,
-0.2877, +0.0865, +0.5975, -0.2466, +0.1317, +0.0568, -0.6254,
-0.0446, +0.3834, -0.4067, +0.3229, -0.5899, +0.4960, -0.4747,
+0.5292, -0.7871, +0.3493, -0.6473, +0.5501, -0.0895, -0.3299,
+0.4775, -0.1642, +0.0202, +0.1572, -0.3672, -0.3397, -0.8822,
+0.0939, -0.2822, +0.1689, -0.1651, +0.0127, +0.4674, +0.3544,
-0.5526, -0.0664, +0.1906, +0.7608, -0.4556, -0.4964, -0.3022,
+0.2400, -0.6743, +0.1732, +0.3559, -0.0506, +0.1518, -0.1480,
+0.2606, +0.0297
],
[
+0.1881, -0.1553, -1.5724, -0.3950, -0.0466, -0.2909, -0.0651,
-0.1796, +0.0579, +0.6609, -0.0485, +0.0586, -0.3038, -0.0271,
-0.4263, +0.4364, +0.0581, -0.1549, +0.0078, +0.0661, -0.7348,
-0.2544, +0.1467, +0.3350, -0.5166, -0.0372, -0.2058, +0.5173,
-0.1624, +0.5320, +0.3230, -0.6647, -0.3546, -0.3545, -0.3915,
-0.0860, -0.5308, +0.1087, +0.1293, -0.4919, -0.0958, -0.8816,
+0.5965, +0.3580, -1.1357, -0.1426, -0.0060, -0.3153, +0.3681,
-0.0367, +0.6846, +0.2793, +0.6284, -0.2864, -0.5706, +0.3115,
-0.0177, +0.2115, +0.3319, +0.0076, -0.0807, +0.1127, +0.0774,
+0.3027, +0.3027, +0.9219, -0.3770, +0.0644, -0.3406, +0.0139,
+0.0360, -0.1875, +0.1214, -0.0015, -0.2289, -0.1416, -0.3921,
-0.1148, -0.3307, -1.1176, -0.4131, -0.0516, +0.3109, -0.6787,
+0.3690, +0.0135, -0.1024, -0.0886, +0.0624, +0.1677, +0.8001,
-0.0035, -0.1321, -0.0525, +0.1772, +0.0420, -0.6397, -0.4285,
+0.4524, -0.5925, -0.1888, +0.3598, -0.0754, -0.3101, -0.3709,
+0.1504, -0.2078, -0.8417, -0.5245, -0.1972, -0.5917, -0.5529,
-0.2298, -0.3431, +0.3858, +0.3420, -0.3509, +0.7314, +0.6297,
-0.0504, +0.0196, +0.1993, +0.3695, -0.6020, +0.1692, -0.3026,
-0.0274, +0.0532
],
[
-0.0535, -0.0434, +0.3107, -0.0591, -0.4013, +0.0417, +0.5899,
+0.0130, +0.5355, -0.5781, +0.3742, -0.1657, -0.0823, +0.1356,
+0.2386, -0.1355, -0.4844, -0.4785, -0.1089, +0.2514, +0.1284,
+0.6192, -0.5746, -0.0572, -0.3031, -0.0263, +0.3194, -1.4349,
-0.7038, -0.0708, +0.0176, +0.1220, +0.1893, +0.3585, -0.0543,
-0.0984, +0.0147, +0.5180, -0.9553, -0.3607, -0.6300, -0.2242,
-0.3692, -0.3634, -1.2479, +0.6050, +0.4687, +0.1761, -0.1653,
+0.4686, +0.5265, -0.1602, -0.0254, +0.2749, -0.0829, -0.6103,
-0.2437, -0.3340, +1.1699, +0.2183, +0.0314, -0.3264, -0.6732,
-0.1501, -0.3775, +0.1754, -0.6461, +0.0506, +0.4287, -0.1066,
+0.8648, -0.3817, -0.1776, +0.2415, +0.4775, +0.2610, -0.3349,
-0.1050, -0.4431, +0.2219, +0.7191, -0.2294, +0.3001, +0.8845,
+0.1041, -0.2900, -0.2438, -0.3065, +0.3172, +0.4716, +0.6355,
+0.3926, +0.0178, -0.9722, +0.7055, -0.1003, -0.0791, +0.0472,
-1.5021, -0.7299, +0.0327, +0.3117, -0.7694, -0.2055, -0.3508,
-0.4653, -0.1949, -0.9672, -0.1199, -0.0421, +0.0697, -0.5390,
+0.1305, -0.8102, -0.1820, +0.3357, -0.3483, -0.7162, +0.5876,
-0.3791, -0.3721, -0.9082, -0.7910, +0.5692, +0.4901, -0.6508,
-0.1578, +0.2336
],
[
-0.0991, -1.9675, -1.1434, -0.0578, -0.4255, -0.0507, -0.3146,
-0.7487, -0.4001, +0.1678, +0.7082, -0.1235, -0.0231, -0.3190,
-0.0053, -1.8510, -0.7238, -0.5839, -0.2875, +0.2034, -0.0091,
+0.0977, -1.2770, -0.2555, -0.3162, -0.1805, +0.1029, +0.0722,
-0.1223, +0.2691, -0.4410, +0.3330, -0.1966, +0.3145, +0.2016,
-0.1409, -0.4752, -0.0351, -1.0175, -0.0973, +0.2214, +0.0240,
+0.5960, -0.3388, +0.1563, +0.3184, -0.6502, -0.9855, -0.9964,
-0.1694, +0.4374, -0.0568, +0.2252, +0.0092, -0.4467, +0.0417,
-0.5258, -0.0546, -0.6569, -0.3540, -1.2910, -0.7955, +0.1682,
-0.1409, +0.1721, -0.4994, -0.0251, -1.7718, -0.6462, -0.4405,
-0.7201, +0.3206, -0.0858, -0.0252, +0.1274, +0.2316, -0.5193,
+0.1882, +0.2965, +0.4450, -0.3046, -0.5045, +0.5530, -0.2995,
+0.4155, -0.2074, -1.0422, -0.9297, -0.6145, -0.2277, +0.4566,
+0.1720, +0.0193, -0.3610, -0.0938, -0.6841, -0.3188, -1.2707,
-0.0435, -1.0730, -0.3487, -0.0927, -0.0735, +0.0962, -0.2547,
-0.0440, -0.6346, +0.1233, +0.0456, +0.5358, +0.0747, -0.1466,
-0.4682, -0.2771, +0.1966, -0.2784, -0.4773, -0.4910, -0.2745,
+0.4193, -0.2568, -1.9416, -0.5763, -0.3306, -0.1720, -0.0927,
-0.8908, +0.1176
],
[
+0.2536, -0.5662, -1.4522, -0.5358, -0.2006, +0.0220, -0.0610,
+0.0789, -1.8121, +0.1627, -0.3495, -0.6294, +0.4751, +0.1971,
-0.4895, +0.0809, -0.6595, -0.5438, +0.7782, +0.6407, -0.0433,
+0.1764, -0.2216, -0.0686, +0.0906, -0.6181, -0.3142, -0.4193,
-0.5353, +0.2141, -0.2462, -0.4703, -0.5101, -0.5080, -0.3058,
-0.0421, -0.3943, -0.1619, +0.3189, +0.7229, -0.5070, +0.4745,
-0.5701, -0.2622, -0.0397, -0.5832, +0.8179, +0.3112, +0.4857,
+0.5036, +0.5898, -1.3488, -0.5989, +0.0316, -0.0931, -1.2044,
-1.3549, -0.4709, +0.2934, -0.5466, -0.1476, +0.3979, -0.4231,
+0.1120, -0.3600, -0.7282, +0.3255, +0.1035, -0.6146, +0.1888,
-0.0499, +0.1143, +0.3409, -0.0101, +0.1368, -0.0465, -0.5839,
-0.3748, +0.2394, +0.9458, -0.0254, -0.4362, +0.1776, -0.0580,
+0.3576, -1.2487, -0.5310, -0.1680, +0.5085, -0.0916, +0.0656,
+0.4350, -0.1020, +0.8172, +0.1495, -1.1081, -0.7834, -0.3577,
-1.9330, -0.3652, -1.1755, +0.0698, -0.3965, -0.2653, +0.1445,
-0.0767, -0.5884, -0.2787, -0.0916, -0.0178, -0.9965, +0.0826,
+0.0155, +0.2869, +0.2088, +0.5580, -1.0579, -0.1831, -0.5635,
-0.1048, -1.1000, +0.3504, +0.0230, -0.4332, -0.3865, +0.0846,
-0.3690, -0.4813
],
[
-0.4787, +0.2002, +0.2028, -0.0158, -0.2770, +0.1566, +0.1161,
-0.0419, +0.2129, -0.2984, -0.1568, -0.0816, -0.0431, -0.2907,
+0.0723, -0.1756, -0.0761, +0.0398, -0.3367, +0.2629, +0.3230,
+0.0630, +0.1386, +0.0527, +0.2323, +0.0386, +0.1846, -0.0896,
-0.1129, -0.1477, +0.0972, +0.1004, -0.1855, -0.3664, +0.3041,
+0.2854, +0.2017, +0.1173, +0.4246, +0.2498, +0.3192, -0.3189,
+0.4909, +0.2758, -0.5229, -0.1006, +0.2822, +0.1657, -0.6560,
-0.3957, +0.4602, +0.1682, -0.5488, +0.1815, +0.1368, +0.0183,
+0.2881, -0.1455, +0.2657, -0.8587, -0.1013, +0.4186, +0.3135,
-0.8613, +0.2746, +0.5370, -0.2433, -0.2217, +0.3542, +0.2261,
+0.1301, -1.1449, -0.9689, -0.7366, +0.1102, -0.0582, -0.2559,
-0.1644, +0.0449, +0.1363, -0.1750, +0.2502, -0.1844, -0.1620,
-0.2977, +0.5287, -0.4214, +0.6418, -0.2855, -0.0037, -0.4145,
-0.3059, +0.0475, -0.0043, -0.8526, -0.5528, +0.3328, +0.2346,
+0.1871, -0.5865, +0.6419, -0.1642, +0.3508, -0.0835, +0.2359,
+0.0595, -0.1623, +0.1377, -0.1352, -0.3811, +0.4506, +0.2045,
+0.0203, -0.0315, -0.0122, -0.3571, -0.1826, +0.5790, -0.3454,
-0.4992, -0.9696, -0.5495, -0.3217, +0.1935, -0.6748, +0.0319,
+0.1601, +0.0082
],
[
+0.1543, +0.2776, +0.2125, -0.1371, +0.4160, +0.3294, -1.0957,
+0.2656, +0.2960, -0.4023, +0.2340, -0.1207, -0.3459, +0.1713,
+0.6184, +0.5171, -0.2404, +0.1536, -0.2846, -0.5125, +0.3653,
-0.5599, +0.0234, -0.3938, +0.0080, +0.4929, -0.9391, -0.0329,
+0.1044, +0.0408, +0.2737, +0.9848, -0.6877, -0.5425, +0.0472,
+0.2561, +0.2861, +0.2821, -0.2904, -0.5215, -0.3803, -0.6176,
-0.9423, +0.1615, -0.1899, +0.3273, +0.0132, +0.4926, -0.3626,
-0.4278, -0.1285, +0.0150, +0.1360, -0.3941, -0.0030, -0.1985,
-1.1165, +0.1333, -0.2363, +0.3486, +0.1008, +0.2353, -0.2938,
-0.4431, -0.2364, -0.2566, +0.1370, -0.9465, +0.1358, +0.3459,
+0.2047, +0.2755, -0.3602, -0.1038, -0.4590, -0.3507, -0.9952,
+0.0772, -0.0768, -0.2582, -0.5881, -0.2763, +0.4777, +0.0767,
-1.0746, +0.4439, -0.8703, -0.5357, -0.0913, +0.2446, -0.5459,
+0.2101, +0.0278, -0.1329, +0.0798, +0.3622, +0.0351, -0.4444,
-0.2385, +0.1734, -0.1854, +0.1911, +0.0680, -0.1799, +0.0571,
-0.4096, +0.3666, +0.0189, -0.8021, +0.0096, +0.2552, -0.1276,
-0.0449, -0.0363, +0.4031, -0.5259, +0.2744, +0.1172, +0.2298,
+0.5545, +0.4626, +0.5044, -0.0241, -0.4306, -0.1280, +0.3301,
+0.1978, -0.3536
],
[
+0.1044, -0.7254, +0.2392, -0.2555, +0.5187, -0.1259, -0.0267,
-0.0483, -1.1547, -0.4744, +0.4596, -0.2068, +0.2914, -0.1488,
-0.5269, +0.5604, -0.9596, -0.6791, -0.1505, +0.4476, -0.6482,
-0.4336, +0.2112, +0.1545, -1.2010, -0.2492, -0.1578, +0.0995,
-1.7680, -0.0496, -0.2035, +0.7748, +0.3368, -0.1282, +0.8091,
+0.1360, -0.2153, +0.5392, -0.3572, -1.0836, -0.4843, -0.0050,
-0.1601, +0.2288, +0.0453, -0.3114, -0.1580, -0.3662, +0.3852,
-0.3149, +0.3257, +0.0765, +0.3093, +0.1396, +0.1867, +0.5917,
+0.3227, +0.0719, +0.0757, +0.3152, +0.0477, +0.8263, +0.4331,
-0.3088, -0.3377, -0.1028, +0.0539, +0.0915, -0.6793, -0.4235,
+0.3025, +0.3221, -0.3192, -0.0481, -0.0763, +0.2885, -1.1171,
+0.6361, +0.7532, -0.7269, +0.0376, -0.2484, -0.1291, +0.3408,
+0.3876, -0.3870, +0.7317, +0.3827, -0.2842, -0.5059, +0.4893,
+0.0877, +0.1553, +0.9659, -0.0103, -0.3438, +0.9302, +0.1913,
+0.3300, +0.1906, -0.5161, -0.5922, -0.2896, +0.2806, -0.1469,
-0.7416, -0.3286, -0.1041, +0.3214, -0.8853, -0.3089, +0.3274,
+0.2492, -0.8162, -0.3591, -0.2656, -0.4484, +0.0786, -0.7396,
-0.2242, +0.4194, -0.0522, +0.2031, +0.5960, +0.5511, -0.2235,
-0.3685, +0.1638
],
[
-0.3699, -0.3807, +0.0028, +0.3853, -0.3473, +0.3783, -0.3137,
+0.4999, -0.4700, +0.1855, +0.0250, +0.1907, +0.0717, -0.0765,
+0.2081, -1.0673, -0.0229, +0.8743, +0.1154, -0.2901, -0.0200,
+0.5757, -1.0128, -0.6901, -0.3488, -0.5791, -0.6534, -1.1944,
+0.6867, -0.5736, -0.1345, +0.4021, +0.5175, +0.4459, +0.1793,
-0.1494, +0.4040, +0.4946, +0.0618, +0.1245, +0.1907, -0.9389,
-0.0765, -0.6841, +0.0778, -0.3652, -0.0633, +0.1939, -0.1546,
+0.1572, -0.3063, -0.1174, +0.2252, -0.0803, -0.1216, -0.9586,
-0.0063, +0.5818, -0.3919, +0.4517, -0.3592, +0.0098, +0.0147,
-0.1723, +0.2093, +0.4135, +0.8197, +0.2438, +0.0600, +0.4231,
-0.1608, +0.1411, +0.3974, -0.4794, -0.2719, -0.2291, -0.1298,
-0.1203, -0.3707, +0.1493, +0.1233, -0.0575, +0.2616, +0.0770,
-0.3670, -1.1465, -0.4462, +0.1386, +0.1485, -0.2544, -0.5235,
+0.0563, +0.0058, +0.1420, -0.3137, -0.2150, -0.8871, +0.0340,
-0.1614, +0.6602, -0.2263, -0.4392, +0.0526, +0.2306, +0.5134,
-0.3948, -0.1330, -0.0663, -0.7350, +0.0353, +0.0651, -0.1853,
+0.4299, -1.3736, +0.2536, +0.1521, -0.0121, +0.6278, +0.3257,
-0.1518, -0.2645, +0.4809, +0.5553, -0.0840, -0.1191, +0.1542,
+0.1102, -0.2089
],
[
-0.0419, +0.2234, -1.4385, -0.1830, +1.3311, +0.6173, -0.2102,
+0.0031, -0.4902, +0.0924, +0.1009, +0.0748, -1.5489, -0.1538,
-0.2732, -0.0818, -0.6964, +0.2878, +0.2451, -0.4405, +0.1007,
-0.0500, +0.3956, -0.2394, -0.4406, +0.1492, +0.1290, -0.3666,
-0.3905, +0.1184, +0.4340, -0.5971, +0.0667, -0.1793, -0.5301,
+0.5881, -0.7302, -0.5281, -0.2048, +0.0339, -0.6472, -0.9960,
-0.6116, +1.3143, +0.5008, -0.5765, -0.1432, -0.1568, -0.2412,
-1.2500, -0.4832, +0.0049, +0.1551, +0.6098, -0.0762, +0.0962,
+0.1702, -0.4485, -0.9531, -0.2700, +0.2681, +0.1645, -0.9228,
-0.2238, +0.0731, +0.1705, +0.3593, +0.4110, +0.3440, -0.4387,
-1.1249, +0.5916, +0.0850, +0.1453, +0.4015, +0.2324, -0.2840,
+0.0777, -0.1384, -0.0731, +0.0235, +0.0055, +0.3287, -0.1665,
-0.3519, -0.2227, -0.4549, +0.0024, +0.1338, +0.0871, +0.3680,
+0.5274, -1.4743, -1.1676, -1.4731, -0.2902, -0.5654, -0.3894,
+0.6527, -0.3981, +0.2669, +0.1013, -0.8804, -0.9715, -1.0932,
-0.7290, +0.0872, +0.0093, +0.4981, -0.8423, -0.2592, -1.1377,
-0.1514, -0.1664, -0.6785, -1.5269, -0.0527, +0.9430, -0.0178,
-0.6142, -0.6908, -0.5368, -1.6182, +0.4248, -0.5426, -0.3651,
-0.6827, -0.7300
],
[
-0.5645, -0.0951, -0.8245, -0.2915, +0.0918, +0.1296, -0.8500,
+0.8293, +0.0947, -0.0885, -0.1730, -0.3815, -0.0692, -0.1989,
-0.0563, +0.4089, +0.4482, -0.0204, -0.0750, -0.0014, +0.2101,
+0.3434, -0.0062, -0.1062, +0.2121, -0.3191, +0.1604, -0.5890,
-0.8282, -0.0523, +0.2027, +0.1242, +0.3165, +0.3932, +0.3421,
+0.1213, -0.3542, -0.2865, -0.6644, +0.2467, -0.1323, +0.2825,
-0.2337, -0.5893, -0.0853, -0.8551, -0.4441, -0.5042, -1.1045,
+0.0843, +0.0584, -0.7077, -1.2498, -0.6926, -0.3114, -0.0837,
-0.6698, -0.2653, +0.0489, -0.3547, -0.3114, +0.2408, -0.0194,
-0.4708, +0.1986, +0.0656, +0.3541, +0.1654, +0.0352, -0.2591,
-0.8707, +0.2080, -0.2313, +0.0107, -0.1276, +0.2932, -0.0761,
+0.5935, +0.4470, -0.2565, -0.1063, -0.5294, +0.3806, +0.0910,
-0.4328, -0.2868, +0.4114, -0.8960, +0.3032, +0.5253, -1.0797,
-0.1307, -0.6211, +0.0088, +0.0559, +0.1488, +0.2288, -0.2893,
-0.4812, -0.6787, -0.8455, -0.6098, +0.0031, -0.2632, -0.0195,
-0.1413, -0.7222, -0.4115, -0.5803, +0.4494, -0.2986, -0.4152,
-0.3315, -0.2730, -0.7341, -0.7955, +0.3027, +0.2047, -0.6978,
+0.1749, -0.0703, -0.7464, -0.1227, -0.6139, +0.1868, +0.1686,
-0.4433, -0.5345
],
[
+0.5373, -0.5023, +0.3304, +0.1281, +0.3533, -0.6281, +0.2297,
-0.4778, -0.1587, -0.6127, -1.2827, -0.3540, +0.2693, +0.0097,
+0.1842, -0.2062, +0.3589, +0.0386, +0.0940, -0.6110, +0.5074,
-0.4471, +0.0641, -0.4592, -0.1442, +0.3023, -0.3187, -0.5908,
-1.2507, -0.6518, -0.1777, +0.8415, +0.0770, +0.0154, -0.0216,
+0.1021, +0.1544, -0.5672, -0.5015, -0.6091, -0.8604, -0.0805,
+0.2870, -0.4945, -0.0334, +0.1428, -1.0402, -0.4387, +0.4980,
+0.1699, -1.3964, -0.6875, -0.4314, +0.2615, -1.1531, +0.7509,
-0.3166, +0.5292, +0.2292, -0.3682, -0.2563, -0.0884, -0.0064,
+0.3462, -0.0136, -0.4905, -0.5082, -0.7308, -0.0257, +0.2141,
+0.4705, +0.0467, -0.0859, -0.5980, +0.4867, +0.1216, -1.3656,
-0.5548, -0.6892, +0.1645, -0.1880, -0.3532, +0.5091, -0.0183,
+0.4596, -0.2019, -0.1287, +0.6507, -0.1666, +0.7605, -0.1819,
-0.3911, +0.7056, +0.0560, -1.0917, +0.1926, +0.1152, -0.5854,
-1.2015, -0.2047, +0.2450, +0.4330, -0.1793, +0.0967, +0.3471,
-0.8313, -0.5207, +0.4464, +0.3575, +0.0050, +0.0109, +0.3466,
-0.6398, +0.0550, -0.3470, -0.1641, -0.5482, -1.6662, -0.3640,
+0.4271, -2.0190, -0.2807, -0.4156, +0.5930, -0.2044, +0.2586,
+0.3294, -0.0410
],
[
-0.3317, -0.0433, +0.7553, +0.0780, -0.1600, +0.3487, -0.0899,
+0.4752, -0.5306, -0.5418, -0.3998, -0.2042, +0.0573, -0.2629,
-0.3835, -0.2808, -0.7365, +0.0468, +0.1259, +0.0197, +0.1999,
-0.0067, -0.0952, -0.5982, +0.6603, -0.3708, -0.4107, -0.2107,
+0.1856, +0.0801, -0.0317, -0.1030, +0.6148, +0.0689, +0.0360,
+0.5873, +0.6373, -0.4274, +0.3931, +0.6688, -0.0991, -0.8677,
-0.1208, -0.6740, -0.0005, -0.3582, -0.0956, -0.5954, -0.9473,
+0.2657, +0.4797, -0.1288, -0.5544, +0.2299, -0.3652, -0.2259,
+0.0398, -0.3877, +0.1457, +0.1774, -0.3009, +0.2741, -0.2197,
+0.1699, +0.0348, +0.2522, +0.5760, +0.3269, -0.2433, +0.3860,
+0.5211, -0.6615, +0.2792, -0.5678, +0.5221, +0.0590, +0.1282,
+0.5853, -0.1564, +0.1237, -0.0384, +0.3060, -0.3530, +0.0635,
-0.1059, -0.8397, +0.0054, -0.5784, -0.1677, +0.6336, +0.4885,
+0.0895, +0.0792, +0.7527, +0.0445, -0.4034, +0.1270, -0.0362,
-0.2035, +0.0901, +0.2301, -0.6577, +0.1569, -0.0478, -0.7499,
+0.0353, -0.5966, -0.0205, -0.5135, +0.4103, +0.1819, +0.1055,
+0.0828, -1.3878, -0.6138, +0.0191, -0.2161, +0.2299, +0.1145,
-0.0208, +0.5890, -0.4278, -0.2275, -0.6212, +0.2328, +0.4505,
+0.1880, -0.2761
],
[
-0.2579, -0.1070, +0.5948, -0.4495, -0.1056, -0.5783, +0.7626,
-0.0990, -0.4974, -0.3786, +0.0336, +0.1340, +0.0176, +0.3846,
-0.1908, -0.0323, -0.1243, +0.3143, -0.1815, -1.2845, -0.0969,
+0.4785, -0.1254, +0.0742, -0.5627, +0.3179, -1.1277, +0.6710,
-0.3180, -0.4783, -0.7258, +0.0998, +0.0103, -0.3908, -0.6606,
+0.0864, -0.1134, -0.7322, -0.0021, -0.3648, -0.1118, -0.0069,
-0.0316, -0.5033, +0.0592, -0.4308, -0.1743, -0.3476, +0.5224,
-0.2702, -0.6365, -0.4019, +0.1359, +0.2903, +0.6723, -0.2187,
-0.6024, +0.2384, +0.0491, -0.0900, +0.1348, -0.2781, +0.0112,
+0.2478, -0.1627, -0.1756, +0.5521, -1.3692, -0.1336, +0.4796,
-0.1884, +0.1825, -0.1318, +0.6813, +0.3728, -0.4068, -0.2569,
+0.2171, +0.5401, +0.0103, -0.2397, +0.2136, +0.6071, -1.1484,
+0.1637, +0.5346, -0.3671, -0.9121, -0.2676, -1.7229, -0.4905,
-0.1932, -0.1517, -0.4315, +0.0992, -0.0417, +0.0596, +0.1999,
+0.0300, -0.1353, +0.3451, +0.3250, -0.6266, +0.6477, +0.4953,
+0.8932, +0.1584, +0.3444, -0.2406, +0.0892, -0.3448, +0.0994,
-0.2997, +0.3734, -0.0937, +0.0631, -0.3965, +0.1908, +0.3220,
+0.3505, +0.0664, -0.0990, +0.5812, +0.3055, -0.6768, +0.0508,
-1.1169, -0.2971
],
[
-0.2826, +0.3017, -1.0716, +0.5454, -0.2297, +0.2570, -0.2675,
-0.3280, +0.5000, -0.6632, -0.1680, +0.0455, -0.5645, -0.2240,
-0.0925, +0.0285, +0.5507, +0.3751, +0.4763, +0.3696, +0.0971,
+0.0564, +0.0225, +0.1475, +0.4914, -0.2191, -0.6406, -0.1431,
-0.6880, +0.2840, +0.5321, -0.1326, +0.1830, -0.2063, -0.6520,
+0.2547, -0.0021, -0.0909, +0.2077, +0.0425, +0.3344, -0.5121,
+0.5924, -0.6228, -0.2005, -0.7171, -0.1157, +0.0358, -0.4479,
+0.0911, +0.2311, -0.2368, -0.3824, -0.4127, +0.0186, +0.3056,
-0.2722, -0.4932, -0.6576, +0.6565, -0.2643, -0.2520, +0.0746,
+0.6838, +0.3458, +0.3152, -0.5829, +0.6142, +0.2486, -0.6898,
+0.0375, -0.0663, -0.0938, +0.0495, +0.5894, +0.5695, -0.0793,
+0.0908, +0.3887, -0.1746, -0.7917, +0.0934, -0.3565, -0.7500,
+0.2916, -0.2257, +0.4372, -0.0252, -0.2825, -0.5158, +0.6199,
-0.2699, -0.0864, +0.1938, -0.7209, -0.2632, -0.6214, -0.0095,
-0.7482, -0.1812, -0.0885, -0.3705, -0.4529, -0.7320, +0.1304,
-0.2019, -0.3944, -0.1590, -0.2112, -0.0378, +0.0883, -0.1832,
+0.4093, +0.0177, -0.9067, -0.0438, +0.3012, +0.1318, -0.1884,
-0.1744, +0.6493, +0.2527, +0.3349, -0.0854, +0.1585, +0.5028,
-0.0638, +0.4182
],
[
+0.2906, -0.2576, -0.2176, -0.4541, +0.1092, -0.0287, -0.3137,
-0.2885, +0.1561, +0.2431, -0.1863, +0.1705, -0.0177, +0.0854,
+0.0712, -0.4275, -0.3382, -0.6201, -0.7132, +0.3172, -0.4919,
+0.4363, +0.2332, +0.3105, +0.3940, -0.4142, +0.4294, +0.0273,
+0.7051, +0.1778, -0.3064, +0.0910, +0.1420, +0.6417, -0.0247,
-1.1611, +0.1286, +0.2238, -0.0254, +0.0795, -0.9549, +0.9174,
-0.2747, -0.2260, +0.1629, +0.3881, +0.6297, +0.3515, -1.0133,
+0.5295, +0.2742, +0.3474, +0.6074, -1.1186, +0.0476, +0.2279,
-0.3011, -0.1067, -0.1332, -0.2300, -0.2225, -0.3024, -0.2980,
-0.1358, -0.1022, -0.6499, -0.3039, +0.1199, -0.3481, -0.7577,
+0.4489, -0.4166, +0.5674, -0.9603, -0.0928, -0.1741, +0.2443,
-1.2442, -0.2971, +0.5504, -0.1294, -0.6932, +0.5146, +0.3808,
-0.0010, -0.2611, -0.2290, -0.3077, -0.3866, +0.0346, +0.0652,
-0.0467, -0.2865, -0.1689, +0.5712, -0.0300, -0.1392, +0.5242,
-0.4779, -0.0639, -0.2994, +0.1722, -0.5602, +0.5796, -0.5325,
+0.4226, +0.0793, +0.6263, +0.1931, +0.3964, -0.0242, -1.0088,
-0.1576, -0.2754, +0.3829, -0.0360, -0.1474, +0.5173, -0.3908,
+0.5383, +0.3459, -0.3353, +0.2198, -0.1983, -0.2535, -0.8102,
-0.1733, -0.2498
],
[
-0.2845, +0.2532, -0.3930, +0.0176, -0.0401, +0.3929, -0.2219,
-0.0176, -0.6583, -0.8225, -0.3858, -0.6111, -0.3160, +0.1729,
-0.5304, -0.4961, +0.4348, +0.1502, -0.0024, +0.5605, -0.5965,
-0.3403, -0.0525, +0.4160, -0.1761, -0.5333, +0.6485, -0.1001,
-0.3320, -0.2852, +0.0461, +0.3127, +0.2732, +0.4850, -0.7572,
+0.3340, +0.1216, -0.2146, +0.5141, -0.0446, +0.3435, -0.1889,
-0.0703, +0.1833, +0.6237, -0.2869, -0.1359, +0.3557, -0.6367,
-0.2098, -0.3921, +0.2821, -0.6608, -0.7367, +0.1877, -0.3778,
-0.2733, +0.2592, +0.3895, +0.5889, +0.1726, -0.8440, -0.1420,
+0.2875, -0.5746, +0.0062, +0.1275, +0.3359, +0.3913, +0.3068,
-0.4358, -0.1234, -0.0252, +0.3891, +0.2927, +0.5481, -0.1240,
-0.7086, +0.2341, +0.0585, -0.0918, +0.4686, +0.2239, +0.2763,
-0.4061, +0.5489, -0.3236, +0.2883, -0.0754, -0.4910, -0.4830,
+0.0780, +0.4842, -0.1382, +0.4660, -0.5561, +0.1641, -0.1805,
-0.2352, -0.4031, +0.3937, +0.0209, +0.1165, -0.4197, -0.1378,
-0.0776, -0.1210, -0.0451, -0.4686, -0.4069, +0.3611, -0.2608,
-0.3837, -0.6298, -0.1267, -0.3378, -0.0777, +0.1820, -0.0371,
+0.4034, +0.0692, +0.0375, -0.2704, -0.4865, -0.4545, +0.3542,
-0.1009, -0.8298
],
[
+0.0277, +0.4274, +0.0410, -0.3348, +0.2236, -0.2796, +0.3243,
-0.3701, +0.3331, +0.0335, -0.2298, -0.0108, -0.7326, +0.2532,
-0.0554, +0.1458, -1.0869, +0.5397, -0.3616, -0.4258, +0.0051,
+0.5826, +0.0720, +0.7102, -0.4815, -0.5512, -1.3826, -0.0495,
-0.0009, -0.2800, -0.2969, +0.1124, -1.1290, -0.6278, +0.2533,
-0.6351, -0.8564, +0.2894, -0.4166, +0.0631, -0.3520, -0.1019,
+0.0933, -0.5000, -0.5518, +0.0643, +0.0005, -0.3435, +0.3769,
-0.1839, +0.3340, -0.5945, +0.0447, +1.3741, -0.3691, -1.1582,
-0.8776, -0.0717, -0.0328, +0.0922, -0.5648, +0.1482, +0.5882,
-0.3070, +0.0753, -0.3949, +0.5848, -0.0525, -0.1069, -0.1223,
+0.2160, -0.6329, +0.2816, -0.0776, +0.3009, +0.8861, +0.4515,
-0.3619, +0.1494, +0.4558, -1.4952, -0.0373, +0.4441, -0.4643,
+0.3820, +0.0463, -0.4576, -1.4621, -0.7752, -0.3164, -0.2166,
+0.3246, +0.0032, -0.3442, -0.9252, +0.2383, -0.5751, -0.2526,
-0.3966, -0.0106, +0.0551, -0.2484, -0.5117, +0.0920, +0.3756,
-0.3718, -0.3283, +0.6047, +0.3816, +0.1391, +0.2320, +0.0394,
+0.0631, -0.0844, +0.1382, -0.0184, -1.0713, -1.0758, -0.9147,
-0.1541, -0.0780, -0.0554, +0.3733, +0.1043, +0.0783, +0.0085,
+0.0763, +0.0499
],
[
+0.2028, -0.0972, -0.0420, +0.3582, -0.2659, +0.0275, -0.3126,
+0.0726, -0.3374, -0.1147, -0.4659, -0.3320, +0.2382, -0.1582,
+0.2975, -0.5718, +0.1347, +0.3142, -0.2734, -0.0589, -0.4717,
-0.2501, -0.1617, +0.1413, +0.3922, -0.4995, -0.1628, +0.2263,
-0.2123, +0.2214, +0.2072, -0.3154, -0.1453, -0.1673, +0.1661,
-0.2971, -0.0208, +0.2328, +0.1944, -0.6479, +0.0608, -0.3874,
-0.1620, +0.0104, +0.2743, +0.1931, -0.6089, +0.1236, -0.2400,
+0.0071, -0.4273, -0.5542, +0.4053, -0.3175, +0.2030, +0.5557,
+0.3351, +0.4363, -0.7274, +0.3224, -0.0487, -1.1022, -0.3274,
-0.0646, +0.3601, +0.2220, -0.1501, +0.4314, -0.2996, +0.4053,
-0.4276, +0.5074, -0.1857, +0.1020, +0.1378, +0.1655, -0.8446,
-0.3429, -0.1343, -0.3011, -0.0274, +0.4764, -0.7874, -0.6551,
+0.2766, -0.2518, +0.1279, +0.2594, -0.2784, -0.3953, +0.1520,
-0.0223, +0.2754, +0.3359, +0.2621, +0.1815, -1.5922, +0.2841,
-0.0714, -0.6989, -0.1654, -0.5011, +0.1637, -0.1394, -0.2840,
-0.3650, +0.2890, +0.0167, -0.1014, -0.1577, +0.2075, -0.6913,
+0.3595, -0.9863, -0.1042, +0.0475, -0.3596, -0.4279, -0.0539,
+0.0853, +0.5694, -0.0971, +0.1162, +0.1094, +0.3452, +0.1604,
+0.1195, -0.2351
],
[
+0.1900, +0.7089, +0.3496, -0.2038, -0.3084, +0.2608, -0.6953,
+0.5173, -0.1191, -0.2883, +0.0648, +0.2797, +0.0287, -0.7875,
+0.2421, +0.3568, +0.1613, +0.0608, -1.1179, +0.3233, +0.2435,
+0.2525, +0.6172, -0.7511, +0.5085, +0.2840, +0.5009, -0.1700,
+0.2576, -0.0248, +0.2106, +0.2717, +0.0067, +0.6714, +0.4278,
-0.6350, +0.2729, -0.4513, +0.0890, -0.2815, -0.2417, +0.4750,
-0.2657, -0.2394, +0.0306, +0.6279, -0.5832, +0.2397, -0.0580,
+0.6375, +0.5022, +0.2646, +0.2561, +0.2462, -0.2213, +0.2257,
-0.2983, -0.6287, +0.3809, -0.0921, -0.2330, -0.3067, +0.0942,
-0.0820, +0.2682, -0.6325, +0.5378, +0.1533, -0.0488, -0.2197,
-0.7697, +0.1914, -0.0968, -1.1765, +0.1117, +0.3153, +0.1784,
+0.3065, +0.5665, -0.2415, -0.3054, -0.1691, +0.0961, +0.0841,
-0.2884, -0.0720, -0.1946, -0.4453, -0.4094, +0.7505, +0.9860,
+0.4382, +0.0251, +0.6391, -0.9557, +0.4968, +0.3713, -0.6909,
+0.3377, +0.5932, -0.0497, -0.7133, -0.0375, +0.6459, +0.1891,
+0.2072, -0.3249, -0.9538, +0.0223, +0.1423, -0.4737, +0.4759,
+0.3123, +0.2271, +0.3975, +0.1807, -0.0245, -0.4997, +0.0934,
+0.3119, -0.6308, -0.6775, +0.1343, -0.9224, +0.3735, +0.3916,
+0.3533, -0.2392
],
[
+0.2814, -0.0062, +0.0933, -0.7245, -0.0320, -0.1942, +0.2133,
+0.4642, +0.3284, -0.3294, +0.3022, +0.1587, -0.2439, -0.5907,
+0.2743, -0.4863, +0.0067, -0.5499, -0.3214, +0.2841, +0.0214,
-0.0561, -0.0420, +0.4335, -0.4909, +0.1226, +0.6087, +0.2644,
+0.0271, +0.3237, -0.2749, -0.2716, -0.1286, +0.7110, -0.5399,
-0.8197, -0.2695, -0.5925, -0.9547, +0.2210, -0.0892, +0.3999,
+0.4132, +0.5972, -1.0397, -0.2844, +0.3267, -0.3480, +0.1662,
+0.9957, -0.1922, -0.0408, -0.7742, -0.1346, -0.2137, +0.1514,
+0.5590, +0.1207, -0.4661, -0.4641, +0.1634, +0.2661, -0.1209,
-0.1571, -0.1591, -0.9180, -0.5031, +0.6926, +0.4839, -0.1161,
+0.2329, +0.1166, -0.0009, -0.3337, +0.2277, +0.8259, -0.9418,
+0.4854, +0.1511, +0.0460, -0.6269, +0.1148, +0.2744, -0.4243,
+0.4802, +0.0008, +0.3037, -0.4941, +0.5982, -0.0887, -0.0670,
+0.2764, +0.9553, -0.2374, +0.3233, +0.2260, -0.2309, -0.0966,
+0.0436, +0.3731, +0.1013, +0.0365, -0.1977, -0.1226, -0.3751,
-1.1944, -0.7115, +0.5875, -0.4934, +0.7552, +0.6172, +0.9160,
+0.0696, -0.1216, +0.5968, +0.5816, -0.6307, +0.2768, -0.2808,
+0.8865, -0.3658, +0.2391, +0.8127, +1.0817, +0.2553, +0.0153,
+0.5750, -0.8275
],
[
+0.0082, +0.0867, -0.7852, +0.0827, +0.1291, +0.0101, -0.4648,
+0.2129, +0.1481, +0.2185, +0.0041, +0.1023, -0.0985, -0.4019,
-0.1962, -0.4703, +0.2551, +0.0781, -0.2133, -0.2784, +0.4115,
+0.1406, -0.6719, +0.0922, +0.0814, -0.2462, +0.1721, -0.0595,
-1.2963, -0.1522, -0.2524, -0.7243, +0.0807, -0.4981, +0.2275,
+0.2468, -0.4768, -0.1847, +0.4707, +0.8096, -0.2368, -0.0147,
+0.0535, -0.6021, -0.0384, +0.2849, +0.3360, -0.1571, -0.5368,
+0.0510, +0.2195, -0.0610, +0.3591, -0.6108, +0.2859, +0.4386,
-0.3010, -0.1109, +0.4162, -0.1174, +0.4276, -0.2966, +0.1508,
+0.3311, -0.2374, -0.1032, +0.3684, +0.2232, -0.2740, +0.1488,
+0.4066, -0.3463, -1.3788, +0.0910, -0.6708, -0.5257, +0.2128,
-0.7257, -0.5533, +0.3904, -0.8414, -0.3692, -0.4447, +0.2932,
+0.3695, +0.1974, -0.0307, -0.0207, +0.2861, +0.0093, -0.3723,
+0.0885, -1.1285, +0.5602, -0.4984, +0.0470, -0.7330, -0.3404,
-0.0676, +0.0126, +0.2968, -0.6792, -0.1664, -0.0904, -0.0668,
+0.0039, +0.3229, -0.3829, -0.0114, +0.0498, +0.2746, +0.3235,
-0.7055, -0.9976, -0.1135, +0.7543, +0.0806, +0.3088, -0.2352,
+0.0764, -0.7089, -0.9394, +0.2522, -0.3699, -0.1798, -0.2856,
-0.1290, +0.1445
],
[
+0.1170, +0.1270, -0.3989, -0.3419, +0.0840, -0.9038, +0.0866,
+0.2107, -0.4077, +0.2281, +0.0722, +0.3743, -0.0479, +0.1286,
-0.7060, -0.0320, -0.5403, -0.0098, -0.4120, -0.4272, +0.2438,
-0.4637, -0.7268, -0.0662, -0.3122, -0.3862, +0.2022, -0.0472,
-0.4934, -0.0315, -0.1665, -1.2208, -2.0757, +0.0802, +0.3474,
-0.0081, -0.2626, -0.3028, -0.2964, -0.0162, +0.1108, -0.6319,
+0.3311, -0.1075, -0.5383, +0.1789, +0.0341, +0.0732, +0.0174,
-0.6334, +0.1319, +0.2015, +0.0771, -0.5511, +0.0671, -0.2133,
-0.0329, -0.1802, -0.4966, -0.0583, -0.4500, +0.3364, +0.3630,
-0.2253, -0.4866, +0.1868, -0.0692, -0.2527, -0.0107, -0.1891,
+0.2936, -0.4164, -0.5263, +0.1735, -0.1163, -0.5953, +0.1242,
+0.4013, -0.1936, -0.9705, -1.2014, +0.2352, -0.2794, -0.5115,
-0.0017, -1.5073, +0.1604, -0.3522, -0.0468, -0.6165, +0.1721,
+0.2418, -0.4455, -0.0092, -0.1756, +0.2693, -0.6080, +0.4912,
-0.1329, +0.4136, -0.2932, +0.0115, -0.0402, +0.2502, -0.0197,
-0.4421, +0.0759, -0.6872, -0.7786, -0.0250, +0.3514, +0.2312,
+0.1051, -0.9007, +0.3253, +0.1189, +0.1139, -0.2096, -0.2937,
+0.0679, -0.8154, -0.4950, +0.6838, -0.0920, +0.0793, -0.2171,
-0.0949, +0.1958
],
[
-0.2691, -0.6323, -0.1146, -0.7969, +0.3603, +0.0558, -0.3731,
-0.8005, -0.0474, +0.0781, -0.1341, -0.2605, -0.1887, +0.4685,
+0.8360, +0.4681, +0.0750, +0.0393, +0.1146, +0.0619, -0.6425,
+0.2530, +0.1581, +0.1261, +0.0122, +0.0781, +0.1272, -0.3750,
-0.6580, -0.1638, +0.1062, +0.3031, -0.3352, +0.2163, -0.1018,
-0.8000, -0.6169, -0.2181, +0.3027, -0.9585, -0.2230, -0.1886,
-0.4316, -0.4782, -0.5062, -0.9208, -0.7954, +0.1160, -0.5291,
-0.8184, -0.0061, -0.1857, -0.9126, +0.5665, -0.2163, +0.0021,
-1.0223, +0.0705, +0.2187, -0.2989, +0.6618, +0.0370, +0.2902,
-0.1797, +0.0894, +0.1833, -0.1715, -0.0093, +0.3925, -0.3233,
-1.0342, -0.4808, +0.1210, +0.3849, +0.5812, +0.2901, +0.0822,
-0.8464, +0.3258, +0.2498, -0.0856, +0.1311, -0.0029, +0.4667,
-0.0699, -0.2817, -0.7217, +0.2866, +0.0190, +0.1614, -0.5219,
-0.0784, +0.0649, +0.0512, +0.4715, -0.5501, +0.1089, -0.7258,
+0.2023, +0.2316, -0.2090, -0.0795, +0.4351, -0.3446, -0.4372,
-0.1601, -0.3571, +0.0786, +0.3685, -0.4748, +0.3770, +0.2971,
-0.0189, -0.6198, +0.0504, -0.2866, -0.2560, +0.1544, -0.6670,
-0.9603, -1.4674, -0.1516, +0.2214, -0.4532, -0.1952, +0.6401,
-0.2176, -0.8166
],
[
-0.0285, -0.3986, +0.1484, -0.2599, -0.1303, +0.0441, +0.4181,
-0.4833, -1.0472, -0.4699, -0.5243, +0.4656, -0.6172, -0.8212,
+0.1187, -0.0418, +0.0160, -0.1062, -0.0762, +0.3476, +0.3903,
+0.0679, -0.1581, -1.0278, +0.0026, -0.4655, -0.2266, +0.1243,
-1.2957, -0.9490, +0.3861, +0.3092, -0.4318, +0.8314, -0.7161,
-0.4065, +0.3536, -0.1895, +0.0566, -0.2526, -0.4563, +0.3996,
+0.2692, -0.9285, -0.0938, +0.0857, -1.2679, -1.3199, +0.1553,
-0.5119, -0.5065, +0.4989, -0.7397, +0.0820, -0.4976, +0.3495,
+0.1541, +0.3716, -0.3373, +0.4194, -0.4855, +0.3548, -0.6374,
-0.2918, -0.4379, -0.2620, +0.6569, +0.3145, +0.4310, +0.0951,
-0.1676, +0.1585, +0.7460, +0.0699, +0.0143, -0.0661, -1.1089,
+0.3126, +0.2163, -0.4875, +0.1745, +0.2242, +0.2786, +0.3927,
-0.5813, +0.3231, -0.1843, -0.0234, -0.2786, +0.0067, +0.1955,
-0.0388, +0.1289, +0.6098, +0.2552, +0.7925, -0.2620, +0.1436,
-1.0747, -0.2431, +0.3825, -0.1392, -0.5851, +0.4949, +0.0018,
+0.0258, -0.1703, -0.1578, +0.4324, +0.0654, -0.0453, +0.0184,
+0.5218, +0.4344, +0.1994, -0.2861, -0.7278, -0.1987, -0.4662,
-0.1155, -0.0638, -0.1569, -0.9375, +0.8239, -0.0273, +0.1714,
+0.6239, -0.2999
],
[
+0.3140, -1.1413, -0.1982, -0.6762, +0.6062, +0.3005, -0.4418,
-1.0130, -0.2415, +0.1512, -0.0788, -0.2140, +0.2363, -0.0995,
-0.1775, -0.2692, -0.2319, -0.1664, -0.0480, -0.2605, -0.4175,
+0.5565, +0.1244, +0.0817, -0.2587, -0.1275, +0.1042, -0.2228,
+0.0417, +0.1563, -0.0341, +0.1533, -0.2492, -0.1530, +0.0599,
+0.4991, -0.9855, -0.2737, +0.2038, -0.3164, +0.0745, -0.1019,
+0.0571, +0.5334, +0.0129, +0.0066, +0.0281, +0.4225, -0.3663,
-0.1974, -0.4947, +0.2419, -0.0759, -1.3532, +0.1309, +0.0166,
-0.2925, -0.0691, -0.2376, +0.3762, -0.8569, -1.2457, -0.0893,
+0.3526, +0.0858, +0.2560, -0.9409, -0.2089, +0.1291, -0.1224,
+0.1125, +0.3010, -0.6485, -0.1327, +0.2401, +0.0642, -0.7335,
-0.0607, -0.0949, +0.1965, -0.0402, +0.7876, -0.2581, -0.0049,
-0.5583, +0.3317, -0.5640, +0.7555, -0.4633, +0.3739, +0.1979,
+0.7038, -0.1302, -0.4236, -0.7923, -0.0621, +0.3316, +0.4299,
-0.3998, -0.4017, +0.3687, +0.2797, -0.0302, -0.0357, +0.1949,
-0.0202, +0.3365, -0.0781, -0.2587, -0.4195, +0.1678, -0.4627,
-0.1905, -0.3720, -0.2279, -0.4517, +0.1817, -0.2728, -0.4155,
+0.4474, +0.2705, +0.5126, -0.1381, -0.7768, +0.0570, +0.3170,
-0.1461, +0.1520
],
[
+0.2711, -0.7083, +0.0868, +0.2666, -0.8103, -0.0690, -0.0300,
-0.7091, +0.1559, -0.3225, -0.3553, -0.1263, +0.2223, -0.2423,
+0.3708, -0.0383, -0.3726, +0.1577, +0.0520, +0.1042, -0.5502,
-0.1205, -0.0600, +0.1708, +0.3769, +0.6033, -0.0370, -0.2149,
+0.0203, +0.2205, +0.1817, +0.0686, +0.2958, -1.5378, -0.3753,
-0.5048, -0.8244, +0.3607, +0.0226, -0.3186, -0.6852, +0.1654,
-0.2479, +0.1836, -0.5161, -0.1248, -0.7217, -0.4131, -0.2711,
-1.2179, +0.5068, -0.7894, -0.2289, +0.1742, -0.4522, -0.2113,
-0.1300, +0.1045, +0.1983, -0.0241, +0.0476, +0.2304, +0.1034,
-0.7503, +0.0238, -0.4383, +0.0790, -0.8974, -0.1478, +0.3492,
-0.7141, +0.2589, +0.0790, -0.2512, -0.2460, -0.0059, -0.3912,
-0.5338, -0.3274, +0.0376, +0.1176, -0.2580, -0.3363, +0.0977,
+0.4249, +0.1062, -0.3632, -0.1051, -0.1989, +0.1453, -0.3825,
+0.4364, +0.3469, -0.0374, -0.2044, -0.1771, -0.5730, -0.1720,
+0.6108, -1.2931, +0.0127, +0.0761, -0.1373, +0.0288, -1.2347,
+0.5185, -0.1560, +0.3861, +0.1622, -0.5163, -0.1247, -0.1058,
-0.2902, -0.2007, +0.6575, -0.1101, -0.6524, +0.0326, -0.4036,
+0.0191, +0.1843, +0.1588, +0.0258, -0.0628, +0.1276, +0.1841,
+0.5514, +0.0580
],
[
+0.3696, -0.2226, -0.5965, +0.0039, +0.0826, -0.0328, +0.2075,
+0.3482, +0.1155, -0.6658, -0.6598, +0.0239, -0.2714, -0.2931,
-0.0308, -0.1994, +0.3646, -0.0805, +0.1486, +0.2427, -0.0741,
+0.3452, +0.0704, -0.0799, +0.6901, -0.2128, -0.2928, +0.0834,
-1.0479, -0.1028, +0.0560, -0.4974, -0.1569, +0.0858, +0.2110,
+0.0329, +0.0708, -0.2342, -0.2855, +0.5861, -0.1896, +0.1390,
-0.3496, +0.3056, -0.8322, +0.1572, -0.4228, +0.3259, -0.6415,
+0.4092, +0.4396, -0.1126, +0.2508, -0.8185, -0.4606, -0.0904,
-0.5178, -0.6965, -0.3374, -0.1446, -0.5244, -0.1085, -0.7043,
+0.0682, +0.2373, -0.0717, -0.8114, +0.3448, +0.0167, +0.2812,
-0.7497, -0.4294, -0.3268, -0.1051, -0.1815, -0.3281, -0.0849,
-0.4348, +0.2231, -0.9791, -0.2975, +0.5974, -0.3474, +0.1663,
+0.0978, -0.3039, +0.1740, +0.2455, -0.1384, +0.1306, -0.0091,
+0.3224, -0.4614, +0.2875, -0.7874, +0.5825, -0.0400, -0.3206,
+0.4512, -0.3062, +0.1509, -0.2496, +0.0852, -0.2199, +0.1985,
+0.1227, -0.2818, -0.1475, +0.3922, +0.1838, +0.0896, +0.4384,
+0.1683, -0.4647, +0.0348, -0.1814, +0.1457, -0.8301, -0.5137,
+0.1269, -0.3037, +0.0274, -0.2094, +0.0461, -0.2276, +0.2731,
+0.2495, +0.1495
],
[
-0.0085, +0.2052, +0.1864, -1.2076, -1.0113, +0.0311, +0.0778,
-0.5844, +0.4804, +0.3460, -0.4087, +0.3961, +0.5099, -0.4606,
-1.3054, -0.7246, +0.4725, +0.4758, -0.1597, -0.6904, -0.1142,
-0.0945, -0.1305, -0.2708, +0.3056, -0.1290, -0.4496, +0.1660,
+0.1616, -0.5353, +0.2048, -0.0921, +0.4782, -0.4734, -0.5955,
-1.1665, -0.6502, -1.0449, +0.0884, -0.6652, +0.6585, -0.1359,
+0.2576, -0.6263, -0.0742, -0.0931, -0.3415, -0.8582, -0.0877,
-0.5015, -1.0665, +0.3704, -0.1931, -0.4724, -1.0108, +0.0551,
-0.5867, +0.1302, -0.0530, -1.2517, +0.2389, -0.6020, +0.2280,
+0.2903, -0.4259, -0.0438, -0.0464, -0.0403, -0.5162, -0.7994,
-0.3000, +0.0190, -0.1081, -0.1555, -0.0449, +0.1102, -0.8093,
+0.1541, +0.1101, +0.1885, +0.0181, +0.1531, -0.5090, -0.3342,
+0.0650, +0.2316, -0.5225, -0.4101, -0.0930, -0.2833, -0.0896,
-0.8806, +0.6488, -0.1290, -0.4551, +0.3343, -0.0093, -0.3612,
+0.2181, -0.1496, +0.1006, -0.7886, -0.3799, -0.4418, +0.0317,
-0.3366, +0.0126, +0.5321, -0.1736, +0.2711, -0.1181, -0.1883,
+0.6228, -0.4832, +0.0469, +0.2955, -0.1980, -0.7133, +0.5580,
+0.1149, -0.5710, -0.1318, +0.4555, -0.9994, +0.1088, -0.1644,
+0.0360, +0.4702
],
[
-0.2252, -0.4254, +0.6137, +0.4718, -0.5521, -0.2921, -0.5468,
+0.7702, -0.5979, +0.2184, -0.2062, +0.0745, -0.4151, +0.1969,
+0.7839, +0.0988, +0.1779, -0.2031, +0.1115, -0.2029, -0.2319,
-1.0614, -0.1879, -1.2515, -0.0887, -0.2592, +0.2736, +0.0759,
-0.4067, -0.2098, +0.2684, -0.9703, -0.2628, -1.4381, -2.2795,
-2.2924, -0.2015, -1.1202, -0.0949, -1.5898, +0.1963, -0.2292,
-0.1158, +0.5034, +0.0557, -0.4832, -0.1155, -0.5655, +0.0922,
-0.3294, -1.1680, +0.2987, -1.2463, -0.3976, -0.5490, +0.0465,
-0.0955, -0.1976, -0.0012, -0.5143, -0.1448, -0.0414, +0.0126,
-0.4112, -0.0247, -0.1230, +0.1532, -0.2767, +0.3638, +0.1027,
-0.0585, +0.3002, +0.3676, -0.3005, +0.2677, +0.3266, -1.5747,
+0.3166, +0.1465, -0.1974, -0.1422, +0.0436, -0.0890, +0.1626,
-0.2840, -0.1864, -1.2519, -0.1626, +0.2748, -0.5678, -1.4952,
-0.0378, +0.4490, +0.3409, +0.1429, -1.2740, +0.1465, -0.3097,
-0.4857, -0.0346, +0.0447, -0.0255, -0.1301, -0.0094, -0.5234,
-0.6989, +0.2882, +0.1444, -0.6770, +0.4679, +0.1677, +0.7201,
-0.2564, +0.1432, +0.0667, -0.0215, -0.1456, -0.4922, -0.4803,
-0.3481, -1.7805, +0.2801, -0.2172, +0.3164, +0.0410, +0.2213,
+0.3071, -0.1733
],
[
-0.1136, -0.0677, -0.4356, +0.8331, -0.8691, -0.5827, -0.0215,
-0.5241, -0.5871, -1.4385, -0.8891, -0.1442, +0.0689, -0.4092,
+0.3884, -0.7465, -1.0275, +0.2555, +0.3577, +0.2575, +0.0209,
-0.1352, +0.0379, -0.0821, +0.0465, -0.0177, +0.0115, -0.3766,
-0.1401, -0.0996, +0.1216, -0.8895, +0.0781, -0.0920, -0.1415,
-0.2272, +0.4005, +0.3169, +0.1274, +0.0498, -0.5372, +0.1034,
-0.1719, -0.0153, +0.6849, +0.0268, +0.0420, +1.1373, +0.2045,
+0.0175, +0.2241, +0.3592, +0.3729, -0.0936, -0.3730, -0.6442,
+0.3203, -0.0835, -0.0376, -0.1133, +0.1059, -0.2747, -0.6443,
+0.1147, -0.0212, +0.1011, +0.0599, +0.0543, +0.1753, +0.1356,
-0.2370, -0.8859, +0.3428, -0.5916, -0.5082, -0.6873, +0.1431,
-0.3359, -0.3301, +0.3276, -0.2136, -0.6678, +0.1320, +0.1852,
-0.0982, -0.0495, -0.2122, +0.2887, +0.0018, -0.1580, -1.1534,
+0.6158, +0.5112, +0.1241, -0.3766, +0.3000, -0.1223, -0.3958,
+0.2922, -0.0240, -0.5557, -0.0616, +0.2368, -0.2329, +0.1579,
+0.0014, -0.3179, -0.2191, -0.1892, +0.2321, +0.0039, +0.7091,
-0.3429, -0.4592, +0.1506, +0.3075, -0.1510, +0.1857, +0.1459,
+0.1891, -0.4055, +0.0411, -0.6508, +0.0743, -0.4859, +0.0052,
+0.4068, +0.1873
],
[
+0.4762, -0.3284, -0.1555, +0.2002, -0.1366, +0.1701, +0.1370,
-0.3074, -0.2124, -0.5547, +0.2435, -0.1142, -0.0982, -0.1635,
-0.1310, -0.2785, +0.0024, +0.0102, -0.2526, -0.4488, -0.1647,
-0.0045, -0.3931, -0.0204, +0.2716, -0.0475, +0.1861, +0.6183,
-0.4493, -0.0702, +0.2247, -0.1569, +0.1372, -0.3291, -0.8000,
-0.6748, +0.4074, +0.5101, -0.7657, -0.6029, -1.0873, -0.1586,
+0.4112, -0.5648, -0.0312, +0.1353, -0.9385, +0.0067, -0.2617,
-0.3750, -0.1196, +0.5406, -0.7990, +0.4246, -0.4306, -0.2984,
+0.3182, +0.0648, +0.4050, +0.1368, +0.2012, -0.2350, -0.2371,
+0.3948, -0.5506, +0.0713, -0.4612, +0.2157, +0.3576, -0.9170,
-0.8457, +0.2411, +0.4271, -0.1765, -0.1865, -0.2401, -0.4079,
-0.1546, -0.0300, +0.3523, +0.1223, -0.4455, +0.1529, -0.2628,
-0.4528, -0.9364, -0.8459, -0.1533, -1.0921, -0.3128, -0.5306,
-0.2182, +0.5052, -0.8434, +0.5184, +0.1367, +0.0152, -0.1304,
+0.7222, -0.2846, +0.0592, -0.1285, +0.1846, +0.2904, +0.4518,
+0.1123, -0.3481, -0.3457, +0.1827, -0.0044, -0.0458, +0.0374,
-0.1125, +0.0941, -0.3499, -0.0423, -0.4055, -0.2829, +0.7004,
+0.1410, -0.3933, -0.3708, -0.4537, -0.5014, +0.1018, +0.5535,
+0.3223, +0.1110
],
[
+0.6492, +0.1605, +0.1305, -0.4848, -0.6308, +0.1230, -0.6904,
+0.4446, -1.0387, -0.4102, -0.1002, +0.0278, -0.0709, +0.0744,
-0.0401, -1.0359, -0.0711, +0.7240, -0.1909, -0.2549, -1.1637,
+0.0829, +0.1114, -0.2705, -0.0319, -0.4715, -0.7474, -0.5330,
-0.0540, -0.5394, +0.5775, -0.1039, -0.4891, -0.8315, -0.5596,
-0.8209, -0.9092, -0.7611, -0.3003, +0.1847, -0.1835, -0.5320,
+0.3177, -0.0634, +0.0724, -0.3234, -0.0891, -0.0884, -0.0462,
-0.1958, -0.5008, -0.3015, +0.1186, -0.8094, +0.4712, +0.0014,
+0.2931, +0.0220, -0.4707, +0.1514, +0.1064, -0.4192, -0.1069,
+0.5645, -0.1316, +0.0881, +0.1463, +0.1614, +0.1803, +0.2927,
-0.6776, +0.0035, -0.1937, -0.1933, -0.6986, +0.0889, -0.6174,
+0.2617, +0.1724, +0.2762, +0.0236, +0.4052, -0.3615, -1.8092,
+0.0611, +0.1489, -0.6541, +0.3291, -0.6879, -0.1768, -0.2767,
-0.1210, -0.3152, -1.0731, +0.4075, -0.0101, -0.9484, -0.1233,
-0.3091, -0.3765, +0.3507, -0.5516, +0.1996, -0.3513, +0.4850,
+0.6935, -2.8095, +0.3908, +0.1824, -0.5622, -0.6693, -0.1793,
-0.1975, -0.5803, +0.0783, -1.4139, -0.1627, -0.5159, -0.0761,
+0.1372, -0.0913, +0.1193, -0.6293, +0.6834, +0.1290, +0.6432,
-0.0958, +0.2212
],
[
+0.2521, +0.2630, -0.4733, +0.3795, +0.0419, -0.4095, +0.2999,
+0.3761, +0.3422, -0.2029, -0.3041, +0.2830, +0.3336, -0.1059,
-1.3482, -0.0119, -0.5787, -0.6648, -0.3205, -0.6331, -0.1909,
-0.0394, -0.7875, +0.0651, -0.0273, +0.1049, +0.5533, -1.2675,
+0.1238, -0.3109, -0.6440, +0.1942, -0.3646, -0.3191, -0.0766,
+0.2061, -0.1044, +0.0561, +0.3081, -0.2792, -0.3319, -0.1471,
+0.3511, +0.0339, -0.1977, -0.6400, +0.0097, -0.6432, +0.1321,
+0.1810, +0.1756, -0.1767, +0.1977, +0.3617, -0.3304, -0.5127,
-0.8530, +0.0533, +0.1787, -0.1992, +0.2893, -0.2216, -0.6566,
+0.0704, -0.1389, -0.4372, +0.1779, -0.3765, -0.1337, -0.0503,
+0.3742, -0.1786, -0.3624, -1.1077, -0.1552, +0.4102, -0.5214,
-0.5095, +0.0131, +0.1564, +0.6065, +0.1712, +0.1516, -0.3438,
+0.3225, -0.0621, +0.3922, -0.4830, +0.1927, -1.4449, -0.9013,
-0.0744, +0.2114, +0.0668, -0.1440, +0.2017, +0.4194, +0.2080,
+0.1666, -0.0075, -0.1641, -0.9365, -0.1810, +0.0262, -0.2943,
+0.2071, +0.1249, -1.5124, -0.0661, -0.3135, -0.1278, -0.3549,
-0.0708, -0.2791, -0.0023, -0.1236, +0.1872, -0.0021, +0.4197,
-0.5973, -1.3331, -0.7616, -1.0685, -0.4284, -0.0643, -0.0932,
-0.7615, -0.4550
],
[
-0.6894, +0.2387, -0.8501, -0.2360, +0.1588, -0.3975, -0.2485,
+0.0576, +0.1002, -0.2252, -0.5013, -0.3919, +0.3921, +0.0695,
-0.9917, -0.8031, -0.2710, +0.3396, +0.5580, -0.0996, -0.0319,
-0.9168, -0.0259, -0.3321, +0.3293, -0.0079, -0.4774, +0.5074,
+0.2986, -0.5248, -0.2066, -0.5032, -0.7702, -0.4826, +0.0393,
-0.3987, -0.7677, +0.2482, -0.7121, -0.1591, +0.3542, +0.2598,
-0.1925, -0.1286, -0.1442, -0.2242, +0.2685, -0.5320, -0.1839,
+0.3071, -0.0286, -0.2077, -0.1724, +0.3268, -0.1637, +0.1221,
-0.3711, +0.3796, +0.1677, +0.0798, +0.0081, -0.2726, +0.3648,
+0.2464, +0.2526, +0.5343, -0.3083, +0.2492, -0.3297, +0.4204,
-0.2402, -0.2899, +0.3629, -0.4292, +0.4970, +0.2512, -0.0435,
-0.3246, -0.5294, +0.6179, -0.2060, +0.4789, -0.0905, +0.1975,
+0.6006, -0.1819, +0.1146, -0.6750, +0.4257, -0.0368, +0.3578,
-0.0778, +0.1832, +0.3916, -0.0713, -0.0925, -0.0996, +0.1648,
+0.1729, -0.6876, +0.1275, -0.4039, +0.8193, +0.5192, +0.2734,
+0.3087, +0.1873, -0.1174, +0.0053, -0.5225, +0.2610, -0.1341,
+0.5482, -1.1334, -0.1744, +0.0211, +0.2616, -0.6873, -0.1929,
-0.5472, -0.1666, +0.3171, -0.0373, +0.1694, -0.1680, -0.0884,
+0.2463, -0.2079
],
[
-0.3374, -0.3851, -0.1854, -0.1772, +0.1176, +0.0174, -0.0545,
-0.2007, -0.2658, -0.1292, -0.2258, -0.1332, -0.3853, -0.6779,
+0.4847, -0.0840, +0.0082, -0.4100, +0.1835, -0.3973, -0.2225,
-0.3307, -1.2065, -0.5345, +0.2386, +0.1299, -0.6485, -0.0198,
+0.3878, +0.4176, +0.1944, +0.4104, -0.3611, +0.1750, -0.2422,
+0.3888, -0.3439, -0.3678, -0.5949, +0.3910, -0.0784, -0.2476,
-0.6963, -0.5632, +0.2662, +0.3285, +0.2715, -0.3387, +0.0520,
-0.3993, -0.1589, +0.4355, -0.1047, +0.4287, -0.2753, +0.1810,
-0.2075, +0.2192, -0.3173, +0.0667, -0.2311, -0.0826, +0.3369,
-1.4102, +0.1262, -0.0202, +0.2389, -0.2517, +0.4403, +0.1408,
+0.0129, +0.1655, -0.2732, +0.1485, -0.0319, +0.2674, -1.2042,
-0.5246, +0.1175, -0.9084, -0.1473, +0.7580, -0.0608, -0.1657,
-0.3441, -0.2765, -0.2576, +0.1945, -0.4545, +0.0471, +0.2464,
-0.1764, -0.3006, -0.4309, +0.5991, +0.7491, +0.3486, +0.2068,
-0.4579, -0.0765, +0.1341, -0.0713, -0.3125, -0.3926, -0.5280,
-0.4428, -0.8202, -0.2347, +0.1489, -0.1848, +0.0109, +0.2817,
+0.3943, +0.5811, -0.0619, -0.0500, -0.3740, -0.0044, -0.3349,
+0.2791, -0.1661, -0.3395, +0.2254, -0.8203, +0.5381, -0.0089,
-0.0524, -0.0049
],
[
-0.3129, +0.3310, -0.0912, -0.2157, +0.1215, -0.3659, -0.0721,
+0.2889, +0.3868, +0.0040, -0.4878, +0.2934, -0.0622, +0.1938,
+0.2447, -0.4872, +0.5489, -0.5351, -0.8669, -0.5864, +0.1900,
+0.3462, +0.3815, -0.1919, +0.1619, -0.3233, +0.1040, +0.3066,
-1.1438, -0.1468, -0.2173, +0.3603, -0.0183, -0.5742, -0.2445,
-0.1754, -1.7395, -0.2586, -0.0417, +0.2469, +0.2116, +0.0549,
+0.2056, -0.0176, +0.1254, +0.3214, +0.3466, -0.2643, -1.6379,
+0.1342, -0.3079, +0.0917, +0.2076, -1.6489, -0.8988, +0.1965,
-0.2954, -0.2331, +0.2279, -1.2496, -0.0440, -0.2847, +0.0058,
+0.6779, +0.3672, -0.2293, -0.5255, -0.2264, +0.5899, -0.4577,
-0.8445, -0.3349, +0.4782, -0.0213, +0.5035, -0.1462, -0.0816,
-0.0924, -0.3762, +0.0949, -0.5648, +0.4525, +0.5809, -0.0342,
+0.1381, -0.3033, -0.4382, -0.1888, -0.5410, +0.1169, +0.7043,
-0.4616, +0.0419, -0.3368, -0.0198, +0.0373, +0.2670, -0.9157,
+0.5766, -0.8848, +0.2547, -2.4214, +0.0289, +0.0294, +0.3200,
+0.2833, +0.7030, +0.1917, +0.0806, +0.0319, +0.1276, +0.3893,
+0.1187, +0.0187, -0.4040, +0.9615, -0.2946, -0.0678, -0.3491,
+0.3768, -0.6789, -0.1654, +0.3386, -0.2474, -0.0224, -0.5732,
+0.2590, +0.2987
],
[
+0.0499, -0.0441, -0.3651, +0.2152, -0.3977, -0.5853, -0.1028,
-0.4648, -0.0573, -0.0586, +0.0939, +0.7476, -0.0733, -0.1556,
-1.2404, +0.2962, -0.3082, +0.2758, +0.4992, -0.5321, +0.2672,
-0.3016, -0.1122, -0.9559, +0.0373, +0.1253, +0.0423, -0.3638,
-0.6725, -0.8164, +0.4092, -0.6592, +0.2284, +0.0237, +0.1574,
-0.4085, -0.0249, -1.7635, +0.3639, +0.1628, -0.1960, +0.1105,
+0.2272, +0.1142, -0.2709, +0.3293, -0.2763, -0.7405, +0.0259,
-0.4482, -0.3133, +0.4974, -0.1307, +0.2308, -0.3896, +0.0042,
+0.0054, -0.2991, -0.0221, -0.4111, -0.0786, -0.0812, +0.3746,
+0.0347, -1.2763, +0.1178, -0.5588, -1.6551, -0.1173, -0.6023,
-0.1478, -0.0474, +0.0818, -0.0719, -0.4102, -0.4633, +0.4273,
-0.2414, +0.5594, -0.0444, -0.5016, -0.4598, +0.2786, -0.1450,
+0.1030, +0.3086, +0.1437, -0.2915, -0.4826, -0.4433, +0.2210,
-0.5075, -0.1776, -0.0854, +0.2941, +0.1911, -0.4371, -0.2531,
-0.1352, -0.2630, +0.6148, -0.2859, -0.0440, -0.3877, -0.4516,
+0.0055, -0.4590, -0.3747, -0.0737, +0.0759, +0.0977, -0.5848,
-0.6917, +0.2776, -0.1383, -0.1147, -0.0361, -0.0117, +0.2566,
-0.4038, -0.3312, +0.4280, -0.0726, -0.9503, -0.3591, -0.0391,
+0.1074, +0.2458
],
[
+0.5959, -0.3278, +0.0867, +0.2935, +0.1105, +0.2164, +0.2708,
-0.0261, -1.1600, -0.2612, -0.2102, -0.2892, -0.1252, -0.1953,
+0.3011, -0.2992, +0.2181, -0.0139, +0.1810, +0.2124, -0.2466,
-0.0319, -0.4725, -0.1248, +0.7223, -0.1485, +0.0357, -0.1122,
-0.6130, -0.1449, +0.3717, -0.5425, +0.2772, +0.3600, +0.0771,
+0.2939, -0.2337, +0.6262, -0.1961, -0.6447, -0.3119, +0.1573,
-0.3272, -0.6251, +0.0969, -0.9605, -0.0935, -0.1721, +0.3689,
-0.1753, -0.7054, -0.1648, -0.7860, +0.3147, -0.3318, -0.4041,
+0.0940, +0.7184, -0.3698, +0.5603, +0.2647, +0.2764, -0.5868,
-0.0931, -0.1904, -0.1462, +0.3757, -0.1287, -0.2810, +0.0976,
-0.2559, +0.2289, +0.1456, +0.0947, +0.1649, -0.0449, +0.0254,
-0.0624, +0.2917, -0.1126, +0.1546, -0.4106, +0.3425, -0.2223,
-0.1813, +0.3036, +0.2795, +0.1488, +0.1489, -0.0121, -0.6496,
+0.1909, +0.0567, -0.1244, -0.1460, -0.1951, +0.1426, +0.0090,
-0.8283, +0.1649, -0.3020, +0.2870, -0.5023, +0.1188, -0.5140,
-0.1743, -0.0307, +0.0629, +0.0458, -0.1941, -0.1876, +0.4947,
+0.4413, -0.7051, +0.0857, +0.2037, -0.1575, -0.0895, -0.4297,
+0.3757, +0.0474, +0.0595, +0.1458, +0.3288, +0.2035, -0.1370,
+0.1637, +0.2244
],
[
-0.0494, -0.5338, +0.3075, +0.3866, -0.0238, +0.0546, +0.3774,
+0.1667, -1.4458, -0.3139, -0.0358, +0.2484, +0.0907, -0.1575,
-0.6370, -0.0251, -0.1844, -0.0867, +0.0449, +0.2515, -0.5639,
-0.2377, +0.0194, +0.2508, +0.3766, -0.0566, -0.5726, +0.2667,
+0.3919, -0.1322, -0.1609, -0.4608, +0.1251, +0.5491, -0.0081,
-0.1707, -0.5703, -0.1431, +0.3946, -0.1315, -0.1477, +0.3808,
-0.4407, +0.0204, -0.0408, -0.0296, +0.2634, +0.3544, -0.1645,
+0.3577, -0.1202, +0.0353, +0.6943, -0.2540, +0.4272, +0.4394,
-0.0890, +0.0457, +0.2672, -0.0779, +0.2240, -0.3899, +0.2615,
-0.3007, -1.1412, -0.2154, -0.0115, +0.3824, -0.2625, +0.2427,
+0.5087, +0.1939, +0.0251, +0.1826, +0.2723, +0.3710, +0.0138,
-0.3563, -0.4064, -0.2353, +0.0655, -0.4434, -0.0499, +0.1209,
+0.1625, +0.0255, +0.1468, +0.3519, +0.0685, -0.2707, -0.3953,
+0.2012, -0.3277, +0.1075, -0.9070, +0.0664, -0.0505, +0.9489,
-0.2441, +0.2456, +0.1766, -0.0657, +0.4403, +0.0069, -0.5148,
-0.0763, +0.5377, +0.1470, -0.2591, +0.2392, -0.5094, -0.6703,
-0.0883, -0.1473, +0.4173, -0.5030, +0.5998, -0.1939, +0.2321,
-0.0096, +0.0813, +0.0249, -0.0330, +0.4237, +0.3936, +0.7550,
-0.1033, -0.4626
],
[
-0.1749, +0.4291, +0.1856, +0.8326, -0.2389, -0.1074, +0.0163,
-0.4133, -0.1674, -0.4193, -0.2264, +0.0122, +0.1945, +0.3477,
+1.1767, -0.2818, +0.2058, +0.1774, -1.2170, -0.0517, -0.1186,
+0.1058, +0.5971, -0.1671, -0.5438, +0.2372, +0.1234, -0.8853,
+0.0058, +0.1098, -0.2242, -0.1922, -0.5617, -0.1774, -0.2270,
-0.2765, -0.0398, -0.2875, -0.2003, +0.4318, -0.0017, +0.6389,
-0.3364, -0.1669, +0.1289, +0.0043, +0.1394, +0.0054, -0.0405,
-0.1790, -0.3323, -0.0987, -0.6836, -1.5795, -0.7282, +0.8996,
-0.1916, +0.4577, -0.3145, +0.3770, -1.1245, -0.1127, +0.3954,
+0.3256, +0.6970, -0.0398, -0.4260, -0.1392, +0.2852, -0.3624,
+0.5735, -0.3427, -0.5304, -0.1201, +0.0896, +0.0079, -0.4158,
+0.7538, -0.2106, +0.0878, +1.1722, +0.0430, -0.7040, -0.3037,
+0.2125, +0.2748, +0.0432, -0.9073, -0.5361, -0.0635, +0.1367,
-0.2737, +0.1896, -0.0686, -0.8063, +0.1628, -0.2493, -0.0644,
-0.4000, -0.0832, -0.8262, -0.2087, +0.0469, -0.2701, -0.0342,
+0.3451, +0.3271, +0.1488, -0.2298, +0.0165, +0.3822, +0.3408,
-0.5740, +0.4275, -0.4073, +0.1550, -0.0615, -0.3236, +0.3417,
-0.4795, -1.4346, -1.1582, -0.0334, +0.1012, +0.0681, -0.3589,
+0.0009, +0.2403
],
[
+0.4514, +0.2783, +0.6260, +0.3761, -0.2668, +0.2137, -0.2847,
+0.1101, +0.1570, -0.8077, -0.3457, -0.1276, -0.3249, -1.1498,
+0.3708, +0.0481, +0.3022, -0.5984, +0.5839, +0.0303, +0.0994,
-0.2405, +0.0918, +0.5515, -0.1574, +0.0112, +0.1610, +0.0654,
-1.0527, +0.3909, -0.1364, -0.5042, -0.0112, -0.1151, -0.3180,
+0.0759, +0.4440, +0.0077, +0.4591, +0.2136, +0.0356, -0.3316,
-0.3721, -0.4922, -0.1280, -0.4384, -1.0652, -1.0171, +0.3237,
-0.1799, +0.4100, +0.1289, -0.5390, -0.4013, +0.1032, +0.2068,
+0.2910, +0.0418, -0.6356, +0.1113, +0.0839, -0.5103, -0.3927,
-0.4109, +0.1319, -0.5748, +0.2908, +0.2892, -0.5980, +0.1307,
+0.6128, -0.5456, -0.2789, +0.3952, +0.2433, -0.2612, +0.1269,
+0.3073, +0.0327, -0.7277, -0.0694, -0.1416, +0.1028, +0.2833,
-0.1480, +0.1768, -0.8571, -0.0552, +0.2363, -0.2078, +0.2579,
-0.0756, -0.6716, -0.7545, +0.0556, -0.2509, +0.2202, -0.4954,
+0.5409, +0.2372, -0.5721, +0.2712, -0.8320, +0.0032, -1.1220,
-0.3420, -0.4108, +0.2167, -0.0481, +0.1335, +0.5197, -0.0579,
+0.2260, -1.0780, +0.0694, +0.0960, +0.0198, -0.1209, -0.0714,
-0.3428, -1.4402, -0.0295, -0.8579, -0.0698, +0.0709, -0.6385,
+0.1580, +0.3372
],
[
-0.1761, -0.1190, -0.1444, -0.1236, +0.0190, -0.6771, +0.1407,
-1.1494, -0.5002, +0.1270, +0.1412, -0.1491, -0.4276, +0.1093,
-0.2619, -0.5989, -0.0392, -0.3743, +0.1734, -0.6701, +0.3487,
+0.1645, +0.0872, -0.0868, -0.3575, -0.4350, +0.5061, -0.0672,
-0.7309, -0.3852, -0.5321, +0.0891, +0.1581, -0.9461, +0.3101,
+0.2622, +0.1075, -1.1945, +0.0055, +0.1117, -0.2656, +0.1402,
-0.2464, +0.1366, +0.0586, -0.0188, +0.0702, +0.1080, +0.5085,
-0.8725, -0.6361, +0.2417, +0.2799, -0.2453, +0.0209, +0.1083,
-0.6030, +0.0556, +0.4698, -0.5757, +0.3942, -0.7870, -0.5153,
-0.3523, -0.7754, +0.1655, +0.1634, +0.1448, +0.0469, -0.5121,
-0.3382, -0.1957, +0.4266, +0.0971, +0.3234, -0.0826, -0.8881,
+0.4790, +0.0021, -0.0421, -0.6887, +0.0712, +0.0470, -0.6644,
-0.1432, -0.4532, -0.6663, +0.1885, -0.2055, -0.4784, +0.0304,
-0.0816, -0.3079, -0.3411, -0.2617, -0.4918, -0.2279, +0.2341,
+0.3344, +0.3590, -0.2672, -0.3317, -1.4133, +0.2980, +0.0894,
-0.0787, -0.6533, +0.4272, -0.1723, -1.3314, -0.2505, -0.6322,
-0.0732, -0.3339, -0.2277, -0.5841, -0.0023, +0.6160, -0.8841,
-0.3858, +0.1262, -0.1833, -0.3150, +0.2126, -0.0341, +0.1543,
-0.0226, -0.0872
],
[
+0.1093, -0.3953, -0.2439, +0.2264, +0.0552, -0.2641, +0.1326,
-0.3655, -0.0776, +0.1456, -0.3135, -0.2428, +0.1776, +0.0427,
-0.1049, +0.3194, -0.6210, -0.1818, +0.0587, -0.3108, -0.0102,
+0.3117, +0.2641, +0.0718, -0.2656, -0.0378, +0.0577, +0.3685,
-0.2128, +0.5100, -0.3235, +0.4025, -0.4131, -0.2795, +0.4549,
-0.5022, -0.7002, +0.1465, +0.1464, +0.4145, +0.2155, +0.2542,
-0.4837, +0.4830, +0.2456, +0.2177, +0.3704, +0.4179, -0.2369,
-1.2701, -0.1190, -0.0053, +0.0357, -0.3522, +0.6011, -0.4625,
-0.0481, +0.3027, -0.3711, -0.1843, -0.1280, -0.1988, +0.0890,
+0.2666, +0.3521, -0.0716, -0.5562, -0.2326, -0.5869, -0.0804,
+0.2775, +0.3285, -0.2048, -0.0762, -0.2221, -0.1345, -0.5772,
+0.4186, -0.3327, -0.3538, +0.2481, +0.2320, -0.2328, +0.0304,
-0.0009, +0.3131, +0.3529, +0.0744, +0.1237, -0.9127, +0.0470,
-0.7908, +0.7607, +0.2485, -0.1654, -0.1840, +0.2082, +0.1369,
+0.1086, -0.3694, -0.0488, -0.1335, +0.2039, +0.4223, -0.3518,
-0.1256, +0.1546, -0.5031, +0.0287, +0.0298, +0.1991, +0.0729,
-0.0224, -0.2507, -0.8534, +0.1450, -0.0068, -0.3593, -0.1262,
-0.4906, +0.2334, +0.0321, -0.7071, +0.2864, -0.0723, -0.0620,
-0.3231, +0.5353
],
[
-0.1872, -0.6072, -0.1623, -0.2428, +0.5207, -0.4531, +0.3649,
-0.0208, -0.0905, +0.1987, -0.1625, +0.0392, -0.7373, -0.2516,
-1.1968, -0.2712, -0.3207, -0.2279, -0.1482, +0.3457, -0.6574,
+0.2216, -0.7708, +0.0120, -0.2948, -0.2319, +0.0410, -0.1395,
+0.1286, -0.8962, -0.6844, -0.2874, -0.2098, -0.8660, -0.3060,
+0.1075, -0.4889, -0.4876, +0.1585, +0.0271, -0.7649, -0.3120,
-0.5355, -0.3379, +0.0560, -0.1290, -0.5892, -0.0722, +0.0397,
-1.7302, -0.1772, +0.0709, +0.4661, +0.5430, +0.0243, +0.1174,
-0.7254, +0.3965, +0.0488, +0.5466, +0.0975, -0.5617, +0.5235,
-0.1244, -0.5608, +0.1739, +0.5572, +0.4367, -0.4987, +0.2556,
-0.6455, +0.2922, -0.4531, +0.1180, -0.0714, -0.3898, -0.7729,
-0.2274, +0.0612, -0.0508, +0.1203, +0.1132, -0.2378, -0.4293,
+0.9299, +0.1615, +0.0224, +0.1529, -0.6744, -0.6975, -0.7713,
-0.1987, -1.2150, -0.0764, -0.4671, +0.1748, -0.0191, -0.1449,
+0.3394, +0.2276, +0.4175, -0.4635, -0.0192, -0.0181, -0.2375,
+0.0315, -0.9739, -0.0035, -0.1776, -0.1825, -0.1149, -0.6031,
-0.1993, +1.0660, +0.1942, +0.2916, -0.3240, +0.1672, +0.8438,
+0.0368, +0.2153, -0.2414, -0.5326, -0.1686, -0.8086, +0.2675,
-0.1521, +0.1660
],
[
+0.3672, +0.3659, -0.3833, -0.0773, +0.5133, -0.1099, -0.1455,
-0.2446, +0.1592, +0.1504, +0.1035, +0.3368, -0.3332, -0.2314,
+0.1218, +0.5182, +0.2823, -0.7633, -0.2657, -0.4206, +0.2680,
+0.3045, +0.1340, -0.7384, +0.1212, +0.5130, +0.1806, +0.0665,
+0.3528, +0.3223, -0.1746, +0.2645, +0.0619, +0.4065, +0.5508,
-0.4019, -0.5304, -0.9035, -0.9114, -0.7582, -0.1242, +0.0469,
-1.1396, -1.0376, +0.2146, -0.1570, -1.2924, -0.5072, -0.5510,
+0.8576, -0.6060, -0.5182, -0.4349, +0.5918, -0.2843, +0.2225,
-0.8508, -0.4305, +0.1419, -0.4509, -0.7419, -0.4085, -0.0913,
-0.1617, -0.2415, -0.3566, -0.4031, -0.8209, -1.1396, -0.1332,
+0.2044, +0.0062, -1.3372, -0.4069, -0.3494, +0.0520, -0.4325,
-0.2444, -0.3479, -0.4087, -0.0608, -0.0265, +0.7527, -0.4687,
-0.1593, +0.3562, -0.7702, -0.0494, +0.5192, -0.0127, +0.1519,
+0.4498, +0.2519, -0.3605, -0.8008, +0.2678, +0.4282, -0.2361,
+0.4220, +0.2413, -0.3887, -0.1261, -0.2721, -0.0707, -0.5530,
-0.0053, -0.0583, +0.1979, +0.2960, -0.9714, -0.5201, -0.5804,
-0.0634, +0.4646, +0.0475, -0.9271, -0.1548, -0.4379, -0.7117,
+0.5550, -2.2792, -1.3753, +0.3930, -0.2748, -0.1226, -0.1022,
-0.1620, -0.5356
],
[
+0.2949, -0.0316, -0.3410, -0.8611, -0.3436, -0.0336, -0.5042,
+0.3260, +0.0233, +0.5927, -0.4618, -0.2004, +0.0765, -0.3380,
-0.5127, +0.1943, -0.4830, -0.3109, +0.1185, -0.2727, +0.0741,
+0.4450, -0.2149, +0.2026, -0.2270, -0.4992, -0.2183, +0.3672,
+0.0453, -0.0997, -0.3463, -0.9736, -0.1515, -0.9857, +0.0598,
-0.5932, -0.3548, +0.1416, +0.2225, -0.3457, +0.2285, -0.6075,
+0.1748, +0.3191, -0.2952, +0.2206, +0.1597, +0.0573, +0.0946,
-0.0554, +0.4816, -0.2746, -0.2081, +0.0103, -0.1562, +0.0599,
+0.4590, +0.0938, -0.1300, +0.2554, +0.8053, -0.3771, +0.0845,
+0.1849, -0.2444, -0.3207, -0.2108, +0.4256, -0.4149, +0.3380,
-0.5478, -0.1006, +0.3588, +0.0793, +0.0071, +0.0359, -0.4133,
-0.4701, -0.2979, -0.1489, +0.3917, -0.3694, -0.2860, -0.1781,
+0.4127, -1.5028, -0.7666, -0.4226, +0.0058, -0.2195, +0.2938,
+0.1673, -0.1712, +0.0225, -0.2716, -0.4006, -0.8034, +0.1702,
-0.6867, -0.6487, +0.4672, +0.3390, -0.1677, -0.1081, -0.1951,
-0.6481, -0.0202, -1.5928, +0.2900, -0.1350, -0.1210, +0.1912,
-0.0764, -0.6552, -0.2993, +0.3903, +0.1795, -0.6494, +0.4557,
+0.0359, -0.1020, -0.0776, +0.2410, +0.4618, +0.1899, +0.0519,
-0.1175, -0.4876
],
[
+0.4475, +0.6580, -0.9072, -0.4252, -0.7311, +0.3157, -0.3769,
-0.2521, +0.0655, -0.3300, +0.8021, +0.5316, +0.5242, +0.9494,
-1.3550, -0.1479, -0.6358, -0.7123, -0.3423, +0.0953, -0.2029,
+0.5488, +0.3757, +0.6414, -1.0084, -0.4088, +0.1759, +0.1782,
-0.0354, -0.2070, +0.2549, -0.7897, -0.6122, +0.3156, +0.1283,
+0.1304, +0.2468, -0.3438, -0.1424, -2.6215, -0.1281, +0.5616,
+0.1851, -0.4052, +0.2366, -0.8374, +0.4125, +0.6650, -0.0151,
-0.5108, -1.8219, -0.3488, +1.0016, -0.4113, -0.5853, +0.6533,
-0.1658, +0.1938, -0.1667, +0.2028, +0.5964, -0.0301, +0.1358,
+0.1099, -0.0235, -1.5907, -1.0106, -0.0173, -0.1321, +0.2166,
-0.1253, +0.4326, +0.3080, -0.6533, +0.7349, -0.5500, +0.7962,
+0.5124, +0.0823, +0.9100, +0.1135, -0.2727, +0.8711, -0.1426,
-0.4308, -0.0841, +0.6076, -0.7595, -0.4672, +0.3527, -0.4772,
+0.3365, -0.4806, -1.4707, +0.8538, +0.1737, -0.4534, +0.5326,
+0.1963, -0.4248, +0.3910, +0.6292, +0.2747, +0.5681, -1.2108,
-0.0866, -0.1978, -0.8462, -0.3194, -1.2809, -0.2784, +0.2669,
-0.9332, -0.5646, -0.2407, +0.2679, -0.9020, -0.1795, -0.0125,
-0.8087, -0.9155, -2.1798, +0.0504, -0.3026, -1.3238, -1.7538,
+0.3439, -0.0563
],
[
+0.0319, -1.6628, -0.0173, +0.2989, +0.1676, +0.0364, -0.1573,
-2.2370, -0.2175, -0.9091, -0.6619, +0.0660, -0.5971, +0.3842,
-0.3193, -0.3382, +0.3384, -0.2757, +0.3400, +0.1164, -0.4148,
-0.1678, -0.3672, +0.9148, +0.4749, +0.0187, -0.3610, -0.2145,
+0.2947, +0.1979, -0.1432, -0.1918, +0.1166, +0.2417, -0.0415,
+0.1454, +0.1314, +0.5063, -0.6644, -0.1707, +0.2847, -0.4376,
-0.1103, -0.8536, +0.2727, -0.1896, -0.5441, -0.5398, -0.0445,
+0.0335, +0.0064, -0.4442, -0.0465, +0.3768, -0.8925, -0.2810,
-0.1458, +0.1723, -0.0520, +0.9517, +0.7592, -0.2111, +0.1319,
-0.8783, -0.2669, -0.2436, -0.2715, -0.4499, -0.7418, +0.1686,
+0.0313, -0.0361, -0.3253, +0.2035, +0.0673, -0.2192, +0.0130,
-0.2811, -0.0055, -0.4326, -0.5431, -0.3846, -0.2410, -0.8734,
-0.1606, +0.0070, -0.3290, +0.5137, +0.3075, -0.1952, +0.0826,
+0.1185, -0.0543, -0.1451, +0.4320, +0.5998, +0.4729, -0.3437,
-0.3013, -0.4789, -0.4182, +0.2208, +0.1769, +0.1167, +0.5403,
-0.2031, -1.8206, -0.9715, -0.4390, -1.0862, +0.0155, -0.7855,
-0.5351, -0.0728, -0.4738, +0.0931, +0.4726, -0.0554, +0.2552,
-0.5134, -0.3282, +0.0480, -0.2491, -0.4939, -0.3105, -1.0567,
-0.0065, +0.1648
],
[
+0.3248, -0.1633, +0.5252, -0.4404, -0.2621, +0.2188, +0.2378,
-0.4007, -0.7312, +0.4298, +0.4192, -0.0322, +0.1656, -0.8179,
+0.3438, +0.2162, +0.1376, -0.1415, +0.1829, +0.2162, +0.1823,
+0.0527, +0.4989, -0.1013, +0.0446, +0.2098, +0.0298, +0.4420,
+0.0982, +0.0556, -0.1275, -0.4022, +0.0921, +0.3972, +0.2696,
-0.1864, +0.4565, +0.2358, +0.4417, -0.0330, +0.1875, +0.3638,
-0.6421, +0.0176, -0.4929, +0.2501, -0.4281, -0.0558, +0.0193,
+0.4463, +0.3124, +0.2450, +0.2867, -0.2307, -0.4713, +0.0499,
-0.0854, +0.0547, -1.0298, -0.0193, +0.1035, +0.4370, -0.8156,
+0.0611, -1.1987, -0.1717, -0.4427, +0.0735, -0.4460, -0.1526,
-0.3083, -0.6694, +0.0866, +0.3043, +0.4516, -0.6468, -0.0721,
-0.1257, -0.1034, +0.0416, -0.0325, -0.5287, +0.4402, -0.1051,
-0.0580, -0.1416, -0.1219, +0.4046, +0.4270, +0.2213, +0.4172,
+0.4552, -0.3745, +0.0014, -0.4077, -0.4349, +0.0824, -0.0385,
+0.3813, +0.0135, +0.0187, +0.3953, -0.1952, +0.0045, -0.9718,
-1.0177, +0.1590, -0.6199, +0.4418, -0.4560, -0.0083, -0.1064,
+0.3796, +0.4562, +0.2073, -0.1268, +0.1443, +0.0193, +0.2260,
+0.1600, -0.6394, -0.1616, -0.6255, -0.1362, -0.0162, +0.4192,
+0.0862, -0.0224
],
[
+0.2984, +0.0992, -0.0996, -0.6480, +0.1425, -0.2154, -0.2364,
-0.5196, +0.2569, +0.4777, +0.0330, -0.2675, -0.4374, +0.4110,
+0.2946, -0.1093, +0.6461, -0.2925, -0.1891, +0.3656, -0.1734,
-0.6296, -0.5544, -0.3675, +0.3985, -0.1510, +0.3925, -0.2182,
-0.0117, -0.0585, -0.3104, +0.3286, +0.8725, +0.6009, +0.1548,
+0.1402, -0.0681, -0.3306, -0.2152, +0.1912, -0.1301, -0.6383,
-0.0810, +0.0093, -0.1257, +0.4486, -0.1424, +0.0640, +0.4627,
-0.2530, -0.1157, +0.2227, -0.1777, +0.3090, -0.2005, -0.1327,
+0.3165, +0.0120, +0.4165, -0.3985, +0.1769, -0.0774, -0.1105,
-0.1150, +0.2654, -0.0559, -0.1382, +0.2627, +0.2446, -0.5470,
-0.5101, +0.0276, -0.3068, +0.4351, -0.0344, -0.2234, +0.3508,
-0.8163, +0.2247, -0.7000, -0.3395, +0.0134, -0.1784, -0.2246,
+0.6040, -0.2900, +0.3628, -0.3002, +0.4111, +0.5022, -0.4669,
+0.2574, +0.5707, -0.2343, +0.6138, -0.1966, -1.4395, +0.0095,
-0.4462, -0.1831, +0.0234, -0.5368, +0.2990, -0.5012, +0.1117,
-0.1993, -0.2311, +0.4470, +0.5955, -0.8588, +0.1398, -0.7063,
-0.1499, -0.0807, -0.1804, -0.6344, +0.0708, +0.0311, -0.2556,
+0.2427, +1.2595, -0.2182, -0.0405, -0.1956, -0.4734, +0.0082,
-0.2395, -1.0875
],
[
+0.4931, -0.0139, -0.1785, -1.3003, -0.9315, +0.1883, +0.0783,
+0.1156, +0.2229, +0.4970, -0.3026, -0.0427, +0.3666, +0.0441,
+0.3605, +0.3052, +0.1717, +0.2815, -1.1105, +0.5068, -0.9422,
+0.1006, +0.3818, -1.0538, +0.4193, +0.1306, +0.0993, -0.0268,
+0.6013, -1.2039, -0.1301, -0.2177, -0.2388, +0.0288, -0.2354,
+0.0407, +0.2387, -0.4171, +0.1845, +1.3959, -0.4449, -1.0931,
+0.1117, -1.2900, -0.3455, +0.1650, +0.4779, +0.1619, -0.1346,
+0.5967, +0.1350, +0.1895, -0.1691, +0.0322, -0.5549, -0.4310,
-0.5731, -0.5571, +0.1791, +0.2053, -0.1841, -0.0625, +0.2050,
+0.2110, -0.0270, -1.5258, -0.1127, +0.3542, -0.6700, +0.0764,
+0.3272, -1.6352, +0.5401, -0.1176, -0.6925, -0.1588, +0.1769,
-0.5969, +0.2519, -0.7011, -0.5501, -0.3885, -0.2958, -0.5574,
-0.1361, +0.4964, +0.2261, +0.1588, -0.6176, +0.3896, +0.3587,
-0.1452, -0.4678, -0.4397, -0.6235, -0.2614, -0.3143, -0.7581,
-0.3924, +0.1405, -0.1026, -1.1059, -0.5655, -0.5290, -0.9429,
+0.1219, +0.2150, -0.0211, +0.3210, +0.1728, +0.3014, +0.7363,
-0.6684, -0.2873, -0.2049, -0.3292, -0.9234, +0.3870, -1.4117,
+0.2839, -0.1830, -0.7153, -1.5961, +0.0216, +0.3415, -0.3118,
-0.5493, -0.1679
],
[
+0.3085, +0.1217, +0.2708, +0.1764, +0.0721, -0.5826, +0.0589,
+0.1488, -0.2251, +0.1201, -0.5999, +0.3246, +0.7053, +0.4986,
-0.6902, +0.4752, -0.1896, +0.3343, -0.5747, +0.2491, +0.0376,
+0.0067, -1.5010, +0.0388, +0.0795, -0.4898, +0.2748, -0.7656,
+0.0971, -0.3358, +0.1696, +0.1662, -0.4723, +0.2035, +0.1646,
-0.0822, -0.1929, -0.8202, +0.2350, -0.1611, +0.1259, -1.3991,
+0.2596, -0.0796, +0.3935, +0.1308, +0.0481, +0.0643, -0.5223,
-0.7995, -0.1504, -0.1120, +0.1316, -0.5272, +0.1430, -1.6754,
-0.3763, -0.4128, +0.2002, -0.0846, +0.1848, +0.2289, -0.1495,
-0.2388, +0.1006, -0.4186, +0.6275, -0.8756, -0.2684, +0.1550,
-0.7136, -0.5394, -0.0622, -0.5143, -0.5301, -0.5289, -1.3851,
-0.1833, -0.3752, -1.3665, +0.3135, +0.3702, -0.2620, -0.2681,
-0.1054, -0.5276, -0.8615, +0.1398, +0.5070, +0.0973, -1.3543,
-0.1740, +0.2780, +0.2337, +0.2031, -0.0993, +0.3770, -0.5235,
-0.4920, +0.0583, -0.0661, -0.0447, -0.0847, +0.2940, +0.1105,
-0.4637, -0.0770, +0.1984, -0.1683, +0.3739, -0.3324, -0.1877,
-0.2671, -0.3427, -0.2696, -0.6949, -0.8354, +0.0840, -0.7230,
-0.2395, -0.2272, -0.1010, -0.5552, -0.0120, -1.7305, +0.4488,
-0.7055, -0.0241
],
[
-0.0699, -0.0347, -0.1426, +0.0382, -0.6711, -0.9992, +0.0990,
-0.0885, -0.0089, -0.3321, +0.0392, +0.1791, -0.0517, -0.0319,
+0.0047, -0.0617, -0.2380, +0.3098, -0.0395, -0.2500, -0.0267,
-0.1255, -0.4858, +0.1856, -0.0685, -0.2430, +0.1449, +0.3326,
-0.4269, +0.5182, +0.1142, -0.2007, +0.2764, -0.2299, +0.7191,
-0.7689, -0.1414, -1.1110, -0.1952, +0.0435, -1.4034, +0.0324,
+0.1118, +0.0090, -0.0316, -0.2086, -0.1791, +0.1090, -0.3573,
+0.0272, +0.4384, +0.0325, -0.5804, +0.0563, +0.3496, +0.1126,
-0.6086, -0.1028, -0.6224, +0.6576, +0.4319, -0.4998, +0.1549,
-0.3424, -0.1119, -0.3496, +0.4719, +0.0783, -0.4349, +0.1816,
-0.5880, +0.1618, -0.3262, -0.3673, -0.3076, -0.1708, -0.4230,
-0.5483, +0.4582, -0.7904, -0.5307, -0.5135, -0.5689, -1.2002,
-0.1985, +0.1232, +0.2213, -0.1413, +0.2333, +0.4705, -0.5972,
+0.5658, -0.1857, -0.0892, -0.5555, +0.0480, -0.7166, -0.3275,
-0.3127, +0.2932, -0.2623, -0.6273, -0.2590, -0.1251, -0.2027,
+0.2016, -0.7108, -0.2773, -0.4188, +0.5586, +0.2671, -0.2214,
-0.0762, -0.9201, -0.4880, +1.1728, -0.0636, +0.1197, -0.7996,
-0.1891, -0.7012, -0.5298, +0.4840, -0.2211, +0.3282, -0.3851,
+0.2790, +0.2206
],
[
+0.2515, -0.0460, +0.6307, -0.4469, -1.2297, +0.3137, -0.0871,
-0.9855, +0.3819, -1.2793, -0.4935, +0.2099, -0.2078, +0.5218,
-0.3201, +0.5992, -0.3316, -0.6488, -0.4344, -0.2481, +0.4467,
-0.1658, +0.3424, -0.7730, -0.0601, +0.2052, -0.7356, -0.1673,
+0.0029, -0.1864, +0.4766, +0.4392, -0.5309, -0.2602, -0.4008,
-0.9269, -0.8221, -0.3150, -0.5733, -0.5973, -0.1171, -0.2877,
+0.4653, +0.6510, -0.0373, +0.1813, -0.5940, -0.3138, -0.1951,
-0.2005, +0.3433, +0.3224, +0.0881, -0.2401, -1.2631, -0.0198,
+0.0647, -0.4116, -0.1162, -0.3314, +0.1495, +0.1694, +0.1436,
-0.2433, -0.6034, -0.1160, +0.4647, -1.1555, +0.2582, -0.7255,
-0.8492, +0.1665, +0.0833, +0.7934, +0.0374, +0.1002, -0.1522,
+0.9246, -0.4266, +0.3160, -0.1681, +0.4971, -0.1865, -0.1163,
-0.9149, +0.3540, -0.2281, +0.0785, +0.0523, -0.3920, -0.7295,
-1.5365, -0.3843, +0.2214, +0.5486, -0.1391, -0.0621, +0.6017,
-1.6143, -0.2603, -0.4795, -0.6317, -0.4797, -0.0137, -0.5190,
-0.4591, -1.6069, +0.2246, -0.1321, +1.2048, +0.1243, +0.1225,
+0.1101, -0.2003, -0.8028, +0.2594, -0.0839, +0.9636, -0.1147,
+0.4519, -0.9124, +0.5739, +0.0732, +0.1405, +0.2791, -0.0281,
-0.3491, +0.4972
],
[
+0.2997, -0.0590, +1.5474, -0.2897, -0.0720, +0.4884, +0.3767,
-0.6406, +0.2781, +0.1654, +0.5724, -0.3223, -0.3083, -0.0130,
-0.8242, +0.1416, -1.2836, -0.2536, -0.5389, -0.7150, +0.2057,
+0.3423, +0.1123, -0.4825, -0.3663, -0.0181, -0.9098, -0.8177,
-0.1424, +0.6420, -0.2045, -1.4718, +0.8390, -0.3501, +0.7143,
+0.4790, -0.8828, -0.6263, +0.4958, -0.3797, +0.0561, -0.5050,
-0.7387, +0.1345, +0.0628, -0.0689, -0.3732, -0.4678, -0.5067,
+0.8548, +0.1120, +0.6079, -0.0247, -0.5180, +0.0315, +0.7373,
-0.0192, -0.0424, -0.6181, +0.3579, +0.2907, -1.0741, -0.5571,
-0.4145, +0.6020, +0.1359, -0.1789, -0.7475, +0.2754, +0.3870,
-0.5211, +0.0470, +0.2925, -0.6933, -0.4954, +0.5955, +0.3210,
-0.7589, +0.3018, -0.5384, -1.0367, +0.2131, -0.3080, -0.1733,
+0.0630, -0.5894, -0.3412, +0.9476, +0.0097, -0.6666, -0.1119,
+0.2413, -0.6325, -0.2442, -1.2067, -0.3356, +0.2132, +0.1711,
-0.8029, -0.0991, +0.3307, +0.3498, -0.9837, +0.4930, -0.7711,
-0.9355, -0.3776, +0.2788, -1.0194, -0.4159, -0.3065, -0.5042,
+0.1818, -0.3402, -0.6123, -0.6465, +0.0899, -0.0228, -0.9121,
-0.7620, -1.9192, -0.1273, -0.3641, -0.6793, -0.6107, -0.9946,
-1.3522, -0.0111
],
[
-0.1071, -0.0914, -0.3853, -0.4486, -0.4044, +0.3221, +0.2509,
-0.2483, +0.8798, -0.0691, -0.9215, +0.4125, +0.0706, +0.3623,
-1.1719, -0.1146, -0.1429, +0.2887, -0.0463, -0.1385, +0.0253,
+0.6948, +0.2812, +0.2271, +0.1506, +0.1074, +0.2028, +0.3923,
+0.0775, +0.1088, -0.2068, +0.3874, -0.1533, -0.1300, +0.3297,
-0.5180, -0.0545, +0.3264, +0.1504, +0.4627, -0.6114, +0.1983,
-0.2525, +0.0557, +0.1478, +0.2654, +0.1795, -1.0393, -0.3441,
+0.2040, -0.2679, -0.1513, -0.0434, -0.6975, -1.2178, +0.0540,
+0.0830, -0.4225, -0.1042, +0.3557, -0.4862, +0.4225, +0.0174,
-0.0394, -0.2975, +0.2248, -0.5806, -0.0481, +0.0870, -0.9754,
-0.3492, -0.2499, +0.1434, -0.7345, -0.4206, -0.1391, +0.5547,
-1.5464, +0.2995, -0.2667, +0.2176, -0.0222, -0.8436, +0.3644,
-0.0144, +0.1929, -0.1981, -0.2658, +0.0008, +0.2550, +0.2259,
+0.2459, -0.0549, -0.8412, -0.2304, +0.2651, +0.3952, -0.1507,
+0.7589, +0.1382, +0.3815, +0.4374, +0.5381, -0.2944, -0.7976,
+0.5965, -0.2968, +0.2455, +0.3352, -0.7624, +0.1680, -1.0777,
+0.2098, +0.0263, +0.5142, +0.1962, -0.9001, -0.2288, -0.0602,
-0.3794, -0.0381, -0.3365, +0.5141, -0.2042, -0.2965, -0.2482,
+0.0614, -0.0506
],
[
-0.4827, -0.9625, -0.6821, +0.6980, -0.7364, -1.0121, +0.1778,
-0.2168, -0.5134, +0.0203, -0.1385, +0.3100, -0.4719, -0.0024,
-0.7544, +0.1833, -0.5929, +0.0118, +0.5007, +0.2929, -1.1400,
-0.3093, +0.1488, +0.0664, -0.0794, +0.1037, -0.1451, +0.4052,
+0.6305, +0.0479, +0.6161, -0.2096, +0.4492, +0.1423, -0.8857,
-0.5945, -0.9675, +0.1129, -0.0625, +1.0241, -0.2228, -0.3425,
+0.3905, -0.0610, -0.7793, -0.5432, -0.4786, -0.7494, -0.3886,
-0.0728, -0.3910, -0.3117, -0.6177, +0.7814, +0.1274, -0.1076,
-0.9399, -0.1651, -0.2074, -0.3800, +0.1975, +0.3417, -0.3567,
+0.1682, +0.5643, -0.3865, -0.5320, -0.0927, -0.4048, -0.3455,
+0.4964, +0.2474, +0.6381, -0.2735, +0.1357, +0.0831, -0.7824,
+0.1336, +0.1894, -0.5041, +0.1137, -0.8554, -0.3267, -0.8148,
+0.2027, -0.6058, +0.2357, -0.6815, +0.3592, -1.0961, -0.0851,
-0.3931, -0.3858, -0.4947, +0.3376, -0.4960, -1.2253, -0.2729,
-0.0613, +0.0338, -0.4375, +0.1772, -1.2183, -0.3815, -0.6360,
-0.1212, +0.5667, +0.3882, -0.2186, +0.3979, -0.8886, +0.5915,
-0.1799, -0.2567, -1.1061, +0.2576, +0.0697, +0.5720, -0.7618,
-0.0331, -0.3751, -0.5745, -0.3045, -0.0802, -0.2254, +0.2281,
+0.7876, +0.8453
],
[
-0.5146, -0.1675, +0.4185, +0.3867, -2.0276, -0.3550, -0.0103,
+0.0759, -0.5695, -0.5775, +0.4338, +0.0862, -0.2782, -1.1816,
+0.4527, +0.0245, +0.2384, +0.2595, -0.1889, +0.1669, +0.1330,
-0.5044, +0.1522, +0.1296, +0.1008, -0.1094, -1.0970, +0.2959,
-0.0608, -0.2347, +0.0648, -0.8752, -0.0874, -0.3487, +0.1176,
+0.6469, +0.4873, +0.2115, -0.1896, -0.3099, +0.2538, +0.1531,
-0.0522, +0.1851, -0.4144, -0.0601, -0.1023, +0.0833, +0.0115,
+0.0726, +0.8781, -0.2878, -1.7336, +0.0163, -1.6014, -0.0083,
-0.3536, +0.2323, -0.7565, -0.2184, -0.4687, +0.3105, +0.3376,
+0.4321, -0.3851, +0.0826, -0.2408, +0.0863, -1.4832, +0.0563,
-0.2557, -0.3054, -0.3075, -0.2278, -0.1671, +0.0521, +0.3658,
+0.3719, +0.0804, -0.6263, -0.1550, -0.1028, -0.2334, +0.2369,
-0.4011, +0.9961, -0.0063, +0.9473, +0.2949, -0.1119, -0.6594,
-0.4036, +0.4119, -0.6482, -0.1113, +0.1171, -0.4483, -0.4772,
-0.0929, +1.0857, +0.2080, +0.1390, +0.6034, +0.2009, +0.0470,
+0.1179, -0.3087, -0.2450, -0.3718, +0.1897, -0.0922, +0.5298,
+0.0121, +0.1860, +0.1340, +0.4798, -0.0977, -0.1933, -0.1136,
-0.0081, -0.3595, -0.1116, -0.8788, -0.8181, +0.0373, +0.1917,
+0.0235, +0.4108
],
[
-0.2226, -0.1118, -0.4395, +0.0949, +0.2345, +0.1716, -0.5861,
+0.3246, -0.1655, -0.3465, -0.1213, -0.3040, +0.2176, -0.1509,
+0.1273, +0.2831, -0.2209, -0.0024, -0.1555, +0.2461, -0.4054,
-0.3875, -0.2816, +0.1992, +0.2812, -0.4946, -0.0605, +0.4227,
-1.1630, +0.0745, -0.0690, -0.1638, -0.1808, +0.0094, -0.0691,
-0.2381, -0.8959, -0.2208, +0.3658, +0.5741, +0.2885, -0.0040,
+0.4126, -1.0711, +0.3548, -0.3181, -0.6322, -0.1208, -1.0722,
+0.2538, -0.5078, -0.5311, +0.3811, -0.2693, +0.2067, +0.6466,
+0.0822, -0.1527, +0.1130, -0.3884, -0.3325, -1.1208, +0.1370,
-0.3095, +0.0311, +0.1457, -0.0690, +0.0818, -0.5080, -0.7021,
-1.9342, +0.0178, -0.1540, +0.1579, +0.5999, -0.0807, -0.0241,
+0.4862, -0.1039, -0.0031, -0.5623, +0.0595, +0.1014, -0.7204,
+0.0172, +0.2057, +0.2657, +0.4014, -0.2632, +0.3744, +0.3248,
-0.4278, -0.5524, +0.4031, -0.4441, +0.5158, +0.4152, -0.1849,
+0.5721, +0.3827, +0.2814, -0.0213, -0.1929, -0.2211, +0.2765,
-0.5487, +0.4636, -0.3462, -0.2213, +0.2036, -0.0372, -0.7832,
+0.3035, -0.3648, +0.1918, -0.2024, +0.1873, -0.3389, -0.1560,
+0.2861, +0.5234, +0.1103, -0.0112, -0.1042, +0.5901, -0.1086,
-0.3113, +0.2456
],
[
+0.6437, +0.2104, -0.1146, -0.2029, -0.1413, +0.0463, -0.1361,
-0.3423, -0.5981, -1.3993, -0.2364, -0.6253, -0.0367, +0.0396,
+0.4071, -0.1041, +0.2952, -0.7470, -0.5323, +0.1711, -1.6514,
-0.2995, -0.1617, -0.0444, +0.2066, -1.2562, +0.1500, +0.2685,
+0.0740, -0.6300, -0.1595, -0.2937, -0.1878, -0.1974, +0.0573,
-0.1410, +0.3946, +0.3699, -0.2207, -0.9597, +0.6649, +0.3057,
-0.1968, -1.5333, +0.0333, +0.1745, +0.6678, -0.4441, -0.5636,
-0.0175, -0.8500, -0.1240, -0.6060, +0.2580, +0.1085, +0.0204,
-0.4799, +0.0779, +0.4179, -0.0790, -0.1145, -1.4217, +0.7018,
+0.0990, +0.4478, +0.2631, -1.5982, -0.1057, -0.6651, -0.2051,
+0.9339, -0.7448, -0.7337, -0.1249, +0.1416, +0.3265, +0.4638,
-0.3997, +0.1113, -0.6644, -1.0355, -0.5059, -0.3138, -0.8874,
-0.8188, +0.2271, -0.5940, +0.4332, -0.5486, -0.2080, -0.8829,
-0.1462, -0.7029, -1.0269, -0.4292, +0.6677, -0.6375, +0.2042,
-0.0905, +0.5251, -0.1005, -0.0572, -0.2358, +0.1797, -0.6072,
-0.5522, +0.0565, -0.6040, -0.0751, -0.0251, -0.0597, -0.6340,
-0.4350, -0.4168, +0.1966, -0.3608, -0.3125, -0.1044, +0.2857,
-0.2191, -0.0965, -0.1001, +0.1235, +0.3814, +0.0643, -0.8396,
+0.3091, +0.3177
],
[
-0.0125, +0.3690, -0.0585, -1.0826, -0.8428, -0.1197, -0.1145,
-0.2935, +0.3786, -0.0549, +0.4265, -0.2455, -0.1427, +0.2034,
+0.2929, +0.4222, +0.1811, -0.4978, -0.3388, +0.3621, -0.0699,
-0.4999, -0.5357, +0.0117, -0.5642, +0.0933, +0.1825, +0.6247,
+0.6617, +0.2117, +0.5872, -0.2158, -1.5956, -0.4088, +0.1522,
-0.0365, -0.1444, +0.0480, +0.0145, -0.8867, -0.3696, +0.7545,
+0.0776, -0.4678, +0.2637, +0.0863, +0.4760, -0.7836, -0.8257,
-0.7849, +0.3583, +0.2555, -0.3267, +0.0516, -0.4765, -0.2294,
-0.1335, +0.6383, -0.0482, +0.1919, +0.4054, -0.0641, +0.1350,
-0.6503, +0.2876, -0.1300, -0.0278, +0.1501, -1.4875, +0.3619,
-0.7003, -0.0982, +0.0386, +0.2116, -0.1633, +0.5162, -1.7085,
+0.1229, +0.0061, +0.4792, +0.0814, +0.2878, +0.2448, -0.0493,
+0.2096, +0.8204, -0.0978, +0.1990, -0.0858, +0.1393, +0.5323,
-0.4105, +0.3717, -0.3621, +0.1622, -0.0615, +0.0896, +0.2078,
+0.1755, -0.6073, +0.0121, +0.5078, +0.4294, -0.2070, +0.0555,
-0.3551, -0.2384, +0.9508, +0.9955, +0.3392, -0.1987, -0.4620,
+0.3046, -1.0395, -0.0181, +0.4667, +0.0746, -0.3318, -0.1283,
+0.4452, -0.2630, -0.2656, -0.2240, +0.2857, -0.5009, +0.1492,
-0.1431, -0.1559
],
[
-0.0629, -0.2279, -0.2815, +0.1708, +0.8295, -0.1126, -0.1447,
-0.6849, -0.1887, -0.0727, -0.3118, +0.3364, +0.1892, -0.0240,
+0.6113, +0.3232, -0.1727, -0.1026, -0.1972, -0.1144, -0.1729,
+0.0693, +0.0774, +0.6179, -0.0878, -0.1258, -0.0726, -0.4002,
-0.0009, +0.1317, -0.1568, -0.1211, -0.3489, -0.2788, +0.3074,
+0.1012, +0.4588, +0.5282, -0.4225, -0.3813, +0.3806, +0.0643,
+0.3658, +0.1461, -0.5421, +0.5411, -0.3853, +0.3188, -0.2143,
+0.3654, +0.1371, +0.1195, +0.4107, -1.8788, -0.3085, +0.1691,
+0.3571, +0.1617, -0.1075, -0.0012, -0.0209, +0.1295, +0.0088,
+0.2663, -0.4468, +0.2328, -0.5461, -0.4623, +0.0639, -0.4745,
+0.0185, +0.1748, +0.2751, +0.0289, -0.1511, -1.0610, -0.9342,
+0.1023, -0.5897, +0.4368, +0.4395, +0.3023, +0.0362, +0.0504,
+0.0549, +0.4292, -0.2066, -0.0201, +0.5096, -0.6873, -0.0542,
-0.6261, -0.4679, +0.3975, +0.6687, +0.0149, -0.0495, +0.2126,
+0.3135, -0.4383, +0.2927, -0.2681, +0.4141, +0.0640, +0.5893,
+0.0434, +0.3599, +0.5617, +0.2766, -0.1020, +0.5417, -0.4419,
+0.0661, -0.0103, -0.0789, -0.4222, +0.8133, -0.6130, -0.2251,
-0.3994, +0.0350, +0.4120, -0.0729, +0.1060, -0.1923, +0.2212,
-0.0015, -0.1975
],
[
-0.4066, +0.0110, -0.1552, +0.7796, -0.0239, +0.3462, -0.2415,
+0.0705, +0.2349, -0.0734, -0.3265, -0.1310, +0.2559, +0.5686,
-0.4128, +0.0741, +0.3212, -0.2172, +0.1443, +0.0788, +0.3495,
-0.5490, +0.3459, -0.0580, +0.0692, -0.9546, -0.4976, -0.1698,
+0.1399, -0.4934, -0.6442, +0.6383, +0.4024, -0.2844, +0.1234,
+0.1897, -0.0190, -0.0917, -0.2153, +0.7597, +0.3709, -0.5425,
+0.0875, +0.1794, +0.1240, -0.2885, -0.6782, -0.2058, -0.2110,
+0.3166, +0.2170, +0.2508, -0.0191, -1.8132, -0.4284, -0.4284,
+0.3022, -0.0620, +0.1973, -0.1018, -0.1348, -0.3027, -0.2532,
+0.8243, -0.9928, -0.0993, -0.3451, -0.2089, -0.3335, +0.1183,
+0.3709, -0.6175, +0.7353, -0.6027, +0.2178, +0.1978, -0.3458,
-0.0521, -0.6020, +0.1237, +0.0796, +0.0057, +0.1332, +0.7635,
-0.5412, +0.0156, -0.3960, +0.0878, -0.1451, -0.9331, -0.4365,
+0.1153, -0.0123, +0.1842, -0.1648, -0.3365, -0.0141, +0.2035,
+0.1613, +0.1402, -0.1826, -0.7295, +0.0094, +0.1283, -0.5300,
+0.0302, +0.3494, +0.3142, -0.8464, +0.6401, +0.4011, -0.2069,
+0.0559, -0.3056, +0.1178, +0.0165, +0.0848, +0.2998, -0.0056,
+0.2207, -0.4445, +0.2723, -0.5331, -0.0323, -0.3625, +0.4932,
+0.2006, -0.1021
],
[
-0.0519, +0.6391, -0.9079, -0.4731, +0.1328, -0.9114, +0.1221,
-0.8589, -0.1144, -0.0532, -0.2697, +0.1769, +0.1012, -0.1550,
-0.2779, -0.0026, -0.1059, -0.8324, -0.0975, +0.1698, +0.0020,
-1.0129, -0.0535, +0.0840, -0.6365, +0.3403, -1.0890, +0.2234,
+0.2051, -0.3762, -0.0219, -0.0708, +0.3895, -0.0854, +0.1450,
-0.3397, -1.0253, -0.1690, +0.2384, -0.0361, +0.6280, -0.0232,
-0.4950, +0.0184, -1.0879, -0.7964, -0.4034, -1.1418, -0.2425,
+0.1005, -0.1049, +0.2868, -0.9874, +0.2592, -0.7185, +0.2495,
-0.2086, -0.3738, +0.1108, -0.1768, -0.2887, -0.8102, +0.4337,
+0.1725, -0.2910, -0.0147, -0.0028, -1.5598, +0.5284, +0.1599,
+0.1920, +0.2220, -0.2343, -0.0158, +0.5636, +0.0944, -1.1463,
-0.2529, +0.1844, -0.6164, +0.2345, -0.0869, +0.4677, -0.6338,
+0.0034, -0.4730, -0.2976, +0.0252, -0.4131, -0.3446, -1.0642,
-0.1187, +0.9727, +0.5157, -1.0458, -0.3792, +0.0248, -0.3634,
+0.5012, -0.4836, +0.1707, +0.0261, +0.5114, -0.0316, +0.3451,
-0.0684, -0.3541, -0.2896, +0.2410, -0.7695, -0.7893, -0.2634,
-0.3458, +0.3608, -0.8740, -0.0193, +0.4683, -1.3214, +0.4505,
-0.8586, -0.5350, +0.0255, -1.7029, +0.1839, -0.6434, -0.7443,
+0.2752, -0.1452
],
[
+0.4497, +0.1332, +0.2510, -0.6546, +0.1903, +0.4629, -0.2670,
-0.6217, -0.7900, +0.4055, +0.1048, +0.0932, -1.2687, -0.0471,
+0.3675, -0.0751, +0.1833, +0.0968, +0.2331, +0.0363, -0.2188,
-0.0195, -0.0392, -0.5979, -0.0682, +0.3105, +0.2466, +0.1776,
+0.6357, -0.6630, +0.3737, -0.1215, +0.3028, +0.2282, +0.1548,
-0.5035, -0.1194, -0.6486, +0.1720, -0.1318, +0.0364, -0.4553,
+0.7951, +0.2073, -0.7346, -0.4911, +0.6745, +0.4376, +0.2163,
-0.0280, -0.1423, -0.3016, -1.3744, +0.3040, -0.3974, +0.0085,
+0.0414, +0.3840, +0.2412, -0.0372, +0.5375, -0.5450, +0.5068,
+0.8780, -0.4269, -0.6047, +0.5153, +0.1237, -0.9643, -0.6672,
-0.1510, +0.4786, -0.0686, +0.1789, -0.3273, -0.1779, +0.0177,
+0.1571, +0.1606, +0.1549, -0.4766, -0.9026, +0.0653, +0.0868,
+0.0621, -0.7266, -0.3686, +0.3382, +0.2308, +0.6874, +0.1348,
+0.4977, -0.5859, -0.2626, -0.3469, +0.1516, +0.0895, -0.2519,
-0.2592, -0.1837, -0.2296, +0.1767, -0.5679, -0.1375, -0.5070,
-0.6382, -0.1374, +0.5779, +0.4514, +0.1180, -0.2327, -0.4522,
-0.3484, -0.0035, +0.7310, +0.0454, +0.8697, +0.1059, -0.3448,
-0.2883, +0.6039, -0.3576, +0.1361, -0.1209, -0.4024, +0.1768,
-0.5684, -0.3368
],
[
-0.0751, +0.7339, +0.0408, -0.1337, -0.9369, +0.5861, +0.0524,
+0.0775, +1.0767, +0.3343, +0.3302, +0.5541, -0.4625, +0.0849,
-0.8359, -0.4253, +0.6121, +0.1737, -0.3291, +0.2212, -0.3580,
-0.0990, -0.7006, -0.1041, -0.0072, +0.7889, -0.3767, -0.0867,
-0.1271, -0.1077, -0.1127, -0.2207, -0.8218, -0.3934, -0.2509,
+0.4139, +0.1033, +0.0888, +0.0886, -0.5549, +0.0095, -0.4237,
+0.1985, +0.4558, -0.1326, +0.0703, -2.2189, -0.6442, +0.3691,
-0.7504, -0.5856, +0.0930, -0.8067, +0.1189, +0.1913, +0.1365,
-0.4218, +0.2168, +0.3196, -0.3373, +0.3003, -0.4674, +0.0712,
+0.0123, -0.1566, -0.0622, -0.1992, -0.3691, -0.5824, +0.2877,
-0.2970, -0.2558, -0.3782, -0.2703, +0.0438, -0.6318, -0.3175,
-0.5792, +0.2643, +0.3303, -0.2036, +0.2678, -0.1222, -1.0226,
+0.0067, -0.0072, +0.5945, -0.1497, -0.9653, -0.3418, -0.5937,
-0.4764, +0.5599, -0.0670, +0.3942, +0.1478, -0.6724, -0.4065,
-0.7034, -0.7214, +0.0970, +0.2242, -0.1217, +0.0651, +0.0720,
-0.5892, +0.4075, +0.1377, -0.3125, -0.3514, -0.2487, +0.0044,
-0.1191, +0.6080, +0.3778, -0.2010, -0.0943, -0.0418, -0.7266,
-0.1643, -0.9309, +0.2203, -0.0052, -0.1801, -0.0985, -0.3393,
+0.0116, -0.6730
],
[
+0.1655, +0.5211, +0.1849, +0.2302, +0.0248, +0.0857, +0.4936,
+0.2880, -0.2824, -0.4684, -0.4457, +0.1313, -0.6796, +0.4019,
-0.4805, +0.3073, +0.1115, +0.4333, +0.3163, -0.0816, -0.1883,
-0.7356, +0.2636, +0.0995, -0.4038, -0.1299, +0.0056, -0.2588,
-1.1740, -0.0212, +0.1199, -0.0595, -0.1753, -0.2451, -0.5145,
+0.6284, +0.4209, +0.2919, -0.3954, +0.1508, -0.6492, +0.3991,
-0.2702, +0.1863, -0.3409, -0.2513, +0.2952, -0.5227, +0.2080,
-0.6887, -0.1140, -0.0634, +0.1080, -0.0947, +0.0752, -0.1845,
-0.0627, +0.1679, +0.6477, +0.5071, +0.1089, -0.4251, -0.5890,
-0.2697, -0.4606, +0.1704, -0.2831, -0.7625, -0.6498, +0.1262,
-0.0748, +0.1890, +0.4346, -0.2856, +0.1777, +0.2118, -0.1639,
+0.0903, +0.2122, +0.0529, -0.0736, +0.5409, -0.1846, -0.2421,
+0.4487, +0.2775, +0.5984, -0.2293, -0.7922, +0.2889, -0.0407,
-0.8344, -0.1089, +0.3043, -0.0466, -0.1661, -0.5346, +0.6690,
-0.3531, -0.5414, +0.4480, +0.4577, +0.0423, +0.3368, -1.8731,
+0.0042, +0.0487, -0.2900, +0.0695, -0.9501, -0.4540, +0.2717,
+0.3854, -0.0282, -0.1735, +0.0998, +0.0670, -0.3067, +0.2340,
-0.1544, +0.2871, -0.1017, -0.2588, +0.0652, +0.0129, -0.2747,
+0.4155, +0.3013
],
[
+0.2223, -0.9679, +0.0401, +0.2288, +0.2322, -0.5094, +0.1492,
-0.6846, -1.2302, -1.1388, -0.6790, +0.4103, -0.6791, +0.1317,
-0.0930, -0.3675, +0.0592, -0.1658, -0.6330, +0.3715, +0.4643,
+0.1644, -0.1344, +0.4981, +0.1944, -0.8210, +0.0189, -1.2005,
-0.4496, -0.0847, -0.0119, +0.5595, -0.3832, -0.4543, -0.2933,
-0.1109, +0.0720, -0.0590, -0.2404, +0.0776, +0.5052, -0.0757,
-0.0339, -1.3568, -0.4457, -0.1594, -0.9628, -0.2158, -0.3825,
+0.3444, +0.0402, -0.2147, -0.2908, -0.3348, -0.1453, -0.3531,
+0.2931, +0.1324, +0.0639, +0.3645, +0.2742, -0.4940, +0.0532,
-0.1737, -0.0905, -0.3756, +0.1394, +0.4191, +0.3998, -0.4623,
-0.7704, +0.3675, +0.3252, -0.6931, -0.4788, -0.1673, -0.8348,
-0.3218, -0.0130, -0.3295, +0.2809, -0.2567, -0.1624, -0.4012,
+0.4326, -0.3862, -0.6991, +0.1055, +0.7961, +0.0076, -0.2748,
-0.3902, +0.2232, +0.1281, -0.3812, +0.3097, -0.4672, -0.3840,
-0.6258, +0.5342, +0.2299, -0.6102, -0.1629, +0.4811, +0.4830,
+0.4507, +0.2669, -0.6992, +0.2315, +0.2384, +0.2729, +1.0647,
-0.2825, -0.3955, -0.0508, -0.4677, +0.1125, +0.2005, -2.1221,
-0.4147, +0.7121, +0.0425, +0.1868, +0.1919, +0.2679, -0.3342,
-0.0763, +0.1073
],
[
-0.0654, -0.1073, -0.5421, -0.2829, +0.6467, +0.2590, -0.3870,
-0.8888, -0.1084, +0.5274, +0.1781, -0.0704, -0.4214, +0.2349,
+0.2373, -0.5531, -0.2668, -0.6312, -0.2647, +0.0704, -0.4293,
-0.7401, +0.3813, +0.1831, +0.1679, -0.4934, -0.0593, -0.3502,
-0.2770, -0.0854, +0.0259, -0.1256, -0.5697, -0.1773, -0.3519,
+0.4235, -0.0044, +0.5315, +0.2296, +0.3223, -0.2340, +0.3053,
-0.5114, +0.1810, +0.1124, +0.3993, +0.4845, +0.2141, -0.3139,
-0.0677, +0.3592, +0.1048, -1.2924, -1.0374, +0.8679, +0.5891,
+0.3809, -0.3269, +0.0119, -0.1475, -0.0078, +0.1639, +0.4512,
-1.1933, -0.1273, -0.2329, +0.1390, +0.0104, -0.0103, +0.2769,
+0.0931, -0.2808, +0.2999, -0.0588, -0.3744, -0.3424, -0.2338,
-0.2979, -0.3278, +0.3907, +0.2448, +0.0403, +0.1301, +0.0081,
-0.6344, -0.4866, -0.1352, -0.8317, -0.6158, +0.5084, -0.7984,
+0.3205, +0.1955, -0.3610, +0.1183, +0.1329, -0.3594, +0.3290,
-1.1694, -0.2003, +0.0781, -0.0032, +0.4619, -0.1056, -0.7916,
-0.5779, +0.6348, -0.0596, +0.4251, -0.5653, -0.1052, +0.1622,
-0.4602, -0.6598, +0.1516, +0.2682, +0.4577, +0.1530, -0.2461,
+0.0172, -1.3133, -0.0957, -0.1072, -1.1757, +0.2277, +0.2722,
-0.0490, +0.1136
],
[
-0.2706, -1.2512, +0.2696, -1.0084, +0.3117, -0.5319, -0.3465,
-0.0488, +1.0287, +0.1097, -0.3625, -0.0389, -0.2479, -0.3738,
+0.3461, -1.6060, +0.2601, -0.4393, -0.7228, -0.2388, +0.2520,
-0.0927, -0.0280, -0.1029, +0.3711, -0.3085, +0.0205, -0.1936,
-0.9044, -0.0753, -0.4208, -1.5043, +0.0190, -0.2815, -0.1377,
-0.6180, -0.1372, -0.1862, -1.2507, +0.0372, +0.3842, -0.6174,
+0.4050, +0.6584, -0.4990, -0.1768, -0.1160, -0.8179, -0.2810,
-1.1368, -0.0725, +0.2794, -1.3444, -0.7596, -0.7320, +0.0897,
+0.4123, +0.5142, -0.0750, +0.1239, +0.1268, +0.1203, +0.4617,
+0.0976, +0.1864, -0.0440, +0.0886, +0.1883, -0.5202, +0.3451,
-0.3070, +0.2383, -0.0104, +0.2111, +0.3925, -0.7099, +0.3812,
+0.3015, +0.1315, -1.3199, +0.4941, +0.1706, -0.2051, -0.8561,
+0.1534, -0.1699, +0.0855, -0.2844, +0.1083, -0.0424, -0.8068,
+0.3341, +0.2707, -0.7211, -0.5140, +0.1177, +0.1067, +0.2696,
-0.7588, +0.5373, -0.0774, +0.0413, -0.2777, -0.1816, +0.0809,
-0.3440, -0.0609, +0.1262, -0.7086, +0.0860, -0.6973, +0.0434,
-0.0279, -0.7123, -0.2715, +0.0866, -1.0773, -0.6588, -0.5664,
-0.0048, +0.1432, -0.4712, +0.9000, -0.7647, +0.3333, -0.4572,
-0.0580, -0.3291
],
[
-0.1489, +0.5402, +0.6031, -0.2599, +0.3752, +0.4728, +0.1931,
+0.0208, +0.1361, -0.7378, -0.7793, -0.4287, -0.3272, -0.2295,
+0.1028, +0.1304, -1.4411, -0.3225, -0.1984, -0.0057, +0.3592,
-0.0134, +0.3944, -0.0920, +0.3960, +0.0392, -0.5262, +0.3807,
-0.6193, -0.8345, -0.7070, -0.1297, -0.0611, +0.0396, +0.0453,
+0.6339, +0.5192, +0.4388, +0.4164, -0.2803, +0.1011, -0.2051,
-0.0662, +0.1686, -0.0033, -0.2948, +0.4392, +0.3964, +0.0259,
+0.1745, -0.0610, +0.0383, -0.4387, -0.7948, +0.0140, -0.3424,
+0.6568, -0.3117, -0.8600, +0.0046, -0.7629, -0.2124, -0.1618,
-0.0903, -0.0160, -0.1507, -0.3717, +0.4397, -0.5954, +0.0672,
+0.0663, -0.1411, -0.1637, +0.6175, -0.1576, -0.3223, -0.1278,
-0.3660, +0.1637, +0.7346, +0.4341, +0.3055, +0.1026, +0.0186,
+0.0550, +0.2911, -1.2892, -1.2114, -0.1807, -0.0828, -0.2480,
-0.2462, -0.2581, -0.7757, +0.2902, +0.0266, -0.2626, -1.7307,
-0.3781, -0.1001, +0.3482, -0.8434, +0.2130, +0.0520, -1.4175,
+0.1837, -0.2961, -1.0314, -0.7599, +0.3381, +0.6051, +0.5653,
+0.0906, -0.1182, -0.0302, -0.3867, -1.0201, -0.2550, -0.3505,
+0.4122, -0.0611, -0.1809, -1.3066, -0.4740, +0.0075, -0.2133,
+0.0619, -0.1811
],
[
+0.4725, -0.6903, +0.1069, -0.2764, -0.4829, +0.1424, -0.4064,
-0.7198, +0.0647, -0.1901, +0.5348, -0.2738, -0.2990, -0.3179,
-0.0097, -1.5312, +0.5687, +0.1389, -0.4395, -0.3930, +0.5095,
-0.1703, -0.1827, +0.0805, +0.4156, +0.3704, -0.1195, -0.1711,
+0.2741, +0.3656, -0.2913, -0.8413, +0.1128, -0.0996, +0.5234,
+0.1482, +0.4244, -0.4038, -0.2496, -0.0959, +0.0538, -0.4928,
-0.3236, -0.3246, +0.2523, +0.0080, +0.1540, -0.5401, -0.4358,
+0.5393, -0.7050, +0.5095, -0.1597, -0.6963, -0.5342, -0.4408,
+1.3109, -0.1664, -0.3779, -0.9932, +0.2030, +0.9412, -0.3152,
+0.1530, +0.2447, -0.4332, -0.1578, -0.9264, -1.2485, +0.1622,
+0.5076, -0.6892, -0.0615, +0.1607, -1.5503, +0.0253, +0.6621,
+0.5765, -0.7294, -0.3851, -0.2190, -0.7339, -0.7382, -0.1852,
+0.1626, -1.1072, -0.3674, -0.7856, -0.0389, -0.0732, -1.1486,
-0.4915, +0.3573, -0.0292, +0.4741, +0.2513, +0.5534, +0.3612,
-0.8750, -0.8013, +0.4614, -1.1983, -0.0763, +0.5898, +0.5711,
+0.2504, -0.4979, +0.0021, -0.4765, +0.0824, -0.1976, -0.4295,
+0.3984, -1.3600, -0.1005, -0.4039, +0.1267, +0.2414, -0.3044,
-0.9220, -0.8115, +0.2719, +0.0273, +0.2470, -0.3792, -0.3335,
+0.0905, +0.5115
],
[
+0.2076, +0.0608, +0.1159, -0.2067, -0.4900, -0.1953, -0.1437,
+0.4170, -0.0335, -0.0583, +0.0487, -0.3439, -0.5721, +0.3095,
+0.1239, +0.1339, +0.3199, +0.2520, -0.8602, -0.1184, +0.3002,
+0.1484, -0.0931, -0.2876, -0.4837, -0.2327, -0.3427, -0.1833,
-0.2469, +0.2013, +0.3121, +0.2055, +0.2293, -0.5355, +0.1646,
-0.0459, +0.1082, -0.1895, -0.2310, -1.0031, +0.2505, -0.0454,
-0.3693, -0.1980, +0.6906, -0.0510, -0.2170, +0.3851, +0.3530,
-0.2247, -0.1184, -0.1441, +0.6583, +0.1746, +0.1381, +0.3182,
+0.1797, +0.4545, -0.3327, +0.3556, -0.4037, -0.6595, +0.2673,
-0.0412, +0.4172, +0.3935, -0.0065, +0.0560, +0.2428, +0.3260,
-0.6168, -0.0381, -0.6579, -0.2867, -0.1551, +0.3825, -1.0231,
-0.0084, +0.1505, -0.2083, -0.3050, +0.3750, -0.3108, -0.4509,
-0.0301, +0.2131, -0.3729, +0.3262, -0.0628, -0.2456, -0.1833,
-0.1106, +0.2168, -0.3768, +0.2713, +0.5294, -0.2034, +0.0242,
-0.6079, -0.1576, +0.2150, +0.2100, +0.4975, +0.1428, -0.1845,
+0.3099, +0.2005, +0.0964, -0.2774, -0.1429, -0.2301, -0.0242,
+0.3992, -0.2053, +0.1651, -0.0676, -0.0708, -0.1506, -0.5444,
+0.2067, -0.1700, -0.2707, -0.1692, +0.1861, -0.0041, -0.0532,
+0.0183, +0.2384
],
[
-0.6375, +0.3651, +0.2436, +0.1752, -0.1460, -0.0626, +0.4601,
+0.0446, -0.1151, +0.3228, -0.1859, +0.1703, +0.2150, +0.0290,
-0.0694, +1.0209, +0.8811, +0.0272, -0.0669, +0.1925, +0.0989,
-0.8075, +0.1572, -0.3682, -0.0514, -0.0063, +0.2538, -0.4736,
-0.7416, -0.1268, +0.4847, -0.3042, -0.3548, -0.4044, +0.0744,
-0.0751, -0.0986, +0.1080, +0.1435, -0.8579, +0.0235, -0.4297,
+0.2014, -0.0363, +0.1568, -0.1170, +0.3229, +0.4236, +0.2343,
-0.0142, +0.1517, +0.3264, -0.2739, -0.1967, -0.8886, -0.0304,
+0.4113, +0.2752, -0.2778, -0.3894, -0.3228, -0.1496, +0.3176,
-0.0606, +0.6366, +0.0869, -0.4706, -0.0623, +0.4748, -0.4167,
-0.2650, -0.1523, -0.0372, -0.5838, -0.3944, -0.1141, -0.2120,
-0.1428, -0.8031, +0.7924, +0.0753, +0.2618, -0.6083, +0.0661,
+0.0275, +0.0300, +0.2161, +0.7156, +0.1853, +0.0142, +0.7981,
+0.1379, -0.1876, +0.3035, +0.0018, +1.0314, +0.0758, -0.1061,
+0.1913, -0.1958, -0.0590, -0.5442, +0.6021, +0.3196, +0.2609,
+0.1737, -0.0722, -0.2525, -0.4437, -0.0467, +0.2741, -0.0649,
-0.1994, -0.2601, -1.0840, -0.0605, +0.2686, -0.1046, +0.4438,
-0.5226, +0.1733, -0.4228, -0.5853, +0.3934, -0.0476, -0.3616,
-0.2780, -0.1258
],
[
+0.6867, +0.4724, +0.3292, -1.1454, -0.2058, +0.4164, +0.2246,
+0.0381, -0.5152, +0.8548, +0.4807, +0.2806, -0.2856, -0.3538,
+0.2281, +0.9878, -0.2247, +0.6616, -0.1019, +0.3186, -0.6905,
+0.0708, +0.5357, -0.1032, -0.7422, -1.2644, -0.4052, +0.6192,
-0.1329, -0.2649, +0.5382, +0.4912, -1.2289, +0.0261, -0.3315,
+0.0534, -0.5083, -0.1222, +0.4136, -0.4186, -0.6623, +0.0077,
-0.1184, -0.6798, -0.4292, -1.3118, +0.0811, -0.0773, +0.3190,
-0.6695, +0.5506, +0.6003, -0.5128, -0.4308, -0.2475, +0.8333,
-0.7603, +0.1938, +0.3206, +0.1851, -0.0911, -0.2287, +0.6717,
-0.0226, -0.6560, -0.3719, -0.4950, +0.2135, +0.1312, -0.1219,
+0.2059, +0.4192, +0.5512, +0.4458, +0.0162, -0.1117, +0.2476,
+0.3416, +0.1183, +0.1549, -0.2135, -0.6936, +0.3073, +0.3932,
-0.3390, +0.8693, +0.3992, +0.5370, +0.5329, +0.6200, +0.2953,
+0.0928, +0.3588, -1.3759, +0.1482, -0.0664, +0.3160, +0.4801,
+0.4890, +0.3038, -0.6116, +0.1161, -0.3446, -0.3424, -0.1681,
+0.1677, -0.6294, -0.9320, -0.4076, +0.2937, +0.6234, +0.0829,
-0.8659, -0.2892, -0.2668, -0.7057, +0.5845, +0.2654, -0.6165,
+0.0247, -0.2863, +1.0240, +0.0559, -0.2702, +0.2465, -0.3120,
-0.4070, +0.0242
]])
weights_dense2_b = np.array([
+0.0589, +0.2417, -0.0986, +0.1092, +0.0381, +0.2114, +0.2297, +0.1468,
-0.1559, -0.1759, +0.0344, +0.3008, +0.3244, +0.3597, +0.1691, +0.0277,
+0.0064, +0.2372, +0.0961, +0.3293, +0.2077, +0.1230, +0.1195, +0.4294,
+0.2816, +0.1169, +0.4083, +0.0309, +0.0433, +0.4852, +0.1903, +0.1055,
+0.2894, +0.0468, +0.0669, +0.1655, -0.0712, +0.2791, +0.3653, +0.1661,
+0.0730, +0.4481, +0.2336, +0.4547, +0.3048, +0.3674, +0.1072, +0.2519,
+0.0875, +0.1864, +0.0793, +0.1467, +0.1665, -0.0635, +0.2464, +0.2529,
+0.2301, +0.3551, +0.1974, +0.5505, +0.1776, +0.0702, -0.0460, +0.1697,
-0.0007, +0.0430, +0.2190, +0.3566, +0.2163, +0.2470, +0.1928, -0.0373,
+0.3103, +0.1705, +0.0386, +0.1008, +0.0483, -0.0530, +0.0899, +0.1354,
+0.2905, +0.0686, +0.2512, +0.4373, +0.2106, +0.2685, +0.2320, +0.0750,
+0.4447, +0.2390, -0.0136, +0.0224, +0.1565, -0.0579, -0.0142, +0.0710,
+0.2252, +0.1527, +0.3315, +0.1419, +0.3483, +0.3999, +0.2818, +0.1021,
+0.2659, +0.2742, +0.0814, +0.0849, -0.0068, +0.1339, +0.1216, +0.0148,
+0.0219, -0.0728, +0.2957, +0.0854, +0.0055, -0.0289, +0.0866, +0.0203,
+0.0353, +0.2069, +0.3297, +0.1171, +0.0607, +0.1667, +0.5721, -0.0218
])
weights_final_w = np.array(
[[
+0.1312, +0.2606, +0.0873, -0.2167, -0.0211, -0.2425, -0.2365, +0.0256,
-0.0525, -0.1167, +0.0605, +0.1389, -0.0801, -0.2973, +0.1066, +0.0129,
+0.0549
],
[
+0.0107, +0.1381, +0.0126, -0.0227, +0.0100, -0.1605, -0.4347,
-0.2622, -0.3952, +0.1417, -0.0394, -0.0345, -0.1321, +0.0973,
+0.0614, -0.1857, +0.0101
],
[
+0.0489, +0.0031, -0.2181, +0.2105, +0.2968, -0.2446, +0.0639,
-0.2621, -0.0567, +0.0232, +0.1381, +0.2903, -0.1861, -0.4347,
+0.5889, +0.1608, +0.3169
],
[
+0.2935, +0.0971, -0.1493, +0.0123, -0.3232, +0.1984, -0.1904,
+0.0674, -0.1251, -0.1421, -0.2297, +0.1642, +0.4883, +0.1015,
+0.0046, -0.1664, -0.1933
],
[
+0.0655, -0.0136, +0.1110, -0.0768, +0.0236, -0.0335, +0.2260,
-0.4519, -0.0795, -0.3457, +0.0667, -0.3201, +0.3744, -0.0273,
+0.2743, +0.0971, -0.1144
],
[
-0.3984, +0.0525, -0.0927, -0.1104, +0.0242, +0.2294, -0.0730,
-0.2585, -0.1027, -0.1138, -0.0855, +0.2366, -0.1895, -0.1304,
-0.4098, +0.2590, -0.0564
],
[
-0.0326, +0.0244, +0.3413, +0.2870, +0.1252, -0.0921, +0.4718,
+0.1316, -0.0767, -0.1213, -0.0975, +0.0160, -0.0676, +0.0719,
+0.3433, +0.1957, +0.2411
],
[
+0.1805, -0.0909, +0.1841, +0.0092, +0.0334, -0.0274, -0.1892,
-0.1136, -0.1936, -0.0776, +0.0088, -0.5994, -0.0894, +0.0054,
+0.0222, -0.5486, +0.0794
],
[
+0.1231, -0.1501, +0.1568, -0.0432, +0.2135, -0.0308, -0.1665,
+0.1327, -0.0055, +0.0054, -0.2374, -0.1399, +0.5330, +0.3818,
+0.0111, +0.3729, -0.3116
],
[
+0.0443, +0.0425, -0.2333, -0.0758, +0.0445, -0.0364, -0.1385,
+0.4477, +0.2164, +0.0454, -0.1320, -0.3380, +0.5406, +0.0488,
-0.2379, +0.1216, -0.0559
],
[
-0.4501, +0.1921, +0.0992, -0.2644, +0.0216, -0.0723, +0.0213,
-0.1043, -0.0775, +0.2790, -0.2341, +0.0725, +0.0472, -0.0021,
-0.1217, -0.1285, -0.2625
],
[
-0.0878, -0.1506, -0.2460, +0.1033, -0.0043, -0.1535, -0.0529,
+0.1674, +0.0078, +0.3391, +0.8355, +0.0874, -0.0233, +0.1923,
+0.0359, +0.1081, +0.1508
],
[
-0.3796, +0.0832, -0.2270, +0.1005, -0.1703, +0.0832, +0.0064,
+0.1643, +0.0637, -0.1930, +0.0365, -0.0470, +0.1059, -0.1114,
+0.1208, -0.3628, +0.2056
],
[
+0.2360, +0.0879, -0.1799, -0.0360, +0.1466, -0.3555, +0.0957,
-0.0095, +0.2665, +0.5403, -0.5690, -0.0800, -0.3047, +0.1044,
+0.0053, -0.0098, -0.2020
],
[
-0.1021, -0.0576, +0.5277, +0.3862, -0.2923, -0.1565, +0.3422,
+0.2636, +0.1655, +0.1700, +0.1921, -0.6448, -0.2882, +0.2176,
-0.2975, +0.4688, +0.0548
],
[
+0.1350, -0.0520, -0.0243, -0.1268, +0.2160, +0.0838, -0.2554,
+0.1928, -0.0042, -0.0117, +0.3009, -0.3786, -0.3108, -0.0581,
+0.2374, +0.2102, +0.0998
],
[
+0.1258, +0.1091, +0.3406, +0.3366, +0.2269, -0.1391, -0.1218,
+0.1913, -0.0044, +0.1850, +0.2097, -0.2372, -0.2832, -0.0987,
+0.1170, +0.0516, -0.1875
],
[
-0.0902, +0.2603, +0.3307, +0.1615, -0.0565, -0.3079, +0.0315,
+0.0874, +0.0755, +0.7551, -0.1873, +0.2390, -0.1559, +0.0447,
-0.0154, +0.0343, +0.1431
],
[
-0.1310, -0.0000, +0.1157, -0.4601, -0.2381, +0.1276, -0.1355,
+0.0909, -0.2596, +0.4611, +0.5581, +0.1119, -0.2449, -0.1039,
+0.1356, -0.1378, +0.1854
],
[
-0.2234, +0.1488, -0.0868, -0.0221, -0.2624, +0.5707, -0.4488,
-0.0552, +0.1251, +0.0740, +0.0574, +0.3261, +0.0011, -0.0559,
+0.0850, +0.1478, -0.0575
],
[
-0.1547, -0.2551, -0.2269, -0.0155, +0.2671, +0.2239, +0.0401,
-0.0152, -0.2506, -0.0510, -0.0408, -0.1499, -0.3132, -0.0916,
+0.0558, -0.1317, -0.1131
],
[
-0.3986, +0.0452, +0.0059, +0.0143, +0.3271, -0.2273, -0.1940,
+0.1802, -0.0765, -0.3095, +0.0365, +0.0157, +0.1850, -0.2821,
+0.0505, -0.0141, +0.0334
],
[
-0.1405, -0.1715, +0.2472, +0.0586, +0.2633, +0.0251, +0.0151,
+0.5158, -0.0045, -0.0354, +0.3007, +0.3528, +0.1331, -0.0457,
-0.1532, +0.1718, -0.0002
],
[
-0.2526, +0.0306, -0.2338, +0.0557, -0.0416, -0.2174, +0.2027,
+0.1293, +0.0471, -0.4165, -0.0245, +0.0312, -0.2050, +0.2281,
+0.0194, -0.0756, -0.1017
],
[
+0.2395, -0.0035, -0.0206, +0.2011, -0.0853, +0.1665, -0.2279,
-0.2057, +0.0230, -0.2693, -0.0173, -0.0095, +0.1317, -0.1597,
+0.3547, +0.0186, +0.1017
],
[
-0.1807, +0.0229, +0.1314, -0.0384, +0.1618, +0.1776, +0.2824,
+0.1815, -0.0702, +0.1897, +0.1154, -0.1015, +0.3698, +0.0610,
+0.2967, -0.1962, +0.0017
],
[
-0.0074, +0.2953, -0.2820, +0.1022, +0.3167, +0.4200, -0.0643,
+0.1692, +0.1454, -0.4422, -0.0188, +0.0325, -0.0591, +0.0319,
+0.0870, -0.1527, -0.1347
],
[
-0.2557, +0.0643, -0.0250, -0.0358, -0.2493, -0.1554, +0.1479,
+0.2026, -0.3371, -0.1351, +0.1498, +0.0373, +0.4199, +0.0188,
-0.2702, +0.0521, +0.0950
],
[
+0.1081, -0.4271, +0.0690, -0.3374, -0.0935, -0.1386, -0.0240,
-0.0407, +0.4000, +0.1332, -0.2086, +0.7726, +0.0442, +0.0718,
-0.2187, -0.1867, -0.0762
],
[
-0.2350, -0.1500, +0.1550, +0.1218, +0.0389, +0.1064, -0.0495,
+0.1717, -0.0759, -0.2376, -0.2130, -0.0091, -0.0250, -0.2824,
+0.0911, -0.1364, -0.1061
],
[
-0.1212, +0.4204, -0.0501, +0.0208, -0.2520, +0.2076, +0.0444,
+0.1458, -0.0982, -0.0022, +0.2173, +0.2447, -0.0222, -0.0018,
-0.0566, +0.2430, -0.0905
],
[
+0.1643, -0.2400, -0.1019, -0.1235, +0.2953, +0.1080, -0.0416,
+0.0763, -0.1258, -0.1884, -0.3330, +0.2187, -0.2763, -0.1867,
-0.2056, -0.2271, +0.1966
],
[
-0.4632, +0.1782, +0.2223, -0.3054, -0.0924, -0.2057, +0.0089,
+0.2455, +0.3828, +0.1087, -0.1154, +0.0237, -0.3203, -0.0789,
+0.0756, +0.1260, +0.0117
],
[
-0.0527, -0.1818, +0.0755, +0.0768, -0.0594, +0.1384, +0.0534,
-0.5923, +0.4133, +0.1154, -0.2839, -0.0294, +0.0174, +0.1350,
+0.1564, +0.1622, -0.0221
],
[
-0.1845, -0.0040, +0.0629, +0.0127, +0.2480, +0.3868, -0.1440,
+0.2099, +0.0125, -0.1419, -0.0316, -0.1121, -0.1147, +0.1579,
-0.1398, -0.3699, -0.2407
],
[
-0.3024, -0.4112, +0.3517, -0.1744, +0.0442, +0.1175, +0.1120,
+0.0313, -0.1000, -0.1217, -0.3270, +0.1557, +0.0458, +0.0634,
+0.1686, +0.0292, +0.0342
],
[
+0.0055, +0.0122, +0.0775, +0.0206, -0.2969, +0.1358, -0.2017,
-0.0757, -0.3607, -0.2885, -0.3357, +0.0148, -0.0613, -0.3099,
-0.2110, +0.4725, -0.0229
],
[
-0.0870, +0.2184, -0.0565, +0.1654, -0.1285, +1.1648, +0.5389,
-0.2226, -0.2618, -0.4095, -0.3999, -0.1014, +0.0956, +0.1682,
+0.0492, +0.2601, +0.0474
],
[
-0.2767, +0.0553, +0.0306, +0.0024, -0.0094, +0.1389, -0.1430,
+0.0036, +0.4679, +0.1425, -0.2145, -0.0646, +0.0081, -0.0832,
-0.1137, -0.0659, +0.1728
],
[
-0.3456, +0.2478, -0.0933, -0.2658, +0.0159, +0.0989, -0.1268,
-0.1793, -0.2511, -0.1328, -0.2603, -0.1707, +0.1464, +0.2335,
-0.1048, -0.3861, +0.3799
],
[
+0.0906, -0.2603, +0.1179, +0.1688, -0.2237, -0.0822, +0.0288,
+0.2402, +0.0442, +0.1249, -0.2379, +0.0698, -0.0972, -0.0560,
-0.1527, +0.0879, -0.0982
],
[
+0.1656, -0.1126, -0.3280, -0.1454, -0.1580, -0.2798, +0.0980,
+0.1962, +0.0373, -0.3712, +0.6412, -0.0309, +0.0066, +0.0889,
-0.0277, -0.3184, +0.1719
],
[
-0.3050, +0.1695, -0.2984, +0.3151, -0.1415, +0.0532, +0.0595,
+0.2024, +0.1260, +0.1307, -0.0846, -0.0340, +0.0356, +0.2450,
-0.0064, +0.3211, +0.1223
],
[
+0.2064, +0.0314, -0.7182, -0.0014, +0.4533, -0.0736, -0.4364,
+0.1237, +0.1503, +0.1236, -0.0738, +0.2819, +0.2560, -0.1169,
+0.1758, -0.4164, +0.0911
],
[
+0.1323, +0.0817, -0.0994, -0.3297, +0.0779, -0.0238, +0.1504,
+0.0698, +0.1012, +0.1071, -0.5144, -0.1897, -0.1890, -0.0724,
-0.0617, -0.0274, +0.2011
],
[
-0.0281, -0.2267, -0.3032, +0.2410, +0.0516, -0.2491, -0.3050,
-0.1812, +0.2029, +0.3053, +0.4205, -0.2745, -0.0210, -0.0765,
-0.0071, -0.1102, -0.1442
],
[
+0.0010, -0.0779, +0.3468, +0.4334, +0.1432, +0.1585, -0.1131,
-0.0239, -0.0272, -0.0349, +0.0364, +0.2644, -0.3331, +0.1804,
-0.5429, -0.2642, +0.2148
],
[
-0.1210, +0.6697, -0.0792, -0.2096, -0.0938, +0.1053, -0.3676,
+0.1888, +0.0033, +0.0138, -0.1001, +0.0124, -0.4953, -0.2625,
+0.4315, +0.1741, +0.0748
],
[
+0.3386, -0.0625, +0.2074, -0.0791, +0.4092, -0.1314, +0.0619,
+0.0787, -0.0088, +0.0886, -0.1326, +0.4888, -0.1590, -0.0694,
+0.3429, -0.1274, +0.0160
],
[
-0.0111, -0.2156, +0.1449, +0.2451, +0.1138, +0.0158, -0.5589,
-0.2248, -0.1329, -0.4511, +0.1869, -0.0745, -0.3610, +0.1168,
+0.1185, +0.3343, -0.0786
],
[
-0.1221, -0.4784, -0.2020, -0.1611, -0.0048, +0.1330, -0.3143,
+0.0581, -0.0509, -0.4198, +0.2756, +0.1595, +0.3195, +0.0522,
-0.0918, +0.1170, -0.0423
],
[
+0.1040, +0.0353, -0.3103, +0.0942, +0.0581, +0.0454, -0.1175,
-0.0464, +0.0016, +0.3844, +0.4261, -0.2159, +0.0670, -0.0158,
-0.1561, +0.2365, -0.1176
],
[
-0.1606, -0.4301, +0.0624, -0.4848, +0.0412, -0.3168, -0.0772,
-0.0698, -0.2040, +0.3138, -0.2606, -0.0569, +0.1970, +0.1635,
+0.1485, -0.0893, -0.0093
],
[
-0.0691, +0.7319, -0.1740, +0.1397, +0.0422, +0.1841, +0.0551,
-0.1779, +0.0263, +0.2575, -0.1547, -0.0804, -0.0104, +0.1240,
+0.0396, +0.5363, -0.0852
],
[
-0.0874, +0.0740, -0.2354, +0.0765, +0.2228, -0.2960, -0.2207,
-0.1744, -0.0959, +0.2325, -0.5918, +0.0846, -0.0356, +0.0450,
-0.2203, +0.1262, -0.1228
],
[
-0.3480, +0.1078, +0.0365, +0.4309, -0.1477, +0.0616, -0.0769,
-0.0193, +0.0070, -0.1749, +0.2338, +0.0302, +0.2317, +0.0679,
+0.0253, +0.2287, -0.0449
],
[
-0.0917, -0.1148, -0.5216, +0.5428, +0.0322, -0.0604, -0.1308,
+0.1717, +0.2328, +0.1074, +0.0431, -0.3477, -0.1743, -0.0226,
+0.3206, +0.1525, +0.0347
],
[
+0.1605, +0.0369, +0.2022, +0.0722, -0.2906, +0.3964, +0.7451,
+0.0630, +0.0663, -0.0819, +0.0415, +0.1646, -0.1499, -0.1255,
+0.1425, -0.1912, -0.0421
],
[
+0.0196, +0.0653, -0.1871, -0.3252, -0.4638, +0.4087, -0.2621,
-0.7069, +0.1975, -0.3065, +0.2014, -0.0236, -0.0719, +0.2058,
-0.0210, -0.1895, -0.0760
],
[
+0.1401, +0.2856, -0.0084, -0.4474, -0.1189, +0.1954, +0.1608,
-0.1745, -0.4177, -0.3583, -0.2078, +0.0498, -0.1714, -0.0160,
-0.0649, -0.1105, +0.1325
],
[
+0.0479, +0.2704, -0.0470, +0.3404, -0.1584, -0.0478, -0.0354,
-0.0816, +0.3430, +0.1074, +0.2332, -0.0058, -0.2567, -0.0425,
+0.1168, -0.3646, -0.0250
],
[
+0.4094, -0.5041, +0.2346, -0.1907, +0.2669, -0.2752, -0.1550,
-0.1642, +0.3191, -0.0082, +0.0502, -0.2870, -0.1683, -0.0697,
-0.3527, +0.3189, +0.1332
],
[
-0.2716, -0.0033, -0.2637, +0.0069, -0.2129, +0.2672, +0.0694,
-0.0430, +0.0637, -0.0555, -0.3187, +0.2670, -0.0308, +0.1458,
+0.2477, -0.2574, +0.0914
],
[
+0.2928, -0.0535, -0.0691, -0.0436, +0.0613, -0.0920, -0.1360,
+0.5571, +0.0624, +0.0410, -0.1896, +0.4296, +0.0266, +0.2580,
-0.2728, +0.0482, +0.0613
],
[
+0.0488, +0.2622, +0.1998, +0.2080, +0.1624, +0.2532, -0.2194,
+0.4212, -0.2253, +0.1078, -0.1612, +0.0316, -0.1959, +0.0955,
+0.1069, +0.2729, +0.0990
],
[
+0.2588, +0.0617, -0.0078, -0.3274, +0.1988, +0.0345, -0.0577,
+0.0777, +0.1154, +0.7071, -0.0287, +0.1041, +0.2812, -0.0966,
+0.1488, +0.1547, -0.0200
],
[
+0.1464, +0.1786, +0.1756, -0.0633, -0.1991, +0.0583, +0.3696,
-0.0610, -0.2088, +0.6352, -0.2822, -0.0619, +0.0712, +0.0683,
+0.0591, -0.1966, +0.0573
],
[
-0.0289, +0.5961, +0.2250, +0.1727, -0.1021, +0.0805, -0.6852,
-0.1022, +0.4412, -0.1102, -0.0573, +0.0108, +0.4795, -0.1854,
+0.1619, -0.3180, +0.0826
],
[
-0.1803, +0.0848, -0.1195, +0.2291, +0.0999, +0.1137, -0.2016,
+0.5933, -0.0431, +0.0807, -0.1362, -0.2669, -0.2680, +0.0616,
+0.3381, -0.1365, -0.0133
],
[
-0.0019, +0.1816, -0.2680, +0.0490, -0.1431, -0.0349, +0.1846,
+0.1512, -0.1755, +0.2003, -0.2616, -0.1497, +0.0726, -0.0063,
-0.2029, -0.3561, -0.1127
],
[
-0.0543, -0.0786, -0.1657, +0.3412, +0.2236, -0.0256, +0.1423,
-0.2476, -0.0579, -0.0400, +0.3387, +0.1397, +0.0693, -0.0978,
-0.0721, +0.0494, -0.1215
],
[
+0.3175, -0.0093, -0.0200, -0.1039, +0.1993, -0.2639, +0.2093,
-0.2860, -0.0647, +0.0382, -0.1736, +0.1920, +0.0989, -0.0879,
+0.3887, +0.1490, -0.2475
],
[
+0.1223, -0.0573, -0.1927, +0.0222, -0.2032, -0.1156, +0.1203,
+0.1252, +0.3434, -0.0309, +0.1683, -0.0745, -0.2512, -0.0162,
-0.2847, +0.0018, +0.2597
],
[
-0.2100, -0.0401, +0.3119, +0.0271, +0.0367, -0.2558, +0.3757,
+0.2703, -0.1604, -0.1646, -0.0853, -0.1255, +0.1305, +0.0554,
-0.0657, +0.3253, -0.2175
],
[
-0.1669, -0.1024, +0.3036, +0.1949, -0.4268, +0.2212, +0.2057,
-0.1204, +0.0223, -0.0924, +0.0152, -0.2183, +0.0476, -0.0045,
-0.1289, +0.0776, +0.1919
],
[
-0.1015, +0.1058, +0.3162, +0.2942, +0.2410, +0.1193, +0.1045,
-0.1116, -0.0550, +0.0776, -0.2475, +0.2624, +0.0536, -0.0720,
+0.1367, -0.1158, +0.1027
],
[
-0.3849, +0.3457, +0.0135, +0.0063, +0.2045, -0.0144, -0.0950,
+0.1271, +0.4600, -0.0311, +0.1044, -0.2487, +0.1230, +0.0327,
-0.3978, -0.3512, +0.2497
],
[
+0.2812, -0.0669, +0.1645, -0.0291, -0.0164, -0.1144, +0.2963,
-0.0595, -0.1484, +0.1771, -0.0079, -0.5441, +0.0339, +0.3036,
-0.2279, +0.1066, -0.2468
],
[
-0.0718, +0.5449, -0.0494, +0.1283, +0.2544, +0.1221, +0.0988,
+0.0028, +0.0135, +0.0904, +0.1348, +0.1037, -0.0058, +0.0007,
-0.0455, +0.1696, +0.1674
],
[
-0.2138, -0.3133, -0.3800, +0.0846, -0.0372, -0.2185, +0.0951,
+0.2048, +0.1555, +0.1266, +0.0414, +0.2256, +0.0326, -0.0332,
-0.0807, -0.3547, +0.2416
],
[
-0.0868, -0.0794, -0.2556, -0.3129, +0.0309, +0.1684, +0.3753,
+0.1522, +0.2974, -0.2167, +0.0158, +0.2495, +0.0596, -0.1184,
+0.0521, +0.2815, +0.1270
],
[
+0.0900, -0.1678, -0.0648, -0.0243, -0.1684, -0.2439, +0.0659,
+0.3151, -0.4868, +0.0200, -0.0563, -0.0812, +0.2157, -0.1118,
-0.0546, +0.1121, +0.1330
],
[
-0.1735, -0.0359, +0.1421, -0.0054, +0.1613, -0.0438, +0.7337,
-0.2124, +0.0604, +0.0033, +0.1450, -0.0176, -0.2187, -0.0204,
-0.2695, +0.0197, -0.0461
],
[
+0.0981, +0.2768, +0.0884, +0.5310, +0.1594, +0.4027, +0.1326,
-0.3091, +0.3588, -0.3596, +0.2099, +0.1202, -0.2811, -0.2679,
-0.3697, -0.1143, +0.0364
],
[
+0.1433, -0.1962, +0.1004, -0.0014, -0.1924, -0.2953, +0.0410,
+0.3597, +0.2484, +0.0705, -0.1239, +0.1030, +0.2636, +0.1599,
+0.0982, -0.0888, +0.0597
],
[
-0.0233, +0.0115, -0.6757, +0.2189, -0.0165, -0.4398, +0.5602,
+0.1727, -0.3657, +0.4095, +0.1018, +0.1222, -0.0591, -0.0114,
+0.2174, +0.2068, -0.2059
],
[
+0.1465, +0.3763, +0.2525, -0.0040, +0.1222, +0.0591, -0.2716,
-0.3108, +0.3361, +0.2440, +0.1371, +0.1249, -0.1091, +0.2130,
+0.4761, -0.0394, -0.1550
],
[
+0.0480, -0.4882, -0.0725, -0.3144, -0.2882, -0.0517, -0.0909,
+0.1522, -0.0457, -0.1458, -0.2927, +0.0594, -0.4833, -0.4030,
+0.1000, +0.0829, -0.1583
],
[
+0.2517, -0.1086, +0.2060, +0.1727, +0.0902, -0.1455, +0.1913,
-0.3011, +0.4524, -0.2250, -0.3558, -0.3009, -0.0365, -0.0636,
+0.0852, +0.1678, -0.0045
],
[
-0.0800, +0.2266, -0.0954, +0.0206, +0.1473, +0.6583, -0.4648,
+0.1038, +0.1741, -0.3025, +0.0773, +0.1044, +0.0888, -0.2105,
+0.1827, +0.0543, -0.0055
],
[
-0.0999, +0.0095, -0.0853, +0.0084, -0.2591, -0.0105, -0.3086,
-0.4188, -0.1658, +0.4141, +0.4294, -0.0325, +0.3242, -0.2091,
-0.2607, +0.1492, +0.1504
],
[
+0.0317, -0.0307, +0.3815, +0.0595, -0.1011, -0.0057, -0.1609,
-0.5363, -0.1927, +0.0689, -0.0432, +0.1582, +0.1995, +0.0791,
-0.0799, -0.0426, -0.0398
],
[
+0.2850, +0.2052, -0.0389, -0.0705, +0.3961, +0.0547, +0.0385,
+0.2505, +0.0714, -0.0159, +0.0321, +0.0161, +0.1245, -0.1221,
-0.2063, +0.0359, +0.0904
],
[
+0.2388, -0.0879, +0.0303, -0.1298, -0.2066, +0.2349, -0.1669,
-0.0393, +0.0557, -0.0419, -0.0636, -0.3270, -0.1898, +0.1185,
-0.1003, +0.2182, -0.1358
],
[
+0.1651, -0.2028, -0.3384, -0.5319, +0.2690, +0.0798, +0.3677,
+0.2660, +0.1497, +0.1026, -0.1128, +0.3130, +0.2733, +0.1554,
-0.1325, -0.1619, -0.0860
],
[
+0.1536, +0.0465, -0.1248, -0.0063, -0.1992, +0.0119, +0.0328,
+0.1646, -0.3838, +0.1776, -0.1014, +0.3482, +0.0298, +0.0296,
+0.1838, +0.1373, -0.1523
],
[
+0.0442, +0.1129, -0.3831, -0.1119, +0.0817, +0.1744, +0.2670,
+0.0339, +0.1102, -0.1592, -0.1006, -0.4853, +0.2444, +0.0459,
-0.1019, -0.1361, -0.0604
],
[
+0.1310, -0.0497, +0.2974, +0.2772, -0.2771, -0.2194, -0.0129,
-0.0623, +0.0006, -0.0298, +0.1518, +0.0271, +0.1619, -0.1267,
-0.1727, -0.1988, -0.1210
],
[
+0.3556, -0.3053, -0.3899, +0.2106, -0.1380, -0.2564, -0.0534,
-0.3945, -0.0198, +0.0277, +0.1276, -0.0327, +0.4129, +0.1444,
-0.3541, +0.2025, -0.0395
],
[
+0.1271, -0.1985, +0.3796, +0.0934, +0.2144, +0.0129, -0.2250,
-0.2218, -0.0024, +0.2304, -0.2798, +0.0901, -0.2428, +0.2513,
+0.1104, +0.2521, -0.0836
],
[
-0.0790, +0.3823, -0.1396, -0.3351, -0.1272, -0.2597, +0.0591,
+0.1499, -0.2298, +0.6025, +0.7618, -0.2407, +0.0333, -0.0403,
-0.0925, -0.3186, -0.1176
],
[
-0.1944, -0.2272, +0.3309, -0.0803, +0.3230, -0.1632, +0.6171,
-0.0997, +0.3684, -0.1963, -0.0740, +0.1319, +0.2760, -0.2500,
-0.0141, -0.3381, +0.0988
],
[
+0.2057, -0.1338, -0.1396, +0.1905, -0.0804, +0.0064, -0.1375,
+0.0256, +0.1821, +0.1315, +0.0442, +0.0899, -0.0152, -0.0606,
+0.1378, -0.5944, +0.0902
],
[
+0.3549, -0.1397, -0.1932, +0.0118, +0.0244, +0.0824, +0.1821,
-0.0512, -0.2780, -0.0666, +0.0240, -0.1947, -0.1455, +0.0940,
+0.0609, -0.2599, -0.0573
],
[
+0.0848, +0.0130, -0.3703, +0.1482, -0.0567, -0.2191, +0.0100,
-0.0555, -0.1383, +0.2142, -0.2411, -0.1008, -0.0247, -0.0685,
-0.6440, +0.5464, -0.2950
],
[
+0.0558, +0.0309, +0.2263, +0.4103, +0.0554, +0.3598, +0.1403,
+0.0423, -0.2540, -0.2593, +0.1508, +0.1841, -0.2731, +0.0649,
+0.3406, -0.1161, +0.2166
],
[
+0.0934, -0.2574, +0.1155, -0.0240, +0.0258, +0.1470, -0.0135,
+0.4334, -0.0167, -0.2294, -0.1428, -0.3680, -0.2007, -0.0010,
+0.1405, -0.4045, -0.0752
],
[
+0.3774, -0.3684, -0.1185, +0.3444, -0.0005, -0.2114, +0.1939,
-0.3012, +0.1912, +0.1980, +0.0747, +0.3322, +0.1122, -0.2042,
-0.2741, +0.1889, -0.0508
],
[
+0.1951, +0.0460, -0.2167, -0.2370, +0.1496, -0.2761, +0.2644,
-0.0282, -0.0858, -0.0368, +0.4173, -0.0596, +0.3189, +0.3252,
+0.3012, +0.2653, -0.1094
],
[
-0.0618, -0.1060, -0.0063, -0.1816, -0.0928, +0.1112, +0.2248,
-0.0704, +0.1565, -0.1376, -0.1280, -0.1405, -0.4444, -0.0081,
-0.3809, -0.2760, +0.2826
],
[
-0.2150, -0.2761, -0.4387, +0.0652, -0.0250, -0.1408, -0.1410,
-0.0401, -0.2530, -0.1720, -0.1383, +0.0815, +0.1345, +0.1094,
+0.1165, -0.1125, -0.0680
],
[
+0.4100, -0.2501, -0.1091, -0.1421, -0.1276, -0.0343, -0.2467,
+0.5050, -0.1084, +0.2873, +0.2955, -0.0441, +0.0624, -0.3208,
-0.1248, -0.2148, +0.0624
],
[
+0.2167, -0.2099, +0.1943, -0.0190, +0.1348, +0.0457, -0.0756,
-0.1493, -0.2804, +0.0296, -0.1222, -0.2076, +0.1460, +0.0056,
+0.0618, +0.0620, +0.1078
],
[
-0.1699, +0.1200, +0.0562, -0.2747, +0.2608, -0.3566, -0.2460,
-0.2062, +0.5545, -0.0188, +0.3313, -0.1312, -0.7428, -0.5009,
-0.6418, -0.0003, +0.2460
],
[
-0.2792, +0.1021, -0.2467, -0.0577, -0.1567, +0.0156, +0.0434,
-0.2623, +0.0924, +0.0685, +0.2042, +0.0532, +0.1473, -0.1451,
-0.0592, -0.1645, +0.1258
],
[
+0.0919, -0.0480, +0.3094, +0.1917, +0.0822, +0.0892, +0.0365,
-0.0325, +0.1961, -0.2383, -0.0073, +0.0189, +0.2700, +0.2116,
-0.2724, -0.1682, -0.1288
],
[
+0.1483, +0.0807, +0.2281, -0.3101, -0.0014, +0.0484, -0.2612,
-0.0005, +0.0087, -0.1544, +0.1201, +0.1475, -0.1714, +0.0190,
-0.2971, -0.1113, -0.4718
],
[
-0.1700, -0.1545, +0.2127, -0.1944, +0.3472, +0.2332, +0.2231,
+0.0469, +0.2023, -0.0298, -0.0297, +0.0597, -0.3039, +0.0959,
+0.2502, +0.2281, -0.0078
],
[
+0.3397, +0.2010, +0.6118, +0.2780, -0.0135, +0.4304, -0.2720,
-0.6300, +0.3764, +0.1227, -0.0925, +0.1188, -0.5911, +0.1235,
-0.1578, -0.4889, -0.1543
],
[
+0.4581, +0.2872, +0.1375, +0.2818, +0.2036, -0.0369, +0.0807,
-0.0667, -0.2801, -0.0582, +0.1936, +0.1047, -0.1245, -0.1259,
-0.1373, -0.1140, +0.0582
],
[
+0.2535, +0.5913, +0.2155, -0.0587, -0.0918, -0.0362, +0.7135,
+0.3591, +0.4240, +0.3692, -0.0313, -0.2431, +0.9143, -0.0241,
-0.6210, +0.4646, -0.1512
],
[
+0.3188, +0.2507, -0.2129, -0.4617, +0.1874, -0.1286, +0.0632,
-0.2470, -0.0572, +0.6183, +0.3531, +0.1321, -0.1687, +0.1307,
-0.3712, +0.0199, -0.0776
],
[
-0.1779, +0.3660, +0.2386, +0.2297, +0.1792, -0.1369, +0.2320,
-0.5867, -0.1306, +0.3471, -0.1127, +0.3352, -0.0214, +0.0801,
-0.1368, -0.7262, +0.1757
],
[
+0.0183, -0.0485, +0.1199, +0.2513, +0.2022, -0.0472, +0.3076,
+0.0656, -0.3302, -0.0587, -0.0200, -0.5474, -0.0863, +0.2087,
-0.2581, -0.1750, +0.3391
],
[
-0.2339, +0.0639, +0.2085, -0.1872, -0.2686, +0.1490, +0.0436,
-0.0841, -0.1054, -0.4899, +0.0193, -0.0250, +0.2212, +0.0972,
+0.0329, +0.1328, -0.0545
],
[
-0.0874, -0.1087, -0.1577, +0.0936, -0.3083, -0.1450, +0.0365,
-0.1924, -0.0536, +0.0475, +0.0348, +0.0772, +0.0348, -0.2800,
+0.0864, +0.2640, -0.0215
],
[
+0.0745, +0.4503, -0.4064, +0.6300, -0.1275, -0.0463, -0.4074,
+0.0031, +0.1408, +0.0531, +0.1400, +0.0308, -0.0220, -0.0014,
-0.3056, -0.1551, -0.0096
],
[
+0.1479, +0.1186, +0.1323, -0.3466, -0.0654, -0.1084, -0.2509,
+0.0944, -0.2135, +0.2020, +0.0602, -0.1239, +0.0741, +0.2037,
-0.4462, +0.1065, +0.1710
]])
weights_final_b = np.array([
-0.0274, +0.1314, -0.0578, +0.2965, +0.1318, -0.0622, +0.1158, +0.0643,
+0.2138, -0.1422, +0.1579, +0.0836, -0.0388, -0.0933, +0.2233, -0.2276,
+0.0375
])
# yapf: enable
if __name__ == "__main__":
demo_run()
|
agpl-3.0
|
[
646,
747,
12,
6485,
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,
736,
14,
515,
14,
3475,
8,
1818,
694,
430,
199,
736,
14,
1274,
14,
515,
14,
3176,
8,
16,
12,
1676,
694,
9,
199,
199,
646,
984,
199,
646,
2680,
465,
980,
199,
646,
7534,
199,
646,
1134,
20520,
465,
299,
199,
646,
900,
199,
199,
5885,
275,
715,
199,
199,
7504,
275,
299,
14,
2242,
8,
80,
14,
13772,
63,
19495,
9,
199,
3,
6098,
365,
8298,
12930,
12,
1325,
17160,
13703,
314,
3879,
486,
2781,
199,
692,
334,
7504,
665,
378,
304,
523,
340,
334,
5885,
304,
272,
12229,
275,
299,
14,
2242,
8,
80,
14,
14438,
9,
523,
587,
26,
272,
12229,
275,
299,
14,
2242,
8,
80,
14,
6098,
9,
199,
199,
3,
80,
14,
409,
5761,
18936,
8,
17,
12,
18,
3057,
25,
14,
24,
9,
199,
3,
80,
14,
409,
2698,
14499,
6758,
334,
16,
14,
20,
9,
199,
80,
14,
409,
5761,
18936,
8,
16,
12,
378,
12,
446,
25,
14,
24,
9,
199,
3,
1507,
2610,
20960,
29,
20,
436,
6317,
1366,
7801,
29,
17,
14,
16,
15,
2259,
14,
365,
376,
15826,
5007,
6317,
3650,
402,
413,
13186,
9873,
199,
3,
264,
11902,
370,
440,
2621,
5084,
5238,
10196,
10615,
199,
80,
14,
409,
6678,
17378,
8524,
4720,
8,
5964,
1366,
7801,
29,
17,
14,
16,
1182,
5212,
2020,
1967,
24755,
26292,
29,
16859,
12,
1967,
2610,
20960,
29,
24,
9,
199,
3,
3749,
6118,
20,
20952,
5074,
16328,
16801,
4903,
199,
3,
311,
20,
793,
275,
299,
14,
928,
2223,
14054,
8,
80,
14,
6689,
63,
27896,
63,
20142,
63,
1658,
20,
4589,
14864,
1170,
14,
311,
20,
531,
199,
199,
3,
80,
14,
912,
3693,
38,
480,
1207,
12980,
14,
83,
1587,
531,
199,
80,
14,
912,
1230,
3888,
480,
15365,
63,
11886,
14,
300,
1587,
531,
199,
199,
8718,
275,
299,
14,
912,
30495,
5487,
480,
77,
74,
2177,
15,
14864,
1170,
63,
18422,
63,
889,
63,
3928,
14,
1652,
401,
2116,
3285,
29,
80,
14,
1230,
3888,
63,
4701,
63,
899,
15965,
63,
3978,
44,
30011,
63,
1438,
13958,
63,
1761,
63,
20562,
51,
9,
199,
14864,
275,
13474,
59,
16,
61,
199,
509,
1335,
315,
1425,
8,
80,
14,
362,
5667,
5691,
13141,
8,
14864,
2298,
523,
22211,
2354,
275,
299,
14,
362,
30219,
2354,
8,
14864,
12,
1335,
9,
523,
870,
480,
10153,
11854,
1335,
12,
298,
81,
2681,
11107,
22211,
2354,
59,
19,
467,
298,
85,
2681,
11107,
22211,
2354,
59,
20,
467,
6099,
11107,
22211,
2354,
9,
199,
8235,
63,
10153,
83,
275,
942,
199,
8235,
63,
10153,
63,
4108,
275,
942,
199,
199,
2087,
275,
7534,
14,
10730,
342,
199,
2087,
14,
525,
63,
2094,
4517,
2913,
358,
199,
199,
74,
807,
275,
1052,
199,
509,
1335,
315,
1425,
8,
80,
14,
362,
5667,
5691,
13141,
8,
14864,
2298,
523,
2256,
275,
299,
14,
362,
30219,
2354,
8,
14864,
12,
1335,
9,
523,
2142,
63,
354,
275,
2256,
59,
713,
1055,
2708,
480,
4371,
531,
523,
340,
2142,
63,
354,
508,
298,
3039,
63,
11407,
582,
3602,
63,
11407,
275,
1335,
523,
340,
2142,
63,
354,
508,
298,
1019,
63,
11407,
582,
2451,
63,
11407,
275,
1335,
523,
7741,
63,
10153,
63,
4108,
14,
740,
8,
74,
9,
819,
340,
2256,
59,
18,
61,
1137,
299,
14,
24931,
63,
907,
12209,
4586,
26,
1980,
523,
1335,
354,
275,
2256,
59,
17,
1055,
2708,
480,
4371,
531,
523,
1335,
807,
59,
74,
354,
61,
275,
1335,
523,
5117,
12,
7008,
275,
334,
815,
59,
24,
467,
2256,
59,
25,
566,
523,
7741,
63,
10153,
83,
14,
740,
1332,
74,
12,
5117,
12,
7008,
430,
819,
299,
14,
409,
30219,
31642,
3717,
18,
8,
14864,
12,
1335,
12,
3304,
1385,
29,
80,
14,
2524,
5752,
1922,
63,
13060,
12,
3542,
29,
16,
9,
199,
199,
27840,
63,
1247,
275,
2097,
371,
1117,
1410,
63,
90,
401,
298,
371,
1117,
1410,
63,
89,
401,
298,
371,
1117,
1410,
63,
88,
937,
199,
27840,
63,
5652,
275,
359,
1960,
12,
2948,
12,
2948,
61,
199,
27840,
63,
1247,
847,
2097,
1019,
63,
28951,
63,
88,
401,
298,
1019,
63,
28951,
63,
90,
401,
298,
1019,
63,
28951,
63,
89,
401,
298,
1019,
63,
75,
18682,
937,
199,
27840,
63,
5652,
847,
359,
1960,
12,
2948,
12,
9601,
12,
1926,
61,
199,
27840,
63,
1247,
847,
2097,
3039,
63,
28951,
63,
88,
401,
298,
3039,
63,
28951,
63,
90,
401,
298,
3039,
63,
28951,
63,
89,
401,
298,
3039,
63,
75,
18682,
937,
199,
27840,
63,
5652,
847,
359,
1960,
12,
2948,
12,
9601,
12,
1926,
61,
199,
27840,
63,
1247,
847,
2097,
1019,
63,
13927,
348,
424,
17,
401,
298,
1019,
63,
13927,
348,
424,
18,
401,
298,
1019,
63,
17778,
583,
937,
199,
27840,
63,
5652,
847,
359,
2194,
12,
13098,
12,
13098,
61,
199,
27840,
63,
1247,
847,
2097,
3039,
63,
13927,
348,
424,
17,
401,
298,
3039,
63,
13927,
348,
424,
18,
401,
298,
3039,
63,
17778,
583,
937,
199,
27840,
63,
5652,
847,
359,
2194,
12,
13098,
12,
13098,
61,
199,
30034,
1384,
275,
359,
74,
807,
59,
78,
61,
367,
302,
315,
28496,
63,
1247,
61,
421,
199,
533,
9762,
26,
523,
986,
421,
199,
5869,
275,
9762,
342,
199,
5869,
14,
2747,
63,
90,
275,
488,
421,
199,
318,
1453,
63,
6188,
63,
3124,
8,
10153,
18010,
12,
11779,
12,
1335,
12,
5117,
12,
7008,
304,
523,
327,
1361,
480,
74,
531,
523,
327,
1361,
8,
74,
9,
523,
327,
1361,
334,
552,
8,
10153,
18010,
430,
523,
327,
1361,
8,
74,
9,
523,
2388,
275,
22211,
18010,
59,
74,
61,
523,
2086,
275,
2388,
59,
16,
61,
523,
373,
352,
275,
2388,
59,
17,
61,
523,
327,
1361,
480,
1712,
531,
523,
327,
1361,
8,
1712,
9,
523,
327,
1361,
480,
1090,
531,
523,
327,
1361,
8,
1090,
9,
523,
2086,
63,
8523,
275,
378,
14,
21,
627,
334,
2325,
435,
7008,
9,
523
] |
[
747,
12,
6485,
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,
736,
14,
515,
14,
3475,
8,
1818,
694,
430,
199,
736,
14,
1274,
14,
515,
14,
3176,
8,
16,
12,
1676,
694,
9,
199,
199,
646,
984,
199,
646,
2680,
465,
980,
199,
646,
7534,
199,
646,
1134,
20520,
465,
299,
199,
646,
900,
199,
199,
5885,
275,
715,
199,
199,
7504,
275,
299,
14,
2242,
8,
80,
14,
13772,
63,
19495,
9,
199,
3,
6098,
365,
8298,
12930,
12,
1325,
17160,
13703,
314,
3879,
486,
2781,
199,
692,
334,
7504,
665,
378,
304,
523,
340,
334,
5885,
304,
272,
12229,
275,
299,
14,
2242,
8,
80,
14,
14438,
9,
523,
587,
26,
272,
12229,
275,
299,
14,
2242,
8,
80,
14,
6098,
9,
199,
199,
3,
80,
14,
409,
5761,
18936,
8,
17,
12,
18,
3057,
25,
14,
24,
9,
199,
3,
80,
14,
409,
2698,
14499,
6758,
334,
16,
14,
20,
9,
199,
80,
14,
409,
5761,
18936,
8,
16,
12,
378,
12,
446,
25,
14,
24,
9,
199,
3,
1507,
2610,
20960,
29,
20,
436,
6317,
1366,
7801,
29,
17,
14,
16,
15,
2259,
14,
365,
376,
15826,
5007,
6317,
3650,
402,
413,
13186,
9873,
199,
3,
264,
11902,
370,
440,
2621,
5084,
5238,
10196,
10615,
199,
80,
14,
409,
6678,
17378,
8524,
4720,
8,
5964,
1366,
7801,
29,
17,
14,
16,
1182,
5212,
2020,
1967,
24755,
26292,
29,
16859,
12,
1967,
2610,
20960,
29,
24,
9,
199,
3,
3749,
6118,
20,
20952,
5074,
16328,
16801,
4903,
199,
3,
311,
20,
793,
275,
299,
14,
928,
2223,
14054,
8,
80,
14,
6689,
63,
27896,
63,
20142,
63,
1658,
20,
4589,
14864,
1170,
14,
311,
20,
531,
199,
199,
3,
80,
14,
912,
3693,
38,
480,
1207,
12980,
14,
83,
1587,
531,
199,
80,
14,
912,
1230,
3888,
480,
15365,
63,
11886,
14,
300,
1587,
531,
199,
199,
8718,
275,
299,
14,
912,
30495,
5487,
480,
77,
74,
2177,
15,
14864,
1170,
63,
18422,
63,
889,
63,
3928,
14,
1652,
401,
2116,
3285,
29,
80,
14,
1230,
3888,
63,
4701,
63,
899,
15965,
63,
3978,
44,
30011,
63,
1438,
13958,
63,
1761,
63,
20562,
51,
9,
199,
14864,
275,
13474,
59,
16,
61,
199,
509,
1335,
315,
1425,
8,
80,
14,
362,
5667,
5691,
13141,
8,
14864,
2298,
523,
22211,
2354,
275,
299,
14,
362,
30219,
2354,
8,
14864,
12,
1335,
9,
523,
870,
480,
10153,
11854,
1335,
12,
298,
81,
2681,
11107,
22211,
2354,
59,
19,
467,
298,
85,
2681,
11107,
22211,
2354,
59,
20,
467,
6099,
11107,
22211,
2354,
9,
199,
8235,
63,
10153,
83,
275,
942,
199,
8235,
63,
10153,
63,
4108,
275,
942,
199,
199,
2087,
275,
7534,
14,
10730,
342,
199,
2087,
14,
525,
63,
2094,
4517,
2913,
358,
199,
199,
74,
807,
275,
1052,
199,
509,
1335,
315,
1425,
8,
80,
14,
362,
5667,
5691,
13141,
8,
14864,
2298,
523,
2256,
275,
299,
14,
362,
30219,
2354,
8,
14864,
12,
1335,
9,
523,
2142,
63,
354,
275,
2256,
59,
713,
1055,
2708,
480,
4371,
531,
523,
340,
2142,
63,
354,
508,
298,
3039,
63,
11407,
582,
3602,
63,
11407,
275,
1335,
523,
340,
2142,
63,
354,
508,
298,
1019,
63,
11407,
582,
2451,
63,
11407,
275,
1335,
523,
7741,
63,
10153,
63,
4108,
14,
740,
8,
74,
9,
819,
340,
2256,
59,
18,
61,
1137,
299,
14,
24931,
63,
907,
12209,
4586,
26,
1980,
523,
1335,
354,
275,
2256,
59,
17,
1055,
2708,
480,
4371,
531,
523,
1335,
807,
59,
74,
354,
61,
275,
1335,
523,
5117,
12,
7008,
275,
334,
815,
59,
24,
467,
2256,
59,
25,
566,
523,
7741,
63,
10153,
83,
14,
740,
1332,
74,
12,
5117,
12,
7008,
430,
819,
299,
14,
409,
30219,
31642,
3717,
18,
8,
14864,
12,
1335,
12,
3304,
1385,
29,
80,
14,
2524,
5752,
1922,
63,
13060,
12,
3542,
29,
16,
9,
199,
199,
27840,
63,
1247,
275,
2097,
371,
1117,
1410,
63,
90,
401,
298,
371,
1117,
1410,
63,
89,
401,
298,
371,
1117,
1410,
63,
88,
937,
199,
27840,
63,
5652,
275,
359,
1960,
12,
2948,
12,
2948,
61,
199,
27840,
63,
1247,
847,
2097,
1019,
63,
28951,
63,
88,
401,
298,
1019,
63,
28951,
63,
90,
401,
298,
1019,
63,
28951,
63,
89,
401,
298,
1019,
63,
75,
18682,
937,
199,
27840,
63,
5652,
847,
359,
1960,
12,
2948,
12,
9601,
12,
1926,
61,
199,
27840,
63,
1247,
847,
2097,
3039,
63,
28951,
63,
88,
401,
298,
3039,
63,
28951,
63,
90,
401,
298,
3039,
63,
28951,
63,
89,
401,
298,
3039,
63,
75,
18682,
937,
199,
27840,
63,
5652,
847,
359,
1960,
12,
2948,
12,
9601,
12,
1926,
61,
199,
27840,
63,
1247,
847,
2097,
1019,
63,
13927,
348,
424,
17,
401,
298,
1019,
63,
13927,
348,
424,
18,
401,
298,
1019,
63,
17778,
583,
937,
199,
27840,
63,
5652,
847,
359,
2194,
12,
13098,
12,
13098,
61,
199,
27840,
63,
1247,
847,
2097,
3039,
63,
13927,
348,
424,
17,
401,
298,
3039,
63,
13927,
348,
424,
18,
401,
298,
3039,
63,
17778,
583,
937,
199,
27840,
63,
5652,
847,
359,
2194,
12,
13098,
12,
13098,
61,
199,
30034,
1384,
275,
359,
74,
807,
59,
78,
61,
367,
302,
315,
28496,
63,
1247,
61,
421,
199,
533,
9762,
26,
523,
986,
421,
199,
5869,
275,
9762,
342,
199,
5869,
14,
2747,
63,
90,
275,
488,
421,
199,
318,
1453,
63,
6188,
63,
3124,
8,
10153,
18010,
12,
11779,
12,
1335,
12,
5117,
12,
7008,
304,
523,
327,
1361,
480,
74,
531,
523,
327,
1361,
8,
74,
9,
523,
327,
1361,
334,
552,
8,
10153,
18010,
430,
523,
327,
1361,
8,
74,
9,
523,
2388,
275,
22211,
18010,
59,
74,
61,
523,
2086,
275,
2388,
59,
16,
61,
523,
373,
352,
275,
2388,
59,
17,
61,
523,
327,
1361,
480,
1712,
531,
523,
327,
1361,
8,
1712,
9,
523,
327,
1361,
480,
1090,
531,
523,
327,
1361,
8,
1090,
9,
523,
2086,
63,
8523,
275,
378,
14,
21,
627,
334,
2325,
435,
7008,
9,
523,
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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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
gandrewstone/BitcoinUnlimited
|
qa/rpc-tests/test_framework/netutil.py
|
328
|
4562
|
#!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Linux network utilities
import sys
import socket
import fcntl
import struct
import array
import os
import binascii
# Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/ by Ricardo Pascal
STATE_ESTABLISHED = '01'
STATE_SYN_SENT = '02'
STATE_SYN_RECV = '03'
STATE_FIN_WAIT1 = '04'
STATE_FIN_WAIT2 = '05'
STATE_TIME_WAIT = '06'
STATE_CLOSE = '07'
STATE_CLOSE_WAIT = '08'
STATE_LAST_ACK = '09'
STATE_LISTEN = '0A'
STATE_CLOSING = '0B'
def get_socket_inodes(pid):
'''
Get list of socket inodes for process pid.
'''
base = '/proc/%i/fd' % pid
inodes = []
for item in os.listdir(base):
target = os.readlink(os.path.join(base, item))
if target.startswith('socket:'):
inodes.append(int(target[8:-1]))
return inodes
def _remove_empty(array):
return [x for x in array if x !='']
def _convert_ip_port(array):
host,port = array.split(':')
# convert host from mangled-per-four-bytes form as used by kernel
host = binascii.unhexlify(host)
host_out = ''
for x in range(0, len(host)/4):
(val,) = struct.unpack('=I', host[x*4:(x+1)*4])
host_out += '%08x' % val
return host_out,int(port,16)
def netstat(typ='tcp'):
'''
Function to return a list with status of tcp connections at linux systems
To get pid of all network process running on system, you must run this script
as superuser
'''
with open('/proc/net/'+typ,'r') as f:
content = f.readlines()
content.pop(0)
result = []
for line in content:
line_array = _remove_empty(line.split(' ')) # Split lines and remove empty spaces.
tcp_id = line_array[0]
l_addr = _convert_ip_port(line_array[1])
r_addr = _convert_ip_port(line_array[2])
state = line_array[3]
inode = int(line_array[9]) # Need the inode to match with process pid.
nline = [tcp_id, l_addr, r_addr, state, inode]
result.append(nline)
return result
def get_bind_addrs(pid):
'''
Get bind addresses as (host,port) tuples for process pid.
'''
inodes = get_socket_inodes(pid)
bind_addrs = []
for conn in netstat('tcp') + netstat('tcp6'):
if conn[3] == STATE_LISTEN and conn[4] in inodes:
bind_addrs.append(conn[1])
return bind_addrs
# from: http://code.activestate.com/recipes/439093/
def all_interfaces():
'''
Return all interfaces that are up
'''
is_64bits = sys.maxsize > 2**32
struct_size = 40 if is_64bits else 32
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
max_possible = 8 # initial value
while True:
bytes = max_possible * struct_size
names = array.array('B', '\0' * bytes)
outbytes = struct.unpack('iL', fcntl.ioctl(
s.fileno(),
0x8912, # SIOCGIFCONF
struct.pack('iL', bytes, names.buffer_info()[0])
))[0]
if outbytes == bytes:
max_possible *= 2
else:
break
namestr = names.tostring()
return [(namestr[i:i+16].split('\0', 1)[0],
socket.inet_ntoa(namestr[i+20:i+24]))
for i in range(0, outbytes, struct_size)]
def addr_to_hex(addr):
'''
Convert string IPv4 or IPv6 address to binary address as returned by
get_bind_addrs.
Very naive implementation that certainly doesn't work for all IPv6 variants.
'''
if '.' in addr: # IPv4
addr = [int(x) for x in addr.split('.')]
elif ':' in addr: # IPv6
sub = [[], []] # prefix, suffix
x = 0
addr = addr.split(':')
for i,comp in enumerate(addr):
if comp == '':
if i == 0 or i == (len(addr)-1): # skip empty component at beginning or end
continue
x += 1 # :: skips to suffix
assert(x < 2)
else: # two bytes per component
val = int(comp, 16)
sub[x].append(val >> 8)
sub[x].append(val & 0xff)
nullbytes = 16 - len(sub[0]) - len(sub[1])
assert((x == 0 and nullbytes == 0) or (x == 1 and nullbytes > 0))
addr = sub[0] + ([0] * nullbytes) + sub[1]
else:
raise ValueError('Could not parse address %s' % addr)
return binascii.hexlify(bytearray(addr))
|
mit
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
18,
199,
3,
1898,
334,
67,
9,
6927,
710,
21158,
11672,
19782,
199,
3,
17484,
1334,
314,
10697,
2032,
4190,
12,
1937,
314,
23073,
199,
3,
570,
9685,
503,
1455,
921,
1544,
14,
16374,
14,
1308,
15,
2383,
15,
1147,
13,
1682,
14,
8624,
14,
199,
199,
3,
10130,
2784,
15841,
199,
646,
984,
199,
646,
2838,
199,
646,
12871,
199,
646,
2702,
199,
646,
1625,
199,
646,
747,
199,
646,
14755,
199,
199,
3,
820,
4937,
590,
4079,
641,
1455,
921,
2392,
269,
3813,
78,
348,
14,
957,
15,
11486,
15,
65,
13,
1548,
13,
846,
3736,
13,
262,
13,
2003,
13,
13797,
13,
1960,
13,
1278,
13,
1618,
13,
600,
15,
701,
820,
530,
1005,
79,
510,
305,
915,
199,
6689,
63,
1719,
1217,
44,
20450,
275,
283,
614,
7,
199,
6689,
63,
31802,
63,
32173,
221,
275,
283,
996,
7,
199,
6689,
63,
31802,
63,
9481,
54,
275,
283,
1644,
7,
199,
6689,
63,
17383,
63,
12458,
17,
275,
283,
966,
7,
199,
6689,
63,
17383,
63,
12458,
18,
275,
283,
1717,
7,
199,
6689,
63,
4961,
63,
12458,
275,
283,
1690,
7,
199,
6689,
63,
18219,
275,
283,
1780,
7,
199,
6689,
63,
18219,
63,
12458,
275,
283,
2036,
7,
199,
6689,
63,
16901,
63,
3099,
275,
283,
1643,
7,
199,
6689,
63,
4924,
742,
275,
283,
16,
33,
7,
199,
6689,
63,
10353,
12567,
275,
283,
16,
34,
7,
199,
199,
318,
664,
63,
3450,
63,
15993,
83,
8,
3150,
304,
272,
1449,
272,
2372,
769,
402,
2838,
25115,
83,
367,
2112,
4422,
14,
272,
1449,
272,
1300,
275,
1994,
4687,
3149,
73,
15,
2592,
7,
450,
4422,
272,
25115,
83,
275,
942,
272,
367,
1242,
315,
747,
14,
7374,
8,
1095,
304,
267,
1347,
275,
747,
14,
31654,
8,
736,
14,
515,
14,
904,
8,
1095,
12,
1242,
430,
267,
340,
1347,
14,
2460,
360,
3450,
23117,
288,
25115,
83,
14,
740,
8,
442,
8,
1375,
59,
24,
6809,
17,
2459,
272,
372,
25115,
83,
199,
199,
318,
485,
2168,
63,
1667,
8,
1144,
304,
272,
372,
359,
88,
367,
671,
315,
1625,
340,
671,
8546,
534,
418,
199,
199,
318,
485,
3916,
63,
711,
63,
719,
8,
1144,
304,
272,
1591,
12,
719,
275,
1625,
14,
1294,
11633,
272,
327,
3957,
1591,
687,
333,
22183,
13,
529,
13,
13672,
13,
2394,
1824,
465,
1202,
701,
5114,
272,
1591,
275,
14755,
14,
324,
20677,
8,
1102,
9,
272,
1591,
63,
548,
275,
2125,
272,
367,
671,
315,
1425,
8,
16,
12,
822,
8,
1102,
2447,
20,
304,
267,
334,
637,
4258,
275,
2702,
14,
5301,
26800,
41,
297,
1591,
59,
88,
10,
20,
20334,
88,
11,
17,
3342,
20,
566,
267,
1591,
63,
548,
847,
1543,
2036,
88,
7,
450,
1139,
339,
372,
1591,
63,
548,
12,
442,
8,
719,
12,
975,
9,
199,
199,
318,
1851,
3736,
8,
9749,
534,
8815,
735,
272,
1449,
272,
6801,
370,
372,
282,
769,
543,
2004,
402,
14719,
6947,
737,
18369,
10460,
272,
4005,
664,
4422,
402,
1006,
2784,
2112,
3879,
641,
2656,
12,
1265,
1471,
1255,
642,
2884,
272,
465,
32590,
272,
1449,
272,
543,
1551,
2336,
4687,
15,
846,
19047,
9749,
2584,
82,
358,
465,
289,
26,
267,
1564,
275,
289,
14,
9684,
342,
267,
1564,
14,
1935,
8,
16,
9,
272,
754,
275,
942,
272,
367,
1004,
315,
1564,
26,
267,
1004,
63,
1144,
275,
485,
2168,
63,
1667,
8,
604,
14,
1294,
360,
20005,
258,
327,
11740,
2385,
436,
2813,
2701,
7883,
14,
267,
14719,
63,
344,
275,
1004,
63,
1144,
59,
16,
61,
267,
634,
63,
2697,
275,
485,
3916,
63,
711,
63,
719,
8,
604,
63,
1144,
59,
17,
566,
267,
519,
63,
2697,
275,
485,
3916,
63,
711,
63,
719,
8,
604,
63,
1144,
59,
18,
566,
267,
1174,
275,
1004,
63,
1144,
59,
19,
61,
267,
25115,
275,
1109,
8,
604,
63,
1144,
59,
25,
566,
10473,
327,
14012,
314,
25115,
370,
1336,
543,
2112,
4422,
14,
267,
302,
604,
275,
359,
8815,
63,
344,
12,
634,
63,
2697,
12,
519,
63,
2697,
12,
1174,
12,
25115,
61,
267,
754,
14,
740,
8,
78,
604,
9,
272,
372,
754,
199,
199,
318,
664,
63,
3409,
63,
18942,
8,
3150,
304,
272,
1449,
272,
2372,
5398,
7149,
465,
334,
1102,
12,
719,
9,
6346,
367,
2112,
4422,
14,
272,
1449,
272,
25115,
83,
275,
664,
63,
3450,
63,
15993,
83,
8,
3150,
9,
272,
5398,
63,
18942,
275,
942,
272,
367,
2557,
315,
1851,
3736,
360,
8815,
358,
435,
1851,
3736,
360,
8815,
22,
735,
267,
340,
2557,
59,
19,
61,
508,
11377,
63,
4924,
742,
436,
2557,
59,
20,
61,
315,
25115,
83,
26,
288,
5398,
63,
18942,
14,
740,
8,
1631,
59,
17,
566,
272,
372,
5398,
63,
18942,
199,
199,
3,
687,
26,
1455,
921,
600,
14,
32595,
14,
957,
15,
25200,
15,
28429,
19035,
15,
199,
318,
1006,
63,
7436,
837,
272,
1449,
272,
1432,
1006,
8386,
626,
787,
1536,
272,
1449,
272,
365,
63,
772,
5609,
275,
984,
14,
13634,
690,
499,
538,
708,
272,
2702,
63,
890,
275,
6335,
340,
365,
63,
772,
5609,
587,
4337,
272,
308,
275,
2838,
14,
3450,
8,
3450,
14,
5699,
63,
11367,
12,
2838,
14,
9469,
63,
25351,
9,
272,
1390,
63,
13893,
275,
1695,
327,
2536,
574,
272,
1830,
715,
26,
267,
2783,
275,
1390,
63,
13893,
627,
2702,
63,
890,
267,
1561,
275,
1625,
14,
1144,
360,
34,
297,
1557,
16,
7,
627,
2783,
9,
267,
734,
2394,
275,
2702,
14,
5301,
360,
73,
44,
297,
12871,
14,
2308,
8077,
8,
288,
308,
14,
9843,
1062,
288,
378,
88,
1407,
713,
12,
221,
327,
428,
2090,
4064,
4656,
3103,
288,
2702,
14,
1389,
360,
73,
44,
297,
2783,
12,
1561,
14,
2738,
63,
815,
3430,
16,
566,
267,
5082,
59,
16,
61,
267,
340,
734,
2394,
508,
2783,
26,
288,
1390,
63,
13893,
9000,
499,
267,
587,
26,
288,
2059,
272,
536,
495,
275,
1561,
14,
14028,
342,
272,
372,
3842,
354,
495,
59,
73,
26,
73,
11,
975,
1055,
1294,
2258,
16,
297,
413,
2788,
16,
467,
1467,
2838,
14,
10811,
63
] |
[
2647,
15,
1393,
15,
1813,
2366,
18,
199,
3,
1898,
334,
67,
9,
6927,
710,
21158,
11672,
19782,
199,
3,
17484,
1334,
314,
10697,
2032,
4190,
12,
1937,
314,
23073,
199,
3,
570,
9685,
503,
1455,
921,
1544,
14,
16374,
14,
1308,
15,
2383,
15,
1147,
13,
1682,
14,
8624,
14,
199,
199,
3,
10130,
2784,
15841,
199,
646,
984,
199,
646,
2838,
199,
646,
12871,
199,
646,
2702,
199,
646,
1625,
199,
646,
747,
199,
646,
14755,
199,
199,
3,
820,
4937,
590,
4079,
641,
1455,
921,
2392,
269,
3813,
78,
348,
14,
957,
15,
11486,
15,
65,
13,
1548,
13,
846,
3736,
13,
262,
13,
2003,
13,
13797,
13,
1960,
13,
1278,
13,
1618,
13,
600,
15,
701,
820,
530,
1005,
79,
510,
305,
915,
199,
6689,
63,
1719,
1217,
44,
20450,
275,
283,
614,
7,
199,
6689,
63,
31802,
63,
32173,
221,
275,
283,
996,
7,
199,
6689,
63,
31802,
63,
9481,
54,
275,
283,
1644,
7,
199,
6689,
63,
17383,
63,
12458,
17,
275,
283,
966,
7,
199,
6689,
63,
17383,
63,
12458,
18,
275,
283,
1717,
7,
199,
6689,
63,
4961,
63,
12458,
275,
283,
1690,
7,
199,
6689,
63,
18219,
275,
283,
1780,
7,
199,
6689,
63,
18219,
63,
12458,
275,
283,
2036,
7,
199,
6689,
63,
16901,
63,
3099,
275,
283,
1643,
7,
199,
6689,
63,
4924,
742,
275,
283,
16,
33,
7,
199,
6689,
63,
10353,
12567,
275,
283,
16,
34,
7,
199,
199,
318,
664,
63,
3450,
63,
15993,
83,
8,
3150,
304,
272,
1449,
272,
2372,
769,
402,
2838,
25115,
83,
367,
2112,
4422,
14,
272,
1449,
272,
1300,
275,
1994,
4687,
3149,
73,
15,
2592,
7,
450,
4422,
272,
25115,
83,
275,
942,
272,
367,
1242,
315,
747,
14,
7374,
8,
1095,
304,
267,
1347,
275,
747,
14,
31654,
8,
736,
14,
515,
14,
904,
8,
1095,
12,
1242,
430,
267,
340,
1347,
14,
2460,
360,
3450,
23117,
288,
25115,
83,
14,
740,
8,
442,
8,
1375,
59,
24,
6809,
17,
2459,
272,
372,
25115,
83,
199,
199,
318,
485,
2168,
63,
1667,
8,
1144,
304,
272,
372,
359,
88,
367,
671,
315,
1625,
340,
671,
8546,
534,
418,
199,
199,
318,
485,
3916,
63,
711,
63,
719,
8,
1144,
304,
272,
1591,
12,
719,
275,
1625,
14,
1294,
11633,
272,
327,
3957,
1591,
687,
333,
22183,
13,
529,
13,
13672,
13,
2394,
1824,
465,
1202,
701,
5114,
272,
1591,
275,
14755,
14,
324,
20677,
8,
1102,
9,
272,
1591,
63,
548,
275,
2125,
272,
367,
671,
315,
1425,
8,
16,
12,
822,
8,
1102,
2447,
20,
304,
267,
334,
637,
4258,
275,
2702,
14,
5301,
26800,
41,
297,
1591,
59,
88,
10,
20,
20334,
88,
11,
17,
3342,
20,
566,
267,
1591,
63,
548,
847,
1543,
2036,
88,
7,
450,
1139,
339,
372,
1591,
63,
548,
12,
442,
8,
719,
12,
975,
9,
199,
199,
318,
1851,
3736,
8,
9749,
534,
8815,
735,
272,
1449,
272,
6801,
370,
372,
282,
769,
543,
2004,
402,
14719,
6947,
737,
18369,
10460,
272,
4005,
664,
4422,
402,
1006,
2784,
2112,
3879,
641,
2656,
12,
1265,
1471,
1255,
642,
2884,
272,
465,
32590,
272,
1449,
272,
543,
1551,
2336,
4687,
15,
846,
19047,
9749,
2584,
82,
358,
465,
289,
26,
267,
1564,
275,
289,
14,
9684,
342,
267,
1564,
14,
1935,
8,
16,
9,
272,
754,
275,
942,
272,
367,
1004,
315,
1564,
26,
267,
1004,
63,
1144,
275,
485,
2168,
63,
1667,
8,
604,
14,
1294,
360,
20005,
258,
327,
11740,
2385,
436,
2813,
2701,
7883,
14,
267,
14719,
63,
344,
275,
1004,
63,
1144,
59,
16,
61,
267,
634,
63,
2697,
275,
485,
3916,
63,
711,
63,
719,
8,
604,
63,
1144,
59,
17,
566,
267,
519,
63,
2697,
275,
485,
3916,
63,
711,
63,
719,
8,
604,
63,
1144,
59,
18,
566,
267,
1174,
275,
1004,
63,
1144,
59,
19,
61,
267,
25115,
275,
1109,
8,
604,
63,
1144,
59,
25,
566,
10473,
327,
14012,
314,
25115,
370,
1336,
543,
2112,
4422,
14,
267,
302,
604,
275,
359,
8815,
63,
344,
12,
634,
63,
2697,
12,
519,
63,
2697,
12,
1174,
12,
25115,
61,
267,
754,
14,
740,
8,
78,
604,
9,
272,
372,
754,
199,
199,
318,
664,
63,
3409,
63,
18942,
8,
3150,
304,
272,
1449,
272,
2372,
5398,
7149,
465,
334,
1102,
12,
719,
9,
6346,
367,
2112,
4422,
14,
272,
1449,
272,
25115,
83,
275,
664,
63,
3450,
63,
15993,
83,
8,
3150,
9,
272,
5398,
63,
18942,
275,
942,
272,
367,
2557,
315,
1851,
3736,
360,
8815,
358,
435,
1851,
3736,
360,
8815,
22,
735,
267,
340,
2557,
59,
19,
61,
508,
11377,
63,
4924,
742,
436,
2557,
59,
20,
61,
315,
25115,
83,
26,
288,
5398,
63,
18942,
14,
740,
8,
1631,
59,
17,
566,
272,
372,
5398,
63,
18942,
199,
199,
3,
687,
26,
1455,
921,
600,
14,
32595,
14,
957,
15,
25200,
15,
28429,
19035,
15,
199,
318,
1006,
63,
7436,
837,
272,
1449,
272,
1432,
1006,
8386,
626,
787,
1536,
272,
1449,
272,
365,
63,
772,
5609,
275,
984,
14,
13634,
690,
499,
538,
708,
272,
2702,
63,
890,
275,
6335,
340,
365,
63,
772,
5609,
587,
4337,
272,
308,
275,
2838,
14,
3450,
8,
3450,
14,
5699,
63,
11367,
12,
2838,
14,
9469,
63,
25351,
9,
272,
1390,
63,
13893,
275,
1695,
327,
2536,
574,
272,
1830,
715,
26,
267,
2783,
275,
1390,
63,
13893,
627,
2702,
63,
890,
267,
1561,
275,
1625,
14,
1144,
360,
34,
297,
1557,
16,
7,
627,
2783,
9,
267,
734,
2394,
275,
2702,
14,
5301,
360,
73,
44,
297,
12871,
14,
2308,
8077,
8,
288,
308,
14,
9843,
1062,
288,
378,
88,
1407,
713,
12,
221,
327,
428,
2090,
4064,
4656,
3103,
288,
2702,
14,
1389,
360,
73,
44,
297,
2783,
12,
1561,
14,
2738,
63,
815,
3430,
16,
566,
267,
5082,
59,
16,
61,
267,
340,
734,
2394,
508,
2783,
26,
288,
1390,
63,
13893,
9000,
499,
267,
587,
26,
288,
2059,
272,
536,
495,
275,
1561,
14,
14028,
342,
272,
372,
3842,
354,
495,
59,
73,
26,
73,
11,
975,
1055,
1294,
2258,
16,
297,
413,
2788,
16,
467,
1467,
2838,
14,
10811,
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,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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
] |
Nico60/kernel_lge_hammerhead
|
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
|
12527
|
1935
|
# Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0
FUTEX_WAKE = 1
FUTEX_PRIVATE_FLAG = 128
FUTEX_CLOCK_REALTIME = 256
FUTEX_CMD_MASK = ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
NSECS_PER_SEC = 1000000000
def avg(total, n):
return total / n
def nsecs(secs, nsecs):
return secs * NSECS_PER_SEC + nsecs
def nsecs_secs(nsecs):
return nsecs / NSECS_PER_SEC
def nsecs_nsecs(nsecs):
return nsecs % NSECS_PER_SEC
def nsecs_str(nsecs):
str = "%5u.%09u" % (nsecs_secs(nsecs), nsecs_nsecs(nsecs)),
return str
def add_stats(dict, key, value):
if not dict.has_key(key):
dict[key] = (value, value, value, 1)
else:
min, max, avg, count = dict[key]
if value < min:
min = value
if value > max:
max = value
avg = (avg + value) / 2
dict[key] = (min, max, avg, count + 1)
def clear_term():
print("\x1b[H\x1b[2J")
audit_package_warned = False
try:
import audit
machine_to_id = {
'x86_64': audit.MACH_86_64,
'alpha' : audit.MACH_ALPHA,
'ia64' : audit.MACH_IA64,
'ppc' : audit.MACH_PPC,
'ppc64' : audit.MACH_PPC64,
's390' : audit.MACH_S390,
's390x' : audit.MACH_S390X,
'i386' : audit.MACH_X86,
'i586' : audit.MACH_X86,
'i686' : audit.MACH_X86,
}
try:
machine_to_id['armeb'] = audit.MACH_ARMEB
except:
pass
machine_id = machine_to_id[os.uname()[4]]
except:
if not audit_package_warned:
audit_package_warned = True
print "Install the audit-libs-python package to get syscall names"
def syscall_name(id):
try:
return audit.audit_syscall_to_name(id, machine_id)
except:
return str(id)
def strerror(nr):
try:
return errno.errorcode[abs(nr)]
except:
return "Unknown %d errno" % nr
|
gpl-2.0
|
[
3,
21248,
14,
647,
446,
2018,
3329,
367,
8582,
2884,
12,
3201,
19549,
11420,
1233,
199,
3,
199,
3,
1898,
334,
35,
9,
7129,
701,
21644,
29385,
665,
29453,
32,
6799,
14,
957,
30,
199,
3,
199,
3,
961,
2032,
1443,
506,
1854,
1334,
314,
2895,
402,
314,
1664,
1696,
199,
3,
1684,
844,
1689,
12006,
531,
1015,
499,
465,
3267,
701,
314,
2868,
2290,
199,
3,
2752,
14,
199,
199,
646,
7554,
12,
747,
199,
199,
31179,
63,
12458,
275,
378,
199,
31179,
63,
9004,
2430,
275,
413,
199,
31179,
63,
18748,
63,
3719,
275,
7960,
199,
31179,
63,
30690,
63,
15508,
4961,
275,
7633,
199,
31179,
63,
9744,
63,
12880,
275,
6146,
8,
31179,
63,
18748,
63,
3719,
1204,
481,
934,
1438,
63,
30690,
63,
15508,
4961,
9,
199,
199,
46,
28466,
63,
4227,
63,
15048,
259,
275,
413,
25464,
199,
199,
318,
12402,
8,
2923,
12,
302,
304,
272,
372,
3141,
1182,
302,
199,
199,
318,
13781,
8,
4855,
12,
13781,
304,
272,
372,
20091,
627,
653,
28466,
63,
4227,
63,
15048,
435,
13781,
199,
199,
318,
13781,
63,
4855,
8,
9618,
304,
272,
372,
13781,
1182,
653,
28466,
63,
4227,
63,
15048,
199,
199,
318,
13781,
63,
9618,
8,
9618,
304,
272,
372,
13781,
450,
653,
28466,
63,
4227,
63,
15048,
199,
199,
318,
13781,
63,
495,
8,
9618,
304,
272,
620,
275,
2071,
21,
85,
4111,
1643,
85,
2,
450,
334,
9618,
63,
4855,
8,
9618,
395,
13781,
63,
9618,
8,
9618,
1826,
272,
372,
620,
199,
199,
318,
1050,
63,
3200,
8,
807,
12,
790,
12,
574,
304,
199,
198,
692,
440,
1211,
14,
1989,
63,
498,
8,
498,
304,
507,
198,
807,
59,
498,
61,
275,
334,
585,
12,
574,
12,
574,
12,
413,
9,
199,
198,
2836,
26,
507,
198,
827,
12,
1390,
12,
12402,
12,
2338,
275,
1211,
59,
498,
61,
507,
198,
692,
574,
665,
1748,
26,
686,
198,
827,
275,
574,
507,
198,
692,
574,
690,
1390,
26,
686,
198,
988,
275,
574,
507,
198,
8595,
275,
334,
8595,
435,
574,
9,
1182,
499,
507,
198,
807,
59,
498,
61,
275,
334,
827,
12,
1390,
12,
12402,
12,
2338,
435,
413,
9,
199,
199,
318,
5436,
63,
5125,
837,
272,
870,
4582,
88,
17,
66,
59,
40,
60,
88,
17,
66,
59,
18,
42,
531,
199,
199,
14274,
63,
2491,
63,
4050,
379,
275,
756,
199,
199,
893,
26,
199,
198,
646,
13968,
199,
198,
6744,
63,
475,
63,
344,
275,
469,
507,
198,
7,
88,
1184,
63,
772,
356,
13968,
14,
13802,
63,
1184,
63,
772,
12,
507,
198,
7,
4468,
7,
198,
26,
13968,
14,
13802,
63,
18554,
12,
507,
198,
7,
4674,
772,
7,
198,
26,
13968,
14,
13802,
63,
13033,
772,
12,
507,
198,
7,
20638,
7,
198,
26,
13968,
14,
13802,
63,
48,
4222,
12,
507,
198,
7,
20638,
772,
7,
198,
26,
13968,
14,
13802,
63,
48,
4222,
772,
12,
507,
198,
1159,
12302,
7,
198,
26,
13968,
14,
13802,
63,
51,
12302,
12,
507,
198,
1159,
12302,
88,
7,
198,
26,
13968,
14,
13802,
63,
51,
12302,
56,
12,
507,
198,
7,
73,
8040,
7,
198,
26,
13968,
14,
13802,
63,
56,
1184,
12,
507,
198,
7,
73,
26888,
7,
198,
26,
13968,
14,
13802,
63,
56,
1184,
12,
507,
198,
7,
73,
10253,
7,
198,
26,
13968,
14,
13802,
63,
56,
1184,
12,
199,
198,
93,
199,
198,
893,
26,
507,
198,
6744,
63,
475,
63,
344,
459,
285,
278,
66,
418,
275,
13968,
14,
13802,
63,
689,
3635,
34,
199,
198,
2590,
26,
507,
198,
1529,
199,
198,
6744,
63,
344,
275,
6844,
63,
475,
63,
344,
59,
736,
14,
16040,
3430,
20,
2677,
199,
2590,
26,
199,
198,
692,
440,
13968,
63,
2491,
63,
4050,
379,
26,
507,
198,
14274,
63,
2491,
63,
4050,
379,
275,
715,
507,
198,
1361,
298,
8154,
314,
13968,
13,
8450,
13,
1548,
2559,
370,
664,
18901,
1561,
2,
199,
199,
318,
18901,
63,
354,
8,
344,
304,
199,
198,
893,
26,
507,
198,
1107,
13968,
14,
14274,
63,
19444,
63,
475,
63,
354,
8,
344,
12,
6844,
63,
344,
9,
199,
198,
2590,
26,
507,
198,
1107,
620,
8,
344,
9,
199,
199,
318,
410,
17844,
8,
7865,
304,
199,
198,
893,
26,
507,
198,
1107,
7554,
14,
28857,
59,
2101,
8,
7865,
1874,
199,
198,
2590,
26,
507,
198,
1107,
298,
5912,
450,
68,
7554,
2,
450,
14762,
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
] |
[
21248,
14,
647,
446,
2018,
3329,
367,
8582,
2884,
12,
3201,
19549,
11420,
1233,
199,
3,
199,
3,
1898,
334,
35,
9,
7129,
701,
21644,
29385,
665,
29453,
32,
6799,
14,
957,
30,
199,
3,
199,
3,
961,
2032,
1443,
506,
1854,
1334,
314,
2895,
402,
314,
1664,
1696,
199,
3,
1684,
844,
1689,
12006,
531,
1015,
499,
465,
3267,
701,
314,
2868,
2290,
199,
3,
2752,
14,
199,
199,
646,
7554,
12,
747,
199,
199,
31179,
63,
12458,
275,
378,
199,
31179,
63,
9004,
2430,
275,
413,
199,
31179,
63,
18748,
63,
3719,
275,
7960,
199,
31179,
63,
30690,
63,
15508,
4961,
275,
7633,
199,
31179,
63,
9744,
63,
12880,
275,
6146,
8,
31179,
63,
18748,
63,
3719,
1204,
481,
934,
1438,
63,
30690,
63,
15508,
4961,
9,
199,
199,
46,
28466,
63,
4227,
63,
15048,
259,
275,
413,
25464,
199,
199,
318,
12402,
8,
2923,
12,
302,
304,
272,
372,
3141,
1182,
302,
199,
199,
318,
13781,
8,
4855,
12,
13781,
304,
272,
372,
20091,
627,
653,
28466,
63,
4227,
63,
15048,
435,
13781,
199,
199,
318,
13781,
63,
4855,
8,
9618,
304,
272,
372,
13781,
1182,
653,
28466,
63,
4227,
63,
15048,
199,
199,
318,
13781,
63,
9618,
8,
9618,
304,
272,
372,
13781,
450,
653,
28466,
63,
4227,
63,
15048,
199,
199,
318,
13781,
63,
495,
8,
9618,
304,
272,
620,
275,
2071,
21,
85,
4111,
1643,
85,
2,
450,
334,
9618,
63,
4855,
8,
9618,
395,
13781,
63,
9618,
8,
9618,
1826,
272,
372,
620,
199,
199,
318,
1050,
63,
3200,
8,
807,
12,
790,
12,
574,
304,
199,
198,
692,
440,
1211,
14,
1989,
63,
498,
8,
498,
304,
507,
198,
807,
59,
498,
61,
275,
334,
585,
12,
574,
12,
574,
12,
413,
9,
199,
198,
2836,
26,
507,
198,
827,
12,
1390,
12,
12402,
12,
2338,
275,
1211,
59,
498,
61,
507,
198,
692,
574,
665,
1748,
26,
686,
198,
827,
275,
574,
507,
198,
692,
574,
690,
1390,
26,
686,
198,
988,
275,
574,
507,
198,
8595,
275,
334,
8595,
435,
574,
9,
1182,
499,
507,
198,
807,
59,
498,
61,
275,
334,
827,
12,
1390,
12,
12402,
12,
2338,
435,
413,
9,
199,
199,
318,
5436,
63,
5125,
837,
272,
870,
4582,
88,
17,
66,
59,
40,
60,
88,
17,
66,
59,
18,
42,
531,
199,
199,
14274,
63,
2491,
63,
4050,
379,
275,
756,
199,
199,
893,
26,
199,
198,
646,
13968,
199,
198,
6744,
63,
475,
63,
344,
275,
469,
507,
198,
7,
88,
1184,
63,
772,
356,
13968,
14,
13802,
63,
1184,
63,
772,
12,
507,
198,
7,
4468,
7,
198,
26,
13968,
14,
13802,
63,
18554,
12,
507,
198,
7,
4674,
772,
7,
198,
26,
13968,
14,
13802,
63,
13033,
772,
12,
507,
198,
7,
20638,
7,
198,
26,
13968,
14,
13802,
63,
48,
4222,
12,
507,
198,
7,
20638,
772,
7,
198,
26,
13968,
14,
13802,
63,
48,
4222,
772,
12,
507,
198,
1159,
12302,
7,
198,
26,
13968,
14,
13802,
63,
51,
12302,
12,
507,
198,
1159,
12302,
88,
7,
198,
26,
13968,
14,
13802,
63,
51,
12302,
56,
12,
507,
198,
7,
73,
8040,
7,
198,
26,
13968,
14,
13802,
63,
56,
1184,
12,
507,
198,
7,
73,
26888,
7,
198,
26,
13968,
14,
13802,
63,
56,
1184,
12,
507,
198,
7,
73,
10253,
7,
198,
26,
13968,
14,
13802,
63,
56,
1184,
12,
199,
198,
93,
199,
198,
893,
26,
507,
198,
6744,
63,
475,
63,
344,
459,
285,
278,
66,
418,
275,
13968,
14,
13802,
63,
689,
3635,
34,
199,
198,
2590,
26,
507,
198,
1529,
199,
198,
6744,
63,
344,
275,
6844,
63,
475,
63,
344,
59,
736,
14,
16040,
3430,
20,
2677,
199,
2590,
26,
199,
198,
692,
440,
13968,
63,
2491,
63,
4050,
379,
26,
507,
198,
14274,
63,
2491,
63,
4050,
379,
275,
715,
507,
198,
1361,
298,
8154,
314,
13968,
13,
8450,
13,
1548,
2559,
370,
664,
18901,
1561,
2,
199,
199,
318,
18901,
63,
354,
8,
344,
304,
199,
198,
893,
26,
507,
198,
1107,
13968,
14,
14274,
63,
19444,
63,
475,
63,
354,
8,
344,
12,
6844,
63,
344,
9,
199,
198,
2590,
26,
507,
198,
1107,
620,
8,
344,
9,
199,
199,
318,
410,
17844,
8,
7865,
304,
199,
198,
893,
26,
507,
198,
1107,
7554,
14,
28857,
59,
2101,
8,
7865,
1874,
199,
198,
2590,
26,
507,
198,
1107,
298,
5912,
450,
68,
7554,
2,
450,
14762,
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,
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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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
] |
hatstand/webcal-filter
|
lib/icalendar/tests/test_recurrence.py
|
4
|
2062
|
# -*- coding: utf-8 -*-
from icalendar.caselessdict import CaselessDict
from icalendar.tests import unittest
import datetime
import icalendar
import os
import pytz
class TestRecurrence(unittest.TestCase):
def setUp(self):
directory = os.path.dirname(__file__)
self.cal = icalendar.Calendar.from_ical(
open(os.path.join(directory, 'recurrence.ics'), 'rb').read()
)
def test_recurrence_exdates_one_line(self):
first_event = self.cal.walk('vevent')[0]
self.assertIsInstance(first_event, CaselessDict)
self.assertEqual(
first_event['rrule'], {'COUNT': [100], 'FREQ': ['DAILY']}
)
self.assertEqual(
first_event['exdate'].to_ical(),
b'19960402T010000Z,19960403T010000Z,19960404T010000Z'
)
self.assertEqual(
first_event['exdate'].dts[0].dt,
pytz.utc.localize(datetime.datetime(1996, 4, 2, 1, 0))
)
self.assertEqual(
first_event['exdate'].dts[1].dt,
pytz.utc.localize(datetime.datetime(1996, 4, 3, 1, 0))
)
self.assertEqual(
first_event['exdate'].dts[2].dt,
pytz.utc.localize(datetime.datetime(1996, 4, 4, 1, 0))
)
def test_recurrence_exdates_multiple_lines(self):
event = self.cal.walk('vevent')[1]
exdate = event['exdate']
# TODO: DOCUMENT BETTER!
# In this case we have multiple EXDATE definitions, one per line.
# Icalendar makes a list out of this instead of zipping it into one
# vDDDLists object. Actually, this feels correct for me, as it also
# allows to define different timezones per exdate line - but client
# code has to handle this as list and not blindly expecting to be able
# to call event['EXDATE'].to_ical() on it:
self.assertEqual(isinstance(exdate, list), True) # multiple EXDATE
self.assertEqual(exdate[0].to_ical(), b'20120529T100000')
# TODO: test for embedded timezone information!
|
mit
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
504,
284,
8183,
14,
2546,
2003,
807,
492,
12425,
2003,
2141,
199,
504,
284,
8183,
14,
2219,
492,
2882,
199,
199,
646,
2197,
199,
646,
284,
8183,
199,
646,
747,
199,
646,
15444,
421,
199,
533,
1379,
14244,
4646,
8,
2796,
14,
1746,
304,
339,
347,
3613,
8,
277,
304,
267,
2082,
275,
747,
14,
515,
14,
3475,
3460,
493,
3368,
267,
291,
14,
915,
275,
284,
8183,
14,
18688,
14,
504,
63,
2652,
8,
288,
1551,
8,
736,
14,
515,
14,
904,
8,
3619,
12,
283,
6794,
4646,
14,
2932,
659,
283,
4848,
1959,
739,
342,
267,
776,
339,
347,
511,
63,
6794,
4646,
63,
476,
9356,
63,
368,
63,
604,
8,
277,
304,
267,
1642,
63,
1430,
275,
291,
14,
915,
14,
7757,
360,
432,
782,
5832,
16,
61,
398,
291,
14,
6926,
8,
2246,
63,
1430,
12,
12425,
2003,
2141,
9,
267,
291,
14,
629,
8,
288,
1642,
63,
1430,
459,
82,
2200,
995,
791,
8760,
356,
359,
1960,
467,
283,
38,
14583,
356,
788,
36,
6593,
57,
12074,
267,
776,
398,
291,
14,
629,
8,
288,
1642,
63,
1430,
459,
476,
602,
2278,
475,
63,
2652,
1062,
288,
330,
7,
7155,
30320,
996,
52,
614,
993,
58,
12,
7155,
30320,
1644,
52,
614,
993,
58,
12,
7155,
30320,
966,
52,
614,
993,
58,
7,
267,
776,
398,
291,
14,
629,
8,
288,
1642,
63,
1430,
459,
476,
602,
2278,
68,
1086,
59,
16,
1055,
3583,
12,
288,
15444,
14,
5834,
14,
21279,
8,
2083,
14,
2083,
8,
7155,
22,
12,
841,
12,
499,
12,
413,
12,
378,
430,
267,
776,
398,
291,
14,
629,
8,
288,
1642,
63,
1430,
459,
476,
602,
2278,
68,
1086,
59,
17,
1055,
3583,
12,
288,
15444,
14,
5834,
14,
21279,
8,
2083,
14,
2083,
8,
7155,
22,
12,
841,
12,
650,
12,
413,
12,
378,
430,
267,
776,
398,
291,
14,
629,
8,
288,
1642,
63,
1430,
459,
476,
602,
2278,
68,
1086,
59,
18,
1055,
3583,
12,
288,
15444,
14,
5834,
14,
21279,
8,
2083,
14,
2083,
8,
7155,
22,
12,
841,
12,
841,
12,
413,
12,
378,
430,
267,
776,
339,
347,
511,
63,
6794,
4646,
63,
476,
9356,
63,
6048,
63,
1278,
8,
277,
304,
267,
1566,
275,
291,
14,
915,
14,
7757,
360,
432,
782,
5832,
17,
61,
398,
444,
602,
275,
1566,
459,
476,
602,
418,
398,
327,
3254,
26,
29970,
699,
1573,
1,
267,
327,
1010,
642,
1930,
781,
1172,
3663,
3651,
5390,
10269,
12,
1373,
1126,
1004,
14,
267,
327,
473,
8183,
7704,
282,
769,
734,
402,
642,
3140,
402,
3482,
4073,
652,
1901,
1373,
267,
327,
373,
5745,
36,
15116,
909,
14,
18982,
3163,
12,
642,
1964,
18099,
3211,
367,
562,
12,
465,
652,
2597,
267,
327,
6127,
370,
5627,
3365,
7137,
83,
1126,
444,
602,
1004,
446,
1325,
1890,
267,
327,
1233,
965,
370,
2429,
642,
465,
769,
436,
440,
330,
24491,
590,
21055,
370,
506,
7688,
267,
327,
370,
1240,
1566,
459,
1438,
5390,
2278,
475,
63,
2652,
342,
641,
652,
26,
267,
291,
14,
629,
8,
6074,
8,
476,
602,
12,
769,
395,
715,
9,
221,
327,
3663,
3651,
5390,
267,
291,
14,
629,
8,
476,
602,
59,
16,
1055,
475,
63,
2652,
1062,
330,
7,
1797,
10629,
1398,
52,
15274,
358,
398,
327,
3254,
26,
511,
367,
12169,
7137,
2556,
1,
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
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
504,
284,
8183,
14,
2546,
2003,
807,
492,
12425,
2003,
2141,
199,
504,
284,
8183,
14,
2219,
492,
2882,
199,
199,
646,
2197,
199,
646,
284,
8183,
199,
646,
747,
199,
646,
15444,
421,
199,
533,
1379,
14244,
4646,
8,
2796,
14,
1746,
304,
339,
347,
3613,
8,
277,
304,
267,
2082,
275,
747,
14,
515,
14,
3475,
3460,
493,
3368,
267,
291,
14,
915,
275,
284,
8183,
14,
18688,
14,
504,
63,
2652,
8,
288,
1551,
8,
736,
14,
515,
14,
904,
8,
3619,
12,
283,
6794,
4646,
14,
2932,
659,
283,
4848,
1959,
739,
342,
267,
776,
339,
347,
511,
63,
6794,
4646,
63,
476,
9356,
63,
368,
63,
604,
8,
277,
304,
267,
1642,
63,
1430,
275,
291,
14,
915,
14,
7757,
360,
432,
782,
5832,
16,
61,
398,
291,
14,
6926,
8,
2246,
63,
1430,
12,
12425,
2003,
2141,
9,
267,
291,
14,
629,
8,
288,
1642,
63,
1430,
459,
82,
2200,
995,
791,
8760,
356,
359,
1960,
467,
283,
38,
14583,
356,
788,
36,
6593,
57,
12074,
267,
776,
398,
291,
14,
629,
8,
288,
1642,
63,
1430,
459,
476,
602,
2278,
475,
63,
2652,
1062,
288,
330,
7,
7155,
30320,
996,
52,
614,
993,
58,
12,
7155,
30320,
1644,
52,
614,
993,
58,
12,
7155,
30320,
966,
52,
614,
993,
58,
7,
267,
776,
398,
291,
14,
629,
8,
288,
1642,
63,
1430,
459,
476,
602,
2278,
68,
1086,
59,
16,
1055,
3583,
12,
288,
15444,
14,
5834,
14,
21279,
8,
2083,
14,
2083,
8,
7155,
22,
12,
841,
12,
499,
12,
413,
12,
378,
430,
267,
776,
398,
291,
14,
629,
8,
288,
1642,
63,
1430,
459,
476,
602,
2278,
68,
1086,
59,
17,
1055,
3583,
12,
288,
15444,
14,
5834,
14,
21279,
8,
2083,
14,
2083,
8,
7155,
22,
12,
841,
12,
650,
12,
413,
12,
378,
430,
267,
776,
398,
291,
14,
629,
8,
288,
1642,
63,
1430,
459,
476,
602,
2278,
68,
1086,
59,
18,
1055,
3583,
12,
288,
15444,
14,
5834,
14,
21279,
8,
2083,
14,
2083,
8,
7155,
22,
12,
841,
12,
841,
12,
413,
12,
378,
430,
267,
776,
339,
347,
511,
63,
6794,
4646,
63,
476,
9356,
63,
6048,
63,
1278,
8,
277,
304,
267,
1566,
275,
291,
14,
915,
14,
7757,
360,
432,
782,
5832,
17,
61,
398,
444,
602,
275,
1566,
459,
476,
602,
418,
398,
327,
3254,
26,
29970,
699,
1573,
1,
267,
327,
1010,
642,
1930,
781,
1172,
3663,
3651,
5390,
10269,
12,
1373,
1126,
1004,
14,
267,
327,
473,
8183,
7704,
282,
769,
734,
402,
642,
3140,
402,
3482,
4073,
652,
1901,
1373,
267,
327,
373,
5745,
36,
15116,
909,
14,
18982,
3163,
12,
642,
1964,
18099,
3211,
367,
562,
12,
465,
652,
2597,
267,
327,
6127,
370,
5627,
3365,
7137,
83,
1126,
444,
602,
1004,
446,
1325,
1890,
267,
327,
1233,
965,
370,
2429,
642,
465,
769,
436,
440,
330,
24491,
590,
21055,
370,
506,
7688,
267,
327,
370,
1240,
1566,
459,
1438,
5390,
2278,
475,
63,
2652,
342,
641,
652,
26,
267,
291,
14,
629,
8,
6074,
8,
476,
602,
12,
769,
395,
715,
9,
221,
327,
3663,
3651,
5390,
267,
291,
14,
629,
8,
476,
602,
59,
16,
1055,
475,
63,
2652,
1062,
330,
7,
1797,
10629,
1398,
52,
15274,
358,
398,
327,
3254,
26,
511,
367,
12169,
7137,
2556,
1,
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,
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,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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
] |
bblacey/FreeCAD-MacOS-CI
|
src/Tools/generate.py
|
15
|
2336
|
#! python
# -*- coding: utf-8 -*-
# (c) 2006 Jürgen Riegel GPL
Usage = """generate - generates a FreeCAD Module out of an XML model
Usage:
generate [Optionen] Model.xml Model2.xml Model3.xml ...
Options:
-h, --help print this help
-o, --outputPath specify the output path if differs from source path
Generate source code out of an model definition.
Autor:
(c) 2006 Juergen Riegel
juergen.riegel@web.de
Licence: GPL
Version:
0.2
"""
import os,sys,string,re,getopt,codecs,binascii
import generateBase.generateModel_Module
import generateTemplates.templateModule
import generateTemplates.templateClassPyExport
# Globals
def generate(filename,path):
# load model
GenerateModelInst = generateBase.generateModel_Module.parse(filename)
if(len(GenerateModelInst.Module)!=0):
Module= generateTemplates.templateModule.TemplateModule()
Module.path = path
Module.module = GenerateModelInst.Module[0]
Module.Generate()
print "Done generating: " + GenerateModelInst.Module[0].Name
else:
Export = generateTemplates.templateClassPyExport.TemplateClassPyExport()
Export.path = path+"/"
Export.dirname = os.path.dirname(filename)+"/";
Export.export = GenerateModelInst.PythonExport[0]
Export.Generate()
print "Done generating: " + GenerateModelInst.PythonExport[0].Name
def main():
defaultPath = ""
class generateOutput:
def write(self, data):
pass
sys.stdout=generateOutput()
try:
opts, args = getopt.getopt(sys.argv[1:], "ho:", ["help","outputPath="])
except getopt.GetoptError:
# print help information and exit:
sys.stderr.write(Usage)
sys.exit(2)
# checking on the options
for o, a in opts:
if o in ("-h", "--help"):
sys.stderr.write(Usage)
sys.exit()
if o in ("-o", "--outputPath"):
defaultPath = a
# runing through the files
if (len(args) ==0):
#sys.stderr.write(Usage)
generate("../Mod/PartDesign/PartDesign_Model.xml")
else:
for i in args:
filename = os.path.abspath(i)
if(defaultPath == ""):
head,tail = os.path.split(filename)
print head,tail
generate(filename,head)
else:
generate(filename,defaultPath)
if __name__ == "__main__":
main()
|
lgpl-2.1
|
[
3168,
2366,
202,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
202,
199,
3,
334,
67,
9,
8315,
1603,
17709,
82,
2268,
820,
1873,
24920,
221,
14629,
2999,
199,
7692,
275,
408,
4208,
446,
12821,
282,
20914,
5673,
734,
402,
376,
4692,
1402,
2999,
199,
7692,
26,
15497,
3550,
359,
2602,
287,
61,
5822,
14,
1652,
5822,
18,
14,
1652,
5822,
19,
14,
1652,
2263,
1128,
202,
199,
4558,
26,
1223,
446,
72,
12,
1553,
3437,
3515,
870,
642,
1720,
1223,
446,
79,
12,
1553,
1199,
2042,
259,
4165,
314,
1072,
931,
340,
22754,
687,
1350,
931,
10292,
202,
199,
6864,
1350,
1233,
734,
402,
376,
1402,
5492,
14,
1128,
202,
199,
33,
4139,
26,
10292,
334,
67,
9,
8315,
1603,
14262,
2268,
820,
1873,
24920,
10292,
1335,
14262,
2268,
14,
11317,
24920,
32,
2520,
14,
271,
1223,
198,
44,
530,
4894,
26,
14629,
2999,
199,
3353,
26,
10292,
378,
14,
18,
202,
199,
624,
2999,
199,
646,
747,
12,
1274,
12,
875,
12,
264,
12,
18907,
12,
8933,
12,
27460,
202,
199,
646,
3550,
1563,
14,
4208,
1685,
63,
2377,
202,
199,
646,
3550,
17969,
14,
1160,
2377,
202,
199,
646,
3550,
17969,
14,
1160,
2543,
2713,
11399,
8065,
199,
3,
13641,
83,
2999,
199,
318,
3550,
8,
1501,
12,
515,
304,
10292,
327,
2248,
1402,
10292,
7958,
1685,
10083,
275,
3550,
1563,
14,
4208,
1685,
63,
2377,
14,
1122,
8,
1501,
9,
25052,
340,
8,
552,
8,
6864,
1685,
10083,
14,
2377,
9,
1111,
16,
304,
26259,
5673,
29,
3550,
17969,
14,
1160,
2377,
14,
4231,
2377,
342,
1128,
5673,
14,
515,
275,
931,
1128,
5673,
14,
578,
275,
7958,
1685,
10083,
14,
2377,
59,
16,
61,
1128,
5673,
14,
6864,
342,
1128,
870,
298,
10759,
12999,
26,
298,
435,
7958,
1685,
10083,
14,
2377,
59,
16,
1055,
985,
10292,
587,
26,
1128,
20220,
275,
3550,
17969,
14,
1160,
2543,
2713,
11399,
14,
4231,
2543,
2713,
11399,
342,
1128,
20220,
14,
515,
275,
931,
5207,
6687,
272,
20220,
14,
3475,
275,
747,
14,
515,
14,
3475,
8,
1501,
18663,
6687,
27,
1128,
20220,
14,
3790,
275,
7958,
1685,
10083,
14,
4718,
11399,
59,
16,
61,
1128,
20220,
14,
6864,
342,
1128,
870,
298,
10759,
12999,
26,
298,
435,
7958,
1685,
10083,
14,
4718,
11399,
59,
16,
1055,
985,
8428,
15497,
15497,
15497,
15497,
8065,
199,
318,
2446,
837,
1223,
198,
885,
2042,
275,
3087,
1223,
198,
533,
3550,
2959,
26,
507,
198,
318,
2218,
8,
277,
12,
666,
304,
686,
198,
1529,
257,
1223,
198,
1274,
14,
2703,
29,
4208,
2959,
342,
28111,
198,
893,
26,
4122,
198,
3291,
12,
1249,
275,
12733,
14,
18907,
8,
1274,
14,
3020,
59,
17,
8429,
298,
526,
6783,
2097,
3437,
2266,
1199,
2042,
628,
566,
1223,
198,
2590,
12733,
14,
1002,
29368,
26,
4122,
198,
3,
870,
1720,
2556,
436,
4458,
26,
4122,
198,
1274,
14,
3083,
14,
952,
8,
7692,
9,
4122,
198,
1274,
14,
2224,
8,
18,
9,
10060,
198,
3,
7907,
641,
314,
1511,
1223,
198,
509,
312,
12,
282,
315,
3999,
26,
4122,
198,
692,
312,
315,
19372,
72,
401,
4320,
3437,
2349,
7903,
198,
1274,
14,
3083,
14,
952,
8,
7692,
9,
7903,
198,
1274,
14,
2224,
342,
4122,
198,
692,
312,
315,
19372,
79,
401,
4320,
1199,
2042,
2349,
7903,
198,
885,
2042,
275,
282,
10060,
1223,
198,
3,
1255,
316,
4012,
314,
1584,
1223,
198,
692,
334,
552,
8,
589,
9,
508,
16,
304,
4122,
198,
3,
1274,
14,
3083,
14,
952,
8,
7692,
9,
4122,
198,
4208,
480,
5093,
9871,
15,
8416,
20924,
15,
8416,
20924,
63,
1685,
14,
1652,
531,
7861,
1223,
198,
2836,
26,
4122,
198,
509,
284,
315,
1249,
26,
7903,
198,
1501,
275,
747,
14,
515,
14,
4832,
8,
73,
9,
7903,
198,
692,
8,
885,
2042,
508,
26430,
13610,
198,
2993,
12,
1521,
275,
747,
14,
515,
14,
1294,
8,
1501,
9,
13610,
198,
1361,
4854,
12,
1521,
13610,
198,
4208,
8,
1501,
12,
2993,
9,
7903,
198,
2836,
26,
13610,
198,
4208,
8,
1501,
12,
885,
2042,
9,
26045,
202,
199,
692,
636,
354,
363,
508,
4396,
973,
5727,
1223,
198,
973,
342,
1223,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
2366,
202,
199,
3,
1882,
2803,
26,
2774,
13,
24,
1882,
202,
199,
3,
334,
67,
9,
8315,
1603,
17709,
82,
2268,
820,
1873,
24920,
221,
14629,
2999,
199,
7692,
275,
408,
4208,
446,
12821,
282,
20914,
5673,
734,
402,
376,
4692,
1402,
2999,
199,
7692,
26,
15497,
3550,
359,
2602,
287,
61,
5822,
14,
1652,
5822,
18,
14,
1652,
5822,
19,
14,
1652,
2263,
1128,
202,
199,
4558,
26,
1223,
446,
72,
12,
1553,
3437,
3515,
870,
642,
1720,
1223,
446,
79,
12,
1553,
1199,
2042,
259,
4165,
314,
1072,
931,
340,
22754,
687,
1350,
931,
10292,
202,
199,
6864,
1350,
1233,
734,
402,
376,
1402,
5492,
14,
1128,
202,
199,
33,
4139,
26,
10292,
334,
67,
9,
8315,
1603,
14262,
2268,
820,
1873,
24920,
10292,
1335,
14262,
2268,
14,
11317,
24920,
32,
2520,
14,
271,
1223,
198,
44,
530,
4894,
26,
14629,
2999,
199,
3353,
26,
10292,
378,
14,
18,
202,
199,
624,
2999,
199,
646,
747,
12,
1274,
12,
875,
12,
264,
12,
18907,
12,
8933,
12,
27460,
202,
199,
646,
3550,
1563,
14,
4208,
1685,
63,
2377,
202,
199,
646,
3550,
17969,
14,
1160,
2377,
202,
199,
646,
3550,
17969,
14,
1160,
2543,
2713,
11399,
8065,
199,
3,
13641,
83,
2999,
199,
318,
3550,
8,
1501,
12,
515,
304,
10292,
327,
2248,
1402,
10292,
7958,
1685,
10083,
275,
3550,
1563,
14,
4208,
1685,
63,
2377,
14,
1122,
8,
1501,
9,
25052,
340,
8,
552,
8,
6864,
1685,
10083,
14,
2377,
9,
1111,
16,
304,
26259,
5673,
29,
3550,
17969,
14,
1160,
2377,
14,
4231,
2377,
342,
1128,
5673,
14,
515,
275,
931,
1128,
5673,
14,
578,
275,
7958,
1685,
10083,
14,
2377,
59,
16,
61,
1128,
5673,
14,
6864,
342,
1128,
870,
298,
10759,
12999,
26,
298,
435,
7958,
1685,
10083,
14,
2377,
59,
16,
1055,
985,
10292,
587,
26,
1128,
20220,
275,
3550,
17969,
14,
1160,
2543,
2713,
11399,
14,
4231,
2543,
2713,
11399,
342,
1128,
20220,
14,
515,
275,
931,
5207,
6687,
272,
20220,
14,
3475,
275,
747,
14,
515,
14,
3475,
8,
1501,
18663,
6687,
27,
1128,
20220,
14,
3790,
275,
7958,
1685,
10083,
14,
4718,
11399,
59,
16,
61,
1128,
20220,
14,
6864,
342,
1128,
870,
298,
10759,
12999,
26,
298,
435,
7958,
1685,
10083,
14,
4718,
11399,
59,
16,
1055,
985,
8428,
15497,
15497,
15497,
15497,
8065,
199,
318,
2446,
837,
1223,
198,
885,
2042,
275,
3087,
1223,
198,
533,
3550,
2959,
26,
507,
198,
318,
2218,
8,
277,
12,
666,
304,
686,
198,
1529,
257,
1223,
198,
1274,
14,
2703,
29,
4208,
2959,
342,
28111,
198,
893,
26,
4122,
198,
3291,
12,
1249,
275,
12733,
14,
18907,
8,
1274,
14,
3020,
59,
17,
8429,
298,
526,
6783,
2097,
3437,
2266,
1199,
2042,
628,
566,
1223,
198,
2590,
12733,
14,
1002,
29368,
26,
4122,
198,
3,
870,
1720,
2556,
436,
4458,
26,
4122,
198,
1274,
14,
3083,
14,
952,
8,
7692,
9,
4122,
198,
1274,
14,
2224,
8,
18,
9,
10060,
198,
3,
7907,
641,
314,
1511,
1223,
198,
509,
312,
12,
282,
315,
3999,
26,
4122,
198,
692,
312,
315,
19372,
72,
401,
4320,
3437,
2349,
7903,
198,
1274,
14,
3083,
14,
952,
8,
7692,
9,
7903,
198,
1274,
14,
2224,
342,
4122,
198,
692,
312,
315,
19372,
79,
401,
4320,
1199,
2042,
2349,
7903,
198,
885,
2042,
275,
282,
10060,
1223,
198,
3,
1255,
316,
4012,
314,
1584,
1223,
198,
692,
334,
552,
8,
589,
9,
508,
16,
304,
4122,
198,
3,
1274,
14,
3083,
14,
952,
8,
7692,
9,
4122,
198,
4208,
480,
5093,
9871,
15,
8416,
20924,
15,
8416,
20924,
63,
1685,
14,
1652,
531,
7861,
1223,
198,
2836,
26,
4122,
198,
509,
284,
315,
1249,
26,
7903,
198,
1501,
275,
747,
14,
515,
14,
4832,
8,
73,
9,
7903,
198,
692,
8,
885,
2042,
508,
26430,
13610,
198,
2993,
12,
1521,
275,
747,
14,
515,
14,
1294,
8,
1501,
9,
13610,
198,
1361,
4854,
12,
1521,
13610,
198,
4208,
8,
1501,
12,
2993,
9,
7903,
198,
2836,
26,
13610,
198,
4208,
8,
1501,
12,
885,
2042,
9,
26045,
202,
199,
692,
636,
354,
363,
508,
4396,
973,
5727,
1223,
198,
973,
342,
1223,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
joshzarrabi/e-mission-server
|
emission/analysis/plotting/leaflet_osm/our_plotter.py
|
1
|
14864
|
import pandas as pd
import folium.folium as folium
import itertools
import numpy as np
import logging
import geojson as gj
import copy
import attrdict as ad
from functional import seq
# import emission.analysis.classification.cleaning.location_smoothing as ls
import bson.json_util as bju
import emission.storage.decorations.location_queries as lq
import emission.storage.decorations.trip_queries as esdt
import emission.storage.decorations.place_queries as esdp
import emission.storage.decorations.stop_queries as esds
import emission.storage.decorations.section_queries as esdsc
import emission.storage.timeseries.abstract_timeseries as esta
import emission.core.wrapper.stop as ecws
import emission.core.wrapper.section as ecwsc
import emission.analysis.plotting.geojson.geojson_feature_converter as gfc
import emission.analysis.plotting.leaflet_osm.folium_geojson_plugin as fgjp
import emission.net.usercache.abstract_usercache as enua
import emission.net.api.usercache as enau
all_color_list = ['black', 'brown', 'blue', 'chocolate', 'cyan', 'fuschia', 'green', 'lime', 'magenta', 'navy', 'pink', 'purple', 'red', 'snow', 'yellow']
sel_color_list = ['black', 'blue', 'chocolate', 'cyan', 'fuschia', 'green', 'lime', 'magenta', 'pink', 'purple', 'red', 'yellow']
def df_to_string_list(df):
"""
Convert the input df into a list of strings, suitable for using as popups in a map.
This is a utility function.
"""
# print "Converting df with size %s to string list" % df.shape[0]
array_list = df.to_dict(orient='records')
return [str(line) for line in array_list]
def get_maps_for_range(user_id, start_ts, end_ts):
map_list = []
geojson_list = gfc.get_geojson_for_ts(user_id, start_ts, end_ts)
return get_maps_for_geojson_list(geojson_list)
def get_maps_for_usercache(user_id):
data_to_phone = seq(enau.sync_server_to_phone(user_id))
logging.debug("Before pipeline, trips to phone list has length %d" % len(data_to_phone.to_list()))
logging.debug("keys are %s" % data_to_phone.map(lambda e: ad.AttrDict(e).metadata.key))
trips_to_phone = data_to_phone.map(lambda e: ad.AttrDict(e))\
.filter(lambda e: e.metadata.key.startswith("diary/trips")) \
.map(lambda e: e.data)
logging.debug("After pipeline, trips to phone list has length %d" % len(trips_to_phone.to_list()))
# logging.debug("trips_to_phone = %s" % trips_to_phone)
maps_for_day = []
for day in trips_to_phone:
maps_for_day.append(get_maps_for_geojson_list(day))
return maps_for_day
def get_maps_for_geojson_list(trip_geojson_list):
map_list = []
for trip_doc in trip_geojson_list:
# logging.debug(trip_doc)
trip_geojson = ad.AttrDict(trip_doc)
logging.debug("centering based on start = %s, end = %s " % (trip_geojson.features[0], trip_geojson.features[1]))
flipped_midpoint = lambda(p1, p2): [(p1.coordinates[1] + p2.coordinates[1])/2,
(p1.coordinates[0] + p2.coordinates[0])/2]
curr_map = folium.Map(flipped_midpoint((trip_geojson.features[0].geometry,
trip_geojson.features[1].geometry)))
curr_plugin = fgjp.FoliumGeojsonPlugin(dict(trip_geojson))
curr_map.add_plugin(curr_plugin)
map_list.append(curr_map)
return map_list
def flipped(coord):
return (coord[1], coord[0])
def get_center_for_map(coords):
# logging.debug(trip_geojson)
midpoint = lambda(p1, p2): [(p1[0] + p2[0])/2,
(p1[1] + p2[1])/2]
if len(coords) == 0:
return None
if len(coords) == 1:
return flipped(coords)
if len(coords) > 0:
logging.debug("Getting midpoint of %s and %s" % (coords[0], coords[-1]))
return flipped(midpoint((coords[0], coords[-1])))
def get_maps_for_geojson_unsectioned(feature_list):
map_list = []
for feature in feature_list:
# logging.debug("Getting map for feature %s" % bju.dumps(feature))
feature_coords = list(get_coords(feature))
# feature_coords = list(gj.utils.coords(feature))
curr_map = folium.Map(get_center_for_map(feature_coords))
curr_plugin = fgjp.FoliumGeojsonPlugin(dict(feature))
curr_map.add_plugin(curr_plugin)
map_list.append(curr_map)
return map_list
def get_coords(feature):
# logging.debug("Getting coordinates for feature %s" % bju.dumps(feature))
if feature["type"] == "FeatureCollection":
retVal = []
for f in feature["features"]:
retVal.extend(get_coords(f))
return retVal
else:
return gj.utils.coords(feature)
def get_maps_for_range_old(user_id, start_ts, end_ts):
# First, get the timeline for that range.
ts = esta.TimeSeries.get_time_series(user_id)
trip_list = esdt.get_trips(user_id, enua.UserCache.TimeQuery("start_ts", start_ts, end_ts))
# TODO: Should the timeline support random access as well?
# If it did, we wouldn't need this additional map
# I think that it would be good to support a doubly linked list, i.e. prev and next in addition
# to the iteration interface
place_list = esdp.get_places(user_id, enua.UserCache.TimeQuery("exit_ts", start_ts, end_ts))
place_list = place_list + (esdp.get_places(user_id, enua.UserCache.TimeQuery("enter_ts", start_ts, end_ts)))
place_map = dict([(p.get_id(), p) for p in place_list])
map_list = []
flipped_midpoint = lambda(p1, p2): [(p1.coordinates[1] + p2.coordinates[1])/2,
(p1.coordinates[0] + p2.coordinates[0])/2]
for i, trip in enumerate(trip_list):
logging.debug("-" * 20 + trip.start_fmt_time + "=>" + trip.end_fmt_time
+ "(" + str(trip.end_ts - trip.start_ts) + ")")
if (len(esdt.get_sections_for_trip(user_id, trip.get_id())) == 0 and
len(esdt.get_stops_for_trip(user_id, trip.get_id())) == 0):
logging.debug("Skipping trip because it has no stops and no sections")
continue
start_point = gj.GeoJSON.to_instance(trip.start_loc)
end_point = gj.GeoJSON.to_instance(trip.end_loc)
curr_map = folium.Map(flipped_midpoint((start_point, end_point)))
map_list.append(curr_map)
logging.debug("About to display places %s and %s" % (trip.start_place, trip.end_place))
update_place(curr_map, trip.start_place, place_map, marker_color='green')
update_place(curr_map, trip.end_place, place_map, marker_color='red')
# TODO: Should get_timeline_for_trip work on a trip_id or on a trip object
# it seems stupid to convert trip object -> id -> trip object
curr_trip_timeline = esdt.get_timeline_for_trip(user_id, trip.get_id())
for i, trip_element in enumerate(curr_trip_timeline):
# logging.debug("Examining element %s of type %s" % (trip_element, type(trip_element)))
if type(trip_element) == ecws.Stop:
time_query = esds.get_time_query_for_stop(trip_element.get_id())
logging.debug("time_query for stop %s = %s" % (trip_element, time_query))
stop_points_df = ts.get_data_df("background/filtered_location", time_query)
# logging.debug("stop_points_df.head() = %s" % stop_points_df.head())
if len(stop_points_df) > 0:
update_line(curr_map, stop_points_df, line_color = sel_color_list[-1],
popup="%s -> %s" % (trip_element.enter_fmt_time, trip_element.exit_fmt_time))
else:
assert(type(trip_element) == ecwsc.Section)
time_query = esdsc.get_time_query_for_section(trip_element.get_id())
logging.debug("time_query for section %s = %s" %
(trip_element, "[%s,%s,%s]" % (time_query.timeType, time_query.startTs, time_query.endTs)))
section_points_df = ts.get_data_df("background/filtered_location", time_query)
logging.debug("section_points_df.tail() = %s" % section_points_df.tail())
if len(section_points_df) > 0:
update_line(curr_map, section_points_df, line_color = sel_color_list[trip_element.sensed_mode.value],
popup="%s (%s -> %s)" % (trip_element.sensed_mode, trip_element.start_fmt_time,
trip_element.end_fmt_time))
else:
logging.warn("found no points for section %s" % trip_element)
return map_list
def update_place(curr_map, place_id, place_map, marker_color='blue'):
if place_id is not None and place_id in place_map:
place = place_map[place_id]
logging.debug("Retrieved place %s" % place)
if hasattr(place, "location"):
coords = copy.copy(place.location.coordinates)
coords.reverse()
logging.debug("Displaying place at %s" % coords)
curr_map.simple_marker(location=coords, popup=str(place), marker_color=marker_color)
else:
logging.debug("starting place has no location, skipping")
else:
logging.warn("place not mapped because place_id = %s and place_id in place_map = %s" % (place_id, place_id in place_map))
def update_line(currMap, line_points, line_color = None, popup=None):
currMap.div_markers(line_points[['latitude', 'longitude']].as_matrix().tolist(),
df_to_string_list(line_points), marker_size=5)
currMap.line(line_points[['latitude', 'longitude']].as_matrix().tolist(),
line_color = line_color,
popup = popup)
##########################
# Everything below this line is from the time when we were evaluating
# segmentation and can potentially be deleted. It is also likely to have bitrotted.
# Let's hold off a bit on that until we have the replacement, though
##########################
def get_map_list(df, potential_splits):
mapList = []
potential_splits_list = list(potential_splits)
for start, end in zip(potential_splits_list, potential_splits_list[1:]):
trip = df[start:end]
print "Considering trip from %s to %s because start = %d and end = %d" % (df.formatted_time.loc[start], df.formatted_time.loc[end], start, end)
if end - start < 4:
# If there are only 3 entries, that means that there is only one
# point other than the start and the end, bail
print "Ignoring trip from %s to %s because start = %d and end = %d" % (df.formatted_time.loc[start], df.formatted_time.loc[end], start, end)
continue
mapList.append(get_map(trip))
return mapList
def get_map_list_after_segmentation(section_map, outlier_algo = None, filter_algo = None):
mapList = []
for trip, section_list in section_map:
logging.debug("%s %s -> %s %s" % ("=" * 20, trip.start_time, trip.end_time, "=" * 20))
trip_df = lq.get_points_for_section(trip)
curr_map = folium.Map([trip_df.mLatitude.mean(), trip_df.mLongitude.mean()])
last_section_end = None
for (i, section) in enumerate(section_list):
logging.debug("%s %s: %s -> %s %s" %
("-" * 20, i, section.start_time, section.end_time, "-" * 20))
raw_section_df = trip_df[np.logical_and(trip_df.mTime >= section.start_ts,
trip_df.mTime <= section.end_ts)]
section_df = ls.filter_points(raw_section_df, outlier_algo, filter_algo)
if section_df.shape[0] == 0:
logging.info("Found empty df! skipping...")
continue
logging.debug("for section %s, section_df.shape = %s, formatted_time.head() = %s" %
(section, section_df.shape, section_df["formatted_time"].head()))
update_map(curr_map, section_df, line_color = sel_color_list[section.activity.value],
popup = "%s" % (section.activity))
if section_df.shape[0] > 0:
curr_section_start = section_df.iloc[0]
if i != 0 and last_section_end is not None:
# We want to join this to the previous section.
curr_map.line([[last_section_end.mLatitude, last_section_end.mLongitude],
[curr_section_start.mLatitude, curr_section_start.mLongitude]],
line_color = sel_color_list[-1],
popup = "%s -> %s" % (section_list[i-1].activity, section.activity))
last_section_end = section_df.iloc[-1]
mapList.append(curr_map)
return mapList
def get_map(section_points, line_color = None, popup=None):
currMap = folium.Map([section_points.mLatitude.mean(), section_points.mLongitude.mean()])
update_map(currMap, section_points, line_color, popup)
return currMap
def update_map(currMap, section_points, line_color = None, popup=None):
currMap.div_markers(section_points[['mLatitude', 'mLongitude']].as_matrix().tolist(),
df_to_string_list(section_points), marker_size=5)
currMap.line(section_points[['mLatitude', 'mLongitude']].as_matrix().tolist(),
line_color = line_color,
popup = popup)
def evaluate_filtering(section_list, outlier_algos, filtering_algos):
"""
TODO: Is this the best place for this? If not, what is?
It almost seems like we need to have a separate evaluation module that is
separate from the plotting and the calculation modules.
But then, what is the purpose of this module?
"""
nCols = 2 + len(outlier_algos) * len(filtering_algos)
nRows = len(section_list)
map_list = []
for section in section_list:
curr_compare_list = []
section_df = ls.get_section_points(section)
curr_compare_list.append(get_map(section_df))
curr_compare_list.append(get_map(ls.filter_points(section_df, None, None)))
for (oa, fa) in itertools.product(outlier_algos, filtering_algos):
curr_filtered_df = ls.filter_points(section_df, oa, fa)
print ("After filtering with %s, %s, size is %s" % (oa, fa, curr_filtered_df.shape))
if "activity" in section:
curr_compare_list.append(get_map(curr_filtered_df,
line_color = sel_color_list[section.activity.value],
popup = "%s" % (section.activity)))
else:
curr_compare_list.append(get_map(curr_filtered_df))
assert(len(curr_compare_list) == nCols)
map_list.append(curr_compare_list)
assert(len(map_list) == nRows)
return map_list
|
bsd-3-clause
|
[
646,
10634,
465,
6454,
199,
646,
7090,
317,
453,
14,
545,
317,
453,
465,
7090,
317,
453,
199,
646,
7975,
199,
646,
2680,
465,
980,
199,
646,
2050,
199,
646,
8509,
1001,
465,
486,
74,
199,
646,
1331,
199,
646,
1921,
807,
465,
1503,
199,
504,
22380,
492,
5412,
199,
199,
3,
492,
325,
2250,
14,
10466,
14,
14368,
14,
3118,
316,
14,
1985,
63,
83,
22610,
465,
9100,
199,
646,
330,
834,
14,
1001,
63,
1974,
465,
330,
27764,
199,
199,
646,
325,
2250,
14,
3494,
14,
6518,
1298,
14,
1985,
63,
10590,
465,
634,
81,
199,
646,
325,
2250,
14,
3494,
14,
6518,
1298,
14,
7254,
63,
10590,
465,
9455,
3583,
199,
646,
325,
2250,
14,
3494,
14,
6518,
1298,
14,
2778,
63,
10590,
465,
325,
3893,
80,
199,
646,
325,
2250,
14,
3494,
14,
6518,
1298,
14,
2379,
63,
10590,
465,
9455,
795,
199,
646,
325,
2250,
14,
3494,
14,
6518,
1298,
14,
2792,
63,
10590,
465,
325,
3893,
551,
199,
199,
646,
325,
2250,
14,
3494,
14,
28551,
14,
6198,
63,
28551,
465,
325,
1207,
199,
199,
646,
325,
2250,
14,
1018,
14,
5029,
14,
2379,
465,
7062,
3569,
199,
646,
325,
2250,
14,
1018,
14,
5029,
14,
2792,
465,
7062,
87,
551,
199,
199,
646,
325,
2250,
14,
10466,
14,
2798,
1337,
14,
27043,
14,
27043,
63,
4445,
63,
11256,
465,
486,
3003,
199,
646,
325,
2250,
14,
10466,
14,
2798,
1337,
14,
8914,
2723,
63,
30613,
14,
545,
317,
453,
63,
27043,
63,
2718,
465,
16587,
11538,
199,
199,
646,
325,
2250,
14,
846,
14,
751,
1637,
14,
6198,
63,
751,
1637,
465,
655,
1458,
199,
646,
325,
2250,
14,
846,
14,
1246,
14,
751,
1637,
465,
655,
3844,
199,
199,
452,
63,
2326,
63,
513,
275,
788,
8399,
297,
283,
27133,
297,
283,
6304,
297,
283,
2239,
331,
750,
297,
283,
28291,
297,
283,
31958,
335,
4674,
297,
283,
7731,
297,
283,
18687,
297,
283,
5615,
21335,
297,
283,
10927,
89,
297,
283,
26591,
297,
283,
6653,
11045,
297,
283,
581,
297,
283,
27765,
297,
283,
14514,
418,
199,
5891,
63,
2326,
63,
513,
275,
788,
8399,
297,
283,
6304,
297,
283,
2239,
331,
750,
297,
283,
28291,
297,
283,
31958,
335,
4674,
297,
283,
7731,
297,
283,
18687,
297,
283,
5615,
21335,
297,
283,
26591,
297,
283,
6653,
11045,
297,
283,
581,
297,
283,
14514,
418,
199,
199,
318,
4051,
63,
475,
63,
875,
63,
513,
8,
1587,
304,
272,
408,
272,
7905,
314,
1324,
4051,
1901,
282,
769,
402,
3326,
12,
11233,
367,
1808,
465,
4560,
15203,
315,
282,
2341,
14,
272,
961,
365,
282,
11420,
805,
14,
272,
408,
272,
327,
870,
298,
7619,
1337,
4051,
543,
1568,
450,
83,
370,
1059,
769,
2,
450,
4051,
14,
1392,
59,
16,
61,
272,
1625,
63,
513,
275,
4051,
14,
475,
63,
807,
8,
19676,
534,
6502,
358,
272,
372,
359,
495,
8,
604,
9,
367,
1004,
315,
1625,
63,
513,
61,
199,
199,
318,
664,
63,
8919,
63,
509,
63,
1842,
8,
751,
63,
344,
12,
1343,
63,
1086,
12,
1284,
63,
1086,
304,
272,
2341,
63,
513,
275,
942,
272,
8509,
1001,
63,
513,
275,
486,
3003,
14,
362,
63,
27043,
63,
509,
63,
1086,
8,
751,
63,
344,
12,
1343,
63,
1086,
12,
1284,
63,
1086,
9,
272,
372,
664,
63,
8919,
63,
509,
63,
27043,
63,
513,
8,
27043,
63,
513,
9,
199,
199,
318,
664,
63,
8919,
63,
509,
63,
751,
1637,
8,
751,
63,
344,
304,
272,
666,
63,
475,
63,
9339,
275,
5412,
8,
287,
3844,
14,
5186,
63,
1000,
63,
475,
63,
9339,
8,
751,
63,
344,
430,
272,
2050,
14,
1757,
480,
13569,
7679,
12,
3229,
1190,
370,
14617,
769,
965,
2582,
450,
68,
2,
450,
822,
8,
576,
63,
475,
63,
9339,
14,
475,
63,
513,
4059,
272,
2050,
14,
1757,
480,
1612,
787,
450,
83,
2,
450,
666,
63,
475,
63,
9339,
14,
1130,
8,
2734,
325,
26,
1503,
14,
7144,
2141,
8,
69,
680,
2343,
14,
498,
430,
272,
3229,
1190,
63,
475,
63,
9339,
275,
666,
63,
475,
63,
9339,
14,
1130,
8,
2734,
325,
26,
1503,
14,
7144,
2141,
8,
69,
25105,
2511,
1275,
1541,
8,
2734,
325,
26,
325,
14,
2343,
14,
498,
14,
2460,
480,
328,
695,
15,
599,
1190,
2237,
971,
2511,
1275,
1130,
8,
2734,
325,
26,
325,
14,
576,
9,
272,
2050,
14,
1757,
480,
10881,
7679,
12,
3229,
1190,
370,
14617,
769,
965,
2582,
450,
68,
2,
450,
822,
8,
599,
1190,
63,
475,
63,
9339,
14,
475,
63,
513,
4059,
272,
327,
2050,
14,
1757,
480,
599,
1190,
63,
475,
63,
9339,
275,
450,
83,
2,
450,
3229,
1190,
63,
475,
63,
9339,
9,
272,
9033,
63,
509,
63,
2977,
275,
942,
272,
367,
5382,
315,
3229,
1190,
63,
475,
63,
9339,
26,
267,
9033,
63,
509,
63,
2977,
14,
740,
8,
362,
63,
8919,
63,
509,
63,
27043,
63,
513,
8,
2977,
430,
272,
372,
9033,
63,
509,
63,
2977,
199,
199,
318,
664,
63,
8919,
63,
509,
63,
27043,
63,
513,
8,
7254,
63,
27043,
63,
513,
304,
272,
2341,
63,
513,
275,
942,
272,
367,
18038,
63,
1301,
315,
18038,
63,
27043,
63,
513,
26,
267,
327,
2050,
14,
1757,
8,
7254,
63,
1301,
9,
267,
18038,
63,
27043,
275,
1503,
14,
7144,
2141,
8,
7254,
63,
1301,
9,
267,
2050,
14,
1757,
480,
4218,
316,
4079,
641,
1343,
275,
450,
83,
12,
1284,
275,
450,
83,
298,
450,
334,
7254,
63,
27043,
14,
3179,
59,
16,
467,
18038,
63,
27043,
14,
3179,
59,
17,
2459,
267,
18761,
1915,
63,
8523,
1403,
275,
2400,
8,
80,
17,
12,
299,
18,
304,
3842,
80,
17,
14,
12924,
59,
17,
61,
435,
299,
18,
14,
12924,
59,
17,
23067,
18,
12,
4490,
334,
80,
17,
14,
12924,
59,
16,
61,
435,
299,
18,
14,
12924,
59,
16,
23067,
18,
61,
398,
8230,
63,
1130,
275,
7090,
317,
453,
14,
2956,
8,
16114,
1915,
63,
8523,
1403,
1332,
7254,
63,
27043,
14,
3179,
59,
16,
1055,
7660,
12,
6059,
18038,
63,
27043,
14,
3179,
59,
17,
1055,
7660,
1724,
267,
8230,
63,
2718,
275,
16587
] |
[
10634,
465,
6454,
199,
646,
7090,
317,
453,
14,
545,
317,
453,
465,
7090,
317,
453,
199,
646,
7975,
199,
646,
2680,
465,
980,
199,
646,
2050,
199,
646,
8509,
1001,
465,
486,
74,
199,
646,
1331,
199,
646,
1921,
807,
465,
1503,
199,
504,
22380,
492,
5412,
199,
199,
3,
492,
325,
2250,
14,
10466,
14,
14368,
14,
3118,
316,
14,
1985,
63,
83,
22610,
465,
9100,
199,
646,
330,
834,
14,
1001,
63,
1974,
465,
330,
27764,
199,
199,
646,
325,
2250,
14,
3494,
14,
6518,
1298,
14,
1985,
63,
10590,
465,
634,
81,
199,
646,
325,
2250,
14,
3494,
14,
6518,
1298,
14,
7254,
63,
10590,
465,
9455,
3583,
199,
646,
325,
2250,
14,
3494,
14,
6518,
1298,
14,
2778,
63,
10590,
465,
325,
3893,
80,
199,
646,
325,
2250,
14,
3494,
14,
6518,
1298,
14,
2379,
63,
10590,
465,
9455,
795,
199,
646,
325,
2250,
14,
3494,
14,
6518,
1298,
14,
2792,
63,
10590,
465,
325,
3893,
551,
199,
199,
646,
325,
2250,
14,
3494,
14,
28551,
14,
6198,
63,
28551,
465,
325,
1207,
199,
199,
646,
325,
2250,
14,
1018,
14,
5029,
14,
2379,
465,
7062,
3569,
199,
646,
325,
2250,
14,
1018,
14,
5029,
14,
2792,
465,
7062,
87,
551,
199,
199,
646,
325,
2250,
14,
10466,
14,
2798,
1337,
14,
27043,
14,
27043,
63,
4445,
63,
11256,
465,
486,
3003,
199,
646,
325,
2250,
14,
10466,
14,
2798,
1337,
14,
8914,
2723,
63,
30613,
14,
545,
317,
453,
63,
27043,
63,
2718,
465,
16587,
11538,
199,
199,
646,
325,
2250,
14,
846,
14,
751,
1637,
14,
6198,
63,
751,
1637,
465,
655,
1458,
199,
646,
325,
2250,
14,
846,
14,
1246,
14,
751,
1637,
465,
655,
3844,
199,
199,
452,
63,
2326,
63,
513,
275,
788,
8399,
297,
283,
27133,
297,
283,
6304,
297,
283,
2239,
331,
750,
297,
283,
28291,
297,
283,
31958,
335,
4674,
297,
283,
7731,
297,
283,
18687,
297,
283,
5615,
21335,
297,
283,
10927,
89,
297,
283,
26591,
297,
283,
6653,
11045,
297,
283,
581,
297,
283,
27765,
297,
283,
14514,
418,
199,
5891,
63,
2326,
63,
513,
275,
788,
8399,
297,
283,
6304,
297,
283,
2239,
331,
750,
297,
283,
28291,
297,
283,
31958,
335,
4674,
297,
283,
7731,
297,
283,
18687,
297,
283,
5615,
21335,
297,
283,
26591,
297,
283,
6653,
11045,
297,
283,
581,
297,
283,
14514,
418,
199,
199,
318,
4051,
63,
475,
63,
875,
63,
513,
8,
1587,
304,
272,
408,
272,
7905,
314,
1324,
4051,
1901,
282,
769,
402,
3326,
12,
11233,
367,
1808,
465,
4560,
15203,
315,
282,
2341,
14,
272,
961,
365,
282,
11420,
805,
14,
272,
408,
272,
327,
870,
298,
7619,
1337,
4051,
543,
1568,
450,
83,
370,
1059,
769,
2,
450,
4051,
14,
1392,
59,
16,
61,
272,
1625,
63,
513,
275,
4051,
14,
475,
63,
807,
8,
19676,
534,
6502,
358,
272,
372,
359,
495,
8,
604,
9,
367,
1004,
315,
1625,
63,
513,
61,
199,
199,
318,
664,
63,
8919,
63,
509,
63,
1842,
8,
751,
63,
344,
12,
1343,
63,
1086,
12,
1284,
63,
1086,
304,
272,
2341,
63,
513,
275,
942,
272,
8509,
1001,
63,
513,
275,
486,
3003,
14,
362,
63,
27043,
63,
509,
63,
1086,
8,
751,
63,
344,
12,
1343,
63,
1086,
12,
1284,
63,
1086,
9,
272,
372,
664,
63,
8919,
63,
509,
63,
27043,
63,
513,
8,
27043,
63,
513,
9,
199,
199,
318,
664,
63,
8919,
63,
509,
63,
751,
1637,
8,
751,
63,
344,
304,
272,
666,
63,
475,
63,
9339,
275,
5412,
8,
287,
3844,
14,
5186,
63,
1000,
63,
475,
63,
9339,
8,
751,
63,
344,
430,
272,
2050,
14,
1757,
480,
13569,
7679,
12,
3229,
1190,
370,
14617,
769,
965,
2582,
450,
68,
2,
450,
822,
8,
576,
63,
475,
63,
9339,
14,
475,
63,
513,
4059,
272,
2050,
14,
1757,
480,
1612,
787,
450,
83,
2,
450,
666,
63,
475,
63,
9339,
14,
1130,
8,
2734,
325,
26,
1503,
14,
7144,
2141,
8,
69,
680,
2343,
14,
498,
430,
272,
3229,
1190,
63,
475,
63,
9339,
275,
666,
63,
475,
63,
9339,
14,
1130,
8,
2734,
325,
26,
1503,
14,
7144,
2141,
8,
69,
25105,
2511,
1275,
1541,
8,
2734,
325,
26,
325,
14,
2343,
14,
498,
14,
2460,
480,
328,
695,
15,
599,
1190,
2237,
971,
2511,
1275,
1130,
8,
2734,
325,
26,
325,
14,
576,
9,
272,
2050,
14,
1757,
480,
10881,
7679,
12,
3229,
1190,
370,
14617,
769,
965,
2582,
450,
68,
2,
450,
822,
8,
599,
1190,
63,
475,
63,
9339,
14,
475,
63,
513,
4059,
272,
327,
2050,
14,
1757,
480,
599,
1190,
63,
475,
63,
9339,
275,
450,
83,
2,
450,
3229,
1190,
63,
475,
63,
9339,
9,
272,
9033,
63,
509,
63,
2977,
275,
942,
272,
367,
5382,
315,
3229,
1190,
63,
475,
63,
9339,
26,
267,
9033,
63,
509,
63,
2977,
14,
740,
8,
362,
63,
8919,
63,
509,
63,
27043,
63,
513,
8,
2977,
430,
272,
372,
9033,
63,
509,
63,
2977,
199,
199,
318,
664,
63,
8919,
63,
509,
63,
27043,
63,
513,
8,
7254,
63,
27043,
63,
513,
304,
272,
2341,
63,
513,
275,
942,
272,
367,
18038,
63,
1301,
315,
18038,
63,
27043,
63,
513,
26,
267,
327,
2050,
14,
1757,
8,
7254,
63,
1301,
9,
267,
18038,
63,
27043,
275,
1503,
14,
7144,
2141,
8,
7254,
63,
1301,
9,
267,
2050,
14,
1757,
480,
4218,
316,
4079,
641,
1343,
275,
450,
83,
12,
1284,
275,
450,
83,
298,
450,
334,
7254,
63,
27043,
14,
3179,
59,
16,
467,
18038,
63,
27043,
14,
3179,
59,
17,
2459,
267,
18761,
1915,
63,
8523,
1403,
275,
2400,
8,
80,
17,
12,
299,
18,
304,
3842,
80,
17,
14,
12924,
59,
17,
61,
435,
299,
18,
14,
12924,
59,
17,
23067,
18,
12,
4490,
334,
80,
17,
14,
12924,
59,
16,
61,
435,
299,
18,
14,
12924,
59,
16,
23067,
18,
61,
398,
8230,
63,
1130,
275,
7090,
317,
453,
14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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
] |
tijme/angularjs-sandbox-escape-scanner
|
acstis/helpers/FileLoggingHelper.py
|
2
|
3000
|
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2017 Tijme Gommers
#
# 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.
import os
import sys
import colorlog
class FileLoggingHelper:
"""The FileLoggingHelper enables logging messages to a file.
Attributes:
__phantomjs_driver (str): The cached path to the executable PhantomJS driver.
"""
__filename = None
@staticmethod
def set_file(filename=None):
"""Set the filename to log messages to.
Args:
filename (str): The filename (including absolute or relative path) to log to.
Note:
If the log filename already exists it will be appended with a number. So output.log
could become `output.log.1` or `output.log.2`.
"""
if not filename:
return
filename_backup = filename
filename_append = 0
filename_changed = False
filename_error = False
while os.path.isfile(filename) and not filename_error:
filename_changed = True
filename_append += 1
filename = filename_backup + "." + str(filename_append)
if filename_append == sys.maxsize:
filename_error = True
if filename_error:
colorlog.getLogger().error("The output log file already exists and therefore no logs will be written.")
return
if filename_changed:
colorlog.getLogger().warning("The output log filename was changed to `" + filename + "` since `" + filename_backup + "` already exists.")
FileLoggingHelper.__filename = filename
@staticmethod
def log(message):
"""Write the given message to the initialized log file.
Args:
message (str): The message to write to the log file.
"""
if not FileLoggingHelper.__filename:
return
with open(FileLoggingHelper.__filename, "a") as log:
log.write(message + "\n")
|
mit
|
[
3,
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
10697,
844,
199,
3,
199,
3,
1898,
334,
67,
9,
9708,
377,
7879,
278,
598,
676,
16465,
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,
1006,
199,
3,
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,
646,
747,
199,
646,
984,
199,
646,
3164,
793,
199,
199,
533,
3814,
14054,
4433,
26,
272,
408,
1918,
3814,
14054,
4433,
22741,
2050,
3788,
370,
282,
570,
14,
339,
9382,
26,
267,
636,
16014,
3151,
3596,
63,
3090,
334,
495,
304,
710,
6328,
931,
370,
314,
7286,
11308,
290,
3151,
11378,
5253,
14,
339,
408,
339,
636,
1501,
275,
488,
339,
768,
4639,
272,
347,
663,
63,
493,
8,
1501,
29,
403,
304,
267,
408,
1084,
314,
1788,
370,
943,
3788,
370,
14,
398,
3033,
26,
288,
1788,
334,
495,
304,
710,
1788,
334,
15768,
3679,
503,
3847,
931,
9,
370,
943,
370,
14,
398,
3390,
26,
288,
982,
314,
943,
1788,
2575,
3495,
652,
911,
506,
11544,
543,
282,
1329,
14,
2002,
1072,
14,
793,
288,
4293,
8649,
658,
1199,
14,
793,
14,
17,
64,
503,
658,
1199,
14,
793,
14,
18,
2313,
398,
408,
398,
340,
440,
1788,
26,
288,
372,
398,
1788,
63,
5751,
275,
1788,
267,
1788,
63,
740,
275,
378,
267,
1788,
63,
2489,
275,
756,
267,
1788,
63,
705,
275,
756,
398,
1830,
747,
14,
515,
14,
6292,
8,
1501,
9,
436,
440,
1788,
63,
705,
26,
288,
1788,
63,
2489,
275,
715,
288,
1788,
63,
740,
847,
413,
288,
1788,
275,
1788,
63,
5751,
435,
14530,
435,
620,
8,
1501,
63,
740,
9,
953,
340,
1788,
63,
740,
508,
984,
14,
13634,
26,
355,
1788,
63,
705,
275,
715,
398,
340,
1788,
63,
705,
26,
288,
3164,
793,
14,
5572,
1252,
705,
480,
1918,
1072,
943,
570,
2575,
3495,
436,
16119,
949,
9610,
911,
506,
5313,
2685,
288,
372,
398,
340,
1788,
63,
2489,
26,
288,
3164,
793,
14,
5572,
1252,
3764,
480,
1918,
1072,
943,
1788,
1990,
2896,
370,
28531,
435,
1788,
435,
24505,
3967,
28531,
435,
1788,
63,
5751,
435,
24505,
2575,
3495,
2685,
398,
3814,
14054,
4433,
855,
1501,
275,
1788,
339,
768,
4639,
272,
347,
943,
8,
1188,
304,
267,
408,
3534,
314,
1627,
1245,
370,
314,
10038,
943,
570,
14,
398,
3033,
26,
288,
1245,
334,
495,
304,
710,
1245,
370,
2218,
370,
314,
943,
570,
14,
398,
408,
398,
340,
440,
3814,
14054,
4433,
855,
1501,
26,
288,
372,
398,
543,
1551,
8,
1173,
14054,
4433,
855,
1501,
12,
298,
65,
531,
465,
943,
26,
288,
943,
14,
952,
8,
1188,
435,
1867,
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
] |
[
1882,
2803,
26,
2774,
13,
24,
1882,
199,
199,
3,
10697,
844,
199,
3,
199,
3,
1898,
334,
67,
9,
9708,
377,
7879,
278,
598,
676,
16465,
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,
1006,
199,
3,
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,
646,
747,
199,
646,
984,
199,
646,
3164,
793,
199,
199,
533,
3814,
14054,
4433,
26,
272,
408,
1918,
3814,
14054,
4433,
22741,
2050,
3788,
370,
282,
570,
14,
339,
9382,
26,
267,
636,
16014,
3151,
3596,
63,
3090,
334,
495,
304,
710,
6328,
931,
370,
314,
7286,
11308,
290,
3151,
11378,
5253,
14,
339,
408,
339,
636,
1501,
275,
488,
339,
768,
4639,
272,
347,
663,
63,
493,
8,
1501,
29,
403,
304,
267,
408,
1084,
314,
1788,
370,
943,
3788,
370,
14,
398,
3033,
26,
288,
1788,
334,
495,
304,
710,
1788,
334,
15768,
3679,
503,
3847,
931,
9,
370,
943,
370,
14,
398,
3390,
26,
288,
982,
314,
943,
1788,
2575,
3495,
652,
911,
506,
11544,
543,
282,
1329,
14,
2002,
1072,
14,
793,
288,
4293,
8649,
658,
1199,
14,
793,
14,
17,
64,
503,
658,
1199,
14,
793,
14,
18,
2313,
398,
408,
398,
340,
440,
1788,
26,
288,
372,
398,
1788,
63,
5751,
275,
1788,
267,
1788,
63,
740,
275,
378,
267,
1788,
63,
2489,
275,
756,
267,
1788,
63,
705,
275,
756,
398,
1830,
747,
14,
515,
14,
6292,
8,
1501,
9,
436,
440,
1788,
63,
705,
26,
288,
1788,
63,
2489,
275,
715,
288,
1788,
63,
740,
847,
413,
288,
1788,
275,
1788,
63,
5751,
435,
14530,
435,
620,
8,
1501,
63,
740,
9,
953,
340,
1788,
63,
740,
508,
984,
14,
13634,
26,
355,
1788,
63,
705,
275,
715,
398,
340,
1788,
63,
705,
26,
288,
3164,
793,
14,
5572,
1252,
705,
480,
1918,
1072,
943,
570,
2575,
3495,
436,
16119,
949,
9610,
911,
506,
5313,
2685,
288,
372,
398,
340,
1788,
63,
2489,
26,
288,
3164,
793,
14,
5572,
1252,
3764,
480,
1918,
1072,
943,
1788,
1990,
2896,
370,
28531,
435,
1788,
435,
24505,
3967,
28531,
435,
1788,
63,
5751,
435,
24505,
2575,
3495,
2685,
398,
3814,
14054,
4433,
855,
1501,
275,
1788,
339,
768,
4639,
272,
347,
943,
8,
1188,
304,
267,
408,
3534,
314,
1627,
1245,
370,
314,
10038,
943,
570,
14,
398,
3033,
26,
288,
1245,
334,
495,
304,
710,
1245,
370,
2218,
370,
314,
943,
570,
14,
398,
408,
398,
340,
440,
3814,
14054,
4433,
855,
1501,
26,
288,
372,
398,
543,
1551,
8,
1173,
14054,
4433,
855,
1501,
12,
298,
65,
531,
465,
943,
26,
288,
943,
14,
952,
8,
1188,
435,
1867,
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,
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,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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
] |
Evervolv/android_external_chromium_org
|
third_party/closure_linter/closure_linter/error_check.py
|
137
|
3620
|
#!/usr/bin/env python
#
# Copyright 2011 The Closure Linter 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.
"""Specific JSLint errors checker."""
import gflags as flags
FLAGS = flags.FLAGS
class Rule(object):
"""Different rules to check."""
# Documentations for specific rules goes in flag definition.
BLANK_LINES_AT_TOP_LEVEL = 'blank_lines_at_top_level'
INDENTATION = 'indentation'
WELL_FORMED_AUTHOR = 'well_formed_author'
NO_BRACES_AROUND_INHERIT_DOC = 'no_braces_around_inherit_doc'
BRACES_AROUND_TYPE = 'braces_around_type'
OPTIONAL_TYPE_MARKER = 'optional_type_marker'
UNUSED_PRIVATE_MEMBERS = 'unused_private_members'
# Rule to raise all known errors.
ALL = 'all'
# All rules that are to be checked when using the strict flag. E.g. the rules
# that are specific to the stricter Closure style.
CLOSURE_RULES = frozenset([BLANK_LINES_AT_TOP_LEVEL,
INDENTATION,
WELL_FORMED_AUTHOR,
NO_BRACES_AROUND_INHERIT_DOC,
BRACES_AROUND_TYPE,
OPTIONAL_TYPE_MARKER])
flags.DEFINE_boolean('strict', False,
'Whether to validate against the stricter Closure style. '
'This includes ' + (', '.join(Rule.CLOSURE_RULES)) + '.')
flags.DEFINE_multistring('jslint_error', [],
'List of specific lint errors to check. Here is a list'
' of accepted values:\n'
' - ' + Rule.ALL + ': enables all following errors.\n'
' - ' + Rule.BLANK_LINES_AT_TOP_LEVEL + ': validates'
'number of blank lines between blocks at top level.\n'
' - ' + Rule.INDENTATION + ': checks correct '
'indentation of code.\n'
' - ' + Rule.WELL_FORMED_AUTHOR + ': validates the '
'@author JsDoc tags.\n'
' - ' + Rule.NO_BRACES_AROUND_INHERIT_DOC + ': '
'forbids braces around @inheritdoc JsDoc tags.\n'
' - ' + Rule.BRACES_AROUND_TYPE + ': enforces braces '
'around types in JsDoc tags.\n'
' - ' + Rule.OPTIONAL_TYPE_MARKER + ': checks correct '
'use of optional marker = in param types.\n'
' - ' + Rule.UNUSED_PRIVATE_MEMBERS + ': checks for '
'unused private variables.\n')
def ShouldCheck(rule):
"""Returns whether the optional rule should be checked.
Computes different flags (strict, jslint_error, jslint_noerror) to find out if
this specific rule should be checked.
Args:
rule: Name of the rule (see Rule).
Returns:
True if the rule should be checked according to the flags, otherwise False.
"""
if rule in FLAGS.jslint_error or Rule.ALL in FLAGS.jslint_error:
return True
# Checks strict rules.
return FLAGS.strict and rule in Rule.CLOSURE_RULES
|
bsd-3-clause
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
3,
199,
3,
1898,
7760,
710,
5980,
3253,
491,
1058,
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,
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,
13,
1311,
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,
421,
199,
624,
16786,
1603,
4929,
442,
2552,
7739,
1041,
4388,
199,
646,
486,
2469,
465,
3285,
199,
199,
4831,
275,
3285,
14,
4831,
421,
199,
533,
11949,
8,
785,
304,
523,
408,
31409,
4713,
370,
1104,
1041,
819,
327,
7543,
1298,
367,
2488,
4713,
13538,
315,
3305,
5492,
14,
523,
699,
10825,
43,
63,
23023,
63,
619,
63,
11422,
63,
11817,
275,
283,
2500,
63,
1278,
63,
292,
63,
2119,
63,
1896,
7,
523,
23632,
1309,
2594,
275,
283,
25152,
7,
523,
644,
14952,
63,
3516,
1149,
63,
27938,
275,
283,
20501,
63,
6194,
63,
2502,
7,
523,
4825,
63,
7184,
21287,
63,
689,
47,
6131,
63,
568,
3452,
649,
63,
16618,
275,
283,
889,
63,
7828,
823,
63,
11659,
63,
6486,
63,
1301,
7,
523,
11713,
21287,
63,
689,
47,
6131,
63,
2711,
275,
283,
7828,
823,
63,
11659,
63,
466,
7,
523,
30953,
63,
2711,
63,
18997,
275,
283,
4144,
63,
466,
63,
4211,
7,
523,
738,
27726,
63,
18748,
63,
10293,
34,
3960,
275,
283,
8618,
63,
4239,
63,
6334,
7,
819,
327,
11949,
370,
746,
1006,
6040,
2552,
14,
523,
11727,
275,
283,
452,
7,
819,
327,
2900,
4713,
626,
787,
370,
506,
7923,
1380,
1808,
314,
7478,
3305,
14,
662,
14,
71,
14,
314,
4713,
523,
327,
626,
787,
2488,
370,
314,
410,
1567,
351,
5980,
3253,
3449,
14,
523,
445,
1484,
51,
3942,
63,
31490,
275,
9522,
779,
20438,
63,
23023,
63,
619,
63,
11422,
63,
11817,
12,
2490,
23632,
1309,
2594,
12,
2490,
644,
14952,
63,
3516,
1149,
63,
27938,
12,
2490,
4825,
63,
7184,
21287,
63,
689,
47,
6131,
63,
568,
3452,
649,
63,
16618,
12,
2490,
11713,
21287,
63,
689,
47,
6131,
63,
2711,
12,
2490,
30953,
63,
2711,
63,
18997,
566,
421,
199,
2469,
14,
14603,
63,
4871,
360,
4768,
297,
756,
12,
2151,
283,
26625,
370,
4107,
6169,
314,
410,
1567,
351,
5980,
3253,
3449,
14,
283,
2151,
283,
2765,
6952,
283,
435,
334,
297,
1987,
904,
8,
5065,
14,
10353,
51,
3942,
63,
31490,
430,
435,
20093,
199,
2469,
14,
14603,
63,
3029,
875,
360,
74,
2482,
442,
63,
705,
297,
990,
586,
283,
1296,
402,
2488,
24620,
2552,
370,
1104,
14,
11842,
365,
282,
769,
7,
586,
283,
402,
10226,
1338,
3427,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
1761,
435,
7596,
22741,
1006,
2569,
2552,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
20438,
63,
23023,
63,
619,
63,
11422,
63,
11817,
435,
7596,
29280,
7,
586,
283,
1955,
402,
4596,
2385,
3382,
5664,
737,
2746,
2166,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
29080,
2594,
435,
7596,
5920,
3211,
283,
586,
283,
25152,
402,
1233,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
55,
14952,
63,
3516,
1149,
63,
27938,
435,
7596,
29280,
314,
283,
586,
10267,
2502,
26231,
3768,
3762,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
2826,
63,
7184,
21287,
63,
689,
47,
6131,
63,
568,
3452,
649,
63,
16618,
435,
7596,
283,
586,
283,
509,
66,
1580,
27158,
6818,
768,
6486,
1301,
26231,
3768,
3762,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
7184,
21287,
63,
689,
47,
6131,
63,
2711,
435,
7596,
655,
509,
823,
27158,
283,
586,
283,
11659,
2943,
315,
26231,
3768,
3762,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
21008,
63,
2711,
63,
18997,
435,
7596,
5920,
3211,
283,
586,
283,
1180,
402,
2716,
3608,
275,
315,
1215,
2943,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
53,
27726,
63,
18748,
63,
10293,
34,
3960,
435,
7596,
5920,
367,
283,
586,
283,
8618,
5726,
2860,
3134,
78,
358,
421,
199,
318,
7719,
1799,
8,
2200,
304,
523,
408,
3407,
3775,
314,
2716,
2332,
1077,
506,
7923,
14,
819,
28040,
3365,
3285,
334,
4768,
12,
1335,
2482,
442,
63,
705,
12,
1335,
2482,
442,
63,
889,
705,
9,
370,
2342,
734,
340,
523,
642,
2488,
2332,
1077,
506,
7923,
14,
819,
3033,
26,
272,
2332,
26,
2812,
402,
314,
2332,
334,
3239,
11949,
680,
819,
1803,
26,
272,
715,
340,
314,
2332,
1077,
506,
7923,
7182,
370,
314,
3285,
12,
4257,
756,
14,
523,
408,
523,
340,
2332,
315,
12846,
14,
74,
2482,
442,
63,
705,
503,
11949,
14,
1761,
315,
12846,
14,
74,
2482,
442,
63,
705,
26,
272,
372,
715,
523,
327,
13813,
7478,
4713,
14,
523,
372,
12846,
14,
4768,
436,
2332,
315,
11949,
14,
10353,
51,
3942,
63,
31490,
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
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
3,
199,
3,
1898,
7760,
710,
5980,
3253,
491,
1058,
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,
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,
13,
1311,
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,
421,
199,
624,
16786,
1603,
4929,
442,
2552,
7739,
1041,
4388,
199,
646,
486,
2469,
465,
3285,
199,
199,
4831,
275,
3285,
14,
4831,
421,
199,
533,
11949,
8,
785,
304,
523,
408,
31409,
4713,
370,
1104,
1041,
819,
327,
7543,
1298,
367,
2488,
4713,
13538,
315,
3305,
5492,
14,
523,
699,
10825,
43,
63,
23023,
63,
619,
63,
11422,
63,
11817,
275,
283,
2500,
63,
1278,
63,
292,
63,
2119,
63,
1896,
7,
523,
23632,
1309,
2594,
275,
283,
25152,
7,
523,
644,
14952,
63,
3516,
1149,
63,
27938,
275,
283,
20501,
63,
6194,
63,
2502,
7,
523,
4825,
63,
7184,
21287,
63,
689,
47,
6131,
63,
568,
3452,
649,
63,
16618,
275,
283,
889,
63,
7828,
823,
63,
11659,
63,
6486,
63,
1301,
7,
523,
11713,
21287,
63,
689,
47,
6131,
63,
2711,
275,
283,
7828,
823,
63,
11659,
63,
466,
7,
523,
30953,
63,
2711,
63,
18997,
275,
283,
4144,
63,
466,
63,
4211,
7,
523,
738,
27726,
63,
18748,
63,
10293,
34,
3960,
275,
283,
8618,
63,
4239,
63,
6334,
7,
819,
327,
11949,
370,
746,
1006,
6040,
2552,
14,
523,
11727,
275,
283,
452,
7,
819,
327,
2900,
4713,
626,
787,
370,
506,
7923,
1380,
1808,
314,
7478,
3305,
14,
662,
14,
71,
14,
314,
4713,
523,
327,
626,
787,
2488,
370,
314,
410,
1567,
351,
5980,
3253,
3449,
14,
523,
445,
1484,
51,
3942,
63,
31490,
275,
9522,
779,
20438,
63,
23023,
63,
619,
63,
11422,
63,
11817,
12,
2490,
23632,
1309,
2594,
12,
2490,
644,
14952,
63,
3516,
1149,
63,
27938,
12,
2490,
4825,
63,
7184,
21287,
63,
689,
47,
6131,
63,
568,
3452,
649,
63,
16618,
12,
2490,
11713,
21287,
63,
689,
47,
6131,
63,
2711,
12,
2490,
30953,
63,
2711,
63,
18997,
566,
421,
199,
2469,
14,
14603,
63,
4871,
360,
4768,
297,
756,
12,
2151,
283,
26625,
370,
4107,
6169,
314,
410,
1567,
351,
5980,
3253,
3449,
14,
283,
2151,
283,
2765,
6952,
283,
435,
334,
297,
1987,
904,
8,
5065,
14,
10353,
51,
3942,
63,
31490,
430,
435,
20093,
199,
2469,
14,
14603,
63,
3029,
875,
360,
74,
2482,
442,
63,
705,
297,
990,
586,
283,
1296,
402,
2488,
24620,
2552,
370,
1104,
14,
11842,
365,
282,
769,
7,
586,
283,
402,
10226,
1338,
3427,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
1761,
435,
7596,
22741,
1006,
2569,
2552,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
20438,
63,
23023,
63,
619,
63,
11422,
63,
11817,
435,
7596,
29280,
7,
586,
283,
1955,
402,
4596,
2385,
3382,
5664,
737,
2746,
2166,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
29080,
2594,
435,
7596,
5920,
3211,
283,
586,
283,
25152,
402,
1233,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
55,
14952,
63,
3516,
1149,
63,
27938,
435,
7596,
29280,
314,
283,
586,
10267,
2502,
26231,
3768,
3762,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
2826,
63,
7184,
21287,
63,
689,
47,
6131,
63,
568,
3452,
649,
63,
16618,
435,
7596,
283,
586,
283,
509,
66,
1580,
27158,
6818,
768,
6486,
1301,
26231,
3768,
3762,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
7184,
21287,
63,
689,
47,
6131,
63,
2711,
435,
7596,
655,
509,
823,
27158,
283,
586,
283,
11659,
2943,
315,
26231,
3768,
3762,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
21008,
63,
2711,
63,
18997,
435,
7596,
5920,
3211,
283,
586,
283,
1180,
402,
2716,
3608,
275,
315,
1215,
2943,
3134,
78,
7,
586,
283,
446,
283,
435,
11949,
14,
53,
27726,
63,
18748,
63,
10293,
34,
3960,
435,
7596,
5920,
367,
283,
586,
283,
8618,
5726,
2860,
3134,
78,
358,
421,
199,
318,
7719,
1799,
8,
2200,
304,
523,
408,
3407,
3775,
314,
2716,
2332,
1077,
506,
7923,
14,
819,
28040,
3365,
3285,
334,
4768,
12,
1335,
2482,
442,
63,
705,
12,
1335,
2482,
442,
63,
889,
705,
9,
370,
2342,
734,
340,
523,
642,
2488,
2332,
1077,
506,
7923,
14,
819,
3033,
26,
272,
2332,
26,
2812,
402,
314,
2332,
334,
3239,
11949,
680,
819,
1803,
26,
272,
715,
340,
314,
2332,
1077,
506,
7923,
7182,
370,
314,
3285,
12,
4257,
756,
14,
523,
408,
523,
340,
2332,
315,
12846,
14,
74,
2482,
442,
63,
705,
503,
11949,
14,
1761,
315,
12846,
14,
74,
2482,
442,
63,
705,
26,
272,
372,
715,
523,
327,
13813,
7478,
4713,
14,
523,
372,
12846,
14,
4768,
436,
2332,
315,
11949,
14,
10353,
51,
3942,
63,
31490,
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,
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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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
andyzsf/django
|
django/core/cache/backends/base.py
|
104
|
8793
|
"Base Cache class."
from __future__ import unicode_literals
import time
import warnings
from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning
from django.utils.module_loading import import_string
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRuntimeWarning):
pass
# Stub class to ensure not passing in a `timeout` argument results in
# the default timeout
DEFAULT_TIMEOUT = object()
# Memcached does not accept keys longer than this.
MEMCACHE_MAX_KEY_LENGTH = 250
def default_key_func(key, key_prefix, version):
"""
Default function to generate keys.
Constructs the key used by all other methods. By default it prepends
the `key_prefix'. KEY_FUNCTION can be used to specify an alternate
function with custom key making behavior.
"""
return '%s:%s:%s' % (key_prefix, version, key)
def get_key_func(key_func):
"""
Function to decide which key function to use.
Defaults to ``default_key_func``.
"""
if key_func is not None:
if callable(key_func):
return key_func
else:
return import_string(key_func)
return default_key_func
class BaseCache(object):
def __init__(self, params):
timeout = params.get('timeout', params.get('TIMEOUT', 300))
if timeout is not None:
try:
timeout = int(timeout)
except (ValueError, TypeError):
timeout = 300
self.default_timeout = timeout
options = params.get('OPTIONS', {})
max_entries = params.get('max_entries', options.get('MAX_ENTRIES', 300))
try:
self._max_entries = int(max_entries)
except (ValueError, TypeError):
self._max_entries = 300
cull_frequency = params.get('cull_frequency', options.get('CULL_FREQUENCY', 3))
try:
self._cull_frequency = int(cull_frequency)
except (ValueError, TypeError):
self._cull_frequency = 3
self.key_prefix = params.get('KEY_PREFIX', '')
self.version = params.get('VERSION', 1)
self.key_func = get_key_func(params.get('KEY_FUNCTION', None))
def get_backend_timeout(self, timeout=DEFAULT_TIMEOUT):
"""
Returns the timeout value usable by this backend based upon the provided
timeout.
"""
if timeout == DEFAULT_TIMEOUT:
timeout = self.default_timeout
elif timeout == 0:
# ticket 21147 - avoid time.time() related precision issues
timeout = -1
return None if timeout is None else time.time() + timeout
def make_key(self, key, version=None):
"""Constructs the key used by all other methods. By default it
uses the key_func to generate a key (which, by default,
prepends the `key_prefix' and 'version'). An different key
function can be provided at the time of cache construction;
alternatively, you can subclass the cache backend to provide
custom key making behavior.
"""
if version is None:
version = self.version
new_key = self.key_func(key, self.key_prefix, version)
return new_key
def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None):
"""
Set a value in the cache if the key does not already exist. If
timeout is given, that timeout will be used for the key; otherwise
the default cache timeout will be used.
Returns True if the value was stored, False otherwise.
"""
raise NotImplementedError('subclasses of BaseCache must provide an add() method')
def get(self, key, default=None, version=None):
"""
Fetch a given key from the cache. If the key does not exist, return
default, which itself defaults to None.
"""
raise NotImplementedError('subclasses of BaseCache must provide a get() method')
def set(self, key, value, timeout=DEFAULT_TIMEOUT, version=None):
"""
Set a value in the cache. If timeout is given, that timeout will be
used for the key; otherwise the default cache timeout will be used.
"""
raise NotImplementedError('subclasses of BaseCache must provide a set() method')
def delete(self, key, version=None):
"""
Delete a key from the cache, failing silently.
"""
raise NotImplementedError('subclasses of BaseCache must provide a delete() method')
def get_many(self, keys, version=None):
"""
Fetch a bunch of keys from the cache. For certain backends (memcached,
pgsql) this can be *much* faster when fetching multiple values.
Returns a dict mapping each key in keys to its value. If the given
key is missing, it will be missing from the response dict.
"""
d = {}
for k in keys:
val = self.get(k, version=version)
if val is not None:
d[k] = val
return d
def has_key(self, key, version=None):
"""
Returns True if the key is in the cache and has not expired.
"""
return self.get(key, version=version) is not None
def incr(self, key, delta=1, version=None):
"""
Add delta to value in the cache. If the key does not exist, raise a
ValueError exception.
"""
value = self.get(key, version=version)
if value is None:
raise ValueError("Key '%s' not found" % key)
new_value = value + delta
self.set(key, new_value, version=version)
return new_value
def decr(self, key, delta=1, version=None):
"""
Subtract delta from value in the cache. If the key does not exist, raise
a ValueError exception.
"""
return self.incr(key, -delta, version=version)
def __contains__(self, key):
"""
Returns True if the key is in the cache and has not expired.
"""
# This is a separate method, rather than just a copy of has_key(),
# so that it always has the same functionality as has_key(), even
# if a subclass overrides it.
return self.has_key(key)
def set_many(self, data, timeout=DEFAULT_TIMEOUT, version=None):
"""
Set a bunch of values in the cache at once from a dict of key/value
pairs. For certain backends (memcached), this is much more efficient
than calling set() multiple times.
If timeout is given, that timeout will be used for the key; otherwise
the default cache timeout will be used.
"""
for key, value in data.items():
self.set(key, value, timeout=timeout, version=version)
def delete_many(self, keys, version=None):
"""
Set a bunch of values in the cache at once. For certain backends
(memcached), this is much more efficient than calling delete() multiple
times.
"""
for key in keys:
self.delete(key, version=version)
def clear(self):
"""Remove *all* values from the cache at once."""
raise NotImplementedError('subclasses of BaseCache must provide a clear() method')
def validate_key(self, key):
"""
Warn about keys that would not be portable to the memcached
backend. This encourages (but does not force) writing backend-portable
cache code.
"""
if len(key) > MEMCACHE_MAX_KEY_LENGTH:
warnings.warn('Cache key will cause errors if used with memcached: '
'%s (longer than %s)' % (key, MEMCACHE_MAX_KEY_LENGTH),
CacheKeyWarning)
for char in key:
if ord(char) < 33 or ord(char) == 127:
warnings.warn('Cache key contains characters that will cause '
'errors if used with memcached: %r' % key,
CacheKeyWarning)
def incr_version(self, key, delta=1, version=None):
"""Adds delta to the cache version for the supplied key. Returns the
new version.
"""
if version is None:
version = self.version
value = self.get(key, version=version)
if value is None:
raise ValueError("Key '%s' not found" % key)
self.set(key, value, version=version + delta)
self.delete(key, version=version)
return version + delta
def decr_version(self, key, delta=1, version=None):
"""Substracts delta from the cache version for the supplied key. Returns
the new version.
"""
return self.incr_version(key, -delta, version)
def close(self, **kwargs):
"""Close the cache connection"""
pass
|
bsd-3-clause
|
[
2,
1563,
11977,
1021,
2122,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
900,
199,
646,
3598,
199,
199,
504,
1639,
14,
1018,
14,
3924,
492,
11897,
12,
5634,
14357,
3849,
199,
504,
1639,
14,
1208,
14,
578,
63,
8786,
492,
492,
63,
875,
421,
199,
533,
6378,
4437,
8447,
547,
8,
8499,
10951,
304,
272,
986,
421,
199,
533,
11977,
1197,
3849,
8,
9323,
14357,
3849,
304,
272,
986,
421,
199,
3,
23429,
1021,
370,
4868,
440,
9476,
315,
282,
658,
2593,
64,
1423,
2058,
315,
199,
3,
314,
849,
2653,
199,
3472,
63,
8899,
275,
909,
342,
199,
199,
3,
30465,
5245,
1630,
440,
4729,
2883,
8088,
2419,
642,
14,
199,
10293,
8677,
63,
4283,
63,
3078,
63,
9127,
275,
16074,
421,
199,
318,
849,
63,
498,
63,
1532,
8,
498,
12,
790,
63,
1861,
12,
1015,
304,
272,
408,
272,
3758,
805,
370,
3550,
2883,
14,
339,
9215,
83,
314,
790,
1202,
701,
1006,
1163,
3102,
14,
4885,
849,
652,
19986,
3198,
272,
314,
658,
498,
63,
1861,
1370,
9301,
63,
15476,
883,
506,
1202,
370,
4165,
376,
18034,
272,
805,
543,
3537,
790,
10663,
5953,
14,
272,
408,
272,
372,
1543,
83,
2689,
83,
2689,
83,
7,
450,
334,
498,
63,
1861,
12,
1015,
12,
790,
9,
421,
199,
318,
664,
63,
498,
63,
1532,
8,
498,
63,
1532,
304,
272,
408,
272,
6801,
370,
19822,
1314,
790,
805,
370,
675,
14,
339,
7827,
370,
1124,
885,
63,
498,
63,
1532,
4345,
272,
408,
272,
340,
790,
63,
1532,
365,
440,
488,
26,
267,
340,
4550,
8,
498,
63,
1532,
304,
288,
372,
790,
63,
1532,
267,
587,
26,
288,
372,
492,
63,
875,
8,
498,
63,
1532,
9,
272,
372,
849,
63,
498,
63,
1532,
421,
199,
533,
3523,
4437,
8,
785,
304,
272,
347,
636,
826,
721,
277,
12,
1862,
304,
267,
2653,
275,
1862,
14,
362,
360,
2593,
297,
1862,
14,
362,
360,
8899,
297,
9601,
430,
267,
340,
2653,
365,
440,
488,
26,
288,
862,
26,
355,
2653,
275,
1109,
8,
2593,
9,
288,
871,
334,
3393,
12,
3146,
304,
355,
2653,
275,
9601,
267,
291,
14,
885,
63,
2593,
275,
2653,
398,
1511,
275,
1862,
14,
362,
360,
8808,
297,
5009,
267,
1390,
63,
3189,
275,
1862,
14,
362,
360,
988,
63,
3189,
297,
1511,
14,
362,
360,
4283,
63,
1309,
23359,
297,
9601,
430,
267,
862,
26,
288,
291,
423,
988,
63,
3189,
275,
1109,
8,
988,
63,
3189,
9,
267,
871,
334,
3393,
12,
3146,
304,
288,
291,
423,
988,
63,
3189,
275,
9601,
398,
286,
979,
63,
11132,
275,
1862,
14,
362,
360,
67,
979,
63,
11132,
297,
1511,
14,
362,
360,
35,
3785,
63,
38,
5255,
17059,
297,
650,
430,
267,
862,
26,
288,
291,
423,
67,
979,
63,
11132,
275,
1109,
8,
67,
979,
63,
11132,
9,
267,
871,
334,
3393,
12,
3146,
304,
288,
291,
423,
67,
979,
63,
11132,
275,
650,
398,
291,
14,
498,
63,
1861,
275,
1862,
14,
362,
360,
3078,
63,
6351,
297,
4074,
267,
291,
14,
1023,
275,
1862,
14,
362,
360,
4612,
297,
413,
9,
267,
291,
14,
498,
63,
1532,
275,
664,
63,
498,
63,
1532,
8,
1162,
14,
362,
360,
3078,
63,
15476,
297,
488,
430,
339,
347,
664,
63,
4620,
63,
2593,
8,
277,
12,
2653,
29,
3472,
63,
8899,
304,
267,
408,
267,
1803,
314,
2653,
574,
18025,
701,
642,
4865,
4079,
12188,
314,
2741,
267,
2653,
14,
267,
408,
267,
340,
2653,
508,
6186,
63,
8899,
26,
288,
2653,
275,
291,
14,
885,
63,
2593,
267,
916,
2653,
508,
378,
26,
288,
327,
12052,
30301,
2417,
446,
5126,
900,
14,
521,
342,
4048,
7151,
10876,
288,
2653,
275,
446,
17,
267,
372,
488,
340,
2653,
365,
488,
587,
900,
14,
521,
342,
435,
2653,
339,
347,
1852,
63,
498,
8,
277,
12,
790,
12,
1015,
29,
403,
304,
267,
408,
27943,
314,
790,
1202,
701,
1006,
1163,
3102,
14,
4885,
849,
652,
267,
4440,
314,
790,
63,
1532,
370,
3550,
282,
790,
334,
6777,
12,
701,
849,
12,
267,
19986,
3198,
314,
658,
498,
63,
1861,
7,
436,
283,
1023,
1959,
1626,
3365,
790,
267,
805,
883,
506,
2741,
737,
314,
900,
402,
2581,
14538,
27,
267,
8679,
17330,
12,
1265,
883,
5516,
314,
2581,
4865,
370,
5647,
267,
3537,
790,
10663,
5953,
14,
267,
408,
267,
340,
1015,
365,
488,
26,
288,
1015,
275,
291,
14,
1023,
398,
892,
63,
498,
275,
291,
14,
498,
63,
1532,
8,
498,
12,
291,
14,
498,
63,
1861,
12,
1015,
9,
267,
372,
892,
63,
498,
339,
347,
1050,
8,
277,
12,
790,
12,
574,
12,
2653,
29,
3472,
63,
8899,
12,
1015,
29,
403,
304,
267,
408,
267,
2494,
282,
574,
315,
314,
2581,
340,
314,
790,
1630,
440,
2575,
2187,
14,
982,
267,
2653,
365,
1627,
12,
626,
2653,
911,
506,
1202,
367,
314,
790,
27,
4257,
267,
314,
849,
2581,
2653,
911,
506,
1202,
14,
398,
1803,
715,
340,
314,
574,
1990,
5489,
12,
756,
4257,
14,
267,
408,
267,
746,
4279,
360,
19094,
402,
3523,
4437,
1471,
5647,
376,
1050,
342,
1083,
358,
339,
347,
664,
8,
277,
12,
790,
12,
849,
29,
403,
12,
1015,
29,
403,
304,
267,
408,
267,
16347,
282,
1627,
790,
687,
314,
2581,
14,
982,
314,
790,
1630,
440,
2187,
12,
372,
267,
849,
12,
1314,
6337,
4243,
370,
488,
14,
267,
408,
267,
746,
4279,
360,
19094,
402,
3523,
4437,
1471,
5647,
282,
664,
342,
1083,
358,
339,
347,
663,
8,
277,
12,
790,
12,
574,
12,
2653,
29,
3472,
63,
8899,
12,
1015,
29,
403,
304,
267,
408,
267,
2494,
282,
574,
315,
314,
2581,
14,
982,
2653,
365,
1627,
12,
626,
2653,
911,
506,
267,
1202,
367,
314,
790,
27,
4257,
314,
849,
2581,
2653,
911,
506,
1202,
14,
267,
408,
267,
746,
4279,
360,
19094,
402,
3523,
4437,
1471,
5647,
282,
663,
342,
1083,
358,
339,
347,
3145,
8,
277,
12,
790,
12,
1015,
29,
403,
304,
267,
408,
267,
8496,
282,
790,
687,
314,
2581,
12,
18648,
18030,
14,
267,
408,
267,
746,
4279,
360,
19094,
402,
3523,
4437,
1471,
5647
] |
[
1563,
11977,
1021,
2122,
199,
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
900,
199,
646,
3598,
199,
199,
504,
1639,
14,
1018,
14,
3924,
492,
11897,
12,
5634,
14357,
3849,
199,
504,
1639,
14,
1208,
14,
578,
63,
8786,
492,
492,
63,
875,
421,
199,
533,
6378,
4437,
8447,
547,
8,
8499,
10951,
304,
272,
986,
421,
199,
533,
11977,
1197,
3849,
8,
9323,
14357,
3849,
304,
272,
986,
421,
199,
3,
23429,
1021,
370,
4868,
440,
9476,
315,
282,
658,
2593,
64,
1423,
2058,
315,
199,
3,
314,
849,
2653,
199,
3472,
63,
8899,
275,
909,
342,
199,
199,
3,
30465,
5245,
1630,
440,
4729,
2883,
8088,
2419,
642,
14,
199,
10293,
8677,
63,
4283,
63,
3078,
63,
9127,
275,
16074,
421,
199,
318,
849,
63,
498,
63,
1532,
8,
498,
12,
790,
63,
1861,
12,
1015,
304,
272,
408,
272,
3758,
805,
370,
3550,
2883,
14,
339,
9215,
83,
314,
790,
1202,
701,
1006,
1163,
3102,
14,
4885,
849,
652,
19986,
3198,
272,
314,
658,
498,
63,
1861,
1370,
9301,
63,
15476,
883,
506,
1202,
370,
4165,
376,
18034,
272,
805,
543,
3537,
790,
10663,
5953,
14,
272,
408,
272,
372,
1543,
83,
2689,
83,
2689,
83,
7,
450,
334,
498,
63,
1861,
12,
1015,
12,
790,
9,
421,
199,
318,
664,
63,
498,
63,
1532,
8,
498,
63,
1532,
304,
272,
408,
272,
6801,
370,
19822,
1314,
790,
805,
370,
675,
14,
339,
7827,
370,
1124,
885,
63,
498,
63,
1532,
4345,
272,
408,
272,
340,
790,
63,
1532,
365,
440,
488,
26,
267,
340,
4550,
8,
498,
63,
1532,
304,
288,
372,
790,
63,
1532,
267,
587,
26,
288,
372,
492,
63,
875,
8,
498,
63,
1532,
9,
272,
372,
849,
63,
498,
63,
1532,
421,
199,
533,
3523,
4437,
8,
785,
304,
272,
347,
636,
826,
721,
277,
12,
1862,
304,
267,
2653,
275,
1862,
14,
362,
360,
2593,
297,
1862,
14,
362,
360,
8899,
297,
9601,
430,
267,
340,
2653,
365,
440,
488,
26,
288,
862,
26,
355,
2653,
275,
1109,
8,
2593,
9,
288,
871,
334,
3393,
12,
3146,
304,
355,
2653,
275,
9601,
267,
291,
14,
885,
63,
2593,
275,
2653,
398,
1511,
275,
1862,
14,
362,
360,
8808,
297,
5009,
267,
1390,
63,
3189,
275,
1862,
14,
362,
360,
988,
63,
3189,
297,
1511,
14,
362,
360,
4283,
63,
1309,
23359,
297,
9601,
430,
267,
862,
26,
288,
291,
423,
988,
63,
3189,
275,
1109,
8,
988,
63,
3189,
9,
267,
871,
334,
3393,
12,
3146,
304,
288,
291,
423,
988,
63,
3189,
275,
9601,
398,
286,
979,
63,
11132,
275,
1862,
14,
362,
360,
67,
979,
63,
11132,
297,
1511,
14,
362,
360,
35,
3785,
63,
38,
5255,
17059,
297,
650,
430,
267,
862,
26,
288,
291,
423,
67,
979,
63,
11132,
275,
1109,
8,
67,
979,
63,
11132,
9,
267,
871,
334,
3393,
12,
3146,
304,
288,
291,
423,
67,
979,
63,
11132,
275,
650,
398,
291,
14,
498,
63,
1861,
275,
1862,
14,
362,
360,
3078,
63,
6351,
297,
4074,
267,
291,
14,
1023,
275,
1862,
14,
362,
360,
4612,
297,
413,
9,
267,
291,
14,
498,
63,
1532,
275,
664,
63,
498,
63,
1532,
8,
1162,
14,
362,
360,
3078,
63,
15476,
297,
488,
430,
339,
347,
664,
63,
4620,
63,
2593,
8,
277,
12,
2653,
29,
3472,
63,
8899,
304,
267,
408,
267,
1803,
314,
2653,
574,
18025,
701,
642,
4865,
4079,
12188,
314,
2741,
267,
2653,
14,
267,
408,
267,
340,
2653,
508,
6186,
63,
8899,
26,
288,
2653,
275,
291,
14,
885,
63,
2593,
267,
916,
2653,
508,
378,
26,
288,
327,
12052,
30301,
2417,
446,
5126,
900,
14,
521,
342,
4048,
7151,
10876,
288,
2653,
275,
446,
17,
267,
372,
488,
340,
2653,
365,
488,
587,
900,
14,
521,
342,
435,
2653,
339,
347,
1852,
63,
498,
8,
277,
12,
790,
12,
1015,
29,
403,
304,
267,
408,
27943,
314,
790,
1202,
701,
1006,
1163,
3102,
14,
4885,
849,
652,
267,
4440,
314,
790,
63,
1532,
370,
3550,
282,
790,
334,
6777,
12,
701,
849,
12,
267,
19986,
3198,
314,
658,
498,
63,
1861,
7,
436,
283,
1023,
1959,
1626,
3365,
790,
267,
805,
883,
506,
2741,
737,
314,
900,
402,
2581,
14538,
27,
267,
8679,
17330,
12,
1265,
883,
5516,
314,
2581,
4865,
370,
5647,
267,
3537,
790,
10663,
5953,
14,
267,
408,
267,
340,
1015,
365,
488,
26,
288,
1015,
275,
291,
14,
1023,
398,
892,
63,
498,
275,
291,
14,
498,
63,
1532,
8,
498,
12,
291,
14,
498,
63,
1861,
12,
1015,
9,
267,
372,
892,
63,
498,
339,
347,
1050,
8,
277,
12,
790,
12,
574,
12,
2653,
29,
3472,
63,
8899,
12,
1015,
29,
403,
304,
267,
408,
267,
2494,
282,
574,
315,
314,
2581,
340,
314,
790,
1630,
440,
2575,
2187,
14,
982,
267,
2653,
365,
1627,
12,
626,
2653,
911,
506,
1202,
367,
314,
790,
27,
4257,
267,
314,
849,
2581,
2653,
911,
506,
1202,
14,
398,
1803,
715,
340,
314,
574,
1990,
5489,
12,
756,
4257,
14,
267,
408,
267,
746,
4279,
360,
19094,
402,
3523,
4437,
1471,
5647,
376,
1050,
342,
1083,
358,
339,
347,
664,
8,
277,
12,
790,
12,
849,
29,
403,
12,
1015,
29,
403,
304,
267,
408,
267,
16347,
282,
1627,
790,
687,
314,
2581,
14,
982,
314,
790,
1630,
440,
2187,
12,
372,
267,
849,
12,
1314,
6337,
4243,
370,
488,
14,
267,
408,
267,
746,
4279,
360,
19094,
402,
3523,
4437,
1471,
5647,
282,
664,
342,
1083,
358,
339,
347,
663,
8,
277,
12,
790,
12,
574,
12,
2653,
29,
3472,
63,
8899,
12,
1015,
29,
403,
304,
267,
408,
267,
2494,
282,
574,
315,
314,
2581,
14,
982,
2653,
365,
1627,
12,
626,
2653,
911,
506,
267,
1202,
367,
314,
790,
27,
4257,
314,
849,
2581,
2653,
911,
506,
1202,
14,
267,
408,
267,
746,
4279,
360,
19094,
402,
3523,
4437,
1471,
5647,
282,
663,
342,
1083,
358,
339,
347,
3145,
8,
277,
12,
790,
12,
1015,
29,
403,
304,
267,
408,
267,
8496,
282,
790,
687,
314,
2581,
12,
18648,
18030,
14,
267,
408,
267,
746,
4279,
360,
19094,
402,
3523,
4437,
1471,
5647,
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,
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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
] |
GaetanCambier/CouchPotatoServer
|
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/ign.py
|
23
|
5296
|
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class IGNIE(InfoExtractor):
"""
Extractor for some of the IGN sites, like www.ign.com, es.ign.com de.ign.com.
Some videos of it.ign.com are also supported
"""
_VALID_URL = r'https?://.+?\.ign\.com/(?P<type>videos|show_videos|articles|(?:[^/]*/feature))(/.+)?/(?P<name_or_id>.+)'
IE_NAME = 'ign.com'
_CONFIG_URL_TEMPLATE = 'http://www.ign.com/videos/configs/id/%s.config'
_DESCRIPTION_RE = [
r'<span class="page-object-description">(.+?)</span>',
r'id="my_show_video">.*?<p>(.*?)</p>',
r'<meta name="description" content="(.*?)"',
]
_TESTS = [
{
'url': 'http://www.ign.com/videos/2013/06/05/the-last-of-us-review',
'md5': 'eac8bdc1890980122c3b66f14bdd02e9',
'info_dict': {
'id': '8f862beef863986b2785559b9e1aa599',
'ext': 'mp4',
'title': 'The Last of Us Review',
'description': 'md5:c8946d4260a4d43a00d5ae8ed998870c',
}
},
{
'url': 'http://me.ign.com/en/feature/15775/100-little-things-in-gta-5-that-will-blow-your-mind',
'playlist': [
{
'info_dict': {
'id': '5ebbd138523268b93c9141af17bec937',
'ext': 'mp4',
'title': 'GTA 5 Video Review',
'description': 'Rockstar drops the mic on this generation of games. Watch our review of the masterly Grand Theft Auto V.',
},
},
{
'info_dict': {
'id': '638672ee848ae4ff108df2a296418ee2',
'ext': 'mp4',
'title': '26 Twisted Moments from GTA 5 in Slow Motion',
'description': 'The twisted beauty of GTA 5 in stunning slow motion.',
},
},
],
'params': {
'skip_download': True,
},
},
{
'url': 'http://www.ign.com/articles/2014/08/15/rewind-theater-wild-trailer-gamescom-2014?watch',
'md5': '4e9a0bda1e5eebd31ddcf86ec0b9b3c7',
'info_dict': {
'id': '078fdd005f6d3c02f63d795faa1b984f',
'ext': 'mp4',
'title': 'Rewind Theater - Wild Trailer Gamescom 2014',
'description': (
'Giant skeletons, bloody hunts, and captivating'
' natural beauty take our breath away.'
),
},
},
]
def _find_video_id(self, webpage):
res_id = [
r'"video_id"\s*:\s*"(.*?)"',
r'data-video-id="(.+?)"',
r'<object id="vid_(.+?)"',
r'<meta name="og:image" content=".*/(.+?)-(.+?)/.+.jpg"',
r'class="hero-poster[^"]*?"[^>]*id="(.+?)"',
]
return self._search_regex(res_id, webpage, 'video id')
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
name_or_id = mobj.group('name_or_id')
page_type = mobj.group('type')
webpage = self._download_webpage(url, name_or_id)
if page_type != 'video':
multiple_urls = re.findall(
'<param name="flashvars"[^>]*value="[^"]*?url=(https?://www\.ign\.com/videos/.*?)["&]',
webpage)
if multiple_urls:
entries = [self.url_result(u, ie='IGN') for u in multiple_urls]
return {
'_type': 'playlist',
'id': name_or_id,
'entries': entries,
}
video_id = self._find_video_id(webpage)
result = self._get_video_info(video_id)
description = self._html_search_regex(self._DESCRIPTION_RE,
webpage, 'video description', flags=re.DOTALL)
result['description'] = description
return result
def _get_video_info(self, video_id):
config_url = self._CONFIG_URL_TEMPLATE % video_id
config = self._download_json(config_url, video_id)
media = config['playlist']['media']
return {
'id': media['metadata']['videoId'],
'url': media['url'],
'title': media['metadata']['title'],
'thumbnail': media['poster'][0]['url'].replace('{size}', 'grande'),
}
class OneUPIE(IGNIE):
_VALID_URL = r'https?://gamevideos\.1up\.com/(?P<type>video)/id/(?P<name_or_id>.+)\.html'
IE_NAME = '1up.com'
_DESCRIPTION_RE = r'<div id="vid_summary">(.+?)</div>'
_TESTS = [{
'url': 'http://gamevideos.1up.com/video/id/34976.html',
'md5': '68a54ce4ebc772e4b71e3123d413163d',
'info_dict': {
'id': '34976',
'ext': 'mp4',
'title': 'Sniper Elite V2 - Trailer',
'description': 'md5:5d289b722f5a6d940ca3136e9dae89cf',
}
}]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
result = super(OneUPIE, self)._real_extract(url)
result['id'] = mobj.group('name_or_id')
return result
|
gpl-3.0
|
[
504,
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
295,
199,
199,
504,
1275,
2330,
492,
21298,
421,
199,
533,
27499,
4332,
8,
18283,
304,
272,
408,
272,
18925,
367,
2005,
402,
314,
27499,
15424,
12,
2839,
20732,
14,
1030,
14,
957,
12,
9455,
14,
1030,
14,
957,
477,
14,
1030,
14,
957,
14,
272,
6601,
22010,
402,
652,
14,
1030,
14,
957,
787,
2597,
3748,
272,
408,
339,
485,
5600,
63,
2632,
275,
519,
7,
2859,
14144,
11198,
4537,
1030,
4537,
957,
9448,
48,
28,
466,
30,
11418,
92,
2384,
63,
11418,
92,
19813,
92,
5169,
4735,
15,
3672,
15,
4445,
430,
29478,
6977,
5547,
9448,
48,
28,
354,
63,
269,
63,
344,
31411,
3171,
272,
15292,
63,
2339,
275,
283,
1030,
14,
957,
7,
339,
485,
5569,
63,
2632,
63,
7433,
275,
283,
1014,
921,
1544,
14,
1030,
14,
957,
15,
11418,
15,
7532,
15,
344,
3149,
83,
14,
888,
7,
272,
485,
17705,
63,
907,
275,
359,
267,
519,
7601,
3751,
1021,
628,
1606,
13,
785,
13,
1802,
1743,
28149,
15939,
3751,
4206,
267,
519,
7,
344,
628,
1662,
63,
2384,
63,
3722,
1743,
6697,
28,
80,
13661,
6697,
15939,
80,
4206,
267,
519,
7601,
2024,
536,
628,
1802,
2,
1564,
628,
17140,
32691,
272,
1622,
339,
485,
7569,
275,
359,
267,
469,
288,
283,
633,
356,
283,
1014,
921,
1544,
14,
1030,
14,
957,
15,
11418,
15,
6965,
15,
1690,
15,
1717,
15,
1589,
13,
2019,
13,
1618,
13,
527,
13,
8578,
297,
288,
283,
1064,
21,
356,
283,
28870,
24,
3691,
67,
11370,
17764,
614,
1081,
67,
19,
66,
1272,
70,
1079,
26293,
996,
69,
25,
297,
288,
283,
815,
63,
807,
356,
469,
355,
283,
344,
356,
283,
24,
70,
16414,
19446,
70,
1184,
29451,
66,
1465,
12593,
1427,
66,
25,
69,
17,
2158,
30859,
297,
355,
283,
832,
356,
283,
311,
20,
297,
355,
283,
1213,
356,
283,
1918,
15237,
402,
18482,
26705,
297,
355,
283,
1802,
356,
283,
1064,
21,
26,
67,
1407,
2466,
68,
20,
13085,
65,
20,
68,
2824,
65,
383,
68,
21,
3624,
24,
379,
1020,
1299,
2760,
67,
297,
288,
789,
267,
1660,
267,
469,
288,
283,
633,
356,
283,
1014,
921,
278,
14,
1030,
14,
957,
15,
287,
15,
4445,
15,
1046,
12710,
15,
1960,
13,
10182,
13,
25970,
13,
262,
13,
71,
502,
13,
21,
13,
9099,
13,
14117,
13,
66,
674,
13,
12695,
13,
77,
688,
297,
288,
283,
10411,
356,
359,
355,
469,
490,
283,
815,
63,
807,
356,
469,
717,
283,
344,
356,
283,
21,
69,
32737,
969,
2426,
8001,
2333,
66,
3129,
67,
25,
12735,
2756,
1196,
24554,
29375,
297,
717,
283,
832,
356,
283,
311,
20,
297,
717,
283,
1213,
356,
283,
39,
6166,
959,
15709,
26705,
297,
717,
283,
1802,
356,
283,
50,
766,
7848,
366,
26307,
314,
333,
530,
641,
642,
10152,
402,
9219,
83,
14,
29075,
4154,
11248,
402,
314,
5288,
590,
598,
3759,
710,
856,
9195,
812,
3130,
490,
1660,
355,
1660,
355,
469,
490,
283,
815,
63,
807,
356,
469,
717,
283,
344,
356,
283,
2766,
1184,
2819,
1024,
15186,
3624,
20,
556,
8079,
1587,
18,
65,
1398,
772,
1085,
1024,
18,
297,
717,
283,
832,
356,
283,
311,
20,
297,
717,
283,
1213,
356,
283,
1479,
17078,
3930,
1470,
687,
598,
6166,
959,
315,
428,
674,
3930,
296,
297,
717,
283,
1802,
356,
283,
1918,
7390,
506,
6898,
89,
402,
598,
6166,
959,
315,
410,
324,
1835,
11999,
25134,
3130,
490,
1660,
355,
1660,
288,
2156,
288,
283,
1162,
356,
469,
355,
283,
2759,
63,
4249,
356,
715,
12,
288,
1660,
267,
1660,
267,
469,
288,
283,
633,
356,
283,
1014,
921,
1544,
14,
1030,
14,
957,
15,
19813,
15,
7280,
15,
2036,
15,
1046,
15,
5257,
688,
13,
1589,
6618,
13,
87,
668,
13,
21606,
13,
28129,
957,
13,
7280,
31,
6821,
297,
288,
283,
1064,
21,
356,
283,
20,
69,
25,
65,
16,
66,
983,
17,
69,
21,
1024,
3691,
2192,
617,
2177,
1184,
825,
16,
66,
25,
66,
19,
67,
23,
297,
288,
283,
815,
63,
807,
356,
469,
355,
283,
344,
356,
283,
19226,
70,
617,
7972,
70,
22,
68,
19,
67,
996,
70,
2766,
68,
22370,
667,
65,
17,
66,
29703,
70,
297,
355,
283,
832,
356,
283,
311,
20,
297,
355,
283,
1213,
356,
283,
497,
11530,
710,
6618,
446,
644,
668,
12643,
3566,
598,
14015,
957,
6927,
297,
355,
283,
1802,
356,
334,
490,
283,
30815,
867,
30537,
83,
12,
32580,
1351,
394,
638,
83,
12,
436,
4021,
280,
86,
1958,
7,
490,
283,
19981,
506,
6898,
89,
5452,
4154,
330,
264,
1619,
13437,
3530,
355,
2318,
288,
1660,
267,
1660,
272,
1622,
339,
347,
485,
1623,
63,
3722,
63,
344,
8,
277,
12,
9248,
304,
267,
522,
63,
344,
275,
359,
288,
519,
4065,
3722,
63,
344,
3212,
83,
10,
3427,
83,
12469,
17140,
32691,
288,
519,
5121,
419,
13,
3722,
13,
344,
628,
28149,
32691,
288,
519,
7601,
785,
1305,
628,
5017,
2531,
11198,
32691,
288,
519,
7601,
2024,
536,
628,
974,
26,
1569,
2,
1564,
628,
2795,
7985,
11198,
7216,
28149,
2447,
6977,
14,
8476,
6949,
288,
519,
7,
533,
628,
31863,
13,
20801,
25153,
10,
13472,
28959,
344,
628,
28149,
32691,
267,
1622,
267,
372,
291,
423,
1733,
63,
3821,
8,
470,
63,
344,
12,
9248,
12,
283,
3722,
1305,
358,
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,
536,
63,
269,
63,
344,
275,
14208,
14,
923,
360,
354,
63,
269,
63,
344,
358,
267,
2034,
63,
466,
275,
14208,
14,
923,
360,
466,
358,
267,
9248,
275,
291,
423,
4249,
63,
12022,
8,
633,
12,
536,
63,
269,
63,
344,
9,
267,
340,
2034,
63,
466,
1137,
283,
3722,
356,
288,
3663,
63,
3603,
275,
295,
14,
6452,
8,
355,
2650,
635,
536,
628,
11331,
2936,
2,
28959,
585,
628,
25153,
15279,
633,
2687,
2859,
14144,
1544,
4537,
1030,
4537,
957,
15,
11418,
15,
6697,
26332,
6,
4300,
355,
9248,
9,
288,
340,
3663,
63,
3603,
26,
355,
4811,
275,
359,
277,
14,
633,
63
] |
[
636,
2443,
363,
492,
2649,
63,
5955,
199,
199,
646,
295,
199,
199,
504,
1275,
2330,
492,
21298,
421,
199,
533,
27499,
4332,
8,
18283,
304,
272,
408,
272,
18925,
367,
2005,
402,
314,
27499,
15424,
12,
2839,
20732,
14,
1030,
14,
957,
12,
9455,
14,
1030,
14,
957,
477,
14,
1030,
14,
957,
14,
272,
6601,
22010,
402,
652,
14,
1030,
14,
957,
787,
2597,
3748,
272,
408,
339,
485,
5600,
63,
2632,
275,
519,
7,
2859,
14144,
11198,
4537,
1030,
4537,
957,
9448,
48,
28,
466,
30,
11418,
92,
2384,
63,
11418,
92,
19813,
92,
5169,
4735,
15,
3672,
15,
4445,
430,
29478,
6977,
5547,
9448,
48,
28,
354,
63,
269,
63,
344,
31411,
3171,
272,
15292,
63,
2339,
275,
283,
1030,
14,
957,
7,
339,
485,
5569,
63,
2632,
63,
7433,
275,
283,
1014,
921,
1544,
14,
1030,
14,
957,
15,
11418,
15,
7532,
15,
344,
3149,
83,
14,
888,
7,
272,
485,
17705,
63,
907,
275,
359,
267,
519,
7601,
3751,
1021,
628,
1606,
13,
785,
13,
1802,
1743,
28149,
15939,
3751,
4206,
267,
519,
7,
344,
628,
1662,
63,
2384,
63,
3722,
1743,
6697,
28,
80,
13661,
6697,
15939,
80,
4206,
267,
519,
7601,
2024,
536,
628,
1802,
2,
1564,
628,
17140,
32691,
272,
1622,
339,
485,
7569,
275,
359,
267,
469,
288,
283,
633,
356,
283,
1014,
921,
1544,
14,
1030,
14,
957,
15,
11418,
15,
6965,
15,
1690,
15,
1717,
15,
1589,
13,
2019,
13,
1618,
13,
527,
13,
8578,
297,
288,
283,
1064,
21,
356,
283,
28870,
24,
3691,
67,
11370,
17764,
614,
1081,
67,
19,
66,
1272,
70,
1079,
26293,
996,
69,
25,
297,
288,
283,
815,
63,
807,
356,
469,
355,
283,
344,
356,
283,
24,
70,
16414,
19446,
70,
1184,
29451,
66,
1465,
12593,
1427,
66,
25,
69,
17,
2158,
30859,
297,
355,
283,
832,
356,
283,
311,
20,
297,
355,
283,
1213,
356,
283,
1918,
15237,
402,
18482,
26705,
297,
355,
283,
1802,
356,
283,
1064,
21,
26,
67,
1407,
2466,
68,
20,
13085,
65,
20,
68,
2824,
65,
383,
68,
21,
3624,
24,
379,
1020,
1299,
2760,
67,
297,
288,
789,
267,
1660,
267,
469,
288,
283,
633,
356,
283,
1014,
921,
278,
14,
1030,
14,
957,
15,
287,
15,
4445,
15,
1046,
12710,
15,
1960,
13,
10182,
13,
25970,
13,
262,
13,
71,
502,
13,
21,
13,
9099,
13,
14117,
13,
66,
674,
13,
12695,
13,
77,
688,
297,
288,
283,
10411,
356,
359,
355,
469,
490,
283,
815,
63,
807,
356,
469,
717,
283,
344,
356,
283,
21,
69,
32737,
969,
2426,
8001,
2333,
66,
3129,
67,
25,
12735,
2756,
1196,
24554,
29375,
297,
717,
283,
832,
356,
283,
311,
20,
297,
717,
283,
1213,
356,
283,
39,
6166,
959,
15709,
26705,
297,
717,
283,
1802,
356,
283,
50,
766,
7848,
366,
26307,
314,
333,
530,
641,
642,
10152,
402,
9219,
83,
14,
29075,
4154,
11248,
402,
314,
5288,
590,
598,
3759,
710,
856,
9195,
812,
3130,
490,
1660,
355,
1660,
355,
469,
490,
283,
815,
63,
807,
356,
469,
717,
283,
344,
356,
283,
2766,
1184,
2819,
1024,
15186,
3624,
20,
556,
8079,
1587,
18,
65,
1398,
772,
1085,
1024,
18,
297,
717,
283,
832,
356,
283,
311,
20,
297,
717,
283,
1213,
356,
283,
1479,
17078,
3930,
1470,
687,
598,
6166,
959,
315,
428,
674,
3930,
296,
297,
717,
283,
1802,
356,
283,
1918,
7390,
506,
6898,
89,
402,
598,
6166,
959,
315,
410,
324,
1835,
11999,
25134,
3130,
490,
1660,
355,
1660,
288,
2156,
288,
283,
1162,
356,
469,
355,
283,
2759,
63,
4249,
356,
715,
12,
288,
1660,
267,
1660,
267,
469,
288,
283,
633,
356,
283,
1014,
921,
1544,
14,
1030,
14,
957,
15,
19813,
15,
7280,
15,
2036,
15,
1046,
15,
5257,
688,
13,
1589,
6618,
13,
87,
668,
13,
21606,
13,
28129,
957,
13,
7280,
31,
6821,
297,
288,
283,
1064,
21,
356,
283,
20,
69,
25,
65,
16,
66,
983,
17,
69,
21,
1024,
3691,
2192,
617,
2177,
1184,
825,
16,
66,
25,
66,
19,
67,
23,
297,
288,
283,
815,
63,
807,
356,
469,
355,
283,
344,
356,
283,
19226,
70,
617,
7972,
70,
22,
68,
19,
67,
996,
70,
2766,
68,
22370,
667,
65,
17,
66,
29703,
70,
297,
355,
283,
832,
356,
283,
311,
20,
297,
355,
283,
1213,
356,
283,
497,
11530,
710,
6618,
446,
644,
668,
12643,
3566,
598,
14015,
957,
6927,
297,
355,
283,
1802,
356,
334,
490,
283,
30815,
867,
30537,
83,
12,
32580,
1351,
394,
638,
83,
12,
436,
4021,
280,
86,
1958,
7,
490,
283,
19981,
506,
6898,
89,
5452,
4154,
330,
264,
1619,
13437,
3530,
355,
2318,
288,
1660,
267,
1660,
272,
1622,
339,
347,
485,
1623,
63,
3722,
63,
344,
8,
277,
12,
9248,
304,
267,
522,
63,
344,
275,
359,
288,
519,
4065,
3722,
63,
344,
3212,
83,
10,
3427,
83,
12469,
17140,
32691,
288,
519,
5121,
419,
13,
3722,
13,
344,
628,
28149,
32691,
288,
519,
7601,
785,
1305,
628,
5017,
2531,
11198,
32691,
288,
519,
7601,
2024,
536,
628,
974,
26,
1569,
2,
1564,
628,
2795,
7985,
11198,
7216,
28149,
2447,
6977,
14,
8476,
6949,
288,
519,
7,
533,
628,
31863,
13,
20801,
25153,
10,
13472,
28959,
344,
628,
28149,
32691,
267,
1622,
267,
372,
291,
423,
1733,
63,
3821,
8,
470,
63,
344,
12,
9248,
12,
283,
3722,
1305,
358,
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,
536,
63,
269,
63,
344,
275,
14208,
14,
923,
360,
354,
63,
269,
63,
344,
358,
267,
2034,
63,
466,
275,
14208,
14,
923,
360,
466,
358,
267,
9248,
275,
291,
423,
4249,
63,
12022,
8,
633,
12,
536,
63,
269,
63,
344,
9,
267,
340,
2034,
63,
466,
1137,
283,
3722,
356,
288,
3663,
63,
3603,
275,
295,
14,
6452,
8,
355,
2650,
635,
536,
628,
11331,
2936,
2,
28959,
585,
628,
25153,
15279,
633,
2687,
2859,
14144,
1544,
4537,
1030,
4537,
957,
15,
11418,
15,
6697,
26332,
6,
4300,
355,
9248,
9,
288,
340,
3663,
63,
3603,
26,
355,
4811,
275,
359,
277,
14,
633,
63,
0
] |
[
1,
1,
1,
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/lib
|
python/pmg_tk/skins/normal/ColorMap.py
|
1
|
2882
|
from Tkinter import *
class ColorMap:
"""
A simple converter from a ColorRamp (a gradient of nColors) to
a ColorMap (a graph of data + visual way pts)
"""
def __init__(self,parent,ramp,width=None,height=None,data=None):
"""
just produces the canvas/image for
the ColorRamp
"""
self.parent = parent
self.ramp = ramp
self.width = width
self.height = height
self.data = data
# constants
self.CIRCLE_RADIUS=3
# container
self.canvas = None
self.canvas_ids = []
def toCanvas(self,parent=None,canvas=None,ramp=None,width=None,height=None):
"""
get a correct canvas for this color ramp
"""
print " +ColorMap::toCanvas"
if None==parent:
parent=self.parent
if None==width:
width=self.width
if None==height:
height=self.height
if None==ramp:
ramp = self.ramp
if None==canvas:
canvas = self.canvas
r = self.CIRCLE_RADIUS
## if self.canvas!=None:
## # empty the canvas
## for x in self.canvas_ids:
## self.canvas.delete(x)
## self.canvas_ids = []
## else:
## # create empty canvas
## self.canvas = Canvas(parent,width=width,height=height,bg="white")
# draw colored circles where the users clicked
for key in ramp.keys.keys():
curColorPt = ramp.keys[key]
# get original values
origX, origY, origColor = curColorPt.idx, curColorPt.color[3], curColorPt.color
# convert to scaled and Tkinter-friendly formats
# scale X
x = int(float(origX)/float(ramp.nColors) * width)
# scale Y
y = int(height * (1.0-float(origY)))
# convert the color from RGBA --> HEX6
colHEX6 = "#%02x%02x%02x" % (origColor[0]*255., origColor[1]*255., origColor[2]*255.)
# plot the pt
unique_id = canvas.create_oval((x-r,y-r,x+r,y+r),fill=colHEX6,tags="colorPt")
self.canvas_ids.append(unique_id)
print " -ColorMap::toCanvas"
return canvas
def clearCanvas(self):
for x in self.canvas_ids:
self.canvas.delete(x)
if __name__=="__main__":
# test with a ColorRamp
try:
root = Tk()
from ColorRamp import ColorRamp
c = ColorRamp(256)
c.addColor(0, (0,0,0,0.7))
c.addColor(128, (1,0,0,0.5))
c.addColor(255, (1,1,1,0.2))
m = ColorMap(root, ramp=c, width=256, height=100)
can = m.toCanvas(root)
can.pack()
root.mainloop()
except ImportError:
print "Warning: Cannot test with a color ramp"
|
gpl-2.0
|
[
199,
504,
16826,
492,
627,
199,
199,
533,
11581,
2956,
26,
272,
408,
272,
437,
3486,
11109,
687,
282,
11581,
1537,
311,
334,
65,
6709,
402,
302,
20094,
9,
370,
272,
282,
11581,
2956,
334,
65,
3343,
402,
666,
435,
13104,
4340,
21286,
9,
272,
408,
272,
347,
636,
826,
721,
277,
12,
1708,
12,
345,
311,
12,
2063,
29,
403,
12,
3333,
29,
403,
12,
576,
29,
403,
304,
267,
408,
267,
2951,
16904,
314,
10218,
15,
1569,
367,
267,
314,
11581,
1537,
311,
267,
408,
267,
291,
14,
1708,
275,
1676,
267,
291,
14,
345,
311,
275,
660,
311,
267,
291,
14,
2063,
275,
3462,
267,
291,
14,
3333,
275,
4569,
267,
291,
14,
576,
275,
666,
267,
327,
5262,
267,
291,
14,
31749,
906,
63,
19662,
30373,
29,
19,
267,
327,
3970,
267,
291,
14,
7682,
275,
488,
267,
291,
14,
7682,
63,
1580,
275,
942,
339,
347,
370,
15174,
8,
277,
12,
1708,
29,
403,
12,
7682,
29,
403,
12,
345,
311,
29,
403,
12,
2063,
29,
403,
12,
3333,
29,
403,
304,
267,
408,
267,
664,
282,
3211,
10218,
367,
642,
3164,
660,
311,
267,
408,
267,
870,
298,
435,
4117,
2956,
447,
475,
15174,
2,
267,
340,
488,
389,
1708,
26,
288,
1676,
29,
277,
14,
1708,
267,
340,
488,
389,
2063,
26,
288,
3462,
29,
277,
14,
2063,
267,
340,
488,
389,
3333,
26,
288,
4569,
29,
277,
14,
3333,
267,
340,
488,
389,
345,
311,
26,
288,
660,
311,
275,
291,
14,
345,
311,
267,
340,
488,
389,
7682,
26,
288,
10218,
275,
291,
14,
7682,
398,
519,
275,
291,
14,
31749,
906,
63,
19662,
30373,
398,
925,
340,
291,
14,
7682,
1111,
403,
26,
267,
925,
258,
327,
2701,
314,
10218,
267,
925,
258,
367,
671,
315,
291,
14,
7682,
63,
1580,
26,
267,
925,
260,
291,
14,
7682,
14,
1807,
8,
88,
9,
267,
925,
258,
291,
14,
7682,
63,
1580,
275,
942,
267,
925,
587,
26,
267,
925,
258,
327,
1218,
2701,
10218,
267,
925,
258,
291,
14,
7682,
275,
29349,
8,
1708,
12,
2063,
29,
2063,
12,
3333,
29,
3333,
12,
6856,
628,
7510,
531,
2728,
327,
5954,
32076,
17990,
83,
2382,
314,
4390,
28614,
267,
367,
790,
315,
660,
311,
14,
1612,
14,
1612,
837,
288,
1094,
4117,
19886,
275,
660,
311,
14,
1612,
59,
498,
61,
953,
327,
664,
3379,
1338,
288,
2306,
56,
12,
2306,
57,
12,
2306,
4117,
275,
1094,
4117,
19886,
14,
2996,
12,
1094,
4117,
19886,
14,
2326,
59,
19,
467,
1094,
4117,
19886,
14,
2326,
27180,
327,
3957,
370,
17923,
436,
16826,
13,
17317,
6752,
288,
327,
4666,
1323,
288,
671,
275,
1109,
8,
1609,
8,
2981,
56,
2447,
1609,
8,
345,
311,
14,
78,
20094,
9,
627,
3462,
9,
288,
327,
4666,
1488,
288,
612,
275,
1109,
8,
3333,
627,
334,
17,
14,
16,
13,
1609,
8,
2981,
57,
1724,
288,
327,
3957,
314,
3164,
687,
820,
39,
4134,
10541,
29467,
22,
288,
1048,
21377,
22,
275,
5426,
5,
996,
88,
5,
996,
88,
5,
996,
88,
2,
450,
334,
2981,
4117,
59,
16,
3672,
2299,
2020,
2306,
4117,
59,
17,
3672,
2299,
2020,
2306,
4117,
59,
18,
3672,
2299,
4959,
288,
327,
5137,
314,
10063,
288,
3747,
63,
344,
275,
10218,
14,
981,
63,
79,
637,
1332,
88,
13,
82,
12,
89,
13,
82,
12,
88,
11,
82,
12,
89,
11,
82,
395,
4498,
29,
761,
21377,
22,
12,
2969,
628,
2326,
19886,
531,
288,
291,
14,
7682,
63,
1580,
14,
740,
8,
3235,
63,
344,
9,
267,
870,
298,
446,
4117,
2956,
447,
475,
15174,
2,
3777,
267,
372,
10218,
339,
347,
5436,
15174,
8,
277,
304,
267,
367,
671,
315,
291,
14,
7682,
63,
1580,
26,
288,
291,
14,
7682,
14,
1807,
8,
88,
9,
421,
199,
692,
636,
354,
363,
11800,
363,
973,
5727,
339,
327,
511,
543,
282,
11581,
1537,
311,
272,
862,
26,
267,
1738,
275,
12435,
342,
267,
687,
11581,
1537,
311,
492,
11581,
1537,
311,
267,
286,
275,
11581,
1537,
311,
8,
3912,
9,
267,
286,
14,
525,
4117,
8,
16,
12,
334,
16,
12,
16,
12,
16,
12,
16,
14,
23,
430,
267,
286,
14,
525,
4117,
8,
3933,
12,
334,
17,
12,
16,
12,
16,
12,
16,
14,
21,
430,
267,
286,
14,
525,
4117,
8,
2299,
12,
334,
17,
12,
17,
12,
17,
12,
16,
14,
18,
430,
2728,
333,
275,
11581,
2956,
8,
1231,
12,
660,
311,
29,
67,
12,
3462,
29,
3912,
12,
4569,
29,
1960,
9,
2728,
883,
275,
333,
14,
475,
15174,
8,
1231,
9,
267,
883,
14,
1389,
342,
267,
1738,
14,
22644,
342,
272,
871,
3545,
26,
267,
870,
298,
3849,
26,
18435,
511,
543,
282,
3164,
660,
311,
2,
13359,
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
] |
[
504,
16826,
492,
627,
199,
199,
533,
11581,
2956,
26,
272,
408,
272,
437,
3486,
11109,
687,
282,
11581,
1537,
311,
334,
65,
6709,
402,
302,
20094,
9,
370,
272,
282,
11581,
2956,
334,
65,
3343,
402,
666,
435,
13104,
4340,
21286,
9,
272,
408,
272,
347,
636,
826,
721,
277,
12,
1708,
12,
345,
311,
12,
2063,
29,
403,
12,
3333,
29,
403,
12,
576,
29,
403,
304,
267,
408,
267,
2951,
16904,
314,
10218,
15,
1569,
367,
267,
314,
11581,
1537,
311,
267,
408,
267,
291,
14,
1708,
275,
1676,
267,
291,
14,
345,
311,
275,
660,
311,
267,
291,
14,
2063,
275,
3462,
267,
291,
14,
3333,
275,
4569,
267,
291,
14,
576,
275,
666,
267,
327,
5262,
267,
291,
14,
31749,
906,
63,
19662,
30373,
29,
19,
267,
327,
3970,
267,
291,
14,
7682,
275,
488,
267,
291,
14,
7682,
63,
1580,
275,
942,
339,
347,
370,
15174,
8,
277,
12,
1708,
29,
403,
12,
7682,
29,
403,
12,
345,
311,
29,
403,
12,
2063,
29,
403,
12,
3333,
29,
403,
304,
267,
408,
267,
664,
282,
3211,
10218,
367,
642,
3164,
660,
311,
267,
408,
267,
870,
298,
435,
4117,
2956,
447,
475,
15174,
2,
267,
340,
488,
389,
1708,
26,
288,
1676,
29,
277,
14,
1708,
267,
340,
488,
389,
2063,
26,
288,
3462,
29,
277,
14,
2063,
267,
340,
488,
389,
3333,
26,
288,
4569,
29,
277,
14,
3333,
267,
340,
488,
389,
345,
311,
26,
288,
660,
311,
275,
291,
14,
345,
311,
267,
340,
488,
389,
7682,
26,
288,
10218,
275,
291,
14,
7682,
398,
519,
275,
291,
14,
31749,
906,
63,
19662,
30373,
398,
925,
340,
291,
14,
7682,
1111,
403,
26,
267,
925,
258,
327,
2701,
314,
10218,
267,
925,
258,
367,
671,
315,
291,
14,
7682,
63,
1580,
26,
267,
925,
260,
291,
14,
7682,
14,
1807,
8,
88,
9,
267,
925,
258,
291,
14,
7682,
63,
1580,
275,
942,
267,
925,
587,
26,
267,
925,
258,
327,
1218,
2701,
10218,
267,
925,
258,
291,
14,
7682,
275,
29349,
8,
1708,
12,
2063,
29,
2063,
12,
3333,
29,
3333,
12,
6856,
628,
7510,
531,
2728,
327,
5954,
32076,
17990,
83,
2382,
314,
4390,
28614,
267,
367,
790,
315,
660,
311,
14,
1612,
14,
1612,
837,
288,
1094,
4117,
19886,
275,
660,
311,
14,
1612,
59,
498,
61,
953,
327,
664,
3379,
1338,
288,
2306,
56,
12,
2306,
57,
12,
2306,
4117,
275,
1094,
4117,
19886,
14,
2996,
12,
1094,
4117,
19886,
14,
2326,
59,
19,
467,
1094,
4117,
19886,
14,
2326,
27180,
327,
3957,
370,
17923,
436,
16826,
13,
17317,
6752,
288,
327,
4666,
1323,
288,
671,
275,
1109,
8,
1609,
8,
2981,
56,
2447,
1609,
8,
345,
311,
14,
78,
20094,
9,
627,
3462,
9,
288,
327,
4666,
1488,
288,
612,
275,
1109,
8,
3333,
627,
334,
17,
14,
16,
13,
1609,
8,
2981,
57,
1724,
288,
327,
3957,
314,
3164,
687,
820,
39,
4134,
10541,
29467,
22,
288,
1048,
21377,
22,
275,
5426,
5,
996,
88,
5,
996,
88,
5,
996,
88,
2,
450,
334,
2981,
4117,
59,
16,
3672,
2299,
2020,
2306,
4117,
59,
17,
3672,
2299,
2020,
2306,
4117,
59,
18,
3672,
2299,
4959,
288,
327,
5137,
314,
10063,
288,
3747,
63,
344,
275,
10218,
14,
981,
63,
79,
637,
1332,
88,
13,
82,
12,
89,
13,
82,
12,
88,
11,
82,
12,
89,
11,
82,
395,
4498,
29,
761,
21377,
22,
12,
2969,
628,
2326,
19886,
531,
288,
291,
14,
7682,
63,
1580,
14,
740,
8,
3235,
63,
344,
9,
267,
870,
298,
446,
4117,
2956,
447,
475,
15174,
2,
3777,
267,
372,
10218,
339,
347,
5436,
15174,
8,
277,
304,
267,
367,
671,
315,
291,
14,
7682,
63,
1580,
26,
288,
291,
14,
7682,
14,
1807,
8,
88,
9,
421,
199,
692,
636,
354,
363,
11800,
363,
973,
5727,
339,
327,
511,
543,
282,
11581,
1537,
311,
272,
862,
26,
267,
1738,
275,
12435,
342,
267,
687,
11581,
1537,
311,
492,
11581,
1537,
311,
267,
286,
275,
11581,
1537,
311,
8,
3912,
9,
267,
286,
14,
525,
4117,
8,
16,
12,
334,
16,
12,
16,
12,
16,
12,
16,
14,
23,
430,
267,
286,
14,
525,
4117,
8,
3933,
12,
334,
17,
12,
16,
12,
16,
12,
16,
14,
21,
430,
267,
286,
14,
525,
4117,
8,
2299,
12,
334,
17,
12,
17,
12,
17,
12,
16,
14,
18,
430,
2728,
333,
275,
11581,
2956,
8,
1231,
12,
660,
311,
29,
67,
12,
3462,
29,
3912,
12,
4569,
29,
1960,
9,
2728,
883,
275,
333,
14,
475,
15174,
8,
1231,
9,
267,
883,
14,
1389,
342,
267,
1738,
14,
22644,
342,
272,
871,
3545,
26,
267,
870,
298,
3849,
26,
18435,
511,
543,
282,
3164,
660,
311,
2,
13359,
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,
0
] |
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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in/env python
#ryan g coleman ryangc@mail.med.upenn.edu
#kim sharp, brian shoichet, upenn, ucsf own this, whatevers
#reads a pdb file, for each atom, pick the most occupied one.
#useful when the alternate positions and occupancies are meaningful.
#if tie, just pick a consistent set for each residue.
import sys,os,string,math #necessary for file and string stuff
import pdb
def pdbMostOccupied(pdbFileName, outName=None, exceptions=[]):
pdbEntry = pdb.pdbData(pdbFileName)
newPdb = pdbEntry.copy()
#print newPdb.altChars.count('A'), newPdb.altChars.count('B')
newPdb.selectMostOccupied(exceptions=exceptions)
#print newPdb.altChars.count('A'), newPdb.altChars.count('B')
newPdb.write(outName)
#this is the main loop here
if -1 != string.find(sys.argv[0], "pdbMostOccupied.py"):
outName = None
exceptions = []
if len(sys.argv) > 3:
ids = string.split(sys.argv[3], '+')
for id in ids:
exceptions.append(int(id))
if len(sys.argv) > 2:
outName = sys.argv[2]
pdbFileName = sys.argv[1]
pdbMostOccupied(pdbFileName, outName, exceptions)
else:
print "Usage: pdbMostOccupied.py pdbFile outFile [exceptions]"
print " exceptions is a list of residue ids like 55+66 that the minor form"
print " of each will be chosen instead of the most occupied form"
|
gpl-2.0
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
9948,
199,
3,
651,
290,
486,
512,
274,
1237,
519,
11912,
67,
32,
1198,
14,
3594,
14,
384,
287,
78,
14,
8654,
199,
3,
75,
1017,
1033,
12868,
12,
330,
18429,
930,
1158,
386,
12,
1536,
287,
78,
12,
27455,
70,
5705,
642,
12,
15685,
83,
199,
3,
15656,
282,
10543,
570,
12,
367,
1924,
6222,
12,
3732,
314,
4750,
26182,
5299,
1373,
14,
221,
199,
3,
1180,
1893,
1380,
314,
18034,
12266,
436,
26182,
290,
2578,
787,
26562,
14,
199,
3,
692,
3367,
69,
12,
2951,
3732,
282,
12137,
663,
367,
1924,
23185,
310,
14,
199,
199,
646,
984,
12,
736,
12,
875,
12,
3442,
263,
327,
17927,
367,
570,
436,
1059,
8292,
199,
646,
10543,
199,
199,
318,
10543,
24625,
47,
2055,
384,
5299,
8,
10511,
7733,
12,
734,
985,
29,
403,
12,
4967,
17894,
523,
10543,
3900,
275,
10543,
14,
10511,
1451,
8,
10511,
7733,
9,
523,
892,
21427,
275,
10543,
3900,
14,
1574,
342,
523,
327,
1361,
892,
21427,
14,
4478,
11229,
14,
835,
360,
33,
659,
892,
21427,
14,
4478,
11229,
14,
835,
360,
34,
358,
523,
892,
21427,
14,
2416,
24625,
47,
2055,
384,
5299,
8,
3924,
29,
3924,
9,
523,
327,
1361,
892,
21427,
14,
4478,
11229,
14,
835,
360,
33,
659,
892,
21427,
14,
4478,
11229,
14,
835,
360,
34,
358,
523,
892,
21427,
14,
952,
8,
548,
985,
9,
199,
199,
3,
3749,
365,
314,
2446,
4438,
2348,
199,
692,
446,
17,
1137,
1059,
14,
1623,
8,
1274,
14,
3020,
59,
16,
467,
298,
10511,
24625,
47,
2055,
384,
5299,
14,
647,
2349,
523,
734,
985,
275,
488,
523,
4967,
275,
942,
523,
340,
822,
8,
1274,
14,
3020,
9,
690,
650,
26,
272,
2762,
275,
1059,
14,
1294,
8,
1274,
14,
3020,
59,
19,
467,
6681,
358,
272,
367,
1305,
315,
2762,
26,
489,
4967,
14,
740,
8,
442,
8,
344,
430,
523,
340,
822,
8,
1274,
14,
3020,
9,
690,
499,
26,
272,
734,
985,
275,
984,
14,
3020,
59,
18,
61,
272,
10543,
7733,
275,
984,
14,
3020,
59,
17,
61,
272,
10543,
24625,
47,
2055,
384,
5299,
8,
10511,
7733,
12,
734,
985,
12,
4967,
9,
523,
587,
26,
272,
870,
298,
7692,
26,
10543,
24625,
47,
2055,
384,
5299,
14,
647,
10543,
1173,
734,
1173,
359,
3924,
8480,
272,
870,
298,
221,
4967,
365,
282,
769,
402,
23185,
310,
2762,
2839,
12766,
11,
1272,
626,
314,
12612,
1824,
2,
272,
870,
298,
221,
402,
1924,
911,
506,
12414,
3140,
402,
314,
4750,
26182,
5299,
1824,
2,
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
] |
[
2647,
15,
1393,
15,
1813,
2366,
9948,
199,
3,
651,
290,
486,
512,
274,
1237,
519,
11912,
67,
32,
1198,
14,
3594,
14,
384,
287,
78,
14,
8654,
199,
3,
75,
1017,
1033,
12868,
12,
330,
18429,
930,
1158,
386,
12,
1536,
287,
78,
12,
27455,
70,
5705,
642,
12,
15685,
83,
199,
3,
15656,
282,
10543,
570,
12,
367,
1924,
6222,
12,
3732,
314,
4750,
26182,
5299,
1373,
14,
221,
199,
3,
1180,
1893,
1380,
314,
18034,
12266,
436,
26182,
290,
2578,
787,
26562,
14,
199,
3,
692,
3367,
69,
12,
2951,
3732,
282,
12137,
663,
367,
1924,
23185,
310,
14,
199,
199,
646,
984,
12,
736,
12,
875,
12,
3442,
263,
327,
17927,
367,
570,
436,
1059,
8292,
199,
646,
10543,
199,
199,
318,
10543,
24625,
47,
2055,
384,
5299,
8,
10511,
7733,
12,
734,
985,
29,
403,
12,
4967,
17894,
523,
10543,
3900,
275,
10543,
14,
10511,
1451,
8,
10511,
7733,
9,
523,
892,
21427,
275,
10543,
3900,
14,
1574,
342,
523,
327,
1361,
892,
21427,
14,
4478,
11229,
14,
835,
360,
33,
659,
892,
21427,
14,
4478,
11229,
14,
835,
360,
34,
358,
523,
892,
21427,
14,
2416,
24625,
47,
2055,
384,
5299,
8,
3924,
29,
3924,
9,
523,
327,
1361,
892,
21427,
14,
4478,
11229,
14,
835,
360,
33,
659,
892,
21427,
14,
4478,
11229,
14,
835,
360,
34,
358,
523,
892,
21427,
14,
952,
8,
548,
985,
9,
199,
199,
3,
3749,
365,
314,
2446,
4438,
2348,
199,
692,
446,
17,
1137,
1059,
14,
1623,
8,
1274,
14,
3020,
59,
16,
467,
298,
10511,
24625,
47,
2055,
384,
5299,
14,
647,
2349,
523,
734,
985,
275,
488,
523,
4967,
275,
942,
523,
340,
822,
8,
1274,
14,
3020,
9,
690,
650,
26,
272,
2762,
275,
1059,
14,
1294,
8,
1274,
14,
3020,
59,
19,
467,
6681,
358,
272,
367,
1305,
315,
2762,
26,
489,
4967,
14,
740,
8,
442,
8,
344,
430,
523,
340,
822,
8,
1274,
14,
3020,
9,
690,
499,
26,
272,
734,
985,
275,
984,
14,
3020,
59,
18,
61,
272,
10543,
7733,
275,
984,
14,
3020,
59,
17,
61,
272,
10543,
24625,
47,
2055,
384,
5299,
8,
10511,
7733,
12,
734,
985,
12,
4967,
9,
523,
587,
26,
272,
870,
298,
7692,
26,
10543,
24625,
47,
2055,
384,
5299,
14,
647,
10543,
1173,
734,
1173,
359,
3924,
8480,
272,
870,
298,
221,
4967,
365,
282,
769,
402,
23185,
310,
2762,
2839,
12766,
11,
1272,
626,
314,
12612,
1824,
2,
272,
870,
298,
221,
402,
1924,
911,
506,
12414,
3140,
402,
314,
4750,
26182,
5299,
1824,
2,
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,
32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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] |
imron/scalyr-agent-2
|
benchmarks/scripts/send_usage_data_to_codespeed.py
|
2
|
13778
|
#!/usr/bin/env python
# Copyright 2014-2020 Scalyr 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.
"""
Script which utilizes ProcessTracker abstraction from Scalyr Linux Process Metrics monitor to
collect various agent metrics which are used to track agent resource utilization over time.
It captures two types of metrics:
1. Monotonically increasing ones aka counters - metrics such as CPU time (user and system), disk
write and read request counts, etc. Those values monotonically increase over the process life
time so we only capture the values once before stopping.
2. Values which can change over time aka gauges - memory usage (resident and virtual), number of
open files, number of active threads.
Those values can change over time, so we periodically capture them and calculate derivative
values at the end of the capture period (min, max, avg, stddev).
Dependencies:
- scalyr_agent Python package
- requests
- numpy
"""
from __future__ import absolute_import
from __future__ import print_function
from io import open
if False: # NOSONAR
# NOTE: This is a workaround for old Python versions where typing module is not available
# We should eventually improve that once we start producing distributions with Python
# interpreter and dependencies bundled in.
# Adding conditional "typing" dependency would require too much boiler plate code at this point.
from typing import Dict
from typing import Tuple
from typing import List
from typing import Union
from typing import Optional
T_metric_value = Union[int, float]
import os
import sys
import time
import logging
import signal
import json
import argparse
from datetime import datetime
from collections import defaultdict
import six
import numpy as np
import psutil
BASE_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, os.path.abspath(os.path.join(BASE_DIR, "../../")))
from scalyr_agent.builtin_monitors.linux_process_metrics import ProcessTracker
from scalyr_agent.builtin_monitors.linux_process_metrics import Metric
from utils import initialize_logging
from utils import add_common_parser_arguments
from utils import parse_auth_credentials
from utils import parse_commit_date
from utils import send_payload_to_codespeed
logger = logging.getLogger(__name__)
METRICS_GAUGES = {
# CPU usage related metrics
"cpu_threads": Metric(name="app.threads", _type=None),
# Memory usage related metrics
"memory_usage_rss": Metric(name="app.mem.bytes", _type="resident"),
"memory_usage_rss_shared": Metric(name="app.mem.bytes", _type="resident_shared"),
"memory_usage_rss_private": Metric(name="app.mem.bytes", _type="resident_private"),
"memory_usage_vms": Metric(name="app.mem.bytes", _type="vmsize"),
# IO related metrics
"io_open_fds": Metric(name="app.io.fds", _type="open"),
# GC related metrics
"gc_garbage": Metric(name="app.gc.garbage", _type=None),
} # type: Dict[str, Metric]
METRICS_COUNTERS = {
# CPU usage related metrics
"cpu_time_user": Metric(name="app.cpu", _type="user"),
"cpu_time_system": Metric(name="app.cpu", _type="system"),
# IO related metrics
"io_read_count_requests": Metric(name="app.disk.requests", _type="read"),
"io_write_count_requests": Metric(name="app.disk.requests", _type="write"),
"io_read_count_bytes": Metric(name="app.disk.bytes", _type="read"),
"io_write_count_bytes": Metric(name="app.disk.bytes", _type="write"),
} # type: Dict[str, Metric]
def bytes_to_megabytes(value):
if not value:
return value
return float(value) / 1048576
# Functions for formatting metrics values
# We use those so we operate in more user-friendly units. It makes no sense to track memory usae
# in bytes when in reality, actual usage will never be smaller than a couple of MBs
METRIC_FORMAT_FUNCTIONS = {
"memory_usage_rss": bytes_to_megabytes,
"memory_usage_vms": bytes_to_megabytes,
"memory_usage_rss_shared": bytes_to_megabytes,
"memory_usage_rss_private": bytes_to_megabytes,
}
def send_data_to_codespeed(
codespeed_url,
codespeed_auth,
codespeed_project,
codespeed_executable,
codespeed_environment,
branch,
commit_id,
result,
commit_date=None,
dry_run=False,
):
# type: (str, Optional[Tuple[str, str]], str, str, str, str, str, dict, Optional[datetime], bool) -> None
"""
Submit captured data to CodeSpeed instance.
"""
payload = []
for metric_name, metric_result in result.items():
benchmark = metric_name
item = {
"commitid": commit_id,
"branch": branch,
"project": codespeed_project,
"executable": codespeed_executable,
"benchmark": benchmark,
"environment": codespeed_environment,
"result_value": metric_result["value"],
}
if commit_date:
item["revision_date"] = commit_date.strftime("%Y-%m-%d %H:%M:%S")
# Include optional pre-computed data for gauge metrics
for key in ["min", "max", "std_dev"]:
if metric_result.get(key, None) is not None:
item[key] = metric_result[key]
payload.append(item)
send_payload_to_codespeed(
codespeed_url=codespeed_url,
codespeed_auth=codespeed_auth,
commit_id=commit_id,
payload=payload,
dry_run=dry_run,
)
def capture_metrics(
tracker, process, metrics, values, capture_agent_status_metrics=False
):
# type: (ProcessTracker, psutil.Process, Dict[str, Metric], dict, bool) -> dict
"""
Capture gauge metric types and store them in the provided dictionary.
"""
# Check if process we are monitoring is still alive
try:
os.kill(tracker.pid, 0)
except OSError:
raise ValueError('Process with pid "%s" is not alive' % (tracker.pid))
process_metrics = tracker.collect()
# Add in metrics we capture via psutil
psutil_metrics = get_additional_psutil_metrics(process=process)
process_metrics.update(psutil_metrics)
# Add in agent_status metrics (if enabled)
if capture_agent_status_metrics:
agent_status_metrics = get_agent_status_metrics(process=process)
process_metrics.update(agent_status_metrics)
metric_values = {}
for metric_name, metric_obj in metrics.items():
if metric_obj not in process_metrics:
continue
value = process_metrics[metric_obj]
format_func = METRIC_FORMAT_FUNCTIONS.get(metric_name, lambda val: val)
value = format_func(value)
metric_values[metric_name] = value
values[metric_name].append(value)
logger.debug("Captured metrics: %s" % (str(metric_values)))
return values
def get_additional_psutil_metrics(process):
# type: (psutil.Process) -> Dict[Metric, T_metric_value]
"""
Capture any additional metrics which are currently not exposed via Linux Process Metric tracker
using psutil.
"""
# Capture and calculate shared and private memory usage
metric_shared = Metric(name="app.mem.bytes", _type="resident_shared")
metric_private = Metric(name="app.mem.bytes", _type="resident_private")
result = {
metric_shared: 0,
metric_private: 0,
} # type: Dict[Metric, T_metric_value]
memory_maps = process.memory_maps()
for memory_map in memory_maps:
result[metric_shared] += memory_map.shared_clean + memory_map.shared_dirty
result[metric_private] += memory_map.private_clean + memory_map.private_dirty
return result
def get_agent_status_metrics(process):
# type: (psutil.Process) -> dict
"""
Retrieve additional agent related metrics utilizing agent status functionality.
"""
result = {}
# Request json format
agent_data_path = os.path.expanduser("~/scalyr-agent-dev/data")
status_format_file = os.path.join(agent_data_path, "status_format")
with open(status_format_file, "w") as fp:
fp.write(six.text_type("json"))
# Ask agent to dump metrics
os.kill(process.pid, signal.SIGUSR1)
# Wait a bit for agent to write the metrics and parse the metrics
time.sleep(2)
status_file = os.path.join(agent_data_path, "last_status")
with open(status_file, "r") as fp:
content = fp.read()
content = json.loads(content)
# NOTE: Currently we only capture gc metrics
metric_gc_garbage = Metric(name="app.gc.garbage", _type=None)
result[metric_gc_garbage] = content.get("gc_stats", {}).get("garbage", 0)
return result
def main(
pid,
codespeed_url,
codespeed_auth,
codespeed_project,
codespeed_executable,
codespeed_environment,
branch,
commit_id,
commit_date=None,
capture_agent_status_metrics=False,
dry_run=False,
):
# type: (int, str, Optional[Tuple[str, str]], str, str, str, str, str, Optional[datetime], bool, bool) -> None
"""
Main entry point / run loop for the script.
"""
logger.info('Monitoring process with pid "%s" for metrics' % (pid))
tracker = ProcessTracker(pid=pid, logger=logger)
process = psutil.Process(pid)
end_time = int(time.time() + args.capture_time)
# Dictionary where captured metrics are saved
# It maps metric name to a dictionary with the results
captured_values = defaultdict(list) # type: Dict[str, List[T_metric_value]]
# Give it some time for the process to start and initialize before first capture
time.sleep(5)
while time.time() <= end_time:
logger.debug("Capturing gauge metrics...")
capture_metrics(
tracker=tracker,
process=process,
metrics=METRICS_GAUGES,
values=captured_values,
capture_agent_status_metrics=capture_agent_status_metrics,
)
time.sleep(args.capture_interval)
# Capture counter metrics
logger.debug("Capturing counter metrics...")
capture_metrics(
tracker=tracker,
process=process,
metrics=METRICS_COUNTERS,
values=captured_values,
)
# Generate final result object and calculate derivatives for gauge metrics
result = {} # type: Dict[str, Dict[str, T_metric_value]]
# Calculate derivatives for gauge metrics
for metric_name in METRICS_GAUGES.keys():
if metric_name not in captured_values:
continue
values = captured_values[metric_name]
percentile_999 = np.percentile(values, 99.9)
minimum = min(values)
maximum = max(values)
std_dev = np.std(values)
result[metric_name] = {
"value": percentile_999,
"min": minimum,
"max": maximum,
"std_dev": std_dev,
}
for metric_name in METRICS_COUNTERS.keys():
metric_value = captured_values[metric_name][0]
result[metric_name] = {"value": metric_value}
logger.debug("Captured data: %s" % (str(result)))
logger.info("Capture complete, submitting metrics to CodeSpeed...")
send_data_to_codespeed(
codespeed_url=codespeed_url,
codespeed_auth=codespeed_auth,
codespeed_project=codespeed_project,
codespeed_executable=codespeed_executable,
codespeed_environment=codespeed_environment,
branch=branch,
commit_id=commit_id,
result=result,
commit_date=commit_date,
dry_run=dry_run,
)
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description=(
"Capture process level metric data and submit it " "to CodeSpeed instance"
)
)
# Add common arguments
parser = add_common_parser_arguments(parser=parser)
# Add arguments which are specific to this script
parser.add_argument(
"--pid",
type=int,
required=True,
help=("ID of a process to capture metrics for."),
)
parser.add_argument(
"--capture-time",
type=int,
required=True,
default=10,
help=("How long capture metrics for (in seconds)."),
)
parser.add_argument(
"--capture-interval",
type=float,
required=True,
default=1,
help=(
"How often to capture gauge metrics during the capture time "
"(in seconds)."
),
)
parser.add_argument(
"--capture-agent-status-metrics",
action="store_true",
default=False,
help=("True to also capture additional metrics using agent status file."),
)
args = parser.parse_args()
codespeed_auth = parse_auth_credentials(args.codespeed_auth)
commit_date = parse_commit_date(args.commit_date)
initialize_logging(debug=args.debug)
main(
pid=args.pid,
codespeed_url=args.codespeed_url,
codespeed_auth=codespeed_auth,
codespeed_project=args.codespeed_project,
codespeed_executable=args.codespeed_executable,
codespeed_environment=args.codespeed_environment,
branch=args.branch,
commit_id=args.commit_id,
commit_date=commit_date,
capture_agent_status_metrics=args.capture_agent_status_metrics,
dry_run=args.dry_run,
)
|
apache-2.0
|
[
3381,
2647,
15,
1393,
15,
1813,
2366,
199,
3,
1898,
6927,
13,
13934,
17619,
21897,
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,
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,
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,
199,
5229,
1314,
7678,
19030,
397,
7132,
13652,
2236,
29639,
687,
17619,
21897,
10130,
7132,
10072,
11818,
8372,
370,
199,
7112,
7750,
6631,
7186,
1314,
787,
1202,
370,
4426,
6631,
2073,
7678,
25698,
1806,
900,
14,
199,
199,
7940,
12162,
1482,
2877,
2943,
402,
7186,
26,
199,
199,
17,
14,
10953,
357,
265,
7288,
22255,
7869,
282,
7351,
21272,
446,
7186,
4066,
465,
11952,
900,
334,
751,
436,
2656,
395,
4543,
2043,
2218,
436,
1586,
1056,
8242,
12,
5423,
14,
18049,
261,
1338,
3485,
357,
265,
7288,
19781,
1806,
314,
2112,
15451,
2043,
900,
880,
781,
1454,
12296,
314,
1338,
5403,
2544,
23599,
14,
199,
199,
18,
14,
13468,
1314,
883,
1570,
1806,
900,
282,
7351,
486,
3844,
3389,
446,
4402,
4503,
334,
20807,
1326,
436,
5791,
395,
1329,
402,
2043,
1551,
1584,
12,
1329,
402,
4702,
7183,
14,
8410,
18049,
261,
1338,
883,
1570,
1806,
900,
12,
880,
781,
18745,
1183,
12296,
3062,
436,
8671,
18883,
2043,
1338,
737,
314,
1284,
402,
314,
12296,
6247,
334,
827,
12,
1390,
12,
12402,
12,
28052,
680,
199,
199,
11927,
26,
339,
446,
5269,
21897,
63,
4054,
2018,
2559,
272,
446,
4145,
272,
446,
2680,
199,
624,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
504,
5890,
492,
1551,
199,
199,
692,
756,
26,
221,
327,
653,
3100,
615,
689,
272,
327,
6944,
26,
961,
365,
282,
18092,
367,
2269,
2018,
5459,
2382,
14090,
859,
365,
440,
2808,
272,
327,
2136,
1077,
21356,
19053,
626,
5403,
781,
1343,
27955,
10208,
543,
2018,
272,
327,
12693,
436,
5124,
330,
725,
1146,
315,
14,
272,
327,
12934,
12303,
298,
29747,
2,
5936,
3955,
4409,
4634,
8298,
1234,
3566,
299,
750,
1233,
737,
642,
2376,
14,
272,
687,
14090,
492,
7448,
272,
687,
14090,
492,
11634,
272,
687,
14090,
492,
3820,
272,
687,
14090,
492,
15961,
272,
687,
14090,
492,
4879,
339,
377,
63,
5165,
63,
585,
275,
15961,
59,
442,
12,
2069,
61,
199,
199,
646,
747,
199,
646,
984,
199,
646,
900,
199,
646,
2050,
199,
646,
4673,
199,
646,
2022,
199,
646,
7534,
199,
199,
504,
2197,
492,
2197,
199,
504,
5055,
492,
10018,
199,
199,
646,
3816,
199,
646,
2680,
465,
980,
199,
646,
22214,
199,
199,
5825,
63,
3022,
275,
747,
14,
515,
14,
4832,
8,
736,
14,
515,
14,
3475,
8,
736,
14,
515,
14,
4832,
3460,
493,
29658,
199,
1274,
14,
515,
14,
3176,
8,
16,
12,
747,
14,
515,
14,
4832,
8,
736,
14,
515,
14,
904,
8,
5825,
63,
3022,
12,
298,
9707,
13324,
199,
199,
504,
5269,
21897,
63,
4054,
14,
5351,
63,
24048,
14,
5135,
63,
1412,
63,
6759,
492,
7132,
13652,
199,
504,
5269,
21897,
63,
4054,
14,
5351,
63,
24048,
14,
5135,
63,
1412,
63,
6759,
492,
22465,
199,
199,
504,
3778,
492,
8265,
63,
4806,
199,
504,
3778,
492,
1050,
63,
2330,
63,
2087,
63,
4958,
199,
504,
3778,
492,
2198,
63,
1178,
63,
6942,
199,
504,
3778,
492,
2198,
63,
3543,
63,
602,
199,
504,
3778,
492,
3222,
63,
4749,
63,
475,
63,
6021,
4536,
199,
199,
2921,
275,
2050,
14,
5572,
3460,
354,
3368,
421,
199,
30476,
63,
39,
9331,
39,
654,
275,
469,
272,
327,
11952,
4503,
4048,
7186,
272,
298,
3541,
63,
6962,
582,
22465,
8,
354,
628,
571,
14,
6962,
401,
485,
466,
29,
403,
395,
272,
327,
15825,
4503,
4048,
7186,
272,
298,
4844,
63,
3807,
63,
13614,
582,
22465,
8,
354,
628,
571,
14,
5286,
14,
2394,
401,
485,
466,
628,
20807,
1326,
1288,
272,
298,
4844,
63,
3807,
63,
13614,
63,
5555,
582,
22465,
8,
354,
628,
571,
14,
5286,
14,
2394,
401,
485,
466,
628,
20807,
1326,
63,
5555,
1288,
272,
298,
4844,
63,
3807,
63,
13614,
63,
4239,
582,
22465,
8,
354,
628,
571,
14,
5286,
14,
2394,
401,
485,
466,
628,
20807,
1326,
63,
4239,
1288,
272,
298,
4844,
63,
3807,
63,
16092,
582,
22465,
8,
354,
628,
571,
14,
5286,
14,
2394,
401,
485,
466,
628,
2611,
890,
1288,
272,
327,
5004,
4048,
7186,
272,
298,
2308,
63,
1490,
63,
14240,
582,
22465,
8,
354,
628,
571,
14,
2308,
14,
14240,
401,
485,
466,
628,
1490,
1288,
272,
327,
31555,
4048,
7186,
272,
298,
9493,
63,
28737,
582,
22465,
8,
354,
628,
571,
14,
9493,
14,
28737,
401,
485,
466,
29,
403,
395,
199,
93,
221,
327,
730,
26,
7448,
59,
495,
12,
22465,
61,
199,
199,
30476,
63,
23049,
51,
275,
469,
272,
327,
11952,
4503,
4048,
7186,
272,
298,
3541,
63,
521,
63,
751,
582,
22465,
8,
354,
628,
571,
14,
3541,
401,
485,
466,
628,
751,
1288,
272,
298,
3541,
63,
521,
63,
2253,
582,
22465,
8,
354,
628,
571,
14,
3541,
401,
485,
466,
628,
2253,
1288,
272,
327,
5004,
4048,
7186,
272,
298,
2308,
63,
739,
63,
835,
63,
6615,
582,
22465,
8,
354,
628,
571,
14,
4032,
14,
6615,
401,
485,
466,
628,
739,
1288,
272,
298,
2308,
63,
952,
63,
835,
63,
6615,
582,
22465,
8,
354,
628,
571,
14,
4032,
14,
6615,
401,
485,
466,
628,
952,
1288,
272,
298,
2308,
63,
739,
63,
835,
63,
2394,
582,
22465,
8,
354,
628,
571,
14,
4032,
14,
2394,
401,
485,
466,
628,
739
] |
[
2647,
15,
1393,
15,
1813,
2366,
199,
3,
1898,
6927,
13,
13934,
17619,
21897,
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,
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,
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,
199,
5229,
1314,
7678,
19030,
397,
7132,
13652,
2236,
29639,
687,
17619,
21897,
10130,
7132,
10072,
11818,
8372,
370,
199,
7112,
7750,
6631,
7186,
1314,
787,
1202,
370,
4426,
6631,
2073,
7678,
25698,
1806,
900,
14,
199,
199,
7940,
12162,
1482,
2877,
2943,
402,
7186,
26,
199,
199,
17,
14,
10953,
357,
265,
7288,
22255,
7869,
282,
7351,
21272,
446,
7186,
4066,
465,
11952,
900,
334,
751,
436,
2656,
395,
4543,
2043,
2218,
436,
1586,
1056,
8242,
12,
5423,
14,
18049,
261,
1338,
3485,
357,
265,
7288,
19781,
1806,
314,
2112,
15451,
2043,
900,
880,
781,
1454,
12296,
314,
1338,
5403,
2544,
23599,
14,
199,
199,
18,
14,
13468,
1314,
883,
1570,
1806,
900,
282,
7351,
486,
3844,
3389,
446,
4402,
4503,
334,
20807,
1326,
436,
5791,
395,
1329,
402,
2043,
1551,
1584,
12,
1329,
402,
4702,
7183,
14,
8410,
18049,
261,
1338,
883,
1570,
1806,
900,
12,
880,
781,
18745,
1183,
12296,
3062,
436,
8671,
18883,
2043,
1338,
737,
314,
1284,
402,
314,
12296,
6247,
334,
827,
12,
1390,
12,
12402,
12,
28052,
680,
199,
199,
11927,
26,
339,
446,
5269,
21897,
63,
4054,
2018,
2559,
272,
446,
4145,
272,
446,
2680,
199,
624,
199,
199,
504,
636,
2443,
363,
492,
3679,
63,
646,
199,
504,
636,
2443,
363,
492,
870,
63,
1593,
199,
504,
5890,
492,
1551,
199,
199,
692,
756,
26,
221,
327,
653,
3100,
615,
689,
272,
327,
6944,
26,
961,
365,
282,
18092,
367,
2269,
2018,
5459,
2382,
14090,
859,
365,
440,
2808,
272,
327,
2136,
1077,
21356,
19053,
626,
5403,
781,
1343,
27955,
10208,
543,
2018,
272,
327,
12693,
436,
5124,
330,
725,
1146,
315,
14,
272,
327,
12934,
12303,
298,
29747,
2,
5936,
3955,
4409,
4634,
8298,
1234,
3566,
299,
750,
1233,
737,
642,
2376,
14,
272,
687,
14090,
492,
7448,
272,
687,
14090,
492,
11634,
272,
687,
14090,
492,
3820,
272,
687,
14090,
492,
15961,
272,
687,
14090,
492,
4879,
339,
377,
63,
5165,
63,
585,
275,
15961,
59,
442,
12,
2069,
61,
199,
199,
646,
747,
199,
646,
984,
199,
646,
900,
199,
646,
2050,
199,
646,
4673,
199,
646,
2022,
199,
646,
7534,
199,
199,
504,
2197,
492,
2197,
199,
504,
5055,
492,
10018,
199,
199,
646,
3816,
199,
646,
2680,
465,
980,
199,
646,
22214,
199,
199,
5825,
63,
3022,
275,
747,
14,
515,
14,
4832,
8,
736,
14,
515,
14,
3475,
8,
736,
14,
515,
14,
4832,
3460,
493,
29658,
199,
1274,
14,
515,
14,
3176,
8,
16,
12,
747,
14,
515,
14,
4832,
8,
736,
14,
515,
14,
904,
8,
5825,
63,
3022,
12,
298,
9707,
13324,
199,
199,
504,
5269,
21897,
63,
4054,
14,
5351,
63,
24048,
14,
5135,
63,
1412,
63,
6759,
492,
7132,
13652,
199,
504,
5269,
21897,
63,
4054,
14,
5351,
63,
24048,
14,
5135,
63,
1412,
63,
6759,
492,
22465,
199,
199,
504,
3778,
492,
8265,
63,
4806,
199,
504,
3778,
492,
1050,
63,
2330,
63,
2087,
63,
4958,
199,
504,
3778,
492,
2198,
63,
1178,
63,
6942,
199,
504,
3778,
492,
2198,
63,
3543,
63,
602,
199,
504,
3778,
492,
3222,
63,
4749,
63,
475,
63,
6021,
4536,
199,
199,
2921,
275,
2050,
14,
5572,
3460,
354,
3368,
421,
199,
30476,
63,
39,
9331,
39,
654,
275,
469,
272,
327,
11952,
4503,
4048,
7186,
272,
298,
3541,
63,
6962,
582,
22465,
8,
354,
628,
571,
14,
6962,
401,
485,
466,
29,
403,
395,
272,
327,
15825,
4503,
4048,
7186,
272,
298,
4844,
63,
3807,
63,
13614,
582,
22465,
8,
354,
628,
571,
14,
5286,
14,
2394,
401,
485,
466,
628,
20807,
1326,
1288,
272,
298,
4844,
63,
3807,
63,
13614,
63,
5555,
582,
22465,
8,
354,
628,
571,
14,
5286,
14,
2394,
401,
485,
466,
628,
20807,
1326,
63,
5555,
1288,
272,
298,
4844,
63,
3807,
63,
13614,
63,
4239,
582,
22465,
8,
354,
628,
571,
14,
5286,
14,
2394,
401,
485,
466,
628,
20807,
1326,
63,
4239,
1288,
272,
298,
4844,
63,
3807,
63,
16092,
582,
22465,
8,
354,
628,
571,
14,
5286,
14,
2394,
401,
485,
466,
628,
2611,
890,
1288,
272,
327,
5004,
4048,
7186,
272,
298,
2308,
63,
1490,
63,
14240,
582,
22465,
8,
354,
628,
571,
14,
2308,
14,
14240,
401,
485,
466,
628,
1490,
1288,
272,
327,
31555,
4048,
7186,
272,
298,
9493,
63,
28737,
582,
22465,
8,
354,
628,
571,
14,
9493,
14,
28737,
401,
485,
466,
29,
403,
395,
199,
93,
221,
327,
730,
26,
7448,
59,
495,
12,
22465,
61,
199,
199,
30476,
63,
23049,
51,
275,
469,
272,
327,
11952,
4503,
4048,
7186,
272,
298,
3541,
63,
521,
63,
751,
582,
22465,
8,
354,
628,
571,
14,
3541,
401,
485,
466,
628,
751,
1288,
272,
298,
3541,
63,
521,
63,
2253,
582,
22465,
8,
354,
628,
571,
14,
3541,
401,
485,
466,
628,
2253,
1288,
272,
327,
5004,
4048,
7186,
272,
298,
2308,
63,
739,
63,
835,
63,
6615,
582,
22465,
8,
354,
628,
571,
14,
4032,
14,
6615,
401,
485,
466,
628,
739,
1288,
272,
298,
2308,
63,
952,
63,
835,
63,
6615,
582,
22465,
8,
354,
628,
571,
14,
4032,
14,
6615,
401,
485,
466,
628,
952,
1288,
272,
298,
2308,
63,
739,
63,
835,
63,
2394,
582,
22465,
8,
354,
628,
571,
14,
4032,
14,
2394,
401,
485,
466,
628,
739,
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,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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
] |
yelfathi/juniper-mpls-check
|
lsp_ping.py
|
1
|
5582
|
# -- coding: utf-8 --
__author__ = "yelfathi"
import argparse
import os
import re
import time
from jnpr.junos import Device
from multiprocessing import Process
class LSPping(Process):
def __init__(self, device, user, passwd, treetrace):
self.device = device
self.user = user
self.passwd = passwd
self.treetrace = treetrace
Process.__init__(self)
# Returns a list with next-hop and protocol-name
def check_rtentry(self, dev, prefix):
''' List with 2 entries:
prefix present or not in the routing table
the protocol name (Local, Direct ...)
'''
rtentry_result = ['False', 'False']
rtentry = dev.rpc.get_route_information(destination=prefix)
if rtentry.xpath('//nh'):
rtentry_result = [rtentry.xpath('//nh')[0],
rtentry.xpath('//protocol-name')[0].text]
return rtentry_result
# LSP ping to prefix, returns the nb of packets received
def ping_ldp(self, dev, prefix, dest, count):
ping_result = dev.rpc.request_ping_ldp_lsp(fec=prefix,
destination=dest,
count=count)
pkts_rcved = ping_result.xpath('//lsping-packets-received')[0].\
text.strip()
return pkts_rcved
# LSP traceroute to prefix, returns all the paths
def trace_ldp(self, dev, prefix, dest, ttl, wait, retries):
trace_result = dev.rpc.traceroute_mpls_ldp(fec=prefix,
destination=dest,
ttl=ttl,
wait=wait,
retries=retries)
return trace_result
def run(self):
''' Open the RPC connection to each device:
- check the rt-entry and the LSP reachability
because JUNOS RPC generates an exception for
local or unreachable prefix
- if OK LSP Ping to each prefix through all multipath (127.0.0.x)
multipath retrieved from lsp_treetrace.py script
'''
''' The file "lock" is used to check
if lsp-treetrace script is running
'''
if not os.path.isfile('lock'):
dev = Device(host=self.device,
user=self.user,
password=self.passwd)
try:
dev.open()
dev.timeout = 300
except Exception as err:
print 'Cannot connect to device:', err
with open(self.treetrace, 'r') as my_file:
result = my_file.read().splitlines()
for line in result:
[hopfail, lasthop, status] = ['', '', '']
pe = line.split(',')[0]
dest = line.split(',')[1]
time.sleep(0.1) # Wait 100 ms, avoiding false negative
if self.check_rtentry(dev, pe)[0] == 'False':
print 'Device {0}: no entry in routing table for prefix {1}'\
.format(self.device, pe)
elif self.check_rtentry(dev, pe)[1] == 'Direct':
print 'Device {0}: no test for local loopback {1}'\
.format(self.device, pe)
elif self.ping_ldp(dev, pe, dest, '1') != '1':
trace_result = self.trace_ldp(dev, pe, dest, '5', '5', '1')
hop_count = len(trace_result.xpath('//depth'))
for hop in range(hop_count):
ipv4_patt =\
re.compile('^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$')
address = trace_result.xpath('//address')[hop].text
if re.match(ipv4_patt, address):
hopfail = hop
lasthop = re.match(ipv4_patt, address).group()
status = trace_result.xpath('//status')[hop].text
if [hopfail, lasthop, status] != ['', '', '']:
print 'Device {0}: LSP treetrace failed for prefix {1}, destination {2}, failure at hop:{3}, address:{4}, with status:\"{5}\"'\
.format(self.device, pe, dest,
hopfail, lasthop, status)
dev.close()
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='\
LSP Ping')
parser.add_argument('--devices',
help='loopback devices separated by '+':\
1.1.1.1/32+2.2.2.2/32',
required=True)
parser.add_argument('--user',
help='username',
required=True)
parser.add_argument('--passwd',
help='password',
required=True)
parser.add_argument('--treetrace',
help='treetrace file w/o the extension \
generated by lsp-treetrace.py',
required=True)
args = parser.parse_args()
devlist = re.split('\+', args.devices)
# For each device, a different process is executed
jobs = []
for i in range(len(devlist)):
jobs.append(LSPping(devlist[i],
args.user,
args.passwd,
args.treetrace+'.'+devlist[i]))
for job in jobs:
job.start()
|
unlicense
|
[
3,
1553,
2803,
26,
2774,
13,
24,
1553,
199,
363,
2502,
363,
275,
298,
8048,
276,
1619,
73,
2,
421,
199,
646,
7534,
199,
646,
747,
199,
646,
295,
199,
646,
900,
199,
504,
1335,
1590,
82,
14,
31959,
492,
12272,
199,
504,
12866,
492,
7132,
421,
199,
533,
491,
5763,
4073,
8,
3498,
304,
339,
347,
636,
826,
721,
277,
12,
2243,
12,
922,
12,
15081,
12,
307,
7936,
5986,
304,
267,
291,
14,
1782,
275,
2243,
267,
291,
14,
751,
275,
922,
267,
291,
14,
12671,
275,
15081,
267,
291,
14,
84,
7936,
5986,
275,
307,
7936,
5986,
267,
7132,
855,
826,
721,
277,
9,
339,
327,
1803,
282,
769,
543,
2163,
13,
13376,
436,
4113,
13,
354,
272,
347,
1104,
63,
82,
767,
651,
8,
277,
12,
4866,
12,
2403,
304,
267,
1449,
3820,
543,
499,
4811,
26,
1467,
2403,
3451,
503,
440,
315,
314,
14870,
1817,
1467,
314,
4113,
536,
334,
5339,
12,
21128,
19172,
267,
1449,
267,
519,
767,
651,
63,
1099,
275,
788,
797,
297,
283,
797,
418,
267,
519,
767,
651,
275,
4866,
14,
4354,
14,
362,
63,
4449,
63,
11697,
8,
6881,
29,
1861,
9,
267,
340,
519,
767,
651,
14,
8006,
15079,
29199,
735,
288,
519,
767,
651,
63,
1099,
275,
359,
82,
767,
651,
14,
8006,
15079,
29199,
5832,
16,
467,
2892,
519,
767,
651,
14,
8006,
15079,
3922,
13,
354,
5832,
16,
1055,
505,
61,
267,
372,
519,
767,
651,
63,
1099,
339,
327,
491,
5763,
18249,
370,
2403,
12,
2529,
314,
8526,
402,
14593,
3086,
272,
347,
18249,
63,
17288,
8,
277,
12,
4866,
12,
2403,
12,
2053,
12,
2338,
304,
267,
18249,
63,
1099,
275,
4866,
14,
4354,
14,
1069,
63,
4073,
63,
17288,
63,
478,
80,
8,
27848,
29,
1861,
12,
8962,
5724,
29,
2614,
12,
8962,
2338,
29,
835,
9,
267,
3803,
1086,
63,
1195,
1354,
275,
18249,
63,
1099,
14,
8006,
15079,
478,
4073,
13,
18853,
13,
9226,
5832,
16,
1055,
60,
288,
1318,
14,
1913,
342,
267,
372,
3803,
1086,
63,
1195,
1354,
339,
327,
491,
5763,
29140,
810,
266,
370,
2403,
12,
2529,
1006,
314,
3792,
272,
347,
3307,
63,
17288,
8,
277,
12,
4866,
12,
2403,
12,
2053,
12,
14856,
12,
3618,
12,
10086,
304,
267,
3307,
63,
1099,
275,
4866,
14,
4354,
14,
16825,
810,
266,
63,
311,
478,
63,
17288,
8,
27848,
29,
1861,
12,
8962,
5724,
29,
2614,
12,
8962,
14856,
29,
12130,
12,
8962,
3618,
29,
2573,
12,
8962,
10086,
29,
10937,
9,
267,
372,
3307,
63,
1099,
339,
347,
1255,
8,
277,
304,
267,
1449,
3232,
314,
11785,
1950,
370,
1924,
2243,
26,
288,
446,
1104,
314,
14059,
13,
2373,
436,
314,
491,
5763,
12276,
3616,
1598,
2952,
1603,
1734,
3100,
11785,
12821,
376,
1919,
367,
1598,
2257,
503,
625,
15837,
2403,
288,
446,
340,
9949,
491,
5763,
510,
316,
370,
1924,
2403,
4012,
1006,
3510,
515,
334,
4195,
14,
16,
14,
16,
14,
88,
9,
1598,
3510,
515,
12396,
687,
9100,
80,
63,
84,
7936,
5986,
14,
647,
2884,
267,
1449,
398,
1449,
710,
570,
298,
831,
2,
365,
1202,
370,
1104,
288,
340,
9100,
80,
13,
84,
7936,
5986,
2884,
365,
3879,
267,
1449,
267,
340,
440,
747,
14,
515,
14,
6292,
360,
831,
735,
288,
4866,
275,
12272,
8,
1102,
29,
277,
14,
1782,
12,
586,
922,
29,
277,
14,
751,
12,
586,
2505,
29,
277,
14,
12671,
9,
288,
862,
26,
355,
4866,
14,
1490,
342,
355,
4866,
14,
2593,
275,
9601,
288,
871,
2186,
465,
2329,
26,
355,
870,
283,
6612,
4907,
370,
2243,
6536,
2329,
398,
543,
1551,
8,
277,
14,
84,
7936,
5986,
12,
283,
82,
358,
465,
3002,
63,
493,
26,
288,
754,
275,
3002,
63,
493,
14,
739,
1252,
7644,
342,
288,
367,
1004,
315,
754,
26,
355,
359,
13376,
1633,
12,
2061,
13376,
12,
2004,
61,
275,
18179,
3260,
28696,
355,
4837,
275,
1004,
14,
1294,
5102,
5832,
16,
61,
355,
2053,
275,
1004,
14,
1294,
5102,
5832,
17,
61,
355,
900,
14,
4532,
8,
16,
14,
17,
9,
221,
327,
13144,
2948,
6605,
12,
5126,
316,
3055,
6946,
355,
340,
291,
14,
1074,
63,
82,
767,
651,
8,
2374,
12,
4837,
2788,
16,
61,
508,
283,
797,
356,
490,
870,
283,
2510,
469,
16,
9160,
949,
2397,
315,
14870,
1817,
367,
2403,
469,
17,
93,
1154,
717,
1275,
908,
8,
277,
14,
1782,
12,
4837,
9,
355,
916,
291,
14,
1074,
63,
82,
767,
651,
8,
2374,
12,
4837,
2788,
17,
61,
508,
283,
16281,
356,
490,
870,
283,
2510,
469,
16,
9160,
949,
511,
367,
2257,
4438,
894,
469,
17,
93,
1154,
717,
1275,
908,
8,
277,
14,
1782,
12,
4837,
9,
355,
916,
291,
14,
4073,
63,
17288,
8,
2374,
12,
4837,
12,
2053,
12,
283,
17,
358,
1137,
283,
17,
356,
490,
3307,
63,
1099,
275,
291,
14,
3446,
63,
17288,
8,
2374,
12,
4837,
12,
2053,
12,
283,
21,
297,
283,
21,
297,
283,
17,
358,
490,
22377,
63,
835,
275,
822,
8,
3446,
63,
1099,
14,
8006,
15079,
4631,
1333,
490,
367,
22377,
315,
1425,
8,
13376,
63,
835,
304,
717,
3278,
20,
63,
80,
6796,
26447,
1169,
295,
14,
2014,
9097,
60,
68,
91,
17,
12,
19,
4988,
3134,
68,
91,
17,
12,
19,
4988,
3134,
68,
91,
17,
12,
19,
4988,
3134,
68,
91,
17,
12,
19,
93,
9988,
717,
2287,
275,
3307,
63,
1099,
14,
8006,
15079,
1562,
5832,
13376,
1055,
505,
717,
340,
295,
14,
1431,
8,
4774,
20,
63,
80,
6796,
12,
2287,
304,
1169,
22377,
1633,
275,
22377,
1169,
2061,
13376,
275,
295,
14,
1431,
8,
4774,
20,
63,
80,
6796,
12,
2287,
680,
923,
342,
1169,
2004,
275,
3307,
63,
1099,
14,
8006,
15079,
1205,
5832,
13376,
1055,
505,
355,
340,
359,
13376,
1633,
12,
2061,
13376,
12,
2004,
61,
1137,
18179,
3260,
283,
2565,
490,
870,
283,
2510,
469,
16,
9160,
491,
5763,
307,
7936,
5986,
3405,
367,
2403,
469,
17,
1386,
5724,
469,
18,
1386,
5988,
737,
22377,
14534,
19,
1386,
2287,
14534,
20,
1386,
543,
2004,
3427,
14381,
21,
93,
4451,
1154,
717,
1275,
908,
8,
277,
14,
1782,
12,
4837,
12,
2053,
12
] |
[
1553,
2803,
26,
2774,
13,
24,
1553,
199,
363,
2502,
363,
275,
298,
8048,
276,
1619,
73,
2,
421,
199,
646,
7534,
199,
646,
747,
199,
646,
295,
199,
646,
900,
199,
504,
1335,
1590,
82,
14,
31959,
492,
12272,
199,
504,
12866,
492,
7132,
421,
199,
533,
491,
5763,
4073,
8,
3498,
304,
339,
347,
636,
826,
721,
277,
12,
2243,
12,
922,
12,
15081,
12,
307,
7936,
5986,
304,
267,
291,
14,
1782,
275,
2243,
267,
291,
14,
751,
275,
922,
267,
291,
14,
12671,
275,
15081,
267,
291,
14,
84,
7936,
5986,
275,
307,
7936,
5986,
267,
7132,
855,
826,
721,
277,
9,
339,
327,
1803,
282,
769,
543,
2163,
13,
13376,
436,
4113,
13,
354,
272,
347,
1104,
63,
82,
767,
651,
8,
277,
12,
4866,
12,
2403,
304,
267,
1449,
3820,
543,
499,
4811,
26,
1467,
2403,
3451,
503,
440,
315,
314,
14870,
1817,
1467,
314,
4113,
536,
334,
5339,
12,
21128,
19172,
267,
1449,
267,
519,
767,
651,
63,
1099,
275,
788,
797,
297,
283,
797,
418,
267,
519,
767,
651,
275,
4866,
14,
4354,
14,
362,
63,
4449,
63,
11697,
8,
6881,
29,
1861,
9,
267,
340,
519,
767,
651,
14,
8006,
15079,
29199,
735,
288,
519,
767,
651,
63,
1099,
275,
359,
82,
767,
651,
14,
8006,
15079,
29199,
5832,
16,
467,
2892,
519,
767,
651,
14,
8006,
15079,
3922,
13,
354,
5832,
16,
1055,
505,
61,
267,
372,
519,
767,
651,
63,
1099,
339,
327,
491,
5763,
18249,
370,
2403,
12,
2529,
314,
8526,
402,
14593,
3086,
272,
347,
18249,
63,
17288,
8,
277,
12,
4866,
12,
2403,
12,
2053,
12,
2338,
304,
267,
18249,
63,
1099,
275,
4866,
14,
4354,
14,
1069,
63,
4073,
63,
17288,
63,
478,
80,
8,
27848,
29,
1861,
12,
8962,
5724,
29,
2614,
12,
8962,
2338,
29,
835,
9,
267,
3803,
1086,
63,
1195,
1354,
275,
18249,
63,
1099,
14,
8006,
15079,
478,
4073,
13,
18853,
13,
9226,
5832,
16,
1055,
60,
288,
1318,
14,
1913,
342,
267,
372,
3803,
1086,
63,
1195,
1354,
339,
327,
491,
5763,
29140,
810,
266,
370,
2403,
12,
2529,
1006,
314,
3792,
272,
347,
3307,
63,
17288,
8,
277,
12,
4866,
12,
2403,
12,
2053,
12,
14856,
12,
3618,
12,
10086,
304,
267,
3307,
63,
1099,
275,
4866,
14,
4354,
14,
16825,
810,
266,
63,
311,
478,
63,
17288,
8,
27848,
29,
1861,
12,
8962,
5724,
29,
2614,
12,
8962,
14856,
29,
12130,
12,
8962,
3618,
29,
2573,
12,
8962,
10086,
29,
10937,
9,
267,
372,
3307,
63,
1099,
339,
347,
1255,
8,
277,
304,
267,
1449,
3232,
314,
11785,
1950,
370,
1924,
2243,
26,
288,
446,
1104,
314,
14059,
13,
2373,
436,
314,
491,
5763,
12276,
3616,
1598,
2952,
1603,
1734,
3100,
11785,
12821,
376,
1919,
367,
1598,
2257,
503,
625,
15837,
2403,
288,
446,
340,
9949,
491,
5763,
510,
316,
370,
1924,
2403,
4012,
1006,
3510,
515,
334,
4195,
14,
16,
14,
16,
14,
88,
9,
1598,
3510,
515,
12396,
687,
9100,
80,
63,
84,
7936,
5986,
14,
647,
2884,
267,
1449,
398,
1449,
710,
570,
298,
831,
2,
365,
1202,
370,
1104,
288,
340,
9100,
80,
13,
84,
7936,
5986,
2884,
365,
3879,
267,
1449,
267,
340,
440,
747,
14,
515,
14,
6292,
360,
831,
735,
288,
4866,
275,
12272,
8,
1102,
29,
277,
14,
1782,
12,
586,
922,
29,
277,
14,
751,
12,
586,
2505,
29,
277,
14,
12671,
9,
288,
862,
26,
355,
4866,
14,
1490,
342,
355,
4866,
14,
2593,
275,
9601,
288,
871,
2186,
465,
2329,
26,
355,
870,
283,
6612,
4907,
370,
2243,
6536,
2329,
398,
543,
1551,
8,
277,
14,
84,
7936,
5986,
12,
283,
82,
358,
465,
3002,
63,
493,
26,
288,
754,
275,
3002,
63,
493,
14,
739,
1252,
7644,
342,
288,
367,
1004,
315,
754,
26,
355,
359,
13376,
1633,
12,
2061,
13376,
12,
2004,
61,
275,
18179,
3260,
28696,
355,
4837,
275,
1004,
14,
1294,
5102,
5832,
16,
61,
355,
2053,
275,
1004,
14,
1294,
5102,
5832,
17,
61,
355,
900,
14,
4532,
8,
16,
14,
17,
9,
221,
327,
13144,
2948,
6605,
12,
5126,
316,
3055,
6946,
355,
340,
291,
14,
1074,
63,
82,
767,
651,
8,
2374,
12,
4837,
2788,
16,
61,
508,
283,
797,
356,
490,
870,
283,
2510,
469,
16,
9160,
949,
2397,
315,
14870,
1817,
367,
2403,
469,
17,
93,
1154,
717,
1275,
908,
8,
277,
14,
1782,
12,
4837,
9,
355,
916,
291,
14,
1074,
63,
82,
767,
651,
8,
2374,
12,
4837,
2788,
17,
61,
508,
283,
16281,
356,
490,
870,
283,
2510,
469,
16,
9160,
949,
511,
367,
2257,
4438,
894,
469,
17,
93,
1154,
717,
1275,
908,
8,
277,
14,
1782,
12,
4837,
9,
355,
916,
291,
14,
4073,
63,
17288,
8,
2374,
12,
4837,
12,
2053,
12,
283,
17,
358,
1137,
283,
17,
356,
490,
3307,
63,
1099,
275,
291,
14,
3446,
63,
17288,
8,
2374,
12,
4837,
12,
2053,
12,
283,
21,
297,
283,
21,
297,
283,
17,
358,
490,
22377,
63,
835,
275,
822,
8,
3446,
63,
1099,
14,
8006,
15079,
4631,
1333,
490,
367,
22377,
315,
1425,
8,
13376,
63,
835,
304,
717,
3278,
20,
63,
80,
6796,
26447,
1169,
295,
14,
2014,
9097,
60,
68,
91,
17,
12,
19,
4988,
3134,
68,
91,
17,
12,
19,
4988,
3134,
68,
91,
17,
12,
19,
4988,
3134,
68,
91,
17,
12,
19,
93,
9988,
717,
2287,
275,
3307,
63,
1099,
14,
8006,
15079,
1562,
5832,
13376,
1055,
505,
717,
340,
295,
14,
1431,
8,
4774,
20,
63,
80,
6796,
12,
2287,
304,
1169,
22377,
1633,
275,
22377,
1169,
2061,
13376,
275,
295,
14,
1431,
8,
4774,
20,
63,
80,
6796,
12,
2287,
680,
923,
342,
1169,
2004,
275,
3307,
63,
1099,
14,
8006,
15079,
1205,
5832,
13376,
1055,
505,
355,
340,
359,
13376,
1633,
12,
2061,
13376,
12,
2004,
61,
1137,
18179,
3260,
283,
2565,
490,
870,
283,
2510,
469,
16,
9160,
491,
5763,
307,
7936,
5986,
3405,
367,
2403,
469,
17,
1386,
5724,
469,
18,
1386,
5988,
737,
22377,
14534,
19,
1386,
2287,
14534,
20,
1386,
543,
2004,
3427,
14381,
21,
93,
4451,
1154,
717,
1275,
908,
8,
277,
14,
1782,
12,
4837,
12,
2053,
12,
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,
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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
] |
tombstone/models
|
official/nlp/transformer/misc.py
|
1
|
10095
|
# Copyright 2019 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.
# ==============================================================================
"""Misc for Transformer."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=g-bad-import-order
from absl import flags
import tensorflow as tf
from official.nlp.transformer import model_params
from official.utils.flags import core as flags_core
from official.utils.misc import keras_utils
FLAGS = flags.FLAGS
PARAMS_MAP = {
'tiny': model_params.TINY_PARAMS,
'base': model_params.BASE_PARAMS,
'big': model_params.BIG_PARAMS,
}
def get_model_params(param_set, num_gpus):
"""Gets predefined model params."""
if num_gpus > 1:
if param_set == 'big':
return model_params.BIG_MULTI_GPU_PARAMS.copy()
elif param_set == 'base':
return model_params.BASE_MULTI_GPU_PARAMS.copy()
else:
raise ValueError('Not valid params: param_set={} num_gpus={}'.format(
param_set, num_gpus))
return PARAMS_MAP[param_set].copy()
def define_transformer_flags():
"""Add flags and flag validators for running transformer_main."""
# Add common flags (data_dir, model_dir, etc.).
flags_core.define_base(num_gpu=True, distribution_strategy=True)
flags_core.define_performance(
num_parallel_calls=True,
inter_op=False,
intra_op=False,
synthetic_data=True,
max_train_steps=False,
dtype=True,
loss_scale=True,
all_reduce_alg=True,
num_packs=True,
tf_gpu_thread_mode=True,
datasets_num_private_threads=True,
enable_xla=True,
fp16_implementation=True
)
flags_core.define_benchmark()
flags_core.define_device(tpu=True)
flags.DEFINE_integer(
name='train_steps', short_name='ts', default=300000,
help=flags_core.help_wrap('The number of steps used to train.'))
flags.DEFINE_integer(
name='steps_between_evals', short_name='sbe', default=5000,
help=flags_core.help_wrap(
'The Number of training steps to run between evaluations. This is '
'used if --train_steps is defined.'))
flags.DEFINE_boolean(
name='enable_time_history', default=True,
help='Whether to enable TimeHistory callback.')
flags.DEFINE_boolean(
name='enable_tensorboard', default=False,
help='Whether to enable Tensorboard callback.')
flags.DEFINE_boolean(
name='enable_metrics_in_training', default=False,
help='Whether to enable metrics during training.')
flags.DEFINE_boolean(
name='enable_mlir_bridge',
default=False,
help='Whether to enable the TF to XLA bridge.')
# Set flags from the flags_core module as 'key flags' so they're listed when
# the '-h' flag is used. Without this line, the flags defined above are
# only shown in the full `--helpful` help text.
flags.adopt_module_key_flags(flags_core)
# Add transformer-specific flags
flags.DEFINE_enum(
name='param_set', short_name='mp', default='big',
enum_values=PARAMS_MAP.keys(),
help=flags_core.help_wrap(
'Parameter set to use when creating and training the model. The '
'parameters define the input shape (batch size and max length), '
'model configuration (size of embedding, # of hidden layers, etc.), '
'and various other settings. The big parameter set increases the '
'default batch size, embedding/hidden size, and filter size. For a '
'complete list of parameters, please see model/model_params.py.'))
flags.DEFINE_bool(
name='static_batch', short_name='sb', default=False,
help=flags_core.help_wrap(
'Whether the batches in the dataset should have static shapes. In '
'general, this setting should be False. Dynamic shapes allow the '
'inputs to be grouped so that the number of padding tokens is '
'minimized, and helps model training. In cases where the input shape '
'must be static (e.g. running on TPU), this setting will be ignored '
'and static batching will always be used.'))
flags.DEFINE_integer(
name='max_length', short_name='ml', default=256,
help=flags_core.help_wrap(
'Max sentence length for Transformer. Default is 256. Note: Usually '
'it is more effective to use a smaller max length if static_batch is '
'enabled, e.g. 64.'))
# Flags for training with steps (may be used for debugging)
flags.DEFINE_integer(
name='validation_steps', short_name='vs', default=64,
help=flags_core.help_wrap('The number of steps used in validation.'))
# BLEU score computation
flags.DEFINE_string(
name='bleu_source', short_name='bls', default=None,
help=flags_core.help_wrap(
'Path to source file containing text translate when calculating the '
'official BLEU score. Both --bleu_source and --bleu_ref must be set. '
))
flags.DEFINE_string(
name='bleu_ref', short_name='blr', default=None,
help=flags_core.help_wrap(
'Path to source file containing text translate when calculating the '
'official BLEU score. Both --bleu_source and --bleu_ref must be set. '
))
flags.DEFINE_string(
name='vocab_file', short_name='vf', default=None,
help=flags_core.help_wrap(
'Path to subtoken vocabulary file. If data_download.py was used to '
'download and encode the training data, look in the data_dir to find '
'the vocab file.'))
flags.DEFINE_string(
name='mode', default='train',
help=flags_core.help_wrap('mode: train, eval, or predict'))
flags.DEFINE_bool(
name='use_ctl',
default=False,
help=flags_core.help_wrap(
'Whether the model runs with custom training loop.'))
flags.DEFINE_integer(
name='decode_batch_size',
default=32,
help=flags_core.help_wrap(
'Global batch size used for Transformer autoregressive decoding on '
'TPU.'))
flags.DEFINE_integer(
name='decode_max_length',
default=97,
help=flags_core.help_wrap(
'Max sequence length of the decode/eval data. This is used by '
'Transformer autoregressive decoding on TPU to have minimum '
'paddings.'))
flags.DEFINE_bool(
name='padded_decode',
default=False,
help=flags_core.help_wrap(
'Whether the autoregressive decoding runs with input data padded to '
'the decode_max_length. For TPU/XLA-GPU runs, this flag has to be '
'set due the static shape requirement. Although CPU/GPU could also '
'use padded_decode, it has not been tested. In addition, this method '
'will introduce unnecessary overheads which grow quadratically with '
'the max sequence length.'))
flags.DEFINE_bool(
name='enable_checkpointing',
default=True,
help=flags_core.help_wrap(
'Whether to do checkpointing during training. When running under '
'benchmark harness, we will avoid checkpointing.'))
flags_core.set_defaults(data_dir='/tmp/translate_ende',
model_dir='/tmp/transformer_model',
batch_size=None)
# pylint: disable=unused-variable
@flags.multi_flags_validator(
['bleu_source', 'bleu_ref'],
message='Both or neither --bleu_source and --bleu_ref must be defined.')
def _check_bleu_files(flags_dict):
return (flags_dict['bleu_source'] is None) == (
flags_dict['bleu_ref'] is None)
@flags.multi_flags_validator(
['bleu_source', 'bleu_ref', 'vocab_file'],
message='--vocab_file must be defined if --bleu_source and --bleu_ref '
'are defined.')
def _check_bleu_vocab_file(flags_dict):
if flags_dict['bleu_source'] and flags_dict['bleu_ref']:
return flags_dict['vocab_file'] is not None
return True
# pylint: enable=unused-variable
def get_callbacks():
"""Returns common callbacks."""
callbacks = []
if FLAGS.enable_time_history:
time_callback = keras_utils.TimeHistory(
FLAGS.batch_size,
FLAGS.log_steps,
logdir=FLAGS.model_dir if FLAGS.enable_tensorboard else None)
callbacks.append(time_callback)
if FLAGS.enable_tensorboard:
tensorboard_callback = tf.keras.callbacks.TensorBoard(
log_dir=FLAGS.model_dir)
callbacks.append(tensorboard_callback)
return callbacks
def update_stats(history, stats, callbacks):
"""Normalizes and updates dictionary of stats.
Args:
history: Results of the training step.
stats: Dict with pre-existing training stats.
callbacks: a list of callbacks which might include a time history callback
used during keras.fit.
"""
if history and history.history:
train_hist = history.history
# Gets final loss from training.
stats['loss'] = float(train_hist['loss'][-1])
if not callbacks:
return
# Look for the time history callback which was used during keras.fit
for callback in callbacks:
if isinstance(callback, keras_utils.TimeHistory):
timestamp_log = callback.timestamp_log
stats['step_timestamp_log'] = timestamp_log
stats['train_finish_time'] = callback.train_finish_time
if len(timestamp_log) > 1:
stats['avg_exp_per_second'] = (
callback.batch_size * callback.log_steps *
(len(callback.timestamp_log)-1) /
(timestamp_log[-1].timestamp - timestamp_log[0].timestamp))
|
apache-2.0
|
[
3,
1898,
20312,
710,
9134,
6642,
14,
2900,
5924,
5702,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
283,
3761,
11339,
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,
283,
1179,
2281,
7,
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,
29926,
367,
30486,
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,
3,
4287,
26,
3507,
29,
71,
13,
4087,
13,
646,
13,
1648,
199,
504,
2853,
76,
492,
3285,
199,
646,
3228,
465,
2833,
199,
199,
504,
25410,
14,
7530,
80,
14,
19754,
492,
1402,
63,
1162,
199,
504,
25410,
14,
1208,
14,
2469,
492,
6170,
465,
3285,
63,
1018,
199,
504,
25410,
14,
1208,
14,
9923,
492,
11708,
63,
1208,
199,
199,
4831,
275,
3285,
14,
4831,
199,
199,
17978,
63,
5443,
275,
469,
272,
283,
9864,
356,
1402,
63,
1162,
14,
31178,
63,
17978,
12,
272,
283,
1095,
356,
1402,
63,
1162,
14,
5825,
63,
17978,
12,
272,
283,
5076,
356,
1402,
63,
1162,
14,
18643,
63,
17978,
12,
199,
93,
421,
199,
318,
664,
63,
1238,
63,
1162,
8,
635,
63,
409,
12,
1967,
63,
23652,
304,
523,
408,
14426,
27684,
1402,
1862,
1041,
523,
340,
1967,
63,
23652,
690,
413,
26,
272,
340,
1215,
63,
409,
508,
283,
5076,
356,
489,
372,
1402,
63,
1162,
14,
18643,
63,
21389,
63,
20769,
63,
17978,
14,
1574,
342,
272,
916,
1215,
63,
409,
508,
283,
1095,
356,
489,
372,
1402,
63,
1162,
14,
5825,
63,
21389,
63,
20769,
63,
17978,
14,
1574,
342,
272,
587,
26,
489,
746,
1722,
360,
1763,
1686,
1862,
26,
1215,
63,
409,
7622,
1967,
63,
23652,
27244,
908,
8,
881,
1215,
63,
409,
12,
1967,
63,
23652,
430,
819,
372,
16565,
51,
63,
5443,
59,
635,
63,
409,
1055,
1574,
342,
421,
199,
318,
5627,
63,
19754,
63,
2469,
837,
523,
408,
1123,
3285,
436,
3305,
14370,
367,
3879,
21484,
63,
973,
1041,
523,
327,
2654,
2863,
3285,
334,
576,
63,
694,
12,
1402,
63,
694,
12,
5423,
25860,
523,
3285,
63,
1018,
14,
4640,
63,
1095,
8,
1507,
63,
6477,
29,
549,
12,
4084,
63,
8590,
29,
549,
9,
523,
3285,
63,
1018,
14,
4640,
63,
20576,
8,
489,
1967,
63,
11887,
63,
5352,
29,
549,
12,
489,
1640,
63,
411,
29,
797,
12,
489,
1109,
345,
63,
411,
29,
797,
12,
489,
9560,
21231,
63,
576,
29,
549,
12,
489,
1390,
63,
2834,
63,
5895,
29,
797,
12,
489,
2152,
29,
549,
12,
489,
5621,
63,
3467,
29,
549,
12,
489,
1006,
63,
5270,
63,
6731,
29,
549,
12,
489,
1967,
63,
1389,
83,
29,
549,
12,
489,
2833,
63,
6477,
63,
2671,
63,
632,
29,
549,
12,
489,
13148,
63,
1507,
63,
4239,
63,
6962,
29,
549,
12,
489,
4756,
63,
88,
416,
29,
549,
12,
489,
4090,
975,
63,
12236,
29,
549,
523,
776,
819,
3285,
63,
1018,
14,
4640,
63,
11861,
342,
523,
3285,
63,
1018,
14,
4640,
63,
1782,
8,
23186,
29,
549,
9,
819,
3285,
14,
14603,
63,
4115,
8,
489,
536,
534,
2834,
63,
5895,
297,
3974,
63,
354,
534,
1086,
297,
849,
29,
19,
5345,
12,
489,
1720,
29,
2469,
63,
1018,
14,
3437,
63,
3823,
360,
1918,
1329,
402,
7124,
1202,
370,
3560,
12459,
523,
3285,
14,
14603,
63,
4115,
8,
489,
536,
534,
5895,
63,
13007,
63,
2579,
83,
297,
3974,
63,
354,
534,
83,
1235,
297,
849,
29,
13128,
12,
489,
1720,
29,
2469,
63,
1018,
14,
3437,
63,
3823,
8,
881,
283,
1918,
4860,
402,
6093,
7124,
370,
1255,
3382,
8031,
1298,
14,
961,
365,
283,
881,
283,
2972,
340,
1553,
2834,
63,
5895,
365,
3247,
12459,
523,
3285,
14,
14603,
63,
4871,
8,
489,
536,
534,
4296,
63,
521,
63,
5570,
297,
849,
29,
549,
12,
489,
1720,
534,
26625,
370,
4756,
4703,
12114,
3233,
2659,
523,
3285,
14,
14603,
63,
4871,
8,
489,
536,
534,
4296,
63,
3128,
3576,
297,
849,
29,
797,
12,
489,
1720,
534,
26625,
370,
4756,
5878,
3576,
3233,
2659,
523,
3285,
14,
14603,
63,
4871,
8,
489,
536,
534,
4296,
63,
6759,
63,
262,
63,
7588,
297,
849,
29,
797,
12,
489,
1720,
534,
26625,
370,
4756,
7186,
5309,
6093,
2659,
523,
3285,
14,
14603,
63,
4871,
8,
489,
536,
534,
4296,
63,
77,
317,
82,
63,
9528,
297,
489,
849,
29,
797,
12,
489,
1720,
534,
26625,
370,
4756,
314,
21721,
370,
1323,
5837,
13928,
2659,
523,
327,
2494,
3285,
687,
314,
3285,
63,
1018,
859,
465,
283,
498,
3285,
7,
880,
2985,
3984,
10532,
1380,
523,
327,
314,
2475,
72,
7,
3305,
365,
1202,
14,
23952,
642,
1004,
12,
314,
3285,
3247,
3432,
787,
523,
327,
1454,
9164,
315,
314,
2615,
658,
306,
3437,
1893,
64,
1720,
1318,
14,
523,
3285,
14,
350,
2992,
63,
578,
63,
498,
63,
2469,
8,
2469,
63,
1018,
9,
819,
327,
2654,
21484,
13,
6100,
3285,
523,
3285,
14,
14603,
63,
4869,
8,
489,
536,
534,
635,
63,
409,
297,
3974,
63,
354,
534,
311,
297,
849,
534,
5076,
297,
489,
4952,
63,
1459,
29,
17978,
63,
5443,
14,
1612,
1062,
489,
1720,
29,
2469,
63,
1018,
14,
3437,
63,
3823,
8,
881,
283,
4720,
663,
370,
675,
1380,
6425,
436,
6093,
314,
1402,
14,
710,
283,
881,
283,
3214,
5627,
314,
1324,
2215,
334,
2912,
1568,
436,
1390,
2582,
395,
283,
881,
283,
1238,
2897,
334,
890,
402,
12452,
12,
327,
402,
8752,
9393,
12,
5423,
15631,
283,
881,
283
] |
[
1898,
20312,
710,
9134,
6642,
14,
2900,
5924,
5702,
14,
199,
3,
199,
3,
3909,
1334,
314,
3668,
844,
12,
3394,
499,
14,
16,
334,
1589,
283,
3761,
11339,
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,
283,
1179,
2281,
7,
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,
29926,
367,
30486,
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,
3,
4287,
26,
3507,
29,
71,
13,
4087,
13,
646,
13,
1648,
199,
504,
2853,
76,
492,
3285,
199,
646,
3228,
465,
2833,
199,
199,
504,
25410,
14,
7530,
80,
14,
19754,
492,
1402,
63,
1162,
199,
504,
25410,
14,
1208,
14,
2469,
492,
6170,
465,
3285,
63,
1018,
199,
504,
25410,
14,
1208,
14,
9923,
492,
11708,
63,
1208,
199,
199,
4831,
275,
3285,
14,
4831,
199,
199,
17978,
63,
5443,
275,
469,
272,
283,
9864,
356,
1402,
63,
1162,
14,
31178,
63,
17978,
12,
272,
283,
1095,
356,
1402,
63,
1162,
14,
5825,
63,
17978,
12,
272,
283,
5076,
356,
1402,
63,
1162,
14,
18643,
63,
17978,
12,
199,
93,
421,
199,
318,
664,
63,
1238,
63,
1162,
8,
635,
63,
409,
12,
1967,
63,
23652,
304,
523,
408,
14426,
27684,
1402,
1862,
1041,
523,
340,
1967,
63,
23652,
690,
413,
26,
272,
340,
1215,
63,
409,
508,
283,
5076,
356,
489,
372,
1402,
63,
1162,
14,
18643,
63,
21389,
63,
20769,
63,
17978,
14,
1574,
342,
272,
916,
1215,
63,
409,
508,
283,
1095,
356,
489,
372,
1402,
63,
1162,
14,
5825,
63,
21389,
63,
20769,
63,
17978,
14,
1574,
342,
272,
587,
26,
489,
746,
1722,
360,
1763,
1686,
1862,
26,
1215,
63,
409,
7622,
1967,
63,
23652,
27244,
908,
8,
881,
1215,
63,
409,
12,
1967,
63,
23652,
430,
819,
372,
16565,
51,
63,
5443,
59,
635,
63,
409,
1055,
1574,
342,
421,
199,
318,
5627,
63,
19754,
63,
2469,
837,
523,
408,
1123,
3285,
436,
3305,
14370,
367,
3879,
21484,
63,
973,
1041,
523,
327,
2654,
2863,
3285,
334,
576,
63,
694,
12,
1402,
63,
694,
12,
5423,
25860,
523,
3285,
63,
1018,
14,
4640,
63,
1095,
8,
1507,
63,
6477,
29,
549,
12,
4084,
63,
8590,
29,
549,
9,
523,
3285,
63,
1018,
14,
4640,
63,
20576,
8,
489,
1967,
63,
11887,
63,
5352,
29,
549,
12,
489,
1640,
63,
411,
29,
797,
12,
489,
1109,
345,
63,
411,
29,
797,
12,
489,
9560,
21231,
63,
576,
29,
549,
12,
489,
1390,
63,
2834,
63,
5895,
29,
797,
12,
489,
2152,
29,
549,
12,
489,
5621,
63,
3467,
29,
549,
12,
489,
1006,
63,
5270,
63,
6731,
29,
549,
12,
489,
1967,
63,
1389,
83,
29,
549,
12,
489,
2833,
63,
6477,
63,
2671,
63,
632,
29,
549,
12,
489,
13148,
63,
1507,
63,
4239,
63,
6962,
29,
549,
12,
489,
4756,
63,
88,
416,
29,
549,
12,
489,
4090,
975,
63,
12236,
29,
549,
523,
776,
819,
3285,
63,
1018,
14,
4640,
63,
11861,
342,
523,
3285,
63,
1018,
14,
4640,
63,
1782,
8,
23186,
29,
549,
9,
819,
3285,
14,
14603,
63,
4115,
8,
489,
536,
534,
2834,
63,
5895,
297,
3974,
63,
354,
534,
1086,
297,
849,
29,
19,
5345,
12,
489,
1720,
29,
2469,
63,
1018,
14,
3437,
63,
3823,
360,
1918,
1329,
402,
7124,
1202,
370,
3560,
12459,
523,
3285,
14,
14603,
63,
4115,
8,
489,
536,
534,
5895,
63,
13007,
63,
2579,
83,
297,
3974,
63,
354,
534,
83,
1235,
297,
849,
29,
13128,
12,
489,
1720,
29,
2469,
63,
1018,
14,
3437,
63,
3823,
8,
881,
283,
1918,
4860,
402,
6093,
7124,
370,
1255,
3382,
8031,
1298,
14,
961,
365,
283,
881,
283,
2972,
340,
1553,
2834,
63,
5895,
365,
3247,
12459,
523,
3285,
14,
14603,
63,
4871,
8,
489,
536,
534,
4296,
63,
521,
63,
5570,
297,
849,
29,
549,
12,
489,
1720,
534,
26625,
370,
4756,
4703,
12114,
3233,
2659,
523,
3285,
14,
14603,
63,
4871,
8,
489,
536,
534,
4296,
63,
3128,
3576,
297,
849,
29,
797,
12,
489,
1720,
534,
26625,
370,
4756,
5878,
3576,
3233,
2659,
523,
3285,
14,
14603,
63,
4871,
8,
489,
536,
534,
4296,
63,
6759,
63,
262,
63,
7588,
297,
849,
29,
797,
12,
489,
1720,
534,
26625,
370,
4756,
7186,
5309,
6093,
2659,
523,
3285,
14,
14603,
63,
4871,
8,
489,
536,
534,
4296,
63,
77,
317,
82,
63,
9528,
297,
489,
849,
29,
797,
12,
489,
1720,
534,
26625,
370,
4756,
314,
21721,
370,
1323,
5837,
13928,
2659,
523,
327,
2494,
3285,
687,
314,
3285,
63,
1018,
859,
465,
283,
498,
3285,
7,
880,
2985,
3984,
10532,
1380,
523,
327,
314,
2475,
72,
7,
3305,
365,
1202,
14,
23952,
642,
1004,
12,
314,
3285,
3247,
3432,
787,
523,
327,
1454,
9164,
315,
314,
2615,
658,
306,
3437,
1893,
64,
1720,
1318,
14,
523,
3285,
14,
350,
2992,
63,
578,
63,
498,
63,
2469,
8,
2469,
63,
1018,
9,
819,
327,
2654,
21484,
13,
6100,
3285,
523,
3285,
14,
14603,
63,
4869,
8,
489,
536,
534,
635,
63,
409,
297,
3974,
63,
354,
534,
311,
297,
849,
534,
5076,
297,
489,
4952,
63,
1459,
29,
17978,
63,
5443,
14,
1612,
1062,
489,
1720,
29,
2469,
63,
1018,
14,
3437,
63,
3823,
8,
881,
283,
4720,
663,
370,
675,
1380,
6425,
436,
6093,
314,
1402,
14,
710,
283,
881,
283,
3214,
5627,
314,
1324,
2215,
334,
2912,
1568,
436,
1390,
2582,
395,
283,
881,
283,
1238,
2897,
334,
890,
402,
12452,
12,
327,
402,
8752,
9393,
12,
5423,
15631,
283,
881,
283,
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,
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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
] |
tutengfei/sulley
|
unit_tests/legos.py
|
10
|
1500
|
from sulley import *
def run ():
tag()
ndr_string()
ber()
# clear out the requests.
blocks.REQUESTS = {}
blocks.CURRENT = None
########################################################################################################################
def tag ():
s_initialize("UNIT TEST TAG 1")
s_lego("tag", value="pedram")
req = s_get("UNIT TEST TAG 1")
print "LEGO MUTATION COUNTS:"
print "\ttag: %d" % req.num_mutations()
########################################################################################################################
def ndr_string ():
s_initialize("UNIT TEST NDR 1")
s_lego("ndr_string", value="pedram")
req = s_get("UNIT TEST NDR 1")
# XXX - unfinished!
#print req.render()
########################################################################################################################
def ber ():
s_initialize("UNIT TEST BER 1")
s_lego("ber_string", value="pedram")
req = s_get("UNIT TEST BER 1")
assert(s_render() == "\x04\x84\x00\x00\x00\x06\x70\x65\x64\x72\x61\x6d")
s_mutate()
assert(s_render() == "\x04\x84\x00\x00\x00\x00\x70\x65\x64\x72\x61\x6d")
s_initialize("UNIT TEST BER 2")
s_lego("ber_integer", value=0xdeadbeef)
req = s_get("UNIT TEST BER 2")
assert(s_render() == "\x02\x04\xde\xad\xbe\xef")
s_mutate()
assert(s_render() == "\x02\x04\x00\x00\x00\x00")
s_mutate()
assert(s_render() == "\x02\x04\x00\x00\x00\x01")
|
gpl-2.0
|
[
504,
308,
348,
15515,
492,
627,
199,
199,
318,
1255,
23390,
272,
1947,
342,
272,
302,
5012,
63,
875,
342,
272,
330,
281,
342,
339,
327,
5436,
734,
314,
4145,
14,
272,
5664,
14,
6780,
51,
275,
1052,
272,
5664,
14,
14211,
221,
275,
488,
421,
199,
3060,
26207,
199,
318,
1947,
23390,
272,
308,
63,
8489,
480,
15505,
7393,
18395,
413,
531,
272,
308,
63,
274,
1939,
480,
1450,
401,
574,
628,
1915,
5975,
531,
339,
2648,
275,
308,
63,
362,
480,
15505,
7393,
18395,
413,
531,
339,
870,
298,
906,
13160,
603,
934,
2594,
5099,
1734,
9730,
5424,
272,
870,
1867,
84,
1450,
26,
259,
450,
68,
2,
450,
2648,
14,
1507,
63,
15974,
342,
421,
199,
3060,
26207,
199,
318,
302,
5012,
63,
875,
23390,
272,
308,
63,
8489,
480,
15505,
7393,
653,
4564,
413,
531,
272,
308,
63,
274,
1939,
480,
977,
82,
63,
875,
401,
574,
628,
1915,
5975,
531,
339,
2648,
275,
308,
63,
362,
480,
15505,
7393,
653,
4564,
413,
531,
272,
327,
5787,
446,
625,
8669,
1,
272,
327,
1361,
2648,
14,
3352,
342,
421,
199,
3060,
26207,
199,
318,
330,
281,
23390,
272,
308,
63,
8489,
480,
15505,
7393,
699,
540,
413,
531,
272,
308,
63,
274,
1939,
480,
605,
63,
875,
401,
574,
628,
1915,
5975,
531,
272,
2648,
275,
308,
63,
362,
480,
15505,
7393,
699,
540,
413,
531,
272,
702,
8,
83,
63,
3352,
342,
508,
1867,
88,
966,
60,
88,
1349,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
1690,
60,
88,
2760,
60,
88,
2182,
60,
88,
772,
60,
88,
2819,
60,
88,
2976,
60,
88,
22,
68,
531,
272,
308,
63,
6552,
323,
342,
272,
702,
8,
83,
63,
3352,
342,
508,
1867,
88,
966,
60,
88,
1349,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
2760,
60,
88,
2182,
60,
88,
772,
60,
88,
2819,
60,
88,
2976,
60,
88,
22,
68,
531,
339,
308,
63,
8489,
480,
15505,
7393,
699,
540,
499,
531,
272,
308,
63,
274,
1939,
480,
605,
63,
4115,
401,
574,
29,
16,
10745,
13741,
1024,
70,
9,
272,
2648,
275,
308,
63,
362,
480,
15505,
7393,
699,
540,
499,
531,
272,
702,
8,
83,
63,
3352,
342,
508,
1867,
88,
996,
60,
88,
966,
60,
10745,
60,
10135,
60,
9957,
60,
9532,
531,
272,
308,
63,
6552,
323,
342,
272,
702,
8,
83,
63,
3352,
342,
508,
1867,
88,
996,
60,
88,
966,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
383,
531,
272,
308,
63,
6552,
323,
342,
272,
702,
8,
83,
63,
3352,
342,
508,
1867,
88,
996,
60,
88,
966,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
614,
531,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768
] |
[
308,
348,
15515,
492,
627,
199,
199,
318,
1255,
23390,
272,
1947,
342,
272,
302,
5012,
63,
875,
342,
272,
330,
281,
342,
339,
327,
5436,
734,
314,
4145,
14,
272,
5664,
14,
6780,
51,
275,
1052,
272,
5664,
14,
14211,
221,
275,
488,
421,
199,
3060,
26207,
199,
318,
1947,
23390,
272,
308,
63,
8489,
480,
15505,
7393,
18395,
413,
531,
272,
308,
63,
274,
1939,
480,
1450,
401,
574,
628,
1915,
5975,
531,
339,
2648,
275,
308,
63,
362,
480,
15505,
7393,
18395,
413,
531,
339,
870,
298,
906,
13160,
603,
934,
2594,
5099,
1734,
9730,
5424,
272,
870,
1867,
84,
1450,
26,
259,
450,
68,
2,
450,
2648,
14,
1507,
63,
15974,
342,
421,
199,
3060,
26207,
199,
318,
302,
5012,
63,
875,
23390,
272,
308,
63,
8489,
480,
15505,
7393,
653,
4564,
413,
531,
272,
308,
63,
274,
1939,
480,
977,
82,
63,
875,
401,
574,
628,
1915,
5975,
531,
339,
2648,
275,
308,
63,
362,
480,
15505,
7393,
653,
4564,
413,
531,
272,
327,
5787,
446,
625,
8669,
1,
272,
327,
1361,
2648,
14,
3352,
342,
421,
199,
3060,
26207,
199,
318,
330,
281,
23390,
272,
308,
63,
8489,
480,
15505,
7393,
699,
540,
413,
531,
272,
308,
63,
274,
1939,
480,
605,
63,
875,
401,
574,
628,
1915,
5975,
531,
272,
2648,
275,
308,
63,
362,
480,
15505,
7393,
699,
540,
413,
531,
272,
702,
8,
83,
63,
3352,
342,
508,
1867,
88,
966,
60,
88,
1349,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
1690,
60,
88,
2760,
60,
88,
2182,
60,
88,
772,
60,
88,
2819,
60,
88,
2976,
60,
88,
22,
68,
531,
272,
308,
63,
6552,
323,
342,
272,
702,
8,
83,
63,
3352,
342,
508,
1867,
88,
966,
60,
88,
1349,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
2760,
60,
88,
2182,
60,
88,
772,
60,
88,
2819,
60,
88,
2976,
60,
88,
22,
68,
531,
339,
308,
63,
8489,
480,
15505,
7393,
699,
540,
499,
531,
272,
308,
63,
274,
1939,
480,
605,
63,
4115,
401,
574,
29,
16,
10745,
13741,
1024,
70,
9,
272,
2648,
275,
308,
63,
362,
480,
15505,
7393,
699,
540,
499,
531,
272,
702,
8,
83,
63,
3352,
342,
508,
1867,
88,
996,
60,
88,
966,
60,
10745,
60,
10135,
60,
9957,
60,
9532,
531,
272,
308,
63,
6552,
323,
342,
272,
702,
8,
83,
63,
3352,
342,
508,
1867,
88,
996,
60,
88,
966,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
383,
531,
272,
308,
63,
6552,
323,
342,
272,
702,
8,
83,
63,
3352,
342,
508,
1867,
88,
996,
60,
88,
966,
60,
88,
383,
60,
88,
383,
60,
88,
383,
60,
88,
614,
531,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
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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
] |
sjsucohort6/openstack
|
python/venv/lib/python2.7/site-packages/cinderclient/v1/availability_zones.py
|
7
|
1427
|
# Copyright 2011-2013 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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.
"""Availability Zone interface (v1 extension)"""
from cinderclient import base
class AvailabilityZone(base.Resource):
NAME_ATTR = 'display_name'
def __repr__(self):
return "<AvailabilityZone: %s>" % self.zoneName
class AvailabilityZoneManager(base.ManagerWithFind):
"""Manage :class:`AvailabilityZone` resources."""
resource_class = AvailabilityZone
def list(self, detailed=False):
"""Lists all availability zones.
:rtype: list of :class:`AvailabilityZone`
"""
if detailed is True:
return self._list("/os-availability-zone/detail",
"availabilityZoneInfo")
else:
return self._list("/os-availability-zone", "availabilityZoneInfo")
|
mit
|
[
3,
1898,
7760,
13,
6965,
14260,
2752,
199,
3,
1898,
6171,
26202,
22304,
14,
199,
3,
2900,
5924,
5702,
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,
624,
26462,
22518,
3217,
334,
86,
17,
3329,
9471,
199,
199,
504,
13069,
1258,
492,
1300,
421,
199,
533,
16599,
7615,
11860,
8,
1095,
14,
4031,
304,
272,
13637,
63,
5280,
275,
283,
2918,
63,
354,
7,
339,
347,
636,
2722,
721,
277,
304,
267,
372,
3886,
26462,
11860,
26,
450,
83,
4335,
450,
291,
14,
2619,
985,
421,
199,
533,
16599,
7615,
11860,
2988,
8,
1095,
14,
2988,
3007,
6591,
304,
272,
408,
20588,
520,
533,
1705,
26462,
11860,
64,
5944,
1041,
272,
2073,
63,
533,
275,
16599,
7615,
11860,
339,
347,
769,
8,
277,
12,
16212,
29,
797,
304,
267,
408,
15116,
1006,
14962,
18666,
14,
398,
520,
4500,
26,
769,
402,
520,
533,
1705,
26462,
11860,
64,
267,
408,
267,
340,
16212,
365,
715,
26,
288,
372,
291,
423,
513,
4769,
736,
13,
11856,
13,
2619,
15,
5506,
401,
2892,
298,
11856,
11860,
2354,
531,
267,
587,
26,
288,
372,
291,
423,
513,
4769,
736,
13,
11856,
13,
2619,
401,
298,
11856,
11860,
2354,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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,
13,
6965,
14260,
2752,
199,
3,
1898,
6171,
26202,
22304,
14,
199,
3,
2900,
5924,
5702,
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,
624,
26462,
22518,
3217,
334,
86,
17,
3329,
9471,
199,
199,
504,
13069,
1258,
492,
1300,
421,
199,
533,
16599,
7615,
11860,
8,
1095,
14,
4031,
304,
272,
13637,
63,
5280,
275,
283,
2918,
63,
354,
7,
339,
347,
636,
2722,
721,
277,
304,
267,
372,
3886,
26462,
11860,
26,
450,
83,
4335,
450,
291,
14,
2619,
985,
421,
199,
533,
16599,
7615,
11860,
2988,
8,
1095,
14,
2988,
3007,
6591,
304,
272,
408,
20588,
520,
533,
1705,
26462,
11860,
64,
5944,
1041,
272,
2073,
63,
533,
275,
16599,
7615,
11860,
339,
347,
769,
8,
277,
12,
16212,
29,
797,
304,
267,
408,
15116,
1006,
14962,
18666,
14,
398,
520,
4500,
26,
769,
402,
520,
533,
1705,
26462,
11860,
64,
267,
408,
267,
340,
16212,
365,
715,
26,
288,
372,
291,
423,
513,
4769,
736,
13,
11856,
13,
2619,
15,
5506,
401,
2892,
298,
11856,
11860,
2354,
531,
267,
587,
26,
288,
372,
291,
423,
513,
4769,
736,
13,
11856,
13,
2619,
401,
298,
11856,
11860,
2354,
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,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
32768,
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
] |
disqus/django-mailviews
|
mailviews/messages.py
|
4
|
9335
|
from django.core.exceptions import ImproperlyConfigured
from django.core.mail.message import EmailMessage, EmailMultiAlternatives
from django.template import Context
from django.template.loader import get_template, select_template
from mailviews.utils import unescape
class EmailMessageView(object):
"""
Base class for encapsulating the logic for the rendering and sending
class-based email messages.
"""
message_class = EmailMessage
@property
def headers(self):
"""
A dictionary containing the headers for this message.
"""
if not hasattr(self, '_headers'):
self._headers = {}
return self._headers
def render_subject(self, context):
raise NotImplementedError # Must be implemented by subclasses.
def render_body(self, context):
raise NotImplementedError # Must be implemented by subclasses.
def get_context_data(self, **kwargs):
"""
Returns the context that will be used for rendering this message.
:rtype: :class:`django.template.Context`
"""
return Context(kwargs)
def render_to_message(self, extra_context=None, **kwargs):
"""
Renders and returns an unsent message with the provided context.
Any extra keyword arguments passed will be passed through as keyword
arguments to the message constructor.
:param extra_context: Any additional context to use when rendering the
templated content.
:type extra_context: :class:`dict`
:returns: A message instance.
:rtype: :attr:`.message_class`
"""
if extra_context is None:
extra_context = {}
# Ensure our custom headers are added to the underlying message class.
kwargs.setdefault('headers', {}).update(self.headers)
context = self.get_context_data(**extra_context)
return self.message_class(
subject=self.render_subject(context),
body=self.render_body(context),
**kwargs)
def send(self, extra_context=None, **kwargs):
"""
Renders and sends an email message.
All keyword arguments other than ``extra_context`` are passed through
as keyword arguments when constructing a new :attr:`message_class`
instance for this message.
This method exists primarily for convenience, and the proper
rendering of your message should not depend on the behavior of this
method. To alter how a message is created, override
:meth:``render_to_message`` instead, since that should always be
called, even if a message is not sent.
:param extra_context: Any additional context data that will be used
when rendering this message.
:type extra_context: :class:`dict`
"""
message = self.render_to_message(extra_context=extra_context, **kwargs)
return message.send()
class TemplatedEmailMessageView(EmailMessageView):
"""
An email message view that uses Django templates for rendering the message
subject and plain text body.
"""
#: A template name (or list of template names) that will be used to render
#: the subject of this message. The rendered subject should be plain text
#: without any linebreaks. (Any trailing whitespace will be automatically
#: stripped.) :attr:`.subject_template` will precedence over this value,
#: if set.
subject_template_name = None
#: A template name (or list of template names) that will be used to render
#: the plain text body of this message. :attr:`.body_template` will take
#: precedence over this value, if set.
body_template_name = None
def _get_template(self, value):
if isinstance(value, (list, tuple)):
return select_template(value)
else:
return get_template(value)
def _get_subject_template(self):
if getattr(self, '_subject_template', None) is not None:
return self._subject_template
if self.subject_template_name is None:
raise ImproperlyConfigured('A `subject_template` or '
'`subject_template_name` must be provided to render this '
'message subject.')
return self._get_template(self.subject_template_name)
def _set_subject_template(self, template):
self._subject_template = template
#: Returns the subject template that will be used for rendering this
#: message. If the subject template has been explicitly set, that template
#: will be used. If not, the template(s) defined as
#: :attr:`.subject_template_name` will be used instead.
subject_template = property(_get_subject_template, _set_subject_template)
def _get_body_template(self):
if getattr(self, '_body_template', None) is not None:
return self._body_template
if self.body_template_name is None:
raise ImproperlyConfigured('A `body_template` or '
'`body_template_name` must be provided to render this '
'message subject.')
return self._get_template(self.body_template_name)
def _set_body_template(self, template):
self._body_template = template
#: Returns the body template that will be used for rendering this message.
#: If the body template has been explicitly set, that template will be
#: used. If not, the template(s) defined as :attr:`.body_template_name`
#: will be used instead.
body_template = property(_get_body_template, _set_body_template)
def render_subject(self, context):
"""
Renders the message subject for the given context.
The context data is automatically unescaped to avoid rendering HTML
entities in ``text/plain`` content.
:param context: The context to use when rendering the subject template.
:type context: :class:`~django.template.Context`
:returns: A rendered subject.
:rtype: :class:`str`
"""
rendered = self.subject_template.render(unescape(context))
return rendered.strip()
def render_body(self, context):
"""
Renders the message body for the given context.
The context data is automatically unescaped to avoid rendering HTML
entities in ``text/plain`` content.
:param context: The context to use when rendering the body template.
:type context: :class:`~django.template.Context`
:returns: A rendered body.
:rtype: :class:`str`
"""
return self.body_template.render(unescape(context))
class TemplatedHTMLEmailMessageView(TemplatedEmailMessageView):
"""
An email message view that uses Django templates for rendering the message
subject, plain text and HTML body.
"""
message_class = EmailMultiAlternatives
#: A template name (or list of template names) that will be used to render
#: the HTML body of this message. :attr:`.html_body_template` will take
#: precedence over this value, if set.
html_body_template_name = None
def _get_html_body_template(self):
if getattr(self, '_html_body_template', None) is not None:
return self._html_body_template
if self.html_body_template_name is None:
raise ImproperlyConfigured('An `html_body_template` or '
'`html_body_template_name` must be provided to render this '
'message HTML body.')
return self._get_template(self.html_body_template_name)
def _set_html_body_template(self, template):
self._html_body_template = template
#: Returns the body template that will be used for rendering the HTML body
#: of this message. If the HTML body template has been explicitly set, that
#: template will be used. If not, the template(s) defined as
#: :attr:`.html_body_template_name` will be used instead.
html_body_template = property(_get_html_body_template,
_set_html_body_template)
def render_html_body(self, context):
"""
Renders the message body for the given context.
:param context: The context to use when rendering the body template.
:type context: :class:`~django.template.Context`
:returns: A rendered HTML body.
:rtype: :class:`str`
"""
return self.html_body_template.render(context)
def render_to_message(self, extra_context=None, *args, **kwargs):
"""
Renders and returns an unsent message with the given context.
Any extra keyword arguments passed will be passed through as keyword
arguments to the message constructor.
:param extra_context: Any additional context to use when rendering
templated content.
:type extra_context: :class:`dict`
:returns: A message instance.
:rtype: :attr:`.message_class`
"""
message = super(TemplatedHTMLEmailMessageView, self)\
.render_to_message(extra_context, *args, **kwargs)
if extra_context is None:
extra_context = {}
context = self.get_context_data(**extra_context)
content = self.render_html_body(context)
message.attach_alternative(content, mimetype='text/html')
return message
|
apache-2.0
|
[
504,
1639,
14,
1018,
14,
3924,
492,
11897,
199,
504,
1639,
14,
1018,
14,
1198,
14,
1188,
492,
11426,
2209,
12,
11426,
3947,
19978,
10661,
199,
504,
1639,
14,
1160,
492,
9470,
199,
504,
1639,
14,
1160,
14,
3422,
492,
664,
63,
1160,
12,
3504,
63,
1160,
199,
199,
504,
6016,
4196,
14,
1208,
492,
22221,
421,
199,
533,
11426,
2209,
2768,
8,
785,
304,
272,
408,
272,
3523,
1021,
367,
22667,
20529,
314,
9661,
367,
314,
14066,
436,
10209,
272,
1021,
13,
6788,
3031,
3788,
14,
272,
408,
272,
1245,
63,
533,
275,
11426,
2209,
339,
768,
1829,
272,
347,
2323,
8,
277,
304,
267,
408,
267,
437,
2600,
3035,
314,
2323,
367,
642,
1245,
14,
267,
408,
267,
340,
440,
2688,
8,
277,
12,
2513,
2139,
735,
288,
291,
423,
2139,
275,
1052,
267,
372,
291,
423,
2139,
339,
347,
3795,
63,
5875,
8,
277,
12,
1067,
304,
267,
746,
4279,
221,
327,
9498,
506,
6366,
701,
9180,
14,
339,
347,
3795,
63,
2030,
8,
277,
12,
1067,
304,
267,
746,
4279,
221,
327,
9498,
506,
6366,
701,
9180,
14,
339,
347,
664,
63,
1100,
63,
576,
8,
277,
12,
1011,
958,
304,
267,
408,
267,
1803,
314,
1067,
626,
911,
506,
1202,
367,
14066,
642,
1245,
14,
398,
520,
4500,
26,
520,
533,
1705,
1176,
14,
1160,
14,
2998,
64,
267,
408,
267,
372,
9470,
8,
958,
9,
339,
347,
3795,
63,
475,
63,
1188,
8,
277,
12,
2402,
63,
1100,
29,
403,
12,
1011,
958,
304,
267,
408,
267,
10055,
7735,
436,
2529,
376,
625,
1150,
1245,
543,
314,
2741,
1067,
14,
398,
6184,
2402,
4252,
2368,
3032,
911,
506,
3032,
4012,
465,
4252,
267,
2368,
370,
314,
1245,
3787,
14,
398,
520,
635,
2402,
63,
1100,
26,
6184,
4722,
1067,
370,
675,
1380,
14066,
314,
288,
27960,
1564,
14,
267,
520,
466,
2402,
63,
1100,
26,
520,
533,
1705,
807,
64,
267,
520,
5808,
26,
437,
1245,
1256,
14,
267,
520,
4500,
26,
520,
962,
5026,
1188,
63,
533,
64,
267,
408,
267,
340,
2402,
63,
1100,
365,
488,
26,
288,
2402,
63,
1100,
275,
1052,
398,
327,
7523,
4154,
3537,
2323,
787,
3483,
370,
314,
8793,
1245,
1021,
14,
267,
2074,
14,
5486,
360,
2139,
297,
13056,
873,
8,
277,
14,
2139,
9,
398,
1067,
275,
291,
14,
362,
63,
1100,
63,
576,
3682,
2911,
63,
1100,
9,
267,
372,
291,
14,
1188,
63,
533,
8,
288,
5420,
29,
277,
14,
3352,
63,
5875,
8,
1100,
395,
288,
2396,
29,
277,
14,
3352,
63,
2030,
8,
1100,
395,
288,
1011,
958,
9,
339,
347,
3222,
8,
277,
12,
2402,
63,
1100,
29,
403,
12,
1011,
958,
304,
267,
408,
267,
10055,
7735,
436,
16178,
376,
3031,
1245,
14,
398,
2900,
4252,
2368,
1163,
2419,
1124,
2911,
63,
1100,
1040,
787,
3032,
4012,
267,
465,
4252,
2368,
1380,
22048,
282,
892,
520,
962,
1705,
1188,
63,
533,
64,
267,
1256,
367,
642,
1245,
14,
398,
961,
1083,
3495,
1979,
30468,
367,
16777,
12,
436,
314,
5576,
267,
14066,
402,
2195,
1245,
1077,
440,
11687,
641,
314,
5953,
402,
642,
267,
1083,
14,
4005,
17355,
4212,
282,
1245,
365,
2737,
12,
4278,
267,
520,
5247,
5409,
3352,
63,
475,
63,
1188,
1040,
3140,
12,
3967,
626,
1077,
3544,
506,
267,
2797,
12,
2755,
340,
282,
1245,
365,
440,
4847,
14,
398,
520,
635,
2402,
63,
1100,
26,
6184,
4722,
1067,
666,
626,
911,
506,
1202,
288,
1380,
14066,
642,
1245,
14,
267,
520,
466,
2402,
63,
1100,
26,
520,
533,
1705,
807,
64,
267,
408,
267,
1245,
275,
291,
14,
3352,
63,
475,
63,
1188,
8,
2911,
63,
1100,
29,
2911,
63,
1100,
12,
1011,
958,
9,
267,
372,
1245,
14,
2254,
342,
421,
199,
533,
12540,
1776,
7035,
2209,
2768,
8,
7035,
2209,
2768,
304,
272,
408,
272,
1626,
3031,
1245,
2455,
626,
4440,
5634,
7009,
367,
14066,
314,
1245,
272,
5420,
436,
8971,
1318,
2396,
14,
272,
408,
272,
6079,
437,
1978,
536,
334,
269,
769,
402,
1978,
1561,
9,
626,
911,
506,
1202,
370,
3795,
272,
6079,
314,
5420,
402,
642,
1245,
14,
710,
8018,
5420,
1077,
506,
8971,
1318,
272,
6079,
1928,
1263,
1004,
18566,
14,
334,
9874,
8520,
8139,
911,
506,
5847,
272,
6079,
14489,
4959,
520,
962,
5026,
5875,
63,
1160,
64,
911,
13823,
1806,
642,
574,
12,
272,
6079,
340,
663,
14,
272,
5420,
63,
1160,
63,
354,
275,
488,
339,
6079,
437,
1978,
536,
334,
269,
769,
402,
1978,
1561,
9,
626,
911,
506,
1202,
370,
3795,
272,
6079,
314,
8971,
1318,
2396,
402,
642,
1245,
14,
520,
962,
5026,
2030,
63,
1160,
64,
911,
5452,
272,
6079,
13823,
1806,
642,
574,
12,
340,
663,
14,
272,
2396,
63,
1160,
63,
354,
275,
488,
339,
347,
485,
362,
63,
1160,
8,
277,
12,
574,
304,
267,
340,
1228,
8,
585,
12,
334,
513,
12,
2008,
2298,
288,
372,
3504,
63,
1160,
8,
585,
9,
267,
587,
26,
288,
372,
664,
63,
1160,
8,
585,
9,
339,
347,
485,
362,
63,
5875,
63,
1160,
8,
277,
304,
267,
340,
2519,
8,
277,
12,
2513,
5875,
63,
1160,
297,
488,
9,
365,
440,
488,
26,
288,
372,
291,
423,
5875,
63,
1160,
398,
340,
291,
14,
5875,
63,
1160,
63,
354,
365,
488,
26,
288,
746,
11897,
360,
33,
658,
5875,
63,
1160,
64,
503,
283,
355,
26144,
5875,
63,
1160,
63,
354,
64,
1471,
506,
2741,
370,
3795,
642,
283,
355,
283,
1188,
5420,
2659,
398,
372,
291,
423,
362,
63,
1160,
8,
277,
14,
5875,
63,
1160,
63,
354,
9,
339,
347,
485,
409,
63,
5875,
63,
1160,
8,
277,
12,
1978,
304,
267,
291,
423,
5875,
63,
1160,
275,
1978,
339,
6079,
1803,
314,
5420,
1978,
626,
911,
506,
1202,
367,
14066,
642,
272,
6079,
1245,
14,
982,
314,
5420,
1978,
965,
2757,
7662,
663,
12,
626,
1978,
272,
6079,
911,
506,
1202,
14,
982,
440,
12,
314,
1978,
8,
83,
9,
3247,
465,
272,
6079,
520,
962,
5026,
5875,
63,
1160,
63,
354,
64,
911,
506,
1202,
3140,
14,
272,
5420,
63,
1160,
275,
3324,
1547,
362,
63,
5875,
63,
1160,
12,
485,
409,
63,
5875,
63,
1160,
9,
339
] |
[
1639,
14,
1018,
14,
3924,
492,
11897,
199,
504,
1639,
14,
1018,
14,
1198,
14,
1188,
492,
11426,
2209,
12,
11426,
3947,
19978,
10661,
199,
504,
1639,
14,
1160,
492,
9470,
199,
504,
1639,
14,
1160,
14,
3422,
492,
664,
63,
1160,
12,
3504,
63,
1160,
199,
199,
504,
6016,
4196,
14,
1208,
492,
22221,
421,
199,
533,
11426,
2209,
2768,
8,
785,
304,
272,
408,
272,
3523,
1021,
367,
22667,
20529,
314,
9661,
367,
314,
14066,
436,
10209,
272,
1021,
13,
6788,
3031,
3788,
14,
272,
408,
272,
1245,
63,
533,
275,
11426,
2209,
339,
768,
1829,
272,
347,
2323,
8,
277,
304,
267,
408,
267,
437,
2600,
3035,
314,
2323,
367,
642,
1245,
14,
267,
408,
267,
340,
440,
2688,
8,
277,
12,
2513,
2139,
735,
288,
291,
423,
2139,
275,
1052,
267,
372,
291,
423,
2139,
339,
347,
3795,
63,
5875,
8,
277,
12,
1067,
304,
267,
746,
4279,
221,
327,
9498,
506,
6366,
701,
9180,
14,
339,
347,
3795,
63,
2030,
8,
277,
12,
1067,
304,
267,
746,
4279,
221,
327,
9498,
506,
6366,
701,
9180,
14,
339,
347,
664,
63,
1100,
63,
576,
8,
277,
12,
1011,
958,
304,
267,
408,
267,
1803,
314,
1067,
626,
911,
506,
1202,
367,
14066,
642,
1245,
14,
398,
520,
4500,
26,
520,
533,
1705,
1176,
14,
1160,
14,
2998,
64,
267,
408,
267,
372,
9470,
8,
958,
9,
339,
347,
3795,
63,
475,
63,
1188,
8,
277,
12,
2402,
63,
1100,
29,
403,
12,
1011,
958,
304,
267,
408,
267,
10055,
7735,
436,
2529,
376,
625,
1150,
1245,
543,
314,
2741,
1067,
14,
398,
6184,
2402,
4252,
2368,
3032,
911,
506,
3032,
4012,
465,
4252,
267,
2368,
370,
314,
1245,
3787,
14,
398,
520,
635,
2402,
63,
1100,
26,
6184,
4722,
1067,
370,
675,
1380,
14066,
314,
288,
27960,
1564,
14,
267,
520,
466,
2402,
63,
1100,
26,
520,
533,
1705,
807,
64,
267,
520,
5808,
26,
437,
1245,
1256,
14,
267,
520,
4500,
26,
520,
962,
5026,
1188,
63,
533,
64,
267,
408,
267,
340,
2402,
63,
1100,
365,
488,
26,
288,
2402,
63,
1100,
275,
1052,
398,
327,
7523,
4154,
3537,
2323,
787,
3483,
370,
314,
8793,
1245,
1021,
14,
267,
2074,
14,
5486,
360,
2139,
297,
13056,
873,
8,
277,
14,
2139,
9,
398,
1067,
275,
291,
14,
362,
63,
1100,
63,
576,
3682,
2911,
63,
1100,
9,
267,
372,
291,
14,
1188,
63,
533,
8,
288,
5420,
29,
277,
14,
3352,
63,
5875,
8,
1100,
395,
288,
2396,
29,
277,
14,
3352,
63,
2030,
8,
1100,
395,
288,
1011,
958,
9,
339,
347,
3222,
8,
277,
12,
2402,
63,
1100,
29,
403,
12,
1011,
958,
304,
267,
408,
267,
10055,
7735,
436,
16178,
376,
3031,
1245,
14,
398,
2900,
4252,
2368,
1163,
2419,
1124,
2911,
63,
1100,
1040,
787,
3032,
4012,
267,
465,
4252,
2368,
1380,
22048,
282,
892,
520,
962,
1705,
1188,
63,
533,
64,
267,
1256,
367,
642,
1245,
14,
398,
961,
1083,
3495,
1979,
30468,
367,
16777,
12,
436,
314,
5576,
267,
14066,
402,
2195,
1245,
1077,
440,
11687,
641,
314,
5953,
402,
642,
267,
1083,
14,
4005,
17355,
4212,
282,
1245,
365,
2737,
12,
4278,
267,
520,
5247,
5409,
3352,
63,
475,
63,
1188,
1040,
3140,
12,
3967,
626,
1077,
3544,
506,
267,
2797,
12,
2755,
340,
282,
1245,
365,
440,
4847,
14,
398,
520,
635,
2402,
63,
1100,
26,
6184,
4722,
1067,
666,
626,
911,
506,
1202,
288,
1380,
14066,
642,
1245,
14,
267,
520,
466,
2402,
63,
1100,
26,
520,
533,
1705,
807,
64,
267,
408,
267,
1245,
275,
291,
14,
3352,
63,
475,
63,
1188,
8,
2911,
63,
1100,
29,
2911,
63,
1100,
12,
1011,
958,
9,
267,
372,
1245,
14,
2254,
342,
421,
199,
533,
12540,
1776,
7035,
2209,
2768,
8,
7035,
2209,
2768,
304,
272,
408,
272,
1626,
3031,
1245,
2455,
626,
4440,
5634,
7009,
367,
14066,
314,
1245,
272,
5420,
436,
8971,
1318,
2396,
14,
272,
408,
272,
6079,
437,
1978,
536,
334,
269,
769,
402,
1978,
1561,
9,
626,
911,
506,
1202,
370,
3795,
272,
6079,
314,
5420,
402,
642,
1245,
14,
710,
8018,
5420,
1077,
506,
8971,
1318,
272,
6079,
1928,
1263,
1004,
18566,
14,
334,
9874,
8520,
8139,
911,
506,
5847,
272,
6079,
14489,
4959,
520,
962,
5026,
5875,
63,
1160,
64,
911,
13823,
1806,
642,
574,
12,
272,
6079,
340,
663,
14,
272,
5420,
63,
1160,
63,
354,
275,
488,
339,
6079,
437,
1978,
536,
334,
269,
769,
402,
1978,
1561,
9,
626,
911,
506,
1202,
370,
3795,
272,
6079,
314,
8971,
1318,
2396,
402,
642,
1245,
14,
520,
962,
5026,
2030,
63,
1160,
64,
911,
5452,
272,
6079,
13823,
1806,
642,
574,
12,
340,
663,
14,
272,
2396,
63,
1160,
63,
354,
275,
488,
339,
347,
485,
362,
63,
1160,
8,
277,
12,
574,
304,
267,
340,
1228,
8,
585,
12,
334,
513,
12,
2008,
2298,
288,
372,
3504,
63,
1160,
8,
585,
9,
267,
587,
26,
288,
372,
664,
63,
1160,
8,
585,
9,
339,
347,
485,
362,
63,
5875,
63,
1160,
8,
277,
304,
267,
340,
2519,
8,
277,
12,
2513,
5875,
63,
1160,
297,
488,
9,
365,
440,
488,
26,
288,
372,
291,
423,
5875,
63,
1160,
398,
340,
291,
14,
5875,
63,
1160,
63,
354,
365,
488,
26,
288,
746,
11897,
360,
33,
658,
5875,
63,
1160,
64,
503,
283,
355,
26144,
5875,
63,
1160,
63,
354,
64,
1471,
506,
2741,
370,
3795,
642,
283,
355,
283,
1188,
5420,
2659,
398,
372,
291,
423,
362,
63,
1160,
8,
277,
14,
5875,
63,
1160,
63,
354,
9,
339,
347,
485,
409,
63,
5875,
63,
1160,
8,
277,
12,
1978,
304,
267,
291,
423,
5875,
63,
1160,
275,
1978,
339,
6079,
1803,
314,
5420,
1978,
626,
911,
506,
1202,
367,
14066,
642,
272,
6079,
1245,
14,
982,
314,
5420,
1978,
965,
2757,
7662,
663,
12,
626,
1978,
272,
6079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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
] |
a-doumoulakis/tensorflow
|
tensorflow/contrib/graph_editor/tests/match.py
|
186
|
5700
|
# 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.
# ==============================================================================
"""Simple graph matching functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six import string_types
from tensorflow.contrib.graph_editor import select
from tensorflow.python.framework import ops as tf_ops
__all__ = [
"op_type",
"OpMatcher",
]
def _make_graph_match(graph_match):
"""Convert to a OpMatcher instance."""
if graph_match is None:
return None
if not isinstance(graph_match, OpMatcher):
graph_match = OpMatcher(graph_match)
return graph_match
def op_type(op_types, op=None):
"""Check if an op is of the given type.
Args:
op_types: tuple of strings containing the types to check against.
For instance: ("Add", "Const")
op: the operation to check (or None).
Returns:
if op is not None, return True if the op is of the correct type.
if op is None, return a lambda function which does the type checking.
"""
if isinstance(op_types, string_types):
op_types = (op_types)
if op is None:
return lambda op: op.node_def.op in op_types
else:
return op.node_def.op in op_types
class OpMatcher(object):
"""Graph match class."""
def __init__(self, positive_filter):
"""Graph match constructor."""
self.positive_filters = []
self.input_op_matches = None
self.control_input_op_matches = None
self.output_op_matches = None
positive_filter = self._finalize_positive_filter(positive_filter)
self.positive_filters.append(positive_filter)
def _finalize_positive_filter(self, elem):
"""Convert to a filter function."""
if select.can_be_regex(elem):
regex_ = select.make_regex(elem)
return lambda op, regex=regex_: regex.search(op.name) is not None
elif isinstance(elem, tf_ops.Operation):
return lambda op, match_op=elem: op is match_op
elif callable(elem):
return elem
elif elem is True:
return lambda op: True
else:
raise ValueError("Cannot finalize the positive filter: {}".format(elem))
def __call__(self, op):
"""Evaluate if the op matches or not."""
if not isinstance(op, tf_ops.Operation):
raise TypeError("Expect tf.Operation, got: {}".format(type(op)))
for positive_filter in self.positive_filters:
if not positive_filter(op):
return False
if self.input_op_matches is not None:
if len(op.inputs) != len(self.input_op_matches):
return False
for input_t, input_op_match in zip(op.inputs, self.input_op_matches):
if input_op_match is None:
continue
if not input_op_match(input_t.op):
return False
if self.control_input_op_matches is not None:
if len(op.control_inputs) != len(self.control_input_op_matches):
return False
for cinput_op, cinput_op_match in zip(op.control_inputs,
self.control_input_op_matches):
if cinput_op_match is None:
continue
if not cinput_op_match(cinput_op):
return False
if self.output_op_matches is not None:
if len(op.outputs) != len(self.output_op_matches):
return False
for output_t, output_op_matches in zip(op.outputs,
self.output_op_matches):
if output_op_matches is None:
continue
if len(output_t.consumers()) != len(output_op_matches):
return False
for consumer_op, consumer_op_match in zip(output_t.consumers(),
output_op_matches):
if consumer_op_match is None:
continue
if not consumer_op_match(consumer_op):
return False
return True
def input_ops(self, *args):
"""Add input matches."""
if self.input_op_matches is not None:
raise ValueError("input_op_matches is already set.")
self.input_op_matches = []
for input_match in args:
self.input_op_matches.append(_make_graph_match(input_match))
return self
def control_input_ops(self, *args):
"""Add input matches."""
if self.control_input_op_matches is not None:
raise ValueError("control_input_op_matches is already set.")
self.control_input_op_matches = []
for input_match in args:
self.control_input_op_matches.append(_make_graph_match(input_match))
return self
def output_ops(self, *args):
"""Add output matches."""
if self.output_op_matches is not None:
raise ValueError("output_op_matches is already set.")
self.output_op_matches = []
for consumer_op_matches in args:
if consumer_op_matches is None:
self.output_op_matches.append(None)
if not isinstance(consumer_op_matches, list):
consumer_op_matches = [consumer_op_matches]
consumer_op_matches = [_make_graph_match(consumer_op_match)
for consumer_op_match in consumer_op_matches]
self.output_op_matches.append(consumer_op_matches)
return self
|
apache-2.0
|
[
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,
624,
3184,
3343,
4877,
3423,
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,
3816,
492,
1059,
63,
1313,
199,
199,
504,
3228,
14,
2828,
14,
2180,
63,
7515,
492,
3504,
199,
504,
3228,
14,
1548,
14,
4857,
492,
4156,
465,
2833,
63,
1483,
199,
199,
363,
452,
363,
275,
359,
272,
298,
411,
63,
466,
401,
272,
298,
4619,
16073,
401,
199,
61,
421,
199,
318,
485,
1875,
63,
2180,
63,
1431,
8,
2180,
63,
1431,
304,
523,
408,
7306,
370,
282,
9319,
16073,
1256,
1041,
523,
340,
3343,
63,
1431,
365,
488,
26,
272,
372,
488,
523,
340,
440,
1228,
8,
2180,
63,
1431,
12,
9319,
16073,
304,
272,
3343,
63,
1431,
275,
9319,
16073,
8,
2180,
63,
1431,
9,
523,
372,
3343,
63,
1431,
421,
199,
318,
1687,
63,
466,
8,
411,
63,
1313,
12,
1687,
29,
403,
304,
523,
408,
1799,
340,
376,
1687,
365,
402,
314,
1627,
730,
14,
819,
3033,
26,
272,
1687,
63,
1313,
26,
2008,
402,
3326,
3035,
314,
2943,
370,
1104,
6169,
14,
489,
2104,
1256,
26,
1689,
1123,
401,
298,
6361,
531,
272,
1687,
26,
314,
3439,
370,
1104,
334,
269,
488,
680,
523,
1803,
26,
272,
340,
1687,
365,
440,
488,
12,
372,
715,
340,
314,
1687,
365,
402,
314,
3211,
730,
14,
272,
340,
1687,
365,
488,
12,
372,
282,
2400,
805,
1314,
1630,
314,
730,
7907,
14,
523,
408,
523,
340,
1228,
8,
411,
63,
1313,
12,
1059,
63,
1313,
304,
272,
1687,
63,
1313,
275,
334,
411,
63,
1313,
9,
523,
340,
1687,
365,
488,
26,
272,
372,
2400,
1687,
26,
1687,
14,
932,
63,
318,
14,
411,
315,
1687,
63,
1313,
523,
587,
26,
272,
372,
1687,
14,
932,
63,
318,
14,
411,
315,
1687,
63,
1313,
421,
199,
533,
9319,
16073,
8,
785,
304,
523,
408,
4578,
1336,
1021,
1041,
819,
347,
636,
826,
721,
277,
12,
7317,
63,
1541,
304,
272,
408,
4578,
1336,
3787,
1041,
272,
291,
14,
8965,
63,
4273,
275,
942,
272,
291,
14,
1210,
63,
411,
63,
6742,
275,
488,
272,
291,
14,
2785,
63,
1210,
63,
411,
63,
6742,
275,
488,
272,
291,
14,
1199,
63,
411,
63,
6742,
275,
488,
272,
7317,
63,
1541,
275,
291,
423,
14450,
63,
8965,
63,
1541,
8,
8965,
63,
1541,
9,
272,
291,
14,
8965,
63,
4273,
14,
740,
8,
8965,
63,
1541,
9,
819,
347,
485,
14450,
63,
8965,
63,
1541,
8,
277,
12,
6193,
304,
272,
408,
7306,
370,
282,
2457,
805,
1041,
272,
340,
3504,
14,
2425,
63,
1235,
63,
3821,
8,
6086,
304,
489,
5163,
63,
275,
3504,
14,
1875,
63,
3821,
8,
6086,
9,
489,
372,
2400,
1687,
12,
5163,
29,
3821,
10388,
5163,
14,
1733,
8,
411,
14,
354,
9,
365,
440,
488,
272,
916,
1228,
8,
6086,
12,
2833,
63,
1483,
14,
6044,
304,
489,
372,
2400,
1687,
12,
1336,
63,
411,
29,
6086,
26,
1687,
365,
1336,
63,
411,
272,
916,
4550,
8,
6086,
304,
489,
372,
6193,
272,
916,
6193,
365,
715,
26,
489,
372,
2400,
1687,
26,
715,
272,
587,
26,
489,
746,
1722,
480,
6612,
17284,
314,
7317,
2457,
26,
8352,
908,
8,
6086,
430,
819,
347,
636,
1250,
721,
277,
12,
1687,
304,
272,
408,
25002,
340,
314,
1687,
4450,
503,
440,
1041,
272,
340,
440,
1228,
8,
411,
12,
2833,
63,
1483,
14,
6044,
304,
489,
746,
3146,
480,
13495,
2833,
14,
6044,
12,
4788,
26,
8352,
908,
8,
466,
8,
411,
1724,
272,
367,
7317,
63,
1541,
315,
291,
14,
8965,
63,
4273,
26,
489,
340,
440,
7317,
63,
1541,
8,
411,
304,
267,
372,
756,
272,
340,
291,
14,
1210,
63,
411,
63,
6742,
365,
440,
488,
26,
489,
340,
822,
8,
411,
14,
3711,
9,
1137,
822,
8,
277,
14,
1210,
63,
411,
63,
6742,
304,
267,
372,
756,
489,
367,
1324,
63,
84,
12,
1324,
63,
411,
63,
1431,
315,
3482,
8,
411,
14,
3711,
12,
291,
14,
1210,
63,
411,
63,
6742,
304,
267,
340,
1324,
63,
411,
63,
1431,
365,
488,
26,
881,
1980,
267,
340,
440,
1324,
63,
411,
63,
1431,
8,
1210,
63,
84,
14,
411,
304,
881,
372,
756,
272,
340,
291,
14,
2785,
63,
1210,
63,
411,
63,
6742,
365,
440,
488,
26,
489,
340,
822,
8,
411,
14,
2785,
63,
3711,
9,
1137,
822,
8,
277,
14,
2785,
63,
1210,
63,
411,
63,
6742,
304,
267,
372,
756,
489,
367,
286,
1210,
63,
411,
12,
286,
1210,
63,
411,
63,
1431,
315,
3482,
8,
411,
14,
2785,
63,
3711,
12,
4490,
291,
14,
2785,
63,
1210,
63,
411,
63,
6742,
304,
267,
340,
286,
1210,
63,
411,
63,
1431,
365,
488,
26,
881,
1980,
267,
340,
440,
286,
1210,
63,
411,
63,
1431,
8,
67,
1210,
63,
411,
304,
881,
372,
756,
272,
340,
291,
14,
1199,
63,
411,
63,
6742,
365,
440,
488,
26,
489,
340,
822,
8,
411,
14,
4467,
9,
1137,
822,
8,
277,
14,
1199,
63,
411,
63,
6742,
304,
267,
372,
756,
489,
367,
1072,
63,
84,
12,
1072,
63,
411,
63,
6742,
315,
3482,
8,
411,
14,
4467,
12,
6163,
291,
14,
1199,
63,
411,
63,
6742,
304
] |
[
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,
624,
3184,
3343,
4877,
3423,
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,
3816,
492,
1059,
63,
1313,
199,
199,
504,
3228,
14,
2828,
14,
2180,
63,
7515,
492,
3504,
199,
504,
3228,
14,
1548,
14,
4857,
492,
4156,
465,
2833,
63,
1483,
199,
199,
363,
452,
363,
275,
359,
272,
298,
411,
63,
466,
401,
272,
298,
4619,
16073,
401,
199,
61,
421,
199,
318,
485,
1875,
63,
2180,
63,
1431,
8,
2180,
63,
1431,
304,
523,
408,
7306,
370,
282,
9319,
16073,
1256,
1041,
523,
340,
3343,
63,
1431,
365,
488,
26,
272,
372,
488,
523,
340,
440,
1228,
8,
2180,
63,
1431,
12,
9319,
16073,
304,
272,
3343,
63,
1431,
275,
9319,
16073,
8,
2180,
63,
1431,
9,
523,
372,
3343,
63,
1431,
421,
199,
318,
1687,
63,
466,
8,
411,
63,
1313,
12,
1687,
29,
403,
304,
523,
408,
1799,
340,
376,
1687,
365,
402,
314,
1627,
730,
14,
819,
3033,
26,
272,
1687,
63,
1313,
26,
2008,
402,
3326,
3035,
314,
2943,
370,
1104,
6169,
14,
489,
2104,
1256,
26,
1689,
1123,
401,
298,
6361,
531,
272,
1687,
26,
314,
3439,
370,
1104,
334,
269,
488,
680,
523,
1803,
26,
272,
340,
1687,
365,
440,
488,
12,
372,
715,
340,
314,
1687,
365,
402,
314,
3211,
730,
14,
272,
340,
1687,
365,
488,
12,
372,
282,
2400,
805,
1314,
1630,
314,
730,
7907,
14,
523,
408,
523,
340,
1228,
8,
411,
63,
1313,
12,
1059,
63,
1313,
304,
272,
1687,
63,
1313,
275,
334,
411,
63,
1313,
9,
523,
340,
1687,
365,
488,
26,
272,
372,
2400,
1687,
26,
1687,
14,
932,
63,
318,
14,
411,
315,
1687,
63,
1313,
523,
587,
26,
272,
372,
1687,
14,
932,
63,
318,
14,
411,
315,
1687,
63,
1313,
421,
199,
533,
9319,
16073,
8,
785,
304,
523,
408,
4578,
1336,
1021,
1041,
819,
347,
636,
826,
721,
277,
12,
7317,
63,
1541,
304,
272,
408,
4578,
1336,
3787,
1041,
272,
291,
14,
8965,
63,
4273,
275,
942,
272,
291,
14,
1210,
63,
411,
63,
6742,
275,
488,
272,
291,
14,
2785,
63,
1210,
63,
411,
63,
6742,
275,
488,
272,
291,
14,
1199,
63,
411,
63,
6742,
275,
488,
272,
7317,
63,
1541,
275,
291,
423,
14450,
63,
8965,
63,
1541,
8,
8965,
63,
1541,
9,
272,
291,
14,
8965,
63,
4273,
14,
740,
8,
8965,
63,
1541,
9,
819,
347,
485,
14450,
63,
8965,
63,
1541,
8,
277,
12,
6193,
304,
272,
408,
7306,
370,
282,
2457,
805,
1041,
272,
340,
3504,
14,
2425,
63,
1235,
63,
3821,
8,
6086,
304,
489,
5163,
63,
275,
3504,
14,
1875,
63,
3821,
8,
6086,
9,
489,
372,
2400,
1687,
12,
5163,
29,
3821,
10388,
5163,
14,
1733,
8,
411,
14,
354,
9,
365,
440,
488,
272,
916,
1228,
8,
6086,
12,
2833,
63,
1483,
14,
6044,
304,
489,
372,
2400,
1687,
12,
1336,
63,
411,
29,
6086,
26,
1687,
365,
1336,
63,
411,
272,
916,
4550,
8,
6086,
304,
489,
372,
6193,
272,
916,
6193,
365,
715,
26,
489,
372,
2400,
1687,
26,
715,
272,
587,
26,
489,
746,
1722,
480,
6612,
17284,
314,
7317,
2457,
26,
8352,
908,
8,
6086,
430,
819,
347,
636,
1250,
721,
277,
12,
1687,
304,
272,
408,
25002,
340,
314,
1687,
4450,
503,
440,
1041,
272,
340,
440,
1228,
8,
411,
12,
2833,
63,
1483,
14,
6044,
304,
489,
746,
3146,
480,
13495,
2833,
14,
6044,
12,
4788,
26,
8352,
908,
8,
466,
8,
411,
1724,
272,
367,
7317,
63,
1541,
315,
291,
14,
8965,
63,
4273,
26,
489,
340,
440,
7317,
63,
1541,
8,
411,
304,
267,
372,
756,
272,
340,
291,
14,
1210,
63,
411,
63,
6742,
365,
440,
488,
26,
489,
340,
822,
8,
411,
14,
3711,
9,
1137,
822,
8,
277,
14,
1210,
63,
411,
63,
6742,
304,
267,
372,
756,
489,
367,
1324,
63,
84,
12,
1324,
63,
411,
63,
1431,
315,
3482,
8,
411,
14,
3711,
12,
291,
14,
1210,
63,
411,
63,
6742,
304,
267,
340,
1324,
63,
411,
63,
1431,
365,
488,
26,
881,
1980,
267,
340,
440,
1324,
63,
411,
63,
1431,
8,
1210,
63,
84,
14,
411,
304,
881,
372,
756,
272,
340,
291,
14,
2785,
63,
1210,
63,
411,
63,
6742,
365,
440,
488,
26,
489,
340,
822,
8,
411,
14,
2785,
63,
3711,
9,
1137,
822,
8,
277,
14,
2785,
63,
1210,
63,
411,
63,
6742,
304,
267,
372,
756,
489,
367,
286,
1210,
63,
411,
12,
286,
1210,
63,
411,
63,
1431,
315,
3482,
8,
411,
14,
2785,
63,
3711,
12,
4490,
291,
14,
2785,
63,
1210,
63,
411,
63,
6742,
304,
267,
340,
286,
1210,
63,
411,
63,
1431,
365,
488,
26,
881,
1980,
267,
340,
440,
286,
1210,
63,
411,
63,
1431,
8,
67,
1210,
63,
411,
304,
881,
372,
756,
272,
340,
291,
14,
1199,
63,
411,
63,
6742,
365,
440,
488,
26,
489,
340,
822,
8,
411,
14,
4467,
9,
1137,
822,
8,
277,
14,
1199,
63,
411,
63,
6742,
304,
267,
372,
756,
489,
367,
1072,
63,
84,
12,
1072,
63,
411,
63,
6742,
315,
3482,
8,
411,
14,
4467,
12,
6163,
291,
14,
1199,
63,
411,
63,
6742,
304,
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,
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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
] |
meabsence/python-for-android
|
python3-alpha/extra_modules/gdata/calendar/data.py
|
121
|
9852
|
#!/usr/bin/python
#
# Copyright (C) 2009 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.
"""Contains the data classes of the Google Calendar Data API"""
__author__ = 'j.s@google.com (Jeff Scudder)'
import atom.core
import atom.data
import gdata.acl.data
import gdata.data
import gdata.geo.data
import gdata.opensearch.data
GCAL_NAMESPACE = 'http://schemas.google.com/gCal/2005'
GCAL_TEMPLATE = '{%s}%%s' % GCAL_NAMESPACE
WEB_CONTENT_LINK_REL = '%s/%s' % (GCAL_NAMESPACE, 'webContent')
class AccessLevelProperty(atom.core.XmlElement):
"""Describes how much a given user may do with an event or calendar"""
_qname = GCAL_TEMPLATE % 'accesslevel'
value = 'value'
class AllowGSync2Property(atom.core.XmlElement):
"""Whether the user is permitted to run Google Apps Sync"""
_qname = GCAL_TEMPLATE % 'allowGSync2'
value = 'value'
class AllowGSyncProperty(atom.core.XmlElement):
"""Whether the user is permitted to run Google Apps Sync"""
_qname = GCAL_TEMPLATE % 'allowGSync'
value = 'value'
class AnyoneCanAddSelfProperty(atom.core.XmlElement):
"""Whether anyone can add self as attendee"""
_qname = GCAL_TEMPLATE % 'anyoneCanAddSelf'
value = 'value'
class CalendarAclRole(gdata.acl.data.AclRole):
"""Describes the Calendar roles of an entry in the Calendar access control list"""
_qname = gdata.acl.data.GACL_TEMPLATE % 'role'
class CalendarCommentEntry(gdata.data.GDEntry):
"""Describes an entry in a feed of a Calendar event's comments"""
class CalendarCommentFeed(gdata.data.GDFeed):
"""Describes feed of a Calendar event's comments"""
entry = [CalendarCommentEntry]
class CalendarComments(gdata.data.Comments):
"""Describes a container of a feed link for Calendar comment entries"""
_qname = gdata.data.GD_TEMPLATE % 'comments'
class CalendarExtendedProperty(gdata.data.ExtendedProperty):
"""Defines a value for the realm attribute that is used only in the calendar API"""
_qname = gdata.data.GD_TEMPLATE % 'extendedProperty'
class CalendarWhere(gdata.data.Where):
"""Extends the base Where class with Calendar extensions"""
_qname = gdata.data.GD_TEMPLATE % 'where'
class ColorProperty(atom.core.XmlElement):
"""Describes the color of a calendar"""
_qname = GCAL_TEMPLATE % 'color'
value = 'value'
class GuestsCanInviteOthersProperty(atom.core.XmlElement):
"""Whether guests can invite others to the event"""
_qname = GCAL_TEMPLATE % 'guestsCanInviteOthers'
value = 'value'
class GuestsCanModifyProperty(atom.core.XmlElement):
"""Whether guests can modify event"""
_qname = GCAL_TEMPLATE % 'guestsCanModify'
value = 'value'
class GuestsCanSeeGuestsProperty(atom.core.XmlElement):
"""Whether guests can see other attendees"""
_qname = GCAL_TEMPLATE % 'guestsCanSeeGuests'
value = 'value'
class HiddenProperty(atom.core.XmlElement):
"""Describes whether a calendar is hidden"""
_qname = GCAL_TEMPLATE % 'hidden'
value = 'value'
class IcalUIDProperty(atom.core.XmlElement):
"""Describes the UID in the ical export of the event"""
_qname = GCAL_TEMPLATE % 'uid'
value = 'value'
class OverrideNameProperty(atom.core.XmlElement):
"""Describes the override name property of a calendar"""
_qname = GCAL_TEMPLATE % 'overridename'
value = 'value'
class PrivateCopyProperty(atom.core.XmlElement):
"""Indicates whether this is a private copy of the event, changes to which should not be sent to other calendars"""
_qname = GCAL_TEMPLATE % 'privateCopy'
value = 'value'
class QuickAddProperty(atom.core.XmlElement):
"""Describes whether gd:content is for quick-add processing"""
_qname = GCAL_TEMPLATE % 'quickadd'
value = 'value'
class ResourceProperty(atom.core.XmlElement):
"""Describes whether gd:who is a resource such as a conference room"""
_qname = GCAL_TEMPLATE % 'resource'
value = 'value'
id = 'id'
class EventWho(gdata.data.Who):
"""Extends the base Who class with Calendar extensions"""
_qname = gdata.data.GD_TEMPLATE % 'who'
resource = ResourceProperty
class SelectedProperty(atom.core.XmlElement):
"""Describes whether a calendar is selected"""
_qname = GCAL_TEMPLATE % 'selected'
value = 'value'
class SendAclNotificationsProperty(atom.core.XmlElement):
"""Describes whether to send ACL notifications to grantees"""
_qname = GCAL_TEMPLATE % 'sendAclNotifications'
value = 'value'
class CalendarAclEntry(gdata.acl.data.AclEntry):
"""Describes an entry in a feed of a Calendar access control list (ACL)"""
send_acl_notifications = SendAclNotificationsProperty
class CalendarAclFeed(gdata.data.GDFeed):
"""Describes a Calendar access contorl list (ACL) feed"""
entry = [CalendarAclEntry]
class SendEventNotificationsProperty(atom.core.XmlElement):
"""Describes whether to send event notifications to other participants of the event"""
_qname = GCAL_TEMPLATE % 'sendEventNotifications'
value = 'value'
class SequenceNumberProperty(atom.core.XmlElement):
"""Describes sequence number of an event"""
_qname = GCAL_TEMPLATE % 'sequence'
value = 'value'
class CalendarRecurrenceExceptionEntry(gdata.data.GDEntry):
"""Describes an entry used by a Calendar recurrence exception entry link"""
uid = IcalUIDProperty
sequence = SequenceNumberProperty
class CalendarRecurrenceException(gdata.data.RecurrenceException):
"""Describes an exception to a recurring Calendar event"""
_qname = gdata.data.GD_TEMPLATE % 'recurrenceException'
class SettingsProperty(atom.core.XmlElement):
"""User preference name-value pair"""
_qname = GCAL_TEMPLATE % 'settingsProperty'
name = 'name'
value = 'value'
class SettingsEntry(gdata.data.GDEntry):
"""Describes a Calendar Settings property entry"""
settings_property = SettingsProperty
class CalendarSettingsFeed(gdata.data.GDFeed):
"""Personal settings for Calendar application"""
entry = [SettingsEntry]
class SuppressReplyNotificationsProperty(atom.core.XmlElement):
"""Lists notification methods to be suppressed for this reply"""
_qname = GCAL_TEMPLATE % 'suppressReplyNotifications'
methods = 'methods'
class SyncEventProperty(atom.core.XmlElement):
"""Describes whether this is a sync scenario where the Ical UID and Sequence number are honored during inserts and updates"""
_qname = GCAL_TEMPLATE % 'syncEvent'
value = 'value'
class When(gdata.data.When):
"""Extends the gd:when element to add reminders"""
reminder = [gdata.data.Reminder]
class CalendarEventEntry(gdata.data.BatchEntry):
"""Describes a Calendar event entry"""
quick_add = QuickAddProperty
send_event_notifications = SendEventNotificationsProperty
sync_event = SyncEventProperty
anyone_can_add_self = AnyoneCanAddSelfProperty
extended_property = [CalendarExtendedProperty]
sequence = SequenceNumberProperty
guests_can_invite_others = GuestsCanInviteOthersProperty
guests_can_modify = GuestsCanModifyProperty
guests_can_see_guests = GuestsCanSeeGuestsProperty
georss_where = gdata.geo.data.GeoRssWhere
private_copy = PrivateCopyProperty
suppress_reply_notifications = SuppressReplyNotificationsProperty
uid = IcalUIDProperty
where = [gdata.data.Where]
when = [When]
who = [gdata.data.Who]
transparency = gdata.data.Transparency
comments = gdata.data.Comments
event_status = gdata.data.EventStatus
visibility = gdata.data.Visibility
recurrence = gdata.data.Recurrence
recurrence_exception = [gdata.data.RecurrenceException]
original_event = gdata.data.OriginalEvent
reminder = [gdata.data.Reminder]
class TimeZoneProperty(atom.core.XmlElement):
"""Describes the time zone of a calendar"""
_qname = GCAL_TEMPLATE % 'timezone'
value = 'value'
class TimesCleanedProperty(atom.core.XmlElement):
"""Describes how many times calendar was cleaned via Manage Calendars"""
_qname = GCAL_TEMPLATE % 'timesCleaned'
value = 'value'
class CalendarEntry(gdata.data.GDEntry):
"""Describes a Calendar entry in the feed of a user's calendars"""
timezone = TimeZoneProperty
overridename = OverrideNameProperty
hidden = HiddenProperty
selected = SelectedProperty
times_cleaned = TimesCleanedProperty
color = ColorProperty
where = [CalendarWhere]
accesslevel = AccessLevelProperty
class CalendarEventFeed(gdata.data.BatchFeed):
"""Describes a Calendar event feed"""
allow_g_sync2 = AllowGSync2Property
timezone = TimeZoneProperty
entry = [CalendarEventEntry]
times_cleaned = TimesCleanedProperty
allow_g_sync = AllowGSyncProperty
class CalendarFeed(gdata.data.GDFeed):
"""Describes a feed of Calendars"""
entry = [CalendarEntry]
class WebContentGadgetPref(atom.core.XmlElement):
"""Describes a single web content gadget preference"""
_qname = GCAL_TEMPLATE % 'webContentGadgetPref'
name = 'name'
value = 'value'
class WebContent(atom.core.XmlElement):
"""Describes a "web content" extension"""
_qname = GCAL_TEMPLATE % 'webContent'
height = 'height'
width = 'width'
web_content_gadget_pref = [WebContentGadgetPref]
url = 'url'
display = 'display'
class WebContentLink(atom.data.Link):
"""Describes a "web content" link"""
def __init__(self, title=None, href=None, link_type=None,
web_content=None):
atom.data.Link.__init__(self, rel=WEB_CONTENT_LINK_REL, title=title, href=href,
link_type=link_type)
web_content = WebContent
|
apache-2.0
|
[
3381,
2647,
15,
1393,
15,
1548,
199,
3,
199,
3,
1898,
334,
35,
9,
8937,
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,
421,
199,
624,
6906,
314,
666,
3992,
402,
314,
4475,
27779,
3918,
3261,
624,
421,
199,
363,
2502,
363,
275,
283,
74,
14,
83,
32,
3098,
14,
957,
334,
42,
3609,
13916,
1181,
424,
3171,
421,
199,
646,
6222,
14,
1018,
199,
646,
6222,
14,
576,
199,
646,
11006,
14,
5853,
14,
576,
199,
646,
11006,
14,
576,
199,
646,
11006,
14,
6721,
14,
576,
199,
646,
11006,
14,
27285,
14,
576,
421,
199,
7484,
748,
63,
13001,
275,
283,
1014,
921,
9482,
14,
3098,
14,
957,
15,
71,
6584,
15,
9397,
7,
199,
7484,
748,
63,
7433,
275,
12100,
83,
93,
8530,
83,
7,
450,
598,
13329,
63,
13001,
199,
13166,
63,
9663,
63,
7916,
63,
13604,
275,
1543,
83,
3149,
83,
7,
450,
334,
7484,
748,
63,
13001,
12,
283,
2520,
2714,
358,
421,
199,
533,
11003,
4670,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
16320,
11562,
4212,
8298,
282,
1627,
922,
1443,
886,
543,
376,
1566,
503,
11234,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
2732,
1896,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
9812,
8021,
1870,
18,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
314,
922,
365,
8211,
370,
1255,
4475,
4693,
83,
22407,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
3306,
8021,
1870,
18,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
9812,
8021,
1870,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
314,
922,
365,
8211,
370,
1255,
4475,
4693,
83,
22407,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
3306,
8021,
1870,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
6184,
368,
6049,
1123,
12887,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
29165,
883,
1050,
291,
465,
22624,
11192,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
1629,
368,
6049,
1123,
12887,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
27779,
23937,
7422,
8,
15275,
14,
5853,
14,
576,
14,
23937,
7422,
304,
523,
408,
16320,
11562,
314,
27779,
11689,
402,
376,
2397,
315,
314,
27779,
2879,
3304,
769,
624,
523,
485,
12333,
275,
11006,
14,
5853,
14,
576,
14,
39,
18765,
63,
7433,
450,
283,
3756,
7,
421,
199,
533,
27779,
7488,
3900,
8,
15275,
14,
576,
14,
39,
1093,
3410,
304,
523,
408,
16320,
11562,
376,
2397,
315,
282,
4733,
402,
282,
27779,
1566,
1159,
6786,
624,
421,
199,
533,
27779,
7488,
7658,
8,
15275,
14,
576,
14,
27046,
7658,
304,
523,
408,
16320,
11562,
4733,
402,
282,
27779,
1566,
1159,
6786,
624,
523,
2397,
275,
359,
18688,
7488,
3900,
61,
421,
199,
533,
27779,
18929,
8,
15275,
14,
576,
14,
18929,
304,
523,
408,
16320,
11562,
282,
3970,
402,
282,
4733,
2142,
367,
27779,
3721,
4811,
624,
523,
485,
12333,
275,
11006,
14,
576,
14,
27046,
63,
7433,
450,
283,
6223,
7,
421,
199,
533,
27779,
14107,
3697,
8,
15275,
14,
576,
14,
14107,
3697,
304,
523,
408,
23891,
282,
574,
367,
314,
10482,
2225,
626,
365,
1202,
1454,
315,
314,
11234,
3261,
624,
523,
485,
12333,
275,
11006,
14,
576,
14,
27046,
63,
7433,
450,
283,
10525,
3697,
7,
421,
199,
533,
27779,
26493,
8,
15275,
14,
576,
14,
26493,
304,
523,
408,
4377,
795,
314,
1300,
17685,
1021,
543,
27779,
5478,
624,
523,
485,
12333,
275,
11006,
14,
576,
14,
27046,
63,
7433,
450,
283,
4509,
7,
421,
199,
533,
11581,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
16320,
11562,
314,
3164,
402,
282,
11234,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
2326,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
598,
5291,
83,
6049,
607,
13187,
8632,
83,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
13980,
83,
883,
24542,
11789,
370,
314,
1566,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
10409,
83,
6049,
607,
13187,
8632,
83,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
598,
5291,
83,
6049,
18357,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
13980,
83,
883,
2811,
1566,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
10409,
83,
6049,
18357,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
598,
5291,
83,
6049,
9295,
16022,
83,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
13980,
83,
883,
1937,
1163,
22624,
271,
397,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
10409,
83,
6049,
9295,
16022,
83,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
26401,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
16320,
11562,
3775,
282,
11234,
365,
8752,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
5642,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
473,
915,
6685,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
16320,
11562,
314,
20746,
315,
314,
284,
915,
4843,
402,
314,
1566,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
1535,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
11041,
985,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
16320,
11562,
314
] |
[
2647,
15,
1393,
15,
1548,
199,
3,
199,
3,
1898,
334,
35,
9,
8937,
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,
421,
199,
624,
6906,
314,
666,
3992,
402,
314,
4475,
27779,
3918,
3261,
624,
421,
199,
363,
2502,
363,
275,
283,
74,
14,
83,
32,
3098,
14,
957,
334,
42,
3609,
13916,
1181,
424,
3171,
421,
199,
646,
6222,
14,
1018,
199,
646,
6222,
14,
576,
199,
646,
11006,
14,
5853,
14,
576,
199,
646,
11006,
14,
576,
199,
646,
11006,
14,
6721,
14,
576,
199,
646,
11006,
14,
27285,
14,
576,
421,
199,
7484,
748,
63,
13001,
275,
283,
1014,
921,
9482,
14,
3098,
14,
957,
15,
71,
6584,
15,
9397,
7,
199,
7484,
748,
63,
7433,
275,
12100,
83,
93,
8530,
83,
7,
450,
598,
13329,
63,
13001,
199,
13166,
63,
9663,
63,
7916,
63,
13604,
275,
1543,
83,
3149,
83,
7,
450,
334,
7484,
748,
63,
13001,
12,
283,
2520,
2714,
358,
421,
199,
533,
11003,
4670,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
16320,
11562,
4212,
8298,
282,
1627,
922,
1443,
886,
543,
376,
1566,
503,
11234,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
2732,
1896,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
9812,
8021,
1870,
18,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
314,
922,
365,
8211,
370,
1255,
4475,
4693,
83,
22407,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
3306,
8021,
1870,
18,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
9812,
8021,
1870,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
314,
922,
365,
8211,
370,
1255,
4475,
4693,
83,
22407,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
3306,
8021,
1870,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
6184,
368,
6049,
1123,
12887,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
29165,
883,
1050,
291,
465,
22624,
11192,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
1629,
368,
6049,
1123,
12887,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
27779,
23937,
7422,
8,
15275,
14,
5853,
14,
576,
14,
23937,
7422,
304,
523,
408,
16320,
11562,
314,
27779,
11689,
402,
376,
2397,
315,
314,
27779,
2879,
3304,
769,
624,
523,
485,
12333,
275,
11006,
14,
5853,
14,
576,
14,
39,
18765,
63,
7433,
450,
283,
3756,
7,
421,
199,
533,
27779,
7488,
3900,
8,
15275,
14,
576,
14,
39,
1093,
3410,
304,
523,
408,
16320,
11562,
376,
2397,
315,
282,
4733,
402,
282,
27779,
1566,
1159,
6786,
624,
421,
199,
533,
27779,
7488,
7658,
8,
15275,
14,
576,
14,
27046,
7658,
304,
523,
408,
16320,
11562,
4733,
402,
282,
27779,
1566,
1159,
6786,
624,
523,
2397,
275,
359,
18688,
7488,
3900,
61,
421,
199,
533,
27779,
18929,
8,
15275,
14,
576,
14,
18929,
304,
523,
408,
16320,
11562,
282,
3970,
402,
282,
4733,
2142,
367,
27779,
3721,
4811,
624,
523,
485,
12333,
275,
11006,
14,
576,
14,
27046,
63,
7433,
450,
283,
6223,
7,
421,
199,
533,
27779,
14107,
3697,
8,
15275,
14,
576,
14,
14107,
3697,
304,
523,
408,
23891,
282,
574,
367,
314,
10482,
2225,
626,
365,
1202,
1454,
315,
314,
11234,
3261,
624,
523,
485,
12333,
275,
11006,
14,
576,
14,
27046,
63,
7433,
450,
283,
10525,
3697,
7,
421,
199,
533,
27779,
26493,
8,
15275,
14,
576,
14,
26493,
304,
523,
408,
4377,
795,
314,
1300,
17685,
1021,
543,
27779,
5478,
624,
523,
485,
12333,
275,
11006,
14,
576,
14,
27046,
63,
7433,
450,
283,
4509,
7,
421,
199,
533,
11581,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
16320,
11562,
314,
3164,
402,
282,
11234,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
2326,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
598,
5291,
83,
6049,
607,
13187,
8632,
83,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
13980,
83,
883,
24542,
11789,
370,
314,
1566,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
10409,
83,
6049,
607,
13187,
8632,
83,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
598,
5291,
83,
6049,
18357,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
13980,
83,
883,
2811,
1566,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
10409,
83,
6049,
18357,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
598,
5291,
83,
6049,
9295,
16022,
83,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
26625,
13980,
83,
883,
1937,
1163,
22624,
271,
397,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
10409,
83,
6049,
9295,
16022,
83,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
26401,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
16320,
11562,
3775,
282,
11234,
365,
8752,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
5642,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
473,
915,
6685,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
16320,
11562,
314,
20746,
315,
314,
284,
915,
4843,
402,
314,
1566,
624,
523,
485,
12333,
275,
598,
13329,
63,
7433,
450,
283,
1535,
7,
523,
574,
275,
283,
585,
7,
421,
199,
533,
11041,
985,
3697,
8,
4188,
14,
1018,
14,
26928,
304,
523,
408,
16320,
11562,
314,
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,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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
] |
freedomhui/cinder
|
cinder/tests/image/fake.py
|
4
|
8738
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Justin Santa Barbara
# Copyright 2012 OpenStack LLC
# 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.
"""Implementation of a fake image service"""
import copy
import datetime
from cinder import exception
from cinder import flags
import cinder.image.glance
from cinder.openstack.common import log as logging
from cinder import utils
LOG = logging.getLogger(__name__)
FLAGS = flags.FLAGS
class _FakeImageService(object):
"""Mock (fake) image service for unit testing."""
def __init__(self):
self.images = {}
# NOTE(justinsb): The OpenStack API can't upload an image?
# So, make sure we've got one..
timestamp = datetime.datetime(2011, 01, 01, 01, 02, 03)
image1 = {'id': '155d900f-4e14-4e4c-a73d-069cbf4541e6',
'name': 'fakeimage123456',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': False,
'container_format': 'raw',
'disk_format': 'raw',
'properties': {'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel',
'architecture': 'x86_64'}}
image2 = {'id': 'a2459075-d96c-40d5-893e-577ff92e721c',
'name': 'fakeimage123456',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': True,
'container_format': 'ami',
'disk_format': 'ami',
'properties': {'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel'}}
image3 = {'id': '76fa36fc-c930-4bf3-8c8a-ea2a2420deb6',
'name': 'fakeimage123456',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': True,
'container_format': None,
'disk_format': None,
'properties': {'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel'}}
image4 = {'id': 'cedef40a-ed67-4d10-800e-17455edce175',
'name': 'fakeimage123456',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': True,
'container_format': 'ami',
'disk_format': 'ami',
'properties': {'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel'}}
image5 = {'id': 'c905cedb-7281-47e4-8a62-f26bc5fc4c77',
'name': 'fakeimage123456',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': True,
'container_format': 'ami',
'disk_format': 'ami',
'properties': {'kernel_id':
'155d900f-4e14-4e4c-a73d-069cbf4541e6',
'ramdisk_id': None}}
image6 = {'id': 'a440c04b-79fa-479c-bed1-0b816eaec379',
'name': 'fakeimage6',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': False,
'container_format': 'ova',
'disk_format': 'vhd',
'properties': {'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel',
'architecture': 'x86_64',
'auto_disk_config': 'False'}}
image7 = {'id': '70a599e0-31e7-49b7-b260-868f441e862b',
'name': 'fakeimage7',
'created_at': timestamp,
'updated_at': timestamp,
'deleted_at': None,
'deleted': False,
'status': 'active',
'is_public': False,
'container_format': 'ova',
'disk_format': 'vhd',
'properties': {'kernel_id': 'nokernel',
'ramdisk_id': 'nokernel',
'architecture': 'x86_64',
'auto_disk_config': 'True'}}
self.create(None, image1)
self.create(None, image2)
self.create(None, image3)
self.create(None, image4)
self.create(None, image5)
self.create(None, image6)
self.create(None, image7)
self._imagedata = {}
super(_FakeImageService, self).__init__()
#TODO(bcwaldon): implement optional kwargs such as limit, sort_dir
def detail(self, context, **kwargs):
"""Return list of detailed image information."""
return copy.deepcopy(self.images.values())
def download(self, context, image_id, data):
self.show(context, image_id)
data.write(self._imagedata.get(image_id, ''))
def show(self, context, image_id):
"""Get data about specified image.
Returns a dict containing image data for the given opaque image id.
"""
image = self.images.get(str(image_id))
if image:
return copy.deepcopy(image)
LOG.warn('Unable to find image id %s. Have images: %s',
image_id, self.images)
raise exception.ImageNotFound(image_id=image_id)
def create(self, context, metadata, data=None):
"""Store the image data and return the new image id.
:raises: Duplicate if the image already exist.
"""
image_id = str(metadata.get('id', utils.gen_uuid()))
metadata['id'] = image_id
if image_id in self.images:
raise exception.Duplicate()
self.images[image_id] = copy.deepcopy(metadata)
if data:
self._imagedata[image_id] = data.read()
return self.images[image_id]
def update(self, context, image_id, metadata, data=None,
purge_props=False):
"""Replace the contents of the given image with the new data.
:raises: ImageNotFound if the image does not exist.
"""
if not self.images.get(image_id):
raise exception.ImageNotFound(image_id=image_id)
if purge_props:
self.images[image_id] = copy.deepcopy(metadata)
else:
image = self.images[image_id]
try:
image['properties'].update(metadata.pop('properties'))
except Exception:
pass
image.update(metadata)
return self.images[image_id]
def delete(self, context, image_id):
"""Delete the given image.
:raises: ImageNotFound if the image does not exist.
"""
removed = self.images.pop(image_id, None)
if not removed:
raise exception.ImageNotFound(image_id=image_id)
def get_location(self, context, image_id):
if image_id in self.images:
return 'fake_location'
return None
_fakeImageService = _FakeImageService()
def FakeImageService():
return _fakeImageService
def FakeImageService_reset():
global _fakeImageService
_fakeImageService = _FakeImageService()
def stub_out_image_service(stubs):
def fake_get_remote_image_service(context, image_href):
return (FakeImageService(), image_href)
stubs.Set(cinder.image.glance, 'get_remote_image_service',
lambda x, y: (FakeImageService(), y))
stubs.Set(cinder.image.glance, 'get_default_image_service',
lambda: FakeImageService())
|
apache-2.0
|
[
3,
6695,
26,
20849,
29,
20,
20105,
29,
20,
25966,
29,
20,
199,
199,
3,
1898,
7760,
13870,
262,
29359,
502,
12377,
1700,
65,
199,
3,
1898,
6029,
14260,
20376,
199,
3,
2900,
5924,
5702,
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,
624,
7921,
402,
282,
4026,
1834,
2435,
624,
199,
199,
646,
1331,
199,
646,
2197,
199,
199,
504,
13069,
492,
1919,
199,
504,
13069,
492,
3285,
199,
646,
13069,
14,
1569,
14,
18773,
199,
504,
13069,
14,
8512,
14,
2330,
492,
943,
465,
2050,
199,
504,
13069,
492,
3778,
421,
199,
4947,
275,
2050,
14,
5572,
3460,
354,
3368,
421,
199,
4831,
275,
3285,
14,
4831,
421,
199,
533,
485,
8249,
3491,
3167,
8,
785,
304,
272,
408,
3346,
334,
3183,
9,
1834,
2435,
367,
4137,
5343,
1041,
339,
347,
636,
826,
721,
277,
304,
267,
291,
14,
4782,
275,
1052,
267,
327,
6944,
8,
4764,
3617,
66,
304,
710,
14260,
3261,
883,
1133,
5802,
376,
1834,
31,
267,
327,
2002,
12,
1852,
3238,
781,
9064,
4788,
1373,
703,
267,
4913,
275,
2197,
14,
2083,
8,
8128,
12,
17163,
12,
17163,
12,
17163,
12,
12497,
12,
30569,
9,
398,
1834,
17,
275,
791,
344,
356,
283,
11520,
68,
17518,
70,
13,
20,
69,
1079,
13,
20,
69,
20,
67,
13,
65,
2898,
68,
13,
18264,
2894,
70,
12383,
17,
69,
22,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
756,
12,
326,
283,
3600,
63,
908,
356,
283,
1773,
297,
326,
283,
4032,
63,
908,
356,
283,
1773,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
283,
78,
745,
11526,
297,
1816,
283,
26541,
63,
344,
356,
283,
78,
745,
11526,
297,
1816,
283,
19134,
356,
283,
88,
1184,
63,
772,
18620,
398,
1834,
18,
275,
791,
344,
356,
283,
65,
1194,
1427,
19339,
13,
68,
2534,
67,
13,
2167,
68,
21,
13,
14590,
69,
13,
13539,
556,
2942,
69,
23,
2025,
67,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
283,
13496,
297,
326,
283,
4032,
63,
908,
356,
283,
13496,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
283,
78,
745,
11526,
297,
1816,
283,
26541,
63,
344,
356,
283,
78,
745,
11526,
18620,
398,
1834,
19,
275,
791,
344,
356,
283,
2114,
667,
1344,
3003,
13,
67,
25,
1216,
13,
20,
4361,
19,
13,
24,
67,
24,
65,
13,
4489,
18,
65,
1194,
1165,
16762,
22,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
488,
12,
326,
283,
4032,
63,
908,
356,
488,
12,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
283,
78,
745,
11526,
297,
1816,
283,
26541,
63,
344,
356,
283,
78,
745,
11526,
18620,
398,
1834,
20,
275,
791,
344,
356,
283,
301,
318,
2167,
65,
13,
379,
1822,
13,
20,
68,
709,
13,
6718,
69,
13,
9892,
1229,
379,
301,
10848,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
283,
13496,
297,
326,
283,
4032,
63,
908,
356,
283,
13496,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
283,
78,
745,
11526,
297,
1816,
283,
26541,
63,
344,
356,
283,
78,
745,
11526,
18620,
398,
1834,
21,
275,
791,
344,
356,
283,
67,
29888,
301,
697,
13,
23,
16263,
13,
2417,
69,
20,
13,
24,
65,
2789,
13,
70,
1479,
3776,
21,
3003,
20,
67,
1138,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
283,
13496,
297,
326,
283,
4032,
63,
908,
356,
283,
13496,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
2511,
283,
11520,
68,
17518,
70,
13,
20,
69,
1079,
13,
20,
69,
20,
67,
13,
65,
2898,
68,
13,
18264,
2894,
70,
12383,
17,
69,
22,
297,
1816,
283,
26541,
63,
344,
356,
488,
4863,
398,
1834,
22,
275,
791,
344,
356,
283,
65,
14162,
67,
966,
66,
13,
1965,
667,
13,
14847,
67,
13,
6123,
17,
13,
16
] |
[
6695,
26,
20849,
29,
20,
20105,
29,
20,
25966,
29,
20,
199,
199,
3,
1898,
7760,
13870,
262,
29359,
502,
12377,
1700,
65,
199,
3,
1898,
6029,
14260,
20376,
199,
3,
2900,
5924,
5702,
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,
624,
7921,
402,
282,
4026,
1834,
2435,
624,
199,
199,
646,
1331,
199,
646,
2197,
199,
199,
504,
13069,
492,
1919,
199,
504,
13069,
492,
3285,
199,
646,
13069,
14,
1569,
14,
18773,
199,
504,
13069,
14,
8512,
14,
2330,
492,
943,
465,
2050,
199,
504,
13069,
492,
3778,
421,
199,
4947,
275,
2050,
14,
5572,
3460,
354,
3368,
421,
199,
4831,
275,
3285,
14,
4831,
421,
199,
533,
485,
8249,
3491,
3167,
8,
785,
304,
272,
408,
3346,
334,
3183,
9,
1834,
2435,
367,
4137,
5343,
1041,
339,
347,
636,
826,
721,
277,
304,
267,
291,
14,
4782,
275,
1052,
267,
327,
6944,
8,
4764,
3617,
66,
304,
710,
14260,
3261,
883,
1133,
5802,
376,
1834,
31,
267,
327,
2002,
12,
1852,
3238,
781,
9064,
4788,
1373,
703,
267,
4913,
275,
2197,
14,
2083,
8,
8128,
12,
17163,
12,
17163,
12,
17163,
12,
12497,
12,
30569,
9,
398,
1834,
17,
275,
791,
344,
356,
283,
11520,
68,
17518,
70,
13,
20,
69,
1079,
13,
20,
69,
20,
67,
13,
65,
2898,
68,
13,
18264,
2894,
70,
12383,
17,
69,
22,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
756,
12,
326,
283,
3600,
63,
908,
356,
283,
1773,
297,
326,
283,
4032,
63,
908,
356,
283,
1773,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
283,
78,
745,
11526,
297,
1816,
283,
26541,
63,
344,
356,
283,
78,
745,
11526,
297,
1816,
283,
19134,
356,
283,
88,
1184,
63,
772,
18620,
398,
1834,
18,
275,
791,
344,
356,
283,
65,
1194,
1427,
19339,
13,
68,
2534,
67,
13,
2167,
68,
21,
13,
14590,
69,
13,
13539,
556,
2942,
69,
23,
2025,
67,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
283,
13496,
297,
326,
283,
4032,
63,
908,
356,
283,
13496,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
283,
78,
745,
11526,
297,
1816,
283,
26541,
63,
344,
356,
283,
78,
745,
11526,
18620,
398,
1834,
19,
275,
791,
344,
356,
283,
2114,
667,
1344,
3003,
13,
67,
25,
1216,
13,
20,
4361,
19,
13,
24,
67,
24,
65,
13,
4489,
18,
65,
1194,
1165,
16762,
22,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
488,
12,
326,
283,
4032,
63,
908,
356,
488,
12,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
283,
78,
745,
11526,
297,
1816,
283,
26541,
63,
344,
356,
283,
78,
745,
11526,
18620,
398,
1834,
20,
275,
791,
344,
356,
283,
301,
318,
2167,
65,
13,
379,
1822,
13,
20,
68,
709,
13,
6718,
69,
13,
9892,
1229,
379,
301,
10848,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
283,
13496,
297,
326,
283,
4032,
63,
908,
356,
283,
13496,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
283,
78,
745,
11526,
297,
1816,
283,
26541,
63,
344,
356,
283,
78,
745,
11526,
18620,
398,
1834,
21,
275,
791,
344,
356,
283,
67,
29888,
301,
697,
13,
23,
16263,
13,
2417,
69,
20,
13,
24,
65,
2789,
13,
70,
1479,
3776,
21,
3003,
20,
67,
1138,
297,
326,
283,
354,
356,
283,
3183,
1569,
19060,
297,
326,
283,
3966,
63,
292,
356,
4913,
12,
326,
283,
5334,
63,
292,
356,
4913,
12,
326,
283,
6062,
63,
292,
356,
488,
12,
326,
283,
6062,
356,
756,
12,
326,
283,
1205,
356,
283,
2682,
297,
326,
283,
374,
63,
3455,
356,
715,
12,
326,
283,
3600,
63,
908,
356,
283,
13496,
297,
326,
283,
4032,
63,
908,
356,
283,
13496,
297,
326,
283,
3282,
356,
791,
4989,
63,
344,
356,
2511,
283,
11520,
68,
17518,
70,
13,
20,
69,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